@walletconnect/ethereum-provider 2.15.2 → 2.15.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(pn,Wr){typeof exports=="object"&&typeof module<"u"?Wr(exports):typeof define=="function"&&define.amd?define(["exports"],Wr):(pn=typeof globalThis<"u"?globalThis:pn||self,Wr(pn["@walletconnect/ethereum-provider"]={}))})(this,function(pn){"use strict";var Wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function u0(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var Br={exports:{}},xa=typeof Reflect=="object"?Reflect:null,Og=xa&&typeof xa.apply=="function"?xa.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},yf;xa&&typeof xa.ownKeys=="function"?yf=xa.ownKeys:Object.getOwnPropertySymbols?yf=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:yf=function(e){return Object.getOwnPropertyNames(e)};function Lw(t){console&&console.warn&&console.warn(t)}var Pg=Number.isNaN||function(e){return e!==e};function Jt(){Jt.init.call(this)}Br.exports=Jt,Br.exports.once=kw,Jt.EventEmitter=Jt,Jt.prototype._events=void 0,Jt.prototype._eventsCount=0,Jt.prototype._maxListeners=void 0;var $g=10;function wf(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Jt,"defaultMaxListeners",{enumerable:!0,get:function(){return $g},set:function(t){if(typeof t!="number"||t<0||Pg(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");$g=t}}),Jt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Jt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Pg(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Rg(t){return t._maxListeners===void 0?Jt.defaultMaxListeners:t._maxListeners}Jt.prototype.getMaxListeners=function(){return Rg(this)},Jt.prototype.emit=function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")Og(l,this,r);else for(var d=l.length,b=Fg(l,d),i=0;i<d;++i)Og(b[i],this,r);return!0};function Ng(t,e,r,i){var n,s,a;if(wf(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),a=s[e]),a===void 0)a=s[e]=r,++t._eventsCount;else if(typeof a=="function"?a=s[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),n=Rg(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,Lw(u)}return t}Jt.prototype.addListener=function(e,r){return Ng(this,e,r,!1)},Jt.prototype.on=Jt.prototype.addListener,Jt.prototype.prependListener=function(e,r){return Ng(this,e,r,!0)};function Bw(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Tg(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Bw.bind(i);return n.listener=r,i.wrapFn=n,n}Jt.prototype.once=function(e,r){return wf(r),this.on(e,Tg(this,e,r)),this},Jt.prototype.prependOnceListener=function(e,r){return wf(r),this.prependListener(e,Tg(this,e,r)),this},Jt.prototype.removeListener=function(e,r){var i,n,s,a,u;if(wf(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(s=-1,a=i.length-1;a>=0;a--)if(i[a]===r||i[a].listener===r){u=i[a].listener,s=a;break}if(s<0)return this;s===0?i.shift():Fw(i,s),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,u||r)}return this},Jt.prototype.off=Jt.prototype.removeListener,Jt.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),a;for(n=0;n<s.length;++n)a=s[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this};function Lg(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?Uw(n):Fg(n,n.length)}Jt.prototype.listeners=function(e){return Lg(this,e,!0)},Jt.prototype.rawListeners=function(e){return Lg(this,e,!1)},Jt.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Bg.call(t,e)},Jt.prototype.listenerCount=Bg;function Bg(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Jt.prototype.eventNames=function(){return this._eventsCount>0?yf(this._events):[]};function Fg(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function Fw(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Uw(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function kw(t,e){return new Promise(function(r,i){function n(a){t.removeListener(e,s),i(a)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}Ug(t,e,s,{once:!0}),e!=="error"&&jw(t,n,{once:!0})})}function jw(t,e,r){typeof t.on=="function"&&Ug(t,"error",e,r)}function Ug(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function n(s){i.once&&t.removeEventListener(e,n),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var kg=function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},qw=function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t}(),zw=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),Hw=function(){function t(e,r,i,n){this.name=e,this.version=r,this.os=i,this.bot=n,this.type="bot-device"}return t}(),Kw=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Ww=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Vw=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Gw=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,jg=3,Yw=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Vw]],qg=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Jw(t){return t?zg(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Ww:typeof navigator<"u"?zg(navigator.userAgent):Xw()}function Qw(t){return t!==""&&Yw.reduce(function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]},!1)}function zg(t){var e=Qw(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new Kw;var n=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);n?n.length<jg&&(n=kg(kg([],n,!0),e4(jg-n.length),!0)):n=[];var s=n.join("."),a=Zw(t),u=Gw.exec(t);return u&&u[1]?new Hw(r,s,a,u[1]):new qw(r,s,a)}function Zw(t){for(var e=0,r=qg.length;e<r;e++){var i=qg[e],n=i[0],s=i[1],a=s.exec(t);if(a)return n}return null}function Xw(){var t=typeof process<"u"&&process.version;return t?new zw(process.version.slice(1)):null}function e4(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Ie={};/*! *****************************************************************************
1
+ (function(pn,Wr){typeof exports=="object"&&typeof module<"u"?Wr(exports):typeof define=="function"&&define.amd?define(["exports"],Wr):(pn=typeof globalThis<"u"?globalThis:pn||self,Wr(pn["@walletconnect/ethereum-provider"]={}))})(this,function(pn){"use strict";var Wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Rw(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function f0(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var Br={exports:{}},xa=typeof Reflect=="object"?Reflect:null,Og=xa&&typeof xa.apply=="function"?xa.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},yf;xa&&typeof xa.ownKeys=="function"?yf=xa.ownKeys:Object.getOwnPropertySymbols?yf=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:yf=function(e){return Object.getOwnPropertyNames(e)};function Nw(t){console&&console.warn&&console.warn(t)}var Pg=Number.isNaN||function(e){return e!==e};function Jt(){Jt.init.call(this)}Br.exports=Jt,Br.exports.once=Fw,Jt.EventEmitter=Jt,Jt.prototype._events=void 0,Jt.prototype._eventsCount=0,Jt.prototype._maxListeners=void 0;var $g=10;function wf(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(Jt,"defaultMaxListeners",{enumerable:!0,get:function(){return $g},set:function(t){if(typeof t!="number"||t<0||Pg(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");$g=t}}),Jt.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Jt.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Pg(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Rg(t){return t._maxListeners===void 0?Jt.defaultMaxListeners:t._maxListeners}Jt.prototype.getMaxListeners=function(){return Rg(this)},Jt.prototype.emit=function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var u=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw u.context=a,u}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")Og(l,this,r);else for(var d=l.length,b=Fg(l,d),i=0;i<d;++i)Og(b[i],this,r);return!0};function Ng(t,e,r,i){var n,s,a;if(wf(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),a=s[e]),a===void 0)a=s[e]=r,++t._eventsCount;else if(typeof a=="function"?a=s[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),n=Rg(t),n>0&&a.length>n&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,Nw(u)}return t}Jt.prototype.addListener=function(e,r){return Ng(this,e,r,!1)},Jt.prototype.on=Jt.prototype.addListener,Jt.prototype.prependListener=function(e,r){return Ng(this,e,r,!0)};function Tw(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Tg(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Tw.bind(i);return n.listener=r,i.wrapFn=n,n}Jt.prototype.once=function(e,r){return wf(r),this.on(e,Tg(this,e,r)),this},Jt.prototype.prependOnceListener=function(e,r){return wf(r),this.prependListener(e,Tg(this,e,r)),this},Jt.prototype.removeListener=function(e,r){var i,n,s,a,u;if(wf(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(s=-1,a=i.length-1;a>=0;a--)if(i[a]===r||i[a].listener===r){u=i[a].listener,s=a;break}if(s<0)return this;s===0?i.shift():Lw(i,s),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,u||r)}return this},Jt.prototype.off=Jt.prototype.removeListener,Jt.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),a;for(n=0;n<s.length;++n)a=s[n],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this};function Lg(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?Bw(n):Fg(n,n.length)}Jt.prototype.listeners=function(e){return Lg(this,e,!0)},Jt.prototype.rawListeners=function(e){return Lg(this,e,!1)},Jt.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Bg.call(t,e)},Jt.prototype.listenerCount=Bg;function Bg(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}Jt.prototype.eventNames=function(){return this._eventsCount>0?yf(this._events):[]};function Fg(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function Lw(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Bw(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Fw(t,e){return new Promise(function(r,i){function n(a){t.removeListener(e,s),i(a)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}Ug(t,e,s,{once:!0}),e!=="error"&&Uw(t,n,{once:!0})})}function Uw(t,e,r){typeof t.on=="function"&&Ug(t,"error",e,r)}function Ug(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function n(s){i.once&&t.removeEventListener(e,n),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}var kg=function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},kw=function(){function t(e,r,i){this.name=e,this.version=r,this.os=i,this.type="browser"}return t}(),jw=function(){function t(e){this.version=e,this.type="node",this.name="node",this.os=process.platform}return t}(),qw=function(){function t(e,r,i,n){this.name=e,this.version=r,this.os=i,this.bot=n,this.type="bot-device"}return t}(),zw=function(){function t(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return t}(),Hw=function(){function t(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return t}(),Kw=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,Ww=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,jg=3,Vw=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",Kw]],qg=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function Gw(t){return t?zg(t):typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new Hw:typeof navigator<"u"?zg(navigator.userAgent):Qw()}function Yw(t){return t!==""&&Vw.reduce(function(e,r){var i=r[0],n=r[1];if(e)return e;var s=n.exec(t);return!!s&&[i,s]},!1)}function zg(t){var e=Yw(t);if(!e)return null;var r=e[0],i=e[1];if(r==="searchbot")return new zw;var n=i[1]&&i[1].split(".").join("_").split("_").slice(0,3);n?n.length<jg&&(n=kg(kg([],n,!0),Zw(jg-n.length),!0)):n=[];var s=n.join("."),a=Jw(t),u=Ww.exec(t);return u&&u[1]?new qw(r,s,a,u[1]):new kw(r,s,a)}function Jw(t){for(var e=0,r=qg.length;e<r;e++){var i=qg[e],n=i[0],s=i[1],a=s.exec(t);if(a)return n}return null}function Qw(){var t=typeof process<"u"&&process.version;return t?new jw(process.version.slice(1)):null}function Zw(t){for(var e=[],r=0;r<t;r++)e.push("0");return e}var Ie={};/*! *****************************************************************************
2
2
  Copyright (c) Microsoft Corporation.
3
3
 
4
4
  Permission to use, copy, modify, and/or distribute this software for any
@@ -11,23 +11,23 @@
11
11
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
12
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
13
  PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */var f0=function(t,e){return f0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},f0(t,e)};function t4(t,e){f0(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var h0=function(){return h0=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},h0.apply(this,arguments)};function r4(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function i4(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(s=(n<3?a(s):n>3?a(e,r,s):a(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function n4(t,e){return function(r,i){e(r,i,t)}}function s4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function o4(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(b){try{d(i.next(b))}catch(w){a(w)}}function l(b){try{d(i.throw(b))}catch(w){a(w)}}function d(b){b.done?s(b.value):n(b.value).then(u,l)}d((i=i.apply(t,e||[])).next())})}function a4(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(d){return function(b){return l([d,b])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=d[0]&2?n.return:d[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,d[1])).done)return s;switch(n=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,n=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(b){d=[6,b],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function c4(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function u4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function l0(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Hg(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function f4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Hg(arguments[e]));return t}function h4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],a=0,u=s.length;a<u;a++,n++)i[n]=s[a];return i}function Kc(t){return this instanceof Kc?(this.v=t,this):new Kc(t)}function l4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(S){i[S]&&(n[S]=function(I){return new Promise(function(D,L){s.push([S,I,D,L])>1||u(S,I)})})}function u(S,I){try{l(i[S](I))}catch(D){w(s[0][3],D)}}function l(S){S.value instanceof Kc?Promise.resolve(S.value.v).then(d,b):w(s[0][2],S)}function d(S){u("next",S)}function b(S){u("throw",S)}function w(S,I){S(I),s.shift(),s.length&&u(s[0][0],s[0][1])}}function d4(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(a){return(r=!r)?{value:Kc(t[n](a)),done:n==="return"}:s?s(a):a}:s}}function p4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof l0=="function"?l0(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(a){return new Promise(function(u,l){a=t[s](a),n(u,l,a.done,a.value)})}}function n(s,a,u,l){Promise.resolve(l).then(function(d){s({value:d,done:u})},a)}}function g4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function v4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function m4(t){return t&&t.__esModule?t:{default:t}}function b4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function y4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var w4=Object.freeze({__proto__:null,__extends:t4,get __assign(){return h0},__rest:r4,__decorate:i4,__param:n4,__metadata:s4,__awaiter:o4,__generator:a4,__createBinding:c4,__exportStar:u4,__values:l0,__read:Hg,__spread:f4,__spreadArrays:h4,__await:Kc,__asyncGenerator:l4,__asyncDelegator:d4,__asyncValues:p4,__makeTemplateObject:g4,__importStar:v4,__importDefault:m4,__classPrivateFieldGet:b4,__classPrivateFieldSet:y4}),_f=u0(w4),d0={},Wc={},Kg;function _4(){if(Kg)return Wc;Kg=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Wc.delay=t,Wc}var Co={},p0={},Do={},Wg;function E4(){return Wg||(Wg=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.ONE_THOUSAND=Do.ONE_HUNDRED=void 0,Do.ONE_HUNDRED=100,Do.ONE_THOUSAND=1e3),Do}var g0={},Vg;function A4(){return Vg||(Vg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(g0)),g0}var Gg;function Yg(){return Gg||(Gg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=_f;e.__exportStar(E4(),t),e.__exportStar(A4(),t)}(p0)),p0}var Jg;function x4(){if(Jg)return Co;Jg=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.fromMiliseconds=Co.toMiliseconds=void 0;const t=Yg();function e(i){return i*t.ONE_THOUSAND}Co.toMiliseconds=e;function r(i){return Math.floor(i/t.ONE_THOUSAND)}return Co.fromMiliseconds=r,Co}var Qg;function S4(){return Qg||(Qg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=_f;e.__exportStar(_4(),t),e.__exportStar(x4(),t)}(d0)),d0}var Sa={},Zg;function I4(){if(Zg)return Sa;Zg=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const i=this.get(r);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const n=Date.now()-i.started;this.timestamps.set(r,{started:i.started,elapsed:n})}get(r){const i=this.timestamps.get(r);if(typeof i>"u")throw new Error(`No timestamp found for label: ${r}`);return i}elapsed(r){const i=this.get(r);return i.elapsed||Date.now()-i.started}}return Sa.Watch=t,Sa.default=t,Sa}var v0={},Vc={},Xg;function M4(){if(Xg)return Vc;Xg=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.IWatch=void 0;class t{}return Vc.IWatch=t,Vc}var e2;function C4(){return e2||(e2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),_f.__exportStar(M4(),t)}(v0)),v0}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=_f;e.__exportStar(S4(),t),e.__exportStar(I4(),t),e.__exportStar(C4(),t),e.__exportStar(Yg(),t)})(Ie);var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.getLocalStorage=rr.getLocalStorageOrThrow=rr.getCrypto=rr.getCryptoOrThrow=t2=rr.getLocation=rr.getLocationOrThrow=b0=rr.getNavigator=rr.getNavigatorOrThrow=m0=rr.getDocument=rr.getDocumentOrThrow=rr.getFromWindowOrThrow=rr.getFromWindow=void 0;function Oo(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}rr.getFromWindow=Oo;function Ia(t){const e=Oo(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}rr.getFromWindowOrThrow=Ia;function D4(){return Ia("document")}rr.getDocumentOrThrow=D4;function O4(){return Oo("document")}var m0=rr.getDocument=O4;function P4(){return Ia("navigator")}rr.getNavigatorOrThrow=P4;function $4(){return Oo("navigator")}var b0=rr.getNavigator=$4;function R4(){return Ia("location")}rr.getLocationOrThrow=R4;function N4(){return Oo("location")}var t2=rr.getLocation=N4;function T4(){return Ia("crypto")}rr.getCryptoOrThrow=T4;function L4(){return Oo("crypto")}rr.getCrypto=L4;function B4(){return Ia("localStorage")}rr.getLocalStorageOrThrow=B4;function F4(){return Oo("localStorage")}rr.getLocalStorage=F4;var y0={};Object.defineProperty(y0,"__esModule",{value:!0});var r2=y0.getWindowMetadata=void 0;const i2=rr;function U4(){let t,e;try{t=i2.getDocumentOrThrow(),e=i2.getLocationOrThrow()}catch{return null}function r(){const w=t.getElementsByTagName("link"),S=[];for(let I=0;I<w.length;I++){const D=w[I],L=D.getAttribute("rel");if(L&&L.toLowerCase().indexOf("icon")>-1){const K=D.getAttribute("href");if(K)if(K.toLowerCase().indexOf("https:")===-1&&K.toLowerCase().indexOf("http:")===-1&&K.indexOf("//")!==0){let H=e.protocol+"//"+e.host;if(K.indexOf("/")===0)H+=K;else{const U=e.pathname.split("/");U.pop();const W=U.join("/");H+=W+"/"+K}S.push(H)}else if(K.indexOf("//")===0){const H=e.protocol+K;S.push(H)}else S.push(K)}}return S}function i(...w){const S=t.getElementsByTagName("meta");for(let I=0;I<S.length;I++){const D=S[I],L=["itemprop","property","name"].map(K=>D.getAttribute(K)).filter(K=>K?w.includes(K):!1);if(L.length&&L){const K=D.getAttribute("content");if(K)return K}}return""}function n(){let w=i("name","og:site_name","og:title","twitter:title");return w||(w=t.title),w}function s(){return i("description","og:description","twitter:description","keywords")}const a=n(),u=s(),l=e.origin,d=r();return{description:u,url:l,icons:d,name:a}}r2=y0.getWindowMetadata=U4;var Gc={},k4=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),n2="%[a-f0-9]{2}",s2=new RegExp("("+n2+")|([^%]+?)","gi"),o2=new RegExp("("+n2+")+","gi");function w0(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),i=t.slice(e);return Array.prototype.concat.call([],w0(r),w0(i))}function j4(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(s2)||[],r=1;r<e.length;r++)t=w0(e,r).join(""),e=t.match(s2)||[];return t}}function q4(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=o2.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var i=j4(r[0]);i!==r[0]&&(e[r[0]]=i)}r=o2.exec(t)}e["%C2"]="\uFFFD";for(var n=Object.keys(e),s=0;s<n.length;s++){var a=n[s];t=t.replace(new RegExp(a,"g"),e[a])}return t}var z4=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return q4(t)}},H4=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},K4=function(t,e){for(var r={},i=Object.keys(t),n=Array.isArray(e),s=0;s<i.length;s++){var a=i[s],u=t[a];(n?e.indexOf(a)!==-1:e(a,u,t))&&(r[a]=u)}return r};(function(t){const e=k4,r=z4,i=H4,n=K4,s=U=>U==null,a=Symbol("encodeFragmentIdentifier");function u(U){switch(U.arrayFormat){case"index":return W=>(R,k)=>{const z=R.length;return k===void 0||U.skipNull&&k===null||U.skipEmptyString&&k===""?R:k===null?[...R,[b(W,U),"[",z,"]"].join("")]:[...R,[b(W,U),"[",b(z,U),"]=",b(k,U)].join("")]};case"bracket":return W=>(R,k)=>k===void 0||U.skipNull&&k===null||U.skipEmptyString&&k===""?R:k===null?[...R,[b(W,U),"[]"].join("")]:[...R,[b(W,U),"[]=",b(k,U)].join("")];case"colon-list-separator":return W=>(R,k)=>k===void 0||U.skipNull&&k===null||U.skipEmptyString&&k===""?R:k===null?[...R,[b(W,U),":list="].join("")]:[...R,[b(W,U),":list=",b(k,U)].join("")];case"comma":case"separator":case"bracket-separator":{const W=U.arrayFormat==="bracket-separator"?"[]=":"=";return R=>(k,z)=>z===void 0||U.skipNull&&z===null||U.skipEmptyString&&z===""?k:(z=z===null?"":z,k.length===0?[[b(R,U),W,b(z,U)].join("")]:[[k,b(z,U)].join(U.arrayFormatSeparator)])}default:return W=>(R,k)=>k===void 0||U.skipNull&&k===null||U.skipEmptyString&&k===""?R:k===null?[...R,b(W,U)]:[...R,[b(W,U),"=",b(k,U)].join("")]}}function l(U){let W;switch(U.arrayFormat){case"index":return(R,k,z)=>{if(W=/\[(\d*)\]$/.exec(R),R=R.replace(/\[\d*\]$/,""),!W){z[R]=k;return}z[R]===void 0&&(z[R]={}),z[R][W[1]]=k};case"bracket":return(R,k,z)=>{if(W=/(\[\])$/.exec(R),R=R.replace(/\[\]$/,""),!W){z[R]=k;return}if(z[R]===void 0){z[R]=[k];return}z[R]=[].concat(z[R],k)};case"colon-list-separator":return(R,k,z)=>{if(W=/(:list)$/.exec(R),R=R.replace(/:list$/,""),!W){z[R]=k;return}if(z[R]===void 0){z[R]=[k];return}z[R]=[].concat(z[R],k)};case"comma":case"separator":return(R,k,z)=>{const _=typeof k=="string"&&k.includes(U.arrayFormatSeparator),B=typeof k=="string"&&!_&&w(k,U).includes(U.arrayFormatSeparator);k=B?w(k,U):k;const X=_||B?k.split(U.arrayFormatSeparator).map(re=>w(re,U)):k===null?k:w(k,U);z[R]=X};case"bracket-separator":return(R,k,z)=>{const _=/(\[\])$/.test(R);if(R=R.replace(/\[\]$/,""),!_){z[R]=k&&w(k,U);return}const B=k===null?[]:k.split(U.arrayFormatSeparator).map(X=>w(X,U));if(z[R]===void 0){z[R]=B;return}z[R]=[].concat(z[R],B)};default:return(R,k,z)=>{if(z[R]===void 0){z[R]=k;return}z[R]=[].concat(z[R],k)}}}function d(U){if(typeof U!="string"||U.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(U,W){return W.encode?W.strict?e(U):encodeURIComponent(U):U}function w(U,W){return W.decode?r(U):U}function S(U){return Array.isArray(U)?U.sort():typeof U=="object"?S(Object.keys(U)).sort((W,R)=>Number(W)-Number(R)).map(W=>U[W]):U}function I(U){const W=U.indexOf("#");return W!==-1&&(U=U.slice(0,W)),U}function D(U){let W="";const R=U.indexOf("#");return R!==-1&&(W=U.slice(R)),W}function L(U){U=I(U);const W=U.indexOf("?");return W===-1?"":U.slice(W+1)}function K(U,W){return W.parseNumbers&&!Number.isNaN(Number(U))&&typeof U=="string"&&U.trim()!==""?U=Number(U):W.parseBooleans&&U!==null&&(U.toLowerCase()==="true"||U.toLowerCase()==="false")&&(U=U.toLowerCase()==="true"),U}function H(U,W){W=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},W),d(W.arrayFormatSeparator);const R=l(W),k=Object.create(null);if(typeof U!="string"||(U=U.trim().replace(/^[?#&]/,""),!U))return k;for(const z of U.split("&")){if(z==="")continue;let[_,B]=i(W.decode?z.replace(/\+/g," "):z,"=");B=B===void 0?null:["comma","separator","bracket-separator"].includes(W.arrayFormat)?B:w(B,W),R(w(_,W),B,k)}for(const z of Object.keys(k)){const _=k[z];if(typeof _=="object"&&_!==null)for(const B of Object.keys(_))_[B]=K(_[B],W);else k[z]=K(_,W)}return W.sort===!1?k:(W.sort===!0?Object.keys(k).sort():Object.keys(k).sort(W.sort)).reduce((z,_)=>{const B=k[_];return B&&typeof B=="object"&&!Array.isArray(B)?z[_]=S(B):z[_]=B,z},Object.create(null))}t.extract=L,t.parse=H,t.stringify=(U,W)=>{if(!U)return"";W=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},W),d(W.arrayFormatSeparator);const R=B=>W.skipNull&&s(U[B])||W.skipEmptyString&&U[B]==="",k=u(W),z={};for(const B of Object.keys(U))R(B)||(z[B]=U[B]);const _=Object.keys(z);return W.sort!==!1&&_.sort(W.sort),_.map(B=>{const X=U[B];return X===void 0?"":X===null?b(B,W):Array.isArray(X)?X.length===0&&W.arrayFormat==="bracket-separator"?b(B,W)+"[]":X.reduce(k(B),[]).join("&"):b(B,W)+"="+b(X,W)}).filter(B=>B.length>0).join("&")},t.parseUrl=(U,W)=>{W=Object.assign({decode:!0},W);const[R,k]=i(U,"#");return Object.assign({url:R.split("?")[0]||"",query:H(L(U),W)},W&&W.parseFragmentIdentifier&&k?{fragmentIdentifier:w(k,W)}:{})},t.stringifyUrl=(U,W)=>{W=Object.assign({encode:!0,strict:!0,[a]:!0},W);const R=I(U.url).split("?")[0]||"",k=t.extract(U.url),z=t.parse(k,{sort:!1}),_=Object.assign(z,U.query);let B=t.stringify(_,W);B&&(B=`?${B}`);let X=D(U.url);return U.fragmentIdentifier&&(X=`#${W[a]?b(U.fragmentIdentifier,W):U.fragmentIdentifier}`),`${R}${B}${X}`},t.pick=(U,W,R)=>{R=Object.assign({parseFragmentIdentifier:!0,[a]:!1},R);const{url:k,query:z,fragmentIdentifier:_}=t.parseUrl(U,R);return t.stringifyUrl({url:k,query:n(z,W),fragmentIdentifier:_},R)},t.exclude=(U,W,R)=>{const k=Array.isArray(W)?z=>!W.includes(z):(z,_)=>!W(z,_);return t.pick(U,k,R)}})(Gc);var _0={},Ef={},wt={},a2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(u,l){var d=u>>>16&65535,b=u&65535,w=l>>>16&65535,S=l&65535;return b*S+(d*S+b*w<<16>>>0)|0}t.mul=Math.imul||e;function r(u,l){return u+l|0}t.add=r;function i(u,l){return u-l|0}t.sub=i;function n(u,l){return u<<l|u>>>32-l}t.rotl=n;function s(u,l){return u<<32-l|u>>>l}t.rotr=s;function a(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}t.isInteger=Number.isInteger||a,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(u){return t.isInteger(u)&&u>=-t.MAX_SAFE_INTEGER&&u<=t.MAX_SAFE_INTEGER}})(a2),Object.defineProperty(wt,"__esModule",{value:!0});var c2=a2;function W4(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}wt.readInt16BE=W4;function V4(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}wt.readUint16BE=V4;function G4(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}wt.readInt16LE=G4;function Y4(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}wt.readUint16LE=Y4;function u2(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}wt.writeUint16BE=u2,wt.writeInt16BE=u2;function f2(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}wt.writeUint16LE=f2,wt.writeInt16LE=f2;function E0(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}wt.readInt32BE=E0;function A0(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}wt.readUint32BE=A0;function x0(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}wt.readInt32LE=x0;function S0(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}wt.readUint32LE=S0;function Af(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}wt.writeUint32BE=Af,wt.writeInt32BE=Af;function xf(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}wt.writeUint32LE=xf,wt.writeInt32LE=xf;function J4(t,e){e===void 0&&(e=0);var r=E0(t,e),i=E0(t,e+4);return r*4294967296+i-(i>>31)*4294967296}wt.readInt64BE=J4;function Q4(t,e){e===void 0&&(e=0);var r=A0(t,e),i=A0(t,e+4);return r*4294967296+i}wt.readUint64BE=Q4;function Z4(t,e){e===void 0&&(e=0);var r=x0(t,e),i=x0(t,e+4);return i*4294967296+r-(r>>31)*4294967296}wt.readInt64LE=Z4;function X4(t,e){e===void 0&&(e=0);var r=S0(t,e),i=S0(t,e+4);return i*4294967296+r}wt.readUint64LE=X4;function h2(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Af(t/4294967296>>>0,e,r),Af(t>>>0,e,r+4),e}wt.writeUint64BE=h2,wt.writeInt64BE=h2;function l2(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),xf(t>>>0,e,r),xf(t/4294967296>>>0,e,r+4),e}wt.writeUint64LE=l2,wt.writeInt64LE=l2;function e8(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,s=t/8+r-1;s>=r;s--)i+=e[s]*n,n*=256;return i}wt.readUintBE=e8;function t8(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=r;s<r+t/8;s++)i+=e[s]*n,n*=256;return i}wt.readUintLE=t8;function r8(t,e,r,i){if(r===void 0&&(r=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!c2.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var n=1,s=t/8+i-1;s>=i;s--)r[s]=e/n&255,n*=256;return r}wt.writeUintBE=r8;function i8(t,e,r,i){if(r===void 0&&(r=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!c2.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,s=i;s<i+t/8;s++)r[s]=e/n&255,n*=256;return r}wt.writeUintLE=i8;function n8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}wt.readFloat32BE=n8;function s8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}wt.readFloat32LE=s8;function o8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}wt.readFloat64BE=o8;function a8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}wt.readFloat64LE=a8;function c8(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(r,t),e}wt.writeFloat32BE=c8;function u8(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(r,t,!0),e}wt.writeFloat32LE=u8;function f8(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(r,t),e}wt.writeFloat64BE=f8;function h8(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(r,t,!0),e}wt.writeFloat64LE=h8;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});function l8(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Ri.wipe=l8,Object.defineProperty(Ef,"__esModule",{value:!0});var Vr=wt,I0=Ri,d8=20;function p8(t,e,r){for(var i=1634760805,n=857760878,s=2036477234,a=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],l=r[7]<<24|r[6]<<16|r[5]<<8|r[4],d=r[11]<<24|r[10]<<16|r[9]<<8|r[8],b=r[15]<<24|r[14]<<16|r[13]<<8|r[12],w=r[19]<<24|r[18]<<16|r[17]<<8|r[16],S=r[23]<<24|r[22]<<16|r[21]<<8|r[20],I=r[27]<<24|r[26]<<16|r[25]<<8|r[24],D=r[31]<<24|r[30]<<16|r[29]<<8|r[28],L=e[3]<<24|e[2]<<16|e[1]<<8|e[0],K=e[7]<<24|e[6]<<16|e[5]<<8|e[4],H=e[11]<<24|e[10]<<16|e[9]<<8|e[8],U=e[15]<<24|e[14]<<16|e[13]<<8|e[12],W=i,R=n,k=s,z=a,_=u,B=l,X=d,re=b,T=w,y=S,f=I,h=D,v=L,E=K,C=H,P=U,M=0;M<d8;M+=2)W=W+_|0,v^=W,v=v>>>32-16|v<<16,T=T+v|0,_^=T,_=_>>>32-12|_<<12,R=R+B|0,E^=R,E=E>>>32-16|E<<16,y=y+E|0,B^=y,B=B>>>32-12|B<<12,k=k+X|0,C^=k,C=C>>>32-16|C<<16,f=f+C|0,X^=f,X=X>>>32-12|X<<12,z=z+re|0,P^=z,P=P>>>32-16|P<<16,h=h+P|0,re^=h,re=re>>>32-12|re<<12,k=k+X|0,C^=k,C=C>>>32-8|C<<8,f=f+C|0,X^=f,X=X>>>32-7|X<<7,z=z+re|0,P^=z,P=P>>>32-8|P<<8,h=h+P|0,re^=h,re=re>>>32-7|re<<7,R=R+B|0,E^=R,E=E>>>32-8|E<<8,y=y+E|0,B^=y,B=B>>>32-7|B<<7,W=W+_|0,v^=W,v=v>>>32-8|v<<8,T=T+v|0,_^=T,_=_>>>32-7|_<<7,W=W+B|0,P^=W,P=P>>>32-16|P<<16,f=f+P|0,B^=f,B=B>>>32-12|B<<12,R=R+X|0,v^=R,v=v>>>32-16|v<<16,h=h+v|0,X^=h,X=X>>>32-12|X<<12,k=k+re|0,E^=k,E=E>>>32-16|E<<16,T=T+E|0,re^=T,re=re>>>32-12|re<<12,z=z+_|0,C^=z,C=C>>>32-16|C<<16,y=y+C|0,_^=y,_=_>>>32-12|_<<12,k=k+re|0,E^=k,E=E>>>32-8|E<<8,T=T+E|0,re^=T,re=re>>>32-7|re<<7,z=z+_|0,C^=z,C=C>>>32-8|C<<8,y=y+C|0,_^=y,_=_>>>32-7|_<<7,R=R+X|0,v^=R,v=v>>>32-8|v<<8,h=h+v|0,X^=h,X=X>>>32-7|X<<7,W=W+B|0,P^=W,P=P>>>32-8|P<<8,f=f+P|0,B^=f,B=B>>>32-7|B<<7;Vr.writeUint32LE(W+i|0,t,0),Vr.writeUint32LE(R+n|0,t,4),Vr.writeUint32LE(k+s|0,t,8),Vr.writeUint32LE(z+a|0,t,12),Vr.writeUint32LE(_+u|0,t,16),Vr.writeUint32LE(B+l|0,t,20),Vr.writeUint32LE(X+d|0,t,24),Vr.writeUint32LE(re+b|0,t,28),Vr.writeUint32LE(T+w|0,t,32),Vr.writeUint32LE(y+S|0,t,36),Vr.writeUint32LE(f+I|0,t,40),Vr.writeUint32LE(h+D|0,t,44),Vr.writeUint32LE(v+L|0,t,48),Vr.writeUint32LE(E+K|0,t,52),Vr.writeUint32LE(C+H|0,t,56),Vr.writeUint32LE(P+U|0,t,60)}function d2(t,e,r,i,n){if(n===void 0&&(n=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,a;if(n===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),a=s.length-e.length,s.set(e,a)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,a=n}for(var u=new Uint8Array(64),l=0;l<r.length;l+=64){p8(u,s,t);for(var d=l;d<l+64&&d<r.length;d++)i[d]=r[d]^u[d-l];v8(s,0,a)}return I0.wipe(u),n===0&&I0.wipe(s),i}Ef.streamXOR=d2;function g8(t,e,r,i){return i===void 0&&(i=0),I0.wipe(r),d2(t,e,r,r,i)}Ef.stream=g8;function v8(t,e,r){for(var i=1;r--;)i=i+(t[e]&255)|0,t[e]=i&255,i>>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var p2={},Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});function m8(t,e,r){return~(t-1)&e|t-1&r}Ys.select=m8;function b8(t,e){return(t|0)-(e|0)-1>>>31&1}Ys.lessOrEqual=b8;function g2(t,e){if(t.length!==e.length)return 0;for(var r=0,i=0;i<t.length;i++)r|=t[i]^e[i];return 1&r-1>>>8}Ys.compare=g2;function y8(t,e){return t.length===0||e.length===0?!1:g2(t,e)!==0}Ys.equal=y8,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ys,r=Ri;t.DIGEST_LENGTH=16;var i=function(){function a(u){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var l=u[0]|u[1]<<8;this._r[0]=l&8191;var d=u[2]|u[3]<<8;this._r[1]=(l>>>13|d<<3)&8191;var b=u[4]|u[5]<<8;this._r[2]=(d>>>10|b<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(b>>>7|w<<9)&8191;var S=u[8]|u[9]<<8;this._r[4]=(w>>>4|S<<12)&255,this._r[5]=S>>>1&8190;var I=u[10]|u[11]<<8;this._r[6]=(S>>>14|I<<2)&8191;var D=u[12]|u[13]<<8;this._r[7]=(I>>>11|D<<5)&8065;var L=u[14]|u[15]<<8;this._r[8]=(D>>>8|L<<8)&8191,this._r[9]=L>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return a.prototype._blocks=function(u,l,d){for(var b=this._fin?0:2048,w=this._h[0],S=this._h[1],I=this._h[2],D=this._h[3],L=this._h[4],K=this._h[5],H=this._h[6],U=this._h[7],W=this._h[8],R=this._h[9],k=this._r[0],z=this._r[1],_=this._r[2],B=this._r[3],X=this._r[4],re=this._r[5],T=this._r[6],y=this._r[7],f=this._r[8],h=this._r[9];d>=16;){var v=u[l+0]|u[l+1]<<8;w+=v&8191;var E=u[l+2]|u[l+3]<<8;S+=(v>>>13|E<<3)&8191;var C=u[l+4]|u[l+5]<<8;I+=(E>>>10|C<<6)&8191;var P=u[l+6]|u[l+7]<<8;D+=(C>>>7|P<<9)&8191;var M=u[l+8]|u[l+9]<<8;L+=(P>>>4|M<<12)&8191,K+=M>>>1&8191;var g=u[l+10]|u[l+11]<<8;H+=(M>>>14|g<<2)&8191;var m=u[l+12]|u[l+13]<<8;U+=(g>>>11|m<<5)&8191;var N=u[l+14]|u[l+15]<<8;W+=(m>>>8|N<<8)&8191,R+=N>>>5|b;var ee=0,ae=ee;ae+=w*k,ae+=S*(5*h),ae+=I*(5*f),ae+=D*(5*y),ae+=L*(5*T),ee=ae>>>13,ae&=8191,ae+=K*(5*re),ae+=H*(5*X),ae+=U*(5*B),ae+=W*(5*_),ae+=R*(5*z),ee+=ae>>>13,ae&=8191;var O=ee;O+=w*z,O+=S*k,O+=I*(5*h),O+=D*(5*f),O+=L*(5*y),ee=O>>>13,O&=8191,O+=K*(5*T),O+=H*(5*re),O+=U*(5*X),O+=W*(5*B),O+=R*(5*_),ee+=O>>>13,O&=8191;var te=ee;te+=w*_,te+=S*z,te+=I*k,te+=D*(5*h),te+=L*(5*f),ee=te>>>13,te&=8191,te+=K*(5*y),te+=H*(5*T),te+=U*(5*re),te+=W*(5*X),te+=R*(5*B),ee+=te>>>13,te&=8191;var q=ee;q+=w*B,q+=S*_,q+=I*z,q+=D*k,q+=L*(5*h),ee=q>>>13,q&=8191,q+=K*(5*f),q+=H*(5*y),q+=U*(5*T),q+=W*(5*re),q+=R*(5*X),ee+=q>>>13,q&=8191;var G=ee;G+=w*X,G+=S*B,G+=I*_,G+=D*z,G+=L*k,ee=G>>>13,G&=8191,G+=K*(5*h),G+=H*(5*f),G+=U*(5*y),G+=W*(5*T),G+=R*(5*re),ee+=G>>>13,G&=8191;var Y=ee;Y+=w*re,Y+=S*X,Y+=I*B,Y+=D*_,Y+=L*z,ee=Y>>>13,Y&=8191,Y+=K*k,Y+=H*(5*h),Y+=U*(5*f),Y+=W*(5*y),Y+=R*(5*T),ee+=Y>>>13,Y&=8191;var A=ee;A+=w*T,A+=S*re,A+=I*X,A+=D*B,A+=L*_,ee=A>>>13,A&=8191,A+=K*z,A+=H*k,A+=U*(5*h),A+=W*(5*f),A+=R*(5*y),ee+=A>>>13,A&=8191;var V=ee;V+=w*y,V+=S*T,V+=I*re,V+=D*X,V+=L*B,ee=V>>>13,V&=8191,V+=K*_,V+=H*z,V+=U*k,V+=W*(5*h),V+=R*(5*f),ee+=V>>>13,V&=8191;var oe=ee;oe+=w*f,oe+=S*y,oe+=I*T,oe+=D*re,oe+=L*X,ee=oe>>>13,oe&=8191,oe+=K*B,oe+=H*_,oe+=U*z,oe+=W*k,oe+=R*(5*h),ee+=oe>>>13,oe&=8191;var ue=ee;ue+=w*h,ue+=S*f,ue+=I*y,ue+=D*T,ue+=L*re,ee=ue>>>13,ue&=8191,ue+=K*X,ue+=H*B,ue+=U*_,ue+=W*z,ue+=R*k,ee+=ue>>>13,ue&=8191,ee=(ee<<2)+ee|0,ee=ee+ae|0,ae=ee&8191,ee=ee>>>13,O+=ee,w=ae,S=O,I=te,D=q,L=G,K=Y,H=A,U=V,W=oe,R=ue,l+=16,d-=16}this._h[0]=w,this._h[1]=S,this._h[2]=I,this._h[3]=D,this._h[4]=L,this._h[5]=K,this._h[6]=H,this._h[7]=U,this._h[8]=W,this._h[9]=R},a.prototype.finish=function(u,l){l===void 0&&(l=0);var d=new Uint16Array(10),b,w,S,I;if(this._leftover){for(I=this._leftover,this._buffer[I++]=1;I<16;I++)this._buffer[I]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(b=this._h[1]>>>13,this._h[1]&=8191,I=2;I<10;I++)this._h[I]+=b,b=this._h[I]>>>13,this._h[I]&=8191;for(this._h[0]+=b*5,b=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=b,b=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=b,d[0]=this._h[0]+5,b=d[0]>>>13,d[0]&=8191,I=1;I<10;I++)d[I]=this._h[I]+b,b=d[I]>>>13,d[I]&=8191;for(d[9]-=8192,w=(b^1)-1,I=0;I<10;I++)d[I]&=w;for(w=~w,I=0;I<10;I++)this._h[I]=this._h[I]&w|d[I];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,S=this._h[0]+this._pad[0],this._h[0]=S&65535,I=1;I<8;I++)S=(this._h[I]+this._pad[I]|0)+(S>>>16)|0,this._h[I]=S&65535;return u[l+0]=this._h[0]>>>0,u[l+1]=this._h[0]>>>8,u[l+2]=this._h[1]>>>0,u[l+3]=this._h[1]>>>8,u[l+4]=this._h[2]>>>0,u[l+5]=this._h[2]>>>8,u[l+6]=this._h[3]>>>0,u[l+7]=this._h[3]>>>8,u[l+8]=this._h[4]>>>0,u[l+9]=this._h[4]>>>8,u[l+10]=this._h[5]>>>0,u[l+11]=this._h[5]>>>8,u[l+12]=this._h[6]>>>0,u[l+13]=this._h[6]>>>8,u[l+14]=this._h[7]>>>0,u[l+15]=this._h[7]>>>8,this._finished=!0,this},a.prototype.update=function(u){var l=0,d=u.length,b;if(this._leftover){b=16-this._leftover,b>d&&(b=d);for(var w=0;w<b;w++)this._buffer[this._leftover+w]=u[l+w];if(d-=b,l+=b,this._leftover+=b,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(d>=16&&(b=d-d%16,this._blocks(u,l,b),l+=b,d-=b),d){for(var w=0;w<d;w++)this._buffer[this._leftover+w]=u[l+w];this._leftover+=d}return this},a.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},a.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},a}();t.Poly1305=i;function n(a,u){var l=new i(a);l.update(u);var d=l.digest();return l.clean(),d}t.oneTimeAuth=n;function s(a,u){return a.length!==t.DIGEST_LENGTH||u.length!==t.DIGEST_LENGTH?!1:e.equal(a,u)}t.equal=s}(p2),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ef,r=p2,i=Ri,n=wt,s=Ys;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var a=new Uint8Array(16),u=function(){function l(d){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,d.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(d)}return l.prototype.seal=function(d,b,w,S){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var I=new Uint8Array(16);I.set(d,I.length-d.length);var D=new Uint8Array(32);e.stream(this._key,I,D,4);var L=b.length+this.tagLength,K;if(S){if(S.length!==L)throw new Error("ChaCha20Poly1305: incorrect destination length");K=S}else K=new Uint8Array(L);return e.streamXOR(this._key,I,b,K,4),this._authenticate(K.subarray(K.length-this.tagLength,K.length),D,K.subarray(0,K.length-this.tagLength),w),i.wipe(I),K},l.prototype.open=function(d,b,w,S){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(b.length<this.tagLength)return null;var I=new Uint8Array(16);I.set(d,I.length-d.length);var D=new Uint8Array(32);e.stream(this._key,I,D,4);var L=new Uint8Array(this.tagLength);if(this._authenticate(L,D,b.subarray(0,b.length-this.tagLength),w),!s.equal(L,b.subarray(b.length-this.tagLength,b.length)))return null;var K=b.length-this.tagLength,H;if(S){if(S.length!==K)throw new Error("ChaCha20Poly1305: incorrect destination length");H=S}else H=new Uint8Array(K);return e.streamXOR(this._key,I,b.subarray(0,b.length-this.tagLength),H,4),i.wipe(I),H},l.prototype.clean=function(){return i.wipe(this._key),this},l.prototype._authenticate=function(d,b,w,S){var I=new r.Poly1305(b);S&&(I.update(S),S.length%16>0&&I.update(a.subarray(S.length%16))),I.update(w),w.length%16>0&&I.update(a.subarray(w.length%16));var D=new Uint8Array(8);S&&n.writeUint64LE(S.length,D),I.update(D),n.writeUint64LE(w.length,D),I.update(D);for(var L=I.digest(),K=0;K<L.length;K++)d[K]=L[K];I.clean(),i.wipe(L),i.wipe(D)},l}();t.ChaCha20Poly1305=u}(_0);var v2={},Yc={},M0={};Object.defineProperty(M0,"__esModule",{value:!0});function w8(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}M0.isSerializableHash=w8,Object.defineProperty(Yc,"__esModule",{value:!0});var Un=M0,_8=Ys,E8=Ri,m2=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(i).clean():i.set(r);for(var n=0;n<i.length;n++)i[n]^=54;this._inner.update(i);for(var n=0;n<i.length;n++)i[n]^=106;this._outer.update(i),Un.isSerializableHash(this._inner)&&Un.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),E8.wipe(i)}return t.prototype.reset=function(){if(!Un.isSerializableHash(this._inner)||!Un.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Un.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Un.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Un.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Un.isSerializableHash(this._inner)||!Un.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Un.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Yc.HMAC=m2;function A8(t,e,r){var i=new m2(t,e);i.update(r);var n=i.digest();return i.clean(),n}Yc.hmac=A8,Yc.equal=_8.equal,Object.defineProperty(v2,"__esModule",{value:!0});var b2=Yc,y2=Ri,x8=function(){function t(e,r,i,n){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=n;var s=b2.hmac(this._hash,i,r);this._hmac=new b2.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),i=0;i<r.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[i]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),y2.wipe(this._buffer),y2.wipe(this._counter),this._bufpos=0},t}(),S8=v2.HKDF=x8,Ma={},Sf={},If={};Object.defineProperty(If,"__esModule",{value:!0}),If.BrowserRandomSource=void 0;const w2=65536;class I8{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let i=0;i<r.length;i+=w2)this._crypto.getRandomValues(r.subarray(i,i+Math.min(r.length-i,w2)));return r}}If.BrowserRandomSource=I8;function M8(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Mf={},C8={},D8=Object.freeze({__proto__:null,default:C8}),C0=u0(D8);Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.NodeRandomSource=void 0;const O8=Ri;class P8{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof M8<"u"){const e=C0;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(e);for(let n=0;n<i.length;n++)i[n]=r[n];return(0,O8.wipe)(r),i}}Mf.NodeRandomSource=P8,Object.defineProperty(Sf,"__esModule",{value:!0}),Sf.SystemRandomSource=void 0;const $8=If,R8=Mf;class N8{constructor(){if(this.isAvailable=!1,this.name="",this._source=new $8.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new R8.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}Sf.SystemRandomSource=N8,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=Sf,r=wt,i=Ri;t.defaultRandomSource=new e.SystemRandomSource;function n(d,b=t.defaultRandomSource){return b.randomBytes(d)}t.randomBytes=n;function s(d=t.defaultRandomSource){const b=n(4,d),w=(0,r.readUint32LE)(b);return(0,i.wipe)(b),w}t.randomUint32=s;const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(d,b=a,w=t.defaultRandomSource){if(b.length<2)throw new Error("randomString charset is too short");if(b.length>256)throw new Error("randomString charset is too long");let S="";const I=b.length,D=256-256%I;for(;d>0;){const L=n(Math.ceil(d*256/D),w);for(let K=0;K<L.length&&d>0;K++){const H=L[K];H<D&&(S+=b.charAt(H%I),d--)}(0,i.wipe)(L)}return S}t.randomString=u;function l(d,b=a,w=t.defaultRandomSource){const S=Math.ceil(d/(Math.log(b.length)/Math.LN2));return u(S,b,w)}t.randomStringForEntropy=l}(Ma);var Jc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=wt,r=Ri;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var i=function(){function u(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},u.prototype.update=function(l,d){if(d===void 0&&(d=l.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var b=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&d>0;)this._buffer[this._bufferLength++]=l[b++],d--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(b=s(this._temp,this._state,l,b,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=l[b++],d--;return this},u.prototype.finish=function(l){if(!this._finished){var d=this._bytesHashed,b=this._bufferLength,w=d/536870912|0,S=d<<3,I=d%64<56?64:128;this._buffer[b]=128;for(var D=b+1;D<I-8;D++)this._buffer[D]=0;e.writeUint32BE(w,this._buffer,I-8),e.writeUint32BE(S,this._buffer,I-4),s(this._temp,this._state,this._buffer,0,I),this._finished=!0}for(var D=0;D<this.digestLength/4;D++)e.writeUint32BE(this._state[D],l,D*4);return this},u.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},u.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},u}();t.SHA256=i;var n=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(u,l,d,b,w){for(;w>=64;){for(var S=l[0],I=l[1],D=l[2],L=l[3],K=l[4],H=l[5],U=l[6],W=l[7],R=0;R<16;R++){var k=b+R*4;u[R]=e.readUint32BE(d,k)}for(var R=16;R<64;R++){var z=u[R-2],_=(z>>>17|z<<32-17)^(z>>>19|z<<32-19)^z>>>10;z=u[R-15];var B=(z>>>7|z<<32-7)^(z>>>18|z<<32-18)^z>>>3;u[R]=(_+u[R-7]|0)+(B+u[R-16]|0)}for(var R=0;R<64;R++){var _=(((K>>>6|K<<26)^(K>>>11|K<<21)^(K>>>25|K<<7))+(K&H^~K&U)|0)+(W+(n[R]+u[R]|0)|0)|0,B=((S>>>2|S<<32-2)^(S>>>13|S<<32-13)^(S>>>22|S<<32-22))+(S&I^S&D^I&D)|0;W=U,U=H,H=K,K=L+_|0,L=D,D=I,I=S,S=_+B|0}l[0]+=S,l[1]+=I,l[2]+=D,l[3]+=L,l[4]+=K,l[5]+=H,l[6]+=U,l[7]+=W,b+=64,w-=64}return b}function a(u){var l=new i;l.update(u);var d=l.digest();return l.clean(),d}t.hash=a})(Jc);var D0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Ma,r=Ri;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function i(R){const k=new Float64Array(16);if(R)for(let z=0;z<R.length;z++)k[z]=R[z];return k}const n=new Uint8Array(32);n[0]=9;const s=i([56129,1]);function a(R){let k=1;for(let z=0;z<16;z++){let _=R[z]+k+65535;k=Math.floor(_/65536),R[z]=_-k*65536}R[0]+=k-1+37*(k-1)}function u(R,k,z){const _=~(z-1);for(let B=0;B<16;B++){const X=_&(R[B]^k[B]);R[B]^=X,k[B]^=X}}function l(R,k){const z=i(),_=i();for(let B=0;B<16;B++)_[B]=k[B];a(_),a(_),a(_);for(let B=0;B<2;B++){z[0]=_[0]-65517;for(let re=1;re<15;re++)z[re]=_[re]-65535-(z[re-1]>>16&1),z[re-1]&=65535;z[15]=_[15]-32767-(z[14]>>16&1);const X=z[15]>>16&1;z[14]&=65535,u(_,z,1-X)}for(let B=0;B<16;B++)R[2*B]=_[B]&255,R[2*B+1]=_[B]>>8}function d(R,k){for(let z=0;z<16;z++)R[z]=k[2*z]+(k[2*z+1]<<8);R[15]&=32767}function b(R,k,z){for(let _=0;_<16;_++)R[_]=k[_]+z[_]}function w(R,k,z){for(let _=0;_<16;_++)R[_]=k[_]-z[_]}function S(R,k,z){let _,B,X=0,re=0,T=0,y=0,f=0,h=0,v=0,E=0,C=0,P=0,M=0,g=0,m=0,N=0,ee=0,ae=0,O=0,te=0,q=0,G=0,Y=0,A=0,V=0,oe=0,ue=0,he=0,ye=0,we=0,Re=0,Xe=0,Oe=0,Ne=z[0],Me=z[1],be=z[2],Pe=z[3],Te=z[4],ve=z[5],$e=z[6],xe=z[7],me=z[8],Ue=z[9],Ce=z[10],_e=z[11],Ke=z[12],Ve=z[13],Ae=z[14],We=z[15];_=k[0],X+=_*Ne,re+=_*Me,T+=_*be,y+=_*Pe,f+=_*Te,h+=_*ve,v+=_*$e,E+=_*xe,C+=_*me,P+=_*Ue,M+=_*Ce,g+=_*_e,m+=_*Ke,N+=_*Ve,ee+=_*Ae,ae+=_*We,_=k[1],re+=_*Ne,T+=_*Me,y+=_*be,f+=_*Pe,h+=_*Te,v+=_*ve,E+=_*$e,C+=_*xe,P+=_*me,M+=_*Ue,g+=_*Ce,m+=_*_e,N+=_*Ke,ee+=_*Ve,ae+=_*Ae,O+=_*We,_=k[2],T+=_*Ne,y+=_*Me,f+=_*be,h+=_*Pe,v+=_*Te,E+=_*ve,C+=_*$e,P+=_*xe,M+=_*me,g+=_*Ue,m+=_*Ce,N+=_*_e,ee+=_*Ke,ae+=_*Ve,O+=_*Ae,te+=_*We,_=k[3],y+=_*Ne,f+=_*Me,h+=_*be,v+=_*Pe,E+=_*Te,C+=_*ve,P+=_*$e,M+=_*xe,g+=_*me,m+=_*Ue,N+=_*Ce,ee+=_*_e,ae+=_*Ke,O+=_*Ve,te+=_*Ae,q+=_*We,_=k[4],f+=_*Ne,h+=_*Me,v+=_*be,E+=_*Pe,C+=_*Te,P+=_*ve,M+=_*$e,g+=_*xe,m+=_*me,N+=_*Ue,ee+=_*Ce,ae+=_*_e,O+=_*Ke,te+=_*Ve,q+=_*Ae,G+=_*We,_=k[5],h+=_*Ne,v+=_*Me,E+=_*be,C+=_*Pe,P+=_*Te,M+=_*ve,g+=_*$e,m+=_*xe,N+=_*me,ee+=_*Ue,ae+=_*Ce,O+=_*_e,te+=_*Ke,q+=_*Ve,G+=_*Ae,Y+=_*We,_=k[6],v+=_*Ne,E+=_*Me,C+=_*be,P+=_*Pe,M+=_*Te,g+=_*ve,m+=_*$e,N+=_*xe,ee+=_*me,ae+=_*Ue,O+=_*Ce,te+=_*_e,q+=_*Ke,G+=_*Ve,Y+=_*Ae,A+=_*We,_=k[7],E+=_*Ne,C+=_*Me,P+=_*be,M+=_*Pe,g+=_*Te,m+=_*ve,N+=_*$e,ee+=_*xe,ae+=_*me,O+=_*Ue,te+=_*Ce,q+=_*_e,G+=_*Ke,Y+=_*Ve,A+=_*Ae,V+=_*We,_=k[8],C+=_*Ne,P+=_*Me,M+=_*be,g+=_*Pe,m+=_*Te,N+=_*ve,ee+=_*$e,ae+=_*xe,O+=_*me,te+=_*Ue,q+=_*Ce,G+=_*_e,Y+=_*Ke,A+=_*Ve,V+=_*Ae,oe+=_*We,_=k[9],P+=_*Ne,M+=_*Me,g+=_*be,m+=_*Pe,N+=_*Te,ee+=_*ve,ae+=_*$e,O+=_*xe,te+=_*me,q+=_*Ue,G+=_*Ce,Y+=_*_e,A+=_*Ke,V+=_*Ve,oe+=_*Ae,ue+=_*We,_=k[10],M+=_*Ne,g+=_*Me,m+=_*be,N+=_*Pe,ee+=_*Te,ae+=_*ve,O+=_*$e,te+=_*xe,q+=_*me,G+=_*Ue,Y+=_*Ce,A+=_*_e,V+=_*Ke,oe+=_*Ve,ue+=_*Ae,he+=_*We,_=k[11],g+=_*Ne,m+=_*Me,N+=_*be,ee+=_*Pe,ae+=_*Te,O+=_*ve,te+=_*$e,q+=_*xe,G+=_*me,Y+=_*Ue,A+=_*Ce,V+=_*_e,oe+=_*Ke,ue+=_*Ve,he+=_*Ae,ye+=_*We,_=k[12],m+=_*Ne,N+=_*Me,ee+=_*be,ae+=_*Pe,O+=_*Te,te+=_*ve,q+=_*$e,G+=_*xe,Y+=_*me,A+=_*Ue,V+=_*Ce,oe+=_*_e,ue+=_*Ke,he+=_*Ve,ye+=_*Ae,we+=_*We,_=k[13],N+=_*Ne,ee+=_*Me,ae+=_*be,O+=_*Pe,te+=_*Te,q+=_*ve,G+=_*$e,Y+=_*xe,A+=_*me,V+=_*Ue,oe+=_*Ce,ue+=_*_e,he+=_*Ke,ye+=_*Ve,we+=_*Ae,Re+=_*We,_=k[14],ee+=_*Ne,ae+=_*Me,O+=_*be,te+=_*Pe,q+=_*Te,G+=_*ve,Y+=_*$e,A+=_*xe,V+=_*me,oe+=_*Ue,ue+=_*Ce,he+=_*_e,ye+=_*Ke,we+=_*Ve,Re+=_*Ae,Xe+=_*We,_=k[15],ae+=_*Ne,O+=_*Me,te+=_*be,q+=_*Pe,G+=_*Te,Y+=_*ve,A+=_*$e,V+=_*xe,oe+=_*me,ue+=_*Ue,he+=_*Ce,ye+=_*_e,we+=_*Ke,Re+=_*Ve,Xe+=_*Ae,Oe+=_*We,X+=38*O,re+=38*te,T+=38*q,y+=38*G,f+=38*Y,h+=38*A,v+=38*V,E+=38*oe,C+=38*ue,P+=38*he,M+=38*ye,g+=38*we,m+=38*Re,N+=38*Xe,ee+=38*Oe,B=1,_=X+B+65535,B=Math.floor(_/65536),X=_-B*65536,_=re+B+65535,B=Math.floor(_/65536),re=_-B*65536,_=T+B+65535,B=Math.floor(_/65536),T=_-B*65536,_=y+B+65535,B=Math.floor(_/65536),y=_-B*65536,_=f+B+65535,B=Math.floor(_/65536),f=_-B*65536,_=h+B+65535,B=Math.floor(_/65536),h=_-B*65536,_=v+B+65535,B=Math.floor(_/65536),v=_-B*65536,_=E+B+65535,B=Math.floor(_/65536),E=_-B*65536,_=C+B+65535,B=Math.floor(_/65536),C=_-B*65536,_=P+B+65535,B=Math.floor(_/65536),P=_-B*65536,_=M+B+65535,B=Math.floor(_/65536),M=_-B*65536,_=g+B+65535,B=Math.floor(_/65536),g=_-B*65536,_=m+B+65535,B=Math.floor(_/65536),m=_-B*65536,_=N+B+65535,B=Math.floor(_/65536),N=_-B*65536,_=ee+B+65535,B=Math.floor(_/65536),ee=_-B*65536,_=ae+B+65535,B=Math.floor(_/65536),ae=_-B*65536,X+=B-1+37*(B-1),B=1,_=X+B+65535,B=Math.floor(_/65536),X=_-B*65536,_=re+B+65535,B=Math.floor(_/65536),re=_-B*65536,_=T+B+65535,B=Math.floor(_/65536),T=_-B*65536,_=y+B+65535,B=Math.floor(_/65536),y=_-B*65536,_=f+B+65535,B=Math.floor(_/65536),f=_-B*65536,_=h+B+65535,B=Math.floor(_/65536),h=_-B*65536,_=v+B+65535,B=Math.floor(_/65536),v=_-B*65536,_=E+B+65535,B=Math.floor(_/65536),E=_-B*65536,_=C+B+65535,B=Math.floor(_/65536),C=_-B*65536,_=P+B+65535,B=Math.floor(_/65536),P=_-B*65536,_=M+B+65535,B=Math.floor(_/65536),M=_-B*65536,_=g+B+65535,B=Math.floor(_/65536),g=_-B*65536,_=m+B+65535,B=Math.floor(_/65536),m=_-B*65536,_=N+B+65535,B=Math.floor(_/65536),N=_-B*65536,_=ee+B+65535,B=Math.floor(_/65536),ee=_-B*65536,_=ae+B+65535,B=Math.floor(_/65536),ae=_-B*65536,X+=B-1+37*(B-1),R[0]=X,R[1]=re,R[2]=T,R[3]=y,R[4]=f,R[5]=h,R[6]=v,R[7]=E,R[8]=C,R[9]=P,R[10]=M,R[11]=g,R[12]=m,R[13]=N,R[14]=ee,R[15]=ae}function I(R,k){S(R,k,k)}function D(R,k){const z=i();for(let _=0;_<16;_++)z[_]=k[_];for(let _=253;_>=0;_--)I(z,z),_!==2&&_!==4&&S(z,z,k);for(let _=0;_<16;_++)R[_]=z[_]}function L(R,k){const z=new Uint8Array(32),_=new Float64Array(80),B=i(),X=i(),re=i(),T=i(),y=i(),f=i();for(let C=0;C<31;C++)z[C]=R[C];z[31]=R[31]&127|64,z[0]&=248,d(_,k);for(let C=0;C<16;C++)X[C]=_[C];B[0]=T[0]=1;for(let C=254;C>=0;--C){const P=z[C>>>3]>>>(C&7)&1;u(B,X,P),u(re,T,P),b(y,B,re),w(B,B,re),b(re,X,T),w(X,X,T),I(T,y),I(f,B),S(B,re,B),S(re,X,y),b(y,B,re),w(B,B,re),I(X,B),w(re,T,f),S(B,re,s),b(B,B,T),S(re,re,B),S(B,T,f),S(T,X,_),I(X,y),u(B,X,P),u(re,T,P)}for(let C=0;C<16;C++)_[C+16]=B[C],_[C+32]=re[C],_[C+48]=X[C],_[C+64]=T[C];const h=_.subarray(32),v=_.subarray(16);D(h,h),S(v,v,h);const E=new Uint8Array(32);return l(E,v),E}t.scalarMult=L;function K(R){return L(R,n)}t.scalarMultBase=K;function H(R){if(R.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const k=new Uint8Array(R);return{publicKey:K(k),secretKey:k}}t.generateKeyPairFromSeed=H;function U(R){const k=(0,e.randomBytes)(32,R),z=H(k);return(0,r.wipe)(k),z}t.generateKeyPair=U;function W(R,k,z=!1){if(R.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(k.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const _=L(R,k);if(z){let B=0;for(let X=0;X<_.length;X++)B|=_[X];if(B===0)throw new Error("X25519: invalid shared key")}return _}t.sharedKey=W})(D0);function _2(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function E2(t,e){e||(e=t.reduce((n,s)=>n+s.length,0));const r=_2(e);let i=0;for(const n of t)r.set(n,i),i+=n.length;return r}function T8(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=n}var u=t.length,l=t.charAt(0),d=Math.log(u)/Math.log(256),b=Math.log(256)/Math.log(u);function w(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var L=0,K=0,H=0,U=D.length;H!==U&&D[H]===0;)H++,L++;for(var W=(U-H)*b+1>>>0,R=new Uint8Array(W);H!==U;){for(var k=D[H],z=0,_=W-1;(k!==0||z<K)&&_!==-1;_--,z++)k+=256*R[_]>>>0,R[_]=k%u>>>0,k=k/u>>>0;if(k!==0)throw new Error("Non-zero carry");K=z,H++}for(var B=W-K;B!==W&&R[B]===0;)B++;for(var X=l.repeat(L);B<W;++B)X+=t.charAt(R[B]);return X}function S(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var L=0;if(D[L]!==" "){for(var K=0,H=0;D[L]===l;)K++,L++;for(var U=(D.length-L)*d+1>>>0,W=new Uint8Array(U);D[L];){var R=r[D.charCodeAt(L)];if(R===255)return;for(var k=0,z=U-1;(R!==0||k<H)&&z!==-1;z--,k++)R+=u*W[z]>>>0,W[z]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");H=k,L++}if(D[L]!==" "){for(var _=U-H;_!==U&&W[_]===0;)_++;for(var B=new Uint8Array(K+(U-_)),X=K;_!==U;)B[X++]=W[_++];return B}}}function I(D){var L=S(D);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:S,decode:I}}var L8=T8,B8=L8;const A2=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},F8=t=>new TextEncoder().encode(t),U8=t=>new TextDecoder().decode(t);class k8{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class j8{constructor(e,r,i){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return x2(this,e)}}class q8{constructor(e){this.decoders=e}or(e){return x2(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const x2=(t,e)=>new q8({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class z8{constructor(e,r,i,n){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=n,this.encoder=new k8(e,r,i),this.decoder=new j8(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Cf=({name:t,prefix:e,encode:r,decode:i})=>new z8(t,e,r,i),Qc=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=B8(r,e);return Cf({prefix:t,name:e,encode:i,decode:s=>A2(n(s))})},H8=(t,e,r,i)=>{const n={};for(let b=0;b<e.length;++b)n[e[b]]=b;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*r/8|0);let u=0,l=0,d=0;for(let b=0;b<s;++b){const w=n[t[b]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<r|w,u+=r,u>=8&&(u-=8,a[d++]=255&l>>u)}if(u>=r||255&l<<8-u)throw new SyntaxError("Unexpected end of data");return a},K8=(t,e,r)=>{const i=e[e.length-1]==="=",n=(1<<r)-1;let s="",a=0,u=0;for(let l=0;l<t.length;++l)for(u=u<<8|t[l],a+=8;a>r;)a-=r,s+=e[n&u>>a];if(a&&(s+=e[n&u<<r-a]),i)for(;s.length*r&7;)s+="=";return s},Fr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Cf({prefix:e,name:t,encode(n){return K8(n,i,r)},decode(n){return H8(n,i,r,t)}}),W8=Cf({prefix:"\0",name:"identity",encode:t=>U8(t),decode:t=>F8(t)});var V8=Object.freeze({__proto__:null,identity:W8});const G8=Fr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var Y8=Object.freeze({__proto__:null,base2:G8});const J8=Fr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Q8=Object.freeze({__proto__:null,base8:J8});const Z8=Qc({prefix:"9",name:"base10",alphabet:"0123456789"});var X8=Object.freeze({__proto__:null,base10:Z8});const e7=Fr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),t7=Fr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var r7=Object.freeze({__proto__:null,base16:e7,base16upper:t7});const i7=Fr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),n7=Fr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),s7=Fr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),o7=Fr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),a7=Fr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),c7=Fr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),u7=Fr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),f7=Fr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),h7=Fr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var l7=Object.freeze({__proto__:null,base32:i7,base32upper:n7,base32pad:s7,base32padupper:o7,base32hex:a7,base32hexupper:c7,base32hexpad:u7,base32hexpadupper:f7,base32z:h7});const d7=Qc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),p7=Qc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var g7=Object.freeze({__proto__:null,base36:d7,base36upper:p7});const v7=Qc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),m7=Qc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var b7=Object.freeze({__proto__:null,base58btc:v7,base58flickr:m7});const y7=Fr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),w7=Fr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),_7=Fr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),E7=Fr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var A7=Object.freeze({__proto__:null,base64:y7,base64pad:w7,base64url:_7,base64urlpad:E7});const S2=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),x7=S2.reduce((t,e,r)=>(t[r]=e,t),[]),S7=S2.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function I7(t){return t.reduce((e,r)=>(e+=x7[r],e),"")}function M7(t){const e=[];for(const r of t){const i=S7[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const C7=Cf({prefix:"\u{1F680}",name:"base256emoji",encode:I7,decode:M7});var D7=Object.freeze({__proto__:null,base256emoji:C7}),O7=M2,I2=128,P7=127,$7=~P7,R7=Math.pow(2,31);function M2(t,e,r){e=e||[],r=r||0;for(var i=r;t>=R7;)e[r++]=t&255|I2,t/=128;for(;t&$7;)e[r++]=t&255|I2,t>>>=7;return e[r]=t|0,M2.bytes=r-i+1,e}var N7=O0,T7=128,C2=127;function O0(t,i){var r=0,i=i||0,n=0,s=i,a,u=t.length;do{if(s>=u)throw O0.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=n<28?(a&C2)<<n:(a&C2)*Math.pow(2,n),n+=7}while(a>=T7);return O0.bytes=s-i,r}var L7=Math.pow(2,7),B7=Math.pow(2,14),F7=Math.pow(2,21),U7=Math.pow(2,28),k7=Math.pow(2,35),j7=Math.pow(2,42),q7=Math.pow(2,49),z7=Math.pow(2,56),H7=Math.pow(2,63),K7=function(t){return t<L7?1:t<B7?2:t<F7?3:t<U7?4:t<k7?5:t<j7?6:t<q7?7:t<z7?8:t<H7?9:10},W7={encode:O7,decode:N7,encodingLength:K7},D2=W7;const O2=(t,e,r=0)=>(D2.encode(t,e,r),e),P2=t=>D2.encodingLength(t),P0=(t,e)=>{const r=e.byteLength,i=P2(t),n=i+P2(r),s=new Uint8Array(n+r);return O2(t,s,0),O2(r,s,i),s.set(e,n),new V7(t,r,e,s)};class V7{constructor(e,r,i,n){this.code=e,this.size=r,this.digest=i,this.bytes=n}}const $2=({name:t,code:e,encode:r})=>new G7(t,e,r);class G7{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?P0(this.code,r):r.then(i=>P0(this.code,i))}else throw Error("Unknown type, must be binary type")}}const R2=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),Y7=$2({name:"sha2-256",code:18,encode:R2("SHA-256")}),J7=$2({name:"sha2-512",code:19,encode:R2("SHA-512")});var Q7=Object.freeze({__proto__:null,sha256:Y7,sha512:J7});const N2=0,Z7="identity",T2=A2;var X7=Object.freeze({__proto__:null,identity:{code:N2,name:Z7,encode:T2,digest:t=>P0(N2,T2(t))}});new TextEncoder,new TextDecoder;const Ca={...V8,...Y8,...Q8,...X8,...r7,...l7,...g7,...b7,...A7,...D7};({...Q7,...X7});function L2(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const B2=L2("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),$0=L2("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=_2(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),F2={utf8:B2,"utf-8":B2,hex:Ca.base16,latin1:$0,ascii:$0,binary:$0,...Ca};function gn(t,e="utf8"){const r=F2[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function vn(t,e="utf8"){const r=F2[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var U2={},e9="elliptic",t9="6.5.7",r9="EC cryptography",i9="lib/elliptic.js",n9=["lib"],s9={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},o9={type:"git",url:"git@github.com:indutny/elliptic"},a9=["EC","Elliptic","curve","Cryptography"],c9="Fedor Indutny <fedor@indutny.com>",u9="MIT",f9={url:"https://github.com/indutny/elliptic/issues"},h9="https://github.com/indutny/elliptic",l9={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},d9={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},p9={name:e9,version:t9,description:r9,main:i9,files:n9,scripts:s9,repository:o9,keywords:a9,author:c9,license:u9,bugs:f9,homepage:h9,devDependencies:l9,dependencies:d9},Ni={},kn={exports:{}};(function(t){(function(e,r){function i(T,y){if(!T)throw new Error(y||"Assertion failed")}function n(T,y){T.super_=y;var f=function(){};f.prototype=y.prototype,T.prototype=new f,T.prototype.constructor=T}function s(T,y,f){if(s.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((y==="le"||y==="be")&&(f=y,y=10),this._init(T||0,y||10,f||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=C0.Buffer}catch{}s.isBN=function(y){return y instanceof s?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===s.wordSize&&Array.isArray(y.words)},s.max=function(y,f){return y.cmp(f)>0?y:f},s.min=function(y,f){return y.cmp(f)<0?y:f},s.prototype._init=function(y,f,h){if(typeof y=="number")return this._initNumber(y,f,h);if(typeof y=="object")return this._initArray(y,f,h);f==="hex"&&(f=16),i(f===(f|0)&&f>=2&&f<=36),y=y.toString().replace(/\s+/g,"");var v=0;y[0]==="-"&&(v++,this.negative=1),v<y.length&&(f===16?this._parseHex(y,v,h):(this._parseBase(y,f,v),h==="le"&&this._initArray(this.toArray(),f,h)))},s.prototype._initNumber=function(y,f,h){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(i(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},s.prototype._initArray=function(y,f,h){if(i(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var E,C,P=0;if(h==="be")for(v=y.length-1,E=0;v>=0;v-=3)C=y[v]|y[v-1]<<8|y[v-2]<<16,this.words[E]|=C<<P&67108863,this.words[E+1]=C>>>26-P&67108863,P+=24,P>=26&&(P-=26,E++);else if(h==="le")for(v=0,E=0;v<y.length;v+=3)C=y[v]|y[v+1]<<8|y[v+2]<<16,this.words[E]|=C<<P&67108863,this.words[E+1]=C>>>26-P&67108863,P+=24,P>=26&&(P-=26,E++);return this.strip()};function u(T,y){var f=T.charCodeAt(y);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function l(T,y,f){var h=u(T,f);return f-1>=y&&(h|=u(T,f-1)<<4),h}s.prototype._parseHex=function(y,f,h){this.length=Math.ceil((y.length-f)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var E=0,C=0,P;if(h==="be")for(v=y.length-1;v>=f;v-=2)P=l(y,f,v)<<E,this.words[C]|=P&67108863,E>=18?(E-=18,C+=1,this.words[C]|=P>>>26):E+=8;else{var M=y.length-f;for(v=M%2===0?f+1:f;v<y.length;v+=2)P=l(y,f,v)<<E,this.words[C]|=P&67108863,E>=18?(E-=18,C+=1,this.words[C]|=P>>>26):E+=8}this.strip()};function d(T,y,f,h){for(var v=0,E=Math.min(T.length,f),C=y;C<E;C++){var P=T.charCodeAt(C)-48;v*=h,P>=49?v+=P-49+10:P>=17?v+=P-17+10:v+=P}return v}s.prototype._parseBase=function(y,f,h){this.words=[0],this.length=1;for(var v=0,E=1;E<=67108863;E*=f)v++;v--,E=E/f|0;for(var C=y.length-h,P=C%v,M=Math.min(C,C-P)+h,g=0,m=h;m<M;m+=v)g=d(y,m,m+v,f),this.imuln(E),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(P!==0){var N=1;for(g=d(y,m,y.length,f),m=0;m<P;m++)N*=f;this.imuln(N),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this.strip()},s.prototype.copy=function(y){y.words=new Array(this.length);for(var f=0;f<this.length;f++)y.words[f]=this.words[f];y.length=this.length,y.negative=this.negative,y.red=this.red},s.prototype.clone=function(){var y=new s(null);return this.copy(y),y},s.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],S=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(y,f){y=y||10,f=f|0||1;var h;if(y===16||y==="hex"){h="";for(var v=0,E=0,C=0;C<this.length;C++){var P=this.words[C],M=((P<<v|E)&16777215).toString(16);E=P>>>24-v&16777215,E!==0||C!==this.length-1?h=b[6-M.length]+M+h:h=M+h,v+=2,v>=26&&(v-=26,C--)}for(E!==0&&(h=E.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(y===(y|0)&&y>=2&&y<=36){var g=w[y],m=S[y];h="";var N=this.clone();for(N.negative=0;!N.isZero();){var ee=N.modn(m).toString(y);N=N.idivn(m),N.isZero()?h=ee+h:h=b[g-ee.length]+ee+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(y,f){return i(typeof a<"u"),this.toArrayLike(a,y,f)},s.prototype.toArray=function(y,f){return this.toArrayLike(Array,y,f)},s.prototype.toArrayLike=function(y,f,h){var v=this.byteLength(),E=h||Math.max(1,v);i(v<=E,"byte array longer than desired length"),i(E>0,"Requested array length <= 0"),this.strip();var C=f==="le",P=new y(E),M,g,m=this.clone();if(C){for(g=0;!m.isZero();g++)M=m.andln(255),m.iushrn(8),P[g]=M;for(;g<E;g++)P[g]=0}else{for(g=0;g<E-v;g++)P[g]=0;for(g=0;!m.isZero();g++)M=m.andln(255),m.iushrn(8),P[E-g-1]=M}return P},Math.clz32?s.prototype._countBits=function(y){return 32-Math.clz32(y)}:s.prototype._countBits=function(y){var f=y,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},s.prototype._zeroBits=function(y){if(y===0)return 26;var f=y,h=0;return f&8191||(h+=13,f>>>=13),f&127||(h+=7,f>>>=7),f&15||(h+=4,f>>>=4),f&3||(h+=2,f>>>=2),f&1||h++,h},s.prototype.bitLength=function(){var y=this.words[this.length-1],f=this._countBits(y);return(this.length-1)*26+f};function I(T){for(var y=new Array(T.bitLength()),f=0;f<y.length;f++){var h=f/26|0,v=f%26;y[f]=(T.words[h]&1<<v)>>>v}return y}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(y+=h,h!==26)break}return y},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},s.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var f=0;f<y.length;f++)this.words[f]=this.words[f]|y.words[f];return this.strip()},s.prototype.ior=function(y){return i((this.negative|y.negative)===0),this.iuor(y)},s.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},s.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},s.prototype.iuand=function(y){var f;this.length>y.length?f=y:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&y.words[h];return this.length=f.length,this.strip()},s.prototype.iand=function(y){return i((this.negative|y.negative)===0),this.iuand(y)},s.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},s.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},s.prototype.iuxor=function(y){var f,h;this.length>y.length?(f=this,h=y):(f=y,h=this);for(var v=0;v<h.length;v++)this.words[v]=f.words[v]^h.words[v];if(this!==f)for(;v<f.length;v++)this.words[v]=f.words[v];return this.length=f.length,this.strip()},s.prototype.ixor=function(y){return i((this.negative|y.negative)===0),this.iuxor(y)},s.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},s.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},s.prototype.inotn=function(y){i(typeof y=="number"&&y>=0);var f=Math.ceil(y/26)|0,h=y%26;this._expand(f),h>0&&f--;for(var v=0;v<f;v++)this.words[v]=~this.words[v]&67108863;return h>0&&(this.words[v]=~this.words[v]&67108863>>26-h),this.strip()},s.prototype.notn=function(y){return this.clone().inotn(y)},s.prototype.setn=function(y,f){i(typeof y=="number"&&y>=0);var h=y/26|0,v=y%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<v:this.words[h]=this.words[h]&~(1<<v),this.strip()},s.prototype.iadd=function(y){var f;if(this.negative!==0&&y.negative===0)return this.negative=0,f=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,f=this.isub(y),y.negative=1,f._normSign();var h,v;this.length>y.length?(h=this,v=y):(h=y,v=this);for(var E=0,C=0;C<v.length;C++)f=(h.words[C]|0)+(v.words[C]|0)+E,this.words[C]=f&67108863,E=f>>>26;for(;E!==0&&C<h.length;C++)f=(h.words[C]|0)+E,this.words[C]=f&67108863,E=f>>>26;if(this.length=h.length,E!==0)this.words[this.length]=E,this.length++;else if(h!==this)for(;C<h.length;C++)this.words[C]=h.words[C];return this},s.prototype.add=function(y){var f;return y.negative!==0&&this.negative===0?(y.negative=0,f=this.sub(y),y.negative^=1,f):y.negative===0&&this.negative!==0?(this.negative=0,f=y.sub(this),this.negative=1,f):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},s.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var f=this.iadd(y);return y.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var h=this.cmp(y);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,E;h>0?(v=this,E=y):(v=y,E=this);for(var C=0,P=0;P<E.length;P++)f=(v.words[P]|0)-(E.words[P]|0)+C,C=f>>26,this.words[P]=f&67108863;for(;C!==0&&P<v.length;P++)f=(v.words[P]|0)+C,C=f>>26,this.words[P]=f&67108863;if(C===0&&P<v.length&&v!==this)for(;P<v.length;P++)this.words[P]=v.words[P];return this.length=Math.max(this.length,P),v!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(y){return this.clone().isub(y)};function D(T,y,f){f.negative=y.negative^T.negative;var h=T.length+y.length|0;f.length=h,h=h-1|0;var v=T.words[0]|0,E=y.words[0]|0,C=v*E,P=C&67108863,M=C/67108864|0;f.words[0]=P;for(var g=1;g<h;g++){for(var m=M>>>26,N=M&67108863,ee=Math.min(g,y.length-1),ae=Math.max(0,g-T.length+1);ae<=ee;ae++){var O=g-ae|0;v=T.words[O]|0,E=y.words[ae]|0,C=v*E+N,m+=C/67108864|0,N=C&67108863}f.words[g]=N|0,M=m|0}return M!==0?f.words[g]=M|0:f.length--,f.strip()}var L=function(y,f,h){var v=y.words,E=f.words,C=h.words,P=0,M,g,m,N=v[0]|0,ee=N&8191,ae=N>>>13,O=v[1]|0,te=O&8191,q=O>>>13,G=v[2]|0,Y=G&8191,A=G>>>13,V=v[3]|0,oe=V&8191,ue=V>>>13,he=v[4]|0,ye=he&8191,we=he>>>13,Re=v[5]|0,Xe=Re&8191,Oe=Re>>>13,Ne=v[6]|0,Me=Ne&8191,be=Ne>>>13,Pe=v[7]|0,Te=Pe&8191,ve=Pe>>>13,$e=v[8]|0,xe=$e&8191,me=$e>>>13,Ue=v[9]|0,Ce=Ue&8191,_e=Ue>>>13,Ke=E[0]|0,Ve=Ke&8191,Ae=Ke>>>13,We=E[1]|0,pt=We&8191,Ge=We>>>13,It=E[2]|0,gt=It&8191,Je=It>>>13,Ot=E[3]|0,Tt=Ot&8191,Le=Ot>>>13,et=E[4]|0,it=et&8191,Be=et>>>13,rt=E[5]|0,tt=rt&8191,je=rt>>>13,ht=E[6]|0,nt=ht&8191,qe=ht>>>13,st=E[7]|0,at=st&8191,Fe=st>>>13,Ze=E[8]|0,lt=Ze&8191,ze=Ze>>>13,jt=E[9]|0,qt=jt&8191,ct=jt>>>13;h.negative=y.negative^f.negative,h.length=19,M=Math.imul(ee,Ve),g=Math.imul(ee,Ae),g=g+Math.imul(ae,Ve)|0,m=Math.imul(ae,Ae);var _t=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(_t>>>26)|0,_t&=67108863,M=Math.imul(te,Ve),g=Math.imul(te,Ae),g=g+Math.imul(q,Ve)|0,m=Math.imul(q,Ae),M=M+Math.imul(ee,pt)|0,g=g+Math.imul(ee,Ge)|0,g=g+Math.imul(ae,pt)|0,m=m+Math.imul(ae,Ge)|0;var Qr=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,M=Math.imul(Y,Ve),g=Math.imul(Y,Ae),g=g+Math.imul(A,Ve)|0,m=Math.imul(A,Ae),M=M+Math.imul(te,pt)|0,g=g+Math.imul(te,Ge)|0,g=g+Math.imul(q,pt)|0,m=m+Math.imul(q,Ge)|0,M=M+Math.imul(ee,gt)|0,g=g+Math.imul(ee,Je)|0,g=g+Math.imul(ae,gt)|0,m=m+Math.imul(ae,Je)|0;var Zr=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,M=Math.imul(oe,Ve),g=Math.imul(oe,Ae),g=g+Math.imul(ue,Ve)|0,m=Math.imul(ue,Ae),M=M+Math.imul(Y,pt)|0,g=g+Math.imul(Y,Ge)|0,g=g+Math.imul(A,pt)|0,m=m+Math.imul(A,Ge)|0,M=M+Math.imul(te,gt)|0,g=g+Math.imul(te,Je)|0,g=g+Math.imul(q,gt)|0,m=m+Math.imul(q,Je)|0,M=M+Math.imul(ee,Tt)|0,g=g+Math.imul(ee,Le)|0,g=g+Math.imul(ae,Tt)|0,m=m+Math.imul(ae,Le)|0;var Xr=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,M=Math.imul(ye,Ve),g=Math.imul(ye,Ae),g=g+Math.imul(we,Ve)|0,m=Math.imul(we,Ae),M=M+Math.imul(oe,pt)|0,g=g+Math.imul(oe,Ge)|0,g=g+Math.imul(ue,pt)|0,m=m+Math.imul(ue,Ge)|0,M=M+Math.imul(Y,gt)|0,g=g+Math.imul(Y,Je)|0,g=g+Math.imul(A,gt)|0,m=m+Math.imul(A,Je)|0,M=M+Math.imul(te,Tt)|0,g=g+Math.imul(te,Le)|0,g=g+Math.imul(q,Tt)|0,m=m+Math.imul(q,Le)|0,M=M+Math.imul(ee,it)|0,g=g+Math.imul(ee,Be)|0,g=g+Math.imul(ae,it)|0,m=m+Math.imul(ae,Be)|0;var ei=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(ei>>>26)|0,ei&=67108863,M=Math.imul(Xe,Ve),g=Math.imul(Xe,Ae),g=g+Math.imul(Oe,Ve)|0,m=Math.imul(Oe,Ae),M=M+Math.imul(ye,pt)|0,g=g+Math.imul(ye,Ge)|0,g=g+Math.imul(we,pt)|0,m=m+Math.imul(we,Ge)|0,M=M+Math.imul(oe,gt)|0,g=g+Math.imul(oe,Je)|0,g=g+Math.imul(ue,gt)|0,m=m+Math.imul(ue,Je)|0,M=M+Math.imul(Y,Tt)|0,g=g+Math.imul(Y,Le)|0,g=g+Math.imul(A,Tt)|0,m=m+Math.imul(A,Le)|0,M=M+Math.imul(te,it)|0,g=g+Math.imul(te,Be)|0,g=g+Math.imul(q,it)|0,m=m+Math.imul(q,Be)|0,M=M+Math.imul(ee,tt)|0,g=g+Math.imul(ee,je)|0,g=g+Math.imul(ae,tt)|0,m=m+Math.imul(ae,je)|0;var ti=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(ti>>>26)|0,ti&=67108863,M=Math.imul(Me,Ve),g=Math.imul(Me,Ae),g=g+Math.imul(be,Ve)|0,m=Math.imul(be,Ae),M=M+Math.imul(Xe,pt)|0,g=g+Math.imul(Xe,Ge)|0,g=g+Math.imul(Oe,pt)|0,m=m+Math.imul(Oe,Ge)|0,M=M+Math.imul(ye,gt)|0,g=g+Math.imul(ye,Je)|0,g=g+Math.imul(we,gt)|0,m=m+Math.imul(we,Je)|0,M=M+Math.imul(oe,Tt)|0,g=g+Math.imul(oe,Le)|0,g=g+Math.imul(ue,Tt)|0,m=m+Math.imul(ue,Le)|0,M=M+Math.imul(Y,it)|0,g=g+Math.imul(Y,Be)|0,g=g+Math.imul(A,it)|0,m=m+Math.imul(A,Be)|0,M=M+Math.imul(te,tt)|0,g=g+Math.imul(te,je)|0,g=g+Math.imul(q,tt)|0,m=m+Math.imul(q,je)|0,M=M+Math.imul(ee,nt)|0,g=g+Math.imul(ee,qe)|0,g=g+Math.imul(ae,nt)|0,m=m+Math.imul(ae,qe)|0;var pr=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(pr>>>26)|0,pr&=67108863,M=Math.imul(Te,Ve),g=Math.imul(Te,Ae),g=g+Math.imul(ve,Ve)|0,m=Math.imul(ve,Ae),M=M+Math.imul(Me,pt)|0,g=g+Math.imul(Me,Ge)|0,g=g+Math.imul(be,pt)|0,m=m+Math.imul(be,Ge)|0,M=M+Math.imul(Xe,gt)|0,g=g+Math.imul(Xe,Je)|0,g=g+Math.imul(Oe,gt)|0,m=m+Math.imul(Oe,Je)|0,M=M+Math.imul(ye,Tt)|0,g=g+Math.imul(ye,Le)|0,g=g+Math.imul(we,Tt)|0,m=m+Math.imul(we,Le)|0,M=M+Math.imul(oe,it)|0,g=g+Math.imul(oe,Be)|0,g=g+Math.imul(ue,it)|0,m=m+Math.imul(ue,Be)|0,M=M+Math.imul(Y,tt)|0,g=g+Math.imul(Y,je)|0,g=g+Math.imul(A,tt)|0,m=m+Math.imul(A,je)|0,M=M+Math.imul(te,nt)|0,g=g+Math.imul(te,qe)|0,g=g+Math.imul(q,nt)|0,m=m+Math.imul(q,qe)|0,M=M+Math.imul(ee,at)|0,g=g+Math.imul(ee,Fe)|0,g=g+Math.imul(ae,at)|0,m=m+Math.imul(ae,Fe)|0;var Si=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Si>>>26)|0,Si&=67108863,M=Math.imul(xe,Ve),g=Math.imul(xe,Ae),g=g+Math.imul(me,Ve)|0,m=Math.imul(me,Ae),M=M+Math.imul(Te,pt)|0,g=g+Math.imul(Te,Ge)|0,g=g+Math.imul(ve,pt)|0,m=m+Math.imul(ve,Ge)|0,M=M+Math.imul(Me,gt)|0,g=g+Math.imul(Me,Je)|0,g=g+Math.imul(be,gt)|0,m=m+Math.imul(be,Je)|0,M=M+Math.imul(Xe,Tt)|0,g=g+Math.imul(Xe,Le)|0,g=g+Math.imul(Oe,Tt)|0,m=m+Math.imul(Oe,Le)|0,M=M+Math.imul(ye,it)|0,g=g+Math.imul(ye,Be)|0,g=g+Math.imul(we,it)|0,m=m+Math.imul(we,Be)|0,M=M+Math.imul(oe,tt)|0,g=g+Math.imul(oe,je)|0,g=g+Math.imul(ue,tt)|0,m=m+Math.imul(ue,je)|0,M=M+Math.imul(Y,nt)|0,g=g+Math.imul(Y,qe)|0,g=g+Math.imul(A,nt)|0,m=m+Math.imul(A,qe)|0,M=M+Math.imul(te,at)|0,g=g+Math.imul(te,Fe)|0,g=g+Math.imul(q,at)|0,m=m+Math.imul(q,Fe)|0,M=M+Math.imul(ee,lt)|0,g=g+Math.imul(ee,ze)|0,g=g+Math.imul(ae,lt)|0,m=m+Math.imul(ae,ze)|0;var Cn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,M=Math.imul(Ce,Ve),g=Math.imul(Ce,Ae),g=g+Math.imul(_e,Ve)|0,m=Math.imul(_e,Ae),M=M+Math.imul(xe,pt)|0,g=g+Math.imul(xe,Ge)|0,g=g+Math.imul(me,pt)|0,m=m+Math.imul(me,Ge)|0,M=M+Math.imul(Te,gt)|0,g=g+Math.imul(Te,Je)|0,g=g+Math.imul(ve,gt)|0,m=m+Math.imul(ve,Je)|0,M=M+Math.imul(Me,Tt)|0,g=g+Math.imul(Me,Le)|0,g=g+Math.imul(be,Tt)|0,m=m+Math.imul(be,Le)|0,M=M+Math.imul(Xe,it)|0,g=g+Math.imul(Xe,Be)|0,g=g+Math.imul(Oe,it)|0,m=m+Math.imul(Oe,Be)|0,M=M+Math.imul(ye,tt)|0,g=g+Math.imul(ye,je)|0,g=g+Math.imul(we,tt)|0,m=m+Math.imul(we,je)|0,M=M+Math.imul(oe,nt)|0,g=g+Math.imul(oe,qe)|0,g=g+Math.imul(ue,nt)|0,m=m+Math.imul(ue,qe)|0,M=M+Math.imul(Y,at)|0,g=g+Math.imul(Y,Fe)|0,g=g+Math.imul(A,at)|0,m=m+Math.imul(A,Fe)|0,M=M+Math.imul(te,lt)|0,g=g+Math.imul(te,ze)|0,g=g+Math.imul(q,lt)|0,m=m+Math.imul(q,ze)|0,M=M+Math.imul(ee,qt)|0,g=g+Math.imul(ee,ct)|0,g=g+Math.imul(ae,qt)|0,m=m+Math.imul(ae,ct)|0;var Ii=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,M=Math.imul(Ce,pt),g=Math.imul(Ce,Ge),g=g+Math.imul(_e,pt)|0,m=Math.imul(_e,Ge),M=M+Math.imul(xe,gt)|0,g=g+Math.imul(xe,Je)|0,g=g+Math.imul(me,gt)|0,m=m+Math.imul(me,Je)|0,M=M+Math.imul(Te,Tt)|0,g=g+Math.imul(Te,Le)|0,g=g+Math.imul(ve,Tt)|0,m=m+Math.imul(ve,Le)|0,M=M+Math.imul(Me,it)|0,g=g+Math.imul(Me,Be)|0,g=g+Math.imul(be,it)|0,m=m+Math.imul(be,Be)|0,M=M+Math.imul(Xe,tt)|0,g=g+Math.imul(Xe,je)|0,g=g+Math.imul(Oe,tt)|0,m=m+Math.imul(Oe,je)|0,M=M+Math.imul(ye,nt)|0,g=g+Math.imul(ye,qe)|0,g=g+Math.imul(we,nt)|0,m=m+Math.imul(we,qe)|0,M=M+Math.imul(oe,at)|0,g=g+Math.imul(oe,Fe)|0,g=g+Math.imul(ue,at)|0,m=m+Math.imul(ue,Fe)|0,M=M+Math.imul(Y,lt)|0,g=g+Math.imul(Y,ze)|0,g=g+Math.imul(A,lt)|0,m=m+Math.imul(A,ze)|0,M=M+Math.imul(te,qt)|0,g=g+Math.imul(te,ct)|0,g=g+Math.imul(q,qt)|0,m=m+Math.imul(q,ct)|0;var Dn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,M=Math.imul(Ce,gt),g=Math.imul(Ce,Je),g=g+Math.imul(_e,gt)|0,m=Math.imul(_e,Je),M=M+Math.imul(xe,Tt)|0,g=g+Math.imul(xe,Le)|0,g=g+Math.imul(me,Tt)|0,m=m+Math.imul(me,Le)|0,M=M+Math.imul(Te,it)|0,g=g+Math.imul(Te,Be)|0,g=g+Math.imul(ve,it)|0,m=m+Math.imul(ve,Be)|0,M=M+Math.imul(Me,tt)|0,g=g+Math.imul(Me,je)|0,g=g+Math.imul(be,tt)|0,m=m+Math.imul(be,je)|0,M=M+Math.imul(Xe,nt)|0,g=g+Math.imul(Xe,qe)|0,g=g+Math.imul(Oe,nt)|0,m=m+Math.imul(Oe,qe)|0,M=M+Math.imul(ye,at)|0,g=g+Math.imul(ye,Fe)|0,g=g+Math.imul(we,at)|0,m=m+Math.imul(we,Fe)|0,M=M+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ze)|0,g=g+Math.imul(ue,lt)|0,m=m+Math.imul(ue,ze)|0,M=M+Math.imul(Y,qt)|0,g=g+Math.imul(Y,ct)|0,g=g+Math.imul(A,qt)|0,m=m+Math.imul(A,ct)|0;var On=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(On>>>26)|0,On&=67108863,M=Math.imul(Ce,Tt),g=Math.imul(Ce,Le),g=g+Math.imul(_e,Tt)|0,m=Math.imul(_e,Le),M=M+Math.imul(xe,it)|0,g=g+Math.imul(xe,Be)|0,g=g+Math.imul(me,it)|0,m=m+Math.imul(me,Be)|0,M=M+Math.imul(Te,tt)|0,g=g+Math.imul(Te,je)|0,g=g+Math.imul(ve,tt)|0,m=m+Math.imul(ve,je)|0,M=M+Math.imul(Me,nt)|0,g=g+Math.imul(Me,qe)|0,g=g+Math.imul(be,nt)|0,m=m+Math.imul(be,qe)|0,M=M+Math.imul(Xe,at)|0,g=g+Math.imul(Xe,Fe)|0,g=g+Math.imul(Oe,at)|0,m=m+Math.imul(Oe,Fe)|0,M=M+Math.imul(ye,lt)|0,g=g+Math.imul(ye,ze)|0,g=g+Math.imul(we,lt)|0,m=m+Math.imul(we,ze)|0,M=M+Math.imul(oe,qt)|0,g=g+Math.imul(oe,ct)|0,g=g+Math.imul(ue,qt)|0,m=m+Math.imul(ue,ct)|0;var Mi=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,M=Math.imul(Ce,it),g=Math.imul(Ce,Be),g=g+Math.imul(_e,it)|0,m=Math.imul(_e,Be),M=M+Math.imul(xe,tt)|0,g=g+Math.imul(xe,je)|0,g=g+Math.imul(me,tt)|0,m=m+Math.imul(me,je)|0,M=M+Math.imul(Te,nt)|0,g=g+Math.imul(Te,qe)|0,g=g+Math.imul(ve,nt)|0,m=m+Math.imul(ve,qe)|0,M=M+Math.imul(Me,at)|0,g=g+Math.imul(Me,Fe)|0,g=g+Math.imul(be,at)|0,m=m+Math.imul(be,Fe)|0,M=M+Math.imul(Xe,lt)|0,g=g+Math.imul(Xe,ze)|0,g=g+Math.imul(Oe,lt)|0,m=m+Math.imul(Oe,ze)|0,M=M+Math.imul(ye,qt)|0,g=g+Math.imul(ye,ct)|0,g=g+Math.imul(we,qt)|0,m=m+Math.imul(we,ct)|0;var nn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(nn>>>26)|0,nn&=67108863,M=Math.imul(Ce,tt),g=Math.imul(Ce,je),g=g+Math.imul(_e,tt)|0,m=Math.imul(_e,je),M=M+Math.imul(xe,nt)|0,g=g+Math.imul(xe,qe)|0,g=g+Math.imul(me,nt)|0,m=m+Math.imul(me,qe)|0,M=M+Math.imul(Te,at)|0,g=g+Math.imul(Te,Fe)|0,g=g+Math.imul(ve,at)|0,m=m+Math.imul(ve,Fe)|0,M=M+Math.imul(Me,lt)|0,g=g+Math.imul(Me,ze)|0,g=g+Math.imul(be,lt)|0,m=m+Math.imul(be,ze)|0,M=M+Math.imul(Xe,qt)|0,g=g+Math.imul(Xe,ct)|0,g=g+Math.imul(Oe,qt)|0,m=m+Math.imul(Oe,ct)|0;var sn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(sn>>>26)|0,sn&=67108863,M=Math.imul(Ce,nt),g=Math.imul(Ce,qe),g=g+Math.imul(_e,nt)|0,m=Math.imul(_e,qe),M=M+Math.imul(xe,at)|0,g=g+Math.imul(xe,Fe)|0,g=g+Math.imul(me,at)|0,m=m+Math.imul(me,Fe)|0,M=M+Math.imul(Te,lt)|0,g=g+Math.imul(Te,ze)|0,g=g+Math.imul(ve,lt)|0,m=m+Math.imul(ve,ze)|0,M=M+Math.imul(Me,qt)|0,g=g+Math.imul(Me,ct)|0,g=g+Math.imul(be,qt)|0,m=m+Math.imul(be,ct)|0;var Ir=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,M=Math.imul(Ce,at),g=Math.imul(Ce,Fe),g=g+Math.imul(_e,at)|0,m=Math.imul(_e,Fe),M=M+Math.imul(xe,lt)|0,g=g+Math.imul(xe,ze)|0,g=g+Math.imul(me,lt)|0,m=m+Math.imul(me,ze)|0,M=M+Math.imul(Te,qt)|0,g=g+Math.imul(Te,ct)|0,g=g+Math.imul(ve,qt)|0,m=m+Math.imul(ve,ct)|0;var Pn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,M=Math.imul(Ce,lt),g=Math.imul(Ce,ze),g=g+Math.imul(_e,lt)|0,m=Math.imul(_e,ze),M=M+Math.imul(xe,qt)|0,g=g+Math.imul(xe,ct)|0,g=g+Math.imul(me,qt)|0,m=m+Math.imul(me,ct)|0;var $n=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+($n>>>26)|0,$n&=67108863,M=Math.imul(Ce,qt),g=Math.imul(Ce,ct),g=g+Math.imul(_e,qt)|0,m=Math.imul(_e,ct);var Rn=(P+M|0)+((g&8191)<<13)|0;return P=(m+(g>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,C[0]=_t,C[1]=Qr,C[2]=Zr,C[3]=Xr,C[4]=ei,C[5]=ti,C[6]=pr,C[7]=Si,C[8]=Cn,C[9]=Ii,C[10]=Dn,C[11]=On,C[12]=Mi,C[13]=nn,C[14]=sn,C[15]=Ir,C[16]=Pn,C[17]=$n,C[18]=Rn,P!==0&&(C[19]=P,h.length++),h};Math.imul||(L=D);function K(T,y,f){f.negative=y.negative^T.negative,f.length=T.length+y.length;for(var h=0,v=0,E=0;E<f.length-1;E++){var C=v;v=0;for(var P=h&67108863,M=Math.min(E,y.length-1),g=Math.max(0,E-T.length+1);g<=M;g++){var m=E-g,N=T.words[m]|0,ee=y.words[g]|0,ae=N*ee,O=ae&67108863;C=C+(ae/67108864|0)|0,O=O+P|0,P=O&67108863,C=C+(O>>>26)|0,v+=C>>>26,C&=67108863}f.words[E]=P,h=C,C=v}return h!==0?f.words[E]=h:f.length--,f.strip()}function H(T,y,f){var h=new U;return h.mulp(T,y,f)}s.prototype.mulTo=function(y,f){var h,v=this.length+y.length;return this.length===10&&y.length===10?h=L(this,y,f):v<63?h=D(this,y,f):v<1024?h=K(this,y,f):h=H(this,y,f),h};function U(T,y){this.x=T,this.y=y}U.prototype.makeRBT=function(y){for(var f=new Array(y),h=s.prototype._countBits(y)-1,v=0;v<y;v++)f[v]=this.revBin(v,h,y);return f},U.prototype.revBin=function(y,f,h){if(y===0||y===h-1)return y;for(var v=0,E=0;E<f;E++)v|=(y&1)<<f-E-1,y>>=1;return v},U.prototype.permute=function(y,f,h,v,E,C){for(var P=0;P<C;P++)v[P]=f[y[P]],E[P]=h[y[P]]},U.prototype.transform=function(y,f,h,v,E,C){this.permute(C,y,f,h,v,E);for(var P=1;P<E;P<<=1)for(var M=P<<1,g=Math.cos(2*Math.PI/M),m=Math.sin(2*Math.PI/M),N=0;N<E;N+=M)for(var ee=g,ae=m,O=0;O<P;O++){var te=h[N+O],q=v[N+O],G=h[N+O+P],Y=v[N+O+P],A=ee*G-ae*Y;Y=ee*Y+ae*G,G=A,h[N+O]=te+G,v[N+O]=q+Y,h[N+O+P]=te-G,v[N+O+P]=q-Y,O!==M&&(A=g*ee-m*ae,ae=g*ae+m*ee,ee=A)}},U.prototype.guessLen13b=function(y,f){var h=Math.max(f,y)|1,v=h&1,E=0;for(h=h/2|0;h;h=h>>>1)E++;return 1<<E+1+v},U.prototype.conjugate=function(y,f,h){if(!(h<=1))for(var v=0;v<h/2;v++){var E=y[v];y[v]=y[h-v-1],y[h-v-1]=E,E=f[v],f[v]=-f[h-v-1],f[h-v-1]=-E}},U.prototype.normalize13b=function(y,f){for(var h=0,v=0;v<f/2;v++){var E=Math.round(y[2*v+1]/f)*8192+Math.round(y[2*v]/f)+h;y[v]=E&67108863,E<67108864?h=0:h=E/67108864|0}return y},U.prototype.convert13b=function(y,f,h,v){for(var E=0,C=0;C<f;C++)E=E+(y[C]|0),h[2*C]=E&8191,E=E>>>13,h[2*C+1]=E&8191,E=E>>>13;for(C=2*f;C<v;++C)h[C]=0;i(E===0),i((E&-8192)===0)},U.prototype.stub=function(y){for(var f=new Array(y),h=0;h<y;h++)f[h]=0;return f},U.prototype.mulp=function(y,f,h){var v=2*this.guessLen13b(y.length,f.length),E=this.makeRBT(v),C=this.stub(v),P=new Array(v),M=new Array(v),g=new Array(v),m=new Array(v),N=new Array(v),ee=new Array(v),ae=h.words;ae.length=v,this.convert13b(y.words,y.length,P,v),this.convert13b(f.words,f.length,m,v),this.transform(P,C,M,g,v,E),this.transform(m,C,N,ee,v,E);for(var O=0;O<v;O++){var te=M[O]*N[O]-g[O]*ee[O];g[O]=M[O]*ee[O]+g[O]*N[O],M[O]=te}return this.conjugate(M,g,v),this.transform(M,g,ae,C,v,E),this.conjugate(ae,C,v),this.normalize13b(ae,v),h.negative=y.negative^f.negative,h.length=y.length+f.length,h.strip()},s.prototype.mul=function(y){var f=new s(null);return f.words=new Array(this.length+y.length),this.mulTo(y,f)},s.prototype.mulf=function(y){var f=new s(null);return f.words=new Array(this.length+y.length),H(this,y,f)},s.prototype.imul=function(y){return this.clone().mulTo(y,this)},s.prototype.imuln=function(y){i(typeof y=="number"),i(y<67108864);for(var f=0,h=0;h<this.length;h++){var v=(this.words[h]|0)*y,E=(v&67108863)+(f&67108863);f>>=26,f+=v/67108864|0,f+=E>>>26,this.words[h]=E&67108863}return f!==0&&(this.words[h]=f,this.length++),this},s.prototype.muln=function(y){return this.clone().imuln(y)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(y){var f=I(y);if(f.length===0)return new s(1);for(var h=this,v=0;v<f.length&&f[v]===0;v++,h=h.sqr());if(++v<f.length)for(var E=h.sqr();v<f.length;v++,E=E.sqr())f[v]!==0&&(h=h.mul(E));return h},s.prototype.iushln=function(y){i(typeof y=="number"&&y>=0);var f=y%26,h=(y-f)/26,v=67108863>>>26-f<<26-f,E;if(f!==0){var C=0;for(E=0;E<this.length;E++){var P=this.words[E]&v,M=(this.words[E]|0)-P<<f;this.words[E]=M|C,C=P>>>26-f}C&&(this.words[E]=C,this.length++)}if(h!==0){for(E=this.length-1;E>=0;E--)this.words[E+h]=this.words[E];for(E=0;E<h;E++)this.words[E]=0;this.length+=h}return this.strip()},s.prototype.ishln=function(y){return i(this.negative===0),this.iushln(y)},s.prototype.iushrn=function(y,f,h){i(typeof y=="number"&&y>=0);var v;f?v=(f-f%26)/26:v=0;var E=y%26,C=Math.min((y-E)/26,this.length),P=67108863^67108863>>>E<<E,M=h;if(v-=C,v=Math.max(0,v),M){for(var g=0;g<C;g++)M.words[g]=this.words[g];M.length=C}if(C!==0)if(this.length>C)for(this.length-=C,g=0;g<this.length;g++)this.words[g]=this.words[g+C];else this.words[0]=0,this.length=1;var m=0;for(g=this.length-1;g>=0&&(m!==0||g>=v);g--){var N=this.words[g]|0;this.words[g]=m<<26-E|N>>>E,m=N&P}return M&&m!==0&&(M.words[M.length++]=m),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(y,f,h){return i(this.negative===0),this.iushrn(y,f,h)},s.prototype.shln=function(y){return this.clone().ishln(y)},s.prototype.ushln=function(y){return this.clone().iushln(y)},s.prototype.shrn=function(y){return this.clone().ishrn(y)},s.prototype.ushrn=function(y){return this.clone().iushrn(y)},s.prototype.testn=function(y){i(typeof y=="number"&&y>=0);var f=y%26,h=(y-f)/26,v=1<<f;if(this.length<=h)return!1;var E=this.words[h];return!!(E&v)},s.prototype.imaskn=function(y){i(typeof y=="number"&&y>=0);var f=y%26,h=(y-f)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var v=67108863^67108863>>>f<<f;this.words[this.length-1]&=v}return this.strip()},s.prototype.maskn=function(y){return this.clone().imaskn(y)},s.prototype.iaddn=function(y){return i(typeof y=="number"),i(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},s.prototype._iaddn=function(y){this.words[0]+=y;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},s.prototype.isubn=function(y){if(i(typeof y=="number"),i(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},s.prototype.addn=function(y){return this.clone().iaddn(y)},s.prototype.subn=function(y){return this.clone().isubn(y)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(y,f,h){var v=y.length+h,E;this._expand(v);var C,P=0;for(E=0;E<y.length;E++){C=(this.words[E+h]|0)+P;var M=(y.words[E]|0)*f;C-=M&67108863,P=(C>>26)-(M/67108864|0),this.words[E+h]=C&67108863}for(;E<this.length-h;E++)C=(this.words[E+h]|0)+P,P=C>>26,this.words[E+h]=C&67108863;if(P===0)return this.strip();for(i(P===-1),P=0,E=0;E<this.length;E++)C=-(this.words[E]|0)+P,P=C>>26,this.words[E]=C&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(y,f){var h=this.length-y.length,v=this.clone(),E=y,C=E.words[E.length-1]|0,P=this._countBits(C);h=26-P,h!==0&&(E=E.ushln(h),v.iushln(h),C=E.words[E.length-1]|0);var M=v.length-E.length,g;if(f!=="mod"){g=new s(null),g.length=M+1,g.words=new Array(g.length);for(var m=0;m<g.length;m++)g.words[m]=0}var N=v.clone()._ishlnsubmul(E,1,M);N.negative===0&&(v=N,g&&(g.words[M]=1));for(var ee=M-1;ee>=0;ee--){var ae=(v.words[E.length+ee]|0)*67108864+(v.words[E.length+ee-1]|0);for(ae=Math.min(ae/C|0,67108863),v._ishlnsubmul(E,ae,ee);v.negative!==0;)ae--,v.negative=0,v._ishlnsubmul(E,1,ee),v.isZero()||(v.negative^=1);g&&(g.words[ee]=ae)}return g&&g.strip(),v.strip(),f!=="div"&&h!==0&&v.iushrn(h),{div:g||null,mod:v}},s.prototype.divmod=function(y,f,h){if(i(!y.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var v,E,C;return this.negative!==0&&y.negative===0?(C=this.neg().divmod(y,f),f!=="mod"&&(v=C.div.neg()),f!=="div"&&(E=C.mod.neg(),h&&E.negative!==0&&E.iadd(y)),{div:v,mod:E}):this.negative===0&&y.negative!==0?(C=this.divmod(y.neg(),f),f!=="mod"&&(v=C.div.neg()),{div:v,mod:C.mod}):this.negative&y.negative?(C=this.neg().divmod(y.neg(),f),f!=="div"&&(E=C.mod.neg(),h&&E.negative!==0&&E.isub(y)),{div:C.div,mod:E}):y.length>this.length||this.cmp(y)<0?{div:new s(0),mod:this}:y.length===1?f==="div"?{div:this.divn(y.words[0]),mod:null}:f==="mod"?{div:null,mod:new s(this.modn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new s(this.modn(y.words[0]))}:this._wordDiv(y,f)},s.prototype.div=function(y){return this.divmod(y,"div",!1).div},s.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},s.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},s.prototype.divRound=function(y){var f=this.divmod(y);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(y):f.mod,v=y.ushrn(1),E=y.andln(1),C=h.cmp(v);return C<0||E===1&&C===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},s.prototype.modn=function(y){i(y<=67108863);for(var f=(1<<26)%y,h=0,v=this.length-1;v>=0;v--)h=(f*h+(this.words[v]|0))%y;return h},s.prototype.idivn=function(y){i(y<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var v=(this.words[h]|0)+f*67108864;this.words[h]=v/y|0,f=v%y}return this.strip()},s.prototype.divn=function(y){return this.clone().idivn(y)},s.prototype.egcd=function(y){i(y.negative===0),i(!y.isZero());var f=this,h=y.clone();f.negative!==0?f=f.umod(y):f=f.clone();for(var v=new s(1),E=new s(0),C=new s(0),P=new s(1),M=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++M;for(var g=h.clone(),m=f.clone();!f.isZero();){for(var N=0,ee=1;!(f.words[0]&ee)&&N<26;++N,ee<<=1);if(N>0)for(f.iushrn(N);N-- >0;)(v.isOdd()||E.isOdd())&&(v.iadd(g),E.isub(m)),v.iushrn(1),E.iushrn(1);for(var ae=0,O=1;!(h.words[0]&O)&&ae<26;++ae,O<<=1);if(ae>0)for(h.iushrn(ae);ae-- >0;)(C.isOdd()||P.isOdd())&&(C.iadd(g),P.isub(m)),C.iushrn(1),P.iushrn(1);f.cmp(h)>=0?(f.isub(h),v.isub(C),E.isub(P)):(h.isub(f),C.isub(v),P.isub(E))}return{a:C,b:P,gcd:h.iushln(M)}},s.prototype._invmp=function(y){i(y.negative===0),i(!y.isZero());var f=this,h=y.clone();f.negative!==0?f=f.umod(y):f=f.clone();for(var v=new s(1),E=new s(0),C=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var P=0,M=1;!(f.words[0]&M)&&P<26;++P,M<<=1);if(P>0)for(f.iushrn(P);P-- >0;)v.isOdd()&&v.iadd(C),v.iushrn(1);for(var g=0,m=1;!(h.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(h.iushrn(g);g-- >0;)E.isOdd()&&E.iadd(C),E.iushrn(1);f.cmp(h)>=0?(f.isub(h),v.isub(E)):(h.isub(f),E.isub(v))}var N;return f.cmpn(1)===0?N=v:N=E,N.cmpn(0)<0&&N.iadd(y),N},s.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var f=this.clone(),h=y.clone();f.negative=0,h.negative=0;for(var v=0;f.isEven()&&h.isEven();v++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var E=f.cmp(h);if(E<0){var C=f;f=h,h=C}else if(E===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(v)},s.prototype.invm=function(y){return this.egcd(y).a.umod(y)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(y){return this.words[0]&y},s.prototype.bincn=function(y){i(typeof y=="number");var f=y%26,h=(y-f)/26,v=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=v,this;for(var E=v,C=h;E!==0&&C<this.length;C++){var P=this.words[C]|0;P+=E,E=P>>>26,P&=67108863,this.words[C]=P}return E!==0&&(this.words[C]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(y){var f=y<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var h;if(this.length>1)h=1;else{f&&(y=-y),i(y<=67108863,"Number is too big");var v=this.words[0]|0;h=v===y?0:v<y?-1:1}return this.negative!==0?-h|0:h},s.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var f=this.ucmp(y);return this.negative!==0?-f|0:f},s.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var v=this.words[h]|0,E=y.words[h]|0;if(v!==E){v<E?f=-1:v>E&&(f=1);break}}return f},s.prototype.gtn=function(y){return this.cmpn(y)===1},s.prototype.gt=function(y){return this.cmp(y)===1},s.prototype.gten=function(y){return this.cmpn(y)>=0},s.prototype.gte=function(y){return this.cmp(y)>=0},s.prototype.ltn=function(y){return this.cmpn(y)===-1},s.prototype.lt=function(y){return this.cmp(y)===-1},s.prototype.lten=function(y){return this.cmpn(y)<=0},s.prototype.lte=function(y){return this.cmp(y)<=0},s.prototype.eqn=function(y){return this.cmpn(y)===0},s.prototype.eq=function(y){return this.cmp(y)===0},s.red=function(y){return new X(y)},s.prototype.toRed=function(y){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(y){return this.red=y,this},s.prototype.forceRed=function(y){return i(!this.red,"Already a number in reduction context"),this._forceRed(y)},s.prototype.redAdd=function(y){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},s.prototype.redIAdd=function(y){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},s.prototype.redSub=function(y){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},s.prototype.redISub=function(y){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},s.prototype.redShl=function(y){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},s.prototype.redMul=function(y){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},s.prototype.redIMul=function(y){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(y){return i(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var W={k256:null,p224:null,p192:null,p25519:null};function R(T,y){this.name=T,this.p=new s(y,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}R.prototype._tmp=function(){var y=new s(null);return y.words=new Array(Math.ceil(this.n/13)),y},R.prototype.ireduce=function(y){var f=y,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var v=h<this.n?-1:f.ucmp(this.p);return v===0?(f.words[0]=0,f.length=1):v>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},R.prototype.split=function(y,f){y.iushrn(this.n,0,f)},R.prototype.imulK=function(y){return y.imul(this.k)};function k(){R.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(k,R),k.prototype.split=function(y,f){for(var h=4194303,v=Math.min(y.length,9),E=0;E<v;E++)f.words[E]=y.words[E];if(f.length=v,y.length<=9){y.words[0]=0,y.length=1;return}var C=y.words[9];for(f.words[f.length++]=C&h,E=10;E<y.length;E++){var P=y.words[E]|0;y.words[E-10]=(P&h)<<4|C>>>22,C=P}C>>>=22,y.words[E-10]=C,C===0&&y.length>10?y.length-=10:y.length-=9},k.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var f=0,h=0;h<y.length;h++){var v=y.words[h]|0;f+=v*977,y.words[h]=f&67108863,f=v*64+(f/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function z(){R.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(z,R);function _(){R.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(_,R);function B(){R.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(B,R),B.prototype.imulK=function(y){for(var f=0,h=0;h<y.length;h++){var v=(y.words[h]|0)*19+f,E=v&67108863;v>>>=26,y.words[h]=E,f=v}return f!==0&&(y.words[y.length++]=f),y},s._prime=function(y){if(W[y])return W[y];var f;if(y==="k256")f=new k;else if(y==="p224")f=new z;else if(y==="p192")f=new _;else if(y==="p25519")f=new B;else throw new Error("Unknown prime "+y);return W[y]=f,f};function X(T){if(typeof T=="string"){var y=s._prime(T);this.m=y.p,this.prime=y}else i(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}X.prototype._verify1=function(y){i(y.negative===0,"red works only with positives"),i(y.red,"red works only with red numbers")},X.prototype._verify2=function(y,f){i((y.negative|f.negative)===0,"red works only with positives"),i(y.red&&y.red===f.red,"red works only with red numbers")},X.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):y.umod(this.m)._forceRed(this)},X.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},X.prototype.add=function(y,f){this._verify2(y,f);var h=y.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},X.prototype.iadd=function(y,f){this._verify2(y,f);var h=y.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},X.prototype.sub=function(y,f){this._verify2(y,f);var h=y.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},X.prototype.isub=function(y,f){this._verify2(y,f);var h=y.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},X.prototype.shl=function(y,f){return this._verify1(y),this.imod(y.ushln(f))},X.prototype.imul=function(y,f){return this._verify2(y,f),this.imod(y.imul(f))},X.prototype.mul=function(y,f){return this._verify2(y,f),this.imod(y.mul(f))},X.prototype.isqr=function(y){return this.imul(y,y.clone())},X.prototype.sqr=function(y){return this.mul(y,y)},X.prototype.sqrt=function(y){if(y.isZero())return y.clone();var f=this.m.andln(3);if(i(f%2===1),f===3){var h=this.m.add(new s(1)).iushrn(2);return this.pow(y,h)}for(var v=this.m.subn(1),E=0;!v.isZero()&&v.andln(1)===0;)E++,v.iushrn(1);i(!v.isZero());var C=new s(1).toRed(this),P=C.redNeg(),M=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new s(2*g*g).toRed(this);this.pow(g,M).cmp(P)!==0;)g.redIAdd(P);for(var m=this.pow(g,v),N=this.pow(y,v.addn(1).iushrn(1)),ee=this.pow(y,v),ae=E;ee.cmp(C)!==0;){for(var O=ee,te=0;O.cmp(C)!==0;te++)O=O.redSqr();i(te<ae);var q=this.pow(m,new s(1).iushln(ae-te-1));N=N.redMul(q),m=q.redSqr(),ee=ee.redMul(m),ae=te}return N},X.prototype.invm=function(y){var f=y._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},X.prototype.pow=function(y,f){if(f.isZero())return new s(1).toRed(this);if(f.cmpn(1)===0)return y.clone();var h=4,v=new Array(1<<h);v[0]=new s(1).toRed(this),v[1]=y;for(var E=2;E<v.length;E++)v[E]=this.mul(v[E-1],y);var C=v[0],P=0,M=0,g=f.bitLength()%26;for(g===0&&(g=26),E=f.length-1;E>=0;E--){for(var m=f.words[E],N=g-1;N>=0;N--){var ee=m>>N&1;if(C!==v[0]&&(C=this.sqr(C)),ee===0&&P===0){M=0;continue}P<<=1,P|=ee,M++,!(M!==h&&(E!==0||N!==0))&&(C=this.mul(C,v[P]),M=0,P=0)}g=26}return C},X.prototype.convertTo=function(y){var f=y.umod(this.m);return f===y?f.clone():f},X.prototype.convertFrom=function(y){var f=y.clone();return f.red=null,f},s.mont=function(y){return new re(y)};function re(T){X.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(re,X),re.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},re.prototype.convertFrom=function(y){var f=this.imod(y.mul(this.rinv));return f.red=null,f},re.prototype.imul=function(y,f){if(y.isZero()||f.isZero())return y.words[0]=0,y.length=1,y;var h=y.imul(f),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=h.isub(v).iushrn(this.shift),C=E;return E.cmp(this.m)>=0?C=E.isub(this.m):E.cmpn(0)<0&&(C=E.iadd(this.m)),C._forceRed(this)},re.prototype.mul=function(y,f){if(y.isZero()||f.isZero())return new s(0)._forceRed(this);var h=y.mul(f),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=h.isub(v).iushrn(this.shift),C=E;return E.cmp(this.m)>=0?C=E.isub(this.m):E.cmpn(0)<0&&(C=E.iadd(this.m)),C._forceRed(this)},re.prototype.invm=function(y){var f=this.imod(y._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(t,Wr)})(kn);var Po=k2;function k2(t,e){if(!t)throw new Error(e||"Assertion failed")}k2.equal=function(e,r,i){if(e!=r)throw new Error(i||"Assertion failed: "+e+" != "+r)};var R0={};(function(t){var e=t;function r(s,a){if(Array.isArray(s))return s.slice();if(!s)return[];var u=[];if(typeof s!="string"){for(var l=0;l<s.length;l++)u[l]=s[l]|0;return u}if(a==="hex"){s=s.replace(/[^a-z0-9]+/ig,""),s.length%2!==0&&(s="0"+s);for(var l=0;l<s.length;l+=2)u.push(parseInt(s[l]+s[l+1],16))}else for(var l=0;l<s.length;l++){var d=s.charCodeAt(l),b=d>>8,w=d&255;b?u.push(b,w):u.push(w)}return u}e.toArray=r;function i(s){return s.length===1?"0"+s:s}e.zero2=i;function n(s){for(var a="",u=0;u<s.length;u++)a+=i(s[u].toString(16));return a}e.toHex=n,e.encode=function(a,u){return u==="hex"?n(a):a}})(R0),function(t){var e=t,r=kn.exports,i=Po,n=R0;e.assert=i,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode;function s(b,w,S){var I=new Array(Math.max(b.bitLength(),S)+1),D;for(D=0;D<I.length;D+=1)I[D]=0;var L=1<<w+1,K=b.clone();for(D=0;D<I.length;D++){var H,U=K.andln(L-1);K.isOdd()?(U>(L>>1)-1?H=(L>>1)-U:H=U,K.isubn(H)):H=0,I[D]=H,K.iushrn(1)}return I}e.getNAF=s;function a(b,w){var S=[[],[]];b=b.clone(),w=w.clone();for(var I=0,D=0,L;b.cmpn(-I)>0||w.cmpn(-D)>0;){var K=b.andln(3)+I&3,H=w.andln(3)+D&3;K===3&&(K=-1),H===3&&(H=-1);var U;K&1?(L=b.andln(7)+I&7,(L===3||L===5)&&H===2?U=-K:U=K):U=0,S[0].push(U);var W;H&1?(L=w.andln(7)+D&7,(L===3||L===5)&&K===2?W=-H:W=H):W=0,S[1].push(W),2*I===U+1&&(I=1-I),2*D===W+1&&(D=1-D),b.iushrn(1),w.iushrn(1)}return S}e.getJSF=a;function u(b,w,S){var I="_"+w;b.prototype[w]=function(){return this[I]!==void 0?this[I]:this[I]=S.call(this)}}e.cachedProperty=u;function l(b){return typeof b=="string"?e.toArray(b,"hex"):b}e.parseBytes=l;function d(b){return new r(b,"hex","le")}e.intFromLE=d}(Ni);var Df={exports:{}},N0;Df.exports=function(e){return N0||(N0=new Js(null)),N0.generate(e)};function Js(t){this.rand=t}if(Df.exports.Rand=Js,Js.prototype.generate=function(e){return this._rand(e)},Js.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),i=0;i<r.length;i++)r[i]=this.rand.getByte();return r},typeof self=="object")self.crypto&&self.crypto.getRandomValues?Js.prototype._rand=function(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Js.prototype._rand=function(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(Js.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var j2=C0;if(typeof j2.randomBytes!="function")throw new Error("Not supported");Js.prototype._rand=function(e){return j2.randomBytes(e)}}catch{}var T0={},$o=kn.exports,Zc=Ni,Of=Zc.getNAF,g9=Zc.getJSF,Pf=Zc.assert;function Qs(t,e){this.type=t,this.p=new $o(e.p,16),this.red=e.prime?$o.red(e.prime):$o.mont(this.p),this.zero=new $o(0).toRed(this.red),this.one=new $o(1).toRed(this.red),this.two=new $o(2).toRed(this.red),this.n=e.n&&new $o(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var $f=Qs;Qs.prototype.point=function(){throw new Error("Not implemented")},Qs.prototype.validate=function(){throw new Error("Not implemented")},Qs.prototype._fixedNafMul=function(e,r){Pf(e.precomputed);var i=e._getDoubles(),n=Of(r,1,this._bitLength),s=(1<<i.step+1)-(i.step%2===0?2:1);s/=3;var a=[],u,l;for(u=0;u<n.length;u+=i.step){l=0;for(var d=u+i.step-1;d>=u;d--)l=(l<<1)+n[d];a.push(l)}for(var b=this.jpoint(null,null,null),w=this.jpoint(null,null,null),S=s;S>0;S--){for(u=0;u<a.length;u++)l=a[u],l===S?w=w.mixedAdd(i.points[u]):l===-S&&(w=w.mixedAdd(i.points[u].neg()));b=b.add(w)}return b.toP()},Qs.prototype._wnafMul=function(e,r){var i=4,n=e._getNAFPoints(i);i=n.wnd;for(var s=n.points,a=Of(r,i,this._bitLength),u=this.jpoint(null,null,null),l=a.length-1;l>=0;l--){for(var d=0;l>=0&&a[l]===0;l--)d++;if(l>=0&&d++,u=u.dblp(d),l<0)break;var b=a[l];Pf(b!==0),e.type==="affine"?b>0?u=u.mixedAdd(s[b-1>>1]):u=u.mixedAdd(s[-b-1>>1].neg()):b>0?u=u.add(s[b-1>>1]):u=u.add(s[-b-1>>1].neg())}return e.type==="affine"?u.toP():u},Qs.prototype._wnafMulAdd=function(e,r,i,n,s){var a=this._wnafT1,u=this._wnafT2,l=this._wnafT3,d=0,b,w,S;for(b=0;b<n;b++){S=r[b];var I=S._getNAFPoints(e);a[b]=I.wnd,u[b]=I.points}for(b=n-1;b>=1;b-=2){var D=b-1,L=b;if(a[D]!==1||a[L]!==1){l[D]=Of(i[D],a[D],this._bitLength),l[L]=Of(i[L],a[L],this._bitLength),d=Math.max(l[D].length,d),d=Math.max(l[L].length,d);continue}var K=[r[D],null,null,r[L]];r[D].y.cmp(r[L].y)===0?(K[1]=r[D].add(r[L]),K[2]=r[D].toJ().mixedAdd(r[L].neg())):r[D].y.cmp(r[L].y.redNeg())===0?(K[1]=r[D].toJ().mixedAdd(r[L]),K[2]=r[D].add(r[L].neg())):(K[1]=r[D].toJ().mixedAdd(r[L]),K[2]=r[D].toJ().mixedAdd(r[L].neg()));var H=[-3,-1,-5,-7,0,7,5,1,3],U=g9(i[D],i[L]);for(d=Math.max(U[0].length,d),l[D]=new Array(d),l[L]=new Array(d),w=0;w<d;w++){var W=U[0][w]|0,R=U[1][w]|0;l[D][w]=H[(W+1)*3+(R+1)],l[L][w]=0,u[D]=K}}var k=this.jpoint(null,null,null),z=this._wnafT4;for(b=d;b>=0;b--){for(var _=0;b>=0;){var B=!0;for(w=0;w<n;w++)z[w]=l[w][b]|0,z[w]!==0&&(B=!1);if(!B)break;_++,b--}if(b>=0&&_++,k=k.dblp(_),b<0)break;for(w=0;w<n;w++){var X=z[w];X!==0&&(X>0?S=u[w][X-1>>1]:X<0&&(S=u[w][-X-1>>1].neg()),S.type==="affine"?k=k.mixedAdd(S):k=k.add(S))}}for(b=0;b<n;b++)u[b]=null;return s?k:k.toP()};function Wi(t,e){this.curve=t,this.type=e,this.precomputed=null}Qs.BasePoint=Wi,Wi.prototype.eq=function(){throw new Error("Not implemented")},Wi.prototype.validate=function(){return this.curve.validate(this)},Qs.prototype.decodePoint=function(e,r){e=Zc.toArray(e,r);var i=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*i){e[0]===6?Pf(e[e.length-1]%2===0):e[0]===7&&Pf(e[e.length-1]%2===1);var n=this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));return n}else if((e[0]===2||e[0]===3)&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),e[0]===3);throw new Error("Unknown point format")},Wi.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Wi.prototype._encode=function(e){var r=this.curve.p.byteLength(),i=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",r))},Wi.prototype.encode=function(e,r){return Zc.encode(this._encode(r),e)},Wi.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},Wi.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1},Wi.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,s=0;s<r;s+=e){for(var a=0;a<e;a++)n=n.dbl();i.push(n)}return{step:e,points:i}},Wi.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],i=(1<<e)-1,n=i===1?null:this.dbl(),s=1;s<i;s++)r[s]=r[s-1].add(n);return{wnd:e,points:r}},Wi.prototype._getBeta=function(){return null},Wi.prototype.dblp=function(e){for(var r=this,i=0;i<e;i++)r=r.dbl();return r};var Da={exports:{}};typeof Object.create=="function"?Da.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Da.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}};var v9=Ni,hr=kn.exports,L0=Da.exports,Oa=$f,m9=v9.assert;function Vi(t){Oa.call(this,"short",t),this.a=new hr(t.a,16).toRed(this.red),this.b=new hr(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}L0(Vi,Oa);var b9=Vi;Vi.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,i;if(e.beta)r=new hr(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);r=n[0].cmp(n[1])<0?n[0]:n[1],r=r.toRed(this.red)}if(e.lambda)i=new hr(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?i=s[0]:(i=s[1],m9(this.g.mul(i).x.cmp(this.g.x.redMul(r))===0))}var a;return e.basis?a=e.basis.map(function(u){return{a:new hr(u.a,16),b:new hr(u.b,16)}}):a=this._getEndoBasis(i),{beta:r,lambda:i,basis:a}}},Vi.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:hr.mont(e),i=new hr(2).toRed(r).redInvm(),n=i.redNeg(),s=new hr(3).toRed(r).redNeg().redSqrt().redMul(i),a=n.redAdd(s).fromRed(),u=n.redSub(s).fromRed();return[a,u]},Vi.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,n=this.n.clone(),s=new hr(1),a=new hr(0),u=new hr(0),l=new hr(1),d,b,w,S,I,D,L,K=0,H,U;i.cmpn(0)!==0;){var W=n.div(i);H=n.sub(W.mul(i)),U=u.sub(W.mul(s));var R=l.sub(W.mul(a));if(!w&&H.cmp(r)<0)d=L.neg(),b=s,w=H.neg(),S=U;else if(w&&++K===2)break;L=H,n=i,i=H,u=s,s=U,l=a,a=R}I=H.neg(),D=U;var k=w.sqr().add(S.sqr()),z=I.sqr().add(D.sqr());return z.cmp(k)>=0&&(I=d,D=b),w.negative&&(w=w.neg(),S=S.neg()),I.negative&&(I=I.neg(),D=D.neg()),[{a:w,b:S},{a:I,b:D}]},Vi.prototype._endoSplit=function(e){var r=this.endo.basis,i=r[0],n=r[1],s=n.b.mul(e).divRound(this.n),a=i.b.neg().mul(e).divRound(this.n),u=s.mul(i.a),l=a.mul(n.a),d=s.mul(i.b),b=a.mul(n.b),w=e.sub(u).sub(l),S=d.add(b).neg();return{k1:w,k2:S}},Vi.prototype.pointFromX=function(e,r){e=new hr(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var s=n.fromRed().isOdd();return(r&&!s||!r&&s)&&(n=n.redNeg()),this.point(e,n)},Vi.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,i=e.y,n=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(s).cmpn(0)===0},Vi.prototype._endoWnafMulAdd=function(e,r,i){for(var n=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var u=this._endoSplit(r[a]),l=e[a],d=l._getBeta();u.k1.negative&&(u.k1.ineg(),l=l.neg(!0)),u.k2.negative&&(u.k2.ineg(),d=d.neg(!0)),n[a*2]=l,n[a*2+1]=d,s[a*2]=u.k1,s[a*2+1]=u.k2}for(var b=this._wnafMulAdd(1,n,s,a*2,i),w=0;w<a*2;w++)n[w]=null,s[w]=null;return b};function Dr(t,e,r,i){Oa.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new hr(e,16),this.y=new hr(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}L0(Dr,Oa.BasePoint),Vi.prototype.point=function(e,r,i){return new Dr(this,e,r,i)},Vi.prototype.pointFromJSON=function(e,r){return Dr.fromJSON(this,e,r)},Dr.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,n=function(s){return i.point(s.x.redMul(i.endo.beta),s.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return r}},Dr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Dr.fromJSON=function(e,r,i){typeof r=="string"&&(r=JSON.parse(r));var n=e.point(r[0],r[1],i);if(!r[2])return n;function s(u){return e.point(u[0],u[1],i)}var a=r[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(s))}},n},Dr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Dr.prototype.isInfinity=function(){return this.inf},Dr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(e.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},Dr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),s=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),a=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,u)},Dr.prototype.getX=function(){return this.x.fromRed()},Dr.prototype.getY=function(){return this.y.fromRed()},Dr.prototype.mul=function(e){return e=new hr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Dr.prototype.mulAdd=function(e,r,i){var n=[this,r],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s):this.curve._wnafMulAdd(1,n,s,2)},Dr.prototype.jmulAdd=function(e,r,i){var n=[this,r],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s,!0):this.curve._wnafMulAdd(1,n,s,2,!0)},Dr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},Dr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(s){return s.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r},Dr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Ur(t,e,r,i){Oa.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new hr(0)):(this.x=new hr(e,16),this.y=new hr(r,16),this.z=new hr(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}L0(Ur,Oa.BasePoint),Vi.prototype.jpoint=function(e,r,i){return new Ur(this,e,r,i)},Ur.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(e);return this.curve.point(i,n)},Ur.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ur.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),s=e.x.redMul(i),a=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(i.redMul(this.z)),l=n.redSub(s),d=a.redSub(u);if(l.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=l.redSqr(),w=b.redMul(l),S=n.redMul(b),I=d.redSqr().redIAdd(w).redISub(S).redISub(S),D=d.redMul(S.redISub(I)).redISub(a.redMul(w)),L=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(I,D,L)},Ur.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=e.x.redMul(r),s=this.y,a=e.y.redMul(r).redMul(this.z),u=i.redSub(n),l=s.redSub(a);if(u.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=u.redSqr(),b=d.redMul(u),w=i.redMul(d),S=l.redSqr().redIAdd(b).redISub(w).redISub(w),I=l.redMul(w.redISub(S)).redISub(s.redMul(b)),D=this.z.redMul(u);return this.curve.jpoint(S,I,D)},Ur.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r<e;r++)i=i.dbl();return i}var n=this.curve.a,s=this.curve.tinv,a=this.x,u=this.y,l=this.z,d=l.redSqr().redSqr(),b=u.redAdd(u);for(r=0;r<e;r++){var w=a.redSqr(),S=b.redSqr(),I=S.redSqr(),D=w.redAdd(w).redIAdd(w).redIAdd(n.redMul(d)),L=a.redMul(S),K=D.redSqr().redISub(L.redAdd(L)),H=L.redISub(K),U=D.redMul(H);U=U.redIAdd(U).redISub(I);var W=b.redMul(l);r+1<e&&(d=d.redMul(I)),a=K,l=W,b=U}return this.curve.jpoint(a,b.redMul(s),l)},Ur.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Ur.prototype._zeroDbl=function(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(n).redISub(a);u=u.redIAdd(u);var l=n.redAdd(n).redIAdd(n),d=l.redSqr().redISub(u).redISub(u),b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),e=d,r=l.redMul(u.redISub(d)).redISub(b),i=this.y.redAdd(this.y)}else{var w=this.x.redSqr(),S=this.y.redSqr(),I=S.redSqr(),D=this.x.redAdd(S).redSqr().redISub(w).redISub(I);D=D.redIAdd(D);var L=w.redAdd(w).redIAdd(w),K=L.redSqr(),H=I.redIAdd(I);H=H.redIAdd(H),H=H.redIAdd(H),e=K.redISub(D).redISub(D),r=L.redMul(D.redISub(e)).redISub(H),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(e,r,i)},Ur.prototype._threeDbl=function(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(n).redISub(a);u=u.redIAdd(u);var l=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),d=l.redSqr().redISub(u).redISub(u);e=d;var b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),r=l.redMul(u.redISub(d)).redISub(b),i=this.y.redAdd(this.y)}else{var w=this.z.redSqr(),S=this.y.redSqr(),I=this.x.redMul(S),D=this.x.redSub(w).redMul(this.x.redAdd(w));D=D.redAdd(D).redIAdd(D);var L=I.redIAdd(I);L=L.redIAdd(L);var K=L.redAdd(L);e=D.redSqr().redISub(K),i=this.y.redAdd(this.z).redSqr().redISub(S).redISub(w);var H=S.redSqr();H=H.redIAdd(H),H=H.redIAdd(H),H=H.redIAdd(H),r=D.redMul(L.redISub(e)).redISub(H)}return this.curve.jpoint(e,r,i)},Ur.prototype._dbl=function(){var e=this.curve.a,r=this.x,i=this.y,n=this.z,s=n.redSqr().redSqr(),a=r.redSqr(),u=i.redSqr(),l=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),d=r.redAdd(r);d=d.redIAdd(d);var b=d.redMul(u),w=l.redSqr().redISub(b.redAdd(b)),S=b.redISub(w),I=u.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var D=l.redMul(S).redISub(I),L=i.redAdd(i).redMul(n);return this.curve.jpoint(w,D,L)},Ur.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr(),n=r.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),u=this.x.redAdd(r).redSqr().redISub(e).redISub(n);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(a);var l=u.redSqr(),d=n.redIAdd(n);d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var b=s.redIAdd(u).redSqr().redISub(a).redISub(l).redISub(d),w=r.redMul(b);w=w.redIAdd(w),w=w.redIAdd(w);var S=this.x.redMul(l).redISub(w);S=S.redIAdd(S),S=S.redIAdd(S);var I=this.y.redMul(b.redMul(d.redISub(b)).redISub(u.redMul(l)));I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var D=this.z.redAdd(u).redSqr().redISub(i).redISub(l);return this.curve.jpoint(S,I,D)},Ur.prototype.mul=function(e,r){return e=new hr(e,r),this.curve._wnafMul(this,e)},Ur.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),i=e.z.redSqr();if(this.x.redMul(i).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var n=r.redMul(this.z),s=i.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(n)).cmpn(0)===0},Ur.prototype.eqXToP=function(e){var r=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(i)===0)return!0;for(var n=e.clone(),s=this.curve.redN.redMul(r);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(s),this.x.cmp(i)===0)return!0}},Ur.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Ur.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Pa=kn.exports,q2=Da.exports,Rf=$f,y9=Ni;function $a(t){Rf.call(this,"mont",t),this.a=new Pa(t.a,16).toRed(this.red),this.b=new Pa(t.b,16).toRed(this.red),this.i4=new Pa(4).toRed(this.red).redInvm(),this.two=new Pa(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}q2($a,Rf);var w9=$a;$a.prototype.validate=function(e){var r=e.normalize().x,i=r.redSqr(),n=i.redMul(r).redAdd(i.redMul(this.a)).redAdd(r),s=n.redSqrt();return s.redSqr().cmp(n)===0};function Or(t,e,r){Rf.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Pa(e,16),this.z=new Pa(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}q2(Or,Rf.BasePoint),$a.prototype.decodePoint=function(e,r){return this.point(y9.toArray(e,r),1)},$a.prototype.point=function(e,r){return new Or(this,e,r)},$a.prototype.pointFromJSON=function(e){return Or.fromJSON(this,e)},Or.prototype.precompute=function(){},Or.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Or.fromJSON=function(e,r){return new Or(e,r[0],r[1]||e.one)},Or.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Or.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Or.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),s=r.redSub(n),a=r.redMul(n),u=s.redMul(n.redAdd(this.curve.a24.redMul(s)));return this.curve.point(a,u)},Or.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Or.prototype.diffAdd=function(e,r){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),s=e.x.redAdd(e.z),a=e.x.redSub(e.z),u=a.redMul(i),l=s.redMul(n),d=r.z.redMul(u.redAdd(l).redSqr()),b=r.x.redMul(u.redISub(l).redSqr());return this.curve.point(d,b)},Or.prototype.mul=function(e){for(var r=e.clone(),i=this,n=this.curve.point(null,null),s=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var u=a.length-1;u>=0;u--)a[u]===0?(i=i.diffAdd(n,s),n=n.dbl()):(n=i.diffAdd(n,s),i=i.dbl());return n},Or.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Or.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Or.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},Or.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Or.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var _9=Ni,As=kn.exports,z2=Da.exports,Nf=$f,E9=_9.assert;function jn(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Nf.call(this,"edwards",t),this.a=new As(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new As(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new As(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),E9(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}z2(jn,Nf);var A9=jn;jn.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},jn.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},jn.prototype.jpoint=function(e,r,i,n){return this.point(e,r,i,n)},jn.prototype.pointFromX=function(e,r){e=new As(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),s=this.one.redSub(this.c2.redMul(this.d).redMul(i)),a=n.redMul(s.redInvm()),u=a.redSqrt();if(u.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var l=u.fromRed().isOdd();return(r&&!l||!r&&l)&&(u=u.redNeg()),this.point(e,u)},jn.prototype.pointFromY=function(e,r){e=new As(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),s=i.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(s.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var u=a.redSqrt();if(u.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,e)},jn.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),i=e.y.redSqr(),n=r.redMul(this.a).redAdd(i),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(i)));return n.cmp(s)===0};function ir(t,e,r,i,n){Nf.BasePoint.call(this,t,"projective"),e===null&&r===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new As(e,16),this.y=new As(r,16),this.z=i?new As(i,16):this.curve.one,this.t=n&&new As(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}z2(ir,Nf.BasePoint),jn.prototype.pointFromJSON=function(e){return ir.fromJSON(this,e)},jn.prototype.point=function(e,r,i,n){return new ir(this,e,r,i,n)},ir.fromJSON=function(e,r){return new ir(e,r[0],r[1],r[2])},ir.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},ir.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},ir.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),a=n.redAdd(r),u=a.redSub(i),l=n.redSub(r),d=s.redMul(u),b=a.redMul(l),w=s.redMul(l),S=u.redMul(a);return this.curve.point(d,b,S,w)},ir.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),i=this.y.redSqr(),n,s,a,u,l,d;if(this.curve.twisted){u=this.curve._mulA(r);var b=u.redAdd(i);this.zOne?(n=e.redSub(r).redSub(i).redMul(b.redSub(this.curve.two)),s=b.redMul(u.redSub(i)),a=b.redSqr().redSub(b).redSub(b)):(l=this.z.redSqr(),d=b.redSub(l).redISub(l),n=e.redSub(r).redISub(i).redMul(d),s=b.redMul(u.redSub(i)),a=b.redMul(d))}else u=r.redAdd(i),l=this.curve._mulC(this.z).redSqr(),d=u.redSub(l).redSub(l),n=this.curve._mulC(e.redISub(u)).redMul(d),s=this.curve._mulC(u).redMul(r.redISub(i)),a=u.redMul(d);return this.curve.point(n,s,a)},ir.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},ir.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),a=i.redSub(r),u=s.redSub(n),l=s.redAdd(n),d=i.redAdd(r),b=a.redMul(u),w=l.redMul(d),S=a.redMul(d),I=u.redMul(l);return this.curve.point(b,w,I,S)},ir.prototype._projAdd=function(e){var r=this.z.redMul(e.z),i=r.redSqr(),n=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(n).redMul(s),u=i.redSub(a),l=i.redAdd(a),d=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(s),b=r.redMul(u).redMul(d),w,S;return this.curve.twisted?(w=r.redMul(l).redMul(s.redSub(this.curve._mulA(n))),S=u.redMul(l)):(w=r.redMul(l).redMul(s.redSub(n)),S=this.curve._mulC(u).redMul(l)),this.curve.point(b,w,S)},ir.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},ir.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},ir.prototype.mulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!1)},ir.prototype.jmulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!0)},ir.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},ir.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},ir.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ir.prototype.getY=function(){return this.normalize(),this.y.fromRed()},ir.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},ir.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}},ir.prototype.toP=ir.prototype.normalize,ir.prototype.mixedAdd=ir.prototype.add,function(t){var e=t;e.base=$f,e.short=b9,e.mont=w9,e.edwards=A9}(T0);var Tf={},Lf={},$t={},x9=Po,S9=Da.exports;$t.inherits=S9;function I9(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function M9(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var s=t.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=s&63|128):I9(t,n)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++n)&1023),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=s&63|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=s&63|128)}else for(n=0;n<t.length;n++)r[n]=t[n]|0;return r}$t.toArray=M9;function C9(t){for(var e="",r=0;r<t.length;r++)e+=K2(t[r].toString(16));return e}$t.toHex=C9;function H2(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}$t.htonl=H2;function D9(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];e==="little"&&(n=H2(n)),r+=W2(n.toString(16))}return r}$t.toHex32=D9;function K2(t){return t.length===1?"0"+t:t}$t.zero2=K2;function W2(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}$t.zero8=W2;function O9(t,e,r,i){var n=r-e;x9(n%4===0);for(var s=new Array(n/4),a=0,u=e;a<s.length;a++,u+=4){var l;i==="big"?l=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:l=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=l>>>0}return s}$t.join32=O9;function P9(t,e){for(var r=new Array(t.length*4),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];e==="big"?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=s&255):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=s&255)}return r}$t.split32=P9;function $9(t,e){return t>>>e|t<<32-e}$t.rotr32=$9;function R9(t,e){return t<<e|t>>>32-e}$t.rotl32=R9;function N9(t,e){return t+e>>>0}$t.sum32=N9;function T9(t,e,r){return t+e+r>>>0}$t.sum32_3=T9;function L9(t,e,r,i){return t+e+r+i>>>0}$t.sum32_4=L9;function B9(t,e,r,i,n){return t+e+r+i+n>>>0}$t.sum32_5=B9;function F9(t,e,r,i){var n=t[e],s=t[e+1],a=i+s>>>0,u=(a<i?1:0)+r+n;t[e]=u>>>0,t[e+1]=a}$t.sum64=F9;function U9(t,e,r,i){var n=e+i>>>0,s=(n<e?1:0)+t+r;return s>>>0}$t.sum64_hi=U9;function k9(t,e,r,i){var n=e+i;return n>>>0}$t.sum64_lo=k9;function j9(t,e,r,i,n,s,a,u){var l=0,d=e;d=d+i>>>0,l+=d<e?1:0,d=d+s>>>0,l+=d<s?1:0,d=d+u>>>0,l+=d<u?1:0;var b=t+r+n+a+l;return b>>>0}$t.sum64_4_hi=j9;function q9(t,e,r,i,n,s,a,u){var l=e+i+s+u;return l>>>0}$t.sum64_4_lo=q9;function z9(t,e,r,i,n,s,a,u,l,d){var b=0,w=e;w=w+i>>>0,b+=w<e?1:0,w=w+s>>>0,b+=w<s?1:0,w=w+u>>>0,b+=w<u?1:0,w=w+d>>>0,b+=w<d?1:0;var S=t+r+n+a+l+b;return S>>>0}$t.sum64_5_hi=z9;function H9(t,e,r,i,n,s,a,u,l,d){var b=e+i+s+u+d;return b>>>0}$t.sum64_5_lo=H9;function K9(t,e,r){var i=e<<32-r|t>>>r;return i>>>0}$t.rotr64_hi=K9;function W9(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}$t.rotr64_lo=W9;function V9(t,e,r){return t>>>r}$t.shr64_hi=V9;function G9(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}$t.shr64_lo=G9;var Ra={},V2=$t,Y9=Po;function Bf(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ra.BlockHash=Bf,Bf.prototype.update=function(e,r){if(e=V2.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=V2.join32(e,0,e.length-i,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},Bf.prototype.digest=function(e){return this.update(this._pad()),Y9(this.pending===null),this._digest(e)},Bf.prototype._pad=function(){var e=this.pendingTotal,r=this._delta8,i=r-(e+this.padLength)%r,n=new Array(i+this.padLength);n[0]=128;for(var s=1;s<i;s++)n[s]=0;if(e<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)n[s++]=0;n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=e>>>24&255,n[s++]=e>>>16&255,n[s++]=e>>>8&255,n[s++]=e&255}else for(n[s++]=e&255,n[s++]=e>>>8&255,n[s++]=e>>>16&255,n[s++]=e>>>24&255,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,a=8;a<this.padLength;a++)n[s++]=0;return n};var Na={},qn={},J9=$t,zn=J9.rotr32;function Q9(t,e,r,i){if(t===0)return G2(e,r,i);if(t===1||t===3)return J2(e,r,i);if(t===2)return Y2(e,r,i)}qn.ft_1=Q9;function G2(t,e,r){return t&e^~t&r}qn.ch32=G2;function Y2(t,e,r){return t&e^t&r^e&r}qn.maj32=Y2;function J2(t,e,r){return t^e^r}qn.p32=J2;function Z9(t){return zn(t,2)^zn(t,13)^zn(t,22)}qn.s0_256=Z9;function X9(t){return zn(t,6)^zn(t,11)^zn(t,25)}qn.s1_256=X9;function e_(t){return zn(t,7)^zn(t,18)^t>>>3}qn.g0_256=e_;function t_(t){return zn(t,17)^zn(t,19)^t>>>10}qn.g1_256=t_;var Ta=$t,r_=Ra,i_=qn,B0=Ta.rotl32,Xc=Ta.sum32,n_=Ta.sum32_5,s_=i_.ft_1,Q2=r_.BlockHash,o_=[1518500249,1859775393,2400959708,3395469782];function Hn(){if(!(this instanceof Hn))return new Hn;Q2.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ta.inherits(Hn,Q2);var a_=Hn;Hn.blockSize=512,Hn.outSize=160,Hn.hmacStrength=80,Hn.padLength=64,Hn.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n<i.length;n++)i[n]=B0(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var s=this.h[0],a=this.h[1],u=this.h[2],l=this.h[3],d=this.h[4];for(n=0;n<i.length;n++){var b=~~(n/20),w=n_(B0(s,5),s_(b,a,u,l),d,i[n],o_[b]);d=l,l=u,u=B0(a,30),a=s,s=w}this.h[0]=Xc(this.h[0],s),this.h[1]=Xc(this.h[1],a),this.h[2]=Xc(this.h[2],u),this.h[3]=Xc(this.h[3],l),this.h[4]=Xc(this.h[4],d)},Hn.prototype._digest=function(e){return e==="hex"?Ta.toHex32(this.h,"big"):Ta.split32(this.h,"big")};var La=$t,c_=Ra,Ba=qn,u_=Po,mn=La.sum32,f_=La.sum32_4,h_=La.sum32_5,l_=Ba.ch32,d_=Ba.maj32,p_=Ba.s0_256,g_=Ba.s1_256,v_=Ba.g0_256,m_=Ba.g1_256,Z2=c_.BlockHash,b_=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Kn(){if(!(this instanceof Kn))return new Kn;Z2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b_,this.W=new Array(64)}La.inherits(Kn,Z2);var X2=Kn;Kn.blockSize=512,Kn.outSize=256,Kn.hmacStrength=192,Kn.padLength=64,Kn.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n<i.length;n++)i[n]=f_(m_(i[n-2]),i[n-7],v_(i[n-15]),i[n-16]);var s=this.h[0],a=this.h[1],u=this.h[2],l=this.h[3],d=this.h[4],b=this.h[5],w=this.h[6],S=this.h[7];for(u_(this.k.length===i.length),n=0;n<i.length;n++){var I=h_(S,g_(d),l_(d,b,w),this.k[n],i[n]),D=mn(p_(s),d_(s,a,u));S=w,w=b,b=d,d=mn(l,I),l=u,u=a,a=s,s=mn(I,D)}this.h[0]=mn(this.h[0],s),this.h[1]=mn(this.h[1],a),this.h[2]=mn(this.h[2],u),this.h[3]=mn(this.h[3],l),this.h[4]=mn(this.h[4],d),this.h[5]=mn(this.h[5],b),this.h[6]=mn(this.h[6],w),this.h[7]=mn(this.h[7],S)},Kn.prototype._digest=function(e){return e==="hex"?La.toHex32(this.h,"big"):La.split32(this.h,"big")};var F0=$t,ev=X2;function xs(){if(!(this instanceof xs))return new xs;ev.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}F0.inherits(xs,ev);var y_=xs;xs.blockSize=512,xs.outSize=224,xs.hmacStrength=192,xs.padLength=64,xs.prototype._digest=function(e){return e==="hex"?F0.toHex32(this.h.slice(0,7),"big"):F0.split32(this.h.slice(0,7),"big")};var gi=$t,w_=Ra,__=Po,Wn=gi.rotr64_hi,Vn=gi.rotr64_lo,tv=gi.shr64_hi,rv=gi.shr64_lo,Zs=gi.sum64,U0=gi.sum64_hi,k0=gi.sum64_lo,E_=gi.sum64_4_hi,A_=gi.sum64_4_lo,x_=gi.sum64_5_hi,S_=gi.sum64_5_lo,iv=w_.BlockHash,I_=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function bn(){if(!(this instanceof bn))return new bn;iv.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=I_,this.W=new Array(160)}gi.inherits(bn,iv);var nv=bn;bn.blockSize=1024,bn.outSize=512,bn.hmacStrength=192,bn.padLength=128,bn.prototype._prepareBlock=function(e,r){for(var i=this.W,n=0;n<32;n++)i[n]=e[r+n];for(;n<i.length;n+=2){var s=B_(i[n-4],i[n-3]),a=F_(i[n-4],i[n-3]),u=i[n-14],l=i[n-13],d=T_(i[n-30],i[n-29]),b=L_(i[n-30],i[n-29]),w=i[n-32],S=i[n-31];i[n]=E_(s,a,u,l,d,b,w,S),i[n+1]=A_(s,a,u,l,d,b,w,S)}},bn.prototype._update=function(e,r){this._prepareBlock(e,r);var i=this.W,n=this.h[0],s=this.h[1],a=this.h[2],u=this.h[3],l=this.h[4],d=this.h[5],b=this.h[6],w=this.h[7],S=this.h[8],I=this.h[9],D=this.h[10],L=this.h[11],K=this.h[12],H=this.h[13],U=this.h[14],W=this.h[15];__(this.k.length===i.length);for(var R=0;R<i.length;R+=2){var k=U,z=W,_=R_(S,I),B=N_(S,I),X=M_(S,I,D,L,K),re=C_(S,I,D,L,K,H),T=this.k[R],y=this.k[R+1],f=i[R],h=i[R+1],v=x_(k,z,_,B,X,re,T,y,f,h),E=S_(k,z,_,B,X,re,T,y,f,h);k=P_(n,s),z=$_(n,s),_=D_(n,s,a,u,l),B=O_(n,s,a,u,l,d);var C=U0(k,z,_,B),P=k0(k,z,_,B);U=K,W=H,K=D,H=L,D=S,L=I,S=U0(b,w,v,E),I=k0(w,w,v,E),b=l,w=d,l=a,d=u,a=n,u=s,n=U0(v,E,C,P),s=k0(v,E,C,P)}Zs(this.h,0,n,s),Zs(this.h,2,a,u),Zs(this.h,4,l,d),Zs(this.h,6,b,w),Zs(this.h,8,S,I),Zs(this.h,10,D,L),Zs(this.h,12,K,H),Zs(this.h,14,U,W)},bn.prototype._digest=function(e){return e==="hex"?gi.toHex32(this.h,"big"):gi.split32(this.h,"big")};function M_(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function C_(t,e,r,i,n,s){var a=e&i^~e&s;return a<0&&(a+=4294967296),a}function D_(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function O_(t,e,r,i,n,s){var a=e&i^e&s^i&s;return a<0&&(a+=4294967296),a}function P_(t,e){var r=Wn(t,e,28),i=Wn(e,t,2),n=Wn(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function $_(t,e){var r=Vn(t,e,28),i=Vn(e,t,2),n=Vn(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function R_(t,e){var r=Wn(t,e,14),i=Wn(t,e,18),n=Wn(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function N_(t,e){var r=Vn(t,e,14),i=Vn(t,e,18),n=Vn(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function T_(t,e){var r=Wn(t,e,1),i=Wn(t,e,8),n=tv(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function L_(t,e){var r=Vn(t,e,1),i=Vn(t,e,8),n=rv(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function B_(t,e){var r=Wn(t,e,19),i=Wn(e,t,29),n=tv(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}function F_(t,e){var r=Vn(t,e,19),i=Vn(e,t,29),n=rv(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}var j0=$t,sv=nv;function Ss(){if(!(this instanceof Ss))return new Ss;sv.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}j0.inherits(Ss,sv);var U_=Ss;Ss.blockSize=1024,Ss.outSize=384,Ss.hmacStrength=192,Ss.padLength=128,Ss.prototype._digest=function(e){return e==="hex"?j0.toHex32(this.h.slice(0,12),"big"):j0.split32(this.h.slice(0,12),"big")},Na.sha1=a_,Na.sha224=y_,Na.sha256=X2,Na.sha384=U_,Na.sha512=nv;var ov={},Ro=$t,k_=Ra,Ff=Ro.rotl32,av=Ro.sum32,eu=Ro.sum32_3,cv=Ro.sum32_4,uv=k_.BlockHash;function Gn(){if(!(this instanceof Gn))return new Gn;uv.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Ro.inherits(Gn,uv),ov.ripemd160=Gn,Gn.blockSize=512,Gn.outSize=160,Gn.hmacStrength=192,Gn.padLength=64,Gn.prototype._update=function(e,r){for(var i=this.h[0],n=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],l=i,d=n,b=s,w=a,S=u,I=0;I<80;I++){var D=av(Ff(cv(i,fv(I,n,s,a),e[z_[I]+r],j_(I)),K_[I]),u);i=u,u=a,a=Ff(s,10),s=n,n=D,D=av(Ff(cv(l,fv(79-I,d,b,w),e[H_[I]+r],q_(I)),W_[I]),S),l=S,S=w,w=Ff(b,10),b=d,d=D}D=eu(this.h[1],s,w),this.h[1]=eu(this.h[2],a,S),this.h[2]=eu(this.h[3],u,l),this.h[3]=eu(this.h[4],i,d),this.h[4]=eu(this.h[0],n,b),this.h[0]=D},Gn.prototype._digest=function(e){return e==="hex"?Ro.toHex32(this.h,"little"):Ro.split32(this.h,"little")};function fv(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function j_(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function q_(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var z_=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],H_=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],K_=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],W_=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],V_=$t,G_=Po;function Fa(t,e,r){if(!(this instanceof Fa))return new Fa(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(V_.toArray(e,r))}var Y_=Fa;Fa.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),G_(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)},Fa.prototype.update=function(e,r){return this.inner.update(e,r),this},Fa.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(t){var e=t;e.utils=$t,e.common=Ra,e.sha=Na,e.ripemd=ov,e.hmac=Y_,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(Lf);var q0,hv;function J_(){return hv||(hv=1,q0={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),q0}(function(t){var e=t,r=Lf,i=T0,n=Ni,s=n.assert;function a(d){d.type==="short"?this.curve=new i.short(d):d.type==="edwards"?this.curve=new i.edwards(d):this.curve=new i.mont(d),this.g=this.curve.g,this.n=this.curve.n,this.hash=d.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=a;function u(d,b){Object.defineProperty(e,d,{configurable:!0,enumerable:!0,get:function(){var w=new a(b);return Object.defineProperty(e,d,{configurable:!0,enumerable:!0,value:w}),w}})}u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var l;try{l=J_()}catch{l=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",l]})})(Tf);var Q_=Lf,No=R0,lv=Po;function Xs(t){if(!(this instanceof Xs))return new Xs(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=No.toArray(t.entropy,t.entropyEnc||"hex"),r=No.toArray(t.nonce,t.nonceEnc||"hex"),i=No.toArray(t.pers,t.persEnc||"hex");lv(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var Z_=Xs;Xs.prototype._init=function(e,r,i){var n=e.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Xs.prototype._hmac=function(){return new Q_.hmac(this.hash,this.K)},Xs.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Xs.prototype.reseed=function(e,r,i,n){typeof r!="string"&&(n=i,i=r,r=null),e=No.toArray(e,r),i=No.toArray(i,n),lv(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},Xs.prototype.generate=function(e,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(n=i,i=r,r=null),i&&(i=No.toArray(i,n||"hex"),this._update(i));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(i),this._reseed++,No.encode(a,r)};var X_=kn.exports,eE=Ni,z0=eE.assert;function Gr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var tE=Gr;Gr.fromPublic=function(e,r,i){return r instanceof Gr?r:new Gr(e,{pub:r,pubEnc:i})},Gr.fromPrivate=function(e,r,i){return r instanceof Gr?r:new Gr(e,{priv:r,privEnc:i})},Gr.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Gr.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},Gr.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv},Gr.prototype._importPrivate=function(e,r){this.priv=new X_(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},Gr.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?z0(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&z0(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)},Gr.prototype.derive=function(e){return e.validate()||z0(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Gr.prototype.sign=function(e,r,i){return this.ec.sign(e,this,r,i)},Gr.prototype.verify=function(e,r){return this.ec.verify(e,r,this)},Gr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Uf=kn.exports,H0=Ni,rE=H0.assert;function kf(t,e){if(t instanceof kf)return t;this._importDER(t,e)||(rE(t.r&&t.s,"Signature without r or s"),this.r=new Uf(t.r,16),this.s=new Uf(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var iE=kf;function nE(){this.place=0}function K0(t,e){var r=t[e.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4||t[e.place]===0)return!1;for(var n=0,s=0,a=e.place;s<i;s++,a++)n<<=8,n|=t[a],n>>>=0;return n<=127?!1:(e.place=a,n)}function dv(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}kf.prototype._importDER=function(e,r){e=H0.toArray(e,r);var i=new nE;if(e[i.place++]!==48)return!1;var n=K0(e,i);if(n===!1||n+i.place!==e.length||e[i.place++]!==2)return!1;var s=K0(e,i);if(s===!1||e[i.place]&128)return!1;var a=e.slice(i.place,s+i.place);if(i.place+=s,e[i.place++]!==2)return!1;var u=K0(e,i);if(u===!1||e.length!==u+i.place||e[i.place]&128)return!1;var l=e.slice(i.place,u+i.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;return this.r=new Uf(a),this.s=new Uf(l),this.recoveryParam=null,!0};function W0(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}kf.prototype.toDER=function(e){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=dv(r),i=dv(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];W0(n,r.length),n=n.concat(r),n.push(2),W0(n,i.length);var s=n.concat(i),a=[48];return W0(a,s.length),a=a.concat(s),H0.encode(a,e)};var To=kn.exports,pv=Z_,sE=Ni,V0=Tf,oE=Df.exports,gv=sE.assert,G0=tE,jf=iE;function Gi(t){if(!(this instanceof Gi))return new Gi(t);typeof t=="string"&&(gv(Object.prototype.hasOwnProperty.call(V0,t),"Unknown curve "+t),t=V0[t]),t instanceof V0.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var aE=Gi;Gi.prototype.keyPair=function(e){return new G0(this,e)},Gi.prototype.keyFromPrivate=function(e,r){return G0.fromPrivate(this,e,r)},Gi.prototype.keyFromPublic=function(e,r){return G0.fromPublic(this,e,r)},Gi.prototype.genKeyPair=function(e){e||(e={});for(var r=new pv({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||oE(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new To(2));;){var s=new To(r.generate(i));if(!(s.cmp(n)>0))return s.iaddn(1),this.keyFromPrivate(s)}},Gi.prototype._truncateToN=function(e,r){var i=e.byteLength()*8-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},Gi.prototype.sign=function(e,r,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),r=this.keyFromPrivate(r,i),e=this._truncateToN(new To(e,16));for(var s=this.n.byteLength(),a=r.getPrivate().toArray("be",s),u=e.toArray("be",s),l=new pv({hash:this.hash,entropy:a,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),d=this.n.sub(new To(1)),b=0;;b++){var w=n.k?n.k(b):new To(l.generate(this.n.byteLength()));if(w=this._truncateToN(w,!0),!(w.cmpn(1)<=0||w.cmp(d)>=0)){var S=this.g.mul(w);if(!S.isInfinity()){var I=S.getX(),D=I.umod(this.n);if(D.cmpn(0)!==0){var L=w.invm(this.n).mul(D.mul(r.getPrivate()).iadd(e));if(L=L.umod(this.n),L.cmpn(0)!==0){var K=(S.getY().isOdd()?1:0)|(I.cmp(D)!==0?2:0);return n.canonical&&L.cmp(this.nh)>0&&(L=this.n.sub(L),K^=1),new jf({r:D,s:L,recoveryParam:K})}}}}}},Gi.prototype.verify=function(e,r,i,n){e=this._truncateToN(new To(e,16)),i=this.keyFromPublic(i,n),r=new jf(r,"hex");var s=r.r,a=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var u=a.invm(this.n),l=u.mul(e).umod(this.n),d=u.mul(s).umod(this.n),b;return this.curve._maxwellTrick?(b=this.g.jmulAdd(l,i.getPublic(),d),b.isInfinity()?!1:b.eqXToP(s)):(b=this.g.mulAdd(l,i.getPublic(),d),b.isInfinity()?!1:b.getX().umod(this.n).cmp(s)===0)},Gi.prototype.recoverPubKey=function(t,e,r,i){gv((3&r)===r,"The recovery param is more than two bits"),e=new jf(e,i);var n=this.n,s=new To(t),a=e.r,u=e.s,l=r&1,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");d?a=this.curve.pointFromX(a.add(this.curve.n),l):a=this.curve.pointFromX(a,l);var b=e.r.invm(n),w=n.sub(s).mul(b).umod(n),S=u.mul(b).umod(n);return this.g.mulAdd(w,a,S)},Gi.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new jf(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch{continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var tu=Ni,vv=tu.assert,mv=tu.parseBytes,Ua=tu.cachedProperty;function Pr(t,e){this.eddsa=t,this._secret=mv(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=mv(e.pub)}Pr.fromPublic=function(e,r){return r instanceof Pr?r:new Pr(e,{pub:r})},Pr.fromSecret=function(e,r){return r instanceof Pr?r:new Pr(e,{secret:r})},Pr.prototype.secret=function(){return this._secret},Ua(Pr,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),Ua(Pr,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),Ua(Pr,"privBytes",function(){var e=this.eddsa,r=this.hash(),i=e.encodingLength-1,n=r.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n}),Ua(Pr,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),Ua(Pr,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),Ua(Pr,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Pr.prototype.sign=function(e){return vv(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Pr.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)},Pr.prototype.getSecret=function(e){return vv(this._secret,"KeyPair is public only"),tu.encode(this.secret(),e)},Pr.prototype.getPublic=function(e){return tu.encode(this.pubBytes(),e)};var cE=Pr,uE=kn.exports,qf=Ni,bv=qf.assert,zf=qf.cachedProperty,fE=qf.parseBytes;function Lo(t,e){this.eddsa=t,typeof e!="object"&&(e=fE(e)),Array.isArray(e)&&(bv(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),bv(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof uE&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}zf(Lo,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),zf(Lo,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),zf(Lo,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),zf(Lo,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Lo.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Lo.prototype.toHex=function(){return qf.encode(this.toBytes(),"hex").toUpperCase()};var hE=Lo,lE=Lf,dE=Tf,ka=Ni,pE=ka.assert,yv=ka.parseBytes,wv=cE,_v=hE;function vi(t){if(pE(t==="ed25519","only tested with ed25519 so far"),!(this instanceof vi))return new vi(t);t=dE[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=lE.sha512}var gE=vi;vi.prototype.sign=function(e,r){e=yv(e);var i=this.keyFromSecret(r),n=this.hashInt(i.messagePrefix(),e),s=this.g.mul(n),a=this.encodePoint(s),u=this.hashInt(a,i.pubBytes(),e).mul(i.priv()),l=n.add(u).umod(this.curve.n);return this.makeSignature({R:s,S:l,Rencoded:a})},vi.prototype.verify=function(e,r,i){if(e=yv(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var n=this.keyFromPublic(i),s=this.hashInt(r.Rencoded(),n.pubBytes(),e),a=this.g.mul(r.S()),u=r.R().add(n.pub().mul(s));return u.eq(a)},vi.prototype.hashInt=function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return ka.intFromLE(e.digest()).umod(this.curve.n)},vi.prototype.keyFromPublic=function(e){return wv.fromPublic(this,e)},vi.prototype.keyFromSecret=function(e){return wv.fromSecret(this,e)},vi.prototype.makeSignature=function(e){return e instanceof _v?e:new _v(this,e)},vi.prototype.encodePoint=function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r},vi.prototype.decodePoint=function(e){e=ka.parseBytes(e);var r=e.length-1,i=e.slice(0,r).concat(e[r]&-129),n=(e[r]&128)!==0,s=ka.intFromLE(i);return this.curve.pointFromY(s,n)},vi.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},vi.prototype.decodeInt=function(e){return ka.intFromLE(e)},vi.prototype.isPoint=function(e){return e instanceof this.pointClass},function(t){var e=t;e.version=p9.version,e.utils=Ni,e.rand=Df.exports,e.curve=T0,e.curves=Tf,e.ec=aE,e.eddsa=gE}(U2);var Y0={},Ev={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=wt,r=Ri;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var i=function(){function u(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},u.prototype.update=function(l,d){if(d===void 0&&(d=l.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var b=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&d>0;)this._buffer[this._bufferLength++]=l[b++],d--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(b=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,l,b,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=l[b++],d--;return this},u.prototype.finish=function(l){if(!this._finished){var d=this._bytesHashed,b=this._bufferLength,w=d/536870912|0,S=d<<3,I=d%128<112?128:256;this._buffer[b]=128;for(var D=b+1;D<I-8;D++)this._buffer[D]=0;e.writeUint32BE(w,this._buffer,I-8),e.writeUint32BE(S,this._buffer,I-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,I),this._finished=!0}for(var D=0;D<this.digestLength/8;D++)e.writeUint32BE(this._stateHi[D],l,D*8),e.writeUint32BE(this._stateLo[D],l,D*8+4);return this},u.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},u.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(l){return this._stateHi.set(l.stateHi),this._stateLo.set(l.stateLo),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(l){r.wipe(l.stateHi),r.wipe(l.stateLo),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},u}();t.SHA512=i;var n=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function s(u,l,d,b,w,S,I){for(var D=d[0],L=d[1],K=d[2],H=d[3],U=d[4],W=d[5],R=d[6],k=d[7],z=b[0],_=b[1],B=b[2],X=b[3],re=b[4],T=b[5],y=b[6],f=b[7],h,v,E,C,P,M,g,m;I>=128;){for(var N=0;N<16;N++){var ee=8*N+S;u[N]=e.readUint32BE(w,ee),l[N]=e.readUint32BE(w,ee+4)}for(var N=0;N<80;N++){var ae=D,O=L,te=K,q=H,G=U,Y=W,A=R,V=k,oe=z,ue=_,he=B,ye=X,we=re,Re=T,Xe=y,Oe=f;if(h=k,v=f,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=(U>>>14|re<<32-14)^(U>>>18|re<<32-18)^(re>>>41-32|U<<32-(41-32)),v=(re>>>14|U<<32-14)^(re>>>18|U<<32-18)^(U>>>41-32|re<<32-(41-32)),P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,h=U&W^~U&R,v=re&T^~re&y,P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,h=n[N*2],v=n[N*2+1],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,h=u[N%16],v=l[N%16],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,E=g&65535|m<<16,C=P&65535|M<<16,h=E,v=C,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=(D>>>28|z<<32-28)^(z>>>34-32|D<<32-(34-32))^(z>>>39-32|D<<32-(39-32)),v=(z>>>28|D<<32-28)^(D>>>34-32|z<<32-(34-32))^(D>>>39-32|z<<32-(39-32)),P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,h=D&L^D&K^L&K,v=z&_^z&B^_&B,P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,V=g&65535|m<<16,Oe=P&65535|M<<16,h=q,v=ye,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=E,v=C,P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,q=g&65535|m<<16,ye=P&65535|M<<16,L=ae,K=O,H=te,U=q,W=G,R=Y,k=A,D=V,_=oe,B=ue,X=he,re=ye,T=we,y=Re,f=Xe,z=Oe,N%16===15)for(var ee=0;ee<16;ee++)h=u[ee],v=l[ee],P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=u[(ee+9)%16],v=l[(ee+9)%16],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,E=u[(ee+1)%16],C=l[(ee+1)%16],h=(E>>>1|C<<32-1)^(E>>>8|C<<32-8)^E>>>7,v=(C>>>1|E<<32-1)^(C>>>8|E<<32-8)^(C>>>7|E<<32-7),P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,E=u[(ee+14)%16],C=l[(ee+14)%16],h=(E>>>19|C<<32-19)^(C>>>61-32|E<<32-(61-32))^E>>>6,v=(C>>>19|E<<32-19)^(E>>>61-32|C<<32-(61-32))^(C>>>6|E<<32-6),P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,u[ee]=g&65535|m<<16,l[ee]=P&65535|M<<16}h=D,v=z,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[0],v=b[0],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[0]=D=g&65535|m<<16,b[0]=z=P&65535|M<<16,h=L,v=_,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[1],v=b[1],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[1]=L=g&65535|m<<16,b[1]=_=P&65535|M<<16,h=K,v=B,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[2],v=b[2],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[2]=K=g&65535|m<<16,b[2]=B=P&65535|M<<16,h=H,v=X,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[3],v=b[3],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[3]=H=g&65535|m<<16,b[3]=X=P&65535|M<<16,h=U,v=re,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[4],v=b[4],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[4]=U=g&65535|m<<16,b[4]=re=P&65535|M<<16,h=W,v=T,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[5],v=b[5],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[5]=W=g&65535|m<<16,b[5]=T=P&65535|M<<16,h=R,v=y,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[6],v=b[6],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[6]=R=g&65535|m<<16,b[6]=y=P&65535|M<<16,h=k,v=f,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[7],v=b[7],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[7]=k=g&65535|m<<16,b[7]=f=P&65535|M<<16,S+=128,I-=128}return S}function a(u){var l=new i;l.update(u);var d=l.digest();return l.clean(),d}t.hash=a})(Ev),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Ma,r=Ev,i=Ri;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function n(q){const G=new Float64Array(16);if(q)for(let Y=0;Y<q.length;Y++)G[Y]=q[Y];return G}const s=new Uint8Array(32);s[0]=9;const a=n(),u=n([1]),l=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),b=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),w=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),S=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function I(q,G){for(let Y=0;Y<16;Y++)q[Y]=G[Y]|0}function D(q){let G=1;for(let Y=0;Y<16;Y++){let A=q[Y]+G+65535;G=Math.floor(A/65536),q[Y]=A-G*65536}q[0]+=G-1+37*(G-1)}function L(q,G,Y){const A=~(Y-1);for(let V=0;V<16;V++){const oe=A&(q[V]^G[V]);q[V]^=oe,G[V]^=oe}}function K(q,G){const Y=n(),A=n();for(let V=0;V<16;V++)A[V]=G[V];D(A),D(A),D(A);for(let V=0;V<2;V++){Y[0]=A[0]-65517;for(let ue=1;ue<15;ue++)Y[ue]=A[ue]-65535-(Y[ue-1]>>16&1),Y[ue-1]&=65535;Y[15]=A[15]-32767-(Y[14]>>16&1);const oe=Y[15]>>16&1;Y[14]&=65535,L(A,Y,1-oe)}for(let V=0;V<16;V++)q[2*V]=A[V]&255,q[2*V+1]=A[V]>>8}function H(q,G){let Y=0;for(let A=0;A<32;A++)Y|=q[A]^G[A];return(1&Y-1>>>8)-1}function U(q,G){const Y=new Uint8Array(32),A=new Uint8Array(32);return K(Y,q),K(A,G),H(Y,A)}function W(q){const G=new Uint8Array(32);return K(G,q),G[0]&1}function R(q,G){for(let Y=0;Y<16;Y++)q[Y]=G[2*Y]+(G[2*Y+1]<<8);q[15]&=32767}function k(q,G,Y){for(let A=0;A<16;A++)q[A]=G[A]+Y[A]}function z(q,G,Y){for(let A=0;A<16;A++)q[A]=G[A]-Y[A]}function _(q,G,Y){let A,V,oe=0,ue=0,he=0,ye=0,we=0,Re=0,Xe=0,Oe=0,Ne=0,Me=0,be=0,Pe=0,Te=0,ve=0,$e=0,xe=0,me=0,Ue=0,Ce=0,_e=0,Ke=0,Ve=0,Ae=0,We=0,pt=0,Ge=0,It=0,gt=0,Je=0,Ot=0,Tt=0,Le=Y[0],et=Y[1],it=Y[2],Be=Y[3],rt=Y[4],tt=Y[5],je=Y[6],ht=Y[7],nt=Y[8],qe=Y[9],st=Y[10],at=Y[11],Fe=Y[12],Ze=Y[13],lt=Y[14],ze=Y[15];A=G[0],oe+=A*Le,ue+=A*et,he+=A*it,ye+=A*Be,we+=A*rt,Re+=A*tt,Xe+=A*je,Oe+=A*ht,Ne+=A*nt,Me+=A*qe,be+=A*st,Pe+=A*at,Te+=A*Fe,ve+=A*Ze,$e+=A*lt,xe+=A*ze,A=G[1],ue+=A*Le,he+=A*et,ye+=A*it,we+=A*Be,Re+=A*rt,Xe+=A*tt,Oe+=A*je,Ne+=A*ht,Me+=A*nt,be+=A*qe,Pe+=A*st,Te+=A*at,ve+=A*Fe,$e+=A*Ze,xe+=A*lt,me+=A*ze,A=G[2],he+=A*Le,ye+=A*et,we+=A*it,Re+=A*Be,Xe+=A*rt,Oe+=A*tt,Ne+=A*je,Me+=A*ht,be+=A*nt,Pe+=A*qe,Te+=A*st,ve+=A*at,$e+=A*Fe,xe+=A*Ze,me+=A*lt,Ue+=A*ze,A=G[3],ye+=A*Le,we+=A*et,Re+=A*it,Xe+=A*Be,Oe+=A*rt,Ne+=A*tt,Me+=A*je,be+=A*ht,Pe+=A*nt,Te+=A*qe,ve+=A*st,$e+=A*at,xe+=A*Fe,me+=A*Ze,Ue+=A*lt,Ce+=A*ze,A=G[4],we+=A*Le,Re+=A*et,Xe+=A*it,Oe+=A*Be,Ne+=A*rt,Me+=A*tt,be+=A*je,Pe+=A*ht,Te+=A*nt,ve+=A*qe,$e+=A*st,xe+=A*at,me+=A*Fe,Ue+=A*Ze,Ce+=A*lt,_e+=A*ze,A=G[5],Re+=A*Le,Xe+=A*et,Oe+=A*it,Ne+=A*Be,Me+=A*rt,be+=A*tt,Pe+=A*je,Te+=A*ht,ve+=A*nt,$e+=A*qe,xe+=A*st,me+=A*at,Ue+=A*Fe,Ce+=A*Ze,_e+=A*lt,Ke+=A*ze,A=G[6],Xe+=A*Le,Oe+=A*et,Ne+=A*it,Me+=A*Be,be+=A*rt,Pe+=A*tt,Te+=A*je,ve+=A*ht,$e+=A*nt,xe+=A*qe,me+=A*st,Ue+=A*at,Ce+=A*Fe,_e+=A*Ze,Ke+=A*lt,Ve+=A*ze,A=G[7],Oe+=A*Le,Ne+=A*et,Me+=A*it,be+=A*Be,Pe+=A*rt,Te+=A*tt,ve+=A*je,$e+=A*ht,xe+=A*nt,me+=A*qe,Ue+=A*st,Ce+=A*at,_e+=A*Fe,Ke+=A*Ze,Ve+=A*lt,Ae+=A*ze,A=G[8],Ne+=A*Le,Me+=A*et,be+=A*it,Pe+=A*Be,Te+=A*rt,ve+=A*tt,$e+=A*je,xe+=A*ht,me+=A*nt,Ue+=A*qe,Ce+=A*st,_e+=A*at,Ke+=A*Fe,Ve+=A*Ze,Ae+=A*lt,We+=A*ze,A=G[9],Me+=A*Le,be+=A*et,Pe+=A*it,Te+=A*Be,ve+=A*rt,$e+=A*tt,xe+=A*je,me+=A*ht,Ue+=A*nt,Ce+=A*qe,_e+=A*st,Ke+=A*at,Ve+=A*Fe,Ae+=A*Ze,We+=A*lt,pt+=A*ze,A=G[10],be+=A*Le,Pe+=A*et,Te+=A*it,ve+=A*Be,$e+=A*rt,xe+=A*tt,me+=A*je,Ue+=A*ht,Ce+=A*nt,_e+=A*qe,Ke+=A*st,Ve+=A*at,Ae+=A*Fe,We+=A*Ze,pt+=A*lt,Ge+=A*ze,A=G[11],Pe+=A*Le,Te+=A*et,ve+=A*it,$e+=A*Be,xe+=A*rt,me+=A*tt,Ue+=A*je,Ce+=A*ht,_e+=A*nt,Ke+=A*qe,Ve+=A*st,Ae+=A*at,We+=A*Fe,pt+=A*Ze,Ge+=A*lt,It+=A*ze,A=G[12],Te+=A*Le,ve+=A*et,$e+=A*it,xe+=A*Be,me+=A*rt,Ue+=A*tt,Ce+=A*je,_e+=A*ht,Ke+=A*nt,Ve+=A*qe,Ae+=A*st,We+=A*at,pt+=A*Fe,Ge+=A*Ze,It+=A*lt,gt+=A*ze,A=G[13],ve+=A*Le,$e+=A*et,xe+=A*it,me+=A*Be,Ue+=A*rt,Ce+=A*tt,_e+=A*je,Ke+=A*ht,Ve+=A*nt,Ae+=A*qe,We+=A*st,pt+=A*at,Ge+=A*Fe,It+=A*Ze,gt+=A*lt,Je+=A*ze,A=G[14],$e+=A*Le,xe+=A*et,me+=A*it,Ue+=A*Be,Ce+=A*rt,_e+=A*tt,Ke+=A*je,Ve+=A*ht,Ae+=A*nt,We+=A*qe,pt+=A*st,Ge+=A*at,It+=A*Fe,gt+=A*Ze,Je+=A*lt,Ot+=A*ze,A=G[15],xe+=A*Le,me+=A*et,Ue+=A*it,Ce+=A*Be,_e+=A*rt,Ke+=A*tt,Ve+=A*je,Ae+=A*ht,We+=A*nt,pt+=A*qe,Ge+=A*st,It+=A*at,gt+=A*Fe,Je+=A*Ze,Ot+=A*lt,Tt+=A*ze,oe+=38*me,ue+=38*Ue,he+=38*Ce,ye+=38*_e,we+=38*Ke,Re+=38*Ve,Xe+=38*Ae,Oe+=38*We,Ne+=38*pt,Me+=38*Ge,be+=38*It,Pe+=38*gt,Te+=38*Je,ve+=38*Ot,$e+=38*Tt,V=1,A=oe+V+65535,V=Math.floor(A/65536),oe=A-V*65536,A=ue+V+65535,V=Math.floor(A/65536),ue=A-V*65536,A=he+V+65535,V=Math.floor(A/65536),he=A-V*65536,A=ye+V+65535,V=Math.floor(A/65536),ye=A-V*65536,A=we+V+65535,V=Math.floor(A/65536),we=A-V*65536,A=Re+V+65535,V=Math.floor(A/65536),Re=A-V*65536,A=Xe+V+65535,V=Math.floor(A/65536),Xe=A-V*65536,A=Oe+V+65535,V=Math.floor(A/65536),Oe=A-V*65536,A=Ne+V+65535,V=Math.floor(A/65536),Ne=A-V*65536,A=Me+V+65535,V=Math.floor(A/65536),Me=A-V*65536,A=be+V+65535,V=Math.floor(A/65536),be=A-V*65536,A=Pe+V+65535,V=Math.floor(A/65536),Pe=A-V*65536,A=Te+V+65535,V=Math.floor(A/65536),Te=A-V*65536,A=ve+V+65535,V=Math.floor(A/65536),ve=A-V*65536,A=$e+V+65535,V=Math.floor(A/65536),$e=A-V*65536,A=xe+V+65535,V=Math.floor(A/65536),xe=A-V*65536,oe+=V-1+37*(V-1),V=1,A=oe+V+65535,V=Math.floor(A/65536),oe=A-V*65536,A=ue+V+65535,V=Math.floor(A/65536),ue=A-V*65536,A=he+V+65535,V=Math.floor(A/65536),he=A-V*65536,A=ye+V+65535,V=Math.floor(A/65536),ye=A-V*65536,A=we+V+65535,V=Math.floor(A/65536),we=A-V*65536,A=Re+V+65535,V=Math.floor(A/65536),Re=A-V*65536,A=Xe+V+65535,V=Math.floor(A/65536),Xe=A-V*65536,A=Oe+V+65535,V=Math.floor(A/65536),Oe=A-V*65536,A=Ne+V+65535,V=Math.floor(A/65536),Ne=A-V*65536,A=Me+V+65535,V=Math.floor(A/65536),Me=A-V*65536,A=be+V+65535,V=Math.floor(A/65536),be=A-V*65536,A=Pe+V+65535,V=Math.floor(A/65536),Pe=A-V*65536,A=Te+V+65535,V=Math.floor(A/65536),Te=A-V*65536,A=ve+V+65535,V=Math.floor(A/65536),ve=A-V*65536,A=$e+V+65535,V=Math.floor(A/65536),$e=A-V*65536,A=xe+V+65535,V=Math.floor(A/65536),xe=A-V*65536,oe+=V-1+37*(V-1),q[0]=oe,q[1]=ue,q[2]=he,q[3]=ye,q[4]=we,q[5]=Re,q[6]=Xe,q[7]=Oe,q[8]=Ne,q[9]=Me,q[10]=be,q[11]=Pe,q[12]=Te,q[13]=ve,q[14]=$e,q[15]=xe}function B(q,G){_(q,G,G)}function X(q,G){const Y=n();let A;for(A=0;A<16;A++)Y[A]=G[A];for(A=253;A>=0;A--)B(Y,Y),A!==2&&A!==4&&_(Y,Y,G);for(A=0;A<16;A++)q[A]=Y[A]}function re(q,G){const Y=n();let A;for(A=0;A<16;A++)Y[A]=G[A];for(A=250;A>=0;A--)B(Y,Y),A!==1&&_(Y,Y,G);for(A=0;A<16;A++)q[A]=Y[A]}function T(q,G){const Y=n(),A=n(),V=n(),oe=n(),ue=n(),he=n(),ye=n(),we=n(),Re=n();z(Y,q[1],q[0]),z(Re,G[1],G[0]),_(Y,Y,Re),k(A,q[0],q[1]),k(Re,G[0],G[1]),_(A,A,Re),_(V,q[3],G[3]),_(V,V,d),_(oe,q[2],G[2]),k(oe,oe,oe),z(ue,A,Y),z(he,oe,V),k(ye,oe,V),k(we,A,Y),_(q[0],ue,he),_(q[1],we,ye),_(q[2],ye,he),_(q[3],ue,we)}function y(q,G,Y){for(let A=0;A<4;A++)L(q[A],G[A],Y)}function f(q,G){const Y=n(),A=n(),V=n();X(V,G[2]),_(Y,G[0],V),_(A,G[1],V),K(q,A),q[31]^=W(Y)<<7}function h(q,G,Y){I(q[0],a),I(q[1],u),I(q[2],u),I(q[3],a);for(let A=255;A>=0;--A){const V=Y[A/8|0]>>(A&7)&1;y(q,G,V),T(G,q),T(q,q),y(q,G,V)}}function v(q,G){const Y=[n(),n(),n(),n()];I(Y[0],b),I(Y[1],w),I(Y[2],u),_(Y[3],b,w),h(q,Y,G)}function E(q){if(q.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const G=(0,r.hash)(q);G[0]&=248,G[31]&=127,G[31]|=64;const Y=new Uint8Array(32),A=[n(),n(),n(),n()];v(A,G),f(Y,A);const V=new Uint8Array(64);return V.set(q),V.set(Y,32),{publicKey:Y,secretKey:V}}t.generateKeyPairFromSeed=E;function C(q){const G=(0,e.randomBytes)(32,q),Y=E(G);return(0,i.wipe)(G),Y}t.generateKeyPair=C;function P(q){if(q.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(q.subarray(32))}t.extractPublicKeyFromSecretKey=P;const M=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function g(q,G){let Y,A,V,oe;for(A=63;A>=32;--A){for(Y=0,V=A-32,oe=A-12;V<oe;++V)G[V]+=Y-16*G[A]*M[V-(A-32)],Y=Math.floor((G[V]+128)/256),G[V]-=Y*256;G[V]+=Y,G[A]=0}for(Y=0,V=0;V<32;V++)G[V]+=Y-(G[31]>>4)*M[V],Y=G[V]>>8,G[V]&=255;for(V=0;V<32;V++)G[V]-=Y*M[V];for(A=0;A<32;A++)G[A+1]+=G[A]>>8,q[A]=G[A]&255}function m(q){const G=new Float64Array(64);for(let Y=0;Y<64;Y++)G[Y]=q[Y];for(let Y=0;Y<64;Y++)q[Y]=0;g(q,G)}function N(q,G){const Y=new Float64Array(64),A=[n(),n(),n(),n()],V=(0,r.hash)(q.subarray(0,32));V[0]&=248,V[31]&=127,V[31]|=64;const oe=new Uint8Array(64);oe.set(V.subarray(32),32);const ue=new r.SHA512;ue.update(oe.subarray(32)),ue.update(G);const he=ue.digest();ue.clean(),m(he),v(A,he),f(oe,A),ue.reset(),ue.update(oe.subarray(0,32)),ue.update(q.subarray(32)),ue.update(G);const ye=ue.digest();m(ye);for(let we=0;we<32;we++)Y[we]=he[we];for(let we=0;we<32;we++)for(let Re=0;Re<32;Re++)Y[we+Re]+=ye[we]*V[Re];return g(oe.subarray(32),Y),oe}t.sign=N;function ee(q,G){const Y=n(),A=n(),V=n(),oe=n(),ue=n(),he=n(),ye=n();return I(q[2],u),R(q[1],G),B(V,q[1]),_(oe,V,l),z(V,V,q[2]),k(oe,q[2],oe),B(ue,oe),B(he,ue),_(ye,he,ue),_(Y,ye,V),_(Y,Y,oe),re(Y,Y),_(Y,Y,V),_(Y,Y,oe),_(Y,Y,oe),_(q[0],Y,oe),B(A,q[0]),_(A,A,oe),U(A,V)&&_(q[0],q[0],S),B(A,q[0]),_(A,A,oe),U(A,V)?-1:(W(q[0])===G[31]>>7&&z(q[0],a,q[0]),_(q[3],q[0],q[1]),0)}function ae(q,G,Y){const A=new Uint8Array(32),V=[n(),n(),n(),n()],oe=[n(),n(),n(),n()];if(Y.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ee(oe,q))return!1;const ue=new r.SHA512;ue.update(Y.subarray(0,32)),ue.update(q),ue.update(G);const he=ue.digest();return m(he),h(V,oe,he),v(oe,Y.subarray(32)),T(V,oe),f(A,V),!H(Y,A)}t.verify=ae;function O(q){let G=[n(),n(),n(),n()];if(ee(G,q))throw new Error("Ed25519: invalid public key");let Y=n(),A=n(),V=G[1];k(Y,u,V),z(A,u,V),X(A,A),_(Y,Y,A);let oe=new Uint8Array(32);return K(oe,Y),oe}t.convertPublicKeyToX25519=O;function te(q){const G=(0,r.hash)(q.subarray(0,32));G[0]&=248,G[31]&=127,G[31]|=64;const Y=new Uint8Array(G.subarray(0,32));return(0,i.wipe)(G),Y}t.convertSecretKeyToX25519=te}(Y0);const vE="EdDSA",mE="JWT",Hf=".",Kf="base64url",Av="utf8",xv="utf8",bE=":",yE="did",wE="key",Sv="base58btc",_E="z",EE="K36",AE=32;function J0(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Iv(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?J0(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function xE(t,e){e||(e=t.reduce((n,s)=>n+s.length,0));const r=Iv(e);let i=0;for(const n of t)r.set(n,i),i+=n.length;return J0(r)}function Mv(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Cv=Mv("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Q0=Mv("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Iv(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Dv={utf8:Cv,"utf-8":Cv,hex:Ca.base16,latin1:Q0,ascii:Q0,binary:Q0,...Ca};function Wf(t,e="utf8"){const r=Dv[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function ja(t,e="utf8"){const r=Dv[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?J0(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const SE=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),IE=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(i,n)=>typeof n=="string"&&n.match(/^\d+n$/)?BigInt(n.substring(0,n.length-1)):n)};function qa(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return IE(t)}catch{return t}}function Is(t){return typeof t=="string"?t:SE(t)||""}function Ov(t){return qa(Wf(ja(t,Kf),Av))}function Vf(t){return Wf(ja(Is(t),Av),Kf)}function Pv(t){const e=ja(EE,Sv),r=_E+Wf(xE([e,t]),Sv);return[yE,wE,r].join(bE)}function ME(t){return Wf(t,Kf)}function CE(t){return ja(t,Kf)}function DE(t){return ja([Vf(t.header),Vf(t.payload)].join(Hf),xv)}function OE(t){return[Vf(t.header),Vf(t.payload),ME(t.signature)].join(Hf)}function Z0(t){const e=t.split(Hf),r=Ov(e[0]),i=Ov(e[1]),n=CE(e[2]),s=ja(e.slice(0,2).join(Hf),xv);return{header:r,payload:i,signature:n,data:s}}function $v(t=Ma.randomBytes(AE)){return Y0.generateKeyPairFromSeed(t)}async function PE(t,e,r,i,n=Ie.fromMiliseconds(Date.now())){const s={alg:vE,typ:mE},a=Pv(i.publicKey),u=n+r,l={iss:a,sub:t,aud:e,iat:n,exp:u},d=DE({header:s,payload:l}),b=Y0.sign(i.secretKey,d);return OE({header:s,payload:l,signature:b})}const $E={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},RE=":";function ru(t){const[e,r]=t.split(RE);return{namespace:e,reference:r}}function Rv(t,e=[]){const r=[];return Object.keys(t).forEach(i=>{if(e.length&&!e.includes(i))return;const n=t[i];r.push(...n.accounts)}),r}function Nv(t,e){return t.includes(":")?[t]:e.chains||[]}var NE=Object.defineProperty,Tv=Object.getOwnPropertySymbols,TE=Object.prototype.hasOwnProperty,LE=Object.prototype.propertyIsEnumerable,Lv=(t,e,r)=>e in t?NE(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Bv=(t,e)=>{for(var r in e||(e={}))TE.call(e,r)&&Lv(t,r,e[r]);if(Tv)for(var r of Tv(e))LE.call(e,r)&&Lv(t,r,e[r]);return t};const BE="ReactNative",Ti={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},FE="js";function iu(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function nu(){return!m0()&&!!b0()&&navigator.product===BE}function su(){return!iu()&&!!b0()&&!!m0()}function ou(){return nu()?Ti.reactNative:iu()?Ti.node:su()?Ti.browser:Ti.unknown}function UE(){var t;try{return nu()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function kE(t,e){let r=Gc.parse(t);return r=Bv(Bv({},r),e),t=Gc.stringify(r),t}function jE(){return r2()||{name:"",description:"",url:"",icons:[""]}}function qE(){if(ou()===Ti.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:i}=global.Platform;return[r,i].join("-")}const t=Jw();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function zE(){var t;const e=ou();return e===Ti.browser?[e,((t=t2())==null?void 0:t.host)||"unknown"].join(":"):e}function HE(t,e,r){const i=qE(),n=zE();return[[t,e].join("-"),[FE,r].join("-"),i,n].join("/")}function KE({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:n,projectId:s,useOnCloseEvent:a,bundleId:u}){const l=r.split("?"),d=HE(t,e,i),b={auth:n,ua:d,projectId:s,useOnCloseEvent:a||void 0,origin:u||void 0},w=kE(l[1]||"",b);return l[0]+"?"+w}function Bo(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Fv(t){return Object.fromEntries(t.entries())}function Uv(t){return new Map(Object.entries(t))}function Fo(t=Ie.FIVE_MINUTES,e){const r=Ie.toMiliseconds(t||Ie.FIVE_MINUTES);let i,n,s;return{resolve:a=>{s&&i&&(clearTimeout(s),i(a))},reject:a=>{s&&n&&(clearTimeout(s),n(a))},done:()=>new Promise((a,u)=>{s=setTimeout(()=>{u(new Error(e))},r),i=a,n=u})}}function za(t,e,r){return new Promise(async(i,n)=>{const s=setTimeout(()=>n(new Error(r)),e);try{const a=await t;i(a)}catch(a){n(a)}clearTimeout(s)})}function kv(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function WE(t){return kv("topic",t)}function VE(t){return kv("id",t)}function jv(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")i.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))i.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}function kr(t,e){return Ie.fromMiliseconds((e||Date.now())+Ie.toMiliseconds(t))}function eo(t){return Date.now()>=Ie.toMiliseconds(t)}function Dt(t,e){return`${t}${e?`:${e}`:""}`}function Gf(t=[],e=[]){return[...new Set([...t,...e])]}async function GE({id:t,topic:e,wcDeepLink:r}){try{if(!r)return;const i=typeof r=="string"?JSON.parse(r):r;let n=i?.href;if(typeof n!="string")return;n.endsWith("/")&&(n=n.slice(0,-1));const s=`${n}/wc?requestId=${t}&sessionTopic=${e}`,a=ou();a===Ti.browser?s.startsWith("https://")||s.startsWith("http://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):a===Ti.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(s)}catch(i){console.error(i)}}async function YE(t,e){try{return await t.getItem(e)||(su()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}function JE(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var qv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function QE(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var zv={exports:{}};/**
14
+ ***************************************************************************** */var h0=function(t,e){return h0=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},h0(t,e)};function Xw(t,e){h0(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var l0=function(){return l0=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},l0.apply(this,arguments)};function e4(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function t4(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(s=(n<3?a(s):n>3?a(e,r,s):a(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function r4(t,e){return function(r,i){e(r,i,t)}}function i4(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function n4(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(b){try{d(i.next(b))}catch(w){a(w)}}function l(b){try{d(i.throw(b))}catch(w){a(w)}}function d(b){b.done?s(b.value):n(b.value).then(u,l)}d((i=i.apply(t,e||[])).next())})}function s4(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(d){return function(b){return l([d,b])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=d[0]&2?n.return:d[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,d[1])).done)return s;switch(n=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,n=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(b){d=[6,b],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function o4(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function a4(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function d0(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Hg(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function c4(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Hg(arguments[e]));return t}function u4(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],a=0,u=s.length;a<u;a++,n++)i[n]=s[a];return i}function Kc(t){return this instanceof Kc?(this.v=t,this):new Kc(t)}function f4(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(I){i[I]&&(n[I]=function(S){return new Promise(function(D,L){s.push([I,S,D,L])>1||u(I,S)})})}function u(I,S){try{l(i[I](S))}catch(D){w(s[0][3],D)}}function l(I){I.value instanceof Kc?Promise.resolve(I.value.v).then(d,b):w(s[0][2],I)}function d(I){u("next",I)}function b(I){u("throw",I)}function w(I,S){I(S),s.shift(),s.length&&u(s[0][0],s[0][1])}}function h4(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(a){return(r=!r)?{value:Kc(t[n](a)),done:n==="return"}:s?s(a):a}:s}}function l4(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof d0=="function"?d0(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(a){return new Promise(function(u,l){a=t[s](a),n(u,l,a.done,a.value)})}}function n(s,a,u,l){Promise.resolve(l).then(function(d){s({value:d,done:u})},a)}}function d4(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function p4(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function g4(t){return t&&t.__esModule?t:{default:t}}function v4(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function m4(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var b4=Object.freeze({__proto__:null,__extends:Xw,get __assign(){return l0},__rest:e4,__decorate:t4,__param:r4,__metadata:i4,__awaiter:n4,__generator:s4,__createBinding:o4,__exportStar:a4,__values:d0,__read:Hg,__spread:c4,__spreadArrays:u4,__await:Kc,__asyncGenerator:f4,__asyncDelegator:h4,__asyncValues:l4,__makeTemplateObject:d4,__importStar:p4,__importDefault:g4,__classPrivateFieldGet:v4,__classPrivateFieldSet:m4}),_f=f0(b4),p0={},Wc={},Kg;function y4(){if(Kg)return Wc;Kg=1,Object.defineProperty(Wc,"__esModule",{value:!0}),Wc.delay=void 0;function t(e){return new Promise(r=>{setTimeout(()=>{r(!0)},e)})}return Wc.delay=t,Wc}var Co={},g0={},Do={},Wg;function w4(){return Wg||(Wg=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.ONE_THOUSAND=Do.ONE_HUNDRED=void 0,Do.ONE_HUNDRED=100,Do.ONE_THOUSAND=1e3),Do}var v0={},Vg;function _4(){return Vg||(Vg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=t.ONE_MINUTE*5,t.TEN_MINUTES=t.ONE_MINUTE*10,t.THIRTY_MINUTES=t.ONE_MINUTE*30,t.SIXTY_MINUTES=t.ONE_MINUTE*60,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=t.ONE_HOUR*3,t.SIX_HOURS=t.ONE_HOUR*6,t.TWELVE_HOURS=t.ONE_HOUR*12,t.TWENTY_FOUR_HOURS=t.ONE_HOUR*24,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=t.ONE_DAY*3,t.FIVE_DAYS=t.ONE_DAY*5,t.SEVEN_DAYS=t.ONE_DAY*7,t.THIRTY_DAYS=t.ONE_DAY*30,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=t.ONE_WEEK*2,t.THREE_WEEKS=t.ONE_WEEK*3,t.FOUR_WEEKS=t.ONE_WEEK*4,t.ONE_YEAR=t.ONE_DAY*365}(v0)),v0}var Gg;function Yg(){return Gg||(Gg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=_f;e.__exportStar(w4(),t),e.__exportStar(_4(),t)}(g0)),g0}var Jg;function E4(){if(Jg)return Co;Jg=1,Object.defineProperty(Co,"__esModule",{value:!0}),Co.fromMiliseconds=Co.toMiliseconds=void 0;const t=Yg();function e(i){return i*t.ONE_THOUSAND}Co.toMiliseconds=e;function r(i){return Math.floor(i/t.ONE_THOUSAND)}return Co.fromMiliseconds=r,Co}var Qg;function A4(){return Qg||(Qg=1,function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=_f;e.__exportStar(y4(),t),e.__exportStar(E4(),t)}(p0)),p0}var Sa={},Zg;function x4(){if(Zg)return Sa;Zg=1,Object.defineProperty(Sa,"__esModule",{value:!0}),Sa.Watch=void 0;class t{constructor(){this.timestamps=new Map}start(r){if(this.timestamps.has(r))throw new Error(`Watch already started for label: ${r}`);this.timestamps.set(r,{started:Date.now()})}stop(r){const i=this.get(r);if(typeof i.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const n=Date.now()-i.started;this.timestamps.set(r,{started:i.started,elapsed:n})}get(r){const i=this.timestamps.get(r);if(typeof i>"u")throw new Error(`No timestamp found for label: ${r}`);return i}elapsed(r){const i=this.get(r);return i.elapsed||Date.now()-i.started}}return Sa.Watch=t,Sa.default=t,Sa}var m0={},Vc={},Xg;function S4(){if(Xg)return Vc;Xg=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.IWatch=void 0;class t{}return Vc.IWatch=t,Vc}var e2;function I4(){return e2||(e2=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),_f.__exportStar(S4(),t)}(m0)),m0}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=_f;e.__exportStar(A4(),t),e.__exportStar(x4(),t),e.__exportStar(I4(),t),e.__exportStar(Yg(),t)})(Ie);var rr={};Object.defineProperty(rr,"__esModule",{value:!0}),rr.getLocalStorage=rr.getLocalStorageOrThrow=rr.getCrypto=rr.getCryptoOrThrow=t2=rr.getLocation=rr.getLocationOrThrow=b0=rr.getNavigator=rr.getNavigatorOrThrow=Ef=rr.getDocument=rr.getDocumentOrThrow=rr.getFromWindowOrThrow=rr.getFromWindow=void 0;function Oo(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}rr.getFromWindow=Oo;function Ia(t){const e=Oo(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}rr.getFromWindowOrThrow=Ia;function M4(){return Ia("document")}rr.getDocumentOrThrow=M4;function C4(){return Oo("document")}var Ef=rr.getDocument=C4;function D4(){return Ia("navigator")}rr.getNavigatorOrThrow=D4;function O4(){return Oo("navigator")}var b0=rr.getNavigator=O4;function P4(){return Ia("location")}rr.getLocationOrThrow=P4;function $4(){return Oo("location")}var t2=rr.getLocation=$4;function R4(){return Ia("crypto")}rr.getCryptoOrThrow=R4;function N4(){return Oo("crypto")}rr.getCrypto=N4;function T4(){return Ia("localStorage")}rr.getLocalStorageOrThrow=T4;function L4(){return Oo("localStorage")}rr.getLocalStorage=L4;var y0={};Object.defineProperty(y0,"__esModule",{value:!0});var r2=y0.getWindowMetadata=void 0;const i2=rr;function B4(){let t,e;try{t=i2.getDocumentOrThrow(),e=i2.getLocationOrThrow()}catch{return null}function r(){const w=t.getElementsByTagName("link"),I=[];for(let S=0;S<w.length;S++){const D=w[S],L=D.getAttribute("rel");if(L&&L.toLowerCase().indexOf("icon")>-1){const K=D.getAttribute("href");if(K)if(K.toLowerCase().indexOf("https:")===-1&&K.toLowerCase().indexOf("http:")===-1&&K.indexOf("//")!==0){let H=e.protocol+"//"+e.host;if(K.indexOf("/")===0)H+=K;else{const U=e.pathname.split("/");U.pop();const W=U.join("/");H+=W+"/"+K}I.push(H)}else if(K.indexOf("//")===0){const H=e.protocol+K;I.push(H)}else I.push(K)}}return I}function i(...w){const I=t.getElementsByTagName("meta");for(let S=0;S<I.length;S++){const D=I[S],L=["itemprop","property","name"].map(K=>D.getAttribute(K)).filter(K=>K?w.includes(K):!1);if(L.length&&L){const K=D.getAttribute("content");if(K)return K}}return""}function n(){let w=i("name","og:site_name","og:title","twitter:title");return w||(w=t.title),w}function s(){return i("description","og:description","twitter:description","keywords")}const a=n(),u=s(),l=e.origin,d=r();return{description:u,url:l,icons:d,name:a}}r2=y0.getWindowMetadata=B4;var Gc={},F4=t=>encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`),n2="%[a-f0-9]{2}",s2=new RegExp("("+n2+")|([^%]+?)","gi"),o2=new RegExp("("+n2+")+","gi");function w0(t,e){try{return[decodeURIComponent(t.join(""))]}catch{}if(t.length===1)return t;e=e||1;var r=t.slice(0,e),i=t.slice(e);return Array.prototype.concat.call([],w0(r),w0(i))}function U4(t){try{return decodeURIComponent(t)}catch{for(var e=t.match(s2)||[],r=1;r<e.length;r++)t=w0(e,r).join(""),e=t.match(s2)||[];return t}}function k4(t){for(var e={"%FE%FF":"\uFFFD\uFFFD","%FF%FE":"\uFFFD\uFFFD"},r=o2.exec(t);r;){try{e[r[0]]=decodeURIComponent(r[0])}catch{var i=U4(r[0]);i!==r[0]&&(e[r[0]]=i)}r=o2.exec(t)}e["%C2"]="\uFFFD";for(var n=Object.keys(e),s=0;s<n.length;s++){var a=n[s];t=t.replace(new RegExp(a,"g"),e[a])}return t}var j4=function(t){if(typeof t!="string")throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof t+"`");try{return t=t.replace(/\+/g," "),decodeURIComponent(t)}catch{return k4(t)}},q4=(t,e)=>{if(!(typeof t=="string"&&typeof e=="string"))throw new TypeError("Expected the arguments to be of type `string`");if(e==="")return[t];const r=t.indexOf(e);return r===-1?[t]:[t.slice(0,r),t.slice(r+e.length)]},z4=function(t,e){for(var r={},i=Object.keys(t),n=Array.isArray(e),s=0;s<i.length;s++){var a=i[s],u=t[a];(n?e.indexOf(a)!==-1:e(a,u,t))&&(r[a]=u)}return r};(function(t){const e=F4,r=j4,i=q4,n=z4,s=U=>U==null,a=Symbol("encodeFragmentIdentifier");function u(U){switch(U.arrayFormat){case"index":return W=>(R,k)=>{const z=R.length;return k===void 0||U.skipNull&&k===null||U.skipEmptyString&&k===""?R:k===null?[...R,[b(W,U),"[",z,"]"].join("")]:[...R,[b(W,U),"[",b(z,U),"]=",b(k,U)].join("")]};case"bracket":return W=>(R,k)=>k===void 0||U.skipNull&&k===null||U.skipEmptyString&&k===""?R:k===null?[...R,[b(W,U),"[]"].join("")]:[...R,[b(W,U),"[]=",b(k,U)].join("")];case"colon-list-separator":return W=>(R,k)=>k===void 0||U.skipNull&&k===null||U.skipEmptyString&&k===""?R:k===null?[...R,[b(W,U),":list="].join("")]:[...R,[b(W,U),":list=",b(k,U)].join("")];case"comma":case"separator":case"bracket-separator":{const W=U.arrayFormat==="bracket-separator"?"[]=":"=";return R=>(k,z)=>z===void 0||U.skipNull&&z===null||U.skipEmptyString&&z===""?k:(z=z===null?"":z,k.length===0?[[b(R,U),W,b(z,U)].join("")]:[[k,b(z,U)].join(U.arrayFormatSeparator)])}default:return W=>(R,k)=>k===void 0||U.skipNull&&k===null||U.skipEmptyString&&k===""?R:k===null?[...R,b(W,U)]:[...R,[b(W,U),"=",b(k,U)].join("")]}}function l(U){let W;switch(U.arrayFormat){case"index":return(R,k,z)=>{if(W=/\[(\d*)\]$/.exec(R),R=R.replace(/\[\d*\]$/,""),!W){z[R]=k;return}z[R]===void 0&&(z[R]={}),z[R][W[1]]=k};case"bracket":return(R,k,z)=>{if(W=/(\[\])$/.exec(R),R=R.replace(/\[\]$/,""),!W){z[R]=k;return}if(z[R]===void 0){z[R]=[k];return}z[R]=[].concat(z[R],k)};case"colon-list-separator":return(R,k,z)=>{if(W=/(:list)$/.exec(R),R=R.replace(/:list$/,""),!W){z[R]=k;return}if(z[R]===void 0){z[R]=[k];return}z[R]=[].concat(z[R],k)};case"comma":case"separator":return(R,k,z)=>{const _=typeof k=="string"&&k.includes(U.arrayFormatSeparator),B=typeof k=="string"&&!_&&w(k,U).includes(U.arrayFormatSeparator);k=B?w(k,U):k;const X=_||B?k.split(U.arrayFormatSeparator).map(re=>w(re,U)):k===null?k:w(k,U);z[R]=X};case"bracket-separator":return(R,k,z)=>{const _=/(\[\])$/.test(R);if(R=R.replace(/\[\]$/,""),!_){z[R]=k&&w(k,U);return}const B=k===null?[]:k.split(U.arrayFormatSeparator).map(X=>w(X,U));if(z[R]===void 0){z[R]=B;return}z[R]=[].concat(z[R],B)};default:return(R,k,z)=>{if(z[R]===void 0){z[R]=k;return}z[R]=[].concat(z[R],k)}}}function d(U){if(typeof U!="string"||U.length!==1)throw new TypeError("arrayFormatSeparator must be single character string")}function b(U,W){return W.encode?W.strict?e(U):encodeURIComponent(U):U}function w(U,W){return W.decode?r(U):U}function I(U){return Array.isArray(U)?U.sort():typeof U=="object"?I(Object.keys(U)).sort((W,R)=>Number(W)-Number(R)).map(W=>U[W]):U}function S(U){const W=U.indexOf("#");return W!==-1&&(U=U.slice(0,W)),U}function D(U){let W="";const R=U.indexOf("#");return R!==-1&&(W=U.slice(R)),W}function L(U){U=S(U);const W=U.indexOf("?");return W===-1?"":U.slice(W+1)}function K(U,W){return W.parseNumbers&&!Number.isNaN(Number(U))&&typeof U=="string"&&U.trim()!==""?U=Number(U):W.parseBooleans&&U!==null&&(U.toLowerCase()==="true"||U.toLowerCase()==="false")&&(U=U.toLowerCase()==="true"),U}function H(U,W){W=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},W),d(W.arrayFormatSeparator);const R=l(W),k=Object.create(null);if(typeof U!="string"||(U=U.trim().replace(/^[?#&]/,""),!U))return k;for(const z of U.split("&")){if(z==="")continue;let[_,B]=i(W.decode?z.replace(/\+/g," "):z,"=");B=B===void 0?null:["comma","separator","bracket-separator"].includes(W.arrayFormat)?B:w(B,W),R(w(_,W),B,k)}for(const z of Object.keys(k)){const _=k[z];if(typeof _=="object"&&_!==null)for(const B of Object.keys(_))_[B]=K(_[B],W);else k[z]=K(_,W)}return W.sort===!1?k:(W.sort===!0?Object.keys(k).sort():Object.keys(k).sort(W.sort)).reduce((z,_)=>{const B=k[_];return B&&typeof B=="object"&&!Array.isArray(B)?z[_]=I(B):z[_]=B,z},Object.create(null))}t.extract=L,t.parse=H,t.stringify=(U,W)=>{if(!U)return"";W=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},W),d(W.arrayFormatSeparator);const R=B=>W.skipNull&&s(U[B])||W.skipEmptyString&&U[B]==="",k=u(W),z={};for(const B of Object.keys(U))R(B)||(z[B]=U[B]);const _=Object.keys(z);return W.sort!==!1&&_.sort(W.sort),_.map(B=>{const X=U[B];return X===void 0?"":X===null?b(B,W):Array.isArray(X)?X.length===0&&W.arrayFormat==="bracket-separator"?b(B,W)+"[]":X.reduce(k(B),[]).join("&"):b(B,W)+"="+b(X,W)}).filter(B=>B.length>0).join("&")},t.parseUrl=(U,W)=>{W=Object.assign({decode:!0},W);const[R,k]=i(U,"#");return Object.assign({url:R.split("?")[0]||"",query:H(L(U),W)},W&&W.parseFragmentIdentifier&&k?{fragmentIdentifier:w(k,W)}:{})},t.stringifyUrl=(U,W)=>{W=Object.assign({encode:!0,strict:!0,[a]:!0},W);const R=S(U.url).split("?")[0]||"",k=t.extract(U.url),z=t.parse(k,{sort:!1}),_=Object.assign(z,U.query);let B=t.stringify(_,W);B&&(B=`?${B}`);let X=D(U.url);return U.fragmentIdentifier&&(X=`#${W[a]?b(U.fragmentIdentifier,W):U.fragmentIdentifier}`),`${R}${B}${X}`},t.pick=(U,W,R)=>{R=Object.assign({parseFragmentIdentifier:!0,[a]:!1},R);const{url:k,query:z,fragmentIdentifier:_}=t.parseUrl(U,R);return t.stringifyUrl({url:k,query:n(z,W),fragmentIdentifier:_},R)},t.exclude=(U,W,R)=>{const k=Array.isArray(W)?z=>!W.includes(z):(z,_)=>!W(z,_);return t.pick(U,k,R)}})(Gc);var _0={},Af={},wt={},a2={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(u,l){var d=u>>>16&65535,b=u&65535,w=l>>>16&65535,I=l&65535;return b*I+(d*I+b*w<<16>>>0)|0}t.mul=Math.imul||e;function r(u,l){return u+l|0}t.add=r;function i(u,l){return u-l|0}t.sub=i;function n(u,l){return u<<l|u>>>32-l}t.rotl=n;function s(u,l){return u<<32-l|u>>>l}t.rotr=s;function a(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u}t.isInteger=Number.isInteger||a,t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(u){return t.isInteger(u)&&u>=-t.MAX_SAFE_INTEGER&&u<=t.MAX_SAFE_INTEGER}})(a2),Object.defineProperty(wt,"__esModule",{value:!0});var c2=a2;function H4(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])<<16>>16}wt.readInt16BE=H4;function K4(t,e){return e===void 0&&(e=0),(t[e+0]<<8|t[e+1])>>>0}wt.readUint16BE=K4;function W4(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])<<16>>16}wt.readInt16LE=W4;function V4(t,e){return e===void 0&&(e=0),(t[e+1]<<8|t[e])>>>0}wt.readUint16LE=V4;function u2(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>8,e[r+1]=t>>>0,e}wt.writeUint16BE=u2,wt.writeInt16BE=u2;function f2(t,e,r){return e===void 0&&(e=new Uint8Array(2)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e}wt.writeUint16LE=f2,wt.writeInt16LE=f2;function E0(t,e){return e===void 0&&(e=0),t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3]}wt.readInt32BE=E0;function A0(t,e){return e===void 0&&(e=0),(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}wt.readUint32BE=A0;function x0(t,e){return e===void 0&&(e=0),t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e]}wt.readInt32LE=x0;function S0(t,e){return e===void 0&&(e=0),(t[e+3]<<24|t[e+2]<<16|t[e+1]<<8|t[e])>>>0}wt.readUint32LE=S0;function xf(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>24,e[r+1]=t>>>16,e[r+2]=t>>>8,e[r+3]=t>>>0,e}wt.writeUint32BE=xf,wt.writeInt32BE=xf;function Sf(t,e,r){return e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0),e[r+0]=t>>>0,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24,e}wt.writeUint32LE=Sf,wt.writeInt32LE=Sf;function G4(t,e){e===void 0&&(e=0);var r=E0(t,e),i=E0(t,e+4);return r*4294967296+i-(i>>31)*4294967296}wt.readInt64BE=G4;function Y4(t,e){e===void 0&&(e=0);var r=A0(t,e),i=A0(t,e+4);return r*4294967296+i}wt.readUint64BE=Y4;function J4(t,e){e===void 0&&(e=0);var r=x0(t,e),i=x0(t,e+4);return i*4294967296+r-(r>>31)*4294967296}wt.readInt64LE=J4;function Q4(t,e){e===void 0&&(e=0);var r=S0(t,e),i=S0(t,e+4);return i*4294967296+r}wt.readUint64LE=Q4;function h2(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),xf(t/4294967296>>>0,e,r),xf(t>>>0,e,r+4),e}wt.writeUint64BE=h2,wt.writeInt64BE=h2;function l2(t,e,r){return e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0),Sf(t>>>0,e,r),Sf(t/4294967296>>>0,e,r+4),e}wt.writeUint64LE=l2,wt.writeInt64LE=l2;function Z4(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var i=0,n=1,s=t/8+r-1;s>=r;s--)i+=e[s]*n,n*=256;return i}wt.readUintBE=Z4;function X4(t,e,r){if(r===void 0&&(r=0),t%8!==0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(t/8>e.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var i=0,n=1,s=r;s<r+t/8;s++)i+=e[s]*n,n*=256;return i}wt.readUintLE=X4;function e8(t,e,r,i){if(r===void 0&&(r=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!c2.isSafeInteger(e))throw new Error("writeUintBE value must be an integer");for(var n=1,s=t/8+i-1;s>=i;s--)r[s]=e/n&255,n*=256;return r}wt.writeUintBE=e8;function t8(t,e,r,i){if(r===void 0&&(r=new Uint8Array(t/8)),i===void 0&&(i=0),t%8!==0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!c2.isSafeInteger(e))throw new Error("writeUintLE value must be an integer");for(var n=1,s=i;s<i+t/8;s++)r[s]=e/n&255,n*=256;return r}wt.writeUintLE=t8;function r8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e)}wt.readFloat32BE=r8;function i8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat32(e,!0)}wt.readFloat32LE=i8;function n8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e)}wt.readFloat64BE=n8;function s8(t,e){e===void 0&&(e=0);var r=new DataView(t.buffer,t.byteOffset,t.byteLength);return r.getFloat64(e,!0)}wt.readFloat64LE=s8;function o8(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(r,t),e}wt.writeFloat32BE=o8;function a8(t,e,r){e===void 0&&(e=new Uint8Array(4)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat32(r,t,!0),e}wt.writeFloat32LE=a8;function c8(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(r,t),e}wt.writeFloat64BE=c8;function u8(t,e,r){e===void 0&&(e=new Uint8Array(8)),r===void 0&&(r=0);var i=new DataView(e.buffer,e.byteOffset,e.byteLength);return i.setFloat64(r,t,!0),e}wt.writeFloat64LE=u8;var Ri={};Object.defineProperty(Ri,"__esModule",{value:!0});function f8(t){for(var e=0;e<t.length;e++)t[e]=0;return t}Ri.wipe=f8,Object.defineProperty(Af,"__esModule",{value:!0});var Vr=wt,I0=Ri,h8=20;function l8(t,e,r){for(var i=1634760805,n=857760878,s=2036477234,a=1797285236,u=r[3]<<24|r[2]<<16|r[1]<<8|r[0],l=r[7]<<24|r[6]<<16|r[5]<<8|r[4],d=r[11]<<24|r[10]<<16|r[9]<<8|r[8],b=r[15]<<24|r[14]<<16|r[13]<<8|r[12],w=r[19]<<24|r[18]<<16|r[17]<<8|r[16],I=r[23]<<24|r[22]<<16|r[21]<<8|r[20],S=r[27]<<24|r[26]<<16|r[25]<<8|r[24],D=r[31]<<24|r[30]<<16|r[29]<<8|r[28],L=e[3]<<24|e[2]<<16|e[1]<<8|e[0],K=e[7]<<24|e[6]<<16|e[5]<<8|e[4],H=e[11]<<24|e[10]<<16|e[9]<<8|e[8],U=e[15]<<24|e[14]<<16|e[13]<<8|e[12],W=i,R=n,k=s,z=a,_=u,B=l,X=d,re=b,T=w,y=I,f=S,h=D,v=L,E=K,C=H,P=U,M=0;M<h8;M+=2)W=W+_|0,v^=W,v=v>>>32-16|v<<16,T=T+v|0,_^=T,_=_>>>32-12|_<<12,R=R+B|0,E^=R,E=E>>>32-16|E<<16,y=y+E|0,B^=y,B=B>>>32-12|B<<12,k=k+X|0,C^=k,C=C>>>32-16|C<<16,f=f+C|0,X^=f,X=X>>>32-12|X<<12,z=z+re|0,P^=z,P=P>>>32-16|P<<16,h=h+P|0,re^=h,re=re>>>32-12|re<<12,k=k+X|0,C^=k,C=C>>>32-8|C<<8,f=f+C|0,X^=f,X=X>>>32-7|X<<7,z=z+re|0,P^=z,P=P>>>32-8|P<<8,h=h+P|0,re^=h,re=re>>>32-7|re<<7,R=R+B|0,E^=R,E=E>>>32-8|E<<8,y=y+E|0,B^=y,B=B>>>32-7|B<<7,W=W+_|0,v^=W,v=v>>>32-8|v<<8,T=T+v|0,_^=T,_=_>>>32-7|_<<7,W=W+B|0,P^=W,P=P>>>32-16|P<<16,f=f+P|0,B^=f,B=B>>>32-12|B<<12,R=R+X|0,v^=R,v=v>>>32-16|v<<16,h=h+v|0,X^=h,X=X>>>32-12|X<<12,k=k+re|0,E^=k,E=E>>>32-16|E<<16,T=T+E|0,re^=T,re=re>>>32-12|re<<12,z=z+_|0,C^=z,C=C>>>32-16|C<<16,y=y+C|0,_^=y,_=_>>>32-12|_<<12,k=k+re|0,E^=k,E=E>>>32-8|E<<8,T=T+E|0,re^=T,re=re>>>32-7|re<<7,z=z+_|0,C^=z,C=C>>>32-8|C<<8,y=y+C|0,_^=y,_=_>>>32-7|_<<7,R=R+X|0,v^=R,v=v>>>32-8|v<<8,h=h+v|0,X^=h,X=X>>>32-7|X<<7,W=W+B|0,P^=W,P=P>>>32-8|P<<8,f=f+P|0,B^=f,B=B>>>32-7|B<<7;Vr.writeUint32LE(W+i|0,t,0),Vr.writeUint32LE(R+n|0,t,4),Vr.writeUint32LE(k+s|0,t,8),Vr.writeUint32LE(z+a|0,t,12),Vr.writeUint32LE(_+u|0,t,16),Vr.writeUint32LE(B+l|0,t,20),Vr.writeUint32LE(X+d|0,t,24),Vr.writeUint32LE(re+b|0,t,28),Vr.writeUint32LE(T+w|0,t,32),Vr.writeUint32LE(y+I|0,t,36),Vr.writeUint32LE(f+S|0,t,40),Vr.writeUint32LE(h+D|0,t,44),Vr.writeUint32LE(v+L|0,t,48),Vr.writeUint32LE(E+K|0,t,52),Vr.writeUint32LE(C+H|0,t,56),Vr.writeUint32LE(P+U|0,t,60)}function d2(t,e,r,i,n){if(n===void 0&&(n=0),t.length!==32)throw new Error("ChaCha: key size must be 32 bytes");if(i.length<r.length)throw new Error("ChaCha: destination is shorter than source");var s,a;if(n===0){if(e.length!==8&&e.length!==12)throw new Error("ChaCha nonce must be 8 or 12 bytes");s=new Uint8Array(16),a=s.length-e.length,s.set(e,a)}else{if(e.length!==16)throw new Error("ChaCha nonce with counter must be 16 bytes");s=e,a=n}for(var u=new Uint8Array(64),l=0;l<r.length;l+=64){l8(u,s,t);for(var d=l;d<l+64&&d<r.length;d++)i[d]=r[d]^u[d-l];p8(s,0,a)}return I0.wipe(u),n===0&&I0.wipe(s),i}Af.streamXOR=d2;function d8(t,e,r,i){return i===void 0&&(i=0),I0.wipe(r),d2(t,e,r,r,i)}Af.stream=d8;function p8(t,e,r){for(var i=1;r--;)i=i+(t[e]&255)|0,t[e]=i&255,i>>>=8,e++;if(i>0)throw new Error("ChaCha: counter overflow")}var p2={},Ys={};Object.defineProperty(Ys,"__esModule",{value:!0});function g8(t,e,r){return~(t-1)&e|t-1&r}Ys.select=g8;function v8(t,e){return(t|0)-(e|0)-1>>>31&1}Ys.lessOrEqual=v8;function g2(t,e){if(t.length!==e.length)return 0;for(var r=0,i=0;i<t.length;i++)r|=t[i]^e[i];return 1&r-1>>>8}Ys.compare=g2;function m8(t,e){return t.length===0||e.length===0?!1:g2(t,e)!==0}Ys.equal=m8,function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Ys,r=Ri;t.DIGEST_LENGTH=16;var i=function(){function a(u){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var l=u[0]|u[1]<<8;this._r[0]=l&8191;var d=u[2]|u[3]<<8;this._r[1]=(l>>>13|d<<3)&8191;var b=u[4]|u[5]<<8;this._r[2]=(d>>>10|b<<6)&7939;var w=u[6]|u[7]<<8;this._r[3]=(b>>>7|w<<9)&8191;var I=u[8]|u[9]<<8;this._r[4]=(w>>>4|I<<12)&255,this._r[5]=I>>>1&8190;var S=u[10]|u[11]<<8;this._r[6]=(I>>>14|S<<2)&8191;var D=u[12]|u[13]<<8;this._r[7]=(S>>>11|D<<5)&8065;var L=u[14]|u[15]<<8;this._r[8]=(D>>>8|L<<8)&8191,this._r[9]=L>>>5&127,this._pad[0]=u[16]|u[17]<<8,this._pad[1]=u[18]|u[19]<<8,this._pad[2]=u[20]|u[21]<<8,this._pad[3]=u[22]|u[23]<<8,this._pad[4]=u[24]|u[25]<<8,this._pad[5]=u[26]|u[27]<<8,this._pad[6]=u[28]|u[29]<<8,this._pad[7]=u[30]|u[31]<<8}return a.prototype._blocks=function(u,l,d){for(var b=this._fin?0:2048,w=this._h[0],I=this._h[1],S=this._h[2],D=this._h[3],L=this._h[4],K=this._h[5],H=this._h[6],U=this._h[7],W=this._h[8],R=this._h[9],k=this._r[0],z=this._r[1],_=this._r[2],B=this._r[3],X=this._r[4],re=this._r[5],T=this._r[6],y=this._r[7],f=this._r[8],h=this._r[9];d>=16;){var v=u[l+0]|u[l+1]<<8;w+=v&8191;var E=u[l+2]|u[l+3]<<8;I+=(v>>>13|E<<3)&8191;var C=u[l+4]|u[l+5]<<8;S+=(E>>>10|C<<6)&8191;var P=u[l+6]|u[l+7]<<8;D+=(C>>>7|P<<9)&8191;var M=u[l+8]|u[l+9]<<8;L+=(P>>>4|M<<12)&8191,K+=M>>>1&8191;var g=u[l+10]|u[l+11]<<8;H+=(M>>>14|g<<2)&8191;var m=u[l+12]|u[l+13]<<8;U+=(g>>>11|m<<5)&8191;var N=u[l+14]|u[l+15]<<8;W+=(m>>>8|N<<8)&8191,R+=N>>>5|b;var ee=0,ae=ee;ae+=w*k,ae+=I*(5*h),ae+=S*(5*f),ae+=D*(5*y),ae+=L*(5*T),ee=ae>>>13,ae&=8191,ae+=K*(5*re),ae+=H*(5*X),ae+=U*(5*B),ae+=W*(5*_),ae+=R*(5*z),ee+=ae>>>13,ae&=8191;var O=ee;O+=w*z,O+=I*k,O+=S*(5*h),O+=D*(5*f),O+=L*(5*y),ee=O>>>13,O&=8191,O+=K*(5*T),O+=H*(5*re),O+=U*(5*X),O+=W*(5*B),O+=R*(5*_),ee+=O>>>13,O&=8191;var te=ee;te+=w*_,te+=I*z,te+=S*k,te+=D*(5*h),te+=L*(5*f),ee=te>>>13,te&=8191,te+=K*(5*y),te+=H*(5*T),te+=U*(5*re),te+=W*(5*X),te+=R*(5*B),ee+=te>>>13,te&=8191;var q=ee;q+=w*B,q+=I*_,q+=S*z,q+=D*k,q+=L*(5*h),ee=q>>>13,q&=8191,q+=K*(5*f),q+=H*(5*y),q+=U*(5*T),q+=W*(5*re),q+=R*(5*X),ee+=q>>>13,q&=8191;var G=ee;G+=w*X,G+=I*B,G+=S*_,G+=D*z,G+=L*k,ee=G>>>13,G&=8191,G+=K*(5*h),G+=H*(5*f),G+=U*(5*y),G+=W*(5*T),G+=R*(5*re),ee+=G>>>13,G&=8191;var Y=ee;Y+=w*re,Y+=I*X,Y+=S*B,Y+=D*_,Y+=L*z,ee=Y>>>13,Y&=8191,Y+=K*k,Y+=H*(5*h),Y+=U*(5*f),Y+=W*(5*y),Y+=R*(5*T),ee+=Y>>>13,Y&=8191;var A=ee;A+=w*T,A+=I*re,A+=S*X,A+=D*B,A+=L*_,ee=A>>>13,A&=8191,A+=K*z,A+=H*k,A+=U*(5*h),A+=W*(5*f),A+=R*(5*y),ee+=A>>>13,A&=8191;var V=ee;V+=w*y,V+=I*T,V+=S*re,V+=D*X,V+=L*B,ee=V>>>13,V&=8191,V+=K*_,V+=H*z,V+=U*k,V+=W*(5*h),V+=R*(5*f),ee+=V>>>13,V&=8191;var oe=ee;oe+=w*f,oe+=I*y,oe+=S*T,oe+=D*re,oe+=L*X,ee=oe>>>13,oe&=8191,oe+=K*B,oe+=H*_,oe+=U*z,oe+=W*k,oe+=R*(5*h),ee+=oe>>>13,oe&=8191;var ue=ee;ue+=w*h,ue+=I*f,ue+=S*y,ue+=D*T,ue+=L*re,ee=ue>>>13,ue&=8191,ue+=K*X,ue+=H*B,ue+=U*_,ue+=W*z,ue+=R*k,ee+=ue>>>13,ue&=8191,ee=(ee<<2)+ee|0,ee=ee+ae|0,ae=ee&8191,ee=ee>>>13,O+=ee,w=ae,I=O,S=te,D=q,L=G,K=Y,H=A,U=V,W=oe,R=ue,l+=16,d-=16}this._h[0]=w,this._h[1]=I,this._h[2]=S,this._h[3]=D,this._h[4]=L,this._h[5]=K,this._h[6]=H,this._h[7]=U,this._h[8]=W,this._h[9]=R},a.prototype.finish=function(u,l){l===void 0&&(l=0);var d=new Uint16Array(10),b,w,I,S;if(this._leftover){for(S=this._leftover,this._buffer[S++]=1;S<16;S++)this._buffer[S]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(b=this._h[1]>>>13,this._h[1]&=8191,S=2;S<10;S++)this._h[S]+=b,b=this._h[S]>>>13,this._h[S]&=8191;for(this._h[0]+=b*5,b=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=b,b=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=b,d[0]=this._h[0]+5,b=d[0]>>>13,d[0]&=8191,S=1;S<10;S++)d[S]=this._h[S]+b,b=d[S]>>>13,d[S]&=8191;for(d[9]-=8192,w=(b^1)-1,S=0;S<10;S++)d[S]&=w;for(w=~w,S=0;S<10;S++)this._h[S]=this._h[S]&w|d[S];for(this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,I=this._h[0]+this._pad[0],this._h[0]=I&65535,S=1;S<8;S++)I=(this._h[S]+this._pad[S]|0)+(I>>>16)|0,this._h[S]=I&65535;return u[l+0]=this._h[0]>>>0,u[l+1]=this._h[0]>>>8,u[l+2]=this._h[1]>>>0,u[l+3]=this._h[1]>>>8,u[l+4]=this._h[2]>>>0,u[l+5]=this._h[2]>>>8,u[l+6]=this._h[3]>>>0,u[l+7]=this._h[3]>>>8,u[l+8]=this._h[4]>>>0,u[l+9]=this._h[4]>>>8,u[l+10]=this._h[5]>>>0,u[l+11]=this._h[5]>>>8,u[l+12]=this._h[6]>>>0,u[l+13]=this._h[6]>>>8,u[l+14]=this._h[7]>>>0,u[l+15]=this._h[7]>>>8,this._finished=!0,this},a.prototype.update=function(u){var l=0,d=u.length,b;if(this._leftover){b=16-this._leftover,b>d&&(b=d);for(var w=0;w<b;w++)this._buffer[this._leftover+w]=u[l+w];if(d-=b,l+=b,this._leftover+=b,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(d>=16&&(b=d-d%16,this._blocks(u,l,b),l+=b,d-=b),d){for(var w=0;w<d;w++)this._buffer[this._leftover+w]=u[l+w];this._leftover+=d}return this},a.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var u=new Uint8Array(16);return this.finish(u),u},a.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},a}();t.Poly1305=i;function n(a,u){var l=new i(a);l.update(u);var d=l.digest();return l.clean(),d}t.oneTimeAuth=n;function s(a,u){return a.length!==t.DIGEST_LENGTH||u.length!==t.DIGEST_LENGTH?!1:e.equal(a,u)}t.equal=s}(p2),function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=Af,r=p2,i=Ri,n=wt,s=Ys;t.KEY_LENGTH=32,t.NONCE_LENGTH=12,t.TAG_LENGTH=16;var a=new Uint8Array(16),u=function(){function l(d){if(this.nonceLength=t.NONCE_LENGTH,this.tagLength=t.TAG_LENGTH,d.length!==t.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(d)}return l.prototype.seal=function(d,b,w,I){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var S=new Uint8Array(16);S.set(d,S.length-d.length);var D=new Uint8Array(32);e.stream(this._key,S,D,4);var L=b.length+this.tagLength,K;if(I){if(I.length!==L)throw new Error("ChaCha20Poly1305: incorrect destination length");K=I}else K=new Uint8Array(L);return e.streamXOR(this._key,S,b,K,4),this._authenticate(K.subarray(K.length-this.tagLength,K.length),D,K.subarray(0,K.length-this.tagLength),w),i.wipe(S),K},l.prototype.open=function(d,b,w,I){if(d.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(b.length<this.tagLength)return null;var S=new Uint8Array(16);S.set(d,S.length-d.length);var D=new Uint8Array(32);e.stream(this._key,S,D,4);var L=new Uint8Array(this.tagLength);if(this._authenticate(L,D,b.subarray(0,b.length-this.tagLength),w),!s.equal(L,b.subarray(b.length-this.tagLength,b.length)))return null;var K=b.length-this.tagLength,H;if(I){if(I.length!==K)throw new Error("ChaCha20Poly1305: incorrect destination length");H=I}else H=new Uint8Array(K);return e.streamXOR(this._key,S,b.subarray(0,b.length-this.tagLength),H,4),i.wipe(S),H},l.prototype.clean=function(){return i.wipe(this._key),this},l.prototype._authenticate=function(d,b,w,I){var S=new r.Poly1305(b);I&&(S.update(I),I.length%16>0&&S.update(a.subarray(I.length%16))),S.update(w),w.length%16>0&&S.update(a.subarray(w.length%16));var D=new Uint8Array(8);I&&n.writeUint64LE(I.length,D),S.update(D),n.writeUint64LE(w.length,D),S.update(D);for(var L=S.digest(),K=0;K<L.length;K++)d[K]=L[K];S.clean(),i.wipe(L),i.wipe(D)},l}();t.ChaCha20Poly1305=u}(_0);var v2={},Yc={},M0={};Object.defineProperty(M0,"__esModule",{value:!0});function b8(t){return typeof t.saveState<"u"&&typeof t.restoreState<"u"&&typeof t.cleanSavedState<"u"}M0.isSerializableHash=b8,Object.defineProperty(Yc,"__esModule",{value:!0});var Un=M0,y8=Ys,w8=Ri,m2=function(){function t(e,r){this._finished=!1,this._inner=new e,this._outer=new e,this.blockSize=this._outer.blockSize,this.digestLength=this._outer.digestLength;var i=new Uint8Array(this.blockSize);r.length>this.blockSize?this._inner.update(r).finish(i).clean():i.set(r);for(var n=0;n<i.length;n++)i[n]^=54;this._inner.update(i);for(var n=0;n<i.length;n++)i[n]^=106;this._outer.update(i),Un.isSerializableHash(this._inner)&&Un.isSerializableHash(this._outer)&&(this._innerKeyedState=this._inner.saveState(),this._outerKeyedState=this._outer.saveState()),w8.wipe(i)}return t.prototype.reset=function(){if(!Un.isSerializableHash(this._inner)||!Un.isSerializableHash(this._outer))throw new Error("hmac: can't reset() because hash doesn't implement restoreState()");return this._inner.restoreState(this._innerKeyedState),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.clean=function(){Un.isSerializableHash(this._inner)&&this._inner.cleanSavedState(this._innerKeyedState),Un.isSerializableHash(this._outer)&&this._outer.cleanSavedState(this._outerKeyedState),this._inner.clean(),this._outer.clean()},t.prototype.update=function(e){return this._inner.update(e),this},t.prototype.finish=function(e){return this._finished?(this._outer.finish(e),this):(this._inner.finish(e),this._outer.update(e.subarray(0,this.digestLength)).finish(e),this._finished=!0,this)},t.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},t.prototype.saveState=function(){if(!Un.isSerializableHash(this._inner))throw new Error("hmac: can't saveState() because hash doesn't implement it");return this._inner.saveState()},t.prototype.restoreState=function(e){if(!Un.isSerializableHash(this._inner)||!Un.isSerializableHash(this._outer))throw new Error("hmac: can't restoreState() because hash doesn't implement it");return this._inner.restoreState(e),this._outer.restoreState(this._outerKeyedState),this._finished=!1,this},t.prototype.cleanSavedState=function(e){if(!Un.isSerializableHash(this._inner))throw new Error("hmac: can't cleanSavedState() because hash doesn't implement it");this._inner.cleanSavedState(e)},t}();Yc.HMAC=m2;function _8(t,e,r){var i=new m2(t,e);i.update(r);var n=i.digest();return i.clean(),n}Yc.hmac=_8,Yc.equal=y8.equal,Object.defineProperty(v2,"__esModule",{value:!0});var b2=Yc,y2=Ri,E8=function(){function t(e,r,i,n){i===void 0&&(i=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=n;var s=b2.hmac(this._hash,i,r);this._hmac=new b2.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return t.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(e===0)throw new Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},t.prototype.expand=function(e){for(var r=new Uint8Array(e),i=0;i<r.length;i++)this._bufpos===this._buffer.length&&this._fillBuffer(),r[i]=this._buffer[this._bufpos++];return r},t.prototype.clean=function(){this._hmac.clean(),y2.wipe(this._buffer),y2.wipe(this._counter),this._bufpos=0},t}(),A8=v2.HKDF=E8,Ma={},If={},Mf={};Object.defineProperty(Mf,"__esModule",{value:!0}),Mf.BrowserRandomSource=void 0;const w2=65536;class x8{constructor(){this.isAvailable=!1,this.isInstantiated=!1;const e=typeof self<"u"?self.crypto||self.msCrypto:null;e&&e.getRandomValues!==void 0&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");const r=new Uint8Array(e);for(let i=0;i<r.length;i+=w2)this._crypto.getRandomValues(r.subarray(i,i+Math.min(r.length-i,w2)));return r}}Mf.BrowserRandomSource=x8;function S8(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Cf={},I8={},M8=Object.freeze({__proto__:null,default:I8}),C0=f0(M8);Object.defineProperty(Cf,"__esModule",{value:!0}),Cf.NodeRandomSource=void 0;const C8=Ri;class D8{constructor(){if(this.isAvailable=!1,this.isInstantiated=!1,typeof S8<"u"){const e=C0;e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}randomBytes(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");let r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");const i=new Uint8Array(e);for(let n=0;n<i.length;n++)i[n]=r[n];return(0,C8.wipe)(r),i}}Cf.NodeRandomSource=D8,Object.defineProperty(If,"__esModule",{value:!0}),If.SystemRandomSource=void 0;const O8=Mf,P8=Cf;class $8{constructor(){if(this.isAvailable=!1,this.name="",this._source=new O8.BrowserRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Browser";return}if(this._source=new P8.NodeRandomSource,this._source.isAvailable){this.isAvailable=!0,this.name="Node";return}}randomBytes(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)}}If.SystemRandomSource=$8,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.randomStringForEntropy=t.randomString=t.randomUint32=t.randomBytes=t.defaultRandomSource=void 0;const e=If,r=wt,i=Ri;t.defaultRandomSource=new e.SystemRandomSource;function n(d,b=t.defaultRandomSource){return b.randomBytes(d)}t.randomBytes=n;function s(d=t.defaultRandomSource){const b=n(4,d),w=(0,r.readUint32LE)(b);return(0,i.wipe)(b),w}t.randomUint32=s;const a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function u(d,b=a,w=t.defaultRandomSource){if(b.length<2)throw new Error("randomString charset is too short");if(b.length>256)throw new Error("randomString charset is too long");let I="";const S=b.length,D=256-256%S;for(;d>0;){const L=n(Math.ceil(d*256/D),w);for(let K=0;K<L.length&&d>0;K++){const H=L[K];H<D&&(I+=b.charAt(H%S),d--)}(0,i.wipe)(L)}return I}t.randomString=u;function l(d,b=a,w=t.defaultRandomSource){const I=Math.ceil(d/(Math.log(b.length)/Math.LN2));return u(I,b,w)}t.randomStringForEntropy=l}(Ma);var Jc={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=wt,r=Ri;t.DIGEST_LENGTH=32,t.BLOCK_SIZE=64;var i=function(){function u(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},u.prototype.update=function(l,d){if(d===void 0&&(d=l.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var b=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&d>0;)this._buffer[this._bufferLength++]=l[b++],d--;this._bufferLength===this.blockSize&&(s(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(b=s(this._temp,this._state,l,b,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=l[b++],d--;return this},u.prototype.finish=function(l){if(!this._finished){var d=this._bytesHashed,b=this._bufferLength,w=d/536870912|0,I=d<<3,S=d%64<56?64:128;this._buffer[b]=128;for(var D=b+1;D<S-8;D++)this._buffer[D]=0;e.writeUint32BE(w,this._buffer,S-8),e.writeUint32BE(I,this._buffer,S-4),s(this._temp,this._state,this._buffer,0,S),this._finished=!0}for(var D=0;D<this.digestLength/4;D++)e.writeUint32BE(this._state[D],l,D*4);return this},u.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},u.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(l){return this._state.set(l.state),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(l){r.wipe(l.state),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},u}();t.SHA256=i;var n=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function s(u,l,d,b,w){for(;w>=64;){for(var I=l[0],S=l[1],D=l[2],L=l[3],K=l[4],H=l[5],U=l[6],W=l[7],R=0;R<16;R++){var k=b+R*4;u[R]=e.readUint32BE(d,k)}for(var R=16;R<64;R++){var z=u[R-2],_=(z>>>17|z<<32-17)^(z>>>19|z<<32-19)^z>>>10;z=u[R-15];var B=(z>>>7|z<<32-7)^(z>>>18|z<<32-18)^z>>>3;u[R]=(_+u[R-7]|0)+(B+u[R-16]|0)}for(var R=0;R<64;R++){var _=(((K>>>6|K<<26)^(K>>>11|K<<21)^(K>>>25|K<<7))+(K&H^~K&U)|0)+(W+(n[R]+u[R]|0)|0)|0,B=((I>>>2|I<<32-2)^(I>>>13|I<<32-13)^(I>>>22|I<<32-22))+(I&S^I&D^S&D)|0;W=U,U=H,H=K,K=L+_|0,L=D,D=S,S=I,I=_+B|0}l[0]+=I,l[1]+=S,l[2]+=D,l[3]+=L,l[4]+=K,l[5]+=H,l[6]+=U,l[7]+=W,b+=64,w-=64}return b}function a(u){var l=new i;l.update(u);var d=l.digest();return l.clean(),d}t.hash=a})(Jc);var D0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.sharedKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.scalarMultBase=t.scalarMult=t.SHARED_KEY_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=void 0;const e=Ma,r=Ri;t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=32,t.SHARED_KEY_LENGTH=32;function i(R){const k=new Float64Array(16);if(R)for(let z=0;z<R.length;z++)k[z]=R[z];return k}const n=new Uint8Array(32);n[0]=9;const s=i([56129,1]);function a(R){let k=1;for(let z=0;z<16;z++){let _=R[z]+k+65535;k=Math.floor(_/65536),R[z]=_-k*65536}R[0]+=k-1+37*(k-1)}function u(R,k,z){const _=~(z-1);for(let B=0;B<16;B++){const X=_&(R[B]^k[B]);R[B]^=X,k[B]^=X}}function l(R,k){const z=i(),_=i();for(let B=0;B<16;B++)_[B]=k[B];a(_),a(_),a(_);for(let B=0;B<2;B++){z[0]=_[0]-65517;for(let re=1;re<15;re++)z[re]=_[re]-65535-(z[re-1]>>16&1),z[re-1]&=65535;z[15]=_[15]-32767-(z[14]>>16&1);const X=z[15]>>16&1;z[14]&=65535,u(_,z,1-X)}for(let B=0;B<16;B++)R[2*B]=_[B]&255,R[2*B+1]=_[B]>>8}function d(R,k){for(let z=0;z<16;z++)R[z]=k[2*z]+(k[2*z+1]<<8);R[15]&=32767}function b(R,k,z){for(let _=0;_<16;_++)R[_]=k[_]+z[_]}function w(R,k,z){for(let _=0;_<16;_++)R[_]=k[_]-z[_]}function I(R,k,z){let _,B,X=0,re=0,T=0,y=0,f=0,h=0,v=0,E=0,C=0,P=0,M=0,g=0,m=0,N=0,ee=0,ae=0,O=0,te=0,q=0,G=0,Y=0,A=0,V=0,oe=0,ue=0,he=0,ye=0,we=0,Re=0,Xe=0,Oe=0,Ne=z[0],Me=z[1],be=z[2],Pe=z[3],Te=z[4],ve=z[5],$e=z[6],xe=z[7],me=z[8],Ue=z[9],Ce=z[10],_e=z[11],Ke=z[12],Ve=z[13],Ae=z[14],We=z[15];_=k[0],X+=_*Ne,re+=_*Me,T+=_*be,y+=_*Pe,f+=_*Te,h+=_*ve,v+=_*$e,E+=_*xe,C+=_*me,P+=_*Ue,M+=_*Ce,g+=_*_e,m+=_*Ke,N+=_*Ve,ee+=_*Ae,ae+=_*We,_=k[1],re+=_*Ne,T+=_*Me,y+=_*be,f+=_*Pe,h+=_*Te,v+=_*ve,E+=_*$e,C+=_*xe,P+=_*me,M+=_*Ue,g+=_*Ce,m+=_*_e,N+=_*Ke,ee+=_*Ve,ae+=_*Ae,O+=_*We,_=k[2],T+=_*Ne,y+=_*Me,f+=_*be,h+=_*Pe,v+=_*Te,E+=_*ve,C+=_*$e,P+=_*xe,M+=_*me,g+=_*Ue,m+=_*Ce,N+=_*_e,ee+=_*Ke,ae+=_*Ve,O+=_*Ae,te+=_*We,_=k[3],y+=_*Ne,f+=_*Me,h+=_*be,v+=_*Pe,E+=_*Te,C+=_*ve,P+=_*$e,M+=_*xe,g+=_*me,m+=_*Ue,N+=_*Ce,ee+=_*_e,ae+=_*Ke,O+=_*Ve,te+=_*Ae,q+=_*We,_=k[4],f+=_*Ne,h+=_*Me,v+=_*be,E+=_*Pe,C+=_*Te,P+=_*ve,M+=_*$e,g+=_*xe,m+=_*me,N+=_*Ue,ee+=_*Ce,ae+=_*_e,O+=_*Ke,te+=_*Ve,q+=_*Ae,G+=_*We,_=k[5],h+=_*Ne,v+=_*Me,E+=_*be,C+=_*Pe,P+=_*Te,M+=_*ve,g+=_*$e,m+=_*xe,N+=_*me,ee+=_*Ue,ae+=_*Ce,O+=_*_e,te+=_*Ke,q+=_*Ve,G+=_*Ae,Y+=_*We,_=k[6],v+=_*Ne,E+=_*Me,C+=_*be,P+=_*Pe,M+=_*Te,g+=_*ve,m+=_*$e,N+=_*xe,ee+=_*me,ae+=_*Ue,O+=_*Ce,te+=_*_e,q+=_*Ke,G+=_*Ve,Y+=_*Ae,A+=_*We,_=k[7],E+=_*Ne,C+=_*Me,P+=_*be,M+=_*Pe,g+=_*Te,m+=_*ve,N+=_*$e,ee+=_*xe,ae+=_*me,O+=_*Ue,te+=_*Ce,q+=_*_e,G+=_*Ke,Y+=_*Ve,A+=_*Ae,V+=_*We,_=k[8],C+=_*Ne,P+=_*Me,M+=_*be,g+=_*Pe,m+=_*Te,N+=_*ve,ee+=_*$e,ae+=_*xe,O+=_*me,te+=_*Ue,q+=_*Ce,G+=_*_e,Y+=_*Ke,A+=_*Ve,V+=_*Ae,oe+=_*We,_=k[9],P+=_*Ne,M+=_*Me,g+=_*be,m+=_*Pe,N+=_*Te,ee+=_*ve,ae+=_*$e,O+=_*xe,te+=_*me,q+=_*Ue,G+=_*Ce,Y+=_*_e,A+=_*Ke,V+=_*Ve,oe+=_*Ae,ue+=_*We,_=k[10],M+=_*Ne,g+=_*Me,m+=_*be,N+=_*Pe,ee+=_*Te,ae+=_*ve,O+=_*$e,te+=_*xe,q+=_*me,G+=_*Ue,Y+=_*Ce,A+=_*_e,V+=_*Ke,oe+=_*Ve,ue+=_*Ae,he+=_*We,_=k[11],g+=_*Ne,m+=_*Me,N+=_*be,ee+=_*Pe,ae+=_*Te,O+=_*ve,te+=_*$e,q+=_*xe,G+=_*me,Y+=_*Ue,A+=_*Ce,V+=_*_e,oe+=_*Ke,ue+=_*Ve,he+=_*Ae,ye+=_*We,_=k[12],m+=_*Ne,N+=_*Me,ee+=_*be,ae+=_*Pe,O+=_*Te,te+=_*ve,q+=_*$e,G+=_*xe,Y+=_*me,A+=_*Ue,V+=_*Ce,oe+=_*_e,ue+=_*Ke,he+=_*Ve,ye+=_*Ae,we+=_*We,_=k[13],N+=_*Ne,ee+=_*Me,ae+=_*be,O+=_*Pe,te+=_*Te,q+=_*ve,G+=_*$e,Y+=_*xe,A+=_*me,V+=_*Ue,oe+=_*Ce,ue+=_*_e,he+=_*Ke,ye+=_*Ve,we+=_*Ae,Re+=_*We,_=k[14],ee+=_*Ne,ae+=_*Me,O+=_*be,te+=_*Pe,q+=_*Te,G+=_*ve,Y+=_*$e,A+=_*xe,V+=_*me,oe+=_*Ue,ue+=_*Ce,he+=_*_e,ye+=_*Ke,we+=_*Ve,Re+=_*Ae,Xe+=_*We,_=k[15],ae+=_*Ne,O+=_*Me,te+=_*be,q+=_*Pe,G+=_*Te,Y+=_*ve,A+=_*$e,V+=_*xe,oe+=_*me,ue+=_*Ue,he+=_*Ce,ye+=_*_e,we+=_*Ke,Re+=_*Ve,Xe+=_*Ae,Oe+=_*We,X+=38*O,re+=38*te,T+=38*q,y+=38*G,f+=38*Y,h+=38*A,v+=38*V,E+=38*oe,C+=38*ue,P+=38*he,M+=38*ye,g+=38*we,m+=38*Re,N+=38*Xe,ee+=38*Oe,B=1,_=X+B+65535,B=Math.floor(_/65536),X=_-B*65536,_=re+B+65535,B=Math.floor(_/65536),re=_-B*65536,_=T+B+65535,B=Math.floor(_/65536),T=_-B*65536,_=y+B+65535,B=Math.floor(_/65536),y=_-B*65536,_=f+B+65535,B=Math.floor(_/65536),f=_-B*65536,_=h+B+65535,B=Math.floor(_/65536),h=_-B*65536,_=v+B+65535,B=Math.floor(_/65536),v=_-B*65536,_=E+B+65535,B=Math.floor(_/65536),E=_-B*65536,_=C+B+65535,B=Math.floor(_/65536),C=_-B*65536,_=P+B+65535,B=Math.floor(_/65536),P=_-B*65536,_=M+B+65535,B=Math.floor(_/65536),M=_-B*65536,_=g+B+65535,B=Math.floor(_/65536),g=_-B*65536,_=m+B+65535,B=Math.floor(_/65536),m=_-B*65536,_=N+B+65535,B=Math.floor(_/65536),N=_-B*65536,_=ee+B+65535,B=Math.floor(_/65536),ee=_-B*65536,_=ae+B+65535,B=Math.floor(_/65536),ae=_-B*65536,X+=B-1+37*(B-1),B=1,_=X+B+65535,B=Math.floor(_/65536),X=_-B*65536,_=re+B+65535,B=Math.floor(_/65536),re=_-B*65536,_=T+B+65535,B=Math.floor(_/65536),T=_-B*65536,_=y+B+65535,B=Math.floor(_/65536),y=_-B*65536,_=f+B+65535,B=Math.floor(_/65536),f=_-B*65536,_=h+B+65535,B=Math.floor(_/65536),h=_-B*65536,_=v+B+65535,B=Math.floor(_/65536),v=_-B*65536,_=E+B+65535,B=Math.floor(_/65536),E=_-B*65536,_=C+B+65535,B=Math.floor(_/65536),C=_-B*65536,_=P+B+65535,B=Math.floor(_/65536),P=_-B*65536,_=M+B+65535,B=Math.floor(_/65536),M=_-B*65536,_=g+B+65535,B=Math.floor(_/65536),g=_-B*65536,_=m+B+65535,B=Math.floor(_/65536),m=_-B*65536,_=N+B+65535,B=Math.floor(_/65536),N=_-B*65536,_=ee+B+65535,B=Math.floor(_/65536),ee=_-B*65536,_=ae+B+65535,B=Math.floor(_/65536),ae=_-B*65536,X+=B-1+37*(B-1),R[0]=X,R[1]=re,R[2]=T,R[3]=y,R[4]=f,R[5]=h,R[6]=v,R[7]=E,R[8]=C,R[9]=P,R[10]=M,R[11]=g,R[12]=m,R[13]=N,R[14]=ee,R[15]=ae}function S(R,k){I(R,k,k)}function D(R,k){const z=i();for(let _=0;_<16;_++)z[_]=k[_];for(let _=253;_>=0;_--)S(z,z),_!==2&&_!==4&&I(z,z,k);for(let _=0;_<16;_++)R[_]=z[_]}function L(R,k){const z=new Uint8Array(32),_=new Float64Array(80),B=i(),X=i(),re=i(),T=i(),y=i(),f=i();for(let C=0;C<31;C++)z[C]=R[C];z[31]=R[31]&127|64,z[0]&=248,d(_,k);for(let C=0;C<16;C++)X[C]=_[C];B[0]=T[0]=1;for(let C=254;C>=0;--C){const P=z[C>>>3]>>>(C&7)&1;u(B,X,P),u(re,T,P),b(y,B,re),w(B,B,re),b(re,X,T),w(X,X,T),S(T,y),S(f,B),I(B,re,B),I(re,X,y),b(y,B,re),w(B,B,re),S(X,B),w(re,T,f),I(B,re,s),b(B,B,T),I(re,re,B),I(B,T,f),I(T,X,_),S(X,y),u(B,X,P),u(re,T,P)}for(let C=0;C<16;C++)_[C+16]=B[C],_[C+32]=re[C],_[C+48]=X[C],_[C+64]=T[C];const h=_.subarray(32),v=_.subarray(16);D(h,h),I(v,v,h);const E=new Uint8Array(32);return l(E,v),E}t.scalarMult=L;function K(R){return L(R,n)}t.scalarMultBase=K;function H(R){if(R.length!==t.SECRET_KEY_LENGTH)throw new Error(`x25519: seed must be ${t.SECRET_KEY_LENGTH} bytes`);const k=new Uint8Array(R);return{publicKey:K(k),secretKey:k}}t.generateKeyPairFromSeed=H;function U(R){const k=(0,e.randomBytes)(32,R),z=H(k);return(0,r.wipe)(k),z}t.generateKeyPair=U;function W(R,k,z=!1){if(R.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(k.length!==t.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");const _=L(R,k);if(z){let B=0;for(let X=0;X<_.length;X++)B|=_[X];if(B===0)throw new Error("X25519: invalid shared key")}return _}t.sharedKey=W})(D0);function _2(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function E2(t,e){e||(e=t.reduce((n,s)=>n+s.length,0));const r=_2(e);let i=0;for(const n of t)r.set(n,i),i+=n.length;return r}function R8(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=n}var u=t.length,l=t.charAt(0),d=Math.log(u)/Math.log(256),b=Math.log(256)/Math.log(u);function w(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var L=0,K=0,H=0,U=D.length;H!==U&&D[H]===0;)H++,L++;for(var W=(U-H)*b+1>>>0,R=new Uint8Array(W);H!==U;){for(var k=D[H],z=0,_=W-1;(k!==0||z<K)&&_!==-1;_--,z++)k+=256*R[_]>>>0,R[_]=k%u>>>0,k=k/u>>>0;if(k!==0)throw new Error("Non-zero carry");K=z,H++}for(var B=W-K;B!==W&&R[B]===0;)B++;for(var X=l.repeat(L);B<W;++B)X+=t.charAt(R[B]);return X}function I(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var L=0;if(D[L]!==" "){for(var K=0,H=0;D[L]===l;)K++,L++;for(var U=(D.length-L)*d+1>>>0,W=new Uint8Array(U);D[L];){var R=r[D.charCodeAt(L)];if(R===255)return;for(var k=0,z=U-1;(R!==0||k<H)&&z!==-1;z--,k++)R+=u*W[z]>>>0,W[z]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");H=k,L++}if(D[L]!==" "){for(var _=U-H;_!==U&&W[_]===0;)_++;for(var B=new Uint8Array(K+(U-_)),X=K;_!==U;)B[X++]=W[_++];return B}}}function S(D){var L=I(D);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:I,decode:S}}var N8=R8,T8=N8;const A2=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},L8=t=>new TextEncoder().encode(t),B8=t=>new TextDecoder().decode(t);class F8{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class U8{constructor(e,r,i){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return x2(this,e)}}class k8{constructor(e){this.decoders=e}or(e){return x2(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const x2=(t,e)=>new k8({...t.decoders||{[t.prefix]:t},...e.decoders||{[e.prefix]:e}});class j8{constructor(e,r,i,n){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=n,this.encoder=new F8(e,r,i),this.decoder=new U8(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Df=({name:t,prefix:e,encode:r,decode:i})=>new j8(t,e,r,i),Qc=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=T8(r,e);return Df({prefix:t,name:e,encode:i,decode:s=>A2(n(s))})},q8=(t,e,r,i)=>{const n={};for(let b=0;b<e.length;++b)n[e[b]]=b;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*r/8|0);let u=0,l=0,d=0;for(let b=0;b<s;++b){const w=n[t[b]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<r|w,u+=r,u>=8&&(u-=8,a[d++]=255&l>>u)}if(u>=r||255&l<<8-u)throw new SyntaxError("Unexpected end of data");return a},z8=(t,e,r)=>{const i=e[e.length-1]==="=",n=(1<<r)-1;let s="",a=0,u=0;for(let l=0;l<t.length;++l)for(u=u<<8|t[l],a+=8;a>r;)a-=r,s+=e[n&u>>a];if(a&&(s+=e[n&u<<r-a]),i)for(;s.length*r&7;)s+="=";return s},Fr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Df({prefix:e,name:t,encode(n){return z8(n,i,r)},decode(n){return q8(n,i,r,t)}}),H8=Df({prefix:"\0",name:"identity",encode:t=>B8(t),decode:t=>L8(t)});var K8=Object.freeze({__proto__:null,identity:H8});const W8=Fr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var V8=Object.freeze({__proto__:null,base2:W8});const G8=Fr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Y8=Object.freeze({__proto__:null,base8:G8});const J8=Qc({prefix:"9",name:"base10",alphabet:"0123456789"});var Q8=Object.freeze({__proto__:null,base10:J8});const Z8=Fr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),X8=Fr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var e7=Object.freeze({__proto__:null,base16:Z8,base16upper:X8});const t7=Fr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),r7=Fr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),i7=Fr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),n7=Fr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),s7=Fr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),o7=Fr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),a7=Fr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),c7=Fr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),u7=Fr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var f7=Object.freeze({__proto__:null,base32:t7,base32upper:r7,base32pad:i7,base32padupper:n7,base32hex:s7,base32hexupper:o7,base32hexpad:a7,base32hexpadupper:c7,base32z:u7});const h7=Qc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),l7=Qc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var d7=Object.freeze({__proto__:null,base36:h7,base36upper:l7});const p7=Qc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),g7=Qc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var v7=Object.freeze({__proto__:null,base58btc:p7,base58flickr:g7});const m7=Fr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),b7=Fr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),y7=Fr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),w7=Fr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var _7=Object.freeze({__proto__:null,base64:m7,base64pad:b7,base64url:y7,base64urlpad:w7});const S2=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),E7=S2.reduce((t,e,r)=>(t[r]=e,t),[]),A7=S2.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function x7(t){return t.reduce((e,r)=>(e+=E7[r],e),"")}function S7(t){const e=[];for(const r of t){const i=A7[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const I7=Df({prefix:"\u{1F680}",name:"base256emoji",encode:x7,decode:S7});var M7=Object.freeze({__proto__:null,base256emoji:I7}),C7=M2,I2=128,D7=127,O7=~D7,P7=Math.pow(2,31);function M2(t,e,r){e=e||[],r=r||0;for(var i=r;t>=P7;)e[r++]=t&255|I2,t/=128;for(;t&O7;)e[r++]=t&255|I2,t>>>=7;return e[r]=t|0,M2.bytes=r-i+1,e}var $7=O0,R7=128,C2=127;function O0(t,i){var r=0,i=i||0,n=0,s=i,a,u=t.length;do{if(s>=u)throw O0.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=n<28?(a&C2)<<n:(a&C2)*Math.pow(2,n),n+=7}while(a>=R7);return O0.bytes=s-i,r}var N7=Math.pow(2,7),T7=Math.pow(2,14),L7=Math.pow(2,21),B7=Math.pow(2,28),F7=Math.pow(2,35),U7=Math.pow(2,42),k7=Math.pow(2,49),j7=Math.pow(2,56),q7=Math.pow(2,63),z7=function(t){return t<N7?1:t<T7?2:t<L7?3:t<B7?4:t<F7?5:t<U7?6:t<k7?7:t<j7?8:t<q7?9:10},H7={encode:C7,decode:$7,encodingLength:z7},D2=H7;const O2=(t,e,r=0)=>(D2.encode(t,e,r),e),P2=t=>D2.encodingLength(t),P0=(t,e)=>{const r=e.byteLength,i=P2(t),n=i+P2(r),s=new Uint8Array(n+r);return O2(t,s,0),O2(r,s,i),s.set(e,n),new K7(t,r,e,s)};class K7{constructor(e,r,i,n){this.code=e,this.size=r,this.digest=i,this.bytes=n}}const $2=({name:t,code:e,encode:r})=>new W7(t,e,r);class W7{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?P0(this.code,r):r.then(i=>P0(this.code,i))}else throw Error("Unknown type, must be binary type")}}const R2=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),V7=$2({name:"sha2-256",code:18,encode:R2("SHA-256")}),G7=$2({name:"sha2-512",code:19,encode:R2("SHA-512")});var Y7=Object.freeze({__proto__:null,sha256:V7,sha512:G7});const N2=0,J7="identity",T2=A2;var Q7=Object.freeze({__proto__:null,identity:{code:N2,name:J7,encode:T2,digest:t=>P0(N2,T2(t))}});new TextEncoder,new TextDecoder;const Ca={...K8,...V8,...Y8,...Q8,...e7,...f7,...d7,...v7,..._7,...M7};({...Y7,...Q7});function L2(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const B2=L2("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),$0=L2("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=_2(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),F2={utf8:B2,"utf-8":B2,hex:Ca.base16,latin1:$0,ascii:$0,binary:$0,...Ca};function gn(t,e="utf8"){const r=F2[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}function vn(t,e="utf8"){const r=F2[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}var U2={},Z7="elliptic",X7="6.5.7",e9="EC cryptography",t9="lib/elliptic.js",r9=["lib"],i9={lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},n9={type:"git",url:"git@github.com:indutny/elliptic"},s9=["EC","Elliptic","curve","Cryptography"],o9="Fedor Indutny <fedor@indutny.com>",a9="MIT",c9={url:"https://github.com/indutny/elliptic/issues"},u9="https://github.com/indutny/elliptic",f9={brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},h9={"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},l9={name:Z7,version:X7,description:e9,main:t9,files:r9,scripts:i9,repository:n9,keywords:s9,author:o9,license:a9,bugs:c9,homepage:u9,devDependencies:f9,dependencies:h9},Ni={},kn={exports:{}};(function(t){(function(e,r){function i(T,y){if(!T)throw new Error(y||"Assertion failed")}function n(T,y){T.super_=y;var f=function(){};f.prototype=y.prototype,T.prototype=new f,T.prototype.constructor=T}function s(T,y,f){if(s.isBN(T))return T;this.negative=0,this.words=null,this.length=0,this.red=null,T!==null&&((y==="le"||y==="be")&&(f=y,y=10),this._init(T||0,y||10,f||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=C0.Buffer}catch{}s.isBN=function(y){return y instanceof s?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===s.wordSize&&Array.isArray(y.words)},s.max=function(y,f){return y.cmp(f)>0?y:f},s.min=function(y,f){return y.cmp(f)<0?y:f},s.prototype._init=function(y,f,h){if(typeof y=="number")return this._initNumber(y,f,h);if(typeof y=="object")return this._initArray(y,f,h);f==="hex"&&(f=16),i(f===(f|0)&&f>=2&&f<=36),y=y.toString().replace(/\s+/g,"");var v=0;y[0]==="-"&&(v++,this.negative=1),v<y.length&&(f===16?this._parseHex(y,v,h):(this._parseBase(y,f,v),h==="le"&&this._initArray(this.toArray(),f,h)))},s.prototype._initNumber=function(y,f,h){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(i(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),h==="le"&&this._initArray(this.toArray(),f,h)},s.prototype._initArray=function(y,f,h){if(i(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var E,C,P=0;if(h==="be")for(v=y.length-1,E=0;v>=0;v-=3)C=y[v]|y[v-1]<<8|y[v-2]<<16,this.words[E]|=C<<P&67108863,this.words[E+1]=C>>>26-P&67108863,P+=24,P>=26&&(P-=26,E++);else if(h==="le")for(v=0,E=0;v<y.length;v+=3)C=y[v]|y[v+1]<<8|y[v+2]<<16,this.words[E]|=C<<P&67108863,this.words[E+1]=C>>>26-P&67108863,P+=24,P>=26&&(P-=26,E++);return this.strip()};function u(T,y){var f=T.charCodeAt(y);return f>=65&&f<=70?f-55:f>=97&&f<=102?f-87:f-48&15}function l(T,y,f){var h=u(T,f);return f-1>=y&&(h|=u(T,f-1)<<4),h}s.prototype._parseHex=function(y,f,h){this.length=Math.ceil((y.length-f)/6),this.words=new Array(this.length);for(var v=0;v<this.length;v++)this.words[v]=0;var E=0,C=0,P;if(h==="be")for(v=y.length-1;v>=f;v-=2)P=l(y,f,v)<<E,this.words[C]|=P&67108863,E>=18?(E-=18,C+=1,this.words[C]|=P>>>26):E+=8;else{var M=y.length-f;for(v=M%2===0?f+1:f;v<y.length;v+=2)P=l(y,f,v)<<E,this.words[C]|=P&67108863,E>=18?(E-=18,C+=1,this.words[C]|=P>>>26):E+=8}this.strip()};function d(T,y,f,h){for(var v=0,E=Math.min(T.length,f),C=y;C<E;C++){var P=T.charCodeAt(C)-48;v*=h,P>=49?v+=P-49+10:P>=17?v+=P-17+10:v+=P}return v}s.prototype._parseBase=function(y,f,h){this.words=[0],this.length=1;for(var v=0,E=1;E<=67108863;E*=f)v++;v--,E=E/f|0;for(var C=y.length-h,P=C%v,M=Math.min(C,C-P)+h,g=0,m=h;m<M;m+=v)g=d(y,m,m+v,f),this.imuln(E),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g);if(P!==0){var N=1;for(g=d(y,m,y.length,f),m=0;m<P;m++)N*=f;this.imuln(N),this.words[0]+g<67108864?this.words[0]+=g:this._iaddn(g)}this.strip()},s.prototype.copy=function(y){y.words=new Array(this.length);for(var f=0;f<this.length;f++)y.words[f]=this.words[f];y.length=this.length,y.negative=this.negative,y.red=this.red},s.prototype.clone=function(){var y=new s(null);return this.copy(y),y},s.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var b=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],w=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],I=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(y,f){y=y||10,f=f|0||1;var h;if(y===16||y==="hex"){h="";for(var v=0,E=0,C=0;C<this.length;C++){var P=this.words[C],M=((P<<v|E)&16777215).toString(16);E=P>>>24-v&16777215,E!==0||C!==this.length-1?h=b[6-M.length]+M+h:h=M+h,v+=2,v>=26&&(v-=26,C--)}for(E!==0&&(h=E.toString(16)+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}if(y===(y|0)&&y>=2&&y<=36){var g=w[y],m=I[y];h="";var N=this.clone();for(N.negative=0;!N.isZero();){var ee=N.modn(m).toString(y);N=N.idivn(m),N.isZero()?h=ee+h:h=b[g-ee.length]+ee+h}for(this.isZero()&&(h="0"+h);h.length%f!==0;)h="0"+h;return this.negative!==0&&(h="-"+h),h}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(y,f){return i(typeof a<"u"),this.toArrayLike(a,y,f)},s.prototype.toArray=function(y,f){return this.toArrayLike(Array,y,f)},s.prototype.toArrayLike=function(y,f,h){var v=this.byteLength(),E=h||Math.max(1,v);i(v<=E,"byte array longer than desired length"),i(E>0,"Requested array length <= 0"),this.strip();var C=f==="le",P=new y(E),M,g,m=this.clone();if(C){for(g=0;!m.isZero();g++)M=m.andln(255),m.iushrn(8),P[g]=M;for(;g<E;g++)P[g]=0}else{for(g=0;g<E-v;g++)P[g]=0;for(g=0;!m.isZero();g++)M=m.andln(255),m.iushrn(8),P[E-g-1]=M}return P},Math.clz32?s.prototype._countBits=function(y){return 32-Math.clz32(y)}:s.prototype._countBits=function(y){var f=y,h=0;return f>=4096&&(h+=13,f>>>=13),f>=64&&(h+=7,f>>>=7),f>=8&&(h+=4,f>>>=4),f>=2&&(h+=2,f>>>=2),h+f},s.prototype._zeroBits=function(y){if(y===0)return 26;var f=y,h=0;return f&8191||(h+=13,f>>>=13),f&127||(h+=7,f>>>=7),f&15||(h+=4,f>>>=4),f&3||(h+=2,f>>>=2),f&1||h++,h},s.prototype.bitLength=function(){var y=this.words[this.length-1],f=this._countBits(y);return(this.length-1)*26+f};function S(T){for(var y=new Array(T.bitLength()),f=0;f<y.length;f++){var h=f/26|0,v=f%26;y[f]=(T.words[h]&1<<v)>>>v}return y}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,f=0;f<this.length;f++){var h=this._zeroBits(this.words[f]);if(y+=h,h!==26)break}return y},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},s.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var f=0;f<y.length;f++)this.words[f]=this.words[f]|y.words[f];return this.strip()},s.prototype.ior=function(y){return i((this.negative|y.negative)===0),this.iuor(y)},s.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},s.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},s.prototype.iuand=function(y){var f;this.length>y.length?f=y:f=this;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]&y.words[h];return this.length=f.length,this.strip()},s.prototype.iand=function(y){return i((this.negative|y.negative)===0),this.iuand(y)},s.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},s.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},s.prototype.iuxor=function(y){var f,h;this.length>y.length?(f=this,h=y):(f=y,h=this);for(var v=0;v<h.length;v++)this.words[v]=f.words[v]^h.words[v];if(this!==f)for(;v<f.length;v++)this.words[v]=f.words[v];return this.length=f.length,this.strip()},s.prototype.ixor=function(y){return i((this.negative|y.negative)===0),this.iuxor(y)},s.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},s.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},s.prototype.inotn=function(y){i(typeof y=="number"&&y>=0);var f=Math.ceil(y/26)|0,h=y%26;this._expand(f),h>0&&f--;for(var v=0;v<f;v++)this.words[v]=~this.words[v]&67108863;return h>0&&(this.words[v]=~this.words[v]&67108863>>26-h),this.strip()},s.prototype.notn=function(y){return this.clone().inotn(y)},s.prototype.setn=function(y,f){i(typeof y=="number"&&y>=0);var h=y/26|0,v=y%26;return this._expand(h+1),f?this.words[h]=this.words[h]|1<<v:this.words[h]=this.words[h]&~(1<<v),this.strip()},s.prototype.iadd=function(y){var f;if(this.negative!==0&&y.negative===0)return this.negative=0,f=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,f=this.isub(y),y.negative=1,f._normSign();var h,v;this.length>y.length?(h=this,v=y):(h=y,v=this);for(var E=0,C=0;C<v.length;C++)f=(h.words[C]|0)+(v.words[C]|0)+E,this.words[C]=f&67108863,E=f>>>26;for(;E!==0&&C<h.length;C++)f=(h.words[C]|0)+E,this.words[C]=f&67108863,E=f>>>26;if(this.length=h.length,E!==0)this.words[this.length]=E,this.length++;else if(h!==this)for(;C<h.length;C++)this.words[C]=h.words[C];return this},s.prototype.add=function(y){var f;return y.negative!==0&&this.negative===0?(y.negative=0,f=this.sub(y),y.negative^=1,f):y.negative===0&&this.negative!==0?(this.negative=0,f=y.sub(this),this.negative=1,f):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},s.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var f=this.iadd(y);return y.negative=1,f._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var h=this.cmp(y);if(h===0)return this.negative=0,this.length=1,this.words[0]=0,this;var v,E;h>0?(v=this,E=y):(v=y,E=this);for(var C=0,P=0;P<E.length;P++)f=(v.words[P]|0)-(E.words[P]|0)+C,C=f>>26,this.words[P]=f&67108863;for(;C!==0&&P<v.length;P++)f=(v.words[P]|0)+C,C=f>>26,this.words[P]=f&67108863;if(C===0&&P<v.length&&v!==this)for(;P<v.length;P++)this.words[P]=v.words[P];return this.length=Math.max(this.length,P),v!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(y){return this.clone().isub(y)};function D(T,y,f){f.negative=y.negative^T.negative;var h=T.length+y.length|0;f.length=h,h=h-1|0;var v=T.words[0]|0,E=y.words[0]|0,C=v*E,P=C&67108863,M=C/67108864|0;f.words[0]=P;for(var g=1;g<h;g++){for(var m=M>>>26,N=M&67108863,ee=Math.min(g,y.length-1),ae=Math.max(0,g-T.length+1);ae<=ee;ae++){var O=g-ae|0;v=T.words[O]|0,E=y.words[ae]|0,C=v*E+N,m+=C/67108864|0,N=C&67108863}f.words[g]=N|0,M=m|0}return M!==0?f.words[g]=M|0:f.length--,f.strip()}var L=function(y,f,h){var v=y.words,E=f.words,C=h.words,P=0,M,g,m,N=v[0]|0,ee=N&8191,ae=N>>>13,O=v[1]|0,te=O&8191,q=O>>>13,G=v[2]|0,Y=G&8191,A=G>>>13,V=v[3]|0,oe=V&8191,ue=V>>>13,he=v[4]|0,ye=he&8191,we=he>>>13,Re=v[5]|0,Xe=Re&8191,Oe=Re>>>13,Ne=v[6]|0,Me=Ne&8191,be=Ne>>>13,Pe=v[7]|0,Te=Pe&8191,ve=Pe>>>13,$e=v[8]|0,xe=$e&8191,me=$e>>>13,Ue=v[9]|0,Ce=Ue&8191,_e=Ue>>>13,Ke=E[0]|0,Ve=Ke&8191,Ae=Ke>>>13,We=E[1]|0,pt=We&8191,Ge=We>>>13,It=E[2]|0,gt=It&8191,Je=It>>>13,Ot=E[3]|0,Tt=Ot&8191,Le=Ot>>>13,et=E[4]|0,it=et&8191,Be=et>>>13,rt=E[5]|0,tt=rt&8191,je=rt>>>13,ht=E[6]|0,nt=ht&8191,qe=ht>>>13,st=E[7]|0,at=st&8191,Fe=st>>>13,Ze=E[8]|0,lt=Ze&8191,ze=Ze>>>13,jt=E[9]|0,qt=jt&8191,ct=jt>>>13;h.negative=y.negative^f.negative,h.length=19,M=Math.imul(ee,Ve),g=Math.imul(ee,Ae),g=g+Math.imul(ae,Ve)|0,m=Math.imul(ae,Ae);var _t=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(_t>>>26)|0,_t&=67108863,M=Math.imul(te,Ve),g=Math.imul(te,Ae),g=g+Math.imul(q,Ve)|0,m=Math.imul(q,Ae),M=M+Math.imul(ee,pt)|0,g=g+Math.imul(ee,Ge)|0,g=g+Math.imul(ae,pt)|0,m=m+Math.imul(ae,Ge)|0;var Qr=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,M=Math.imul(Y,Ve),g=Math.imul(Y,Ae),g=g+Math.imul(A,Ve)|0,m=Math.imul(A,Ae),M=M+Math.imul(te,pt)|0,g=g+Math.imul(te,Ge)|0,g=g+Math.imul(q,pt)|0,m=m+Math.imul(q,Ge)|0,M=M+Math.imul(ee,gt)|0,g=g+Math.imul(ee,Je)|0,g=g+Math.imul(ae,gt)|0,m=m+Math.imul(ae,Je)|0;var Zr=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,M=Math.imul(oe,Ve),g=Math.imul(oe,Ae),g=g+Math.imul(ue,Ve)|0,m=Math.imul(ue,Ae),M=M+Math.imul(Y,pt)|0,g=g+Math.imul(Y,Ge)|0,g=g+Math.imul(A,pt)|0,m=m+Math.imul(A,Ge)|0,M=M+Math.imul(te,gt)|0,g=g+Math.imul(te,Je)|0,g=g+Math.imul(q,gt)|0,m=m+Math.imul(q,Je)|0,M=M+Math.imul(ee,Tt)|0,g=g+Math.imul(ee,Le)|0,g=g+Math.imul(ae,Tt)|0,m=m+Math.imul(ae,Le)|0;var Xr=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,M=Math.imul(ye,Ve),g=Math.imul(ye,Ae),g=g+Math.imul(we,Ve)|0,m=Math.imul(we,Ae),M=M+Math.imul(oe,pt)|0,g=g+Math.imul(oe,Ge)|0,g=g+Math.imul(ue,pt)|0,m=m+Math.imul(ue,Ge)|0,M=M+Math.imul(Y,gt)|0,g=g+Math.imul(Y,Je)|0,g=g+Math.imul(A,gt)|0,m=m+Math.imul(A,Je)|0,M=M+Math.imul(te,Tt)|0,g=g+Math.imul(te,Le)|0,g=g+Math.imul(q,Tt)|0,m=m+Math.imul(q,Le)|0,M=M+Math.imul(ee,it)|0,g=g+Math.imul(ee,Be)|0,g=g+Math.imul(ae,it)|0,m=m+Math.imul(ae,Be)|0;var ei=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(ei>>>26)|0,ei&=67108863,M=Math.imul(Xe,Ve),g=Math.imul(Xe,Ae),g=g+Math.imul(Oe,Ve)|0,m=Math.imul(Oe,Ae),M=M+Math.imul(ye,pt)|0,g=g+Math.imul(ye,Ge)|0,g=g+Math.imul(we,pt)|0,m=m+Math.imul(we,Ge)|0,M=M+Math.imul(oe,gt)|0,g=g+Math.imul(oe,Je)|0,g=g+Math.imul(ue,gt)|0,m=m+Math.imul(ue,Je)|0,M=M+Math.imul(Y,Tt)|0,g=g+Math.imul(Y,Le)|0,g=g+Math.imul(A,Tt)|0,m=m+Math.imul(A,Le)|0,M=M+Math.imul(te,it)|0,g=g+Math.imul(te,Be)|0,g=g+Math.imul(q,it)|0,m=m+Math.imul(q,Be)|0,M=M+Math.imul(ee,tt)|0,g=g+Math.imul(ee,je)|0,g=g+Math.imul(ae,tt)|0,m=m+Math.imul(ae,je)|0;var ti=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(ti>>>26)|0,ti&=67108863,M=Math.imul(Me,Ve),g=Math.imul(Me,Ae),g=g+Math.imul(be,Ve)|0,m=Math.imul(be,Ae),M=M+Math.imul(Xe,pt)|0,g=g+Math.imul(Xe,Ge)|0,g=g+Math.imul(Oe,pt)|0,m=m+Math.imul(Oe,Ge)|0,M=M+Math.imul(ye,gt)|0,g=g+Math.imul(ye,Je)|0,g=g+Math.imul(we,gt)|0,m=m+Math.imul(we,Je)|0,M=M+Math.imul(oe,Tt)|0,g=g+Math.imul(oe,Le)|0,g=g+Math.imul(ue,Tt)|0,m=m+Math.imul(ue,Le)|0,M=M+Math.imul(Y,it)|0,g=g+Math.imul(Y,Be)|0,g=g+Math.imul(A,it)|0,m=m+Math.imul(A,Be)|0,M=M+Math.imul(te,tt)|0,g=g+Math.imul(te,je)|0,g=g+Math.imul(q,tt)|0,m=m+Math.imul(q,je)|0,M=M+Math.imul(ee,nt)|0,g=g+Math.imul(ee,qe)|0,g=g+Math.imul(ae,nt)|0,m=m+Math.imul(ae,qe)|0;var pr=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(pr>>>26)|0,pr&=67108863,M=Math.imul(Te,Ve),g=Math.imul(Te,Ae),g=g+Math.imul(ve,Ve)|0,m=Math.imul(ve,Ae),M=M+Math.imul(Me,pt)|0,g=g+Math.imul(Me,Ge)|0,g=g+Math.imul(be,pt)|0,m=m+Math.imul(be,Ge)|0,M=M+Math.imul(Xe,gt)|0,g=g+Math.imul(Xe,Je)|0,g=g+Math.imul(Oe,gt)|0,m=m+Math.imul(Oe,Je)|0,M=M+Math.imul(ye,Tt)|0,g=g+Math.imul(ye,Le)|0,g=g+Math.imul(we,Tt)|0,m=m+Math.imul(we,Le)|0,M=M+Math.imul(oe,it)|0,g=g+Math.imul(oe,Be)|0,g=g+Math.imul(ue,it)|0,m=m+Math.imul(ue,Be)|0,M=M+Math.imul(Y,tt)|0,g=g+Math.imul(Y,je)|0,g=g+Math.imul(A,tt)|0,m=m+Math.imul(A,je)|0,M=M+Math.imul(te,nt)|0,g=g+Math.imul(te,qe)|0,g=g+Math.imul(q,nt)|0,m=m+Math.imul(q,qe)|0,M=M+Math.imul(ee,at)|0,g=g+Math.imul(ee,Fe)|0,g=g+Math.imul(ae,at)|0,m=m+Math.imul(ae,Fe)|0;var Si=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Si>>>26)|0,Si&=67108863,M=Math.imul(xe,Ve),g=Math.imul(xe,Ae),g=g+Math.imul(me,Ve)|0,m=Math.imul(me,Ae),M=M+Math.imul(Te,pt)|0,g=g+Math.imul(Te,Ge)|0,g=g+Math.imul(ve,pt)|0,m=m+Math.imul(ve,Ge)|0,M=M+Math.imul(Me,gt)|0,g=g+Math.imul(Me,Je)|0,g=g+Math.imul(be,gt)|0,m=m+Math.imul(be,Je)|0,M=M+Math.imul(Xe,Tt)|0,g=g+Math.imul(Xe,Le)|0,g=g+Math.imul(Oe,Tt)|0,m=m+Math.imul(Oe,Le)|0,M=M+Math.imul(ye,it)|0,g=g+Math.imul(ye,Be)|0,g=g+Math.imul(we,it)|0,m=m+Math.imul(we,Be)|0,M=M+Math.imul(oe,tt)|0,g=g+Math.imul(oe,je)|0,g=g+Math.imul(ue,tt)|0,m=m+Math.imul(ue,je)|0,M=M+Math.imul(Y,nt)|0,g=g+Math.imul(Y,qe)|0,g=g+Math.imul(A,nt)|0,m=m+Math.imul(A,qe)|0,M=M+Math.imul(te,at)|0,g=g+Math.imul(te,Fe)|0,g=g+Math.imul(q,at)|0,m=m+Math.imul(q,Fe)|0,M=M+Math.imul(ee,lt)|0,g=g+Math.imul(ee,ze)|0,g=g+Math.imul(ae,lt)|0,m=m+Math.imul(ae,ze)|0;var Cn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,M=Math.imul(Ce,Ve),g=Math.imul(Ce,Ae),g=g+Math.imul(_e,Ve)|0,m=Math.imul(_e,Ae),M=M+Math.imul(xe,pt)|0,g=g+Math.imul(xe,Ge)|0,g=g+Math.imul(me,pt)|0,m=m+Math.imul(me,Ge)|0,M=M+Math.imul(Te,gt)|0,g=g+Math.imul(Te,Je)|0,g=g+Math.imul(ve,gt)|0,m=m+Math.imul(ve,Je)|0,M=M+Math.imul(Me,Tt)|0,g=g+Math.imul(Me,Le)|0,g=g+Math.imul(be,Tt)|0,m=m+Math.imul(be,Le)|0,M=M+Math.imul(Xe,it)|0,g=g+Math.imul(Xe,Be)|0,g=g+Math.imul(Oe,it)|0,m=m+Math.imul(Oe,Be)|0,M=M+Math.imul(ye,tt)|0,g=g+Math.imul(ye,je)|0,g=g+Math.imul(we,tt)|0,m=m+Math.imul(we,je)|0,M=M+Math.imul(oe,nt)|0,g=g+Math.imul(oe,qe)|0,g=g+Math.imul(ue,nt)|0,m=m+Math.imul(ue,qe)|0,M=M+Math.imul(Y,at)|0,g=g+Math.imul(Y,Fe)|0,g=g+Math.imul(A,at)|0,m=m+Math.imul(A,Fe)|0,M=M+Math.imul(te,lt)|0,g=g+Math.imul(te,ze)|0,g=g+Math.imul(q,lt)|0,m=m+Math.imul(q,ze)|0,M=M+Math.imul(ee,qt)|0,g=g+Math.imul(ee,ct)|0,g=g+Math.imul(ae,qt)|0,m=m+Math.imul(ae,ct)|0;var Ii=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,M=Math.imul(Ce,pt),g=Math.imul(Ce,Ge),g=g+Math.imul(_e,pt)|0,m=Math.imul(_e,Ge),M=M+Math.imul(xe,gt)|0,g=g+Math.imul(xe,Je)|0,g=g+Math.imul(me,gt)|0,m=m+Math.imul(me,Je)|0,M=M+Math.imul(Te,Tt)|0,g=g+Math.imul(Te,Le)|0,g=g+Math.imul(ve,Tt)|0,m=m+Math.imul(ve,Le)|0,M=M+Math.imul(Me,it)|0,g=g+Math.imul(Me,Be)|0,g=g+Math.imul(be,it)|0,m=m+Math.imul(be,Be)|0,M=M+Math.imul(Xe,tt)|0,g=g+Math.imul(Xe,je)|0,g=g+Math.imul(Oe,tt)|0,m=m+Math.imul(Oe,je)|0,M=M+Math.imul(ye,nt)|0,g=g+Math.imul(ye,qe)|0,g=g+Math.imul(we,nt)|0,m=m+Math.imul(we,qe)|0,M=M+Math.imul(oe,at)|0,g=g+Math.imul(oe,Fe)|0,g=g+Math.imul(ue,at)|0,m=m+Math.imul(ue,Fe)|0,M=M+Math.imul(Y,lt)|0,g=g+Math.imul(Y,ze)|0,g=g+Math.imul(A,lt)|0,m=m+Math.imul(A,ze)|0,M=M+Math.imul(te,qt)|0,g=g+Math.imul(te,ct)|0,g=g+Math.imul(q,qt)|0,m=m+Math.imul(q,ct)|0;var Dn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,M=Math.imul(Ce,gt),g=Math.imul(Ce,Je),g=g+Math.imul(_e,gt)|0,m=Math.imul(_e,Je),M=M+Math.imul(xe,Tt)|0,g=g+Math.imul(xe,Le)|0,g=g+Math.imul(me,Tt)|0,m=m+Math.imul(me,Le)|0,M=M+Math.imul(Te,it)|0,g=g+Math.imul(Te,Be)|0,g=g+Math.imul(ve,it)|0,m=m+Math.imul(ve,Be)|0,M=M+Math.imul(Me,tt)|0,g=g+Math.imul(Me,je)|0,g=g+Math.imul(be,tt)|0,m=m+Math.imul(be,je)|0,M=M+Math.imul(Xe,nt)|0,g=g+Math.imul(Xe,qe)|0,g=g+Math.imul(Oe,nt)|0,m=m+Math.imul(Oe,qe)|0,M=M+Math.imul(ye,at)|0,g=g+Math.imul(ye,Fe)|0,g=g+Math.imul(we,at)|0,m=m+Math.imul(we,Fe)|0,M=M+Math.imul(oe,lt)|0,g=g+Math.imul(oe,ze)|0,g=g+Math.imul(ue,lt)|0,m=m+Math.imul(ue,ze)|0,M=M+Math.imul(Y,qt)|0,g=g+Math.imul(Y,ct)|0,g=g+Math.imul(A,qt)|0,m=m+Math.imul(A,ct)|0;var On=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(On>>>26)|0,On&=67108863,M=Math.imul(Ce,Tt),g=Math.imul(Ce,Le),g=g+Math.imul(_e,Tt)|0,m=Math.imul(_e,Le),M=M+Math.imul(xe,it)|0,g=g+Math.imul(xe,Be)|0,g=g+Math.imul(me,it)|0,m=m+Math.imul(me,Be)|0,M=M+Math.imul(Te,tt)|0,g=g+Math.imul(Te,je)|0,g=g+Math.imul(ve,tt)|0,m=m+Math.imul(ve,je)|0,M=M+Math.imul(Me,nt)|0,g=g+Math.imul(Me,qe)|0,g=g+Math.imul(be,nt)|0,m=m+Math.imul(be,qe)|0,M=M+Math.imul(Xe,at)|0,g=g+Math.imul(Xe,Fe)|0,g=g+Math.imul(Oe,at)|0,m=m+Math.imul(Oe,Fe)|0,M=M+Math.imul(ye,lt)|0,g=g+Math.imul(ye,ze)|0,g=g+Math.imul(we,lt)|0,m=m+Math.imul(we,ze)|0,M=M+Math.imul(oe,qt)|0,g=g+Math.imul(oe,ct)|0,g=g+Math.imul(ue,qt)|0,m=m+Math.imul(ue,ct)|0;var Mi=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,M=Math.imul(Ce,it),g=Math.imul(Ce,Be),g=g+Math.imul(_e,it)|0,m=Math.imul(_e,Be),M=M+Math.imul(xe,tt)|0,g=g+Math.imul(xe,je)|0,g=g+Math.imul(me,tt)|0,m=m+Math.imul(me,je)|0,M=M+Math.imul(Te,nt)|0,g=g+Math.imul(Te,qe)|0,g=g+Math.imul(ve,nt)|0,m=m+Math.imul(ve,qe)|0,M=M+Math.imul(Me,at)|0,g=g+Math.imul(Me,Fe)|0,g=g+Math.imul(be,at)|0,m=m+Math.imul(be,Fe)|0,M=M+Math.imul(Xe,lt)|0,g=g+Math.imul(Xe,ze)|0,g=g+Math.imul(Oe,lt)|0,m=m+Math.imul(Oe,ze)|0,M=M+Math.imul(ye,qt)|0,g=g+Math.imul(ye,ct)|0,g=g+Math.imul(we,qt)|0,m=m+Math.imul(we,ct)|0;var nn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(nn>>>26)|0,nn&=67108863,M=Math.imul(Ce,tt),g=Math.imul(Ce,je),g=g+Math.imul(_e,tt)|0,m=Math.imul(_e,je),M=M+Math.imul(xe,nt)|0,g=g+Math.imul(xe,qe)|0,g=g+Math.imul(me,nt)|0,m=m+Math.imul(me,qe)|0,M=M+Math.imul(Te,at)|0,g=g+Math.imul(Te,Fe)|0,g=g+Math.imul(ve,at)|0,m=m+Math.imul(ve,Fe)|0,M=M+Math.imul(Me,lt)|0,g=g+Math.imul(Me,ze)|0,g=g+Math.imul(be,lt)|0,m=m+Math.imul(be,ze)|0,M=M+Math.imul(Xe,qt)|0,g=g+Math.imul(Xe,ct)|0,g=g+Math.imul(Oe,qt)|0,m=m+Math.imul(Oe,ct)|0;var sn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(sn>>>26)|0,sn&=67108863,M=Math.imul(Ce,nt),g=Math.imul(Ce,qe),g=g+Math.imul(_e,nt)|0,m=Math.imul(_e,qe),M=M+Math.imul(xe,at)|0,g=g+Math.imul(xe,Fe)|0,g=g+Math.imul(me,at)|0,m=m+Math.imul(me,Fe)|0,M=M+Math.imul(Te,lt)|0,g=g+Math.imul(Te,ze)|0,g=g+Math.imul(ve,lt)|0,m=m+Math.imul(ve,ze)|0,M=M+Math.imul(Me,qt)|0,g=g+Math.imul(Me,ct)|0,g=g+Math.imul(be,qt)|0,m=m+Math.imul(be,ct)|0;var Ir=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,M=Math.imul(Ce,at),g=Math.imul(Ce,Fe),g=g+Math.imul(_e,at)|0,m=Math.imul(_e,Fe),M=M+Math.imul(xe,lt)|0,g=g+Math.imul(xe,ze)|0,g=g+Math.imul(me,lt)|0,m=m+Math.imul(me,ze)|0,M=M+Math.imul(Te,qt)|0,g=g+Math.imul(Te,ct)|0,g=g+Math.imul(ve,qt)|0,m=m+Math.imul(ve,ct)|0;var Pn=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,M=Math.imul(Ce,lt),g=Math.imul(Ce,ze),g=g+Math.imul(_e,lt)|0,m=Math.imul(_e,ze),M=M+Math.imul(xe,qt)|0,g=g+Math.imul(xe,ct)|0,g=g+Math.imul(me,qt)|0,m=m+Math.imul(me,ct)|0;var $n=(P+M|0)+((g&8191)<<13)|0;P=(m+(g>>>13)|0)+($n>>>26)|0,$n&=67108863,M=Math.imul(Ce,qt),g=Math.imul(Ce,ct),g=g+Math.imul(_e,qt)|0,m=Math.imul(_e,ct);var Rn=(P+M|0)+((g&8191)<<13)|0;return P=(m+(g>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,C[0]=_t,C[1]=Qr,C[2]=Zr,C[3]=Xr,C[4]=ei,C[5]=ti,C[6]=pr,C[7]=Si,C[8]=Cn,C[9]=Ii,C[10]=Dn,C[11]=On,C[12]=Mi,C[13]=nn,C[14]=sn,C[15]=Ir,C[16]=Pn,C[17]=$n,C[18]=Rn,P!==0&&(C[19]=P,h.length++),h};Math.imul||(L=D);function K(T,y,f){f.negative=y.negative^T.negative,f.length=T.length+y.length;for(var h=0,v=0,E=0;E<f.length-1;E++){var C=v;v=0;for(var P=h&67108863,M=Math.min(E,y.length-1),g=Math.max(0,E-T.length+1);g<=M;g++){var m=E-g,N=T.words[m]|0,ee=y.words[g]|0,ae=N*ee,O=ae&67108863;C=C+(ae/67108864|0)|0,O=O+P|0,P=O&67108863,C=C+(O>>>26)|0,v+=C>>>26,C&=67108863}f.words[E]=P,h=C,C=v}return h!==0?f.words[E]=h:f.length--,f.strip()}function H(T,y,f){var h=new U;return h.mulp(T,y,f)}s.prototype.mulTo=function(y,f){var h,v=this.length+y.length;return this.length===10&&y.length===10?h=L(this,y,f):v<63?h=D(this,y,f):v<1024?h=K(this,y,f):h=H(this,y,f),h};function U(T,y){this.x=T,this.y=y}U.prototype.makeRBT=function(y){for(var f=new Array(y),h=s.prototype._countBits(y)-1,v=0;v<y;v++)f[v]=this.revBin(v,h,y);return f},U.prototype.revBin=function(y,f,h){if(y===0||y===h-1)return y;for(var v=0,E=0;E<f;E++)v|=(y&1)<<f-E-1,y>>=1;return v},U.prototype.permute=function(y,f,h,v,E,C){for(var P=0;P<C;P++)v[P]=f[y[P]],E[P]=h[y[P]]},U.prototype.transform=function(y,f,h,v,E,C){this.permute(C,y,f,h,v,E);for(var P=1;P<E;P<<=1)for(var M=P<<1,g=Math.cos(2*Math.PI/M),m=Math.sin(2*Math.PI/M),N=0;N<E;N+=M)for(var ee=g,ae=m,O=0;O<P;O++){var te=h[N+O],q=v[N+O],G=h[N+O+P],Y=v[N+O+P],A=ee*G-ae*Y;Y=ee*Y+ae*G,G=A,h[N+O]=te+G,v[N+O]=q+Y,h[N+O+P]=te-G,v[N+O+P]=q-Y,O!==M&&(A=g*ee-m*ae,ae=g*ae+m*ee,ee=A)}},U.prototype.guessLen13b=function(y,f){var h=Math.max(f,y)|1,v=h&1,E=0;for(h=h/2|0;h;h=h>>>1)E++;return 1<<E+1+v},U.prototype.conjugate=function(y,f,h){if(!(h<=1))for(var v=0;v<h/2;v++){var E=y[v];y[v]=y[h-v-1],y[h-v-1]=E,E=f[v],f[v]=-f[h-v-1],f[h-v-1]=-E}},U.prototype.normalize13b=function(y,f){for(var h=0,v=0;v<f/2;v++){var E=Math.round(y[2*v+1]/f)*8192+Math.round(y[2*v]/f)+h;y[v]=E&67108863,E<67108864?h=0:h=E/67108864|0}return y},U.prototype.convert13b=function(y,f,h,v){for(var E=0,C=0;C<f;C++)E=E+(y[C]|0),h[2*C]=E&8191,E=E>>>13,h[2*C+1]=E&8191,E=E>>>13;for(C=2*f;C<v;++C)h[C]=0;i(E===0),i((E&-8192)===0)},U.prototype.stub=function(y){for(var f=new Array(y),h=0;h<y;h++)f[h]=0;return f},U.prototype.mulp=function(y,f,h){var v=2*this.guessLen13b(y.length,f.length),E=this.makeRBT(v),C=this.stub(v),P=new Array(v),M=new Array(v),g=new Array(v),m=new Array(v),N=new Array(v),ee=new Array(v),ae=h.words;ae.length=v,this.convert13b(y.words,y.length,P,v),this.convert13b(f.words,f.length,m,v),this.transform(P,C,M,g,v,E),this.transform(m,C,N,ee,v,E);for(var O=0;O<v;O++){var te=M[O]*N[O]-g[O]*ee[O];g[O]=M[O]*ee[O]+g[O]*N[O],M[O]=te}return this.conjugate(M,g,v),this.transform(M,g,ae,C,v,E),this.conjugate(ae,C,v),this.normalize13b(ae,v),h.negative=y.negative^f.negative,h.length=y.length+f.length,h.strip()},s.prototype.mul=function(y){var f=new s(null);return f.words=new Array(this.length+y.length),this.mulTo(y,f)},s.prototype.mulf=function(y){var f=new s(null);return f.words=new Array(this.length+y.length),H(this,y,f)},s.prototype.imul=function(y){return this.clone().mulTo(y,this)},s.prototype.imuln=function(y){i(typeof y=="number"),i(y<67108864);for(var f=0,h=0;h<this.length;h++){var v=(this.words[h]|0)*y,E=(v&67108863)+(f&67108863);f>>=26,f+=v/67108864|0,f+=E>>>26,this.words[h]=E&67108863}return f!==0&&(this.words[h]=f,this.length++),this},s.prototype.muln=function(y){return this.clone().imuln(y)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(y){var f=S(y);if(f.length===0)return new s(1);for(var h=this,v=0;v<f.length&&f[v]===0;v++,h=h.sqr());if(++v<f.length)for(var E=h.sqr();v<f.length;v++,E=E.sqr())f[v]!==0&&(h=h.mul(E));return h},s.prototype.iushln=function(y){i(typeof y=="number"&&y>=0);var f=y%26,h=(y-f)/26,v=67108863>>>26-f<<26-f,E;if(f!==0){var C=0;for(E=0;E<this.length;E++){var P=this.words[E]&v,M=(this.words[E]|0)-P<<f;this.words[E]=M|C,C=P>>>26-f}C&&(this.words[E]=C,this.length++)}if(h!==0){for(E=this.length-1;E>=0;E--)this.words[E+h]=this.words[E];for(E=0;E<h;E++)this.words[E]=0;this.length+=h}return this.strip()},s.prototype.ishln=function(y){return i(this.negative===0),this.iushln(y)},s.prototype.iushrn=function(y,f,h){i(typeof y=="number"&&y>=0);var v;f?v=(f-f%26)/26:v=0;var E=y%26,C=Math.min((y-E)/26,this.length),P=67108863^67108863>>>E<<E,M=h;if(v-=C,v=Math.max(0,v),M){for(var g=0;g<C;g++)M.words[g]=this.words[g];M.length=C}if(C!==0)if(this.length>C)for(this.length-=C,g=0;g<this.length;g++)this.words[g]=this.words[g+C];else this.words[0]=0,this.length=1;var m=0;for(g=this.length-1;g>=0&&(m!==0||g>=v);g--){var N=this.words[g]|0;this.words[g]=m<<26-E|N>>>E,m=N&P}return M&&m!==0&&(M.words[M.length++]=m),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(y,f,h){return i(this.negative===0),this.iushrn(y,f,h)},s.prototype.shln=function(y){return this.clone().ishln(y)},s.prototype.ushln=function(y){return this.clone().iushln(y)},s.prototype.shrn=function(y){return this.clone().ishrn(y)},s.prototype.ushrn=function(y){return this.clone().iushrn(y)},s.prototype.testn=function(y){i(typeof y=="number"&&y>=0);var f=y%26,h=(y-f)/26,v=1<<f;if(this.length<=h)return!1;var E=this.words[h];return!!(E&v)},s.prototype.imaskn=function(y){i(typeof y=="number"&&y>=0);var f=y%26,h=(y-f)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=h)return this;if(f!==0&&h++,this.length=Math.min(h,this.length),f!==0){var v=67108863^67108863>>>f<<f;this.words[this.length-1]&=v}return this.strip()},s.prototype.maskn=function(y){return this.clone().imaskn(y)},s.prototype.iaddn=function(y){return i(typeof y=="number"),i(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},s.prototype._iaddn=function(y){this.words[0]+=y;for(var f=0;f<this.length&&this.words[f]>=67108864;f++)this.words[f]-=67108864,f===this.length-1?this.words[f+1]=1:this.words[f+1]++;return this.length=Math.max(this.length,f+1),this},s.prototype.isubn=function(y){if(i(typeof y=="number"),i(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var f=0;f<this.length&&this.words[f]<0;f++)this.words[f]+=67108864,this.words[f+1]-=1;return this.strip()},s.prototype.addn=function(y){return this.clone().iaddn(y)},s.prototype.subn=function(y){return this.clone().isubn(y)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(y,f,h){var v=y.length+h,E;this._expand(v);var C,P=0;for(E=0;E<y.length;E++){C=(this.words[E+h]|0)+P;var M=(y.words[E]|0)*f;C-=M&67108863,P=(C>>26)-(M/67108864|0),this.words[E+h]=C&67108863}for(;E<this.length-h;E++)C=(this.words[E+h]|0)+P,P=C>>26,this.words[E+h]=C&67108863;if(P===0)return this.strip();for(i(P===-1),P=0,E=0;E<this.length;E++)C=-(this.words[E]|0)+P,P=C>>26,this.words[E]=C&67108863;return this.negative=1,this.strip()},s.prototype._wordDiv=function(y,f){var h=this.length-y.length,v=this.clone(),E=y,C=E.words[E.length-1]|0,P=this._countBits(C);h=26-P,h!==0&&(E=E.ushln(h),v.iushln(h),C=E.words[E.length-1]|0);var M=v.length-E.length,g;if(f!=="mod"){g=new s(null),g.length=M+1,g.words=new Array(g.length);for(var m=0;m<g.length;m++)g.words[m]=0}var N=v.clone()._ishlnsubmul(E,1,M);N.negative===0&&(v=N,g&&(g.words[M]=1));for(var ee=M-1;ee>=0;ee--){var ae=(v.words[E.length+ee]|0)*67108864+(v.words[E.length+ee-1]|0);for(ae=Math.min(ae/C|0,67108863),v._ishlnsubmul(E,ae,ee);v.negative!==0;)ae--,v.negative=0,v._ishlnsubmul(E,1,ee),v.isZero()||(v.negative^=1);g&&(g.words[ee]=ae)}return g&&g.strip(),v.strip(),f!=="div"&&h!==0&&v.iushrn(h),{div:g||null,mod:v}},s.prototype.divmod=function(y,f,h){if(i(!y.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var v,E,C;return this.negative!==0&&y.negative===0?(C=this.neg().divmod(y,f),f!=="mod"&&(v=C.div.neg()),f!=="div"&&(E=C.mod.neg(),h&&E.negative!==0&&E.iadd(y)),{div:v,mod:E}):this.negative===0&&y.negative!==0?(C=this.divmod(y.neg(),f),f!=="mod"&&(v=C.div.neg()),{div:v,mod:C.mod}):this.negative&y.negative?(C=this.neg().divmod(y.neg(),f),f!=="div"&&(E=C.mod.neg(),h&&E.negative!==0&&E.isub(y)),{div:C.div,mod:E}):y.length>this.length||this.cmp(y)<0?{div:new s(0),mod:this}:y.length===1?f==="div"?{div:this.divn(y.words[0]),mod:null}:f==="mod"?{div:null,mod:new s(this.modn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new s(this.modn(y.words[0]))}:this._wordDiv(y,f)},s.prototype.div=function(y){return this.divmod(y,"div",!1).div},s.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},s.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},s.prototype.divRound=function(y){var f=this.divmod(y);if(f.mod.isZero())return f.div;var h=f.div.negative!==0?f.mod.isub(y):f.mod,v=y.ushrn(1),E=y.andln(1),C=h.cmp(v);return C<0||E===1&&C===0?f.div:f.div.negative!==0?f.div.isubn(1):f.div.iaddn(1)},s.prototype.modn=function(y){i(y<=67108863);for(var f=(1<<26)%y,h=0,v=this.length-1;v>=0;v--)h=(f*h+(this.words[v]|0))%y;return h},s.prototype.idivn=function(y){i(y<=67108863);for(var f=0,h=this.length-1;h>=0;h--){var v=(this.words[h]|0)+f*67108864;this.words[h]=v/y|0,f=v%y}return this.strip()},s.prototype.divn=function(y){return this.clone().idivn(y)},s.prototype.egcd=function(y){i(y.negative===0),i(!y.isZero());var f=this,h=y.clone();f.negative!==0?f=f.umod(y):f=f.clone();for(var v=new s(1),E=new s(0),C=new s(0),P=new s(1),M=0;f.isEven()&&h.isEven();)f.iushrn(1),h.iushrn(1),++M;for(var g=h.clone(),m=f.clone();!f.isZero();){for(var N=0,ee=1;!(f.words[0]&ee)&&N<26;++N,ee<<=1);if(N>0)for(f.iushrn(N);N-- >0;)(v.isOdd()||E.isOdd())&&(v.iadd(g),E.isub(m)),v.iushrn(1),E.iushrn(1);for(var ae=0,O=1;!(h.words[0]&O)&&ae<26;++ae,O<<=1);if(ae>0)for(h.iushrn(ae);ae-- >0;)(C.isOdd()||P.isOdd())&&(C.iadd(g),P.isub(m)),C.iushrn(1),P.iushrn(1);f.cmp(h)>=0?(f.isub(h),v.isub(C),E.isub(P)):(h.isub(f),C.isub(v),P.isub(E))}return{a:C,b:P,gcd:h.iushln(M)}},s.prototype._invmp=function(y){i(y.negative===0),i(!y.isZero());var f=this,h=y.clone();f.negative!==0?f=f.umod(y):f=f.clone();for(var v=new s(1),E=new s(0),C=h.clone();f.cmpn(1)>0&&h.cmpn(1)>0;){for(var P=0,M=1;!(f.words[0]&M)&&P<26;++P,M<<=1);if(P>0)for(f.iushrn(P);P-- >0;)v.isOdd()&&v.iadd(C),v.iushrn(1);for(var g=0,m=1;!(h.words[0]&m)&&g<26;++g,m<<=1);if(g>0)for(h.iushrn(g);g-- >0;)E.isOdd()&&E.iadd(C),E.iushrn(1);f.cmp(h)>=0?(f.isub(h),v.isub(E)):(h.isub(f),E.isub(v))}var N;return f.cmpn(1)===0?N=v:N=E,N.cmpn(0)<0&&N.iadd(y),N},s.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var f=this.clone(),h=y.clone();f.negative=0,h.negative=0;for(var v=0;f.isEven()&&h.isEven();v++)f.iushrn(1),h.iushrn(1);do{for(;f.isEven();)f.iushrn(1);for(;h.isEven();)h.iushrn(1);var E=f.cmp(h);if(E<0){var C=f;f=h,h=C}else if(E===0||h.cmpn(1)===0)break;f.isub(h)}while(!0);return h.iushln(v)},s.prototype.invm=function(y){return this.egcd(y).a.umod(y)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(y){return this.words[0]&y},s.prototype.bincn=function(y){i(typeof y=="number");var f=y%26,h=(y-f)/26,v=1<<f;if(this.length<=h)return this._expand(h+1),this.words[h]|=v,this;for(var E=v,C=h;E!==0&&C<this.length;C++){var P=this.words[C]|0;P+=E,E=P>>>26,P&=67108863,this.words[C]=P}return E!==0&&(this.words[C]=E,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(y){var f=y<0;if(this.negative!==0&&!f)return-1;if(this.negative===0&&f)return 1;this.strip();var h;if(this.length>1)h=1;else{f&&(y=-y),i(y<=67108863,"Number is too big");var v=this.words[0]|0;h=v===y?0:v<y?-1:1}return this.negative!==0?-h|0:h},s.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var f=this.ucmp(y);return this.negative!==0?-f|0:f},s.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var f=0,h=this.length-1;h>=0;h--){var v=this.words[h]|0,E=y.words[h]|0;if(v!==E){v<E?f=-1:v>E&&(f=1);break}}return f},s.prototype.gtn=function(y){return this.cmpn(y)===1},s.prototype.gt=function(y){return this.cmp(y)===1},s.prototype.gten=function(y){return this.cmpn(y)>=0},s.prototype.gte=function(y){return this.cmp(y)>=0},s.prototype.ltn=function(y){return this.cmpn(y)===-1},s.prototype.lt=function(y){return this.cmp(y)===-1},s.prototype.lten=function(y){return this.cmpn(y)<=0},s.prototype.lte=function(y){return this.cmp(y)<=0},s.prototype.eqn=function(y){return this.cmpn(y)===0},s.prototype.eq=function(y){return this.cmp(y)===0},s.red=function(y){return new X(y)},s.prototype.toRed=function(y){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(y){return this.red=y,this},s.prototype.forceRed=function(y){return i(!this.red,"Already a number in reduction context"),this._forceRed(y)},s.prototype.redAdd=function(y){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},s.prototype.redIAdd=function(y){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},s.prototype.redSub=function(y){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},s.prototype.redISub=function(y){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},s.prototype.redShl=function(y){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},s.prototype.redMul=function(y){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},s.prototype.redIMul=function(y){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(y){return i(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var W={k256:null,p224:null,p192:null,p25519:null};function R(T,y){this.name=T,this.p=new s(y,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}R.prototype._tmp=function(){var y=new s(null);return y.words=new Array(Math.ceil(this.n/13)),y},R.prototype.ireduce=function(y){var f=y,h;do this.split(f,this.tmp),f=this.imulK(f),f=f.iadd(this.tmp),h=f.bitLength();while(h>this.n);var v=h<this.n?-1:f.ucmp(this.p);return v===0?(f.words[0]=0,f.length=1):v>0?f.isub(this.p):f.strip!==void 0?f.strip():f._strip(),f},R.prototype.split=function(y,f){y.iushrn(this.n,0,f)},R.prototype.imulK=function(y){return y.imul(this.k)};function k(){R.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(k,R),k.prototype.split=function(y,f){for(var h=4194303,v=Math.min(y.length,9),E=0;E<v;E++)f.words[E]=y.words[E];if(f.length=v,y.length<=9){y.words[0]=0,y.length=1;return}var C=y.words[9];for(f.words[f.length++]=C&h,E=10;E<y.length;E++){var P=y.words[E]|0;y.words[E-10]=(P&h)<<4|C>>>22,C=P}C>>>=22,y.words[E-10]=C,C===0&&y.length>10?y.length-=10:y.length-=9},k.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var f=0,h=0;h<y.length;h++){var v=y.words[h]|0;f+=v*977,y.words[h]=f&67108863,f=v*64+(f/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function z(){R.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(z,R);function _(){R.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(_,R);function B(){R.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(B,R),B.prototype.imulK=function(y){for(var f=0,h=0;h<y.length;h++){var v=(y.words[h]|0)*19+f,E=v&67108863;v>>>=26,y.words[h]=E,f=v}return f!==0&&(y.words[y.length++]=f),y},s._prime=function(y){if(W[y])return W[y];var f;if(y==="k256")f=new k;else if(y==="p224")f=new z;else if(y==="p192")f=new _;else if(y==="p25519")f=new B;else throw new Error("Unknown prime "+y);return W[y]=f,f};function X(T){if(typeof T=="string"){var y=s._prime(T);this.m=y.p,this.prime=y}else i(T.gtn(1),"modulus must be greater than 1"),this.m=T,this.prime=null}X.prototype._verify1=function(y){i(y.negative===0,"red works only with positives"),i(y.red,"red works only with red numbers")},X.prototype._verify2=function(y,f){i((y.negative|f.negative)===0,"red works only with positives"),i(y.red&&y.red===f.red,"red works only with red numbers")},X.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):y.umod(this.m)._forceRed(this)},X.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},X.prototype.add=function(y,f){this._verify2(y,f);var h=y.add(f);return h.cmp(this.m)>=0&&h.isub(this.m),h._forceRed(this)},X.prototype.iadd=function(y,f){this._verify2(y,f);var h=y.iadd(f);return h.cmp(this.m)>=0&&h.isub(this.m),h},X.prototype.sub=function(y,f){this._verify2(y,f);var h=y.sub(f);return h.cmpn(0)<0&&h.iadd(this.m),h._forceRed(this)},X.prototype.isub=function(y,f){this._verify2(y,f);var h=y.isub(f);return h.cmpn(0)<0&&h.iadd(this.m),h},X.prototype.shl=function(y,f){return this._verify1(y),this.imod(y.ushln(f))},X.prototype.imul=function(y,f){return this._verify2(y,f),this.imod(y.imul(f))},X.prototype.mul=function(y,f){return this._verify2(y,f),this.imod(y.mul(f))},X.prototype.isqr=function(y){return this.imul(y,y.clone())},X.prototype.sqr=function(y){return this.mul(y,y)},X.prototype.sqrt=function(y){if(y.isZero())return y.clone();var f=this.m.andln(3);if(i(f%2===1),f===3){var h=this.m.add(new s(1)).iushrn(2);return this.pow(y,h)}for(var v=this.m.subn(1),E=0;!v.isZero()&&v.andln(1)===0;)E++,v.iushrn(1);i(!v.isZero());var C=new s(1).toRed(this),P=C.redNeg(),M=this.m.subn(1).iushrn(1),g=this.m.bitLength();for(g=new s(2*g*g).toRed(this);this.pow(g,M).cmp(P)!==0;)g.redIAdd(P);for(var m=this.pow(g,v),N=this.pow(y,v.addn(1).iushrn(1)),ee=this.pow(y,v),ae=E;ee.cmp(C)!==0;){for(var O=ee,te=0;O.cmp(C)!==0;te++)O=O.redSqr();i(te<ae);var q=this.pow(m,new s(1).iushln(ae-te-1));N=N.redMul(q),m=q.redSqr(),ee=ee.redMul(m),ae=te}return N},X.prototype.invm=function(y){var f=y._invmp(this.m);return f.negative!==0?(f.negative=0,this.imod(f).redNeg()):this.imod(f)},X.prototype.pow=function(y,f){if(f.isZero())return new s(1).toRed(this);if(f.cmpn(1)===0)return y.clone();var h=4,v=new Array(1<<h);v[0]=new s(1).toRed(this),v[1]=y;for(var E=2;E<v.length;E++)v[E]=this.mul(v[E-1],y);var C=v[0],P=0,M=0,g=f.bitLength()%26;for(g===0&&(g=26),E=f.length-1;E>=0;E--){for(var m=f.words[E],N=g-1;N>=0;N--){var ee=m>>N&1;if(C!==v[0]&&(C=this.sqr(C)),ee===0&&P===0){M=0;continue}P<<=1,P|=ee,M++,!(M!==h&&(E!==0||N!==0))&&(C=this.mul(C,v[P]),M=0,P=0)}g=26}return C},X.prototype.convertTo=function(y){var f=y.umod(this.m);return f===y?f.clone():f},X.prototype.convertFrom=function(y){var f=y.clone();return f.red=null,f},s.mont=function(y){return new re(y)};function re(T){X.call(this,T),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(re,X),re.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},re.prototype.convertFrom=function(y){var f=this.imod(y.mul(this.rinv));return f.red=null,f},re.prototype.imul=function(y,f){if(y.isZero()||f.isZero())return y.words[0]=0,y.length=1,y;var h=y.imul(f),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=h.isub(v).iushrn(this.shift),C=E;return E.cmp(this.m)>=0?C=E.isub(this.m):E.cmpn(0)<0&&(C=E.iadd(this.m)),C._forceRed(this)},re.prototype.mul=function(y,f){if(y.isZero()||f.isZero())return new s(0)._forceRed(this);var h=y.mul(f),v=h.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),E=h.isub(v).iushrn(this.shift),C=E;return E.cmp(this.m)>=0?C=E.isub(this.m):E.cmpn(0)<0&&(C=E.iadd(this.m)),C._forceRed(this)},re.prototype.invm=function(y){var f=this.imod(y._invmp(this.m).mul(this.r2));return f._forceRed(this)}})(t,Wr)})(kn);var Po=k2;function k2(t,e){if(!t)throw new Error(e||"Assertion failed")}k2.equal=function(e,r,i){if(e!=r)throw new Error(i||"Assertion failed: "+e+" != "+r)};var R0={};(function(t){var e=t;function r(s,a){if(Array.isArray(s))return s.slice();if(!s)return[];var u=[];if(typeof s!="string"){for(var l=0;l<s.length;l++)u[l]=s[l]|0;return u}if(a==="hex"){s=s.replace(/[^a-z0-9]+/ig,""),s.length%2!==0&&(s="0"+s);for(var l=0;l<s.length;l+=2)u.push(parseInt(s[l]+s[l+1],16))}else for(var l=0;l<s.length;l++){var d=s.charCodeAt(l),b=d>>8,w=d&255;b?u.push(b,w):u.push(w)}return u}e.toArray=r;function i(s){return s.length===1?"0"+s:s}e.zero2=i;function n(s){for(var a="",u=0;u<s.length;u++)a+=i(s[u].toString(16));return a}e.toHex=n,e.encode=function(a,u){return u==="hex"?n(a):a}})(R0),function(t){var e=t,r=kn.exports,i=Po,n=R0;e.assert=i,e.toArray=n.toArray,e.zero2=n.zero2,e.toHex=n.toHex,e.encode=n.encode;function s(b,w,I){var S=new Array(Math.max(b.bitLength(),I)+1),D;for(D=0;D<S.length;D+=1)S[D]=0;var L=1<<w+1,K=b.clone();for(D=0;D<S.length;D++){var H,U=K.andln(L-1);K.isOdd()?(U>(L>>1)-1?H=(L>>1)-U:H=U,K.isubn(H)):H=0,S[D]=H,K.iushrn(1)}return S}e.getNAF=s;function a(b,w){var I=[[],[]];b=b.clone(),w=w.clone();for(var S=0,D=0,L;b.cmpn(-S)>0||w.cmpn(-D)>0;){var K=b.andln(3)+S&3,H=w.andln(3)+D&3;K===3&&(K=-1),H===3&&(H=-1);var U;K&1?(L=b.andln(7)+S&7,(L===3||L===5)&&H===2?U=-K:U=K):U=0,I[0].push(U);var W;H&1?(L=w.andln(7)+D&7,(L===3||L===5)&&K===2?W=-H:W=H):W=0,I[1].push(W),2*S===U+1&&(S=1-S),2*D===W+1&&(D=1-D),b.iushrn(1),w.iushrn(1)}return I}e.getJSF=a;function u(b,w,I){var S="_"+w;b.prototype[w]=function(){return this[S]!==void 0?this[S]:this[S]=I.call(this)}}e.cachedProperty=u;function l(b){return typeof b=="string"?e.toArray(b,"hex"):b}e.parseBytes=l;function d(b){return new r(b,"hex","le")}e.intFromLE=d}(Ni);var Of={exports:{}},N0;Of.exports=function(e){return N0||(N0=new Js(null)),N0.generate(e)};function Js(t){this.rand=t}if(Of.exports.Rand=Js,Js.prototype.generate=function(e){return this._rand(e)},Js.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var r=new Uint8Array(e),i=0;i<r.length;i++)r[i]=this.rand.getByte();return r},typeof self=="object")self.crypto&&self.crypto.getRandomValues?Js.prototype._rand=function(e){var r=new Uint8Array(e);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?Js.prototype._rand=function(e){var r=new Uint8Array(e);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(Js.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var j2=C0;if(typeof j2.randomBytes!="function")throw new Error("Not supported");Js.prototype._rand=function(e){return j2.randomBytes(e)}}catch{}var T0={},$o=kn.exports,Zc=Ni,Pf=Zc.getNAF,d9=Zc.getJSF,$f=Zc.assert;function Qs(t,e){this.type=t,this.p=new $o(e.p,16),this.red=e.prime?$o.red(e.prime):$o.mont(this.p),this.zero=new $o(0).toRed(this.red),this.one=new $o(1).toRed(this.red),this.two=new $o(2).toRed(this.red),this.n=e.n&&new $o(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var Rf=Qs;Qs.prototype.point=function(){throw new Error("Not implemented")},Qs.prototype.validate=function(){throw new Error("Not implemented")},Qs.prototype._fixedNafMul=function(e,r){$f(e.precomputed);var i=e._getDoubles(),n=Pf(r,1,this._bitLength),s=(1<<i.step+1)-(i.step%2===0?2:1);s/=3;var a=[],u,l;for(u=0;u<n.length;u+=i.step){l=0;for(var d=u+i.step-1;d>=u;d--)l=(l<<1)+n[d];a.push(l)}for(var b=this.jpoint(null,null,null),w=this.jpoint(null,null,null),I=s;I>0;I--){for(u=0;u<a.length;u++)l=a[u],l===I?w=w.mixedAdd(i.points[u]):l===-I&&(w=w.mixedAdd(i.points[u].neg()));b=b.add(w)}return b.toP()},Qs.prototype._wnafMul=function(e,r){var i=4,n=e._getNAFPoints(i);i=n.wnd;for(var s=n.points,a=Pf(r,i,this._bitLength),u=this.jpoint(null,null,null),l=a.length-1;l>=0;l--){for(var d=0;l>=0&&a[l]===0;l--)d++;if(l>=0&&d++,u=u.dblp(d),l<0)break;var b=a[l];$f(b!==0),e.type==="affine"?b>0?u=u.mixedAdd(s[b-1>>1]):u=u.mixedAdd(s[-b-1>>1].neg()):b>0?u=u.add(s[b-1>>1]):u=u.add(s[-b-1>>1].neg())}return e.type==="affine"?u.toP():u},Qs.prototype._wnafMulAdd=function(e,r,i,n,s){var a=this._wnafT1,u=this._wnafT2,l=this._wnafT3,d=0,b,w,I;for(b=0;b<n;b++){I=r[b];var S=I._getNAFPoints(e);a[b]=S.wnd,u[b]=S.points}for(b=n-1;b>=1;b-=2){var D=b-1,L=b;if(a[D]!==1||a[L]!==1){l[D]=Pf(i[D],a[D],this._bitLength),l[L]=Pf(i[L],a[L],this._bitLength),d=Math.max(l[D].length,d),d=Math.max(l[L].length,d);continue}var K=[r[D],null,null,r[L]];r[D].y.cmp(r[L].y)===0?(K[1]=r[D].add(r[L]),K[2]=r[D].toJ().mixedAdd(r[L].neg())):r[D].y.cmp(r[L].y.redNeg())===0?(K[1]=r[D].toJ().mixedAdd(r[L]),K[2]=r[D].add(r[L].neg())):(K[1]=r[D].toJ().mixedAdd(r[L]),K[2]=r[D].toJ().mixedAdd(r[L].neg()));var H=[-3,-1,-5,-7,0,7,5,1,3],U=d9(i[D],i[L]);for(d=Math.max(U[0].length,d),l[D]=new Array(d),l[L]=new Array(d),w=0;w<d;w++){var W=U[0][w]|0,R=U[1][w]|0;l[D][w]=H[(W+1)*3+(R+1)],l[L][w]=0,u[D]=K}}var k=this.jpoint(null,null,null),z=this._wnafT4;for(b=d;b>=0;b--){for(var _=0;b>=0;){var B=!0;for(w=0;w<n;w++)z[w]=l[w][b]|0,z[w]!==0&&(B=!1);if(!B)break;_++,b--}if(b>=0&&_++,k=k.dblp(_),b<0)break;for(w=0;w<n;w++){var X=z[w];X!==0&&(X>0?I=u[w][X-1>>1]:X<0&&(I=u[w][-X-1>>1].neg()),I.type==="affine"?k=k.mixedAdd(I):k=k.add(I))}}for(b=0;b<n;b++)u[b]=null;return s?k:k.toP()};function Wi(t,e){this.curve=t,this.type=e,this.precomputed=null}Qs.BasePoint=Wi,Wi.prototype.eq=function(){throw new Error("Not implemented")},Wi.prototype.validate=function(){return this.curve.validate(this)},Qs.prototype.decodePoint=function(e,r){e=Zc.toArray(e,r);var i=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*i){e[0]===6?$f(e[e.length-1]%2===0):e[0]===7&&$f(e[e.length-1]%2===1);var n=this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));return n}else if((e[0]===2||e[0]===3)&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),e[0]===3);throw new Error("Unknown point format")},Wi.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Wi.prototype._encode=function(e){var r=this.curve.p.byteLength(),i=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",r))},Wi.prototype.encode=function(e,r){return Zc.encode(this._encode(r),e)},Wi.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},Wi.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1},Wi.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,s=0;s<r;s+=e){for(var a=0;a<e;a++)n=n.dbl();i.push(n)}return{step:e,points:i}},Wi.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],i=(1<<e)-1,n=i===1?null:this.dbl(),s=1;s<i;s++)r[s]=r[s-1].add(n);return{wnd:e,points:r}},Wi.prototype._getBeta=function(){return null},Wi.prototype.dblp=function(e){for(var r=this,i=0;i<e;i++)r=r.dbl();return r};var Da={exports:{}};typeof Object.create=="function"?Da.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:Da.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}};var p9=Ni,hr=kn.exports,L0=Da.exports,Oa=Rf,g9=p9.assert;function Vi(t){Oa.call(this,"short",t),this.a=new hr(t.a,16).toRed(this.red),this.b=new hr(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}L0(Vi,Oa);var v9=Vi;Vi.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,i;if(e.beta)r=new hr(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);r=n[0].cmp(n[1])<0?n[0]:n[1],r=r.toRed(this.red)}if(e.lambda)i=new hr(e.lambda,16);else{var s=this._getEndoRoots(this.n);this.g.mul(s[0]).x.cmp(this.g.x.redMul(r))===0?i=s[0]:(i=s[1],g9(this.g.mul(i).x.cmp(this.g.x.redMul(r))===0))}var a;return e.basis?a=e.basis.map(function(u){return{a:new hr(u.a,16),b:new hr(u.b,16)}}):a=this._getEndoBasis(i),{beta:r,lambda:i,basis:a}}},Vi.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:hr.mont(e),i=new hr(2).toRed(r).redInvm(),n=i.redNeg(),s=new hr(3).toRed(r).redNeg().redSqrt().redMul(i),a=n.redAdd(s).fromRed(),u=n.redSub(s).fromRed();return[a,u]},Vi.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),i=e,n=this.n.clone(),s=new hr(1),a=new hr(0),u=new hr(0),l=new hr(1),d,b,w,I,S,D,L,K=0,H,U;i.cmpn(0)!==0;){var W=n.div(i);H=n.sub(W.mul(i)),U=u.sub(W.mul(s));var R=l.sub(W.mul(a));if(!w&&H.cmp(r)<0)d=L.neg(),b=s,w=H.neg(),I=U;else if(w&&++K===2)break;L=H,n=i,i=H,u=s,s=U,l=a,a=R}S=H.neg(),D=U;var k=w.sqr().add(I.sqr()),z=S.sqr().add(D.sqr());return z.cmp(k)>=0&&(S=d,D=b),w.negative&&(w=w.neg(),I=I.neg()),S.negative&&(S=S.neg(),D=D.neg()),[{a:w,b:I},{a:S,b:D}]},Vi.prototype._endoSplit=function(e){var r=this.endo.basis,i=r[0],n=r[1],s=n.b.mul(e).divRound(this.n),a=i.b.neg().mul(e).divRound(this.n),u=s.mul(i.a),l=a.mul(n.a),d=s.mul(i.b),b=a.mul(n.b),w=e.sub(u).sub(l),I=d.add(b).neg();return{k1:w,k2:I}},Vi.prototype.pointFromX=function(e,r){e=new hr(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(n.redSqr().redSub(i).cmp(this.zero)!==0)throw new Error("invalid point");var s=n.fromRed().isOdd();return(r&&!s||!r&&s)&&(n=n.redNeg()),this.point(e,n)},Vi.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,i=e.y,n=this.a.redMul(r),s=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return i.redSqr().redISub(s).cmpn(0)===0},Vi.prototype._endoWnafMulAdd=function(e,r,i){for(var n=this._endoWnafT1,s=this._endoWnafT2,a=0;a<e.length;a++){var u=this._endoSplit(r[a]),l=e[a],d=l._getBeta();u.k1.negative&&(u.k1.ineg(),l=l.neg(!0)),u.k2.negative&&(u.k2.ineg(),d=d.neg(!0)),n[a*2]=l,n[a*2+1]=d,s[a*2]=u.k1,s[a*2+1]=u.k2}for(var b=this._wnafMulAdd(1,n,s,a*2,i),w=0;w<a*2;w++)n[w]=null,s[w]=null;return b};function Dr(t,e,r,i){Oa.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new hr(e,16),this.y=new hr(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}L0(Dr,Oa.BasePoint),Vi.prototype.point=function(e,r,i){return new Dr(this,e,r,i)},Vi.prototype.pointFromJSON=function(e,r){return Dr.fromJSON(this,e,r)},Dr.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,n=function(s){return i.point(s.x.redMul(i.endo.beta),s.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return r}},Dr.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Dr.fromJSON=function(e,r,i){typeof r=="string"&&(r=JSON.parse(r));var n=e.point(r[0],r[1],i);if(!r[2])return n;function s(u){return e.point(u[0],u[1],i)}var a=r[2];return n.precomputed={beta:null,doubles:a.doubles&&{step:a.doubles.step,points:[n].concat(a.doubles.points.map(s))},naf:a.naf&&{wnd:a.naf.wnd,points:[n].concat(a.naf.points.map(s))}},n},Dr.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Dr.prototype.isInfinity=function(){return this.inf},Dr.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var i=r.redSqr().redISub(this.x).redISub(e.x),n=r.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},Dr.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),s=i.redAdd(i).redIAdd(i).redIAdd(r).redMul(n),a=s.redSqr().redISub(this.x.redAdd(this.x)),u=s.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,u)},Dr.prototype.getX=function(){return this.x.fromRed()},Dr.prototype.getY=function(){return this.y.fromRed()},Dr.prototype.mul=function(e){return e=new hr(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Dr.prototype.mulAdd=function(e,r,i){var n=[this,r],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s):this.curve._wnafMulAdd(1,n,s,2)},Dr.prototype.jmulAdd=function(e,r,i){var n=[this,r],s=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,s,!0):this.curve._wnafMulAdd(1,n,s,2,!0)},Dr.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)},Dr.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(s){return s.neg()};r.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return r},Dr.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function Ur(t,e,r,i){Oa.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new hr(0)):(this.x=new hr(e,16),this.y=new hr(r,16),this.z=new hr(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}L0(Ur,Oa.BasePoint),Vi.prototype.jpoint=function(e,r,i){return new Ur(this,e,r,i)},Ur.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),i=this.x.redMul(r),n=this.y.redMul(r).redMul(e);return this.curve.point(i,n)},Ur.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},Ur.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(r),s=e.x.redMul(i),a=this.y.redMul(r.redMul(e.z)),u=e.y.redMul(i.redMul(this.z)),l=n.redSub(s),d=a.redSub(u);if(l.cmpn(0)===0)return d.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var b=l.redSqr(),w=b.redMul(l),I=n.redMul(b),S=d.redSqr().redIAdd(w).redISub(I).redISub(I),D=d.redMul(I.redISub(S)).redISub(a.redMul(w)),L=this.z.redMul(e.z).redMul(l);return this.curve.jpoint(S,D,L)},Ur.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),i=this.x,n=e.x.redMul(r),s=this.y,a=e.y.redMul(r).redMul(this.z),u=i.redSub(n),l=s.redSub(a);if(u.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=u.redSqr(),b=d.redMul(u),w=i.redMul(d),I=l.redSqr().redIAdd(b).redISub(w).redISub(w),S=l.redMul(w.redISub(I)).redISub(s.redMul(b)),D=this.z.redMul(u);return this.curve.jpoint(I,S,D)},Ur.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var i=this;for(r=0;r<e;r++)i=i.dbl();return i}var n=this.curve.a,s=this.curve.tinv,a=this.x,u=this.y,l=this.z,d=l.redSqr().redSqr(),b=u.redAdd(u);for(r=0;r<e;r++){var w=a.redSqr(),I=b.redSqr(),S=I.redSqr(),D=w.redAdd(w).redIAdd(w).redIAdd(n.redMul(d)),L=a.redMul(I),K=D.redSqr().redISub(L.redAdd(L)),H=L.redISub(K),U=D.redMul(H);U=U.redIAdd(U).redISub(S);var W=b.redMul(l);r+1<e&&(d=d.redMul(S)),a=K,l=W,b=U}return this.curve.jpoint(a,b.redMul(s),l)},Ur.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},Ur.prototype._zeroDbl=function(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(n).redISub(a);u=u.redIAdd(u);var l=n.redAdd(n).redIAdd(n),d=l.redSqr().redISub(u).redISub(u),b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),e=d,r=l.redMul(u.redISub(d)).redISub(b),i=this.y.redAdd(this.y)}else{var w=this.x.redSqr(),I=this.y.redSqr(),S=I.redSqr(),D=this.x.redAdd(I).redSqr().redISub(w).redISub(S);D=D.redIAdd(D);var L=w.redAdd(w).redIAdd(w),K=L.redSqr(),H=S.redIAdd(S);H=H.redIAdd(H),H=H.redIAdd(H),e=K.redISub(D).redISub(D),r=L.redMul(D.redISub(e)).redISub(H),i=this.y.redMul(this.z),i=i.redIAdd(i)}return this.curve.jpoint(e,r,i)},Ur.prototype._threeDbl=function(){var e,r,i;if(this.zOne){var n=this.x.redSqr(),s=this.y.redSqr(),a=s.redSqr(),u=this.x.redAdd(s).redSqr().redISub(n).redISub(a);u=u.redIAdd(u);var l=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),d=l.redSqr().redISub(u).redISub(u);e=d;var b=a.redIAdd(a);b=b.redIAdd(b),b=b.redIAdd(b),r=l.redMul(u.redISub(d)).redISub(b),i=this.y.redAdd(this.y)}else{var w=this.z.redSqr(),I=this.y.redSqr(),S=this.x.redMul(I),D=this.x.redSub(w).redMul(this.x.redAdd(w));D=D.redAdd(D).redIAdd(D);var L=S.redIAdd(S);L=L.redIAdd(L);var K=L.redAdd(L);e=D.redSqr().redISub(K),i=this.y.redAdd(this.z).redSqr().redISub(I).redISub(w);var H=I.redSqr();H=H.redIAdd(H),H=H.redIAdd(H),H=H.redIAdd(H),r=D.redMul(L.redISub(e)).redISub(H)}return this.curve.jpoint(e,r,i)},Ur.prototype._dbl=function(){var e=this.curve.a,r=this.x,i=this.y,n=this.z,s=n.redSqr().redSqr(),a=r.redSqr(),u=i.redSqr(),l=a.redAdd(a).redIAdd(a).redIAdd(e.redMul(s)),d=r.redAdd(r);d=d.redIAdd(d);var b=d.redMul(u),w=l.redSqr().redISub(b.redAdd(b)),I=b.redISub(w),S=u.redSqr();S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var D=l.redMul(I).redISub(S),L=i.redAdd(i).redMul(n);return this.curve.jpoint(w,D,L)},Ur.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr(),n=r.redSqr(),s=e.redAdd(e).redIAdd(e),a=s.redSqr(),u=this.x.redAdd(r).redSqr().redISub(e).redISub(n);u=u.redIAdd(u),u=u.redAdd(u).redIAdd(u),u=u.redISub(a);var l=u.redSqr(),d=n.redIAdd(n);d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var b=s.redIAdd(u).redSqr().redISub(a).redISub(l).redISub(d),w=r.redMul(b);w=w.redIAdd(w),w=w.redIAdd(w);var I=this.x.redMul(l).redISub(w);I=I.redIAdd(I),I=I.redIAdd(I);var S=this.y.redMul(b.redMul(d.redISub(b)).redISub(u.redMul(l)));S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var D=this.z.redAdd(u).redSqr().redISub(i).redISub(l);return this.curve.jpoint(I,S,D)},Ur.prototype.mul=function(e,r){return e=new hr(e,r),this.curve._wnafMul(this,e)},Ur.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),i=e.z.redSqr();if(this.x.redMul(i).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var n=r.redMul(this.z),s=i.redMul(e.z);return this.y.redMul(s).redISub(e.y.redMul(n)).cmpn(0)===0},Ur.prototype.eqXToP=function(e){var r=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(i)===0)return!0;for(var n=e.clone(),s=this.curve.redN.redMul(r);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(s),this.x.cmp(i)===0)return!0}},Ur.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},Ur.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var Pa=kn.exports,q2=Da.exports,Nf=Rf,m9=Ni;function $a(t){Nf.call(this,"mont",t),this.a=new Pa(t.a,16).toRed(this.red),this.b=new Pa(t.b,16).toRed(this.red),this.i4=new Pa(4).toRed(this.red).redInvm(),this.two=new Pa(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}q2($a,Nf);var b9=$a;$a.prototype.validate=function(e){var r=e.normalize().x,i=r.redSqr(),n=i.redMul(r).redAdd(i.redMul(this.a)).redAdd(r),s=n.redSqrt();return s.redSqr().cmp(n)===0};function Or(t,e,r){Nf.BasePoint.call(this,t,"projective"),e===null&&r===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Pa(e,16),this.z=new Pa(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}q2(Or,Nf.BasePoint),$a.prototype.decodePoint=function(e,r){return this.point(m9.toArray(e,r),1)},$a.prototype.point=function(e,r){return new Or(this,e,r)},$a.prototype.pointFromJSON=function(e){return Or.fromJSON(this,e)},Or.prototype.precompute=function(){},Or.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Or.fromJSON=function(e,r){return new Or(e,r[0],r[1]||e.one)},Or.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Or.prototype.isInfinity=function(){return this.z.cmpn(0)===0},Or.prototype.dbl=function(){var e=this.x.redAdd(this.z),r=e.redSqr(),i=this.x.redSub(this.z),n=i.redSqr(),s=r.redSub(n),a=r.redMul(n),u=s.redMul(n.redAdd(this.curve.a24.redMul(s)));return this.curve.point(a,u)},Or.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Or.prototype.diffAdd=function(e,r){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),s=e.x.redAdd(e.z),a=e.x.redSub(e.z),u=a.redMul(i),l=s.redMul(n),d=r.z.redMul(u.redAdd(l).redSqr()),b=r.x.redMul(u.redISub(l).redSqr());return this.curve.point(d,b)},Or.prototype.mul=function(e){for(var r=e.clone(),i=this,n=this.curve.point(null,null),s=this,a=[];r.cmpn(0)!==0;r.iushrn(1))a.push(r.andln(1));for(var u=a.length-1;u>=0;u--)a[u]===0?(i=i.diffAdd(n,s),n=n.dbl()):(n=i.diffAdd(n,s),i=i.dbl());return n},Or.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Or.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Or.prototype.eq=function(e){return this.getX().cmp(e.getX())===0},Or.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Or.prototype.getX=function(){return this.normalize(),this.x.fromRed()};var y9=Ni,As=kn.exports,z2=Da.exports,Tf=Rf,w9=y9.assert;function jn(t){this.twisted=(t.a|0)!==1,this.mOneA=this.twisted&&(t.a|0)===-1,this.extended=this.mOneA,Tf.call(this,"edwards",t),this.a=new As(t.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new As(t.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new As(t.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),w9(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(t.c|0)===1}z2(jn,Tf);var _9=jn;jn.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},jn.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},jn.prototype.jpoint=function(e,r,i,n){return this.point(e,r,i,n)},jn.prototype.pointFromX=function(e,r){e=new As(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),s=this.one.redSub(this.c2.redMul(this.d).redMul(i)),a=n.redMul(s.redInvm()),u=a.redSqrt();if(u.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var l=u.fromRed().isOdd();return(r&&!l||!r&&l)&&(u=u.redNeg()),this.point(e,u)},jn.prototype.pointFromY=function(e,r){e=new As(e,16),e.red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),s=i.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(s.redInvm());if(a.cmp(this.zero)===0){if(r)throw new Error("invalid point");return this.point(this.zero,e)}var u=a.redSqrt();if(u.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");return u.fromRed().isOdd()!==r&&(u=u.redNeg()),this.point(u,e)},jn.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var r=e.x.redSqr(),i=e.y.redSqr(),n=r.redMul(this.a).redAdd(i),s=this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(i)));return n.cmp(s)===0};function ir(t,e,r,i,n){Tf.BasePoint.call(this,t,"projective"),e===null&&r===null&&i===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new As(e,16),this.y=new As(r,16),this.z=i?new As(i,16):this.curve.one,this.t=n&&new As(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}z2(ir,Tf.BasePoint),jn.prototype.pointFromJSON=function(e){return ir.fromJSON(this,e)},jn.prototype.point=function(e,r,i,n){return new ir(this,e,r,i,n)},ir.fromJSON=function(e,r){return new ir(e,r[0],r[1],r[2])},ir.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},ir.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},ir.prototype._extDbl=function(){var e=this.x.redSqr(),r=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),s=this.x.redAdd(this.y).redSqr().redISub(e).redISub(r),a=n.redAdd(r),u=a.redSub(i),l=n.redSub(r),d=s.redMul(u),b=a.redMul(l),w=s.redMul(l),I=u.redMul(a);return this.curve.point(d,b,I,w)},ir.prototype._projDbl=function(){var e=this.x.redAdd(this.y).redSqr(),r=this.x.redSqr(),i=this.y.redSqr(),n,s,a,u,l,d;if(this.curve.twisted){u=this.curve._mulA(r);var b=u.redAdd(i);this.zOne?(n=e.redSub(r).redSub(i).redMul(b.redSub(this.curve.two)),s=b.redMul(u.redSub(i)),a=b.redSqr().redSub(b).redSub(b)):(l=this.z.redSqr(),d=b.redSub(l).redISub(l),n=e.redSub(r).redISub(i).redMul(d),s=b.redMul(u.redSub(i)),a=b.redMul(d))}else u=r.redAdd(i),l=this.curve._mulC(this.z).redSqr(),d=u.redSub(l).redSub(l),n=this.curve._mulC(e.redISub(u)).redMul(d),s=this.curve._mulC(u).redMul(r.redISub(i)),a=u.redMul(d);return this.curve.point(n,s,a)},ir.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},ir.prototype._extAdd=function(e){var r=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),s=this.z.redMul(e.z.redAdd(e.z)),a=i.redSub(r),u=s.redSub(n),l=s.redAdd(n),d=i.redAdd(r),b=a.redMul(u),w=l.redMul(d),I=a.redMul(d),S=u.redMul(l);return this.curve.point(b,w,S,I)},ir.prototype._projAdd=function(e){var r=this.z.redMul(e.z),i=r.redSqr(),n=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(n).redMul(s),u=i.redSub(a),l=i.redAdd(a),d=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(n).redISub(s),b=r.redMul(u).redMul(d),w,I;return this.curve.twisted?(w=r.redMul(l).redMul(s.redSub(this.curve._mulA(n))),I=u.redMul(l)):(w=r.redMul(l).redMul(s.redSub(n)),I=this.curve._mulC(u).redMul(l)),this.curve.point(b,w,I)},ir.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},ir.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},ir.prototype.mulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!1)},ir.prototype.jmulAdd=function(e,r,i){return this.curve._wnafMulAdd(1,[this,r],[e,i],2,!0)},ir.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},ir.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},ir.prototype.getX=function(){return this.normalize(),this.x.fromRed()},ir.prototype.getY=function(){return this.normalize(),this.y.fromRed()},ir.prototype.eq=function(e){return this===e||this.getX().cmp(e.getX())===0&&this.getY().cmp(e.getY())===0},ir.prototype.eqXToP=function(e){var r=e.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(r)===0)return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}},ir.prototype.toP=ir.prototype.normalize,ir.prototype.mixedAdd=ir.prototype.add,function(t){var e=t;e.base=Rf,e.short=v9,e.mont=b9,e.edwards=_9}(T0);var Lf={},Bf={},$t={},E9=Po,A9=Da.exports;$t.inherits=A9;function x9(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function S9(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var s=t.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=s&63|128):x9(t,n)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++n)&1023),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=s&63|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=s&63|128)}else for(n=0;n<t.length;n++)r[n]=t[n]|0;return r}$t.toArray=S9;function I9(t){for(var e="",r=0;r<t.length;r++)e+=K2(t[r].toString(16));return e}$t.toHex=I9;function H2(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}$t.htonl=H2;function M9(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];e==="little"&&(n=H2(n)),r+=W2(n.toString(16))}return r}$t.toHex32=M9;function K2(t){return t.length===1?"0"+t:t}$t.zero2=K2;function W2(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}$t.zero8=W2;function C9(t,e,r,i){var n=r-e;E9(n%4===0);for(var s=new Array(n/4),a=0,u=e;a<s.length;a++,u+=4){var l;i==="big"?l=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:l=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=l>>>0}return s}$t.join32=C9;function D9(t,e){for(var r=new Array(t.length*4),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];e==="big"?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=s&255):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=s&255)}return r}$t.split32=D9;function O9(t,e){return t>>>e|t<<32-e}$t.rotr32=O9;function P9(t,e){return t<<e|t>>>32-e}$t.rotl32=P9;function $9(t,e){return t+e>>>0}$t.sum32=$9;function R9(t,e,r){return t+e+r>>>0}$t.sum32_3=R9;function N9(t,e,r,i){return t+e+r+i>>>0}$t.sum32_4=N9;function T9(t,e,r,i,n){return t+e+r+i+n>>>0}$t.sum32_5=T9;function L9(t,e,r,i){var n=t[e],s=t[e+1],a=i+s>>>0,u=(a<i?1:0)+r+n;t[e]=u>>>0,t[e+1]=a}$t.sum64=L9;function B9(t,e,r,i){var n=e+i>>>0,s=(n<e?1:0)+t+r;return s>>>0}$t.sum64_hi=B9;function F9(t,e,r,i){var n=e+i;return n>>>0}$t.sum64_lo=F9;function U9(t,e,r,i,n,s,a,u){var l=0,d=e;d=d+i>>>0,l+=d<e?1:0,d=d+s>>>0,l+=d<s?1:0,d=d+u>>>0,l+=d<u?1:0;var b=t+r+n+a+l;return b>>>0}$t.sum64_4_hi=U9;function k9(t,e,r,i,n,s,a,u){var l=e+i+s+u;return l>>>0}$t.sum64_4_lo=k9;function j9(t,e,r,i,n,s,a,u,l,d){var b=0,w=e;w=w+i>>>0,b+=w<e?1:0,w=w+s>>>0,b+=w<s?1:0,w=w+u>>>0,b+=w<u?1:0,w=w+d>>>0,b+=w<d?1:0;var I=t+r+n+a+l+b;return I>>>0}$t.sum64_5_hi=j9;function q9(t,e,r,i,n,s,a,u,l,d){var b=e+i+s+u+d;return b>>>0}$t.sum64_5_lo=q9;function z9(t,e,r){var i=e<<32-r|t>>>r;return i>>>0}$t.rotr64_hi=z9;function H9(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}$t.rotr64_lo=H9;function K9(t,e,r){return t>>>r}$t.shr64_hi=K9;function W9(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}$t.shr64_lo=W9;var Ra={},V2=$t,V9=Po;function Ff(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ra.BlockHash=Ff,Ff.prototype.update=function(e,r){if(e=V2.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){e=this.pending;var i=e.length%this._delta8;this.pending=e.slice(e.length-i,e.length),this.pending.length===0&&(this.pending=null),e=V2.join32(e,0,e.length-i,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},Ff.prototype.digest=function(e){return this.update(this._pad()),V9(this.pending===null),this._digest(e)},Ff.prototype._pad=function(){var e=this.pendingTotal,r=this._delta8,i=r-(e+this.padLength)%r,n=new Array(i+this.padLength);n[0]=128;for(var s=1;s<i;s++)n[s]=0;if(e<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)n[s++]=0;n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=e>>>24&255,n[s++]=e>>>16&255,n[s++]=e>>>8&255,n[s++]=e&255}else for(n[s++]=e&255,n[s++]=e>>>8&255,n[s++]=e>>>16&255,n[s++]=e>>>24&255,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,a=8;a<this.padLength;a++)n[s++]=0;return n};var Na={},qn={},G9=$t,zn=G9.rotr32;function Y9(t,e,r,i){if(t===0)return G2(e,r,i);if(t===1||t===3)return J2(e,r,i);if(t===2)return Y2(e,r,i)}qn.ft_1=Y9;function G2(t,e,r){return t&e^~t&r}qn.ch32=G2;function Y2(t,e,r){return t&e^t&r^e&r}qn.maj32=Y2;function J2(t,e,r){return t^e^r}qn.p32=J2;function J9(t){return zn(t,2)^zn(t,13)^zn(t,22)}qn.s0_256=J9;function Q9(t){return zn(t,6)^zn(t,11)^zn(t,25)}qn.s1_256=Q9;function Z9(t){return zn(t,7)^zn(t,18)^t>>>3}qn.g0_256=Z9;function X9(t){return zn(t,17)^zn(t,19)^t>>>10}qn.g1_256=X9;var Ta=$t,e_=Ra,t_=qn,B0=Ta.rotl32,Xc=Ta.sum32,r_=Ta.sum32_5,i_=t_.ft_1,Q2=e_.BlockHash,n_=[1518500249,1859775393,2400959708,3395469782];function Hn(){if(!(this instanceof Hn))return new Hn;Q2.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ta.inherits(Hn,Q2);var s_=Hn;Hn.blockSize=512,Hn.outSize=160,Hn.hmacStrength=80,Hn.padLength=64,Hn.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n<i.length;n++)i[n]=B0(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var s=this.h[0],a=this.h[1],u=this.h[2],l=this.h[3],d=this.h[4];for(n=0;n<i.length;n++){var b=~~(n/20),w=r_(B0(s,5),i_(b,a,u,l),d,i[n],n_[b]);d=l,l=u,u=B0(a,30),a=s,s=w}this.h[0]=Xc(this.h[0],s),this.h[1]=Xc(this.h[1],a),this.h[2]=Xc(this.h[2],u),this.h[3]=Xc(this.h[3],l),this.h[4]=Xc(this.h[4],d)},Hn.prototype._digest=function(e){return e==="hex"?Ta.toHex32(this.h,"big"):Ta.split32(this.h,"big")};var La=$t,o_=Ra,Ba=qn,a_=Po,mn=La.sum32,c_=La.sum32_4,u_=La.sum32_5,f_=Ba.ch32,h_=Ba.maj32,l_=Ba.s0_256,d_=Ba.s1_256,p_=Ba.g0_256,g_=Ba.g1_256,Z2=o_.BlockHash,v_=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function Kn(){if(!(this instanceof Kn))return new Kn;Z2.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=v_,this.W=new Array(64)}La.inherits(Kn,Z2);var X2=Kn;Kn.blockSize=512,Kn.outSize=256,Kn.hmacStrength=192,Kn.padLength=64,Kn.prototype._update=function(e,r){for(var i=this.W,n=0;n<16;n++)i[n]=e[r+n];for(;n<i.length;n++)i[n]=c_(g_(i[n-2]),i[n-7],p_(i[n-15]),i[n-16]);var s=this.h[0],a=this.h[1],u=this.h[2],l=this.h[3],d=this.h[4],b=this.h[5],w=this.h[6],I=this.h[7];for(a_(this.k.length===i.length),n=0;n<i.length;n++){var S=u_(I,d_(d),f_(d,b,w),this.k[n],i[n]),D=mn(l_(s),h_(s,a,u));I=w,w=b,b=d,d=mn(l,S),l=u,u=a,a=s,s=mn(S,D)}this.h[0]=mn(this.h[0],s),this.h[1]=mn(this.h[1],a),this.h[2]=mn(this.h[2],u),this.h[3]=mn(this.h[3],l),this.h[4]=mn(this.h[4],d),this.h[5]=mn(this.h[5],b),this.h[6]=mn(this.h[6],w),this.h[7]=mn(this.h[7],I)},Kn.prototype._digest=function(e){return e==="hex"?La.toHex32(this.h,"big"):La.split32(this.h,"big")};var F0=$t,ev=X2;function xs(){if(!(this instanceof xs))return new xs;ev.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}F0.inherits(xs,ev);var m_=xs;xs.blockSize=512,xs.outSize=224,xs.hmacStrength=192,xs.padLength=64,xs.prototype._digest=function(e){return e==="hex"?F0.toHex32(this.h.slice(0,7),"big"):F0.split32(this.h.slice(0,7),"big")};var gi=$t,b_=Ra,y_=Po,Wn=gi.rotr64_hi,Vn=gi.rotr64_lo,tv=gi.shr64_hi,rv=gi.shr64_lo,Zs=gi.sum64,U0=gi.sum64_hi,k0=gi.sum64_lo,w_=gi.sum64_4_hi,__=gi.sum64_4_lo,E_=gi.sum64_5_hi,A_=gi.sum64_5_lo,iv=b_.BlockHash,x_=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function bn(){if(!(this instanceof bn))return new bn;iv.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=x_,this.W=new Array(160)}gi.inherits(bn,iv);var nv=bn;bn.blockSize=1024,bn.outSize=512,bn.hmacStrength=192,bn.padLength=128,bn.prototype._prepareBlock=function(e,r){for(var i=this.W,n=0;n<32;n++)i[n]=e[r+n];for(;n<i.length;n+=2){var s=T_(i[n-4],i[n-3]),a=L_(i[n-4],i[n-3]),u=i[n-14],l=i[n-13],d=R_(i[n-30],i[n-29]),b=N_(i[n-30],i[n-29]),w=i[n-32],I=i[n-31];i[n]=w_(s,a,u,l,d,b,w,I),i[n+1]=__(s,a,u,l,d,b,w,I)}},bn.prototype._update=function(e,r){this._prepareBlock(e,r);var i=this.W,n=this.h[0],s=this.h[1],a=this.h[2],u=this.h[3],l=this.h[4],d=this.h[5],b=this.h[6],w=this.h[7],I=this.h[8],S=this.h[9],D=this.h[10],L=this.h[11],K=this.h[12],H=this.h[13],U=this.h[14],W=this.h[15];y_(this.k.length===i.length);for(var R=0;R<i.length;R+=2){var k=U,z=W,_=P_(I,S),B=$_(I,S),X=S_(I,S,D,L,K),re=I_(I,S,D,L,K,H),T=this.k[R],y=this.k[R+1],f=i[R],h=i[R+1],v=E_(k,z,_,B,X,re,T,y,f,h),E=A_(k,z,_,B,X,re,T,y,f,h);k=D_(n,s),z=O_(n,s),_=M_(n,s,a,u,l),B=C_(n,s,a,u,l,d);var C=U0(k,z,_,B),P=k0(k,z,_,B);U=K,W=H,K=D,H=L,D=I,L=S,I=U0(b,w,v,E),S=k0(w,w,v,E),b=l,w=d,l=a,d=u,a=n,u=s,n=U0(v,E,C,P),s=k0(v,E,C,P)}Zs(this.h,0,n,s),Zs(this.h,2,a,u),Zs(this.h,4,l,d),Zs(this.h,6,b,w),Zs(this.h,8,I,S),Zs(this.h,10,D,L),Zs(this.h,12,K,H),Zs(this.h,14,U,W)},bn.prototype._digest=function(e){return e==="hex"?gi.toHex32(this.h,"big"):gi.split32(this.h,"big")};function S_(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function I_(t,e,r,i,n,s){var a=e&i^~e&s;return a<0&&(a+=4294967296),a}function M_(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function C_(t,e,r,i,n,s){var a=e&i^e&s^i&s;return a<0&&(a+=4294967296),a}function D_(t,e){var r=Wn(t,e,28),i=Wn(e,t,2),n=Wn(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function O_(t,e){var r=Vn(t,e,28),i=Vn(e,t,2),n=Vn(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function P_(t,e){var r=Wn(t,e,14),i=Wn(t,e,18),n=Wn(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function $_(t,e){var r=Vn(t,e,14),i=Vn(t,e,18),n=Vn(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function R_(t,e){var r=Wn(t,e,1),i=Wn(t,e,8),n=tv(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function N_(t,e){var r=Vn(t,e,1),i=Vn(t,e,8),n=rv(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function T_(t,e){var r=Wn(t,e,19),i=Wn(e,t,29),n=tv(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}function L_(t,e){var r=Vn(t,e,19),i=Vn(e,t,29),n=rv(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}var j0=$t,sv=nv;function Ss(){if(!(this instanceof Ss))return new Ss;sv.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}j0.inherits(Ss,sv);var B_=Ss;Ss.blockSize=1024,Ss.outSize=384,Ss.hmacStrength=192,Ss.padLength=128,Ss.prototype._digest=function(e){return e==="hex"?j0.toHex32(this.h.slice(0,12),"big"):j0.split32(this.h.slice(0,12),"big")},Na.sha1=s_,Na.sha224=m_,Na.sha256=X2,Na.sha384=B_,Na.sha512=nv;var ov={},Ro=$t,F_=Ra,Uf=Ro.rotl32,av=Ro.sum32,eu=Ro.sum32_3,cv=Ro.sum32_4,uv=F_.BlockHash;function Gn(){if(!(this instanceof Gn))return new Gn;uv.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Ro.inherits(Gn,uv),ov.ripemd160=Gn,Gn.blockSize=512,Gn.outSize=160,Gn.hmacStrength=192,Gn.padLength=64,Gn.prototype._update=function(e,r){for(var i=this.h[0],n=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],l=i,d=n,b=s,w=a,I=u,S=0;S<80;S++){var D=av(Uf(cv(i,fv(S,n,s,a),e[j_[S]+r],U_(S)),z_[S]),u);i=u,u=a,a=Uf(s,10),s=n,n=D,D=av(Uf(cv(l,fv(79-S,d,b,w),e[q_[S]+r],k_(S)),H_[S]),I),l=I,I=w,w=Uf(b,10),b=d,d=D}D=eu(this.h[1],s,w),this.h[1]=eu(this.h[2],a,I),this.h[2]=eu(this.h[3],u,l),this.h[3]=eu(this.h[4],i,d),this.h[4]=eu(this.h[0],n,b),this.h[0]=D},Gn.prototype._digest=function(e){return e==="hex"?Ro.toHex32(this.h,"little"):Ro.split32(this.h,"little")};function fv(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function U_(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function k_(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var j_=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],q_=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],z_=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],H_=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],K_=$t,W_=Po;function Fa(t,e,r){if(!(this instanceof Fa))return new Fa(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(K_.toArray(e,r))}var V_=Fa;Fa.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),W_(e.length<=this.blockSize);for(var r=e.length;r<this.blockSize;r++)e.push(0);for(r=0;r<e.length;r++)e[r]^=54;for(this.inner=new this.Hash().update(e),r=0;r<e.length;r++)e[r]^=106;this.outer=new this.Hash().update(e)},Fa.prototype.update=function(e,r){return this.inner.update(e,r),this},Fa.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(t){var e=t;e.utils=$t,e.common=Ra,e.sha=Na,e.ripemd=ov,e.hmac=V_,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(Bf);var q0,hv;function G_(){return hv||(hv=1,q0={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),q0}(function(t){var e=t,r=Bf,i=T0,n=Ni,s=n.assert;function a(d){d.type==="short"?this.curve=new i.short(d):d.type==="edwards"?this.curve=new i.edwards(d):this.curve=new i.mont(d),this.g=this.curve.g,this.n=this.curve.n,this.hash=d.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}e.PresetCurve=a;function u(d,b){Object.defineProperty(e,d,{configurable:!0,enumerable:!0,get:function(){var w=new a(b);return Object.defineProperty(e,d,{configurable:!0,enumerable:!0,value:w}),w}})}u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:r.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:r.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var l;try{l=G_()}catch{l=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",l]})})(Lf);var Y_=Bf,No=R0,lv=Po;function Xs(t){if(!(this instanceof Xs))return new Xs(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=No.toArray(t.entropy,t.entropyEnc||"hex"),r=No.toArray(t.nonce,t.nonceEnc||"hex"),i=No.toArray(t.pers,t.persEnc||"hex");lv(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var J_=Xs;Xs.prototype._init=function(e,r,i){var n=e.concat(r).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var s=0;s<this.V.length;s++)this.K[s]=0,this.V[s]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Xs.prototype._hmac=function(){return new Y_.hmac(this.hash,this.K)},Xs.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Xs.prototype.reseed=function(e,r,i,n){typeof r!="string"&&(n=i,i=r,r=null),e=No.toArray(e,r),i=No.toArray(i,n),lv(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},Xs.prototype.generate=function(e,r,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(n=i,i=r,r=null),i&&(i=No.toArray(i,n||"hex"),this._update(i));for(var s=[];s.length<e;)this.V=this._hmac().update(this.V).digest(),s=s.concat(this.V);var a=s.slice(0,e);return this._update(i),this._reseed++,No.encode(a,r)};var Q_=kn.exports,Z_=Ni,z0=Z_.assert;function Gr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var X_=Gr;Gr.fromPublic=function(e,r,i){return r instanceof Gr?r:new Gr(e,{pub:r,pubEnc:i})},Gr.fromPrivate=function(e,r,i){return r instanceof Gr?r:new Gr(e,{priv:r,privEnc:i})},Gr.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Gr.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},Gr.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv},Gr.prototype._importPrivate=function(e,r){this.priv=new Q_(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},Gr.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?z0(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&z0(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)},Gr.prototype.derive=function(e){return e.validate()||z0(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Gr.prototype.sign=function(e,r,i){return this.ec.sign(e,this,r,i)},Gr.prototype.verify=function(e,r){return this.ec.verify(e,r,this)},Gr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var kf=kn.exports,H0=Ni,eE=H0.assert;function jf(t,e){if(t instanceof jf)return t;this._importDER(t,e)||(eE(t.r&&t.s,"Signature without r or s"),this.r=new kf(t.r,16),this.s=new kf(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var tE=jf;function rE(){this.place=0}function K0(t,e){var r=t[e.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4||t[e.place]===0)return!1;for(var n=0,s=0,a=e.place;s<i;s++,a++)n<<=8,n|=t[a],n>>>=0;return n<=127?!1:(e.place=a,n)}function dv(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}jf.prototype._importDER=function(e,r){e=H0.toArray(e,r);var i=new rE;if(e[i.place++]!==48)return!1;var n=K0(e,i);if(n===!1||n+i.place!==e.length||e[i.place++]!==2)return!1;var s=K0(e,i);if(s===!1||e[i.place]&128)return!1;var a=e.slice(i.place,s+i.place);if(i.place+=s,e[i.place++]!==2)return!1;var u=K0(e,i);if(u===!1||e.length!==u+i.place||e[i.place]&128)return!1;var l=e.slice(i.place,u+i.place);if(a[0]===0)if(a[1]&128)a=a.slice(1);else return!1;if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;return this.r=new kf(a),this.s=new kf(l),this.recoveryParam=null,!0};function W0(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}jf.prototype.toDER=function(e){var r=this.r.toArray(),i=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),i[0]&128&&(i=[0].concat(i)),r=dv(r),i=dv(i);!i[0]&&!(i[1]&128);)i=i.slice(1);var n=[2];W0(n,r.length),n=n.concat(r),n.push(2),W0(n,i.length);var s=n.concat(i),a=[48];return W0(a,s.length),a=a.concat(s),H0.encode(a,e)};var To=kn.exports,pv=J_,iE=Ni,V0=Lf,nE=Of.exports,gv=iE.assert,G0=X_,qf=tE;function Gi(t){if(!(this instanceof Gi))return new Gi(t);typeof t=="string"&&(gv(Object.prototype.hasOwnProperty.call(V0,t),"Unknown curve "+t),t=V0[t]),t instanceof V0.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var sE=Gi;Gi.prototype.keyPair=function(e){return new G0(this,e)},Gi.prototype.keyFromPrivate=function(e,r){return G0.fromPrivate(this,e,r)},Gi.prototype.keyFromPublic=function(e,r){return G0.fromPublic(this,e,r)},Gi.prototype.genKeyPair=function(e){e||(e={});for(var r=new pv({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||nE(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),n=this.n.sub(new To(2));;){var s=new To(r.generate(i));if(!(s.cmp(n)>0))return s.iaddn(1),this.keyFromPrivate(s)}},Gi.prototype._truncateToN=function(e,r){var i=e.byteLength()*8-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},Gi.prototype.sign=function(e,r,i,n){typeof i=="object"&&(n=i,i=null),n||(n={}),r=this.keyFromPrivate(r,i),e=this._truncateToN(new To(e,16));for(var s=this.n.byteLength(),a=r.getPrivate().toArray("be",s),u=e.toArray("be",s),l=new pv({hash:this.hash,entropy:a,nonce:u,pers:n.pers,persEnc:n.persEnc||"utf8"}),d=this.n.sub(new To(1)),b=0;;b++){var w=n.k?n.k(b):new To(l.generate(this.n.byteLength()));if(w=this._truncateToN(w,!0),!(w.cmpn(1)<=0||w.cmp(d)>=0)){var I=this.g.mul(w);if(!I.isInfinity()){var S=I.getX(),D=S.umod(this.n);if(D.cmpn(0)!==0){var L=w.invm(this.n).mul(D.mul(r.getPrivate()).iadd(e));if(L=L.umod(this.n),L.cmpn(0)!==0){var K=(I.getY().isOdd()?1:0)|(S.cmp(D)!==0?2:0);return n.canonical&&L.cmp(this.nh)>0&&(L=this.n.sub(L),K^=1),new qf({r:D,s:L,recoveryParam:K})}}}}}},Gi.prototype.verify=function(e,r,i,n){e=this._truncateToN(new To(e,16)),i=this.keyFromPublic(i,n),r=new qf(r,"hex");var s=r.r,a=r.s;if(s.cmpn(1)<0||s.cmp(this.n)>=0||a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var u=a.invm(this.n),l=u.mul(e).umod(this.n),d=u.mul(s).umod(this.n),b;return this.curve._maxwellTrick?(b=this.g.jmulAdd(l,i.getPublic(),d),b.isInfinity()?!1:b.eqXToP(s)):(b=this.g.mulAdd(l,i.getPublic(),d),b.isInfinity()?!1:b.getX().umod(this.n).cmp(s)===0)},Gi.prototype.recoverPubKey=function(t,e,r,i){gv((3&r)===r,"The recovery param is more than two bits"),e=new qf(e,i);var n=this.n,s=new To(t),a=e.r,u=e.s,l=r&1,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");d?a=this.curve.pointFromX(a.add(this.curve.n),l):a=this.curve.pointFromX(a,l);var b=e.r.invm(n),w=n.sub(s).mul(b).umod(n),I=u.mul(b).umod(n);return this.g.mulAdd(w,a,I)},Gi.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new qf(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch{continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var tu=Ni,vv=tu.assert,mv=tu.parseBytes,Ua=tu.cachedProperty;function Pr(t,e){this.eddsa=t,this._secret=mv(e.secret),t.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=mv(e.pub)}Pr.fromPublic=function(e,r){return r instanceof Pr?r:new Pr(e,{pub:r})},Pr.fromSecret=function(e,r){return r instanceof Pr?r:new Pr(e,{secret:r})},Pr.prototype.secret=function(){return this._secret},Ua(Pr,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),Ua(Pr,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),Ua(Pr,"privBytes",function(){var e=this.eddsa,r=this.hash(),i=e.encodingLength-1,n=r.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n}),Ua(Pr,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),Ua(Pr,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),Ua(Pr,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Pr.prototype.sign=function(e){return vv(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},Pr.prototype.verify=function(e,r){return this.eddsa.verify(e,r,this)},Pr.prototype.getSecret=function(e){return vv(this._secret,"KeyPair is public only"),tu.encode(this.secret(),e)},Pr.prototype.getPublic=function(e){return tu.encode(this.pubBytes(),e)};var oE=Pr,aE=kn.exports,zf=Ni,bv=zf.assert,Hf=zf.cachedProperty,cE=zf.parseBytes;function Lo(t,e){this.eddsa=t,typeof e!="object"&&(e=cE(e)),Array.isArray(e)&&(bv(e.length===t.encodingLength*2,"Signature has invalid size"),e={R:e.slice(0,t.encodingLength),S:e.slice(t.encodingLength)}),bv(e.R&&e.S,"Signature without R or S"),t.isPoint(e.R)&&(this._R=e.R),e.S instanceof aE&&(this._S=e.S),this._Rencoded=Array.isArray(e.R)?e.R:e.Rencoded,this._Sencoded=Array.isArray(e.S)?e.S:e.Sencoded}Hf(Lo,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),Hf(Lo,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),Hf(Lo,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),Hf(Lo,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Lo.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Lo.prototype.toHex=function(){return zf.encode(this.toBytes(),"hex").toUpperCase()};var uE=Lo,fE=Bf,hE=Lf,ka=Ni,lE=ka.assert,yv=ka.parseBytes,wv=oE,_v=uE;function vi(t){if(lE(t==="ed25519","only tested with ed25519 so far"),!(this instanceof vi))return new vi(t);t=hE[t].curve,this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=fE.sha512}var dE=vi;vi.prototype.sign=function(e,r){e=yv(e);var i=this.keyFromSecret(r),n=this.hashInt(i.messagePrefix(),e),s=this.g.mul(n),a=this.encodePoint(s),u=this.hashInt(a,i.pubBytes(),e).mul(i.priv()),l=n.add(u).umod(this.curve.n);return this.makeSignature({R:s,S:l,Rencoded:a})},vi.prototype.verify=function(e,r,i){if(e=yv(e),r=this.makeSignature(r),r.S().gte(r.eddsa.curve.n)||r.S().isNeg())return!1;var n=this.keyFromPublic(i),s=this.hashInt(r.Rencoded(),n.pubBytes(),e),a=this.g.mul(r.S()),u=r.R().add(n.pub().mul(s));return u.eq(a)},vi.prototype.hashInt=function(){for(var e=this.hash(),r=0;r<arguments.length;r++)e.update(arguments[r]);return ka.intFromLE(e.digest()).umod(this.curve.n)},vi.prototype.keyFromPublic=function(e){return wv.fromPublic(this,e)},vi.prototype.keyFromSecret=function(e){return wv.fromSecret(this,e)},vi.prototype.makeSignature=function(e){return e instanceof _v?e:new _v(this,e)},vi.prototype.encodePoint=function(e){var r=e.getY().toArray("le",this.encodingLength);return r[this.encodingLength-1]|=e.getX().isOdd()?128:0,r},vi.prototype.decodePoint=function(e){e=ka.parseBytes(e);var r=e.length-1,i=e.slice(0,r).concat(e[r]&-129),n=(e[r]&128)!==0,s=ka.intFromLE(i);return this.curve.pointFromY(s,n)},vi.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},vi.prototype.decodeInt=function(e){return ka.intFromLE(e)},vi.prototype.isPoint=function(e){return e instanceof this.pointClass},function(t){var e=t;e.version=l9.version,e.utils=Ni,e.rand=Of.exports,e.curve=T0,e.curves=Lf,e.ec=sE,e.eddsa=dE}(U2);var Y0={},Ev={};(function(t){Object.defineProperty(t,"__esModule",{value:!0});var e=wt,r=Ri;t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var i=function(){function u(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return u.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},u.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},u.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},u.prototype.update=function(l,d){if(d===void 0&&(d=l.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var b=0;if(this._bytesHashed+=d,this._bufferLength>0){for(;this._bufferLength<t.BLOCK_SIZE&&d>0;)this._buffer[this._bufferLength++]=l[b++],d--;this._bufferLength===this.blockSize&&(s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(d>=this.blockSize&&(b=s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,l,b,d),d%=this.blockSize);d>0;)this._buffer[this._bufferLength++]=l[b++],d--;return this},u.prototype.finish=function(l){if(!this._finished){var d=this._bytesHashed,b=this._bufferLength,w=d/536870912|0,I=d<<3,S=d%128<112?128:256;this._buffer[b]=128;for(var D=b+1;D<S-8;D++)this._buffer[D]=0;e.writeUint32BE(w,this._buffer,S-8),e.writeUint32BE(I,this._buffer,S-4),s(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,S),this._finished=!0}for(var D=0;D<this.digestLength/8;D++)e.writeUint32BE(this._stateHi[D],l,D*8),e.writeUint32BE(this._stateLo[D],l,D*8+4);return this},u.prototype.digest=function(){var l=new Uint8Array(this.digestLength);return this.finish(l),l},u.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},u.prototype.restoreState=function(l){return this._stateHi.set(l.stateHi),this._stateLo.set(l.stateLo),this._bufferLength=l.bufferLength,l.buffer&&this._buffer.set(l.buffer),this._bytesHashed=l.bytesHashed,this._finished=!1,this},u.prototype.cleanSavedState=function(l){r.wipe(l.stateHi),r.wipe(l.stateLo),l.buffer&&r.wipe(l.buffer),l.bufferLength=0,l.bytesHashed=0},u}();t.SHA512=i;var n=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function s(u,l,d,b,w,I,S){for(var D=d[0],L=d[1],K=d[2],H=d[3],U=d[4],W=d[5],R=d[6],k=d[7],z=b[0],_=b[1],B=b[2],X=b[3],re=b[4],T=b[5],y=b[6],f=b[7],h,v,E,C,P,M,g,m;S>=128;){for(var N=0;N<16;N++){var ee=8*N+I;u[N]=e.readUint32BE(w,ee),l[N]=e.readUint32BE(w,ee+4)}for(var N=0;N<80;N++){var ae=D,O=L,te=K,q=H,G=U,Y=W,A=R,V=k,oe=z,ue=_,he=B,ye=X,we=re,Re=T,Xe=y,Oe=f;if(h=k,v=f,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=(U>>>14|re<<32-14)^(U>>>18|re<<32-18)^(re>>>41-32|U<<32-(41-32)),v=(re>>>14|U<<32-14)^(re>>>18|U<<32-18)^(U>>>41-32|re<<32-(41-32)),P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,h=U&W^~U&R,v=re&T^~re&y,P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,h=n[N*2],v=n[N*2+1],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,h=u[N%16],v=l[N%16],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,E=g&65535|m<<16,C=P&65535|M<<16,h=E,v=C,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=(D>>>28|z<<32-28)^(z>>>34-32|D<<32-(34-32))^(z>>>39-32|D<<32-(39-32)),v=(z>>>28|D<<32-28)^(D>>>34-32|z<<32-(34-32))^(D>>>39-32|z<<32-(39-32)),P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,h=D&L^D&K^L&K,v=z&_^z&B^_&B,P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,V=g&65535|m<<16,Oe=P&65535|M<<16,h=q,v=ye,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=E,v=C,P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,q=g&65535|m<<16,ye=P&65535|M<<16,L=ae,K=O,H=te,U=q,W=G,R=Y,k=A,D=V,_=oe,B=ue,X=he,re=ye,T=we,y=Re,f=Xe,z=Oe,N%16===15)for(var ee=0;ee<16;ee++)h=u[ee],v=l[ee],P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=u[(ee+9)%16],v=l[(ee+9)%16],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,E=u[(ee+1)%16],C=l[(ee+1)%16],h=(E>>>1|C<<32-1)^(E>>>8|C<<32-8)^E>>>7,v=(C>>>1|E<<32-1)^(C>>>8|E<<32-8)^(C>>>7|E<<32-7),P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,E=u[(ee+14)%16],C=l[(ee+14)%16],h=(E>>>19|C<<32-19)^(C>>>61-32|E<<32-(61-32))^E>>>6,v=(C>>>19|E<<32-19)^(E>>>61-32|C<<32-(61-32))^(C>>>6|E<<32-6),P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,u[ee]=g&65535|m<<16,l[ee]=P&65535|M<<16}h=D,v=z,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[0],v=b[0],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[0]=D=g&65535|m<<16,b[0]=z=P&65535|M<<16,h=L,v=_,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[1],v=b[1],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[1]=L=g&65535|m<<16,b[1]=_=P&65535|M<<16,h=K,v=B,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[2],v=b[2],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[2]=K=g&65535|m<<16,b[2]=B=P&65535|M<<16,h=H,v=X,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[3],v=b[3],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[3]=H=g&65535|m<<16,b[3]=X=P&65535|M<<16,h=U,v=re,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[4],v=b[4],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[4]=U=g&65535|m<<16,b[4]=re=P&65535|M<<16,h=W,v=T,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[5],v=b[5],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[5]=W=g&65535|m<<16,b[5]=T=P&65535|M<<16,h=R,v=y,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[6],v=b[6],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[6]=R=g&65535|m<<16,b[6]=y=P&65535|M<<16,h=k,v=f,P=v&65535,M=v>>>16,g=h&65535,m=h>>>16,h=d[7],v=b[7],P+=v&65535,M+=v>>>16,g+=h&65535,m+=h>>>16,M+=P>>>16,g+=M>>>16,m+=g>>>16,d[7]=k=g&65535|m<<16,b[7]=f=P&65535|M<<16,I+=128,S-=128}return I}function a(u){var l=new i;l.update(u);var d=l.digest();return l.clean(),d}t.hash=a})(Ev),function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.convertSecretKeyToX25519=t.convertPublicKeyToX25519=t.verify=t.sign=t.extractPublicKeyFromSecretKey=t.generateKeyPair=t.generateKeyPairFromSeed=t.SEED_LENGTH=t.SECRET_KEY_LENGTH=t.PUBLIC_KEY_LENGTH=t.SIGNATURE_LENGTH=void 0;const e=Ma,r=Ev,i=Ri;t.SIGNATURE_LENGTH=64,t.PUBLIC_KEY_LENGTH=32,t.SECRET_KEY_LENGTH=64,t.SEED_LENGTH=32;function n(q){const G=new Float64Array(16);if(q)for(let Y=0;Y<q.length;Y++)G[Y]=q[Y];return G}const s=new Uint8Array(32);s[0]=9;const a=n(),u=n([1]),l=n([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),d=n([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),b=n([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),w=n([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),I=n([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function S(q,G){for(let Y=0;Y<16;Y++)q[Y]=G[Y]|0}function D(q){let G=1;for(let Y=0;Y<16;Y++){let A=q[Y]+G+65535;G=Math.floor(A/65536),q[Y]=A-G*65536}q[0]+=G-1+37*(G-1)}function L(q,G,Y){const A=~(Y-1);for(let V=0;V<16;V++){const oe=A&(q[V]^G[V]);q[V]^=oe,G[V]^=oe}}function K(q,G){const Y=n(),A=n();for(let V=0;V<16;V++)A[V]=G[V];D(A),D(A),D(A);for(let V=0;V<2;V++){Y[0]=A[0]-65517;for(let ue=1;ue<15;ue++)Y[ue]=A[ue]-65535-(Y[ue-1]>>16&1),Y[ue-1]&=65535;Y[15]=A[15]-32767-(Y[14]>>16&1);const oe=Y[15]>>16&1;Y[14]&=65535,L(A,Y,1-oe)}for(let V=0;V<16;V++)q[2*V]=A[V]&255,q[2*V+1]=A[V]>>8}function H(q,G){let Y=0;for(let A=0;A<32;A++)Y|=q[A]^G[A];return(1&Y-1>>>8)-1}function U(q,G){const Y=new Uint8Array(32),A=new Uint8Array(32);return K(Y,q),K(A,G),H(Y,A)}function W(q){const G=new Uint8Array(32);return K(G,q),G[0]&1}function R(q,G){for(let Y=0;Y<16;Y++)q[Y]=G[2*Y]+(G[2*Y+1]<<8);q[15]&=32767}function k(q,G,Y){for(let A=0;A<16;A++)q[A]=G[A]+Y[A]}function z(q,G,Y){for(let A=0;A<16;A++)q[A]=G[A]-Y[A]}function _(q,G,Y){let A,V,oe=0,ue=0,he=0,ye=0,we=0,Re=0,Xe=0,Oe=0,Ne=0,Me=0,be=0,Pe=0,Te=0,ve=0,$e=0,xe=0,me=0,Ue=0,Ce=0,_e=0,Ke=0,Ve=0,Ae=0,We=0,pt=0,Ge=0,It=0,gt=0,Je=0,Ot=0,Tt=0,Le=Y[0],et=Y[1],it=Y[2],Be=Y[3],rt=Y[4],tt=Y[5],je=Y[6],ht=Y[7],nt=Y[8],qe=Y[9],st=Y[10],at=Y[11],Fe=Y[12],Ze=Y[13],lt=Y[14],ze=Y[15];A=G[0],oe+=A*Le,ue+=A*et,he+=A*it,ye+=A*Be,we+=A*rt,Re+=A*tt,Xe+=A*je,Oe+=A*ht,Ne+=A*nt,Me+=A*qe,be+=A*st,Pe+=A*at,Te+=A*Fe,ve+=A*Ze,$e+=A*lt,xe+=A*ze,A=G[1],ue+=A*Le,he+=A*et,ye+=A*it,we+=A*Be,Re+=A*rt,Xe+=A*tt,Oe+=A*je,Ne+=A*ht,Me+=A*nt,be+=A*qe,Pe+=A*st,Te+=A*at,ve+=A*Fe,$e+=A*Ze,xe+=A*lt,me+=A*ze,A=G[2],he+=A*Le,ye+=A*et,we+=A*it,Re+=A*Be,Xe+=A*rt,Oe+=A*tt,Ne+=A*je,Me+=A*ht,be+=A*nt,Pe+=A*qe,Te+=A*st,ve+=A*at,$e+=A*Fe,xe+=A*Ze,me+=A*lt,Ue+=A*ze,A=G[3],ye+=A*Le,we+=A*et,Re+=A*it,Xe+=A*Be,Oe+=A*rt,Ne+=A*tt,Me+=A*je,be+=A*ht,Pe+=A*nt,Te+=A*qe,ve+=A*st,$e+=A*at,xe+=A*Fe,me+=A*Ze,Ue+=A*lt,Ce+=A*ze,A=G[4],we+=A*Le,Re+=A*et,Xe+=A*it,Oe+=A*Be,Ne+=A*rt,Me+=A*tt,be+=A*je,Pe+=A*ht,Te+=A*nt,ve+=A*qe,$e+=A*st,xe+=A*at,me+=A*Fe,Ue+=A*Ze,Ce+=A*lt,_e+=A*ze,A=G[5],Re+=A*Le,Xe+=A*et,Oe+=A*it,Ne+=A*Be,Me+=A*rt,be+=A*tt,Pe+=A*je,Te+=A*ht,ve+=A*nt,$e+=A*qe,xe+=A*st,me+=A*at,Ue+=A*Fe,Ce+=A*Ze,_e+=A*lt,Ke+=A*ze,A=G[6],Xe+=A*Le,Oe+=A*et,Ne+=A*it,Me+=A*Be,be+=A*rt,Pe+=A*tt,Te+=A*je,ve+=A*ht,$e+=A*nt,xe+=A*qe,me+=A*st,Ue+=A*at,Ce+=A*Fe,_e+=A*Ze,Ke+=A*lt,Ve+=A*ze,A=G[7],Oe+=A*Le,Ne+=A*et,Me+=A*it,be+=A*Be,Pe+=A*rt,Te+=A*tt,ve+=A*je,$e+=A*ht,xe+=A*nt,me+=A*qe,Ue+=A*st,Ce+=A*at,_e+=A*Fe,Ke+=A*Ze,Ve+=A*lt,Ae+=A*ze,A=G[8],Ne+=A*Le,Me+=A*et,be+=A*it,Pe+=A*Be,Te+=A*rt,ve+=A*tt,$e+=A*je,xe+=A*ht,me+=A*nt,Ue+=A*qe,Ce+=A*st,_e+=A*at,Ke+=A*Fe,Ve+=A*Ze,Ae+=A*lt,We+=A*ze,A=G[9],Me+=A*Le,be+=A*et,Pe+=A*it,Te+=A*Be,ve+=A*rt,$e+=A*tt,xe+=A*je,me+=A*ht,Ue+=A*nt,Ce+=A*qe,_e+=A*st,Ke+=A*at,Ve+=A*Fe,Ae+=A*Ze,We+=A*lt,pt+=A*ze,A=G[10],be+=A*Le,Pe+=A*et,Te+=A*it,ve+=A*Be,$e+=A*rt,xe+=A*tt,me+=A*je,Ue+=A*ht,Ce+=A*nt,_e+=A*qe,Ke+=A*st,Ve+=A*at,Ae+=A*Fe,We+=A*Ze,pt+=A*lt,Ge+=A*ze,A=G[11],Pe+=A*Le,Te+=A*et,ve+=A*it,$e+=A*Be,xe+=A*rt,me+=A*tt,Ue+=A*je,Ce+=A*ht,_e+=A*nt,Ke+=A*qe,Ve+=A*st,Ae+=A*at,We+=A*Fe,pt+=A*Ze,Ge+=A*lt,It+=A*ze,A=G[12],Te+=A*Le,ve+=A*et,$e+=A*it,xe+=A*Be,me+=A*rt,Ue+=A*tt,Ce+=A*je,_e+=A*ht,Ke+=A*nt,Ve+=A*qe,Ae+=A*st,We+=A*at,pt+=A*Fe,Ge+=A*Ze,It+=A*lt,gt+=A*ze,A=G[13],ve+=A*Le,$e+=A*et,xe+=A*it,me+=A*Be,Ue+=A*rt,Ce+=A*tt,_e+=A*je,Ke+=A*ht,Ve+=A*nt,Ae+=A*qe,We+=A*st,pt+=A*at,Ge+=A*Fe,It+=A*Ze,gt+=A*lt,Je+=A*ze,A=G[14],$e+=A*Le,xe+=A*et,me+=A*it,Ue+=A*Be,Ce+=A*rt,_e+=A*tt,Ke+=A*je,Ve+=A*ht,Ae+=A*nt,We+=A*qe,pt+=A*st,Ge+=A*at,It+=A*Fe,gt+=A*Ze,Je+=A*lt,Ot+=A*ze,A=G[15],xe+=A*Le,me+=A*et,Ue+=A*it,Ce+=A*Be,_e+=A*rt,Ke+=A*tt,Ve+=A*je,Ae+=A*ht,We+=A*nt,pt+=A*qe,Ge+=A*st,It+=A*at,gt+=A*Fe,Je+=A*Ze,Ot+=A*lt,Tt+=A*ze,oe+=38*me,ue+=38*Ue,he+=38*Ce,ye+=38*_e,we+=38*Ke,Re+=38*Ve,Xe+=38*Ae,Oe+=38*We,Ne+=38*pt,Me+=38*Ge,be+=38*It,Pe+=38*gt,Te+=38*Je,ve+=38*Ot,$e+=38*Tt,V=1,A=oe+V+65535,V=Math.floor(A/65536),oe=A-V*65536,A=ue+V+65535,V=Math.floor(A/65536),ue=A-V*65536,A=he+V+65535,V=Math.floor(A/65536),he=A-V*65536,A=ye+V+65535,V=Math.floor(A/65536),ye=A-V*65536,A=we+V+65535,V=Math.floor(A/65536),we=A-V*65536,A=Re+V+65535,V=Math.floor(A/65536),Re=A-V*65536,A=Xe+V+65535,V=Math.floor(A/65536),Xe=A-V*65536,A=Oe+V+65535,V=Math.floor(A/65536),Oe=A-V*65536,A=Ne+V+65535,V=Math.floor(A/65536),Ne=A-V*65536,A=Me+V+65535,V=Math.floor(A/65536),Me=A-V*65536,A=be+V+65535,V=Math.floor(A/65536),be=A-V*65536,A=Pe+V+65535,V=Math.floor(A/65536),Pe=A-V*65536,A=Te+V+65535,V=Math.floor(A/65536),Te=A-V*65536,A=ve+V+65535,V=Math.floor(A/65536),ve=A-V*65536,A=$e+V+65535,V=Math.floor(A/65536),$e=A-V*65536,A=xe+V+65535,V=Math.floor(A/65536),xe=A-V*65536,oe+=V-1+37*(V-1),V=1,A=oe+V+65535,V=Math.floor(A/65536),oe=A-V*65536,A=ue+V+65535,V=Math.floor(A/65536),ue=A-V*65536,A=he+V+65535,V=Math.floor(A/65536),he=A-V*65536,A=ye+V+65535,V=Math.floor(A/65536),ye=A-V*65536,A=we+V+65535,V=Math.floor(A/65536),we=A-V*65536,A=Re+V+65535,V=Math.floor(A/65536),Re=A-V*65536,A=Xe+V+65535,V=Math.floor(A/65536),Xe=A-V*65536,A=Oe+V+65535,V=Math.floor(A/65536),Oe=A-V*65536,A=Ne+V+65535,V=Math.floor(A/65536),Ne=A-V*65536,A=Me+V+65535,V=Math.floor(A/65536),Me=A-V*65536,A=be+V+65535,V=Math.floor(A/65536),be=A-V*65536,A=Pe+V+65535,V=Math.floor(A/65536),Pe=A-V*65536,A=Te+V+65535,V=Math.floor(A/65536),Te=A-V*65536,A=ve+V+65535,V=Math.floor(A/65536),ve=A-V*65536,A=$e+V+65535,V=Math.floor(A/65536),$e=A-V*65536,A=xe+V+65535,V=Math.floor(A/65536),xe=A-V*65536,oe+=V-1+37*(V-1),q[0]=oe,q[1]=ue,q[2]=he,q[3]=ye,q[4]=we,q[5]=Re,q[6]=Xe,q[7]=Oe,q[8]=Ne,q[9]=Me,q[10]=be,q[11]=Pe,q[12]=Te,q[13]=ve,q[14]=$e,q[15]=xe}function B(q,G){_(q,G,G)}function X(q,G){const Y=n();let A;for(A=0;A<16;A++)Y[A]=G[A];for(A=253;A>=0;A--)B(Y,Y),A!==2&&A!==4&&_(Y,Y,G);for(A=0;A<16;A++)q[A]=Y[A]}function re(q,G){const Y=n();let A;for(A=0;A<16;A++)Y[A]=G[A];for(A=250;A>=0;A--)B(Y,Y),A!==1&&_(Y,Y,G);for(A=0;A<16;A++)q[A]=Y[A]}function T(q,G){const Y=n(),A=n(),V=n(),oe=n(),ue=n(),he=n(),ye=n(),we=n(),Re=n();z(Y,q[1],q[0]),z(Re,G[1],G[0]),_(Y,Y,Re),k(A,q[0],q[1]),k(Re,G[0],G[1]),_(A,A,Re),_(V,q[3],G[3]),_(V,V,d),_(oe,q[2],G[2]),k(oe,oe,oe),z(ue,A,Y),z(he,oe,V),k(ye,oe,V),k(we,A,Y),_(q[0],ue,he),_(q[1],we,ye),_(q[2],ye,he),_(q[3],ue,we)}function y(q,G,Y){for(let A=0;A<4;A++)L(q[A],G[A],Y)}function f(q,G){const Y=n(),A=n(),V=n();X(V,G[2]),_(Y,G[0],V),_(A,G[1],V),K(q,A),q[31]^=W(Y)<<7}function h(q,G,Y){S(q[0],a),S(q[1],u),S(q[2],u),S(q[3],a);for(let A=255;A>=0;--A){const V=Y[A/8|0]>>(A&7)&1;y(q,G,V),T(G,q),T(q,q),y(q,G,V)}}function v(q,G){const Y=[n(),n(),n(),n()];S(Y[0],b),S(Y[1],w),S(Y[2],u),_(Y[3],b,w),h(q,Y,G)}function E(q){if(q.length!==t.SEED_LENGTH)throw new Error(`ed25519: seed must be ${t.SEED_LENGTH} bytes`);const G=(0,r.hash)(q);G[0]&=248,G[31]&=127,G[31]|=64;const Y=new Uint8Array(32),A=[n(),n(),n(),n()];v(A,G),f(Y,A);const V=new Uint8Array(64);return V.set(q),V.set(Y,32),{publicKey:Y,secretKey:V}}t.generateKeyPairFromSeed=E;function C(q){const G=(0,e.randomBytes)(32,q),Y=E(G);return(0,i.wipe)(G),Y}t.generateKeyPair=C;function P(q){if(q.length!==t.SECRET_KEY_LENGTH)throw new Error(`ed25519: secret key must be ${t.SECRET_KEY_LENGTH} bytes`);return new Uint8Array(q.subarray(32))}t.extractPublicKeyFromSecretKey=P;const M=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function g(q,G){let Y,A,V,oe;for(A=63;A>=32;--A){for(Y=0,V=A-32,oe=A-12;V<oe;++V)G[V]+=Y-16*G[A]*M[V-(A-32)],Y=Math.floor((G[V]+128)/256),G[V]-=Y*256;G[V]+=Y,G[A]=0}for(Y=0,V=0;V<32;V++)G[V]+=Y-(G[31]>>4)*M[V],Y=G[V]>>8,G[V]&=255;for(V=0;V<32;V++)G[V]-=Y*M[V];for(A=0;A<32;A++)G[A+1]+=G[A]>>8,q[A]=G[A]&255}function m(q){const G=new Float64Array(64);for(let Y=0;Y<64;Y++)G[Y]=q[Y];for(let Y=0;Y<64;Y++)q[Y]=0;g(q,G)}function N(q,G){const Y=new Float64Array(64),A=[n(),n(),n(),n()],V=(0,r.hash)(q.subarray(0,32));V[0]&=248,V[31]&=127,V[31]|=64;const oe=new Uint8Array(64);oe.set(V.subarray(32),32);const ue=new r.SHA512;ue.update(oe.subarray(32)),ue.update(G);const he=ue.digest();ue.clean(),m(he),v(A,he),f(oe,A),ue.reset(),ue.update(oe.subarray(0,32)),ue.update(q.subarray(32)),ue.update(G);const ye=ue.digest();m(ye);for(let we=0;we<32;we++)Y[we]=he[we];for(let we=0;we<32;we++)for(let Re=0;Re<32;Re++)Y[we+Re]+=ye[we]*V[Re];return g(oe.subarray(32),Y),oe}t.sign=N;function ee(q,G){const Y=n(),A=n(),V=n(),oe=n(),ue=n(),he=n(),ye=n();return S(q[2],u),R(q[1],G),B(V,q[1]),_(oe,V,l),z(V,V,q[2]),k(oe,q[2],oe),B(ue,oe),B(he,ue),_(ye,he,ue),_(Y,ye,V),_(Y,Y,oe),re(Y,Y),_(Y,Y,V),_(Y,Y,oe),_(Y,Y,oe),_(q[0],Y,oe),B(A,q[0]),_(A,A,oe),U(A,V)&&_(q[0],q[0],I),B(A,q[0]),_(A,A,oe),U(A,V)?-1:(W(q[0])===G[31]>>7&&z(q[0],a,q[0]),_(q[3],q[0],q[1]),0)}function ae(q,G,Y){const A=new Uint8Array(32),V=[n(),n(),n(),n()],oe=[n(),n(),n(),n()];if(Y.length!==t.SIGNATURE_LENGTH)throw new Error(`ed25519: signature must be ${t.SIGNATURE_LENGTH} bytes`);if(ee(oe,q))return!1;const ue=new r.SHA512;ue.update(Y.subarray(0,32)),ue.update(q),ue.update(G);const he=ue.digest();return m(he),h(V,oe,he),v(oe,Y.subarray(32)),T(V,oe),f(A,V),!H(Y,A)}t.verify=ae;function O(q){let G=[n(),n(),n(),n()];if(ee(G,q))throw new Error("Ed25519: invalid public key");let Y=n(),A=n(),V=G[1];k(Y,u,V),z(A,u,V),X(A,A),_(Y,Y,A);let oe=new Uint8Array(32);return K(oe,Y),oe}t.convertPublicKeyToX25519=O;function te(q){const G=(0,r.hash)(q.subarray(0,32));G[0]&=248,G[31]&=127,G[31]|=64;const Y=new Uint8Array(G.subarray(0,32));return(0,i.wipe)(G),Y}t.convertSecretKeyToX25519=te}(Y0);const pE="EdDSA",gE="JWT",Kf=".",Wf="base64url",Av="utf8",xv="utf8",vE=":",mE="did",bE="key",Sv="base58btc",yE="z",wE="K36",_E=32;function J0(t){return globalThis.Buffer!=null?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t}function Iv(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?J0(globalThis.Buffer.allocUnsafe(t)):new Uint8Array(t)}function EE(t,e){e||(e=t.reduce((n,s)=>n+s.length,0));const r=Iv(e);let i=0;for(const n of t)r.set(n,i),i+=n.length;return J0(r)}function Mv(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Cv=Mv("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Q0=Mv("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=Iv(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),Dv={utf8:Cv,"utf-8":Cv,hex:Ca.base16,latin1:Q0,ascii:Q0,binary:Q0,...Ca};function Vf(t,e="utf8"){const r=Dv[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}function ja(t,e="utf8"){const r=Dv[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?J0(globalThis.Buffer.from(t,"utf-8")):r.decoder.decode(`${r.prefix}${t}`)}const AE=t=>JSON.stringify(t,(e,r)=>typeof r=="bigint"?r.toString()+"n":r),xE=t=>{const e=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,r=t.replace(e,'$1"$2n"$3');return JSON.parse(r,(i,n)=>typeof n=="string"&&n.match(/^\d+n$/)?BigInt(n.substring(0,n.length-1)):n)};function qa(t){if(typeof t!="string")throw new Error(`Cannot safe json parse value of type ${typeof t}`);try{return xE(t)}catch{return t}}function Is(t){return typeof t=="string"?t:AE(t)||""}function Ov(t){return qa(Vf(ja(t,Wf),Av))}function Gf(t){return Vf(ja(Is(t),Av),Wf)}function Pv(t){const e=ja(wE,Sv),r=yE+Vf(EE([e,t]),Sv);return[mE,bE,r].join(vE)}function SE(t){return Vf(t,Wf)}function IE(t){return ja(t,Wf)}function ME(t){return ja([Gf(t.header),Gf(t.payload)].join(Kf),xv)}function CE(t){return[Gf(t.header),Gf(t.payload),SE(t.signature)].join(Kf)}function Z0(t){const e=t.split(Kf),r=Ov(e[0]),i=Ov(e[1]),n=IE(e[2]),s=ja(e.slice(0,2).join(Kf),xv);return{header:r,payload:i,signature:n,data:s}}function $v(t=Ma.randomBytes(_E)){return Y0.generateKeyPairFromSeed(t)}async function DE(t,e,r,i,n=Ie.fromMiliseconds(Date.now())){const s={alg:pE,typ:gE},a=Pv(i.publicKey),u=n+r,l={iss:a,sub:t,aud:e,iat:n,exp:u},d=ME({header:s,payload:l}),b=Y0.sign(i.secretKey,d);return CE({header:s,payload:l,signature:b})}const OE={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}},PE=":";function ru(t){const[e,r]=t.split(PE);return{namespace:e,reference:r}}function Rv(t,e=[]){const r=[];return Object.keys(t).forEach(i=>{if(e.length&&!e.includes(i))return;const n=t[i];r.push(...n.accounts)}),r}function Nv(t,e){return t.includes(":")?[t]:e.chains||[]}var $E=Object.defineProperty,Tv=Object.getOwnPropertySymbols,RE=Object.prototype.hasOwnProperty,NE=Object.prototype.propertyIsEnumerable,Lv=(t,e,r)=>e in t?$E(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Bv=(t,e)=>{for(var r in e||(e={}))RE.call(e,r)&&Lv(t,r,e[r]);if(Tv)for(var r of Tv(e))NE.call(e,r)&&Lv(t,r,e[r]);return t};const TE="ReactNative",Ti={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},LE="js";function iu(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}function nu(){return!Ef()&&!!b0()&&navigator.product===TE}function su(){return!iu()&&!!b0()&&!!Ef()}function ou(){return nu()?Ti.reactNative:iu()?Ti.node:su()?Ti.browser:Ti.unknown}function BE(){var t;try{return nu()&&typeof global<"u"&&typeof(global==null?void 0:global.Application)<"u"?(t=global.Application)==null?void 0:t.applicationId:void 0}catch{return}}function FE(t,e){let r=Gc.parse(t);return r=Bv(Bv({},r),e),t=Gc.stringify(r),t}function UE(){return r2()||{name:"",description:"",url:"",icons:[""]}}function kE(){if(ou()===Ti.reactNative&&typeof global<"u"&&typeof(global==null?void 0:global.Platform)<"u"){const{OS:r,Version:i}=global.Platform;return[r,i].join("-")}const t=Gw();if(t===null)return"unknown";const e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return t.type==="browser"?[e,t.name,t.version].join("-"):[e,t.version].join("-")}function jE(){var t;const e=ou();return e===Ti.browser?[e,((t=t2())==null?void 0:t.host)||"unknown"].join(":"):e}function qE(t,e,r){const i=kE(),n=jE();return[[t,e].join("-"),[LE,r].join("-"),i,n].join("/")}function zE({protocol:t,version:e,relayUrl:r,sdkVersion:i,auth:n,projectId:s,useOnCloseEvent:a,bundleId:u}){const l=r.split("?"),d=qE(t,e,i),b={auth:n,ua:d,projectId:s,useOnCloseEvent:a||void 0,origin:u||void 0},w=FE(l[1]||"",b);return l[0]+"?"+w}function Bo(t,e){return t.filter(r=>e.includes(r)).length===t.length}function Fv(t){return Object.fromEntries(t.entries())}function Uv(t){return new Map(Object.entries(t))}function Fo(t=Ie.FIVE_MINUTES,e){const r=Ie.toMiliseconds(t||Ie.FIVE_MINUTES);let i,n,s;return{resolve:a=>{s&&i&&(clearTimeout(s),i(a))},reject:a=>{s&&n&&(clearTimeout(s),n(a))},done:()=>new Promise((a,u)=>{s=setTimeout(()=>{u(new Error(e))},r),i=a,n=u})}}function za(t,e,r){return new Promise(async(i,n)=>{const s=setTimeout(()=>n(new Error(r)),e);try{const a=await t;i(a)}catch(a){n(a)}clearTimeout(s)})}function kv(t,e){if(typeof e=="string"&&e.startsWith(`${t}:`))return e;if(t.toLowerCase()==="topic"){if(typeof e!="string")throw new Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}else if(t.toLowerCase()==="id"){if(typeof e!="number")throw new Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw new Error(`Unknown expirer target type: ${t}`)}function HE(t){return kv("topic",t)}function KE(t){return kv("id",t)}function jv(t){const[e,r]=t.split(":"),i={id:void 0,topic:void 0};if(e==="topic"&&typeof r=="string")i.topic=r;else if(e==="id"&&Number.isInteger(Number(r)))i.id=Number(r);else throw new Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}function kr(t,e){return Ie.fromMiliseconds((e||Date.now())+Ie.toMiliseconds(t))}function eo(t){return Date.now()>=Ie.toMiliseconds(t)}function Dt(t,e){return`${t}${e?`:${e}`:""}`}function Yf(t=[],e=[]){return[...new Set([...t,...e])]}async function WE({id:t,topic:e,wcDeepLink:r}){var i;try{if(!r)return;const n=typeof r=="string"?JSON.parse(r):r;let s=n?.href;if(typeof s!="string")return;s.endsWith("/")&&(s=s.slice(0,-1));const a=`${s}/wc?requestId=${t}&sessionTopic=${e}`,u=ou();if(u===Ti.browser){if(!((i=Ef())!=null&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}a.startsWith("https://")||a.startsWith("http://")?window.open(a,"_blank","noreferrer noopener"):window.open(a,"_self","noreferrer noopener")}else u===Ti.reactNative&&typeof(global==null?void 0:global.Linking)<"u"&&await global.Linking.openURL(a)}catch(n){console.error(n)}}async function VE(t,e){try{return await t.getItem(e)||(su()?localStorage.getItem(e):void 0)}catch(r){console.error(r)}}function GE(){return typeof crypto<"u"&&crypto!=null&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}var qv=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function YE(t){var e=t.default;if(typeof e=="function"){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(i){var n=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,n.get?n:{enumerable:!0,get:function(){return t[i]}})}),r}var zv={exports:{}};/**
15
15
  * [js-sha3]{@link https://github.com/emn178/js-sha3}
16
16
  *
17
17
  * @version 0.8.0
18
18
  * @author Chen, Yi-Cyuan [emn178@gmail.com]
19
19
  * @copyright Chen, Yi-Cyuan 2015-2018
20
20
  * @license MIT
21
- */(function(t){(function(){var e="input is invalid type",r="finalize already called",i=typeof window=="object",n=i?window:{};n.JS_SHA3_NO_WINDOW&&(i=!1);var s=!i&&typeof self=="object",a=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;a?n=qv:s&&(n=self);var u=!n.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),b=[31,7936,2031616,520093696],w=[4,1024,262144,67108864],S=[1,256,65536,16777216],I=[6,1536,393216,100663296],D=[0,8,16,24],L=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],K=[224,256,384,512],H=[128,256],U=["hex","buffer","arrayBuffer","array","digest"],W={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(O){return Object.prototype.toString.call(O)==="[object Array]"}),l&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(O){return typeof O=="object"&&O.buffer&&O.buffer.constructor===ArrayBuffer});for(var R=function(O,te,q){return function(G){return new N(O,te,O).update(G)[q]()}},k=function(O,te,q){return function(G,Y){return new N(O,te,Y).update(G)[q]()}},z=function(O,te,q){return function(G,Y,A,V){return h["cshake"+O].update(G,Y,A,V)[q]()}},_=function(O,te,q){return function(G,Y,A,V){return h["kmac"+O].update(G,Y,A,V)[q]()}},B=function(O,te,q,G){for(var Y=0;Y<U.length;++Y){var A=U[Y];O[A]=te(q,G,A)}return O},X=function(O,te){var q=R(O,te,"hex");return q.create=function(){return new N(O,te,O)},q.update=function(G){return q.create().update(G)},B(q,R,O,te)},re=function(O,te){var q=k(O,te,"hex");return q.create=function(G){return new N(O,te,G)},q.update=function(G,Y){return q.create(Y).update(G)},B(q,k,O,te)},T=function(O,te){var q=W[O],G=z(O,te,"hex");return G.create=function(Y,A,V){return!A&&!V?h["shake"+O].create(Y):new N(O,te,Y).bytepad([A,V],q)},G.update=function(Y,A,V,oe){return G.create(A,V,oe).update(Y)},B(G,z,O,te)},y=function(O,te){var q=W[O],G=_(O,te,"hex");return G.create=function(Y,A,V){return new ee(O,te,A).bytepad(["KMAC",V],q).bytepad([Y],q)},G.update=function(Y,A,V,oe){return G.create(Y,V,oe).update(A)},B(G,_,O,te)},f=[{name:"keccak",padding:S,bits:K,createMethod:X},{name:"sha3",padding:I,bits:K,createMethod:X},{name:"shake",padding:b,bits:H,createMethod:re},{name:"cshake",padding:w,bits:H,createMethod:T},{name:"kmac",padding:w,bits:H,createMethod:y}],h={},v=[],E=0;E<f.length;++E)for(var C=f[E],P=C.bits,M=0;M<P.length;++M){var g=C.name+"_"+P[M];if(v.push(g),h[g]=C.createMethod(P[M],C.padding),C.name!=="sha3"){var m=C.name+P[M];v.push(m),h[m]=h[g]}}function N(O,te,q){this.blocks=[],this.s=[],this.padding=te,this.outputBits=q,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(O<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=q>>5,this.extraBytes=(q&31)>>3;for(var G=0;G<50;++G)this.s[G]=0}N.prototype.update=function(O){if(this.finalized)throw new Error(r);var te,q=typeof O;if(q!=="string"){if(q==="object"){if(O===null)throw new Error(e);if(l&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!l||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);te=!0}for(var G=this.blocks,Y=this.byteCount,A=O.length,V=this.blockCount,oe=0,ue=this.s,he,ye;oe<A;){if(this.reset)for(this.reset=!1,G[0]=this.block,he=1;he<V+1;++he)G[he]=0;if(te)for(he=this.start;oe<A&&he<Y;++oe)G[he>>2]|=O[oe]<<D[he++&3];else for(he=this.start;oe<A&&he<Y;++oe)ye=O.charCodeAt(oe),ye<128?G[he>>2]|=ye<<D[he++&3]:ye<2048?(G[he>>2]|=(192|ye>>6)<<D[he++&3],G[he>>2]|=(128|ye&63)<<D[he++&3]):ye<55296||ye>=57344?(G[he>>2]|=(224|ye>>12)<<D[he++&3],G[he>>2]|=(128|ye>>6&63)<<D[he++&3],G[he>>2]|=(128|ye&63)<<D[he++&3]):(ye=65536+((ye&1023)<<10|O.charCodeAt(++oe)&1023),G[he>>2]|=(240|ye>>18)<<D[he++&3],G[he>>2]|=(128|ye>>12&63)<<D[he++&3],G[he>>2]|=(128|ye>>6&63)<<D[he++&3],G[he>>2]|=(128|ye&63)<<D[he++&3]);if(this.lastByteIndex=he,he>=Y){for(this.start=he-Y,this.block=G[V],he=0;he<V;++he)ue[he]^=G[he];ae(ue),this.reset=!0}else this.start=he}return this},N.prototype.encode=function(O,te){var q=O&255,G=1,Y=[q];for(O=O>>8,q=O&255;q>0;)Y.unshift(q),O=O>>8,q=O&255,++G;return te?Y.push(G):Y.unshift(G),this.update(Y),Y.length},N.prototype.encodeString=function(O){var te,q=typeof O;if(q!=="string"){if(q==="object"){if(O===null)throw new Error(e);if(l&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!l||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);te=!0}var G=0,Y=O.length;if(te)G=Y;else for(var A=0;A<O.length;++A){var V=O.charCodeAt(A);V<128?G+=1:V<2048?G+=2:V<55296||V>=57344?G+=3:(V=65536+((V&1023)<<10|O.charCodeAt(++A)&1023),G+=4)}return G+=this.encode(G*8),this.update(O),G},N.prototype.bytepad=function(O,te){for(var q=this.encode(te),G=0;G<O.length;++G)q+=this.encodeString(O[G]);var Y=te-q%te,A=[];return A.length=Y,this.update(A),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var O=this.blocks,te=this.lastByteIndex,q=this.blockCount,G=this.s;if(O[te>>2]|=this.padding[te&3],this.lastByteIndex===this.byteCount)for(O[0]=O[q],te=1;te<q+1;++te)O[te]=0;for(O[q-1]|=2147483648,te=0;te<q;++te)G[te]^=O[te];ae(G)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var O=this.blockCount,te=this.s,q=this.outputBlocks,G=this.extraBytes,Y=0,A=0,V="",oe;A<q;){for(Y=0;Y<O&&A<q;++Y,++A)oe=te[Y],V+=d[oe>>4&15]+d[oe&15]+d[oe>>12&15]+d[oe>>8&15]+d[oe>>20&15]+d[oe>>16&15]+d[oe>>28&15]+d[oe>>24&15];A%O===0&&(ae(te),Y=0)}return G&&(oe=te[Y],V+=d[oe>>4&15]+d[oe&15],G>1&&(V+=d[oe>>12&15]+d[oe>>8&15]),G>2&&(V+=d[oe>>20&15]+d[oe>>16&15])),V},N.prototype.arrayBuffer=function(){this.finalize();var O=this.blockCount,te=this.s,q=this.outputBlocks,G=this.extraBytes,Y=0,A=0,V=this.outputBits>>3,oe;G?oe=new ArrayBuffer(q+1<<2):oe=new ArrayBuffer(V);for(var ue=new Uint32Array(oe);A<q;){for(Y=0;Y<O&&A<q;++Y,++A)ue[A]=te[Y];A%O===0&&ae(te)}return G&&(ue[Y]=te[Y],oe=oe.slice(0,V)),oe},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var O=this.blockCount,te=this.s,q=this.outputBlocks,G=this.extraBytes,Y=0,A=0,V=[],oe,ue;A<q;){for(Y=0;Y<O&&A<q;++Y,++A)oe=A<<2,ue=te[Y],V[oe]=ue&255,V[oe+1]=ue>>8&255,V[oe+2]=ue>>16&255,V[oe+3]=ue>>24&255;A%O===0&&ae(te)}return G&&(oe=A<<2,ue=te[Y],V[oe]=ue&255,G>1&&(V[oe+1]=ue>>8&255),G>2&&(V[oe+2]=ue>>16&255)),V};function ee(O,te,q){N.call(this,O,te,q)}ee.prototype=new N,ee.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var ae=function(O){var te,q,G,Y,A,V,oe,ue,he,ye,we,Re,Xe,Oe,Ne,Me,be,Pe,Te,ve,$e,xe,me,Ue,Ce,_e,Ke,Ve,Ae,We,pt,Ge,It,gt,Je,Ot,Tt,Le,et,it,Be,rt,tt,je,ht,nt,qe,st,at,Fe,Ze,lt,ze,jt,qt,ct,_t,Qr,Zr,Xr,ei,ti,pr;for(G=0;G<48;G+=2)Y=O[0]^O[10]^O[20]^O[30]^O[40],A=O[1]^O[11]^O[21]^O[31]^O[41],V=O[2]^O[12]^O[22]^O[32]^O[42],oe=O[3]^O[13]^O[23]^O[33]^O[43],ue=O[4]^O[14]^O[24]^O[34]^O[44],he=O[5]^O[15]^O[25]^O[35]^O[45],ye=O[6]^O[16]^O[26]^O[36]^O[46],we=O[7]^O[17]^O[27]^O[37]^O[47],Re=O[8]^O[18]^O[28]^O[38]^O[48],Xe=O[9]^O[19]^O[29]^O[39]^O[49],te=Re^(V<<1|oe>>>31),q=Xe^(oe<<1|V>>>31),O[0]^=te,O[1]^=q,O[10]^=te,O[11]^=q,O[20]^=te,O[21]^=q,O[30]^=te,O[31]^=q,O[40]^=te,O[41]^=q,te=Y^(ue<<1|he>>>31),q=A^(he<<1|ue>>>31),O[2]^=te,O[3]^=q,O[12]^=te,O[13]^=q,O[22]^=te,O[23]^=q,O[32]^=te,O[33]^=q,O[42]^=te,O[43]^=q,te=V^(ye<<1|we>>>31),q=oe^(we<<1|ye>>>31),O[4]^=te,O[5]^=q,O[14]^=te,O[15]^=q,O[24]^=te,O[25]^=q,O[34]^=te,O[35]^=q,O[44]^=te,O[45]^=q,te=ue^(Re<<1|Xe>>>31),q=he^(Xe<<1|Re>>>31),O[6]^=te,O[7]^=q,O[16]^=te,O[17]^=q,O[26]^=te,O[27]^=q,O[36]^=te,O[37]^=q,O[46]^=te,O[47]^=q,te=ye^(Y<<1|A>>>31),q=we^(A<<1|Y>>>31),O[8]^=te,O[9]^=q,O[18]^=te,O[19]^=q,O[28]^=te,O[29]^=q,O[38]^=te,O[39]^=q,O[48]^=te,O[49]^=q,Oe=O[0],Ne=O[1],nt=O[11]<<4|O[10]>>>28,qe=O[10]<<4|O[11]>>>28,Ve=O[20]<<3|O[21]>>>29,Ae=O[21]<<3|O[20]>>>29,Xr=O[31]<<9|O[30]>>>23,ei=O[30]<<9|O[31]>>>23,rt=O[40]<<18|O[41]>>>14,tt=O[41]<<18|O[40]>>>14,gt=O[2]<<1|O[3]>>>31,Je=O[3]<<1|O[2]>>>31,Me=O[13]<<12|O[12]>>>20,be=O[12]<<12|O[13]>>>20,st=O[22]<<10|O[23]>>>22,at=O[23]<<10|O[22]>>>22,We=O[33]<<13|O[32]>>>19,pt=O[32]<<13|O[33]>>>19,ti=O[42]<<2|O[43]>>>30,pr=O[43]<<2|O[42]>>>30,jt=O[5]<<30|O[4]>>>2,qt=O[4]<<30|O[5]>>>2,Ot=O[14]<<6|O[15]>>>26,Tt=O[15]<<6|O[14]>>>26,Pe=O[25]<<11|O[24]>>>21,Te=O[24]<<11|O[25]>>>21,Fe=O[34]<<15|O[35]>>>17,Ze=O[35]<<15|O[34]>>>17,Ge=O[45]<<29|O[44]>>>3,It=O[44]<<29|O[45]>>>3,Ue=O[6]<<28|O[7]>>>4,Ce=O[7]<<28|O[6]>>>4,ct=O[17]<<23|O[16]>>>9,_t=O[16]<<23|O[17]>>>9,Le=O[26]<<25|O[27]>>>7,et=O[27]<<25|O[26]>>>7,ve=O[36]<<21|O[37]>>>11,$e=O[37]<<21|O[36]>>>11,lt=O[47]<<24|O[46]>>>8,ze=O[46]<<24|O[47]>>>8,je=O[8]<<27|O[9]>>>5,ht=O[9]<<27|O[8]>>>5,_e=O[18]<<20|O[19]>>>12,Ke=O[19]<<20|O[18]>>>12,Qr=O[29]<<7|O[28]>>>25,Zr=O[28]<<7|O[29]>>>25,it=O[38]<<8|O[39]>>>24,Be=O[39]<<8|O[38]>>>24,xe=O[48]<<14|O[49]>>>18,me=O[49]<<14|O[48]>>>18,O[0]=Oe^~Me&Pe,O[1]=Ne^~be&Te,O[10]=Ue^~_e&Ve,O[11]=Ce^~Ke&Ae,O[20]=gt^~Ot&Le,O[21]=Je^~Tt&et,O[30]=je^~nt&st,O[31]=ht^~qe&at,O[40]=jt^~ct&Qr,O[41]=qt^~_t&Zr,O[2]=Me^~Pe&ve,O[3]=be^~Te&$e,O[12]=_e^~Ve&We,O[13]=Ke^~Ae&pt,O[22]=Ot^~Le&it,O[23]=Tt^~et&Be,O[32]=nt^~st&Fe,O[33]=qe^~at&Ze,O[42]=ct^~Qr&Xr,O[43]=_t^~Zr&ei,O[4]=Pe^~ve&xe,O[5]=Te^~$e&me,O[14]=Ve^~We&Ge,O[15]=Ae^~pt&It,O[24]=Le^~it&rt,O[25]=et^~Be&tt,O[34]=st^~Fe&lt,O[35]=at^~Ze&ze,O[44]=Qr^~Xr&ti,O[45]=Zr^~ei&pr,O[6]=ve^~xe&Oe,O[7]=$e^~me&Ne,O[16]=We^~Ge&Ue,O[17]=pt^~It&Ce,O[26]=it^~rt&gt,O[27]=Be^~tt&Je,O[36]=Fe^~lt&je,O[37]=Ze^~ze&ht,O[46]=Xr^~ti&jt,O[47]=ei^~pr&qt,O[8]=xe^~Oe&Me,O[9]=me^~Ne&be,O[18]=Ge^~Ue&_e,O[19]=It^~Ce&Ke,O[28]=rt^~gt&Ot,O[29]=tt^~Je&Tt,O[38]=lt^~je&nt,O[39]=ze^~ht&qe,O[48]=ti^~jt&ct,O[49]=pr^~qt&_t,O[0]^=L[G],O[1]^=L[G+1]};if(u)t.exports=h;else for(E=0;E<v.length;++E)n[v[E]]=h[v[E]]})()})(zv);var ZE=zv.exports;const XE="logger/5.7.0";let Hv=!1,Kv=!1;const Yf={debug:1,default:2,info:2,warning:3,error:4,off:5};let Wv=Yf.default,X0=null;function eA(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const Vv=eA();var ed;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(ed||(ed={}));var yn;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(yn||(yn={}));const Gv="0123456789abcdef";class Et{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const i=e.toLowerCase();Yf[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Wv>Yf[i])&&console.log.apply(console,r)}debug(...e){this._log(Et.levels.DEBUG,e)}info(...e){this._log(Et.levels.INFO,e)}warn(...e){this._log(Et.levels.WARNING,e)}makeError(e,r,i){if(Kv)return this.makeError("censored error",r,{});r||(r=Et.errors.UNKNOWN_ERROR),i||(i={});const n=[];Object.keys(i).forEach(l=>{const d=i[l];try{if(d instanceof Uint8Array){let b="";for(let w=0;w<d.length;w++)b+=Gv[d[w]>>4],b+=Gv[d[w]&15];n.push(l+"=Uint8Array(0x"+b+")")}else n.push(l+"="+JSON.stringify(d))}catch{n.push(l+"="+JSON.stringify(i[l].toString()))}}),n.push(`code=${r}`),n.push(`version=${this.version}`);const s=e;let a="";switch(r){case yn.NUMERIC_FAULT:{a="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":a+="-"+l;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result";break}break}case yn.CALL_EXCEPTION:case yn.INSUFFICIENT_FUNDS:case yn.MISSING_NEW:case yn.NONCE_EXPIRED:case yn.REPLACEMENT_UNDERPRICED:case yn.TRANSACTION_REPLACED:case yn.UNPREDICTABLE_GAS_LIMIT:a=r;break}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const u=new Error(e);return u.reason=s,u.code=r,Object.keys(i).forEach(function(l){u[l]=i[l]}),u}throwError(e,r,i){throw this.makeError(e,r,i)}throwArgumentError(e,r,i){return this.throwError(e,Et.errors.INVALID_ARGUMENT,{argument:r,value:i})}assert(e,r,i,n){e||this.throwError(r,i,n)}assertArgument(e,r,i,n){e||this.throwArgumentError(r,i,n)}checkNormalize(e){Vv&&this.throwError("platform missing String.prototype.normalize",Et.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Vv})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,i){i?i=": "+i:i="",e<r&&this.throwError("missing argument"+i,Et.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+i,Et.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Et.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return X0||(X0=new Et(XE)),X0}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Hv){if(!e)return;this.globalLogger().throwError("error censorship permanent",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Kv=!!e,Hv=!!r}static setLogLevel(e){const r=Yf[e.toLowerCase()];if(r==null){Et.globalLogger().warn("invalid log level - "+e);return}Wv=r}static from(e){return new Et(e)}}Et.errors=yn,Et.levels=ed;const tA="bytes/5.7.0",vr=new Et(tA);function Yv(t){return!!t.toHexString}function Ha(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Ha(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function rA(t){return Li(t)&&!(t.length%2)||Ka(t)}function Jv(t){return typeof t=="number"&&t==t&&t%1===0}function Ka(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Jv(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!Jv(r)||r<0||r>=256)return!1}return!0}function lr(t,e){if(e||(e={}),typeof t=="number"){vr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Ha(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Yv(t)&&(t=t.toHexString()),Li(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":vr.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let n=0;n<r.length;n+=2)i.push(parseInt(r.substring(n,n+2),16));return Ha(new Uint8Array(i))}return Ka(t)?Ha(new Uint8Array(t)):vr.throwArgumentError("invalid arrayify value","value",t)}function iA(t){const e=t.map(n=>lr(n)),r=e.reduce((n,s)=>n+s.length,0),i=new Uint8Array(r);return e.reduce((n,s)=>(i.set(s,n),n+s.length),0),Ha(i)}function nA(t,e){t=lr(t),t.length>e&&vr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Ha(r)}function Li(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const td="0123456789abcdef";function ni(t,e){if(e||(e={}),typeof t=="number"){vr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=td[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Yv(t))return t.toHexString();if(Li(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":vr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Ka(t)){let r="0x";for(let i=0;i<t.length;i++){let n=t[i];r+=td[(n&240)>>4]+td[n&15]}return r}return vr.throwArgumentError("invalid hexlify value","value",t)}function sA(t){if(typeof t!="string")t=ni(t);else if(!Li(t)||t.length%2)return null;return(t.length-2)/2}function Qv(t,e,r){return typeof t!="string"?t=ni(t):(!Li(t)||t.length%2)&&vr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Yn(t,e){for(typeof t!="string"?t=ni(t):Li(t)||vr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&vr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Zv(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(rA(t)){let r=lr(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=ni(r.slice(0,32)),e.s=ni(r.slice(32,64))):r.length===65?(e.r=ni(r.slice(0,32)),e.s=ni(r.slice(32,64)),e.v=r[64]):vr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:vr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=ni(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const n=nA(lr(e._vs),32);e._vs=ni(n);const s=n[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&vr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),n[0]&=127;const a=ni(n);e.s==null?e.s=a:e.s!==a&&vr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?vr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const n=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==n&&vr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Li(e.r)?vr.throwArgumentError("signature missing or invalid r","signature",t):e.r=Yn(e.r,32),e.s==null||!Li(e.s)?vr.throwArgumentError("signature missing or invalid s","signature",t):e.s=Yn(e.s,32);const r=lr(e.s);r[0]>=128&&vr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=ni(r);e._vs&&(Li(e._vs)||vr.throwArgumentError("signature invalid _vs","signature",t),e._vs=Yn(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&vr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function rd(t){return"0x"+ZE.keccak_256(lr(t))}var Xv={exports:{}},oA={},aA=Object.freeze({__proto__:null,default:oA}),cA=QE(aA);(function(t){(function(e,r){function i(f,h){if(!f)throw new Error(h||"Assertion failed")}function n(f,h){f.super_=h;var v=function(){};v.prototype=h.prototype,f.prototype=new v,f.prototype.constructor=f}function s(f,h,v){if(s.isBN(f))return f;this.negative=0,this.words=null,this.length=0,this.red=null,f!==null&&((h==="le"||h==="be")&&(v=h,h=10),this._init(f||0,h||10,v||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=cA.Buffer}catch{}s.isBN=function(f){return f instanceof s?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===s.wordSize&&Array.isArray(f.words)},s.max=function(f,h){return f.cmp(h)>0?f:h},s.min=function(f,h){return f.cmp(h)<0?f:h},s.prototype._init=function(f,h,v){if(typeof f=="number")return this._initNumber(f,h,v);if(typeof f=="object")return this._initArray(f,h,v);h==="hex"&&(h=16),i(h===(h|0)&&h>=2&&h<=36),f=f.toString().replace(/\s+/g,"");var E=0;f[0]==="-"&&(E++,this.negative=1),E<f.length&&(h===16?this._parseHex(f,E,v):(this._parseBase(f,h,E),v==="le"&&this._initArray(this.toArray(),h,v)))},s.prototype._initNumber=function(f,h,v){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(i(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),v==="le"&&this._initArray(this.toArray(),h,v)},s.prototype._initArray=function(f,h,v){if(i(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var C,P,M=0;if(v==="be")for(E=f.length-1,C=0;E>=0;E-=3)P=f[E]|f[E-1]<<8|f[E-2]<<16,this.words[C]|=P<<M&67108863,this.words[C+1]=P>>>26-M&67108863,M+=24,M>=26&&(M-=26,C++);else if(v==="le")for(E=0,C=0;E<f.length;E+=3)P=f[E]|f[E+1]<<8|f[E+2]<<16,this.words[C]|=P<<M&67108863,this.words[C+1]=P>>>26-M&67108863,M+=24,M>=26&&(M-=26,C++);return this._strip()};function u(f,h){var v=f.charCodeAt(h);if(v>=48&&v<=57)return v-48;if(v>=65&&v<=70)return v-55;if(v>=97&&v<=102)return v-87;i(!1,"Invalid character in "+f)}function l(f,h,v){var E=u(f,v);return v-1>=h&&(E|=u(f,v-1)<<4),E}s.prototype._parseHex=function(f,h,v){this.length=Math.ceil((f.length-h)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var C=0,P=0,M;if(v==="be")for(E=f.length-1;E>=h;E-=2)M=l(f,h,E)<<C,this.words[P]|=M&67108863,C>=18?(C-=18,P+=1,this.words[P]|=M>>>26):C+=8;else{var g=f.length-h;for(E=g%2===0?h+1:h;E<f.length;E+=2)M=l(f,h,E)<<C,this.words[P]|=M&67108863,C>=18?(C-=18,P+=1,this.words[P]|=M>>>26):C+=8}this._strip()};function d(f,h,v,E){for(var C=0,P=0,M=Math.min(f.length,v),g=h;g<M;g++){var m=f.charCodeAt(g)-48;C*=E,m>=49?P=m-49+10:m>=17?P=m-17+10:P=m,i(m>=0&&P<E,"Invalid character"),C+=P}return C}s.prototype._parseBase=function(f,h,v){this.words=[0],this.length=1;for(var E=0,C=1;C<=67108863;C*=h)E++;E--,C=C/h|0;for(var P=f.length-v,M=P%E,g=Math.min(P,P-M)+v,m=0,N=v;N<g;N+=E)m=d(f,N,N+E,h),this.imuln(C),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if(M!==0){var ee=1;for(m=d(f,N,f.length,h),N=0;N<M;N++)ee*=h;this.imuln(ee),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this._strip()},s.prototype.copy=function(f){f.words=new Array(this.length);for(var h=0;h<this.length;h++)f.words[h]=this.words[h];f.length=this.length,f.negative=this.negative,f.red=this.red};function b(f,h){f.words=h.words,f.length=h.length,f.negative=h.negative,f.red=h.red}if(s.prototype._move=function(f){b(f,this)},s.prototype.clone=function(){var f=new s(null);return this.copy(f),f},s.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=w}catch{s.prototype.inspect=w}else s.prototype.inspect=w;function w(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var S=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],I=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],D=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(f,h){f=f||10,h=h|0||1;var v;if(f===16||f==="hex"){v="";for(var E=0,C=0,P=0;P<this.length;P++){var M=this.words[P],g=((M<<E|C)&16777215).toString(16);C=M>>>24-E&16777215,E+=2,E>=26&&(E-=26,P--),C!==0||P!==this.length-1?v=S[6-g.length]+g+v:v=g+v}for(C!==0&&(v=C.toString(16)+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(f===(f|0)&&f>=2&&f<=36){var m=I[f],N=D[f];v="";var ee=this.clone();for(ee.negative=0;!ee.isZero();){var ae=ee.modrn(N).toString(f);ee=ee.idivn(N),ee.isZero()?v=ae+v:v=S[m-ae.length]+ae+v}for(this.isZero()&&(v="0"+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(f,h){return this.toArrayLike(a,f,h)}),s.prototype.toArray=function(f,h){return this.toArrayLike(Array,f,h)};var L=function(f,h){return f.allocUnsafe?f.allocUnsafe(h):new f(h)};s.prototype.toArrayLike=function(f,h,v){this._strip();var E=this.byteLength(),C=v||Math.max(1,E);i(E<=C,"byte array longer than desired length"),i(C>0,"Requested array length <= 0");var P=L(f,C),M=h==="le"?"LE":"BE";return this["_toArrayLike"+M](P,E),P},s.prototype._toArrayLikeLE=function(f,h){for(var v=0,E=0,C=0,P=0;C<this.length;C++){var M=this.words[C]<<P|E;f[v++]=M&255,v<f.length&&(f[v++]=M>>8&255),v<f.length&&(f[v++]=M>>16&255),P===6?(v<f.length&&(f[v++]=M>>24&255),E=0,P=0):(E=M>>>24,P+=2)}if(v<f.length)for(f[v++]=E;v<f.length;)f[v++]=0},s.prototype._toArrayLikeBE=function(f,h){for(var v=f.length-1,E=0,C=0,P=0;C<this.length;C++){var M=this.words[C]<<P|E;f[v--]=M&255,v>=0&&(f[v--]=M>>8&255),v>=0&&(f[v--]=M>>16&255),P===6?(v>=0&&(f[v--]=M>>24&255),E=0,P=0):(E=M>>>24,P+=2)}if(v>=0)for(f[v--]=E;v>=0;)f[v--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var h=f,v=0;return h>=4096&&(v+=13,h>>>=13),h>=64&&(v+=7,h>>>=7),h>=8&&(v+=4,h>>>=4),h>=2&&(v+=2,h>>>=2),v+h},s.prototype._zeroBits=function(f){if(f===0)return 26;var h=f,v=0;return h&8191||(v+=13,h>>>=13),h&127||(v+=7,h>>>=7),h&15||(v+=4,h>>>=4),h&3||(v+=2,h>>>=2),h&1||v++,v},s.prototype.bitLength=function(){var f=this.words[this.length-1],h=this._countBits(f);return(this.length-1)*26+h};function K(f){for(var h=new Array(f.bitLength()),v=0;v<h.length;v++){var E=v/26|0,C=v%26;h[v]=f.words[E]>>>C&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,h=0;h<this.length;h++){var v=this._zeroBits(this.words[h]);if(f+=v,v!==26)break}return f},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},s.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]|f.words[h];return this._strip()},s.prototype.ior=function(f){return i((this.negative|f.negative)===0),this.iuor(f)},s.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var h;this.length>f.length?h=f:h=this;for(var v=0;v<h.length;v++)this.words[v]=this.words[v]&f.words[v];return this.length=h.length,this._strip()},s.prototype.iand=function(f){return i((this.negative|f.negative)===0),this.iuand(f)},s.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var h,v;this.length>f.length?(h=this,v=f):(h=f,v=this);for(var E=0;E<v.length;E++)this.words[E]=h.words[E]^v.words[E];if(this!==h)for(;E<h.length;E++)this.words[E]=h.words[E];return this.length=h.length,this._strip()},s.prototype.ixor=function(f){return i((this.negative|f.negative)===0),this.iuxor(f)},s.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){i(typeof f=="number"&&f>=0);var h=Math.ceil(f/26)|0,v=f%26;this._expand(h),v>0&&h--;for(var E=0;E<h;E++)this.words[E]=~this.words[E]&67108863;return v>0&&(this.words[E]=~this.words[E]&67108863>>26-v),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,h){i(typeof f=="number"&&f>=0);var v=f/26|0,E=f%26;return this._expand(v+1),h?this.words[v]=this.words[v]|1<<E:this.words[v]=this.words[v]&~(1<<E),this._strip()},s.prototype.iadd=function(f){var h;if(this.negative!==0&&f.negative===0)return this.negative=0,h=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,h=this.isub(f),f.negative=1,h._normSign();var v,E;this.length>f.length?(v=this,E=f):(v=f,E=this);for(var C=0,P=0;P<E.length;P++)h=(v.words[P]|0)+(E.words[P]|0)+C,this.words[P]=h&67108863,C=h>>>26;for(;C!==0&&P<v.length;P++)h=(v.words[P]|0)+C,this.words[P]=h&67108863,C=h>>>26;if(this.length=v.length,C!==0)this.words[this.length]=C,this.length++;else if(v!==this)for(;P<v.length;P++)this.words[P]=v.words[P];return this},s.prototype.add=function(f){var h;return f.negative!==0&&this.negative===0?(f.negative=0,h=this.sub(f),f.negative^=1,h):f.negative===0&&this.negative!==0?(this.negative=0,h=f.sub(this),this.negative=1,h):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var h=this.iadd(f);return f.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var v=this.cmp(f);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,C;v>0?(E=this,C=f):(E=f,C=this);for(var P=0,M=0;M<C.length;M++)h=(E.words[M]|0)-(C.words[M]|0)+P,P=h>>26,this.words[M]=h&67108863;for(;P!==0&&M<E.length;M++)h=(E.words[M]|0)+P,P=h>>26,this.words[M]=h&67108863;if(P===0&&M<E.length&&E!==this)for(;M<E.length;M++)this.words[M]=E.words[M];return this.length=Math.max(this.length,M),E!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(f){return this.clone().isub(f)};function H(f,h,v){v.negative=h.negative^f.negative;var E=f.length+h.length|0;v.length=E,E=E-1|0;var C=f.words[0]|0,P=h.words[0]|0,M=C*P,g=M&67108863,m=M/67108864|0;v.words[0]=g;for(var N=1;N<E;N++){for(var ee=m>>>26,ae=m&67108863,O=Math.min(N,h.length-1),te=Math.max(0,N-f.length+1);te<=O;te++){var q=N-te|0;C=f.words[q]|0,P=h.words[te]|0,M=C*P+ae,ee+=M/67108864|0,ae=M&67108863}v.words[N]=ae|0,m=ee|0}return m!==0?v.words[N]=m|0:v.length--,v._strip()}var U=function(f,h,v){var E=f.words,C=h.words,P=v.words,M=0,g,m,N,ee=E[0]|0,ae=ee&8191,O=ee>>>13,te=E[1]|0,q=te&8191,G=te>>>13,Y=E[2]|0,A=Y&8191,V=Y>>>13,oe=E[3]|0,ue=oe&8191,he=oe>>>13,ye=E[4]|0,we=ye&8191,Re=ye>>>13,Xe=E[5]|0,Oe=Xe&8191,Ne=Xe>>>13,Me=E[6]|0,be=Me&8191,Pe=Me>>>13,Te=E[7]|0,ve=Te&8191,$e=Te>>>13,xe=E[8]|0,me=xe&8191,Ue=xe>>>13,Ce=E[9]|0,_e=Ce&8191,Ke=Ce>>>13,Ve=C[0]|0,Ae=Ve&8191,We=Ve>>>13,pt=C[1]|0,Ge=pt&8191,It=pt>>>13,gt=C[2]|0,Je=gt&8191,Ot=gt>>>13,Tt=C[3]|0,Le=Tt&8191,et=Tt>>>13,it=C[4]|0,Be=it&8191,rt=it>>>13,tt=C[5]|0,je=tt&8191,ht=tt>>>13,nt=C[6]|0,qe=nt&8191,st=nt>>>13,at=C[7]|0,Fe=at&8191,Ze=at>>>13,lt=C[8]|0,ze=lt&8191,jt=lt>>>13,qt=C[9]|0,ct=qt&8191,_t=qt>>>13;v.negative=f.negative^h.negative,v.length=19,g=Math.imul(ae,Ae),m=Math.imul(ae,We),m=m+Math.imul(O,Ae)|0,N=Math.imul(O,We);var Qr=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,g=Math.imul(q,Ae),m=Math.imul(q,We),m=m+Math.imul(G,Ae)|0,N=Math.imul(G,We),g=g+Math.imul(ae,Ge)|0,m=m+Math.imul(ae,It)|0,m=m+Math.imul(O,Ge)|0,N=N+Math.imul(O,It)|0;var Zr=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,g=Math.imul(A,Ae),m=Math.imul(A,We),m=m+Math.imul(V,Ae)|0,N=Math.imul(V,We),g=g+Math.imul(q,Ge)|0,m=m+Math.imul(q,It)|0,m=m+Math.imul(G,Ge)|0,N=N+Math.imul(G,It)|0,g=g+Math.imul(ae,Je)|0,m=m+Math.imul(ae,Ot)|0,m=m+Math.imul(O,Je)|0,N=N+Math.imul(O,Ot)|0;var Xr=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,g=Math.imul(ue,Ae),m=Math.imul(ue,We),m=m+Math.imul(he,Ae)|0,N=Math.imul(he,We),g=g+Math.imul(A,Ge)|0,m=m+Math.imul(A,It)|0,m=m+Math.imul(V,Ge)|0,N=N+Math.imul(V,It)|0,g=g+Math.imul(q,Je)|0,m=m+Math.imul(q,Ot)|0,m=m+Math.imul(G,Je)|0,N=N+Math.imul(G,Ot)|0,g=g+Math.imul(ae,Le)|0,m=m+Math.imul(ae,et)|0,m=m+Math.imul(O,Le)|0,N=N+Math.imul(O,et)|0;var ei=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(ei>>>26)|0,ei&=67108863,g=Math.imul(we,Ae),m=Math.imul(we,We),m=m+Math.imul(Re,Ae)|0,N=Math.imul(Re,We),g=g+Math.imul(ue,Ge)|0,m=m+Math.imul(ue,It)|0,m=m+Math.imul(he,Ge)|0,N=N+Math.imul(he,It)|0,g=g+Math.imul(A,Je)|0,m=m+Math.imul(A,Ot)|0,m=m+Math.imul(V,Je)|0,N=N+Math.imul(V,Ot)|0,g=g+Math.imul(q,Le)|0,m=m+Math.imul(q,et)|0,m=m+Math.imul(G,Le)|0,N=N+Math.imul(G,et)|0,g=g+Math.imul(ae,Be)|0,m=m+Math.imul(ae,rt)|0,m=m+Math.imul(O,Be)|0,N=N+Math.imul(O,rt)|0;var ti=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(ti>>>26)|0,ti&=67108863,g=Math.imul(Oe,Ae),m=Math.imul(Oe,We),m=m+Math.imul(Ne,Ae)|0,N=Math.imul(Ne,We),g=g+Math.imul(we,Ge)|0,m=m+Math.imul(we,It)|0,m=m+Math.imul(Re,Ge)|0,N=N+Math.imul(Re,It)|0,g=g+Math.imul(ue,Je)|0,m=m+Math.imul(ue,Ot)|0,m=m+Math.imul(he,Je)|0,N=N+Math.imul(he,Ot)|0,g=g+Math.imul(A,Le)|0,m=m+Math.imul(A,et)|0,m=m+Math.imul(V,Le)|0,N=N+Math.imul(V,et)|0,g=g+Math.imul(q,Be)|0,m=m+Math.imul(q,rt)|0,m=m+Math.imul(G,Be)|0,N=N+Math.imul(G,rt)|0,g=g+Math.imul(ae,je)|0,m=m+Math.imul(ae,ht)|0,m=m+Math.imul(O,je)|0,N=N+Math.imul(O,ht)|0;var pr=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(pr>>>26)|0,pr&=67108863,g=Math.imul(be,Ae),m=Math.imul(be,We),m=m+Math.imul(Pe,Ae)|0,N=Math.imul(Pe,We),g=g+Math.imul(Oe,Ge)|0,m=m+Math.imul(Oe,It)|0,m=m+Math.imul(Ne,Ge)|0,N=N+Math.imul(Ne,It)|0,g=g+Math.imul(we,Je)|0,m=m+Math.imul(we,Ot)|0,m=m+Math.imul(Re,Je)|0,N=N+Math.imul(Re,Ot)|0,g=g+Math.imul(ue,Le)|0,m=m+Math.imul(ue,et)|0,m=m+Math.imul(he,Le)|0,N=N+Math.imul(he,et)|0,g=g+Math.imul(A,Be)|0,m=m+Math.imul(A,rt)|0,m=m+Math.imul(V,Be)|0,N=N+Math.imul(V,rt)|0,g=g+Math.imul(q,je)|0,m=m+Math.imul(q,ht)|0,m=m+Math.imul(G,je)|0,N=N+Math.imul(G,ht)|0,g=g+Math.imul(ae,qe)|0,m=m+Math.imul(ae,st)|0,m=m+Math.imul(O,qe)|0,N=N+Math.imul(O,st)|0;var Si=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Si>>>26)|0,Si&=67108863,g=Math.imul(ve,Ae),m=Math.imul(ve,We),m=m+Math.imul($e,Ae)|0,N=Math.imul($e,We),g=g+Math.imul(be,Ge)|0,m=m+Math.imul(be,It)|0,m=m+Math.imul(Pe,Ge)|0,N=N+Math.imul(Pe,It)|0,g=g+Math.imul(Oe,Je)|0,m=m+Math.imul(Oe,Ot)|0,m=m+Math.imul(Ne,Je)|0,N=N+Math.imul(Ne,Ot)|0,g=g+Math.imul(we,Le)|0,m=m+Math.imul(we,et)|0,m=m+Math.imul(Re,Le)|0,N=N+Math.imul(Re,et)|0,g=g+Math.imul(ue,Be)|0,m=m+Math.imul(ue,rt)|0,m=m+Math.imul(he,Be)|0,N=N+Math.imul(he,rt)|0,g=g+Math.imul(A,je)|0,m=m+Math.imul(A,ht)|0,m=m+Math.imul(V,je)|0,N=N+Math.imul(V,ht)|0,g=g+Math.imul(q,qe)|0,m=m+Math.imul(q,st)|0,m=m+Math.imul(G,qe)|0,N=N+Math.imul(G,st)|0,g=g+Math.imul(ae,Fe)|0,m=m+Math.imul(ae,Ze)|0,m=m+Math.imul(O,Fe)|0,N=N+Math.imul(O,Ze)|0;var Cn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,g=Math.imul(me,Ae),m=Math.imul(me,We),m=m+Math.imul(Ue,Ae)|0,N=Math.imul(Ue,We),g=g+Math.imul(ve,Ge)|0,m=m+Math.imul(ve,It)|0,m=m+Math.imul($e,Ge)|0,N=N+Math.imul($e,It)|0,g=g+Math.imul(be,Je)|0,m=m+Math.imul(be,Ot)|0,m=m+Math.imul(Pe,Je)|0,N=N+Math.imul(Pe,Ot)|0,g=g+Math.imul(Oe,Le)|0,m=m+Math.imul(Oe,et)|0,m=m+Math.imul(Ne,Le)|0,N=N+Math.imul(Ne,et)|0,g=g+Math.imul(we,Be)|0,m=m+Math.imul(we,rt)|0,m=m+Math.imul(Re,Be)|0,N=N+Math.imul(Re,rt)|0,g=g+Math.imul(ue,je)|0,m=m+Math.imul(ue,ht)|0,m=m+Math.imul(he,je)|0,N=N+Math.imul(he,ht)|0,g=g+Math.imul(A,qe)|0,m=m+Math.imul(A,st)|0,m=m+Math.imul(V,qe)|0,N=N+Math.imul(V,st)|0,g=g+Math.imul(q,Fe)|0,m=m+Math.imul(q,Ze)|0,m=m+Math.imul(G,Fe)|0,N=N+Math.imul(G,Ze)|0,g=g+Math.imul(ae,ze)|0,m=m+Math.imul(ae,jt)|0,m=m+Math.imul(O,ze)|0,N=N+Math.imul(O,jt)|0;var Ii=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,g=Math.imul(_e,Ae),m=Math.imul(_e,We),m=m+Math.imul(Ke,Ae)|0,N=Math.imul(Ke,We),g=g+Math.imul(me,Ge)|0,m=m+Math.imul(me,It)|0,m=m+Math.imul(Ue,Ge)|0,N=N+Math.imul(Ue,It)|0,g=g+Math.imul(ve,Je)|0,m=m+Math.imul(ve,Ot)|0,m=m+Math.imul($e,Je)|0,N=N+Math.imul($e,Ot)|0,g=g+Math.imul(be,Le)|0,m=m+Math.imul(be,et)|0,m=m+Math.imul(Pe,Le)|0,N=N+Math.imul(Pe,et)|0,g=g+Math.imul(Oe,Be)|0,m=m+Math.imul(Oe,rt)|0,m=m+Math.imul(Ne,Be)|0,N=N+Math.imul(Ne,rt)|0,g=g+Math.imul(we,je)|0,m=m+Math.imul(we,ht)|0,m=m+Math.imul(Re,je)|0,N=N+Math.imul(Re,ht)|0,g=g+Math.imul(ue,qe)|0,m=m+Math.imul(ue,st)|0,m=m+Math.imul(he,qe)|0,N=N+Math.imul(he,st)|0,g=g+Math.imul(A,Fe)|0,m=m+Math.imul(A,Ze)|0,m=m+Math.imul(V,Fe)|0,N=N+Math.imul(V,Ze)|0,g=g+Math.imul(q,ze)|0,m=m+Math.imul(q,jt)|0,m=m+Math.imul(G,ze)|0,N=N+Math.imul(G,jt)|0,g=g+Math.imul(ae,ct)|0,m=m+Math.imul(ae,_t)|0,m=m+Math.imul(O,ct)|0,N=N+Math.imul(O,_t)|0;var Dn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,g=Math.imul(_e,Ge),m=Math.imul(_e,It),m=m+Math.imul(Ke,Ge)|0,N=Math.imul(Ke,It),g=g+Math.imul(me,Je)|0,m=m+Math.imul(me,Ot)|0,m=m+Math.imul(Ue,Je)|0,N=N+Math.imul(Ue,Ot)|0,g=g+Math.imul(ve,Le)|0,m=m+Math.imul(ve,et)|0,m=m+Math.imul($e,Le)|0,N=N+Math.imul($e,et)|0,g=g+Math.imul(be,Be)|0,m=m+Math.imul(be,rt)|0,m=m+Math.imul(Pe,Be)|0,N=N+Math.imul(Pe,rt)|0,g=g+Math.imul(Oe,je)|0,m=m+Math.imul(Oe,ht)|0,m=m+Math.imul(Ne,je)|0,N=N+Math.imul(Ne,ht)|0,g=g+Math.imul(we,qe)|0,m=m+Math.imul(we,st)|0,m=m+Math.imul(Re,qe)|0,N=N+Math.imul(Re,st)|0,g=g+Math.imul(ue,Fe)|0,m=m+Math.imul(ue,Ze)|0,m=m+Math.imul(he,Fe)|0,N=N+Math.imul(he,Ze)|0,g=g+Math.imul(A,ze)|0,m=m+Math.imul(A,jt)|0,m=m+Math.imul(V,ze)|0,N=N+Math.imul(V,jt)|0,g=g+Math.imul(q,ct)|0,m=m+Math.imul(q,_t)|0,m=m+Math.imul(G,ct)|0,N=N+Math.imul(G,_t)|0;var On=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(On>>>26)|0,On&=67108863,g=Math.imul(_e,Je),m=Math.imul(_e,Ot),m=m+Math.imul(Ke,Je)|0,N=Math.imul(Ke,Ot),g=g+Math.imul(me,Le)|0,m=m+Math.imul(me,et)|0,m=m+Math.imul(Ue,Le)|0,N=N+Math.imul(Ue,et)|0,g=g+Math.imul(ve,Be)|0,m=m+Math.imul(ve,rt)|0,m=m+Math.imul($e,Be)|0,N=N+Math.imul($e,rt)|0,g=g+Math.imul(be,je)|0,m=m+Math.imul(be,ht)|0,m=m+Math.imul(Pe,je)|0,N=N+Math.imul(Pe,ht)|0,g=g+Math.imul(Oe,qe)|0,m=m+Math.imul(Oe,st)|0,m=m+Math.imul(Ne,qe)|0,N=N+Math.imul(Ne,st)|0,g=g+Math.imul(we,Fe)|0,m=m+Math.imul(we,Ze)|0,m=m+Math.imul(Re,Fe)|0,N=N+Math.imul(Re,Ze)|0,g=g+Math.imul(ue,ze)|0,m=m+Math.imul(ue,jt)|0,m=m+Math.imul(he,ze)|0,N=N+Math.imul(he,jt)|0,g=g+Math.imul(A,ct)|0,m=m+Math.imul(A,_t)|0,m=m+Math.imul(V,ct)|0,N=N+Math.imul(V,_t)|0;var Mi=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,g=Math.imul(_e,Le),m=Math.imul(_e,et),m=m+Math.imul(Ke,Le)|0,N=Math.imul(Ke,et),g=g+Math.imul(me,Be)|0,m=m+Math.imul(me,rt)|0,m=m+Math.imul(Ue,Be)|0,N=N+Math.imul(Ue,rt)|0,g=g+Math.imul(ve,je)|0,m=m+Math.imul(ve,ht)|0,m=m+Math.imul($e,je)|0,N=N+Math.imul($e,ht)|0,g=g+Math.imul(be,qe)|0,m=m+Math.imul(be,st)|0,m=m+Math.imul(Pe,qe)|0,N=N+Math.imul(Pe,st)|0,g=g+Math.imul(Oe,Fe)|0,m=m+Math.imul(Oe,Ze)|0,m=m+Math.imul(Ne,Fe)|0,N=N+Math.imul(Ne,Ze)|0,g=g+Math.imul(we,ze)|0,m=m+Math.imul(we,jt)|0,m=m+Math.imul(Re,ze)|0,N=N+Math.imul(Re,jt)|0,g=g+Math.imul(ue,ct)|0,m=m+Math.imul(ue,_t)|0,m=m+Math.imul(he,ct)|0,N=N+Math.imul(he,_t)|0;var nn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(nn>>>26)|0,nn&=67108863,g=Math.imul(_e,Be),m=Math.imul(_e,rt),m=m+Math.imul(Ke,Be)|0,N=Math.imul(Ke,rt),g=g+Math.imul(me,je)|0,m=m+Math.imul(me,ht)|0,m=m+Math.imul(Ue,je)|0,N=N+Math.imul(Ue,ht)|0,g=g+Math.imul(ve,qe)|0,m=m+Math.imul(ve,st)|0,m=m+Math.imul($e,qe)|0,N=N+Math.imul($e,st)|0,g=g+Math.imul(be,Fe)|0,m=m+Math.imul(be,Ze)|0,m=m+Math.imul(Pe,Fe)|0,N=N+Math.imul(Pe,Ze)|0,g=g+Math.imul(Oe,ze)|0,m=m+Math.imul(Oe,jt)|0,m=m+Math.imul(Ne,ze)|0,N=N+Math.imul(Ne,jt)|0,g=g+Math.imul(we,ct)|0,m=m+Math.imul(we,_t)|0,m=m+Math.imul(Re,ct)|0,N=N+Math.imul(Re,_t)|0;var sn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(sn>>>26)|0,sn&=67108863,g=Math.imul(_e,je),m=Math.imul(_e,ht),m=m+Math.imul(Ke,je)|0,N=Math.imul(Ke,ht),g=g+Math.imul(me,qe)|0,m=m+Math.imul(me,st)|0,m=m+Math.imul(Ue,qe)|0,N=N+Math.imul(Ue,st)|0,g=g+Math.imul(ve,Fe)|0,m=m+Math.imul(ve,Ze)|0,m=m+Math.imul($e,Fe)|0,N=N+Math.imul($e,Ze)|0,g=g+Math.imul(be,ze)|0,m=m+Math.imul(be,jt)|0,m=m+Math.imul(Pe,ze)|0,N=N+Math.imul(Pe,jt)|0,g=g+Math.imul(Oe,ct)|0,m=m+Math.imul(Oe,_t)|0,m=m+Math.imul(Ne,ct)|0,N=N+Math.imul(Ne,_t)|0;var Ir=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,g=Math.imul(_e,qe),m=Math.imul(_e,st),m=m+Math.imul(Ke,qe)|0,N=Math.imul(Ke,st),g=g+Math.imul(me,Fe)|0,m=m+Math.imul(me,Ze)|0,m=m+Math.imul(Ue,Fe)|0,N=N+Math.imul(Ue,Ze)|0,g=g+Math.imul(ve,ze)|0,m=m+Math.imul(ve,jt)|0,m=m+Math.imul($e,ze)|0,N=N+Math.imul($e,jt)|0,g=g+Math.imul(be,ct)|0,m=m+Math.imul(be,_t)|0,m=m+Math.imul(Pe,ct)|0,N=N+Math.imul(Pe,_t)|0;var Pn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,g=Math.imul(_e,Fe),m=Math.imul(_e,Ze),m=m+Math.imul(Ke,Fe)|0,N=Math.imul(Ke,Ze),g=g+Math.imul(me,ze)|0,m=m+Math.imul(me,jt)|0,m=m+Math.imul(Ue,ze)|0,N=N+Math.imul(Ue,jt)|0,g=g+Math.imul(ve,ct)|0,m=m+Math.imul(ve,_t)|0,m=m+Math.imul($e,ct)|0,N=N+Math.imul($e,_t)|0;var $n=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+($n>>>26)|0,$n&=67108863,g=Math.imul(_e,ze),m=Math.imul(_e,jt),m=m+Math.imul(Ke,ze)|0,N=Math.imul(Ke,jt),g=g+Math.imul(me,ct)|0,m=m+Math.imul(me,_t)|0,m=m+Math.imul(Ue,ct)|0,N=N+Math.imul(Ue,_t)|0;var Rn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,g=Math.imul(_e,ct),m=Math.imul(_e,_t),m=m+Math.imul(Ke,ct)|0,N=Math.imul(Ke,_t);var fa=(M+g|0)+((m&8191)<<13)|0;return M=(N+(m>>>13)|0)+(fa>>>26)|0,fa&=67108863,P[0]=Qr,P[1]=Zr,P[2]=Xr,P[3]=ei,P[4]=ti,P[5]=pr,P[6]=Si,P[7]=Cn,P[8]=Ii,P[9]=Dn,P[10]=On,P[11]=Mi,P[12]=nn,P[13]=sn,P[14]=Ir,P[15]=Pn,P[16]=$n,P[17]=Rn,P[18]=fa,M!==0&&(P[19]=M,v.length++),v};Math.imul||(U=H);function W(f,h,v){v.negative=h.negative^f.negative,v.length=f.length+h.length;for(var E=0,C=0,P=0;P<v.length-1;P++){var M=C;C=0;for(var g=E&67108863,m=Math.min(P,h.length-1),N=Math.max(0,P-f.length+1);N<=m;N++){var ee=P-N,ae=f.words[ee]|0,O=h.words[N]|0,te=ae*O,q=te&67108863;M=M+(te/67108864|0)|0,q=q+g|0,g=q&67108863,M=M+(q>>>26)|0,C+=M>>>26,M&=67108863}v.words[P]=g,E=M,M=C}return E!==0?v.words[P]=E:v.length--,v._strip()}function R(f,h,v){return W(f,h,v)}s.prototype.mulTo=function(f,h){var v,E=this.length+f.length;return this.length===10&&f.length===10?v=U(this,f,h):E<63?v=H(this,f,h):E<1024?v=W(this,f,h):v=R(this,f,h),v},s.prototype.mul=function(f){var h=new s(null);return h.words=new Array(this.length+f.length),this.mulTo(f,h)},s.prototype.mulf=function(f){var h=new s(null);return h.words=new Array(this.length+f.length),R(this,f,h)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var h=f<0;h&&(f=-f),i(typeof f=="number"),i(f<67108864);for(var v=0,E=0;E<this.length;E++){var C=(this.words[E]|0)*f,P=(C&67108863)+(v&67108863);v>>=26,v+=C/67108864|0,v+=P>>>26,this.words[E]=P&67108863}return v!==0&&(this.words[E]=v,this.length++),h?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var h=K(f);if(h.length===0)return new s(1);for(var v=this,E=0;E<h.length&&h[E]===0;E++,v=v.sqr());if(++E<h.length)for(var C=v.sqr();E<h.length;E++,C=C.sqr())h[E]!==0&&(v=v.mul(C));return v},s.prototype.iushln=function(f){i(typeof f=="number"&&f>=0);var h=f%26,v=(f-h)/26,E=67108863>>>26-h<<26-h,C;if(h!==0){var P=0;for(C=0;C<this.length;C++){var M=this.words[C]&E,g=(this.words[C]|0)-M<<h;this.words[C]=g|P,P=M>>>26-h}P&&(this.words[C]=P,this.length++)}if(v!==0){for(C=this.length-1;C>=0;C--)this.words[C+v]=this.words[C];for(C=0;C<v;C++)this.words[C]=0;this.length+=v}return this._strip()},s.prototype.ishln=function(f){return i(this.negative===0),this.iushln(f)},s.prototype.iushrn=function(f,h,v){i(typeof f=="number"&&f>=0);var E;h?E=(h-h%26)/26:E=0;var C=f%26,P=Math.min((f-C)/26,this.length),M=67108863^67108863>>>C<<C,g=v;if(E-=P,E=Math.max(0,E),g){for(var m=0;m<P;m++)g.words[m]=this.words[m];g.length=P}if(P!==0)if(this.length>P)for(this.length-=P,m=0;m<this.length;m++)this.words[m]=this.words[m+P];else this.words[0]=0,this.length=1;var N=0;for(m=this.length-1;m>=0&&(N!==0||m>=E);m--){var ee=this.words[m]|0;this.words[m]=N<<26-C|ee>>>C,N=ee&M}return g&&N!==0&&(g.words[g.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,h,v){return i(this.negative===0),this.iushrn(f,h,v)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){i(typeof f=="number"&&f>=0);var h=f%26,v=(f-h)/26,E=1<<h;if(this.length<=v)return!1;var C=this.words[v];return!!(C&E)},s.prototype.imaskn=function(f){i(typeof f=="number"&&f>=0);var h=f%26,v=(f-h)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(h!==0&&v++,this.length=Math.min(v,this.length),h!==0){var E=67108863^67108863>>>h<<h;this.words[this.length-1]&=E}return this._strip()},s.prototype.maskn=function(f){return this.clone().imaskn(f)},s.prototype.iaddn=function(f){return i(typeof f=="number"),i(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},s.prototype._iaddn=function(f){this.words[0]+=f;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(f){if(i(typeof f=="number"),i(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this._strip()},s.prototype.addn=function(f){return this.clone().iaddn(f)},s.prototype.subn=function(f){return this.clone().isubn(f)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(f,h,v){var E=f.length+v,C;this._expand(E);var P,M=0;for(C=0;C<f.length;C++){P=(this.words[C+v]|0)+M;var g=(f.words[C]|0)*h;P-=g&67108863,M=(P>>26)-(g/67108864|0),this.words[C+v]=P&67108863}for(;C<this.length-v;C++)P=(this.words[C+v]|0)+M,M=P>>26,this.words[C+v]=P&67108863;if(M===0)return this._strip();for(i(M===-1),M=0,C=0;C<this.length;C++)P=-(this.words[C]|0)+M,M=P>>26,this.words[C]=P&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,h){var v=this.length-f.length,E=this.clone(),C=f,P=C.words[C.length-1]|0,M=this._countBits(P);v=26-M,v!==0&&(C=C.ushln(v),E.iushln(v),P=C.words[C.length-1]|0);var g=E.length-C.length,m;if(h!=="mod"){m=new s(null),m.length=g+1,m.words=new Array(m.length);for(var N=0;N<m.length;N++)m.words[N]=0}var ee=E.clone()._ishlnsubmul(C,1,g);ee.negative===0&&(E=ee,m&&(m.words[g]=1));for(var ae=g-1;ae>=0;ae--){var O=(E.words[C.length+ae]|0)*67108864+(E.words[C.length+ae-1]|0);for(O=Math.min(O/P|0,67108863),E._ishlnsubmul(C,O,ae);E.negative!==0;)O--,E.negative=0,E._ishlnsubmul(C,1,ae),E.isZero()||(E.negative^=1);m&&(m.words[ae]=O)}return m&&m._strip(),E._strip(),h!=="div"&&v!==0&&E.iushrn(v),{div:m||null,mod:E}},s.prototype.divmod=function(f,h,v){if(i(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var E,C,P;return this.negative!==0&&f.negative===0?(P=this.neg().divmod(f,h),h!=="mod"&&(E=P.div.neg()),h!=="div"&&(C=P.mod.neg(),v&&C.negative!==0&&C.iadd(f)),{div:E,mod:C}):this.negative===0&&f.negative!==0?(P=this.divmod(f.neg(),h),h!=="mod"&&(E=P.div.neg()),{div:E,mod:P.mod}):this.negative&f.negative?(P=this.neg().divmod(f.neg(),h),h!=="div"&&(C=P.mod.neg(),v&&C.negative!==0&&C.isub(f)),{div:P.div,mod:C}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?h==="div"?{div:this.divn(f.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,h)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var h=this.divmod(f);if(h.mod.isZero())return h.div;var v=h.div.negative!==0?h.mod.isub(f):h.mod,E=f.ushrn(1),C=f.andln(1),P=v.cmp(E);return P<0||C===1&&P===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modrn=function(f){var h=f<0;h&&(f=-f),i(f<=67108863);for(var v=(1<<26)%f,E=0,C=this.length-1;C>=0;C--)E=(v*E+(this.words[C]|0))%f;return h?-E:E},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var h=f<0;h&&(f=-f),i(f<=67108863);for(var v=0,E=this.length-1;E>=0;E--){var C=(this.words[E]|0)+v*67108864;this.words[E]=C/f|0,v=C%f}return this._strip(),h?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){i(f.negative===0),i(!f.isZero());var h=this,v=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var E=new s(1),C=new s(0),P=new s(0),M=new s(1),g=0;h.isEven()&&v.isEven();)h.iushrn(1),v.iushrn(1),++g;for(var m=v.clone(),N=h.clone();!h.isZero();){for(var ee=0,ae=1;!(h.words[0]&ae)&&ee<26;++ee,ae<<=1);if(ee>0)for(h.iushrn(ee);ee-- >0;)(E.isOdd()||C.isOdd())&&(E.iadd(m),C.isub(N)),E.iushrn(1),C.iushrn(1);for(var O=0,te=1;!(v.words[0]&te)&&O<26;++O,te<<=1);if(O>0)for(v.iushrn(O);O-- >0;)(P.isOdd()||M.isOdd())&&(P.iadd(m),M.isub(N)),P.iushrn(1),M.iushrn(1);h.cmp(v)>=0?(h.isub(v),E.isub(P),C.isub(M)):(v.isub(h),P.isub(E),M.isub(C))}return{a:P,b:M,gcd:v.iushln(g)}},s.prototype._invmp=function(f){i(f.negative===0),i(!f.isZero());var h=this,v=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var E=new s(1),C=new s(0),P=v.clone();h.cmpn(1)>0&&v.cmpn(1)>0;){for(var M=0,g=1;!(h.words[0]&g)&&M<26;++M,g<<=1);if(M>0)for(h.iushrn(M);M-- >0;)E.isOdd()&&E.iadd(P),E.iushrn(1);for(var m=0,N=1;!(v.words[0]&N)&&m<26;++m,N<<=1);if(m>0)for(v.iushrn(m);m-- >0;)C.isOdd()&&C.iadd(P),C.iushrn(1);h.cmp(v)>=0?(h.isub(v),E.isub(C)):(v.isub(h),C.isub(E))}var ee;return h.cmpn(1)===0?ee=E:ee=C,ee.cmpn(0)<0&&ee.iadd(f),ee},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var h=this.clone(),v=f.clone();h.negative=0,v.negative=0;for(var E=0;h.isEven()&&v.isEven();E++)h.iushrn(1),v.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;v.isEven();)v.iushrn(1);var C=h.cmp(v);if(C<0){var P=h;h=v,v=P}else if(C===0||v.cmpn(1)===0)break;h.isub(v)}while(!0);return v.iushln(E)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){i(typeof f=="number");var h=f%26,v=(f-h)/26,E=1<<h;if(this.length<=v)return this._expand(v+1),this.words[v]|=E,this;for(var C=E,P=v;C!==0&&P<this.length;P++){var M=this.words[P]|0;M+=C,C=M>>>26,M&=67108863,this.words[P]=M}return C!==0&&(this.words[P]=C,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var h=f<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var v;if(this.length>1)v=1;else{h&&(f=-f),i(f<=67108863,"Number is too big");var E=this.words[0]|0;v=E===f?0:E<f?-1:1}return this.negative!==0?-v|0:v},s.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var h=this.ucmp(f);return this.negative!==0?-h|0:h},s.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var h=0,v=this.length-1;v>=0;v--){var E=this.words[v]|0,C=f.words[v]|0;if(E!==C){E<C?h=-1:E>C&&(h=1);break}}return h},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new T(f)},s.prototype.toRed=function(f){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return i(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return i(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var k={k256:null,p224:null,p192:null,p25519:null};function z(f,h){this.name=f,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},z.prototype.ireduce=function(f){var h=f,v;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),v=h.bitLength();while(v>this.n);var E=v<this.n?-1:h.ucmp(this.p);return E===0?(h.words[0]=0,h.length=1):E>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},z.prototype.split=function(f,h){f.iushrn(this.n,0,h)},z.prototype.imulK=function(f){return f.imul(this.k)};function _(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(_,z),_.prototype.split=function(f,h){for(var v=4194303,E=Math.min(f.length,9),C=0;C<E;C++)h.words[C]=f.words[C];if(h.length=E,f.length<=9){f.words[0]=0,f.length=1;return}var P=f.words[9];for(h.words[h.length++]=P&v,C=10;C<f.length;C++){var M=f.words[C]|0;f.words[C-10]=(M&v)<<4|P>>>22,P=M}P>>>=22,f.words[C-10]=P,P===0&&f.length>10?f.length-=10:f.length-=9},_.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var h=0,v=0;v<f.length;v++){var E=f.words[v]|0;h+=E*977,f.words[v]=h&67108863,h=E*64+(h/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function B(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(B,z);function X(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(X,z);function re(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(re,z),re.prototype.imulK=function(f){for(var h=0,v=0;v<f.length;v++){var E=(f.words[v]|0)*19+h,C=E&67108863;E>>>=26,f.words[v]=C,h=E}return h!==0&&(f.words[f.length++]=h),f},s._prime=function(f){if(k[f])return k[f];var h;if(f==="k256")h=new _;else if(f==="p224")h=new B;else if(f==="p192")h=new X;else if(f==="p25519")h=new re;else throw new Error("Unknown prime "+f);return k[f]=h,h};function T(f){if(typeof f=="string"){var h=s._prime(f);this.m=h.p,this.prime=h}else i(f.gtn(1),"modulus must be greater than 1"),this.m=f,this.prime=null}T.prototype._verify1=function(f){i(f.negative===0,"red works only with positives"),i(f.red,"red works only with red numbers")},T.prototype._verify2=function(f,h){i((f.negative|h.negative)===0,"red works only with positives"),i(f.red&&f.red===h.red,"red works only with red numbers")},T.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(b(f,f.umod(this.m)._forceRed(this)),f)},T.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},T.prototype.add=function(f,h){this._verify2(f,h);var v=f.add(h);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},T.prototype.iadd=function(f,h){this._verify2(f,h);var v=f.iadd(h);return v.cmp(this.m)>=0&&v.isub(this.m),v},T.prototype.sub=function(f,h){this._verify2(f,h);var v=f.sub(h);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},T.prototype.isub=function(f,h){this._verify2(f,h);var v=f.isub(h);return v.cmpn(0)<0&&v.iadd(this.m),v},T.prototype.shl=function(f,h){return this._verify1(f),this.imod(f.ushln(h))},T.prototype.imul=function(f,h){return this._verify2(f,h),this.imod(f.imul(h))},T.prototype.mul=function(f,h){return this._verify2(f,h),this.imod(f.mul(h))},T.prototype.isqr=function(f){return this.imul(f,f.clone())},T.prototype.sqr=function(f){return this.mul(f,f)},T.prototype.sqrt=function(f){if(f.isZero())return f.clone();var h=this.m.andln(3);if(i(h%2===1),h===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(f,v)}for(var E=this.m.subn(1),C=0;!E.isZero()&&E.andln(1)===0;)C++,E.iushrn(1);i(!E.isZero());var P=new s(1).toRed(this),M=P.redNeg(),g=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new s(2*m*m).toRed(this);this.pow(m,g).cmp(M)!==0;)m.redIAdd(M);for(var N=this.pow(m,E),ee=this.pow(f,E.addn(1).iushrn(1)),ae=this.pow(f,E),O=C;ae.cmp(P)!==0;){for(var te=ae,q=0;te.cmp(P)!==0;q++)te=te.redSqr();i(q<O);var G=this.pow(N,new s(1).iushln(O-q-1));ee=ee.redMul(G),N=G.redSqr(),ae=ae.redMul(N),O=q}return ee},T.prototype.invm=function(f){var h=f._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},T.prototype.pow=function(f,h){if(h.isZero())return new s(1).toRed(this);if(h.cmpn(1)===0)return f.clone();var v=4,E=new Array(1<<v);E[0]=new s(1).toRed(this),E[1]=f;for(var C=2;C<E.length;C++)E[C]=this.mul(E[C-1],f);var P=E[0],M=0,g=0,m=h.bitLength()%26;for(m===0&&(m=26),C=h.length-1;C>=0;C--){for(var N=h.words[C],ee=m-1;ee>=0;ee--){var ae=N>>ee&1;if(P!==E[0]&&(P=this.sqr(P)),ae===0&&M===0){g=0;continue}M<<=1,M|=ae,g++,!(g!==v&&(C!==0||ee!==0))&&(P=this.mul(P,E[M]),g=0,M=0)}m=26}return P},T.prototype.convertTo=function(f){var h=f.umod(this.m);return h===f?h.clone():h},T.prototype.convertFrom=function(f){var h=f.clone();return h.red=null,h},s.mont=function(f){return new y(f)};function y(f){T.call(this,f),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(y,T),y.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},y.prototype.convertFrom=function(f){var h=this.imod(f.mul(this.rinv));return h.red=null,h},y.prototype.imul=function(f,h){if(f.isZero()||h.isZero())return f.words[0]=0,f.length=1,f;var v=f.imul(h),E=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=v.isub(E).iushrn(this.shift),P=C;return C.cmp(this.m)>=0?P=C.isub(this.m):C.cmpn(0)<0&&(P=C.iadd(this.m)),P._forceRed(this)},y.prototype.mul=function(f,h){if(f.isZero()||h.isZero())return new s(0)._forceRed(this);var v=f.mul(h),E=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=v.isub(E).iushrn(this.shift),P=C;return C.cmp(this.m)>=0?P=C.isub(this.m):C.cmpn(0)<0&&(P=C.iadd(this.m)),P._forceRed(this)},y.prototype.invm=function(f){var h=this.imod(f._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(t,qv)})(Xv);var mt=Xv.exports;const em="bignumber/5.7.0";var Jf=mt.BN;const Ms=new Et(em),id={},tm=9007199254740991;function uA(t){return t!=null&&(nr.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Li(t)||typeof t=="bigint"||Ka(t))}let rm=!1;class nr{constructor(e,r){e!==id&&Ms.throwError("cannot call constructor directly; use BigNumber.from",Et.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return mi(Rt(this).fromTwos(e))}toTwos(e){return mi(Rt(this).toTwos(e))}abs(){return this._hex[0]==="-"?nr.from(this._hex.substring(1)):this}add(e){return mi(Rt(this).add(Rt(e)))}sub(e){return mi(Rt(this).sub(Rt(e)))}div(e){return nr.from(e).isZero()&&Yi("division-by-zero","div"),mi(Rt(this).div(Rt(e)))}mul(e){return mi(Rt(this).mul(Rt(e)))}mod(e){const r=Rt(e);return r.isNeg()&&Yi("division-by-zero","mod"),mi(Rt(this).umod(r))}pow(e){const r=Rt(e);return r.isNeg()&&Yi("negative-power","pow"),mi(Rt(this).pow(r))}and(e){const r=Rt(e);return(this.isNegative()||r.isNeg())&&Yi("unbound-bitwise-result","and"),mi(Rt(this).and(r))}or(e){const r=Rt(e);return(this.isNegative()||r.isNeg())&&Yi("unbound-bitwise-result","or"),mi(Rt(this).or(r))}xor(e){const r=Rt(e);return(this.isNegative()||r.isNeg())&&Yi("unbound-bitwise-result","xor"),mi(Rt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Yi("negative-width","mask"),mi(Rt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Yi("negative-width","shl"),mi(Rt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Yi("negative-width","shr"),mi(Rt(this).shrn(e))}eq(e){return Rt(this).eq(Rt(e))}lt(e){return Rt(this).lt(Rt(e))}lte(e){return Rt(this).lte(Rt(e))}gt(e){return Rt(this).gt(Rt(e))}gte(e){return Rt(this).gte(Rt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Rt(this).isZero()}toNumber(){try{return Rt(this).toNumber()}catch{Yi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ms.throwError("this platform does not support BigInt",Et.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?rm||(rm=!0,Ms.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ms.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Et.errors.UNEXPECTED_ARGUMENT,{}):Ms.throwError("BigNumber.toString does not accept parameters",Et.errors.UNEXPECTED_ARGUMENT,{})),Rt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof nr)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new nr(id,au(e)):e.match(/^-?[0-9]+$/)?new nr(id,au(new Jf(e))):Ms.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Yi("underflow","BigNumber.from",e),(e>=tm||e<=-tm)&&Yi("overflow","BigNumber.from",e),nr.from(String(e));const r=e;if(typeof r=="bigint")return nr.from(r.toString());if(Ka(r))return nr.from(ni(r));if(r)if(r.toHexString){const i=r.toHexString();if(typeof i=="string")return nr.from(i)}else{let i=r._hex;if(i==null&&r.type==="BigNumber"&&(i=r.hex),typeof i=="string"&&(Li(i)||i[0]==="-"&&Li(i.substring(1))))return nr.from(i)}return Ms.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function au(t){if(typeof t!="string")return au(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Ms.throwArgumentError("invalid hex","value",t),t=au(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function mi(t){return nr.from(au(t))}function Rt(t){const e=nr.from(t).toHexString();return e[0]==="-"?new Jf("-"+e.substring(3),16):new Jf(e.substring(2),16)}function Yi(t,e,r){const i={fault:t,operation:e};return r!=null&&(i.value=r),Ms.throwError(t,Et.errors.NUMERIC_FAULT,i)}function fA(t){return new Jf(t,36).toString(16)}const si=new Et(em),cu={},im=nr.from(0),nm=nr.from(-1);function sm(t,e,r,i){const n={fault:e,operation:r};return i!==void 0&&(n.value=i),si.throwError(t,Et.errors.NUMERIC_FAULT,n)}let uu="0";for(;uu.length<256;)uu+=uu;function nd(t){if(typeof t!="number")try{t=nr.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+uu.substring(0,t):si.throwArgumentError("invalid decimal size","decimals",t)}function sd(t,e){e==null&&(e=0);const r=nd(e);t=nr.from(t);const i=t.lt(im);i&&(t=t.mul(nm));let n=t.mod(r).toString();for(;n.length<r.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];const s=t.div(r).toString();return r.length===1?t=s:t=s+"."+n,i&&(t="-"+t),t}function Cs(t,e){e==null&&(e=0);const r=nd(e);(typeof t!="string"||!t.match(/^-?[0-9.]+$/))&&si.throwArgumentError("invalid decimal value","value",t);const i=t.substring(0,1)==="-";i&&(t=t.substring(1)),t==="."&&si.throwArgumentError("missing value","value",t);const n=t.split(".");n.length>2&&si.throwArgumentError("too many decimal points","value",t);let s=n[0],a=n[1];for(s||(s="0"),a||(a="0");a[a.length-1]==="0";)a=a.substring(0,a.length-1);for(a.length>r.length-1&&sm("fractional component exceeds decimals","underflow","parseFixed"),a===""&&(a="0");a.length<r.length-1;)a+="0";const u=nr.from(s),l=nr.from(a);let d=u.mul(r).add(l);return i&&(d=d.mul(nm)),d}class Wa{constructor(e,r,i,n){e!==cu&&si.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Et.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=i,this.decimals=n,this.name=(r?"":"u")+"fixed"+String(i)+"x"+String(n),this._multiplier=nd(n),Object.freeze(this)}static from(e){if(e instanceof Wa)return e;typeof e=="number"&&(e=`fixed128x${e}`);let r=!0,i=128,n=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")r=!1;else{const s=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);s||si.throwArgumentError("invalid fixed format","format",e),r=s[1]!=="u",i=parseInt(s[2]),n=parseInt(s[3])}}else if(e){const s=(a,u,l)=>e[a]==null?l:(typeof e[a]!==u&&si.throwArgumentError("invalid fixed format ("+a+" not "+u+")","format."+a,e[a]),e[a]);r=s("signed","boolean",r),i=s("width","number",i),n=s("decimals","number",n)}return i%8&&si.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),n>80&&si.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new Wa(cu,r,i,n)}}class jr{constructor(e,r,i,n){e!==cu&&si.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Et.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=r,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&si.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return jr.fromValue(r.add(i),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return jr.fromValue(r.sub(i),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return jr.fromValue(r.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return jr.fromValue(r.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=jr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return this.isNegative()&&i&&(r=r.subUnsafe(om.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=jr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return!this.isNegative()&&i&&(r=r.addUnsafe(om.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&si.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const i=jr.from("1"+uu.substring(0,e),this.format),n=hA.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(n).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&si.throwArgumentError("invalid byte width","width",e);const r=nr.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Yn(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return jr.fromString(this._value,e)}static fromValue(e,r,i){return i==null&&r!=null&&!uA(r)&&(i=r,r=null),r==null&&(r=0),i==null&&(i="fixed"),jr.fromString(sd(e,r),Wa.from(i))}static fromString(e,r){r==null&&(r="fixed");const i=Wa.from(r),n=Cs(e,i.decimals);!i.signed&&n.lt(im)&&sm("unsigned value cannot be negative","overflow","value",e);let s=null;i.signed?s=n.toTwos(i.width).toHexString():(s=n.toHexString(),s=Yn(s,i.width/8));const a=sd(n,i.decimals);return new jr(cu,s,a,i)}static fromBytes(e,r){r==null&&(r="fixed");const i=Wa.from(r);if(lr(e).length>i.width/8)throw new Error("overflow");let n=nr.from(e);i.signed&&(n=n.fromTwos(i.width));const s=n.toTwos((i.signed?0:1)+i.width).toHexString(),a=sd(n,i.decimals);return new jr(cu,s,a,i)}static from(e,r){if(typeof e=="string")return jr.fromString(e,r);if(Ka(e))return jr.fromBytes(e,r);try{return jr.fromValue(e,0,r)}catch(i){if(i.code!==Et.errors.INVALID_ARGUMENT)throw i}return si.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const om=jr.from(1),hA=jr.from("0.5"),lA="strings/5.7.0",am=new Et(lA);var Qf;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(Qf||(Qf={}));var Va;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Va||(Va={}));function dA(t,e,r,i,n){return am.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function cm(t,e,r,i,n){if(t===Va.BAD_PREFIX||t===Va.UNEXPECTED_CONTINUE){let s=0;for(let a=e+1;a<r.length&&r[a]>>6===2;a++)s++;return s}return t===Va.OVERRUN?r.length-e-1:0}function pA(t,e,r,i,n){return t===Va.OVERLONG?(i.push(n),0):(i.push(65533),cm(t,e,r))}Object.freeze({error:dA,ignore:cm,replace:pA});function od(t,e=Qf.current){e!=Qf.current&&(am.checkNormalize(),t=t.normalize(e));let r=[];for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(n&63|128);else if((n&64512)==55296){i++;const s=t.charCodeAt(i);if(i>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const a=65536+((n&1023)<<10)+(s&1023);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(a&63|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(n&63|128)}return lr(r)}function gA(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e}function ad(t,e){e||(e=function(n){return[parseInt(n,16)]});let r=0,i={};return t.split(",").forEach(n=>{let s=n.split(":");r+=parseInt(s[0],16),i[r]=e(s[1])}),i}function um(t){let e=0;return t.split(",").map(r=>{let i=r.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let n=e+parseInt(i[0],16);return e=parseInt(i[1],16),{l:n,h:e}})}um("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),ad("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),ad("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),ad("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",gA),um("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const fm="hash/5.7.0";function vA(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return lr(e)}function hm(t,e){e==null&&(e=1);const r=[],i=r.forEach,n=function(s,a){i.call(s,function(u){a>0&&Array.isArray(u)?n(u,a-1):r.push(u)})};return n(t,e),r}function mA(t){const e={};for(let r=0;r<t.length;r++){const i=t[r];e[i[0]]=i[1]}return e}function bA(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,s=[0,1];for(let k=1;k<i;k++)s.push(n+=r());let a=r(),u=e;e+=a;let l=0,d=0;function b(){return l==0&&(d=d<<8|t[e++],l=8),d>>--l&1}const w=31,S=Math.pow(2,w),I=S>>>1,D=I>>1,L=S-1;let K=0;for(let k=0;k<w;k++)K=K<<1|b();let H=[],U=0,W=S;for(;;){let k=Math.floor(((K-U+1)*n-1)/W),z=0,_=i;for(;_-z>1;){let re=z+_>>>1;k<s[re]?_=re:z=re}if(z==0)break;H.push(z);let B=U+Math.floor(W*s[z]/n),X=U+Math.floor(W*s[z+1]/n)-1;for(;!((B^X)&I);)K=K<<1&L|b(),B=B<<1&L,X=X<<1&L|1;for(;B&~X&D;)K=K&I|K<<1&L>>>1|b(),B=B<<1^I,X=(X^I)<<1|I|1;U=B,W=1+X-B}let R=i-4;return H.map(k=>{switch(k-R){case 3:return R+65792+(t[u++]<<16|t[u++]<<8|t[u++]);case 2:return R+256+(t[u++]<<8|t[u++]);case 1:return R+t[u++];default:return k-1}})}function yA(t){let e=0;return()=>t[e++]}function wA(t){return yA(bA(t))}function _A(t){return t&1?~t>>1:t>>1}function EA(t,e){let r=Array(t);for(let i=0;i<t;i++)r[i]=1+e();return r}function lm(t,e){let r=Array(t);for(let i=0,n=-1;i<t;i++)r[i]=n+=1+e();return r}function AA(t,e){let r=Array(t);for(let i=0,n=0;i<t;i++)r[i]=n+=_A(e());return r}function Zf(t,e){let r=lm(t(),t),i=t(),n=lm(i,t),s=EA(i,t);for(let a=0;a<i;a++)for(let u=0;u<s[a];u++)r.push(n[a]+u);return e?r.map(a=>e[a]):r}function xA(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(IA(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(MA(r,t))}return mA(hm(e))}function SA(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function dm(t,e,r){let i=Array(t).fill(void 0).map(()=>[]);for(let n=0;n<e;n++)AA(t,r).forEach((s,a)=>i[a].push(s));return i}function IA(t,e){let r=1+e(),i=e(),n=SA(e),s=dm(n.length,1+t,e);return hm(s.map((a,u)=>{const l=a[0],d=a.slice(1);return Array(n[u]).fill(void 0).map((b,w)=>{let S=w*i;return[l+w*r,d.map(I=>I+S)]})}))}function MA(t,e){let r=1+e();return dm(r,1+t,e).map(i=>[i[0],i.slice(1)])}function CA(t){let e=Zf(t).sort((i,n)=>i-n);return r();function r(){let i=[];for(;;){let d=Zf(t,e);if(d.length==0)break;i.push({set:new Set(d),node:r()})}i.sort((d,b)=>b.set.size-d.set.size);let n=t(),s=n%3;n=n/3|0;let a=!!(n&1);n>>=1;let u=n==1,l=n==2;return{branches:i,valid:s,fe0f:a,save:u,check:l}}}function DA(){return wA(vA("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const Xf=DA();new Set(Zf(Xf)),new Set(Zf(Xf)),xA(Xf),CA(Xf),new Et(fm),new Uint8Array(32).fill(0);const OA=`Ethereum Signed Message:
22
- `;function pm(t){return typeof t=="string"&&(t=od(t)),rd(iA([od(OA),od(String(t.length)),t]))}const PA="rlp/5.7.0";new Et(PA);const $A="address/5.7.0",fu=new Et($A);function gm(t){Li(t,20)||fu.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let n=0;n<40;n++)r[n]=e[n].charCodeAt(0);const i=lr(rd(r));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(i[n>>1]&15)>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}const RA=9007199254740991;function NA(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const cd={};for(let t=0;t<10;t++)cd[String(t)]=String(t);for(let t=0;t<26;t++)cd[String.fromCharCode(65+t)]=String(10+t);const vm=Math.floor(NA(RA));function TA(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(i=>cd[i]).join("");for(;e.length>=vm;){let i=e.substring(0,vm);e=parseInt(i,10)%97+e.substring(i.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function LA(t){let e=null;if(typeof t!="string"&&fu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=gm(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&fu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==TA(t)&&fu.throwArgumentError("bad icap checksum","address",t),e=fA(t.substring(4));e.length<40;)e="0"+e;e=gm("0x"+e)}else fu.throwArgumentError("invalid address","address",t);return e}const BA="properties/5.7.0";new Et(BA);function hu(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new Et(fm),new Uint8Array(32).fill(0),nr.from(-1);const FA=nr.from(0),UA=nr.from(1);nr.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Yn(UA.toHexString(),32),Yn(FA.toHexString(),32);var Jn={},Nt={},lu=mm;function mm(t,e){if(!t)throw new Error(e||"Assertion failed")}mm.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var ud={exports:{}};typeof Object.create=="function"?ud.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ud.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var kA=lu,jA=ud.exports;Nt.inherits=jA;function qA(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function zA(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var s=t.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=s&63|128):qA(t,n)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++n)&1023),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=s&63|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=s&63|128)}else for(n=0;n<t.length;n++)r[n]=t[n]|0;return r}Nt.toArray=zA;function HA(t){for(var e="",r=0;r<t.length;r++)e+=ym(t[r].toString(16));return e}Nt.toHex=HA;function bm(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Nt.htonl=bm;function KA(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];e==="little"&&(n=bm(n)),r+=wm(n.toString(16))}return r}Nt.toHex32=KA;function ym(t){return t.length===1?"0"+t:t}Nt.zero2=ym;function wm(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}Nt.zero8=wm;function WA(t,e,r,i){var n=r-e;kA(n%4===0);for(var s=new Array(n/4),a=0,u=e;a<s.length;a++,u+=4){var l;i==="big"?l=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:l=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=l>>>0}return s}Nt.join32=WA;function VA(t,e){for(var r=new Array(t.length*4),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];e==="big"?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=s&255):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=s&255)}return r}Nt.split32=VA;function GA(t,e){return t>>>e|t<<32-e}Nt.rotr32=GA;function YA(t,e){return t<<e|t>>>32-e}Nt.rotl32=YA;function JA(t,e){return t+e>>>0}Nt.sum32=JA;function QA(t,e,r){return t+e+r>>>0}Nt.sum32_3=QA;function ZA(t,e,r,i){return t+e+r+i>>>0}Nt.sum32_4=ZA;function XA(t,e,r,i,n){return t+e+r+i+n>>>0}Nt.sum32_5=XA;function ex(t,e,r,i){var n=t[e],s=t[e+1],a=i+s>>>0,u=(a<i?1:0)+r+n;t[e]=u>>>0,t[e+1]=a}Nt.sum64=ex;function tx(t,e,r,i){var n=e+i>>>0,s=(n<e?1:0)+t+r;return s>>>0}Nt.sum64_hi=tx;function rx(t,e,r,i){var n=e+i;return n>>>0}Nt.sum64_lo=rx;function ix(t,e,r,i,n,s,a,u){var l=0,d=e;d=d+i>>>0,l+=d<e?1:0,d=d+s>>>0,l+=d<s?1:0,d=d+u>>>0,l+=d<u?1:0;var b=t+r+n+a+l;return b>>>0}Nt.sum64_4_hi=ix;function nx(t,e,r,i,n,s,a,u){var l=e+i+s+u;return l>>>0}Nt.sum64_4_lo=nx;function sx(t,e,r,i,n,s,a,u,l,d){var b=0,w=e;w=w+i>>>0,b+=w<e?1:0,w=w+s>>>0,b+=w<s?1:0,w=w+u>>>0,b+=w<u?1:0,w=w+d>>>0,b+=w<d?1:0;var S=t+r+n+a+l+b;return S>>>0}Nt.sum64_5_hi=sx;function ox(t,e,r,i,n,s,a,u,l,d){var b=e+i+s+u+d;return b>>>0}Nt.sum64_5_lo=ox;function ax(t,e,r){var i=e<<32-r|t>>>r;return i>>>0}Nt.rotr64_hi=ax;function cx(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Nt.rotr64_lo=cx;function ux(t,e,r){return t>>>r}Nt.shr64_hi=ux;function fx(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Nt.shr64_lo=fx;var Ga={},_m=Nt,hx=lu;function eh(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ga.BlockHash=eh,eh.prototype.update=function(t,e){if(t=_m.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=_m.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},eh.prototype.digest=function(t){return this.update(this._pad()),hx(this.pending===null),this._digest(t)},eh.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,this.endian==="big"){for(var s=8;s<this.padLength;s++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=t&255}else for(i[n++]=t&255,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s<this.padLength;s++)i[n++]=0;return i};var Ya={},Qn={},lx=Nt,Zn=lx.rotr32;function dx(t,e,r,i){if(t===0)return Em(e,r,i);if(t===1||t===3)return xm(e,r,i);if(t===2)return Am(e,r,i)}Qn.ft_1=dx;function Em(t,e,r){return t&e^~t&r}Qn.ch32=Em;function Am(t,e,r){return t&e^t&r^e&r}Qn.maj32=Am;function xm(t,e,r){return t^e^r}Qn.p32=xm;function px(t){return Zn(t,2)^Zn(t,13)^Zn(t,22)}Qn.s0_256=px;function gx(t){return Zn(t,6)^Zn(t,11)^Zn(t,25)}Qn.s1_256=gx;function vx(t){return Zn(t,7)^Zn(t,18)^t>>>3}Qn.g0_256=vx;function mx(t){return Zn(t,17)^Zn(t,19)^t>>>10}Qn.g1_256=mx;var Ja=Nt,bx=Ga,yx=Qn,fd=Ja.rotl32,du=Ja.sum32,wx=Ja.sum32_5,_x=yx.ft_1,Sm=bx.BlockHash,Ex=[1518500249,1859775393,2400959708,3395469782];function Xn(){if(!(this instanceof Xn))return new Xn;Sm.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ja.inherits(Xn,Sm);var Ax=Xn;Xn.blockSize=512,Xn.outSize=160,Xn.hmacStrength=80,Xn.padLength=64,Xn.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=fd(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],s=this.h[1],a=this.h[2],u=this.h[3],l=this.h[4];for(i=0;i<r.length;i++){var d=~~(i/20),b=wx(fd(n,5),_x(d,s,a,u),l,r[i],Ex[d]);l=u,u=a,a=fd(s,30),s=n,n=b}this.h[0]=du(this.h[0],n),this.h[1]=du(this.h[1],s),this.h[2]=du(this.h[2],a),this.h[3]=du(this.h[3],u),this.h[4]=du(this.h[4],l)},Xn.prototype._digest=function(t){return t==="hex"?Ja.toHex32(this.h,"big"):Ja.split32(this.h,"big")};var Qa=Nt,xx=Ga,Za=Qn,Sx=lu,wn=Qa.sum32,Ix=Qa.sum32_4,Mx=Qa.sum32_5,Cx=Za.ch32,Dx=Za.maj32,Ox=Za.s0_256,Px=Za.s1_256,$x=Za.g0_256,Rx=Za.g1_256,Im=xx.BlockHash,Nx=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function es(){if(!(this instanceof es))return new es;Im.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=Nx,this.W=new Array(64)}Qa.inherits(es,Im);var Mm=es;es.blockSize=512,es.outSize=256,es.hmacStrength=192,es.padLength=64,es.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=Ix(Rx(r[i-2]),r[i-7],$x(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],a=this.h[2],u=this.h[3],l=this.h[4],d=this.h[5],b=this.h[6],w=this.h[7];for(Sx(this.k.length===r.length),i=0;i<r.length;i++){var S=Mx(w,Px(l),Cx(l,d,b),this.k[i],r[i]),I=wn(Ox(n),Dx(n,s,a));w=b,b=d,d=l,l=wn(u,S),u=a,a=s,s=n,n=wn(S,I)}this.h[0]=wn(this.h[0],n),this.h[1]=wn(this.h[1],s),this.h[2]=wn(this.h[2],a),this.h[3]=wn(this.h[3],u),this.h[4]=wn(this.h[4],l),this.h[5]=wn(this.h[5],d),this.h[6]=wn(this.h[6],b),this.h[7]=wn(this.h[7],w)},es.prototype._digest=function(t){return t==="hex"?Qa.toHex32(this.h,"big"):Qa.split32(this.h,"big")};var hd=Nt,Cm=Mm;function Ds(){if(!(this instanceof Ds))return new Ds;Cm.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}hd.inherits(Ds,Cm);var Tx=Ds;Ds.blockSize=512,Ds.outSize=224,Ds.hmacStrength=192,Ds.padLength=64,Ds.prototype._digest=function(t){return t==="hex"?hd.toHex32(this.h.slice(0,7),"big"):hd.split32(this.h.slice(0,7),"big")};var bi=Nt,Lx=Ga,Bx=lu,ts=bi.rotr64_hi,rs=bi.rotr64_lo,Dm=bi.shr64_hi,Om=bi.shr64_lo,to=bi.sum64,ld=bi.sum64_hi,dd=bi.sum64_lo,Fx=bi.sum64_4_hi,Ux=bi.sum64_4_lo,kx=bi.sum64_5_hi,jx=bi.sum64_5_lo,Pm=Lx.BlockHash,qx=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _n(){if(!(this instanceof _n))return new _n;Pm.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=qx,this.W=new Array(160)}bi.inherits(_n,Pm);var $m=_n;_n.blockSize=1024,_n.outSize=512,_n.hmacStrength=192,_n.padLength=128,_n.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=Xx(r[i-4],r[i-3]),s=eS(r[i-4],r[i-3]),a=r[i-14],u=r[i-13],l=Qx(r[i-30],r[i-29]),d=Zx(r[i-30],r[i-29]),b=r[i-32],w=r[i-31];r[i]=Fx(n,s,a,u,l,d,b,w),r[i+1]=Ux(n,s,a,u,l,d,b,w)}},_n.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],l=this.h[5],d=this.h[6],b=this.h[7],w=this.h[8],S=this.h[9],I=this.h[10],D=this.h[11],L=this.h[12],K=this.h[13],H=this.h[14],U=this.h[15];Bx(this.k.length===r.length);for(var W=0;W<r.length;W+=2){var R=H,k=U,z=Yx(w,S),_=Jx(w,S),B=zx(w,S,I,D,L),X=Hx(w,S,I,D,L,K),re=this.k[W],T=this.k[W+1],y=r[W],f=r[W+1],h=kx(R,k,z,_,B,X,re,T,y,f),v=jx(R,k,z,_,B,X,re,T,y,f);R=Vx(i,n),k=Gx(i,n),z=Kx(i,n,s,a,u),_=Wx(i,n,s,a,u,l);var E=ld(R,k,z,_),C=dd(R,k,z,_);H=L,U=K,L=I,K=D,I=w,D=S,w=ld(d,b,h,v),S=dd(b,b,h,v),d=u,b=l,u=s,l=a,s=i,a=n,i=ld(h,v,E,C),n=dd(h,v,E,C)}to(this.h,0,i,n),to(this.h,2,s,a),to(this.h,4,u,l),to(this.h,6,d,b),to(this.h,8,w,S),to(this.h,10,I,D),to(this.h,12,L,K),to(this.h,14,H,U)},_n.prototype._digest=function(t){return t==="hex"?bi.toHex32(this.h,"big"):bi.split32(this.h,"big")};function zx(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function Hx(t,e,r,i,n,s){var a=e&i^~e&s;return a<0&&(a+=4294967296),a}function Kx(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function Wx(t,e,r,i,n,s){var a=e&i^e&s^i&s;return a<0&&(a+=4294967296),a}function Vx(t,e){var r=ts(t,e,28),i=ts(e,t,2),n=ts(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function Gx(t,e){var r=rs(t,e,28),i=rs(e,t,2),n=rs(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function Yx(t,e){var r=ts(t,e,14),i=ts(t,e,18),n=ts(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function Jx(t,e){var r=rs(t,e,14),i=rs(t,e,18),n=rs(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function Qx(t,e){var r=ts(t,e,1),i=ts(t,e,8),n=Dm(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function Zx(t,e){var r=rs(t,e,1),i=rs(t,e,8),n=Om(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function Xx(t,e){var r=ts(t,e,19),i=ts(e,t,29),n=Dm(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}function eS(t,e){var r=rs(t,e,19),i=rs(e,t,29),n=Om(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}var pd=Nt,Rm=$m;function Os(){if(!(this instanceof Os))return new Os;Rm.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}pd.inherits(Os,Rm);var tS=Os;Os.blockSize=1024,Os.outSize=384,Os.hmacStrength=192,Os.padLength=128,Os.prototype._digest=function(t){return t==="hex"?pd.toHex32(this.h.slice(0,12),"big"):pd.split32(this.h.slice(0,12),"big")},Ya.sha1=Ax,Ya.sha224=Tx,Ya.sha256=Mm,Ya.sha384=tS,Ya.sha512=$m;var Nm={},Uo=Nt,rS=Ga,th=Uo.rotl32,Tm=Uo.sum32,pu=Uo.sum32_3,Lm=Uo.sum32_4,Bm=rS.BlockHash;function is(){if(!(this instanceof is))return new is;Bm.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Uo.inherits(is,Bm),Nm.ripemd160=is,is.blockSize=512,is.outSize=160,is.hmacStrength=192,is.padLength=64,is.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],s=this.h[3],a=this.h[4],u=r,l=i,d=n,b=s,w=a,S=0;S<80;S++){var I=Tm(th(Lm(r,Fm(S,i,n,s),t[sS[S]+e],iS(S)),aS[S]),a);r=a,a=s,s=th(n,10),n=i,i=I,I=Tm(th(Lm(u,Fm(79-S,l,d,b),t[oS[S]+e],nS(S)),cS[S]),w),u=w,w=b,b=th(d,10),d=l,l=I}I=pu(this.h[1],n,b),this.h[1]=pu(this.h[2],s,w),this.h[2]=pu(this.h[3],a,u),this.h[3]=pu(this.h[4],r,l),this.h[4]=pu(this.h[0],i,d),this.h[0]=I},is.prototype._digest=function(t){return t==="hex"?Uo.toHex32(this.h,"little"):Uo.split32(this.h,"little")};function Fm(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function iS(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function nS(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var sS=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],oS=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],aS=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],cS=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],uS=Nt,fS=lu;function Xa(t,e,r){if(!(this instanceof Xa))return new Xa(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(uS.toArray(e,r))}var hS=Xa;Xa.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),fS(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=new this.Hash().update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=new this.Hash().update(t)},Xa.prototype.update=function(t,e){return this.inner.update(t,e),this},Xa.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=Nt,e.common=Ga,e.sha=Ya,e.ripemd=Nm,e.hmac=hS,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(Jn);function ec(t,e,r){return r={path:e,exports:{},require:function(i,n){return lS(i,n??r.path)}},t(r,r.exports),r.exports}function lS(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var gd=Um;function Um(t,e){if(!t)throw new Error(e||"Assertion failed")}Um.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var En=ec(function(t,e){var r=e;function i(a,u){if(Array.isArray(a))return a.slice();if(!a)return[];var l=[];if(typeof a!="string"){for(var d=0;d<a.length;d++)l[d]=a[d]|0;return l}if(u==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var d=0;d<a.length;d+=2)l.push(parseInt(a[d]+a[d+1],16))}else for(var d=0;d<a.length;d++){var b=a.charCodeAt(d),w=b>>8,S=b&255;w?l.push(w,S):l.push(S)}return l}r.toArray=i;function n(a){return a.length===1?"0"+a:a}r.zero2=n;function s(a){for(var u="",l=0;l<a.length;l++)u+=n(a[l].toString(16));return u}r.toHex=s,r.encode=function(a,u){return u==="hex"?s(a):a}}),Bi=ec(function(t,e){var r=e;r.assert=gd,r.toArray=En.toArray,r.zero2=En.zero2,r.toHex=En.toHex,r.encode=En.encode;function i(l,d,b){var w=new Array(Math.max(l.bitLength(),b)+1);w.fill(0);for(var S=1<<d+1,I=l.clone(),D=0;D<w.length;D++){var L,K=I.andln(S-1);I.isOdd()?(K>(S>>1)-1?L=(S>>1)-K:L=K,I.isubn(L)):L=0,w[D]=L,I.iushrn(1)}return w}r.getNAF=i;function n(l,d){var b=[[],[]];l=l.clone(),d=d.clone();for(var w=0,S=0,I;l.cmpn(-w)>0||d.cmpn(-S)>0;){var D=l.andln(3)+w&3,L=d.andln(3)+S&3;D===3&&(D=-1),L===3&&(L=-1);var K;D&1?(I=l.andln(7)+w&7,(I===3||I===5)&&L===2?K=-D:K=D):K=0,b[0].push(K);var H;L&1?(I=d.andln(7)+S&7,(I===3||I===5)&&D===2?H=-L:H=L):H=0,b[1].push(H),2*w===K+1&&(w=1-w),2*S===H+1&&(S=1-S),l.iushrn(1),d.iushrn(1)}return b}r.getJSF=n;function s(l,d,b){var w="_"+d;l.prototype[d]=function(){return this[w]!==void 0?this[w]:this[w]=b.call(this)}}r.cachedProperty=s;function a(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=a;function u(l){return new mt(l,"hex","le")}r.intFromLE=u}),rh=Bi.getNAF,dS=Bi.getJSF,ih=Bi.assert;function ro(t,e){this.type=t,this.p=new mt(e.p,16),this.red=e.prime?mt.red(e.prime):mt.mont(this.p),this.zero=new mt(0).toRed(this.red),this.one=new mt(1).toRed(this.red),this.two=new mt(2).toRed(this.red),this.n=e.n&&new mt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ko=ro;ro.prototype.point=function(){throw new Error("Not implemented")},ro.prototype.validate=function(){throw new Error("Not implemented")},ro.prototype._fixedNafMul=function(t,e){ih(t.precomputed);var r=t._getDoubles(),i=rh(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2===0?2:1);n/=3;var s=[],a,u;for(a=0;a<i.length;a+=r.step){u=0;for(var l=a+r.step-1;l>=a;l--)u=(u<<1)+i[l];s.push(u)}for(var d=this.jpoint(null,null,null),b=this.jpoint(null,null,null),w=n;w>0;w--){for(a=0;a<s.length;a++)u=s[a],u===w?b=b.mixedAdd(r.points[a]):u===-w&&(b=b.mixedAdd(r.points[a].neg()));d=d.add(b)}return d.toP()},ro.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,s=rh(e,r,this._bitLength),a=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&s[u]===0;u--)l++;if(u>=0&&l++,a=a.dblp(l),u<0)break;var d=s[u];ih(d!==0),t.type==="affine"?d>0?a=a.mixedAdd(n[d-1>>1]):a=a.mixedAdd(n[-d-1>>1].neg()):d>0?a=a.add(n[d-1>>1]):a=a.add(n[-d-1>>1].neg())}return t.type==="affine"?a.toP():a},ro.prototype._wnafMulAdd=function(t,e,r,i,n){var s=this._wnafT1,a=this._wnafT2,u=this._wnafT3,l=0,d,b,w;for(d=0;d<i;d++){w=e[d];var S=w._getNAFPoints(t);s[d]=S.wnd,a[d]=S.points}for(d=i-1;d>=1;d-=2){var I=d-1,D=d;if(s[I]!==1||s[D]!==1){u[I]=rh(r[I],s[I],this._bitLength),u[D]=rh(r[D],s[D],this._bitLength),l=Math.max(u[I].length,l),l=Math.max(u[D].length,l);continue}var L=[e[I],null,null,e[D]];e[I].y.cmp(e[D].y)===0?(L[1]=e[I].add(e[D]),L[2]=e[I].toJ().mixedAdd(e[D].neg())):e[I].y.cmp(e[D].y.redNeg())===0?(L[1]=e[I].toJ().mixedAdd(e[D]),L[2]=e[I].add(e[D].neg())):(L[1]=e[I].toJ().mixedAdd(e[D]),L[2]=e[I].toJ().mixedAdd(e[D].neg()));var K=[-3,-1,-5,-7,0,7,5,1,3],H=dS(r[I],r[D]);for(l=Math.max(H[0].length,l),u[I]=new Array(l),u[D]=new Array(l),b=0;b<l;b++){var U=H[0][b]|0,W=H[1][b]|0;u[I][b]=K[(U+1)*3+(W+1)],u[D][b]=0,a[I]=L}}var R=this.jpoint(null,null,null),k=this._wnafT4;for(d=l;d>=0;d--){for(var z=0;d>=0;){var _=!0;for(b=0;b<i;b++)k[b]=u[b][d]|0,k[b]!==0&&(_=!1);if(!_)break;z++,d--}if(d>=0&&z++,R=R.dblp(z),d<0)break;for(b=0;b<i;b++){var B=k[b];B!==0&&(B>0?w=a[b][B-1>>1]:B<0&&(w=a[b][-B-1>>1].neg()),w.type==="affine"?R=R.mixedAdd(w):R=R.add(w))}}for(d=0;d<i;d++)a[d]=null;return n?R:R.toP()};function Ji(t,e){this.curve=t,this.type=e,this.precomputed=null}ro.BasePoint=Ji,Ji.prototype.eq=function(){throw new Error("Not implemented")},Ji.prototype.validate=function(){return this.curve.validate(this)},ro.prototype.decodePoint=function(t,e){t=Bi.toArray(t,e);var r=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*r){t[0]===6?ih(t[t.length-1]%2===0):t[0]===7&&ih(t[t.length-1]%2===1);var i=this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));return i}else if((t[0]===2||t[0]===3)&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),t[0]===3);throw new Error("Unknown point format")},Ji.prototype.encodeCompressed=function(t){return this.encode(t,!0)},Ji.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},Ji.prototype.encode=function(t,e){return Bi.encode(this._encode(e),t)},Ji.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},Ji.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1},Ji.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var s=0;s<t;s++)i=i.dbl();r.push(i)}return{step:t,points:r}},Ji.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=r===1?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},Ji.prototype._getBeta=function(){return null},Ji.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var vd=ec(function(t){typeof Object.create=="function"?t.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}}),pS=Bi.assert;function Qi(t){ko.call(this,"short",t),this.a=new mt(t.a,16).toRed(this.red),this.b=new mt(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}vd(Qi,ko);var gS=Qi;Qi.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,r;if(t.beta)e=new mt(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=i[0].cmp(i[1])<0?i[0]:i[1],e=e.toRed(this.red)}if(t.lambda)r=new mt(t.lambda,16);else{var n=this._getEndoRoots(this.n);this.g.mul(n[0]).x.cmp(this.g.x.redMul(e))===0?r=n[0]:(r=n[1],pS(this.g.mul(r).x.cmp(this.g.x.redMul(e))===0))}var s;return t.basis?s=t.basis.map(function(a){return{a:new mt(a.a,16),b:new mt(a.b,16)}}):s=this._getEndoBasis(r),{beta:e,lambda:r,basis:s}}},Qi.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:mt.mont(t),r=new mt(2).toRed(e).redInvm(),i=r.redNeg(),n=new mt(3).toRed(e).redNeg().redSqrt().redMul(r),s=i.redAdd(n).fromRed(),a=i.redSub(n).fromRed();return[s,a]},Qi.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),r=t,i=this.n.clone(),n=new mt(1),s=new mt(0),a=new mt(0),u=new mt(1),l,d,b,w,S,I,D,L=0,K,H;r.cmpn(0)!==0;){var U=i.div(r);K=i.sub(U.mul(r)),H=a.sub(U.mul(n));var W=u.sub(U.mul(s));if(!b&&K.cmp(e)<0)l=D.neg(),d=n,b=K.neg(),w=H;else if(b&&++L===2)break;D=K,i=r,r=K,a=n,n=H,u=s,s=W}S=K.neg(),I=H;var R=b.sqr().add(w.sqr()),k=S.sqr().add(I.sqr());return k.cmp(R)>=0&&(S=l,I=d),b.negative&&(b=b.neg(),w=w.neg()),S.negative&&(S=S.neg(),I=I.neg()),[{a:b,b:w},{a:S,b:I}]},Qi.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),a=n.mul(r.a),u=s.mul(i.a),l=n.mul(r.b),d=s.mul(i.b),b=t.sub(a).sub(u),w=l.add(d).neg();return{k1:b,k2:w}},Qi.prototype.pointFromX=function(t,e){t=new mt(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(i.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},Qi.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(n).cmpn(0)===0},Qi.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<t.length;s++){var a=this._endoSplit(e[s]),u=t[s],l=u._getBeta();a.k1.negative&&(a.k1.ineg(),u=u.neg(!0)),a.k2.negative&&(a.k2.ineg(),l=l.neg(!0)),i[s*2]=u,i[s*2+1]=l,n[s*2]=a.k1,n[s*2+1]=a.k2}for(var d=this._wnafMulAdd(1,i,n,s*2,r),b=0;b<s*2;b++)i[b]=null,n[b]=null;return d};function $r(t,e,r,i){ko.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new mt(e,16),this.y=new mt(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}vd($r,ko.BasePoint),Qi.prototype.point=function(t,e,r){return new $r(this,t,e,r)},Qi.prototype.pointFromJSON=function(t,e){return $r.fromJSON(this,t,e)},$r.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(n){return r.point(n.x.redMul(r.endo.beta),n.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},$r.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},$r.fromJSON=function(t,e,r){typeof e=="string"&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(a){return t.point(a[0],a[1],r)}var s=e[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},$r.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},$r.prototype.isInfinity=function(){return this.inf},$r.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},$r.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)},$r.prototype.getX=function(){return this.x.fromRed()},$r.prototype.getY=function(){return this.y.fromRed()},$r.prototype.mul=function(t){return t=new mt(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},$r.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},$r.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},$r.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},$r.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(n){return n.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},$r.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function qr(t,e,r,i){ko.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new mt(0)):(this.x=new mt(e,16),this.y=new mt(r,16),this.z=new mt(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}vd(qr,ko.BasePoint),Qi.prototype.jpoint=function(t,e,r){return new qr(this,t,e,r)},qr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},qr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},qr.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),u=i.redSub(n),l=s.redSub(a);if(u.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=u.redSqr(),b=d.redMul(u),w=i.redMul(d),S=l.redSqr().redIAdd(b).redISub(w).redISub(w),I=l.redMul(w.redISub(S)).redISub(s.redMul(b)),D=this.z.redMul(t.z).redMul(u);return this.curve.jpoint(S,I,D)},qr.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),a=r.redSub(i),u=n.redSub(s);if(a.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),d=l.redMul(a),b=r.redMul(l),w=u.redSqr().redIAdd(d).redISub(b).redISub(b),S=u.redMul(b.redISub(w)).redISub(n.redMul(d)),I=this.z.redMul(a);return this.curve.jpoint(w,S,I)},qr.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,a=this.y,u=this.z,l=u.redSqr().redSqr(),d=a.redAdd(a);for(e=0;e<t;e++){var b=s.redSqr(),w=d.redSqr(),S=w.redSqr(),I=b.redAdd(b).redIAdd(b).redIAdd(i.redMul(l)),D=s.redMul(w),L=I.redSqr().redISub(D.redAdd(D)),K=D.redISub(L),H=I.redMul(K);H=H.redIAdd(H).redISub(S);var U=d.redMul(u);e+1<t&&(l=l.redMul(S)),s=L,u=U,d=H}return this.curve.jpoint(s,d.redMul(n),u)},qr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},qr.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(s);a=a.redIAdd(a);var u=i.redAdd(i).redIAdd(i),l=u.redSqr().redISub(a).redISub(a),d=s.redIAdd(s);d=d.redIAdd(d),d=d.redIAdd(d),t=l,e=u.redMul(a.redISub(l)).redISub(d),r=this.y.redAdd(this.y)}else{var b=this.x.redSqr(),w=this.y.redSqr(),S=w.redSqr(),I=this.x.redAdd(w).redSqr().redISub(b).redISub(S);I=I.redIAdd(I);var D=b.redAdd(b).redIAdd(b),L=D.redSqr(),K=S.redIAdd(S);K=K.redIAdd(K),K=K.redIAdd(K),t=L.redISub(I).redISub(I),e=D.redMul(I.redISub(t)).redISub(K),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},qr.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(s);a=a.redIAdd(a);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),l=u.redSqr().redISub(a).redISub(a);t=l;var d=s.redIAdd(s);d=d.redIAdd(d),d=d.redIAdd(d),e=u.redMul(a.redISub(l)).redISub(d),r=this.y.redAdd(this.y)}else{var b=this.z.redSqr(),w=this.y.redSqr(),S=this.x.redMul(w),I=this.x.redSub(b).redMul(this.x.redAdd(b));I=I.redAdd(I).redIAdd(I);var D=S.redIAdd(S);D=D.redIAdd(D);var L=D.redAdd(D);t=I.redSqr().redISub(L),r=this.y.redAdd(this.z).redSqr().redISub(w).redISub(b);var K=w.redSqr();K=K.redIAdd(K),K=K.redIAdd(K),K=K.redIAdd(K),e=I.redMul(D.redISub(t)).redISub(K)}return this.curve.jpoint(t,e,r)},qr.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=e.redSqr(),a=r.redSqr(),u=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(n)),l=e.redAdd(e);l=l.redIAdd(l);var d=l.redMul(a),b=u.redSqr().redISub(d.redAdd(d)),w=d.redISub(b),S=a.redSqr();S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var I=u.redMul(w).redISub(S),D=r.redAdd(r).redMul(i);return this.curve.jpoint(b,I,D)},qr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),s=n.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(i);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(s);var u=a.redSqr(),l=i.redIAdd(i);l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l);var d=n.redIAdd(a).redSqr().redISub(s).redISub(u).redISub(l),b=e.redMul(d);b=b.redIAdd(b),b=b.redIAdd(b);var w=this.x.redMul(u).redISub(b);w=w.redIAdd(w),w=w.redIAdd(w);var S=this.y.redMul(d.redMul(l.redISub(d)).redISub(a.redMul(u)));S=S.redIAdd(S),S=S.redIAdd(S),S=S.redIAdd(S);var I=this.z.redAdd(a).redSqr().redISub(r).redISub(u);return this.curve.jpoint(w,S,I)},qr.prototype.mul=function(t,e){return t=new mt(t,e),this.curve._wnafMul(this,t)},qr.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)===0},qr.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(r)===0)return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}},qr.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},qr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var nh=ec(function(t,e){var r=e;r.base=ko,r.short=gS,r.mont=null,r.edwards=null}),sh=ec(function(t,e){var r=e,i=Bi.assert;function n(u){u.type==="short"?this.curve=new nh.short(u):u.type==="edwards"?this.curve=new nh.edwards(u):this.curve=new nh.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=n;function s(u,l){Object.defineProperty(r,u,{configurable:!0,enumerable:!0,get:function(){var d=new n(l);return Object.defineProperty(r,u,{configurable:!0,enumerable:!0,value:d}),d}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Jn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Jn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Jn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Jn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Jn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Jn.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Jn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=null.crash()}catch{a=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Jn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})});function io(t){if(!(this instanceof io))return new io(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=En.toArray(t.entropy,t.entropyEnc||"hex"),r=En.toArray(t.nonce,t.nonceEnc||"hex"),i=En.toArray(t.pers,t.persEnc||"hex");gd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var km=io;io.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},io.prototype._hmac=function(){return new Jn.hmac(this.hash,this.K)},io.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},io.prototype.reseed=function(t,e,r,i){typeof e!="string"&&(i=r,r=e,e=null),t=En.toArray(t,e),r=En.toArray(r,i),gd(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},io.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(i=r,r=e,e=null),r&&(r=En.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<t;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var s=n.slice(0,t);return this._update(r),this._reseed++,En.encode(s,e)};var md=Bi.assert;function Yr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var bd=Yr;Yr.fromPublic=function(t,e,r){return e instanceof Yr?e:new Yr(t,{pub:e,pubEnc:r})},Yr.fromPrivate=function(t,e,r){return e instanceof Yr?e:new Yr(t,{priv:e,privEnc:r})},Yr.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Yr.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},Yr.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv},Yr.prototype._importPrivate=function(t,e){this.priv=new mt(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Yr.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?md(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&md(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)},Yr.prototype.derive=function(t){return t.validate()||md(t.validate(),"public point not validated"),t.mul(this.priv).getX()},Yr.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},Yr.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Yr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var vS=Bi.assert;function oh(t,e){if(t instanceof oh)return t;this._importDER(t,e)||(vS(t.r&&t.s,"Signature without r or s"),this.r=new mt(t.r,16),this.s=new mt(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var ah=oh;function mS(){this.place=0}function yd(t,e){var r=t[e.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var n=0,s=0,a=e.place;s<i;s++,a++)n<<=8,n|=t[a],n>>>=0;return n<=127?!1:(e.place=a,n)}function jm(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}oh.prototype._importDER=function(t,e){t=Bi.toArray(t,e);var r=new mS;if(t[r.place++]!==48)return!1;var i=yd(t,r);if(i===!1||i+r.place!==t.length||t[r.place++]!==2)return!1;var n=yd(t,r);if(n===!1)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,t[r.place++]!==2)return!1;var a=yd(t,r);if(a===!1||t.length!==a+r.place)return!1;var u=t.slice(r.place,a+r.place);if(s[0]===0)if(s[1]&128)s=s.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new mt(s),this.s=new mt(u),this.recoveryParam=null,!0};function wd(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}oh.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),r[0]&128&&(r=[0].concat(r)),e=jm(e),r=jm(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var i=[2];wd(i,e.length),i=i.concat(e),i.push(2),wd(i,r.length);var n=i.concat(r),s=[48];return wd(s,n.length),s=s.concat(n),Bi.encode(s,t)};var bS=function(){throw new Error("unsupported")},qm=Bi.assert;function Zi(t){if(!(this instanceof Zi))return new Zi(t);typeof t=="string"&&(qm(Object.prototype.hasOwnProperty.call(sh,t),"Unknown curve "+t),t=sh[t]),t instanceof sh.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var yS=Zi;Zi.prototype.keyPair=function(t){return new bd(this,t)},Zi.prototype.keyFromPrivate=function(t,e){return bd.fromPrivate(this,t,e)},Zi.prototype.keyFromPublic=function(t,e){return bd.fromPublic(this,t,e)},Zi.prototype.genKeyPair=function(t){t||(t={});for(var e=new km({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||bS(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new mt(2));;){var n=new mt(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Zi.prototype._truncateToN=function(t,e){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},Zi.prototype.sign=function(t,e,r,i){typeof r=="object"&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new mt(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),a=t.toArray("be",n),u=new km({hash:this.hash,entropy:s,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new mt(1)),d=0;;d++){var b=i.k?i.k(d):new mt(u.generate(this.n.byteLength()));if(b=this._truncateToN(b,!0),!(b.cmpn(1)<=0||b.cmp(l)>=0)){var w=this.g.mul(b);if(!w.isInfinity()){var S=w.getX(),I=S.umod(this.n);if(I.cmpn(0)!==0){var D=b.invm(this.n).mul(I.mul(e.getPrivate()).iadd(t));if(D=D.umod(this.n),D.cmpn(0)!==0){var L=(w.getY().isOdd()?1:0)|(S.cmp(I)!==0?2:0);return i.canonical&&D.cmp(this.nh)>0&&(D=this.n.sub(D),L^=1),new ah({r:I,s:D,recoveryParam:L})}}}}}},Zi.prototype.verify=function(t,e,r,i){t=this._truncateToN(new mt(t,16)),r=this.keyFromPublic(r,i),e=new ah(e,"hex");var n=e.r,s=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a=s.invm(this.n),u=a.mul(t).umod(this.n),l=a.mul(n).umod(this.n),d;return this.curve._maxwellTrick?(d=this.g.jmulAdd(u,r.getPublic(),l),d.isInfinity()?!1:d.eqXToP(n)):(d=this.g.mulAdd(u,r.getPublic(),l),d.isInfinity()?!1:d.getX().umod(this.n).cmp(n)===0)},Zi.prototype.recoverPubKey=function(t,e,r,i){qm((3&r)===r,"The recovery param is more than two bits"),e=new ah(e,i);var n=this.n,s=new mt(t),a=e.r,u=e.s,l=r&1,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");d?a=this.curve.pointFromX(a.add(this.curve.n),l):a=this.curve.pointFromX(a,l);var b=e.r.invm(n),w=n.sub(s).mul(b).umod(n),S=u.mul(b).umod(n);return this.g.mulAdd(w,a,S)},Zi.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new ah(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch{continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var wS=ec(function(t,e){var r=e;r.version="6.5.4",r.utils=Bi,r.rand=function(){throw new Error("unsupported")},r.curve=nh,r.curves=sh,r.ec=yS,r.eddsa=null}),_S=wS.ec;const ES="signing-key/5.7.0",_d=new Et(ES);let Ed=null;function ns(){return Ed||(Ed=new _S("secp256k1")),Ed}class AS{constructor(e){hu(this,"curve","secp256k1"),hu(this,"privateKey",ni(e)),sA(this.privateKey)!==32&&_d.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=ns().keyFromPrivate(lr(this.privateKey));hu(this,"publicKey","0x"+r.getPublic(!1,"hex")),hu(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),hu(this,"_isSigningKey",!0)}_addPoint(e){const r=ns().keyFromPublic(lr(this.publicKey)),i=ns().keyFromPublic(lr(e));return"0x"+r.pub.add(i.pub).encodeCompressed("hex")}signDigest(e){const r=ns().keyFromPrivate(lr(this.privateKey)),i=lr(e);i.length!==32&&_d.throwArgumentError("bad digest length","digest",e);const n=r.sign(i,{canonical:!0});return Zv({recoveryParam:n.recoveryParam,r:Yn("0x"+n.r.toString(16),32),s:Yn("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const r=ns().keyFromPrivate(lr(this.privateKey)),i=ns().keyFromPublic(lr(zm(e)));return Yn("0x"+r.derive(i.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function xS(t,e){const r=Zv(e),i={r:lr(r.r),s:lr(r.s)};return"0x"+ns().recoverPubKey(lr(t),i,r.recoveryParam).encode("hex",!1)}function zm(t,e){const r=lr(t);if(r.length===32){const i=new AS(r);return e?"0x"+ns().keyFromPrivate(r).getPublic(!0,"hex"):i.publicKey}else{if(r.length===33)return e?ni(r):"0x"+ns().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+ns().keyFromPublic(r).getPublic(!0,"hex"):ni(r)}return _d.throwArgumentError("invalid public or private key","key","[REDACTED]")}const SS="transactions/5.7.0";new Et(SS);var Hm;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Hm||(Hm={}));function IS(t){const e=zm(t);return LA(Qv(rd(Qv(e,1)),12))}function MS(t,e){return IS(xS(lr(t),e))}const CS="https://rpc.walletconnect.com/v1";async function DS(t,e,r,i,n,s){switch(r.t){case"eip191":return OS(t,e,r.s);case"eip1271":return await PS(t,e,r.s,i,n,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function OS(t,e,r){return MS(pm(e),r).toLowerCase()===t.toLowerCase()}async function PS(t,e,r,i,n,s){try{const a="0x1626ba7e",u="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",d=r.substring(2),b=pm(e).substring(2),w=a+b+u+l+d,S=await fetch(`${s||CS}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:$S(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:w},"latest"]})}),{result:I}=await S.json();return I?I.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function $S(){return Date.now()+Math.floor(Math.random()*1e3)}var RS=Object.defineProperty,NS=Object.defineProperties,TS=Object.getOwnPropertyDescriptors,Km=Object.getOwnPropertySymbols,LS=Object.prototype.hasOwnProperty,BS=Object.prototype.propertyIsEnumerable,Wm=(t,e,r)=>e in t?RS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,FS=(t,e)=>{for(var r in e||(e={}))LS.call(e,r)&&Wm(t,r,e[r]);if(Km)for(var r of Km(e))BS.call(e,r)&&Wm(t,r,e[r]);return t},US=(t,e)=>NS(t,TS(e));const kS="did:pkh:",Ad=t=>t?.split(":"),Vm=t=>{const e=t&&Ad(t);if(e)return t.includes(kS)?e[3]:e[1]},Gm=t=>{const e=t&&Ad(t);if(e)return e[2]+":"+e[3]},ch=t=>{const e=t&&Ad(t);if(e)return e.pop()};async function Ym(t){const{cacao:e,projectId:r}=t,{s:i,p:n}=e,s=Jm(n,n.iss),a=ch(n.iss);return await DS(a,s,i,Vm(n.iss),r)}const Jm=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,i=ch(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,a=`Version: ${t.version}`,u=`Chain ID: ${Vm(e)}`,l=`Nonce: ${t.nonce}`,d=`Issued At: ${t.iat}`,b=t.exp?`Expiration Time: ${t.exp}`:void 0,w=t.nbf?`Not Before: ${t.nbf}`:void 0,S=t.requestId?`Request ID: ${t.requestId}`:void 0,I=t.resources?`Resources:${t.resources.map(L=>`
23
- - ${L}`).join("")}`:void 0,D=uh(t.resources);if(D){const L=gu(D);n=YS(n,L)}return[r,i,"",n,"",s,a,u,l,d,b,w,S,I].filter(L=>L!=null).join(`
24
- `)};function jS(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function qS(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function jo(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const i=t.att[r];if(Array.isArray(i))throw new Error(`Resource must be an object: ${r}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(i).forEach(n=>{const s=i[n];if(!Array.isArray(s))throw new Error(`Ability limits ${n} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${n} is empty array, must be an array with objects`);s.forEach(a=>{if(typeof a!="object")throw new Error(`Ability limits (${n}) must be an array of objects, found: ${a}`)})})})}function zS(t,e,r,i={}){return r?.sort((n,s)=>n.localeCompare(s)),{att:{[t]:HS(e,r,i)}}}function HS(t,e,r={}){e=e?.sort((n,s)=>n.localeCompare(s));const i=e.map(n=>({[`${t}/${n}`]:[r]}));return Object.assign({},...i)}function Qm(t){return jo(t),`urn:recap:${jS(t).replace(/=/g,"")}`}function gu(t){const e=qS(t.replace("urn:recap:",""));return jo(e),e}function KS(t,e,r){const i=zS(t,e,r);return Qm(i)}function WS(t){return t&&t.includes("urn:recap:")}function VS(t,e){const r=gu(t),i=gu(e),n=GS(r,i);return Qm(n)}function GS(t,e){jo(t),jo(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((n,s)=>n.localeCompare(s)),i={att:{}};return r.forEach(n=>{var s,a;Object.keys(((s=t.att)==null?void 0:s[n])||{}).concat(Object.keys(((a=e.att)==null?void 0:a[n])||{})).sort((u,l)=>u.localeCompare(l)).forEach(u=>{var l,d;i.att[n]=US(FS({},i.att[n]),{[u]:((l=t.att[n])==null?void 0:l[u])||((d=e.att[n])==null?void 0:d[u])})})}),i}function YS(t="",e){jo(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const i=[];let n=0;Object.keys(e.att).forEach(u=>{const l=Object.keys(e.att[u]).map(w=>({ability:w.split("/")[0],action:w.split("/")[1]}));l.sort((w,S)=>w.action.localeCompare(S.action));const d={};l.forEach(w=>{d[w.ability]||(d[w.ability]=[]),d[w.ability].push(w.action)});const b=Object.keys(d).map(w=>(n++,`(${n}) '${w}': '${d[w].join("', '")}' for '${u}'.`));i.push(b.join(", ").replace(".,","."))});const s=i.join(" "),a=`${r}${s}`;return`${t?t+" ":""}${a}`}function Zm(t){var e;const r=gu(t);jo(r);const i=(e=r.att)==null?void 0:e.eip155;return i?Object.keys(i).map(n=>n.split("/")[1]):[]}function Xm(t){const e=gu(t);jo(e);const r=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(n=>{var s;(s=n?.[0])!=null&&s.chains&&r.push(n[0].chains)})}),[...new Set(r.flat())]}function uh(t){if(!t)return;const e=t?.[t.length-1];return WS(e)?e:void 0}var JS=Object.defineProperty,QS=Object.defineProperties,ZS=Object.getOwnPropertyDescriptors,eb=Object.getOwnPropertySymbols,XS=Object.prototype.hasOwnProperty,eI=Object.prototype.propertyIsEnumerable,tb=(t,e,r)=>e in t?JS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,tI=(t,e)=>{for(var r in e||(e={}))XS.call(e,r)&&tb(t,r,e[r]);if(eb)for(var r of eb(e))eI.call(e,r)&&tb(t,r,e[r]);return t},rI=(t,e)=>QS(t,ZS(e));const rb="base10",oi="base16",xd="base64pad",Sd="utf8",ib=0,Ps=1,iI=0,nb=1,Id=12,Md=32;function nI(){const t=D0.generateKeyPair();return{privateKey:vn(t.secretKey,oi),publicKey:vn(t.publicKey,oi)}}function Cd(){const t=Ma.randomBytes(Md);return vn(t,oi)}function sI(t,e){const r=D0.sharedKey(gn(t,oi),gn(e,oi),!0),i=new S8(Jc.SHA256,r).expand(Md);return vn(i,oi)}function fh(t){const e=Jc.hash(gn(t,oi));return vn(e,oi)}function $s(t){const e=Jc.hash(gn(t,Sd));return vn(e,oi)}function oI(t){return gn(`${t}`,rb)}function vu(t){return Number(vn(t,rb))}function aI(t){const e=oI(typeof t.type<"u"?t.type:ib);if(vu(e)===Ps&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?gn(t.senderPublicKey,oi):void 0,i=typeof t.iv<"u"?gn(t.iv,oi):Ma.randomBytes(Id),n=new _0.ChaCha20Poly1305(gn(t.symKey,oi)).seal(i,gn(t.message,Sd));return uI({type:e,sealed:n,iv:i,senderPublicKey:r})}function cI(t){const e=new _0.ChaCha20Poly1305(gn(t.symKey,oi)),{sealed:r,iv:i}=hh(t.encoded),n=e.open(i,r);if(n===null)throw new Error("Failed to decrypt");return vn(n,Sd)}function uI(t){if(vu(t.type)===Ps){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return vn(E2([t.type,t.senderPublicKey,t.iv,t.sealed]),xd)}return vn(E2([t.type,t.iv,t.sealed]),xd)}function hh(t){const e=gn(t,xd),r=e.slice(iI,nb),i=nb;if(vu(r)===Ps){const u=i+Md,l=u+Id,d=e.slice(i,u),b=e.slice(u,l),w=e.slice(l);return{type:r,sealed:w,iv:b,senderPublicKey:d}}const n=i+Id,s=e.slice(i,n),a=e.slice(n);return{type:r,sealed:a,iv:s}}function fI(t,e){const r=hh(t);return sb({type:vu(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?vn(r.senderPublicKey,oi):void 0,receiverPublicKey:e?.receiverPublicKey})}function sb(t){const e=t?.type||ib;if(e===Ps){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function ob(t){return t.type===Ps&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function hI(t){return new U2.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function lI(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function dI(t){return Buffer.from(lI(t),"base64")}function pI(t,e){const[r,i,n]=t.split("."),s=dI(n);if(s.length!==64)throw new Error("Invalid signature length");const a=s.slice(0,32).toString("hex"),u=s.slice(32,64).toString("hex"),l=`${r}.${i}`,d=new Jc.SHA256().update(Buffer.from(l)).digest(),b=hI(e),w=Buffer.from(d).toString("hex"),S=b.verify(w,{r:a,s:u});if(!S)throw new Error("Invalid signature");const I=Z0(t);return rI(tI({},I.payload),{isVerified:S})}const gI="irn";function Dd(t){return t?.relay||{protocol:gI}}function mu(t){const e=$E[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var vI=Object.defineProperty,mI=Object.defineProperties,bI=Object.getOwnPropertyDescriptors,ab=Object.getOwnPropertySymbols,yI=Object.prototype.hasOwnProperty,wI=Object.prototype.propertyIsEnumerable,cb=(t,e,r)=>e in t?vI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ub=(t,e)=>{for(var r in e||(e={}))yI.call(e,r)&&cb(t,r,e[r]);if(ab)for(var r of ab(e))wI.call(e,r)&&cb(t,r,e[r]);return t},_I=(t,e)=>mI(t,bI(e));function EI(t,e="-"){const r={},i="relay"+e;return Object.keys(t).forEach(n=>{if(n.startsWith(i)){const s=n.replace(i,""),a=t[n];r[s]=a}}),r}function fb(t){t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,i=t.substring(0,e),n=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",a=Gc.parse(s),u=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:i,topic:AI(n[0]),version:parseInt(n[1],10),symKey:a.symKey,relay:EI(a),methods:u,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function AI(t){return t.startsWith("//")?t.substring(2):t}function xI(t,e="-"){const r="relay",i={};return Object.keys(t).forEach(n=>{const s=r+e+n;t[n]&&(i[s]=t[n])}),i}function SI(t){return`${t.protocol}:${t.topic}@${t.version}?`+Gc.stringify(ub(_I(ub({symKey:t.symKey},xI(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function tc(t){const e=[];return t.forEach(r=>{const[i,n]=r.split(":");e.push(`${i}:${n}`)}),e}function II(t){const e=[];return Object.values(t).forEach(r=>{e.push(...tc(r.accounts))}),e}function MI(t,e){const r=[];return Object.values(t).forEach(i=>{tc(i.accounts).includes(e)&&r.push(...i.methods)}),r}function CI(t,e){const r=[];return Object.values(t).forEach(i=>{tc(i.accounts).includes(e)&&r.push(...i.events)}),r}function Od(t){return t.includes(":")}function bu(t){return Od(t)?t.split(":")[0]:t}function DI(t){const e={};return t?.forEach(r=>{const[i,n]=r.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[]}),e[i].accounts.push(r),e[i].chains.push(`${i}:${n}`)}),e}function hb(t,e){e=e.map(i=>i.replace("did:pkh:",""));const r=DI(e);for(const[i,n]of Object.entries(r))n.methods?n.methods=Gf(n.methods,t):n.methods=t,n.events=["chainChanged","accountsChanged"];return r}const OI={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},PI={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Ee(t,e){const{message:r,code:i}=PI[t];return{message:e?`${r} ${e}`:r,code:i}}function Gt(t,e){const{message:r,code:i}=OI[t];return{message:e?`${r} ${e}`:r,code:i}}function ss(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function yu(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function ai(t){return typeof t>"u"}function mr(t,e){return e&&ai(t)?!0:typeof t=="string"&&!!t.trim().length}function Pd(t,e){return e&&ai(t)?!0:typeof t=="number"&&!isNaN(t)}function $I(t,e){const{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),n=Object.keys(r);let s=!0;return Bo(n,i)?(i.forEach(a=>{const{accounts:u,methods:l,events:d}=t.namespaces[a],b=tc(u),w=r[a];(!Bo(Nv(a,w),b)||!Bo(w.methods,l)||!Bo(w.events,d))&&(s=!1)}),s):!1}function lh(t){return mr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function RI(t){if(mr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&lh(r)}}return!1}function NI(t){if(mr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function TI(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function LI(t){return t?.topic}function BI(t,e){let r=null;return mr(t?.publicKey,!1)||(r=Ee("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function lb(t){let e=!0;return ss(t)?t.length&&(e=t.every(r=>mr(r,!1))):e=!1,e}function FI(t,e,r){let i=null;return ss(e)&&e.length?e.forEach(n=>{i||lh(n)||(i=Gt("UNSUPPORTED_CHAINS",`${r}, chain ${n} should be a string and conform to "namespace:chainId" format`))}):lh(t)||(i=Gt("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}function UI(t,e,r){let i=null;return Object.entries(t).forEach(([n,s])=>{if(i)return;const a=FI(n,Nv(n,s),`${e} ${r}`);a&&(i=a)}),i}function kI(t,e){let r=null;return ss(t)?t.forEach(i=>{r||RI(i)||(r=Gt("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):r=Gt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function jI(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const n=kI(i?.accounts,`${e} namespace`);n&&(r=n)}),r}function qI(t,e){let r=null;return lb(t?.methods)?lb(t?.events)||(r=Gt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Gt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function db(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const n=qI(i,`${e}, namespace`);n&&(r=n)}),r}function zI(t,e,r){let i=null;if(t&&yu(t)){const n=db(t,e);n&&(i=n);const s=UI(t,e,r);s&&(i=s)}else i=Ee("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}function $d(t,e){let r=null;if(t&&yu(t)){const i=db(t,e);i&&(r=i);const n=jI(t,e);n&&(r=n)}else r=Ee("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function pb(t){return mr(t.protocol,!0)}function HI(t,e){let r=!1;return e&&!t?r=!0:t&&ss(t)&&t.length&&t.forEach(i=>{r=pb(i)}),r}function KI(t){return typeof t=="number"}function yi(t){return typeof t<"u"&&typeof t!==null}function WI(t){return!(!t||typeof t!="object"||!t.code||!Pd(t.code,!1)||!t.message||!mr(t.message,!1))}function VI(t){return!(ai(t)||!mr(t.method,!1))}function GI(t){return!(ai(t)||ai(t.result)&&ai(t.error)||!Pd(t.id,!1)||!mr(t.jsonrpc,!1))}function YI(t){return!(ai(t)||!mr(t.name,!1))}function gb(t,e){return!(!lh(e)||!II(t).includes(e))}function JI(t,e,r){return mr(r,!1)?MI(t,e).includes(r):!1}function QI(t,e,r){return mr(r,!1)?CI(t,e).includes(r):!1}function vb(t,e,r){let i=null;const n=ZI(t),s=XI(e),a=Object.keys(n),u=Object.keys(s),l=mb(Object.keys(t)),d=mb(Object.keys(e)),b=l.filter(w=>!d.includes(w));return b.length&&(i=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
21
+ */(function(t){(function(){var e="input is invalid type",r="finalize already called",i=typeof window=="object",n=i?window:{};n.JS_SHA3_NO_WINDOW&&(i=!1);var s=!i&&typeof self=="object",a=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;a?n=qv:s&&(n=self);var u=!n.JS_SHA3_NO_COMMON_JS&&!0&&t.exports,l=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",d="0123456789abcdef".split(""),b=[31,7936,2031616,520093696],w=[4,1024,262144,67108864],I=[1,256,65536,16777216],S=[6,1536,393216,100663296],D=[0,8,16,24],L=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],K=[224,256,384,512],H=[128,256],U=["hex","buffer","arrayBuffer","array","digest"],W={128:168,256:136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(O){return Object.prototype.toString.call(O)==="[object Array]"}),l&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(O){return typeof O=="object"&&O.buffer&&O.buffer.constructor===ArrayBuffer});for(var R=function(O,te,q){return function(G){return new N(O,te,O).update(G)[q]()}},k=function(O,te,q){return function(G,Y){return new N(O,te,Y).update(G)[q]()}},z=function(O,te,q){return function(G,Y,A,V){return h["cshake"+O].update(G,Y,A,V)[q]()}},_=function(O,te,q){return function(G,Y,A,V){return h["kmac"+O].update(G,Y,A,V)[q]()}},B=function(O,te,q,G){for(var Y=0;Y<U.length;++Y){var A=U[Y];O[A]=te(q,G,A)}return O},X=function(O,te){var q=R(O,te,"hex");return q.create=function(){return new N(O,te,O)},q.update=function(G){return q.create().update(G)},B(q,R,O,te)},re=function(O,te){var q=k(O,te,"hex");return q.create=function(G){return new N(O,te,G)},q.update=function(G,Y){return q.create(Y).update(G)},B(q,k,O,te)},T=function(O,te){var q=W[O],G=z(O,te,"hex");return G.create=function(Y,A,V){return!A&&!V?h["shake"+O].create(Y):new N(O,te,Y).bytepad([A,V],q)},G.update=function(Y,A,V,oe){return G.create(A,V,oe).update(Y)},B(G,z,O,te)},y=function(O,te){var q=W[O],G=_(O,te,"hex");return G.create=function(Y,A,V){return new ee(O,te,A).bytepad(["KMAC",V],q).bytepad([Y],q)},G.update=function(Y,A,V,oe){return G.create(Y,V,oe).update(A)},B(G,_,O,te)},f=[{name:"keccak",padding:I,bits:K,createMethod:X},{name:"sha3",padding:S,bits:K,createMethod:X},{name:"shake",padding:b,bits:H,createMethod:re},{name:"cshake",padding:w,bits:H,createMethod:T},{name:"kmac",padding:w,bits:H,createMethod:y}],h={},v=[],E=0;E<f.length;++E)for(var C=f[E],P=C.bits,M=0;M<P.length;++M){var g=C.name+"_"+P[M];if(v.push(g),h[g]=C.createMethod(P[M],C.padding),C.name!=="sha3"){var m=C.name+P[M];v.push(m),h[m]=h[g]}}function N(O,te,q){this.blocks=[],this.s=[],this.padding=te,this.outputBits=q,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(O<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=q>>5,this.extraBytes=(q&31)>>3;for(var G=0;G<50;++G)this.s[G]=0}N.prototype.update=function(O){if(this.finalized)throw new Error(r);var te,q=typeof O;if(q!=="string"){if(q==="object"){if(O===null)throw new Error(e);if(l&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!l||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);te=!0}for(var G=this.blocks,Y=this.byteCount,A=O.length,V=this.blockCount,oe=0,ue=this.s,he,ye;oe<A;){if(this.reset)for(this.reset=!1,G[0]=this.block,he=1;he<V+1;++he)G[he]=0;if(te)for(he=this.start;oe<A&&he<Y;++oe)G[he>>2]|=O[oe]<<D[he++&3];else for(he=this.start;oe<A&&he<Y;++oe)ye=O.charCodeAt(oe),ye<128?G[he>>2]|=ye<<D[he++&3]:ye<2048?(G[he>>2]|=(192|ye>>6)<<D[he++&3],G[he>>2]|=(128|ye&63)<<D[he++&3]):ye<55296||ye>=57344?(G[he>>2]|=(224|ye>>12)<<D[he++&3],G[he>>2]|=(128|ye>>6&63)<<D[he++&3],G[he>>2]|=(128|ye&63)<<D[he++&3]):(ye=65536+((ye&1023)<<10|O.charCodeAt(++oe)&1023),G[he>>2]|=(240|ye>>18)<<D[he++&3],G[he>>2]|=(128|ye>>12&63)<<D[he++&3],G[he>>2]|=(128|ye>>6&63)<<D[he++&3],G[he>>2]|=(128|ye&63)<<D[he++&3]);if(this.lastByteIndex=he,he>=Y){for(this.start=he-Y,this.block=G[V],he=0;he<V;++he)ue[he]^=G[he];ae(ue),this.reset=!0}else this.start=he}return this},N.prototype.encode=function(O,te){var q=O&255,G=1,Y=[q];for(O=O>>8,q=O&255;q>0;)Y.unshift(q),O=O>>8,q=O&255,++G;return te?Y.push(G):Y.unshift(G),this.update(Y),Y.length},N.prototype.encodeString=function(O){var te,q=typeof O;if(q!=="string"){if(q==="object"){if(O===null)throw new Error(e);if(l&&O.constructor===ArrayBuffer)O=new Uint8Array(O);else if(!Array.isArray(O)&&(!l||!ArrayBuffer.isView(O)))throw new Error(e)}else throw new Error(e);te=!0}var G=0,Y=O.length;if(te)G=Y;else for(var A=0;A<O.length;++A){var V=O.charCodeAt(A);V<128?G+=1:V<2048?G+=2:V<55296||V>=57344?G+=3:(V=65536+((V&1023)<<10|O.charCodeAt(++A)&1023),G+=4)}return G+=this.encode(G*8),this.update(O),G},N.prototype.bytepad=function(O,te){for(var q=this.encode(te),G=0;G<O.length;++G)q+=this.encodeString(O[G]);var Y=te-q%te,A=[];return A.length=Y,this.update(A),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var O=this.blocks,te=this.lastByteIndex,q=this.blockCount,G=this.s;if(O[te>>2]|=this.padding[te&3],this.lastByteIndex===this.byteCount)for(O[0]=O[q],te=1;te<q+1;++te)O[te]=0;for(O[q-1]|=2147483648,te=0;te<q;++te)G[te]^=O[te];ae(G)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var O=this.blockCount,te=this.s,q=this.outputBlocks,G=this.extraBytes,Y=0,A=0,V="",oe;A<q;){for(Y=0;Y<O&&A<q;++Y,++A)oe=te[Y],V+=d[oe>>4&15]+d[oe&15]+d[oe>>12&15]+d[oe>>8&15]+d[oe>>20&15]+d[oe>>16&15]+d[oe>>28&15]+d[oe>>24&15];A%O===0&&(ae(te),Y=0)}return G&&(oe=te[Y],V+=d[oe>>4&15]+d[oe&15],G>1&&(V+=d[oe>>12&15]+d[oe>>8&15]),G>2&&(V+=d[oe>>20&15]+d[oe>>16&15])),V},N.prototype.arrayBuffer=function(){this.finalize();var O=this.blockCount,te=this.s,q=this.outputBlocks,G=this.extraBytes,Y=0,A=0,V=this.outputBits>>3,oe;G?oe=new ArrayBuffer(q+1<<2):oe=new ArrayBuffer(V);for(var ue=new Uint32Array(oe);A<q;){for(Y=0;Y<O&&A<q;++Y,++A)ue[A]=te[Y];A%O===0&&ae(te)}return G&&(ue[Y]=te[Y],oe=oe.slice(0,V)),oe},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var O=this.blockCount,te=this.s,q=this.outputBlocks,G=this.extraBytes,Y=0,A=0,V=[],oe,ue;A<q;){for(Y=0;Y<O&&A<q;++Y,++A)oe=A<<2,ue=te[Y],V[oe]=ue&255,V[oe+1]=ue>>8&255,V[oe+2]=ue>>16&255,V[oe+3]=ue>>24&255;A%O===0&&ae(te)}return G&&(oe=A<<2,ue=te[Y],V[oe]=ue&255,G>1&&(V[oe+1]=ue>>8&255),G>2&&(V[oe+2]=ue>>16&255)),V};function ee(O,te,q){N.call(this,O,te,q)}ee.prototype=new N,ee.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var ae=function(O){var te,q,G,Y,A,V,oe,ue,he,ye,we,Re,Xe,Oe,Ne,Me,be,Pe,Te,ve,$e,xe,me,Ue,Ce,_e,Ke,Ve,Ae,We,pt,Ge,It,gt,Je,Ot,Tt,Le,et,it,Be,rt,tt,je,ht,nt,qe,st,at,Fe,Ze,lt,ze,jt,qt,ct,_t,Qr,Zr,Xr,ei,ti,pr;for(G=0;G<48;G+=2)Y=O[0]^O[10]^O[20]^O[30]^O[40],A=O[1]^O[11]^O[21]^O[31]^O[41],V=O[2]^O[12]^O[22]^O[32]^O[42],oe=O[3]^O[13]^O[23]^O[33]^O[43],ue=O[4]^O[14]^O[24]^O[34]^O[44],he=O[5]^O[15]^O[25]^O[35]^O[45],ye=O[6]^O[16]^O[26]^O[36]^O[46],we=O[7]^O[17]^O[27]^O[37]^O[47],Re=O[8]^O[18]^O[28]^O[38]^O[48],Xe=O[9]^O[19]^O[29]^O[39]^O[49],te=Re^(V<<1|oe>>>31),q=Xe^(oe<<1|V>>>31),O[0]^=te,O[1]^=q,O[10]^=te,O[11]^=q,O[20]^=te,O[21]^=q,O[30]^=te,O[31]^=q,O[40]^=te,O[41]^=q,te=Y^(ue<<1|he>>>31),q=A^(he<<1|ue>>>31),O[2]^=te,O[3]^=q,O[12]^=te,O[13]^=q,O[22]^=te,O[23]^=q,O[32]^=te,O[33]^=q,O[42]^=te,O[43]^=q,te=V^(ye<<1|we>>>31),q=oe^(we<<1|ye>>>31),O[4]^=te,O[5]^=q,O[14]^=te,O[15]^=q,O[24]^=te,O[25]^=q,O[34]^=te,O[35]^=q,O[44]^=te,O[45]^=q,te=ue^(Re<<1|Xe>>>31),q=he^(Xe<<1|Re>>>31),O[6]^=te,O[7]^=q,O[16]^=te,O[17]^=q,O[26]^=te,O[27]^=q,O[36]^=te,O[37]^=q,O[46]^=te,O[47]^=q,te=ye^(Y<<1|A>>>31),q=we^(A<<1|Y>>>31),O[8]^=te,O[9]^=q,O[18]^=te,O[19]^=q,O[28]^=te,O[29]^=q,O[38]^=te,O[39]^=q,O[48]^=te,O[49]^=q,Oe=O[0],Ne=O[1],nt=O[11]<<4|O[10]>>>28,qe=O[10]<<4|O[11]>>>28,Ve=O[20]<<3|O[21]>>>29,Ae=O[21]<<3|O[20]>>>29,Xr=O[31]<<9|O[30]>>>23,ei=O[30]<<9|O[31]>>>23,rt=O[40]<<18|O[41]>>>14,tt=O[41]<<18|O[40]>>>14,gt=O[2]<<1|O[3]>>>31,Je=O[3]<<1|O[2]>>>31,Me=O[13]<<12|O[12]>>>20,be=O[12]<<12|O[13]>>>20,st=O[22]<<10|O[23]>>>22,at=O[23]<<10|O[22]>>>22,We=O[33]<<13|O[32]>>>19,pt=O[32]<<13|O[33]>>>19,ti=O[42]<<2|O[43]>>>30,pr=O[43]<<2|O[42]>>>30,jt=O[5]<<30|O[4]>>>2,qt=O[4]<<30|O[5]>>>2,Ot=O[14]<<6|O[15]>>>26,Tt=O[15]<<6|O[14]>>>26,Pe=O[25]<<11|O[24]>>>21,Te=O[24]<<11|O[25]>>>21,Fe=O[34]<<15|O[35]>>>17,Ze=O[35]<<15|O[34]>>>17,Ge=O[45]<<29|O[44]>>>3,It=O[44]<<29|O[45]>>>3,Ue=O[6]<<28|O[7]>>>4,Ce=O[7]<<28|O[6]>>>4,ct=O[17]<<23|O[16]>>>9,_t=O[16]<<23|O[17]>>>9,Le=O[26]<<25|O[27]>>>7,et=O[27]<<25|O[26]>>>7,ve=O[36]<<21|O[37]>>>11,$e=O[37]<<21|O[36]>>>11,lt=O[47]<<24|O[46]>>>8,ze=O[46]<<24|O[47]>>>8,je=O[8]<<27|O[9]>>>5,ht=O[9]<<27|O[8]>>>5,_e=O[18]<<20|O[19]>>>12,Ke=O[19]<<20|O[18]>>>12,Qr=O[29]<<7|O[28]>>>25,Zr=O[28]<<7|O[29]>>>25,it=O[38]<<8|O[39]>>>24,Be=O[39]<<8|O[38]>>>24,xe=O[48]<<14|O[49]>>>18,me=O[49]<<14|O[48]>>>18,O[0]=Oe^~Me&Pe,O[1]=Ne^~be&Te,O[10]=Ue^~_e&Ve,O[11]=Ce^~Ke&Ae,O[20]=gt^~Ot&Le,O[21]=Je^~Tt&et,O[30]=je^~nt&st,O[31]=ht^~qe&at,O[40]=jt^~ct&Qr,O[41]=qt^~_t&Zr,O[2]=Me^~Pe&ve,O[3]=be^~Te&$e,O[12]=_e^~Ve&We,O[13]=Ke^~Ae&pt,O[22]=Ot^~Le&it,O[23]=Tt^~et&Be,O[32]=nt^~st&Fe,O[33]=qe^~at&Ze,O[42]=ct^~Qr&Xr,O[43]=_t^~Zr&ei,O[4]=Pe^~ve&xe,O[5]=Te^~$e&me,O[14]=Ve^~We&Ge,O[15]=Ae^~pt&It,O[24]=Le^~it&rt,O[25]=et^~Be&tt,O[34]=st^~Fe&lt,O[35]=at^~Ze&ze,O[44]=Qr^~Xr&ti,O[45]=Zr^~ei&pr,O[6]=ve^~xe&Oe,O[7]=$e^~me&Ne,O[16]=We^~Ge&Ue,O[17]=pt^~It&Ce,O[26]=it^~rt&gt,O[27]=Be^~tt&Je,O[36]=Fe^~lt&je,O[37]=Ze^~ze&ht,O[46]=Xr^~ti&jt,O[47]=ei^~pr&qt,O[8]=xe^~Oe&Me,O[9]=me^~Ne&be,O[18]=Ge^~Ue&_e,O[19]=It^~Ce&Ke,O[28]=rt^~gt&Ot,O[29]=tt^~Je&Tt,O[38]=lt^~je&nt,O[39]=ze^~ht&qe,O[48]=ti^~jt&ct,O[49]=pr^~qt&_t,O[0]^=L[G],O[1]^=L[G+1]};if(u)t.exports=h;else for(E=0;E<v.length;++E)n[v[E]]=h[v[E]]})()})(zv);var JE=zv.exports;const QE="logger/5.7.0";let Hv=!1,Kv=!1;const Jf={debug:1,default:2,info:2,warning:3,error:4,off:5};let Wv=Jf.default,X0=null;function ZE(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}const Vv=ZE();var ed;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(ed||(ed={}));var yn;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(yn||(yn={}));const Gv="0123456789abcdef";class Et{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){const i=e.toLowerCase();Jf[i]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(Wv>Jf[i])&&console.log.apply(console,r)}debug(...e){this._log(Et.levels.DEBUG,e)}info(...e){this._log(Et.levels.INFO,e)}warn(...e){this._log(Et.levels.WARNING,e)}makeError(e,r,i){if(Kv)return this.makeError("censored error",r,{});r||(r=Et.errors.UNKNOWN_ERROR),i||(i={});const n=[];Object.keys(i).forEach(l=>{const d=i[l];try{if(d instanceof Uint8Array){let b="";for(let w=0;w<d.length;w++)b+=Gv[d[w]>>4],b+=Gv[d[w]&15];n.push(l+"=Uint8Array(0x"+b+")")}else n.push(l+"="+JSON.stringify(d))}catch{n.push(l+"="+JSON.stringify(i[l].toString()))}}),n.push(`code=${r}`),n.push(`version=${this.version}`);const s=e;let a="";switch(r){case yn.NUMERIC_FAULT:{a="NUMERIC_FAULT";const l=e;switch(l){case"overflow":case"underflow":case"division-by-zero":a+="-"+l;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result";break}break}case yn.CALL_EXCEPTION:case yn.INSUFFICIENT_FUNDS:case yn.MISSING_NEW:case yn.NONCE_EXPIRED:case yn.REPLACEMENT_UNDERPRICED:case yn.TRANSACTION_REPLACED:case yn.UNPREDICTABLE_GAS_LIMIT:a=r;break}a&&(e+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const u=new Error(e);return u.reason=s,u.code=r,Object.keys(i).forEach(function(l){u[l]=i[l]}),u}throwError(e,r,i){throw this.makeError(e,r,i)}throwArgumentError(e,r,i){return this.throwError(e,Et.errors.INVALID_ARGUMENT,{argument:r,value:i})}assert(e,r,i,n){e||this.throwError(r,i,n)}assertArgument(e,r,i,n){e||this.throwArgumentError(r,i,n)}checkNormalize(e){Vv&&this.throwError("platform missing String.prototype.normalize",Et.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Vv})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,Et.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,i){i?i=": "+i:i="",e<r&&this.throwError("missing argument"+i,Et.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+i,Et.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",Et.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",Et.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return X0||(X0=new Et(QE)),X0}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Hv){if(!e)return;this.globalLogger().throwError("error censorship permanent",Et.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Kv=!!e,Hv=!!r}static setLogLevel(e){const r=Jf[e.toLowerCase()];if(r==null){Et.globalLogger().warn("invalid log level - "+e);return}Wv=r}static from(e){return new Et(e)}}Et.errors=yn,Et.levels=ed;const XE="bytes/5.7.0",vr=new Et(XE);function Yv(t){return!!t.toHexString}function Ha(t){return t.slice||(t.slice=function(){const e=Array.prototype.slice.call(arguments);return Ha(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function eA(t){return Li(t)&&!(t.length%2)||Ka(t)}function Jv(t){return typeof t=="number"&&t==t&&t%1===0}function Ka(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!Jv(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){const r=t[e];if(!Jv(r)||r<0||r>=256)return!1}return!0}function lr(t,e){if(e||(e={}),typeof t=="number"){vr.checkSafeUint53(t,"invalid arrayify value");const r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),Ha(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Yv(t)&&(t=t.toHexString()),Li(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":vr.throwArgumentError("hex data is odd-length","value",t));const i=[];for(let n=0;n<r.length;n+=2)i.push(parseInt(r.substring(n,n+2),16));return Ha(new Uint8Array(i))}return Ka(t)?Ha(new Uint8Array(t)):vr.throwArgumentError("invalid arrayify value","value",t)}function tA(t){const e=t.map(n=>lr(n)),r=e.reduce((n,s)=>n+s.length,0),i=new Uint8Array(r);return e.reduce((n,s)=>(i.set(s,n),n+s.length),0),Ha(i)}function rA(t,e){t=lr(t),t.length>e&&vr.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(e);return r.set(t,e-t.length),Ha(r)}function Li(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}const td="0123456789abcdef";function ni(t,e){if(e||(e={}),typeof t=="number"){vr.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=td[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Yv(t))return t.toHexString();if(Li(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":vr.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Ka(t)){let r="0x";for(let i=0;i<t.length;i++){let n=t[i];r+=td[(n&240)>>4]+td[n&15]}return r}return vr.throwArgumentError("invalid hexlify value","value",t)}function iA(t){if(typeof t!="string")t=ni(t);else if(!Li(t)||t.length%2)return null;return(t.length-2)/2}function Qv(t,e,r){return typeof t!="string"?t=ni(t):(!Li(t)||t.length%2)&&vr.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Yn(t,e){for(typeof t!="string"?t=ni(t):Li(t)||vr.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&vr.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Zv(t){const e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(eA(t)){let r=lr(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=ni(r.slice(0,32)),e.s=ni(r.slice(32,64))):r.length===65?(e.r=ni(r.slice(0,32)),e.s=ni(r.slice(32,64)),e.v=r[64]):vr.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:vr.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=ni(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){const n=rA(lr(e._vs),32);e._vs=ni(n);const s=n[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=s:e.recoveryParam!==s&&vr.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),n[0]&=127;const a=ni(n);e.s==null?e.s=a:e.s!==a&&vr.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?vr.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{const n=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==n&&vr.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!Li(e.r)?vr.throwArgumentError("signature missing or invalid r","signature",t):e.r=Yn(e.r,32),e.s==null||!Li(e.s)?vr.throwArgumentError("signature missing or invalid s","signature",t):e.s=Yn(e.s,32);const r=lr(e.s);r[0]>=128&&vr.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);const i=ni(r);e._vs&&(Li(e._vs)||vr.throwArgumentError("signature invalid _vs","signature",t),e._vs=Yn(e._vs,32)),e._vs==null?e._vs=i:e._vs!==i&&vr.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function rd(t){return"0x"+JE.keccak_256(lr(t))}var Xv={exports:{}},nA={},sA=Object.freeze({__proto__:null,default:nA}),oA=YE(sA);(function(t){(function(e,r){function i(f,h){if(!f)throw new Error(h||"Assertion failed")}function n(f,h){f.super_=h;var v=function(){};v.prototype=h.prototype,f.prototype=new v,f.prototype.constructor=f}function s(f,h,v){if(s.isBN(f))return f;this.negative=0,this.words=null,this.length=0,this.red=null,f!==null&&((h==="le"||h==="be")&&(v=h,h=10),this._init(f||0,h||10,v||"be"))}typeof e=="object"?e.exports=s:r.BN=s,s.BN=s,s.wordSize=26;var a;try{typeof window<"u"&&typeof window.Buffer<"u"?a=window.Buffer:a=oA.Buffer}catch{}s.isBN=function(f){return f instanceof s?!0:f!==null&&typeof f=="object"&&f.constructor.wordSize===s.wordSize&&Array.isArray(f.words)},s.max=function(f,h){return f.cmp(h)>0?f:h},s.min=function(f,h){return f.cmp(h)<0?f:h},s.prototype._init=function(f,h,v){if(typeof f=="number")return this._initNumber(f,h,v);if(typeof f=="object")return this._initArray(f,h,v);h==="hex"&&(h=16),i(h===(h|0)&&h>=2&&h<=36),f=f.toString().replace(/\s+/g,"");var E=0;f[0]==="-"&&(E++,this.negative=1),E<f.length&&(h===16?this._parseHex(f,E,v):(this._parseBase(f,h,E),v==="le"&&this._initArray(this.toArray(),h,v)))},s.prototype._initNumber=function(f,h,v){f<0&&(this.negative=1,f=-f),f<67108864?(this.words=[f&67108863],this.length=1):f<4503599627370496?(this.words=[f&67108863,f/67108864&67108863],this.length=2):(i(f<9007199254740992),this.words=[f&67108863,f/67108864&67108863,1],this.length=3),v==="le"&&this._initArray(this.toArray(),h,v)},s.prototype._initArray=function(f,h,v){if(i(typeof f.length=="number"),f.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(f.length/3),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var C,P,M=0;if(v==="be")for(E=f.length-1,C=0;E>=0;E-=3)P=f[E]|f[E-1]<<8|f[E-2]<<16,this.words[C]|=P<<M&67108863,this.words[C+1]=P>>>26-M&67108863,M+=24,M>=26&&(M-=26,C++);else if(v==="le")for(E=0,C=0;E<f.length;E+=3)P=f[E]|f[E+1]<<8|f[E+2]<<16,this.words[C]|=P<<M&67108863,this.words[C+1]=P>>>26-M&67108863,M+=24,M>=26&&(M-=26,C++);return this._strip()};function u(f,h){var v=f.charCodeAt(h);if(v>=48&&v<=57)return v-48;if(v>=65&&v<=70)return v-55;if(v>=97&&v<=102)return v-87;i(!1,"Invalid character in "+f)}function l(f,h,v){var E=u(f,v);return v-1>=h&&(E|=u(f,v-1)<<4),E}s.prototype._parseHex=function(f,h,v){this.length=Math.ceil((f.length-h)/6),this.words=new Array(this.length);for(var E=0;E<this.length;E++)this.words[E]=0;var C=0,P=0,M;if(v==="be")for(E=f.length-1;E>=h;E-=2)M=l(f,h,E)<<C,this.words[P]|=M&67108863,C>=18?(C-=18,P+=1,this.words[P]|=M>>>26):C+=8;else{var g=f.length-h;for(E=g%2===0?h+1:h;E<f.length;E+=2)M=l(f,h,E)<<C,this.words[P]|=M&67108863,C>=18?(C-=18,P+=1,this.words[P]|=M>>>26):C+=8}this._strip()};function d(f,h,v,E){for(var C=0,P=0,M=Math.min(f.length,v),g=h;g<M;g++){var m=f.charCodeAt(g)-48;C*=E,m>=49?P=m-49+10:m>=17?P=m-17+10:P=m,i(m>=0&&P<E,"Invalid character"),C+=P}return C}s.prototype._parseBase=function(f,h,v){this.words=[0],this.length=1;for(var E=0,C=1;C<=67108863;C*=h)E++;E--,C=C/h|0;for(var P=f.length-v,M=P%E,g=Math.min(P,P-M)+v,m=0,N=v;N<g;N+=E)m=d(f,N,N+E,h),this.imuln(C),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m);if(M!==0){var ee=1;for(m=d(f,N,f.length,h),N=0;N<M;N++)ee*=h;this.imuln(ee),this.words[0]+m<67108864?this.words[0]+=m:this._iaddn(m)}this._strip()},s.prototype.copy=function(f){f.words=new Array(this.length);for(var h=0;h<this.length;h++)f.words[h]=this.words[h];f.length=this.length,f.negative=this.negative,f.red=this.red};function b(f,h){f.words=h.words,f.length=h.length,f.negative=h.negative,f.red=h.red}if(s.prototype._move=function(f){b(f,this)},s.prototype.clone=function(){var f=new s(null);return this.copy(f),f},s.prototype._expand=function(f){for(;this.length<f;)this.words[this.length++]=0;return this},s.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},s.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=w}catch{s.prototype.inspect=w}else s.prototype.inspect=w;function w(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var I=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],S=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],D=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];s.prototype.toString=function(f,h){f=f||10,h=h|0||1;var v;if(f===16||f==="hex"){v="";for(var E=0,C=0,P=0;P<this.length;P++){var M=this.words[P],g=((M<<E|C)&16777215).toString(16);C=M>>>24-E&16777215,E+=2,E>=26&&(E-=26,P--),C!==0||P!==this.length-1?v=I[6-g.length]+g+v:v=g+v}for(C!==0&&(v=C.toString(16)+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}if(f===(f|0)&&f>=2&&f<=36){var m=S[f],N=D[f];v="";var ee=this.clone();for(ee.negative=0;!ee.isZero();){var ae=ee.modrn(N).toString(f);ee=ee.idivn(N),ee.isZero()?v=ae+v:v=I[m-ae.length]+ae+v}for(this.isZero()&&(v="0"+v);v.length%h!==0;)v="0"+v;return this.negative!==0&&(v="-"+v),v}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var f=this.words[0];return this.length===2?f+=this.words[1]*67108864:this.length===3&&this.words[2]===1?f+=4503599627370496+this.words[1]*67108864:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-f:f},s.prototype.toJSON=function(){return this.toString(16,2)},a&&(s.prototype.toBuffer=function(f,h){return this.toArrayLike(a,f,h)}),s.prototype.toArray=function(f,h){return this.toArrayLike(Array,f,h)};var L=function(f,h){return f.allocUnsafe?f.allocUnsafe(h):new f(h)};s.prototype.toArrayLike=function(f,h,v){this._strip();var E=this.byteLength(),C=v||Math.max(1,E);i(E<=C,"byte array longer than desired length"),i(C>0,"Requested array length <= 0");var P=L(f,C),M=h==="le"?"LE":"BE";return this["_toArrayLike"+M](P,E),P},s.prototype._toArrayLikeLE=function(f,h){for(var v=0,E=0,C=0,P=0;C<this.length;C++){var M=this.words[C]<<P|E;f[v++]=M&255,v<f.length&&(f[v++]=M>>8&255),v<f.length&&(f[v++]=M>>16&255),P===6?(v<f.length&&(f[v++]=M>>24&255),E=0,P=0):(E=M>>>24,P+=2)}if(v<f.length)for(f[v++]=E;v<f.length;)f[v++]=0},s.prototype._toArrayLikeBE=function(f,h){for(var v=f.length-1,E=0,C=0,P=0;C<this.length;C++){var M=this.words[C]<<P|E;f[v--]=M&255,v>=0&&(f[v--]=M>>8&255),v>=0&&(f[v--]=M>>16&255),P===6?(v>=0&&(f[v--]=M>>24&255),E=0,P=0):(E=M>>>24,P+=2)}if(v>=0)for(f[v--]=E;v>=0;)f[v--]=0},Math.clz32?s.prototype._countBits=function(f){return 32-Math.clz32(f)}:s.prototype._countBits=function(f){var h=f,v=0;return h>=4096&&(v+=13,h>>>=13),h>=64&&(v+=7,h>>>=7),h>=8&&(v+=4,h>>>=4),h>=2&&(v+=2,h>>>=2),v+h},s.prototype._zeroBits=function(f){if(f===0)return 26;var h=f,v=0;return h&8191||(v+=13,h>>>=13),h&127||(v+=7,h>>>=7),h&15||(v+=4,h>>>=4),h&3||(v+=2,h>>>=2),h&1||v++,v},s.prototype.bitLength=function(){var f=this.words[this.length-1],h=this._countBits(f);return(this.length-1)*26+h};function K(f){for(var h=new Array(f.bitLength()),v=0;v<h.length;v++){var E=v/26|0,C=v%26;h[v]=f.words[E]>>>C&1}return h}s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var f=0,h=0;h<this.length;h++){var v=this._zeroBits(this.words[h]);if(f+=v,v!==26)break}return f},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(f){return this.negative!==0?this.abs().inotn(f).iaddn(1):this.clone()},s.prototype.fromTwos=function(f){return this.testn(f-1)?this.notn(f).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return this.negative!==0},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(f){for(;this.length<f.length;)this.words[this.length++]=0;for(var h=0;h<f.length;h++)this.words[h]=this.words[h]|f.words[h];return this._strip()},s.prototype.ior=function(f){return i((this.negative|f.negative)===0),this.iuor(f)},s.prototype.or=function(f){return this.length>f.length?this.clone().ior(f):f.clone().ior(this)},s.prototype.uor=function(f){return this.length>f.length?this.clone().iuor(f):f.clone().iuor(this)},s.prototype.iuand=function(f){var h;this.length>f.length?h=f:h=this;for(var v=0;v<h.length;v++)this.words[v]=this.words[v]&f.words[v];return this.length=h.length,this._strip()},s.prototype.iand=function(f){return i((this.negative|f.negative)===0),this.iuand(f)},s.prototype.and=function(f){return this.length>f.length?this.clone().iand(f):f.clone().iand(this)},s.prototype.uand=function(f){return this.length>f.length?this.clone().iuand(f):f.clone().iuand(this)},s.prototype.iuxor=function(f){var h,v;this.length>f.length?(h=this,v=f):(h=f,v=this);for(var E=0;E<v.length;E++)this.words[E]=h.words[E]^v.words[E];if(this!==h)for(;E<h.length;E++)this.words[E]=h.words[E];return this.length=h.length,this._strip()},s.prototype.ixor=function(f){return i((this.negative|f.negative)===0),this.iuxor(f)},s.prototype.xor=function(f){return this.length>f.length?this.clone().ixor(f):f.clone().ixor(this)},s.prototype.uxor=function(f){return this.length>f.length?this.clone().iuxor(f):f.clone().iuxor(this)},s.prototype.inotn=function(f){i(typeof f=="number"&&f>=0);var h=Math.ceil(f/26)|0,v=f%26;this._expand(h),v>0&&h--;for(var E=0;E<h;E++)this.words[E]=~this.words[E]&67108863;return v>0&&(this.words[E]=~this.words[E]&67108863>>26-v),this._strip()},s.prototype.notn=function(f){return this.clone().inotn(f)},s.prototype.setn=function(f,h){i(typeof f=="number"&&f>=0);var v=f/26|0,E=f%26;return this._expand(v+1),h?this.words[v]=this.words[v]|1<<E:this.words[v]=this.words[v]&~(1<<E),this._strip()},s.prototype.iadd=function(f){var h;if(this.negative!==0&&f.negative===0)return this.negative=0,h=this.isub(f),this.negative^=1,this._normSign();if(this.negative===0&&f.negative!==0)return f.negative=0,h=this.isub(f),f.negative=1,h._normSign();var v,E;this.length>f.length?(v=this,E=f):(v=f,E=this);for(var C=0,P=0;P<E.length;P++)h=(v.words[P]|0)+(E.words[P]|0)+C,this.words[P]=h&67108863,C=h>>>26;for(;C!==0&&P<v.length;P++)h=(v.words[P]|0)+C,this.words[P]=h&67108863,C=h>>>26;if(this.length=v.length,C!==0)this.words[this.length]=C,this.length++;else if(v!==this)for(;P<v.length;P++)this.words[P]=v.words[P];return this},s.prototype.add=function(f){var h;return f.negative!==0&&this.negative===0?(f.negative=0,h=this.sub(f),f.negative^=1,h):f.negative===0&&this.negative!==0?(this.negative=0,h=f.sub(this),this.negative=1,h):this.length>f.length?this.clone().iadd(f):f.clone().iadd(this)},s.prototype.isub=function(f){if(f.negative!==0){f.negative=0;var h=this.iadd(f);return f.negative=1,h._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(f),this.negative=1,this._normSign();var v=this.cmp(f);if(v===0)return this.negative=0,this.length=1,this.words[0]=0,this;var E,C;v>0?(E=this,C=f):(E=f,C=this);for(var P=0,M=0;M<C.length;M++)h=(E.words[M]|0)-(C.words[M]|0)+P,P=h>>26,this.words[M]=h&67108863;for(;P!==0&&M<E.length;M++)h=(E.words[M]|0)+P,P=h>>26,this.words[M]=h&67108863;if(P===0&&M<E.length&&E!==this)for(;M<E.length;M++)this.words[M]=E.words[M];return this.length=Math.max(this.length,M),E!==this&&(this.negative=1),this._strip()},s.prototype.sub=function(f){return this.clone().isub(f)};function H(f,h,v){v.negative=h.negative^f.negative;var E=f.length+h.length|0;v.length=E,E=E-1|0;var C=f.words[0]|0,P=h.words[0]|0,M=C*P,g=M&67108863,m=M/67108864|0;v.words[0]=g;for(var N=1;N<E;N++){for(var ee=m>>>26,ae=m&67108863,O=Math.min(N,h.length-1),te=Math.max(0,N-f.length+1);te<=O;te++){var q=N-te|0;C=f.words[q]|0,P=h.words[te]|0,M=C*P+ae,ee+=M/67108864|0,ae=M&67108863}v.words[N]=ae|0,m=ee|0}return m!==0?v.words[N]=m|0:v.length--,v._strip()}var U=function(f,h,v){var E=f.words,C=h.words,P=v.words,M=0,g,m,N,ee=E[0]|0,ae=ee&8191,O=ee>>>13,te=E[1]|0,q=te&8191,G=te>>>13,Y=E[2]|0,A=Y&8191,V=Y>>>13,oe=E[3]|0,ue=oe&8191,he=oe>>>13,ye=E[4]|0,we=ye&8191,Re=ye>>>13,Xe=E[5]|0,Oe=Xe&8191,Ne=Xe>>>13,Me=E[6]|0,be=Me&8191,Pe=Me>>>13,Te=E[7]|0,ve=Te&8191,$e=Te>>>13,xe=E[8]|0,me=xe&8191,Ue=xe>>>13,Ce=E[9]|0,_e=Ce&8191,Ke=Ce>>>13,Ve=C[0]|0,Ae=Ve&8191,We=Ve>>>13,pt=C[1]|0,Ge=pt&8191,It=pt>>>13,gt=C[2]|0,Je=gt&8191,Ot=gt>>>13,Tt=C[3]|0,Le=Tt&8191,et=Tt>>>13,it=C[4]|0,Be=it&8191,rt=it>>>13,tt=C[5]|0,je=tt&8191,ht=tt>>>13,nt=C[6]|0,qe=nt&8191,st=nt>>>13,at=C[7]|0,Fe=at&8191,Ze=at>>>13,lt=C[8]|0,ze=lt&8191,jt=lt>>>13,qt=C[9]|0,ct=qt&8191,_t=qt>>>13;v.negative=f.negative^h.negative,v.length=19,g=Math.imul(ae,Ae),m=Math.imul(ae,We),m=m+Math.imul(O,Ae)|0,N=Math.imul(O,We);var Qr=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,g=Math.imul(q,Ae),m=Math.imul(q,We),m=m+Math.imul(G,Ae)|0,N=Math.imul(G,We),g=g+Math.imul(ae,Ge)|0,m=m+Math.imul(ae,It)|0,m=m+Math.imul(O,Ge)|0,N=N+Math.imul(O,It)|0;var Zr=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Zr>>>26)|0,Zr&=67108863,g=Math.imul(A,Ae),m=Math.imul(A,We),m=m+Math.imul(V,Ae)|0,N=Math.imul(V,We),g=g+Math.imul(q,Ge)|0,m=m+Math.imul(q,It)|0,m=m+Math.imul(G,Ge)|0,N=N+Math.imul(G,It)|0,g=g+Math.imul(ae,Je)|0,m=m+Math.imul(ae,Ot)|0,m=m+Math.imul(O,Je)|0,N=N+Math.imul(O,Ot)|0;var Xr=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Xr>>>26)|0,Xr&=67108863,g=Math.imul(ue,Ae),m=Math.imul(ue,We),m=m+Math.imul(he,Ae)|0,N=Math.imul(he,We),g=g+Math.imul(A,Ge)|0,m=m+Math.imul(A,It)|0,m=m+Math.imul(V,Ge)|0,N=N+Math.imul(V,It)|0,g=g+Math.imul(q,Je)|0,m=m+Math.imul(q,Ot)|0,m=m+Math.imul(G,Je)|0,N=N+Math.imul(G,Ot)|0,g=g+Math.imul(ae,Le)|0,m=m+Math.imul(ae,et)|0,m=m+Math.imul(O,Le)|0,N=N+Math.imul(O,et)|0;var ei=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(ei>>>26)|0,ei&=67108863,g=Math.imul(we,Ae),m=Math.imul(we,We),m=m+Math.imul(Re,Ae)|0,N=Math.imul(Re,We),g=g+Math.imul(ue,Ge)|0,m=m+Math.imul(ue,It)|0,m=m+Math.imul(he,Ge)|0,N=N+Math.imul(he,It)|0,g=g+Math.imul(A,Je)|0,m=m+Math.imul(A,Ot)|0,m=m+Math.imul(V,Je)|0,N=N+Math.imul(V,Ot)|0,g=g+Math.imul(q,Le)|0,m=m+Math.imul(q,et)|0,m=m+Math.imul(G,Le)|0,N=N+Math.imul(G,et)|0,g=g+Math.imul(ae,Be)|0,m=m+Math.imul(ae,rt)|0,m=m+Math.imul(O,Be)|0,N=N+Math.imul(O,rt)|0;var ti=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(ti>>>26)|0,ti&=67108863,g=Math.imul(Oe,Ae),m=Math.imul(Oe,We),m=m+Math.imul(Ne,Ae)|0,N=Math.imul(Ne,We),g=g+Math.imul(we,Ge)|0,m=m+Math.imul(we,It)|0,m=m+Math.imul(Re,Ge)|0,N=N+Math.imul(Re,It)|0,g=g+Math.imul(ue,Je)|0,m=m+Math.imul(ue,Ot)|0,m=m+Math.imul(he,Je)|0,N=N+Math.imul(he,Ot)|0,g=g+Math.imul(A,Le)|0,m=m+Math.imul(A,et)|0,m=m+Math.imul(V,Le)|0,N=N+Math.imul(V,et)|0,g=g+Math.imul(q,Be)|0,m=m+Math.imul(q,rt)|0,m=m+Math.imul(G,Be)|0,N=N+Math.imul(G,rt)|0,g=g+Math.imul(ae,je)|0,m=m+Math.imul(ae,ht)|0,m=m+Math.imul(O,je)|0,N=N+Math.imul(O,ht)|0;var pr=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(pr>>>26)|0,pr&=67108863,g=Math.imul(be,Ae),m=Math.imul(be,We),m=m+Math.imul(Pe,Ae)|0,N=Math.imul(Pe,We),g=g+Math.imul(Oe,Ge)|0,m=m+Math.imul(Oe,It)|0,m=m+Math.imul(Ne,Ge)|0,N=N+Math.imul(Ne,It)|0,g=g+Math.imul(we,Je)|0,m=m+Math.imul(we,Ot)|0,m=m+Math.imul(Re,Je)|0,N=N+Math.imul(Re,Ot)|0,g=g+Math.imul(ue,Le)|0,m=m+Math.imul(ue,et)|0,m=m+Math.imul(he,Le)|0,N=N+Math.imul(he,et)|0,g=g+Math.imul(A,Be)|0,m=m+Math.imul(A,rt)|0,m=m+Math.imul(V,Be)|0,N=N+Math.imul(V,rt)|0,g=g+Math.imul(q,je)|0,m=m+Math.imul(q,ht)|0,m=m+Math.imul(G,je)|0,N=N+Math.imul(G,ht)|0,g=g+Math.imul(ae,qe)|0,m=m+Math.imul(ae,st)|0,m=m+Math.imul(O,qe)|0,N=N+Math.imul(O,st)|0;var Si=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Si>>>26)|0,Si&=67108863,g=Math.imul(ve,Ae),m=Math.imul(ve,We),m=m+Math.imul($e,Ae)|0,N=Math.imul($e,We),g=g+Math.imul(be,Ge)|0,m=m+Math.imul(be,It)|0,m=m+Math.imul(Pe,Ge)|0,N=N+Math.imul(Pe,It)|0,g=g+Math.imul(Oe,Je)|0,m=m+Math.imul(Oe,Ot)|0,m=m+Math.imul(Ne,Je)|0,N=N+Math.imul(Ne,Ot)|0,g=g+Math.imul(we,Le)|0,m=m+Math.imul(we,et)|0,m=m+Math.imul(Re,Le)|0,N=N+Math.imul(Re,et)|0,g=g+Math.imul(ue,Be)|0,m=m+Math.imul(ue,rt)|0,m=m+Math.imul(he,Be)|0,N=N+Math.imul(he,rt)|0,g=g+Math.imul(A,je)|0,m=m+Math.imul(A,ht)|0,m=m+Math.imul(V,je)|0,N=N+Math.imul(V,ht)|0,g=g+Math.imul(q,qe)|0,m=m+Math.imul(q,st)|0,m=m+Math.imul(G,qe)|0,N=N+Math.imul(G,st)|0,g=g+Math.imul(ae,Fe)|0,m=m+Math.imul(ae,Ze)|0,m=m+Math.imul(O,Fe)|0,N=N+Math.imul(O,Ze)|0;var Cn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,g=Math.imul(me,Ae),m=Math.imul(me,We),m=m+Math.imul(Ue,Ae)|0,N=Math.imul(Ue,We),g=g+Math.imul(ve,Ge)|0,m=m+Math.imul(ve,It)|0,m=m+Math.imul($e,Ge)|0,N=N+Math.imul($e,It)|0,g=g+Math.imul(be,Je)|0,m=m+Math.imul(be,Ot)|0,m=m+Math.imul(Pe,Je)|0,N=N+Math.imul(Pe,Ot)|0,g=g+Math.imul(Oe,Le)|0,m=m+Math.imul(Oe,et)|0,m=m+Math.imul(Ne,Le)|0,N=N+Math.imul(Ne,et)|0,g=g+Math.imul(we,Be)|0,m=m+Math.imul(we,rt)|0,m=m+Math.imul(Re,Be)|0,N=N+Math.imul(Re,rt)|0,g=g+Math.imul(ue,je)|0,m=m+Math.imul(ue,ht)|0,m=m+Math.imul(he,je)|0,N=N+Math.imul(he,ht)|0,g=g+Math.imul(A,qe)|0,m=m+Math.imul(A,st)|0,m=m+Math.imul(V,qe)|0,N=N+Math.imul(V,st)|0,g=g+Math.imul(q,Fe)|0,m=m+Math.imul(q,Ze)|0,m=m+Math.imul(G,Fe)|0,N=N+Math.imul(G,Ze)|0,g=g+Math.imul(ae,ze)|0,m=m+Math.imul(ae,jt)|0,m=m+Math.imul(O,ze)|0,N=N+Math.imul(O,jt)|0;var Ii=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Ii>>>26)|0,Ii&=67108863,g=Math.imul(_e,Ae),m=Math.imul(_e,We),m=m+Math.imul(Ke,Ae)|0,N=Math.imul(Ke,We),g=g+Math.imul(me,Ge)|0,m=m+Math.imul(me,It)|0,m=m+Math.imul(Ue,Ge)|0,N=N+Math.imul(Ue,It)|0,g=g+Math.imul(ve,Je)|0,m=m+Math.imul(ve,Ot)|0,m=m+Math.imul($e,Je)|0,N=N+Math.imul($e,Ot)|0,g=g+Math.imul(be,Le)|0,m=m+Math.imul(be,et)|0,m=m+Math.imul(Pe,Le)|0,N=N+Math.imul(Pe,et)|0,g=g+Math.imul(Oe,Be)|0,m=m+Math.imul(Oe,rt)|0,m=m+Math.imul(Ne,Be)|0,N=N+Math.imul(Ne,rt)|0,g=g+Math.imul(we,je)|0,m=m+Math.imul(we,ht)|0,m=m+Math.imul(Re,je)|0,N=N+Math.imul(Re,ht)|0,g=g+Math.imul(ue,qe)|0,m=m+Math.imul(ue,st)|0,m=m+Math.imul(he,qe)|0,N=N+Math.imul(he,st)|0,g=g+Math.imul(A,Fe)|0,m=m+Math.imul(A,Ze)|0,m=m+Math.imul(V,Fe)|0,N=N+Math.imul(V,Ze)|0,g=g+Math.imul(q,ze)|0,m=m+Math.imul(q,jt)|0,m=m+Math.imul(G,ze)|0,N=N+Math.imul(G,jt)|0,g=g+Math.imul(ae,ct)|0,m=m+Math.imul(ae,_t)|0,m=m+Math.imul(O,ct)|0,N=N+Math.imul(O,_t)|0;var Dn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Dn>>>26)|0,Dn&=67108863,g=Math.imul(_e,Ge),m=Math.imul(_e,It),m=m+Math.imul(Ke,Ge)|0,N=Math.imul(Ke,It),g=g+Math.imul(me,Je)|0,m=m+Math.imul(me,Ot)|0,m=m+Math.imul(Ue,Je)|0,N=N+Math.imul(Ue,Ot)|0,g=g+Math.imul(ve,Le)|0,m=m+Math.imul(ve,et)|0,m=m+Math.imul($e,Le)|0,N=N+Math.imul($e,et)|0,g=g+Math.imul(be,Be)|0,m=m+Math.imul(be,rt)|0,m=m+Math.imul(Pe,Be)|0,N=N+Math.imul(Pe,rt)|0,g=g+Math.imul(Oe,je)|0,m=m+Math.imul(Oe,ht)|0,m=m+Math.imul(Ne,je)|0,N=N+Math.imul(Ne,ht)|0,g=g+Math.imul(we,qe)|0,m=m+Math.imul(we,st)|0,m=m+Math.imul(Re,qe)|0,N=N+Math.imul(Re,st)|0,g=g+Math.imul(ue,Fe)|0,m=m+Math.imul(ue,Ze)|0,m=m+Math.imul(he,Fe)|0,N=N+Math.imul(he,Ze)|0,g=g+Math.imul(A,ze)|0,m=m+Math.imul(A,jt)|0,m=m+Math.imul(V,ze)|0,N=N+Math.imul(V,jt)|0,g=g+Math.imul(q,ct)|0,m=m+Math.imul(q,_t)|0,m=m+Math.imul(G,ct)|0,N=N+Math.imul(G,_t)|0;var On=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(On>>>26)|0,On&=67108863,g=Math.imul(_e,Je),m=Math.imul(_e,Ot),m=m+Math.imul(Ke,Je)|0,N=Math.imul(Ke,Ot),g=g+Math.imul(me,Le)|0,m=m+Math.imul(me,et)|0,m=m+Math.imul(Ue,Le)|0,N=N+Math.imul(Ue,et)|0,g=g+Math.imul(ve,Be)|0,m=m+Math.imul(ve,rt)|0,m=m+Math.imul($e,Be)|0,N=N+Math.imul($e,rt)|0,g=g+Math.imul(be,je)|0,m=m+Math.imul(be,ht)|0,m=m+Math.imul(Pe,je)|0,N=N+Math.imul(Pe,ht)|0,g=g+Math.imul(Oe,qe)|0,m=m+Math.imul(Oe,st)|0,m=m+Math.imul(Ne,qe)|0,N=N+Math.imul(Ne,st)|0,g=g+Math.imul(we,Fe)|0,m=m+Math.imul(we,Ze)|0,m=m+Math.imul(Re,Fe)|0,N=N+Math.imul(Re,Ze)|0,g=g+Math.imul(ue,ze)|0,m=m+Math.imul(ue,jt)|0,m=m+Math.imul(he,ze)|0,N=N+Math.imul(he,jt)|0,g=g+Math.imul(A,ct)|0,m=m+Math.imul(A,_t)|0,m=m+Math.imul(V,ct)|0,N=N+Math.imul(V,_t)|0;var Mi=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Mi>>>26)|0,Mi&=67108863,g=Math.imul(_e,Le),m=Math.imul(_e,et),m=m+Math.imul(Ke,Le)|0,N=Math.imul(Ke,et),g=g+Math.imul(me,Be)|0,m=m+Math.imul(me,rt)|0,m=m+Math.imul(Ue,Be)|0,N=N+Math.imul(Ue,rt)|0,g=g+Math.imul(ve,je)|0,m=m+Math.imul(ve,ht)|0,m=m+Math.imul($e,je)|0,N=N+Math.imul($e,ht)|0,g=g+Math.imul(be,qe)|0,m=m+Math.imul(be,st)|0,m=m+Math.imul(Pe,qe)|0,N=N+Math.imul(Pe,st)|0,g=g+Math.imul(Oe,Fe)|0,m=m+Math.imul(Oe,Ze)|0,m=m+Math.imul(Ne,Fe)|0,N=N+Math.imul(Ne,Ze)|0,g=g+Math.imul(we,ze)|0,m=m+Math.imul(we,jt)|0,m=m+Math.imul(Re,ze)|0,N=N+Math.imul(Re,jt)|0,g=g+Math.imul(ue,ct)|0,m=m+Math.imul(ue,_t)|0,m=m+Math.imul(he,ct)|0,N=N+Math.imul(he,_t)|0;var nn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(nn>>>26)|0,nn&=67108863,g=Math.imul(_e,Be),m=Math.imul(_e,rt),m=m+Math.imul(Ke,Be)|0,N=Math.imul(Ke,rt),g=g+Math.imul(me,je)|0,m=m+Math.imul(me,ht)|0,m=m+Math.imul(Ue,je)|0,N=N+Math.imul(Ue,ht)|0,g=g+Math.imul(ve,qe)|0,m=m+Math.imul(ve,st)|0,m=m+Math.imul($e,qe)|0,N=N+Math.imul($e,st)|0,g=g+Math.imul(be,Fe)|0,m=m+Math.imul(be,Ze)|0,m=m+Math.imul(Pe,Fe)|0,N=N+Math.imul(Pe,Ze)|0,g=g+Math.imul(Oe,ze)|0,m=m+Math.imul(Oe,jt)|0,m=m+Math.imul(Ne,ze)|0,N=N+Math.imul(Ne,jt)|0,g=g+Math.imul(we,ct)|0,m=m+Math.imul(we,_t)|0,m=m+Math.imul(Re,ct)|0,N=N+Math.imul(Re,_t)|0;var sn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(sn>>>26)|0,sn&=67108863,g=Math.imul(_e,je),m=Math.imul(_e,ht),m=m+Math.imul(Ke,je)|0,N=Math.imul(Ke,ht),g=g+Math.imul(me,qe)|0,m=m+Math.imul(me,st)|0,m=m+Math.imul(Ue,qe)|0,N=N+Math.imul(Ue,st)|0,g=g+Math.imul(ve,Fe)|0,m=m+Math.imul(ve,Ze)|0,m=m+Math.imul($e,Fe)|0,N=N+Math.imul($e,Ze)|0,g=g+Math.imul(be,ze)|0,m=m+Math.imul(be,jt)|0,m=m+Math.imul(Pe,ze)|0,N=N+Math.imul(Pe,jt)|0,g=g+Math.imul(Oe,ct)|0,m=m+Math.imul(Oe,_t)|0,m=m+Math.imul(Ne,ct)|0,N=N+Math.imul(Ne,_t)|0;var Ir=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Ir>>>26)|0,Ir&=67108863,g=Math.imul(_e,qe),m=Math.imul(_e,st),m=m+Math.imul(Ke,qe)|0,N=Math.imul(Ke,st),g=g+Math.imul(me,Fe)|0,m=m+Math.imul(me,Ze)|0,m=m+Math.imul(Ue,Fe)|0,N=N+Math.imul(Ue,Ze)|0,g=g+Math.imul(ve,ze)|0,m=m+Math.imul(ve,jt)|0,m=m+Math.imul($e,ze)|0,N=N+Math.imul($e,jt)|0,g=g+Math.imul(be,ct)|0,m=m+Math.imul(be,_t)|0,m=m+Math.imul(Pe,ct)|0,N=N+Math.imul(Pe,_t)|0;var Pn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Pn>>>26)|0,Pn&=67108863,g=Math.imul(_e,Fe),m=Math.imul(_e,Ze),m=m+Math.imul(Ke,Fe)|0,N=Math.imul(Ke,Ze),g=g+Math.imul(me,ze)|0,m=m+Math.imul(me,jt)|0,m=m+Math.imul(Ue,ze)|0,N=N+Math.imul(Ue,jt)|0,g=g+Math.imul(ve,ct)|0,m=m+Math.imul(ve,_t)|0,m=m+Math.imul($e,ct)|0,N=N+Math.imul($e,_t)|0;var $n=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+($n>>>26)|0,$n&=67108863,g=Math.imul(_e,ze),m=Math.imul(_e,jt),m=m+Math.imul(Ke,ze)|0,N=Math.imul(Ke,jt),g=g+Math.imul(me,ct)|0,m=m+Math.imul(me,_t)|0,m=m+Math.imul(Ue,ct)|0,N=N+Math.imul(Ue,_t)|0;var Rn=(M+g|0)+((m&8191)<<13)|0;M=(N+(m>>>13)|0)+(Rn>>>26)|0,Rn&=67108863,g=Math.imul(_e,ct),m=Math.imul(_e,_t),m=m+Math.imul(Ke,ct)|0,N=Math.imul(Ke,_t);var fa=(M+g|0)+((m&8191)<<13)|0;return M=(N+(m>>>13)|0)+(fa>>>26)|0,fa&=67108863,P[0]=Qr,P[1]=Zr,P[2]=Xr,P[3]=ei,P[4]=ti,P[5]=pr,P[6]=Si,P[7]=Cn,P[8]=Ii,P[9]=Dn,P[10]=On,P[11]=Mi,P[12]=nn,P[13]=sn,P[14]=Ir,P[15]=Pn,P[16]=$n,P[17]=Rn,P[18]=fa,M!==0&&(P[19]=M,v.length++),v};Math.imul||(U=H);function W(f,h,v){v.negative=h.negative^f.negative,v.length=f.length+h.length;for(var E=0,C=0,P=0;P<v.length-1;P++){var M=C;C=0;for(var g=E&67108863,m=Math.min(P,h.length-1),N=Math.max(0,P-f.length+1);N<=m;N++){var ee=P-N,ae=f.words[ee]|0,O=h.words[N]|0,te=ae*O,q=te&67108863;M=M+(te/67108864|0)|0,q=q+g|0,g=q&67108863,M=M+(q>>>26)|0,C+=M>>>26,M&=67108863}v.words[P]=g,E=M,M=C}return E!==0?v.words[P]=E:v.length--,v._strip()}function R(f,h,v){return W(f,h,v)}s.prototype.mulTo=function(f,h){var v,E=this.length+f.length;return this.length===10&&f.length===10?v=U(this,f,h):E<63?v=H(this,f,h):E<1024?v=W(this,f,h):v=R(this,f,h),v},s.prototype.mul=function(f){var h=new s(null);return h.words=new Array(this.length+f.length),this.mulTo(f,h)},s.prototype.mulf=function(f){var h=new s(null);return h.words=new Array(this.length+f.length),R(this,f,h)},s.prototype.imul=function(f){return this.clone().mulTo(f,this)},s.prototype.imuln=function(f){var h=f<0;h&&(f=-f),i(typeof f=="number"),i(f<67108864);for(var v=0,E=0;E<this.length;E++){var C=(this.words[E]|0)*f,P=(C&67108863)+(v&67108863);v>>=26,v+=C/67108864|0,v+=P>>>26,this.words[E]=P&67108863}return v!==0&&(this.words[E]=v,this.length++),h?this.ineg():this},s.prototype.muln=function(f){return this.clone().imuln(f)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(f){var h=K(f);if(h.length===0)return new s(1);for(var v=this,E=0;E<h.length&&h[E]===0;E++,v=v.sqr());if(++E<h.length)for(var C=v.sqr();E<h.length;E++,C=C.sqr())h[E]!==0&&(v=v.mul(C));return v},s.prototype.iushln=function(f){i(typeof f=="number"&&f>=0);var h=f%26,v=(f-h)/26,E=67108863>>>26-h<<26-h,C;if(h!==0){var P=0;for(C=0;C<this.length;C++){var M=this.words[C]&E,g=(this.words[C]|0)-M<<h;this.words[C]=g|P,P=M>>>26-h}P&&(this.words[C]=P,this.length++)}if(v!==0){for(C=this.length-1;C>=0;C--)this.words[C+v]=this.words[C];for(C=0;C<v;C++)this.words[C]=0;this.length+=v}return this._strip()},s.prototype.ishln=function(f){return i(this.negative===0),this.iushln(f)},s.prototype.iushrn=function(f,h,v){i(typeof f=="number"&&f>=0);var E;h?E=(h-h%26)/26:E=0;var C=f%26,P=Math.min((f-C)/26,this.length),M=67108863^67108863>>>C<<C,g=v;if(E-=P,E=Math.max(0,E),g){for(var m=0;m<P;m++)g.words[m]=this.words[m];g.length=P}if(P!==0)if(this.length>P)for(this.length-=P,m=0;m<this.length;m++)this.words[m]=this.words[m+P];else this.words[0]=0,this.length=1;var N=0;for(m=this.length-1;m>=0&&(N!==0||m>=E);m--){var ee=this.words[m]|0;this.words[m]=N<<26-C|ee>>>C,N=ee&M}return g&&N!==0&&(g.words[g.length++]=N),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(f,h,v){return i(this.negative===0),this.iushrn(f,h,v)},s.prototype.shln=function(f){return this.clone().ishln(f)},s.prototype.ushln=function(f){return this.clone().iushln(f)},s.prototype.shrn=function(f){return this.clone().ishrn(f)},s.prototype.ushrn=function(f){return this.clone().iushrn(f)},s.prototype.testn=function(f){i(typeof f=="number"&&f>=0);var h=f%26,v=(f-h)/26,E=1<<h;if(this.length<=v)return!1;var C=this.words[v];return!!(C&E)},s.prototype.imaskn=function(f){i(typeof f=="number"&&f>=0);var h=f%26,v=(f-h)/26;if(i(this.negative===0,"imaskn works only with positive numbers"),this.length<=v)return this;if(h!==0&&v++,this.length=Math.min(v,this.length),h!==0){var E=67108863^67108863>>>h<<h;this.words[this.length-1]&=E}return this._strip()},s.prototype.maskn=function(f){return this.clone().imaskn(f)},s.prototype.iaddn=function(f){return i(typeof f=="number"),i(f<67108864),f<0?this.isubn(-f):this.negative!==0?this.length===1&&(this.words[0]|0)<=f?(this.words[0]=f-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(f),this.negative=1,this):this._iaddn(f)},s.prototype._iaddn=function(f){this.words[0]+=f;for(var h=0;h<this.length&&this.words[h]>=67108864;h++)this.words[h]-=67108864,h===this.length-1?this.words[h+1]=1:this.words[h+1]++;return this.length=Math.max(this.length,h+1),this},s.prototype.isubn=function(f){if(i(typeof f=="number"),i(f<67108864),f<0)return this.iaddn(-f);if(this.negative!==0)return this.negative=0,this.iaddn(f),this.negative=1,this;if(this.words[0]-=f,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var h=0;h<this.length&&this.words[h]<0;h++)this.words[h]+=67108864,this.words[h+1]-=1;return this._strip()},s.prototype.addn=function(f){return this.clone().iaddn(f)},s.prototype.subn=function(f){return this.clone().isubn(f)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(f,h,v){var E=f.length+v,C;this._expand(E);var P,M=0;for(C=0;C<f.length;C++){P=(this.words[C+v]|0)+M;var g=(f.words[C]|0)*h;P-=g&67108863,M=(P>>26)-(g/67108864|0),this.words[C+v]=P&67108863}for(;C<this.length-v;C++)P=(this.words[C+v]|0)+M,M=P>>26,this.words[C+v]=P&67108863;if(M===0)return this._strip();for(i(M===-1),M=0,C=0;C<this.length;C++)P=-(this.words[C]|0)+M,M=P>>26,this.words[C]=P&67108863;return this.negative=1,this._strip()},s.prototype._wordDiv=function(f,h){var v=this.length-f.length,E=this.clone(),C=f,P=C.words[C.length-1]|0,M=this._countBits(P);v=26-M,v!==0&&(C=C.ushln(v),E.iushln(v),P=C.words[C.length-1]|0);var g=E.length-C.length,m;if(h!=="mod"){m=new s(null),m.length=g+1,m.words=new Array(m.length);for(var N=0;N<m.length;N++)m.words[N]=0}var ee=E.clone()._ishlnsubmul(C,1,g);ee.negative===0&&(E=ee,m&&(m.words[g]=1));for(var ae=g-1;ae>=0;ae--){var O=(E.words[C.length+ae]|0)*67108864+(E.words[C.length+ae-1]|0);for(O=Math.min(O/P|0,67108863),E._ishlnsubmul(C,O,ae);E.negative!==0;)O--,E.negative=0,E._ishlnsubmul(C,1,ae),E.isZero()||(E.negative^=1);m&&(m.words[ae]=O)}return m&&m._strip(),E._strip(),h!=="div"&&v!==0&&E.iushrn(v),{div:m||null,mod:E}},s.prototype.divmod=function(f,h,v){if(i(!f.isZero()),this.isZero())return{div:new s(0),mod:new s(0)};var E,C,P;return this.negative!==0&&f.negative===0?(P=this.neg().divmod(f,h),h!=="mod"&&(E=P.div.neg()),h!=="div"&&(C=P.mod.neg(),v&&C.negative!==0&&C.iadd(f)),{div:E,mod:C}):this.negative===0&&f.negative!==0?(P=this.divmod(f.neg(),h),h!=="mod"&&(E=P.div.neg()),{div:E,mod:P.mod}):this.negative&f.negative?(P=this.neg().divmod(f.neg(),h),h!=="div"&&(C=P.mod.neg(),v&&C.negative!==0&&C.isub(f)),{div:P.div,mod:C}):f.length>this.length||this.cmp(f)<0?{div:new s(0),mod:this}:f.length===1?h==="div"?{div:this.divn(f.words[0]),mod:null}:h==="mod"?{div:null,mod:new s(this.modrn(f.words[0]))}:{div:this.divn(f.words[0]),mod:new s(this.modrn(f.words[0]))}:this._wordDiv(f,h)},s.prototype.div=function(f){return this.divmod(f,"div",!1).div},s.prototype.mod=function(f){return this.divmod(f,"mod",!1).mod},s.prototype.umod=function(f){return this.divmod(f,"mod",!0).mod},s.prototype.divRound=function(f){var h=this.divmod(f);if(h.mod.isZero())return h.div;var v=h.div.negative!==0?h.mod.isub(f):h.mod,E=f.ushrn(1),C=f.andln(1),P=v.cmp(E);return P<0||C===1&&P===0?h.div:h.div.negative!==0?h.div.isubn(1):h.div.iaddn(1)},s.prototype.modrn=function(f){var h=f<0;h&&(f=-f),i(f<=67108863);for(var v=(1<<26)%f,E=0,C=this.length-1;C>=0;C--)E=(v*E+(this.words[C]|0))%f;return h?-E:E},s.prototype.modn=function(f){return this.modrn(f)},s.prototype.idivn=function(f){var h=f<0;h&&(f=-f),i(f<=67108863);for(var v=0,E=this.length-1;E>=0;E--){var C=(this.words[E]|0)+v*67108864;this.words[E]=C/f|0,v=C%f}return this._strip(),h?this.ineg():this},s.prototype.divn=function(f){return this.clone().idivn(f)},s.prototype.egcd=function(f){i(f.negative===0),i(!f.isZero());var h=this,v=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var E=new s(1),C=new s(0),P=new s(0),M=new s(1),g=0;h.isEven()&&v.isEven();)h.iushrn(1),v.iushrn(1),++g;for(var m=v.clone(),N=h.clone();!h.isZero();){for(var ee=0,ae=1;!(h.words[0]&ae)&&ee<26;++ee,ae<<=1);if(ee>0)for(h.iushrn(ee);ee-- >0;)(E.isOdd()||C.isOdd())&&(E.iadd(m),C.isub(N)),E.iushrn(1),C.iushrn(1);for(var O=0,te=1;!(v.words[0]&te)&&O<26;++O,te<<=1);if(O>0)for(v.iushrn(O);O-- >0;)(P.isOdd()||M.isOdd())&&(P.iadd(m),M.isub(N)),P.iushrn(1),M.iushrn(1);h.cmp(v)>=0?(h.isub(v),E.isub(P),C.isub(M)):(v.isub(h),P.isub(E),M.isub(C))}return{a:P,b:M,gcd:v.iushln(g)}},s.prototype._invmp=function(f){i(f.negative===0),i(!f.isZero());var h=this,v=f.clone();h.negative!==0?h=h.umod(f):h=h.clone();for(var E=new s(1),C=new s(0),P=v.clone();h.cmpn(1)>0&&v.cmpn(1)>0;){for(var M=0,g=1;!(h.words[0]&g)&&M<26;++M,g<<=1);if(M>0)for(h.iushrn(M);M-- >0;)E.isOdd()&&E.iadd(P),E.iushrn(1);for(var m=0,N=1;!(v.words[0]&N)&&m<26;++m,N<<=1);if(m>0)for(v.iushrn(m);m-- >0;)C.isOdd()&&C.iadd(P),C.iushrn(1);h.cmp(v)>=0?(h.isub(v),E.isub(C)):(v.isub(h),C.isub(E))}var ee;return h.cmpn(1)===0?ee=E:ee=C,ee.cmpn(0)<0&&ee.iadd(f),ee},s.prototype.gcd=function(f){if(this.isZero())return f.abs();if(f.isZero())return this.abs();var h=this.clone(),v=f.clone();h.negative=0,v.negative=0;for(var E=0;h.isEven()&&v.isEven();E++)h.iushrn(1),v.iushrn(1);do{for(;h.isEven();)h.iushrn(1);for(;v.isEven();)v.iushrn(1);var C=h.cmp(v);if(C<0){var P=h;h=v,v=P}else if(C===0||v.cmpn(1)===0)break;h.isub(v)}while(!0);return v.iushln(E)},s.prototype.invm=function(f){return this.egcd(f).a.umod(f)},s.prototype.isEven=function(){return(this.words[0]&1)===0},s.prototype.isOdd=function(){return(this.words[0]&1)===1},s.prototype.andln=function(f){return this.words[0]&f},s.prototype.bincn=function(f){i(typeof f=="number");var h=f%26,v=(f-h)/26,E=1<<h;if(this.length<=v)return this._expand(v+1),this.words[v]|=E,this;for(var C=E,P=v;C!==0&&P<this.length;P++){var M=this.words[P]|0;M+=C,C=M>>>26,M&=67108863,this.words[P]=M}return C!==0&&(this.words[P]=C,this.length++),this},s.prototype.isZero=function(){return this.length===1&&this.words[0]===0},s.prototype.cmpn=function(f){var h=f<0;if(this.negative!==0&&!h)return-1;if(this.negative===0&&h)return 1;this._strip();var v;if(this.length>1)v=1;else{h&&(f=-f),i(f<=67108863,"Number is too big");var E=this.words[0]|0;v=E===f?0:E<f?-1:1}return this.negative!==0?-v|0:v},s.prototype.cmp=function(f){if(this.negative!==0&&f.negative===0)return-1;if(this.negative===0&&f.negative!==0)return 1;var h=this.ucmp(f);return this.negative!==0?-h|0:h},s.prototype.ucmp=function(f){if(this.length>f.length)return 1;if(this.length<f.length)return-1;for(var h=0,v=this.length-1;v>=0;v--){var E=this.words[v]|0,C=f.words[v]|0;if(E!==C){E<C?h=-1:E>C&&(h=1);break}}return h},s.prototype.gtn=function(f){return this.cmpn(f)===1},s.prototype.gt=function(f){return this.cmp(f)===1},s.prototype.gten=function(f){return this.cmpn(f)>=0},s.prototype.gte=function(f){return this.cmp(f)>=0},s.prototype.ltn=function(f){return this.cmpn(f)===-1},s.prototype.lt=function(f){return this.cmp(f)===-1},s.prototype.lten=function(f){return this.cmpn(f)<=0},s.prototype.lte=function(f){return this.cmp(f)<=0},s.prototype.eqn=function(f){return this.cmpn(f)===0},s.prototype.eq=function(f){return this.cmp(f)===0},s.red=function(f){return new T(f)},s.prototype.toRed=function(f){return i(!this.red,"Already a number in reduction context"),i(this.negative===0,"red works only with positives"),f.convertTo(this)._forceRed(f)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(f){return this.red=f,this},s.prototype.forceRed=function(f){return i(!this.red,"Already a number in reduction context"),this._forceRed(f)},s.prototype.redAdd=function(f){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,f)},s.prototype.redIAdd=function(f){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,f)},s.prototype.redSub=function(f){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,f)},s.prototype.redISub=function(f){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,f)},s.prototype.redShl=function(f){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,f)},s.prototype.redMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.mul(this,f)},s.prototype.redIMul=function(f){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,f),this.red.imul(this,f)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(f){return i(this.red&&!f.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,f)};var k={k256:null,p224:null,p192:null,p25519:null};function z(f,h){this.name=f,this.p=new s(h,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}z.prototype._tmp=function(){var f=new s(null);return f.words=new Array(Math.ceil(this.n/13)),f},z.prototype.ireduce=function(f){var h=f,v;do this.split(h,this.tmp),h=this.imulK(h),h=h.iadd(this.tmp),v=h.bitLength();while(v>this.n);var E=v<this.n?-1:h.ucmp(this.p);return E===0?(h.words[0]=0,h.length=1):E>0?h.isub(this.p):h.strip!==void 0?h.strip():h._strip(),h},z.prototype.split=function(f,h){f.iushrn(this.n,0,h)},z.prototype.imulK=function(f){return f.imul(this.k)};function _(){z.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}n(_,z),_.prototype.split=function(f,h){for(var v=4194303,E=Math.min(f.length,9),C=0;C<E;C++)h.words[C]=f.words[C];if(h.length=E,f.length<=9){f.words[0]=0,f.length=1;return}var P=f.words[9];for(h.words[h.length++]=P&v,C=10;C<f.length;C++){var M=f.words[C]|0;f.words[C-10]=(M&v)<<4|P>>>22,P=M}P>>>=22,f.words[C-10]=P,P===0&&f.length>10?f.length-=10:f.length-=9},_.prototype.imulK=function(f){f.words[f.length]=0,f.words[f.length+1]=0,f.length+=2;for(var h=0,v=0;v<f.length;v++){var E=f.words[v]|0;h+=E*977,f.words[v]=h&67108863,h=E*64+(h/67108864|0)}return f.words[f.length-1]===0&&(f.length--,f.words[f.length-1]===0&&f.length--),f};function B(){z.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}n(B,z);function X(){z.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}n(X,z);function re(){z.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}n(re,z),re.prototype.imulK=function(f){for(var h=0,v=0;v<f.length;v++){var E=(f.words[v]|0)*19+h,C=E&67108863;E>>>=26,f.words[v]=C,h=E}return h!==0&&(f.words[f.length++]=h),f},s._prime=function(f){if(k[f])return k[f];var h;if(f==="k256")h=new _;else if(f==="p224")h=new B;else if(f==="p192")h=new X;else if(f==="p25519")h=new re;else throw new Error("Unknown prime "+f);return k[f]=h,h};function T(f){if(typeof f=="string"){var h=s._prime(f);this.m=h.p,this.prime=h}else i(f.gtn(1),"modulus must be greater than 1"),this.m=f,this.prime=null}T.prototype._verify1=function(f){i(f.negative===0,"red works only with positives"),i(f.red,"red works only with red numbers")},T.prototype._verify2=function(f,h){i((f.negative|h.negative)===0,"red works only with positives"),i(f.red&&f.red===h.red,"red works only with red numbers")},T.prototype.imod=function(f){return this.prime?this.prime.ireduce(f)._forceRed(this):(b(f,f.umod(this.m)._forceRed(this)),f)},T.prototype.neg=function(f){return f.isZero()?f.clone():this.m.sub(f)._forceRed(this)},T.prototype.add=function(f,h){this._verify2(f,h);var v=f.add(h);return v.cmp(this.m)>=0&&v.isub(this.m),v._forceRed(this)},T.prototype.iadd=function(f,h){this._verify2(f,h);var v=f.iadd(h);return v.cmp(this.m)>=0&&v.isub(this.m),v},T.prototype.sub=function(f,h){this._verify2(f,h);var v=f.sub(h);return v.cmpn(0)<0&&v.iadd(this.m),v._forceRed(this)},T.prototype.isub=function(f,h){this._verify2(f,h);var v=f.isub(h);return v.cmpn(0)<0&&v.iadd(this.m),v},T.prototype.shl=function(f,h){return this._verify1(f),this.imod(f.ushln(h))},T.prototype.imul=function(f,h){return this._verify2(f,h),this.imod(f.imul(h))},T.prototype.mul=function(f,h){return this._verify2(f,h),this.imod(f.mul(h))},T.prototype.isqr=function(f){return this.imul(f,f.clone())},T.prototype.sqr=function(f){return this.mul(f,f)},T.prototype.sqrt=function(f){if(f.isZero())return f.clone();var h=this.m.andln(3);if(i(h%2===1),h===3){var v=this.m.add(new s(1)).iushrn(2);return this.pow(f,v)}for(var E=this.m.subn(1),C=0;!E.isZero()&&E.andln(1)===0;)C++,E.iushrn(1);i(!E.isZero());var P=new s(1).toRed(this),M=P.redNeg(),g=this.m.subn(1).iushrn(1),m=this.m.bitLength();for(m=new s(2*m*m).toRed(this);this.pow(m,g).cmp(M)!==0;)m.redIAdd(M);for(var N=this.pow(m,E),ee=this.pow(f,E.addn(1).iushrn(1)),ae=this.pow(f,E),O=C;ae.cmp(P)!==0;){for(var te=ae,q=0;te.cmp(P)!==0;q++)te=te.redSqr();i(q<O);var G=this.pow(N,new s(1).iushln(O-q-1));ee=ee.redMul(G),N=G.redSqr(),ae=ae.redMul(N),O=q}return ee},T.prototype.invm=function(f){var h=f._invmp(this.m);return h.negative!==0?(h.negative=0,this.imod(h).redNeg()):this.imod(h)},T.prototype.pow=function(f,h){if(h.isZero())return new s(1).toRed(this);if(h.cmpn(1)===0)return f.clone();var v=4,E=new Array(1<<v);E[0]=new s(1).toRed(this),E[1]=f;for(var C=2;C<E.length;C++)E[C]=this.mul(E[C-1],f);var P=E[0],M=0,g=0,m=h.bitLength()%26;for(m===0&&(m=26),C=h.length-1;C>=0;C--){for(var N=h.words[C],ee=m-1;ee>=0;ee--){var ae=N>>ee&1;if(P!==E[0]&&(P=this.sqr(P)),ae===0&&M===0){g=0;continue}M<<=1,M|=ae,g++,!(g!==v&&(C!==0||ee!==0))&&(P=this.mul(P,E[M]),g=0,M=0)}m=26}return P},T.prototype.convertTo=function(f){var h=f.umod(this.m);return h===f?h.clone():h},T.prototype.convertFrom=function(f){var h=f.clone();return h.red=null,h},s.mont=function(f){return new y(f)};function y(f){T.call(this,f),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}n(y,T),y.prototype.convertTo=function(f){return this.imod(f.ushln(this.shift))},y.prototype.convertFrom=function(f){var h=this.imod(f.mul(this.rinv));return h.red=null,h},y.prototype.imul=function(f,h){if(f.isZero()||h.isZero())return f.words[0]=0,f.length=1,f;var v=f.imul(h),E=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=v.isub(E).iushrn(this.shift),P=C;return C.cmp(this.m)>=0?P=C.isub(this.m):C.cmpn(0)<0&&(P=C.iadd(this.m)),P._forceRed(this)},y.prototype.mul=function(f,h){if(f.isZero()||h.isZero())return new s(0)._forceRed(this);var v=f.mul(h),E=v.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=v.isub(E).iushrn(this.shift),P=C;return C.cmp(this.m)>=0?P=C.isub(this.m):C.cmpn(0)<0&&(P=C.iadd(this.m)),P._forceRed(this)},y.prototype.invm=function(f){var h=this.imod(f._invmp(this.m).mul(this.r2));return h._forceRed(this)}})(t,qv)})(Xv);var mt=Xv.exports;const em="bignumber/5.7.0";var Qf=mt.BN;const Ms=new Et(em),id={},tm=9007199254740991;function aA(t){return t!=null&&(nr.isBigNumber(t)||typeof t=="number"&&t%1===0||typeof t=="string"&&!!t.match(/^-?[0-9]+$/)||Li(t)||typeof t=="bigint"||Ka(t))}let rm=!1;class nr{constructor(e,r){e!==id&&Ms.throwError("cannot call constructor directly; use BigNumber.from",Et.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return mi(Rt(this).fromTwos(e))}toTwos(e){return mi(Rt(this).toTwos(e))}abs(){return this._hex[0]==="-"?nr.from(this._hex.substring(1)):this}add(e){return mi(Rt(this).add(Rt(e)))}sub(e){return mi(Rt(this).sub(Rt(e)))}div(e){return nr.from(e).isZero()&&Yi("division-by-zero","div"),mi(Rt(this).div(Rt(e)))}mul(e){return mi(Rt(this).mul(Rt(e)))}mod(e){const r=Rt(e);return r.isNeg()&&Yi("division-by-zero","mod"),mi(Rt(this).umod(r))}pow(e){const r=Rt(e);return r.isNeg()&&Yi("negative-power","pow"),mi(Rt(this).pow(r))}and(e){const r=Rt(e);return(this.isNegative()||r.isNeg())&&Yi("unbound-bitwise-result","and"),mi(Rt(this).and(r))}or(e){const r=Rt(e);return(this.isNegative()||r.isNeg())&&Yi("unbound-bitwise-result","or"),mi(Rt(this).or(r))}xor(e){const r=Rt(e);return(this.isNegative()||r.isNeg())&&Yi("unbound-bitwise-result","xor"),mi(Rt(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&Yi("negative-width","mask"),mi(Rt(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Yi("negative-width","shl"),mi(Rt(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Yi("negative-width","shr"),mi(Rt(this).shrn(e))}eq(e){return Rt(this).eq(Rt(e))}lt(e){return Rt(this).lt(Rt(e))}lte(e){return Rt(this).lte(Rt(e))}gt(e){return Rt(this).gt(Rt(e))}gte(e){return Rt(this).gte(Rt(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Rt(this).isZero()}toNumber(){try{return Rt(this).toNumber()}catch{Yi("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return Ms.throwError("this platform does not support BigInt",Et.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?rm||(rm=!0,Ms.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?Ms.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Et.errors.UNEXPECTED_ARGUMENT,{}):Ms.throwError("BigNumber.toString does not accept parameters",Et.errors.UNEXPECTED_ARGUMENT,{})),Rt(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof nr)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new nr(id,au(e)):e.match(/^-?[0-9]+$/)?new nr(id,au(new Qf(e))):Ms.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&Yi("underflow","BigNumber.from",e),(e>=tm||e<=-tm)&&Yi("overflow","BigNumber.from",e),nr.from(String(e));const r=e;if(typeof r=="bigint")return nr.from(r.toString());if(Ka(r))return nr.from(ni(r));if(r)if(r.toHexString){const i=r.toHexString();if(typeof i=="string")return nr.from(i)}else{let i=r._hex;if(i==null&&r.type==="BigNumber"&&(i=r.hex),typeof i=="string"&&(Li(i)||i[0]==="-"&&Li(i.substring(1))))return nr.from(i)}return Ms.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function au(t){if(typeof t!="string")return au(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&Ms.throwArgumentError("invalid hex","value",t),t=au(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function mi(t){return nr.from(au(t))}function Rt(t){const e=nr.from(t).toHexString();return e[0]==="-"?new Qf("-"+e.substring(3),16):new Qf(e.substring(2),16)}function Yi(t,e,r){const i={fault:t,operation:e};return r!=null&&(i.value=r),Ms.throwError(t,Et.errors.NUMERIC_FAULT,i)}function cA(t){return new Qf(t,36).toString(16)}const si=new Et(em),cu={},im=nr.from(0),nm=nr.from(-1);function sm(t,e,r,i){const n={fault:e,operation:r};return i!==void 0&&(n.value=i),si.throwError(t,Et.errors.NUMERIC_FAULT,n)}let uu="0";for(;uu.length<256;)uu+=uu;function nd(t){if(typeof t!="number")try{t=nr.from(t).toNumber()}catch{}return typeof t=="number"&&t>=0&&t<=256&&!(t%1)?"1"+uu.substring(0,t):si.throwArgumentError("invalid decimal size","decimals",t)}function sd(t,e){e==null&&(e=0);const r=nd(e);t=nr.from(t);const i=t.lt(im);i&&(t=t.mul(nm));let n=t.mod(r).toString();for(;n.length<r.length-1;)n="0"+n;n=n.match(/^([0-9]*[1-9]|0)(0*)/)[1];const s=t.div(r).toString();return r.length===1?t=s:t=s+"."+n,i&&(t="-"+t),t}function Cs(t,e){e==null&&(e=0);const r=nd(e);(typeof t!="string"||!t.match(/^-?[0-9.]+$/))&&si.throwArgumentError("invalid decimal value","value",t);const i=t.substring(0,1)==="-";i&&(t=t.substring(1)),t==="."&&si.throwArgumentError("missing value","value",t);const n=t.split(".");n.length>2&&si.throwArgumentError("too many decimal points","value",t);let s=n[0],a=n[1];for(s||(s="0"),a||(a="0");a[a.length-1]==="0";)a=a.substring(0,a.length-1);for(a.length>r.length-1&&sm("fractional component exceeds decimals","underflow","parseFixed"),a===""&&(a="0");a.length<r.length-1;)a+="0";const u=nr.from(s),l=nr.from(a);let d=u.mul(r).add(l);return i&&(d=d.mul(nm)),d}class Wa{constructor(e,r,i,n){e!==cu&&si.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Et.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=i,this.decimals=n,this.name=(r?"":"u")+"fixed"+String(i)+"x"+String(n),this._multiplier=nd(n),Object.freeze(this)}static from(e){if(e instanceof Wa)return e;typeof e=="number"&&(e=`fixed128x${e}`);let r=!0,i=128,n=18;if(typeof e=="string"){if(e!=="fixed")if(e==="ufixed")r=!1;else{const s=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);s||si.throwArgumentError("invalid fixed format","format",e),r=s[1]!=="u",i=parseInt(s[2]),n=parseInt(s[3])}}else if(e){const s=(a,u,l)=>e[a]==null?l:(typeof e[a]!==u&&si.throwArgumentError("invalid fixed format ("+a+" not "+u+")","format."+a,e[a]),e[a]);r=s("signed","boolean",r),i=s("width","number",i),n=s("decimals","number",n)}return i%8&&si.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",i),n>80&&si.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new Wa(cu,r,i,n)}}class jr{constructor(e,r,i,n){e!==cu&&si.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Et.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=r,this._value=i,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&si.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return jr.fromValue(r.add(i),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return jr.fromValue(r.sub(i),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return jr.fromValue(r.mul(i).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=Cs(this._value,this.format.decimals),i=Cs(e._value,e.format.decimals);return jr.fromValue(r.mul(this.format._multiplier).div(i),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=jr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return this.isNegative()&&i&&(r=r.subUnsafe(om.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");e.length===1&&e.push("0");let r=jr.from(e[0],this.format);const i=!e[1].match(/^(0*)$/);return!this.isNegative()&&i&&(r=r.addUnsafe(om.toFormat(r.format))),r}round(e){e==null&&(e=0);const r=this.toString().split(".");if(r.length===1&&r.push("0"),(e<0||e>80||e%1)&&si.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const i=jr.from("1"+uu.substring(0,e),this.format),n=uA.toFormat(this.format);return this.mulUnsafe(i).addUnsafe(n).floor().divUnsafe(i)}isZero(){return this._value==="0.0"||this._value==="0"}isNegative(){return this._value[0]==="-"}toString(){return this._value}toHexString(e){if(e==null)return this._hex;e%8&&si.throwArgumentError("invalid byte width","width",e);const r=nr.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Yn(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return jr.fromString(this._value,e)}static fromValue(e,r,i){return i==null&&r!=null&&!aA(r)&&(i=r,r=null),r==null&&(r=0),i==null&&(i="fixed"),jr.fromString(sd(e,r),Wa.from(i))}static fromString(e,r){r==null&&(r="fixed");const i=Wa.from(r),n=Cs(e,i.decimals);!i.signed&&n.lt(im)&&sm("unsigned value cannot be negative","overflow","value",e);let s=null;i.signed?s=n.toTwos(i.width).toHexString():(s=n.toHexString(),s=Yn(s,i.width/8));const a=sd(n,i.decimals);return new jr(cu,s,a,i)}static fromBytes(e,r){r==null&&(r="fixed");const i=Wa.from(r);if(lr(e).length>i.width/8)throw new Error("overflow");let n=nr.from(e);i.signed&&(n=n.fromTwos(i.width));const s=n.toTwos((i.signed?0:1)+i.width).toHexString(),a=sd(n,i.decimals);return new jr(cu,s,a,i)}static from(e,r){if(typeof e=="string")return jr.fromString(e,r);if(Ka(e))return jr.fromBytes(e,r);try{return jr.fromValue(e,0,r)}catch(i){if(i.code!==Et.errors.INVALID_ARGUMENT)throw i}return si.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}const om=jr.from(1),uA=jr.from("0.5"),fA="strings/5.7.0",am=new Et(fA);var Zf;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(Zf||(Zf={}));var Va;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(Va||(Va={}));function hA(t,e,r,i,n){return am.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function cm(t,e,r,i,n){if(t===Va.BAD_PREFIX||t===Va.UNEXPECTED_CONTINUE){let s=0;for(let a=e+1;a<r.length&&r[a]>>6===2;a++)s++;return s}return t===Va.OVERRUN?r.length-e-1:0}function lA(t,e,r,i,n){return t===Va.OVERLONG?(i.push(n),0):(i.push(65533),cm(t,e,r))}Object.freeze({error:hA,ignore:cm,replace:lA});function od(t,e=Zf.current){e!=Zf.current&&(am.checkNormalize(),t=t.normalize(e));let r=[];for(let i=0;i<t.length;i++){const n=t.charCodeAt(i);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(n&63|128);else if((n&64512)==55296){i++;const s=t.charCodeAt(i);if(i>=t.length||(s&64512)!==56320)throw new Error("invalid utf-8 string");const a=65536+((n&1023)<<10)+(s&1023);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(a&63|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(n&63|128)}return lr(r)}function dA(t){if(t.length%4!==0)throw new Error("bad data");let e=[];for(let r=0;r<t.length;r+=4)e.push(parseInt(t.substring(r,r+4),16));return e}function ad(t,e){e||(e=function(n){return[parseInt(n,16)]});let r=0,i={};return t.split(",").forEach(n=>{let s=n.split(":");r+=parseInt(s[0],16),i[r]=e(s[1])}),i}function um(t){let e=0;return t.split(",").map(r=>{let i=r.split("-");i.length===1?i[1]="0":i[1]===""&&(i[1]="1");let n=e+parseInt(i[0],16);return e=parseInt(i[1],16),{l:n,h:e}})}um("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),ad("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),ad("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),ad("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",dA),um("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const fm="hash/5.7.0";function pA(t){t=atob(t);const e=[];for(let r=0;r<t.length;r++)e.push(t.charCodeAt(r));return lr(e)}function hm(t,e){e==null&&(e=1);const r=[],i=r.forEach,n=function(s,a){i.call(s,function(u){a>0&&Array.isArray(u)?n(u,a-1):r.push(u)})};return n(t,e),r}function gA(t){const e={};for(let r=0;r<t.length;r++){const i=t[r];e[i[0]]=i[1]}return e}function vA(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,s=[0,1];for(let k=1;k<i;k++)s.push(n+=r());let a=r(),u=e;e+=a;let l=0,d=0;function b(){return l==0&&(d=d<<8|t[e++],l=8),d>>--l&1}const w=31,I=Math.pow(2,w),S=I>>>1,D=S>>1,L=I-1;let K=0;for(let k=0;k<w;k++)K=K<<1|b();let H=[],U=0,W=I;for(;;){let k=Math.floor(((K-U+1)*n-1)/W),z=0,_=i;for(;_-z>1;){let re=z+_>>>1;k<s[re]?_=re:z=re}if(z==0)break;H.push(z);let B=U+Math.floor(W*s[z]/n),X=U+Math.floor(W*s[z+1]/n)-1;for(;!((B^X)&S);)K=K<<1&L|b(),B=B<<1&L,X=X<<1&L|1;for(;B&~X&D;)K=K&S|K<<1&L>>>1|b(),B=B<<1^S,X=(X^S)<<1|S|1;U=B,W=1+X-B}let R=i-4;return H.map(k=>{switch(k-R){case 3:return R+65792+(t[u++]<<16|t[u++]<<8|t[u++]);case 2:return R+256+(t[u++]<<8|t[u++]);case 1:return R+t[u++];default:return k-1}})}function mA(t){let e=0;return()=>t[e++]}function bA(t){return mA(vA(t))}function yA(t){return t&1?~t>>1:t>>1}function wA(t,e){let r=Array(t);for(let i=0;i<t;i++)r[i]=1+e();return r}function lm(t,e){let r=Array(t);for(let i=0,n=-1;i<t;i++)r[i]=n+=1+e();return r}function _A(t,e){let r=Array(t);for(let i=0,n=0;i<t;i++)r[i]=n+=yA(e());return r}function Xf(t,e){let r=lm(t(),t),i=t(),n=lm(i,t),s=wA(i,t);for(let a=0;a<i;a++)for(let u=0;u<s[a];u++)r.push(n[a]+u);return e?r.map(a=>e[a]):r}function EA(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(xA(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(SA(r,t))}return gA(hm(e))}function AA(t){let e=[];for(;;){let r=t();if(r==0)break;e.push(r)}return e}function dm(t,e,r){let i=Array(t).fill(void 0).map(()=>[]);for(let n=0;n<e;n++)_A(t,r).forEach((s,a)=>i[a].push(s));return i}function xA(t,e){let r=1+e(),i=e(),n=AA(e),s=dm(n.length,1+t,e);return hm(s.map((a,u)=>{const l=a[0],d=a.slice(1);return Array(n[u]).fill(void 0).map((b,w)=>{let I=w*i;return[l+w*r,d.map(S=>S+I)]})}))}function SA(t,e){let r=1+e();return dm(r,1+t,e).map(i=>[i[0],i.slice(1)])}function IA(t){let e=Xf(t).sort((i,n)=>i-n);return r();function r(){let i=[];for(;;){let d=Xf(t,e);if(d.length==0)break;i.push({set:new Set(d),node:r()})}i.sort((d,b)=>b.set.size-d.set.size);let n=t(),s=n%3;n=n/3|0;let a=!!(n&1);n>>=1;let u=n==1,l=n==2;return{branches:i,valid:s,fe0f:a,save:u,check:l}}}function MA(){return bA(pA("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA=="))}const eh=MA();new Set(Xf(eh)),new Set(Xf(eh)),EA(eh),IA(eh),new Et(fm),new Uint8Array(32).fill(0);const CA=`Ethereum Signed Message:
22
+ `;function pm(t){return typeof t=="string"&&(t=od(t)),rd(tA([od(CA),od(String(t.length)),t]))}const DA="rlp/5.7.0";new Et(DA);const OA="address/5.7.0",fu=new Et(OA);function gm(t){Li(t,20)||fu.throwArgumentError("invalid address","address",t),t=t.toLowerCase();const e=t.substring(2).split(""),r=new Uint8Array(40);for(let n=0;n<40;n++)r[n]=e[n].charCodeAt(0);const i=lr(rd(r));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(i[n>>1]&15)>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}const PA=9007199254740991;function $A(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}const cd={};for(let t=0;t<10;t++)cd[String(t)]=String(t);for(let t=0;t<26;t++)cd[String.fromCharCode(65+t)]=String(10+t);const vm=Math.floor($A(PA));function RA(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(i=>cd[i]).join("");for(;e.length>=vm;){let i=e.substring(0,vm);e=parseInt(i,10)%97+e.substring(i.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function NA(t){let e=null;if(typeof t!="string"&&fu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=gm(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&fu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==RA(t)&&fu.throwArgumentError("bad icap checksum","address",t),e=cA(t.substring(4));e.length<40;)e="0"+e;e=gm("0x"+e)}else fu.throwArgumentError("invalid address","address",t);return e}const TA="properties/5.7.0";new Et(TA);function hu(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new Et(fm),new Uint8Array(32).fill(0),nr.from(-1);const LA=nr.from(0),BA=nr.from(1);nr.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Yn(BA.toHexString(),32),Yn(LA.toHexString(),32);var Jn={},Nt={},lu=mm;function mm(t,e){if(!t)throw new Error(e||"Assertion failed")}mm.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var ud={exports:{}};typeof Object.create=="function"?ud.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ud.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var FA=lu,UA=ud.exports;Nt.inherits=UA;function kA(t,e){return(t.charCodeAt(e)&64512)!==55296||e<0||e+1>=t.length?!1:(t.charCodeAt(e+1)&64512)===56320}function jA(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if(typeof t=="string")if(e){if(e==="hex")for(t=t.replace(/[^a-z0-9]+/ig,""),t.length%2!==0&&(t="0"+t),n=0;n<t.length;n+=2)r.push(parseInt(t[n]+t[n+1],16))}else for(var i=0,n=0;n<t.length;n++){var s=t.charCodeAt(n);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=s&63|128):kA(t,n)?(s=65536+((s&1023)<<10)+(t.charCodeAt(++n)&1023),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=s&63|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=s&63|128)}else for(n=0;n<t.length;n++)r[n]=t[n]|0;return r}Nt.toArray=jA;function qA(t){for(var e="",r=0;r<t.length;r++)e+=ym(t[r].toString(16));return e}Nt.toHex=qA;function bm(t){var e=t>>>24|t>>>8&65280|t<<8&16711680|(t&255)<<24;return e>>>0}Nt.htonl=bm;function zA(t,e){for(var r="",i=0;i<t.length;i++){var n=t[i];e==="little"&&(n=bm(n)),r+=wm(n.toString(16))}return r}Nt.toHex32=zA;function ym(t){return t.length===1?"0"+t:t}Nt.zero2=ym;function wm(t){return t.length===7?"0"+t:t.length===6?"00"+t:t.length===5?"000"+t:t.length===4?"0000"+t:t.length===3?"00000"+t:t.length===2?"000000"+t:t.length===1?"0000000"+t:t}Nt.zero8=wm;function HA(t,e,r,i){var n=r-e;FA(n%4===0);for(var s=new Array(n/4),a=0,u=e;a<s.length;a++,u+=4){var l;i==="big"?l=t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:l=t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],s[a]=l>>>0}return s}Nt.join32=HA;function KA(t,e){for(var r=new Array(t.length*4),i=0,n=0;i<t.length;i++,n+=4){var s=t[i];e==="big"?(r[n]=s>>>24,r[n+1]=s>>>16&255,r[n+2]=s>>>8&255,r[n+3]=s&255):(r[n+3]=s>>>24,r[n+2]=s>>>16&255,r[n+1]=s>>>8&255,r[n]=s&255)}return r}Nt.split32=KA;function WA(t,e){return t>>>e|t<<32-e}Nt.rotr32=WA;function VA(t,e){return t<<e|t>>>32-e}Nt.rotl32=VA;function GA(t,e){return t+e>>>0}Nt.sum32=GA;function YA(t,e,r){return t+e+r>>>0}Nt.sum32_3=YA;function JA(t,e,r,i){return t+e+r+i>>>0}Nt.sum32_4=JA;function QA(t,e,r,i,n){return t+e+r+i+n>>>0}Nt.sum32_5=QA;function ZA(t,e,r,i){var n=t[e],s=t[e+1],a=i+s>>>0,u=(a<i?1:0)+r+n;t[e]=u>>>0,t[e+1]=a}Nt.sum64=ZA;function XA(t,e,r,i){var n=e+i>>>0,s=(n<e?1:0)+t+r;return s>>>0}Nt.sum64_hi=XA;function ex(t,e,r,i){var n=e+i;return n>>>0}Nt.sum64_lo=ex;function tx(t,e,r,i,n,s,a,u){var l=0,d=e;d=d+i>>>0,l+=d<e?1:0,d=d+s>>>0,l+=d<s?1:0,d=d+u>>>0,l+=d<u?1:0;var b=t+r+n+a+l;return b>>>0}Nt.sum64_4_hi=tx;function rx(t,e,r,i,n,s,a,u){var l=e+i+s+u;return l>>>0}Nt.sum64_4_lo=rx;function ix(t,e,r,i,n,s,a,u,l,d){var b=0,w=e;w=w+i>>>0,b+=w<e?1:0,w=w+s>>>0,b+=w<s?1:0,w=w+u>>>0,b+=w<u?1:0,w=w+d>>>0,b+=w<d?1:0;var I=t+r+n+a+l+b;return I>>>0}Nt.sum64_5_hi=ix;function nx(t,e,r,i,n,s,a,u,l,d){var b=e+i+s+u+d;return b>>>0}Nt.sum64_5_lo=nx;function sx(t,e,r){var i=e<<32-r|t>>>r;return i>>>0}Nt.rotr64_hi=sx;function ox(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Nt.rotr64_lo=ox;function ax(t,e,r){return t>>>r}Nt.shr64_hi=ax;function cx(t,e,r){var i=t<<32-r|e>>>r;return i>>>0}Nt.shr64_lo=cx;var Ga={},_m=Nt,ux=lu;function th(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Ga.BlockHash=th,th.prototype.update=function(t,e){if(t=_m.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){t=this.pending;var r=t.length%this._delta8;this.pending=t.slice(t.length-r,t.length),this.pending.length===0&&(this.pending=null),t=_m.join32(t,0,t.length-r,this.endian);for(var i=0;i<t.length;i+=this._delta32)this._update(t,i,i+this._delta32)}return this},th.prototype.digest=function(t){return this.update(this._pad()),ux(this.pending===null),this._digest(t)},th.prototype._pad=function(){var t=this.pendingTotal,e=this._delta8,r=e-(t+this.padLength)%e,i=new Array(r+this.padLength);i[0]=128;for(var n=1;n<r;n++)i[n]=0;if(t<<=3,this.endian==="big"){for(var s=8;s<this.padLength;s++)i[n++]=0;i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=t>>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=t&255}else for(i[n++]=t&255,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,s=8;s<this.padLength;s++)i[n++]=0;return i};var Ya={},Qn={},fx=Nt,Zn=fx.rotr32;function hx(t,e,r,i){if(t===0)return Em(e,r,i);if(t===1||t===3)return xm(e,r,i);if(t===2)return Am(e,r,i)}Qn.ft_1=hx;function Em(t,e,r){return t&e^~t&r}Qn.ch32=Em;function Am(t,e,r){return t&e^t&r^e&r}Qn.maj32=Am;function xm(t,e,r){return t^e^r}Qn.p32=xm;function lx(t){return Zn(t,2)^Zn(t,13)^Zn(t,22)}Qn.s0_256=lx;function dx(t){return Zn(t,6)^Zn(t,11)^Zn(t,25)}Qn.s1_256=dx;function px(t){return Zn(t,7)^Zn(t,18)^t>>>3}Qn.g0_256=px;function gx(t){return Zn(t,17)^Zn(t,19)^t>>>10}Qn.g1_256=gx;var Ja=Nt,vx=Ga,mx=Qn,fd=Ja.rotl32,du=Ja.sum32,bx=Ja.sum32_5,yx=mx.ft_1,Sm=vx.BlockHash,wx=[1518500249,1859775393,2400959708,3395469782];function Xn(){if(!(this instanceof Xn))return new Xn;Sm.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Ja.inherits(Xn,Sm);var _x=Xn;Xn.blockSize=512,Xn.outSize=160,Xn.hmacStrength=80,Xn.padLength=64,Xn.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=fd(r[i-3]^r[i-8]^r[i-14]^r[i-16],1);var n=this.h[0],s=this.h[1],a=this.h[2],u=this.h[3],l=this.h[4];for(i=0;i<r.length;i++){var d=~~(i/20),b=bx(fd(n,5),yx(d,s,a,u),l,r[i],wx[d]);l=u,u=a,a=fd(s,30),s=n,n=b}this.h[0]=du(this.h[0],n),this.h[1]=du(this.h[1],s),this.h[2]=du(this.h[2],a),this.h[3]=du(this.h[3],u),this.h[4]=du(this.h[4],l)},Xn.prototype._digest=function(t){return t==="hex"?Ja.toHex32(this.h,"big"):Ja.split32(this.h,"big")};var Qa=Nt,Ex=Ga,Za=Qn,Ax=lu,wn=Qa.sum32,xx=Qa.sum32_4,Sx=Qa.sum32_5,Ix=Za.ch32,Mx=Za.maj32,Cx=Za.s0_256,Dx=Za.s1_256,Ox=Za.g0_256,Px=Za.g1_256,Im=Ex.BlockHash,$x=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function es(){if(!(this instanceof es))return new es;Im.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=$x,this.W=new Array(64)}Qa.inherits(es,Im);var Mm=es;es.blockSize=512,es.outSize=256,es.hmacStrength=192,es.padLength=64,es.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i<r.length;i++)r[i]=xx(Px(r[i-2]),r[i-7],Ox(r[i-15]),r[i-16]);var n=this.h[0],s=this.h[1],a=this.h[2],u=this.h[3],l=this.h[4],d=this.h[5],b=this.h[6],w=this.h[7];for(Ax(this.k.length===r.length),i=0;i<r.length;i++){var I=Sx(w,Dx(l),Ix(l,d,b),this.k[i],r[i]),S=wn(Cx(n),Mx(n,s,a));w=b,b=d,d=l,l=wn(u,I),u=a,a=s,s=n,n=wn(I,S)}this.h[0]=wn(this.h[0],n),this.h[1]=wn(this.h[1],s),this.h[2]=wn(this.h[2],a),this.h[3]=wn(this.h[3],u),this.h[4]=wn(this.h[4],l),this.h[5]=wn(this.h[5],d),this.h[6]=wn(this.h[6],b),this.h[7]=wn(this.h[7],w)},es.prototype._digest=function(t){return t==="hex"?Qa.toHex32(this.h,"big"):Qa.split32(this.h,"big")};var hd=Nt,Cm=Mm;function Ds(){if(!(this instanceof Ds))return new Ds;Cm.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}hd.inherits(Ds,Cm);var Rx=Ds;Ds.blockSize=512,Ds.outSize=224,Ds.hmacStrength=192,Ds.padLength=64,Ds.prototype._digest=function(t){return t==="hex"?hd.toHex32(this.h.slice(0,7),"big"):hd.split32(this.h.slice(0,7),"big")};var bi=Nt,Nx=Ga,Tx=lu,ts=bi.rotr64_hi,rs=bi.rotr64_lo,Dm=bi.shr64_hi,Om=bi.shr64_lo,to=bi.sum64,ld=bi.sum64_hi,dd=bi.sum64_lo,Lx=bi.sum64_4_hi,Bx=bi.sum64_4_lo,Fx=bi.sum64_5_hi,Ux=bi.sum64_5_lo,Pm=Nx.BlockHash,kx=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _n(){if(!(this instanceof _n))return new _n;Pm.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=kx,this.W=new Array(160)}bi.inherits(_n,Pm);var $m=_n;_n.blockSize=1024,_n.outSize=512,_n.hmacStrength=192,_n.padLength=128,_n.prototype._prepareBlock=function(t,e){for(var r=this.W,i=0;i<32;i++)r[i]=t[e+i];for(;i<r.length;i+=2){var n=Qx(r[i-4],r[i-3]),s=Zx(r[i-4],r[i-3]),a=r[i-14],u=r[i-13],l=Yx(r[i-30],r[i-29]),d=Jx(r[i-30],r[i-29]),b=r[i-32],w=r[i-31];r[i]=Lx(n,s,a,u,l,d,b,w),r[i+1]=Bx(n,s,a,u,l,d,b,w)}},_n.prototype._update=function(t,e){this._prepareBlock(t,e);var r=this.W,i=this.h[0],n=this.h[1],s=this.h[2],a=this.h[3],u=this.h[4],l=this.h[5],d=this.h[6],b=this.h[7],w=this.h[8],I=this.h[9],S=this.h[10],D=this.h[11],L=this.h[12],K=this.h[13],H=this.h[14],U=this.h[15];Tx(this.k.length===r.length);for(var W=0;W<r.length;W+=2){var R=H,k=U,z=Vx(w,I),_=Gx(w,I),B=jx(w,I,S,D,L),X=qx(w,I,S,D,L,K),re=this.k[W],T=this.k[W+1],y=r[W],f=r[W+1],h=Fx(R,k,z,_,B,X,re,T,y,f),v=Ux(R,k,z,_,B,X,re,T,y,f);R=Kx(i,n),k=Wx(i,n),z=zx(i,n,s,a,u),_=Hx(i,n,s,a,u,l);var E=ld(R,k,z,_),C=dd(R,k,z,_);H=L,U=K,L=S,K=D,S=w,D=I,w=ld(d,b,h,v),I=dd(b,b,h,v),d=u,b=l,u=s,l=a,s=i,a=n,i=ld(h,v,E,C),n=dd(h,v,E,C)}to(this.h,0,i,n),to(this.h,2,s,a),to(this.h,4,u,l),to(this.h,6,d,b),to(this.h,8,w,I),to(this.h,10,S,D),to(this.h,12,L,K),to(this.h,14,H,U)},_n.prototype._digest=function(t){return t==="hex"?bi.toHex32(this.h,"big"):bi.split32(this.h,"big")};function jx(t,e,r,i,n){var s=t&r^~t&n;return s<0&&(s+=4294967296),s}function qx(t,e,r,i,n,s){var a=e&i^~e&s;return a<0&&(a+=4294967296),a}function zx(t,e,r,i,n){var s=t&r^t&n^r&n;return s<0&&(s+=4294967296),s}function Hx(t,e,r,i,n,s){var a=e&i^e&s^i&s;return a<0&&(a+=4294967296),a}function Kx(t,e){var r=ts(t,e,28),i=ts(e,t,2),n=ts(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function Wx(t,e){var r=rs(t,e,28),i=rs(e,t,2),n=rs(e,t,7),s=r^i^n;return s<0&&(s+=4294967296),s}function Vx(t,e){var r=ts(t,e,14),i=ts(t,e,18),n=ts(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function Gx(t,e){var r=rs(t,e,14),i=rs(t,e,18),n=rs(e,t,9),s=r^i^n;return s<0&&(s+=4294967296),s}function Yx(t,e){var r=ts(t,e,1),i=ts(t,e,8),n=Dm(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function Jx(t,e){var r=rs(t,e,1),i=rs(t,e,8),n=Om(t,e,7),s=r^i^n;return s<0&&(s+=4294967296),s}function Qx(t,e){var r=ts(t,e,19),i=ts(e,t,29),n=Dm(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}function Zx(t,e){var r=rs(t,e,19),i=rs(e,t,29),n=Om(t,e,6),s=r^i^n;return s<0&&(s+=4294967296),s}var pd=Nt,Rm=$m;function Os(){if(!(this instanceof Os))return new Os;Rm.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}pd.inherits(Os,Rm);var Xx=Os;Os.blockSize=1024,Os.outSize=384,Os.hmacStrength=192,Os.padLength=128,Os.prototype._digest=function(t){return t==="hex"?pd.toHex32(this.h.slice(0,12),"big"):pd.split32(this.h.slice(0,12),"big")},Ya.sha1=_x,Ya.sha224=Rx,Ya.sha256=Mm,Ya.sha384=Xx,Ya.sha512=$m;var Nm={},Uo=Nt,eS=Ga,rh=Uo.rotl32,Tm=Uo.sum32,pu=Uo.sum32_3,Lm=Uo.sum32_4,Bm=eS.BlockHash;function is(){if(!(this instanceof is))return new is;Bm.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}Uo.inherits(is,Bm),Nm.ripemd160=is,is.blockSize=512,is.outSize=160,is.hmacStrength=192,is.padLength=64,is.prototype._update=function(t,e){for(var r=this.h[0],i=this.h[1],n=this.h[2],s=this.h[3],a=this.h[4],u=r,l=i,d=n,b=s,w=a,I=0;I<80;I++){var S=Tm(rh(Lm(r,Fm(I,i,n,s),t[iS[I]+e],tS(I)),sS[I]),a);r=a,a=s,s=rh(n,10),n=i,i=S,S=Tm(rh(Lm(u,Fm(79-I,l,d,b),t[nS[I]+e],rS(I)),oS[I]),w),u=w,w=b,b=rh(d,10),d=l,l=S}S=pu(this.h[1],n,b),this.h[1]=pu(this.h[2],s,w),this.h[2]=pu(this.h[3],a,u),this.h[3]=pu(this.h[4],r,l),this.h[4]=pu(this.h[0],i,d),this.h[0]=S},is.prototype._digest=function(t){return t==="hex"?Uo.toHex32(this.h,"little"):Uo.split32(this.h,"little")};function Fm(t,e,r,i){return t<=15?e^r^i:t<=31?e&r|~e&i:t<=47?(e|~r)^i:t<=63?e&i|r&~i:e^(r|~i)}function tS(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function rS(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}var iS=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],nS=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],sS=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],oS=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],aS=Nt,cS=lu;function Xa(t,e,r){if(!(this instanceof Xa))return new Xa(t,e,r);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(aS.toArray(e,r))}var uS=Xa;Xa.prototype._init=function(t){t.length>this.blockSize&&(t=new this.Hash().update(t).digest()),cS(t.length<=this.blockSize);for(var e=t.length;e<this.blockSize;e++)t.push(0);for(e=0;e<t.length;e++)t[e]^=54;for(this.inner=new this.Hash().update(t),e=0;e<t.length;e++)t[e]^=106;this.outer=new this.Hash().update(t)},Xa.prototype.update=function(t,e){return this.inner.update(t,e),this},Xa.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var e=t;e.utils=Nt,e.common=Ga,e.sha=Ya,e.ripemd=Nm,e.hmac=uS,e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}(Jn);function ec(t,e,r){return r={path:e,exports:{},require:function(i,n){return fS(i,n??r.path)}},t(r,r.exports),r.exports}function fS(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var gd=Um;function Um(t,e){if(!t)throw new Error(e||"Assertion failed")}Um.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)};var En=ec(function(t,e){var r=e;function i(a,u){if(Array.isArray(a))return a.slice();if(!a)return[];var l=[];if(typeof a!="string"){for(var d=0;d<a.length;d++)l[d]=a[d]|0;return l}if(u==="hex"){a=a.replace(/[^a-z0-9]+/ig,""),a.length%2!==0&&(a="0"+a);for(var d=0;d<a.length;d+=2)l.push(parseInt(a[d]+a[d+1],16))}else for(var d=0;d<a.length;d++){var b=a.charCodeAt(d),w=b>>8,I=b&255;w?l.push(w,I):l.push(I)}return l}r.toArray=i;function n(a){return a.length===1?"0"+a:a}r.zero2=n;function s(a){for(var u="",l=0;l<a.length;l++)u+=n(a[l].toString(16));return u}r.toHex=s,r.encode=function(a,u){return u==="hex"?s(a):a}}),Bi=ec(function(t,e){var r=e;r.assert=gd,r.toArray=En.toArray,r.zero2=En.zero2,r.toHex=En.toHex,r.encode=En.encode;function i(l,d,b){var w=new Array(Math.max(l.bitLength(),b)+1);w.fill(0);for(var I=1<<d+1,S=l.clone(),D=0;D<w.length;D++){var L,K=S.andln(I-1);S.isOdd()?(K>(I>>1)-1?L=(I>>1)-K:L=K,S.isubn(L)):L=0,w[D]=L,S.iushrn(1)}return w}r.getNAF=i;function n(l,d){var b=[[],[]];l=l.clone(),d=d.clone();for(var w=0,I=0,S;l.cmpn(-w)>0||d.cmpn(-I)>0;){var D=l.andln(3)+w&3,L=d.andln(3)+I&3;D===3&&(D=-1),L===3&&(L=-1);var K;D&1?(S=l.andln(7)+w&7,(S===3||S===5)&&L===2?K=-D:K=D):K=0,b[0].push(K);var H;L&1?(S=d.andln(7)+I&7,(S===3||S===5)&&D===2?H=-L:H=L):H=0,b[1].push(H),2*w===K+1&&(w=1-w),2*I===H+1&&(I=1-I),l.iushrn(1),d.iushrn(1)}return b}r.getJSF=n;function s(l,d,b){var w="_"+d;l.prototype[d]=function(){return this[w]!==void 0?this[w]:this[w]=b.call(this)}}r.cachedProperty=s;function a(l){return typeof l=="string"?r.toArray(l,"hex"):l}r.parseBytes=a;function u(l){return new mt(l,"hex","le")}r.intFromLE=u}),ih=Bi.getNAF,hS=Bi.getJSF,nh=Bi.assert;function ro(t,e){this.type=t,this.p=new mt(e.p,16),this.red=e.prime?mt.red(e.prime):mt.mont(this.p),this.zero=new mt(0).toRed(this.red),this.one=new mt(1).toRed(this.red),this.two=new mt(2).toRed(this.red),this.n=e.n&&new mt(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ko=ro;ro.prototype.point=function(){throw new Error("Not implemented")},ro.prototype.validate=function(){throw new Error("Not implemented")},ro.prototype._fixedNafMul=function(t,e){nh(t.precomputed);var r=t._getDoubles(),i=ih(e,1,this._bitLength),n=(1<<r.step+1)-(r.step%2===0?2:1);n/=3;var s=[],a,u;for(a=0;a<i.length;a+=r.step){u=0;for(var l=a+r.step-1;l>=a;l--)u=(u<<1)+i[l];s.push(u)}for(var d=this.jpoint(null,null,null),b=this.jpoint(null,null,null),w=n;w>0;w--){for(a=0;a<s.length;a++)u=s[a],u===w?b=b.mixedAdd(r.points[a]):u===-w&&(b=b.mixedAdd(r.points[a].neg()));d=d.add(b)}return d.toP()},ro.prototype._wnafMul=function(t,e){var r=4,i=t._getNAFPoints(r);r=i.wnd;for(var n=i.points,s=ih(e,r,this._bitLength),a=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&s[u]===0;u--)l++;if(u>=0&&l++,a=a.dblp(l),u<0)break;var d=s[u];nh(d!==0),t.type==="affine"?d>0?a=a.mixedAdd(n[d-1>>1]):a=a.mixedAdd(n[-d-1>>1].neg()):d>0?a=a.add(n[d-1>>1]):a=a.add(n[-d-1>>1].neg())}return t.type==="affine"?a.toP():a},ro.prototype._wnafMulAdd=function(t,e,r,i,n){var s=this._wnafT1,a=this._wnafT2,u=this._wnafT3,l=0,d,b,w;for(d=0;d<i;d++){w=e[d];var I=w._getNAFPoints(t);s[d]=I.wnd,a[d]=I.points}for(d=i-1;d>=1;d-=2){var S=d-1,D=d;if(s[S]!==1||s[D]!==1){u[S]=ih(r[S],s[S],this._bitLength),u[D]=ih(r[D],s[D],this._bitLength),l=Math.max(u[S].length,l),l=Math.max(u[D].length,l);continue}var L=[e[S],null,null,e[D]];e[S].y.cmp(e[D].y)===0?(L[1]=e[S].add(e[D]),L[2]=e[S].toJ().mixedAdd(e[D].neg())):e[S].y.cmp(e[D].y.redNeg())===0?(L[1]=e[S].toJ().mixedAdd(e[D]),L[2]=e[S].add(e[D].neg())):(L[1]=e[S].toJ().mixedAdd(e[D]),L[2]=e[S].toJ().mixedAdd(e[D].neg()));var K=[-3,-1,-5,-7,0,7,5,1,3],H=hS(r[S],r[D]);for(l=Math.max(H[0].length,l),u[S]=new Array(l),u[D]=new Array(l),b=0;b<l;b++){var U=H[0][b]|0,W=H[1][b]|0;u[S][b]=K[(U+1)*3+(W+1)],u[D][b]=0,a[S]=L}}var R=this.jpoint(null,null,null),k=this._wnafT4;for(d=l;d>=0;d--){for(var z=0;d>=0;){var _=!0;for(b=0;b<i;b++)k[b]=u[b][d]|0,k[b]!==0&&(_=!1);if(!_)break;z++,d--}if(d>=0&&z++,R=R.dblp(z),d<0)break;for(b=0;b<i;b++){var B=k[b];B!==0&&(B>0?w=a[b][B-1>>1]:B<0&&(w=a[b][-B-1>>1].neg()),w.type==="affine"?R=R.mixedAdd(w):R=R.add(w))}}for(d=0;d<i;d++)a[d]=null;return n?R:R.toP()};function Ji(t,e){this.curve=t,this.type=e,this.precomputed=null}ro.BasePoint=Ji,Ji.prototype.eq=function(){throw new Error("Not implemented")},Ji.prototype.validate=function(){return this.curve.validate(this)},ro.prototype.decodePoint=function(t,e){t=Bi.toArray(t,e);var r=this.p.byteLength();if((t[0]===4||t[0]===6||t[0]===7)&&t.length-1===2*r){t[0]===6?nh(t[t.length-1]%2===0):t[0]===7&&nh(t[t.length-1]%2===1);var i=this.point(t.slice(1,1+r),t.slice(1+r,1+2*r));return i}else if((t[0]===2||t[0]===3)&&t.length-1===r)return this.pointFromX(t.slice(1,1+r),t[0]===3);throw new Error("Unknown point format")},Ji.prototype.encodeCompressed=function(t){return this.encode(t,!0)},Ji.prototype._encode=function(t){var e=this.curve.p.byteLength(),r=this.getX().toArray("be",e);return t?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",e))},Ji.prototype.encode=function(t,e){return Bi.encode(this._encode(e),t)},Ji.prototype.precompute=function(t){if(this.precomputed)return this;var e={doubles:null,naf:null,beta:null};return e.naf=this._getNAFPoints(8),e.doubles=this._getDoubles(4,t),e.beta=this._getBeta(),this.precomputed=e,this},Ji.prototype._hasDoubles=function(t){if(!this.precomputed)return!1;var e=this.precomputed.doubles;return e?e.points.length>=Math.ceil((t.bitLength()+1)/e.step):!1},Ji.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n<e;n+=t){for(var s=0;s<t;s++)i=i.dbl();r.push(i)}return{step:t,points:r}},Ji.prototype._getNAFPoints=function(t){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var e=[this],r=(1<<t)-1,i=r===1?null:this.dbl(),n=1;n<r;n++)e[n]=e[n-1].add(i);return{wnd:t,points:e}},Ji.prototype._getBeta=function(){return null},Ji.prototype.dblp=function(t){for(var e=this,r=0;r<t;r++)e=e.dbl();return e};var vd=ec(function(t){typeof Object.create=="function"?t.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}}),lS=Bi.assert;function Qi(t){ko.call(this,"short",t),this.a=new mt(t.a,16).toRed(this.red),this.b=new mt(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}vd(Qi,ko);var dS=Qi;Qi.prototype._getEndomorphism=function(t){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,r;if(t.beta)e=new mt(t.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);e=i[0].cmp(i[1])<0?i[0]:i[1],e=e.toRed(this.red)}if(t.lambda)r=new mt(t.lambda,16);else{var n=this._getEndoRoots(this.n);this.g.mul(n[0]).x.cmp(this.g.x.redMul(e))===0?r=n[0]:(r=n[1],lS(this.g.mul(r).x.cmp(this.g.x.redMul(e))===0))}var s;return t.basis?s=t.basis.map(function(a){return{a:new mt(a.a,16),b:new mt(a.b,16)}}):s=this._getEndoBasis(r),{beta:e,lambda:r,basis:s}}},Qi.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:mt.mont(t),r=new mt(2).toRed(e).redInvm(),i=r.redNeg(),n=new mt(3).toRed(e).redNeg().redSqrt().redMul(r),s=i.redAdd(n).fromRed(),a=i.redSub(n).fromRed();return[s,a]},Qi.prototype._getEndoBasis=function(t){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),r=t,i=this.n.clone(),n=new mt(1),s=new mt(0),a=new mt(0),u=new mt(1),l,d,b,w,I,S,D,L=0,K,H;r.cmpn(0)!==0;){var U=i.div(r);K=i.sub(U.mul(r)),H=a.sub(U.mul(n));var W=u.sub(U.mul(s));if(!b&&K.cmp(e)<0)l=D.neg(),d=n,b=K.neg(),w=H;else if(b&&++L===2)break;D=K,i=r,r=K,a=n,n=H,u=s,s=W}I=K.neg(),S=H;var R=b.sqr().add(w.sqr()),k=I.sqr().add(S.sqr());return k.cmp(R)>=0&&(I=l,S=d),b.negative&&(b=b.neg(),w=w.neg()),I.negative&&(I=I.neg(),S=S.neg()),[{a:b,b:w},{a:I,b:S}]},Qi.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),s=r.b.neg().mul(t).divRound(this.n),a=n.mul(r.a),u=s.mul(i.a),l=n.mul(r.b),d=s.mul(i.b),b=t.sub(a).sub(u),w=l.add(d).neg();return{k1:b,k2:w}},Qi.prototype.pointFromX=function(t,e){t=new mt(t,16),t.red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(i.redSqr().redSub(r).cmp(this.zero)!==0)throw new Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},Qi.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return r.redSqr().redISub(n).cmpn(0)===0},Qi.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,s=0;s<t.length;s++){var a=this._endoSplit(e[s]),u=t[s],l=u._getBeta();a.k1.negative&&(a.k1.ineg(),u=u.neg(!0)),a.k2.negative&&(a.k2.ineg(),l=l.neg(!0)),i[s*2]=u,i[s*2+1]=l,n[s*2]=a.k1,n[s*2+1]=a.k2}for(var d=this._wnafMulAdd(1,i,n,s*2,r),b=0;b<s*2;b++)i[b]=null,n[b]=null;return d};function $r(t,e,r,i){ko.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new mt(e,16),this.y=new mt(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}vd($r,ko.BasePoint),Qi.prototype.point=function(t,e,r){return new $r(this,t,e,r)},Qi.prototype.pointFromJSON=function(t,e){return $r.fromJSON(this,t,e)},$r.prototype._getBeta=function(){if(this.curve.endo){var t=this.precomputed;if(t&&t.beta)return t.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(t){var r=this.curve,i=function(n){return r.point(n.x.redMul(r.endo.beta),n.y)};t.beta=e,e.precomputed={beta:null,naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(i)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(i)}}}return e}},$r.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},$r.fromJSON=function(t,e,r){typeof e=="string"&&(e=JSON.parse(e));var i=t.point(e[0],e[1],r);if(!e[2])return i;function n(a){return t.point(a[0],a[1],r)}var s=e[2];return i.precomputed={beta:null,doubles:s.doubles&&{step:s.doubles.step,points:[i].concat(s.doubles.points.map(n))},naf:s.naf&&{wnd:s.naf.wnd,points:[i].concat(s.naf.points.map(n))}},i},$r.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},$r.prototype.isInfinity=function(){return this.inf},$r.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t))return this.curve.point(null,null);if(this.x.cmp(t.x)===0)return this.curve.point(null,null);var e=this.y.redSub(t.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},$r.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(t.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),s=n.redSqr().redISub(this.x.redAdd(this.x)),a=n.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,a)},$r.prototype.getX=function(){return this.x.fromRed()},$r.prototype.getY=function(){return this.y.fromRed()},$r.prototype.mul=function(t){return t=new mt(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},$r.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},$r.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},$r.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||this.x.cmp(t.x)===0&&this.y.cmp(t.y)===0)},$r.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(n){return n.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},$r.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var t=this.curve.jpoint(this.x,this.y,this.curve.one);return t};function qr(t,e,r,i){ko.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&i===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new mt(0)):(this.x=new mt(e,16),this.y=new mt(r,16),this.z=new mt(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}vd(qr,ko.BasePoint),Qi.prototype.jpoint=function(t,e,r){return new qr(this,t,e,r)},qr.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},qr.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},qr.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),s=this.y.redMul(e.redMul(t.z)),a=t.y.redMul(r.redMul(this.z)),u=i.redSub(n),l=s.redSub(a);if(u.cmpn(0)===0)return l.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var d=u.redSqr(),b=d.redMul(u),w=i.redMul(d),I=l.redSqr().redIAdd(b).redISub(w).redISub(w),S=l.redMul(w.redISub(I)).redISub(s.redMul(b)),D=this.z.redMul(t.z).redMul(u);return this.curve.jpoint(I,S,D)},qr.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,s=t.y.redMul(e).redMul(this.z),a=r.redSub(i),u=n.redSub(s);if(a.cmpn(0)===0)return u.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var l=a.redSqr(),d=l.redMul(a),b=r.redMul(l),w=u.redSqr().redIAdd(d).redISub(b).redISub(b),I=u.redMul(b.redISub(w)).redISub(n.redMul(d)),S=this.z.redMul(a);return this.curve.jpoint(w,I,S)},qr.prototype.dblp=function(t){if(t===0)return this;if(this.isInfinity())return this;if(!t)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var r=this;for(e=0;e<t;e++)r=r.dbl();return r}var i=this.curve.a,n=this.curve.tinv,s=this.x,a=this.y,u=this.z,l=u.redSqr().redSqr(),d=a.redAdd(a);for(e=0;e<t;e++){var b=s.redSqr(),w=d.redSqr(),I=w.redSqr(),S=b.redAdd(b).redIAdd(b).redIAdd(i.redMul(l)),D=s.redMul(w),L=S.redSqr().redISub(D.redAdd(D)),K=D.redISub(L),H=S.redMul(K);H=H.redIAdd(H).redISub(I);var U=d.redMul(u);e+1<t&&(l=l.redMul(I)),s=L,u=U,d=H}return this.curve.jpoint(s,d.redMul(n),u)},qr.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},qr.prototype._zeroDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(s);a=a.redIAdd(a);var u=i.redAdd(i).redIAdd(i),l=u.redSqr().redISub(a).redISub(a),d=s.redIAdd(s);d=d.redIAdd(d),d=d.redIAdd(d),t=l,e=u.redMul(a.redISub(l)).redISub(d),r=this.y.redAdd(this.y)}else{var b=this.x.redSqr(),w=this.y.redSqr(),I=w.redSqr(),S=this.x.redAdd(w).redSqr().redISub(b).redISub(I);S=S.redIAdd(S);var D=b.redAdd(b).redIAdd(b),L=D.redSqr(),K=I.redIAdd(I);K=K.redIAdd(K),K=K.redIAdd(K),t=L.redISub(S).redISub(S),e=D.redMul(S.redISub(t)).redISub(K),r=this.y.redMul(this.z),r=r.redIAdd(r)}return this.curve.jpoint(t,e,r)},qr.prototype._threeDbl=function(){var t,e,r;if(this.zOne){var i=this.x.redSqr(),n=this.y.redSqr(),s=n.redSqr(),a=this.x.redAdd(n).redSqr().redISub(i).redISub(s);a=a.redIAdd(a);var u=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),l=u.redSqr().redISub(a).redISub(a);t=l;var d=s.redIAdd(s);d=d.redIAdd(d),d=d.redIAdd(d),e=u.redMul(a.redISub(l)).redISub(d),r=this.y.redAdd(this.y)}else{var b=this.z.redSqr(),w=this.y.redSqr(),I=this.x.redMul(w),S=this.x.redSub(b).redMul(this.x.redAdd(b));S=S.redAdd(S).redIAdd(S);var D=I.redIAdd(I);D=D.redIAdd(D);var L=D.redAdd(D);t=S.redSqr().redISub(L),r=this.y.redAdd(this.z).redSqr().redISub(w).redISub(b);var K=w.redSqr();K=K.redIAdd(K),K=K.redIAdd(K),K=K.redIAdd(K),e=S.redMul(D.redISub(t)).redISub(K)}return this.curve.jpoint(t,e,r)},qr.prototype._dbl=function(){var t=this.curve.a,e=this.x,r=this.y,i=this.z,n=i.redSqr().redSqr(),s=e.redSqr(),a=r.redSqr(),u=s.redAdd(s).redIAdd(s).redIAdd(t.redMul(n)),l=e.redAdd(e);l=l.redIAdd(l);var d=l.redMul(a),b=u.redSqr().redISub(d.redAdd(d)),w=d.redISub(b),I=a.redSqr();I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var S=u.redMul(w).redISub(I),D=r.redAdd(r).redMul(i);return this.curve.jpoint(b,S,D)},qr.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var t=this.x.redSqr(),e=this.y.redSqr(),r=this.z.redSqr(),i=e.redSqr(),n=t.redAdd(t).redIAdd(t),s=n.redSqr(),a=this.x.redAdd(e).redSqr().redISub(t).redISub(i);a=a.redIAdd(a),a=a.redAdd(a).redIAdd(a),a=a.redISub(s);var u=a.redSqr(),l=i.redIAdd(i);l=l.redIAdd(l),l=l.redIAdd(l),l=l.redIAdd(l);var d=n.redIAdd(a).redSqr().redISub(s).redISub(u).redISub(l),b=e.redMul(d);b=b.redIAdd(b),b=b.redIAdd(b);var w=this.x.redMul(u).redISub(b);w=w.redIAdd(w),w=w.redIAdd(w);var I=this.y.redMul(d.redMul(l.redISub(d)).redISub(a.redMul(u)));I=I.redIAdd(I),I=I.redIAdd(I),I=I.redIAdd(I);var S=this.z.redAdd(a).redSqr().redISub(r).redISub(u);return this.curve.jpoint(w,I,S)},qr.prototype.mul=function(t,e){return t=new mt(t,e),this.curve._wnafMul(this,t)},qr.prototype.eq=function(t){if(t.type==="affine")return this.eq(t.toJ());if(this===t)return!0;var e=this.z.redSqr(),r=t.z.redSqr();if(this.x.redMul(r).redISub(t.x.redMul(e)).cmpn(0)!==0)return!1;var i=e.redMul(this.z),n=r.redMul(t.z);return this.y.redMul(n).redISub(t.y.redMul(i)).cmpn(0)===0},qr.prototype.eqXToP=function(t){var e=this.z.redSqr(),r=t.toRed(this.curve.red).redMul(e);if(this.x.cmp(r)===0)return!0;for(var i=t.clone(),n=this.curve.redN.redMul(e);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(n),this.x.cmp(r)===0)return!0}},qr.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},qr.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var sh=ec(function(t,e){var r=e;r.base=ko,r.short=dS,r.mont=null,r.edwards=null}),oh=ec(function(t,e){var r=e,i=Bi.assert;function n(u){u.type==="short"?this.curve=new sh.short(u):u.type==="edwards"?this.curve=new sh.edwards(u):this.curve=new sh.mont(u),this.g=this.curve.g,this.n=this.curve.n,this.hash=u.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=n;function s(u,l){Object.defineProperty(r,u,{configurable:!0,enumerable:!0,get:function(){var d=new n(l);return Object.defineProperty(r,u,{configurable:!0,enumerable:!0,value:d}),d}})}s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Jn.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Jn.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Jn.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Jn.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Jn.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Jn.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Jn.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=null.crash()}catch{a=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Jn.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})});function io(t){if(!(this instanceof io))return new io(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=En.toArray(t.entropy,t.entropyEnc||"hex"),r=En.toArray(t.nonce,t.nonceEnc||"hex"),i=En.toArray(t.pers,t.persEnc||"hex");gd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}var km=io;io.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656},io.prototype._hmac=function(){return new Jn.hmac(this.hash,this.K)},io.prototype._update=function(t){var e=this._hmac().update(this.V).update([0]);t&&(e=e.update(t)),this.K=e.digest(),this.V=this._hmac().update(this.V).digest(),t&&(this.K=this._hmac().update(this.V).update([1]).update(t).digest(),this.V=this._hmac().update(this.V).digest())},io.prototype.reseed=function(t,e,r,i){typeof e!="string"&&(i=r,r=e,e=null),t=En.toArray(t,e),r=En.toArray(r,i),gd(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},io.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof e!="string"&&(i=r,r=e,e=null),r&&(r=En.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length<t;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var s=n.slice(0,t);return this._update(r),this._reseed++,En.encode(s,e)};var md=Bi.assert;function Yr(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var bd=Yr;Yr.fromPublic=function(t,e,r){return e instanceof Yr?e:new Yr(t,{pub:e,pubEnc:r})},Yr.fromPrivate=function(t,e,r){return e instanceof Yr?e:new Yr(t,{priv:e,privEnc:r})},Yr.prototype.validate=function(){var t=this.getPublic();return t.isInfinity()?{result:!1,reason:"Invalid public key"}:t.validate()?t.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},Yr.prototype.getPublic=function(t,e){return typeof t=="string"&&(e=t,t=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),e?this.pub.encode(e,t):this.pub},Yr.prototype.getPrivate=function(t){return t==="hex"?this.priv.toString(16,2):this.priv},Yr.prototype._importPrivate=function(t,e){this.priv=new mt(t,e||16),this.priv=this.priv.umod(this.ec.curve.n)},Yr.prototype._importPublic=function(t,e){if(t.x||t.y){this.ec.curve.type==="mont"?md(t.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&md(t.x&&t.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(t.x,t.y);return}this.pub=this.ec.curve.decodePoint(t,e)},Yr.prototype.derive=function(t){return t.validate()||md(t.validate(),"public point not validated"),t.mul(this.priv).getX()},Yr.prototype.sign=function(t,e,r){return this.ec.sign(t,this,e,r)},Yr.prototype.verify=function(t,e){return this.ec.verify(t,e,this)},Yr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var pS=Bi.assert;function ah(t,e){if(t instanceof ah)return t;this._importDER(t,e)||(pS(t.r&&t.s,"Signature without r or s"),this.r=new mt(t.r,16),this.s=new mt(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var ch=ah;function gS(){this.place=0}function yd(t,e){var r=t[e.place++];if(!(r&128))return r;var i=r&15;if(i===0||i>4)return!1;for(var n=0,s=0,a=e.place;s<i;s++,a++)n<<=8,n|=t[a],n>>>=0;return n<=127?!1:(e.place=a,n)}function jm(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}ah.prototype._importDER=function(t,e){t=Bi.toArray(t,e);var r=new gS;if(t[r.place++]!==48)return!1;var i=yd(t,r);if(i===!1||i+r.place!==t.length||t[r.place++]!==2)return!1;var n=yd(t,r);if(n===!1)return!1;var s=t.slice(r.place,n+r.place);if(r.place+=n,t[r.place++]!==2)return!1;var a=yd(t,r);if(a===!1||t.length!==a+r.place)return!1;var u=t.slice(r.place,a+r.place);if(s[0]===0)if(s[1]&128)s=s.slice(1);else return!1;if(u[0]===0)if(u[1]&128)u=u.slice(1);else return!1;return this.r=new mt(s),this.s=new mt(u),this.recoveryParam=null,!0};function wd(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}ah.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),r[0]&128&&(r=[0].concat(r)),e=jm(e),r=jm(r);!r[0]&&!(r[1]&128);)r=r.slice(1);var i=[2];wd(i,e.length),i=i.concat(e),i.push(2),wd(i,r.length);var n=i.concat(r),s=[48];return wd(s,n.length),s=s.concat(n),Bi.encode(s,t)};var vS=function(){throw new Error("unsupported")},qm=Bi.assert;function Zi(t){if(!(this instanceof Zi))return new Zi(t);typeof t=="string"&&(qm(Object.prototype.hasOwnProperty.call(oh,t),"Unknown curve "+t),t=oh[t]),t instanceof oh.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var mS=Zi;Zi.prototype.keyPair=function(t){return new bd(this,t)},Zi.prototype.keyFromPrivate=function(t,e){return bd.fromPrivate(this,t,e)},Zi.prototype.keyFromPublic=function(t,e){return bd.fromPublic(this,t,e)},Zi.prototype.genKeyPair=function(t){t||(t={});for(var e=new km({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||vS(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new mt(2));;){var n=new mt(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},Zi.prototype._truncateToN=function(t,e){var r=t.byteLength()*8-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},Zi.prototype.sign=function(t,e,r,i){typeof r=="object"&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new mt(t,16));for(var n=this.n.byteLength(),s=e.getPrivate().toArray("be",n),a=t.toArray("be",n),u=new km({hash:this.hash,entropy:s,nonce:a,pers:i.pers,persEnc:i.persEnc||"utf8"}),l=this.n.sub(new mt(1)),d=0;;d++){var b=i.k?i.k(d):new mt(u.generate(this.n.byteLength()));if(b=this._truncateToN(b,!0),!(b.cmpn(1)<=0||b.cmp(l)>=0)){var w=this.g.mul(b);if(!w.isInfinity()){var I=w.getX(),S=I.umod(this.n);if(S.cmpn(0)!==0){var D=b.invm(this.n).mul(S.mul(e.getPrivate()).iadd(t));if(D=D.umod(this.n),D.cmpn(0)!==0){var L=(w.getY().isOdd()?1:0)|(I.cmp(S)!==0?2:0);return i.canonical&&D.cmp(this.nh)>0&&(D=this.n.sub(D),L^=1),new ch({r:S,s:D,recoveryParam:L})}}}}}},Zi.prototype.verify=function(t,e,r,i){t=this._truncateToN(new mt(t,16)),r=this.keyFromPublic(r,i),e=new ch(e,"hex");var n=e.r,s=e.s;if(n.cmpn(1)<0||n.cmp(this.n)>=0||s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a=s.invm(this.n),u=a.mul(t).umod(this.n),l=a.mul(n).umod(this.n),d;return this.curve._maxwellTrick?(d=this.g.jmulAdd(u,r.getPublic(),l),d.isInfinity()?!1:d.eqXToP(n)):(d=this.g.mulAdd(u,r.getPublic(),l),d.isInfinity()?!1:d.getX().umod(this.n).cmp(n)===0)},Zi.prototype.recoverPubKey=function(t,e,r,i){qm((3&r)===r,"The recovery param is more than two bits"),e=new ch(e,i);var n=this.n,s=new mt(t),a=e.r,u=e.s,l=r&1,d=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&d)throw new Error("Unable to find sencond key candinate");d?a=this.curve.pointFromX(a.add(this.curve.n),l):a=this.curve.pointFromX(a,l);var b=e.r.invm(n),w=n.sub(s).mul(b).umod(n),I=u.mul(b).umod(n);return this.g.mulAdd(w,a,I)},Zi.prototype.getKeyRecoveryParam=function(t,e,r,i){if(e=new ch(e,i),e.recoveryParam!==null)return e.recoveryParam;for(var n=0;n<4;n++){var s;try{s=this.recoverPubKey(t,e,n)}catch{continue}if(s.eq(r))return n}throw new Error("Unable to find valid recovery factor")};var bS=ec(function(t,e){var r=e;r.version="6.5.4",r.utils=Bi,r.rand=function(){throw new Error("unsupported")},r.curve=sh,r.curves=oh,r.ec=mS,r.eddsa=null}),yS=bS.ec;const wS="signing-key/5.7.0",_d=new Et(wS);let Ed=null;function ns(){return Ed||(Ed=new yS("secp256k1")),Ed}class _S{constructor(e){hu(this,"curve","secp256k1"),hu(this,"privateKey",ni(e)),iA(this.privateKey)!==32&&_d.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=ns().keyFromPrivate(lr(this.privateKey));hu(this,"publicKey","0x"+r.getPublic(!1,"hex")),hu(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),hu(this,"_isSigningKey",!0)}_addPoint(e){const r=ns().keyFromPublic(lr(this.publicKey)),i=ns().keyFromPublic(lr(e));return"0x"+r.pub.add(i.pub).encodeCompressed("hex")}signDigest(e){const r=ns().keyFromPrivate(lr(this.privateKey)),i=lr(e);i.length!==32&&_d.throwArgumentError("bad digest length","digest",e);const n=r.sign(i,{canonical:!0});return Zv({recoveryParam:n.recoveryParam,r:Yn("0x"+n.r.toString(16),32),s:Yn("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const r=ns().keyFromPrivate(lr(this.privateKey)),i=ns().keyFromPublic(lr(zm(e)));return Yn("0x"+r.derive(i.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function ES(t,e){const r=Zv(e),i={r:lr(r.r),s:lr(r.s)};return"0x"+ns().recoverPubKey(lr(t),i,r.recoveryParam).encode("hex",!1)}function zm(t,e){const r=lr(t);if(r.length===32){const i=new _S(r);return e?"0x"+ns().keyFromPrivate(r).getPublic(!0,"hex"):i.publicKey}else{if(r.length===33)return e?ni(r):"0x"+ns().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+ns().keyFromPublic(r).getPublic(!0,"hex"):ni(r)}return _d.throwArgumentError("invalid public or private key","key","[REDACTED]")}const AS="transactions/5.7.0";new Et(AS);var Hm;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(Hm||(Hm={}));function xS(t){const e=zm(t);return NA(Qv(rd(Qv(e,1)),12))}function SS(t,e){return xS(ES(lr(t),e))}const IS="https://rpc.walletconnect.com/v1";async function MS(t,e,r,i,n,s){switch(r.t){case"eip191":return CS(t,e,r.s);case"eip1271":return await DS(t,e,r.s,i,n,s);default:throw new Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}function CS(t,e,r){return SS(pm(e),r).toLowerCase()===t.toLowerCase()}async function DS(t,e,r,i,n,s){try{const a="0x1626ba7e",u="0000000000000000000000000000000000000000000000000000000000000040",l="0000000000000000000000000000000000000000000000000000000000000041",d=r.substring(2),b=pm(e).substring(2),w=a+b+u+l+d,I=await fetch(`${s||IS}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:OS(),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:w},"latest"]})}),{result:S}=await I.json();return S?S.slice(0,a.length).toLowerCase()===a.toLowerCase():!1}catch(a){return console.error("isValidEip1271Signature: ",a),!1}}function OS(){return Date.now()+Math.floor(Math.random()*1e3)}var PS=Object.defineProperty,$S=Object.defineProperties,RS=Object.getOwnPropertyDescriptors,Km=Object.getOwnPropertySymbols,NS=Object.prototype.hasOwnProperty,TS=Object.prototype.propertyIsEnumerable,Wm=(t,e,r)=>e in t?PS(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,LS=(t,e)=>{for(var r in e||(e={}))NS.call(e,r)&&Wm(t,r,e[r]);if(Km)for(var r of Km(e))TS.call(e,r)&&Wm(t,r,e[r]);return t},BS=(t,e)=>$S(t,RS(e));const FS="did:pkh:",Ad=t=>t?.split(":"),Vm=t=>{const e=t&&Ad(t);if(e)return t.includes(FS)?e[3]:e[1]},Gm=t=>{const e=t&&Ad(t);if(e)return e[2]+":"+e[3]},uh=t=>{const e=t&&Ad(t);if(e)return e.pop()};async function Ym(t){const{cacao:e,projectId:r}=t,{s:i,p:n}=e,s=Jm(n,n.iss),a=uh(n.iss);return await MS(a,s,i,Vm(n.iss),r)}const Jm=(t,e)=>{const r=`${t.domain} wants you to sign in with your Ethereum account:`,i=uh(e);if(!t.aud&&!t.uri)throw new Error("Either `aud` or `uri` is required to construct the message");let n=t.statement||void 0;const s=`URI: ${t.aud||t.uri}`,a=`Version: ${t.version}`,u=`Chain ID: ${Vm(e)}`,l=`Nonce: ${t.nonce}`,d=`Issued At: ${t.iat}`,b=t.exp?`Expiration Time: ${t.exp}`:void 0,w=t.nbf?`Not Before: ${t.nbf}`:void 0,I=t.requestId?`Request ID: ${t.requestId}`:void 0,S=t.resources?`Resources:${t.resources.map(L=>`
23
+ - ${L}`).join("")}`:void 0,D=fh(t.resources);if(D){const L=gu(D);n=VS(n,L)}return[r,i,"",n,"",s,a,u,l,d,b,w,I,S].filter(L=>L!=null).join(`
24
+ `)};function US(t){return Buffer.from(JSON.stringify(t)).toString("base64")}function kS(t){return JSON.parse(Buffer.from(t,"base64").toString("utf-8"))}function jo(t){if(!t)throw new Error("No recap provided, value is undefined");if(!t.att)throw new Error("No `att` property found");const e=Object.keys(t.att);if(!(e!=null&&e.length))throw new Error("No resources found in `att` property");e.forEach(r=>{const i=t.att[r];if(Array.isArray(i))throw new Error(`Resource must be an object: ${r}`);if(typeof i!="object")throw new Error(`Resource must be an object: ${r}`);if(!Object.keys(i).length)throw new Error(`Resource object is empty: ${r}`);Object.keys(i).forEach(n=>{const s=i[n];if(!Array.isArray(s))throw new Error(`Ability limits ${n} must be an array of objects, found: ${s}`);if(!s.length)throw new Error(`Value of ${n} is empty array, must be an array with objects`);s.forEach(a=>{if(typeof a!="object")throw new Error(`Ability limits (${n}) must be an array of objects, found: ${a}`)})})})}function jS(t,e,r,i={}){return r?.sort((n,s)=>n.localeCompare(s)),{att:{[t]:qS(e,r,i)}}}function qS(t,e,r={}){e=e?.sort((n,s)=>n.localeCompare(s));const i=e.map(n=>({[`${t}/${n}`]:[r]}));return Object.assign({},...i)}function Qm(t){return jo(t),`urn:recap:${US(t).replace(/=/g,"")}`}function gu(t){const e=kS(t.replace("urn:recap:",""));return jo(e),e}function zS(t,e,r){const i=jS(t,e,r);return Qm(i)}function HS(t){return t&&t.includes("urn:recap:")}function KS(t,e){const r=gu(t),i=gu(e),n=WS(r,i);return Qm(n)}function WS(t,e){jo(t),jo(e);const r=Object.keys(t.att).concat(Object.keys(e.att)).sort((n,s)=>n.localeCompare(s)),i={att:{}};return r.forEach(n=>{var s,a;Object.keys(((s=t.att)==null?void 0:s[n])||{}).concat(Object.keys(((a=e.att)==null?void 0:a[n])||{})).sort((u,l)=>u.localeCompare(l)).forEach(u=>{var l,d;i.att[n]=BS(LS({},i.att[n]),{[u]:((l=t.att[n])==null?void 0:l[u])||((d=e.att[n])==null?void 0:d[u])})})}),i}function VS(t="",e){jo(e);const r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;const i=[];let n=0;Object.keys(e.att).forEach(u=>{const l=Object.keys(e.att[u]).map(w=>({ability:w.split("/")[0],action:w.split("/")[1]}));l.sort((w,I)=>w.action.localeCompare(I.action));const d={};l.forEach(w=>{d[w.ability]||(d[w.ability]=[]),d[w.ability].push(w.action)});const b=Object.keys(d).map(w=>(n++,`(${n}) '${w}': '${d[w].join("', '")}' for '${u}'.`));i.push(b.join(", ").replace(".,","."))});const s=i.join(" "),a=`${r}${s}`;return`${t?t+" ":""}${a}`}function Zm(t){var e;const r=gu(t);jo(r);const i=(e=r.att)==null?void 0:e.eip155;return i?Object.keys(i).map(n=>n.split("/")[1]):[]}function Xm(t){const e=gu(t);jo(e);const r=[];return Object.values(e.att).forEach(i=>{Object.values(i).forEach(n=>{var s;(s=n?.[0])!=null&&s.chains&&r.push(n[0].chains)})}),[...new Set(r.flat())]}function fh(t){if(!t)return;const e=t?.[t.length-1];return HS(e)?e:void 0}const eb="base10",oi="base16",xd="base64pad",Sd="utf8",tb=0,Ps=1,GS=0,rb=1,Id=12,Md=32;function YS(){const t=D0.generateKeyPair();return{privateKey:vn(t.secretKey,oi),publicKey:vn(t.publicKey,oi)}}function Cd(){const t=Ma.randomBytes(Md);return vn(t,oi)}function JS(t,e){const r=D0.sharedKey(gn(t,oi),gn(e,oi),!0),i=new A8(Jc.SHA256,r).expand(Md);return vn(i,oi)}function hh(t){const e=Jc.hash(gn(t,oi));return vn(e,oi)}function $s(t){const e=Jc.hash(gn(t,Sd));return vn(e,oi)}function QS(t){return gn(`${t}`,eb)}function vu(t){return Number(vn(t,eb))}function ZS(t){const e=QS(typeof t.type<"u"?t.type:tb);if(vu(e)===Ps&&typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");const r=typeof t.senderPublicKey<"u"?gn(t.senderPublicKey,oi):void 0,i=typeof t.iv<"u"?gn(t.iv,oi):Ma.randomBytes(Id),n=new _0.ChaCha20Poly1305(gn(t.symKey,oi)).seal(i,gn(t.message,Sd));return eI({type:e,sealed:n,iv:i,senderPublicKey:r})}function XS(t){const e=new _0.ChaCha20Poly1305(gn(t.symKey,oi)),{sealed:r,iv:i}=lh(t.encoded),n=e.open(i,r);if(n===null)throw new Error("Failed to decrypt");return vn(n,Sd)}function eI(t){if(vu(t.type)===Ps){if(typeof t.senderPublicKey>"u")throw new Error("Missing sender public key for type 1 envelope");return vn(E2([t.type,t.senderPublicKey,t.iv,t.sealed]),xd)}return vn(E2([t.type,t.iv,t.sealed]),xd)}function lh(t){const e=gn(t,xd),r=e.slice(GS,rb),i=rb;if(vu(r)===Ps){const u=i+Md,l=u+Id,d=e.slice(i,u),b=e.slice(u,l),w=e.slice(l);return{type:r,sealed:w,iv:b,senderPublicKey:d}}const n=i+Id,s=e.slice(i,n),a=e.slice(n);return{type:r,sealed:a,iv:s}}function tI(t,e){const r=lh(t);return ib({type:vu(r.type),senderPublicKey:typeof r.senderPublicKey<"u"?vn(r.senderPublicKey,oi):void 0,receiverPublicKey:e?.receiverPublicKey})}function ib(t){const e=t?.type||tb;if(e===Ps){if(typeof t?.senderPublicKey>"u")throw new Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw new Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function nb(t){return t.type===Ps&&typeof t.senderPublicKey=="string"&&typeof t.receiverPublicKey=="string"}function rI(t){return new U2.ec("p256").keyFromPublic({x:Buffer.from(t.x,"base64").toString("hex"),y:Buffer.from(t.y,"base64").toString("hex")},"hex")}function iI(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");const r=e.length%4;return r>0&&(e+="=".repeat(4-r)),e}function nI(t){return Buffer.from(iI(t),"base64")}function sI(t,e){const[r,i,n]=t.split("."),s=nI(n);if(s.length!==64)throw new Error("Invalid signature length");const a=s.slice(0,32).toString("hex"),u=s.slice(32,64).toString("hex"),l=`${r}.${i}`,d=new Jc.SHA256().update(Buffer.from(l)).digest(),b=rI(e),w=Buffer.from(d).toString("hex");if(!b.verify(w,{r:a,s:u}))throw new Error("Invalid signature");return Z0(t).payload}const oI="irn";function Dd(t){return t?.relay||{protocol:oI}}function mu(t){const e=OE[t];if(typeof e>"u")throw new Error(`Relay Protocol not supported: ${t}`);return e}var aI=Object.defineProperty,cI=Object.defineProperties,uI=Object.getOwnPropertyDescriptors,sb=Object.getOwnPropertySymbols,fI=Object.prototype.hasOwnProperty,hI=Object.prototype.propertyIsEnumerable,ob=(t,e,r)=>e in t?aI(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ab=(t,e)=>{for(var r in e||(e={}))fI.call(e,r)&&ob(t,r,e[r]);if(sb)for(var r of sb(e))hI.call(e,r)&&ob(t,r,e[r]);return t},lI=(t,e)=>cI(t,uI(e));function dI(t,e="-"){const r={},i="relay"+e;return Object.keys(t).forEach(n=>{if(n.startsWith(i)){const s=n.replace(i,""),a=t[n];r[s]=a}}),r}function cb(t){t=t.includes("wc://")?t.replace("wc://",""):t,t=t.includes("wc:")?t.replace("wc:",""):t;const e=t.indexOf(":"),r=t.indexOf("?")!==-1?t.indexOf("?"):void 0,i=t.substring(0,e),n=t.substring(e+1,r).split("@"),s=typeof r<"u"?t.substring(r):"",a=Gc.parse(s),u=typeof a.methods=="string"?a.methods.split(","):void 0;return{protocol:i,topic:pI(n[0]),version:parseInt(n[1],10),symKey:a.symKey,relay:dI(a),methods:u,expiryTimestamp:a.expiryTimestamp?parseInt(a.expiryTimestamp,10):void 0}}function pI(t){return t.startsWith("//")?t.substring(2):t}function gI(t,e="-"){const r="relay",i={};return Object.keys(t).forEach(n=>{const s=r+e+n;t[n]&&(i[s]=t[n])}),i}function vI(t){return`${t.protocol}:${t.topic}@${t.version}?`+Gc.stringify(ab(lI(ab({symKey:t.symKey},gI(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function tc(t){const e=[];return t.forEach(r=>{const[i,n]=r.split(":");e.push(`${i}:${n}`)}),e}function mI(t){const e=[];return Object.values(t).forEach(r=>{e.push(...tc(r.accounts))}),e}function bI(t,e){const r=[];return Object.values(t).forEach(i=>{tc(i.accounts).includes(e)&&r.push(...i.methods)}),r}function yI(t,e){const r=[];return Object.values(t).forEach(i=>{tc(i.accounts).includes(e)&&r.push(...i.events)}),r}function Od(t){return t.includes(":")}function bu(t){return Od(t)?t.split(":")[0]:t}function wI(t){const e={};return t?.forEach(r=>{const[i,n]=r.split(":");e[i]||(e[i]={accounts:[],chains:[],events:[]}),e[i].accounts.push(r),e[i].chains.push(`${i}:${n}`)}),e}function ub(t,e){e=e.map(i=>i.replace("did:pkh:",""));const r=wI(e);for(const[i,n]of Object.entries(r))n.methods?n.methods=Yf(n.methods,t):n.methods=t,n.events=["chainChanged","accountsChanged"];return r}const _I={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},EI={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function Ee(t,e){const{message:r,code:i}=EI[t];return{message:e?`${r} ${e}`:r,code:i}}function Gt(t,e){const{message:r,code:i}=_I[t];return{message:e?`${r} ${e}`:r,code:i}}function ss(t,e){return Array.isArray(t)?typeof e<"u"&&t.length?t.every(e):!0:!1}function yu(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function ai(t){return typeof t>"u"}function mr(t,e){return e&&ai(t)?!0:typeof t=="string"&&!!t.trim().length}function Pd(t,e){return e&&ai(t)?!0:typeof t=="number"&&!isNaN(t)}function AI(t,e){const{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),n=Object.keys(r);let s=!0;return Bo(n,i)?(i.forEach(a=>{const{accounts:u,methods:l,events:d}=t.namespaces[a],b=tc(u),w=r[a];(!Bo(Nv(a,w),b)||!Bo(w.methods,l)||!Bo(w.events,d))&&(s=!1)}),s):!1}function dh(t){return mr(t,!1)&&t.includes(":")?t.split(":").length===2:!1}function xI(t){if(mr(t,!1)&&t.includes(":")){const e=t.split(":");if(e.length===3){const r=e[0]+":"+e[1];return!!e[2]&&dh(r)}}return!1}function SI(t){if(mr(t,!1))try{return typeof new URL(t)<"u"}catch{return!1}return!1}function II(t){var e;return(e=t?.proposer)==null?void 0:e.publicKey}function MI(t){return t?.topic}function CI(t,e){let r=null;return mr(t?.publicKey,!1)||(r=Ee("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function fb(t){let e=!0;return ss(t)?t.length&&(e=t.every(r=>mr(r,!1))):e=!1,e}function DI(t,e,r){let i=null;return ss(e)&&e.length?e.forEach(n=>{i||dh(n)||(i=Gt("UNSUPPORTED_CHAINS",`${r}, chain ${n} should be a string and conform to "namespace:chainId" format`))}):dh(t)||(i=Gt("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),i}function OI(t,e,r){let i=null;return Object.entries(t).forEach(([n,s])=>{if(i)return;const a=DI(n,Nv(n,s),`${e} ${r}`);a&&(i=a)}),i}function PI(t,e){let r=null;return ss(t)?t.forEach(i=>{r||xI(i)||(r=Gt("UNSUPPORTED_ACCOUNTS",`${e}, account ${i} should be a string and conform to "namespace:chainId:address" format`))}):r=Gt("UNSUPPORTED_ACCOUNTS",`${e}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function $I(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const n=PI(i?.accounts,`${e} namespace`);n&&(r=n)}),r}function RI(t,e){let r=null;return fb(t?.methods)?fb(t?.events)||(r=Gt("UNSUPPORTED_EVENTS",`${e}, events should be an array of strings or empty array for no events`)):r=Gt("UNSUPPORTED_METHODS",`${e}, methods should be an array of strings or empty array for no methods`),r}function hb(t,e){let r=null;return Object.values(t).forEach(i=>{if(r)return;const n=RI(i,`${e}, namespace`);n&&(r=n)}),r}function NI(t,e,r){let i=null;if(t&&yu(t)){const n=hb(t,e);n&&(i=n);const s=OI(t,e,r);s&&(i=s)}else i=Ee("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}function $d(t,e){let r=null;if(t&&yu(t)){const i=hb(t,e);i&&(r=i);const n=$I(t,e);n&&(r=n)}else r=Ee("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function lb(t){return mr(t.protocol,!0)}function TI(t,e){let r=!1;return e&&!t?r=!0:t&&ss(t)&&t.length&&t.forEach(i=>{r=lb(i)}),r}function LI(t){return typeof t=="number"}function yi(t){return typeof t<"u"&&typeof t!==null}function BI(t){return!(!t||typeof t!="object"||!t.code||!Pd(t.code,!1)||!t.message||!mr(t.message,!1))}function FI(t){return!(ai(t)||!mr(t.method,!1))}function UI(t){return!(ai(t)||ai(t.result)&&ai(t.error)||!Pd(t.id,!1)||!mr(t.jsonrpc,!1))}function kI(t){return!(ai(t)||!mr(t.name,!1))}function db(t,e){return!(!dh(e)||!mI(t).includes(e))}function jI(t,e,r){return mr(r,!1)?bI(t,e).includes(r):!1}function qI(t,e,r){return mr(r,!1)?yI(t,e).includes(r):!1}function pb(t,e,r){let i=null;const n=zI(t),s=HI(e),a=Object.keys(n),u=Object.keys(s),l=gb(Object.keys(t)),d=gb(Object.keys(e)),b=l.filter(w=>!d.includes(w));return b.length&&(i=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces.
25
25
  Required: ${b.toString()}
26
26
  Received: ${Object.keys(e).toString()}`)),Bo(a,u)||(i=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces.
27
27
  Required: ${a.toString()}
28
- Approved: ${u.toString()}`)),Object.keys(e).forEach(w=>{if(!w.includes(":")||i)return;const S=tc(e[w].accounts);S.includes(w)||(i=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${w}
28
+ Approved: ${u.toString()}`)),Object.keys(e).forEach(w=>{if(!w.includes(":")||i)return;const I=tc(e[w].accounts);I.includes(w)||(i=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${w}
29
29
  Required: ${w}
30
- Approved: ${S.toString()}`))}),a.forEach(w=>{i||(Bo(n[w].methods,s[w].methods)?Bo(n[w].events,s[w].events)||(i=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${w}`)):i=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${w}`))}),i}function ZI(t){const e={};return Object.keys(t).forEach(r=>{var i;r.includes(":")?e[r]=t[r]:(i=t[r].chains)==null||i.forEach(n=>{e[n]={methods:t[r].methods,events:t[r].events}})}),e}function mb(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function XI(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const i=tc(t[r].accounts);i?.forEach(n=>{e[n]={accounts:t[r].accounts.filter(s=>s.includes(`${n}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function eM(t,e){return Pd(t,!1)&&t<=e.max&&t>=e.min}function bb(){const t=ou();return new Promise(e=>{switch(t){case Ti.browser:e(tM());break;case Ti.reactNative:e(rM());break;case Ti.node:e(iM());break;default:e(!0)}})}function tM(){return su()&&navigator?.onLine}async function rM(){if(nu()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t?.isConnected}return!0}function iM(){return!0}function nM(t){switch(ou()){case Ti.browser:sM(t);break;case Ti.reactNative:oM(t);break}}function sM(t){!nu()&&su()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function oM(t){nu()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>t(e?.isConnected))}const Rd={};class wu{static get(e){return Rd[e]}static set(e,r){Rd[e]=r}static delete(e){delete Rd[e]}}const aM=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,cM=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,uM=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function fM(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){hM(t);return}return e}function hM(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function dh(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const i=r.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;if(i==="undefined")return;if(i==="null")return null;if(i==="nan")return Number.NaN;if(i==="infinity")return Number.POSITIVE_INFINITY;if(i==="-infinity")return Number.NEGATIVE_INFINITY}if(!uM.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(aM.test(t)||cM.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,fM)}return JSON.parse(t)}catch(i){if(e.strict)throw i;return t}}function lM(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Rr(t,...e){try{return lM(t(...e))}catch(r){return Promise.reject(r)}}function dM(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function pM(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function ph(t){if(dM(t))return String(t);if(pM(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return ph(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function yb(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const Nd="base64:";function gM(t){if(typeof t=="string")return t;yb();const e=Buffer.from(t).toString("base64");return Nd+e}function vM(t){return typeof t!="string"||!t.startsWith(Nd)?t:(yb(),Buffer.from(t.slice(Nd.length),"base64"))}function wi(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function mM(...t){return wi(t.join(":"))}function gh(t){return t=wi(t),t?t+":":""}function zH(t){return t}const bM="memory",yM=()=>{const t=new Map;return{name:bM,options:{},hasItem(e){return t.has(e)},getItem(e){return t.get(e)||null},getItemRaw(e){return t.get(e)||null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return Array.from(t.keys())},clear(){t.clear()},dispose(){t.clear()}}};function wM(t={}){const e={mounts:{"":t.driver||yM()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=d=>{for(const b of e.mountpoints)if(d.startsWith(b))return{base:b,relativeKey:d.slice(b.length),driver:e.mounts[b]};return{base:"",relativeKey:d,driver:e.mounts[""]}},i=(d,b)=>e.mountpoints.filter(w=>w.startsWith(d)||b&&d.startsWith(w)).map(w=>({relativeBase:d.length>w.length?d.slice(w.length):void 0,mountpoint:w,driver:e.mounts[w]})),n=(d,b)=>{if(e.watching){b=wi(b);for(const w of e.watchListeners)w(d,b)}},s=async()=>{if(!e.watching){e.watching=!0;for(const d in e.mounts)e.unwatch[d]=await wb(e.mounts[d],n,d)}},a=async()=>{if(e.watching){for(const d in e.unwatch)await e.unwatch[d]();e.unwatch={},e.watching=!1}},u=(d,b,w)=>{const S=new Map,I=D=>{let L=S.get(D.base);return L||(L={driver:D.driver,base:D.base,items:[]},S.set(D.base,L)),L};for(const D of d){const L=typeof D=="string",K=wi(L?D:D.key),H=L?void 0:D.value,U=L||!D.options?b:{...b,...D.options},W=r(K);I(W).items.push({key:K,value:H,relativeKey:W.relativeKey,options:U})}return Promise.all([...S.values()].map(D=>w(D))).then(D=>D.flat())},l={hasItem(d,b={}){d=wi(d);const{relativeKey:w,driver:S}=r(d);return Rr(S.hasItem,w,b)},getItem(d,b={}){d=wi(d);const{relativeKey:w,driver:S}=r(d);return Rr(S.getItem,w,b).then(I=>dh(I))},getItems(d,b){return u(d,b,w=>w.driver.getItems?Rr(w.driver.getItems,w.items.map(S=>({key:S.relativeKey,options:S.options})),b).then(S=>S.map(I=>({key:mM(w.base,I.key),value:dh(I.value)}))):Promise.all(w.items.map(S=>Rr(w.driver.getItem,S.relativeKey,S.options).then(I=>({key:S.key,value:dh(I)})))))},getItemRaw(d,b={}){d=wi(d);const{relativeKey:w,driver:S}=r(d);return S.getItemRaw?Rr(S.getItemRaw,w,b):Rr(S.getItem,w,b).then(I=>vM(I))},async setItem(d,b,w={}){if(b===void 0)return l.removeItem(d);d=wi(d);const{relativeKey:S,driver:I}=r(d);I.setItem&&(await Rr(I.setItem,S,ph(b),w),I.watch||n("update",d))},async setItems(d,b){await u(d,b,async w=>{w.driver.setItems&&await Rr(w.driver.setItems,w.items.map(S=>({key:S.relativeKey,value:ph(S.value),options:S.options})),b),w.driver.setItem&&await Promise.all(w.items.map(S=>Rr(w.driver.setItem,S.relativeKey,ph(S.value),S.options)))})},async setItemRaw(d,b,w={}){if(b===void 0)return l.removeItem(d,w);d=wi(d);const{relativeKey:S,driver:I}=r(d);if(I.setItemRaw)await Rr(I.setItemRaw,S,b,w);else if(I.setItem)await Rr(I.setItem,S,gM(b),w);else return;I.watch||n("update",d)},async removeItem(d,b={}){typeof b=="boolean"&&(b={removeMeta:b}),d=wi(d);const{relativeKey:w,driver:S}=r(d);S.removeItem&&(await Rr(S.removeItem,w,b),(b.removeMeta||b.removeMata)&&await Rr(S.removeItem,w+"$",b),S.watch||n("remove",d))},async getMeta(d,b={}){typeof b=="boolean"&&(b={nativeOnly:b}),d=wi(d);const{relativeKey:w,driver:S}=r(d),I=Object.create(null);if(S.getMeta&&Object.assign(I,await Rr(S.getMeta,w,b)),!b.nativeOnly){const D=await Rr(S.getItem,w+"$",b).then(L=>dh(L));D&&typeof D=="object"&&(typeof D.atime=="string"&&(D.atime=new Date(D.atime)),typeof D.mtime=="string"&&(D.mtime=new Date(D.mtime)),Object.assign(I,D))}return I},setMeta(d,b,w={}){return this.setItem(d+"$",b,w)},removeMeta(d,b={}){return this.removeItem(d+"$",b)},async getKeys(d,b={}){d=gh(d);const w=i(d,!0);let S=[];const I=[];for(const D of w){const K=(await Rr(D.driver.getKeys,D.relativeBase,b)).map(H=>D.mountpoint+wi(H)).filter(H=>!S.some(U=>H.startsWith(U)));I.push(...K),S=[D.mountpoint,...S.filter(H=>!H.startsWith(D.mountpoint))]}return d?I.filter(D=>D.startsWith(d)&&!D.endsWith("$")):I.filter(D=>!D.endsWith("$"))},async clear(d,b={}){d=gh(d),await Promise.all(i(d,!1).map(async w=>{if(w.driver.clear)return Rr(w.driver.clear,w.relativeBase,b);if(w.driver.removeItem){const S=await w.driver.getKeys(w.relativeBase||"",b);return Promise.all(S.map(I=>w.driver.removeItem(I,b)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(d=>_b(d)))},async watch(d){return await s(),e.watchListeners.push(d),async()=>{e.watchListeners=e.watchListeners.filter(b=>b!==d),e.watchListeners.length===0&&await a()}},async unwatch(){e.watchListeners=[],await a()},mount(d,b){if(d=gh(d),d&&e.mounts[d])throw new Error(`already mounted at ${d}`);return d&&(e.mountpoints.push(d),e.mountpoints.sort((w,S)=>S.length-w.length)),e.mounts[d]=b,e.watching&&Promise.resolve(wb(b,n,d)).then(w=>{e.unwatch[d]=w}).catch(console.error),l},async unmount(d,b=!0){d=gh(d),!(!d||!e.mounts[d])&&(e.watching&&d in e.unwatch&&(e.unwatch[d](),delete e.unwatch[d]),b&&await _b(e.mounts[d]),e.mountpoints=e.mountpoints.filter(w=>w!==d),delete e.mounts[d])},getMount(d=""){d=wi(d)+":";const b=r(d);return{driver:b.driver,base:b.base}},getMounts(d="",b={}){return d=wi(d),i(d,b.parents).map(S=>({driver:S.driver,base:S.mountpoint}))}};return l}function wb(t,e,r){return t.watch?t.watch((i,n)=>e(i,r+n)):()=>{}}async function _b(t){typeof t.dispose=="function"&&await Rr(t.dispose)}function qo(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function Eb(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const i=qo(r);return(n,s)=>i.then(a=>s(a.transaction(e,n).objectStore(e)))}let Td;function _u(){return Td||(Td=Eb("keyval-store","keyval")),Td}function Ab(t,e=_u()){return e("readonly",r=>qo(r.get(t)))}function _M(t,e,r=_u()){return r("readwrite",i=>(i.put(e,t),qo(i.transaction)))}function EM(t,e=_u()){return e("readwrite",r=>(r.delete(t),qo(r.transaction)))}function AM(t=_u()){return t("readwrite",e=>(e.clear(),qo(e.transaction)))}function xM(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},qo(t.transaction)}function SM(t=_u()){return t("readonly",e=>{if(e.getAllKeys)return qo(e.getAllKeys());const r=[];return xM(e,i=>r.push(i.key)).then(()=>r)})}const IM="idb-keyval";var MM=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=n=>e+n;let i;return t.dbName&&t.storeName&&(i=Eb(t.dbName,t.storeName)),{name:IM,options:t,async hasItem(n){return!(typeof await Ab(r(n),i)>"u")},async getItem(n){return await Ab(r(n),i)??null},setItem(n,s){return _M(r(n),s,i)},removeItem(n){return EM(r(n),i)},getKeys(){return SM(i)},clear(){return AM(i)}}};const CM="WALLET_CONNECT_V2_INDEXED_DB",DM="keyvaluestorage";class OM{constructor(){this.indexedDb=wM({driver:MM({dbName:CM,storeName:DM})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Is(r))}async removeItem(e){await this.indexedDb.removeItem(e)}}var Ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},vh={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,i){this[r]=String(i)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(i){r[i]=void 0,delete r[i]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Ld<"u"&&Ld.localStorage?vh.exports=Ld.localStorage:typeof window<"u"&&window.localStorage?vh.exports=window.localStorage:vh.exports=new e})();function PM(t){var e;return[t[0],qa((e=t[1])!=null?e:"")]}class $M{constructor(){this.localStorage=vh.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(PM)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return qa(r)}async setItem(e,r){this.localStorage.setItem(e,Is(r))}async removeItem(e){this.localStorage.removeItem(e)}}const RM="wc_storage_version",xb=1,NM=async(t,e,r)=>{const i=RM,n=await e.getItem(i);if(n&&n>=xb){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const a=[];for(;s.length;){const u=s.shift();if(!u)continue;const l=u.toLowerCase();if(l.includes("wc@")||l.includes("walletconnect")||l.includes("wc_")||l.includes("wallet_connect")){const d=await t.getItem(u);await e.setItem(u,d),a.push(u)}}await e.setItem(i,xb),r(e),TM(t,a)},TM=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};class LM{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new $M;this.storage=e;try{const r=new OM;NM(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}}class zo{}class BM extends zo{constructor(e){super()}}const Sb=Ie.FIVE_SECONDS,rc={pulse:"heartbeat_pulse"};class Bd extends BM{constructor(e){super(e),this.events=new Br.exports.EventEmitter,this.interval=Sb,this.interval=e?.interval||Sb}static async init(e){const r=new Bd(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),Ie.toMiliseconds(this.interval))}pulse(){this.events.emit(rc.pulse)}}function FM(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var UM=kM;function kM(t,e,r){var i=r&&r.stringify||FM,n=1;if(typeof t=="object"&&t!==null){var s=e.length+n;if(s===1)return t;var a=new Array(s);a[0]=i(t);for(var u=1;u<s;u++)a[u]=i(e[u]);return a.join(" ")}if(typeof t!="string")return t;var l=e.length;if(l===0)return t;for(var d="",b=1-n,w=-1,S=t&&t.length||0,I=0;I<S;){if(t.charCodeAt(I)===37&&I+1<S){switch(w=w>-1?w:0,t.charCodeAt(I+1)){case 100:case 102:if(b>=l||e[b]==null)break;w<I&&(d+=t.slice(w,I)),d+=Number(e[b]),w=I+2,I++;break;case 105:if(b>=l||e[b]==null)break;w<I&&(d+=t.slice(w,I)),d+=Math.floor(Number(e[b])),w=I+2,I++;break;case 79:case 111:case 106:if(b>=l||e[b]===void 0)break;w<I&&(d+=t.slice(w,I));var D=typeof e[b];if(D==="string"){d+="'"+e[b]+"'",w=I+2,I++;break}if(D==="function"){d+=e[b].name||"<anonymous>",w=I+2,I++;break}d+=i(e[b]),w=I+2,I++;break;case 115:if(b>=l)break;w<I&&(d+=t.slice(w,I)),d+=String(e[b]),w=I+2,I++;break;case 37:w<I&&(d+=t.slice(w,I)),d+="%",w=I+2,I++,b--;break}++b}++I}return w===-1?t:(w<S&&(d+=t.slice(w)),d)}const Ib=UM;var os=as;const Eu=JM().console||{},jM={mapHttpRequest:bh,mapHttpResponse:bh,wrapRequestSerializer:Ud,wrapResponseSerializer:Ud,wrapErrorSerializer:Ud,req:bh,res:bh,err:WM};function qM(t,e){return Array.isArray(t)?t.filter(function(i){return i!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function as(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||Eu;t.browser.write&&(t.browser.asObject=!0);const i=t.serializers||{},n=qM(t.browser.serialize,i);let s=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const a=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const u=t.level||"info",l=Object.create(r);l.log||(l.log=Au),Object.defineProperty(l,"levelVal",{get:b}),Object.defineProperty(l,"level",{get:w,set:S});const d={transmit:e,serialize:n,asObject:t.browser.asObject,levels:a,timestamp:VM(t)};l.levels=as.levels,l.level=u,l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=Au,l.serializers=i,l._serialize=n,l._stdErrSerialize=s,l.child=I,e&&(l._logEvent=Fd());function b(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function S(D){if(D!=="silent"&&!this.levels.values[D])throw Error("unknown level "+D);this._level=D,ic(d,l,"error","log"),ic(d,l,"fatal","error"),ic(d,l,"warn","error"),ic(d,l,"info","log"),ic(d,l,"debug","log"),ic(d,l,"trace","log")}function I(D,L){if(!D)throw new Error("missing bindings for child Pino");L=L||{},n&&D.serializers&&(L.serializers=D.serializers);const K=L.serializers;if(n&&K){var H=Object.assign({},i,K),U=t.browser.serialize===!0?Object.keys(H):n;delete D.serializers,mh([D],U,H,this._stdErrSerialize)}function W(R){this._childLevel=(R._childLevel|0)+1,this.error=nc(R,D,"error"),this.fatal=nc(R,D,"fatal"),this.warn=nc(R,D,"warn"),this.info=nc(R,D,"info"),this.debug=nc(R,D,"debug"),this.trace=nc(R,D,"trace"),H&&(this.serializers=H,this._serialize=U),e&&(this._logEvent=Fd([].concat(R._logEvent.bindings,D)))}return W.prototype=this,new W(this)}return l}as.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},as.stdSerializers=jM,as.stdTimeFunctions=Object.assign({},{nullTime:Mb,epochTime:Cb,unixTime:GM,isoTime:YM});function ic(t,e,r,i){const n=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Au:n[r]?n[r]:Eu[r]||Eu[i]||Au,zM(t,e,r)}function zM(t,e,r){!t.transmit&&e[r]===Au||(e[r]=function(i){return function(){const s=t.timestamp(),a=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Eu?Eu:this;for(var l=0;l<a.length;l++)a[l]=arguments[l];if(t.serialize&&!t.asObject&&mh(a,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?i.call(u,HM(this,r,a,s)):i.apply(u,a),t.transmit){const d=t.transmit.level||e.level,b=as.levels.values[d],w=as.levels.values[r];if(w<b)return;KM(this,{ts:s,methodLevel:r,methodValue:w,transmitLevel:d,transmitValue:as.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},a)}}}(e[r]))}function HM(t,e,r,i){t._serialize&&mh(r,t._serialize,t.serializers,t._stdErrSerialize);const n=r.slice();let s=n[0];const a={};i&&(a.time=i),a.level=as.levels.values[e];let u=(t._childLevel|0)+1;if(u<1&&(u=1),s!==null&&typeof s=="object"){for(;u--&&typeof n[0]=="object";)Object.assign(a,n.shift());s=n.length?Ib(n.shift(),n):void 0}else typeof s=="string"&&(s=Ib(n.shift(),n));return s!==void 0&&(a.msg=s),a}function mh(t,e,r,i){for(const n in t)if(i&&t[n]instanceof Error)t[n]=as.stdSerializers.err(t[n]);else if(typeof t[n]=="object"&&!Array.isArray(t[n]))for(const s in t[n])e&&e.indexOf(s)>-1&&s in r&&(t[n][s]=r[s](t[n][s]))}function nc(t,e,r){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;n<i.length;n++)i[n]=arguments[n-1];return t[r].apply(this,i)}}function KM(t,e,r){const i=e.send,n=e.ts,s=e.methodLevel,a=e.methodValue,u=e.val,l=t._logEvent.bindings;mh(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=n,t._logEvent.messages=r.filter(function(d){return l.indexOf(d)===-1}),t._logEvent.level.label=s,t._logEvent.level.value=a,i(s,t._logEvent,u),t._logEvent=Fd(l)}function Fd(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function WM(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function VM(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Mb:Cb}function bh(){return{}}function Ud(t){return t}function Au(){}function Mb(){return!1}function Cb(){return Date.now()}function GM(){return Math.round(Date.now()/1e3)}function YM(){return new Date(Date.now()).toISOString()}function JM(){function t(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}const QM={level:"info"},xu="custom_context",kd=1e3*1024;class ZM{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Db{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new ZM(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}}class Ob{constructor(e,r=kd){this.level=e??"error",this.levelValue=os.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new Db(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===os.levels.values.error?console.error(e):r===os.levels.values.warn?console.warn(e):r===os.levels.values.debug?console.debug(e):r===os.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Is({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new Db(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Is({extraMetadata:e})),new Blob(r,{type:"application/json"})}}class XM{constructor(e,r=kd){this.baseChunkLogger=new Ob(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=r,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}}class eC{constructor(e,r=kd){this.baseChunkLogger=new Ob(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var tC=Object.defineProperty,rC=Object.defineProperties,iC=Object.getOwnPropertyDescriptors,Pb=Object.getOwnPropertySymbols,nC=Object.prototype.hasOwnProperty,sC=Object.prototype.propertyIsEnumerable,$b=(t,e,r)=>e in t?tC(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,yh=(t,e)=>{for(var r in e||(e={}))nC.call(e,r)&&$b(t,r,e[r]);if(Pb)for(var r of Pb(e))sC.call(e,r)&&$b(t,r,e[r]);return t},wh=(t,e)=>rC(t,iC(e));function _h(t){return wh(yh({},t),{level:t?.level||QM.level})}function oC(t,e=xu){return t[e]||""}function aC(t,e,r=xu){return t[r]=e,t}function _i(t,e=xu){let r="";return typeof t.bindings>"u"?r=oC(t,e):r=t.bindings().context||"",r}function cC(t,e,r=xu){const i=_i(t,r);return i.trim()?`${i}/${e}`:e}function ci(t,e,r=xu){const i=cC(t,e,r),n=t.child({context:i});return aC(n,i,r)}function uC(t){var e,r;const i=new XM((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:os(wh(yh({},t.opts),{level:"trace",browser:wh(yh({},(r=t.opts)==null?void 0:r.browser),{write:n=>i.write(n)})})),chunkLoggerController:i}}function fC(t){var e;const r=new eC((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:os(wh(yh({},t.opts),{level:"trace"})),chunkLoggerController:r}}function hC(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?uC(t):fC(t)}class lC extends zo{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class dC extends zo{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class pC{constructor(e,r){this.logger=e,this.core=r}}class gC extends zo{constructor(e,r){super(),this.relayer=e,this.logger=r}}class vC extends zo{constructor(e){super()}}class mC{constructor(e,r,i,n){this.core=e,this.logger=r,this.name=i}}class bC extends zo{constructor(e,r){super(),this.relayer=e,this.logger=r}}class yC extends zo{constructor(e,r){super(),this.core=e,this.logger=r}}class wC{constructor(e,r,i){this.core=e,this.logger=r,this.store=i}}class _C{constructor(e,r){this.projectId=e,this.logger=r}}class EC{constructor(e,r,i){this.core=e,this.logger=r,this.telemetryEnabled=i}}class AC{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class xC{constructor(e){this.client=e}}function SC(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Rb(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const Nb=Rb("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),jd=Rb("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=SC(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),IC={utf8:Nb,"utf-8":Nb,hex:Ca.base16,latin1:jd,ascii:jd,binary:jd,...Ca};function MC(t,e="utf8"){const r=IC[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}const CC="PARSE_ERROR",DC="INVALID_REQUEST",OC="METHOD_NOT_FOUND",PC="INVALID_PARAMS",Tb="INTERNAL_ERROR",qd="SERVER_ERROR",$C=[-32700,-32600,-32601,-32602,-32603],Su={[CC]:{code:-32700,message:"Parse error"},[DC]:{code:-32600,message:"Invalid Request"},[OC]:{code:-32601,message:"Method not found"},[PC]:{code:-32602,message:"Invalid params"},[Tb]:{code:-32603,message:"Internal error"},[qd]:{code:-32e3,message:"Server error"}},Lb=qd;function RC(t){return $C.includes(t)}function Bb(t){return Object.keys(Su).includes(t)?Su[t]:Su[Lb]}function NC(t){const e=Object.values(Su).find(r=>r.code===t);return e||Su[Lb]}function Fb(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Ub={};/*! *****************************************************************************
30
+ Approved: ${I.toString()}`))}),a.forEach(w=>{i||(Bo(n[w].methods,s[w].methods)?Bo(n[w].events,s[w].events)||(i=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${w}`)):i=Ee("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${w}`))}),i}function zI(t){const e={};return Object.keys(t).forEach(r=>{var i;r.includes(":")?e[r]=t[r]:(i=t[r].chains)==null||i.forEach(n=>{e[n]={methods:t[r].methods,events:t[r].events}})}),e}function gb(t){return[...new Set(t.map(e=>e.includes(":")?e.split(":")[0]:e))]}function HI(t){const e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{const i=tc(t[r].accounts);i?.forEach(n=>{e[n]={accounts:t[r].accounts.filter(s=>s.includes(`${n}:`)),methods:t[r].methods,events:t[r].events}})}}),e}function KI(t,e){return Pd(t,!1)&&t<=e.max&&t>=e.min}function vb(){const t=ou();return new Promise(e=>{switch(t){case Ti.browser:e(WI());break;case Ti.reactNative:e(VI());break;case Ti.node:e(GI());break;default:e(!0)}})}function WI(){return su()&&navigator?.onLine}async function VI(){if(nu()&&typeof global<"u"&&global!=null&&global.NetInfo){const t=await(global==null?void 0:global.NetInfo.fetch());return t?.isConnected}return!0}function GI(){return!0}function YI(t){switch(ou()){case Ti.browser:JI(t);break;case Ti.reactNative:QI(t);break}}function JI(t){!nu()&&su()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)))}function QI(t){nu()&&typeof global<"u"&&global!=null&&global.NetInfo&&global?.NetInfo.addEventListener(e=>t(e?.isConnected))}const Rd={};class wu{static get(e){return Rd[e]}static set(e,r){Rd[e]=r}static delete(e){delete Rd[e]}}const ZI=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,XI=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,eM=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function tM(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){rM(t);return}return e}function rM(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function ph(t,e={}){if(typeof t!="string")return t;const r=t.trim();if(t[0]==='"'&&t.at(-1)==='"'&&!t.includes("\\"))return r.slice(1,-1);if(r.length<=9){const i=r.toLowerCase();if(i==="true")return!0;if(i==="false")return!1;if(i==="undefined")return;if(i==="null")return null;if(i==="nan")return Number.NaN;if(i==="infinity")return Number.POSITIVE_INFINITY;if(i==="-infinity")return Number.NEGATIVE_INFINITY}if(!eM.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(ZI.test(t)||XI.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,tM)}return JSON.parse(t)}catch(i){if(e.strict)throw i;return t}}function iM(t){return!t||typeof t.then!="function"?Promise.resolve(t):t}function Rr(t,...e){try{return iM(t(...e))}catch(r){return Promise.reject(r)}}function nM(t){const e=typeof t;return t===null||e!=="object"&&e!=="function"}function sM(t){const e=Object.getPrototypeOf(t);return!e||e.isPrototypeOf(Object)}function gh(t){if(nM(t))return String(t);if(sM(t)||Array.isArray(t))return JSON.stringify(t);if(typeof t.toJSON=="function")return gh(t.toJSON());throw new Error("[unstorage] Cannot stringify value!")}function mb(){if(typeof Buffer===void 0)throw new TypeError("[unstorage] Buffer is not supported!")}const Nd="base64:";function oM(t){if(typeof t=="string")return t;mb();const e=Buffer.from(t).toString("base64");return Nd+e}function aM(t){return typeof t!="string"||!t.startsWith(Nd)?t:(mb(),Buffer.from(t.slice(Nd.length),"base64"))}function wi(t){return t?t.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function cM(...t){return wi(t.join(":"))}function vh(t){return t=wi(t),t?t+":":""}function NH(t){return t}const uM="memory",fM=()=>{const t=new Map;return{name:uM,options:{},hasItem(e){return t.has(e)},getItem(e){return t.get(e)||null},getItemRaw(e){return t.get(e)||null},setItem(e,r){t.set(e,r)},setItemRaw(e,r){t.set(e,r)},removeItem(e){t.delete(e)},getKeys(){return Array.from(t.keys())},clear(){t.clear()},dispose(){t.clear()}}};function hM(t={}){const e={mounts:{"":t.driver||fM()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=d=>{for(const b of e.mountpoints)if(d.startsWith(b))return{base:b,relativeKey:d.slice(b.length),driver:e.mounts[b]};return{base:"",relativeKey:d,driver:e.mounts[""]}},i=(d,b)=>e.mountpoints.filter(w=>w.startsWith(d)||b&&d.startsWith(w)).map(w=>({relativeBase:d.length>w.length?d.slice(w.length):void 0,mountpoint:w,driver:e.mounts[w]})),n=(d,b)=>{if(e.watching){b=wi(b);for(const w of e.watchListeners)w(d,b)}},s=async()=>{if(!e.watching){e.watching=!0;for(const d in e.mounts)e.unwatch[d]=await bb(e.mounts[d],n,d)}},a=async()=>{if(e.watching){for(const d in e.unwatch)await e.unwatch[d]();e.unwatch={},e.watching=!1}},u=(d,b,w)=>{const I=new Map,S=D=>{let L=I.get(D.base);return L||(L={driver:D.driver,base:D.base,items:[]},I.set(D.base,L)),L};for(const D of d){const L=typeof D=="string",K=wi(L?D:D.key),H=L?void 0:D.value,U=L||!D.options?b:{...b,...D.options},W=r(K);S(W).items.push({key:K,value:H,relativeKey:W.relativeKey,options:U})}return Promise.all([...I.values()].map(D=>w(D))).then(D=>D.flat())},l={hasItem(d,b={}){d=wi(d);const{relativeKey:w,driver:I}=r(d);return Rr(I.hasItem,w,b)},getItem(d,b={}){d=wi(d);const{relativeKey:w,driver:I}=r(d);return Rr(I.getItem,w,b).then(S=>ph(S))},getItems(d,b){return u(d,b,w=>w.driver.getItems?Rr(w.driver.getItems,w.items.map(I=>({key:I.relativeKey,options:I.options})),b).then(I=>I.map(S=>({key:cM(w.base,S.key),value:ph(S.value)}))):Promise.all(w.items.map(I=>Rr(w.driver.getItem,I.relativeKey,I.options).then(S=>({key:I.key,value:ph(S)})))))},getItemRaw(d,b={}){d=wi(d);const{relativeKey:w,driver:I}=r(d);return I.getItemRaw?Rr(I.getItemRaw,w,b):Rr(I.getItem,w,b).then(S=>aM(S))},async setItem(d,b,w={}){if(b===void 0)return l.removeItem(d);d=wi(d);const{relativeKey:I,driver:S}=r(d);S.setItem&&(await Rr(S.setItem,I,gh(b),w),S.watch||n("update",d))},async setItems(d,b){await u(d,b,async w=>{w.driver.setItems&&await Rr(w.driver.setItems,w.items.map(I=>({key:I.relativeKey,value:gh(I.value),options:I.options})),b),w.driver.setItem&&await Promise.all(w.items.map(I=>Rr(w.driver.setItem,I.relativeKey,gh(I.value),I.options)))})},async setItemRaw(d,b,w={}){if(b===void 0)return l.removeItem(d,w);d=wi(d);const{relativeKey:I,driver:S}=r(d);if(S.setItemRaw)await Rr(S.setItemRaw,I,b,w);else if(S.setItem)await Rr(S.setItem,I,oM(b),w);else return;S.watch||n("update",d)},async removeItem(d,b={}){typeof b=="boolean"&&(b={removeMeta:b}),d=wi(d);const{relativeKey:w,driver:I}=r(d);I.removeItem&&(await Rr(I.removeItem,w,b),(b.removeMeta||b.removeMata)&&await Rr(I.removeItem,w+"$",b),I.watch||n("remove",d))},async getMeta(d,b={}){typeof b=="boolean"&&(b={nativeOnly:b}),d=wi(d);const{relativeKey:w,driver:I}=r(d),S=Object.create(null);if(I.getMeta&&Object.assign(S,await Rr(I.getMeta,w,b)),!b.nativeOnly){const D=await Rr(I.getItem,w+"$",b).then(L=>ph(L));D&&typeof D=="object"&&(typeof D.atime=="string"&&(D.atime=new Date(D.atime)),typeof D.mtime=="string"&&(D.mtime=new Date(D.mtime)),Object.assign(S,D))}return S},setMeta(d,b,w={}){return this.setItem(d+"$",b,w)},removeMeta(d,b={}){return this.removeItem(d+"$",b)},async getKeys(d,b={}){d=vh(d);const w=i(d,!0);let I=[];const S=[];for(const D of w){const K=(await Rr(D.driver.getKeys,D.relativeBase,b)).map(H=>D.mountpoint+wi(H)).filter(H=>!I.some(U=>H.startsWith(U)));S.push(...K),I=[D.mountpoint,...I.filter(H=>!H.startsWith(D.mountpoint))]}return d?S.filter(D=>D.startsWith(d)&&!D.endsWith("$")):S.filter(D=>!D.endsWith("$"))},async clear(d,b={}){d=vh(d),await Promise.all(i(d,!1).map(async w=>{if(w.driver.clear)return Rr(w.driver.clear,w.relativeBase,b);if(w.driver.removeItem){const I=await w.driver.getKeys(w.relativeBase||"",b);return Promise.all(I.map(S=>w.driver.removeItem(S,b)))}}))},async dispose(){await Promise.all(Object.values(e.mounts).map(d=>yb(d)))},async watch(d){return await s(),e.watchListeners.push(d),async()=>{e.watchListeners=e.watchListeners.filter(b=>b!==d),e.watchListeners.length===0&&await a()}},async unwatch(){e.watchListeners=[],await a()},mount(d,b){if(d=vh(d),d&&e.mounts[d])throw new Error(`already mounted at ${d}`);return d&&(e.mountpoints.push(d),e.mountpoints.sort((w,I)=>I.length-w.length)),e.mounts[d]=b,e.watching&&Promise.resolve(bb(b,n,d)).then(w=>{e.unwatch[d]=w}).catch(console.error),l},async unmount(d,b=!0){d=vh(d),!(!d||!e.mounts[d])&&(e.watching&&d in e.unwatch&&(e.unwatch[d](),delete e.unwatch[d]),b&&await yb(e.mounts[d]),e.mountpoints=e.mountpoints.filter(w=>w!==d),delete e.mounts[d])},getMount(d=""){d=wi(d)+":";const b=r(d);return{driver:b.driver,base:b.base}},getMounts(d="",b={}){return d=wi(d),i(d,b.parents).map(I=>({driver:I.driver,base:I.mountpoint}))}};return l}function bb(t,e,r){return t.watch?t.watch((i,n)=>e(i,r+n)):()=>{}}async function yb(t){typeof t.dispose=="function"&&await Rr(t.dispose)}function qo(t){return new Promise((e,r)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>r(t.error)})}function wb(t,e){const r=indexedDB.open(t);r.onupgradeneeded=()=>r.result.createObjectStore(e);const i=qo(r);return(n,s)=>i.then(a=>s(a.transaction(e,n).objectStore(e)))}let Td;function _u(){return Td||(Td=wb("keyval-store","keyval")),Td}function _b(t,e=_u()){return e("readonly",r=>qo(r.get(t)))}function lM(t,e,r=_u()){return r("readwrite",i=>(i.put(e,t),qo(i.transaction)))}function dM(t,e=_u()){return e("readwrite",r=>(r.delete(t),qo(r.transaction)))}function pM(t=_u()){return t("readwrite",e=>(e.clear(),qo(e.transaction)))}function gM(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},qo(t.transaction)}function vM(t=_u()){return t("readonly",e=>{if(e.getAllKeys)return qo(e.getAllKeys());const r=[];return gM(e,i=>r.push(i.key)).then(()=>r)})}const mM="idb-keyval";var bM=(t={})=>{const e=t.base&&t.base.length>0?`${t.base}:`:"",r=n=>e+n;let i;return t.dbName&&t.storeName&&(i=wb(t.dbName,t.storeName)),{name:mM,options:t,async hasItem(n){return!(typeof await _b(r(n),i)>"u")},async getItem(n){return await _b(r(n),i)??null},setItem(n,s){return lM(r(n),s,i)},removeItem(n){return dM(r(n),i)},getKeys(){return vM(i)},clear(){return pM(i)}}};const yM="WALLET_CONNECT_V2_INDEXED_DB",wM="keyvaluestorage";class _M{constructor(){this.indexedDb=hM({driver:bM({dbName:yM,storeName:wM})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){const r=await this.indexedDb.getItem(e);if(r!==null)return r}async setItem(e,r){await this.indexedDb.setItem(e,Is(r))}async removeItem(e){await this.indexedDb.removeItem(e)}}var Ld=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},mh={exports:{}};(function(){let t;function e(){}t=e,t.prototype.getItem=function(r){return this.hasOwnProperty(r)?String(this[r]):null},t.prototype.setItem=function(r,i){this[r]=String(i)},t.prototype.removeItem=function(r){delete this[r]},t.prototype.clear=function(){const r=this;Object.keys(r).forEach(function(i){r[i]=void 0,delete r[i]})},t.prototype.key=function(r){return r=r||0,Object.keys(this)[r]},t.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),typeof Ld<"u"&&Ld.localStorage?mh.exports=Ld.localStorage:typeof window<"u"&&window.localStorage?mh.exports=window.localStorage:mh.exports=new e})();function EM(t){var e;return[t[0],qa((e=t[1])!=null?e:"")]}class AM{constructor(){this.localStorage=mh.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(EM)}async getItem(e){const r=this.localStorage.getItem(e);if(r!==null)return qa(r)}async setItem(e,r){this.localStorage.setItem(e,Is(r))}async removeItem(e){this.localStorage.removeItem(e)}}const xM="wc_storage_version",Eb=1,SM=async(t,e,r)=>{const i=xM,n=await e.getItem(i);if(n&&n>=Eb){r(e);return}const s=await t.getKeys();if(!s.length){r(e);return}const a=[];for(;s.length;){const u=s.shift();if(!u)continue;const l=u.toLowerCase();if(l.includes("wc@")||l.includes("walletconnect")||l.includes("wc_")||l.includes("wallet_connect")){const d=await t.getItem(u);await e.setItem(u,d),a.push(u)}}await e.setItem(i,Eb),r(e),IM(t,a)},IM=async(t,e)=>{e.length&&e.forEach(async r=>{await t.removeItem(r)})};class MM{constructor(){this.initialized=!1,this.setInitialized=r=>{this.storage=r,this.initialized=!0};const e=new AM;this.storage=e;try{const r=new _M;SM(e,r,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,r){return await this.initialize(),this.storage.setItem(e,r)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{const r=setInterval(()=>{this.initialized&&(clearInterval(r),e())},20)})}}class zo{}class CM extends zo{constructor(e){super()}}const Ab=Ie.FIVE_SECONDS,rc={pulse:"heartbeat_pulse"};class Bd extends CM{constructor(e){super(e),this.events=new Br.exports.EventEmitter,this.interval=Ab,this.interval=e?.interval||Ab}static async init(e){const r=new Bd(e);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),Ie.toMiliseconds(this.interval))}pulse(){this.events.emit(rc.pulse)}}function DM(t){try{return JSON.stringify(t)}catch{return'"[Circular]"'}}var OM=PM;function PM(t,e,r){var i=r&&r.stringify||DM,n=1;if(typeof t=="object"&&t!==null){var s=e.length+n;if(s===1)return t;var a=new Array(s);a[0]=i(t);for(var u=1;u<s;u++)a[u]=i(e[u]);return a.join(" ")}if(typeof t!="string")return t;var l=e.length;if(l===0)return t;for(var d="",b=1-n,w=-1,I=t&&t.length||0,S=0;S<I;){if(t.charCodeAt(S)===37&&S+1<I){switch(w=w>-1?w:0,t.charCodeAt(S+1)){case 100:case 102:if(b>=l||e[b]==null)break;w<S&&(d+=t.slice(w,S)),d+=Number(e[b]),w=S+2,S++;break;case 105:if(b>=l||e[b]==null)break;w<S&&(d+=t.slice(w,S)),d+=Math.floor(Number(e[b])),w=S+2,S++;break;case 79:case 111:case 106:if(b>=l||e[b]===void 0)break;w<S&&(d+=t.slice(w,S));var D=typeof e[b];if(D==="string"){d+="'"+e[b]+"'",w=S+2,S++;break}if(D==="function"){d+=e[b].name||"<anonymous>",w=S+2,S++;break}d+=i(e[b]),w=S+2,S++;break;case 115:if(b>=l)break;w<S&&(d+=t.slice(w,S)),d+=String(e[b]),w=S+2,S++;break;case 37:w<S&&(d+=t.slice(w,S)),d+="%",w=S+2,S++,b--;break}++b}++S}return w===-1?t:(w<I&&(d+=t.slice(w)),d)}const xb=OM;var os=as;const Eu=jM().console||{},$M={mapHttpRequest:yh,mapHttpResponse:yh,wrapRequestSerializer:Ud,wrapResponseSerializer:Ud,wrapErrorSerializer:Ud,req:yh,res:yh,err:BM};function RM(t,e){return Array.isArray(t)?t.filter(function(i){return i!=="!stdSerializers.err"}):t===!0?Object.keys(e):!1}function as(t){t=t||{},t.browser=t.browser||{};const e=t.browser.transmit;if(e&&typeof e.send!="function")throw Error("pino: transmit option must have a send function");const r=t.browser.write||Eu;t.browser.write&&(t.browser.asObject=!0);const i=t.serializers||{},n=RM(t.browser.serialize,i);let s=t.browser.serialize;Array.isArray(t.browser.serialize)&&t.browser.serialize.indexOf("!stdSerializers.err")>-1&&(s=!1);const a=["error","fatal","warn","info","debug","trace"];typeof r=="function"&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),t.enabled===!1&&(t.level="silent");const u=t.level||"info",l=Object.create(r);l.log||(l.log=Au),Object.defineProperty(l,"levelVal",{get:b}),Object.defineProperty(l,"level",{get:w,set:I});const d={transmit:e,serialize:n,asObject:t.browser.asObject,levels:a,timestamp:FM(t)};l.levels=as.levels,l.level=u,l.setMaxListeners=l.getMaxListeners=l.emit=l.addListener=l.on=l.prependListener=l.once=l.prependOnceListener=l.removeListener=l.removeAllListeners=l.listeners=l.listenerCount=l.eventNames=l.write=l.flush=Au,l.serializers=i,l._serialize=n,l._stdErrSerialize=s,l.child=S,e&&(l._logEvent=Fd());function b(){return this.level==="silent"?1/0:this.levels.values[this.level]}function w(){return this._level}function I(D){if(D!=="silent"&&!this.levels.values[D])throw Error("unknown level "+D);this._level=D,ic(d,l,"error","log"),ic(d,l,"fatal","error"),ic(d,l,"warn","error"),ic(d,l,"info","log"),ic(d,l,"debug","log"),ic(d,l,"trace","log")}function S(D,L){if(!D)throw new Error("missing bindings for child Pino");L=L||{},n&&D.serializers&&(L.serializers=D.serializers);const K=L.serializers;if(n&&K){var H=Object.assign({},i,K),U=t.browser.serialize===!0?Object.keys(H):n;delete D.serializers,bh([D],U,H,this._stdErrSerialize)}function W(R){this._childLevel=(R._childLevel|0)+1,this.error=nc(R,D,"error"),this.fatal=nc(R,D,"fatal"),this.warn=nc(R,D,"warn"),this.info=nc(R,D,"info"),this.debug=nc(R,D,"debug"),this.trace=nc(R,D,"trace"),H&&(this.serializers=H,this._serialize=U),e&&(this._logEvent=Fd([].concat(R._logEvent.bindings,D)))}return W.prototype=this,new W(this)}return l}as.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},as.stdSerializers=$M,as.stdTimeFunctions=Object.assign({},{nullTime:Sb,epochTime:Ib,unixTime:UM,isoTime:kM});function ic(t,e,r,i){const n=Object.getPrototypeOf(e);e[r]=e.levelVal>e.levels.values[r]?Au:n[r]?n[r]:Eu[r]||Eu[i]||Au,NM(t,e,r)}function NM(t,e,r){!t.transmit&&e[r]===Au||(e[r]=function(i){return function(){const s=t.timestamp(),a=new Array(arguments.length),u=Object.getPrototypeOf&&Object.getPrototypeOf(this)===Eu?Eu:this;for(var l=0;l<a.length;l++)a[l]=arguments[l];if(t.serialize&&!t.asObject&&bh(a,this._serialize,this.serializers,this._stdErrSerialize),t.asObject?i.call(u,TM(this,r,a,s)):i.apply(u,a),t.transmit){const d=t.transmit.level||e.level,b=as.levels.values[d],w=as.levels.values[r];if(w<b)return;LM(this,{ts:s,methodLevel:r,methodValue:w,transmitLevel:d,transmitValue:as.levels.values[t.transmit.level||e.level],send:t.transmit.send,val:e.levelVal},a)}}}(e[r]))}function TM(t,e,r,i){t._serialize&&bh(r,t._serialize,t.serializers,t._stdErrSerialize);const n=r.slice();let s=n[0];const a={};i&&(a.time=i),a.level=as.levels.values[e];let u=(t._childLevel|0)+1;if(u<1&&(u=1),s!==null&&typeof s=="object"){for(;u--&&typeof n[0]=="object";)Object.assign(a,n.shift());s=n.length?xb(n.shift(),n):void 0}else typeof s=="string"&&(s=xb(n.shift(),n));return s!==void 0&&(a.msg=s),a}function bh(t,e,r,i){for(const n in t)if(i&&t[n]instanceof Error)t[n]=as.stdSerializers.err(t[n]);else if(typeof t[n]=="object"&&!Array.isArray(t[n]))for(const s in t[n])e&&e.indexOf(s)>-1&&s in r&&(t[n][s]=r[s](t[n][s]))}function nc(t,e,r){return function(){const i=new Array(1+arguments.length);i[0]=e;for(var n=1;n<i.length;n++)i[n]=arguments[n-1];return t[r].apply(this,i)}}function LM(t,e,r){const i=e.send,n=e.ts,s=e.methodLevel,a=e.methodValue,u=e.val,l=t._logEvent.bindings;bh(r,t._serialize||Object.keys(t.serializers),t.serializers,t._stdErrSerialize===void 0?!0:t._stdErrSerialize),t._logEvent.ts=n,t._logEvent.messages=r.filter(function(d){return l.indexOf(d)===-1}),t._logEvent.level.label=s,t._logEvent.level.value=a,i(s,t._logEvent,u),t._logEvent=Fd(l)}function Fd(t){return{ts:0,messages:[],bindings:t||[],level:{label:"",value:0}}}function BM(t){const e={type:t.constructor.name,msg:t.message,stack:t.stack};for(const r in t)e[r]===void 0&&(e[r]=t[r]);return e}function FM(t){return typeof t.timestamp=="function"?t.timestamp:t.timestamp===!1?Sb:Ib}function yh(){return{}}function Ud(t){return t}function Au(){}function Sb(){return!1}function Ib(){return Date.now()}function UM(){return Math.round(Date.now()/1e3)}function kM(){return new Date(Date.now()).toISOString()}function jM(){function t(e){return typeof e<"u"&&e}try{return typeof globalThis<"u"||Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch{return t(self)||t(window)||t(this)||{}}}const qM={level:"info"},xu="custom_context",kd=1e3*1024;class zM{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class Mb{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){const r=new zM(e);if(r.size>this.maxSizeInBytes)throw new Error(`[LinkedList] Value too big to insert into list: ${e} with size ${r.size}`);for(;this.size+r.size>this.maxSizeInBytes;)this.shift();this.head?(this.tail&&(this.tail.next=r),this.tail=r):(this.head=r,this.tail=r),this.lengthInNodes++,this.sizeInBytes+=r.size}shift(){if(!this.head)return;const e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){const e=[];let r=this.head;for(;r!==null;)e.push(r.value),r=r.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};const r=e.value;return e=e.next,{done:!1,value:r}}}}}class Cb{constructor(e,r=kd){this.level=e??"error",this.levelValue=os.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=r,this.logs=new Mb(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,r){r===os.levels.values.error?console.error(e):r===os.levels.values.warn?console.warn(e):r===os.levels.values.debug?console.debug(e):r===os.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(Is({timestamp:new Date().toISOString(),log:e}));const r=typeof e=="string"?JSON.parse(e).level:e.level;r>=this.levelValue&&this.forwardToConsole(e,r)}getLogs(){return this.logs}clearLogs(){this.logs=new Mb(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){const r=this.getLogArray();return r.push(Is({extraMetadata:e})),new Blob(r,{type:"application/json"})}}class HM{constructor(e,r=kd){this.baseChunkLogger=new Cb(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){const r=URL.createObjectURL(this.logsToBlob(e)),i=document.createElement("a");i.href=r,i.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(r)}}class KM{constructor(e,r=kd){this.baseChunkLogger=new Cb(e,r)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var WM=Object.defineProperty,VM=Object.defineProperties,GM=Object.getOwnPropertyDescriptors,Db=Object.getOwnPropertySymbols,YM=Object.prototype.hasOwnProperty,JM=Object.prototype.propertyIsEnumerable,Ob=(t,e,r)=>e in t?WM(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,wh=(t,e)=>{for(var r in e||(e={}))YM.call(e,r)&&Ob(t,r,e[r]);if(Db)for(var r of Db(e))JM.call(e,r)&&Ob(t,r,e[r]);return t},_h=(t,e)=>VM(t,GM(e));function Eh(t){return _h(wh({},t),{level:t?.level||qM.level})}function QM(t,e=xu){return t[e]||""}function ZM(t,e,r=xu){return t[r]=e,t}function _i(t,e=xu){let r="";return typeof t.bindings>"u"?r=QM(t,e):r=t.bindings().context||"",r}function XM(t,e,r=xu){const i=_i(t,r);return i.trim()?`${i}/${e}`:e}function ci(t,e,r=xu){const i=XM(t,e,r),n=t.child({context:i});return ZM(n,i,r)}function eC(t){var e,r;const i=new HM((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:os(_h(wh({},t.opts),{level:"trace",browser:_h(wh({},(r=t.opts)==null?void 0:r.browser),{write:n=>i.write(n)})})),chunkLoggerController:i}}function tC(t){var e;const r=new KM((e=t.opts)==null?void 0:e.level,t.maxSizeInBytes);return{logger:os(_h(wh({},t.opts),{level:"trace"})),chunkLoggerController:r}}function rC(t){return typeof t.loggerOverride<"u"&&typeof t.loggerOverride!="string"?{logger:t.loggerOverride,chunkLoggerController:null}:typeof window<"u"?eC(t):tC(t)}class iC extends zo{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class nC extends zo{constructor(e,r){super(),this.core=e,this.logger=r,this.records=new Map}}class sC{constructor(e,r){this.logger=e,this.core=r}}class oC extends zo{constructor(e,r){super(),this.relayer=e,this.logger=r}}class aC extends zo{constructor(e){super()}}class cC{constructor(e,r,i,n){this.core=e,this.logger=r,this.name=i}}class uC extends zo{constructor(e,r){super(),this.relayer=e,this.logger=r}}class fC extends zo{constructor(e,r){super(),this.core=e,this.logger=r}}class hC{constructor(e,r,i){this.core=e,this.logger=r,this.store=i}}class lC{constructor(e,r){this.projectId=e,this.logger=r}}class dC{constructor(e,r,i){this.core=e,this.logger=r,this.telemetryEnabled=i}}class pC{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class gC{constructor(e){this.client=e}}function vC(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function Pb(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const $b=Pb("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),jd=Pb("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=vC(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),mC={utf8:$b,"utf-8":$b,hex:Ca.base16,latin1:jd,ascii:jd,binary:jd,...Ca};function bC(t,e="utf8"){const r=mC[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t.buffer,t.byteOffset,t.byteLength).toString("utf8"):r.encoder.encode(t).substring(1)}const yC="PARSE_ERROR",wC="INVALID_REQUEST",_C="METHOD_NOT_FOUND",EC="INVALID_PARAMS",Rb="INTERNAL_ERROR",qd="SERVER_ERROR",AC=[-32700,-32600,-32601,-32602,-32603],Su={[yC]:{code:-32700,message:"Parse error"},[wC]:{code:-32600,message:"Invalid Request"},[_C]:{code:-32601,message:"Method not found"},[EC]:{code:-32602,message:"Invalid params"},[Rb]:{code:-32603,message:"Internal error"},[qd]:{code:-32e3,message:"Server error"}},Nb=qd;function xC(t){return AC.includes(t)}function Tb(t){return Object.keys(Su).includes(t)?Su[t]:Su[Nb]}function SC(t){const e=Object.values(Su).find(r=>r.code===t);return e||Su[Nb]}function Lb(t,e,r){return t.message.includes("getaddrinfo ENOTFOUND")||t.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${e}`):t}var Bb={};/*! *****************************************************************************
31
31
  Copyright (c) Microsoft Corporation.
32
32
 
33
33
  Permission to use, copy, modify, and/or distribute this software for any
@@ -40,17 +40,17 @@
40
40
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
41
41
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
42
42
  PERFORMANCE OF THIS SOFTWARE.
43
- ***************************************************************************** */var zd=function(t,e){return zd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},zd(t,e)};function TC(t,e){zd(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Hd=function(){return Hd=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Hd.apply(this,arguments)};function LC(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function BC(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(s=(n<3?a(s):n>3?a(e,r,s):a(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function FC(t,e){return function(r,i){e(r,i,t)}}function UC(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function kC(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(b){try{d(i.next(b))}catch(w){a(w)}}function l(b){try{d(i.throw(b))}catch(w){a(w)}}function d(b){b.done?s(b.value):n(b.value).then(u,l)}d((i=i.apply(t,e||[])).next())})}function jC(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(d){return function(b){return l([d,b])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=d[0]&2?n.return:d[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,d[1])).done)return s;switch(n=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,n=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(b){d=[6,b],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function qC(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function zC(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Kd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function kb(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function HC(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(kb(arguments[e]));return t}function KC(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],a=0,u=s.length;a<u;a++,n++)i[n]=s[a];return i}function Iu(t){return this instanceof Iu?(this.v=t,this):new Iu(t)}function WC(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(S){i[S]&&(n[S]=function(I){return new Promise(function(D,L){s.push([S,I,D,L])>1||u(S,I)})})}function u(S,I){try{l(i[S](I))}catch(D){w(s[0][3],D)}}function l(S){S.value instanceof Iu?Promise.resolve(S.value.v).then(d,b):w(s[0][2],S)}function d(S){u("next",S)}function b(S){u("throw",S)}function w(S,I){S(I),s.shift(),s.length&&u(s[0][0],s[0][1])}}function VC(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(a){return(r=!r)?{value:Iu(t[n](a)),done:n==="return"}:s?s(a):a}:s}}function GC(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Kd=="function"?Kd(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(a){return new Promise(function(u,l){a=t[s](a),n(u,l,a.done,a.value)})}}function n(s,a,u,l){Promise.resolve(l).then(function(d){s({value:d,done:u})},a)}}function YC(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function JC(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function QC(t){return t&&t.__esModule?t:{default:t}}function ZC(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function XC(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var eD=Object.freeze({__proto__:null,__extends:TC,get __assign(){return Hd},__rest:LC,__decorate:BC,__param:FC,__metadata:UC,__awaiter:kC,__generator:jC,__createBinding:qC,__exportStar:zC,__values:Kd,__read:kb,__spread:HC,__spreadArrays:KC,__await:Iu,__asyncGenerator:WC,__asyncDelegator:VC,__asyncValues:GC,__makeTemplateObject:YC,__importStar:JC,__importDefault:QC,__classPrivateFieldGet:ZC,__classPrivateFieldSet:XC}),tD=u0(eD),Rs={},jb;function rD(){if(jb)return Rs;jb=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.isBrowserCryptoAvailable=Rs.getSubtleCrypto=Rs.getBrowerCrypto=void 0;function t(){return Wr?.crypto||Wr?.msCrypto||{}}Rs.getBrowerCrypto=t;function e(){const i=t();return i.subtle||i.webkitSubtle}Rs.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Rs.isBrowserCryptoAvailable=r,Rs}var Ns={},qb;function iD(){if(qb)return Ns;qb=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.isBrowser=Ns.isNode=Ns.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ns.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Ns.isNode=e;function r(){return!t()&&!e()}return Ns.isBrowser=r,Ns}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=tD;e.__exportStar(rD(),t),e.__exportStar(iD(),t)})(Ub);function no(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Ho(t=6){return BigInt(no(t))}function sc(t,e,r){return{id:r||no(),jsonrpc:"2.0",method:t,params:e}}function Eh(t,e){return{id:t,jsonrpc:"2.0",result:e}}function Ah(t,e,r){return{id:t,jsonrpc:"2.0",error:nD(e,r)}}function nD(t,e){return typeof t>"u"?Bb(Tb):(typeof t=="string"&&(t=Object.assign(Object.assign({},Bb(qd)),{message:t})),typeof e<"u"&&(t.data=e),RC(t.code)&&(t=NC(t.code)),t)}class sD{}class oD extends sD{constructor(){super()}}class aD extends oD{constructor(e){super()}}const cD="^https?:",uD="^wss?:";function fD(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function zb(t,e){const r=fD(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function Hb(t){return zb(t,cD)}function Kb(t){return zb(t,uD)}function hD(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Wb(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Wd(t){return Wb(t)&&"method"in t}function xh(t){return Wb(t)&&(cs(t)||Xi(t))}function cs(t){return"result"in t}function Xi(t){return"error"in t}class An extends aD{constructor(e){super(e),this.events=new Br.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(sc(e.method,e.params||[],e.id||Ho().toString()),r)}async requestStrict(e,r){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{Xi(s)?n(s.error):i(s.result)});try{await this.connection.send(e,r)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),xh(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const lD=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),dD=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Vb=t=>t.split("?")[0],Gb=10,pD=lD();class gD{constructor(e){if(this.url=e,this.events=new Br.exports.EventEmitter,this.registering=!1,!Kb(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=i=>{this.onClose(i),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Is(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!Kb(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((i,n)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),n(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return n(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,i)=>{const n=new URLSearchParams(e).get("origin"),s=Ub.isReactNative()?{headers:{origin:n}}:{rejectUnauthorized:!hD(e)},a=new pD(e,[],s);dD()?a.onerror=u=>{const l=u;i(this.emitError(l.error))}:a.on("error",u=>{i(this.emitError(u))}),a.onopen=()=>{this.onOpen(a),r(a)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?qa(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const i=this.parseError(r),n=i.message||i.toString(),s=Ah(e,n);this.events.emit("payload",s)}parseError(e,r=this.url){return Fb(e,Vb(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Gb&&this.events.setMaxListeners(Gb)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Vb(this.url)}`));return this.events.emit("register_error",r),r}}var Vd={exports:{}};(function(t,e){var r=200,i="__lodash_hash_undefined__",n=1,s=2,a=9007199254740991,u="[object Arguments]",l="[object Array]",d="[object AsyncFunction]",b="[object Boolean]",w="[object Date]",S="[object Error]",I="[object Function]",D="[object GeneratorFunction]",L="[object Map]",K="[object Number]",H="[object Null]",U="[object Object]",W="[object Promise]",R="[object Proxy]",k="[object RegExp]",z="[object Set]",_="[object String]",B="[object Symbol]",X="[object Undefined]",re="[object WeakMap]",T="[object ArrayBuffer]",y="[object DataView]",f="[object Float32Array]",h="[object Float64Array]",v="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",P="[object Uint8Array]",M="[object Uint8ClampedArray]",g="[object Uint16Array]",m="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,ee=/^\[object .+?Constructor\]$/,ae=/^(?:0|[1-9]\d*)$/,O={};O[f]=O[h]=O[v]=O[E]=O[C]=O[P]=O[M]=O[g]=O[m]=!0,O[u]=O[l]=O[T]=O[b]=O[y]=O[w]=O[S]=O[I]=O[L]=O[K]=O[U]=O[k]=O[z]=O[_]=O[re]=!1;var te=typeof Wr=="object"&&Wr&&Wr.Object===Object&&Wr,q=typeof self=="object"&&self&&self.Object===Object&&self,G=te||q||Function("return this")(),Y=e&&!e.nodeType&&e,A=Y&&!0&&t&&!t.nodeType&&t,V=A&&A.exports===Y,oe=V&&te.process,ue=function(){try{return oe&&oe.binding&&oe.binding("util")}catch{}}(),he=ue&&ue.isTypedArray;function ye(J,ie){for(var pe=-1,ke=J==null?0:J.length,Xt=0,bt=[];++pe<ke;){var or=J[pe];ie(or,pe,J)&&(bt[Xt++]=or)}return bt}function we(J,ie){for(var pe=-1,ke=ie.length,Xt=J.length;++pe<ke;)J[Xt+pe]=ie[pe];return J}function Re(J,ie){for(var pe=-1,ke=J==null?0:J.length;++pe<ke;)if(ie(J[pe],pe,J))return!0;return!1}function Xe(J,ie){for(var pe=-1,ke=Array(J);++pe<J;)ke[pe]=ie(pe);return ke}function Oe(J){return function(ie){return J(ie)}}function Ne(J,ie){return J.has(ie)}function Me(J,ie){return J?.[ie]}function be(J){var ie=-1,pe=Array(J.size);return J.forEach(function(ke,Xt){pe[++ie]=[Xt,ke]}),pe}function Pe(J,ie){return function(pe){return J(ie(pe))}}function Te(J){var ie=-1,pe=Array(J.size);return J.forEach(function(ke){pe[++ie]=ke}),pe}var ve=Array.prototype,$e=Function.prototype,xe=Object.prototype,me=G["__core-js_shared__"],Ue=$e.toString,Ce=xe.hasOwnProperty,_e=function(){var J=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return J?"Symbol(src)_1."+J:""}(),Ke=xe.toString,Ve=RegExp("^"+Ue.call(Ce).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ae=V?G.Buffer:void 0,We=G.Symbol,pt=G.Uint8Array,Ge=xe.propertyIsEnumerable,It=ve.splice,gt=We?We.toStringTag:void 0,Je=Object.getOwnPropertySymbols,Ot=Ae?Ae.isBuffer:void 0,Tt=Pe(Object.keys,Object),Le=ki(G,"DataView"),et=ki(G,"Map"),it=ki(G,"Promise"),Be=ki(G,"Set"),rt=ki(G,"WeakMap"),tt=ki(Object,"create"),je=Us(Le),ht=Us(et),nt=Us(it),qe=Us(Be),st=Us(rt),at=We?We.prototype:void 0,Fe=at?at.valueOf:void 0;function Ze(J){var ie=-1,pe=J==null?0:J.length;for(this.clear();++ie<pe;){var ke=J[ie];this.set(ke[0],ke[1])}}function lt(){this.__data__=tt?tt(null):{},this.size=0}function ze(J){var ie=this.has(J)&&delete this.__data__[J];return this.size-=ie?1:0,ie}function jt(J){var ie=this.__data__;if(tt){var pe=ie[J];return pe===i?void 0:pe}return Ce.call(ie,J)?ie[J]:void 0}function qt(J){var ie=this.__data__;return tt?ie[J]!==void 0:Ce.call(ie,J)}function ct(J,ie){var pe=this.__data__;return this.size+=this.has(J)?0:1,pe[J]=tt&&ie===void 0?i:ie,this}Ze.prototype.clear=lt,Ze.prototype.delete=ze,Ze.prototype.get=jt,Ze.prototype.has=qt,Ze.prototype.set=ct;function _t(J){var ie=-1,pe=J==null?0:J.length;for(this.clear();++ie<pe;){var ke=J[ie];this.set(ke[0],ke[1])}}function Qr(){this.__data__=[],this.size=0}function Zr(J){var ie=this.__data__,pe=ha(ie,J);if(pe<0)return!1;var ke=ie.length-1;return pe==ke?ie.pop():It.call(ie,pe,1),--this.size,!0}function Xr(J){var ie=this.__data__,pe=ha(ie,J);return pe<0?void 0:ie[pe][1]}function ei(J){return ha(this.__data__,J)>-1}function ti(J,ie){var pe=this.__data__,ke=ha(pe,J);return ke<0?(++this.size,pe.push([J,ie])):pe[ke][1]=ie,this}_t.prototype.clear=Qr,_t.prototype.delete=Zr,_t.prototype.get=Xr,_t.prototype.has=ei,_t.prototype.set=ti;function pr(J){var ie=-1,pe=J==null?0:J.length;for(this.clear();++ie<pe;){var ke=J[ie];this.set(ke[0],ke[1])}}function Si(){this.size=0,this.__data__={hash:new Ze,map:new(et||_t),string:new Ze}}function Cn(J){var ie=bo(this,J).delete(J);return this.size-=ie?1:0,ie}function Ii(J){return bo(this,J).get(J)}function Dn(J){return bo(this,J).has(J)}function On(J,ie){var pe=bo(this,J),ke=pe.size;return pe.set(J,ie),this.size+=pe.size==ke?0:1,this}pr.prototype.clear=Si,pr.prototype.delete=Cn,pr.prototype.get=Ii,pr.prototype.has=Dn,pr.prototype.set=On;function Mi(J){var ie=-1,pe=J==null?0:J.length;for(this.__data__=new pr;++ie<pe;)this.add(J[ie])}function nn(J){return this.__data__.set(J,i),this}function sn(J){return this.__data__.has(J)}Mi.prototype.add=Mi.prototype.push=nn,Mi.prototype.has=sn;function Ir(J){var ie=this.__data__=new _t(J);this.size=ie.size}function Pn(){this.__data__=new _t,this.size=0}function $n(J){var ie=this.__data__,pe=ie.delete(J);return this.size=ie.size,pe}function Rn(J){return this.__data__.get(J)}function fa(J){return this.__data__.has(J)}function al(J,ie){var pe=this.__data__;if(pe instanceof _t){var ke=pe.__data__;if(!et||ke.length<r-1)return ke.push([J,ie]),this.size=++pe.size,this;pe=this.__data__=new pr(ke)}return pe.set(J,ie),this.size=pe.size,this}Ir.prototype.clear=Pn,Ir.prototype.delete=$n,Ir.prototype.get=Rn,Ir.prototype.has=fa,Ir.prototype.set=al;function cl(J,ie){var pe=Oc(J),ke=!pe&&wl(J),Xt=!pe&&!ke&&tf(J),bt=!pe&&!ke&&!Xt&&Al(J),or=pe||ke||Xt||bt,Er=or?Xe(J.length,String):[],Ft=Er.length;for(var er in J)(ie||Ce.call(J,er))&&!(or&&(er=="length"||Xt&&(er=="offset"||er=="parent")||bt&&(er=="buffer"||er=="byteLength"||er=="byteOffset")||gl(er,Ft)))&&Er.push(er);return Er}function ha(J,ie){for(var pe=J.length;pe--;)if(yl(J[pe][0],ie))return pe;return-1}function Xu(J,ie,pe){var ke=ie(J);return Oc(J)?ke:we(ke,pe(J))}function la(J){return J==null?J===void 0?X:H:gt&&gt in Object(J)?dl(J):Ap(J)}function ef(J){return pa(J)&&la(J)==u}function da(J,ie,pe,ke,Xt){return J===ie?!0:J==null||ie==null||!pa(J)&&!pa(ie)?J!==J&&ie!==ie:ul(J,ie,pe,ke,da,Xt)}function ul(J,ie,pe,ke,Xt,bt){var or=Oc(J),Er=Oc(ie),Ft=or?l:bs(J),er=Er?l:bs(ie);Ft=Ft==u?U:Ft,er=er==u?U:er;var yr=Ft==U,Ci=er==U,Ar=Ft==er;if(Ar&&tf(J)){if(!tf(ie))return!1;or=!0,yr=!1}if(Ar&&!yr)return bt||(bt=new Ir),or||Al(J)?Cc(J,ie,pe,ke,Xt,bt):Ep(J,ie,Ft,pe,ke,Xt,bt);if(!(pe&n)){var ar=yr&&Ce.call(J,"__wrapped__"),hi=Ci&&Ce.call(ie,"__wrapped__");if(ar||hi){var Nn=ar?J.value():J,on=hi?ie.value():ie;return bt||(bt=new Ir),Xt(Nn,on,pe,ke,bt)}}return Ar?(bt||(bt=new Ir),ll(J,ie,pe,ke,Xt,bt)):!1}function _p(J){if(!El(J)||ml(J))return!1;var ie=Pc(J)?Ve:ee;return ie.test(Us(J))}function fl(J){return pa(J)&&_l(J.length)&&!!O[la(J)]}function hl(J){if(!bl(J))return Tt(J);var ie=[];for(var pe in Object(J))Ce.call(J,pe)&&pe!="constructor"&&ie.push(pe);return ie}function Cc(J,ie,pe,ke,Xt,bt){var or=pe&n,Er=J.length,Ft=ie.length;if(Er!=Ft&&!(or&&Ft>Er))return!1;var er=bt.get(J);if(er&&bt.get(ie))return er==ie;var yr=-1,Ci=!0,Ar=pe&s?new Mi:void 0;for(bt.set(J,ie),bt.set(ie,J);++yr<Er;){var ar=J[yr],hi=ie[yr];if(ke)var Nn=or?ke(hi,ar,yr,ie,J,bt):ke(ar,hi,yr,J,ie,bt);if(Nn!==void 0){if(Nn)continue;Ci=!1;break}if(Ar){if(!Re(ie,function(on,ys){if(!Ne(Ar,ys)&&(ar===on||Xt(ar,on,pe,ke,bt)))return Ar.push(ys)})){Ci=!1;break}}else if(!(ar===hi||Xt(ar,hi,pe,ke,bt))){Ci=!1;break}}return bt.delete(J),bt.delete(ie),Ci}function Ep(J,ie,pe,ke,Xt,bt,or){switch(pe){case y:if(J.byteLength!=ie.byteLength||J.byteOffset!=ie.byteOffset)return!1;J=J.buffer,ie=ie.buffer;case T:return!(J.byteLength!=ie.byteLength||!bt(new pt(J),new pt(ie)));case b:case w:case K:return yl(+J,+ie);case S:return J.name==ie.name&&J.message==ie.message;case k:case _:return J==ie+"";case L:var Er=be;case z:var Ft=ke&n;if(Er||(Er=Te),J.size!=ie.size&&!Ft)return!1;var er=or.get(J);if(er)return er==ie;ke|=s,or.set(J,ie);var yr=Cc(Er(J),Er(ie),ke,Xt,bt,or);return or.delete(J),yr;case B:if(Fe)return Fe.call(J)==Fe.call(ie)}return!1}function ll(J,ie,pe,ke,Xt,bt){var or=pe&n,Er=Dc(J),Ft=Er.length,er=Dc(ie),yr=er.length;if(Ft!=yr&&!or)return!1;for(var Ci=Ft;Ci--;){var Ar=Er[Ci];if(!(or?Ar in ie:Ce.call(ie,Ar)))return!1}var ar=bt.get(J);if(ar&&bt.get(ie))return ar==ie;var hi=!0;bt.set(J,ie),bt.set(ie,J);for(var Nn=or;++Ci<Ft;){Ar=Er[Ci];var on=J[Ar],ys=ie[Ar];if(ke)var rf=or?ke(ys,on,Ar,ie,J,bt):ke(on,ys,Ar,J,ie,bt);if(!(rf===void 0?on===ys||Xt(on,ys,pe,ke,bt):rf)){hi=!1;break}Nn||(Nn=Ar=="constructor")}if(hi&&!Nn){var ga=J.constructor,Tr=ie.constructor;ga!=Tr&&"constructor"in J&&"constructor"in ie&&!(typeof ga=="function"&&ga instanceof ga&&typeof Tr=="function"&&Tr instanceof Tr)&&(hi=!1)}return bt.delete(J),bt.delete(ie),hi}function Dc(J){return Xu(J,Ip,pl)}function bo(J,ie){var pe=J.__data__;return vl(ie)?pe[typeof ie=="string"?"string":"hash"]:pe.map}function ki(J,ie){var pe=Me(J,ie);return _p(pe)?pe:void 0}function dl(J){var ie=Ce.call(J,gt),pe=J[gt];try{J[gt]=void 0;var ke=!0}catch{}var Xt=Ke.call(J);return ke&&(ie?J[gt]=pe:delete J[gt]),Xt}var pl=Je?function(J){return J==null?[]:(J=Object(J),ye(Je(J),function(ie){return Ge.call(J,ie)}))}:Zt,bs=la;(Le&&bs(new Le(new ArrayBuffer(1)))!=y||et&&bs(new et)!=L||it&&bs(it.resolve())!=W||Be&&bs(new Be)!=z||rt&&bs(new rt)!=re)&&(bs=function(J){var ie=la(J),pe=ie==U?J.constructor:void 0,ke=pe?Us(pe):"";if(ke)switch(ke){case je:return y;case ht:return L;case nt:return W;case qe:return z;case st:return re}return ie});function gl(J,ie){return ie=ie??a,!!ie&&(typeof J=="number"||ae.test(J))&&J>-1&&J%1==0&&J<ie}function vl(J){var ie=typeof J;return ie=="string"||ie=="number"||ie=="symbol"||ie=="boolean"?J!=="__proto__":J===null}function ml(J){return!!_e&&_e in J}function bl(J){var ie=J&&J.constructor,pe=typeof ie=="function"&&ie.prototype||xe;return J===pe}function Ap(J){return Ke.call(J)}function Us(J){if(J!=null){try{return Ue.call(J)}catch{}try{return J+""}catch{}}return""}function yl(J,ie){return J===ie||J!==J&&ie!==ie}var wl=ef(function(){return arguments}())?ef:function(J){return pa(J)&&Ce.call(J,"callee")&&!Ge.call(J,"callee")},Oc=Array.isArray;function xp(J){return J!=null&&_l(J.length)&&!Pc(J)}var tf=Ot||Qt;function Sp(J,ie){return da(J,ie)}function Pc(J){if(!El(J))return!1;var ie=la(J);return ie==I||ie==D||ie==d||ie==R}function _l(J){return typeof J=="number"&&J>-1&&J%1==0&&J<=a}function El(J){var ie=typeof J;return J!=null&&(ie=="object"||ie=="function")}function pa(J){return J!=null&&typeof J=="object"}var Al=he?Oe(he):fl;function Ip(J){return xp(J)?cl(J):hl(J)}function Zt(){return[]}function Qt(){return!1}t.exports=Sp})(Vd,Vd.exports);var vD=Vd.exports,mD=Object.defineProperty,Yb=Object.getOwnPropertySymbols,bD=Object.prototype.hasOwnProperty,yD=Object.prototype.propertyIsEnumerable,Jb=(t,e,r)=>e in t?mD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ui=(t,e)=>{for(var r in e||(e={}))bD.call(e,r)&&Jb(t,r,e[r]);if(Yb)for(var r of Yb(e))yD.call(e,r)&&Jb(t,r,e[r]);return t};function wD(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=n}var u=t.length,l=t.charAt(0),d=Math.log(u)/Math.log(256),b=Math.log(256)/Math.log(u);function w(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var L=0,K=0,H=0,U=D.length;H!==U&&D[H]===0;)H++,L++;for(var W=(U-H)*b+1>>>0,R=new Uint8Array(W);H!==U;){for(var k=D[H],z=0,_=W-1;(k!==0||z<K)&&_!==-1;_--,z++)k+=256*R[_]>>>0,R[_]=k%u>>>0,k=k/u>>>0;if(k!==0)throw new Error("Non-zero carry");K=z,H++}for(var B=W-K;B!==W&&R[B]===0;)B++;for(var X=l.repeat(L);B<W;++B)X+=t.charAt(R[B]);return X}function S(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var L=0;if(D[L]!==" "){for(var K=0,H=0;D[L]===l;)K++,L++;for(var U=(D.length-L)*d+1>>>0,W=new Uint8Array(U);D[L];){var R=r[D.charCodeAt(L)];if(R===255)return;for(var k=0,z=U-1;(R!==0||k<H)&&z!==-1;z--,k++)R+=u*W[z]>>>0,W[z]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");H=k,L++}if(D[L]!==" "){for(var _=U-H;_!==U&&W[_]===0;)_++;for(var B=new Uint8Array(K+(U-_)),X=K;_!==U;)B[X++]=W[_++];return B}}}function I(D){var L=S(D);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:S,decode:I}}var _D=wD,ED=_D;const Qb=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},AD=t=>new TextEncoder().encode(t),xD=t=>new TextDecoder().decode(t);class SD{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class ID{constructor(e,r,i){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Zb(this,e)}}class MD{constructor(e){this.decoders=e}or(e){return Zb(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Zb=(t,e)=>new MD(ui(ui({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class CD{constructor(e,r,i,n){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=n,this.encoder=new SD(e,r,i),this.decoder=new ID(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Sh=({name:t,prefix:e,encode:r,decode:i})=>new CD(t,e,r,i),Mu=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=ED(r,e);return Sh({prefix:t,name:e,encode:i,decode:s=>Qb(n(s))})},DD=(t,e,r,i)=>{const n={};for(let b=0;b<e.length;++b)n[e[b]]=b;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*r/8|0);let u=0,l=0,d=0;for(let b=0;b<s;++b){const w=n[t[b]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<r|w,u+=r,u>=8&&(u-=8,a[d++]=255&l>>u)}if(u>=r||255&l<<8-u)throw new SyntaxError("Unexpected end of data");return a},OD=(t,e,r)=>{const i=e[e.length-1]==="=",n=(1<<r)-1;let s="",a=0,u=0;for(let l=0;l<t.length;++l)for(u=u<<8|t[l],a+=8;a>r;)a-=r,s+=e[n&u>>a];if(a&&(s+=e[n&u<<r-a]),i)for(;s.length*r&7;)s+="=";return s},zr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Sh({prefix:e,name:t,encode(n){return OD(n,i,r)},decode(n){return DD(n,i,r,t)}}),PD=Sh({prefix:"\0",name:"identity",encode:t=>xD(t),decode:t=>AD(t)});var $D=Object.freeze({__proto__:null,identity:PD});const RD=zr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var ND=Object.freeze({__proto__:null,base2:RD});const TD=zr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var LD=Object.freeze({__proto__:null,base8:TD});const BD=Mu({prefix:"9",name:"base10",alphabet:"0123456789"});var FD=Object.freeze({__proto__:null,base10:BD});const UD=zr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),kD=zr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var jD=Object.freeze({__proto__:null,base16:UD,base16upper:kD});const qD=zr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),zD=zr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),HD=zr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),KD=zr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),WD=zr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),VD=zr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),GD=zr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),YD=zr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),JD=zr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var QD=Object.freeze({__proto__:null,base32:qD,base32upper:zD,base32pad:HD,base32padupper:KD,base32hex:WD,base32hexupper:VD,base32hexpad:GD,base32hexpadupper:YD,base32z:JD});const ZD=Mu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),XD=Mu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var eO=Object.freeze({__proto__:null,base36:ZD,base36upper:XD});const tO=Mu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),rO=Mu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var iO=Object.freeze({__proto__:null,base58btc:tO,base58flickr:rO});const nO=zr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),sO=zr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),oO=zr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),aO=zr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var cO=Object.freeze({__proto__:null,base64:nO,base64pad:sO,base64url:oO,base64urlpad:aO});const Xb=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),uO=Xb.reduce((t,e,r)=>(t[r]=e,t),[]),fO=Xb.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function hO(t){return t.reduce((e,r)=>(e+=uO[r],e),"")}function lO(t){const e=[];for(const r of t){const i=fO[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const dO=Sh({prefix:"\u{1F680}",name:"base256emoji",encode:hO,decode:lO});var pO=Object.freeze({__proto__:null,base256emoji:dO}),gO=t3,e3=128,vO=127,mO=~vO,bO=Math.pow(2,31);function t3(t,e,r){e=e||[],r=r||0;for(var i=r;t>=bO;)e[r++]=t&255|e3,t/=128;for(;t&mO;)e[r++]=t&255|e3,t>>>=7;return e[r]=t|0,t3.bytes=r-i+1,e}var yO=Gd,wO=128,r3=127;function Gd(t,i){var r=0,i=i||0,n=0,s=i,a,u=t.length;do{if(s>=u)throw Gd.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=n<28?(a&r3)<<n:(a&r3)*Math.pow(2,n),n+=7}while(a>=wO);return Gd.bytes=s-i,r}var _O=Math.pow(2,7),EO=Math.pow(2,14),AO=Math.pow(2,21),xO=Math.pow(2,28),SO=Math.pow(2,35),IO=Math.pow(2,42),MO=Math.pow(2,49),CO=Math.pow(2,56),DO=Math.pow(2,63),OO=function(t){return t<_O?1:t<EO?2:t<AO?3:t<xO?4:t<SO?5:t<IO?6:t<MO?7:t<CO?8:t<DO?9:10},PO={encode:gO,decode:yO,encodingLength:OO},i3=PO;const n3=(t,e,r=0)=>(i3.encode(t,e,r),e),s3=t=>i3.encodingLength(t),Yd=(t,e)=>{const r=e.byteLength,i=s3(t),n=i+s3(r),s=new Uint8Array(n+r);return n3(t,s,0),n3(r,s,i),s.set(e,n),new $O(t,r,e,s)};class $O{constructor(e,r,i,n){this.code=e,this.size=r,this.digest=i,this.bytes=n}}const o3=({name:t,code:e,encode:r})=>new RO(t,e,r);class RO{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Yd(this.code,r):r.then(i=>Yd(this.code,i))}else throw Error("Unknown type, must be binary type")}}const a3=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),NO=o3({name:"sha2-256",code:18,encode:a3("SHA-256")}),TO=o3({name:"sha2-512",code:19,encode:a3("SHA-512")});var LO=Object.freeze({__proto__:null,sha256:NO,sha512:TO});const c3=0,BO="identity",u3=Qb;var FO=Object.freeze({__proto__:null,identity:{code:c3,name:BO,encode:u3,digest:t=>Yd(c3,u3(t))}});new TextEncoder,new TextDecoder;const f3=ui(ui(ui(ui(ui(ui(ui(ui(ui(ui({},$D),ND),LD),FD),jD),QD),eO),iO),cO),pO);ui(ui({},LO),FO);function UO(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function h3(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const l3=h3("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Jd=h3("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=UO(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),kO=ui({utf8:l3,"utf-8":l3,hex:f3.base16,latin1:Jd,ascii:Jd,binary:Jd},f3);function jO(t,e="utf8"){const r=kO[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}const d3="wc",p3=2,Qd="core",us=`${d3}@2:${Qd}:`,qO={name:Qd,logger:"error"},zO={database:":memory:"},HO="crypto",g3="client_ed25519_seed",KO=Ie.ONE_DAY,WO="keychain",VO="0.3",GO="messages",YO="0.3",JO=Ie.SIX_HOURS,QO="publisher",v3="irn",ZO="error",m3="wss://relay.walletconnect.org",XO="relayer",Ei={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},eP="_subscription",en={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},tP=.1,b3="2.15.2",rP=1e4,iP="0.3",nP="WALLETCONNECT_CLIENT_ID",fs={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},sP="subscription",oP="0.3",aP=Ie.FIVE_SECONDS*1e3,cP="pairing",uP="0.3",Cu={wc_pairingDelete:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Ie.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Ie.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:0},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:0}}},oc={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},xn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},fP="history",hP="0.3",lP="expirer",tn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},dP="0.3",pP="verify-api",gP="https://verify.walletconnect.com",y3="https://verify.walletconnect.org",Du=y3,vP=`${Du}/v3`,mP=[gP,y3],bP="echo",yP="https://echo.walletconnect.com",hs={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},Ts={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Sn={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},Ko={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},Wo={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Ou={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},wP=.1,_P="event-client",EP=86400,AP="https://pulse.walletconnect.com/batch";class xP{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=WO,this.version=VO,this.initialized=!1,this.storagePrefix=us,this.init=async()=>{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,n)=>{this.isInitialized(),this.keychain.set(i,n),await this.persist()},this.get=i=>{this.isInitialized();const n=this.keychain.get(i);if(typeof n>"u"){const{message:s}=Ee("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(s)}return n},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=ci(r,this.name)}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Fv(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Uv(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class SP{constructor(e,r,i){this.core=e,this.logger=r,this.name=HO,this.randomSessionIdentifier=Cd(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=n=>(this.isInitialized(),this.keychain.has(n)),this.getClientId=async()=>{this.isInitialized();const n=await this.getClientSeed(),s=$v(n);return Pv(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const n=nI();return this.setPrivateKey(n.publicKey,n.privateKey)},this.signJWT=async n=>{this.isInitialized();const s=await this.getClientSeed(),a=$v(s),u=this.randomSessionIdentifier;return await PE(u,n,KO,a)},this.generateSharedKey=(n,s,a)=>{this.isInitialized();const u=this.getPrivateKey(n),l=sI(u,s);return this.setSymKey(l,a)},this.setSymKey=async(n,s)=>{this.isInitialized();const a=s||fh(n);return await this.keychain.set(a,n),a},this.deleteKeyPair=async n=>{this.isInitialized(),await this.keychain.del(n)},this.deleteSymKey=async n=>{this.isInitialized(),await this.keychain.del(n)},this.encode=async(n,s,a)=>{this.isInitialized();const u=sb(a),l=Is(s);if(ob(u)){const S=u.senderPublicKey,I=u.receiverPublicKey;n=await this.generateSharedKey(S,I)}const d=this.getSymKey(n),{type:b,senderPublicKey:w}=u;return aI({type:b,symKey:d,message:l,senderPublicKey:w})},this.decode=async(n,s,a)=>{this.isInitialized();const u=fI(s,a);if(ob(u)){const l=u.receiverPublicKey,d=u.senderPublicKey;n=await this.generateSharedKey(l,d)}try{const l=this.getSymKey(n),d=cI({symKey:l,encoded:s});return qa(d)}catch(l){this.logger.error(`Failed to decode message from topic: '${n}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}},this.getPayloadType=n=>{const s=hh(n);return vu(s.type)},this.getPayloadSenderPublicKey=n=>{const s=hh(n);return s.senderPublicKey?MC(s.senderPublicKey,oi):void 0},this.core=e,this.logger=ci(r,this.name),this.keychain=i||new xP(this.core,this.logger)}get context(){return _i(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(g3)}catch{e=Cd(),await this.keychain.set(g3,e)}return jO(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class IP extends pC{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=GO,this.version=YO,this.initialized=!1,this.storagePrefix=us,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,n)=>{this.isInitialized();const s=$s(n);let a=this.messages.get(i);return typeof a>"u"&&(a={}),typeof a[s]<"u"||(a[s]=n,this.messages.set(i,a),await this.persist()),s},this.get=i=>{this.isInitialized();let n=this.messages.get(i);return typeof n>"u"&&(n={}),n},this.has=(i,n)=>{this.isInitialized();const s=this.get(i),a=$s(n);return typeof s[a]<"u"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=ci(e,this.name),this.core=r}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Fv(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Uv(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class MP extends gC{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new Br.exports.EventEmitter,this.name=QO,this.queue=new Map,this.publishTimeout=Ie.toMiliseconds(Ie.ONE_MINUTE),this.failedPublishTimeout=Ie.toMiliseconds(Ie.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(i,n,s)=>{var a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:n,opts:s}});const u=s?.ttl||JO,l=Dd(s),d=s?.prompt||!1,b=s?.tag||0,w=s?.id||Ho().toString(),S={topic:i,message:n,opts:{ttl:u,relay:l,prompt:d,tag:b,id:w,attestation:s?.attestation}},I=`Failed to publish payload, please try again. id:${w} tag:${b}`,D=Date.now();let L,K=1;try{for(;L===void 0;){if(Date.now()-D>this.publishTimeout)throw new Error(I);this.logger.trace({id:w,attempts:K},`publisher.publish - attempt ${K}`),L=await await za(this.rpcPublish(i,n,u,l,d,b,w,s?.attestation).catch(H=>this.logger.warn(H)),this.publishTimeout,I),K++,L||await new Promise(H=>setTimeout(H,this.failedPublishTimeout))}this.relayer.events.emit(Ei.publish,S),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:w,topic:i,message:n,opts:s}})}catch(H){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(H),(a=s?.internal)!=null&&a.throwOnFailedPublish)throw H;this.queue.set(w,S)}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.relayer=e,this.logger=ci(r,this.name),this.registerEventListeners()}get context(){return _i(this.logger)}rpcPublish(e,r,i,n,s,a,u,l){var d,b,w,S;const I={method:mu(n.protocol).publish,params:{topic:e,message:r,ttl:i,prompt:s,tag:a,attestation:l},id:u};return ai((d=I.params)==null?void 0:d.prompt)&&((b=I.params)==null||delete b.prompt),ai((w=I.params)==null?void 0:w.tag)&&((S=I.params)==null||delete S.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:I}),this.relayer.request(I)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:i,opts:n}=e;await this.publish(r,i,n)})}registerEventListeners(){this.relayer.core.heartbeat.on(rc.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ei.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ei.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class CP{constructor(){this.map=new Map,this.set=(e,r)=>{const i=this.get(e);this.exists(e,r)||this.map.set(e,[...i,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const i=this.get(e);if(!this.exists(e,r))return;const n=i.filter(s=>s!==r);if(!n.length){this.map.delete(e);return}this.map.set(e,n)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var DP=Object.defineProperty,OP=Object.defineProperties,PP=Object.getOwnPropertyDescriptors,w3=Object.getOwnPropertySymbols,$P=Object.prototype.hasOwnProperty,RP=Object.prototype.propertyIsEnumerable,_3=(t,e,r)=>e in t?DP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pu=(t,e)=>{for(var r in e||(e={}))$P.call(e,r)&&_3(t,r,e[r]);if(w3)for(var r of w3(e))RP.call(e,r)&&_3(t,r,e[r]);return t},Zd=(t,e)=>OP(t,PP(e));class NP extends bC{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new CP,this.events=new Br.exports.EventEmitter,this.name=sP,this.version=oP,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=us,this.subscribeTimeout=Ie.toMiliseconds(Ie.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}});try{const s=Dd(n),a={topic:i,relay:s};this.pending.set(i,a);const u=await this.rpcSubscribe(i,s);return typeof u=="string"&&(this.onSubscribe(u,a),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}})),u}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),typeof n?.id<"u"?await this.unsubscribeById(i,n.id,n):await this.unsubscribeByTopic(i,n)},this.isSubscribed=async i=>{if(this.topics.includes(i))return!0;const n=`${this.pendingSubscriptionWatchLabel}_${i}`;return await new Promise((s,a)=>{const u=new Ie.Watch;u.start(n);const l=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(l),u.stop(n),s(!0)),u.elapsed(n)>=aP&&(clearInterval(l),u.stop(n),a(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=ci(r,this.name),this.clientId=""}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let i=!1;try{i=this.getSubscription(e).topic===r}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const i=this.topicMap.get(e);await Promise.all(i.map(async n=>await this.unsubscribeById(e,n,r)))}async unsubscribeById(e,r,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:i}});try{const n=Dd(i);await this.rpcUnsubscribe(e,r,n);const s=Gt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:i}})}catch(n){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(n),n}}async rpcSubscribe(e,r){const i={method:mu(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await za(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)?$s(e+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ei.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,i={method:mu(r.protocol).batchSubscribe,params:{topics:e.map(n=>n.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await za(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)}catch{this.relayer.events.emit(Ei.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,i={method:mu(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let n;try{n=await await za(this.relayer.request(i).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(Ei.connection_stalled)}return n}rpcUnsubscribe(e,r,i){const n={method:mu(i.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,r){this.setSubscription(e,Zd(Pu({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Pu({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,i){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,Pu({},r)),this.topicMap.set(r.topic,e),this.events.emit(fs.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:i}=Ee("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(fs.deleted,Zd(Pu({},i),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(fs.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const i=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(i),await this.batchSubscribe(i)}}this.events.emit(fs.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);ss(r)&&this.onBatchSubscribe(r.map((i,n)=>Zd(Pu({},e[n]),{id:i})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(rc.pulse,async()=>{await this.checkPending()}),this.events.on(fs.created,async e=>{const r=fs.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(fs.deleted,async e=>{const r=fs.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var TP=Object.defineProperty,E3=Object.getOwnPropertySymbols,LP=Object.prototype.hasOwnProperty,BP=Object.prototype.propertyIsEnumerable,A3=(t,e,r)=>e in t?TP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,FP=(t,e)=>{for(var r in e||(e={}))LP.call(e,r)&&A3(t,r,e[r]);if(E3)for(var r of E3(e))BP.call(e,r)&&A3(t,r,e[r]);return t};class UP extends vC{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Br.exports.EventEmitter,this.name=XO,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=Ie.toMiliseconds(Ie.THIRTY_SECONDS+Ie.ONE_SECOND),this.request=async r=>{var i,n;this.logger.debug("Publishing Request Payload");const s=r.id||Ho().toString();await this.toEstablishConnection();try{const a=this.provider.request(r);this.requestsInFlight.set(s,{promise:a,request:r}),this.logger.trace({id:s,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - attempt to publish...");const u=await new Promise(async(l,d)=>{const b=()=>{d(new Error(`relayer.request - publish interrupted, id: ${s}`))};this.provider.on(en.disconnect,b);const w=await a;this.provider.off(en.disconnect,b),l(w)});return this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - published"),u}catch(a){throw this.logger.debug(`Failed to Publish Request: ${s}`),a}finally{this.requestsInFlight.delete(s)}},this.resetPingTimeout=()=>{if(iu())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,i,n;(n=(i=(r=this.provider)==null?void 0:r.connection)==null?void 0:i.socket)==null||n.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Ei.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Ei.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(en.payload,this.onPayloadHandler),this.provider.on(en.connect,this.onConnectHandler),this.provider.on(en.disconnect,this.onDisconnectHandler),this.provider.on(en.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?ci(e.logger,this.name):os(_h({level:e.logger||ZO})),this.messages=new IP(this.logger,e.core),this.subscriber=new NP(this,this.logger),this.publisher=new MP(this,this.logger),this.relayUrl=e?.relayUrl||m3,this.projectId=e.projectId,this.bundleId=UE(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),await this.transportOpen(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&this.subscriber.pending.size===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},rP)}get context(){return _i(this.logger)}get connected(){var e,r,i;return((i=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:i.readyState)===1}get connecting(){var e,r,i;return((i=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:i.readyState)===0}async publish(e,r,i){this.isInitialized(),await this.publisher.publish(e,r,i),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var i;this.isInitialized();let n=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||"",s;const a=u=>{u.topic===e&&(this.subscriber.off(fs.created,a),s())};return await Promise.all([new Promise(u=>{s=u,this.subscriber.on(fs.created,a)}),new Promise(async u=>{n=await this.subscriber.subscribe(e,r)||n,u()})]),n}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await za(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,i)=>{const n=()=>{this.provider.off(en.disconnect,n),i(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(en.disconnect,n),await za(this.provider.connect(),Ie.toMiliseconds(Ie.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{i(s)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(s=>{this.logger.error(s),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const i=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(i.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await bb())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((i,n)=>i.publishedAt-n.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const i of r)try{await this.onMessageEvent(i)}catch(n){this.logger.warn(n)}this.logger.trace(`Batch of ${r.length} message events processed`)}startPingTimeout(){var e,r,i,n,s;if(iu())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(n=(i=this.provider)==null?void 0:i.connection)==null?void 0:n.socket)==null||s.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(a){this.logger.warn(a)}}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new An(new gD(KE({sdkVersion:b3,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:i}=e;await this.messages.set(r,i)}async shouldIgnoreMessageEvent(e){const{topic:r,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const n=this.messages.has(r,i);return n&&this.logger.debug(`Ignoring duplicate message: ${i}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Wd(e)){if(!e.method.endsWith(eP))return;const r=e.params,{topic:i,message:n,publishedAt:s,attestation:a}=r.data,u={topic:i,message:n,publishedAt:s,attestation:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(FP({type:"event",event:r.id},u)),this.events.emit(r.id,u),await this.acknowledgePayload(e),await this.onMessageEvent(u)}else xh(e)&&this.events.emit(Ei.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ei.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=Eh(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(en.payload,this.onPayloadHandler),this.provider.off(en.connect,this.onConnectHandler),this.provider.off(en.disconnect,this.onDisconnectHandler),this.provider.off(en.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await bb();nM(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Ei.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},Ie.toMiliseconds(tP))))}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var kP=Object.defineProperty,x3=Object.getOwnPropertySymbols,jP=Object.prototype.hasOwnProperty,qP=Object.prototype.propertyIsEnumerable,S3=(t,e,r)=>e in t?kP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,I3=(t,e)=>{for(var r in e||(e={}))jP.call(e,r)&&S3(t,r,e[r]);if(x3)for(var r of x3(e))qP.call(e,r)&&S3(t,r,e[r]);return t};class Vo extends mC{constructor(e,r,i,n=us,s=void 0){super(e,r,i,n),this.core=e,this.logger=r,this.name=i,this.map=new Map,this.version=iP,this.cached=[],this.initialized=!1,this.storagePrefix=us,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(a=>{this.getKey&&a!==null&&!ai(a)?this.map.set(this.getKey(a),a):TI(a)?this.map.set(a.id,a):LI(a)&&this.map.set(a.topic,a)}),this.cached=[],this.initialized=!0)},this.set=async(a,u)=>{this.isInitialized(),this.map.has(a)?await this.update(a,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:a,value:u}),this.map.set(a,u),await this.persist())},this.get=a=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:a}),this.getData(a)),this.getAll=a=>(this.isInitialized(),a?this.values.filter(u=>Object.keys(a).every(l=>vD(u[l],a[l]))):this.values),this.update=async(a,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:a,update:u});const l=I3(I3({},this.getData(a)),u);this.map.set(a,l),await this.persist()},this.delete=async(a,u)=>{this.isInitialized(),this.map.has(a)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:a,reason:u}),this.map.delete(a),this.addToRecentlyDeleted(a),await this.persist())},this.logger=ci(r,this.name),this.storagePrefix=n,this.getKey=s}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:n}=Ee("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}const{message:i}=Ee("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class zP{constructor(e,r){this.core=e,this.logger=r,this.name=cP,this.version=uP,this.events=new Br.exports,this.initialized=!1,this.storagePrefix=us,this.ignoredPayloadTypes=[Ps],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async i=>{this.isInitialized();const n=Cd(),s=await this.core.crypto.setSymKey(n),a=kr(Ie.FIVE_MINUTES),u={protocol:v3},l={topic:s,expiry:a,relay:u,active:!1},d=SI({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:n,relay:u,expiryTimestamp:a,methods:i?.methods});return this.core.expirer.set(s,a),await this.pairings.set(s,l),await this.core.relayer.subscribe(s),{topic:s,uri:d}},this.pair=async i=>{this.isInitialized();const n=this.core.eventClient.createEvent({properties:{topic:i?.uri,trace:[hs.pairing_started]}});this.isValidPair(i,n);const{topic:s,symKey:a,relay:u,expiryTimestamp:l,methods:d}=fb(i.uri);n.props.properties.topic=s,n.addTrace(hs.pairing_uri_validation_success),n.addTrace(hs.pairing_uri_not_expired);let b;if(this.pairings.keys.includes(s)){if(b=this.pairings.get(s),n.addTrace(hs.existing_pairing),b.active)throw n.setError(Ts.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);n.addTrace(hs.pairing_not_expired)}const w=l||kr(Ie.FIVE_MINUTES),S={topic:s,relay:u,expiry:w,active:!1,methods:d};this.core.expirer.set(s,w),await this.pairings.set(s,S),n.addTrace(hs.store_new_pairing),i.activatePairing&&await this.activate({topic:s}),this.events.emit(oc.create,S),n.addTrace(hs.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(a,s),n.addTrace(hs.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{n.setError(Ts.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:u})}catch(I){throw n.setError(Ts.subscribe_pairing_topic_failure),I}return n.addTrace(hs.subscribe_pairing_topic_success),S},this.activate=async({topic:i})=>{this.isInitialized();const n=kr(Ie.THIRTY_DAYS);this.core.expirer.set(i,n),await this.pairings.update(i,{active:!0,expiry:n})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:n}=i;if(this.pairings.keys.includes(n)){const s=await this.sendRequest(n,"wc_pairingPing",{}),{done:a,resolve:u,reject:l}=Fo();this.events.once(Dt("pairing_ping",s),({error:d})=>{d?l(d):u()}),await a()}},this.updateExpiry=async({topic:i,expiry:n})=>{this.isInitialized(),await this.pairings.update(i,{expiry:n})},this.updateMetadata=async({topic:i,metadata:n})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:n})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:n}=i;this.pairings.keys.includes(n)&&(await this.sendRequest(n,"wc_pairingDelete",Gt("USER_DISCONNECTED")),await this.deletePairing(n))},this.sendRequest=async(i,n,s)=>{const a=sc(n,s),u=await this.core.crypto.encode(i,a),l=Cu[n].req;return this.core.history.set(i,a),this.core.relayer.publish(i,u,l),a.id},this.sendResult=async(i,n,s)=>{const a=Eh(i,s),u=await this.core.crypto.encode(n,a),l=await this.core.history.get(n,i),d=Cu[l.request.method].res;await this.core.relayer.publish(n,u,d),await this.core.history.resolve(a)},this.sendError=async(i,n,s)=>{const a=Ah(i,s),u=await this.core.crypto.encode(n,a),l=await this.core.history.get(n,i),d=Cu[l.request.method]?Cu[l.request.method].res:Cu.unregistered_method.res;await this.core.relayer.publish(n,u,d),await this.core.history.resolve(a)},this.deletePairing=async(i,n)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,Gt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),n?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(n=>eo(n.expiry));await Promise.all(i.map(n=>this.deletePairing(n.topic)))},this.onRelayEventRequest=i=>{const{topic:n,payload:s}=i;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(n,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(n,s);default:return this.onUnknownRpcMethodRequest(n,s)}},this.onRelayEventResponse=async i=>{const{topic:n,payload:s}=i,a=(await this.core.history.get(n,s.id)).request.method;switch(a){case"wc_pairingPing":return this.onPairingPingResponse(n,s);default:return this.onUnknownRpcMethodResponse(a)}},this.onPairingPingRequest=async(i,n)=>{const{id:s}=n;try{this.isValidPing({topic:i}),await this.sendResult(s,i,!0),this.events.emit(oc.ping,{id:s,topic:i})}catch(a){await this.sendError(s,i,a),this.logger.error(a)}},this.onPairingPingResponse=(i,n)=>{const{id:s}=n;setTimeout(()=>{cs(n)?this.events.emit(Dt("pairing_ping",s),{}):Xi(n)&&this.events.emit(Dt("pairing_ping",s),{error:n.error})},500)},this.onPairingDeleteRequest=async(i,n)=>{const{id:s}=n;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(oc.delete,{id:s,topic:i})}catch(a){await this.sendError(s,i,a),this.logger.error(a)}},this.onUnknownRpcMethodRequest=async(i,n)=>{const{id:s,method:a}=n;try{if(this.registeredMethods.includes(a))return;const u=Gt("WC_METHOD_UNSUPPORTED",a);await this.sendError(s,i,u),this.logger.error(u)}catch(u){await this.sendError(s,i,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error(Gt("WC_METHOD_UNSUPPORTED",i))},this.isValidPair=(i,n)=>{var s;if(!yi(i)){const{message:u}=Ee("MISSING_OR_INVALID",`pair() params: ${i}`);throw n.setError(Ts.malformed_pairing_uri),new Error(u)}if(!NI(i.uri)){const{message:u}=Ee("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw n.setError(Ts.malformed_pairing_uri),new Error(u)}const a=fb(i?.uri);if(!((s=a?.relay)!=null&&s.protocol)){const{message:u}=Ee("MISSING_OR_INVALID","pair() uri#relay-protocol");throw n.setError(Ts.malformed_pairing_uri),new Error(u)}if(!(a!=null&&a.symKey)){const{message:u}=Ee("MISSING_OR_INVALID","pair() uri#symKey");throw n.setError(Ts.malformed_pairing_uri),new Error(u)}if(a!=null&&a.expiryTimestamp&&Ie.toMiliseconds(a?.expiryTimestamp)<Date.now()){n.setError(Ts.pairing_expired);const{message:u}=Ee("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(u)}},this.isValidPing=async i=>{if(!yi(i)){const{message:s}=Ee("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(s)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidDisconnect=async i=>{if(!yi(i)){const{message:s}=Ee("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(s)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidPairingTopic=async i=>{if(!mr(i,!1)){const{message:n}=Ee("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(n)}if(!this.pairings.keys.includes(i)){const{message:n}=Ee("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(n)}if(eo(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:n}=Ee("EXPIRED",`pairing topic: ${i}`);throw new Error(n)}},this.core=e,this.logger=ci(r,this.name),this.pairings=new Vo(this.core,this.logger,this.name,this.storagePrefix)}get context(){return _i(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Ei.message,async e=>{const{topic:r,message:i}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const n=await this.core.crypto.decode(r,i);try{Wd(n)?(this.core.history.set(r,n),this.onRelayEventRequest({topic:r,payload:n})):xh(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:r,payload:n}),this.core.history.delete(r,n.id))}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(tn.expired,async e=>{const{topic:r}=jv(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(oc.expire,{topic:r}))})}}class HP extends dC{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new Br.exports.EventEmitter,this.name=fP,this.version=hP,this.cached=[],this.initialized=!1,this.storagePrefix=us,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,n,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:n,chainId:s}),this.records.has(n.id))return;const a={id:n.id,topic:i,request:{method:n.method,params:n.params||null},chainId:s,expiry:kr(Ie.THIRTY_DAYS)};this.records.set(a.id,a),this.persist(),this.events.emit(xn.created,a)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const n=await this.getRecord(i.id);typeof n.response>"u"&&(n.response=Xi(i)?{error:i.error}:{result:i.result},this.records.set(n.id,n),this.persist(),this.events.emit(xn.updated,n))},this.get=async(i,n)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:n}),await this.getRecord(n)),this.delete=(i,n)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:n}),this.values.forEach(s=>{if(s.topic===i){if(typeof n<"u"&&s.id!==n)return;this.records.delete(s.id),this.events.emit(xn.deleted,s)}}),this.persist()},this.exists=async(i,n)=>(this.isInitialized(),this.records.has(n)?(await this.getRecord(n)).topic===i:!1),this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=ci(r,this.name)}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const i={topic:r.topic,request:sc(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:i}=Ee("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(xn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(xn.created,e=>{const r=xn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xn.updated,e=>{const r=xn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xn.deleted,e=>{const r=xn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(rc.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{Ie.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(xn.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class KP extends yC{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new Br.exports.EventEmitter,this.name=lP,this.version=dP,this.cached=[],this.initialized=!1,this.storagePrefix=us,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const n=this.formatTarget(i);return typeof this.getExpiration(n)<"u"}catch{return!1}},this.set=(i,n)=>{this.isInitialized();const s=this.formatTarget(i),a={target:s,expiry:n};this.expirations.set(s,a),this.checkExpiry(s,a),this.events.emit(tn.created,{target:s,expiration:a})},this.get=i=>{this.isInitialized();const n=this.formatTarget(i);return this.getExpiration(n)},this.del=i=>{if(this.isInitialized(),this.has(i)){const n=this.formatTarget(i),s=this.getExpiration(n);this.expirations.delete(n),this.events.emit(tn.deleted,{target:n,expiration:s})}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=ci(r,this.name)}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return WE(e);if(typeof e=="number")return VE(e);const{message:r}=Ee("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(tn.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:i}=Ee("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(i),new Error(i)}return r}checkExpiry(e,r){const{expiry:i}=r;Ie.toMiliseconds(i)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(tn.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(rc.pulse,()=>this.checkExpirations()),this.events.on(tn.created,e=>{const r=tn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(tn.expired,e=>{const r=tn.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(tn.deleted,e=>{const r=tn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}var sr={};Object.defineProperty(sr,"__esModule",{value:!0}),sr.getLocalStorage=sr.getLocalStorageOrThrow=sr.getCrypto=sr.getCryptoOrThrow=sr.getLocation=sr.getLocationOrThrow=sr.getNavigator=sr.getNavigatorOrThrow=M3=sr.getDocument=sr.getDocumentOrThrow=sr.getFromWindowOrThrow=sr.getFromWindow=void 0;function Go(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}sr.getFromWindow=Go;function ac(t){const e=Go(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}sr.getFromWindowOrThrow=ac;function WP(){return ac("document")}sr.getDocumentOrThrow=WP;function VP(){return Go("document")}var M3=sr.getDocument=VP;function GP(){return ac("navigator")}sr.getNavigatorOrThrow=GP;function YP(){return Go("navigator")}sr.getNavigator=YP;function JP(){return ac("location")}sr.getLocationOrThrow=JP;function QP(){return Go("location")}sr.getLocation=QP;function ZP(){return ac("crypto")}sr.getCryptoOrThrow=ZP;function XP(){return Go("crypto")}sr.getCrypto=XP;function e$(){return ac("localStorage")}sr.getLocalStorageOrThrow=e$;function t$(){return Go("localStorage")}sr.getLocalStorage=t$;class r$ extends wC{constructor(e,r,i){super(e,r,i),this.core=e,this.logger=r,this.store=i,this.name=pP,this.verifyUrlV3=vP,this.storagePrefix=us,this.version=p3,this.init=async()=>{var n;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Ie.toMiliseconds((n=this.publicKey)==null?void 0:n.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()),this.publicKey||await this.fetchAndPersistPublicKey())},this.register=async n=>{if(!su()||this.isDevEnv)return;const s=window.location.origin,{id:a,decryptedId:u}=n,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${a}&decryptedId=${u}`;try{const d=M3(),b=this.startAbortTimer(Ie.ONE_SECOND*5),w=await new Promise((S,I)=>{const D=()=>{window.removeEventListener("message",K),d.body.removeChild(L),I("attestation aborted")};this.abortController.signal.addEventListener("abort",D);const L=d.createElement("iframe");L.src=l,L.style.display="none",L.addEventListener("error",D,{signal:this.abortController.signal});const K=H=>{if(!H.data)return;const U=JSON.parse(H.data);if(U.type==="verify_attestation"){if(Z0(U.attestation).payload.id!==a)return;clearInterval(b),d.body.removeChild(L),this.abortController.signal.removeEventListener("abort",D),window.removeEventListener("message",K),S(U.attestation===null?"":U.attestation)}};d.body.appendChild(L),window.addEventListener("message",K,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",w),w}catch(d){this.logger.warn(d)}return""},this.resolve=async n=>{if(this.isDevEnv)return"";const{attestationId:s,hash:a,encryptedId:u}=n;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(Z0(s).payload.id!==u)return;const d=await this.isValidJwtAttestation(s);if(d)return d}if(!a)return;const l=this.getVerifyUrl(n?.verifyUrl);return this.fetchAttestation(a,l)},this.fetchAttestation=async(n,s)=>{this.logger.debug(`resolving attestation: ${n} from url: ${s}`);const a=this.startAbortTimer(Ie.ONE_SECOND*5),u=await fetch(`${s}/attestation/${n}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(a),u.status===200?await u.json():void 0},this.getVerifyUrl=n=>{let s=n||Du;return mP.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${Du}`),s=Du),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const n=this.startAbortTimer(Ie.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(n),await s.json()}catch(n){this.logger.warn(n)}},this.persistPublicKey=async n=>{this.logger.debug("persisting public key to local storage",n),await this.store.setItem(this.storeKey,n),this.publicKey=n},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async n=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(n,s)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}const a=await this.fetchAndPersistPublicKey();try{if(a)return this.validateAttestation(n,a)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const a=await this.fetchPublicKey();a&&(await this.persistPublicKey(a),s(a))});const n=await this.fetchPromise;return this.fetchPromise=void 0,n},this.validateAttestation=(n,s)=>{const a=pI(n,s.publicKey),u={hasExpired:Ie.toMiliseconds(a.exp)<Date.now(),payload:a};if(u.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:u.payload.origin,isScam:u.payload.isScam}},this.logger=ci(r,this.name),this.abortController=new AbortController,this.isDevEnv=iu()&&process.env.IS_VITEST,this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return _i(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Ie.toMiliseconds(e))}}class i$ extends _C{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=bP,this.registerDeviceToken=async i=>{const{clientId:n,token:s,notificationType:a,enableEncrypted:u=!1}=i,l=`${yP}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:n,type:a,token:s,always_raw:u})})},this.logger=ci(r,this.context)}}var n$=Object.defineProperty,C3=Object.getOwnPropertySymbols,s$=Object.prototype.hasOwnProperty,o$=Object.prototype.propertyIsEnumerable,D3=(t,e,r)=>e in t?n$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$u=(t,e)=>{for(var r in e||(e={}))s$.call(e,r)&&D3(t,r,e[r]);if(C3)for(var r of C3(e))o$.call(e,r)&&D3(t,r,e[r]);return t};class a$ extends EC{constructor(e,r,i=!0){super(e,r,i),this.core=e,this.logger=r,this.context=_P,this.storagePrefix=us,this.storageVersion=wP,this.events=new Map,this.shouldPersist=!1,this.createEvent=n=>{const{event:s="ERROR",type:a="",properties:{topic:u,trace:l}}=n,d=JE(),b=this.core.projectId||"",w=Date.now(),S=$u({eventId:d,bundleId:b,timestamp:w,props:{event:s,type:a,properties:{topic:u,trace:l}}},this.setMethods(d));return this.telemetryEnabled&&(this.events.set(d,S),this.shouldPersist=!0),S},this.getEvent=n=>{const{eventId:s,topic:a}=n;if(s)return this.events.get(s);const u=Array.from(this.events.values()).find(l=>l.props.properties.topic===a);if(u)return $u($u({},u),this.setMethods(u.eventId))},this.deleteEvent=n=>{const{eventId:s}=n;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(rc.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(n=>{Ie.fromMiliseconds(Date.now())-Ie.fromMiliseconds(n.timestamp)>EP&&(this.events.delete(n.eventId),this.shouldPersist=!0)})})},this.setMethods=n=>({addTrace:s=>this.addTrace(n,s),setError:s=>this.setError(n,s)}),this.addTrace=(n,s)=>{const a=this.events.get(n);a&&(a.props.properties.trace.push(s),this.events.set(n,a),this.shouldPersist=!0)},this.setError=(n,s)=>{const a=this.events.get(n);a&&(a.props.type=s,a.timestamp=Date.now(),this.events.set(n,a),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const n=await this.core.storage.getItem(this.storageKey)||[];if(!n.length)return;n.forEach(s=>{this.events.set(s.eventId,$u($u({},s),this.setMethods(s.eventId)))})}catch(n){this.logger.warn(n)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const n=[];for(const[s,a]of this.events)a.props.type&&n.push(a);if(n.length!==0)try{if((await fetch(`${AP}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${b3}`,{method:"POST",body:JSON.stringify(n)})).ok)for(const s of n)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.logger=ci(r,this.context),i?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var c$=Object.defineProperty,O3=Object.getOwnPropertySymbols,u$=Object.prototype.hasOwnProperty,f$=Object.prototype.propertyIsEnumerable,P3=(t,e,r)=>e in t?c$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$3=(t,e)=>{for(var r in e||(e={}))u$.call(e,r)&&P3(t,r,e[r]);if(O3)for(var r of O3(e))f$.call(e,r)&&P3(t,r,e[r]);return t};class Xd extends lC{constructor(e){var r;super(e),this.protocol=d3,this.version=p3,this.name=Qd,this.events=new Br.exports.EventEmitter,this.initialized=!1,this.on=(a,u)=>this.events.on(a,u),this.once=(a,u)=>this.events.once(a,u),this.off=(a,u)=>this.events.off(a,u),this.removeListener=(a,u)=>this.events.removeListener(a,u),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||m3,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=_h({level:typeof e?.logger=="string"&&e.logger?e.logger:qO.logger}),{logger:n,chunkLoggerController:s}=hC({opts:i,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=s,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,u;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((u=this.logChunkController)==null||u.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=ci(n,this.name),this.heartbeat=new Bd,this.crypto=new SP(this,this.logger,e?.keychain),this.history=new HP(this,this.logger),this.expirer=new KP(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new LM($3($3({},zO),e?.storageOptions)),this.relayer=new UP({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new zP(this,this.logger),this.verify=new r$(this,this.logger,this.storage),this.echoClient=new i$(this.projectId||"",this.logger),this.eventClient=new a$(this,this.logger,e?.telemetryEnabled)}static async init(e){const r=new Xd(e);await r.initialize();const i=await r.crypto.getClientId();return await r.storage.setItem(nP,i),r}get context(){return _i(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const h$=Xd,R3="wc",N3=2,T3="client",e1=`${R3}@${N3}:${T3}:`,t1={name:T3,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},L3="WALLETCONNECT_DEEPLINK_CHOICE",l$="proposal",B3="Proposal expired",d$="session",cc=Ie.SEVEN_DAYS,p$="engine",Hr={wc_sessionPropose:{req:{ttl:Ie.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Ie.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Ie.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Ie.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Ie.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1119}}},r1={min:Ie.FIVE_MINUTES,max:Ie.SEVEN_DAYS},ls={idle:"IDLE",active:"ACTIVE"},g$="request",v$=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],m$="wc",b$="auth",y$="authKeys",w$="pairingTopics",_$="requests",Ih=`${m$}@${1.5}:${b$}:`,Mh=`${Ih}:PUB_KEY`;var E$=Object.defineProperty,A$=Object.defineProperties,x$=Object.getOwnPropertyDescriptors,F3=Object.getOwnPropertySymbols,S$=Object.prototype.hasOwnProperty,I$=Object.prototype.propertyIsEnumerable,U3=(t,e,r)=>e in t?E$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xr=(t,e)=>{for(var r in e||(e={}))S$.call(e,r)&&U3(t,r,e[r]);if(F3)for(var r of F3(e))I$.call(e,r)&&U3(t,r,e[r]);return t},Yo=(t,e)=>A$(t,x$(e));class M$ extends xC{constructor(e){super(e),this.name=p$,this.events=new Br.exports,this.initialized=!1,this.requestQueue={state:ls.idle,queue:[]},this.sessionRequestQueue={state:ls.idle,queue:[]},this.requestQueueDelay=Ie.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Hr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Ie.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const i=Yo(xr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(i);const{pairingTopic:n,requiredNamespaces:s,optionalNamespaces:a,sessionProperties:u,relays:l}=i;let d=n,b,w=!1;try{d&&(w=this.client.core.pairing.pairings.get(d).active)}catch(R){throw this.client.logger.error(`connect() -> pairing.get(${d}) failed`),R}if(!d||!w){const{topic:R,uri:k}=await this.client.core.pairing.create();d=R,b=k}if(!d){const{message:R}=Ee("NO_MATCHING_KEY",`connect() pairing topic: ${d}`);throw new Error(R)}const S=await this.client.core.crypto.generateKeyPair(),I=Hr.wc_sessionPropose.req.ttl||Ie.FIVE_MINUTES,D=kr(I),L=xr({requiredNamespaces:s,optionalNamespaces:a,relays:l??[{protocol:v3}],proposer:{publicKey:S,metadata:this.client.metadata},expiryTimestamp:D,pairingTopic:d},u&&{sessionProperties:u}),{reject:K,resolve:H,done:U}=Fo(I,B3);this.events.once(Dt("session_connect"),async({error:R,session:k})=>{if(R)K(R);else if(k){k.self.publicKey=S;const z=Yo(xr({},k),{pairingTopic:L.pairingTopic,requiredNamespaces:L.requiredNamespaces,optionalNamespaces:L.optionalNamespaces});await this.client.session.set(k.topic,z),await this.setExpiry(k.topic,k.expiry),d&&await this.client.core.pairing.updateMetadata({topic:d,metadata:k.peer.metadata}),this.cleanupDuplicatePairings(z),H(z)}});const W=await this.sendRequest({topic:d,method:"wc_sessionPropose",params:L,throwOnFailedPublish:!0});return await this.setProposal(W,xr({id:W},L)),{uri:b,approval:U}},this.pair=async r=>{await this.isInitialized();try{return await this.client.core.pairing.pair(r)}catch(i){throw this.client.logger.error("pair() failed"),i}},this.approve=async r=>{var i,n,s;const a=this.client.core.eventClient.createEvent({properties:{topic:(i=r?.id)==null?void 0:i.toString(),trace:[Sn.session_approve_started]}});try{await this.isInitialized()}catch(_){throw a.setError(Ko.no_internet_connection),_}try{await this.isValidProposalId(r?.id)}catch(_){throw this.client.logger.error(`approve() -> proposal.get(${r?.id}) failed`),a.setError(Ko.proposal_not_found),_}try{await this.isValidApprove(r)}catch(_){throw this.client.logger.error("approve() -> isValidApprove() failed"),a.setError(Ko.session_approve_namespace_validation_failure),_}const{id:u,relayProtocol:l,namespaces:d,sessionProperties:b,sessionConfig:w}=r,S=this.client.proposal.get(u);this.client.core.eventClient.deleteEvent({eventId:a.eventId});const{pairingTopic:I,proposer:D,requiredNamespaces:L,optionalNamespaces:K}=S;let H=(n=this.client.core.eventClient)==null?void 0:n.getEvent({topic:I});H||(H=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Sn.session_approve_started,properties:{topic:I,trace:[Sn.session_approve_started,Sn.session_namespaces_validation_success]}}));const U=await this.client.core.crypto.generateKeyPair(),W=D.publicKey,R=await this.client.core.crypto.generateSharedKey(U,W),k=xr(xr({relay:{protocol:l??"irn"},namespaces:d,controller:{publicKey:U,metadata:this.client.metadata},expiry:kr(cc)},b&&{sessionProperties:b}),w&&{sessionConfig:w});H.addTrace(Sn.subscribing_session_topic);try{await this.client.core.relayer.subscribe(R)}catch(_){throw H.setError(Ko.subscribe_session_topic_failure),_}H.addTrace(Sn.subscribe_session_topic_success);const z=Yo(xr({},k),{topic:R,requiredNamespaces:L,optionalNamespaces:K,pairingTopic:I,acknowledged:!1,self:k.controller,peer:{publicKey:D.publicKey,metadata:D.metadata},controller:U});await this.client.session.set(R,z),H.addTrace(Sn.store_session);try{H.addTrace(Sn.publishing_session_settle),await this.sendRequest({topic:R,method:"wc_sessionSettle",params:k,throwOnFailedPublish:!0}).catch(_=>{throw H?.setError(Ko.session_settle_publish_failure),_}),H.addTrace(Sn.session_settle_publish_success),H.addTrace(Sn.publishing_session_approve),await this.sendResult({id:u,topic:I,result:{relay:{protocol:l??"irn"},responderPublicKey:U},throwOnFailedPublish:!0}).catch(_=>{throw H?.setError(Ko.session_approve_publish_failure),_}),H.addTrace(Sn.session_approve_publish_success)}catch(_){throw this.client.logger.error(_),this.client.session.delete(R,Gt("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(R),_}return this.client.core.eventClient.deleteEvent({eventId:H.eventId}),await this.client.core.pairing.updateMetadata({topic:I,metadata:D.metadata}),await this.client.proposal.delete(u,Gt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:I}),await this.setExpiry(R,kr(cc)),{topic:R,acknowledged:()=>Promise.resolve(this.client.session.get(R))}},this.reject=async r=>{await this.isInitialized();try{await this.isValidReject(r)}catch(a){throw this.client.logger.error("reject() -> isValidReject() failed"),a}const{id:i,reason:n}=r;let s;try{s=this.client.proposal.get(i).pairingTopic}catch(a){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),a}s&&(await this.sendError({id:i,topic:s,error:n,rpcOpts:Hr.wc_sessionPropose.reject}),await this.client.proposal.delete(i,Gt("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized();try{await this.isValidUpdate(r)}catch(w){throw this.client.logger.error("update() -> isValidUpdate() failed"),w}const{topic:i,namespaces:n}=r,{done:s,resolve:a,reject:u}=Fo(),l=no(),d=Ho().toString(),b=this.client.session.get(i).namespaces;return this.events.once(Dt("session_update",l),({error:w})=>{w?u(w):a()}),await this.client.session.update(i,{namespaces:n}),await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:l,relayRpcId:d}).catch(w=>{this.client.logger.error(w),this.client.session.update(i,{namespaces:b}),u(w)}),{acknowledged:s}},this.extend=async r=>{await this.isInitialized();try{await this.isValidExtend(r)}catch(l){throw this.client.logger.error("extend() -> isValidExtend() failed"),l}const{topic:i}=r,n=no(),{done:s,resolve:a,reject:u}=Fo();return this.events.once(Dt("session_extend",n),({error:l})=>{l?u(l):a()}),await this.setExpiry(i,kr(cc)),this.sendRequest({topic:i,method:"wc_sessionExtend",params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(l=>{u(l)}),{acknowledged:s}},this.request=async r=>{await this.isInitialized();try{await this.isValidRequest(r)}catch(I){throw this.client.logger.error("request() -> isValidRequest() failed"),I}const{chainId:i,request:n,topic:s,expiry:a=Hr.wc_sessionRequest.req.ttl}=r,u=this.client.session.get(s),l=no(),d=Ho().toString(),{done:b,resolve:w,reject:S}=Fo(a,"Request expired. Please try again.");return this.events.once(Dt("session_request",l),({error:I,result:D})=>{I?S(I):w(D)}),await Promise.all([new Promise(async I=>{await this.sendRequest({clientRpcId:l,relayRpcId:d,topic:s,method:"wc_sessionRequest",params:{request:Yo(xr({},n),{expiryTimestamp:kr(a)}),chainId:i},expiry:a,throwOnFailedPublish:!0}).catch(D=>S(D)),this.client.events.emit("session_request_sent",{topic:s,request:n,chainId:i,id:l}),I()}),new Promise(async I=>{var D;if(!((D=u.sessionConfig)!=null&&D.disableDeepLink)){const L=await YE(this.client.core.storage,L3);GE({id:l,topic:s,wcDeepLink:L})}I()}),b()]).then(I=>I[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:i,response:n}=r,{id:s}=n;cs(n)?await this.sendResult({id:s,topic:i,result:n.result,throwOnFailedPublish:!0}):Xi(n)&&await this.sendError({id:s,topic:i,error:n.error}),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized();try{await this.isValidPing(r)}catch(n){throw this.client.logger.error("ping() -> isValidPing() failed"),n}const{topic:i}=r;if(this.client.session.keys.includes(i)){const n=no(),s=Ho().toString(),{done:a,resolve:u,reject:l}=Fo();this.events.once(Dt("session_ping",n),({error:d})=>{d?l(d):u()}),await Promise.all([this.sendRequest({topic:i,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:n,relayRpcId:s}),a()])}else this.client.core.pairing.pairings.keys.includes(i)&&await this.client.core.pairing.ping({topic:i})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:i,event:n,chainId:s}=r,a=Ho().toString();await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:n,chainId:s},throwOnFailedPublish:!0,relayRpcId:a})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:i}=r;if(this.client.session.keys.includes(i))await this.sendRequest({topic:i,method:"wc_sessionDelete",params:Gt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:i,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(i))await this.client.core.pairing.disconnect({topic:i});else{const{message:n}=Ee("MISMATCHED_TOPIC",`Session or pairing topic not found: ${i}`);throw new Error(n)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(i=>$I(i,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async r=>{this.isInitialized(),this.isValidAuthenticate(r);const{chains:i,statement:n="",uri:s,domain:a,nonce:u,type:l,exp:d,nbf:b,methods:w=[],expiry:S}=r,I=[...r.resources||[]],{topic:D,uri:L}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:D,uri:L}});const K=await this.client.core.crypto.generateKeyPair(),H=fh(K);if(await Promise.all([this.client.auth.authKeys.set(Mh,{responseTopic:H,publicKey:K}),this.client.auth.pairingTopics.set(H,{topic:H,pairingTopic:D})]),await this.client.core.relayer.subscribe(H),this.client.logger.info(`sending request to new pairing topic: ${D}`),w.length>0){const{namespace:f}=ru(i[0]);let h=KS(f,"request",w);uh(I)&&(h=VS(h,I.pop())),I.push(h)}const U=S&&S>Hr.wc_sessionAuthenticate.req.ttl?S:Hr.wc_sessionAuthenticate.req.ttl,W={authPayload:{type:l??"caip122",chains:i,statement:n,aud:s,domain:a,version:"1",nonce:u,iat:new Date().toISOString(),exp:d,nbf:b,resources:I},requester:{publicKey:K,metadata:this.client.metadata},expiryTimestamp:kr(U)},R={eip155:{chains:i,methods:[...new Set(["personal_sign",...w])],events:["chainChanged","accountsChanged"]}},k={requiredNamespaces:{},optionalNamespaces:R,relays:[{protocol:"irn"}],pairingTopic:D,proposer:{publicKey:K,metadata:this.client.metadata},expiryTimestamp:kr(Hr.wc_sessionPropose.req.ttl)},{done:z,resolve:_,reject:B}=Fo(U,"Request expired"),X=async({error:f,session:h})=>{if(this.events.off(Dt("session_request",T),re),f)B(f);else if(h){h.self.publicKey=K,await this.client.session.set(h.topic,h),await this.setExpiry(h.topic,h.expiry),D&&await this.client.core.pairing.updateMetadata({topic:D,metadata:h.peer.metadata});const v=this.client.session.get(h.topic);await this.deleteProposal(y),_({session:v})}},re=async f=>{if(await this.deletePendingAuthRequest(T,{message:"fulfilled",code:0}),f.error){const g=Gt("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return f.error.code===g.code?void 0:(this.events.off(Dt("session_connect"),X),B(f.error.message))}await this.deleteProposal(y),this.events.off(Dt("session_connect"),X);const{cacaos:h,responder:v}=f.result,E=[],C=[];for(const g of h){await Ym({cacao:g,projectId:this.client.core.projectId})||(this.client.logger.error(g,"Signature verification failed"),B(Gt("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:m}=g,N=uh(m.resources),ee=[Gm(m.iss)],ae=ch(m.iss);if(N){const O=Zm(N),te=Xm(N);E.push(...O),ee.push(...te)}for(const O of ee)C.push(`${O}:${ae}`)}const P=await this.client.core.crypto.generateSharedKey(K,v.publicKey);let M;E.length>0&&(M={topic:P,acknowledged:!0,self:{publicKey:K,metadata:this.client.metadata},peer:v,controller:v.publicKey,expiry:kr(cc),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:D,namespaces:hb([...new Set(E)],[...new Set(C)])},await this.client.core.relayer.subscribe(P),await this.client.session.set(P,M),D&&await this.client.core.pairing.updateMetadata({topic:D,metadata:v.metadata}),M=this.client.session.get(P)),_({auths:h,session:M})},T=no(),y=no();this.events.once(Dt("session_connect"),X),this.events.once(Dt("session_request",T),re);try{await Promise.all([this.sendRequest({topic:D,method:"wc_sessionAuthenticate",params:W,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:T}),this.sendRequest({topic:D,method:"wc_sessionPropose",params:k,expiry:Hr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:y})])}catch(f){throw this.events.off(Dt("session_connect"),X),this.events.off(Dt("session_request",T),re),f}return await this.setProposal(y,xr({id:y},k)),await this.setAuthRequest(T,{request:Yo(xr({},W),{verifyContext:{}}),pairingTopic:D}),{uri:L,response:z}},this.approveSessionAuthenticate=async r=>{const{id:i,auths:n}=r,s=this.client.core.eventClient.createEvent({properties:{topic:i.toString(),trace:[Wo.authenticated_session_approve_started]}});try{this.isInitialized()}catch(L){throw s.setError(Ou.no_internet_connection),L}const a=this.getPendingAuthRequest(i);if(!a)throw s.setError(Ou.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${i}`);const u=a.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),d=fh(u),b={type:Ps,receiverPublicKey:u,senderPublicKey:l},w=[],S=[];for(const L of n){if(!await Ym({cacao:L,projectId:this.client.core.projectId})){s.setError(Ou.invalid_cacao);const R=Gt("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:d,error:R,encodeOpts:b}),new Error(R.message)}s.addTrace(Wo.cacaos_verified);const{p:K}=L,H=uh(K.resources),U=[Gm(K.iss)],W=ch(K.iss);if(H){const R=Zm(H),k=Xm(H);w.push(...R),U.push(...k)}for(const R of U)S.push(`${R}:${W}`)}const I=await this.client.core.crypto.generateSharedKey(l,u);s.addTrace(Wo.create_authenticated_session_topic);let D;if(w?.length>0){D={topic:I,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:u,metadata:a.requester.metadata},controller:u,expiry:kr(cc),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:a.pairingTopic,namespaces:hb([...new Set(w)],[...new Set(S)])},s.addTrace(Wo.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(I)}catch(L){throw s.setError(Ou.subscribe_authenticated_session_topic_failure),L}s.addTrace(Wo.subscribe_authenticated_session_topic_success),await this.client.session.set(I,D),s.addTrace(Wo.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:a.pairingTopic,metadata:a.requester.metadata})}s.addTrace(Wo.publishing_authenticated_session_approve);try{await this.sendResult({topic:d,id:i,result:{cacaos:n,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:b,throwOnFailedPublish:!0})}catch(L){throw s.setError(Ou.authenticated_session_approve_publish_failure),L}return await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:a.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:D}},this.rejectSessionAuthenticate=async r=>{await this.isInitialized();const{id:i,reason:n}=r,s=this.getPendingAuthRequest(i);if(!s)throw new Error(`Could not find pending auth request with id ${i}`);const a=s.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),l=fh(a),d={type:Ps,receiverPublicKey:a,senderPublicKey:u};await this.sendError({id:i,topic:l,error:n,encodeOpts:d,rpcOpts:Hr.wc_sessionAuthenticate.reject}),await this.client.auth.requests.delete(i,{message:"rejected",code:0}),await this.client.proposal.delete(i,Gt("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:i,iss:n}=r;return Jm(i,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const i=this.client.core.pairing.pairings.get(r.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(s=>{var a,u;return((a=s.peerMetadata)==null?void 0:a.url)&&((u=s.peerMetadata)==null?void 0:u.url)===r.peer.metadata.url&&s.topic&&s.topic!==i.topic});if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}},this.deleteSession=async r=>{var i;const{topic:n,expirerHasDeleted:s=!1,emitEvent:a=!0,id:u=0}=r,{self:l}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,Gt("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(l.publicKey)&&await this.client.core.crypto.deleteKeyPair(l.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),s||this.client.core.expirer.del(n),this.client.core.storage.removeItem(L3).catch(d=>this.client.logger.warn(d)),this.getPendingSessionRequests().forEach(d=>{d.topic===n&&this.deletePendingSessionRequest(d.id,Gt("USER_DISCONNECTED"))}),n===((i=this.sessionRequestQueue.queue[0])==null?void 0:i.topic)&&(this.sessionRequestQueue.state=ls.idle),a&&this.client.events.emit("session_delete",{id:u,topic:n})},this.deleteProposal=async(r,i)=>{if(i)try{const n=this.client.proposal.get(r),s=this.client.core.eventClient.getEvent({topic:n.pairingTopic});s?.setError(Ko.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,Gt("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,i,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,i),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),n&&(this.sessionRequestQueue.state=ls.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,i,n=!1)=>{await Promise.all([this.client.auth.requests.delete(r,i),n?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,i)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,i),await this.client.session.update(r,{expiry:i}))},this.setProposal=async(r,i)=>{this.client.core.expirer.set(r,kr(Hr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,i)},this.setAuthRequest=async(r,i)=>{const{request:n,pairingTopic:s}=i;this.client.core.expirer.set(r,n.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:r,pairingTopic:s,verifyContext:n.verifyContext})},this.setPendingSessionRequest=async r=>{const{id:i,topic:n,params:s,verifyContext:a}=r,u=s.request.expiryTimestamp||kr(Hr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(i,u),await this.client.pendingRequest.set(i,{id:i,topic:n,params:s,verifyContext:a})},this.sendRequest=async r=>{const{topic:i,method:n,params:s,expiry:a,relayRpcId:u,clientRpcId:l,throwOnFailedPublish:d}=r,b=sc(n,s,l);let w;try{w=await this.client.core.crypto.encode(i,b)}catch(D){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),D}let S;if(v$.includes(n)){const D=$s(JSON.stringify(b)),L=$s(w);S=await this.client.core.verify.register({id:L,decryptedId:D})}const I=Hr[n].req;return I.attestation=S,a&&(I.ttl=a),u&&(I.id=u),this.client.core.history.set(i,b),d?(I.internal=Yo(xr({},I.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,w,I)):this.client.core.relayer.publish(i,w,I).catch(D=>this.client.logger.error(D)),b.id},this.sendResult=async r=>{const{id:i,topic:n,result:s,throwOnFailedPublish:a,encodeOpts:u}=r,l=Eh(i,s);let d;try{d=await this.client.core.crypto.encode(n,l,u)}catch(S){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),S}let b;try{b=await this.client.core.history.get(n,i)}catch(S){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${i}) failed`),S}const w=Hr[b.request.method].res;a?(w.internal=Yo(xr({},w.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,d,w)):this.client.core.relayer.publish(n,d,w).catch(S=>this.client.logger.error(S)),await this.client.core.history.resolve(l)},this.sendError=async r=>{const{id:i,topic:n,error:s,encodeOpts:a,rpcOpts:u}=r,l=Ah(i,s);let d;try{d=await this.client.core.crypto.encode(n,l,a)}catch(S){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),S}let b;try{b=await this.client.core.history.get(n,i)}catch(S){throw this.client.logger.error(`sendError() -> history.get(${n}, ${i}) failed`),S}const w=u||Hr[b.request.method].res;this.client.core.relayer.publish(n,d,w),await this.client.core.history.resolve(l)},this.cleanup=async()=>{const r=[],i=[];this.client.session.getAll().forEach(n=>{let s=!1;eo(n.expiry)&&(s=!0),this.client.core.crypto.keychain.has(n.topic)||(s=!0),s&&r.push(n.topic)}),this.client.proposal.getAll().forEach(n=>{eo(n.expiryTimestamp)&&i.push(n.id)}),await Promise.all([...r.map(n=>this.deleteSession({topic:n})),...i.map(n=>this.deleteProposal(n))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===ls.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=ls.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=ls.idle},this.processRequest=async r=>{const{topic:i,payload:n,attestation:s,encryptedId:a}=r,u=n.method;if(!this.shouldIgnorePairingRequest({topic:i,requestMethod:u}))switch(u){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:i,payload:n,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(i,n);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(i,n);case"wc_sessionExtend":return await this.onSessionExtendRequest(i,n);case"wc_sessionPing":return await this.onSessionPingRequest(i,n);case"wc_sessionDelete":return await this.onSessionDeleteRequest(i,n);case"wc_sessionRequest":return await this.onSessionRequest({topic:i,payload:n,attestation:s,encryptedId:a});case"wc_sessionEvent":return await this.onSessionEventRequest(i,n);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:i,payload:n,attestation:s,encryptedId:a});default:return this.client.logger.info(`Unsupported request method ${u}`)}},this.onRelayEventResponse=async r=>{const{topic:i,payload:n}=r,s=(await this.client.core.history.get(i,n.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(i,n);case"wc_sessionSettle":return this.onSessionSettleResponse(i,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,n);case"wc_sessionExtend":return this.onSessionExtendResponse(i,n);case"wc_sessionPing":return this.onSessionPingResponse(i,n);case"wc_sessionRequest":return this.onSessionRequestResponse(i,n);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(i,n);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:i}=r,{message:n}=Ee("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(n)},this.shouldIgnorePairingRequest=r=>{const{topic:i,requestMethod:n}=r,s=this.expectedPairingMethodMap.get(i);return!s||s.includes(n)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:i,payload:n,attestation:s,encryptedId:a}=r,{params:u,id:l}=n;try{const d=this.client.core.eventClient.getEvent({topic:i});this.isValidConnect(xr({},n.params));const b=u.expiryTimestamp||kr(Hr.wc_sessionPropose.req.ttl),w=xr({id:l,pairingTopic:i,expiryTimestamp:b},u);await this.setProposal(l,w);const S=await this.getVerifyContext({attestationId:s,hash:$s(JSON.stringify(n)),encryptedId:a,metadata:w.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),d?.setError(Ts.proposal_listener_not_found)),d?.addTrace(hs.emit_session_proposal),this.client.events.emit("session_proposal",{id:l,params:w,verifyContext:S})}catch(d){await this.sendError({id:l,topic:i,error:d,rpcOpts:Hr.wc_sessionPropose.autoReject}),this.client.logger.error(d)}},this.onSessionProposeResponse=async(r,i)=>{const{id:n}=i;if(cs(i)){const{result:s}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const a=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const u=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u});const l=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const d=await this.client.core.crypto.generateSharedKey(u,l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:d});const b=await this.client.core.relayer.subscribe(d);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:b}),await this.client.core.pairing.activate({topic:r})}else if(Xi(i)){await this.client.proposal.delete(n,Gt("USER_DISCONNECTED"));const s=Dt("session_connect");if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners, 954`);this.events.emit(Dt("session_connect"),{error:i.error})}},this.onSessionSettleRequest=async(r,i)=>{const{id:n,params:s}=i;try{this.isValidSessionSettleRequest(s);const{relay:a,controller:u,expiry:l,namespaces:d,sessionProperties:b,sessionConfig:w}=i.params,S=xr(xr({topic:r,relay:a,expiry:l,namespaces:d,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},b&&{sessionProperties:b}),w&&{sessionConfig:w}),I=Dt("session_connect");if(this.events.listenerCount(I)===0)throw new Error(`emitting ${I} without any listeners 997`);this.events.emit(Dt("session_connect"),{session:S}),await this.sendResult({id:i.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(a){await this.sendError({id:n,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionSettleResponse=async(r,i)=>{const{id:n}=i;cs(i)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Dt("session_approve",n),{})):Xi(i)&&(await this.client.session.delete(r,Gt("USER_DISCONNECTED")),this.events.emit(Dt("session_approve",n),{error:i.error}))},this.onSessionUpdateRequest=async(r,i)=>{const{params:n,id:s}=i;try{const a=`${r}_session_update`,u=wu.get(a);if(u&&this.isRequestOutOfSync(u,s)){this.client.logger.info(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:Gt("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(xr({topic:r},n));try{wu.set(a,s),await this.client.session.update(r,{namespaces:n.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(l){throw wu.delete(a),l}this.client.events.emit("session_update",{id:s,topic:r,params:n})}catch(a){await this.sendError({id:s,topic:r,error:a}),this.client.logger.error(a)}},this.isRequestOutOfSync=(r,i)=>parseInt(i.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,i)=>{const{id:n}=i,s=Dt("session_update",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);cs(i)?this.events.emit(Dt("session_update",n),{}):Xi(i)&&this.events.emit(Dt("session_update",n),{error:i.error})},this.onSessionExtendRequest=async(r,i)=>{const{id:n}=i;try{this.isValidExtend({topic:r}),await this.setExpiry(r,kr(cc)),await this.sendResult({id:n,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:n,topic:r})}catch(s){await this.sendError({id:n,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,i)=>{const{id:n}=i,s=Dt("session_extend",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);cs(i)?this.events.emit(Dt("session_extend",n),{}):Xi(i)&&this.events.emit(Dt("session_extend",n),{error:i.error})},this.onSessionPingRequest=async(r,i)=>{const{id:n}=i;try{this.isValidPing({topic:r}),await this.sendResult({id:n,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:n,topic:r})}catch(s){await this.sendError({id:n,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,i)=>{const{id:n}=i,s=Dt("session_ping",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{cs(i)?this.events.emit(Dt("session_ping",n),{}):Xi(i)&&this.events.emit(Dt("session_ping",n),{error:i.error})},500)},this.onSessionDeleteRequest=async(r,i)=>{const{id:n}=i;try{this.isValidDisconnect({topic:r,reason:i.params}),await Promise.all([new Promise(s=>{this.client.core.relayer.once(Ei.publish,async()=>{s(await this.deleteSession({topic:r,id:n}))})}),this.sendResult({id:n,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:Gt("USER_DISCONNECTED")})])}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{var i;const{topic:n,payload:s,attestation:a,encryptedId:u}=r,{id:l,params:d}=s;try{await this.isValidRequest(xr({topic:n},d));const b=this.client.session.get(n),w=await this.getVerifyContext({attestationId:a,hash:$s(JSON.stringify(sc("wc_sessionRequest",d,l))),encryptedId:u,metadata:b.peer.metadata}),S={id:l,topic:n,params:d,verifyContext:w};await this.setPendingSessionRequest(S),(i=this.client.signConfig)!=null&&i.disableRequestQueue?this.emitSessionRequest(S):(this.addSessionRequestToSessionRequestQueue(S),this.processSessionRequestQueue())}catch(b){await this.sendError({id:l,topic:n,error:b}),this.client.logger.error(b)}},this.onSessionRequestResponse=(r,i)=>{const{id:n}=i,s=Dt("session_request",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);cs(i)?this.events.emit(Dt("session_request",n),{result:i.result}):Xi(i)&&this.events.emit(Dt("session_request",n),{error:i.error})},this.onSessionEventRequest=async(r,i)=>{const{id:n,params:s}=i;try{const a=`${r}_session_event_${s.event.name}`,u=wu.get(a);if(u&&this.isRequestOutOfSync(u,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit(xr({topic:r},s)),this.client.events.emit("session_event",{id:n,topic:r,params:s}),wu.set(a,n)}catch(a){await this.sendError({id:n,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionAuthenticateResponse=(r,i)=>{const{id:n}=i;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:i}),cs(i)?this.events.emit(Dt("session_request",n),{result:i.result}):Xi(i)&&this.events.emit(Dt("session_request",n),{error:i.error})},this.onSessionAuthenticateRequest=async r=>{const{topic:i,payload:n,attestation:s,encryptedId:a}=r;try{const{requester:u,authPayload:l,expiryTimestamp:d}=n.params,b=await this.getVerifyContext({attestationId:s,hash:$s(JSON.stringify(n)),encryptedId:a,metadata:this.client.metadata}),w={requester:u,pairingTopic:i,id:n.id,authPayload:l,verifyContext:b,expiryTimestamp:d};await this.setAuthRequest(n.id,{request:w,pairingTopic:i}),this.client.events.emit("session_authenticate",{topic:i,params:n.params,id:n.id,verifyContext:b})}catch(u){this.client.logger.error(u);const l=n.params.requester.publicKey,d=await this.client.core.crypto.generateKeyPair(),b={type:Ps,receiverPublicKey:l,senderPublicKey:d};await this.sendError({id:n.id,topic:i,error:u,encodeOpts:b,rpcOpts:Hr.wc_sessionAuthenticate.autoReject})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=ls.idle,this.processSessionRequestQueue()},Ie.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:i})=>{const n=this.client.core.history.pending;n.length>0&&n.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const a=s.request.id,u=Dt("session_request",a);if(this.events.listenerCount(u)===0)throw new Error(`emitting ${u} without any listeners`);this.events.emit(Dt("session_request",s.request.id),{error:i})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===ls.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=ls.active,this.emitSessionRequest(r)}catch(i){this.client.logger.error(i)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const i=this.client.proposal.getAll().find(n=>n.pairingTopic===r.topic);i&&this.onSessionProposeRequest({topic:r.topic,payload:sc("wc_sessionPropose",{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer,sessionProperties:i.sessionProperties},i.id)})},this.isValidConnect=async r=>{if(!yi(r)){const{message:l}=Ee("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:i,requiredNamespaces:n,optionalNamespaces:s,sessionProperties:a,relays:u}=r;if(ai(i)||await this.isValidPairingTopic(i),!HI(u,!0)){const{message:l}=Ee("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(l)}!ai(n)&&yu(n)!==0&&this.validateNamespaces(n,"requiredNamespaces"),!ai(s)&&yu(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),ai(a)||this.validateSessionProps(a,"sessionProperties")},this.validateNamespaces=(r,i)=>{const n=zI(r,"connect()",i);if(n)throw new Error(n.message)},this.isValidApprove=async r=>{if(!yi(r))throw new Error(Ee("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:i,namespaces:n,relayProtocol:s,sessionProperties:a}=r;this.checkRecentlyDeleted(i),await this.isValidProposalId(i);const u=this.client.proposal.get(i),l=$d(n,"approve()");if(l)throw new Error(l.message);const d=vb(u.requiredNamespaces,n,"approve()");if(d)throw new Error(d.message);if(!mr(s,!0)){const{message:b}=Ee("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(b)}ai(a)||this.validateSessionProps(a,"sessionProperties")},this.isValidReject=async r=>{if(!yi(r)){const{message:s}=Ee("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:i,reason:n}=r;if(this.checkRecentlyDeleted(i),await this.isValidProposalId(i),!WI(n)){const{message:s}=Ee("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(n)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!yi(r)){const{message:d}=Ee("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(d)}const{relay:i,controller:n,namespaces:s,expiry:a}=r;if(!pb(i)){const{message:d}=Ee("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(d)}const u=BI(n,"onSessionSettleRequest()");if(u)throw new Error(u.message);const l=$d(s,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(eo(a)){const{message:d}=Ee("EXPIRED","onSessionSettleRequest()");throw new Error(d)}},this.isValidUpdate=async r=>{if(!yi(r)){const{message:l}=Ee("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(l)}const{topic:i,namespaces:n}=r;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const s=this.client.session.get(i),a=$d(n,"update()");if(a)throw new Error(a.message);const u=vb(s.requiredNamespaces,n,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async r=>{if(!yi(r)){const{message:n}=Ee("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(n)}const{topic:i}=r;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i)},this.isValidRequest=async r=>{if(!yi(r)){const{message:l}=Ee("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(l)}const{topic:i,request:n,chainId:s,expiry:a}=r;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const{namespaces:u}=this.client.session.get(i);if(!gb(u,s)){const{message:l}=Ee("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(l)}if(!VI(n)){const{message:l}=Ee("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw new Error(l)}if(!JI(u,s,n.method)){const{message:l}=Ee("MISSING_OR_INVALID",`request() method: ${n.method}`);throw new Error(l)}if(a&&!eM(a,r1)){const{message:l}=Ee("MISSING_OR_INVALID",`request() expiry: ${a}. Expiry must be a number (in seconds) between ${r1.min} and ${r1.max}`);throw new Error(l)}},this.isValidRespond=async r=>{var i;if(!yi(r)){const{message:a}=Ee("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(a)}const{topic:n,response:s}=r;try{await this.isValidSessionTopic(n)}catch(a){throw(i=r?.response)!=null&&i.id&&this.cleanupAfterResponse(r),a}if(!GI(s)){const{message:a}=Ee("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(a)}},this.isValidPing=async r=>{if(!yi(r)){const{message:n}=Ee("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(n)}const{topic:i}=r;await this.isValidSessionOrPairingTopic(i)},this.isValidEmit=async r=>{if(!yi(r)){const{message:u}=Ee("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(u)}const{topic:i,event:n,chainId:s}=r;await this.isValidSessionTopic(i);const{namespaces:a}=this.client.session.get(i);if(!gb(a,s)){const{message:u}=Ee("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(u)}if(!YI(n)){const{message:u}=Ee("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}if(!QI(a,s,n.name)){const{message:u}=Ee("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}},this.isValidDisconnect=async r=>{if(!yi(r)){const{message:n}=Ee("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(n)}const{topic:i}=r;await this.isValidSessionOrPairingTopic(i)},this.isValidAuthenticate=r=>{const{chains:i,uri:n,domain:s,nonce:a}=r;if(!Array.isArray(i)||i.length===0)throw new Error("chains is required and must be a non-empty array");if(!mr(n,!1))throw new Error("uri is required parameter");if(!mr(s,!1))throw new Error("domain is required parameter");if(!mr(a,!1))throw new Error("nonce is required parameter");if([...new Set(i.map(l=>ru(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:u}=ru(i[0]);if(u!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:i,hash:n,encryptedId:s,metadata:a}=r,u={verified:{verifyUrl:a.verifyUrl||Du,validation:"UNKNOWN",origin:a.url||""}};try{const l=await this.client.core.verify.resolve({attestationId:i,hash:n,encryptedId:s,verifyUrl:a.verifyUrl});l&&(u.verified.origin=l.origin,u.verified.isScam=l.isScam,u.verified.validation=l.origin===new URL(a.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(u)}`),u},this.validateSessionProps=(r,i)=>{Object.values(r).forEach(n=>{if(!mr(n,!1)){const{message:s}=Ee("MISSING_OR_INVALID",`${i} must be in Record<string, string> format. Received: ${JSON.stringify(n)}`);throw new Error(s)}})},this.getPendingAuthRequest=r=>{const i=this.client.auth.requests.get(r);return typeof i=="object"?i:void 0},this.addToRecentlyDeleted=(r,i)=>{if(this.recentlyDeletedMap.set(r,i),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let n=0;const s=this.recentlyDeletedLimit/2;for(const a of this.recentlyDeletedMap.keys()){if(n++>=s)break;this.recentlyDeletedMap.delete(a)}}},this.checkRecentlyDeleted=r=>{const i=this.recentlyDeletedMap.get(r);if(i){const{message:n}=Ee("MISSING_OR_INVALID",`Record was recently deleted - ${i}: ${r}`);throw new Error(n)}}}async isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Ei.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:i,attestation:n}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(Mh)?this.client.auth.authKeys.get(Mh):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,i,{receiverPublicKey:s});try{Wd(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:n,encryptedId:$s(i)})):xh(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a}),this.client.core.history.delete(r,a.id)):this.onRelayEventUnknownPayload({topic:r,payload:a})}catch(u){this.client.logger.error(u)}}registerExpirerEvents(){this.client.core.expirer.on(tn.expired,async e=>{const{topic:r,id:i}=jv(e.target);if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,Ee("EXPIRED"),!0);if(i&&this.client.auth.requests.keys.includes(i))return await this.deletePendingAuthRequest(i,Ee("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(oc.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(oc.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!mr(e,!1)){const{message:r}=Ee("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=Ee("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(eo(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=Ee("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!mr(e,!1)){const{message:r}=Ee("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=Ee("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(eo(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=Ee("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=Ee("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(mr(e,!1)){const{message:r}=Ee("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=Ee("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!KI(e)){const{message:r}=Ee("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=Ee("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(eo(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=Ee("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class C$ extends Vo{constructor(e,r){super(e,r,l$,e1),this.core=e,this.logger=r}}class D$ extends Vo{constructor(e,r){super(e,r,d$,e1),this.core=e,this.logger=r}}class O$ extends Vo{constructor(e,r){super(e,r,g$,e1,i=>i.id),this.core=e,this.logger=r}}class P$ extends Vo{constructor(e,r){super(e,r,y$,Ih,()=>Mh),this.core=e,this.logger=r}}class $$ extends Vo{constructor(e,r){super(e,r,w$,Ih),this.core=e,this.logger=r}}class R$ extends Vo{constructor(e,r){super(e,r,_$,Ih,i=>i.id),this.core=e,this.logger=r}}class N${constructor(e,r){this.core=e,this.logger=r,this.authKeys=new P$(this.core,this.logger),this.pairingTopics=new $$(this.core,this.logger),this.requests=new R$(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class i1 extends AC{constructor(e){super(e),this.protocol=R3,this.version=N3,this.name=t1.name,this.events=new Br.exports.EventEmitter,this.on=(i,n)=>this.events.on(i,n),this.once=(i,n)=>this.events.once(i,n),this.off=(i,n)=>this.events.off(i,n),this.removeListener=(i,n)=>this.events.removeListener(i,n),this.removeAllListeners=i=>this.events.removeAllListeners(i),this.connect=async i=>{try{return await this.engine.connect(i)}catch(n){throw this.logger.error(n.message),n}},this.pair=async i=>{try{return await this.engine.pair(i)}catch(n){throw this.logger.error(n.message),n}},this.approve=async i=>{try{return await this.engine.approve(i)}catch(n){throw this.logger.error(n.message),n}},this.reject=async i=>{try{return await this.engine.reject(i)}catch(n){throw this.logger.error(n.message),n}},this.update=async i=>{try{return await this.engine.update(i)}catch(n){throw this.logger.error(n.message),n}},this.extend=async i=>{try{return await this.engine.extend(i)}catch(n){throw this.logger.error(n.message),n}},this.request=async i=>{try{return await this.engine.request(i)}catch(n){throw this.logger.error(n.message),n}},this.respond=async i=>{try{return await this.engine.respond(i)}catch(n){throw this.logger.error(n.message),n}},this.ping=async i=>{try{return await this.engine.ping(i)}catch(n){throw this.logger.error(n.message),n}},this.emit=async i=>{try{return await this.engine.emit(i)}catch(n){throw this.logger.error(n.message),n}},this.disconnect=async i=>{try{return await this.engine.disconnect(i)}catch(n){throw this.logger.error(n.message),n}},this.find=i=>{try{return this.engine.find(i)}catch(n){throw this.logger.error(n.message),n}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}},this.authenticate=async i=>{try{return await this.engine.authenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.formatAuthMessage=i=>{try{return this.engine.formatAuthMessage(i)}catch(n){throw this.logger.error(n.message),n}},this.approveSessionAuthenticate=async i=>{try{return await this.engine.approveSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.rejectSessionAuthenticate=async i=>{try{return await this.engine.rejectSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||t1.name,this.metadata=e?.metadata||jE(),this.signConfig=e?.signConfig;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:os(_h({level:e?.logger||t1.logger}));this.core=e?.core||new h$(e),this.logger=ci(r,this.name),this.session=new D$(this.core,this.logger),this.proposal=new C$(this.core,this.logger),this.pendingRequest=new O$(this.core,this.logger),this.engine=new M$(this),this.auth=new N$(this.core,this.logger)}static async init(e){const r=new i1(e);return await r.initialize(),r}get context(){return _i(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),await this.auth.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var n1={exports:{}};(function(t,e){var r=typeof self<"u"?self:Wr,i=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(a){var u={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function l(h){return h&&DataView.prototype.isPrototypeOf(h)}if(u.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=ArrayBuffer.isView||function(h){return h&&d.indexOf(Object.prototype.toString.call(h))>-1};function w(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(h))throw new TypeError("Invalid character in header field name");return h.toLowerCase()}function S(h){return typeof h!="string"&&(h=String(h)),h}function I(h){var v={next:function(){var E=h.shift();return{done:E===void 0,value:E}}};return u.iterable&&(v[Symbol.iterator]=function(){return v}),v}function D(h){this.map={},h instanceof D?h.forEach(function(v,E){this.append(E,v)},this):Array.isArray(h)?h.forEach(function(v){this.append(v[0],v[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(v){this.append(v,h[v])},this)}D.prototype.append=function(h,v){h=w(h),v=S(v);var E=this.map[h];this.map[h]=E?E+", "+v:v},D.prototype.delete=function(h){delete this.map[w(h)]},D.prototype.get=function(h){return h=w(h),this.has(h)?this.map[h]:null},D.prototype.has=function(h){return this.map.hasOwnProperty(w(h))},D.prototype.set=function(h,v){this.map[w(h)]=S(v)},D.prototype.forEach=function(h,v){for(var E in this.map)this.map.hasOwnProperty(E)&&h.call(v,this.map[E],E,this)},D.prototype.keys=function(){var h=[];return this.forEach(function(v,E){h.push(E)}),I(h)},D.prototype.values=function(){var h=[];return this.forEach(function(v){h.push(v)}),I(h)},D.prototype.entries=function(){var h=[];return this.forEach(function(v,E){h.push([E,v])}),I(h)},u.iterable&&(D.prototype[Symbol.iterator]=D.prototype.entries);function L(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function K(h){return new Promise(function(v,E){h.onload=function(){v(h.result)},h.onerror=function(){E(h.error)}})}function H(h){var v=new FileReader,E=K(v);return v.readAsArrayBuffer(h),E}function U(h){var v=new FileReader,E=K(v);return v.readAsText(h),E}function W(h){for(var v=new Uint8Array(h),E=new Array(v.length),C=0;C<v.length;C++)E[C]=String.fromCharCode(v[C]);return E.join("")}function R(h){if(h.slice)return h.slice(0);var v=new Uint8Array(h.byteLength);return v.set(new Uint8Array(h)),v.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(h){this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:u.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:u.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():u.arrayBuffer&&u.blob&&l(h)?(this._bodyArrayBuffer=R(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||b(h))?this._bodyArrayBuffer=R(h):this._bodyText=h=Object.prototype.toString.call(h):this._bodyText="",this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var h=L(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?L(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(H)}),this.text=function(){var h=L(this);if(h)return h;if(this._bodyBlob)return U(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(W(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(X)}),this.json=function(){return this.text().then(JSON.parse)},this}var z=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(h){var v=h.toUpperCase();return z.indexOf(v)>-1?v:h}function B(h,v){v=v||{};var E=v.body;if(h instanceof B){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,v.headers||(this.headers=new D(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!E&&h._bodyInit!=null&&(E=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=v.credentials||this.credentials||"same-origin",(v.headers||!this.headers)&&(this.headers=new D(v.headers)),this.method=_(v.method||this.method||"GET"),this.mode=v.mode||this.mode||null,this.signal=v.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&E)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(E)}B.prototype.clone=function(){return new B(this,{body:this._bodyInit})};function X(h){var v=new FormData;return h.trim().split("&").forEach(function(E){if(E){var C=E.split("="),P=C.shift().replace(/\+/g," "),M=C.join("=").replace(/\+/g," ");v.append(decodeURIComponent(P),decodeURIComponent(M))}}),v}function re(h){var v=new D,E=h.replace(/\r?\n[\t ]+/g," ");return E.split(/\r?\n/).forEach(function(C){var P=C.split(":"),M=P.shift().trim();if(M){var g=P.join(":").trim();v.append(M,g)}}),v}k.call(B.prototype);function T(h,v){v||(v={}),this.type="default",this.status=v.status===void 0?200:v.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in v?v.statusText:"OK",this.headers=new D(v.headers),this.url=v.url||"",this._initBody(h)}k.call(T.prototype),T.prototype.clone=function(){return new T(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},T.error=function(){var h=new T(null,{status:0,statusText:""});return h.type="error",h};var y=[301,302,303,307,308];T.redirect=function(h,v){if(y.indexOf(v)===-1)throw new RangeError("Invalid status code");return new T(null,{status:v,headers:{location:h}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(v,E){this.message=v,this.name=E;var C=Error(v);this.stack=C.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function f(h,v){return new Promise(function(E,C){var P=new B(h,v);if(P.signal&&P.signal.aborted)return C(new a.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function g(){M.abort()}M.onload=function(){var m={status:M.status,statusText:M.statusText,headers:re(M.getAllResponseHeaders()||"")};m.url="responseURL"in M?M.responseURL:m.headers.get("X-Request-URL");var N="response"in M?M.response:M.responseText;E(new T(N,m))},M.onerror=function(){C(new TypeError("Network request failed"))},M.ontimeout=function(){C(new TypeError("Network request failed"))},M.onabort=function(){C(new a.DOMException("Aborted","AbortError"))},M.open(P.method,P.url,!0),P.credentials==="include"?M.withCredentials=!0:P.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&u.blob&&(M.responseType="blob"),P.headers.forEach(function(m,N){M.setRequestHeader(N,m)}),P.signal&&(P.signal.addEventListener("abort",g),M.onreadystatechange=function(){M.readyState===4&&P.signal.removeEventListener("abort",g)}),M.send(typeof P._bodyInit>"u"?null:P._bodyInit)})}return f.polyfill=!0,s.fetch||(s.fetch=f,s.Headers=D,s.Request=B,s.Response=T),a.Headers=D,a.Request=B,a.Response=T,a.fetch=f,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e})(n1,n1.exports);var k3=Tw(n1.exports),T$=Object.defineProperty,L$=Object.defineProperties,B$=Object.getOwnPropertyDescriptors,j3=Object.getOwnPropertySymbols,F$=Object.prototype.hasOwnProperty,U$=Object.prototype.propertyIsEnumerable,q3=(t,e,r)=>e in t?T$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,z3=(t,e)=>{for(var r in e||(e={}))F$.call(e,r)&&q3(t,r,e[r]);if(j3)for(var r of j3(e))U$.call(e,r)&&q3(t,r,e[r]);return t},H3=(t,e)=>L$(t,B$(e));const k$={Accept:"application/json","Content-Type":"application/json"},j$="POST",K3={headers:k$,method:j$},W3=10;class ds{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new Br.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!Hb(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Is(e),i=await(await k3(this.url,H3(z3({},K3),{body:r}))).json();this.onPayload({data:i})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!Hb(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((i,n)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),n(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return n(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Is({id:1,jsonrpc:"2.0",method:"test",params:[]});await k3(e,H3(z3({},K3),{body:r}))}this.onOpen()}catch(r){const i=this.parseError(r);throw this.events.emit("register_error",i),this.onClose(),i}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?qa(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const i=this.parseError(r),n=i.message||i.toString(),s=Ah(e,n);this.events.emit("payload",s)}parseError(e,r=this.url){return Fb(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>W3&&this.events.setMaxListeners(W3)}}const V3="error",q$="wss://relay.walletconnect.com",z$="wc",H$="universal_provider",G3=`${z$}@2:${H$}:`,K$="https://rpc.walletconnect.com/v1/",uc="generic",In={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Ru=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s1={exports:{}};/**
43
+ ***************************************************************************** */var zd=function(t,e){return zd=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)i.hasOwnProperty(n)&&(r[n]=i[n])},zd(t,e)};function IC(t,e){zd(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Hd=function(){return Hd=Object.assign||function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s]=r[s])}return e},Hd.apply(this,arguments)};function MC(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function CC(t,e,r,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(t,e,r,i);else for(var u=t.length-1;u>=0;u--)(a=t[u])&&(s=(n<3?a(s):n>3?a(e,r,s):a(e,r))||s);return n>3&&s&&Object.defineProperty(e,r,s),s}function DC(t,e){return function(r,i){e(r,i,t)}}function OC(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function PC(t,e,r,i){function n(s){return s instanceof r?s:new r(function(a){a(s)})}return new(r||(r=Promise))(function(s,a){function u(b){try{d(i.next(b))}catch(w){a(w)}}function l(b){try{d(i.throw(b))}catch(w){a(w)}}function d(b){b.done?s(b.value):n(b.value).then(u,l)}d((i=i.apply(t,e||[])).next())})}function $C(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(d){return function(b){return l([d,b])}}function l(d){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=d[0]&2?n.return:d[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,d[1])).done)return s;switch(n=0,s&&(d=[d[0]&2,s.value]),d[0]){case 0:case 1:s=d;break;case 4:return r.label++,{value:d[1],done:!1};case 5:r.label++,n=d[1],d=[0];continue;case 7:d=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(d[0]===6||d[0]===2)){r=0;continue}if(d[0]===3&&(!s||d[1]>s[0]&&d[1]<s[3])){r.label=d[1];break}if(d[0]===6&&r.label<s[1]){r.label=s[1],s=d;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(d);break}s[2]&&r.ops.pop(),r.trys.pop();continue}d=e.call(t,r)}catch(b){d=[6,b],n=0}finally{i=s=0}if(d[0]&5)throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}}function RC(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]}function NC(t,e){for(var r in t)r!=="default"&&!e.hasOwnProperty(r)&&(e[r]=t[r])}function Kd(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Fb(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(u){a={error:u}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return s}function TC(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Fb(arguments[e]));return t}function LC(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var s=arguments[e],a=0,u=s.length;a<u;a++,n++)i[n]=s[a];return i}function Iu(t){return this instanceof Iu?(this.v=t,this):new Iu(t)}function BC(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,s=[];return n={},a("next"),a("throw"),a("return"),n[Symbol.asyncIterator]=function(){return this},n;function a(I){i[I]&&(n[I]=function(S){return new Promise(function(D,L){s.push([I,S,D,L])>1||u(I,S)})})}function u(I,S){try{l(i[I](S))}catch(D){w(s[0][3],D)}}function l(I){I.value instanceof Iu?Promise.resolve(I.value.v).then(d,b):w(s[0][2],I)}function d(I){u("next",I)}function b(I){u("throw",I)}function w(I,S){I(S),s.shift(),s.length&&u(s[0][0],s[0][1])}}function FC(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,s){e[n]=t[n]?function(a){return(r=!r)?{value:Iu(t[n](a)),done:n==="return"}:s?s(a):a}:s}}function UC(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Kd=="function"?Kd(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(s){r[s]=t[s]&&function(a){return new Promise(function(u,l){a=t[s](a),n(u,l,a.done,a.value)})}}function n(s,a,u,l){Promise.resolve(l).then(function(d){s({value:d,done:u})},a)}}function kC(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function jC(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e}function qC(t){return t&&t.__esModule?t:{default:t}}function zC(t,e){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return e.get(t)}function HC(t,e,r){if(!e.has(t))throw new TypeError("attempted to set private field on non-instance");return e.set(t,r),r}var KC=Object.freeze({__proto__:null,__extends:IC,get __assign(){return Hd},__rest:MC,__decorate:CC,__param:DC,__metadata:OC,__awaiter:PC,__generator:$C,__createBinding:RC,__exportStar:NC,__values:Kd,__read:Fb,__spread:TC,__spreadArrays:LC,__await:Iu,__asyncGenerator:BC,__asyncDelegator:FC,__asyncValues:UC,__makeTemplateObject:kC,__importStar:jC,__importDefault:qC,__classPrivateFieldGet:zC,__classPrivateFieldSet:HC}),WC=f0(KC),Rs={},Ub;function VC(){if(Ub)return Rs;Ub=1,Object.defineProperty(Rs,"__esModule",{value:!0}),Rs.isBrowserCryptoAvailable=Rs.getSubtleCrypto=Rs.getBrowerCrypto=void 0;function t(){return Wr?.crypto||Wr?.msCrypto||{}}Rs.getBrowerCrypto=t;function e(){const i=t();return i.subtle||i.webkitSubtle}Rs.getSubtleCrypto=e;function r(){return!!t()&&!!e()}return Rs.isBrowserCryptoAvailable=r,Rs}var Ns={},kb;function GC(){if(kb)return Ns;kb=1,Object.defineProperty(Ns,"__esModule",{value:!0}),Ns.isBrowser=Ns.isNode=Ns.isReactNative=void 0;function t(){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"}Ns.isReactNative=t;function e(){return typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"}Ns.isNode=e;function r(){return!t()&&!e()}return Ns.isBrowser=r,Ns}(function(t){Object.defineProperty(t,"__esModule",{value:!0});const e=WC;e.__exportStar(VC(),t),e.__exportStar(GC(),t)})(Bb);function no(t=3){const e=Date.now()*Math.pow(10,t),r=Math.floor(Math.random()*Math.pow(10,t));return e+r}function Ho(t=6){return BigInt(no(t))}function sc(t,e,r){return{id:r||no(),jsonrpc:"2.0",method:t,params:e}}function Ah(t,e){return{id:t,jsonrpc:"2.0",result:e}}function xh(t,e,r){return{id:t,jsonrpc:"2.0",error:YC(e,r)}}function YC(t,e){return typeof t>"u"?Tb(Rb):(typeof t=="string"&&(t=Object.assign(Object.assign({},Tb(qd)),{message:t})),typeof e<"u"&&(t.data=e),xC(t.code)&&(t=SC(t.code)),t)}class JC{}class QC extends JC{constructor(){super()}}class ZC extends QC{constructor(e){super()}}const XC="^https?:",eD="^wss?:";function tD(t){const e=t.match(new RegExp(/^\w+:/,"gi"));if(!(!e||!e.length))return e[0]}function jb(t,e){const r=tD(t);return typeof r>"u"?!1:new RegExp(e).test(r)}function qb(t){return jb(t,XC)}function zb(t){return jb(t,eD)}function rD(t){return new RegExp("wss?://localhost(:d{2,5})?").test(t)}function Hb(t){return typeof t=="object"&&"id"in t&&"jsonrpc"in t&&t.jsonrpc==="2.0"}function Wd(t){return Hb(t)&&"method"in t}function Sh(t){return Hb(t)&&(cs(t)||Xi(t))}function cs(t){return"result"in t}function Xi(t){return"error"in t}class An extends ZC{constructor(e){super(e),this.events=new Br.exports.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async request(e,r){return this.requestStrict(sc(e.method,e.params||[],e.id||Ho().toString()),r)}async requestStrict(e,r){return new Promise(async(i,n)=>{if(!this.connection.connected)try{await this.open()}catch(s){n(s)}this.events.on(`${e.id}`,s=>{Xi(s)?n(s.error):i(s.result)});try{await this.connection.send(e,r)}catch(s){n(s)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),Sh(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&e.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),typeof e=="string"&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}const iD=()=>typeof WebSocket<"u"?WebSocket:typeof global<"u"&&typeof global.WebSocket<"u"?global.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:require("ws"),nD=()=>typeof WebSocket<"u"||typeof global<"u"&&typeof global.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Kb=t=>t.split("?")[0],Wb=10,sD=iD();class oD{constructor(e){if(this.url=e,this.events=new Br.exports.EventEmitter,this.registering=!1,!zb(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=i=>{this.onClose(i),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(Is(e))}catch(r){this.onError(e.id,r)}}register(e=this.url){if(!zb(e))throw new Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((i,n)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),n(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return n(new Error("WebSocket connection is missing or invalid"));i(this.socket)})})}return this.url=e,this.registering=!0,new Promise((r,i)=>{const n=new URLSearchParams(e).get("origin"),s=Bb.isReactNative()?{headers:{origin:n}}:{rejectUnauthorized:!rD(e)},a=new sD(e,[],s);nD()?a.onerror=u=>{const l=u;i(this.emitError(l.error))}:a.on("error",u=>{i(this.emitError(u))}),a.onopen=()=>{this.onOpen(a),r(a)}})}onOpen(e){e.onmessage=r=>this.onPayload(r),e.onclose=r=>this.onClose(r),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?qa(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const i=this.parseError(r),n=i.message||i.toString(),s=xh(e,n);this.events.emit("payload",s)}parseError(e,r=this.url){return Lb(e,Kb(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>Wb&&this.events.setMaxListeners(Wb)}emitError(e){const r=this.parseError(new Error(e?.message||`WebSocket connection failed for host: ${Kb(this.url)}`));return this.events.emit("register_error",r),r}}var Vd={exports:{}};(function(t,e){var r=200,i="__lodash_hash_undefined__",n=1,s=2,a=9007199254740991,u="[object Arguments]",l="[object Array]",d="[object AsyncFunction]",b="[object Boolean]",w="[object Date]",I="[object Error]",S="[object Function]",D="[object GeneratorFunction]",L="[object Map]",K="[object Number]",H="[object Null]",U="[object Object]",W="[object Promise]",R="[object Proxy]",k="[object RegExp]",z="[object Set]",_="[object String]",B="[object Symbol]",X="[object Undefined]",re="[object WeakMap]",T="[object ArrayBuffer]",y="[object DataView]",f="[object Float32Array]",h="[object Float64Array]",v="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",P="[object Uint8Array]",M="[object Uint8ClampedArray]",g="[object Uint16Array]",m="[object Uint32Array]",N=/[\\^$.*+?()[\]{}|]/g,ee=/^\[object .+?Constructor\]$/,ae=/^(?:0|[1-9]\d*)$/,O={};O[f]=O[h]=O[v]=O[E]=O[C]=O[P]=O[M]=O[g]=O[m]=!0,O[u]=O[l]=O[T]=O[b]=O[y]=O[w]=O[I]=O[S]=O[L]=O[K]=O[U]=O[k]=O[z]=O[_]=O[re]=!1;var te=typeof Wr=="object"&&Wr&&Wr.Object===Object&&Wr,q=typeof self=="object"&&self&&self.Object===Object&&self,G=te||q||Function("return this")(),Y=e&&!e.nodeType&&e,A=Y&&!0&&t&&!t.nodeType&&t,V=A&&A.exports===Y,oe=V&&te.process,ue=function(){try{return oe&&oe.binding&&oe.binding("util")}catch{}}(),he=ue&&ue.isTypedArray;function ye(J,ie){for(var pe=-1,ke=J==null?0:J.length,Xt=0,bt=[];++pe<ke;){var or=J[pe];ie(or,pe,J)&&(bt[Xt++]=or)}return bt}function we(J,ie){for(var pe=-1,ke=ie.length,Xt=J.length;++pe<ke;)J[Xt+pe]=ie[pe];return J}function Re(J,ie){for(var pe=-1,ke=J==null?0:J.length;++pe<ke;)if(ie(J[pe],pe,J))return!0;return!1}function Xe(J,ie){for(var pe=-1,ke=Array(J);++pe<J;)ke[pe]=ie(pe);return ke}function Oe(J){return function(ie){return J(ie)}}function Ne(J,ie){return J.has(ie)}function Me(J,ie){return J?.[ie]}function be(J){var ie=-1,pe=Array(J.size);return J.forEach(function(ke,Xt){pe[++ie]=[Xt,ke]}),pe}function Pe(J,ie){return function(pe){return J(ie(pe))}}function Te(J){var ie=-1,pe=Array(J.size);return J.forEach(function(ke){pe[++ie]=ke}),pe}var ve=Array.prototype,$e=Function.prototype,xe=Object.prototype,me=G["__core-js_shared__"],Ue=$e.toString,Ce=xe.hasOwnProperty,_e=function(){var J=/[^.]+$/.exec(me&&me.keys&&me.keys.IE_PROTO||"");return J?"Symbol(src)_1."+J:""}(),Ke=xe.toString,Ve=RegExp("^"+Ue.call(Ce).replace(N,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ae=V?G.Buffer:void 0,We=G.Symbol,pt=G.Uint8Array,Ge=xe.propertyIsEnumerable,It=ve.splice,gt=We?We.toStringTag:void 0,Je=Object.getOwnPropertySymbols,Ot=Ae?Ae.isBuffer:void 0,Tt=Pe(Object.keys,Object),Le=ki(G,"DataView"),et=ki(G,"Map"),it=ki(G,"Promise"),Be=ki(G,"Set"),rt=ki(G,"WeakMap"),tt=ki(Object,"create"),je=Us(Le),ht=Us(et),nt=Us(it),qe=Us(Be),st=Us(rt),at=We?We.prototype:void 0,Fe=at?at.valueOf:void 0;function Ze(J){var ie=-1,pe=J==null?0:J.length;for(this.clear();++ie<pe;){var ke=J[ie];this.set(ke[0],ke[1])}}function lt(){this.__data__=tt?tt(null):{},this.size=0}function ze(J){var ie=this.has(J)&&delete this.__data__[J];return this.size-=ie?1:0,ie}function jt(J){var ie=this.__data__;if(tt){var pe=ie[J];return pe===i?void 0:pe}return Ce.call(ie,J)?ie[J]:void 0}function qt(J){var ie=this.__data__;return tt?ie[J]!==void 0:Ce.call(ie,J)}function ct(J,ie){var pe=this.__data__;return this.size+=this.has(J)?0:1,pe[J]=tt&&ie===void 0?i:ie,this}Ze.prototype.clear=lt,Ze.prototype.delete=ze,Ze.prototype.get=jt,Ze.prototype.has=qt,Ze.prototype.set=ct;function _t(J){var ie=-1,pe=J==null?0:J.length;for(this.clear();++ie<pe;){var ke=J[ie];this.set(ke[0],ke[1])}}function Qr(){this.__data__=[],this.size=0}function Zr(J){var ie=this.__data__,pe=ha(ie,J);if(pe<0)return!1;var ke=ie.length-1;return pe==ke?ie.pop():It.call(ie,pe,1),--this.size,!0}function Xr(J){var ie=this.__data__,pe=ha(ie,J);return pe<0?void 0:ie[pe][1]}function ei(J){return ha(this.__data__,J)>-1}function ti(J,ie){var pe=this.__data__,ke=ha(pe,J);return ke<0?(++this.size,pe.push([J,ie])):pe[ke][1]=ie,this}_t.prototype.clear=Qr,_t.prototype.delete=Zr,_t.prototype.get=Xr,_t.prototype.has=ei,_t.prototype.set=ti;function pr(J){var ie=-1,pe=J==null?0:J.length;for(this.clear();++ie<pe;){var ke=J[ie];this.set(ke[0],ke[1])}}function Si(){this.size=0,this.__data__={hash:new Ze,map:new(et||_t),string:new Ze}}function Cn(J){var ie=bo(this,J).delete(J);return this.size-=ie?1:0,ie}function Ii(J){return bo(this,J).get(J)}function Dn(J){return bo(this,J).has(J)}function On(J,ie){var pe=bo(this,J),ke=pe.size;return pe.set(J,ie),this.size+=pe.size==ke?0:1,this}pr.prototype.clear=Si,pr.prototype.delete=Cn,pr.prototype.get=Ii,pr.prototype.has=Dn,pr.prototype.set=On;function Mi(J){var ie=-1,pe=J==null?0:J.length;for(this.__data__=new pr;++ie<pe;)this.add(J[ie])}function nn(J){return this.__data__.set(J,i),this}function sn(J){return this.__data__.has(J)}Mi.prototype.add=Mi.prototype.push=nn,Mi.prototype.has=sn;function Ir(J){var ie=this.__data__=new _t(J);this.size=ie.size}function Pn(){this.__data__=new _t,this.size=0}function $n(J){var ie=this.__data__,pe=ie.delete(J);return this.size=ie.size,pe}function Rn(J){return this.__data__.get(J)}function fa(J){return this.__data__.has(J)}function cl(J,ie){var pe=this.__data__;if(pe instanceof _t){var ke=pe.__data__;if(!et||ke.length<r-1)return ke.push([J,ie]),this.size=++pe.size,this;pe=this.__data__=new pr(ke)}return pe.set(J,ie),this.size=pe.size,this}Ir.prototype.clear=Pn,Ir.prototype.delete=$n,Ir.prototype.get=Rn,Ir.prototype.has=fa,Ir.prototype.set=cl;function ul(J,ie){var pe=Oc(J),ke=!pe&&_l(J),Xt=!pe&&!ke&&tf(J),bt=!pe&&!ke&&!Xt&&xl(J),or=pe||ke||Xt||bt,Er=or?Xe(J.length,String):[],Ft=Er.length;for(var er in J)(ie||Ce.call(J,er))&&!(or&&(er=="length"||Xt&&(er=="offset"||er=="parent")||bt&&(er=="buffer"||er=="byteLength"||er=="byteOffset")||vl(er,Ft)))&&Er.push(er);return Er}function ha(J,ie){for(var pe=J.length;pe--;)if(wl(J[pe][0],ie))return pe;return-1}function Xu(J,ie,pe){var ke=ie(J);return Oc(J)?ke:we(ke,pe(J))}function la(J){return J==null?J===void 0?X:H:gt&&gt in Object(J)?pl(J):Ap(J)}function ef(J){return pa(J)&&la(J)==u}function da(J,ie,pe,ke,Xt){return J===ie?!0:J==null||ie==null||!pa(J)&&!pa(ie)?J!==J&&ie!==ie:fl(J,ie,pe,ke,da,Xt)}function fl(J,ie,pe,ke,Xt,bt){var or=Oc(J),Er=Oc(ie),Ft=or?l:bs(J),er=Er?l:bs(ie);Ft=Ft==u?U:Ft,er=er==u?U:er;var yr=Ft==U,Ci=er==U,Ar=Ft==er;if(Ar&&tf(J)){if(!tf(ie))return!1;or=!0,yr=!1}if(Ar&&!yr)return bt||(bt=new Ir),or||xl(J)?Cc(J,ie,pe,ke,Xt,bt):Ep(J,ie,Ft,pe,ke,Xt,bt);if(!(pe&n)){var ar=yr&&Ce.call(J,"__wrapped__"),hi=Ci&&Ce.call(ie,"__wrapped__");if(ar||hi){var Nn=ar?J.value():J,on=hi?ie.value():ie;return bt||(bt=new Ir),Xt(Nn,on,pe,ke,bt)}}return Ar?(bt||(bt=new Ir),dl(J,ie,pe,ke,Xt,bt)):!1}function _p(J){if(!Al(J)||bl(J))return!1;var ie=Pc(J)?Ve:ee;return ie.test(Us(J))}function hl(J){return pa(J)&&El(J.length)&&!!O[la(J)]}function ll(J){if(!yl(J))return Tt(J);var ie=[];for(var pe in Object(J))Ce.call(J,pe)&&pe!="constructor"&&ie.push(pe);return ie}function Cc(J,ie,pe,ke,Xt,bt){var or=pe&n,Er=J.length,Ft=ie.length;if(Er!=Ft&&!(or&&Ft>Er))return!1;var er=bt.get(J);if(er&&bt.get(ie))return er==ie;var yr=-1,Ci=!0,Ar=pe&s?new Mi:void 0;for(bt.set(J,ie),bt.set(ie,J);++yr<Er;){var ar=J[yr],hi=ie[yr];if(ke)var Nn=or?ke(hi,ar,yr,ie,J,bt):ke(ar,hi,yr,J,ie,bt);if(Nn!==void 0){if(Nn)continue;Ci=!1;break}if(Ar){if(!Re(ie,function(on,ys){if(!Ne(Ar,ys)&&(ar===on||Xt(ar,on,pe,ke,bt)))return Ar.push(ys)})){Ci=!1;break}}else if(!(ar===hi||Xt(ar,hi,pe,ke,bt))){Ci=!1;break}}return bt.delete(J),bt.delete(ie),Ci}function Ep(J,ie,pe,ke,Xt,bt,or){switch(pe){case y:if(J.byteLength!=ie.byteLength||J.byteOffset!=ie.byteOffset)return!1;J=J.buffer,ie=ie.buffer;case T:return!(J.byteLength!=ie.byteLength||!bt(new pt(J),new pt(ie)));case b:case w:case K:return wl(+J,+ie);case I:return J.name==ie.name&&J.message==ie.message;case k:case _:return J==ie+"";case L:var Er=be;case z:var Ft=ke&n;if(Er||(Er=Te),J.size!=ie.size&&!Ft)return!1;var er=or.get(J);if(er)return er==ie;ke|=s,or.set(J,ie);var yr=Cc(Er(J),Er(ie),ke,Xt,bt,or);return or.delete(J),yr;case B:if(Fe)return Fe.call(J)==Fe.call(ie)}return!1}function dl(J,ie,pe,ke,Xt,bt){var or=pe&n,Er=Dc(J),Ft=Er.length,er=Dc(ie),yr=er.length;if(Ft!=yr&&!or)return!1;for(var Ci=Ft;Ci--;){var Ar=Er[Ci];if(!(or?Ar in ie:Ce.call(ie,Ar)))return!1}var ar=bt.get(J);if(ar&&bt.get(ie))return ar==ie;var hi=!0;bt.set(J,ie),bt.set(ie,J);for(var Nn=or;++Ci<Ft;){Ar=Er[Ci];var on=J[Ar],ys=ie[Ar];if(ke)var rf=or?ke(ys,on,Ar,ie,J,bt):ke(on,ys,Ar,J,ie,bt);if(!(rf===void 0?on===ys||Xt(on,ys,pe,ke,bt):rf)){hi=!1;break}Nn||(Nn=Ar=="constructor")}if(hi&&!Nn){var ga=J.constructor,Tr=ie.constructor;ga!=Tr&&"constructor"in J&&"constructor"in ie&&!(typeof ga=="function"&&ga instanceof ga&&typeof Tr=="function"&&Tr instanceof Tr)&&(hi=!1)}return bt.delete(J),bt.delete(ie),hi}function Dc(J){return Xu(J,Ip,gl)}function bo(J,ie){var pe=J.__data__;return ml(ie)?pe[typeof ie=="string"?"string":"hash"]:pe.map}function ki(J,ie){var pe=Me(J,ie);return _p(pe)?pe:void 0}function pl(J){var ie=Ce.call(J,gt),pe=J[gt];try{J[gt]=void 0;var ke=!0}catch{}var Xt=Ke.call(J);return ke&&(ie?J[gt]=pe:delete J[gt]),Xt}var gl=Je?function(J){return J==null?[]:(J=Object(J),ye(Je(J),function(ie){return Ge.call(J,ie)}))}:Zt,bs=la;(Le&&bs(new Le(new ArrayBuffer(1)))!=y||et&&bs(new et)!=L||it&&bs(it.resolve())!=W||Be&&bs(new Be)!=z||rt&&bs(new rt)!=re)&&(bs=function(J){var ie=la(J),pe=ie==U?J.constructor:void 0,ke=pe?Us(pe):"";if(ke)switch(ke){case je:return y;case ht:return L;case nt:return W;case qe:return z;case st:return re}return ie});function vl(J,ie){return ie=ie??a,!!ie&&(typeof J=="number"||ae.test(J))&&J>-1&&J%1==0&&J<ie}function ml(J){var ie=typeof J;return ie=="string"||ie=="number"||ie=="symbol"||ie=="boolean"?J!=="__proto__":J===null}function bl(J){return!!_e&&_e in J}function yl(J){var ie=J&&J.constructor,pe=typeof ie=="function"&&ie.prototype||xe;return J===pe}function Ap(J){return Ke.call(J)}function Us(J){if(J!=null){try{return Ue.call(J)}catch{}try{return J+""}catch{}}return""}function wl(J,ie){return J===ie||J!==J&&ie!==ie}var _l=ef(function(){return arguments}())?ef:function(J){return pa(J)&&Ce.call(J,"callee")&&!Ge.call(J,"callee")},Oc=Array.isArray;function xp(J){return J!=null&&El(J.length)&&!Pc(J)}var tf=Ot||Qt;function Sp(J,ie){return da(J,ie)}function Pc(J){if(!Al(J))return!1;var ie=la(J);return ie==S||ie==D||ie==d||ie==R}function El(J){return typeof J=="number"&&J>-1&&J%1==0&&J<=a}function Al(J){var ie=typeof J;return J!=null&&(ie=="object"||ie=="function")}function pa(J){return J!=null&&typeof J=="object"}var xl=he?Oe(he):hl;function Ip(J){return xp(J)?ul(J):ll(J)}function Zt(){return[]}function Qt(){return!1}t.exports=Sp})(Vd,Vd.exports);var aD=Vd.exports,cD=Object.defineProperty,Vb=Object.getOwnPropertySymbols,uD=Object.prototype.hasOwnProperty,fD=Object.prototype.propertyIsEnumerable,Gb=(t,e,r)=>e in t?cD(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ui=(t,e)=>{for(var r in e||(e={}))uD.call(e,r)&&Gb(t,r,e[r]);if(Vb)for(var r of Vb(e))fD.call(e,r)&&Gb(t,r,e[r]);return t};function hD(t,e){if(t.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),i=0;i<r.length;i++)r[i]=255;for(var n=0;n<t.length;n++){var s=t.charAt(n),a=s.charCodeAt(0);if(r[a]!==255)throw new TypeError(s+" is ambiguous");r[a]=n}var u=t.length,l=t.charAt(0),d=Math.log(u)/Math.log(256),b=Math.log(256)/Math.log(u);function w(D){if(D instanceof Uint8Array||(ArrayBuffer.isView(D)?D=new Uint8Array(D.buffer,D.byteOffset,D.byteLength):Array.isArray(D)&&(D=Uint8Array.from(D))),!(D instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(D.length===0)return"";for(var L=0,K=0,H=0,U=D.length;H!==U&&D[H]===0;)H++,L++;for(var W=(U-H)*b+1>>>0,R=new Uint8Array(W);H!==U;){for(var k=D[H],z=0,_=W-1;(k!==0||z<K)&&_!==-1;_--,z++)k+=256*R[_]>>>0,R[_]=k%u>>>0,k=k/u>>>0;if(k!==0)throw new Error("Non-zero carry");K=z,H++}for(var B=W-K;B!==W&&R[B]===0;)B++;for(var X=l.repeat(L);B<W;++B)X+=t.charAt(R[B]);return X}function I(D){if(typeof D!="string")throw new TypeError("Expected String");if(D.length===0)return new Uint8Array;var L=0;if(D[L]!==" "){for(var K=0,H=0;D[L]===l;)K++,L++;for(var U=(D.length-L)*d+1>>>0,W=new Uint8Array(U);D[L];){var R=r[D.charCodeAt(L)];if(R===255)return;for(var k=0,z=U-1;(R!==0||k<H)&&z!==-1;z--,k++)R+=u*W[z]>>>0,W[z]=R%256>>>0,R=R/256>>>0;if(R!==0)throw new Error("Non-zero carry");H=k,L++}if(D[L]!==" "){for(var _=U-H;_!==U&&W[_]===0;)_++;for(var B=new Uint8Array(K+(U-_)),X=K;_!==U;)B[X++]=W[_++];return B}}}function S(D){var L=I(D);if(L)return L;throw new Error(`Non-${e} character`)}return{encode:w,decodeUnsafe:I,decode:S}}var lD=hD,dD=lD;const Yb=t=>{if(t instanceof Uint8Array&&t.constructor.name==="Uint8Array")return t;if(t instanceof ArrayBuffer)return new Uint8Array(t);if(ArrayBuffer.isView(t))return new Uint8Array(t.buffer,t.byteOffset,t.byteLength);throw new Error("Unknown type, must be binary type")},pD=t=>new TextEncoder().encode(t),gD=t=>new TextDecoder().decode(t);class vD{constructor(e,r,i){this.name=e,this.prefix=r,this.baseEncode=i}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class mD{constructor(e,r,i){if(this.name=e,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=i}decode(e){if(typeof e=="string"){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(e){return Jb(this,e)}}class bD{constructor(e){this.decoders=e}or(e){return Jb(this,e)}decode(e){const r=e[0],i=this.decoders[r];if(i)return i.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const Jb=(t,e)=>new bD(ui(ui({},t.decoders||{[t.prefix]:t}),e.decoders||{[e.prefix]:e}));class yD{constructor(e,r,i,n){this.name=e,this.prefix=r,this.baseEncode=i,this.baseDecode=n,this.encoder=new vD(e,r,i),this.decoder=new mD(e,r,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}const Ih=({name:t,prefix:e,encode:r,decode:i})=>new yD(t,e,r,i),Mu=({prefix:t,name:e,alphabet:r})=>{const{encode:i,decode:n}=dD(r,e);return Ih({prefix:t,name:e,encode:i,decode:s=>Yb(n(s))})},wD=(t,e,r,i)=>{const n={};for(let b=0;b<e.length;++b)n[e[b]]=b;let s=t.length;for(;t[s-1]==="=";)--s;const a=new Uint8Array(s*r/8|0);let u=0,l=0,d=0;for(let b=0;b<s;++b){const w=n[t[b]];if(w===void 0)throw new SyntaxError(`Non-${i} character`);l=l<<r|w,u+=r,u>=8&&(u-=8,a[d++]=255&l>>u)}if(u>=r||255&l<<8-u)throw new SyntaxError("Unexpected end of data");return a},_D=(t,e,r)=>{const i=e[e.length-1]==="=",n=(1<<r)-1;let s="",a=0,u=0;for(let l=0;l<t.length;++l)for(u=u<<8|t[l],a+=8;a>r;)a-=r,s+=e[n&u>>a];if(a&&(s+=e[n&u<<r-a]),i)for(;s.length*r&7;)s+="=";return s},zr=({name:t,prefix:e,bitsPerChar:r,alphabet:i})=>Ih({prefix:e,name:t,encode(n){return _D(n,i,r)},decode(n){return wD(n,i,r,t)}}),ED=Ih({prefix:"\0",name:"identity",encode:t=>gD(t),decode:t=>pD(t)});var AD=Object.freeze({__proto__:null,identity:ED});const xD=zr({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var SD=Object.freeze({__proto__:null,base2:xD});const ID=zr({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var MD=Object.freeze({__proto__:null,base8:ID});const CD=Mu({prefix:"9",name:"base10",alphabet:"0123456789"});var DD=Object.freeze({__proto__:null,base10:CD});const OD=zr({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),PD=zr({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var $D=Object.freeze({__proto__:null,base16:OD,base16upper:PD});const RD=zr({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ND=zr({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),TD=zr({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),LD=zr({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),BD=zr({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),FD=zr({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),UD=zr({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),kD=zr({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),jD=zr({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var qD=Object.freeze({__proto__:null,base32:RD,base32upper:ND,base32pad:TD,base32padupper:LD,base32hex:BD,base32hexupper:FD,base32hexpad:UD,base32hexpadupper:kD,base32z:jD});const zD=Mu({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),HD=Mu({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var KD=Object.freeze({__proto__:null,base36:zD,base36upper:HD});const WD=Mu({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),VD=Mu({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var GD=Object.freeze({__proto__:null,base58btc:WD,base58flickr:VD});const YD=zr({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),JD=zr({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),QD=zr({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ZD=zr({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var XD=Object.freeze({__proto__:null,base64:YD,base64pad:JD,base64url:QD,base64urlpad:ZD});const Qb=Array.from("\u{1F680}\u{1FA90}\u2604\u{1F6F0}\u{1F30C}\u{1F311}\u{1F312}\u{1F313}\u{1F314}\u{1F315}\u{1F316}\u{1F317}\u{1F318}\u{1F30D}\u{1F30F}\u{1F30E}\u{1F409}\u2600\u{1F4BB}\u{1F5A5}\u{1F4BE}\u{1F4BF}\u{1F602}\u2764\u{1F60D}\u{1F923}\u{1F60A}\u{1F64F}\u{1F495}\u{1F62D}\u{1F618}\u{1F44D}\u{1F605}\u{1F44F}\u{1F601}\u{1F525}\u{1F970}\u{1F494}\u{1F496}\u{1F499}\u{1F622}\u{1F914}\u{1F606}\u{1F644}\u{1F4AA}\u{1F609}\u263A\u{1F44C}\u{1F917}\u{1F49C}\u{1F614}\u{1F60E}\u{1F607}\u{1F339}\u{1F926}\u{1F389}\u{1F49E}\u270C\u2728\u{1F937}\u{1F631}\u{1F60C}\u{1F338}\u{1F64C}\u{1F60B}\u{1F497}\u{1F49A}\u{1F60F}\u{1F49B}\u{1F642}\u{1F493}\u{1F929}\u{1F604}\u{1F600}\u{1F5A4}\u{1F603}\u{1F4AF}\u{1F648}\u{1F447}\u{1F3B6}\u{1F612}\u{1F92D}\u2763\u{1F61C}\u{1F48B}\u{1F440}\u{1F62A}\u{1F611}\u{1F4A5}\u{1F64B}\u{1F61E}\u{1F629}\u{1F621}\u{1F92A}\u{1F44A}\u{1F973}\u{1F625}\u{1F924}\u{1F449}\u{1F483}\u{1F633}\u270B\u{1F61A}\u{1F61D}\u{1F634}\u{1F31F}\u{1F62C}\u{1F643}\u{1F340}\u{1F337}\u{1F63B}\u{1F613}\u2B50\u2705\u{1F97A}\u{1F308}\u{1F608}\u{1F918}\u{1F4A6}\u2714\u{1F623}\u{1F3C3}\u{1F490}\u2639\u{1F38A}\u{1F498}\u{1F620}\u261D\u{1F615}\u{1F33A}\u{1F382}\u{1F33B}\u{1F610}\u{1F595}\u{1F49D}\u{1F64A}\u{1F639}\u{1F5E3}\u{1F4AB}\u{1F480}\u{1F451}\u{1F3B5}\u{1F91E}\u{1F61B}\u{1F534}\u{1F624}\u{1F33C}\u{1F62B}\u26BD\u{1F919}\u2615\u{1F3C6}\u{1F92B}\u{1F448}\u{1F62E}\u{1F646}\u{1F37B}\u{1F343}\u{1F436}\u{1F481}\u{1F632}\u{1F33F}\u{1F9E1}\u{1F381}\u26A1\u{1F31E}\u{1F388}\u274C\u270A\u{1F44B}\u{1F630}\u{1F928}\u{1F636}\u{1F91D}\u{1F6B6}\u{1F4B0}\u{1F353}\u{1F4A2}\u{1F91F}\u{1F641}\u{1F6A8}\u{1F4A8}\u{1F92C}\u2708\u{1F380}\u{1F37A}\u{1F913}\u{1F619}\u{1F49F}\u{1F331}\u{1F616}\u{1F476}\u{1F974}\u25B6\u27A1\u2753\u{1F48E}\u{1F4B8}\u2B07\u{1F628}\u{1F31A}\u{1F98B}\u{1F637}\u{1F57A}\u26A0\u{1F645}\u{1F61F}\u{1F635}\u{1F44E}\u{1F932}\u{1F920}\u{1F927}\u{1F4CC}\u{1F535}\u{1F485}\u{1F9D0}\u{1F43E}\u{1F352}\u{1F617}\u{1F911}\u{1F30A}\u{1F92F}\u{1F437}\u260E\u{1F4A7}\u{1F62F}\u{1F486}\u{1F446}\u{1F3A4}\u{1F647}\u{1F351}\u2744\u{1F334}\u{1F4A3}\u{1F438}\u{1F48C}\u{1F4CD}\u{1F940}\u{1F922}\u{1F445}\u{1F4A1}\u{1F4A9}\u{1F450}\u{1F4F8}\u{1F47B}\u{1F910}\u{1F92E}\u{1F3BC}\u{1F975}\u{1F6A9}\u{1F34E}\u{1F34A}\u{1F47C}\u{1F48D}\u{1F4E3}\u{1F942}"),eO=Qb.reduce((t,e,r)=>(t[r]=e,t),[]),tO=Qb.reduce((t,e,r)=>(t[e.codePointAt(0)]=r,t),[]);function rO(t){return t.reduce((e,r)=>(e+=eO[r],e),"")}function iO(t){const e=[];for(const r of t){const i=tO[r.codePointAt(0)];if(i===void 0)throw new Error(`Non-base256emoji character: ${r}`);e.push(i)}return new Uint8Array(e)}const nO=Ih({prefix:"\u{1F680}",name:"base256emoji",encode:rO,decode:iO});var sO=Object.freeze({__proto__:null,base256emoji:nO}),oO=Xb,Zb=128,aO=127,cO=~aO,uO=Math.pow(2,31);function Xb(t,e,r){e=e||[],r=r||0;for(var i=r;t>=uO;)e[r++]=t&255|Zb,t/=128;for(;t&cO;)e[r++]=t&255|Zb,t>>>=7;return e[r]=t|0,Xb.bytes=r-i+1,e}var fO=Gd,hO=128,e3=127;function Gd(t,i){var r=0,i=i||0,n=0,s=i,a,u=t.length;do{if(s>=u)throw Gd.bytes=0,new RangeError("Could not decode varint");a=t[s++],r+=n<28?(a&e3)<<n:(a&e3)*Math.pow(2,n),n+=7}while(a>=hO);return Gd.bytes=s-i,r}var lO=Math.pow(2,7),dO=Math.pow(2,14),pO=Math.pow(2,21),gO=Math.pow(2,28),vO=Math.pow(2,35),mO=Math.pow(2,42),bO=Math.pow(2,49),yO=Math.pow(2,56),wO=Math.pow(2,63),_O=function(t){return t<lO?1:t<dO?2:t<pO?3:t<gO?4:t<vO?5:t<mO?6:t<bO?7:t<yO?8:t<wO?9:10},EO={encode:oO,decode:fO,encodingLength:_O},t3=EO;const r3=(t,e,r=0)=>(t3.encode(t,e,r),e),i3=t=>t3.encodingLength(t),Yd=(t,e)=>{const r=e.byteLength,i=i3(t),n=i+i3(r),s=new Uint8Array(n+r);return r3(t,s,0),r3(r,s,i),s.set(e,n),new AO(t,r,e,s)};class AO{constructor(e,r,i,n){this.code=e,this.size=r,this.digest=i,this.bytes=n}}const n3=({name:t,code:e,encode:r})=>new xO(t,e,r);class xO{constructor(e,r,i){this.name=e,this.code=r,this.encode=i}digest(e){if(e instanceof Uint8Array){const r=this.encode(e);return r instanceof Uint8Array?Yd(this.code,r):r.then(i=>Yd(this.code,i))}else throw Error("Unknown type, must be binary type")}}const s3=t=>async e=>new Uint8Array(await crypto.subtle.digest(t,e)),SO=n3({name:"sha2-256",code:18,encode:s3("SHA-256")}),IO=n3({name:"sha2-512",code:19,encode:s3("SHA-512")});var MO=Object.freeze({__proto__:null,sha256:SO,sha512:IO});const o3=0,CO="identity",a3=Yb;var DO=Object.freeze({__proto__:null,identity:{code:o3,name:CO,encode:a3,digest:t=>Yd(o3,a3(t))}});new TextEncoder,new TextDecoder;const c3=ui(ui(ui(ui(ui(ui(ui(ui(ui(ui({},AD),SD),MD),DD),$D),qD),KD),GD),XD),sO);ui(ui({},MO),DO);function OO(t=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?globalThis.Buffer.allocUnsafe(t):new Uint8Array(t)}function u3(t,e,r,i){return{name:t,prefix:e,encoder:{name:t,prefix:e,encode:r},decoder:{decode:i}}}const f3=u3("utf8","u",t=>"u"+new TextDecoder("utf8").decode(t),t=>new TextEncoder().encode(t.substring(1))),Jd=u3("ascii","a",t=>{let e="a";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e},t=>{t=t.substring(1);const e=OO(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}),PO=ui({utf8:f3,"utf-8":f3,hex:c3.base16,latin1:Jd,ascii:Jd,binary:Jd},c3);function $O(t,e="utf8"){const r=PO[e];if(!r)throw new Error(`Unsupported encoding "${e}"`);return(e==="utf8"||e==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(t,"utf8"):r.decoder.decode(`${r.prefix}${t}`)}const h3="wc",l3=2,Qd="core",us=`${h3}@2:${Qd}:`,RO={name:Qd,logger:"error"},NO={database:":memory:"},TO="crypto",d3="client_ed25519_seed",LO=Ie.ONE_DAY,BO="keychain",FO="0.3",UO="messages",kO="0.3",jO=Ie.SIX_HOURS,qO="publisher",p3="irn",zO="error",g3="wss://relay.walletconnect.org",HO="relayer",Ei={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",transport_closed:"relayer_transport_closed",publish:"relayer_publish"},KO="_subscription",en={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},WO=.1,v3="2.15.3",VO=1e4,GO="0.3",YO="WALLETCONNECT_CLIENT_ID",fs={created:"subscription_created",deleted:"subscription_deleted",expired:"subscription_expired",disabled:"subscription_disabled",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},JO="subscription",QO="0.3",ZO=Ie.FIVE_SECONDS*1e3,XO="pairing",eP="0.3",Cu={wc_pairingDelete:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:Ie.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:Ie.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:0},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:0}}},oc={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},xn={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},tP="history",rP="0.3",iP="expirer",tn={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},nP="0.3",sP="verify-api",oP="https://verify.walletconnect.com",m3="https://verify.walletconnect.org",Du=m3,aP=`${Du}/v3`,cP=[oP,m3],uP="echo",fP="https://echo.walletconnect.com",hs={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal",subscribing_to_pairing_topic:"subscribing_to_pairing_topic"},Ts={no_wss_connection:"no_wss_connection",no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_expired:"proposal_expired",proposal_listener_not_found:"proposal_listener_not_found"},Sn={session_approve_started:"session_approve_started",proposal_not_expired:"proposal_not_expired",session_namespaces_validation_success:"session_namespaces_validation_success",create_session_topic:"create_session_topic",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},Ko={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},Wo={authenticated_session_approve_started:"authenticated_session_approve_started",authenticated_session_not_expired:"authenticated_session_not_expired",chains_caip2_compliant:"chains_caip2_compliant",chains_evm_compliant:"chains_evm_compliant",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve",authenticated_session_approve_publish_success:"authenticated_session_approve_publish_success"},Ou={no_internet_connection:"no_internet_connection",no_wss_connection:"no_wss_connection",missing_session_authenticate_request:"missing_session_authenticate_request",session_authenticate_request_expired:"session_authenticate_request_expired",chains_caip2_compliant_failure:"chains_caip2_compliant_failure",chains_evm_compliant_failure:"chains_evm_compliant_failure",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},hP=.1,lP="event-client",dP=86400,pP="https://pulse.walletconnect.com/batch";class gP{constructor(e,r){this.core=e,this.logger=r,this.keychain=new Map,this.name=BO,this.version=FO,this.initialized=!1,this.storagePrefix=us,this.init=async()=>{if(!this.initialized){const i=await this.getKeyChain();typeof i<"u"&&(this.keychain=i),this.initialized=!0}},this.has=i=>(this.isInitialized(),this.keychain.has(i)),this.set=async(i,n)=>{this.isInitialized(),this.keychain.set(i,n),await this.persist()},this.get=i=>{this.isInitialized();const n=this.keychain.get(i);if(typeof n>"u"){const{message:s}=Ee("NO_MATCHING_KEY",`${this.name}: ${i}`);throw new Error(s)}return n},this.del=async i=>{this.isInitialized(),this.keychain.delete(i),await this.persist()},this.core=e,this.logger=ci(r,this.name)}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,Fv(e))}async getKeyChain(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Uv(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class vP{constructor(e,r,i){this.core=e,this.logger=r,this.name=TO,this.randomSessionIdentifier=Cd(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=n=>(this.isInitialized(),this.keychain.has(n)),this.getClientId=async()=>{this.isInitialized();const n=await this.getClientSeed(),s=$v(n);return Pv(s.publicKey)},this.generateKeyPair=()=>{this.isInitialized();const n=YS();return this.setPrivateKey(n.publicKey,n.privateKey)},this.signJWT=async n=>{this.isInitialized();const s=await this.getClientSeed(),a=$v(s),u=this.randomSessionIdentifier;return await DE(u,n,LO,a)},this.generateSharedKey=(n,s,a)=>{this.isInitialized();const u=this.getPrivateKey(n),l=JS(u,s);return this.setSymKey(l,a)},this.setSymKey=async(n,s)=>{this.isInitialized();const a=s||hh(n);return await this.keychain.set(a,n),a},this.deleteKeyPair=async n=>{this.isInitialized(),await this.keychain.del(n)},this.deleteSymKey=async n=>{this.isInitialized(),await this.keychain.del(n)},this.encode=async(n,s,a)=>{this.isInitialized();const u=ib(a),l=Is(s);if(nb(u)){const I=u.senderPublicKey,S=u.receiverPublicKey;n=await this.generateSharedKey(I,S)}const d=this.getSymKey(n),{type:b,senderPublicKey:w}=u;return ZS({type:b,symKey:d,message:l,senderPublicKey:w})},this.decode=async(n,s,a)=>{this.isInitialized();const u=tI(s,a);if(nb(u)){const l=u.receiverPublicKey,d=u.senderPublicKey;n=await this.generateSharedKey(l,d)}try{const l=this.getSymKey(n),d=XS({symKey:l,encoded:s});return qa(d)}catch(l){this.logger.error(`Failed to decode message from topic: '${n}', clientId: '${await this.getClientId()}'`),this.logger.error(l)}},this.getPayloadType=n=>{const s=lh(n);return vu(s.type)},this.getPayloadSenderPublicKey=n=>{const s=lh(n);return s.senderPublicKey?bC(s.senderPublicKey,oi):void 0},this.core=e,this.logger=ci(r,this.name),this.keychain=i||new gP(this.core,this.logger)}get context(){return _i(this.logger)}async setPrivateKey(e,r){return await this.keychain.set(e,r),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(d3)}catch{e=Cd(),await this.keychain.set(d3,e)}return $O(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class mP extends sC{constructor(e,r){super(e,r),this.logger=e,this.core=r,this.messages=new Map,this.name=UO,this.version=kO,this.initialized=!1,this.storagePrefix=us,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{const i=await this.getRelayerMessages();typeof i<"u"&&(this.messages=i),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(i){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(i)}finally{this.initialized=!0}}},this.set=async(i,n)=>{this.isInitialized();const s=$s(n);let a=this.messages.get(i);return typeof a>"u"&&(a={}),typeof a[s]<"u"||(a[s]=n,this.messages.set(i,a),await this.persist()),s},this.get=i=>{this.isInitialized();let n=this.messages.get(i);return typeof n>"u"&&(n={}),n},this.has=(i,n)=>{this.isInitialized();const s=this.get(i),a=$s(n);return typeof s[a]<"u"},this.del=async i=>{this.isInitialized(),this.messages.delete(i),await this.persist()},this.logger=ci(e,this.name),this.core=r}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,Fv(e))}async getRelayerMessages(){const e=await this.core.storage.getItem(this.storageKey);return typeof e<"u"?Uv(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class bP extends oC{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.events=new Br.exports.EventEmitter,this.name=qO,this.queue=new Map,this.publishTimeout=Ie.toMiliseconds(Ie.ONE_MINUTE),this.failedPublishTimeout=Ie.toMiliseconds(Ie.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(i,n,s)=>{var a;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:i,message:n,opts:s}});const u=s?.ttl||jO,l=Dd(s),d=s?.prompt||!1,b=s?.tag||0,w=s?.id||Ho().toString(),I={topic:i,message:n,opts:{ttl:u,relay:l,prompt:d,tag:b,id:w,attestation:s?.attestation}},S=`Failed to publish payload, please try again. id:${w} tag:${b}`,D=Date.now();let L,K=1;try{for(;L===void 0;){if(Date.now()-D>this.publishTimeout)throw new Error(S);this.logger.trace({id:w,attempts:K},`publisher.publish - attempt ${K}`),L=await await za(this.rpcPublish(i,n,u,l,d,b,w,s?.attestation).catch(H=>this.logger.warn(H)),this.publishTimeout,S),K++,L||await new Promise(H=>setTimeout(H,this.failedPublishTimeout))}this.relayer.events.emit(Ei.publish,I),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:w,topic:i,message:n,opts:s}})}catch(H){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(H),(a=s?.internal)!=null&&a.throwOnFailedPublish)throw H;this.queue.set(w,I)}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.relayer=e,this.logger=ci(r,this.name),this.registerEventListeners()}get context(){return _i(this.logger)}rpcPublish(e,r,i,n,s,a,u,l){var d,b,w,I;const S={method:mu(n.protocol).publish,params:{topic:e,message:r,ttl:i,prompt:s,tag:a,attestation:l},id:u};return ai((d=S.params)==null?void 0:d.prompt)&&((b=S.params)==null||delete b.prompt),ai((w=S.params)==null?void 0:w.tag)&&((I=S.params)==null||delete I.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:S}),this.relayer.request(S)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{const{topic:r,message:i,opts:n}=e;await this.publish(r,i,n)})}registerEventListeners(){this.relayer.core.heartbeat.on(rc.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(Ei.connection_stalled);return}this.checkQueue()}),this.relayer.on(Ei.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class yP{constructor(){this.map=new Map,this.set=(e,r)=>{const i=this.get(e);this.exists(e,r)||this.map.set(e,[...i,r])},this.get=e=>this.map.get(e)||[],this.exists=(e,r)=>this.get(e).includes(r),this.delete=(e,r)=>{if(typeof r>"u"){this.map.delete(e);return}if(!this.map.has(e))return;const i=this.get(e);if(!this.exists(e,r))return;const n=i.filter(s=>s!==r);if(!n.length){this.map.delete(e);return}this.map.set(e,n)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var wP=Object.defineProperty,_P=Object.defineProperties,EP=Object.getOwnPropertyDescriptors,b3=Object.getOwnPropertySymbols,AP=Object.prototype.hasOwnProperty,xP=Object.prototype.propertyIsEnumerable,y3=(t,e,r)=>e in t?wP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pu=(t,e)=>{for(var r in e||(e={}))AP.call(e,r)&&y3(t,r,e[r]);if(b3)for(var r of b3(e))xP.call(e,r)&&y3(t,r,e[r]);return t},Zd=(t,e)=>_P(t,EP(e));class SP extends uC{constructor(e,r){super(e,r),this.relayer=e,this.logger=r,this.subscriptions=new Map,this.topicMap=new yP,this.events=new Br.exports.EventEmitter,this.name=JO,this.version=QO,this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=us,this.subscribeTimeout=Ie.toMiliseconds(Ie.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}});try{const s=Dd(n),a={topic:i,relay:s};this.pending.set(i,a);const u=await this.rpcSubscribe(i,s);return typeof u=="string"&&(this.onSubscribe(u,a),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:i,opts:n}})),u}catch(s){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(s),s}},this.unsubscribe=async(i,n)=>{await this.restartToComplete(),this.isInitialized(),typeof n?.id<"u"?await this.unsubscribeById(i,n.id,n):await this.unsubscribeByTopic(i,n)},this.isSubscribed=async i=>{if(this.topics.includes(i))return!0;const n=`${this.pendingSubscriptionWatchLabel}_${i}`;return await new Promise((s,a)=>{const u=new Ie.Watch;u.start(n);const l=setInterval(()=>{!this.pending.has(i)&&this.topics.includes(i)&&(clearInterval(l),u.stop(n),s(!0)),u.elapsed(n)>=ZO&&(clearInterval(l),u.stop(n),a(new Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=ci(r,this.name),this.clientId=""}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,r){let i=!1;try{i=this.getSubscription(e).topic===r}catch{}return i}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,r){const i=this.topicMap.get(e);await Promise.all(i.map(async n=>await this.unsubscribeById(e,n,r)))}async unsubscribeById(e,r,i){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:i}});try{const n=Dd(i);await this.rpcUnsubscribe(e,r,n);const s=Gt("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,r,s),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:r,opts:i}})}catch(n){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(n),n}}async rpcSubscribe(e,r){const i={method:mu(r.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await za(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)?$s(e+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(Ei.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;const r=e[0].relay,i={method:mu(r.protocol).batchSubscribe,params:{topics:e.map(n=>n.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});try{return await await za(this.relayer.request(i).catch(n=>this.logger.warn(n)),this.subscribeTimeout)}catch{this.relayer.events.emit(Ei.connection_stalled)}}async rpcBatchFetchMessages(e){if(!e.length)return;const r=e[0].relay,i={method:mu(r.protocol).batchFetchMessages,params:{topics:e.map(s=>s.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let n;try{n=await await za(this.relayer.request(i).catch(s=>this.logger.warn(s)),this.subscribeTimeout)}catch{this.relayer.events.emit(Ei.connection_stalled)}return n}rpcUnsubscribe(e,r,i){const n={method:mu(i.protocol).unsubscribe,params:{topic:e,id:r}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,r){this.setSubscription(e,Zd(Pu({},r),{id:e})),this.pending.delete(r.topic)}onBatchSubscribe(e){e.length&&e.forEach(r=>{this.setSubscription(r.id,Pu({},r)),this.pending.delete(r.topic)})}async onUnsubscribe(e,r,i){this.events.removeAllListeners(r),this.hasSubscription(r,e)&&this.deleteSubscription(r,i),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,r){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:r}),this.addSubscription(e,r)}addSubscription(e,r){this.subscriptions.set(e,Pu({},r)),this.topicMap.set(r.topic,e),this.events.emit(fs.created,r)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});const r=this.subscriptions.get(e);if(!r){const{message:i}=Ee("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return r}deleteSubscription(e,r){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:r});const i=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(i.topic,e),this.events.emit(fs.deleted,Zd(Pu({},i),{reason:r}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(fs.sync)}async reset(){if(this.cached.length){const e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<e;r++){const i=this.cached.splice(0,this.batchSubscribeTopicsLimit);await this.batchFetchMessages(i),await this.batchSubscribe(i)}}this.events.emit(fs.resubscribed)}async restore(){try{const e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){const{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;const r=await this.rpcBatchSubscribe(e);ss(r)&&this.onBatchSubscribe(r.map((i,n)=>Zd(Pu({},e[n]),{id:i})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);const r=await this.rpcBatchFetchMessages(e);r&&r.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(r.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;const e=[];this.pending.forEach(r=>{e.push(r)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(rc.pulse,async()=>{await this.checkPending()}),this.events.on(fs.created,async e=>{const r=fs.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()}),this.events.on(fs.deleted,async e=>{const r=fs.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.restartInProgress||(clearInterval(r),e())},this.pollingInterval)})}}var IP=Object.defineProperty,w3=Object.getOwnPropertySymbols,MP=Object.prototype.hasOwnProperty,CP=Object.prototype.propertyIsEnumerable,_3=(t,e,r)=>e in t?IP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,DP=(t,e)=>{for(var r in e||(e={}))MP.call(e,r)&&_3(t,r,e[r]);if(w3)for(var r of w3(e))CP.call(e,r)&&_3(t,r,e[r]);return t};class OP extends aC{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new Br.exports.EventEmitter,this.name=HO,this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=Ie.toMiliseconds(Ie.THIRTY_SECONDS+Ie.ONE_SECOND),this.request=async r=>{var i,n;this.logger.debug("Publishing Request Payload");const s=r.id||Ho().toString();await this.toEstablishConnection();try{const a=this.provider.request(r);this.requestsInFlight.set(s,{promise:a,request:r}),this.logger.trace({id:s,method:r.method,topic:(i=r.params)==null?void 0:i.topic},"relayer.request - attempt to publish...");const u=await new Promise(async(l,d)=>{const b=()=>{d(new Error(`relayer.request - publish interrupted, id: ${s}`))};this.provider.on(en.disconnect,b);const w=await a;this.provider.off(en.disconnect,b),l(w)});return this.logger.trace({id:s,method:r.method,topic:(n=r.params)==null?void 0:n.topic},"relayer.request - published"),u}catch(a){throw this.logger.debug(`Failed to Publish Request: ${s}`),a}finally{this.requestsInFlight.delete(s)}},this.resetPingTimeout=()=>{if(iu())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var r,i,n;(n=(i=(r=this.provider)==null?void 0:r.connection)==null?void 0:i.socket)==null||n.terminate()},this.heartBeatTimeout)}catch(r){this.logger.warn(r)}},this.onPayloadHandler=r=>{this.onProviderPayload(r),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(Ei.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=r=>{this.logger.error(r),this.events.emit(Ei.error,r),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(en.payload,this.onPayloadHandler),this.provider.on(en.connect,this.onConnectHandler),this.provider.on(en.disconnect,this.onDisconnectHandler),this.provider.on(en.error,this.onProviderErrorHandler)},this.core=e.core,this.logger=typeof e.logger<"u"&&typeof e.logger!="string"?ci(e.logger,this.name):os(Eh({level:e.logger||zO})),this.messages=new mP(this.logger,e.core),this.subscriber=new SP(this,this.logger),this.publisher=new bP(this,this.logger),this.relayUrl=e?.relayUrl||g3,this.projectId=e.projectId,this.bundleId=BE(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),await this.transportOpen(),this.initialized=!0,setTimeout(async()=>{this.subscriber.topics.length===0&&this.subscriber.pending.size===0&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},VO)}get context(){return _i(this.logger)}get connected(){var e,r,i;return((i=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:i.readyState)===1}get connecting(){var e,r,i;return((i=(r=(e=this.provider)==null?void 0:e.connection)==null?void 0:r.socket)==null?void 0:i.readyState)===0}async publish(e,r,i){this.isInitialized(),await this.publisher.publish(e,r,i),await this.recordMessageEvent({topic:e,message:r,publishedAt:Date.now()})}async subscribe(e,r){var i;this.isInitialized();let n=((i=this.subscriber.topicMap.get(e))==null?void 0:i[0])||"",s;const a=u=>{u.topic===e&&(this.subscriber.off(fs.created,a),s())};return await Promise.all([new Promise(u=>{s=u,this.subscriber.on(fs.created,a)}),new Promise(async u=>{n=await this.subscriber.subscribe(e,r)||n,u()})]),n}async unsubscribe(e,r){this.isInitialized(),await this.subscriber.unsubscribe(e,r)}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await za(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(r,i)=>{const n=()=>{this.provider.off(en.disconnect,n),i(new Error("Connection interrupted while trying to subscribe"))};this.provider.on(en.disconnect,n),await za(this.provider.connect(),Ie.toMiliseconds(Ie.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(s=>{i(s)}).finally(()=>{clearTimeout(this.reconnectTimeout),this.reconnectTimeout=void 0}),this.subscriber.start().catch(s=>{this.logger.error(s),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,r()})}catch(r){this.logger.error(r);const i=r;if(this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(i.message))throw r}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await vb())throw new Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}const r=e.sort((i,n)=>i.publishedAt-n.publishedAt);this.logger.trace(`Batch of ${r.length} message events sorted`);for(const i of r)try{await this.onMessageEvent(i)}catch(n){this.logger.warn(n)}this.logger.trace(`Batch of ${r.length} message events processed`)}startPingTimeout(){var e,r,i,n,s;if(iu())try{(r=(e=this.provider)==null?void 0:e.connection)!=null&&r.socket&&((s=(n=(i=this.provider)==null?void 0:i.connection)==null?void 0:n.socket)==null||s.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(a){this.logger.warn(a)}}isConnectionStalled(e){return this.staleConnectionErrors.some(r=>e.includes(r))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();const e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new An(new oD(zE({sdkVersion:v3,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){const{topic:r,message:i}=e;await this.messages.set(r,i)}async shouldIgnoreMessageEvent(e){const{topic:r,message:i}=e;if(!i||i.length===0)return this.logger.debug(`Ignoring invalid/empty message: ${i}`),!0;if(!await this.subscriber.isSubscribed(r))return this.logger.debug(`Ignoring message for non-subscribed topic ${r}`),!0;const n=this.messages.has(r,i);return n&&this.logger.debug(`Ignoring duplicate message: ${i}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),Wd(e)){if(!e.method.endsWith(KO))return;const r=e.params,{topic:i,message:n,publishedAt:s,attestation:a}=r.data,u={topic:i,message:n,publishedAt:s,attestation:a};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(DP({type:"event",event:r.id},u)),this.events.emit(r.id,u),await this.acknowledgePayload(e),await this.onMessageEvent(u)}else Sh(e)&&this.events.emit(Ei.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(Ei.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){const r=Ah(e.id,!0);await this.provider.connection.send(r)}unregisterProviderListeners(){this.provider.off(en.payload,this.onPayloadHandler),this.provider.off(en.connect,this.onConnectHandler),this.provider.off(en.disconnect,this.onDisconnectHandler),this.provider.off(en.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await vb();YI(async r=>{e!==r&&(e=r,r?await this.restartTransport().catch(i=>this.logger.error(i)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(Ei.disconnect),this.connectionAttemptInProgress=!1,!this.transportExplicitlyClosed&&(this.reconnectTimeout||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},Ie.toMiliseconds(WO))))}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),!this.connected&&(this.connectionAttemptInProgress&&await new Promise(e=>{const r=setInterval(()=>{this.connected&&(clearInterval(r),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var PP=Object.defineProperty,E3=Object.getOwnPropertySymbols,$P=Object.prototype.hasOwnProperty,RP=Object.prototype.propertyIsEnumerable,A3=(t,e,r)=>e in t?PP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x3=(t,e)=>{for(var r in e||(e={}))$P.call(e,r)&&A3(t,r,e[r]);if(E3)for(var r of E3(e))RP.call(e,r)&&A3(t,r,e[r]);return t};class Vo extends cC{constructor(e,r,i,n=us,s=void 0){super(e,r,i,n),this.core=e,this.logger=r,this.name=i,this.map=new Map,this.version=GO,this.cached=[],this.initialized=!1,this.storagePrefix=us,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(a=>{this.getKey&&a!==null&&!ai(a)?this.map.set(this.getKey(a),a):II(a)?this.map.set(a.id,a):MI(a)&&this.map.set(a.topic,a)}),this.cached=[],this.initialized=!0)},this.set=async(a,u)=>{this.isInitialized(),this.map.has(a)?await this.update(a,u):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:a,value:u}),this.map.set(a,u),await this.persist())},this.get=a=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:a}),this.getData(a)),this.getAll=a=>(this.isInitialized(),a?this.values.filter(u=>Object.keys(a).every(l=>aD(u[l],a[l]))):this.values),this.update=async(a,u)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:a,update:u});const l=x3(x3({},this.getData(a)),u);this.map.set(a,l),await this.persist()},this.delete=async(a,u)=>{this.isInitialized(),this.map.has(a)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:a,reason:u}),this.map.delete(a),this.addToRecentlyDeleted(a),await this.persist())},this.logger=ci(r,this.name),this.storagePrefix=n,this.getKey=s}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){const r=this.map.get(e);if(!r){if(this.recentlyDeleted.includes(e)){const{message:n}=Ee("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(n),new Error(n)}const{message:i}=Ee("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(i),new Error(i)}return r}async persist(){await this.setDataStore(this.values)}async restore(){try{const e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){const{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class NP{constructor(e,r){this.core=e,this.logger=r,this.name=XO,this.version=eP,this.events=new Br.exports,this.initialized=!1,this.storagePrefix=us,this.ignoredPayloadTypes=[Ps],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:i})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...i])]},this.create=async i=>{this.isInitialized();const n=Cd(),s=await this.core.crypto.setSymKey(n),a=kr(Ie.FIVE_MINUTES),u={protocol:p3},l={topic:s,expiry:a,relay:u,active:!1},d=vI({protocol:this.core.protocol,version:this.core.version,topic:s,symKey:n,relay:u,expiryTimestamp:a,methods:i?.methods});return this.core.expirer.set(s,a),await this.pairings.set(s,l),await this.core.relayer.subscribe(s),{topic:s,uri:d}},this.pair=async i=>{this.isInitialized();const n=this.core.eventClient.createEvent({properties:{topic:i?.uri,trace:[hs.pairing_started]}});this.isValidPair(i,n);const{topic:s,symKey:a,relay:u,expiryTimestamp:l,methods:d}=cb(i.uri);n.props.properties.topic=s,n.addTrace(hs.pairing_uri_validation_success),n.addTrace(hs.pairing_uri_not_expired);let b;if(this.pairings.keys.includes(s)){if(b=this.pairings.get(s),n.addTrace(hs.existing_pairing),b.active)throw n.setError(Ts.active_pairing_already_exists),new Error(`Pairing already exists: ${s}. Please try again with a new connection URI.`);n.addTrace(hs.pairing_not_expired)}const w=l||kr(Ie.FIVE_MINUTES),I={topic:s,relay:u,expiry:w,active:!1,methods:d};this.core.expirer.set(s,w),await this.pairings.set(s,I),n.addTrace(hs.store_new_pairing),i.activatePairing&&await this.activate({topic:s}),this.events.emit(oc.create,I),n.addTrace(hs.emit_inactive_pairing),this.core.crypto.keychain.has(s)||await this.core.crypto.setSymKey(a,s),n.addTrace(hs.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{n.setError(Ts.no_internet_connection)}try{await this.core.relayer.subscribe(s,{relay:u})}catch(S){throw n.setError(Ts.subscribe_pairing_topic_failure),S}return n.addTrace(hs.subscribe_pairing_topic_success),I},this.activate=async({topic:i})=>{this.isInitialized();const n=kr(Ie.THIRTY_DAYS);this.core.expirer.set(i,n),await this.pairings.update(i,{active:!0,expiry:n})},this.ping=async i=>{this.isInitialized(),await this.isValidPing(i);const{topic:n}=i;if(this.pairings.keys.includes(n)){const s=await this.sendRequest(n,"wc_pairingPing",{}),{done:a,resolve:u,reject:l}=Fo();this.events.once(Dt("pairing_ping",s),({error:d})=>{d?l(d):u()}),await a()}},this.updateExpiry=async({topic:i,expiry:n})=>{this.isInitialized(),await this.pairings.update(i,{expiry:n})},this.updateMetadata=async({topic:i,metadata:n})=>{this.isInitialized(),await this.pairings.update(i,{peerMetadata:n})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async i=>{this.isInitialized(),await this.isValidDisconnect(i);const{topic:n}=i;this.pairings.keys.includes(n)&&(await this.sendRequest(n,"wc_pairingDelete",Gt("USER_DISCONNECTED")),await this.deletePairing(n))},this.sendRequest=async(i,n,s)=>{const a=sc(n,s),u=await this.core.crypto.encode(i,a),l=Cu[n].req;return this.core.history.set(i,a),this.core.relayer.publish(i,u,l),a.id},this.sendResult=async(i,n,s)=>{const a=Ah(i,s),u=await this.core.crypto.encode(n,a),l=await this.core.history.get(n,i),d=Cu[l.request.method].res;await this.core.relayer.publish(n,u,d),await this.core.history.resolve(a)},this.sendError=async(i,n,s)=>{const a=xh(i,s),u=await this.core.crypto.encode(n,a),l=await this.core.history.get(n,i),d=Cu[l.request.method]?Cu[l.request.method].res:Cu.unregistered_method.res;await this.core.relayer.publish(n,u,d),await this.core.history.resolve(a)},this.deletePairing=async(i,n)=>{await this.core.relayer.unsubscribe(i),await Promise.all([this.pairings.delete(i,Gt("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(i),n?Promise.resolve():this.core.expirer.del(i)])},this.cleanup=async()=>{const i=this.pairings.getAll().filter(n=>eo(n.expiry));await Promise.all(i.map(n=>this.deletePairing(n.topic)))},this.onRelayEventRequest=i=>{const{topic:n,payload:s}=i;switch(s.method){case"wc_pairingPing":return this.onPairingPingRequest(n,s);case"wc_pairingDelete":return this.onPairingDeleteRequest(n,s);default:return this.onUnknownRpcMethodRequest(n,s)}},this.onRelayEventResponse=async i=>{const{topic:n,payload:s}=i,a=(await this.core.history.get(n,s.id)).request.method;switch(a){case"wc_pairingPing":return this.onPairingPingResponse(n,s);default:return this.onUnknownRpcMethodResponse(a)}},this.onPairingPingRequest=async(i,n)=>{const{id:s}=n;try{this.isValidPing({topic:i}),await this.sendResult(s,i,!0),this.events.emit(oc.ping,{id:s,topic:i})}catch(a){await this.sendError(s,i,a),this.logger.error(a)}},this.onPairingPingResponse=(i,n)=>{const{id:s}=n;setTimeout(()=>{cs(n)?this.events.emit(Dt("pairing_ping",s),{}):Xi(n)&&this.events.emit(Dt("pairing_ping",s),{error:n.error})},500)},this.onPairingDeleteRequest=async(i,n)=>{const{id:s}=n;try{this.isValidDisconnect({topic:i}),await this.deletePairing(i),this.events.emit(oc.delete,{id:s,topic:i})}catch(a){await this.sendError(s,i,a),this.logger.error(a)}},this.onUnknownRpcMethodRequest=async(i,n)=>{const{id:s,method:a}=n;try{if(this.registeredMethods.includes(a))return;const u=Gt("WC_METHOD_UNSUPPORTED",a);await this.sendError(s,i,u),this.logger.error(u)}catch(u){await this.sendError(s,i,u),this.logger.error(u)}},this.onUnknownRpcMethodResponse=i=>{this.registeredMethods.includes(i)||this.logger.error(Gt("WC_METHOD_UNSUPPORTED",i))},this.isValidPair=(i,n)=>{var s;if(!yi(i)){const{message:u}=Ee("MISSING_OR_INVALID",`pair() params: ${i}`);throw n.setError(Ts.malformed_pairing_uri),new Error(u)}if(!SI(i.uri)){const{message:u}=Ee("MISSING_OR_INVALID",`pair() uri: ${i.uri}`);throw n.setError(Ts.malformed_pairing_uri),new Error(u)}const a=cb(i?.uri);if(!((s=a?.relay)!=null&&s.protocol)){const{message:u}=Ee("MISSING_OR_INVALID","pair() uri#relay-protocol");throw n.setError(Ts.malformed_pairing_uri),new Error(u)}if(!(a!=null&&a.symKey)){const{message:u}=Ee("MISSING_OR_INVALID","pair() uri#symKey");throw n.setError(Ts.malformed_pairing_uri),new Error(u)}if(a!=null&&a.expiryTimestamp&&Ie.toMiliseconds(a?.expiryTimestamp)<Date.now()){n.setError(Ts.pairing_expired);const{message:u}=Ee("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw new Error(u)}},this.isValidPing=async i=>{if(!yi(i)){const{message:s}=Ee("MISSING_OR_INVALID",`ping() params: ${i}`);throw new Error(s)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidDisconnect=async i=>{if(!yi(i)){const{message:s}=Ee("MISSING_OR_INVALID",`disconnect() params: ${i}`);throw new Error(s)}const{topic:n}=i;await this.isValidPairingTopic(n)},this.isValidPairingTopic=async i=>{if(!mr(i,!1)){const{message:n}=Ee("MISSING_OR_INVALID",`pairing topic should be a string: ${i}`);throw new Error(n)}if(!this.pairings.keys.includes(i)){const{message:n}=Ee("NO_MATCHING_KEY",`pairing topic doesn't exist: ${i}`);throw new Error(n)}if(eo(this.pairings.get(i).expiry)){await this.deletePairing(i);const{message:n}=Ee("EXPIRED",`pairing topic: ${i}`);throw new Error(n)}},this.core=e,this.logger=ci(r,this.name),this.pairings=new Vo(this.core,this.logger,this.name,this.storagePrefix)}get context(){return _i(this.logger)}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}registerRelayerEvents(){this.core.relayer.on(Ei.message,async e=>{const{topic:r,message:i}=e;if(!this.pairings.keys.includes(r)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(i)))return;const n=await this.core.crypto.decode(r,i);try{Wd(n)?(this.core.history.set(r,n),this.onRelayEventRequest({topic:r,payload:n})):Sh(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:r,payload:n}),this.core.history.delete(r,n.id))}catch(s){this.logger.error(s)}})}registerExpirerEvents(){this.core.expirer.on(tn.expired,async e=>{const{topic:r}=jv(e.target);r&&this.pairings.keys.includes(r)&&(await this.deletePairing(r,!0),this.events.emit(oc.expire,{topic:r}))})}}class TP extends nC{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.records=new Map,this.events=new Br.exports.EventEmitter,this.name=tP,this.version=rP,this.cached=[],this.initialized=!1,this.storagePrefix=us,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.records.set(i.id,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(i,n,s)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:i,request:n,chainId:s}),this.records.has(n.id))return;const a={id:n.id,topic:i,request:{method:n.method,params:n.params||null},chainId:s,expiry:kr(Ie.THIRTY_DAYS)};this.records.set(a.id,a),this.persist(),this.events.emit(xn.created,a)},this.resolve=async i=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:i}),!this.records.has(i.id))return;const n=await this.getRecord(i.id);typeof n.response>"u"&&(n.response=Xi(i)?{error:i.error}:{result:i.result},this.records.set(n.id,n),this.persist(),this.events.emit(xn.updated,n))},this.get=async(i,n)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:i,id:n}),await this.getRecord(n)),this.delete=(i,n)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:n}),this.values.forEach(s=>{if(s.topic===i){if(typeof n<"u"&&s.id!==n)return;this.records.delete(s.id),this.events.emit(xn.deleted,s)}}),this.persist()},this.exists=async(i,n)=>(this.isInitialized(),this.records.has(n)?(await this.getRecord(n)).topic===i:!1),this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=ci(r,this.name)}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){const e=[];return this.values.forEach(r=>{if(typeof r.response<"u")return;const i={topic:r.topic,request:sc(r.request.method,r.request.params,r.id),chainId:r.chainId};return e.push(i)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();const r=this.records.get(e);if(!r){const{message:i}=Ee("NO_MATCHING_KEY",`${this.name}: ${e}`);throw new Error(i)}return r}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(xn.sync)}async restore(){try{const e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){const{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(xn.created,e=>{const r=xn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xn.updated,e=>{const r=xn.updated;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.events.on(xn.deleted,e=>{const r=xn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,record:e})}),this.core.heartbeat.on(rc.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(r=>{Ie.toMiliseconds(r.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${r.id}`),this.records.delete(r.id),this.events.emit(xn.deleted,r,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}class LP extends fC{constructor(e,r){super(e,r),this.core=e,this.logger=r,this.expirations=new Map,this.events=new Br.exports.EventEmitter,this.name=iP,this.version=nP,this.cached=[],this.initialized=!1,this.storagePrefix=us,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(i=>this.expirations.set(i.target,i)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=i=>{try{const n=this.formatTarget(i);return typeof this.getExpiration(n)<"u"}catch{return!1}},this.set=(i,n)=>{this.isInitialized();const s=this.formatTarget(i),a={target:s,expiry:n};this.expirations.set(s,a),this.checkExpiry(s,a),this.events.emit(tn.created,{target:s,expiration:a})},this.get=i=>{this.isInitialized();const n=this.formatTarget(i);return this.getExpiration(n)},this.del=i=>{if(this.isInitialized(),this.has(i)){const n=this.formatTarget(i),s=this.getExpiration(n);this.expirations.delete(n),this.events.emit(tn.deleted,{target:n,expiration:s})}},this.on=(i,n)=>{this.events.on(i,n)},this.once=(i,n)=>{this.events.once(i,n)},this.off=(i,n)=>{this.events.off(i,n)},this.removeListener=(i,n)=>{this.events.removeListener(i,n)},this.logger=ci(r,this.name)}get context(){return _i(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if(typeof e=="string")return HE(e);if(typeof e=="number")return KE(e);const{message:r}=Ee("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw new Error(r)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(tn.sync)}async restore(){try{const e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){const{message:r}=Ee("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(r),new Error(r)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){const r=this.expirations.get(e);if(!r){const{message:i}=Ee("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(i),new Error(i)}return r}checkExpiry(e,r){const{expiry:i}=r;Ie.toMiliseconds(i)-Date.now()<=0&&this.expire(e,r)}expire(e,r){this.expirations.delete(e),this.events.emit(tn.expired,{target:e,expiration:r})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,r)=>this.checkExpiry(r,e))}registerEventListeners(){this.core.heartbeat.on(rc.pulse,()=>this.checkExpirations()),this.events.on(tn.created,e=>{const r=tn.created;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(tn.expired,e=>{const r=tn.expired;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()}),this.events.on(tn.deleted,e=>{const r=tn.deleted;this.logger.info(`Emitting ${r}`),this.logger.debug({type:"event",event:r,data:e}),this.persist()})}isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}}}var sr={};Object.defineProperty(sr,"__esModule",{value:!0}),sr.getLocalStorage=sr.getLocalStorageOrThrow=sr.getCrypto=sr.getCryptoOrThrow=sr.getLocation=sr.getLocationOrThrow=sr.getNavigator=sr.getNavigatorOrThrow=S3=sr.getDocument=sr.getDocumentOrThrow=sr.getFromWindowOrThrow=sr.getFromWindow=void 0;function Go(t){let e;return typeof window<"u"&&typeof window[t]<"u"&&(e=window[t]),e}sr.getFromWindow=Go;function ac(t){const e=Go(t);if(!e)throw new Error(`${t} is not defined in Window`);return e}sr.getFromWindowOrThrow=ac;function BP(){return ac("document")}sr.getDocumentOrThrow=BP;function FP(){return Go("document")}var S3=sr.getDocument=FP;function UP(){return ac("navigator")}sr.getNavigatorOrThrow=UP;function kP(){return Go("navigator")}sr.getNavigator=kP;function jP(){return ac("location")}sr.getLocationOrThrow=jP;function qP(){return Go("location")}sr.getLocation=qP;function zP(){return ac("crypto")}sr.getCryptoOrThrow=zP;function HP(){return Go("crypto")}sr.getCrypto=HP;function KP(){return ac("localStorage")}sr.getLocalStorageOrThrow=KP;function WP(){return Go("localStorage")}sr.getLocalStorage=WP;class VP extends hC{constructor(e,r,i){super(e,r,i),this.core=e,this.logger=r,this.store=i,this.name=sP,this.verifyUrlV3=aP,this.storagePrefix=us,this.version=l3,this.init=async()=>{var n;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&Ie.toMiliseconds((n=this.publicKey)==null?void 0:n.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))},this.register=async n=>{if(!su()||this.isDevEnv)return;const s=window.location.origin,{id:a,decryptedId:u}=n,l=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${s}&id=${a}&decryptedId=${u}`;try{const d=S3(),b=this.startAbortTimer(Ie.ONE_SECOND*5),w=await new Promise((I,S)=>{const D=()=>{window.removeEventListener("message",K),d.body.removeChild(L),S("attestation aborted")};this.abortController.signal.addEventListener("abort",D);const L=d.createElement("iframe");L.src=l,L.style.display="none",L.addEventListener("error",D,{signal:this.abortController.signal});const K=H=>{if(!H.data)return;const U=JSON.parse(H.data);if(U.type==="verify_attestation"){if(Z0(U.attestation).payload.id!==a)return;clearInterval(b),d.body.removeChild(L),this.abortController.signal.removeEventListener("abort",D),window.removeEventListener("message",K),I(U.attestation===null?"":U.attestation)}};d.body.appendChild(L),window.addEventListener("message",K,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",w),w}catch(d){this.logger.warn(d)}return""},this.resolve=async n=>{if(this.isDevEnv)return"";const{attestationId:s,hash:a,encryptedId:u}=n;if(s===""){this.logger.debug("resolve: attestationId is empty, skipping");return}if(s){if(Z0(s).payload.id!==u)return;const d=await this.isValidJwtAttestation(s);if(d){if(!d.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return d}}if(!a)return;const l=this.getVerifyUrl(n?.verifyUrl);return this.fetchAttestation(a,l)},this.fetchAttestation=async(n,s)=>{this.logger.debug(`resolving attestation: ${n} from url: ${s}`);const a=this.startAbortTimer(Ie.ONE_SECOND*5),u=await fetch(`${s}/attestation/${n}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(a),u.status===200?await u.json():void 0},this.getVerifyUrl=n=>{let s=n||Du;return cP.includes(s)||(this.logger.info(`verify url: ${s}, not included in trusted list, assigning default: ${Du}`),s=Du),s},this.fetchPublicKey=async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);const n=this.startAbortTimer(Ie.FIVE_SECONDS),s=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(n),await s.json()}catch(n){this.logger.warn(n)}},this.persistPublicKey=async n=>{this.logger.debug("persisting public key to local storage",n),await this.store.setItem(this.storeKey,n),this.publicKey=n},this.removePublicKey=async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0},this.isValidJwtAttestation=async n=>{const s=await this.getPublicKey();try{if(s)return this.validateAttestation(n,s)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}const a=await this.fetchAndPersistPublicKey();try{if(a)return this.validateAttestation(n,a)}catch(u){this.logger.error(u),this.logger.warn("error validating attestation")}},this.getPublicKey=async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey(),this.fetchAndPersistPublicKey=async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async s=>{const a=await this.fetchPublicKey();a&&(await this.persistPublicKey(a),s(a))});const n=await this.fetchPromise;return this.fetchPromise=void 0,n},this.validateAttestation=(n,s)=>{const a=sI(n,s.publicKey),u={hasExpired:Ie.toMiliseconds(a.exp)<Date.now(),payload:a};if(u.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),new Error("JWT attestation expired");return{origin:u.payload.origin,isScam:u.payload.isScam,isVerified:u.payload.isVerified}},this.logger=ci(r,this.name),this.abortController=new AbortController,this.isDevEnv=iu()&&process.env.IS_VITEST,this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return _i(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),Ie.toMiliseconds(e))}}class GP extends lC{constructor(e,r){super(e,r),this.projectId=e,this.logger=r,this.context=uP,this.registerDeviceToken=async i=>{const{clientId:n,token:s,notificationType:a,enableEncrypted:u=!1}=i,l=`${fP}/${this.projectId}/clients`;await fetch(l,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:n,type:a,token:s,always_raw:u})})},this.logger=ci(r,this.context)}}var YP=Object.defineProperty,I3=Object.getOwnPropertySymbols,JP=Object.prototype.hasOwnProperty,QP=Object.prototype.propertyIsEnumerable,M3=(t,e,r)=>e in t?YP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,$u=(t,e)=>{for(var r in e||(e={}))JP.call(e,r)&&M3(t,r,e[r]);if(I3)for(var r of I3(e))QP.call(e,r)&&M3(t,r,e[r]);return t};class ZP extends dC{constructor(e,r,i=!0){super(e,r,i),this.core=e,this.logger=r,this.context=lP,this.storagePrefix=us,this.storageVersion=hP,this.events=new Map,this.shouldPersist=!1,this.createEvent=n=>{const{event:s="ERROR",type:a="",properties:{topic:u,trace:l}}=n,d=GE(),b=this.core.projectId||"",w=Date.now(),I=$u({eventId:d,bundleId:b,timestamp:w,props:{event:s,type:a,properties:{topic:u,trace:l}}},this.setMethods(d));return this.telemetryEnabled&&(this.events.set(d,I),this.shouldPersist=!0),I},this.getEvent=n=>{const{eventId:s,topic:a}=n;if(s)return this.events.get(s);const u=Array.from(this.events.values()).find(l=>l.props.properties.topic===a);if(u)return $u($u({},u),this.setMethods(u.eventId))},this.deleteEvent=n=>{const{eventId:s}=n;this.events.delete(s),this.shouldPersist=!0},this.setEventListeners=()=>{this.core.heartbeat.on(rc.pulse,async()=>{this.shouldPersist&&await this.persist(),this.events.forEach(n=>{Ie.fromMiliseconds(Date.now())-Ie.fromMiliseconds(n.timestamp)>dP&&(this.events.delete(n.eventId),this.shouldPersist=!0)})})},this.setMethods=n=>({addTrace:s=>this.addTrace(n,s),setError:s=>this.setError(n,s)}),this.addTrace=(n,s)=>{const a=this.events.get(n);a&&(a.props.properties.trace.push(s),this.events.set(n,a),this.shouldPersist=!0)},this.setError=(n,s)=>{const a=this.events.get(n);a&&(a.props.type=s,a.timestamp=Date.now(),this.events.set(n,a),this.shouldPersist=!0)},this.persist=async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1},this.restore=async()=>{try{const n=await this.core.storage.getItem(this.storageKey)||[];if(!n.length)return;n.forEach(s=>{this.events.set(s.eventId,$u($u({},s),this.setMethods(s.eventId)))})}catch(n){this.logger.warn(n)}},this.submit=async()=>{if(!this.telemetryEnabled||this.events.size===0)return;const n=[];for(const[s,a]of this.events)a.props.type&&n.push(a);if(n.length!==0)try{if((await fetch(`${pP}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${v3}`,{method:"POST",body:JSON.stringify(n)})).ok)for(const s of n)this.events.delete(s.eventId),this.shouldPersist=!0}catch(s){this.logger.warn(s)}},this.logger=ci(r,this.context),i?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var XP=Object.defineProperty,C3=Object.getOwnPropertySymbols,e$=Object.prototype.hasOwnProperty,t$=Object.prototype.propertyIsEnumerable,D3=(t,e,r)=>e in t?XP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,O3=(t,e)=>{for(var r in e||(e={}))e$.call(e,r)&&D3(t,r,e[r]);if(C3)for(var r of C3(e))t$.call(e,r)&&D3(t,r,e[r]);return t};class Xd extends iC{constructor(e){var r;super(e),this.protocol=h3,this.version=l3,this.name=Qd,this.events=new Br.exports.EventEmitter,this.initialized=!1,this.on=(a,u)=>this.events.on(a,u),this.once=(a,u)=>this.events.once(a,u),this.off=(a,u)=>this.events.off(a,u),this.removeListener=(a,u)=>this.events.removeListener(a,u),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||g3,this.customStoragePrefix=e!=null&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";const i=Eh({level:typeof e?.logger=="string"&&e.logger?e.logger:RO.logger}),{logger:n,chunkLoggerController:s}=rC({opts:i,maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=s,(r=this.logChunkController)!=null&&r.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var a,u;(a=this.logChunkController)!=null&&a.downloadLogsBlobInBrowser&&((u=this.logChunkController)==null||u.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=ci(n,this.name),this.heartbeat=new Bd,this.crypto=new vP(this,this.logger,e?.keychain),this.history=new TP(this,this.logger),this.expirer=new LP(this,this.logger),this.storage=e!=null&&e.storage?e.storage:new MM(O3(O3({},NO),e?.storageOptions)),this.relayer=new OP({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new NP(this,this.logger),this.verify=new VP(this,this.logger,this.storage),this.echoClient=new GP(this.projectId||"",this.logger),this.eventClient=new ZP(this,this.logger,e?.telemetryEnabled)}static async init(e){const r=new Xd(e);await r.initialize();const i=await r.crypto.getClientId();return await r.storage.setItem(YO,i),r}get context(){return _i(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return(e=this.logChunkController)==null?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}const r$=Xd,P3="wc",$3=2,R3="client",e1=`${P3}@${$3}:${R3}:`,t1={name:R3,logger:"error",controller:!1,relayUrl:"wss://relay.walletconnect.com"},N3="WALLETCONNECT_DEEPLINK_CHOICE",i$="proposal",T3="Proposal expired",n$="session",cc=Ie.SEVEN_DAYS,s$="engine",Hr={wc_sessionPropose:{req:{ttl:Ie.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1104},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1106},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:Ie.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:Ie.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1112},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:Ie.ONE_DAY,prompt:!1,tag:1114},res:{ttl:Ie.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:Ie.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:Ie.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:Ie.FIVE_MINUTES,prompt:!1,tag:1119}}},r1={min:Ie.FIVE_MINUTES,max:Ie.SEVEN_DAYS},ls={idle:"IDLE",active:"ACTIVE"},o$="request",a$=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],c$="wc",u$="auth",f$="authKeys",h$="pairingTopics",l$="requests",Mh=`${c$}@${1.5}:${u$}:`,Ch=`${Mh}:PUB_KEY`;var d$=Object.defineProperty,p$=Object.defineProperties,g$=Object.getOwnPropertyDescriptors,L3=Object.getOwnPropertySymbols,v$=Object.prototype.hasOwnProperty,m$=Object.prototype.propertyIsEnumerable,B3=(t,e,r)=>e in t?d$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,xr=(t,e)=>{for(var r in e||(e={}))v$.call(e,r)&&B3(t,r,e[r]);if(L3)for(var r of L3(e))m$.call(e,r)&&B3(t,r,e[r]);return t},Yo=(t,e)=>p$(t,g$(e));class b$ extends gC{constructor(e){super(e),this.name=s$,this.events=new Br.exports,this.initialized=!1,this.requestQueue={state:ls.idle,queue:[]},this.sessionRequestQueue={state:ls.idle,queue:[]},this.requestQueueDelay=Ie.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(Hr)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},Ie.toMiliseconds(this.requestQueueDelay)))},this.connect=async r=>{await this.isInitialized();const i=Yo(xr({},r),{requiredNamespaces:r.requiredNamespaces||{},optionalNamespaces:r.optionalNamespaces||{}});await this.isValidConnect(i);const{pairingTopic:n,requiredNamespaces:s,optionalNamespaces:a,sessionProperties:u,relays:l}=i;let d=n,b,w=!1;try{d&&(w=this.client.core.pairing.pairings.get(d).active)}catch(R){throw this.client.logger.error(`connect() -> pairing.get(${d}) failed`),R}if(!d||!w){const{topic:R,uri:k}=await this.client.core.pairing.create();d=R,b=k}if(!d){const{message:R}=Ee("NO_MATCHING_KEY",`connect() pairing topic: ${d}`);throw new Error(R)}const I=await this.client.core.crypto.generateKeyPair(),S=Hr.wc_sessionPropose.req.ttl||Ie.FIVE_MINUTES,D=kr(S),L=xr({requiredNamespaces:s,optionalNamespaces:a,relays:l??[{protocol:p3}],proposer:{publicKey:I,metadata:this.client.metadata},expiryTimestamp:D,pairingTopic:d},u&&{sessionProperties:u}),{reject:K,resolve:H,done:U}=Fo(S,T3);this.events.once(Dt("session_connect"),async({error:R,session:k})=>{if(R)K(R);else if(k){k.self.publicKey=I;const z=Yo(xr({},k),{pairingTopic:L.pairingTopic,requiredNamespaces:L.requiredNamespaces,optionalNamespaces:L.optionalNamespaces});await this.client.session.set(k.topic,z),await this.setExpiry(k.topic,k.expiry),d&&await this.client.core.pairing.updateMetadata({topic:d,metadata:k.peer.metadata}),this.cleanupDuplicatePairings(z),H(z)}});const W=await this.sendRequest({topic:d,method:"wc_sessionPropose",params:L,throwOnFailedPublish:!0});return await this.setProposal(W,xr({id:W},L)),{uri:b,approval:U}},this.pair=async r=>{await this.isInitialized();try{return await this.client.core.pairing.pair(r)}catch(i){throw this.client.logger.error("pair() failed"),i}},this.approve=async r=>{var i,n,s;const a=this.client.core.eventClient.createEvent({properties:{topic:(i=r?.id)==null?void 0:i.toString(),trace:[Sn.session_approve_started]}});try{await this.isInitialized()}catch(_){throw a.setError(Ko.no_internet_connection),_}try{await this.isValidProposalId(r?.id)}catch(_){throw this.client.logger.error(`approve() -> proposal.get(${r?.id}) failed`),a.setError(Ko.proposal_not_found),_}try{await this.isValidApprove(r)}catch(_){throw this.client.logger.error("approve() -> isValidApprove() failed"),a.setError(Ko.session_approve_namespace_validation_failure),_}const{id:u,relayProtocol:l,namespaces:d,sessionProperties:b,sessionConfig:w}=r,I=this.client.proposal.get(u);this.client.core.eventClient.deleteEvent({eventId:a.eventId});const{pairingTopic:S,proposer:D,requiredNamespaces:L,optionalNamespaces:K}=I;let H=(n=this.client.core.eventClient)==null?void 0:n.getEvent({topic:S});H||(H=(s=this.client.core.eventClient)==null?void 0:s.createEvent({type:Sn.session_approve_started,properties:{topic:S,trace:[Sn.session_approve_started,Sn.session_namespaces_validation_success]}}));const U=await this.client.core.crypto.generateKeyPair(),W=D.publicKey,R=await this.client.core.crypto.generateSharedKey(U,W),k=xr(xr({relay:{protocol:l??"irn"},namespaces:d,controller:{publicKey:U,metadata:this.client.metadata},expiry:kr(cc)},b&&{sessionProperties:b}),w&&{sessionConfig:w});H.addTrace(Sn.subscribing_session_topic);try{await this.client.core.relayer.subscribe(R)}catch(_){throw H.setError(Ko.subscribe_session_topic_failure),_}H.addTrace(Sn.subscribe_session_topic_success);const z=Yo(xr({},k),{topic:R,requiredNamespaces:L,optionalNamespaces:K,pairingTopic:S,acknowledged:!1,self:k.controller,peer:{publicKey:D.publicKey,metadata:D.metadata},controller:U});await this.client.session.set(R,z),H.addTrace(Sn.store_session);try{H.addTrace(Sn.publishing_session_settle),await this.sendRequest({topic:R,method:"wc_sessionSettle",params:k,throwOnFailedPublish:!0}).catch(_=>{throw H?.setError(Ko.session_settle_publish_failure),_}),H.addTrace(Sn.session_settle_publish_success),H.addTrace(Sn.publishing_session_approve),await this.sendResult({id:u,topic:S,result:{relay:{protocol:l??"irn"},responderPublicKey:U},throwOnFailedPublish:!0}).catch(_=>{throw H?.setError(Ko.session_approve_publish_failure),_}),H.addTrace(Sn.session_approve_publish_success)}catch(_){throw this.client.logger.error(_),this.client.session.delete(R,Gt("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(R),_}return this.client.core.eventClient.deleteEvent({eventId:H.eventId}),await this.client.core.pairing.updateMetadata({topic:S,metadata:D.metadata}),await this.client.proposal.delete(u,Gt("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:S}),await this.setExpiry(R,kr(cc)),{topic:R,acknowledged:()=>Promise.resolve(this.client.session.get(R))}},this.reject=async r=>{await this.isInitialized();try{await this.isValidReject(r)}catch(a){throw this.client.logger.error("reject() -> isValidReject() failed"),a}const{id:i,reason:n}=r;let s;try{s=this.client.proposal.get(i).pairingTopic}catch(a){throw this.client.logger.error(`reject() -> proposal.get(${i}) failed`),a}s&&(await this.sendError({id:i,topic:s,error:n,rpcOpts:Hr.wc_sessionPropose.reject}),await this.client.proposal.delete(i,Gt("USER_DISCONNECTED")))},this.update=async r=>{await this.isInitialized();try{await this.isValidUpdate(r)}catch(w){throw this.client.logger.error("update() -> isValidUpdate() failed"),w}const{topic:i,namespaces:n}=r,{done:s,resolve:a,reject:u}=Fo(),l=no(),d=Ho().toString(),b=this.client.session.get(i).namespaces;return this.events.once(Dt("session_update",l),({error:w})=>{w?u(w):a()}),await this.client.session.update(i,{namespaces:n}),await this.sendRequest({topic:i,method:"wc_sessionUpdate",params:{namespaces:n},throwOnFailedPublish:!0,clientRpcId:l,relayRpcId:d}).catch(w=>{this.client.logger.error(w),this.client.session.update(i,{namespaces:b}),u(w)}),{acknowledged:s}},this.extend=async r=>{await this.isInitialized();try{await this.isValidExtend(r)}catch(l){throw this.client.logger.error("extend() -> isValidExtend() failed"),l}const{topic:i}=r,n=no(),{done:s,resolve:a,reject:u}=Fo();return this.events.once(Dt("session_extend",n),({error:l})=>{l?u(l):a()}),await this.setExpiry(i,kr(cc)),this.sendRequest({topic:i,method:"wc_sessionExtend",params:{},clientRpcId:n,throwOnFailedPublish:!0}).catch(l=>{u(l)}),{acknowledged:s}},this.request=async r=>{await this.isInitialized();try{await this.isValidRequest(r)}catch(S){throw this.client.logger.error("request() -> isValidRequest() failed"),S}const{chainId:i,request:n,topic:s,expiry:a=Hr.wc_sessionRequest.req.ttl}=r,u=this.client.session.get(s),l=no(),d=Ho().toString(),{done:b,resolve:w,reject:I}=Fo(a,"Request expired. Please try again.");return this.events.once(Dt("session_request",l),({error:S,result:D})=>{S?I(S):w(D)}),await Promise.all([new Promise(async S=>{await this.sendRequest({clientRpcId:l,relayRpcId:d,topic:s,method:"wc_sessionRequest",params:{request:Yo(xr({},n),{expiryTimestamp:kr(a)}),chainId:i},expiry:a,throwOnFailedPublish:!0}).catch(D=>I(D)),this.client.events.emit("session_request_sent",{topic:s,request:n,chainId:i,id:l}),S()}),new Promise(async S=>{var D;if(!((D=u.sessionConfig)!=null&&D.disableDeepLink)){const L=await VE(this.client.core.storage,N3);WE({id:l,topic:s,wcDeepLink:L})}S()}),b()]).then(S=>S[2])},this.respond=async r=>{await this.isInitialized(),await this.isValidRespond(r);const{topic:i,response:n}=r,{id:s}=n;cs(n)?await this.sendResult({id:s,topic:i,result:n.result,throwOnFailedPublish:!0}):Xi(n)&&await this.sendError({id:s,topic:i,error:n.error}),this.cleanupAfterResponse(r)},this.ping=async r=>{await this.isInitialized();try{await this.isValidPing(r)}catch(n){throw this.client.logger.error("ping() -> isValidPing() failed"),n}const{topic:i}=r;if(this.client.session.keys.includes(i)){const n=no(),s=Ho().toString(),{done:a,resolve:u,reject:l}=Fo();this.events.once(Dt("session_ping",n),({error:d})=>{d?l(d):u()}),await Promise.all([this.sendRequest({topic:i,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:n,relayRpcId:s}),a()])}else this.client.core.pairing.pairings.keys.includes(i)&&await this.client.core.pairing.ping({topic:i})},this.emit=async r=>{await this.isInitialized(),await this.isValidEmit(r);const{topic:i,event:n,chainId:s}=r,a=Ho().toString();await this.sendRequest({topic:i,method:"wc_sessionEvent",params:{event:n,chainId:s},throwOnFailedPublish:!0,relayRpcId:a})},this.disconnect=async r=>{await this.isInitialized(),await this.isValidDisconnect(r);const{topic:i}=r;if(this.client.session.keys.includes(i))await this.sendRequest({topic:i,method:"wc_sessionDelete",params:Gt("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:i,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(i))await this.client.core.pairing.disconnect({topic:i});else{const{message:n}=Ee("MISMATCHED_TOPIC",`Session or pairing topic not found: ${i}`);throw new Error(n)}},this.find=r=>(this.isInitialized(),this.client.session.getAll().filter(i=>AI(i,r))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async r=>{this.isInitialized(),this.isValidAuthenticate(r);const{chains:i,statement:n="",uri:s,domain:a,nonce:u,type:l,exp:d,nbf:b,methods:w=[],expiry:I}=r,S=[...r.resources||[]],{topic:D,uri:L}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:D,uri:L}});const K=await this.client.core.crypto.generateKeyPair(),H=hh(K);if(await Promise.all([this.client.auth.authKeys.set(Ch,{responseTopic:H,publicKey:K}),this.client.auth.pairingTopics.set(H,{topic:H,pairingTopic:D})]),await this.client.core.relayer.subscribe(H),this.client.logger.info(`sending request to new pairing topic: ${D}`),w.length>0){const{namespace:f}=ru(i[0]);let h=zS(f,"request",w);fh(S)&&(h=KS(h,S.pop())),S.push(h)}const U=I&&I>Hr.wc_sessionAuthenticate.req.ttl?I:Hr.wc_sessionAuthenticate.req.ttl,W={authPayload:{type:l??"caip122",chains:i,statement:n,aud:s,domain:a,version:"1",nonce:u,iat:new Date().toISOString(),exp:d,nbf:b,resources:S},requester:{publicKey:K,metadata:this.client.metadata},expiryTimestamp:kr(U)},R={eip155:{chains:i,methods:[...new Set(["personal_sign",...w])],events:["chainChanged","accountsChanged"]}},k={requiredNamespaces:{},optionalNamespaces:R,relays:[{protocol:"irn"}],pairingTopic:D,proposer:{publicKey:K,metadata:this.client.metadata},expiryTimestamp:kr(Hr.wc_sessionPropose.req.ttl)},{done:z,resolve:_,reject:B}=Fo(U,"Request expired"),X=async({error:f,session:h})=>{if(this.events.off(Dt("session_request",T),re),f)B(f);else if(h){h.self.publicKey=K,await this.client.session.set(h.topic,h),await this.setExpiry(h.topic,h.expiry),D&&await this.client.core.pairing.updateMetadata({topic:D,metadata:h.peer.metadata});const v=this.client.session.get(h.topic);await this.deleteProposal(y),_({session:v})}},re=async f=>{if(await this.deletePendingAuthRequest(T,{message:"fulfilled",code:0}),f.error){const g=Gt("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return f.error.code===g.code?void 0:(this.events.off(Dt("session_connect"),X),B(f.error.message))}await this.deleteProposal(y),this.events.off(Dt("session_connect"),X);const{cacaos:h,responder:v}=f.result,E=[],C=[];for(const g of h){await Ym({cacao:g,projectId:this.client.core.projectId})||(this.client.logger.error(g,"Signature verification failed"),B(Gt("SESSION_SETTLEMENT_FAILED","Signature verification failed")));const{p:m}=g,N=fh(m.resources),ee=[Gm(m.iss)],ae=uh(m.iss);if(N){const O=Zm(N),te=Xm(N);E.push(...O),ee.push(...te)}for(const O of ee)C.push(`${O}:${ae}`)}const P=await this.client.core.crypto.generateSharedKey(K,v.publicKey);let M;E.length>0&&(M={topic:P,acknowledged:!0,self:{publicKey:K,metadata:this.client.metadata},peer:v,controller:v.publicKey,expiry:kr(cc),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:D,namespaces:ub([...new Set(E)],[...new Set(C)])},await this.client.core.relayer.subscribe(P),await this.client.session.set(P,M),D&&await this.client.core.pairing.updateMetadata({topic:D,metadata:v.metadata}),M=this.client.session.get(P)),_({auths:h,session:M})},T=no(),y=no();this.events.once(Dt("session_connect"),X),this.events.once(Dt("session_request",T),re);try{await Promise.all([this.sendRequest({topic:D,method:"wc_sessionAuthenticate",params:W,expiry:r.expiry,throwOnFailedPublish:!0,clientRpcId:T}),this.sendRequest({topic:D,method:"wc_sessionPropose",params:k,expiry:Hr.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:y})])}catch(f){throw this.events.off(Dt("session_connect"),X),this.events.off(Dt("session_request",T),re),f}return await this.setProposal(y,xr({id:y},k)),await this.setAuthRequest(T,{request:Yo(xr({},W),{verifyContext:{}}),pairingTopic:D}),{uri:L,response:z}},this.approveSessionAuthenticate=async r=>{const{id:i,auths:n}=r,s=this.client.core.eventClient.createEvent({properties:{topic:i.toString(),trace:[Wo.authenticated_session_approve_started]}});try{this.isInitialized()}catch(L){throw s.setError(Ou.no_internet_connection),L}const a=this.getPendingAuthRequest(i);if(!a)throw s.setError(Ou.authenticated_session_pending_request_not_found),new Error(`Could not find pending auth request with id ${i}`);const u=a.requester.publicKey,l=await this.client.core.crypto.generateKeyPair(),d=hh(u),b={type:Ps,receiverPublicKey:u,senderPublicKey:l},w=[],I=[];for(const L of n){if(!await Ym({cacao:L,projectId:this.client.core.projectId})){s.setError(Ou.invalid_cacao);const R=Gt("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:i,topic:d,error:R,encodeOpts:b}),new Error(R.message)}s.addTrace(Wo.cacaos_verified);const{p:K}=L,H=fh(K.resources),U=[Gm(K.iss)],W=uh(K.iss);if(H){const R=Zm(H),k=Xm(H);w.push(...R),U.push(...k)}for(const R of U)I.push(`${R}:${W}`)}const S=await this.client.core.crypto.generateSharedKey(l,u);s.addTrace(Wo.create_authenticated_session_topic);let D;if(w?.length>0){D={topic:S,acknowledged:!0,self:{publicKey:l,metadata:this.client.metadata},peer:{publicKey:u,metadata:a.requester.metadata},controller:u,expiry:kr(cc),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:a.pairingTopic,namespaces:ub([...new Set(w)],[...new Set(I)])},s.addTrace(Wo.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(S)}catch(L){throw s.setError(Ou.subscribe_authenticated_session_topic_failure),L}s.addTrace(Wo.subscribe_authenticated_session_topic_success),await this.client.session.set(S,D),s.addTrace(Wo.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:a.pairingTopic,metadata:a.requester.metadata})}s.addTrace(Wo.publishing_authenticated_session_approve);try{await this.sendResult({topic:d,id:i,result:{cacaos:n,responder:{publicKey:l,metadata:this.client.metadata}},encodeOpts:b,throwOnFailedPublish:!0})}catch(L){throw s.setError(Ou.authenticated_session_approve_publish_failure),L}return await this.client.auth.requests.delete(i,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:a.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:s.eventId}),{session:D}},this.rejectSessionAuthenticate=async r=>{await this.isInitialized();const{id:i,reason:n}=r,s=this.getPendingAuthRequest(i);if(!s)throw new Error(`Could not find pending auth request with id ${i}`);const a=s.requester.publicKey,u=await this.client.core.crypto.generateKeyPair(),l=hh(a),d={type:Ps,receiverPublicKey:a,senderPublicKey:u};await this.sendError({id:i,topic:l,error:n,encodeOpts:d,rpcOpts:Hr.wc_sessionAuthenticate.reject}),await this.client.auth.requests.delete(i,{message:"rejected",code:0}),await this.client.proposal.delete(i,Gt("USER_DISCONNECTED"))},this.formatAuthMessage=r=>{this.isInitialized();const{request:i,iss:n}=r;return Jm(i,n)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(this.relayMessageCache.length!==0)for(;this.relayMessageCache.length>0;)try{const r=this.relayMessageCache.shift();r&&await this.onRelayMessage(r)}catch(r){this.client.logger.error(r)}},50)},this.cleanupDuplicatePairings=async r=>{if(r.pairingTopic)try{const i=this.client.core.pairing.pairings.get(r.pairingTopic),n=this.client.core.pairing.pairings.getAll().filter(s=>{var a,u;return((a=s.peerMetadata)==null?void 0:a.url)&&((u=s.peerMetadata)==null?void 0:u.url)===r.peer.metadata.url&&s.topic&&s.topic!==i.topic});if(n.length===0)return;this.client.logger.info(`Cleaning up ${n.length} duplicate pairing(s)`),await Promise.all(n.map(s=>this.client.core.pairing.disconnect({topic:s.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(i){this.client.logger.error(i)}},this.deleteSession=async r=>{var i;const{topic:n,expirerHasDeleted:s=!1,emitEvent:a=!0,id:u=0}=r,{self:l}=this.client.session.get(n);await this.client.core.relayer.unsubscribe(n),await this.client.session.delete(n,Gt("USER_DISCONNECTED")),this.addToRecentlyDeleted(n,"session"),this.client.core.crypto.keychain.has(l.publicKey)&&await this.client.core.crypto.deleteKeyPair(l.publicKey),this.client.core.crypto.keychain.has(n)&&await this.client.core.crypto.deleteSymKey(n),s||this.client.core.expirer.del(n),this.client.core.storage.removeItem(N3).catch(d=>this.client.logger.warn(d)),this.getPendingSessionRequests().forEach(d=>{d.topic===n&&this.deletePendingSessionRequest(d.id,Gt("USER_DISCONNECTED"))}),n===((i=this.sessionRequestQueue.queue[0])==null?void 0:i.topic)&&(this.sessionRequestQueue.state=ls.idle),a&&this.client.events.emit("session_delete",{id:u,topic:n})},this.deleteProposal=async(r,i)=>{if(i)try{const n=this.client.proposal.get(r),s=this.client.core.eventClient.getEvent({topic:n.pairingTopic});s?.setError(Ko.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(r,Gt("USER_DISCONNECTED")),i?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"proposal")},this.deletePendingSessionRequest=async(r,i,n=!1)=>{await Promise.all([this.client.pendingRequest.delete(r,i),n?Promise.resolve():this.client.core.expirer.del(r)]),this.addToRecentlyDeleted(r,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(s=>s.id!==r),n&&(this.sessionRequestQueue.state=ls.idle,this.client.events.emit("session_request_expire",{id:r}))},this.deletePendingAuthRequest=async(r,i,n=!1)=>{await Promise.all([this.client.auth.requests.delete(r,i),n?Promise.resolve():this.client.core.expirer.del(r)])},this.setExpiry=async(r,i)=>{this.client.session.keys.includes(r)&&(this.client.core.expirer.set(r,i),await this.client.session.update(r,{expiry:i}))},this.setProposal=async(r,i)=>{this.client.core.expirer.set(r,kr(Hr.wc_sessionPropose.req.ttl)),await this.client.proposal.set(r,i)},this.setAuthRequest=async(r,i)=>{const{request:n,pairingTopic:s}=i;this.client.core.expirer.set(r,n.expiryTimestamp),await this.client.auth.requests.set(r,{authPayload:n.authPayload,requester:n.requester,expiryTimestamp:n.expiryTimestamp,id:r,pairingTopic:s,verifyContext:n.verifyContext})},this.setPendingSessionRequest=async r=>{const{id:i,topic:n,params:s,verifyContext:a}=r,u=s.request.expiryTimestamp||kr(Hr.wc_sessionRequest.req.ttl);this.client.core.expirer.set(i,u),await this.client.pendingRequest.set(i,{id:i,topic:n,params:s,verifyContext:a})},this.sendRequest=async r=>{const{topic:i,method:n,params:s,expiry:a,relayRpcId:u,clientRpcId:l,throwOnFailedPublish:d}=r,b=sc(n,s,l);let w;try{w=await this.client.core.crypto.encode(i,b)}catch(D){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),D}let I;if(a$.includes(n)){const D=$s(JSON.stringify(b)),L=$s(w);I=await this.client.core.verify.register({id:L,decryptedId:D})}const S=Hr[n].req;return S.attestation=I,a&&(S.ttl=a),u&&(S.id=u),this.client.core.history.set(i,b),d?(S.internal=Yo(xr({},S.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,w,S)):this.client.core.relayer.publish(i,w,S).catch(D=>this.client.logger.error(D)),b.id},this.sendResult=async r=>{const{id:i,topic:n,result:s,throwOnFailedPublish:a,encodeOpts:u}=r,l=Ah(i,s);let d;try{d=await this.client.core.crypto.encode(n,l,u)}catch(I){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${n} failed`),I}let b;try{b=await this.client.core.history.get(n,i)}catch(I){throw this.client.logger.error(`sendResult() -> history.get(${n}, ${i}) failed`),I}const w=Hr[b.request.method].res;a?(w.internal=Yo(xr({},w.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(n,d,w)):this.client.core.relayer.publish(n,d,w).catch(I=>this.client.logger.error(I)),await this.client.core.history.resolve(l)},this.sendError=async r=>{const{id:i,topic:n,error:s,encodeOpts:a,rpcOpts:u}=r,l=xh(i,s);let d;try{d=await this.client.core.crypto.encode(n,l,a)}catch(I){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${n} failed`),I}let b;try{b=await this.client.core.history.get(n,i)}catch(I){throw this.client.logger.error(`sendError() -> history.get(${n}, ${i}) failed`),I}const w=u||Hr[b.request.method].res;this.client.core.relayer.publish(n,d,w),await this.client.core.history.resolve(l)},this.cleanup=async()=>{const r=[],i=[];this.client.session.getAll().forEach(n=>{let s=!1;eo(n.expiry)&&(s=!0),this.client.core.crypto.keychain.has(n.topic)||(s=!0),s&&r.push(n.topic)}),this.client.proposal.getAll().forEach(n=>{eo(n.expiryTimestamp)&&i.push(n.id)}),await Promise.all([...r.map(n=>this.deleteSession({topic:n})),...i.map(n=>this.deleteProposal(n))])},this.onRelayEventRequest=async r=>{this.requestQueue.queue.push(r),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===ls.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=ls.active;const r=this.requestQueue.queue.shift();if(r)try{await this.processRequest(r)}catch(i){this.client.logger.warn(i)}}this.requestQueue.state=ls.idle},this.processRequest=async r=>{const{topic:i,payload:n,attestation:s,encryptedId:a}=r,u=n.method;if(!this.shouldIgnorePairingRequest({topic:i,requestMethod:u}))switch(u){case"wc_sessionPropose":return await this.onSessionProposeRequest({topic:i,payload:n,attestation:s,encryptedId:a});case"wc_sessionSettle":return await this.onSessionSettleRequest(i,n);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(i,n);case"wc_sessionExtend":return await this.onSessionExtendRequest(i,n);case"wc_sessionPing":return await this.onSessionPingRequest(i,n);case"wc_sessionDelete":return await this.onSessionDeleteRequest(i,n);case"wc_sessionRequest":return await this.onSessionRequest({topic:i,payload:n,attestation:s,encryptedId:a});case"wc_sessionEvent":return await this.onSessionEventRequest(i,n);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:i,payload:n,attestation:s,encryptedId:a});default:return this.client.logger.info(`Unsupported request method ${u}`)}},this.onRelayEventResponse=async r=>{const{topic:i,payload:n}=r,s=(await this.client.core.history.get(i,n.id)).request.method;switch(s){case"wc_sessionPropose":return this.onSessionProposeResponse(i,n);case"wc_sessionSettle":return this.onSessionSettleResponse(i,n);case"wc_sessionUpdate":return this.onSessionUpdateResponse(i,n);case"wc_sessionExtend":return this.onSessionExtendResponse(i,n);case"wc_sessionPing":return this.onSessionPingResponse(i,n);case"wc_sessionRequest":return this.onSessionRequestResponse(i,n);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(i,n);default:return this.client.logger.info(`Unsupported response method ${s}`)}},this.onRelayEventUnknownPayload=r=>{const{topic:i}=r,{message:n}=Ee("MISSING_OR_INVALID",`Decoded payload on topic ${i} is not identifiable as a JSON-RPC request or a response.`);throw new Error(n)},this.shouldIgnorePairingRequest=r=>{const{topic:i,requestMethod:n}=r,s=this.expectedPairingMethodMap.get(i);return!s||s.includes(n)?!1:!!(s.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async r=>{const{topic:i,payload:n,attestation:s,encryptedId:a}=r,{params:u,id:l}=n;try{const d=this.client.core.eventClient.getEvent({topic:i});this.isValidConnect(xr({},n.params));const b=u.expiryTimestamp||kr(Hr.wc_sessionPropose.req.ttl),w=xr({id:l,pairingTopic:i,expiryTimestamp:b},u);await this.setProposal(l,w);const I=await this.getVerifyContext({attestationId:s,hash:$s(JSON.stringify(n)),encryptedId:a,metadata:w.proposer.metadata});this.client.events.listenerCount("session_proposal")===0&&(console.warn("No listener for session_proposal event"),d?.setError(Ts.proposal_listener_not_found)),d?.addTrace(hs.emit_session_proposal),this.client.events.emit("session_proposal",{id:l,params:w,verifyContext:I})}catch(d){await this.sendError({id:l,topic:i,error:d,rpcOpts:Hr.wc_sessionPropose.autoReject}),this.client.logger.error(d)}},this.onSessionProposeResponse=async(r,i)=>{const{id:n}=i;if(cs(i)){const{result:s}=i;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:s});const a=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:a});const u=a.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:u});const l=s.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:l});const d=await this.client.core.crypto.generateSharedKey(u,l);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:d});const b=await this.client.core.relayer.subscribe(d);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:b}),await this.client.core.pairing.activate({topic:r})}else if(Xi(i)){await this.client.proposal.delete(n,Gt("USER_DISCONNECTED"));const s=Dt("session_connect");if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners, 954`);this.events.emit(Dt("session_connect"),{error:i.error})}},this.onSessionSettleRequest=async(r,i)=>{const{id:n,params:s}=i;try{this.isValidSessionSettleRequest(s);const{relay:a,controller:u,expiry:l,namespaces:d,sessionProperties:b,sessionConfig:w}=i.params,I=xr(xr({topic:r,relay:a,expiry:l,namespaces:d,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:u.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:u.publicKey,metadata:u.metadata}},b&&{sessionProperties:b}),w&&{sessionConfig:w}),S=Dt("session_connect");if(this.events.listenerCount(S)===0)throw new Error(`emitting ${S} without any listeners 997`);this.events.emit(Dt("session_connect"),{session:I}),await this.sendResult({id:i.id,topic:r,result:!0,throwOnFailedPublish:!0})}catch(a){await this.sendError({id:n,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionSettleResponse=async(r,i)=>{const{id:n}=i;cs(i)?(await this.client.session.update(r,{acknowledged:!0}),this.events.emit(Dt("session_approve",n),{})):Xi(i)&&(await this.client.session.delete(r,Gt("USER_DISCONNECTED")),this.events.emit(Dt("session_approve",n),{error:i.error}))},this.onSessionUpdateRequest=async(r,i)=>{const{params:n,id:s}=i;try{const a=`${r}_session_update`,u=wu.get(a);if(u&&this.isRequestOutOfSync(u,s)){this.client.logger.info(`Discarding out of sync request - ${s}`),this.sendError({id:s,topic:r,error:Gt("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(xr({topic:r},n));try{wu.set(a,s),await this.client.session.update(r,{namespaces:n.namespaces}),await this.sendResult({id:s,topic:r,result:!0,throwOnFailedPublish:!0})}catch(l){throw wu.delete(a),l}this.client.events.emit("session_update",{id:s,topic:r,params:n})}catch(a){await this.sendError({id:s,topic:r,error:a}),this.client.logger.error(a)}},this.isRequestOutOfSync=(r,i)=>parseInt(i.toString().slice(0,-3))<=parseInt(r.toString().slice(0,-3)),this.onSessionUpdateResponse=(r,i)=>{const{id:n}=i,s=Dt("session_update",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);cs(i)?this.events.emit(Dt("session_update",n),{}):Xi(i)&&this.events.emit(Dt("session_update",n),{error:i.error})},this.onSessionExtendRequest=async(r,i)=>{const{id:n}=i;try{this.isValidExtend({topic:r}),await this.setExpiry(r,kr(cc)),await this.sendResult({id:n,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:n,topic:r})}catch(s){await this.sendError({id:n,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionExtendResponse=(r,i)=>{const{id:n}=i,s=Dt("session_extend",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);cs(i)?this.events.emit(Dt("session_extend",n),{}):Xi(i)&&this.events.emit(Dt("session_extend",n),{error:i.error})},this.onSessionPingRequest=async(r,i)=>{const{id:n}=i;try{this.isValidPing({topic:r}),await this.sendResult({id:n,topic:r,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:n,topic:r})}catch(s){await this.sendError({id:n,topic:r,error:s}),this.client.logger.error(s)}},this.onSessionPingResponse=(r,i)=>{const{id:n}=i,s=Dt("session_ping",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);setTimeout(()=>{cs(i)?this.events.emit(Dt("session_ping",n),{}):Xi(i)&&this.events.emit(Dt("session_ping",n),{error:i.error})},500)},this.onSessionDeleteRequest=async(r,i)=>{const{id:n}=i;try{this.isValidDisconnect({topic:r,reason:i.params}),await Promise.all([new Promise(s=>{this.client.core.relayer.once(Ei.publish,async()=>{s(await this.deleteSession({topic:r,id:n}))})}),this.sendResult({id:n,topic:r,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:r,error:Gt("USER_DISCONNECTED")})])}catch(s){this.client.logger.error(s)}},this.onSessionRequest=async r=>{var i;const{topic:n,payload:s,attestation:a,encryptedId:u}=r,{id:l,params:d}=s;try{await this.isValidRequest(xr({topic:n},d));const b=this.client.session.get(n),w=await this.getVerifyContext({attestationId:a,hash:$s(JSON.stringify(sc("wc_sessionRequest",d,l))),encryptedId:u,metadata:b.peer.metadata}),I={id:l,topic:n,params:d,verifyContext:w};await this.setPendingSessionRequest(I),(i=this.client.signConfig)!=null&&i.disableRequestQueue?this.emitSessionRequest(I):(this.addSessionRequestToSessionRequestQueue(I),this.processSessionRequestQueue())}catch(b){await this.sendError({id:l,topic:n,error:b}),this.client.logger.error(b)}},this.onSessionRequestResponse=(r,i)=>{const{id:n}=i,s=Dt("session_request",n);if(this.events.listenerCount(s)===0)throw new Error(`emitting ${s} without any listeners`);cs(i)?this.events.emit(Dt("session_request",n),{result:i.result}):Xi(i)&&this.events.emit(Dt("session_request",n),{error:i.error})},this.onSessionEventRequest=async(r,i)=>{const{id:n,params:s}=i;try{const a=`${r}_session_event_${s.event.name}`,u=wu.get(a);if(u&&this.isRequestOutOfSync(u,n)){this.client.logger.info(`Discarding out of sync request - ${n}`);return}this.isValidEmit(xr({topic:r},s)),this.client.events.emit("session_event",{id:n,topic:r,params:s}),wu.set(a,n)}catch(a){await this.sendError({id:n,topic:r,error:a}),this.client.logger.error(a)}},this.onSessionAuthenticateResponse=(r,i)=>{const{id:n}=i;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:r,payload:i}),cs(i)?this.events.emit(Dt("session_request",n),{result:i.result}):Xi(i)&&this.events.emit(Dt("session_request",n),{error:i.error})},this.onSessionAuthenticateRequest=async r=>{const{topic:i,payload:n,attestation:s,encryptedId:a}=r;try{const{requester:u,authPayload:l,expiryTimestamp:d}=n.params,b=await this.getVerifyContext({attestationId:s,hash:$s(JSON.stringify(n)),encryptedId:a,metadata:u.metadata}),w={requester:u,pairingTopic:i,id:n.id,authPayload:l,verifyContext:b,expiryTimestamp:d};await this.setAuthRequest(n.id,{request:w,pairingTopic:i}),this.client.events.emit("session_authenticate",{topic:i,params:n.params,id:n.id,verifyContext:b})}catch(u){this.client.logger.error(u);const l=n.params.requester.publicKey,d=await this.client.core.crypto.generateKeyPair(),b={type:Ps,receiverPublicKey:l,senderPublicKey:d};await this.sendError({id:n.id,topic:i,error:u,encodeOpts:b,rpcOpts:Hr.wc_sessionAuthenticate.autoReject})}},this.addSessionRequestToSessionRequestQueue=r=>{this.sessionRequestQueue.queue.push(r)},this.cleanupAfterResponse=r=>{this.deletePendingSessionRequest(r.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=ls.idle,this.processSessionRequestQueue()},Ie.toMiliseconds(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:r,error:i})=>{const n=this.client.core.history.pending;n.length>0&&n.filter(s=>s.topic===r&&s.request.method==="wc_sessionRequest").forEach(s=>{const a=s.request.id,u=Dt("session_request",a);if(this.events.listenerCount(u)===0)throw new Error(`emitting ${u} without any listeners`);this.events.emit(Dt("session_request",s.request.id),{error:i})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===ls.active){this.client.logger.info("session request queue is already active.");return}const r=this.sessionRequestQueue.queue[0];if(!r){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=ls.active,this.emitSessionRequest(r)}catch(i){this.client.logger.error(i)}},this.emitSessionRequest=r=>{this.client.events.emit("session_request",r)},this.onPairingCreated=r=>{if(r.methods&&this.expectedPairingMethodMap.set(r.topic,r.methods),r.active)return;const i=this.client.proposal.getAll().find(n=>n.pairingTopic===r.topic);i&&this.onSessionProposeRequest({topic:r.topic,payload:sc("wc_sessionPropose",{requiredNamespaces:i.requiredNamespaces,optionalNamespaces:i.optionalNamespaces,relays:i.relays,proposer:i.proposer,sessionProperties:i.sessionProperties},i.id)})},this.isValidConnect=async r=>{if(!yi(r)){const{message:l}=Ee("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(r)}`);throw new Error(l)}const{pairingTopic:i,requiredNamespaces:n,optionalNamespaces:s,sessionProperties:a,relays:u}=r;if(ai(i)||await this.isValidPairingTopic(i),!TI(u,!0)){const{message:l}=Ee("MISSING_OR_INVALID",`connect() relays: ${u}`);throw new Error(l)}!ai(n)&&yu(n)!==0&&this.validateNamespaces(n,"requiredNamespaces"),!ai(s)&&yu(s)!==0&&this.validateNamespaces(s,"optionalNamespaces"),ai(a)||this.validateSessionProps(a,"sessionProperties")},this.validateNamespaces=(r,i)=>{const n=NI(r,"connect()",i);if(n)throw new Error(n.message)},this.isValidApprove=async r=>{if(!yi(r))throw new Error(Ee("MISSING_OR_INVALID",`approve() params: ${r}`).message);const{id:i,namespaces:n,relayProtocol:s,sessionProperties:a}=r;this.checkRecentlyDeleted(i),await this.isValidProposalId(i);const u=this.client.proposal.get(i),l=$d(n,"approve()");if(l)throw new Error(l.message);const d=pb(u.requiredNamespaces,n,"approve()");if(d)throw new Error(d.message);if(!mr(s,!0)){const{message:b}=Ee("MISSING_OR_INVALID",`approve() relayProtocol: ${s}`);throw new Error(b)}ai(a)||this.validateSessionProps(a,"sessionProperties")},this.isValidReject=async r=>{if(!yi(r)){const{message:s}=Ee("MISSING_OR_INVALID",`reject() params: ${r}`);throw new Error(s)}const{id:i,reason:n}=r;if(this.checkRecentlyDeleted(i),await this.isValidProposalId(i),!BI(n)){const{message:s}=Ee("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(n)}`);throw new Error(s)}},this.isValidSessionSettleRequest=r=>{if(!yi(r)){const{message:d}=Ee("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${r}`);throw new Error(d)}const{relay:i,controller:n,namespaces:s,expiry:a}=r;if(!lb(i)){const{message:d}=Ee("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw new Error(d)}const u=CI(n,"onSessionSettleRequest()");if(u)throw new Error(u.message);const l=$d(s,"onSessionSettleRequest()");if(l)throw new Error(l.message);if(eo(a)){const{message:d}=Ee("EXPIRED","onSessionSettleRequest()");throw new Error(d)}},this.isValidUpdate=async r=>{if(!yi(r)){const{message:l}=Ee("MISSING_OR_INVALID",`update() params: ${r}`);throw new Error(l)}const{topic:i,namespaces:n}=r;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const s=this.client.session.get(i),a=$d(n,"update()");if(a)throw new Error(a.message);const u=pb(s.requiredNamespaces,n,"update()");if(u)throw new Error(u.message)},this.isValidExtend=async r=>{if(!yi(r)){const{message:n}=Ee("MISSING_OR_INVALID",`extend() params: ${r}`);throw new Error(n)}const{topic:i}=r;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i)},this.isValidRequest=async r=>{if(!yi(r)){const{message:l}=Ee("MISSING_OR_INVALID",`request() params: ${r}`);throw new Error(l)}const{topic:i,request:n,chainId:s,expiry:a}=r;this.checkRecentlyDeleted(i),await this.isValidSessionTopic(i);const{namespaces:u}=this.client.session.get(i);if(!db(u,s)){const{message:l}=Ee("MISSING_OR_INVALID",`request() chainId: ${s}`);throw new Error(l)}if(!FI(n)){const{message:l}=Ee("MISSING_OR_INVALID",`request() ${JSON.stringify(n)}`);throw new Error(l)}if(!jI(u,s,n.method)){const{message:l}=Ee("MISSING_OR_INVALID",`request() method: ${n.method}`);throw new Error(l)}if(a&&!KI(a,r1)){const{message:l}=Ee("MISSING_OR_INVALID",`request() expiry: ${a}. Expiry must be a number (in seconds) between ${r1.min} and ${r1.max}`);throw new Error(l)}},this.isValidRespond=async r=>{var i;if(!yi(r)){const{message:a}=Ee("MISSING_OR_INVALID",`respond() params: ${r}`);throw new Error(a)}const{topic:n,response:s}=r;try{await this.isValidSessionTopic(n)}catch(a){throw(i=r?.response)!=null&&i.id&&this.cleanupAfterResponse(r),a}if(!UI(s)){const{message:a}=Ee("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(s)}`);throw new Error(a)}},this.isValidPing=async r=>{if(!yi(r)){const{message:n}=Ee("MISSING_OR_INVALID",`ping() params: ${r}`);throw new Error(n)}const{topic:i}=r;await this.isValidSessionOrPairingTopic(i)},this.isValidEmit=async r=>{if(!yi(r)){const{message:u}=Ee("MISSING_OR_INVALID",`emit() params: ${r}`);throw new Error(u)}const{topic:i,event:n,chainId:s}=r;await this.isValidSessionTopic(i);const{namespaces:a}=this.client.session.get(i);if(!db(a,s)){const{message:u}=Ee("MISSING_OR_INVALID",`emit() chainId: ${s}`);throw new Error(u)}if(!kI(n)){const{message:u}=Ee("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}if(!qI(a,s,n.name)){const{message:u}=Ee("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(n)}`);throw new Error(u)}},this.isValidDisconnect=async r=>{if(!yi(r)){const{message:n}=Ee("MISSING_OR_INVALID",`disconnect() params: ${r}`);throw new Error(n)}const{topic:i}=r;await this.isValidSessionOrPairingTopic(i)},this.isValidAuthenticate=r=>{const{chains:i,uri:n,domain:s,nonce:a}=r;if(!Array.isArray(i)||i.length===0)throw new Error("chains is required and must be a non-empty array");if(!mr(n,!1))throw new Error("uri is required parameter");if(!mr(s,!1))throw new Error("domain is required parameter");if(!mr(a,!1))throw new Error("nonce is required parameter");if([...new Set(i.map(l=>ru(l).namespace))].length>1)throw new Error("Multi-namespace requests are not supported. Please request single namespace only.");const{namespace:u}=ru(i[0]);if(u!=="eip155")throw new Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async r=>{const{attestationId:i,hash:n,encryptedId:s,metadata:a}=r,u={verified:{verifyUrl:a.verifyUrl||Du,validation:"UNKNOWN",origin:a.url||""}};try{const l=await this.client.core.verify.resolve({attestationId:i,hash:n,encryptedId:s,verifyUrl:a.verifyUrl});l&&(u.verified.origin=l.origin,u.verified.isScam=l.isScam,u.verified.validation=l.origin===new URL(a.url).origin?"VALID":"INVALID")}catch(l){this.client.logger.warn(l)}return this.client.logger.debug(`Verify context: ${JSON.stringify(u)}`),u},this.validateSessionProps=(r,i)=>{Object.values(r).forEach(n=>{if(!mr(n,!1)){const{message:s}=Ee("MISSING_OR_INVALID",`${i} must be in Record<string, string> format. Received: ${JSON.stringify(n)}`);throw new Error(s)}})},this.getPendingAuthRequest=r=>{const i=this.client.auth.requests.get(r);return typeof i=="object"?i:void 0},this.addToRecentlyDeleted=(r,i)=>{if(this.recentlyDeletedMap.set(r,i),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let n=0;const s=this.recentlyDeletedLimit/2;for(const a of this.recentlyDeletedMap.keys()){if(n++>=s)break;this.recentlyDeletedMap.delete(a)}}},this.checkRecentlyDeleted=r=>{const i=this.recentlyDeletedMap.get(r);if(i){const{message:n}=Ee("MISSING_OR_INVALID",`Record was recently deleted - ${i}: ${r}`);throw new Error(n)}}}async isInitialized(){if(!this.initialized){const{message:e}=Ee("NOT_INITIALIZED",this.name);throw new Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(Ei.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){const{topic:r,message:i,attestation:n}=e,{publicKey:s}=this.client.auth.authKeys.keys.includes(Ch)?this.client.auth.authKeys.get(Ch):{responseTopic:void 0,publicKey:void 0},a=await this.client.core.crypto.decode(r,i,{receiverPublicKey:s});try{Wd(a)?(this.client.core.history.set(r,a),this.onRelayEventRequest({topic:r,payload:a,attestation:n,encryptedId:$s(i)})):Sh(a)?(await this.client.core.history.resolve(a),await this.onRelayEventResponse({topic:r,payload:a}),this.client.core.history.delete(r,a.id)):this.onRelayEventUnknownPayload({topic:r,payload:a})}catch(u){this.client.logger.error(u)}}registerExpirerEvents(){this.client.core.expirer.on(tn.expired,async e=>{const{topic:r,id:i}=jv(e.target);if(i&&this.client.pendingRequest.keys.includes(i))return await this.deletePendingSessionRequest(i,Ee("EXPIRED"),!0);if(i&&this.client.auth.requests.keys.includes(i))return await this.deletePendingAuthRequest(i,Ee("EXPIRED"),!0);r?this.client.session.keys.includes(r)&&(await this.deleteSession({topic:r,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:r})):i&&(await this.deleteProposal(i,!0),this.client.events.emit("proposal_expire",{id:i}))})}registerPairingEvents(){this.client.core.pairing.events.on(oc.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(oc.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!mr(e,!1)){const{message:r}=Ee("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw new Error(r)}if(!this.client.core.pairing.pairings.keys.includes(e)){const{message:r}=Ee("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw new Error(r)}if(eo(this.client.core.pairing.pairings.get(e).expiry)){const{message:r}=Ee("EXPIRED",`pairing topic: ${e}`);throw new Error(r)}}async isValidSessionTopic(e){if(!mr(e,!1)){const{message:r}=Ee("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw new Error(r)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){const{message:r}=Ee("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw new Error(r)}if(eo(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});const{message:r}=Ee("EXPIRED",`session topic: ${e}`);throw new Error(r)}if(!this.client.core.crypto.keychain.has(e)){const{message:r}=Ee("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),new Error(r)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(mr(e,!1)){const{message:r}=Ee("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw new Error(r)}else{const{message:r}=Ee("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw new Error(r)}}async isValidProposalId(e){if(!LI(e)){const{message:r}=Ee("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw new Error(r)}if(!this.client.proposal.keys.includes(e)){const{message:r}=Ee("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw new Error(r)}if(eo(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);const{message:r}=Ee("EXPIRED",`proposal id: ${e}`);throw new Error(r)}}}class y$ extends Vo{constructor(e,r){super(e,r,i$,e1),this.core=e,this.logger=r}}class w$ extends Vo{constructor(e,r){super(e,r,n$,e1),this.core=e,this.logger=r}}class _$ extends Vo{constructor(e,r){super(e,r,o$,e1,i=>i.id),this.core=e,this.logger=r}}class E$ extends Vo{constructor(e,r){super(e,r,f$,Mh,()=>Ch),this.core=e,this.logger=r}}class A$ extends Vo{constructor(e,r){super(e,r,h$,Mh),this.core=e,this.logger=r}}class x$ extends Vo{constructor(e,r){super(e,r,l$,Mh,i=>i.id),this.core=e,this.logger=r}}class S${constructor(e,r){this.core=e,this.logger=r,this.authKeys=new E$(this.core,this.logger),this.pairingTopics=new A$(this.core,this.logger),this.requests=new x$(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class i1 extends pC{constructor(e){super(e),this.protocol=P3,this.version=$3,this.name=t1.name,this.events=new Br.exports.EventEmitter,this.on=(i,n)=>this.events.on(i,n),this.once=(i,n)=>this.events.once(i,n),this.off=(i,n)=>this.events.off(i,n),this.removeListener=(i,n)=>this.events.removeListener(i,n),this.removeAllListeners=i=>this.events.removeAllListeners(i),this.connect=async i=>{try{return await this.engine.connect(i)}catch(n){throw this.logger.error(n.message),n}},this.pair=async i=>{try{return await this.engine.pair(i)}catch(n){throw this.logger.error(n.message),n}},this.approve=async i=>{try{return await this.engine.approve(i)}catch(n){throw this.logger.error(n.message),n}},this.reject=async i=>{try{return await this.engine.reject(i)}catch(n){throw this.logger.error(n.message),n}},this.update=async i=>{try{return await this.engine.update(i)}catch(n){throw this.logger.error(n.message),n}},this.extend=async i=>{try{return await this.engine.extend(i)}catch(n){throw this.logger.error(n.message),n}},this.request=async i=>{try{return await this.engine.request(i)}catch(n){throw this.logger.error(n.message),n}},this.respond=async i=>{try{return await this.engine.respond(i)}catch(n){throw this.logger.error(n.message),n}},this.ping=async i=>{try{return await this.engine.ping(i)}catch(n){throw this.logger.error(n.message),n}},this.emit=async i=>{try{return await this.engine.emit(i)}catch(n){throw this.logger.error(n.message),n}},this.disconnect=async i=>{try{return await this.engine.disconnect(i)}catch(n){throw this.logger.error(n.message),n}},this.find=i=>{try{return this.engine.find(i)}catch(n){throw this.logger.error(n.message),n}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(i){throw this.logger.error(i.message),i}},this.authenticate=async i=>{try{return await this.engine.authenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.formatAuthMessage=i=>{try{return this.engine.formatAuthMessage(i)}catch(n){throw this.logger.error(n.message),n}},this.approveSessionAuthenticate=async i=>{try{return await this.engine.approveSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.rejectSessionAuthenticate=async i=>{try{return await this.engine.rejectSessionAuthenticate(i)}catch(n){throw this.logger.error(n.message),n}},this.name=e?.name||t1.name,this.metadata=e?.metadata||UE(),this.signConfig=e?.signConfig;const r=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:os(Eh({level:e?.logger||t1.logger}));this.core=e?.core||new r$(e),this.logger=ci(r,this.name),this.session=new w$(this.core,this.logger),this.proposal=new y$(this.core,this.logger),this.pendingRequest=new _$(this.core,this.logger),this.engine=new b$(this),this.auth=new S$(this.core,this.logger)}static async init(e){const r=new i1(e);return await r.initialize(),r}get context(){return _i(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),await this.auth.init(),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var n1={exports:{}};(function(t,e){var r=typeof self<"u"?self:Wr,i=function(){function s(){this.fetch=!1,this.DOMException=r.DOMException}return s.prototype=r,new s}();(function(s){(function(a){var u={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function l(h){return h&&DataView.prototype.isPrototypeOf(h)}if(u.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],b=ArrayBuffer.isView||function(h){return h&&d.indexOf(Object.prototype.toString.call(h))>-1};function w(h){if(typeof h!="string"&&(h=String(h)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(h))throw new TypeError("Invalid character in header field name");return h.toLowerCase()}function I(h){return typeof h!="string"&&(h=String(h)),h}function S(h){var v={next:function(){var E=h.shift();return{done:E===void 0,value:E}}};return u.iterable&&(v[Symbol.iterator]=function(){return v}),v}function D(h){this.map={},h instanceof D?h.forEach(function(v,E){this.append(E,v)},this):Array.isArray(h)?h.forEach(function(v){this.append(v[0],v[1])},this):h&&Object.getOwnPropertyNames(h).forEach(function(v){this.append(v,h[v])},this)}D.prototype.append=function(h,v){h=w(h),v=I(v);var E=this.map[h];this.map[h]=E?E+", "+v:v},D.prototype.delete=function(h){delete this.map[w(h)]},D.prototype.get=function(h){return h=w(h),this.has(h)?this.map[h]:null},D.prototype.has=function(h){return this.map.hasOwnProperty(w(h))},D.prototype.set=function(h,v){this.map[w(h)]=I(v)},D.prototype.forEach=function(h,v){for(var E in this.map)this.map.hasOwnProperty(E)&&h.call(v,this.map[E],E,this)},D.prototype.keys=function(){var h=[];return this.forEach(function(v,E){h.push(E)}),S(h)},D.prototype.values=function(){var h=[];return this.forEach(function(v){h.push(v)}),S(h)},D.prototype.entries=function(){var h=[];return this.forEach(function(v,E){h.push([E,v])}),S(h)},u.iterable&&(D.prototype[Symbol.iterator]=D.prototype.entries);function L(h){if(h.bodyUsed)return Promise.reject(new TypeError("Already read"));h.bodyUsed=!0}function K(h){return new Promise(function(v,E){h.onload=function(){v(h.result)},h.onerror=function(){E(h.error)}})}function H(h){var v=new FileReader,E=K(v);return v.readAsArrayBuffer(h),E}function U(h){var v=new FileReader,E=K(v);return v.readAsText(h),E}function W(h){for(var v=new Uint8Array(h),E=new Array(v.length),C=0;C<v.length;C++)E[C]=String.fromCharCode(v[C]);return E.join("")}function R(h){if(h.slice)return h.slice(0);var v=new Uint8Array(h.byteLength);return v.set(new Uint8Array(h)),v.buffer}function k(){return this.bodyUsed=!1,this._initBody=function(h){this._bodyInit=h,h?typeof h=="string"?this._bodyText=h:u.blob&&Blob.prototype.isPrototypeOf(h)?this._bodyBlob=h:u.formData&&FormData.prototype.isPrototypeOf(h)?this._bodyFormData=h:u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)?this._bodyText=h.toString():u.arrayBuffer&&u.blob&&l(h)?(this._bodyArrayBuffer=R(h.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(h)||b(h))?this._bodyArrayBuffer=R(h):this._bodyText=h=Object.prototype.toString.call(h):this._bodyText="",this.headers.get("content-type")||(typeof h=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):u.searchParams&&URLSearchParams.prototype.isPrototypeOf(h)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},u.blob&&(this.blob=function(){var h=L(this);if(h)return h;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?L(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(H)}),this.text=function(){var h=L(this);if(h)return h;if(this._bodyBlob)return U(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(W(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},u.formData&&(this.formData=function(){return this.text().then(X)}),this.json=function(){return this.text().then(JSON.parse)},this}var z=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function _(h){var v=h.toUpperCase();return z.indexOf(v)>-1?v:h}function B(h,v){v=v||{};var E=v.body;if(h instanceof B){if(h.bodyUsed)throw new TypeError("Already read");this.url=h.url,this.credentials=h.credentials,v.headers||(this.headers=new D(h.headers)),this.method=h.method,this.mode=h.mode,this.signal=h.signal,!E&&h._bodyInit!=null&&(E=h._bodyInit,h.bodyUsed=!0)}else this.url=String(h);if(this.credentials=v.credentials||this.credentials||"same-origin",(v.headers||!this.headers)&&(this.headers=new D(v.headers)),this.method=_(v.method||this.method||"GET"),this.mode=v.mode||this.mode||null,this.signal=v.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&E)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(E)}B.prototype.clone=function(){return new B(this,{body:this._bodyInit})};function X(h){var v=new FormData;return h.trim().split("&").forEach(function(E){if(E){var C=E.split("="),P=C.shift().replace(/\+/g," "),M=C.join("=").replace(/\+/g," ");v.append(decodeURIComponent(P),decodeURIComponent(M))}}),v}function re(h){var v=new D,E=h.replace(/\r?\n[\t ]+/g," ");return E.split(/\r?\n/).forEach(function(C){var P=C.split(":"),M=P.shift().trim();if(M){var g=P.join(":").trim();v.append(M,g)}}),v}k.call(B.prototype);function T(h,v){v||(v={}),this.type="default",this.status=v.status===void 0?200:v.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in v?v.statusText:"OK",this.headers=new D(v.headers),this.url=v.url||"",this._initBody(h)}k.call(T.prototype),T.prototype.clone=function(){return new T(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new D(this.headers),url:this.url})},T.error=function(){var h=new T(null,{status:0,statusText:""});return h.type="error",h};var y=[301,302,303,307,308];T.redirect=function(h,v){if(y.indexOf(v)===-1)throw new RangeError("Invalid status code");return new T(null,{status:v,headers:{location:h}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(v,E){this.message=v,this.name=E;var C=Error(v);this.stack=C.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function f(h,v){return new Promise(function(E,C){var P=new B(h,v);if(P.signal&&P.signal.aborted)return C(new a.DOMException("Aborted","AbortError"));var M=new XMLHttpRequest;function g(){M.abort()}M.onload=function(){var m={status:M.status,statusText:M.statusText,headers:re(M.getAllResponseHeaders()||"")};m.url="responseURL"in M?M.responseURL:m.headers.get("X-Request-URL");var N="response"in M?M.response:M.responseText;E(new T(N,m))},M.onerror=function(){C(new TypeError("Network request failed"))},M.ontimeout=function(){C(new TypeError("Network request failed"))},M.onabort=function(){C(new a.DOMException("Aborted","AbortError"))},M.open(P.method,P.url,!0),P.credentials==="include"?M.withCredentials=!0:P.credentials==="omit"&&(M.withCredentials=!1),"responseType"in M&&u.blob&&(M.responseType="blob"),P.headers.forEach(function(m,N){M.setRequestHeader(N,m)}),P.signal&&(P.signal.addEventListener("abort",g),M.onreadystatechange=function(){M.readyState===4&&P.signal.removeEventListener("abort",g)}),M.send(typeof P._bodyInit>"u"?null:P._bodyInit)})}return f.polyfill=!0,s.fetch||(s.fetch=f,s.Headers=D,s.Request=B,s.Response=T),a.Headers=D,a.Request=B,a.Response=T,a.fetch=f,Object.defineProperty(a,"__esModule",{value:!0}),a})({})})(i),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var n=i;e=n.fetch,e.default=n.fetch,e.fetch=n.fetch,e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response,t.exports=e})(n1,n1.exports);var F3=Rw(n1.exports),I$=Object.defineProperty,M$=Object.defineProperties,C$=Object.getOwnPropertyDescriptors,U3=Object.getOwnPropertySymbols,D$=Object.prototype.hasOwnProperty,O$=Object.prototype.propertyIsEnumerable,k3=(t,e,r)=>e in t?I$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,j3=(t,e)=>{for(var r in e||(e={}))D$.call(e,r)&&k3(t,r,e[r]);if(U3)for(var r of U3(e))O$.call(e,r)&&k3(t,r,e[r]);return t},q3=(t,e)=>M$(t,C$(e));const P$={Accept:"application/json","Content-Type":"application/json"},$$="POST",z3={headers:P$,method:$$},H3=10;class ds{constructor(e,r=!1){if(this.url=e,this.disableProviderPing=r,this.events=new Br.exports.EventEmitter,this.isAvailable=!1,this.registering=!1,!qb(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=r}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}off(e,r){this.events.off(e,r)}removeListener(e,r){this.events.removeListener(e,r)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw new Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{const r=Is(e),i=await(await F3(this.url,q3(j3({},z3),{body:r}))).json();this.onPayload({data:i})}catch(r){this.onError(e.id,r)}}async register(e=this.url){if(!qb(e))throw new Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){const r=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=r||this.events.listenerCount("open")>=r)&&this.events.setMaxListeners(r+1),new Promise((i,n)=>{this.events.once("register_error",s=>{this.resetMaxListeners(),n(s)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return n(new Error("HTTP connection is missing or invalid"));i()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){const r=Is({id:1,jsonrpc:"2.0",method:"test",params:[]});await F3(e,q3(j3({},z3),{body:r}))}this.onOpen()}catch(r){const i=this.parseError(r);throw this.events.emit("register_error",i),this.onClose(),i}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;const r=typeof e.data=="string"?qa(e.data):e.data;this.events.emit("payload",r)}onError(e,r){const i=this.parseError(r),n=i.message||i.toString(),s=xh(e,n);this.events.emit("payload",s)}parseError(e,r=this.url){return Lb(e,r,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>H3&&this.events.setMaxListeners(H3)}}const K3="error",R$="wss://relay.walletconnect.com",N$="wc",T$="universal_provider",W3=`${N$}@2:${T$}:`,L$="https://rpc.walletconnect.com/v1/",uc="generic",In={DEFAULT_CHAIN_CHANGED:"default_chain_changed"};var Ru=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s1={exports:{}};/**
44
44
  * @license
45
45
  * Lodash <https://lodash.com/>
46
46
  * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
47
47
  * Released under MIT license <https://lodash.com/license>
48
48
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
49
49
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
50
- */(function(t,e){(function(){var r,i="4.17.21",n=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",d=500,b="__lodash_placeholder__",w=1,S=2,I=4,D=1,L=2,K=1,H=2,U=4,W=8,R=16,k=32,z=64,_=128,B=256,X=512,re=30,T="...",y=800,f=16,h=1,v=2,E=3,C=1/0,P=9007199254740991,M=17976931348623157e292,g=0/0,m=4294967295,N=m-1,ee=m>>>1,ae=[["ary",_],["bind",K],["bindKey",H],["curry",W],["curryRight",R],["flip",X],["partial",k],["partialRight",z],["rearg",B]],O="[object Arguments]",te="[object Array]",q="[object AsyncFunction]",G="[object Boolean]",Y="[object Date]",A="[object DOMException]",V="[object Error]",oe="[object Function]",ue="[object GeneratorFunction]",he="[object Map]",ye="[object Number]",we="[object Null]",Re="[object Object]",Xe="[object Promise]",Oe="[object Proxy]",Ne="[object RegExp]",Me="[object Set]",be="[object String]",Pe="[object Symbol]",Te="[object Undefined]",ve="[object WeakMap]",$e="[object WeakSet]",xe="[object ArrayBuffer]",me="[object DataView]",Ue="[object Float32Array]",Ce="[object Float64Array]",_e="[object Int8Array]",Ke="[object Int16Array]",Ve="[object Int32Array]",Ae="[object Uint8Array]",We="[object Uint8ClampedArray]",pt="[object Uint16Array]",Ge="[object Uint32Array]",It=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,Je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ot=/&(?:amp|lt|gt|quot|#39);/g,Tt=/[&<>"']/g,Le=RegExp(Ot.source),et=RegExp(Tt.source),it=/<%-([\s\S]+?)%>/g,Be=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,je=/^\w*$/,ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,qe=RegExp(nt.source),st=/^\s+/,at=/\s/,Fe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ze=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,jt=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,ct=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_t=/\w*$/,Qr=/^[-+]0x[0-9a-f]+$/i,Zr=/^0b[01]+$/i,Xr=/^\[object .+?Constructor\]$/,ei=/^0o[0-7]+$/i,ti=/^(?:0|[1-9]\d*)$/,pr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Si=/($^)/,Cn=/['\n\r\u2028\u2029\\]/g,Ii="\\ud800-\\udfff",Dn="\\u0300-\\u036f",On="\\ufe20-\\ufe2f",Mi="\\u20d0-\\u20ff",nn=Dn+On+Mi,sn="\\u2700-\\u27bf",Ir="a-z\\xdf-\\xf6\\xf8-\\xff",Pn="\\xac\\xb1\\xd7\\xf7",$n="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Rn="\\u2000-\\u206f",fa=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",al="A-Z\\xc0-\\xd6\\xd8-\\xde",cl="\\ufe0e\\ufe0f",ha=Pn+$n+Rn+fa,Xu="['\u2019]",la="["+Ii+"]",ef="["+ha+"]",da="["+nn+"]",ul="\\d+",_p="["+sn+"]",fl="["+Ir+"]",hl="[^"+Ii+ha+ul+sn+Ir+al+"]",Cc="\\ud83c[\\udffb-\\udfff]",Ep="(?:"+da+"|"+Cc+")",ll="[^"+Ii+"]",Dc="(?:\\ud83c[\\udde6-\\uddff]){2}",bo="[\\ud800-\\udbff][\\udc00-\\udfff]",ki="["+al+"]",dl="\\u200d",pl="(?:"+fl+"|"+hl+")",bs="(?:"+ki+"|"+hl+")",gl="(?:"+Xu+"(?:d|ll|m|re|s|t|ve))?",vl="(?:"+Xu+"(?:D|LL|M|RE|S|T|VE))?",ml=Ep+"?",bl="["+cl+"]?",Ap="(?:"+dl+"(?:"+[ll,Dc,bo].join("|")+")"+bl+ml+")*",Us="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",wl=bl+ml+Ap,Oc="(?:"+[_p,Dc,bo].join("|")+")"+wl,xp="(?:"+[ll+da+"?",da,Dc,bo,la].join("|")+")",tf=RegExp(Xu,"g"),Sp=RegExp(da,"g"),Pc=RegExp(Cc+"(?="+Cc+")|"+xp+wl,"g"),_l=RegExp([ki+"?"+fl+"+"+gl+"(?="+[ef,ki,"$"].join("|")+")",bs+"+"+vl+"(?="+[ef,ki+pl,"$"].join("|")+")",ki+"?"+pl+"+"+gl,ki+"+"+vl,yl,Us,ul,Oc].join("|"),"g"),El=RegExp("["+dl+Ii+nn+cl+"]"),pa=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Al=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ip=-1,Zt={};Zt[Ue]=Zt[Ce]=Zt[_e]=Zt[Ke]=Zt[Ve]=Zt[Ae]=Zt[We]=Zt[pt]=Zt[Ge]=!0,Zt[O]=Zt[te]=Zt[xe]=Zt[G]=Zt[me]=Zt[Y]=Zt[V]=Zt[oe]=Zt[he]=Zt[ye]=Zt[Re]=Zt[Ne]=Zt[Me]=Zt[be]=Zt[ve]=!1;var Qt={};Qt[O]=Qt[te]=Qt[xe]=Qt[me]=Qt[G]=Qt[Y]=Qt[Ue]=Qt[Ce]=Qt[_e]=Qt[Ke]=Qt[Ve]=Qt[he]=Qt[ye]=Qt[Re]=Qt[Ne]=Qt[Me]=Qt[be]=Qt[Pe]=Qt[Ae]=Qt[We]=Qt[pt]=Qt[Ge]=!0,Qt[V]=Qt[oe]=Qt[ve]=!1;var J={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xt=parseFloat,bt=parseInt,or=typeof Ru=="object"&&Ru&&Ru.Object===Object&&Ru,Er=typeof self=="object"&&self&&self.Object===Object&&self,Ft=or||Er||Function("return this")(),er=e&&!e.nodeType&&e,yr=er&&!0&&t&&!t.nodeType&&t,Ci=yr&&yr.exports===er,Ar=Ci&&or.process,ar=function(){try{var ne=yr&&yr.require&&yr.require("util").types;return ne||Ar&&Ar.binding&&Ar.binding("util")}catch{}}(),hi=ar&&ar.isArrayBuffer,Nn=ar&&ar.isDate,on=ar&&ar.isMap,ys=ar&&ar.isRegExp,rf=ar&&ar.isSet,ga=ar&&ar.isTypedArray;function Tr(ne,fe,ce){switch(ce.length){case 0:return ne.call(fe);case 1:return ne.call(fe,ce[0]);case 2:return ne.call(fe,ce[0],ce[1]);case 3:return ne.call(fe,ce[0],ce[1],ce[2])}return ne.apply(fe,ce)}function cF(ne,fe,ce,He){for(var vt=-1,Ht=ne==null?0:ne.length;++vt<Ht;){var Mr=ne[vt];fe(He,Mr,ce(Mr),ne)}return He}function an(ne,fe){for(var ce=-1,He=ne==null?0:ne.length;++ce<He&&fe(ne[ce],ce,ne)!==!1;);return ne}function uF(ne,fe){for(var ce=ne==null?0:ne.length;ce--&&fe(ne[ce],ce,ne)!==!1;);return ne}function Ly(ne,fe){for(var ce=-1,He=ne==null?0:ne.length;++ce<He;)if(!fe(ne[ce],ce,ne))return!1;return!0}function yo(ne,fe){for(var ce=-1,He=ne==null?0:ne.length,vt=0,Ht=[];++ce<He;){var Mr=ne[ce];fe(Mr,ce,ne)&&(Ht[vt++]=Mr)}return Ht}function xl(ne,fe){var ce=ne==null?0:ne.length;return!!ce&&$c(ne,fe,0)>-1}function Mp(ne,fe,ce){for(var He=-1,vt=ne==null?0:ne.length;++He<vt;)if(ce(fe,ne[He]))return!0;return!1}function cr(ne,fe){for(var ce=-1,He=ne==null?0:ne.length,vt=Array(He);++ce<He;)vt[ce]=fe(ne[ce],ce,ne);return vt}function wo(ne,fe){for(var ce=-1,He=fe.length,vt=ne.length;++ce<He;)ne[vt+ce]=fe[ce];return ne}function Cp(ne,fe,ce,He){var vt=-1,Ht=ne==null?0:ne.length;for(He&&Ht&&(ce=ne[++vt]);++vt<Ht;)ce=fe(ce,ne[vt],vt,ne);return ce}function fF(ne,fe,ce,He){var vt=ne==null?0:ne.length;for(He&&vt&&(ce=ne[--vt]);vt--;)ce=fe(ce,ne[vt],vt,ne);return ce}function Dp(ne,fe){for(var ce=-1,He=ne==null?0:ne.length;++ce<He;)if(fe(ne[ce],ce,ne))return!0;return!1}var hF=Op("length");function lF(ne){return ne.split("")}function dF(ne){return ne.match(ze)||[]}function By(ne,fe,ce){var He;return ce(ne,function(vt,Ht,Mr){if(fe(vt,Ht,Mr))return He=Ht,!1}),He}function Sl(ne,fe,ce,He){for(var vt=ne.length,Ht=ce+(He?1:-1);He?Ht--:++Ht<vt;)if(fe(ne[Ht],Ht,ne))return Ht;return-1}function $c(ne,fe,ce){return fe===fe?SF(ne,fe,ce):Sl(ne,Fy,ce)}function pF(ne,fe,ce,He){for(var vt=ce-1,Ht=ne.length;++vt<Ht;)if(He(ne[vt],fe))return vt;return-1}function Fy(ne){return ne!==ne}function Uy(ne,fe){var ce=ne==null?0:ne.length;return ce?$p(ne,fe)/ce:g}function Op(ne){return function(fe){return fe==null?r:fe[ne]}}function Pp(ne){return function(fe){return ne==null?r:ne[fe]}}function ky(ne,fe,ce,He,vt){return vt(ne,function(Ht,Mr,tr){ce=He?(He=!1,Ht):fe(ce,Ht,Mr,tr)}),ce}function gF(ne,fe){var ce=ne.length;for(ne.sort(fe);ce--;)ne[ce]=ne[ce].value;return ne}function $p(ne,fe){for(var ce,He=-1,vt=ne.length;++He<vt;){var Ht=fe(ne[He]);Ht!==r&&(ce=ce===r?Ht:ce+Ht)}return ce}function Rp(ne,fe){for(var ce=-1,He=Array(ne);++ce<ne;)He[ce]=fe(ce);return He}function vF(ne,fe){return cr(fe,function(ce){return[ce,ne[ce]]})}function jy(ne){return ne&&ne.slice(0,Ky(ne)+1).replace(st,"")}function ji(ne){return function(fe){return ne(fe)}}function Np(ne,fe){return cr(fe,function(ce){return ne[ce]})}function nf(ne,fe){return ne.has(fe)}function qy(ne,fe){for(var ce=-1,He=ne.length;++ce<He&&$c(fe,ne[ce],0)>-1;);return ce}function zy(ne,fe){for(var ce=ne.length;ce--&&$c(fe,ne[ce],0)>-1;);return ce}function mF(ne,fe){for(var ce=ne.length,He=0;ce--;)ne[ce]===fe&&++He;return He}var bF=Pp(J),yF=Pp(ie);function wF(ne){return"\\"+ke[ne]}function _F(ne,fe){return ne==null?r:ne[fe]}function Rc(ne){return El.test(ne)}function EF(ne){return pa.test(ne)}function AF(ne){for(var fe,ce=[];!(fe=ne.next()).done;)ce.push(fe.value);return ce}function Tp(ne){var fe=-1,ce=Array(ne.size);return ne.forEach(function(He,vt){ce[++fe]=[vt,He]}),ce}function Hy(ne,fe){return function(ce){return ne(fe(ce))}}function _o(ne,fe){for(var ce=-1,He=ne.length,vt=0,Ht=[];++ce<He;){var Mr=ne[ce];(Mr===fe||Mr===b)&&(ne[ce]=b,Ht[vt++]=ce)}return Ht}function Il(ne){var fe=-1,ce=Array(ne.size);return ne.forEach(function(He){ce[++fe]=He}),ce}function xF(ne){var fe=-1,ce=Array(ne.size);return ne.forEach(function(He){ce[++fe]=[He,He]}),ce}function SF(ne,fe,ce){for(var He=ce-1,vt=ne.length;++He<vt;)if(ne[He]===fe)return He;return-1}function IF(ne,fe,ce){for(var He=ce+1;He--;)if(ne[He]===fe)return He;return He}function Nc(ne){return Rc(ne)?CF(ne):hF(ne)}function Tn(ne){return Rc(ne)?DF(ne):lF(ne)}function Ky(ne){for(var fe=ne.length;fe--&&at.test(ne.charAt(fe)););return fe}var MF=Pp(pe);function CF(ne){for(var fe=Pc.lastIndex=0;Pc.test(ne);)++fe;return fe}function DF(ne){return ne.match(Pc)||[]}function OF(ne){return ne.match(_l)||[]}var PF=function ne(fe){fe=fe==null?Ft:Tc.defaults(Ft.Object(),fe,Tc.pick(Ft,Al));var ce=fe.Array,He=fe.Date,vt=fe.Error,Ht=fe.Function,Mr=fe.Math,tr=fe.Object,Lp=fe.RegExp,$F=fe.String,cn=fe.TypeError,Ml=ce.prototype,RF=Ht.prototype,Lc=tr.prototype,Cl=fe["__core-js_shared__"],Dl=RF.toString,Yt=Lc.hasOwnProperty,NF=0,Wy=function(){var o=/[^.]+$/.exec(Cl&&Cl.keys&&Cl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Ol=Lc.toString,TF=Dl.call(tr),LF=Ft._,BF=Lp("^"+Dl.call(Yt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pl=Ci?fe.Buffer:r,Eo=fe.Symbol,$l=fe.Uint8Array,Vy=Pl?Pl.allocUnsafe:r,Rl=Hy(tr.getPrototypeOf,tr),Gy=tr.create,Yy=Lc.propertyIsEnumerable,Nl=Ml.splice,Jy=Eo?Eo.isConcatSpreadable:r,sf=Eo?Eo.iterator:r,va=Eo?Eo.toStringTag:r,Tl=function(){try{var o=_a(tr,"defineProperty");return o({},"",{}),o}catch{}}(),FF=fe.clearTimeout!==Ft.clearTimeout&&fe.clearTimeout,UF=He&&He.now!==Ft.Date.now&&He.now,kF=fe.setTimeout!==Ft.setTimeout&&fe.setTimeout,Ll=Mr.ceil,Bl=Mr.floor,Bp=tr.getOwnPropertySymbols,jF=Pl?Pl.isBuffer:r,Qy=fe.isFinite,qF=Ml.join,zF=Hy(tr.keys,tr),Cr=Mr.max,ri=Mr.min,HF=He.now,KF=fe.parseInt,Zy=Mr.random,WF=Ml.reverse,Fp=_a(fe,"DataView"),of=_a(fe,"Map"),Up=_a(fe,"Promise"),Bc=_a(fe,"Set"),af=_a(fe,"WeakMap"),cf=_a(tr,"create"),Fl=af&&new af,Fc={},VF=Ea(Fp),GF=Ea(of),YF=Ea(Up),JF=Ea(Bc),QF=Ea(af),Ul=Eo?Eo.prototype:r,uf=Ul?Ul.valueOf:r,Xy=Ul?Ul.toString:r;function F(o){if(gr(o)&&!yt(o)&&!(o instanceof Lt)){if(o instanceof un)return o;if(Yt.call(o,"__wrapped__"))return ew(o)}return new un(o)}var Uc=function(){function o(){}return function(c){if(!fr(c))return{};if(Gy)return Gy(c);o.prototype=c;var p=new o;return o.prototype=r,p}}();function kl(){}function un(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=r}F.templateSettings={escape:it,evaluate:Be,interpolate:rt,variable:"",imports:{_:F}},F.prototype=kl.prototype,F.prototype.constructor=F,un.prototype=Uc(kl.prototype),un.prototype.constructor=un;function Lt(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function ZF(){var o=new Lt(this.__wrapped__);return o.__actions__=Di(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Di(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Di(this.__views__),o}function XF(){if(this.__filtered__){var o=new Lt(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function eU(){var o=this.__wrapped__.value(),c=this.__dir__,p=yt(o),x=c<0,$=p?o.length:0,j=lk(0,$,this.__views__),Q=j.start,Z=j.end,se=Z-Q,le=x?Z:Q-1,de=this.__iteratees__,ge=de.length,De=0,Ye=ri(se,this.__takeCount__);if(!p||!x&&$==se&&Ye==se)return A5(o,this.__actions__);var ut=[];e:for(;se--&&De<Ye;){le+=c;for(var St=-1,ft=o[le];++St<ge;){var Pt=de[St],Ut=Pt.iteratee,Hi=Pt.type,pi=Ut(ft);if(Hi==v)ft=pi;else if(!pi){if(Hi==h)continue e;break e}}ut[De++]=ft}return ut}Lt.prototype=Uc(kl.prototype),Lt.prototype.constructor=Lt;function ma(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var x=o[c];this.set(x[0],x[1])}}function tU(){this.__data__=cf?cf(null):{},this.size=0}function rU(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function iU(o){var c=this.__data__;if(cf){var p=c[o];return p===l?r:p}return Yt.call(c,o)?c[o]:r}function nU(o){var c=this.__data__;return cf?c[o]!==r:Yt.call(c,o)}function sU(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=cf&&c===r?l:c,this}ma.prototype.clear=tU,ma.prototype.delete=rU,ma.prototype.get=iU,ma.prototype.has=nU,ma.prototype.set=sU;function ks(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var x=o[c];this.set(x[0],x[1])}}function oU(){this.__data__=[],this.size=0}function aU(o){var c=this.__data__,p=jl(c,o);if(p<0)return!1;var x=c.length-1;return p==x?c.pop():Nl.call(c,p,1),--this.size,!0}function cU(o){var c=this.__data__,p=jl(c,o);return p<0?r:c[p][1]}function uU(o){return jl(this.__data__,o)>-1}function fU(o,c){var p=this.__data__,x=jl(p,o);return x<0?(++this.size,p.push([o,c])):p[x][1]=c,this}ks.prototype.clear=oU,ks.prototype.delete=aU,ks.prototype.get=cU,ks.prototype.has=uU,ks.prototype.set=fU;function js(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var x=o[c];this.set(x[0],x[1])}}function hU(){this.size=0,this.__data__={hash:new ma,map:new(of||ks),string:new ma}}function lU(o){var c=Xl(this,o).delete(o);return this.size-=c?1:0,c}function dU(o){return Xl(this,o).get(o)}function pU(o){return Xl(this,o).has(o)}function gU(o,c){var p=Xl(this,o),x=p.size;return p.set(o,c),this.size+=p.size==x?0:1,this}js.prototype.clear=hU,js.prototype.delete=lU,js.prototype.get=dU,js.prototype.has=pU,js.prototype.set=gU;function ba(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new js;++c<p;)this.add(o[c])}function vU(o){return this.__data__.set(o,l),this}function mU(o){return this.__data__.has(o)}ba.prototype.add=ba.prototype.push=vU,ba.prototype.has=mU;function Ln(o){var c=this.__data__=new ks(o);this.size=c.size}function bU(){this.__data__=new ks,this.size=0}function yU(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function wU(o){return this.__data__.get(o)}function _U(o){return this.__data__.has(o)}function EU(o,c){var p=this.__data__;if(p instanceof ks){var x=p.__data__;if(!of||x.length<n-1)return x.push([o,c]),this.size=++p.size,this;p=this.__data__=new js(x)}return p.set(o,c),this.size=p.size,this}Ln.prototype.clear=bU,Ln.prototype.delete=yU,Ln.prototype.get=wU,Ln.prototype.has=_U,Ln.prototype.set=EU;function e5(o,c){var p=yt(o),x=!p&&Aa(o),$=!p&&!x&&Mo(o),j=!p&&!x&&!$&&zc(o),Q=p||x||$||j,Z=Q?Rp(o.length,$F):[],se=Z.length;for(var le in o)(c||Yt.call(o,le))&&!(Q&&(le=="length"||$&&(le=="offset"||le=="parent")||j&&(le=="buffer"||le=="byteLength"||le=="byteOffset")||Ks(le,se)))&&Z.push(le);return Z}function t5(o){var c=o.length;return c?o[Jp(0,c-1)]:r}function AU(o,c){return e0(Di(o),ya(c,0,o.length))}function xU(o){return e0(Di(o))}function kp(o,c,p){(p!==r&&!Bn(o[c],p)||p===r&&!(c in o))&&qs(o,c,p)}function ff(o,c,p){var x=o[c];(!(Yt.call(o,c)&&Bn(x,p))||p===r&&!(c in o))&&qs(o,c,p)}function jl(o,c){for(var p=o.length;p--;)if(Bn(o[p][0],c))return p;return-1}function SU(o,c,p,x){return Ao(o,function($,j,Q){c(x,$,p($),Q)}),x}function r5(o,c){return o&&_s(c,Lr(c),o)}function IU(o,c){return o&&_s(c,Pi(c),o)}function qs(o,c,p){c=="__proto__"&&Tl?Tl(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function jp(o,c){for(var p=-1,x=c.length,$=ce(x),j=o==null;++p<x;)$[p]=j?r:_g(o,c[p]);return $}function ya(o,c,p){return o===o&&(p!==r&&(o=o<=p?o:p),c!==r&&(o=o>=c?o:c)),o}function fn(o,c,p,x,$,j){var Q,Z=c&w,se=c&S,le=c&I;if(p&&(Q=$?p(o,x,$,j):p(o)),Q!==r)return Q;if(!fr(o))return o;var de=yt(o);if(de){if(Q=pk(o),!Z)return Di(o,Q)}else{var ge=ii(o),De=ge==oe||ge==ue;if(Mo(o))return I5(o,Z);if(ge==Re||ge==O||De&&!$){if(Q=se||De?{}:K5(o),!Z)return se?ik(o,IU(Q,o)):rk(o,r5(Q,o))}else{if(!Qt[ge])return $?o:{};Q=gk(o,ge,Z)}}j||(j=new Ln);var Ye=j.get(o);if(Ye)return Ye;j.set(o,Q),ww(o)?o.forEach(function(ft){Q.add(fn(ft,c,p,ft,o,j))}):bw(o)&&o.forEach(function(ft,Pt){Q.set(Pt,fn(ft,c,p,Pt,o,j))});var ut=le?se?ag:og:se?Pi:Lr,St=de?r:ut(o);return an(St||o,function(ft,Pt){St&&(Pt=ft,ft=o[Pt]),ff(Q,Pt,fn(ft,c,p,Pt,o,j))}),Q}function MU(o){var c=Lr(o);return function(p){return i5(p,o,c)}}function i5(o,c,p){var x=p.length;if(o==null)return!x;for(o=tr(o);x--;){var $=p[x],j=c[$],Q=o[$];if(Q===r&&!($ in o)||!j(Q))return!1}return!0}function n5(o,c,p){if(typeof o!="function")throw new cn(a);return mf(function(){o.apply(r,p)},c)}function hf(o,c,p,x){var $=-1,j=xl,Q=!0,Z=o.length,se=[],le=c.length;if(!Z)return se;p&&(c=cr(c,ji(p))),x?(j=Mp,Q=!1):c.length>=n&&(j=nf,Q=!1,c=new ba(c));e:for(;++$<Z;){var de=o[$],ge=p==null?de:p(de);if(de=x||de!==0?de:0,Q&&ge===ge){for(var De=le;De--;)if(c[De]===ge)continue e;se.push(de)}else j(c,ge,x)||se.push(de)}return se}var Ao=P5(ws),s5=P5(zp,!0);function CU(o,c){var p=!0;return Ao(o,function(x,$,j){return p=!!c(x,$,j),p}),p}function ql(o,c,p){for(var x=-1,$=o.length;++x<$;){var j=o[x],Q=c(j);if(Q!=null&&(Z===r?Q===Q&&!zi(Q):p(Q,Z)))var Z=Q,se=j}return se}function DU(o,c,p,x){var $=o.length;for(p=xt(p),p<0&&(p=-p>$?0:$+p),x=x===r||x>$?$:xt(x),x<0&&(x+=$),x=p>x?0:Ew(x);p<x;)o[p++]=c;return o}function o5(o,c){var p=[];return Ao(o,function(x,$,j){c(x,$,j)&&p.push(x)}),p}function Kr(o,c,p,x,$){var j=-1,Q=o.length;for(p||(p=mk),$||($=[]);++j<Q;){var Z=o[j];c>0&&p(Z)?c>1?Kr(Z,c-1,p,x,$):wo($,Z):x||($[$.length]=Z)}return $}var qp=$5(),a5=$5(!0);function ws(o,c){return o&&qp(o,c,Lr)}function zp(o,c){return o&&a5(o,c,Lr)}function zl(o,c){return yo(c,function(p){return Ws(o[p])})}function wa(o,c){c=So(c,o);for(var p=0,x=c.length;o!=null&&p<x;)o=o[Es(c[p++])];return p&&p==x?o:r}function c5(o,c,p){var x=c(o);return yt(o)?x:wo(x,p(o))}function li(o){return o==null?o===r?Te:we:va&&va in tr(o)?hk(o):xk(o)}function Hp(o,c){return o>c}function OU(o,c){return o!=null&&Yt.call(o,c)}function PU(o,c){return o!=null&&c in tr(o)}function $U(o,c,p){return o>=ri(c,p)&&o<Cr(c,p)}function Kp(o,c,p){for(var x=p?Mp:xl,$=o[0].length,j=o.length,Q=j,Z=ce(j),se=1/0,le=[];Q--;){var de=o[Q];Q&&c&&(de=cr(de,ji(c))),se=ri(de.length,se),Z[Q]=!p&&(c||$>=120&&de.length>=120)?new ba(Q&&de):r}de=o[0];var ge=-1,De=Z[0];e:for(;++ge<$&&le.length<se;){var Ye=de[ge],ut=c?c(Ye):Ye;if(Ye=p||Ye!==0?Ye:0,!(De?nf(De,ut):x(le,ut,p))){for(Q=j;--Q;){var St=Z[Q];if(!(St?nf(St,ut):x(o[Q],ut,p)))continue e}De&&De.push(ut),le.push(Ye)}}return le}function RU(o,c,p,x){return ws(o,function($,j,Q){c(x,p($),j,Q)}),x}function lf(o,c,p){c=So(c,o),o=Y5(o,c);var x=o==null?o:o[Es(ln(c))];return x==null?r:Tr(x,o,p)}function u5(o){return gr(o)&&li(o)==O}function NU(o){return gr(o)&&li(o)==xe}function TU(o){return gr(o)&&li(o)==Y}function df(o,c,p,x,$){return o===c?!0:o==null||c==null||!gr(o)&&!gr(c)?o!==o&&c!==c:LU(o,c,p,x,df,$)}function LU(o,c,p,x,$,j){var Q=yt(o),Z=yt(c),se=Q?te:ii(o),le=Z?te:ii(c);se=se==O?Re:se,le=le==O?Re:le;var de=se==Re,ge=le==Re,De=se==le;if(De&&Mo(o)){if(!Mo(c))return!1;Q=!0,de=!1}if(De&&!de)return j||(j=new Ln),Q||zc(o)?q5(o,c,p,x,$,j):uk(o,c,se,p,x,$,j);if(!(p&D)){var Ye=de&&Yt.call(o,"__wrapped__"),ut=ge&&Yt.call(c,"__wrapped__");if(Ye||ut){var St=Ye?o.value():o,ft=ut?c.value():c;return j||(j=new Ln),$(St,ft,p,x,j)}}return De?(j||(j=new Ln),fk(o,c,p,x,$,j)):!1}function BU(o){return gr(o)&&ii(o)==he}function Wp(o,c,p,x){var $=p.length,j=$,Q=!x;if(o==null)return!j;for(o=tr(o);$--;){var Z=p[$];if(Q&&Z[2]?Z[1]!==o[Z[0]]:!(Z[0]in o))return!1}for(;++$<j;){Z=p[$];var se=Z[0],le=o[se],de=Z[1];if(Q&&Z[2]){if(le===r&&!(se in o))return!1}else{var ge=new Ln;if(x)var De=x(le,de,se,o,c,ge);if(!(De===r?df(de,le,D|L,x,ge):De))return!1}}return!0}function f5(o){if(!fr(o)||yk(o))return!1;var c=Ws(o)?BF:Xr;return c.test(Ea(o))}function FU(o){return gr(o)&&li(o)==Ne}function UU(o){return gr(o)&&ii(o)==Me}function kU(o){return gr(o)&&o0(o.length)&&!!Zt[li(o)]}function h5(o){return typeof o=="function"?o:o==null?$i:typeof o=="object"?yt(o)?p5(o[0],o[1]):d5(o):Rw(o)}function Vp(o){if(!vf(o))return zF(o);var c=[];for(var p in tr(o))Yt.call(o,p)&&p!="constructor"&&c.push(p);return c}function jU(o){if(!fr(o))return Ak(o);var c=vf(o),p=[];for(var x in o)x=="constructor"&&(c||!Yt.call(o,x))||p.push(x);return p}function Gp(o,c){return o<c}function l5(o,c){var p=-1,x=Oi(o)?ce(o.length):[];return Ao(o,function($,j,Q){x[++p]=c($,j,Q)}),x}function d5(o){var c=ug(o);return c.length==1&&c[0][2]?V5(c[0][0],c[0][1]):function(p){return p===o||Wp(p,o,c)}}function p5(o,c){return hg(o)&&W5(c)?V5(Es(o),c):function(p){var x=_g(p,o);return x===r&&x===c?Eg(p,o):df(c,x,D|L)}}function Hl(o,c,p,x,$){o!==c&&qp(c,function(j,Q){if($||($=new Ln),fr(j))qU(o,c,Q,p,Hl,x,$);else{var Z=x?x(dg(o,Q),j,Q+"",o,c,$):r;Z===r&&(Z=j),kp(o,Q,Z)}},Pi)}function qU(o,c,p,x,$,j,Q){var Z=dg(o,p),se=dg(c,p),le=Q.get(se);if(le){kp(o,p,le);return}var de=j?j(Z,se,p+"",o,c,Q):r,ge=de===r;if(ge){var De=yt(se),Ye=!De&&Mo(se),ut=!De&&!Ye&&zc(se);de=se,De||Ye||ut?yt(Z)?de=Z:wr(Z)?de=Di(Z):Ye?(ge=!1,de=I5(se,!0)):ut?(ge=!1,de=M5(se,!0)):de=[]:bf(se)||Aa(se)?(de=Z,Aa(Z)?de=Aw(Z):(!fr(Z)||Ws(Z))&&(de=K5(se))):ge=!1}ge&&(Q.set(se,de),$(de,se,x,j,Q),Q.delete(se)),kp(o,p,de)}function g5(o,c){var p=o.length;if(p)return c+=c<0?p:0,Ks(c,p)?o[c]:r}function v5(o,c,p){c.length?c=cr(c,function(j){return yt(j)?function(Q){return wa(Q,j.length===1?j[0]:j)}:j}):c=[$i];var x=-1;c=cr(c,ji(ot()));var $=l5(o,function(j,Q,Z){var se=cr(c,function(le){return le(j)});return{criteria:se,index:++x,value:j}});return gF($,function(j,Q){return tk(j,Q,p)})}function zU(o,c){return m5(o,c,function(p,x){return Eg(o,x)})}function m5(o,c,p){for(var x=-1,$=c.length,j={};++x<$;){var Q=c[x],Z=wa(o,Q);p(Z,Q)&&pf(j,So(Q,o),Z)}return j}function HU(o){return function(c){return wa(c,o)}}function Yp(o,c,p,x){var $=x?pF:$c,j=-1,Q=c.length,Z=o;for(o===c&&(c=Di(c)),p&&(Z=cr(o,ji(p)));++j<Q;)for(var se=0,le=c[j],de=p?p(le):le;(se=$(Z,de,se,x))>-1;)Z!==o&&Nl.call(Z,se,1),Nl.call(o,se,1);return o}function b5(o,c){for(var p=o?c.length:0,x=p-1;p--;){var $=c[p];if(p==x||$!==j){var j=$;Ks($)?Nl.call(o,$,1):Xp(o,$)}}return o}function Jp(o,c){return o+Bl(Zy()*(c-o+1))}function KU(o,c,p,x){for(var $=-1,j=Cr(Ll((c-o)/(p||1)),0),Q=ce(j);j--;)Q[x?j:++$]=o,o+=p;return Q}function Qp(o,c){var p="";if(!o||c<1||c>P)return p;do c%2&&(p+=o),c=Bl(c/2),c&&(o+=o);while(c);return p}function Mt(o,c){return pg(G5(o,c,$i),o+"")}function WU(o){return t5(Hc(o))}function VU(o,c){var p=Hc(o);return e0(p,ya(c,0,p.length))}function pf(o,c,p,x){if(!fr(o))return o;c=So(c,o);for(var $=-1,j=c.length,Q=j-1,Z=o;Z!=null&&++$<j;){var se=Es(c[$]),le=p;if(se==="__proto__"||se==="constructor"||se==="prototype")return o;if($!=Q){var de=Z[se];le=x?x(de,se,Z):r,le===r&&(le=fr(de)?de:Ks(c[$+1])?[]:{})}ff(Z,se,le),Z=Z[se]}return o}var y5=Fl?function(o,c){return Fl.set(o,c),o}:$i,GU=Tl?function(o,c){return Tl(o,"toString",{configurable:!0,enumerable:!1,value:xg(c),writable:!0})}:$i;function YU(o){return e0(Hc(o))}function hn(o,c,p){var x=-1,$=o.length;c<0&&(c=-c>$?0:$+c),p=p>$?$:p,p<0&&(p+=$),$=c>p?0:p-c>>>0,c>>>=0;for(var j=ce($);++x<$;)j[x]=o[x+c];return j}function JU(o,c){var p;return Ao(o,function(x,$,j){return p=c(x,$,j),!p}),!!p}function Kl(o,c,p){var x=0,$=o==null?x:o.length;if(typeof c=="number"&&c===c&&$<=ee){for(;x<$;){var j=x+$>>>1,Q=o[j];Q!==null&&!zi(Q)&&(p?Q<=c:Q<c)?x=j+1:$=j}return $}return Zp(o,c,$i,p)}function Zp(o,c,p,x){var $=0,j=o==null?0:o.length;if(j===0)return 0;c=p(c);for(var Q=c!==c,Z=c===null,se=zi(c),le=c===r;$<j;){var de=Bl(($+j)/2),ge=p(o[de]),De=ge!==r,Ye=ge===null,ut=ge===ge,St=zi(ge);if(Q)var ft=x||ut;else le?ft=ut&&(x||De):Z?ft=ut&&De&&(x||!Ye):se?ft=ut&&De&&!Ye&&(x||!St):Ye||St?ft=!1:ft=x?ge<=c:ge<c;ft?$=de+1:j=de}return ri(j,N)}function w5(o,c){for(var p=-1,x=o.length,$=0,j=[];++p<x;){var Q=o[p],Z=c?c(Q):Q;if(!p||!Bn(Z,se)){var se=Z;j[$++]=Q===0?0:Q}}return j}function _5(o){return typeof o=="number"?o:zi(o)?g:+o}function qi(o){if(typeof o=="string")return o;if(yt(o))return cr(o,qi)+"";if(zi(o))return Xy?Xy.call(o):"";var c=o+"";return c=="0"&&1/o==-C?"-0":c}function xo(o,c,p){var x=-1,$=xl,j=o.length,Q=!0,Z=[],se=Z;if(p)Q=!1,$=Mp;else if(j>=n){var le=c?null:ak(o);if(le)return Il(le);Q=!1,$=nf,se=new ba}else se=c?[]:Z;e:for(;++x<j;){var de=o[x],ge=c?c(de):de;if(de=p||de!==0?de:0,Q&&ge===ge){for(var De=se.length;De--;)if(se[De]===ge)continue e;c&&se.push(ge),Z.push(de)}else $(se,ge,p)||(se!==Z&&se.push(ge),Z.push(de))}return Z}function Xp(o,c){return c=So(c,o),o=Y5(o,c),o==null||delete o[Es(ln(c))]}function E5(o,c,p,x){return pf(o,c,p(wa(o,c)),x)}function Wl(o,c,p,x){for(var $=o.length,j=x?$:-1;(x?j--:++j<$)&&c(o[j],j,o););return p?hn(o,x?0:j,x?j+1:$):hn(o,x?j+1:0,x?$:j)}function A5(o,c){var p=o;return p instanceof Lt&&(p=p.value()),Cp(c,function(x,$){return $.func.apply($.thisArg,wo([x],$.args))},p)}function eg(o,c,p){var x=o.length;if(x<2)return x?xo(o[0]):[];for(var $=-1,j=ce(x);++$<x;)for(var Q=o[$],Z=-1;++Z<x;)Z!=$&&(j[$]=hf(j[$]||Q,o[Z],c,p));return xo(Kr(j,1),c,p)}function x5(o,c,p){for(var x=-1,$=o.length,j=c.length,Q={};++x<$;){var Z=x<j?c[x]:r;p(Q,o[x],Z)}return Q}function tg(o){return wr(o)?o:[]}function rg(o){return typeof o=="function"?o:$i}function So(o,c){return yt(o)?o:hg(o,c)?[o]:X5(Vt(o))}var QU=Mt;function Io(o,c,p){var x=o.length;return p=p===r?x:p,!c&&p>=x?o:hn(o,c,p)}var S5=FF||function(o){return Ft.clearTimeout(o)};function I5(o,c){if(c)return o.slice();var p=o.length,x=Vy?Vy(p):new o.constructor(p);return o.copy(x),x}function ig(o){var c=new o.constructor(o.byteLength);return new $l(c).set(new $l(o)),c}function ZU(o,c){var p=c?ig(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function XU(o){var c=new o.constructor(o.source,_t.exec(o));return c.lastIndex=o.lastIndex,c}function ek(o){return uf?tr(uf.call(o)):{}}function M5(o,c){var p=c?ig(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function C5(o,c){if(o!==c){var p=o!==r,x=o===null,$=o===o,j=zi(o),Q=c!==r,Z=c===null,se=c===c,le=zi(c);if(!Z&&!le&&!j&&o>c||j&&Q&&se&&!Z&&!le||x&&Q&&se||!p&&se||!$)return 1;if(!x&&!j&&!le&&o<c||le&&p&&$&&!x&&!j||Z&&p&&$||!Q&&$||!se)return-1}return 0}function tk(o,c,p){for(var x=-1,$=o.criteria,j=c.criteria,Q=$.length,Z=p.length;++x<Q;){var se=C5($[x],j[x]);if(se){if(x>=Z)return se;var le=p[x];return se*(le=="desc"?-1:1)}}return o.index-c.index}function D5(o,c,p,x){for(var $=-1,j=o.length,Q=p.length,Z=-1,se=c.length,le=Cr(j-Q,0),de=ce(se+le),ge=!x;++Z<se;)de[Z]=c[Z];for(;++$<Q;)(ge||$<j)&&(de[p[$]]=o[$]);for(;le--;)de[Z++]=o[$++];return de}function O5(o,c,p,x){for(var $=-1,j=o.length,Q=-1,Z=p.length,se=-1,le=c.length,de=Cr(j-Z,0),ge=ce(de+le),De=!x;++$<de;)ge[$]=o[$];for(var Ye=$;++se<le;)ge[Ye+se]=c[se];for(;++Q<Z;)(De||$<j)&&(ge[Ye+p[Q]]=o[$++]);return ge}function Di(o,c){var p=-1,x=o.length;for(c||(c=ce(x));++p<x;)c[p]=o[p];return c}function _s(o,c,p,x){var $=!p;p||(p={});for(var j=-1,Q=c.length;++j<Q;){var Z=c[j],se=x?x(p[Z],o[Z],Z,p,o):r;se===r&&(se=o[Z]),$?qs(p,Z,se):ff(p,Z,se)}return p}function rk(o,c){return _s(o,fg(o),c)}function ik(o,c){return _s(o,z5(o),c)}function Vl(o,c){return function(p,x){var $=yt(p)?cF:SU,j=c?c():{};return $(p,o,ot(x,2),j)}}function kc(o){return Mt(function(c,p){var x=-1,$=p.length,j=$>1?p[$-1]:r,Q=$>2?p[2]:r;for(j=o.length>3&&typeof j=="function"?($--,j):r,Q&&di(p[0],p[1],Q)&&(j=$<3?r:j,$=1),c=tr(c);++x<$;){var Z=p[x];Z&&o(c,Z,x,j)}return c})}function P5(o,c){return function(p,x){if(p==null)return p;if(!Oi(p))return o(p,x);for(var $=p.length,j=c?$:-1,Q=tr(p);(c?j--:++j<$)&&x(Q[j],j,Q)!==!1;);return p}}function $5(o){return function(c,p,x){for(var $=-1,j=tr(c),Q=x(c),Z=Q.length;Z--;){var se=Q[o?Z:++$];if(p(j[se],se,j)===!1)break}return c}}function nk(o,c,p){var x=c&K,$=gf(o);function j(){var Q=this&&this!==Ft&&this instanceof j?$:o;return Q.apply(x?p:this,arguments)}return j}function R5(o){return function(c){c=Vt(c);var p=Rc(c)?Tn(c):r,x=p?p[0]:c.charAt(0),$=p?Io(p,1).join(""):c.slice(1);return x[o]()+$}}function jc(o){return function(c){return Cp(Pw(Ow(c).replace(tf,"")),o,"")}}function gf(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=Uc(o.prototype),x=o.apply(p,c);return fr(x)?x:p}}function sk(o,c,p){var x=gf(o);function $(){for(var j=arguments.length,Q=ce(j),Z=j,se=qc($);Z--;)Q[Z]=arguments[Z];var le=j<3&&Q[0]!==se&&Q[j-1]!==se?[]:_o(Q,se);if(j-=le.length,j<p)return F5(o,c,Gl,$.placeholder,r,Q,le,r,r,p-j);var de=this&&this!==Ft&&this instanceof $?x:o;return Tr(de,this,Q)}return $}function N5(o){return function(c,p,x){var $=tr(c);if(!Oi(c)){var j=ot(p,3);c=Lr(c),p=function(Z){return j($[Z],Z,$)}}var Q=o(c,p,x);return Q>-1?$[j?c[Q]:Q]:r}}function T5(o){return Hs(function(c){var p=c.length,x=p,$=un.prototype.thru;for(o&&c.reverse();x--;){var j=c[x];if(typeof j!="function")throw new cn(a);if($&&!Q&&Zl(j)=="wrapper")var Q=new un([],!0)}for(x=Q?x:p;++x<p;){j=c[x];var Z=Zl(j),se=Z=="wrapper"?cg(j):r;se&&lg(se[0])&&se[1]==(_|W|k|B)&&!se[4].length&&se[9]==1?Q=Q[Zl(se[0])].apply(Q,se[3]):Q=j.length==1&&lg(j)?Q[Z]():Q.thru(j)}return function(){var le=arguments,de=le[0];if(Q&&le.length==1&&yt(de))return Q.plant(de).value();for(var ge=0,De=p?c[ge].apply(this,le):de;++ge<p;)De=c[ge].call(this,De);return De}})}function Gl(o,c,p,x,$,j,Q,Z,se,le){var de=c&_,ge=c&K,De=c&H,Ye=c&(W|R),ut=c&X,St=De?r:gf(o);function ft(){for(var Pt=arguments.length,Ut=ce(Pt),Hi=Pt;Hi--;)Ut[Hi]=arguments[Hi];if(Ye)var pi=qc(ft),Ki=mF(Ut,pi);if(x&&(Ut=D5(Ut,x,$,Ye)),j&&(Ut=O5(Ut,j,Q,Ye)),Pt-=Ki,Ye&&Pt<le){var _r=_o(Ut,pi);return F5(o,c,Gl,ft.placeholder,p,Ut,_r,Z,se,le-Pt)}var Fn=ge?p:this,Gs=De?Fn[o]:o;return Pt=Ut.length,Z?Ut=Sk(Ut,Z):ut&&Pt>1&&Ut.reverse(),de&&se<Pt&&(Ut.length=se),this&&this!==Ft&&this instanceof ft&&(Gs=St||gf(Gs)),Gs.apply(Fn,Ut)}return ft}function L5(o,c){return function(p,x){return RU(p,o,c(x),{})}}function Yl(o,c){return function(p,x){var $;if(p===r&&x===r)return c;if(p!==r&&($=p),x!==r){if($===r)return x;typeof p=="string"||typeof x=="string"?(p=qi(p),x=qi(x)):(p=_5(p),x=_5(x)),$=o(p,x)}return $}}function ng(o){return Hs(function(c){return c=cr(c,ji(ot())),Mt(function(p){var x=this;return o(c,function($){return Tr($,x,p)})})})}function Jl(o,c){c=c===r?" ":qi(c);var p=c.length;if(p<2)return p?Qp(c,o):c;var x=Qp(c,Ll(o/Nc(c)));return Rc(c)?Io(Tn(x),0,o).join(""):x.slice(0,o)}function ok(o,c,p,x){var $=c&K,j=gf(o);function Q(){for(var Z=-1,se=arguments.length,le=-1,de=x.length,ge=ce(de+se),De=this&&this!==Ft&&this instanceof Q?j:o;++le<de;)ge[le]=x[le];for(;se--;)ge[le++]=arguments[++Z];return Tr(De,$?p:this,ge)}return Q}function B5(o){return function(c,p,x){return x&&typeof x!="number"&&di(c,p,x)&&(p=x=r),c=Vs(c),p===r?(p=c,c=0):p=Vs(p),x=x===r?c<p?1:-1:Vs(x),KU(c,p,x,o)}}function Ql(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=dn(c),p=dn(p)),o(c,p)}}function F5(o,c,p,x,$,j,Q,Z,se,le){var de=c&W,ge=de?Q:r,De=de?r:Q,Ye=de?j:r,ut=de?r:j;c|=de?k:z,c&=~(de?z:k),c&U||(c&=~(K|H));var St=[o,c,$,Ye,ge,ut,De,Z,se,le],ft=p.apply(r,St);return lg(o)&&J5(ft,St),ft.placeholder=x,Q5(ft,o,c)}function sg(o){var c=Mr[o];return function(p,x){if(p=dn(p),x=x==null?0:ri(xt(x),292),x&&Qy(p)){var $=(Vt(p)+"e").split("e"),j=c($[0]+"e"+(+$[1]+x));return $=(Vt(j)+"e").split("e"),+($[0]+"e"+(+$[1]-x))}return c(p)}}var ak=Bc&&1/Il(new Bc([,-0]))[1]==C?function(o){return new Bc(o)}:Mg;function U5(o){return function(c){var p=ii(c);return p==he?Tp(c):p==Me?xF(c):vF(c,o(c))}}function zs(o,c,p,x,$,j,Q,Z){var se=c&H;if(!se&&typeof o!="function")throw new cn(a);var le=x?x.length:0;if(le||(c&=~(k|z),x=$=r),Q=Q===r?Q:Cr(xt(Q),0),Z=Z===r?Z:xt(Z),le-=$?$.length:0,c&z){var de=x,ge=$;x=$=r}var De=se?r:cg(o),Ye=[o,c,p,x,$,de,ge,j,Q,Z];if(De&&Ek(Ye,De),o=Ye[0],c=Ye[1],p=Ye[2],x=Ye[3],$=Ye[4],Z=Ye[9]=Ye[9]===r?se?0:o.length:Cr(Ye[9]-le,0),!Z&&c&(W|R)&&(c&=~(W|R)),!c||c==K)var ut=nk(o,c,p);else c==W||c==R?ut=sk(o,c,Z):(c==k||c==(K|k))&&!$.length?ut=ok(o,c,p,x):ut=Gl.apply(r,Ye);var St=De?y5:J5;return Q5(St(ut,Ye),o,c)}function k5(o,c,p,x){return o===r||Bn(o,Lc[p])&&!Yt.call(x,p)?c:o}function j5(o,c,p,x,$,j){return fr(o)&&fr(c)&&(j.set(c,o),Hl(o,c,r,j5,j),j.delete(c)),o}function ck(o){return bf(o)?r:o}function q5(o,c,p,x,$,j){var Q=p&D,Z=o.length,se=c.length;if(Z!=se&&!(Q&&se>Z))return!1;var le=j.get(o),de=j.get(c);if(le&&de)return le==c&&de==o;var ge=-1,De=!0,Ye=p&L?new ba:r;for(j.set(o,c),j.set(c,o);++ge<Z;){var ut=o[ge],St=c[ge];if(x)var ft=Q?x(St,ut,ge,c,o,j):x(ut,St,ge,o,c,j);if(ft!==r){if(ft)continue;De=!1;break}if(Ye){if(!Dp(c,function(Pt,Ut){if(!nf(Ye,Ut)&&(ut===Pt||$(ut,Pt,p,x,j)))return Ye.push(Ut)})){De=!1;break}}else if(!(ut===St||$(ut,St,p,x,j))){De=!1;break}}return j.delete(o),j.delete(c),De}function uk(o,c,p,x,$,j,Q){switch(p){case me:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case xe:return!(o.byteLength!=c.byteLength||!j(new $l(o),new $l(c)));case G:case Y:case ye:return Bn(+o,+c);case V:return o.name==c.name&&o.message==c.message;case Ne:case be:return o==c+"";case he:var Z=Tp;case Me:var se=x&D;if(Z||(Z=Il),o.size!=c.size&&!se)return!1;var le=Q.get(o);if(le)return le==c;x|=L,Q.set(o,c);var de=q5(Z(o),Z(c),x,$,j,Q);return Q.delete(o),de;case Pe:if(uf)return uf.call(o)==uf.call(c)}return!1}function fk(o,c,p,x,$,j){var Q=p&D,Z=og(o),se=Z.length,le=og(c),de=le.length;if(se!=de&&!Q)return!1;for(var ge=se;ge--;){var De=Z[ge];if(!(Q?De in c:Yt.call(c,De)))return!1}var Ye=j.get(o),ut=j.get(c);if(Ye&&ut)return Ye==c&&ut==o;var St=!0;j.set(o,c),j.set(c,o);for(var ft=Q;++ge<se;){De=Z[ge];var Pt=o[De],Ut=c[De];if(x)var Hi=Q?x(Ut,Pt,De,c,o,j):x(Pt,Ut,De,o,c,j);if(!(Hi===r?Pt===Ut||$(Pt,Ut,p,x,j):Hi)){St=!1;break}ft||(ft=De=="constructor")}if(St&&!ft){var pi=o.constructor,Ki=c.constructor;pi!=Ki&&"constructor"in o&&"constructor"in c&&!(typeof pi=="function"&&pi instanceof pi&&typeof Ki=="function"&&Ki instanceof Ki)&&(St=!1)}return j.delete(o),j.delete(c),St}function Hs(o){return pg(G5(o,r,iw),o+"")}function og(o){return c5(o,Lr,fg)}function ag(o){return c5(o,Pi,z5)}var cg=Fl?function(o){return Fl.get(o)}:Mg;function Zl(o){for(var c=o.name+"",p=Fc[c],x=Yt.call(Fc,c)?p.length:0;x--;){var $=p[x],j=$.func;if(j==null||j==o)return $.name}return c}function qc(o){var c=Yt.call(F,"placeholder")?F:o;return c.placeholder}function ot(){var o=F.iteratee||Sg;return o=o===Sg?h5:o,arguments.length?o(arguments[0],arguments[1]):o}function Xl(o,c){var p=o.__data__;return bk(c)?p[typeof c=="string"?"string":"hash"]:p.map}function ug(o){for(var c=Lr(o),p=c.length;p--;){var x=c[p],$=o[x];c[p]=[x,$,W5($)]}return c}function _a(o,c){var p=_F(o,c);return f5(p)?p:r}function hk(o){var c=Yt.call(o,va),p=o[va];try{o[va]=r;var x=!0}catch{}var $=Ol.call(o);return x&&(c?o[va]=p:delete o[va]),$}var fg=Bp?function(o){return o==null?[]:(o=tr(o),yo(Bp(o),function(c){return Yy.call(o,c)}))}:Cg,z5=Bp?function(o){for(var c=[];o;)wo(c,fg(o)),o=Rl(o);return c}:Cg,ii=li;(Fp&&ii(new Fp(new ArrayBuffer(1)))!=me||of&&ii(new of)!=he||Up&&ii(Up.resolve())!=Xe||Bc&&ii(new Bc)!=Me||af&&ii(new af)!=ve)&&(ii=function(o){var c=li(o),p=c==Re?o.constructor:r,x=p?Ea(p):"";if(x)switch(x){case VF:return me;case GF:return he;case YF:return Xe;case JF:return Me;case QF:return ve}return c});function lk(o,c,p){for(var x=-1,$=p.length;++x<$;){var j=p[x],Q=j.size;switch(j.type){case"drop":o+=Q;break;case"dropRight":c-=Q;break;case"take":c=ri(c,o+Q);break;case"takeRight":o=Cr(o,c-Q);break}}return{start:o,end:c}}function dk(o){var c=o.match(Ze);return c?c[1].split(lt):[]}function H5(o,c,p){c=So(c,o);for(var x=-1,$=c.length,j=!1;++x<$;){var Q=Es(c[x]);if(!(j=o!=null&&p(o,Q)))break;o=o[Q]}return j||++x!=$?j:($=o==null?0:o.length,!!$&&o0($)&&Ks(Q,$)&&(yt(o)||Aa(o)))}function pk(o){var c=o.length,p=new o.constructor(c);return c&&typeof o[0]=="string"&&Yt.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function K5(o){return typeof o.constructor=="function"&&!vf(o)?Uc(Rl(o)):{}}function gk(o,c,p){var x=o.constructor;switch(c){case xe:return ig(o);case G:case Y:return new x(+o);case me:return ZU(o,p);case Ue:case Ce:case _e:case Ke:case Ve:case Ae:case We:case pt:case Ge:return M5(o,p);case he:return new x;case ye:case be:return new x(o);case Ne:return XU(o);case Me:return new x;case Pe:return ek(o)}}function vk(o,c){var p=c.length;if(!p)return o;var x=p-1;return c[x]=(p>1?"& ":"")+c[x],c=c.join(p>2?", ":" "),o.replace(Fe,`{
50
+ */(function(t,e){(function(){var r,i="4.17.21",n=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",u="Invalid `variable` option passed into `_.template`",l="__lodash_hash_undefined__",d=500,b="__lodash_placeholder__",w=1,I=2,S=4,D=1,L=2,K=1,H=2,U=4,W=8,R=16,k=32,z=64,_=128,B=256,X=512,re=30,T="...",y=800,f=16,h=1,v=2,E=3,C=1/0,P=9007199254740991,M=17976931348623157e292,g=0/0,m=4294967295,N=m-1,ee=m>>>1,ae=[["ary",_],["bind",K],["bindKey",H],["curry",W],["curryRight",R],["flip",X],["partial",k],["partialRight",z],["rearg",B]],O="[object Arguments]",te="[object Array]",q="[object AsyncFunction]",G="[object Boolean]",Y="[object Date]",A="[object DOMException]",V="[object Error]",oe="[object Function]",ue="[object GeneratorFunction]",he="[object Map]",ye="[object Number]",we="[object Null]",Re="[object Object]",Xe="[object Promise]",Oe="[object Proxy]",Ne="[object RegExp]",Me="[object Set]",be="[object String]",Pe="[object Symbol]",Te="[object Undefined]",ve="[object WeakMap]",$e="[object WeakSet]",xe="[object ArrayBuffer]",me="[object DataView]",Ue="[object Float32Array]",Ce="[object Float64Array]",_e="[object Int8Array]",Ke="[object Int16Array]",Ve="[object Int32Array]",Ae="[object Uint8Array]",We="[object Uint8ClampedArray]",pt="[object Uint16Array]",Ge="[object Uint32Array]",It=/\b__p \+= '';/g,gt=/\b(__p \+=) '' \+/g,Je=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ot=/&(?:amp|lt|gt|quot|#39);/g,Tt=/[&<>"']/g,Le=RegExp(Ot.source),et=RegExp(Tt.source),it=/<%-([\s\S]+?)%>/g,Be=/<%([\s\S]+?)%>/g,rt=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,je=/^\w*$/,ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nt=/[\\^$.*+?()[\]{}|]/g,qe=RegExp(nt.source),st=/^\s+/,at=/\s/,Fe=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ze=/\{\n\/\* \[wrapped with (.+)\] \*/,lt=/,? & /,ze=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,jt=/[()=,{}\[\]\/\s]/,qt=/\\(\\)?/g,ct=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,_t=/\w*$/,Qr=/^[-+]0x[0-9a-f]+$/i,Zr=/^0b[01]+$/i,Xr=/^\[object .+?Constructor\]$/,ei=/^0o[0-7]+$/i,ti=/^(?:0|[1-9]\d*)$/,pr=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Si=/($^)/,Cn=/['\n\r\u2028\u2029\\]/g,Ii="\\ud800-\\udfff",Dn="\\u0300-\\u036f",On="\\ufe20-\\ufe2f",Mi="\\u20d0-\\u20ff",nn=Dn+On+Mi,sn="\\u2700-\\u27bf",Ir="a-z\\xdf-\\xf6\\xf8-\\xff",Pn="\\xac\\xb1\\xd7\\xf7",$n="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Rn="\\u2000-\\u206f",fa=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",cl="A-Z\\xc0-\\xd6\\xd8-\\xde",ul="\\ufe0e\\ufe0f",ha=Pn+$n+Rn+fa,Xu="['\u2019]",la="["+Ii+"]",ef="["+ha+"]",da="["+nn+"]",fl="\\d+",_p="["+sn+"]",hl="["+Ir+"]",ll="[^"+Ii+ha+fl+sn+Ir+cl+"]",Cc="\\ud83c[\\udffb-\\udfff]",Ep="(?:"+da+"|"+Cc+")",dl="[^"+Ii+"]",Dc="(?:\\ud83c[\\udde6-\\uddff]){2}",bo="[\\ud800-\\udbff][\\udc00-\\udfff]",ki="["+cl+"]",pl="\\u200d",gl="(?:"+hl+"|"+ll+")",bs="(?:"+ki+"|"+ll+")",vl="(?:"+Xu+"(?:d|ll|m|re|s|t|ve))?",ml="(?:"+Xu+"(?:D|LL|M|RE|S|T|VE))?",bl=Ep+"?",yl="["+ul+"]?",Ap="(?:"+pl+"(?:"+[dl,Dc,bo].join("|")+")"+yl+bl+")*",Us="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",wl="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",_l=yl+bl+Ap,Oc="(?:"+[_p,Dc,bo].join("|")+")"+_l,xp="(?:"+[dl+da+"?",da,Dc,bo,la].join("|")+")",tf=RegExp(Xu,"g"),Sp=RegExp(da,"g"),Pc=RegExp(Cc+"(?="+Cc+")|"+xp+_l,"g"),El=RegExp([ki+"?"+hl+"+"+vl+"(?="+[ef,ki,"$"].join("|")+")",bs+"+"+ml+"(?="+[ef,ki+gl,"$"].join("|")+")",ki+"?"+gl+"+"+vl,ki+"+"+ml,wl,Us,fl,Oc].join("|"),"g"),Al=RegExp("["+pl+Ii+nn+ul+"]"),pa=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,xl=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ip=-1,Zt={};Zt[Ue]=Zt[Ce]=Zt[_e]=Zt[Ke]=Zt[Ve]=Zt[Ae]=Zt[We]=Zt[pt]=Zt[Ge]=!0,Zt[O]=Zt[te]=Zt[xe]=Zt[G]=Zt[me]=Zt[Y]=Zt[V]=Zt[oe]=Zt[he]=Zt[ye]=Zt[Re]=Zt[Ne]=Zt[Me]=Zt[be]=Zt[ve]=!1;var Qt={};Qt[O]=Qt[te]=Qt[xe]=Qt[me]=Qt[G]=Qt[Y]=Qt[Ue]=Qt[Ce]=Qt[_e]=Qt[Ke]=Qt[Ve]=Qt[he]=Qt[ye]=Qt[Re]=Qt[Ne]=Qt[Me]=Qt[be]=Qt[Pe]=Qt[Ae]=Qt[We]=Qt[pt]=Qt[Ge]=!0,Qt[V]=Qt[oe]=Qt[ve]=!1;var J={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},ie={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},pe={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},ke={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Xt=parseFloat,bt=parseInt,or=typeof Ru=="object"&&Ru&&Ru.Object===Object&&Ru,Er=typeof self=="object"&&self&&self.Object===Object&&self,Ft=or||Er||Function("return this")(),er=e&&!e.nodeType&&e,yr=er&&!0&&t&&!t.nodeType&&t,Ci=yr&&yr.exports===er,Ar=Ci&&or.process,ar=function(){try{var ne=yr&&yr.require&&yr.require("util").types;return ne||Ar&&Ar.binding&&Ar.binding("util")}catch{}}(),hi=ar&&ar.isArrayBuffer,Nn=ar&&ar.isDate,on=ar&&ar.isMap,ys=ar&&ar.isRegExp,rf=ar&&ar.isSet,ga=ar&&ar.isTypedArray;function Tr(ne,fe,ce){switch(ce.length){case 0:return ne.call(fe);case 1:return ne.call(fe,ce[0]);case 2:return ne.call(fe,ce[0],ce[1]);case 3:return ne.call(fe,ce[0],ce[1],ce[2])}return ne.apply(fe,ce)}function XB(ne,fe,ce,He){for(var vt=-1,Ht=ne==null?0:ne.length;++vt<Ht;){var Mr=ne[vt];fe(He,Mr,ce(Mr),ne)}return He}function an(ne,fe){for(var ce=-1,He=ne==null?0:ne.length;++ce<He&&fe(ne[ce],ce,ne)!==!1;);return ne}function eF(ne,fe){for(var ce=ne==null?0:ne.length;ce--&&fe(ne[ce],ce,ne)!==!1;);return ne}function Ny(ne,fe){for(var ce=-1,He=ne==null?0:ne.length;++ce<He;)if(!fe(ne[ce],ce,ne))return!1;return!0}function yo(ne,fe){for(var ce=-1,He=ne==null?0:ne.length,vt=0,Ht=[];++ce<He;){var Mr=ne[ce];fe(Mr,ce,ne)&&(Ht[vt++]=Mr)}return Ht}function Sl(ne,fe){var ce=ne==null?0:ne.length;return!!ce&&$c(ne,fe,0)>-1}function Mp(ne,fe,ce){for(var He=-1,vt=ne==null?0:ne.length;++He<vt;)if(ce(fe,ne[He]))return!0;return!1}function cr(ne,fe){for(var ce=-1,He=ne==null?0:ne.length,vt=Array(He);++ce<He;)vt[ce]=fe(ne[ce],ce,ne);return vt}function wo(ne,fe){for(var ce=-1,He=fe.length,vt=ne.length;++ce<He;)ne[vt+ce]=fe[ce];return ne}function Cp(ne,fe,ce,He){var vt=-1,Ht=ne==null?0:ne.length;for(He&&Ht&&(ce=ne[++vt]);++vt<Ht;)ce=fe(ce,ne[vt],vt,ne);return ce}function tF(ne,fe,ce,He){var vt=ne==null?0:ne.length;for(He&&vt&&(ce=ne[--vt]);vt--;)ce=fe(ce,ne[vt],vt,ne);return ce}function Dp(ne,fe){for(var ce=-1,He=ne==null?0:ne.length;++ce<He;)if(fe(ne[ce],ce,ne))return!0;return!1}var rF=Op("length");function iF(ne){return ne.split("")}function nF(ne){return ne.match(ze)||[]}function Ty(ne,fe,ce){var He;return ce(ne,function(vt,Ht,Mr){if(fe(vt,Ht,Mr))return He=Ht,!1}),He}function Il(ne,fe,ce,He){for(var vt=ne.length,Ht=ce+(He?1:-1);He?Ht--:++Ht<vt;)if(fe(ne[Ht],Ht,ne))return Ht;return-1}function $c(ne,fe,ce){return fe===fe?vF(ne,fe,ce):Il(ne,Ly,ce)}function sF(ne,fe,ce,He){for(var vt=ce-1,Ht=ne.length;++vt<Ht;)if(He(ne[vt],fe))return vt;return-1}function Ly(ne){return ne!==ne}function By(ne,fe){var ce=ne==null?0:ne.length;return ce?$p(ne,fe)/ce:g}function Op(ne){return function(fe){return fe==null?r:fe[ne]}}function Pp(ne){return function(fe){return ne==null?r:ne[fe]}}function Fy(ne,fe,ce,He,vt){return vt(ne,function(Ht,Mr,tr){ce=He?(He=!1,Ht):fe(ce,Ht,Mr,tr)}),ce}function oF(ne,fe){var ce=ne.length;for(ne.sort(fe);ce--;)ne[ce]=ne[ce].value;return ne}function $p(ne,fe){for(var ce,He=-1,vt=ne.length;++He<vt;){var Ht=fe(ne[He]);Ht!==r&&(ce=ce===r?Ht:ce+Ht)}return ce}function Rp(ne,fe){for(var ce=-1,He=Array(ne);++ce<ne;)He[ce]=fe(ce);return He}function aF(ne,fe){return cr(fe,function(ce){return[ce,ne[ce]]})}function Uy(ne){return ne&&ne.slice(0,zy(ne)+1).replace(st,"")}function ji(ne){return function(fe){return ne(fe)}}function Np(ne,fe){return cr(fe,function(ce){return ne[ce]})}function nf(ne,fe){return ne.has(fe)}function ky(ne,fe){for(var ce=-1,He=ne.length;++ce<He&&$c(fe,ne[ce],0)>-1;);return ce}function jy(ne,fe){for(var ce=ne.length;ce--&&$c(fe,ne[ce],0)>-1;);return ce}function cF(ne,fe){for(var ce=ne.length,He=0;ce--;)ne[ce]===fe&&++He;return He}var uF=Pp(J),fF=Pp(ie);function hF(ne){return"\\"+ke[ne]}function lF(ne,fe){return ne==null?r:ne[fe]}function Rc(ne){return Al.test(ne)}function dF(ne){return pa.test(ne)}function pF(ne){for(var fe,ce=[];!(fe=ne.next()).done;)ce.push(fe.value);return ce}function Tp(ne){var fe=-1,ce=Array(ne.size);return ne.forEach(function(He,vt){ce[++fe]=[vt,He]}),ce}function qy(ne,fe){return function(ce){return ne(fe(ce))}}function _o(ne,fe){for(var ce=-1,He=ne.length,vt=0,Ht=[];++ce<He;){var Mr=ne[ce];(Mr===fe||Mr===b)&&(ne[ce]=b,Ht[vt++]=ce)}return Ht}function Ml(ne){var fe=-1,ce=Array(ne.size);return ne.forEach(function(He){ce[++fe]=He}),ce}function gF(ne){var fe=-1,ce=Array(ne.size);return ne.forEach(function(He){ce[++fe]=[He,He]}),ce}function vF(ne,fe,ce){for(var He=ce-1,vt=ne.length;++He<vt;)if(ne[He]===fe)return He;return-1}function mF(ne,fe,ce){for(var He=ce+1;He--;)if(ne[He]===fe)return He;return He}function Nc(ne){return Rc(ne)?yF(ne):rF(ne)}function Tn(ne){return Rc(ne)?wF(ne):iF(ne)}function zy(ne){for(var fe=ne.length;fe--&&at.test(ne.charAt(fe)););return fe}var bF=Pp(pe);function yF(ne){for(var fe=Pc.lastIndex=0;Pc.test(ne);)++fe;return fe}function wF(ne){return ne.match(Pc)||[]}function _F(ne){return ne.match(El)||[]}var EF=function ne(fe){fe=fe==null?Ft:Tc.defaults(Ft.Object(),fe,Tc.pick(Ft,xl));var ce=fe.Array,He=fe.Date,vt=fe.Error,Ht=fe.Function,Mr=fe.Math,tr=fe.Object,Lp=fe.RegExp,AF=fe.String,cn=fe.TypeError,Cl=ce.prototype,xF=Ht.prototype,Lc=tr.prototype,Dl=fe["__core-js_shared__"],Ol=xF.toString,Yt=Lc.hasOwnProperty,SF=0,Hy=function(){var o=/[^.]+$/.exec(Dl&&Dl.keys&&Dl.keys.IE_PROTO||"");return o?"Symbol(src)_1."+o:""}(),Pl=Lc.toString,IF=Ol.call(tr),MF=Ft._,CF=Lp("^"+Ol.call(Yt).replace(nt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),$l=Ci?fe.Buffer:r,Eo=fe.Symbol,Rl=fe.Uint8Array,Ky=$l?$l.allocUnsafe:r,Nl=qy(tr.getPrototypeOf,tr),Wy=tr.create,Vy=Lc.propertyIsEnumerable,Tl=Cl.splice,Gy=Eo?Eo.isConcatSpreadable:r,sf=Eo?Eo.iterator:r,va=Eo?Eo.toStringTag:r,Ll=function(){try{var o=_a(tr,"defineProperty");return o({},"",{}),o}catch{}}(),DF=fe.clearTimeout!==Ft.clearTimeout&&fe.clearTimeout,OF=He&&He.now!==Ft.Date.now&&He.now,PF=fe.setTimeout!==Ft.setTimeout&&fe.setTimeout,Bl=Mr.ceil,Fl=Mr.floor,Bp=tr.getOwnPropertySymbols,$F=$l?$l.isBuffer:r,Yy=fe.isFinite,RF=Cl.join,NF=qy(tr.keys,tr),Cr=Mr.max,ri=Mr.min,TF=He.now,LF=fe.parseInt,Jy=Mr.random,BF=Cl.reverse,Fp=_a(fe,"DataView"),of=_a(fe,"Map"),Up=_a(fe,"Promise"),Bc=_a(fe,"Set"),af=_a(fe,"WeakMap"),cf=_a(tr,"create"),Ul=af&&new af,Fc={},FF=Ea(Fp),UF=Ea(of),kF=Ea(Up),jF=Ea(Bc),qF=Ea(af),kl=Eo?Eo.prototype:r,uf=kl?kl.valueOf:r,Qy=kl?kl.toString:r;function F(o){if(gr(o)&&!yt(o)&&!(o instanceof Lt)){if(o instanceof un)return o;if(Yt.call(o,"__wrapped__"))return Z5(o)}return new un(o)}var Uc=function(){function o(){}return function(c){if(!fr(c))return{};if(Wy)return Wy(c);o.prototype=c;var p=new o;return o.prototype=r,p}}();function jl(){}function un(o,c){this.__wrapped__=o,this.__actions__=[],this.__chain__=!!c,this.__index__=0,this.__values__=r}F.templateSettings={escape:it,evaluate:Be,interpolate:rt,variable:"",imports:{_:F}},F.prototype=jl.prototype,F.prototype.constructor=F,un.prototype=Uc(jl.prototype),un.prototype.constructor=un;function Lt(o){this.__wrapped__=o,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function zF(){var o=new Lt(this.__wrapped__);return o.__actions__=Di(this.__actions__),o.__dir__=this.__dir__,o.__filtered__=this.__filtered__,o.__iteratees__=Di(this.__iteratees__),o.__takeCount__=this.__takeCount__,o.__views__=Di(this.__views__),o}function HF(){if(this.__filtered__){var o=new Lt(this);o.__dir__=-1,o.__filtered__=!0}else o=this.clone(),o.__dir__*=-1;return o}function KF(){var o=this.__wrapped__.value(),c=this.__dir__,p=yt(o),x=c<0,$=p?o.length:0,j=ik(0,$,this.__views__),Q=j.start,Z=j.end,se=Z-Q,le=x?Z:Q-1,de=this.__iteratees__,ge=de.length,De=0,Ye=ri(se,this.__takeCount__);if(!p||!x&&$==se&&Ye==se)return _5(o,this.__actions__);var ut=[];e:for(;se--&&De<Ye;){le+=c;for(var St=-1,ft=o[le];++St<ge;){var Pt=de[St],Ut=Pt.iteratee,Hi=Pt.type,pi=Ut(ft);if(Hi==v)ft=pi;else if(!pi){if(Hi==h)continue e;break e}}ut[De++]=ft}return ut}Lt.prototype=Uc(jl.prototype),Lt.prototype.constructor=Lt;function ma(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var x=o[c];this.set(x[0],x[1])}}function WF(){this.__data__=cf?cf(null):{},this.size=0}function VF(o){var c=this.has(o)&&delete this.__data__[o];return this.size-=c?1:0,c}function GF(o){var c=this.__data__;if(cf){var p=c[o];return p===l?r:p}return Yt.call(c,o)?c[o]:r}function YF(o){var c=this.__data__;return cf?c[o]!==r:Yt.call(c,o)}function JF(o,c){var p=this.__data__;return this.size+=this.has(o)?0:1,p[o]=cf&&c===r?l:c,this}ma.prototype.clear=WF,ma.prototype.delete=VF,ma.prototype.get=GF,ma.prototype.has=YF,ma.prototype.set=JF;function ks(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var x=o[c];this.set(x[0],x[1])}}function QF(){this.__data__=[],this.size=0}function ZF(o){var c=this.__data__,p=ql(c,o);if(p<0)return!1;var x=c.length-1;return p==x?c.pop():Tl.call(c,p,1),--this.size,!0}function XF(o){var c=this.__data__,p=ql(c,o);return p<0?r:c[p][1]}function eU(o){return ql(this.__data__,o)>-1}function tU(o,c){var p=this.__data__,x=ql(p,o);return x<0?(++this.size,p.push([o,c])):p[x][1]=c,this}ks.prototype.clear=QF,ks.prototype.delete=ZF,ks.prototype.get=XF,ks.prototype.has=eU,ks.prototype.set=tU;function js(o){var c=-1,p=o==null?0:o.length;for(this.clear();++c<p;){var x=o[c];this.set(x[0],x[1])}}function rU(){this.size=0,this.__data__={hash:new ma,map:new(of||ks),string:new ma}}function iU(o){var c=e0(this,o).delete(o);return this.size-=c?1:0,c}function nU(o){return e0(this,o).get(o)}function sU(o){return e0(this,o).has(o)}function oU(o,c){var p=e0(this,o),x=p.size;return p.set(o,c),this.size+=p.size==x?0:1,this}js.prototype.clear=rU,js.prototype.delete=iU,js.prototype.get=nU,js.prototype.has=sU,js.prototype.set=oU;function ba(o){var c=-1,p=o==null?0:o.length;for(this.__data__=new js;++c<p;)this.add(o[c])}function aU(o){return this.__data__.set(o,l),this}function cU(o){return this.__data__.has(o)}ba.prototype.add=ba.prototype.push=aU,ba.prototype.has=cU;function Ln(o){var c=this.__data__=new ks(o);this.size=c.size}function uU(){this.__data__=new ks,this.size=0}function fU(o){var c=this.__data__,p=c.delete(o);return this.size=c.size,p}function hU(o){return this.__data__.get(o)}function lU(o){return this.__data__.has(o)}function dU(o,c){var p=this.__data__;if(p instanceof ks){var x=p.__data__;if(!of||x.length<n-1)return x.push([o,c]),this.size=++p.size,this;p=this.__data__=new js(x)}return p.set(o,c),this.size=p.size,this}Ln.prototype.clear=uU,Ln.prototype.delete=fU,Ln.prototype.get=hU,Ln.prototype.has=lU,Ln.prototype.set=dU;function Zy(o,c){var p=yt(o),x=!p&&Aa(o),$=!p&&!x&&Mo(o),j=!p&&!x&&!$&&zc(o),Q=p||x||$||j,Z=Q?Rp(o.length,AF):[],se=Z.length;for(var le in o)(c||Yt.call(o,le))&&!(Q&&(le=="length"||$&&(le=="offset"||le=="parent")||j&&(le=="buffer"||le=="byteLength"||le=="byteOffset")||Ks(le,se)))&&Z.push(le);return Z}function Xy(o){var c=o.length;return c?o[Jp(0,c-1)]:r}function pU(o,c){return t0(Di(o),ya(c,0,o.length))}function gU(o){return t0(Di(o))}function kp(o,c,p){(p!==r&&!Bn(o[c],p)||p===r&&!(c in o))&&qs(o,c,p)}function ff(o,c,p){var x=o[c];(!(Yt.call(o,c)&&Bn(x,p))||p===r&&!(c in o))&&qs(o,c,p)}function ql(o,c){for(var p=o.length;p--;)if(Bn(o[p][0],c))return p;return-1}function vU(o,c,p,x){return Ao(o,function($,j,Q){c(x,$,p($),Q)}),x}function e5(o,c){return o&&_s(c,Lr(c),o)}function mU(o,c){return o&&_s(c,Pi(c),o)}function qs(o,c,p){c=="__proto__"&&Ll?Ll(o,c,{configurable:!0,enumerable:!0,value:p,writable:!0}):o[c]=p}function jp(o,c){for(var p=-1,x=c.length,$=ce(x),j=o==null;++p<x;)$[p]=j?r:_g(o,c[p]);return $}function ya(o,c,p){return o===o&&(p!==r&&(o=o<=p?o:p),c!==r&&(o=o>=c?o:c)),o}function fn(o,c,p,x,$,j){var Q,Z=c&w,se=c&I,le=c&S;if(p&&(Q=$?p(o,x,$,j):p(o)),Q!==r)return Q;if(!fr(o))return o;var de=yt(o);if(de){if(Q=sk(o),!Z)return Di(o,Q)}else{var ge=ii(o),De=ge==oe||ge==ue;if(Mo(o))return x5(o,Z);if(ge==Re||ge==O||De&&!$){if(Q=se||De?{}:z5(o),!Z)return se?GU(o,mU(Q,o)):VU(o,e5(Q,o))}else{if(!Qt[ge])return $?o:{};Q=ok(o,ge,Z)}}j||(j=new Ln);var Ye=j.get(o);if(Ye)return Ye;j.set(o,Q),bw(o)?o.forEach(function(ft){Q.add(fn(ft,c,p,ft,o,j))}):vw(o)&&o.forEach(function(ft,Pt){Q.set(Pt,fn(ft,c,p,Pt,o,j))});var ut=le?se?ag:og:se?Pi:Lr,St=de?r:ut(o);return an(St||o,function(ft,Pt){St&&(Pt=ft,ft=o[Pt]),ff(Q,Pt,fn(ft,c,p,Pt,o,j))}),Q}function bU(o){var c=Lr(o);return function(p){return t5(p,o,c)}}function t5(o,c,p){var x=p.length;if(o==null)return!x;for(o=tr(o);x--;){var $=p[x],j=c[$],Q=o[$];if(Q===r&&!($ in o)||!j(Q))return!1}return!0}function r5(o,c,p){if(typeof o!="function")throw new cn(a);return mf(function(){o.apply(r,p)},c)}function hf(o,c,p,x){var $=-1,j=Sl,Q=!0,Z=o.length,se=[],le=c.length;if(!Z)return se;p&&(c=cr(c,ji(p))),x?(j=Mp,Q=!1):c.length>=n&&(j=nf,Q=!1,c=new ba(c));e:for(;++$<Z;){var de=o[$],ge=p==null?de:p(de);if(de=x||de!==0?de:0,Q&&ge===ge){for(var De=le;De--;)if(c[De]===ge)continue e;se.push(de)}else j(c,ge,x)||se.push(de)}return se}var Ao=D5(ws),i5=D5(zp,!0);function yU(o,c){var p=!0;return Ao(o,function(x,$,j){return p=!!c(x,$,j),p}),p}function zl(o,c,p){for(var x=-1,$=o.length;++x<$;){var j=o[x],Q=c(j);if(Q!=null&&(Z===r?Q===Q&&!zi(Q):p(Q,Z)))var Z=Q,se=j}return se}function wU(o,c,p,x){var $=o.length;for(p=xt(p),p<0&&(p=-p>$?0:$+p),x=x===r||x>$?$:xt(x),x<0&&(x+=$),x=p>x?0:ww(x);p<x;)o[p++]=c;return o}function n5(o,c){var p=[];return Ao(o,function(x,$,j){c(x,$,j)&&p.push(x)}),p}function Kr(o,c,p,x,$){var j=-1,Q=o.length;for(p||(p=ck),$||($=[]);++j<Q;){var Z=o[j];c>0&&p(Z)?c>1?Kr(Z,c-1,p,x,$):wo($,Z):x||($[$.length]=Z)}return $}var qp=O5(),s5=O5(!0);function ws(o,c){return o&&qp(o,c,Lr)}function zp(o,c){return o&&s5(o,c,Lr)}function Hl(o,c){return yo(c,function(p){return Ws(o[p])})}function wa(o,c){c=So(c,o);for(var p=0,x=c.length;o!=null&&p<x;)o=o[Es(c[p++])];return p&&p==x?o:r}function o5(o,c,p){var x=c(o);return yt(o)?x:wo(x,p(o))}function li(o){return o==null?o===r?Te:we:va&&va in tr(o)?rk(o):gk(o)}function Hp(o,c){return o>c}function _U(o,c){return o!=null&&Yt.call(o,c)}function EU(o,c){return o!=null&&c in tr(o)}function AU(o,c,p){return o>=ri(c,p)&&o<Cr(c,p)}function Kp(o,c,p){for(var x=p?Mp:Sl,$=o[0].length,j=o.length,Q=j,Z=ce(j),se=1/0,le=[];Q--;){var de=o[Q];Q&&c&&(de=cr(de,ji(c))),se=ri(de.length,se),Z[Q]=!p&&(c||$>=120&&de.length>=120)?new ba(Q&&de):r}de=o[0];var ge=-1,De=Z[0];e:for(;++ge<$&&le.length<se;){var Ye=de[ge],ut=c?c(Ye):Ye;if(Ye=p||Ye!==0?Ye:0,!(De?nf(De,ut):x(le,ut,p))){for(Q=j;--Q;){var St=Z[Q];if(!(St?nf(St,ut):x(o[Q],ut,p)))continue e}De&&De.push(ut),le.push(Ye)}}return le}function xU(o,c,p,x){return ws(o,function($,j,Q){c(x,p($),j,Q)}),x}function lf(o,c,p){c=So(c,o),o=V5(o,c);var x=o==null?o:o[Es(ln(c))];return x==null?r:Tr(x,o,p)}function a5(o){return gr(o)&&li(o)==O}function SU(o){return gr(o)&&li(o)==xe}function IU(o){return gr(o)&&li(o)==Y}function df(o,c,p,x,$){return o===c?!0:o==null||c==null||!gr(o)&&!gr(c)?o!==o&&c!==c:MU(o,c,p,x,df,$)}function MU(o,c,p,x,$,j){var Q=yt(o),Z=yt(c),se=Q?te:ii(o),le=Z?te:ii(c);se=se==O?Re:se,le=le==O?Re:le;var de=se==Re,ge=le==Re,De=se==le;if(De&&Mo(o)){if(!Mo(c))return!1;Q=!0,de=!1}if(De&&!de)return j||(j=new Ln),Q||zc(o)?k5(o,c,p,x,$,j):ek(o,c,se,p,x,$,j);if(!(p&D)){var Ye=de&&Yt.call(o,"__wrapped__"),ut=ge&&Yt.call(c,"__wrapped__");if(Ye||ut){var St=Ye?o.value():o,ft=ut?c.value():c;return j||(j=new Ln),$(St,ft,p,x,j)}}return De?(j||(j=new Ln),tk(o,c,p,x,$,j)):!1}function CU(o){return gr(o)&&ii(o)==he}function Wp(o,c,p,x){var $=p.length,j=$,Q=!x;if(o==null)return!j;for(o=tr(o);$--;){var Z=p[$];if(Q&&Z[2]?Z[1]!==o[Z[0]]:!(Z[0]in o))return!1}for(;++$<j;){Z=p[$];var se=Z[0],le=o[se],de=Z[1];if(Q&&Z[2]){if(le===r&&!(se in o))return!1}else{var ge=new Ln;if(x)var De=x(le,de,se,o,c,ge);if(!(De===r?df(de,le,D|L,x,ge):De))return!1}}return!0}function c5(o){if(!fr(o)||fk(o))return!1;var c=Ws(o)?CF:Xr;return c.test(Ea(o))}function DU(o){return gr(o)&&li(o)==Ne}function OU(o){return gr(o)&&ii(o)==Me}function PU(o){return gr(o)&&a0(o.length)&&!!Zt[li(o)]}function u5(o){return typeof o=="function"?o:o==null?$i:typeof o=="object"?yt(o)?l5(o[0],o[1]):h5(o):Pw(o)}function Vp(o){if(!vf(o))return NF(o);var c=[];for(var p in tr(o))Yt.call(o,p)&&p!="constructor"&&c.push(p);return c}function $U(o){if(!fr(o))return pk(o);var c=vf(o),p=[];for(var x in o)x=="constructor"&&(c||!Yt.call(o,x))||p.push(x);return p}function Gp(o,c){return o<c}function f5(o,c){var p=-1,x=Oi(o)?ce(o.length):[];return Ao(o,function($,j,Q){x[++p]=c($,j,Q)}),x}function h5(o){var c=ug(o);return c.length==1&&c[0][2]?K5(c[0][0],c[0][1]):function(p){return p===o||Wp(p,o,c)}}function l5(o,c){return hg(o)&&H5(c)?K5(Es(o),c):function(p){var x=_g(p,o);return x===r&&x===c?Eg(p,o):df(c,x,D|L)}}function Kl(o,c,p,x,$){o!==c&&qp(c,function(j,Q){if($||($=new Ln),fr(j))RU(o,c,Q,p,Kl,x,$);else{var Z=x?x(dg(o,Q),j,Q+"",o,c,$):r;Z===r&&(Z=j),kp(o,Q,Z)}},Pi)}function RU(o,c,p,x,$,j,Q){var Z=dg(o,p),se=dg(c,p),le=Q.get(se);if(le){kp(o,p,le);return}var de=j?j(Z,se,p+"",o,c,Q):r,ge=de===r;if(ge){var De=yt(se),Ye=!De&&Mo(se),ut=!De&&!Ye&&zc(se);de=se,De||Ye||ut?yt(Z)?de=Z:wr(Z)?de=Di(Z):Ye?(ge=!1,de=x5(se,!0)):ut?(ge=!1,de=S5(se,!0)):de=[]:bf(se)||Aa(se)?(de=Z,Aa(Z)?de=_w(Z):(!fr(Z)||Ws(Z))&&(de=z5(se))):ge=!1}ge&&(Q.set(se,de),$(de,se,x,j,Q),Q.delete(se)),kp(o,p,de)}function d5(o,c){var p=o.length;if(p)return c+=c<0?p:0,Ks(c,p)?o[c]:r}function p5(o,c,p){c.length?c=cr(c,function(j){return yt(j)?function(Q){return wa(Q,j.length===1?j[0]:j)}:j}):c=[$i];var x=-1;c=cr(c,ji(ot()));var $=f5(o,function(j,Q,Z){var se=cr(c,function(le){return le(j)});return{criteria:se,index:++x,value:j}});return oF($,function(j,Q){return WU(j,Q,p)})}function NU(o,c){return g5(o,c,function(p,x){return Eg(o,x)})}function g5(o,c,p){for(var x=-1,$=c.length,j={};++x<$;){var Q=c[x],Z=wa(o,Q);p(Z,Q)&&pf(j,So(Q,o),Z)}return j}function TU(o){return function(c){return wa(c,o)}}function Yp(o,c,p,x){var $=x?sF:$c,j=-1,Q=c.length,Z=o;for(o===c&&(c=Di(c)),p&&(Z=cr(o,ji(p)));++j<Q;)for(var se=0,le=c[j],de=p?p(le):le;(se=$(Z,de,se,x))>-1;)Z!==o&&Tl.call(Z,se,1),Tl.call(o,se,1);return o}function v5(o,c){for(var p=o?c.length:0,x=p-1;p--;){var $=c[p];if(p==x||$!==j){var j=$;Ks($)?Tl.call(o,$,1):Xp(o,$)}}return o}function Jp(o,c){return o+Fl(Jy()*(c-o+1))}function LU(o,c,p,x){for(var $=-1,j=Cr(Bl((c-o)/(p||1)),0),Q=ce(j);j--;)Q[x?j:++$]=o,o+=p;return Q}function Qp(o,c){var p="";if(!o||c<1||c>P)return p;do c%2&&(p+=o),c=Fl(c/2),c&&(o+=o);while(c);return p}function Mt(o,c){return pg(W5(o,c,$i),o+"")}function BU(o){return Xy(Hc(o))}function FU(o,c){var p=Hc(o);return t0(p,ya(c,0,p.length))}function pf(o,c,p,x){if(!fr(o))return o;c=So(c,o);for(var $=-1,j=c.length,Q=j-1,Z=o;Z!=null&&++$<j;){var se=Es(c[$]),le=p;if(se==="__proto__"||se==="constructor"||se==="prototype")return o;if($!=Q){var de=Z[se];le=x?x(de,se,Z):r,le===r&&(le=fr(de)?de:Ks(c[$+1])?[]:{})}ff(Z,se,le),Z=Z[se]}return o}var m5=Ul?function(o,c){return Ul.set(o,c),o}:$i,UU=Ll?function(o,c){return Ll(o,"toString",{configurable:!0,enumerable:!1,value:xg(c),writable:!0})}:$i;function kU(o){return t0(Hc(o))}function hn(o,c,p){var x=-1,$=o.length;c<0&&(c=-c>$?0:$+c),p=p>$?$:p,p<0&&(p+=$),$=c>p?0:p-c>>>0,c>>>=0;for(var j=ce($);++x<$;)j[x]=o[x+c];return j}function jU(o,c){var p;return Ao(o,function(x,$,j){return p=c(x,$,j),!p}),!!p}function Wl(o,c,p){var x=0,$=o==null?x:o.length;if(typeof c=="number"&&c===c&&$<=ee){for(;x<$;){var j=x+$>>>1,Q=o[j];Q!==null&&!zi(Q)&&(p?Q<=c:Q<c)?x=j+1:$=j}return $}return Zp(o,c,$i,p)}function Zp(o,c,p,x){var $=0,j=o==null?0:o.length;if(j===0)return 0;c=p(c);for(var Q=c!==c,Z=c===null,se=zi(c),le=c===r;$<j;){var de=Fl(($+j)/2),ge=p(o[de]),De=ge!==r,Ye=ge===null,ut=ge===ge,St=zi(ge);if(Q)var ft=x||ut;else le?ft=ut&&(x||De):Z?ft=ut&&De&&(x||!Ye):se?ft=ut&&De&&!Ye&&(x||!St):Ye||St?ft=!1:ft=x?ge<=c:ge<c;ft?$=de+1:j=de}return ri(j,N)}function b5(o,c){for(var p=-1,x=o.length,$=0,j=[];++p<x;){var Q=o[p],Z=c?c(Q):Q;if(!p||!Bn(Z,se)){var se=Z;j[$++]=Q===0?0:Q}}return j}function y5(o){return typeof o=="number"?o:zi(o)?g:+o}function qi(o){if(typeof o=="string")return o;if(yt(o))return cr(o,qi)+"";if(zi(o))return Qy?Qy.call(o):"";var c=o+"";return c=="0"&&1/o==-C?"-0":c}function xo(o,c,p){var x=-1,$=Sl,j=o.length,Q=!0,Z=[],se=Z;if(p)Q=!1,$=Mp;else if(j>=n){var le=c?null:ZU(o);if(le)return Ml(le);Q=!1,$=nf,se=new ba}else se=c?[]:Z;e:for(;++x<j;){var de=o[x],ge=c?c(de):de;if(de=p||de!==0?de:0,Q&&ge===ge){for(var De=se.length;De--;)if(se[De]===ge)continue e;c&&se.push(ge),Z.push(de)}else $(se,ge,p)||(se!==Z&&se.push(ge),Z.push(de))}return Z}function Xp(o,c){return c=So(c,o),o=V5(o,c),o==null||delete o[Es(ln(c))]}function w5(o,c,p,x){return pf(o,c,p(wa(o,c)),x)}function Vl(o,c,p,x){for(var $=o.length,j=x?$:-1;(x?j--:++j<$)&&c(o[j],j,o););return p?hn(o,x?0:j,x?j+1:$):hn(o,x?j+1:0,x?$:j)}function _5(o,c){var p=o;return p instanceof Lt&&(p=p.value()),Cp(c,function(x,$){return $.func.apply($.thisArg,wo([x],$.args))},p)}function eg(o,c,p){var x=o.length;if(x<2)return x?xo(o[0]):[];for(var $=-1,j=ce(x);++$<x;)for(var Q=o[$],Z=-1;++Z<x;)Z!=$&&(j[$]=hf(j[$]||Q,o[Z],c,p));return xo(Kr(j,1),c,p)}function E5(o,c,p){for(var x=-1,$=o.length,j=c.length,Q={};++x<$;){var Z=x<j?c[x]:r;p(Q,o[x],Z)}return Q}function tg(o){return wr(o)?o:[]}function rg(o){return typeof o=="function"?o:$i}function So(o,c){return yt(o)?o:hg(o,c)?[o]:Q5(Vt(o))}var qU=Mt;function Io(o,c,p){var x=o.length;return p=p===r?x:p,!c&&p>=x?o:hn(o,c,p)}var A5=DF||function(o){return Ft.clearTimeout(o)};function x5(o,c){if(c)return o.slice();var p=o.length,x=Ky?Ky(p):new o.constructor(p);return o.copy(x),x}function ig(o){var c=new o.constructor(o.byteLength);return new Rl(c).set(new Rl(o)),c}function zU(o,c){var p=c?ig(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.byteLength)}function HU(o){var c=new o.constructor(o.source,_t.exec(o));return c.lastIndex=o.lastIndex,c}function KU(o){return uf?tr(uf.call(o)):{}}function S5(o,c){var p=c?ig(o.buffer):o.buffer;return new o.constructor(p,o.byteOffset,o.length)}function I5(o,c){if(o!==c){var p=o!==r,x=o===null,$=o===o,j=zi(o),Q=c!==r,Z=c===null,se=c===c,le=zi(c);if(!Z&&!le&&!j&&o>c||j&&Q&&se&&!Z&&!le||x&&Q&&se||!p&&se||!$)return 1;if(!x&&!j&&!le&&o<c||le&&p&&$&&!x&&!j||Z&&p&&$||!Q&&$||!se)return-1}return 0}function WU(o,c,p){for(var x=-1,$=o.criteria,j=c.criteria,Q=$.length,Z=p.length;++x<Q;){var se=I5($[x],j[x]);if(se){if(x>=Z)return se;var le=p[x];return se*(le=="desc"?-1:1)}}return o.index-c.index}function M5(o,c,p,x){for(var $=-1,j=o.length,Q=p.length,Z=-1,se=c.length,le=Cr(j-Q,0),de=ce(se+le),ge=!x;++Z<se;)de[Z]=c[Z];for(;++$<Q;)(ge||$<j)&&(de[p[$]]=o[$]);for(;le--;)de[Z++]=o[$++];return de}function C5(o,c,p,x){for(var $=-1,j=o.length,Q=-1,Z=p.length,se=-1,le=c.length,de=Cr(j-Z,0),ge=ce(de+le),De=!x;++$<de;)ge[$]=o[$];for(var Ye=$;++se<le;)ge[Ye+se]=c[se];for(;++Q<Z;)(De||$<j)&&(ge[Ye+p[Q]]=o[$++]);return ge}function Di(o,c){var p=-1,x=o.length;for(c||(c=ce(x));++p<x;)c[p]=o[p];return c}function _s(o,c,p,x){var $=!p;p||(p={});for(var j=-1,Q=c.length;++j<Q;){var Z=c[j],se=x?x(p[Z],o[Z],Z,p,o):r;se===r&&(se=o[Z]),$?qs(p,Z,se):ff(p,Z,se)}return p}function VU(o,c){return _s(o,fg(o),c)}function GU(o,c){return _s(o,j5(o),c)}function Gl(o,c){return function(p,x){var $=yt(p)?XB:vU,j=c?c():{};return $(p,o,ot(x,2),j)}}function kc(o){return Mt(function(c,p){var x=-1,$=p.length,j=$>1?p[$-1]:r,Q=$>2?p[2]:r;for(j=o.length>3&&typeof j=="function"?($--,j):r,Q&&di(p[0],p[1],Q)&&(j=$<3?r:j,$=1),c=tr(c);++x<$;){var Z=p[x];Z&&o(c,Z,x,j)}return c})}function D5(o,c){return function(p,x){if(p==null)return p;if(!Oi(p))return o(p,x);for(var $=p.length,j=c?$:-1,Q=tr(p);(c?j--:++j<$)&&x(Q[j],j,Q)!==!1;);return p}}function O5(o){return function(c,p,x){for(var $=-1,j=tr(c),Q=x(c),Z=Q.length;Z--;){var se=Q[o?Z:++$];if(p(j[se],se,j)===!1)break}return c}}function YU(o,c,p){var x=c&K,$=gf(o);function j(){var Q=this&&this!==Ft&&this instanceof j?$:o;return Q.apply(x?p:this,arguments)}return j}function P5(o){return function(c){c=Vt(c);var p=Rc(c)?Tn(c):r,x=p?p[0]:c.charAt(0),$=p?Io(p,1).join(""):c.slice(1);return x[o]()+$}}function jc(o){return function(c){return Cp(Dw(Cw(c).replace(tf,"")),o,"")}}function gf(o){return function(){var c=arguments;switch(c.length){case 0:return new o;case 1:return new o(c[0]);case 2:return new o(c[0],c[1]);case 3:return new o(c[0],c[1],c[2]);case 4:return new o(c[0],c[1],c[2],c[3]);case 5:return new o(c[0],c[1],c[2],c[3],c[4]);case 6:return new o(c[0],c[1],c[2],c[3],c[4],c[5]);case 7:return new o(c[0],c[1],c[2],c[3],c[4],c[5],c[6])}var p=Uc(o.prototype),x=o.apply(p,c);return fr(x)?x:p}}function JU(o,c,p){var x=gf(o);function $(){for(var j=arguments.length,Q=ce(j),Z=j,se=qc($);Z--;)Q[Z]=arguments[Z];var le=j<3&&Q[0]!==se&&Q[j-1]!==se?[]:_o(Q,se);if(j-=le.length,j<p)return L5(o,c,Yl,$.placeholder,r,Q,le,r,r,p-j);var de=this&&this!==Ft&&this instanceof $?x:o;return Tr(de,this,Q)}return $}function $5(o){return function(c,p,x){var $=tr(c);if(!Oi(c)){var j=ot(p,3);c=Lr(c),p=function(Z){return j($[Z],Z,$)}}var Q=o(c,p,x);return Q>-1?$[j?c[Q]:Q]:r}}function R5(o){return Hs(function(c){var p=c.length,x=p,$=un.prototype.thru;for(o&&c.reverse();x--;){var j=c[x];if(typeof j!="function")throw new cn(a);if($&&!Q&&Xl(j)=="wrapper")var Q=new un([],!0)}for(x=Q?x:p;++x<p;){j=c[x];var Z=Xl(j),se=Z=="wrapper"?cg(j):r;se&&lg(se[0])&&se[1]==(_|W|k|B)&&!se[4].length&&se[9]==1?Q=Q[Xl(se[0])].apply(Q,se[3]):Q=j.length==1&&lg(j)?Q[Z]():Q.thru(j)}return function(){var le=arguments,de=le[0];if(Q&&le.length==1&&yt(de))return Q.plant(de).value();for(var ge=0,De=p?c[ge].apply(this,le):de;++ge<p;)De=c[ge].call(this,De);return De}})}function Yl(o,c,p,x,$,j,Q,Z,se,le){var de=c&_,ge=c&K,De=c&H,Ye=c&(W|R),ut=c&X,St=De?r:gf(o);function ft(){for(var Pt=arguments.length,Ut=ce(Pt),Hi=Pt;Hi--;)Ut[Hi]=arguments[Hi];if(Ye)var pi=qc(ft),Ki=cF(Ut,pi);if(x&&(Ut=M5(Ut,x,$,Ye)),j&&(Ut=C5(Ut,j,Q,Ye)),Pt-=Ki,Ye&&Pt<le){var _r=_o(Ut,pi);return L5(o,c,Yl,ft.placeholder,p,Ut,_r,Z,se,le-Pt)}var Fn=ge?p:this,Gs=De?Fn[o]:o;return Pt=Ut.length,Z?Ut=vk(Ut,Z):ut&&Pt>1&&Ut.reverse(),de&&se<Pt&&(Ut.length=se),this&&this!==Ft&&this instanceof ft&&(Gs=St||gf(Gs)),Gs.apply(Fn,Ut)}return ft}function N5(o,c){return function(p,x){return xU(p,o,c(x),{})}}function Jl(o,c){return function(p,x){var $;if(p===r&&x===r)return c;if(p!==r&&($=p),x!==r){if($===r)return x;typeof p=="string"||typeof x=="string"?(p=qi(p),x=qi(x)):(p=y5(p),x=y5(x)),$=o(p,x)}return $}}function ng(o){return Hs(function(c){return c=cr(c,ji(ot())),Mt(function(p){var x=this;return o(c,function($){return Tr($,x,p)})})})}function Ql(o,c){c=c===r?" ":qi(c);var p=c.length;if(p<2)return p?Qp(c,o):c;var x=Qp(c,Bl(o/Nc(c)));return Rc(c)?Io(Tn(x),0,o).join(""):x.slice(0,o)}function QU(o,c,p,x){var $=c&K,j=gf(o);function Q(){for(var Z=-1,se=arguments.length,le=-1,de=x.length,ge=ce(de+se),De=this&&this!==Ft&&this instanceof Q?j:o;++le<de;)ge[le]=x[le];for(;se--;)ge[le++]=arguments[++Z];return Tr(De,$?p:this,ge)}return Q}function T5(o){return function(c,p,x){return x&&typeof x!="number"&&di(c,p,x)&&(p=x=r),c=Vs(c),p===r?(p=c,c=0):p=Vs(p),x=x===r?c<p?1:-1:Vs(x),LU(c,p,x,o)}}function Zl(o){return function(c,p){return typeof c=="string"&&typeof p=="string"||(c=dn(c),p=dn(p)),o(c,p)}}function L5(o,c,p,x,$,j,Q,Z,se,le){var de=c&W,ge=de?Q:r,De=de?r:Q,Ye=de?j:r,ut=de?r:j;c|=de?k:z,c&=~(de?z:k),c&U||(c&=~(K|H));var St=[o,c,$,Ye,ge,ut,De,Z,se,le],ft=p.apply(r,St);return lg(o)&&G5(ft,St),ft.placeholder=x,Y5(ft,o,c)}function sg(o){var c=Mr[o];return function(p,x){if(p=dn(p),x=x==null?0:ri(xt(x),292),x&&Yy(p)){var $=(Vt(p)+"e").split("e"),j=c($[0]+"e"+(+$[1]+x));return $=(Vt(j)+"e").split("e"),+($[0]+"e"+(+$[1]-x))}return c(p)}}var ZU=Bc&&1/Ml(new Bc([,-0]))[1]==C?function(o){return new Bc(o)}:Mg;function B5(o){return function(c){var p=ii(c);return p==he?Tp(c):p==Me?gF(c):aF(c,o(c))}}function zs(o,c,p,x,$,j,Q,Z){var se=c&H;if(!se&&typeof o!="function")throw new cn(a);var le=x?x.length:0;if(le||(c&=~(k|z),x=$=r),Q=Q===r?Q:Cr(xt(Q),0),Z=Z===r?Z:xt(Z),le-=$?$.length:0,c&z){var de=x,ge=$;x=$=r}var De=se?r:cg(o),Ye=[o,c,p,x,$,de,ge,j,Q,Z];if(De&&dk(Ye,De),o=Ye[0],c=Ye[1],p=Ye[2],x=Ye[3],$=Ye[4],Z=Ye[9]=Ye[9]===r?se?0:o.length:Cr(Ye[9]-le,0),!Z&&c&(W|R)&&(c&=~(W|R)),!c||c==K)var ut=YU(o,c,p);else c==W||c==R?ut=JU(o,c,Z):(c==k||c==(K|k))&&!$.length?ut=QU(o,c,p,x):ut=Yl.apply(r,Ye);var St=De?m5:G5;return Y5(St(ut,Ye),o,c)}function F5(o,c,p,x){return o===r||Bn(o,Lc[p])&&!Yt.call(x,p)?c:o}function U5(o,c,p,x,$,j){return fr(o)&&fr(c)&&(j.set(c,o),Kl(o,c,r,U5,j),j.delete(c)),o}function XU(o){return bf(o)?r:o}function k5(o,c,p,x,$,j){var Q=p&D,Z=o.length,se=c.length;if(Z!=se&&!(Q&&se>Z))return!1;var le=j.get(o),de=j.get(c);if(le&&de)return le==c&&de==o;var ge=-1,De=!0,Ye=p&L?new ba:r;for(j.set(o,c),j.set(c,o);++ge<Z;){var ut=o[ge],St=c[ge];if(x)var ft=Q?x(St,ut,ge,c,o,j):x(ut,St,ge,o,c,j);if(ft!==r){if(ft)continue;De=!1;break}if(Ye){if(!Dp(c,function(Pt,Ut){if(!nf(Ye,Ut)&&(ut===Pt||$(ut,Pt,p,x,j)))return Ye.push(Ut)})){De=!1;break}}else if(!(ut===St||$(ut,St,p,x,j))){De=!1;break}}return j.delete(o),j.delete(c),De}function ek(o,c,p,x,$,j,Q){switch(p){case me:if(o.byteLength!=c.byteLength||o.byteOffset!=c.byteOffset)return!1;o=o.buffer,c=c.buffer;case xe:return!(o.byteLength!=c.byteLength||!j(new Rl(o),new Rl(c)));case G:case Y:case ye:return Bn(+o,+c);case V:return o.name==c.name&&o.message==c.message;case Ne:case be:return o==c+"";case he:var Z=Tp;case Me:var se=x&D;if(Z||(Z=Ml),o.size!=c.size&&!se)return!1;var le=Q.get(o);if(le)return le==c;x|=L,Q.set(o,c);var de=k5(Z(o),Z(c),x,$,j,Q);return Q.delete(o),de;case Pe:if(uf)return uf.call(o)==uf.call(c)}return!1}function tk(o,c,p,x,$,j){var Q=p&D,Z=og(o),se=Z.length,le=og(c),de=le.length;if(se!=de&&!Q)return!1;for(var ge=se;ge--;){var De=Z[ge];if(!(Q?De in c:Yt.call(c,De)))return!1}var Ye=j.get(o),ut=j.get(c);if(Ye&&ut)return Ye==c&&ut==o;var St=!0;j.set(o,c),j.set(c,o);for(var ft=Q;++ge<se;){De=Z[ge];var Pt=o[De],Ut=c[De];if(x)var Hi=Q?x(Ut,Pt,De,c,o,j):x(Pt,Ut,De,o,c,j);if(!(Hi===r?Pt===Ut||$(Pt,Ut,p,x,j):Hi)){St=!1;break}ft||(ft=De=="constructor")}if(St&&!ft){var pi=o.constructor,Ki=c.constructor;pi!=Ki&&"constructor"in o&&"constructor"in c&&!(typeof pi=="function"&&pi instanceof pi&&typeof Ki=="function"&&Ki instanceof Ki)&&(St=!1)}return j.delete(o),j.delete(c),St}function Hs(o){return pg(W5(o,r,tw),o+"")}function og(o){return o5(o,Lr,fg)}function ag(o){return o5(o,Pi,j5)}var cg=Ul?function(o){return Ul.get(o)}:Mg;function Xl(o){for(var c=o.name+"",p=Fc[c],x=Yt.call(Fc,c)?p.length:0;x--;){var $=p[x],j=$.func;if(j==null||j==o)return $.name}return c}function qc(o){var c=Yt.call(F,"placeholder")?F:o;return c.placeholder}function ot(){var o=F.iteratee||Sg;return o=o===Sg?u5:o,arguments.length?o(arguments[0],arguments[1]):o}function e0(o,c){var p=o.__data__;return uk(c)?p[typeof c=="string"?"string":"hash"]:p.map}function ug(o){for(var c=Lr(o),p=c.length;p--;){var x=c[p],$=o[x];c[p]=[x,$,H5($)]}return c}function _a(o,c){var p=lF(o,c);return c5(p)?p:r}function rk(o){var c=Yt.call(o,va),p=o[va];try{o[va]=r;var x=!0}catch{}var $=Pl.call(o);return x&&(c?o[va]=p:delete o[va]),$}var fg=Bp?function(o){return o==null?[]:(o=tr(o),yo(Bp(o),function(c){return Vy.call(o,c)}))}:Cg,j5=Bp?function(o){for(var c=[];o;)wo(c,fg(o)),o=Nl(o);return c}:Cg,ii=li;(Fp&&ii(new Fp(new ArrayBuffer(1)))!=me||of&&ii(new of)!=he||Up&&ii(Up.resolve())!=Xe||Bc&&ii(new Bc)!=Me||af&&ii(new af)!=ve)&&(ii=function(o){var c=li(o),p=c==Re?o.constructor:r,x=p?Ea(p):"";if(x)switch(x){case FF:return me;case UF:return he;case kF:return Xe;case jF:return Me;case qF:return ve}return c});function ik(o,c,p){for(var x=-1,$=p.length;++x<$;){var j=p[x],Q=j.size;switch(j.type){case"drop":o+=Q;break;case"dropRight":c-=Q;break;case"take":c=ri(c,o+Q);break;case"takeRight":o=Cr(o,c-Q);break}}return{start:o,end:c}}function nk(o){var c=o.match(Ze);return c?c[1].split(lt):[]}function q5(o,c,p){c=So(c,o);for(var x=-1,$=c.length,j=!1;++x<$;){var Q=Es(c[x]);if(!(j=o!=null&&p(o,Q)))break;o=o[Q]}return j||++x!=$?j:($=o==null?0:o.length,!!$&&a0($)&&Ks(Q,$)&&(yt(o)||Aa(o)))}function sk(o){var c=o.length,p=new o.constructor(c);return c&&typeof o[0]=="string"&&Yt.call(o,"index")&&(p.index=o.index,p.input=o.input),p}function z5(o){return typeof o.constructor=="function"&&!vf(o)?Uc(Nl(o)):{}}function ok(o,c,p){var x=o.constructor;switch(c){case xe:return ig(o);case G:case Y:return new x(+o);case me:return zU(o,p);case Ue:case Ce:case _e:case Ke:case Ve:case Ae:case We:case pt:case Ge:return S5(o,p);case he:return new x;case ye:case be:return new x(o);case Ne:return HU(o);case Me:return new x;case Pe:return KU(o)}}function ak(o,c){var p=c.length;if(!p)return o;var x=p-1;return c[x]=(p>1?"& ":"")+c[x],c=c.join(p>2?", ":" "),o.replace(Fe,`{
51
51
  /* [wrapped with `+c+`] */
52
- `)}function mk(o){return yt(o)||Aa(o)||!!(Jy&&o&&o[Jy])}function Ks(o,c){var p=typeof o;return c=c??P,!!c&&(p=="number"||p!="symbol"&&ti.test(o))&&o>-1&&o%1==0&&o<c}function di(o,c,p){if(!fr(p))return!1;var x=typeof c;return(x=="number"?Oi(p)&&Ks(c,p.length):x=="string"&&c in p)?Bn(p[c],o):!1}function hg(o,c){if(yt(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||zi(o)?!0:je.test(o)||!tt.test(o)||c!=null&&o in tr(c)}function bk(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function lg(o){var c=Zl(o),p=F[c];if(typeof p!="function"||!(c in Lt.prototype))return!1;if(o===p)return!0;var x=cg(p);return!!x&&o===x[0]}function yk(o){return!!Wy&&Wy in o}var wk=Cl?Ws:Dg;function vf(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||Lc;return o===p}function W5(o){return o===o&&!fr(o)}function V5(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==r||o in tr(p))}}function _k(o){var c=n0(o,function(x){return p.size===d&&p.clear(),x}),p=c.cache;return c}function Ek(o,c){var p=o[1],x=c[1],$=p|x,j=$<(K|H|_),Q=x==_&&p==W||x==_&&p==B&&o[7].length<=c[8]||x==(_|B)&&c[7].length<=c[8]&&p==W;if(!(j||Q))return o;x&K&&(o[2]=c[2],$|=p&K?0:U);var Z=c[3];if(Z){var se=o[3];o[3]=se?D5(se,Z,c[4]):Z,o[4]=se?_o(o[3],b):c[4]}return Z=c[5],Z&&(se=o[5],o[5]=se?O5(se,Z,c[6]):Z,o[6]=se?_o(o[5],b):c[6]),Z=c[7],Z&&(o[7]=Z),x&_&&(o[8]=o[8]==null?c[8]:ri(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=$,o}function Ak(o){var c=[];if(o!=null)for(var p in tr(o))c.push(p);return c}function xk(o){return Ol.call(o)}function G5(o,c,p){return c=Cr(c===r?o.length-1:c,0),function(){for(var x=arguments,$=-1,j=Cr(x.length-c,0),Q=ce(j);++$<j;)Q[$]=x[c+$];$=-1;for(var Z=ce(c+1);++$<c;)Z[$]=x[$];return Z[c]=p(Q),Tr(o,this,Z)}}function Y5(o,c){return c.length<2?o:wa(o,hn(c,0,-1))}function Sk(o,c){for(var p=o.length,x=ri(c.length,p),$=Di(o);x--;){var j=c[x];o[x]=Ks(j,p)?$[j]:r}return o}function dg(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var J5=Z5(y5),mf=kF||function(o,c){return Ft.setTimeout(o,c)},pg=Z5(GU);function Q5(o,c,p){var x=c+"";return pg(o,vk(x,Ik(dk(x),p)))}function Z5(o){var c=0,p=0;return function(){var x=HF(),$=f-(x-p);if(p=x,$>0){if(++c>=y)return arguments[0]}else c=0;return o.apply(r,arguments)}}function e0(o,c){var p=-1,x=o.length,$=x-1;for(c=c===r?x:c;++p<c;){var j=Jp(p,$),Q=o[j];o[j]=o[p],o[p]=Q}return o.length=c,o}var X5=_k(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(ht,function(p,x,$,j){c.push($?j.replace(qt,"$1"):x||p)}),c});function Es(o){if(typeof o=="string"||zi(o))return o;var c=o+"";return c=="0"&&1/o==-C?"-0":c}function Ea(o){if(o!=null){try{return Dl.call(o)}catch{}try{return o+""}catch{}}return""}function Ik(o,c){return an(ae,function(p){var x="_."+p[0];c&p[1]&&!xl(o,x)&&o.push(x)}),o.sort()}function ew(o){if(o instanceof Lt)return o.clone();var c=new un(o.__wrapped__,o.__chain__);return c.__actions__=Di(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function Mk(o,c,p){(p?di(o,c,p):c===r)?c=1:c=Cr(xt(c),0);var x=o==null?0:o.length;if(!x||c<1)return[];for(var $=0,j=0,Q=ce(Ll(x/c));$<x;)Q[j++]=hn(o,$,$+=c);return Q}function Ck(o){for(var c=-1,p=o==null?0:o.length,x=0,$=[];++c<p;){var j=o[c];j&&($[x++]=j)}return $}function Dk(){var o=arguments.length;if(!o)return[];for(var c=ce(o-1),p=arguments[0],x=o;x--;)c[x-1]=arguments[x];return wo(yt(p)?Di(p):[p],Kr(c,1))}var Ok=Mt(function(o,c){return wr(o)?hf(o,Kr(c,1,wr,!0)):[]}),Pk=Mt(function(o,c){var p=ln(c);return wr(p)&&(p=r),wr(o)?hf(o,Kr(c,1,wr,!0),ot(p,2)):[]}),$k=Mt(function(o,c){var p=ln(c);return wr(p)&&(p=r),wr(o)?hf(o,Kr(c,1,wr,!0),r,p):[]});function Rk(o,c,p){var x=o==null?0:o.length;return x?(c=p||c===r?1:xt(c),hn(o,c<0?0:c,x)):[]}function Nk(o,c,p){var x=o==null?0:o.length;return x?(c=p||c===r?1:xt(c),c=x-c,hn(o,0,c<0?0:c)):[]}function Tk(o,c){return o&&o.length?Wl(o,ot(c,3),!0,!0):[]}function Lk(o,c){return o&&o.length?Wl(o,ot(c,3),!0):[]}function Bk(o,c,p,x){var $=o==null?0:o.length;return $?(p&&typeof p!="number"&&di(o,c,p)&&(p=0,x=$),DU(o,c,p,x)):[]}function tw(o,c,p){var x=o==null?0:o.length;if(!x)return-1;var $=p==null?0:xt(p);return $<0&&($=Cr(x+$,0)),Sl(o,ot(c,3),$)}function rw(o,c,p){var x=o==null?0:o.length;if(!x)return-1;var $=x-1;return p!==r&&($=xt(p),$=p<0?Cr(x+$,0):ri($,x-1)),Sl(o,ot(c,3),$,!0)}function iw(o){var c=o==null?0:o.length;return c?Kr(o,1):[]}function Fk(o){var c=o==null?0:o.length;return c?Kr(o,C):[]}function Uk(o,c){var p=o==null?0:o.length;return p?(c=c===r?1:xt(c),Kr(o,c)):[]}function kk(o){for(var c=-1,p=o==null?0:o.length,x={};++c<p;){var $=o[c];x[$[0]]=$[1]}return x}function nw(o){return o&&o.length?o[0]:r}function jk(o,c,p){var x=o==null?0:o.length;if(!x)return-1;var $=p==null?0:xt(p);return $<0&&($=Cr(x+$,0)),$c(o,c,$)}function qk(o){var c=o==null?0:o.length;return c?hn(o,0,-1):[]}var zk=Mt(function(o){var c=cr(o,tg);return c.length&&c[0]===o[0]?Kp(c):[]}),Hk=Mt(function(o){var c=ln(o),p=cr(o,tg);return c===ln(p)?c=r:p.pop(),p.length&&p[0]===o[0]?Kp(p,ot(c,2)):[]}),Kk=Mt(function(o){var c=ln(o),p=cr(o,tg);return c=typeof c=="function"?c:r,c&&p.pop(),p.length&&p[0]===o[0]?Kp(p,r,c):[]});function Wk(o,c){return o==null?"":qF.call(o,c)}function ln(o){var c=o==null?0:o.length;return c?o[c-1]:r}function Vk(o,c,p){var x=o==null?0:o.length;if(!x)return-1;var $=x;return p!==r&&($=xt(p),$=$<0?Cr(x+$,0):ri($,x-1)),c===c?IF(o,c,$):Sl(o,Fy,$,!0)}function Gk(o,c){return o&&o.length?g5(o,xt(c)):r}var Yk=Mt(sw);function sw(o,c){return o&&o.length&&c&&c.length?Yp(o,c):o}function Jk(o,c,p){return o&&o.length&&c&&c.length?Yp(o,c,ot(p,2)):o}function Qk(o,c,p){return o&&o.length&&c&&c.length?Yp(o,c,r,p):o}var Zk=Hs(function(o,c){var p=o==null?0:o.length,x=jp(o,c);return b5(o,cr(c,function($){return Ks($,p)?+$:$}).sort(C5)),x});function Xk(o,c){var p=[];if(!(o&&o.length))return p;var x=-1,$=[],j=o.length;for(c=ot(c,3);++x<j;){var Q=o[x];c(Q,x,o)&&(p.push(Q),$.push(x))}return b5(o,$),p}function gg(o){return o==null?o:WF.call(o)}function ej(o,c,p){var x=o==null?0:o.length;return x?(p&&typeof p!="number"&&di(o,c,p)?(c=0,p=x):(c=c==null?0:xt(c),p=p===r?x:xt(p)),hn(o,c,p)):[]}function tj(o,c){return Kl(o,c)}function rj(o,c,p){return Zp(o,c,ot(p,2))}function ij(o,c){var p=o==null?0:o.length;if(p){var x=Kl(o,c);if(x<p&&Bn(o[x],c))return x}return-1}function nj(o,c){return Kl(o,c,!0)}function sj(o,c,p){return Zp(o,c,ot(p,2),!0)}function oj(o,c){var p=o==null?0:o.length;if(p){var x=Kl(o,c,!0)-1;if(Bn(o[x],c))return x}return-1}function aj(o){return o&&o.length?w5(o):[]}function cj(o,c){return o&&o.length?w5(o,ot(c,2)):[]}function uj(o){var c=o==null?0:o.length;return c?hn(o,1,c):[]}function fj(o,c,p){return o&&o.length?(c=p||c===r?1:xt(c),hn(o,0,c<0?0:c)):[]}function hj(o,c,p){var x=o==null?0:o.length;return x?(c=p||c===r?1:xt(c),c=x-c,hn(o,c<0?0:c,x)):[]}function lj(o,c){return o&&o.length?Wl(o,ot(c,3),!1,!0):[]}function dj(o,c){return o&&o.length?Wl(o,ot(c,3)):[]}var pj=Mt(function(o){return xo(Kr(o,1,wr,!0))}),gj=Mt(function(o){var c=ln(o);return wr(c)&&(c=r),xo(Kr(o,1,wr,!0),ot(c,2))}),vj=Mt(function(o){var c=ln(o);return c=typeof c=="function"?c:r,xo(Kr(o,1,wr,!0),r,c)});function mj(o){return o&&o.length?xo(o):[]}function bj(o,c){return o&&o.length?xo(o,ot(c,2)):[]}function yj(o,c){return c=typeof c=="function"?c:r,o&&o.length?xo(o,r,c):[]}function vg(o){if(!(o&&o.length))return[];var c=0;return o=yo(o,function(p){if(wr(p))return c=Cr(p.length,c),!0}),Rp(c,function(p){return cr(o,Op(p))})}function ow(o,c){if(!(o&&o.length))return[];var p=vg(o);return c==null?p:cr(p,function(x){return Tr(c,r,x)})}var wj=Mt(function(o,c){return wr(o)?hf(o,c):[]}),_j=Mt(function(o){return eg(yo(o,wr))}),Ej=Mt(function(o){var c=ln(o);return wr(c)&&(c=r),eg(yo(o,wr),ot(c,2))}),Aj=Mt(function(o){var c=ln(o);return c=typeof c=="function"?c:r,eg(yo(o,wr),r,c)}),xj=Mt(vg);function Sj(o,c){return x5(o||[],c||[],ff)}function Ij(o,c){return x5(o||[],c||[],pf)}var Mj=Mt(function(o){var c=o.length,p=c>1?o[c-1]:r;return p=typeof p=="function"?(o.pop(),p):r,ow(o,p)});function aw(o){var c=F(o);return c.__chain__=!0,c}function Cj(o,c){return c(o),o}function t0(o,c){return c(o)}var Dj=Hs(function(o){var c=o.length,p=c?o[0]:0,x=this.__wrapped__,$=function(j){return jp(j,o)};return c>1||this.__actions__.length||!(x instanceof Lt)||!Ks(p)?this.thru($):(x=x.slice(p,+p+(c?1:0)),x.__actions__.push({func:t0,args:[$],thisArg:r}),new un(x,this.__chain__).thru(function(j){return c&&!j.length&&j.push(r),j}))});function Oj(){return aw(this)}function Pj(){return new un(this.value(),this.__chain__)}function $j(){this.__values__===r&&(this.__values__=_w(this.value()));var o=this.__index__>=this.__values__.length,c=o?r:this.__values__[this.__index__++];return{done:o,value:c}}function Rj(){return this}function Nj(o){for(var c,p=this;p instanceof kl;){var x=ew(p);x.__index__=0,x.__values__=r,c?$.__wrapped__=x:c=x;var $=x;p=p.__wrapped__}return $.__wrapped__=o,c}function Tj(){var o=this.__wrapped__;if(o instanceof Lt){var c=o;return this.__actions__.length&&(c=new Lt(this)),c=c.reverse(),c.__actions__.push({func:t0,args:[gg],thisArg:r}),new un(c,this.__chain__)}return this.thru(gg)}function Lj(){return A5(this.__wrapped__,this.__actions__)}var Bj=Vl(function(o,c,p){Yt.call(o,p)?++o[p]:qs(o,p,1)});function Fj(o,c,p){var x=yt(o)?Ly:CU;return p&&di(o,c,p)&&(c=r),x(o,ot(c,3))}function Uj(o,c){var p=yt(o)?yo:o5;return p(o,ot(c,3))}var kj=N5(tw),jj=N5(rw);function qj(o,c){return Kr(r0(o,c),1)}function zj(o,c){return Kr(r0(o,c),C)}function Hj(o,c,p){return p=p===r?1:xt(p),Kr(r0(o,c),p)}function cw(o,c){var p=yt(o)?an:Ao;return p(o,ot(c,3))}function uw(o,c){var p=yt(o)?uF:s5;return p(o,ot(c,3))}var Kj=Vl(function(o,c,p){Yt.call(o,p)?o[p].push(c):qs(o,p,[c])});function Wj(o,c,p,x){o=Oi(o)?o:Hc(o),p=p&&!x?xt(p):0;var $=o.length;return p<0&&(p=Cr($+p,0)),a0(o)?p<=$&&o.indexOf(c,p)>-1:!!$&&$c(o,c,p)>-1}var Vj=Mt(function(o,c,p){var x=-1,$=typeof c=="function",j=Oi(o)?ce(o.length):[];return Ao(o,function(Q){j[++x]=$?Tr(c,Q,p):lf(Q,c,p)}),j}),Gj=Vl(function(o,c,p){qs(o,p,c)});function r0(o,c){var p=yt(o)?cr:l5;return p(o,ot(c,3))}function Yj(o,c,p,x){return o==null?[]:(yt(c)||(c=c==null?[]:[c]),p=x?r:p,yt(p)||(p=p==null?[]:[p]),v5(o,c,p))}var Jj=Vl(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function Qj(o,c,p){var x=yt(o)?Cp:ky,$=arguments.length<3;return x(o,ot(c,4),p,$,Ao)}function Zj(o,c,p){var x=yt(o)?fF:ky,$=arguments.length<3;return x(o,ot(c,4),p,$,s5)}function Xj(o,c){var p=yt(o)?yo:o5;return p(o,s0(ot(c,3)))}function eq(o){var c=yt(o)?t5:WU;return c(o)}function tq(o,c,p){(p?di(o,c,p):c===r)?c=1:c=xt(c);var x=yt(o)?AU:VU;return x(o,c)}function rq(o){var c=yt(o)?xU:YU;return c(o)}function iq(o){if(o==null)return 0;if(Oi(o))return a0(o)?Nc(o):o.length;var c=ii(o);return c==he||c==Me?o.size:Vp(o).length}function nq(o,c,p){var x=yt(o)?Dp:JU;return p&&di(o,c,p)&&(c=r),x(o,ot(c,3))}var sq=Mt(function(o,c){if(o==null)return[];var p=c.length;return p>1&&di(o,c[0],c[1])?c=[]:p>2&&di(c[0],c[1],c[2])&&(c=[c[0]]),v5(o,Kr(c,1),[])}),i0=UF||function(){return Ft.Date.now()};function oq(o,c){if(typeof c!="function")throw new cn(a);return o=xt(o),function(){if(--o<1)return c.apply(this,arguments)}}function fw(o,c,p){return c=p?r:c,c=o&&c==null?o.length:c,zs(o,_,r,r,r,r,c)}function hw(o,c){var p;if(typeof c!="function")throw new cn(a);return o=xt(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=r),p}}var mg=Mt(function(o,c,p){var x=K;if(p.length){var $=_o(p,qc(mg));x|=k}return zs(o,x,c,p,$)}),lw=Mt(function(o,c,p){var x=K|H;if(p.length){var $=_o(p,qc(lw));x|=k}return zs(c,x,o,p,$)});function dw(o,c,p){c=p?r:c;var x=zs(o,W,r,r,r,r,r,c);return x.placeholder=dw.placeholder,x}function pw(o,c,p){c=p?r:c;var x=zs(o,R,r,r,r,r,r,c);return x.placeholder=pw.placeholder,x}function gw(o,c,p){var x,$,j,Q,Z,se,le=0,de=!1,ge=!1,De=!0;if(typeof o!="function")throw new cn(a);c=dn(c)||0,fr(p)&&(de=!!p.leading,ge="maxWait"in p,j=ge?Cr(dn(p.maxWait)||0,c):j,De="trailing"in p?!!p.trailing:De);function Ye(_r){var Fn=x,Gs=$;return x=$=r,le=_r,Q=o.apply(Gs,Fn),Q}function ut(_r){return le=_r,Z=mf(Pt,c),de?Ye(_r):Q}function St(_r){var Fn=_r-se,Gs=_r-le,Nw=c-Fn;return ge?ri(Nw,j-Gs):Nw}function ft(_r){var Fn=_r-se,Gs=_r-le;return se===r||Fn>=c||Fn<0||ge&&Gs>=j}function Pt(){var _r=i0();if(ft(_r))return Ut(_r);Z=mf(Pt,St(_r))}function Ut(_r){return Z=r,De&&x?Ye(_r):(x=$=r,Q)}function Hi(){Z!==r&&S5(Z),le=0,x=se=$=Z=r}function pi(){return Z===r?Q:Ut(i0())}function Ki(){var _r=i0(),Fn=ft(_r);if(x=arguments,$=this,se=_r,Fn){if(Z===r)return ut(se);if(ge)return S5(Z),Z=mf(Pt,c),Ye(se)}return Z===r&&(Z=mf(Pt,c)),Q}return Ki.cancel=Hi,Ki.flush=pi,Ki}var aq=Mt(function(o,c){return n5(o,1,c)}),cq=Mt(function(o,c,p){return n5(o,dn(c)||0,p)});function uq(o){return zs(o,X)}function n0(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new cn(a);var p=function(){var x=arguments,$=c?c.apply(this,x):x[0],j=p.cache;if(j.has($))return j.get($);var Q=o.apply(this,x);return p.cache=j.set($,Q)||j,Q};return p.cache=new(n0.Cache||js),p}n0.Cache=js;function s0(o){if(typeof o!="function")throw new cn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function fq(o){return hw(2,o)}var hq=QU(function(o,c){c=c.length==1&&yt(c[0])?cr(c[0],ji(ot())):cr(Kr(c,1),ji(ot()));var p=c.length;return Mt(function(x){for(var $=-1,j=ri(x.length,p);++$<j;)x[$]=c[$].call(this,x[$]);return Tr(o,this,x)})}),bg=Mt(function(o,c){var p=_o(c,qc(bg));return zs(o,k,r,c,p)}),vw=Mt(function(o,c){var p=_o(c,qc(vw));return zs(o,z,r,c,p)}),lq=Hs(function(o,c){return zs(o,B,r,r,r,c)});function dq(o,c){if(typeof o!="function")throw new cn(a);return c=c===r?c:xt(c),Mt(o,c)}function pq(o,c){if(typeof o!="function")throw new cn(a);return c=c==null?0:Cr(xt(c),0),Mt(function(p){var x=p[c],$=Io(p,0,c);return x&&wo($,x),Tr(o,this,$)})}function gq(o,c,p){var x=!0,$=!0;if(typeof o!="function")throw new cn(a);return fr(p)&&(x="leading"in p?!!p.leading:x,$="trailing"in p?!!p.trailing:$),gw(o,c,{leading:x,maxWait:c,trailing:$})}function vq(o){return fw(o,1)}function mq(o,c){return bg(rg(c),o)}function bq(){if(!arguments.length)return[];var o=arguments[0];return yt(o)?o:[o]}function yq(o){return fn(o,I)}function wq(o,c){return c=typeof c=="function"?c:r,fn(o,I,c)}function _q(o){return fn(o,w|I)}function Eq(o,c){return c=typeof c=="function"?c:r,fn(o,w|I,c)}function Aq(o,c){return c==null||i5(o,c,Lr(c))}function Bn(o,c){return o===c||o!==o&&c!==c}var xq=Ql(Hp),Sq=Ql(function(o,c){return o>=c}),Aa=u5(function(){return arguments}())?u5:function(o){return gr(o)&&Yt.call(o,"callee")&&!Yy.call(o,"callee")},yt=ce.isArray,Iq=hi?ji(hi):NU;function Oi(o){return o!=null&&o0(o.length)&&!Ws(o)}function wr(o){return gr(o)&&Oi(o)}function Mq(o){return o===!0||o===!1||gr(o)&&li(o)==G}var Mo=jF||Dg,Cq=Nn?ji(Nn):TU;function Dq(o){return gr(o)&&o.nodeType===1&&!bf(o)}function Oq(o){if(o==null)return!0;if(Oi(o)&&(yt(o)||typeof o=="string"||typeof o.splice=="function"||Mo(o)||zc(o)||Aa(o)))return!o.length;var c=ii(o);if(c==he||c==Me)return!o.size;if(vf(o))return!Vp(o).length;for(var p in o)if(Yt.call(o,p))return!1;return!0}function Pq(o,c){return df(o,c)}function $q(o,c,p){p=typeof p=="function"?p:r;var x=p?p(o,c):r;return x===r?df(o,c,r,p):!!x}function yg(o){if(!gr(o))return!1;var c=li(o);return c==V||c==A||typeof o.message=="string"&&typeof o.name=="string"&&!bf(o)}function Rq(o){return typeof o=="number"&&Qy(o)}function Ws(o){if(!fr(o))return!1;var c=li(o);return c==oe||c==ue||c==q||c==Oe}function mw(o){return typeof o=="number"&&o==xt(o)}function o0(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=P}function fr(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function gr(o){return o!=null&&typeof o=="object"}var bw=on?ji(on):BU;function Nq(o,c){return o===c||Wp(o,c,ug(c))}function Tq(o,c,p){return p=typeof p=="function"?p:r,Wp(o,c,ug(c),p)}function Lq(o){return yw(o)&&o!=+o}function Bq(o){if(wk(o))throw new vt(s);return f5(o)}function Fq(o){return o===null}function Uq(o){return o==null}function yw(o){return typeof o=="number"||gr(o)&&li(o)==ye}function bf(o){if(!gr(o)||li(o)!=Re)return!1;var c=Rl(o);if(c===null)return!0;var p=Yt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Dl.call(p)==TF}var wg=ys?ji(ys):FU;function kq(o){return mw(o)&&o>=-P&&o<=P}var ww=rf?ji(rf):UU;function a0(o){return typeof o=="string"||!yt(o)&&gr(o)&&li(o)==be}function zi(o){return typeof o=="symbol"||gr(o)&&li(o)==Pe}var zc=ga?ji(ga):kU;function jq(o){return o===r}function qq(o){return gr(o)&&ii(o)==ve}function zq(o){return gr(o)&&li(o)==$e}var Hq=Ql(Gp),Kq=Ql(function(o,c){return o<=c});function _w(o){if(!o)return[];if(Oi(o))return a0(o)?Tn(o):Di(o);if(sf&&o[sf])return AF(o[sf]());var c=ii(o),p=c==he?Tp:c==Me?Il:Hc;return p(o)}function Vs(o){if(!o)return o===0?o:0;if(o=dn(o),o===C||o===-C){var c=o<0?-1:1;return c*M}return o===o?o:0}function xt(o){var c=Vs(o),p=c%1;return c===c?p?c-p:c:0}function Ew(o){return o?ya(xt(o),0,m):0}function dn(o){if(typeof o=="number")return o;if(zi(o))return g;if(fr(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=fr(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=jy(o);var p=Zr.test(o);return p||ei.test(o)?bt(o.slice(2),p?2:8):Qr.test(o)?g:+o}function Aw(o){return _s(o,Pi(o))}function Wq(o){return o?ya(xt(o),-P,P):o===0?o:0}function Vt(o){return o==null?"":qi(o)}var Vq=kc(function(o,c){if(vf(c)||Oi(c)){_s(c,Lr(c),o);return}for(var p in c)Yt.call(c,p)&&ff(o,p,c[p])}),xw=kc(function(o,c){_s(c,Pi(c),o)}),c0=kc(function(o,c,p,x){_s(c,Pi(c),o,x)}),Gq=kc(function(o,c,p,x){_s(c,Lr(c),o,x)}),Yq=Hs(jp);function Jq(o,c){var p=Uc(o);return c==null?p:r5(p,c)}var Qq=Mt(function(o,c){o=tr(o);var p=-1,x=c.length,$=x>2?c[2]:r;for($&&di(c[0],c[1],$)&&(x=1);++p<x;)for(var j=c[p],Q=Pi(j),Z=-1,se=Q.length;++Z<se;){var le=Q[Z],de=o[le];(de===r||Bn(de,Lc[le])&&!Yt.call(o,le))&&(o[le]=j[le])}return o}),Zq=Mt(function(o){return o.push(r,j5),Tr(Sw,r,o)});function Xq(o,c){return By(o,ot(c,3),ws)}function ez(o,c){return By(o,ot(c,3),zp)}function tz(o,c){return o==null?o:qp(o,ot(c,3),Pi)}function rz(o,c){return o==null?o:a5(o,ot(c,3),Pi)}function iz(o,c){return o&&ws(o,ot(c,3))}function nz(o,c){return o&&zp(o,ot(c,3))}function sz(o){return o==null?[]:zl(o,Lr(o))}function oz(o){return o==null?[]:zl(o,Pi(o))}function _g(o,c,p){var x=o==null?r:wa(o,c);return x===r?p:x}function az(o,c){return o!=null&&H5(o,c,OU)}function Eg(o,c){return o!=null&&H5(o,c,PU)}var cz=L5(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Ol.call(c)),o[c]=p},xg($i)),uz=L5(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Ol.call(c)),Yt.call(o,c)?o[c].push(p):o[c]=[p]},ot),fz=Mt(lf);function Lr(o){return Oi(o)?e5(o):Vp(o)}function Pi(o){return Oi(o)?e5(o,!0):jU(o)}function hz(o,c){var p={};return c=ot(c,3),ws(o,function(x,$,j){qs(p,c(x,$,j),x)}),p}function lz(o,c){var p={};return c=ot(c,3),ws(o,function(x,$,j){qs(p,$,c(x,$,j))}),p}var dz=kc(function(o,c,p){Hl(o,c,p)}),Sw=kc(function(o,c,p,x){Hl(o,c,p,x)}),pz=Hs(function(o,c){var p={};if(o==null)return p;var x=!1;c=cr(c,function(j){return j=So(j,o),x||(x=j.length>1),j}),_s(o,ag(o),p),x&&(p=fn(p,w|S|I,ck));for(var $=c.length;$--;)Xp(p,c[$]);return p});function gz(o,c){return Iw(o,s0(ot(c)))}var vz=Hs(function(o,c){return o==null?{}:zU(o,c)});function Iw(o,c){if(o==null)return{};var p=cr(ag(o),function(x){return[x]});return c=ot(c),m5(o,p,function(x,$){return c(x,$[0])})}function mz(o,c,p){c=So(c,o);var x=-1,$=c.length;for($||($=1,o=r);++x<$;){var j=o==null?r:o[Es(c[x])];j===r&&(x=$,j=p),o=Ws(j)?j.call(o):j}return o}function bz(o,c,p){return o==null?o:pf(o,c,p)}function yz(o,c,p,x){return x=typeof x=="function"?x:r,o==null?o:pf(o,c,p,x)}var Mw=U5(Lr),Cw=U5(Pi);function wz(o,c,p){var x=yt(o),$=x||Mo(o)||zc(o);if(c=ot(c,4),p==null){var j=o&&o.constructor;$?p=x?new j:[]:fr(o)?p=Ws(j)?Uc(Rl(o)):{}:p={}}return($?an:ws)(o,function(Q,Z,se){return c(p,Q,Z,se)}),p}function _z(o,c){return o==null?!0:Xp(o,c)}function Ez(o,c,p){return o==null?o:E5(o,c,rg(p))}function Az(o,c,p,x){return x=typeof x=="function"?x:r,o==null?o:E5(o,c,rg(p),x)}function Hc(o){return o==null?[]:Np(o,Lr(o))}function xz(o){return o==null?[]:Np(o,Pi(o))}function Sz(o,c,p){return p===r&&(p=c,c=r),p!==r&&(p=dn(p),p=p===p?p:0),c!==r&&(c=dn(c),c=c===c?c:0),ya(dn(o),c,p)}function Iz(o,c,p){return c=Vs(c),p===r?(p=c,c=0):p=Vs(p),o=dn(o),$U(o,c,p)}function Mz(o,c,p){if(p&&typeof p!="boolean"&&di(o,c,p)&&(c=p=r),p===r&&(typeof c=="boolean"?(p=c,c=r):typeof o=="boolean"&&(p=o,o=r)),o===r&&c===r?(o=0,c=1):(o=Vs(o),c===r?(c=o,o=0):c=Vs(c)),o>c){var x=o;o=c,c=x}if(p||o%1||c%1){var $=Zy();return ri(o+$*(c-o+Xt("1e-"+(($+"").length-1))),c)}return Jp(o,c)}var Cz=jc(function(o,c,p){return c=c.toLowerCase(),o+(p?Dw(c):c)});function Dw(o){return Ag(Vt(o).toLowerCase())}function Ow(o){return o=Vt(o),o&&o.replace(pr,bF).replace(Sp,"")}function Dz(o,c,p){o=Vt(o),c=qi(c);var x=o.length;p=p===r?x:ya(xt(p),0,x);var $=p;return p-=c.length,p>=0&&o.slice(p,$)==c}function Oz(o){return o=Vt(o),o&&et.test(o)?o.replace(Tt,yF):o}function Pz(o){return o=Vt(o),o&&qe.test(o)?o.replace(nt,"\\$&"):o}var $z=jc(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),Rz=jc(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),Nz=R5("toLowerCase");function Tz(o,c,p){o=Vt(o),c=xt(c);var x=c?Nc(o):0;if(!c||x>=c)return o;var $=(c-x)/2;return Jl(Bl($),p)+o+Jl(Ll($),p)}function Lz(o,c,p){o=Vt(o),c=xt(c);var x=c?Nc(o):0;return c&&x<c?o+Jl(c-x,p):o}function Bz(o,c,p){o=Vt(o),c=xt(c);var x=c?Nc(o):0;return c&&x<c?Jl(c-x,p)+o:o}function Fz(o,c,p){return p||c==null?c=0:c&&(c=+c),KF(Vt(o).replace(st,""),c||0)}function Uz(o,c,p){return(p?di(o,c,p):c===r)?c=1:c=xt(c),Qp(Vt(o),c)}function kz(){var o=arguments,c=Vt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var jz=jc(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function qz(o,c,p){return p&&typeof p!="number"&&di(o,c,p)&&(c=p=r),p=p===r?m:p>>>0,p?(o=Vt(o),o&&(typeof c=="string"||c!=null&&!wg(c))&&(c=qi(c),!c&&Rc(o))?Io(Tn(o),0,p):o.split(c,p)):[]}var zz=jc(function(o,c,p){return o+(p?" ":"")+Ag(c)});function Hz(o,c,p){return o=Vt(o),p=p==null?0:ya(xt(p),0,o.length),c=qi(c),o.slice(p,p+c.length)==c}function Kz(o,c,p){var x=F.templateSettings;p&&di(o,c,p)&&(c=r),o=Vt(o),c=c0({},c,x,k5);var $=c0({},c.imports,x.imports,k5),j=Lr($),Q=Np($,j),Z,se,le=0,de=c.interpolate||Si,ge="__p += '",De=Lp((c.escape||Si).source+"|"+de.source+"|"+(de===rt?ct:Si).source+"|"+(c.evaluate||Si).source+"|$","g"),Ye="//# sourceURL="+(Yt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ip+"]")+`
53
- `;o.replace(De,function(ft,Pt,Ut,Hi,pi,Ki){return Ut||(Ut=Hi),ge+=o.slice(le,Ki).replace(Cn,wF),Pt&&(Z=!0,ge+=`' +
52
+ `)}function ck(o){return yt(o)||Aa(o)||!!(Gy&&o&&o[Gy])}function Ks(o,c){var p=typeof o;return c=c??P,!!c&&(p=="number"||p!="symbol"&&ti.test(o))&&o>-1&&o%1==0&&o<c}function di(o,c,p){if(!fr(p))return!1;var x=typeof c;return(x=="number"?Oi(p)&&Ks(c,p.length):x=="string"&&c in p)?Bn(p[c],o):!1}function hg(o,c){if(yt(o))return!1;var p=typeof o;return p=="number"||p=="symbol"||p=="boolean"||o==null||zi(o)?!0:je.test(o)||!tt.test(o)||c!=null&&o in tr(c)}function uk(o){var c=typeof o;return c=="string"||c=="number"||c=="symbol"||c=="boolean"?o!=="__proto__":o===null}function lg(o){var c=Xl(o),p=F[c];if(typeof p!="function"||!(c in Lt.prototype))return!1;if(o===p)return!0;var x=cg(p);return!!x&&o===x[0]}function fk(o){return!!Hy&&Hy in o}var hk=Dl?Ws:Dg;function vf(o){var c=o&&o.constructor,p=typeof c=="function"&&c.prototype||Lc;return o===p}function H5(o){return o===o&&!fr(o)}function K5(o,c){return function(p){return p==null?!1:p[o]===c&&(c!==r||o in tr(p))}}function lk(o){var c=s0(o,function(x){return p.size===d&&p.clear(),x}),p=c.cache;return c}function dk(o,c){var p=o[1],x=c[1],$=p|x,j=$<(K|H|_),Q=x==_&&p==W||x==_&&p==B&&o[7].length<=c[8]||x==(_|B)&&c[7].length<=c[8]&&p==W;if(!(j||Q))return o;x&K&&(o[2]=c[2],$|=p&K?0:U);var Z=c[3];if(Z){var se=o[3];o[3]=se?M5(se,Z,c[4]):Z,o[4]=se?_o(o[3],b):c[4]}return Z=c[5],Z&&(se=o[5],o[5]=se?C5(se,Z,c[6]):Z,o[6]=se?_o(o[5],b):c[6]),Z=c[7],Z&&(o[7]=Z),x&_&&(o[8]=o[8]==null?c[8]:ri(o[8],c[8])),o[9]==null&&(o[9]=c[9]),o[0]=c[0],o[1]=$,o}function pk(o){var c=[];if(o!=null)for(var p in tr(o))c.push(p);return c}function gk(o){return Pl.call(o)}function W5(o,c,p){return c=Cr(c===r?o.length-1:c,0),function(){for(var x=arguments,$=-1,j=Cr(x.length-c,0),Q=ce(j);++$<j;)Q[$]=x[c+$];$=-1;for(var Z=ce(c+1);++$<c;)Z[$]=x[$];return Z[c]=p(Q),Tr(o,this,Z)}}function V5(o,c){return c.length<2?o:wa(o,hn(c,0,-1))}function vk(o,c){for(var p=o.length,x=ri(c.length,p),$=Di(o);x--;){var j=c[x];o[x]=Ks(j,p)?$[j]:r}return o}function dg(o,c){if(!(c==="constructor"&&typeof o[c]=="function")&&c!="__proto__")return o[c]}var G5=J5(m5),mf=PF||function(o,c){return Ft.setTimeout(o,c)},pg=J5(UU);function Y5(o,c,p){var x=c+"";return pg(o,ak(x,mk(nk(x),p)))}function J5(o){var c=0,p=0;return function(){var x=TF(),$=f-(x-p);if(p=x,$>0){if(++c>=y)return arguments[0]}else c=0;return o.apply(r,arguments)}}function t0(o,c){var p=-1,x=o.length,$=x-1;for(c=c===r?x:c;++p<c;){var j=Jp(p,$),Q=o[j];o[j]=o[p],o[p]=Q}return o.length=c,o}var Q5=lk(function(o){var c=[];return o.charCodeAt(0)===46&&c.push(""),o.replace(ht,function(p,x,$,j){c.push($?j.replace(qt,"$1"):x||p)}),c});function Es(o){if(typeof o=="string"||zi(o))return o;var c=o+"";return c=="0"&&1/o==-C?"-0":c}function Ea(o){if(o!=null){try{return Ol.call(o)}catch{}try{return o+""}catch{}}return""}function mk(o,c){return an(ae,function(p){var x="_."+p[0];c&p[1]&&!Sl(o,x)&&o.push(x)}),o.sort()}function Z5(o){if(o instanceof Lt)return o.clone();var c=new un(o.__wrapped__,o.__chain__);return c.__actions__=Di(o.__actions__),c.__index__=o.__index__,c.__values__=o.__values__,c}function bk(o,c,p){(p?di(o,c,p):c===r)?c=1:c=Cr(xt(c),0);var x=o==null?0:o.length;if(!x||c<1)return[];for(var $=0,j=0,Q=ce(Bl(x/c));$<x;)Q[j++]=hn(o,$,$+=c);return Q}function yk(o){for(var c=-1,p=o==null?0:o.length,x=0,$=[];++c<p;){var j=o[c];j&&($[x++]=j)}return $}function wk(){var o=arguments.length;if(!o)return[];for(var c=ce(o-1),p=arguments[0],x=o;x--;)c[x-1]=arguments[x];return wo(yt(p)?Di(p):[p],Kr(c,1))}var _k=Mt(function(o,c){return wr(o)?hf(o,Kr(c,1,wr,!0)):[]}),Ek=Mt(function(o,c){var p=ln(c);return wr(p)&&(p=r),wr(o)?hf(o,Kr(c,1,wr,!0),ot(p,2)):[]}),Ak=Mt(function(o,c){var p=ln(c);return wr(p)&&(p=r),wr(o)?hf(o,Kr(c,1,wr,!0),r,p):[]});function xk(o,c,p){var x=o==null?0:o.length;return x?(c=p||c===r?1:xt(c),hn(o,c<0?0:c,x)):[]}function Sk(o,c,p){var x=o==null?0:o.length;return x?(c=p||c===r?1:xt(c),c=x-c,hn(o,0,c<0?0:c)):[]}function Ik(o,c){return o&&o.length?Vl(o,ot(c,3),!0,!0):[]}function Mk(o,c){return o&&o.length?Vl(o,ot(c,3),!0):[]}function Ck(o,c,p,x){var $=o==null?0:o.length;return $?(p&&typeof p!="number"&&di(o,c,p)&&(p=0,x=$),wU(o,c,p,x)):[]}function X5(o,c,p){var x=o==null?0:o.length;if(!x)return-1;var $=p==null?0:xt(p);return $<0&&($=Cr(x+$,0)),Il(o,ot(c,3),$)}function ew(o,c,p){var x=o==null?0:o.length;if(!x)return-1;var $=x-1;return p!==r&&($=xt(p),$=p<0?Cr(x+$,0):ri($,x-1)),Il(o,ot(c,3),$,!0)}function tw(o){var c=o==null?0:o.length;return c?Kr(o,1):[]}function Dk(o){var c=o==null?0:o.length;return c?Kr(o,C):[]}function Ok(o,c){var p=o==null?0:o.length;return p?(c=c===r?1:xt(c),Kr(o,c)):[]}function Pk(o){for(var c=-1,p=o==null?0:o.length,x={};++c<p;){var $=o[c];x[$[0]]=$[1]}return x}function rw(o){return o&&o.length?o[0]:r}function $k(o,c,p){var x=o==null?0:o.length;if(!x)return-1;var $=p==null?0:xt(p);return $<0&&($=Cr(x+$,0)),$c(o,c,$)}function Rk(o){var c=o==null?0:o.length;return c?hn(o,0,-1):[]}var Nk=Mt(function(o){var c=cr(o,tg);return c.length&&c[0]===o[0]?Kp(c):[]}),Tk=Mt(function(o){var c=ln(o),p=cr(o,tg);return c===ln(p)?c=r:p.pop(),p.length&&p[0]===o[0]?Kp(p,ot(c,2)):[]}),Lk=Mt(function(o){var c=ln(o),p=cr(o,tg);return c=typeof c=="function"?c:r,c&&p.pop(),p.length&&p[0]===o[0]?Kp(p,r,c):[]});function Bk(o,c){return o==null?"":RF.call(o,c)}function ln(o){var c=o==null?0:o.length;return c?o[c-1]:r}function Fk(o,c,p){var x=o==null?0:o.length;if(!x)return-1;var $=x;return p!==r&&($=xt(p),$=$<0?Cr(x+$,0):ri($,x-1)),c===c?mF(o,c,$):Il(o,Ly,$,!0)}function Uk(o,c){return o&&o.length?d5(o,xt(c)):r}var kk=Mt(iw);function iw(o,c){return o&&o.length&&c&&c.length?Yp(o,c):o}function jk(o,c,p){return o&&o.length&&c&&c.length?Yp(o,c,ot(p,2)):o}function qk(o,c,p){return o&&o.length&&c&&c.length?Yp(o,c,r,p):o}var zk=Hs(function(o,c){var p=o==null?0:o.length,x=jp(o,c);return v5(o,cr(c,function($){return Ks($,p)?+$:$}).sort(I5)),x});function Hk(o,c){var p=[];if(!(o&&o.length))return p;var x=-1,$=[],j=o.length;for(c=ot(c,3);++x<j;){var Q=o[x];c(Q,x,o)&&(p.push(Q),$.push(x))}return v5(o,$),p}function gg(o){return o==null?o:BF.call(o)}function Kk(o,c,p){var x=o==null?0:o.length;return x?(p&&typeof p!="number"&&di(o,c,p)?(c=0,p=x):(c=c==null?0:xt(c),p=p===r?x:xt(p)),hn(o,c,p)):[]}function Wk(o,c){return Wl(o,c)}function Vk(o,c,p){return Zp(o,c,ot(p,2))}function Gk(o,c){var p=o==null?0:o.length;if(p){var x=Wl(o,c);if(x<p&&Bn(o[x],c))return x}return-1}function Yk(o,c){return Wl(o,c,!0)}function Jk(o,c,p){return Zp(o,c,ot(p,2),!0)}function Qk(o,c){var p=o==null?0:o.length;if(p){var x=Wl(o,c,!0)-1;if(Bn(o[x],c))return x}return-1}function Zk(o){return o&&o.length?b5(o):[]}function Xk(o,c){return o&&o.length?b5(o,ot(c,2)):[]}function ej(o){var c=o==null?0:o.length;return c?hn(o,1,c):[]}function tj(o,c,p){return o&&o.length?(c=p||c===r?1:xt(c),hn(o,0,c<0?0:c)):[]}function rj(o,c,p){var x=o==null?0:o.length;return x?(c=p||c===r?1:xt(c),c=x-c,hn(o,c<0?0:c,x)):[]}function ij(o,c){return o&&o.length?Vl(o,ot(c,3),!1,!0):[]}function nj(o,c){return o&&o.length?Vl(o,ot(c,3)):[]}var sj=Mt(function(o){return xo(Kr(o,1,wr,!0))}),oj=Mt(function(o){var c=ln(o);return wr(c)&&(c=r),xo(Kr(o,1,wr,!0),ot(c,2))}),aj=Mt(function(o){var c=ln(o);return c=typeof c=="function"?c:r,xo(Kr(o,1,wr,!0),r,c)});function cj(o){return o&&o.length?xo(o):[]}function uj(o,c){return o&&o.length?xo(o,ot(c,2)):[]}function fj(o,c){return c=typeof c=="function"?c:r,o&&o.length?xo(o,r,c):[]}function vg(o){if(!(o&&o.length))return[];var c=0;return o=yo(o,function(p){if(wr(p))return c=Cr(p.length,c),!0}),Rp(c,function(p){return cr(o,Op(p))})}function nw(o,c){if(!(o&&o.length))return[];var p=vg(o);return c==null?p:cr(p,function(x){return Tr(c,r,x)})}var hj=Mt(function(o,c){return wr(o)?hf(o,c):[]}),lj=Mt(function(o){return eg(yo(o,wr))}),dj=Mt(function(o){var c=ln(o);return wr(c)&&(c=r),eg(yo(o,wr),ot(c,2))}),pj=Mt(function(o){var c=ln(o);return c=typeof c=="function"?c:r,eg(yo(o,wr),r,c)}),gj=Mt(vg);function vj(o,c){return E5(o||[],c||[],ff)}function mj(o,c){return E5(o||[],c||[],pf)}var bj=Mt(function(o){var c=o.length,p=c>1?o[c-1]:r;return p=typeof p=="function"?(o.pop(),p):r,nw(o,p)});function sw(o){var c=F(o);return c.__chain__=!0,c}function yj(o,c){return c(o),o}function r0(o,c){return c(o)}var wj=Hs(function(o){var c=o.length,p=c?o[0]:0,x=this.__wrapped__,$=function(j){return jp(j,o)};return c>1||this.__actions__.length||!(x instanceof Lt)||!Ks(p)?this.thru($):(x=x.slice(p,+p+(c?1:0)),x.__actions__.push({func:r0,args:[$],thisArg:r}),new un(x,this.__chain__).thru(function(j){return c&&!j.length&&j.push(r),j}))});function _j(){return sw(this)}function Ej(){return new un(this.value(),this.__chain__)}function Aj(){this.__values__===r&&(this.__values__=yw(this.value()));var o=this.__index__>=this.__values__.length,c=o?r:this.__values__[this.__index__++];return{done:o,value:c}}function xj(){return this}function Sj(o){for(var c,p=this;p instanceof jl;){var x=Z5(p);x.__index__=0,x.__values__=r,c?$.__wrapped__=x:c=x;var $=x;p=p.__wrapped__}return $.__wrapped__=o,c}function Ij(){var o=this.__wrapped__;if(o instanceof Lt){var c=o;return this.__actions__.length&&(c=new Lt(this)),c=c.reverse(),c.__actions__.push({func:r0,args:[gg],thisArg:r}),new un(c,this.__chain__)}return this.thru(gg)}function Mj(){return _5(this.__wrapped__,this.__actions__)}var Cj=Gl(function(o,c,p){Yt.call(o,p)?++o[p]:qs(o,p,1)});function Dj(o,c,p){var x=yt(o)?Ny:yU;return p&&di(o,c,p)&&(c=r),x(o,ot(c,3))}function Oj(o,c){var p=yt(o)?yo:n5;return p(o,ot(c,3))}var Pj=$5(X5),$j=$5(ew);function Rj(o,c){return Kr(i0(o,c),1)}function Nj(o,c){return Kr(i0(o,c),C)}function Tj(o,c,p){return p=p===r?1:xt(p),Kr(i0(o,c),p)}function ow(o,c){var p=yt(o)?an:Ao;return p(o,ot(c,3))}function aw(o,c){var p=yt(o)?eF:i5;return p(o,ot(c,3))}var Lj=Gl(function(o,c,p){Yt.call(o,p)?o[p].push(c):qs(o,p,[c])});function Bj(o,c,p,x){o=Oi(o)?o:Hc(o),p=p&&!x?xt(p):0;var $=o.length;return p<0&&(p=Cr($+p,0)),c0(o)?p<=$&&o.indexOf(c,p)>-1:!!$&&$c(o,c,p)>-1}var Fj=Mt(function(o,c,p){var x=-1,$=typeof c=="function",j=Oi(o)?ce(o.length):[];return Ao(o,function(Q){j[++x]=$?Tr(c,Q,p):lf(Q,c,p)}),j}),Uj=Gl(function(o,c,p){qs(o,p,c)});function i0(o,c){var p=yt(o)?cr:f5;return p(o,ot(c,3))}function kj(o,c,p,x){return o==null?[]:(yt(c)||(c=c==null?[]:[c]),p=x?r:p,yt(p)||(p=p==null?[]:[p]),p5(o,c,p))}var jj=Gl(function(o,c,p){o[p?0:1].push(c)},function(){return[[],[]]});function qj(o,c,p){var x=yt(o)?Cp:Fy,$=arguments.length<3;return x(o,ot(c,4),p,$,Ao)}function zj(o,c,p){var x=yt(o)?tF:Fy,$=arguments.length<3;return x(o,ot(c,4),p,$,i5)}function Hj(o,c){var p=yt(o)?yo:n5;return p(o,o0(ot(c,3)))}function Kj(o){var c=yt(o)?Xy:BU;return c(o)}function Wj(o,c,p){(p?di(o,c,p):c===r)?c=1:c=xt(c);var x=yt(o)?pU:FU;return x(o,c)}function Vj(o){var c=yt(o)?gU:kU;return c(o)}function Gj(o){if(o==null)return 0;if(Oi(o))return c0(o)?Nc(o):o.length;var c=ii(o);return c==he||c==Me?o.size:Vp(o).length}function Yj(o,c,p){var x=yt(o)?Dp:jU;return p&&di(o,c,p)&&(c=r),x(o,ot(c,3))}var Jj=Mt(function(o,c){if(o==null)return[];var p=c.length;return p>1&&di(o,c[0],c[1])?c=[]:p>2&&di(c[0],c[1],c[2])&&(c=[c[0]]),p5(o,Kr(c,1),[])}),n0=OF||function(){return Ft.Date.now()};function Qj(o,c){if(typeof c!="function")throw new cn(a);return o=xt(o),function(){if(--o<1)return c.apply(this,arguments)}}function cw(o,c,p){return c=p?r:c,c=o&&c==null?o.length:c,zs(o,_,r,r,r,r,c)}function uw(o,c){var p;if(typeof c!="function")throw new cn(a);return o=xt(o),function(){return--o>0&&(p=c.apply(this,arguments)),o<=1&&(c=r),p}}var mg=Mt(function(o,c,p){var x=K;if(p.length){var $=_o(p,qc(mg));x|=k}return zs(o,x,c,p,$)}),fw=Mt(function(o,c,p){var x=K|H;if(p.length){var $=_o(p,qc(fw));x|=k}return zs(c,x,o,p,$)});function hw(o,c,p){c=p?r:c;var x=zs(o,W,r,r,r,r,r,c);return x.placeholder=hw.placeholder,x}function lw(o,c,p){c=p?r:c;var x=zs(o,R,r,r,r,r,r,c);return x.placeholder=lw.placeholder,x}function dw(o,c,p){var x,$,j,Q,Z,se,le=0,de=!1,ge=!1,De=!0;if(typeof o!="function")throw new cn(a);c=dn(c)||0,fr(p)&&(de=!!p.leading,ge="maxWait"in p,j=ge?Cr(dn(p.maxWait)||0,c):j,De="trailing"in p?!!p.trailing:De);function Ye(_r){var Fn=x,Gs=$;return x=$=r,le=_r,Q=o.apply(Gs,Fn),Q}function ut(_r){return le=_r,Z=mf(Pt,c),de?Ye(_r):Q}function St(_r){var Fn=_r-se,Gs=_r-le,$w=c-Fn;return ge?ri($w,j-Gs):$w}function ft(_r){var Fn=_r-se,Gs=_r-le;return se===r||Fn>=c||Fn<0||ge&&Gs>=j}function Pt(){var _r=n0();if(ft(_r))return Ut(_r);Z=mf(Pt,St(_r))}function Ut(_r){return Z=r,De&&x?Ye(_r):(x=$=r,Q)}function Hi(){Z!==r&&A5(Z),le=0,x=se=$=Z=r}function pi(){return Z===r?Q:Ut(n0())}function Ki(){var _r=n0(),Fn=ft(_r);if(x=arguments,$=this,se=_r,Fn){if(Z===r)return ut(se);if(ge)return A5(Z),Z=mf(Pt,c),Ye(se)}return Z===r&&(Z=mf(Pt,c)),Q}return Ki.cancel=Hi,Ki.flush=pi,Ki}var Zj=Mt(function(o,c){return r5(o,1,c)}),Xj=Mt(function(o,c,p){return r5(o,dn(c)||0,p)});function eq(o){return zs(o,X)}function s0(o,c){if(typeof o!="function"||c!=null&&typeof c!="function")throw new cn(a);var p=function(){var x=arguments,$=c?c.apply(this,x):x[0],j=p.cache;if(j.has($))return j.get($);var Q=o.apply(this,x);return p.cache=j.set($,Q)||j,Q};return p.cache=new(s0.Cache||js),p}s0.Cache=js;function o0(o){if(typeof o!="function")throw new cn(a);return function(){var c=arguments;switch(c.length){case 0:return!o.call(this);case 1:return!o.call(this,c[0]);case 2:return!o.call(this,c[0],c[1]);case 3:return!o.call(this,c[0],c[1],c[2])}return!o.apply(this,c)}}function tq(o){return uw(2,o)}var rq=qU(function(o,c){c=c.length==1&&yt(c[0])?cr(c[0],ji(ot())):cr(Kr(c,1),ji(ot()));var p=c.length;return Mt(function(x){for(var $=-1,j=ri(x.length,p);++$<j;)x[$]=c[$].call(this,x[$]);return Tr(o,this,x)})}),bg=Mt(function(o,c){var p=_o(c,qc(bg));return zs(o,k,r,c,p)}),pw=Mt(function(o,c){var p=_o(c,qc(pw));return zs(o,z,r,c,p)}),iq=Hs(function(o,c){return zs(o,B,r,r,r,c)});function nq(o,c){if(typeof o!="function")throw new cn(a);return c=c===r?c:xt(c),Mt(o,c)}function sq(o,c){if(typeof o!="function")throw new cn(a);return c=c==null?0:Cr(xt(c),0),Mt(function(p){var x=p[c],$=Io(p,0,c);return x&&wo($,x),Tr(o,this,$)})}function oq(o,c,p){var x=!0,$=!0;if(typeof o!="function")throw new cn(a);return fr(p)&&(x="leading"in p?!!p.leading:x,$="trailing"in p?!!p.trailing:$),dw(o,c,{leading:x,maxWait:c,trailing:$})}function aq(o){return cw(o,1)}function cq(o,c){return bg(rg(c),o)}function uq(){if(!arguments.length)return[];var o=arguments[0];return yt(o)?o:[o]}function fq(o){return fn(o,S)}function hq(o,c){return c=typeof c=="function"?c:r,fn(o,S,c)}function lq(o){return fn(o,w|S)}function dq(o,c){return c=typeof c=="function"?c:r,fn(o,w|S,c)}function pq(o,c){return c==null||t5(o,c,Lr(c))}function Bn(o,c){return o===c||o!==o&&c!==c}var gq=Zl(Hp),vq=Zl(function(o,c){return o>=c}),Aa=a5(function(){return arguments}())?a5:function(o){return gr(o)&&Yt.call(o,"callee")&&!Vy.call(o,"callee")},yt=ce.isArray,mq=hi?ji(hi):SU;function Oi(o){return o!=null&&a0(o.length)&&!Ws(o)}function wr(o){return gr(o)&&Oi(o)}function bq(o){return o===!0||o===!1||gr(o)&&li(o)==G}var Mo=$F||Dg,yq=Nn?ji(Nn):IU;function wq(o){return gr(o)&&o.nodeType===1&&!bf(o)}function _q(o){if(o==null)return!0;if(Oi(o)&&(yt(o)||typeof o=="string"||typeof o.splice=="function"||Mo(o)||zc(o)||Aa(o)))return!o.length;var c=ii(o);if(c==he||c==Me)return!o.size;if(vf(o))return!Vp(o).length;for(var p in o)if(Yt.call(o,p))return!1;return!0}function Eq(o,c){return df(o,c)}function Aq(o,c,p){p=typeof p=="function"?p:r;var x=p?p(o,c):r;return x===r?df(o,c,r,p):!!x}function yg(o){if(!gr(o))return!1;var c=li(o);return c==V||c==A||typeof o.message=="string"&&typeof o.name=="string"&&!bf(o)}function xq(o){return typeof o=="number"&&Yy(o)}function Ws(o){if(!fr(o))return!1;var c=li(o);return c==oe||c==ue||c==q||c==Oe}function gw(o){return typeof o=="number"&&o==xt(o)}function a0(o){return typeof o=="number"&&o>-1&&o%1==0&&o<=P}function fr(o){var c=typeof o;return o!=null&&(c=="object"||c=="function")}function gr(o){return o!=null&&typeof o=="object"}var vw=on?ji(on):CU;function Sq(o,c){return o===c||Wp(o,c,ug(c))}function Iq(o,c,p){return p=typeof p=="function"?p:r,Wp(o,c,ug(c),p)}function Mq(o){return mw(o)&&o!=+o}function Cq(o){if(hk(o))throw new vt(s);return c5(o)}function Dq(o){return o===null}function Oq(o){return o==null}function mw(o){return typeof o=="number"||gr(o)&&li(o)==ye}function bf(o){if(!gr(o)||li(o)!=Re)return!1;var c=Nl(o);if(c===null)return!0;var p=Yt.call(c,"constructor")&&c.constructor;return typeof p=="function"&&p instanceof p&&Ol.call(p)==IF}var wg=ys?ji(ys):DU;function Pq(o){return gw(o)&&o>=-P&&o<=P}var bw=rf?ji(rf):OU;function c0(o){return typeof o=="string"||!yt(o)&&gr(o)&&li(o)==be}function zi(o){return typeof o=="symbol"||gr(o)&&li(o)==Pe}var zc=ga?ji(ga):PU;function $q(o){return o===r}function Rq(o){return gr(o)&&ii(o)==ve}function Nq(o){return gr(o)&&li(o)==$e}var Tq=Zl(Gp),Lq=Zl(function(o,c){return o<=c});function yw(o){if(!o)return[];if(Oi(o))return c0(o)?Tn(o):Di(o);if(sf&&o[sf])return pF(o[sf]());var c=ii(o),p=c==he?Tp:c==Me?Ml:Hc;return p(o)}function Vs(o){if(!o)return o===0?o:0;if(o=dn(o),o===C||o===-C){var c=o<0?-1:1;return c*M}return o===o?o:0}function xt(o){var c=Vs(o),p=c%1;return c===c?p?c-p:c:0}function ww(o){return o?ya(xt(o),0,m):0}function dn(o){if(typeof o=="number")return o;if(zi(o))return g;if(fr(o)){var c=typeof o.valueOf=="function"?o.valueOf():o;o=fr(c)?c+"":c}if(typeof o!="string")return o===0?o:+o;o=Uy(o);var p=Zr.test(o);return p||ei.test(o)?bt(o.slice(2),p?2:8):Qr.test(o)?g:+o}function _w(o){return _s(o,Pi(o))}function Bq(o){return o?ya(xt(o),-P,P):o===0?o:0}function Vt(o){return o==null?"":qi(o)}var Fq=kc(function(o,c){if(vf(c)||Oi(c)){_s(c,Lr(c),o);return}for(var p in c)Yt.call(c,p)&&ff(o,p,c[p])}),Ew=kc(function(o,c){_s(c,Pi(c),o)}),u0=kc(function(o,c,p,x){_s(c,Pi(c),o,x)}),Uq=kc(function(o,c,p,x){_s(c,Lr(c),o,x)}),kq=Hs(jp);function jq(o,c){var p=Uc(o);return c==null?p:e5(p,c)}var qq=Mt(function(o,c){o=tr(o);var p=-1,x=c.length,$=x>2?c[2]:r;for($&&di(c[0],c[1],$)&&(x=1);++p<x;)for(var j=c[p],Q=Pi(j),Z=-1,se=Q.length;++Z<se;){var le=Q[Z],de=o[le];(de===r||Bn(de,Lc[le])&&!Yt.call(o,le))&&(o[le]=j[le])}return o}),zq=Mt(function(o){return o.push(r,U5),Tr(Aw,r,o)});function Hq(o,c){return Ty(o,ot(c,3),ws)}function Kq(o,c){return Ty(o,ot(c,3),zp)}function Wq(o,c){return o==null?o:qp(o,ot(c,3),Pi)}function Vq(o,c){return o==null?o:s5(o,ot(c,3),Pi)}function Gq(o,c){return o&&ws(o,ot(c,3))}function Yq(o,c){return o&&zp(o,ot(c,3))}function Jq(o){return o==null?[]:Hl(o,Lr(o))}function Qq(o){return o==null?[]:Hl(o,Pi(o))}function _g(o,c,p){var x=o==null?r:wa(o,c);return x===r?p:x}function Zq(o,c){return o!=null&&q5(o,c,_U)}function Eg(o,c){return o!=null&&q5(o,c,EU)}var Xq=N5(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Pl.call(c)),o[c]=p},xg($i)),ez=N5(function(o,c,p){c!=null&&typeof c.toString!="function"&&(c=Pl.call(c)),Yt.call(o,c)?o[c].push(p):o[c]=[p]},ot),tz=Mt(lf);function Lr(o){return Oi(o)?Zy(o):Vp(o)}function Pi(o){return Oi(o)?Zy(o,!0):$U(o)}function rz(o,c){var p={};return c=ot(c,3),ws(o,function(x,$,j){qs(p,c(x,$,j),x)}),p}function iz(o,c){var p={};return c=ot(c,3),ws(o,function(x,$,j){qs(p,$,c(x,$,j))}),p}var nz=kc(function(o,c,p){Kl(o,c,p)}),Aw=kc(function(o,c,p,x){Kl(o,c,p,x)}),sz=Hs(function(o,c){var p={};if(o==null)return p;var x=!1;c=cr(c,function(j){return j=So(j,o),x||(x=j.length>1),j}),_s(o,ag(o),p),x&&(p=fn(p,w|I|S,XU));for(var $=c.length;$--;)Xp(p,c[$]);return p});function oz(o,c){return xw(o,o0(ot(c)))}var az=Hs(function(o,c){return o==null?{}:NU(o,c)});function xw(o,c){if(o==null)return{};var p=cr(ag(o),function(x){return[x]});return c=ot(c),g5(o,p,function(x,$){return c(x,$[0])})}function cz(o,c,p){c=So(c,o);var x=-1,$=c.length;for($||($=1,o=r);++x<$;){var j=o==null?r:o[Es(c[x])];j===r&&(x=$,j=p),o=Ws(j)?j.call(o):j}return o}function uz(o,c,p){return o==null?o:pf(o,c,p)}function fz(o,c,p,x){return x=typeof x=="function"?x:r,o==null?o:pf(o,c,p,x)}var Sw=B5(Lr),Iw=B5(Pi);function hz(o,c,p){var x=yt(o),$=x||Mo(o)||zc(o);if(c=ot(c,4),p==null){var j=o&&o.constructor;$?p=x?new j:[]:fr(o)?p=Ws(j)?Uc(Nl(o)):{}:p={}}return($?an:ws)(o,function(Q,Z,se){return c(p,Q,Z,se)}),p}function lz(o,c){return o==null?!0:Xp(o,c)}function dz(o,c,p){return o==null?o:w5(o,c,rg(p))}function pz(o,c,p,x){return x=typeof x=="function"?x:r,o==null?o:w5(o,c,rg(p),x)}function Hc(o){return o==null?[]:Np(o,Lr(o))}function gz(o){return o==null?[]:Np(o,Pi(o))}function vz(o,c,p){return p===r&&(p=c,c=r),p!==r&&(p=dn(p),p=p===p?p:0),c!==r&&(c=dn(c),c=c===c?c:0),ya(dn(o),c,p)}function mz(o,c,p){return c=Vs(c),p===r?(p=c,c=0):p=Vs(p),o=dn(o),AU(o,c,p)}function bz(o,c,p){if(p&&typeof p!="boolean"&&di(o,c,p)&&(c=p=r),p===r&&(typeof c=="boolean"?(p=c,c=r):typeof o=="boolean"&&(p=o,o=r)),o===r&&c===r?(o=0,c=1):(o=Vs(o),c===r?(c=o,o=0):c=Vs(c)),o>c){var x=o;o=c,c=x}if(p||o%1||c%1){var $=Jy();return ri(o+$*(c-o+Xt("1e-"+(($+"").length-1))),c)}return Jp(o,c)}var yz=jc(function(o,c,p){return c=c.toLowerCase(),o+(p?Mw(c):c)});function Mw(o){return Ag(Vt(o).toLowerCase())}function Cw(o){return o=Vt(o),o&&o.replace(pr,uF).replace(Sp,"")}function wz(o,c,p){o=Vt(o),c=qi(c);var x=o.length;p=p===r?x:ya(xt(p),0,x);var $=p;return p-=c.length,p>=0&&o.slice(p,$)==c}function _z(o){return o=Vt(o),o&&et.test(o)?o.replace(Tt,fF):o}function Ez(o){return o=Vt(o),o&&qe.test(o)?o.replace(nt,"\\$&"):o}var Az=jc(function(o,c,p){return o+(p?"-":"")+c.toLowerCase()}),xz=jc(function(o,c,p){return o+(p?" ":"")+c.toLowerCase()}),Sz=P5("toLowerCase");function Iz(o,c,p){o=Vt(o),c=xt(c);var x=c?Nc(o):0;if(!c||x>=c)return o;var $=(c-x)/2;return Ql(Fl($),p)+o+Ql(Bl($),p)}function Mz(o,c,p){o=Vt(o),c=xt(c);var x=c?Nc(o):0;return c&&x<c?o+Ql(c-x,p):o}function Cz(o,c,p){o=Vt(o),c=xt(c);var x=c?Nc(o):0;return c&&x<c?Ql(c-x,p)+o:o}function Dz(o,c,p){return p||c==null?c=0:c&&(c=+c),LF(Vt(o).replace(st,""),c||0)}function Oz(o,c,p){return(p?di(o,c,p):c===r)?c=1:c=xt(c),Qp(Vt(o),c)}function Pz(){var o=arguments,c=Vt(o[0]);return o.length<3?c:c.replace(o[1],o[2])}var $z=jc(function(o,c,p){return o+(p?"_":"")+c.toLowerCase()});function Rz(o,c,p){return p&&typeof p!="number"&&di(o,c,p)&&(c=p=r),p=p===r?m:p>>>0,p?(o=Vt(o),o&&(typeof c=="string"||c!=null&&!wg(c))&&(c=qi(c),!c&&Rc(o))?Io(Tn(o),0,p):o.split(c,p)):[]}var Nz=jc(function(o,c,p){return o+(p?" ":"")+Ag(c)});function Tz(o,c,p){return o=Vt(o),p=p==null?0:ya(xt(p),0,o.length),c=qi(c),o.slice(p,p+c.length)==c}function Lz(o,c,p){var x=F.templateSettings;p&&di(o,c,p)&&(c=r),o=Vt(o),c=u0({},c,x,F5);var $=u0({},c.imports,x.imports,F5),j=Lr($),Q=Np($,j),Z,se,le=0,de=c.interpolate||Si,ge="__p += '",De=Lp((c.escape||Si).source+"|"+de.source+"|"+(de===rt?ct:Si).source+"|"+(c.evaluate||Si).source+"|$","g"),Ye="//# sourceURL="+(Yt.call(c,"sourceURL")?(c.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ip+"]")+`
53
+ `;o.replace(De,function(ft,Pt,Ut,Hi,pi,Ki){return Ut||(Ut=Hi),ge+=o.slice(le,Ki).replace(Cn,hF),Pt&&(Z=!0,ge+=`' +
54
54
  __e(`+Pt+`) +
55
55
  '`),pi&&(se=!0,ge+=`';
56
56
  `+pi+`;
@@ -66,25 +66,25 @@ __p += '`),Ut&&(ge+=`' +
66
66
  function print() { __p += __j.call(arguments, '') }
67
67
  `:`;
68
68
  `)+ge+`return __p
69
- }`;var St=$w(function(){return Ht(j,Ye+"return "+ge).apply(r,Q)});if(St.source=ge,yg(St))throw St;return St}function Wz(o){return Vt(o).toLowerCase()}function Vz(o){return Vt(o).toUpperCase()}function Gz(o,c,p){if(o=Vt(o),o&&(p||c===r))return jy(o);if(!o||!(c=qi(c)))return o;var x=Tn(o),$=Tn(c),j=qy(x,$),Q=zy(x,$)+1;return Io(x,j,Q).join("")}function Yz(o,c,p){if(o=Vt(o),o&&(p||c===r))return o.slice(0,Ky(o)+1);if(!o||!(c=qi(c)))return o;var x=Tn(o),$=zy(x,Tn(c))+1;return Io(x,0,$).join("")}function Jz(o,c,p){if(o=Vt(o),o&&(p||c===r))return o.replace(st,"");if(!o||!(c=qi(c)))return o;var x=Tn(o),$=qy(x,Tn(c));return Io(x,$).join("")}function Qz(o,c){var p=re,x=T;if(fr(c)){var $="separator"in c?c.separator:$;p="length"in c?xt(c.length):p,x="omission"in c?qi(c.omission):x}o=Vt(o);var j=o.length;if(Rc(o)){var Q=Tn(o);j=Q.length}if(p>=j)return o;var Z=p-Nc(x);if(Z<1)return x;var se=Q?Io(Q,0,Z).join(""):o.slice(0,Z);if($===r)return se+x;if(Q&&(Z+=se.length-Z),wg($)){if(o.slice(Z).search($)){var le,de=se;for($.global||($=Lp($.source,Vt(_t.exec($))+"g")),$.lastIndex=0;le=$.exec(de);)var ge=le.index;se=se.slice(0,ge===r?Z:ge)}}else if(o.indexOf(qi($),Z)!=Z){var De=se.lastIndexOf($);De>-1&&(se=se.slice(0,De))}return se+x}function Zz(o){return o=Vt(o),o&&Le.test(o)?o.replace(Ot,MF):o}var Xz=jc(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),Ag=R5("toUpperCase");function Pw(o,c,p){return o=Vt(o),c=p?r:c,c===r?EF(o)?OF(o):dF(o):o.match(c)||[]}var $w=Mt(function(o,c){try{return Tr(o,r,c)}catch(p){return yg(p)?p:new vt(p)}}),eH=Hs(function(o,c){return an(c,function(p){p=Es(p),qs(o,p,mg(o[p],o))}),o});function tH(o){var c=o==null?0:o.length,p=ot();return o=c?cr(o,function(x){if(typeof x[1]!="function")throw new cn(a);return[p(x[0]),x[1]]}):[],Mt(function(x){for(var $=-1;++$<c;){var j=o[$];if(Tr(j[0],this,x))return Tr(j[1],this,x)}})}function rH(o){return MU(fn(o,w))}function xg(o){return function(){return o}}function iH(o,c){return o==null||o!==o?c:o}var nH=T5(),sH=T5(!0);function $i(o){return o}function Sg(o){return h5(typeof o=="function"?o:fn(o,w))}function oH(o){return d5(fn(o,w))}function aH(o,c){return p5(o,fn(c,w))}var cH=Mt(function(o,c){return function(p){return lf(p,o,c)}}),uH=Mt(function(o,c){return function(p){return lf(o,p,c)}});function Ig(o,c,p){var x=Lr(c),$=zl(c,x);p==null&&!(fr(c)&&($.length||!x.length))&&(p=c,c=o,o=this,$=zl(c,Lr(c)));var j=!(fr(p)&&"chain"in p)||!!p.chain,Q=Ws(o);return an($,function(Z){var se=c[Z];o[Z]=se,Q&&(o.prototype[Z]=function(){var le=this.__chain__;if(j||le){var de=o(this.__wrapped__),ge=de.__actions__=Di(this.__actions__);return ge.push({func:se,args:arguments,thisArg:o}),de.__chain__=le,de}return se.apply(o,wo([this.value()],arguments))})}),o}function fH(){return Ft._===this&&(Ft._=LF),this}function Mg(){}function hH(o){return o=xt(o),Mt(function(c){return g5(c,o)})}var lH=ng(cr),dH=ng(Ly),pH=ng(Dp);function Rw(o){return hg(o)?Op(Es(o)):HU(o)}function gH(o){return function(c){return o==null?r:wa(o,c)}}var vH=B5(),mH=B5(!0);function Cg(){return[]}function Dg(){return!1}function bH(){return{}}function yH(){return""}function wH(){return!0}function _H(o,c){if(o=xt(o),o<1||o>P)return[];var p=m,x=ri(o,m);c=ot(c),o-=m;for(var $=Rp(x,c);++p<o;)c(p);return $}function EH(o){return yt(o)?cr(o,Es):zi(o)?[o]:Di(X5(Vt(o)))}function AH(o){var c=++NF;return Vt(o)+c}var xH=Yl(function(o,c){return o+c},0),SH=sg("ceil"),IH=Yl(function(o,c){return o/c},1),MH=sg("floor");function CH(o){return o&&o.length?ql(o,$i,Hp):r}function DH(o,c){return o&&o.length?ql(o,ot(c,2),Hp):r}function OH(o){return Uy(o,$i)}function PH(o,c){return Uy(o,ot(c,2))}function $H(o){return o&&o.length?ql(o,$i,Gp):r}function RH(o,c){return o&&o.length?ql(o,ot(c,2),Gp):r}var NH=Yl(function(o,c){return o*c},1),TH=sg("round"),LH=Yl(function(o,c){return o-c},0);function BH(o){return o&&o.length?$p(o,$i):0}function FH(o,c){return o&&o.length?$p(o,ot(c,2)):0}return F.after=oq,F.ary=fw,F.assign=Vq,F.assignIn=xw,F.assignInWith=c0,F.assignWith=Gq,F.at=Yq,F.before=hw,F.bind=mg,F.bindAll=eH,F.bindKey=lw,F.castArray=bq,F.chain=aw,F.chunk=Mk,F.compact=Ck,F.concat=Dk,F.cond=tH,F.conforms=rH,F.constant=xg,F.countBy=Bj,F.create=Jq,F.curry=dw,F.curryRight=pw,F.debounce=gw,F.defaults=Qq,F.defaultsDeep=Zq,F.defer=aq,F.delay=cq,F.difference=Ok,F.differenceBy=Pk,F.differenceWith=$k,F.drop=Rk,F.dropRight=Nk,F.dropRightWhile=Tk,F.dropWhile=Lk,F.fill=Bk,F.filter=Uj,F.flatMap=qj,F.flatMapDeep=zj,F.flatMapDepth=Hj,F.flatten=iw,F.flattenDeep=Fk,F.flattenDepth=Uk,F.flip=uq,F.flow=nH,F.flowRight=sH,F.fromPairs=kk,F.functions=sz,F.functionsIn=oz,F.groupBy=Kj,F.initial=qk,F.intersection=zk,F.intersectionBy=Hk,F.intersectionWith=Kk,F.invert=cz,F.invertBy=uz,F.invokeMap=Vj,F.iteratee=Sg,F.keyBy=Gj,F.keys=Lr,F.keysIn=Pi,F.map=r0,F.mapKeys=hz,F.mapValues=lz,F.matches=oH,F.matchesProperty=aH,F.memoize=n0,F.merge=dz,F.mergeWith=Sw,F.method=cH,F.methodOf=uH,F.mixin=Ig,F.negate=s0,F.nthArg=hH,F.omit=pz,F.omitBy=gz,F.once=fq,F.orderBy=Yj,F.over=lH,F.overArgs=hq,F.overEvery=dH,F.overSome=pH,F.partial=bg,F.partialRight=vw,F.partition=Jj,F.pick=vz,F.pickBy=Iw,F.property=Rw,F.propertyOf=gH,F.pull=Yk,F.pullAll=sw,F.pullAllBy=Jk,F.pullAllWith=Qk,F.pullAt=Zk,F.range=vH,F.rangeRight=mH,F.rearg=lq,F.reject=Xj,F.remove=Xk,F.rest=dq,F.reverse=gg,F.sampleSize=tq,F.set=bz,F.setWith=yz,F.shuffle=rq,F.slice=ej,F.sortBy=sq,F.sortedUniq=aj,F.sortedUniqBy=cj,F.split=qz,F.spread=pq,F.tail=uj,F.take=fj,F.takeRight=hj,F.takeRightWhile=lj,F.takeWhile=dj,F.tap=Cj,F.throttle=gq,F.thru=t0,F.toArray=_w,F.toPairs=Mw,F.toPairsIn=Cw,F.toPath=EH,F.toPlainObject=Aw,F.transform=wz,F.unary=vq,F.union=pj,F.unionBy=gj,F.unionWith=vj,F.uniq=mj,F.uniqBy=bj,F.uniqWith=yj,F.unset=_z,F.unzip=vg,F.unzipWith=ow,F.update=Ez,F.updateWith=Az,F.values=Hc,F.valuesIn=xz,F.without=wj,F.words=Pw,F.wrap=mq,F.xor=_j,F.xorBy=Ej,F.xorWith=Aj,F.zip=xj,F.zipObject=Sj,F.zipObjectDeep=Ij,F.zipWith=Mj,F.entries=Mw,F.entriesIn=Cw,F.extend=xw,F.extendWith=c0,Ig(F,F),F.add=xH,F.attempt=$w,F.camelCase=Cz,F.capitalize=Dw,F.ceil=SH,F.clamp=Sz,F.clone=yq,F.cloneDeep=_q,F.cloneDeepWith=Eq,F.cloneWith=wq,F.conformsTo=Aq,F.deburr=Ow,F.defaultTo=iH,F.divide=IH,F.endsWith=Dz,F.eq=Bn,F.escape=Oz,F.escapeRegExp=Pz,F.every=Fj,F.find=kj,F.findIndex=tw,F.findKey=Xq,F.findLast=jj,F.findLastIndex=rw,F.findLastKey=ez,F.floor=MH,F.forEach=cw,F.forEachRight=uw,F.forIn=tz,F.forInRight=rz,F.forOwn=iz,F.forOwnRight=nz,F.get=_g,F.gt=xq,F.gte=Sq,F.has=az,F.hasIn=Eg,F.head=nw,F.identity=$i,F.includes=Wj,F.indexOf=jk,F.inRange=Iz,F.invoke=fz,F.isArguments=Aa,F.isArray=yt,F.isArrayBuffer=Iq,F.isArrayLike=Oi,F.isArrayLikeObject=wr,F.isBoolean=Mq,F.isBuffer=Mo,F.isDate=Cq,F.isElement=Dq,F.isEmpty=Oq,F.isEqual=Pq,F.isEqualWith=$q,F.isError=yg,F.isFinite=Rq,F.isFunction=Ws,F.isInteger=mw,F.isLength=o0,F.isMap=bw,F.isMatch=Nq,F.isMatchWith=Tq,F.isNaN=Lq,F.isNative=Bq,F.isNil=Uq,F.isNull=Fq,F.isNumber=yw,F.isObject=fr,F.isObjectLike=gr,F.isPlainObject=bf,F.isRegExp=wg,F.isSafeInteger=kq,F.isSet=ww,F.isString=a0,F.isSymbol=zi,F.isTypedArray=zc,F.isUndefined=jq,F.isWeakMap=qq,F.isWeakSet=zq,F.join=Wk,F.kebabCase=$z,F.last=ln,F.lastIndexOf=Vk,F.lowerCase=Rz,F.lowerFirst=Nz,F.lt=Hq,F.lte=Kq,F.max=CH,F.maxBy=DH,F.mean=OH,F.meanBy=PH,F.min=$H,F.minBy=RH,F.stubArray=Cg,F.stubFalse=Dg,F.stubObject=bH,F.stubString=yH,F.stubTrue=wH,F.multiply=NH,F.nth=Gk,F.noConflict=fH,F.noop=Mg,F.now=i0,F.pad=Tz,F.padEnd=Lz,F.padStart=Bz,F.parseInt=Fz,F.random=Mz,F.reduce=Qj,F.reduceRight=Zj,F.repeat=Uz,F.replace=kz,F.result=mz,F.round=TH,F.runInContext=ne,F.sample=eq,F.size=iq,F.snakeCase=jz,F.some=nq,F.sortedIndex=tj,F.sortedIndexBy=rj,F.sortedIndexOf=ij,F.sortedLastIndex=nj,F.sortedLastIndexBy=sj,F.sortedLastIndexOf=oj,F.startCase=zz,F.startsWith=Hz,F.subtract=LH,F.sum=BH,F.sumBy=FH,F.template=Kz,F.times=_H,F.toFinite=Vs,F.toInteger=xt,F.toLength=Ew,F.toLower=Wz,F.toNumber=dn,F.toSafeInteger=Wq,F.toString=Vt,F.toUpper=Vz,F.trim=Gz,F.trimEnd=Yz,F.trimStart=Jz,F.truncate=Qz,F.unescape=Zz,F.uniqueId=AH,F.upperCase=Xz,F.upperFirst=Ag,F.each=cw,F.eachRight=uw,F.first=nw,Ig(F,function(){var o={};return ws(F,function(c,p){Yt.call(F.prototype,p)||(o[p]=c)}),o}(),{chain:!1}),F.VERSION=i,an(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){F[o].placeholder=F}),an(["drop","take"],function(o,c){Lt.prototype[o]=function(p){p=p===r?1:Cr(xt(p),0);var x=this.__filtered__&&!c?new Lt(this):this.clone();return x.__filtered__?x.__takeCount__=ri(p,x.__takeCount__):x.__views__.push({size:ri(p,m),type:o+(x.__dir__<0?"Right":"")}),x},Lt.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),an(["filter","map","takeWhile"],function(o,c){var p=c+1,x=p==h||p==E;Lt.prototype[o]=function($){var j=this.clone();return j.__iteratees__.push({iteratee:ot($,3),type:p}),j.__filtered__=j.__filtered__||x,j}}),an(["head","last"],function(o,c){var p="take"+(c?"Right":"");Lt.prototype[o]=function(){return this[p](1).value()[0]}}),an(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");Lt.prototype[o]=function(){return this.__filtered__?new Lt(this):this[p](1)}}),Lt.prototype.compact=function(){return this.filter($i)},Lt.prototype.find=function(o){return this.filter(o).head()},Lt.prototype.findLast=function(o){return this.reverse().find(o)},Lt.prototype.invokeMap=Mt(function(o,c){return typeof o=="function"?new Lt(this):this.map(function(p){return lf(p,o,c)})}),Lt.prototype.reject=function(o){return this.filter(s0(ot(o)))},Lt.prototype.slice=function(o,c){o=xt(o);var p=this;return p.__filtered__&&(o>0||c<0)?new Lt(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==r&&(c=xt(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},Lt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Lt.prototype.toArray=function(){return this.take(m)},ws(Lt.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),x=/^(?:head|last)$/.test(c),$=F[x?"take"+(c=="last"?"Right":""):c],j=x||/^find/.test(c);$&&(F.prototype[c]=function(){var Q=this.__wrapped__,Z=x?[1]:arguments,se=Q instanceof Lt,le=Z[0],de=se||yt(Q),ge=function(Pt){var Ut=$.apply(F,wo([Pt],Z));return x&&De?Ut[0]:Ut};de&&p&&typeof le=="function"&&le.length!=1&&(se=de=!1);var De=this.__chain__,Ye=!!this.__actions__.length,ut=j&&!De,St=se&&!Ye;if(!j&&de){Q=St?Q:new Lt(this);var ft=o.apply(Q,Z);return ft.__actions__.push({func:t0,args:[ge],thisArg:r}),new un(ft,De)}return ut&&St?o.apply(this,Z):(ft=this.thru(ge),ut?x?ft.value()[0]:ft.value():ft)})}),an(["pop","push","shift","sort","splice","unshift"],function(o){var c=Ml[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",x=/^(?:pop|shift)$/.test(o);F.prototype[o]=function(){var $=arguments;if(x&&!this.__chain__){var j=this.value();return c.apply(yt(j)?j:[],$)}return this[p](function(Q){return c.apply(yt(Q)?Q:[],$)})}}),ws(Lt.prototype,function(o,c){var p=F[c];if(p){var x=p.name+"";Yt.call(Fc,x)||(Fc[x]=[]),Fc[x].push({name:c,func:p})}}),Fc[Gl(r,H).name]=[{name:"wrapper",func:r}],Lt.prototype.clone=ZF,Lt.prototype.reverse=XF,Lt.prototype.value=eU,F.prototype.at=Dj,F.prototype.chain=Oj,F.prototype.commit=Pj,F.prototype.next=$j,F.prototype.plant=Nj,F.prototype.reverse=Tj,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=Lj,F.prototype.first=F.prototype.head,sf&&(F.prototype[sf]=Rj),F},Tc=PF();yr?((yr.exports=Tc)._=Tc,er._=Tc):Ft._=Tc}).call(Ru)})(s1,s1.exports);var W$=Object.defineProperty,V$=Object.defineProperties,G$=Object.getOwnPropertyDescriptors,Y3=Object.getOwnPropertySymbols,Y$=Object.prototype.hasOwnProperty,J$=Object.prototype.propertyIsEnumerable,J3=(t,e,r)=>e in t?W$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Ch=(t,e)=>{for(var r in e||(e={}))Y$.call(e,r)&&J3(t,r,e[r]);if(Y3)for(var r of Y3(e))J$.call(e,r)&&J3(t,r,e[r]);return t},Q$=(t,e)=>V$(t,G$(e));function Mn(t,e,r){var i;const n=ru(t);return((i=e.rpcMap)==null?void 0:i[n.reference])||`${K$}?chainId=${n.namespace}:${n.reference}&projectId=${r}`}function Jo(t){return t.includes(":")?t.split(":")[1]:t}function Q3(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function Z$(t,e){const r=Object.keys(e.namespaces).filter(n=>n.includes(t));if(!r.length)return[];const i=[];return r.forEach(n=>{const s=e.namespaces[n].accounts;i.push(...s)}),i}function o1(t={},e={}){const r=Z3(t),i=Z3(e);return s1.exports.merge(r,i)}function Z3(t){var e,r,i,n;const s={};if(!yu(t))return s;for(const[a,u]of Object.entries(t)){const l=Od(a)?[a]:u.chains,d=u.methods||[],b=u.events||[],w=u.rpcMap||{},S=bu(a);s[S]=Q$(Ch(Ch({},s[S]),u),{chains:Gf(l,(e=s[S])==null?void 0:e.chains),methods:Gf(d,(r=s[S])==null?void 0:r.methods),events:Gf(b,(i=s[S])==null?void 0:i.events),rpcMap:Ch(Ch({},w),(n=s[S])==null?void 0:n.rpcMap)})}return s}function X$(t){return t.includes(":")?t.split(":")[2]:t}function X3(t){const e={};for(const[r,i]of Object.entries(t)){const n=i.methods||[],s=i.events||[],a=i.accounts||[],u=Od(r)?[r]:i.chains?i.chains:Q3(i.accounts);e[r]={chains:u,methods:n,events:s,accounts:a}}return e}function a1(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const e6={},Kt=t=>e6[t],c1=(t,e)=>{e6[t]=e};class eR{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}var tR=Object.defineProperty,rR=Object.defineProperties,iR=Object.getOwnPropertyDescriptors,t6=Object.getOwnPropertySymbols,nR=Object.prototype.hasOwnProperty,sR=Object.prototype.propertyIsEnumerable,r6=(t,e,r)=>e in t?tR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,i6=(t,e)=>{for(var r in e||(e={}))nR.call(e,r)&&r6(t,r,e[r]);if(t6)for(var r of t6(e))sR.call(e,r)&&r6(t,r,e[r]);return t},n6=(t,e)=>rR(t,iR(e));class oR{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const i=r||Mn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=parseInt(Jo(r));e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,i;let n=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";n=n.startsWith("0x")?n:`0x${n}`;const s=parseInt(n,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,i,n;const s=(i=(r=e.request)==null?void 0:r.params)==null?void 0:i[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const a=this.client.session.get(e.topic),u=((n=a?.sessionProperties)==null?void 0:n.capabilities)||{};if(u!=null&&u[s])return u?.[s];const l=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:n6(i6({},a.sessionProperties||{}),{capabilities:n6(i6({},u||{}),{[s]:l})})})}catch(d){console.warn("Failed to update session with capabilities",d)}return l}}class aR{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class cR{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class uR{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const i=r||Mn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;e[r]=this.createHttpProvider(r,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new An(new ds(i,Kt("disableProviderPing")))}}class fR{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const i=this.getCardanoRPCUrl(r),n=Jo(r);e[n]=this.createHttpProvider(n,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class hR{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class lR{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class dR{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const i=r||Mn(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;e[r]=this.createHttpProvider(r,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace);return typeof i>"u"?void 0:new An(new ds(i,Kt("disableProviderPing")))}}class pR{constructor(e){this.name=uc,this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const i={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(n=>{const s=ru(n);i[`${s.namespace}:${s.reference}`]=this.createHttpProvider(n)}),i}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}var gR=Object.defineProperty,vR=Object.defineProperties,mR=Object.getOwnPropertyDescriptors,s6=Object.getOwnPropertySymbols,bR=Object.prototype.hasOwnProperty,yR=Object.prototype.propertyIsEnumerable,o6=(t,e,r)=>e in t?gR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Dh=(t,e)=>{for(var r in e||(e={}))bR.call(e,r)&&o6(t,r,e[r]);if(s6)for(var r of s6(e))yR.call(e,r)&&o6(t,r,e[r]);return t},u1=(t,e)=>vR(t,mR(e));class f1{constructor(e){this.events=new Br.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:os(_h({level:e?.logger||V3})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new f1(e);return await r.initialize(),r}async request(e,r,i){const[n,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:Dh({},e),chainId:`${n}:${s}`,topic:this.session.topic,expiry:i})}sendAsync(e,r,i,n){const s=new Date().getTime();this.request(e,i,n).then(a=>r(null,Eh(s,a))).catch(a=>r(a,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Gt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:i}=await this.client.authenticate(e);r&&(this.uri=r,this.events.emit("display_uri",r));const n=await i();if(this.session=n.session,this.session){const s=X3(this.session.namespaces);this.namespaces=o1(this.namespaces,s),this.persist("namespaces",this.namespaces),this.onConnect()}return n}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await n().then(s=>{this.session=s;const a=X3(s.namespaces);this.namespaces=o1(this.namespaces,a),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==B3)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[i,n]=this.validateChain(e),s=this.getProvider(i);s.name===uc?s.setDefaultChain(`${i}:${n}`,r):s.setDefaultChain(n,r)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(ss(r)){for(const i of r)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await i1.init({core:this.providerOpts.core,logger:this.providerOpts.logger||V3,relayUrl:this.providerOpts.relayUrl||q$,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>bu(r)))];c1("client",this.client),c1("events",this.events),c1("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const i=Z$(r,this.session),n=Q3(i),s=o1(this.namespaces,this.optionalNamespaces),a=u1(Dh({},s[r]),{accounts:i,chains:n});switch(r){case"eip155":this.rpcProviders[r]=new oR({namespace:a});break;case"algorand":this.rpcProviders[r]=new uR({namespace:a});break;case"solana":this.rpcProviders[r]=new aR({namespace:a});break;case"cosmos":this.rpcProviders[r]=new cR({namespace:a});break;case"polkadot":this.rpcProviders[r]=new eR({namespace:a});break;case"cip34":this.rpcProviders[r]=new fR({namespace:a});break;case"elrond":this.rpcProviders[r]=new hR({namespace:a});break;case"multiversx":this.rpcProviders[r]=new lR({namespace:a});break;case"near":this.rpcProviders[r]=new dR({namespace:a});break;default:this.rpcProviders[uc]?this.rpcProviders[uc].updateNamespace(a):this.rpcProviders[uc]=new pR({namespace:a})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:i}=r;if(i.name==="accountsChanged"){const n=i.data;n&&ss(n)&&this.events.emit("accountsChanged",n.map(X$))}else if(i.name==="chainChanged"){const n=r.chainId,s=r.event.data,a=bu(n),u=a1(n)!==a1(s)?`${a}:${a1(s)}`:n;this.onChainChanged(u)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var i;const{namespaces:n}=r,s=(i=this.client)==null?void 0:i.session.get(e);this.session=u1(Dh({},s),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",u1(Dh({},Gt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(In.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[uc]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:i,sessionProperties:n}=e;r&&Object.keys(r).length&&(this.namespaces=r),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=n,this.persist("namespaces",r),this.persist("optionalNamespaces",i)}validateChain(e){const[r,i]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,i];if(r&&!Object.keys(this.namespaces||{}).map(a=>bu(a)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&i)return[r,i];const n=bu(Object.keys(this.namespaces)[0]),s=this.rpcProviders[n].getDefaultChain();return[n,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[i,n]=this.validateChain(e);n&&(r||this.getProvider(i).setDefaultChain(n),this.namespaces[i]?this.namespaces[i].defaultChain=n:this.namespaces[`${i}:${n}`]?this.namespaces[`${i}:${n}`].defaultChain=n:this.namespaces[`${i}:${n}`]={defaultChain:n},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${G3}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${G3}/${e}`)}}const wR=f1,_R="wc",ER="ethereum_provider",AR=`${_R}@2:${ER}:`,xR="https://rpc.walletconnect.com/v1/",Oh=["eth_sendTransaction","personal_sign"],a6=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],Ph=["chainChanged","accountsChanged"],c6=["chainChanged","accountsChanged","message","disconnect","connect"];var SR=Object.defineProperty,IR=Object.defineProperties,MR=Object.getOwnPropertyDescriptors,u6=Object.getOwnPropertySymbols,CR=Object.prototype.hasOwnProperty,DR=Object.prototype.propertyIsEnumerable,f6=(t,e,r)=>e in t?SR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fc=(t,e)=>{for(var r in e||(e={}))CR.call(e,r)&&f6(t,r,e[r]);if(u6)for(var r of u6(e))DR.call(e,r)&&f6(t,r,e[r]);return t},h1=(t,e)=>IR(t,MR(e));function $h(t){return Number(t[0].split(":")[1])}function Rh(t){return`0x${t.toString(16)}`}function OR(t){const{chains:e,optionalChains:r,methods:i,optionalMethods:n,events:s,optionalEvents:a,rpcMap:u}=t;if(!ss(e))throw new Error("Invalid chains");const l={chains:e,methods:i||Oh,events:s||Ph,rpcMap:fc({},e.length?{[$h(e)]:u[$h(e)]}:{})},d=s?.filter(I=>!Ph.includes(I)),b=i?.filter(I=>!Oh.includes(I));if(!r&&!a&&!n&&!(d!=null&&d.length)&&!(b!=null&&b.length))return{required:e.length?l:void 0};const w=d?.length&&b?.length||!r,S={chains:[...new Set(w?l.chains.concat(r||[]):r)],methods:[...new Set(l.methods.concat(n!=null&&n.length?n:a6))],events:[...new Set(l.events.concat(a!=null&&a.length?a:c6))],rpcMap:u};return{required:e.length?l:void 0,optional:r.length?S:void 0}}class Nh{constructor(){this.events=new Br.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=AR,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Nh;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,i){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:i}=OR(this.rpc);try{const n=await new Promise(async(a,u)=>{var l;this.rpc.showQrModal&&((l=this.modal)==null||l.subscribeModal(d=>{!d.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),u(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(h1(fc({namespaces:fc({},r&&{[this.namespace]:r})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e?.pairingTopic})).then(d=>{a(d)}).catch(d=>{u(new Error(d.message))})});if(!n)return;const s=Rv(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Rh(this.chainId)})}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async authenticate(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e?.chains});try{const r=await new Promise(async(n,s)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),s(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(h1(fc({},e),{chains:this.rpc.chains})).then(u=>{n(u)}).catch(u=>{s(new Error(u.message))})}),i=r.session;if(i){const n=Rv(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:n),this.setAccounts(n),this.events.emit("connect",{chainId:Rh(this.chainId)})}return r}catch(r){throw this.signer.logger.error(r),r}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:i}=r;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Rh(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",h1(fc({},Gt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,i;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Rh(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,i,n]=e.split(":");return{chainId:`${r}:${i}`,address:n}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,i;const n=(r=e?.chains)!=null?r:[],s=(i=e?.optionalChains)!=null?i:[],a=n.concat(s);if(!a.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const u=n.length?e?.methods||Oh:[],l=n.length?e?.events||Ph:[],d=e?.optionalMethods||[],b=e?.optionalEvents||[],w=e?.rpcMap||this.buildRpcMap(a,e.projectId),S=e?.qrModalOptions||void 0;return{chains:n?.map(I=>this.formatChainId(I)),optionalChains:s.map(I=>this.formatChainId(I)),methods:u,events:l,optionalMethods:d,optionalEvents:b,rpcMap:w,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:S,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const i={};return e.forEach(n=>{i[n]=this.getRpcUrl(n,r)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?$h(this.rpc.chains):$h(this.rpc.optionalChains),this.signer=await wR.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:i}=await Promise.resolve().then(function(){return XR});r=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(fc({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:i,rpcMap:n}=e;r&&ss(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=n?.[s]||this.getRpcUrl(s)})),i&&ss(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i?.map(s=>this.formatChainId(s)),i.forEach(s=>{this.rpc.rpcMap[s]=n?.[s]||this.getRpcUrl(s)}))}getRpcUrl(e,r){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${xR}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r?.accounts),this.setAccounts(r?.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const PR=Nh,$R=Symbol(),h6=Object.getPrototypeOf,l1=new WeakMap,RR=t=>t&&(l1.has(t)?l1.get(t):h6(t)===Object.prototype||h6(t)===Array.prototype),NR=t=>RR(t)&&t[$R]||null,l6=(t,e=!0)=>{l1.set(t,e)},d1=t=>typeof t=="object"&&t!==null,so=new WeakMap,Th=new WeakSet,TR=(t=Object.is,e=(d,b)=>new Proxy(d,b),r=d=>d1(d)&&!Th.has(d)&&(Array.isArray(d)||!(Symbol.iterator in d))&&!(d instanceof WeakMap)&&!(d instanceof WeakSet)&&!(d instanceof Error)&&!(d instanceof Number)&&!(d instanceof Date)&&!(d instanceof String)&&!(d instanceof RegExp)&&!(d instanceof ArrayBuffer),i=d=>{switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:throw d}},n=new WeakMap,s=(d,b,w=i)=>{const S=n.get(d);if(S?.[0]===b)return S[1];const I=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d));return l6(I,!0),n.set(d,[b,I]),Reflect.ownKeys(d).forEach(D=>{if(Object.getOwnPropertyDescriptor(I,D))return;const L=Reflect.get(d,D),K={value:L,enumerable:!0,configurable:!0};if(Th.has(L))l6(L,!1);else if(L instanceof Promise)delete K.value,K.get=()=>w(L);else if(so.has(L)){const[H,U]=so.get(L);K.value=s(H,U(),w)}Object.defineProperty(I,D,K)}),Object.preventExtensions(I)},a=new WeakMap,u=[1,1],l=d=>{if(!d1(d))throw new Error("object required");const b=a.get(d);if(b)return b;let w=u[0];const S=new Set,I=(X,re=++u[0])=>{w!==re&&(w=re,S.forEach(T=>T(X,re)))};let D=u[1];const L=(X=++u[1])=>(D!==X&&!S.size&&(D=X,H.forEach(([re])=>{const T=re[1](X);T>w&&(w=T)})),w),K=X=>(re,T)=>{const y=[...re];y[1]=[X,...y[1]],I(y,T)},H=new Map,U=(X,re)=>{if(H.has(X))throw new Error("prop listener already exists");if(S.size){const T=re[3](K(X));H.set(X,[re,T])}else H.set(X,[re])},W=X=>{var re;const T=H.get(X);T&&(H.delete(X),(re=T[1])==null||re.call(T))},R=X=>(S.add(X),S.size===1&&H.forEach(([T,y],f)=>{if(y)throw new Error("remove already exists");const h=T[3](K(f));H.set(f,[T,h])}),()=>{S.delete(X),S.size===0&&H.forEach(([T,y],f)=>{y&&(y(),H.set(f,[T]))})}),k=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d)),_=e(k,{deleteProperty(X,re){const T=Reflect.get(X,re);W(re);const y=Reflect.deleteProperty(X,re);return y&&I(["delete",[re],T]),y},set(X,re,T,y){const f=Reflect.has(X,re),h=Reflect.get(X,re,y);if(f&&(t(h,T)||a.has(T)&&t(h,a.get(T))))return!0;W(re),d1(T)&&(T=NR(T)||T);let v=T;if(T instanceof Promise)T.then(E=>{T.status="fulfilled",T.value=E,I(["resolve",[re],E])}).catch(E=>{T.status="rejected",T.reason=E,I(["reject",[re],E])});else{!so.has(T)&&r(T)&&(v=l(T));const E=!Th.has(v)&&so.get(v);E&&U(re,E)}return Reflect.set(X,re,v,y),I(["set",[re],T,h]),!0}});a.set(d,_);const B=[k,L,s,R];return so.set(_,B),Reflect.ownKeys(d).forEach(X=>{const re=Object.getOwnPropertyDescriptor(d,X);"value"in re&&(_[X]=d[X],delete re.value,delete re.writable),Object.defineProperty(k,X,re)}),_})=>[l,so,Th,t,e,r,i,n,s,a,u],[LR]=TR();function oo(t={}){return LR(t)}function Qo(t,e,r){const i=so.get(t);i||console.warn("Please use proxy object");let n;const s=[],a=i[3];let u=!1;const d=a(b=>{if(s.push(b),r){e(s.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,u&&e(s.splice(0))}))});return u=!0,()=>{u=!1,d()}}function BR(t,e){const r=so.get(t);r||console.warn("Please use proxy object");const[i,n,s]=r;return s(i,n(),e)}const Nr=oo({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ur={state:Nr,subscribe(t){return Qo(Nr,()=>t(Nr))},push(t,e){t!==Nr.view&&(Nr.view=t,e&&(Nr.data=e),Nr.history.push(t))},reset(t){Nr.view=t,Nr.history=[t]},replace(t){Nr.history.length>1&&(Nr.history[Nr.history.length-1]=t,Nr.view=t)},goBack(){if(Nr.history.length>1){Nr.history.pop();const[t]=Nr.history.slice(-1);Nr.view=t}},setData(t){Nr.data=t}},Qe={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Qe.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Qe.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Qe.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let i=t;i.includes("://")||(i=t.replaceAll("/","").replaceAll(":",""),i=`${i}://`),i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,r);const n=encodeURIComponent(e);return`${i}wc?uri=${n}`},formatUniversalUrl(t,e,r){if(!Qe.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let i=t;i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,r);const n=encodeURIComponent(e);return`${i}wc?uri=${n}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem(Qe.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem(Qe.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(Qe.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(Qe.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=ur.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},FR=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Jr=oo({enabled:FR,userSessionId:"",events:[],connectedWalletId:void 0}),d6={state:Jr,subscribe(t){return Qo(Jr.events,()=>t(BR(Jr.events[Jr.events.length-1])))},initialize(){Jr.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Jr.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Jr.connectedWalletId=t},click(t){if(Jr.enabled){const e={type:"CLICK",name:t.name,userSessionId:Jr.userSessionId,timestamp:Date.now(),data:t};Jr.events.push(e)}},track(t){if(Jr.enabled){const e={type:"TRACK",name:t.name,userSessionId:Jr.userSessionId,timestamp:Date.now(),data:t};Jr.events.push(e)}},view(t){if(Jr.enabled){const e={type:"VIEW",name:t.name,userSessionId:Jr.userSessionId,timestamp:Date.now(),data:t};Jr.events.push(e)}}},ps=oo({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),br={state:ps,subscribe(t){return Qo(ps,()=>t(ps))},setChains(t){ps.chains=t},setWalletConnectUri(t){ps.walletConnectUri=t},setIsCustomDesktop(t){ps.isCustomDesktop=t},setIsCustomMobile(t){ps.isCustomMobile=t},setIsDataLoaded(t){ps.isDataLoaded=t},setIsUiLoaded(t){ps.isUiLoaded=t},setIsAuth(t){ps.isAuth=t}},Lh=oo({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Fi={state:Lh,subscribe(t){return Qo(Lh,()=>t(Lh))},setConfig(t){var e,r;d6.initialize(),br.setChains(t.chains),br.setIsAuth(!!t.enableAuthMode),br.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),br.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),Qe.setModalVersionInStorage(),Object.assign(Lh,t)}};var UR=Object.defineProperty,p6=Object.getOwnPropertySymbols,kR=Object.prototype.hasOwnProperty,jR=Object.prototype.propertyIsEnumerable,g6=(t,e,r)=>e in t?UR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,qR=(t,e)=>{for(var r in e||(e={}))kR.call(e,r)&&g6(t,r,e[r]);if(p6)for(var r of p6(e))jR.call(e,r)&&g6(t,r,e[r]);return t};const p1="https://explorer-api.walletconnect.com",g1="wcm",v1="js-2.6.2";async function Bh(t,e){const r=qR({sdkType:g1,sdkVersion:v1},e),i=new URL(t,p1);return i.searchParams.append("projectId",Fi.state.projectId),Object.entries(r).forEach(([n,s])=>{s&&i.searchParams.append(n,String(s))}),(await fetch(i)).json()}const Zo={async getDesktopListings(t){return Bh("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return Bh("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return Bh("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return Bh("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${p1}/w3m/v1/getWalletImage/${t}?projectId=${Fi.state.projectId}&sdkType=${g1}&sdkVersion=${v1}`},getAssetImageUrl(t){return`${p1}/w3m/v1/getAssetImage/${t}?projectId=${Fi.state.projectId}&sdkType=${g1}&sdkVersion=${v1}`}};var zR=Object.defineProperty,v6=Object.getOwnPropertySymbols,HR=Object.prototype.hasOwnProperty,KR=Object.prototype.propertyIsEnumerable,m6=(t,e,r)=>e in t?zR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,WR=(t,e)=>{for(var r in e||(e={}))HR.call(e,r)&&m6(t,r,e[r]);if(v6)for(var r of v6(e))KR.call(e,r)&&m6(t,r,e[r]);return t};const b6=Qe.isMobile(),gs=oo({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ai={state:gs,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=Fi.state;if(t==="NONE"||e==="ALL"&&!t)return gs.recomendedWallets;if(Qe.isArray(t)){const r={recommendedIds:t.join(",")},{listings:i}=await Zo.getAllListings(r),n=Object.values(i);n.sort((s,a)=>{const u=t.indexOf(s.id),l=t.indexOf(a.id);return u-l}),gs.recomendedWallets=n}else{const{chains:r,isAuth:i}=br.state,n=r?.join(","),s=Qe.isArray(e),a={page:1,sdks:i?"auth_v1":void 0,entries:Qe.RECOMMENDED_WALLET_AMOUNT,chains:n,version:2,excludedIds:s?e.join(","):void 0},{listings:u}=b6?await Zo.getMobileListings(a):await Zo.getDesktopListings(a);gs.recomendedWallets=Object.values(u)}return gs.recomendedWallets},async getWallets(t){const e=WR({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:i}=Fi.state,{recomendedWallets:n}=gs;if(i==="ALL")return gs.wallets;n.length?e.excludedIds=n.map(w=>w.id).join(","):Qe.isArray(r)&&(e.excludedIds=r.join(",")),Qe.isArray(i)&&(e.excludedIds=[e.excludedIds,i].filter(Boolean).join(",")),br.state.isAuth&&(e.sdks="auth_v1");const{page:s,search:a}=t,{listings:u,total:l}=b6?await Zo.getMobileListings(e):await Zo.getDesktopListings(e),d=Object.values(u),b=a?"search":"wallets";return gs[b]={listings:[...gs[b].listings,...d],total:l,page:s??1},{listings:d,total:l}},getWalletImageUrl(t){return Zo.getWalletImageUrl(t)},getAssetImageUrl(t){return Zo.getAssetImageUrl(t)},resetSearch(){gs.search={listings:[],total:0,page:1}}},hc=oo({open:!1}),Xo={state:hc,subscribe(t){return Qo(hc,()=>t(hc))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:i}=br.state;if(Qe.removeWalletConnectDeepLink(),br.setWalletConnectUri(t?.uri),br.setChains(t?.chains),ur.reset("ConnectWallet"),r&&i)hc.open=!0,e();else{const n=setInterval(()=>{const s=br.state;s.isUiLoaded&&s.isDataLoaded&&(clearInterval(n),hc.open=!0,e())},200)}})},close(){hc.open=!1}};var VR=Object.defineProperty,y6=Object.getOwnPropertySymbols,GR=Object.prototype.hasOwnProperty,YR=Object.prototype.propertyIsEnumerable,w6=(t,e,r)=>e in t?VR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,JR=(t,e)=>{for(var r in e||(e={}))GR.call(e,r)&&w6(t,r,e[r]);if(y6)for(var r of y6(e))YR.call(e,r)&&w6(t,r,e[r]);return t};function QR(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Nu=oo({themeMode:QR()?"dark":"light"}),ao={state:Nu,subscribe(t){return Qo(Nu,()=>t(Nu))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Nu.themeMode=e),r&&(Nu.themeVariables=JR({},r))}},ea=oo({open:!1,message:"",variant:"success"}),co={state:ea,subscribe(t){return Qo(ea,()=>t(ea))},openToast(t,e){ea.open=!0,ea.message=t,ea.variant=e},closeToast(){ea.open=!1}};class ZR{constructor(e){this.openModal=Xo.open,this.closeModal=Xo.close,this.subscribeModal=Xo.subscribe,this.setTheme=ao.setThemeConfig,ao.setThemeConfig(e),Fi.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return aF});const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),br.setIsUiLoaded(!0)}}}var XR=Object.freeze({__proto__:null,WalletConnectModal:ZR});/**
69
+ }`;var St=Ow(function(){return Ht(j,Ye+"return "+ge).apply(r,Q)});if(St.source=ge,yg(St))throw St;return St}function Bz(o){return Vt(o).toLowerCase()}function Fz(o){return Vt(o).toUpperCase()}function Uz(o,c,p){if(o=Vt(o),o&&(p||c===r))return Uy(o);if(!o||!(c=qi(c)))return o;var x=Tn(o),$=Tn(c),j=ky(x,$),Q=jy(x,$)+1;return Io(x,j,Q).join("")}function kz(o,c,p){if(o=Vt(o),o&&(p||c===r))return o.slice(0,zy(o)+1);if(!o||!(c=qi(c)))return o;var x=Tn(o),$=jy(x,Tn(c))+1;return Io(x,0,$).join("")}function jz(o,c,p){if(o=Vt(o),o&&(p||c===r))return o.replace(st,"");if(!o||!(c=qi(c)))return o;var x=Tn(o),$=ky(x,Tn(c));return Io(x,$).join("")}function qz(o,c){var p=re,x=T;if(fr(c)){var $="separator"in c?c.separator:$;p="length"in c?xt(c.length):p,x="omission"in c?qi(c.omission):x}o=Vt(o);var j=o.length;if(Rc(o)){var Q=Tn(o);j=Q.length}if(p>=j)return o;var Z=p-Nc(x);if(Z<1)return x;var se=Q?Io(Q,0,Z).join(""):o.slice(0,Z);if($===r)return se+x;if(Q&&(Z+=se.length-Z),wg($)){if(o.slice(Z).search($)){var le,de=se;for($.global||($=Lp($.source,Vt(_t.exec($))+"g")),$.lastIndex=0;le=$.exec(de);)var ge=le.index;se=se.slice(0,ge===r?Z:ge)}}else if(o.indexOf(qi($),Z)!=Z){var De=se.lastIndexOf($);De>-1&&(se=se.slice(0,De))}return se+x}function zz(o){return o=Vt(o),o&&Le.test(o)?o.replace(Ot,bF):o}var Hz=jc(function(o,c,p){return o+(p?" ":"")+c.toUpperCase()}),Ag=P5("toUpperCase");function Dw(o,c,p){return o=Vt(o),c=p?r:c,c===r?dF(o)?_F(o):nF(o):o.match(c)||[]}var Ow=Mt(function(o,c){try{return Tr(o,r,c)}catch(p){return yg(p)?p:new vt(p)}}),Kz=Hs(function(o,c){return an(c,function(p){p=Es(p),qs(o,p,mg(o[p],o))}),o});function Wz(o){var c=o==null?0:o.length,p=ot();return o=c?cr(o,function(x){if(typeof x[1]!="function")throw new cn(a);return[p(x[0]),x[1]]}):[],Mt(function(x){for(var $=-1;++$<c;){var j=o[$];if(Tr(j[0],this,x))return Tr(j[1],this,x)}})}function Vz(o){return bU(fn(o,w))}function xg(o){return function(){return o}}function Gz(o,c){return o==null||o!==o?c:o}var Yz=R5(),Jz=R5(!0);function $i(o){return o}function Sg(o){return u5(typeof o=="function"?o:fn(o,w))}function Qz(o){return h5(fn(o,w))}function Zz(o,c){return l5(o,fn(c,w))}var Xz=Mt(function(o,c){return function(p){return lf(p,o,c)}}),eH=Mt(function(o,c){return function(p){return lf(o,p,c)}});function Ig(o,c,p){var x=Lr(c),$=Hl(c,x);p==null&&!(fr(c)&&($.length||!x.length))&&(p=c,c=o,o=this,$=Hl(c,Lr(c)));var j=!(fr(p)&&"chain"in p)||!!p.chain,Q=Ws(o);return an($,function(Z){var se=c[Z];o[Z]=se,Q&&(o.prototype[Z]=function(){var le=this.__chain__;if(j||le){var de=o(this.__wrapped__),ge=de.__actions__=Di(this.__actions__);return ge.push({func:se,args:arguments,thisArg:o}),de.__chain__=le,de}return se.apply(o,wo([this.value()],arguments))})}),o}function tH(){return Ft._===this&&(Ft._=MF),this}function Mg(){}function rH(o){return o=xt(o),Mt(function(c){return d5(c,o)})}var iH=ng(cr),nH=ng(Ny),sH=ng(Dp);function Pw(o){return hg(o)?Op(Es(o)):TU(o)}function oH(o){return function(c){return o==null?r:wa(o,c)}}var aH=T5(),cH=T5(!0);function Cg(){return[]}function Dg(){return!1}function uH(){return{}}function fH(){return""}function hH(){return!0}function lH(o,c){if(o=xt(o),o<1||o>P)return[];var p=m,x=ri(o,m);c=ot(c),o-=m;for(var $=Rp(x,c);++p<o;)c(p);return $}function dH(o){return yt(o)?cr(o,Es):zi(o)?[o]:Di(Q5(Vt(o)))}function pH(o){var c=++SF;return Vt(o)+c}var gH=Jl(function(o,c){return o+c},0),vH=sg("ceil"),mH=Jl(function(o,c){return o/c},1),bH=sg("floor");function yH(o){return o&&o.length?zl(o,$i,Hp):r}function wH(o,c){return o&&o.length?zl(o,ot(c,2),Hp):r}function _H(o){return By(o,$i)}function EH(o,c){return By(o,ot(c,2))}function AH(o){return o&&o.length?zl(o,$i,Gp):r}function xH(o,c){return o&&o.length?zl(o,ot(c,2),Gp):r}var SH=Jl(function(o,c){return o*c},1),IH=sg("round"),MH=Jl(function(o,c){return o-c},0);function CH(o){return o&&o.length?$p(o,$i):0}function DH(o,c){return o&&o.length?$p(o,ot(c,2)):0}return F.after=Qj,F.ary=cw,F.assign=Fq,F.assignIn=Ew,F.assignInWith=u0,F.assignWith=Uq,F.at=kq,F.before=uw,F.bind=mg,F.bindAll=Kz,F.bindKey=fw,F.castArray=uq,F.chain=sw,F.chunk=bk,F.compact=yk,F.concat=wk,F.cond=Wz,F.conforms=Vz,F.constant=xg,F.countBy=Cj,F.create=jq,F.curry=hw,F.curryRight=lw,F.debounce=dw,F.defaults=qq,F.defaultsDeep=zq,F.defer=Zj,F.delay=Xj,F.difference=_k,F.differenceBy=Ek,F.differenceWith=Ak,F.drop=xk,F.dropRight=Sk,F.dropRightWhile=Ik,F.dropWhile=Mk,F.fill=Ck,F.filter=Oj,F.flatMap=Rj,F.flatMapDeep=Nj,F.flatMapDepth=Tj,F.flatten=tw,F.flattenDeep=Dk,F.flattenDepth=Ok,F.flip=eq,F.flow=Yz,F.flowRight=Jz,F.fromPairs=Pk,F.functions=Jq,F.functionsIn=Qq,F.groupBy=Lj,F.initial=Rk,F.intersection=Nk,F.intersectionBy=Tk,F.intersectionWith=Lk,F.invert=Xq,F.invertBy=ez,F.invokeMap=Fj,F.iteratee=Sg,F.keyBy=Uj,F.keys=Lr,F.keysIn=Pi,F.map=i0,F.mapKeys=rz,F.mapValues=iz,F.matches=Qz,F.matchesProperty=Zz,F.memoize=s0,F.merge=nz,F.mergeWith=Aw,F.method=Xz,F.methodOf=eH,F.mixin=Ig,F.negate=o0,F.nthArg=rH,F.omit=sz,F.omitBy=oz,F.once=tq,F.orderBy=kj,F.over=iH,F.overArgs=rq,F.overEvery=nH,F.overSome=sH,F.partial=bg,F.partialRight=pw,F.partition=jj,F.pick=az,F.pickBy=xw,F.property=Pw,F.propertyOf=oH,F.pull=kk,F.pullAll=iw,F.pullAllBy=jk,F.pullAllWith=qk,F.pullAt=zk,F.range=aH,F.rangeRight=cH,F.rearg=iq,F.reject=Hj,F.remove=Hk,F.rest=nq,F.reverse=gg,F.sampleSize=Wj,F.set=uz,F.setWith=fz,F.shuffle=Vj,F.slice=Kk,F.sortBy=Jj,F.sortedUniq=Zk,F.sortedUniqBy=Xk,F.split=Rz,F.spread=sq,F.tail=ej,F.take=tj,F.takeRight=rj,F.takeRightWhile=ij,F.takeWhile=nj,F.tap=yj,F.throttle=oq,F.thru=r0,F.toArray=yw,F.toPairs=Sw,F.toPairsIn=Iw,F.toPath=dH,F.toPlainObject=_w,F.transform=hz,F.unary=aq,F.union=sj,F.unionBy=oj,F.unionWith=aj,F.uniq=cj,F.uniqBy=uj,F.uniqWith=fj,F.unset=lz,F.unzip=vg,F.unzipWith=nw,F.update=dz,F.updateWith=pz,F.values=Hc,F.valuesIn=gz,F.without=hj,F.words=Dw,F.wrap=cq,F.xor=lj,F.xorBy=dj,F.xorWith=pj,F.zip=gj,F.zipObject=vj,F.zipObjectDeep=mj,F.zipWith=bj,F.entries=Sw,F.entriesIn=Iw,F.extend=Ew,F.extendWith=u0,Ig(F,F),F.add=gH,F.attempt=Ow,F.camelCase=yz,F.capitalize=Mw,F.ceil=vH,F.clamp=vz,F.clone=fq,F.cloneDeep=lq,F.cloneDeepWith=dq,F.cloneWith=hq,F.conformsTo=pq,F.deburr=Cw,F.defaultTo=Gz,F.divide=mH,F.endsWith=wz,F.eq=Bn,F.escape=_z,F.escapeRegExp=Ez,F.every=Dj,F.find=Pj,F.findIndex=X5,F.findKey=Hq,F.findLast=$j,F.findLastIndex=ew,F.findLastKey=Kq,F.floor=bH,F.forEach=ow,F.forEachRight=aw,F.forIn=Wq,F.forInRight=Vq,F.forOwn=Gq,F.forOwnRight=Yq,F.get=_g,F.gt=gq,F.gte=vq,F.has=Zq,F.hasIn=Eg,F.head=rw,F.identity=$i,F.includes=Bj,F.indexOf=$k,F.inRange=mz,F.invoke=tz,F.isArguments=Aa,F.isArray=yt,F.isArrayBuffer=mq,F.isArrayLike=Oi,F.isArrayLikeObject=wr,F.isBoolean=bq,F.isBuffer=Mo,F.isDate=yq,F.isElement=wq,F.isEmpty=_q,F.isEqual=Eq,F.isEqualWith=Aq,F.isError=yg,F.isFinite=xq,F.isFunction=Ws,F.isInteger=gw,F.isLength=a0,F.isMap=vw,F.isMatch=Sq,F.isMatchWith=Iq,F.isNaN=Mq,F.isNative=Cq,F.isNil=Oq,F.isNull=Dq,F.isNumber=mw,F.isObject=fr,F.isObjectLike=gr,F.isPlainObject=bf,F.isRegExp=wg,F.isSafeInteger=Pq,F.isSet=bw,F.isString=c0,F.isSymbol=zi,F.isTypedArray=zc,F.isUndefined=$q,F.isWeakMap=Rq,F.isWeakSet=Nq,F.join=Bk,F.kebabCase=Az,F.last=ln,F.lastIndexOf=Fk,F.lowerCase=xz,F.lowerFirst=Sz,F.lt=Tq,F.lte=Lq,F.max=yH,F.maxBy=wH,F.mean=_H,F.meanBy=EH,F.min=AH,F.minBy=xH,F.stubArray=Cg,F.stubFalse=Dg,F.stubObject=uH,F.stubString=fH,F.stubTrue=hH,F.multiply=SH,F.nth=Uk,F.noConflict=tH,F.noop=Mg,F.now=n0,F.pad=Iz,F.padEnd=Mz,F.padStart=Cz,F.parseInt=Dz,F.random=bz,F.reduce=qj,F.reduceRight=zj,F.repeat=Oz,F.replace=Pz,F.result=cz,F.round=IH,F.runInContext=ne,F.sample=Kj,F.size=Gj,F.snakeCase=$z,F.some=Yj,F.sortedIndex=Wk,F.sortedIndexBy=Vk,F.sortedIndexOf=Gk,F.sortedLastIndex=Yk,F.sortedLastIndexBy=Jk,F.sortedLastIndexOf=Qk,F.startCase=Nz,F.startsWith=Tz,F.subtract=MH,F.sum=CH,F.sumBy=DH,F.template=Lz,F.times=lH,F.toFinite=Vs,F.toInteger=xt,F.toLength=ww,F.toLower=Bz,F.toNumber=dn,F.toSafeInteger=Bq,F.toString=Vt,F.toUpper=Fz,F.trim=Uz,F.trimEnd=kz,F.trimStart=jz,F.truncate=qz,F.unescape=zz,F.uniqueId=pH,F.upperCase=Hz,F.upperFirst=Ag,F.each=ow,F.eachRight=aw,F.first=rw,Ig(F,function(){var o={};return ws(F,function(c,p){Yt.call(F.prototype,p)||(o[p]=c)}),o}(),{chain:!1}),F.VERSION=i,an(["bind","bindKey","curry","curryRight","partial","partialRight"],function(o){F[o].placeholder=F}),an(["drop","take"],function(o,c){Lt.prototype[o]=function(p){p=p===r?1:Cr(xt(p),0);var x=this.__filtered__&&!c?new Lt(this):this.clone();return x.__filtered__?x.__takeCount__=ri(p,x.__takeCount__):x.__views__.push({size:ri(p,m),type:o+(x.__dir__<0?"Right":"")}),x},Lt.prototype[o+"Right"]=function(p){return this.reverse()[o](p).reverse()}}),an(["filter","map","takeWhile"],function(o,c){var p=c+1,x=p==h||p==E;Lt.prototype[o]=function($){var j=this.clone();return j.__iteratees__.push({iteratee:ot($,3),type:p}),j.__filtered__=j.__filtered__||x,j}}),an(["head","last"],function(o,c){var p="take"+(c?"Right":"");Lt.prototype[o]=function(){return this[p](1).value()[0]}}),an(["initial","tail"],function(o,c){var p="drop"+(c?"":"Right");Lt.prototype[o]=function(){return this.__filtered__?new Lt(this):this[p](1)}}),Lt.prototype.compact=function(){return this.filter($i)},Lt.prototype.find=function(o){return this.filter(o).head()},Lt.prototype.findLast=function(o){return this.reverse().find(o)},Lt.prototype.invokeMap=Mt(function(o,c){return typeof o=="function"?new Lt(this):this.map(function(p){return lf(p,o,c)})}),Lt.prototype.reject=function(o){return this.filter(o0(ot(o)))},Lt.prototype.slice=function(o,c){o=xt(o);var p=this;return p.__filtered__&&(o>0||c<0)?new Lt(p):(o<0?p=p.takeRight(-o):o&&(p=p.drop(o)),c!==r&&(c=xt(c),p=c<0?p.dropRight(-c):p.take(c-o)),p)},Lt.prototype.takeRightWhile=function(o){return this.reverse().takeWhile(o).reverse()},Lt.prototype.toArray=function(){return this.take(m)},ws(Lt.prototype,function(o,c){var p=/^(?:filter|find|map|reject)|While$/.test(c),x=/^(?:head|last)$/.test(c),$=F[x?"take"+(c=="last"?"Right":""):c],j=x||/^find/.test(c);$&&(F.prototype[c]=function(){var Q=this.__wrapped__,Z=x?[1]:arguments,se=Q instanceof Lt,le=Z[0],de=se||yt(Q),ge=function(Pt){var Ut=$.apply(F,wo([Pt],Z));return x&&De?Ut[0]:Ut};de&&p&&typeof le=="function"&&le.length!=1&&(se=de=!1);var De=this.__chain__,Ye=!!this.__actions__.length,ut=j&&!De,St=se&&!Ye;if(!j&&de){Q=St?Q:new Lt(this);var ft=o.apply(Q,Z);return ft.__actions__.push({func:r0,args:[ge],thisArg:r}),new un(ft,De)}return ut&&St?o.apply(this,Z):(ft=this.thru(ge),ut?x?ft.value()[0]:ft.value():ft)})}),an(["pop","push","shift","sort","splice","unshift"],function(o){var c=Cl[o],p=/^(?:push|sort|unshift)$/.test(o)?"tap":"thru",x=/^(?:pop|shift)$/.test(o);F.prototype[o]=function(){var $=arguments;if(x&&!this.__chain__){var j=this.value();return c.apply(yt(j)?j:[],$)}return this[p](function(Q){return c.apply(yt(Q)?Q:[],$)})}}),ws(Lt.prototype,function(o,c){var p=F[c];if(p){var x=p.name+"";Yt.call(Fc,x)||(Fc[x]=[]),Fc[x].push({name:c,func:p})}}),Fc[Yl(r,H).name]=[{name:"wrapper",func:r}],Lt.prototype.clone=zF,Lt.prototype.reverse=HF,Lt.prototype.value=KF,F.prototype.at=wj,F.prototype.chain=_j,F.prototype.commit=Ej,F.prototype.next=Aj,F.prototype.plant=Sj,F.prototype.reverse=Ij,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=Mj,F.prototype.first=F.prototype.head,sf&&(F.prototype[sf]=xj),F},Tc=EF();yr?((yr.exports=Tc)._=Tc,er._=Tc):Ft._=Tc}).call(Ru)})(s1,s1.exports);var B$=Object.defineProperty,F$=Object.defineProperties,U$=Object.getOwnPropertyDescriptors,V3=Object.getOwnPropertySymbols,k$=Object.prototype.hasOwnProperty,j$=Object.prototype.propertyIsEnumerable,G3=(t,e,r)=>e in t?B$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Dh=(t,e)=>{for(var r in e||(e={}))k$.call(e,r)&&G3(t,r,e[r]);if(V3)for(var r of V3(e))j$.call(e,r)&&G3(t,r,e[r]);return t},q$=(t,e)=>F$(t,U$(e));function Mn(t,e,r){var i;const n=ru(t);return((i=e.rpcMap)==null?void 0:i[n.reference])||`${L$}?chainId=${n.namespace}:${n.reference}&projectId=${r}`}function Jo(t){return t.includes(":")?t.split(":")[1]:t}function Y3(t){return t.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function z$(t,e){const r=Object.keys(e.namespaces).filter(n=>n.includes(t));if(!r.length)return[];const i=[];return r.forEach(n=>{const s=e.namespaces[n].accounts;i.push(...s)}),i}function o1(t={},e={}){const r=J3(t),i=J3(e);return s1.exports.merge(r,i)}function J3(t){var e,r,i,n;const s={};if(!yu(t))return s;for(const[a,u]of Object.entries(t)){const l=Od(a)?[a]:u.chains,d=u.methods||[],b=u.events||[],w=u.rpcMap||{},I=bu(a);s[I]=q$(Dh(Dh({},s[I]),u),{chains:Yf(l,(e=s[I])==null?void 0:e.chains),methods:Yf(d,(r=s[I])==null?void 0:r.methods),events:Yf(b,(i=s[I])==null?void 0:i.events),rpcMap:Dh(Dh({},w),(n=s[I])==null?void 0:n.rpcMap)})}return s}function H$(t){return t.includes(":")?t.split(":")[2]:t}function Q3(t){const e={};for(const[r,i]of Object.entries(t)){const n=i.methods||[],s=i.events||[],a=i.accounts||[],u=Od(r)?[r]:i.chains?i.chains:Y3(i.accounts);e[r]={chains:u,methods:n,events:s,accounts:a}}return e}function a1(t){return typeof t=="number"?t:t.includes("0x")?parseInt(t,16):(t=t.includes(":")?t.split(":")[1]:t,isNaN(Number(t))?t:Number(t))}const Z3={},Kt=t=>Z3[t],c1=(t,e)=>{Z3[t]=e};class K${constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}var W$=Object.defineProperty,V$=Object.defineProperties,G$=Object.getOwnPropertyDescriptors,X3=Object.getOwnPropertySymbols,Y$=Object.prototype.hasOwnProperty,J$=Object.prototype.propertyIsEnumerable,e6=(t,e,r)=>e in t?W$(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,t6=(t,e)=>{for(var r in e||(e={}))Y$.call(e,r)&&e6(t,r,e[r]);if(X3)for(var r of X3(e))J$.call(e,r)&&e6(t,r,e[r]);return t},r6=(t,e)=>V$(t,G$(e));class Q${constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":return this.getAccounts();case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(parseInt(e),r),this.chainId=parseInt(e),this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,r){const i=r||Mn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=parseInt(Jo(r));e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}getHttpProvider(){const e=this.chainId,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}async handleSwitchChain(e){var r,i;let n=e.request.params?(r=e.request.params[0])==null?void 0:r.chainId:"0x0";n=n.startsWith("0x")?n:`0x${n}`;const s=parseInt(n,16);if(this.isChainApproved(s))this.setDefaultChain(`${s}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:(i=this.namespace.chains)==null?void 0:i[0]}),this.setDefaultChain(`${s}`);else throw new Error(`Failed to switch to chain 'eip155:${s}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var r,i,n;const s=(i=(r=e.request)==null?void 0:r.params)==null?void 0:i[0];if(!s)throw new Error("Missing address parameter in `wallet_getCapabilities` request");const a=this.client.session.get(e.topic),u=((n=a?.sessionProperties)==null?void 0:n.capabilities)||{};if(u!=null&&u[s])return u?.[s];const l=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:r6(t6({},a.sessionProperties||{}),{capabilities:r6(t6({},u||{}),{[s]:l})})})}catch(d){console.warn("Failed to update session with capabilities",d)}return l}}class Z${constructor(e){this.name="solana",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class X${constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class eR{constructor(e){this.name="algorand",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(!this.httpProviders[e]){const i=r||Mn(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;e[r]=this.createHttpProvider(r,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);return typeof i>"u"?void 0:new An(new ds(i,Kt("disableProviderPing")))}}class tR{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{const i=this.getCardanoRPCUrl(r),n=Jo(r);e[n]=this.createHttpProvider(n,i)}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}getCardanoRPCUrl(e){const r=this.namespace.rpcMap;if(r)return r[e]}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||this.getCardanoRPCUrl(e);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class rR{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class iR{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;const n=Jo(r);e[n]=this.createHttpProvider(n,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}class nR{constructor(e){this.name="near",this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,r){if(this.chainId=e,!this.httpProviders[e]){const i=r||Mn(`${this.name}:${e}`,this.namespace);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,i)}this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${this.chainId}`)}getAccounts(){const e=this.namespace.accounts;return e?e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2])||[]:[]}createHttpProviders(){const e={};return this.namespace.chains.forEach(r=>{var i;e[r]=this.createHttpProvider(r,(i=this.namespace.rpcMap)==null?void 0:i[r])}),e}getHttpProvider(){const e=`${this.name}:${this.chainId}`,r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace);return typeof i>"u"?void 0:new An(new ds(i,Kt("disableProviderPing")))}}class sR{constructor(e){this.name=uc,this.namespace=e.namespace,this.events=Kt("events"),this.client=Kt("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,r){this.httpProviders[e]||this.setHttpProvider(e,r),this.chainId=e,this.events.emit(In.DEFAULT_CHAIN_CHANGED,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;const e=this.namespace.chains[0];if(!e)throw new Error("ChainId not found");return e.split(":")[1]}getAccounts(){const e=this.namespace.accounts;return e?[...new Set(e.filter(r=>r.split(":")[1]===this.chainId.toString()).map(r=>r.split(":")[2]))]:[]}createHttpProviders(){var e,r;const i={};return(r=(e=this.namespace)==null?void 0:e.accounts)==null||r.forEach(n=>{const s=ru(n);i[`${s.namespace}:${s.reference}`]=this.createHttpProvider(n)}),i}getHttpProvider(e){const r=this.httpProviders[e];if(typeof r>"u")throw new Error(`JSON-RPC provider for ${e} not found`);return r}setHttpProvider(e,r){const i=this.createHttpProvider(e,r);i&&(this.httpProviders[e]=i)}createHttpProvider(e,r){const i=r||Mn(e,this.namespace,this.client.core.projectId);if(!i)throw new Error(`No RPC url provided for chainId: ${e}`);return new An(new ds(i,Kt("disableProviderPing")))}}var oR=Object.defineProperty,aR=Object.defineProperties,cR=Object.getOwnPropertyDescriptors,i6=Object.getOwnPropertySymbols,uR=Object.prototype.hasOwnProperty,fR=Object.prototype.propertyIsEnumerable,n6=(t,e,r)=>e in t?oR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Oh=(t,e)=>{for(var r in e||(e={}))uR.call(e,r)&&n6(t,r,e[r]);if(i6)for(var r of i6(e))fR.call(e,r)&&n6(t,r,e[r]);return t},u1=(t,e)=>aR(t,cR(e));class f1{constructor(e){this.events=new Br.exports,this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger=typeof e?.logger<"u"&&typeof e?.logger!="string"?e.logger:os(Eh({level:e?.logger||K3})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){const r=new f1(e);return await r.initialize(),r}async request(e,r,i){const[n,s]=this.validateChain(r);if(!this.session)throw new Error("Please call connect() before request()");return await this.getProvider(n).request({request:Oh({},e),chainId:`${n}:${s}`,topic:this.session.topic,expiry:i})}sendAsync(e,r,i,n){const s=new Date().getTime();this.request(e,i,n).then(a=>r(null,Ah(s,a))).catch(a=>r(a,void 0))}async enable(){if(!this.client)throw new Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw new Error("Please call connect() before enable()");await this.client.disconnect({topic:(e=this.session)==null?void 0:e.topic,reason:Gt("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw new Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e){if(!this.client)throw new Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();const{uri:r,response:i}=await this.client.authenticate(e);r&&(this.uri=r,this.events.emit("display_uri",r));const n=await i();if(this.session=n.session,this.session){const s=Q3(this.session.namespaces);this.namespaces=o1(this.namespaces,s),this.persist("namespaces",this.namespaces),this.onConnect()}return n}on(e,r){this.events.on(e,r)}once(e,r){this.events.once(e,r)}removeListener(e,r){this.events.removeListener(e,r)}off(e,r){this.events.off(e,r)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let r=0;do{if(this.shouldAbortPairingAttempt)throw new Error("Pairing aborted");if(r>=this.maxPairingAttempts)throw new Error("Max auto pairing attempts reached");const{uri:i,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});i&&(this.uri=i,this.events.emit("display_uri",i)),await n().then(s=>{this.session=s;const a=Q3(s.namespaces);this.namespaces=o1(this.namespaces,a),this.persist("namespaces",this.namespaces)}).catch(s=>{if(s.message!==T3)throw s;r++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,r){try{if(!this.session)return;const[i,n]=this.validateChain(e),s=this.getProvider(i);s.name===uc?s.setDefaultChain(`${i}:${n}`,r):s.setDefaultChain(n,r)}catch(i){if(!/Please call connect/.test(i.message))throw i}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");const r=this.client.pairing.getAll();if(ss(r)){for(const i of r)e.deletePairings?this.client.core.expirer.set(i.topic,0):await this.client.core.relayer.subscriber.unsubscribe(i.topic);this.logger.info(`Inactive pairings cleared: ${r.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){const e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await i1.init({core:this.providerOpts.core,logger:this.providerOpts.logger||K3,relayUrl:this.providerOpts.relayUrl||R$,projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name,customStoragePrefix:this.providerOpts.customStoragePrefix,telemetryEnabled:this.providerOpts.telemetryEnabled}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw new Error("Sign Client not initialized");if(!this.session)throw new Error("Session not initialized. Please call connect() before enable()");const e=[...new Set(Object.keys(this.session.namespaces).map(r=>bu(r)))];c1("client",this.client),c1("events",this.events),c1("disableProviderPing",this.disableProviderPing),e.forEach(r=>{if(!this.session)return;const i=z$(r,this.session),n=Y3(i),s=o1(this.namespaces,this.optionalNamespaces),a=u1(Oh({},s[r]),{accounts:i,chains:n});switch(r){case"eip155":this.rpcProviders[r]=new Q$({namespace:a});break;case"algorand":this.rpcProviders[r]=new eR({namespace:a});break;case"solana":this.rpcProviders[r]=new Z$({namespace:a});break;case"cosmos":this.rpcProviders[r]=new X$({namespace:a});break;case"polkadot":this.rpcProviders[r]=new K$({namespace:a});break;case"cip34":this.rpcProviders[r]=new tR({namespace:a});break;case"elrond":this.rpcProviders[r]=new rR({namespace:a});break;case"multiversx":this.rpcProviders[r]=new iR({namespace:a});break;case"near":this.rpcProviders[r]=new nR({namespace:a});break;default:this.rpcProviders[uc]?this.rpcProviders[uc].updateNamespace(a):this.rpcProviders[uc]=new sR({namespace:a})}})}registerEventListeners(){if(typeof this.client>"u")throw new Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{const{params:r}=e,{event:i}=r;if(i.name==="accountsChanged"){const n=i.data;n&&ss(n)&&this.events.emit("accountsChanged",n.map(H$))}else if(i.name==="chainChanged"){const n=r.chainId,s=r.event.data,a=bu(n),u=a1(n)!==a1(s)?`${a}:${a1(s)}`:n;this.onChainChanged(u)}else this.events.emit(i.name,i.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:r})=>{var i;const{namespaces:n}=r,s=(i=this.client)==null?void 0:i.session.get(e);this.session=u1(Oh({},s),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:r})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",u1(Oh({},Gt("USER_DISCONNECTED")),{data:e.topic}))}),this.on(In.DEFAULT_CHAIN_CHANGED,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[uc]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var r;this.getProvider(e).updateNamespace((r=this.session)==null?void 0:r.namespaces[e])})}setNamespaces(e){const{namespaces:r,optionalNamespaces:i,sessionProperties:n}=e;r&&Object.keys(r).length&&(this.namespaces=r),i&&Object.keys(i).length&&(this.optionalNamespaces=i),this.sessionProperties=n,this.persist("namespaces",r),this.persist("optionalNamespaces",i)}validateChain(e){const[r,i]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[r,i];if(r&&!Object.keys(this.namespaces||{}).map(a=>bu(a)).includes(r))throw new Error(`Namespace '${r}' is not configured. Please call connect() first with namespace config.`);if(r&&i)return[r,i];const n=bu(Object.keys(this.namespaces)[0]),s=this.rpcProviders[n].getDefaultChain();return[n,s]}async requestAccounts(){const[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,r=!1){if(!this.namespaces)return;const[i,n]=this.validateChain(e);n&&(r||this.getProvider(i).setDefaultChain(n),this.namespaces[i]?this.namespaces[i].defaultChain=n:this.namespaces[`${i}:${n}`]?this.namespaces[`${i}:${n}`].defaultChain=n:this.namespaces[`${i}:${n}`]={defaultChain:n},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,r){this.client.core.storage.setItem(`${W3}/${e}`,r)}async getFromStore(e){return await this.client.core.storage.getItem(`${W3}/${e}`)}}const hR=f1,lR="wc",dR="ethereum_provider",pR=`${lR}@2:${dR}:`,gR="https://rpc.walletconnect.com/v1/",Ph=["eth_sendTransaction","personal_sign"],s6=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],$h=["chainChanged","accountsChanged"],o6=["chainChanged","accountsChanged","message","disconnect","connect"];var vR=Object.defineProperty,mR=Object.defineProperties,bR=Object.getOwnPropertyDescriptors,a6=Object.getOwnPropertySymbols,yR=Object.prototype.hasOwnProperty,wR=Object.prototype.propertyIsEnumerable,c6=(t,e,r)=>e in t?vR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,fc=(t,e)=>{for(var r in e||(e={}))yR.call(e,r)&&c6(t,r,e[r]);if(a6)for(var r of a6(e))wR.call(e,r)&&c6(t,r,e[r]);return t},h1=(t,e)=>mR(t,bR(e));function Rh(t){return Number(t[0].split(":")[1])}function Nh(t){return`0x${t.toString(16)}`}function _R(t){const{chains:e,optionalChains:r,methods:i,optionalMethods:n,events:s,optionalEvents:a,rpcMap:u}=t;if(!ss(e))throw new Error("Invalid chains");const l={chains:e,methods:i||Ph,events:s||$h,rpcMap:fc({},e.length?{[Rh(e)]:u[Rh(e)]}:{})},d=s?.filter(S=>!$h.includes(S)),b=i?.filter(S=>!Ph.includes(S));if(!r&&!a&&!n&&!(d!=null&&d.length)&&!(b!=null&&b.length))return{required:e.length?l:void 0};const w=d?.length&&b?.length||!r,I={chains:[...new Set(w?l.chains.concat(r||[]):r)],methods:[...new Set(l.methods.concat(n!=null&&n.length?n:s6))],events:[...new Set(l.events.concat(a!=null&&a.length?a:o6))],rpcMap:u};return{required:e.length?l:void 0,optional:r.length?I:void 0}}class Th{constructor(){this.events=new Br.exports.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY=pR,this.on=(e,r)=>(this.events.on(e,r),this),this.once=(e,r)=>(this.events.once(e,r),this),this.removeListener=(e,r)=>(this.events.removeListener(e,r),this),this.off=(e,r)=>(this.events.off(e,r),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){const r=new Th;return await r.initialize(e),r}async request(e,r){return await this.signer.request(e,this.formatChainId(this.chainId),r)}sendAsync(e,r,i){this.signer.sendAsync(e,r,this.formatChainId(this.chainId),i)}get connected(){return this.signer.client?this.signer.client.core.relayer.connected:!1}get connecting(){return this.signer.client?this.signer.client.core.relayer.connecting:!1}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);const{required:r,optional:i}=_R(this.rpc);try{const n=await new Promise(async(a,u)=>{var l;this.rpc.showQrModal&&((l=this.modal)==null||l.subscribeModal(d=>{!d.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),u(new Error("Connection request reset. Please try again.")))})),await this.signer.connect(h1(fc({namespaces:fc({},r&&{[this.namespace]:r})},i&&{optionalNamespaces:{[this.namespace]:i}}),{pairingTopic:e?.pairingTopic})).then(d=>{a(d)}).catch(d=>{u(new Error(d.message))})});if(!n)return;const s=Rv(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:s),this.setAccounts(s),this.events.emit("connect",{chainId:Nh(this.chainId)})}catch(n){throw this.signer.logger.error(n),n}finally{this.modal&&this.modal.closeModal()}}async authenticate(e){if(!this.signer.client)throw new Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e?.chains});try{const r=await new Promise(async(n,s)=>{var a;this.rpc.showQrModal&&((a=this.modal)==null||a.subscribeModal(u=>{!u.open&&!this.signer.session&&(this.signer.abortPairingAttempt(),s(new Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(h1(fc({},e),{chains:this.rpc.chains})).then(u=>{n(u)}).catch(u=>{s(new Error(u.message))})}),i=r.session;if(i){const n=Rv(i.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:n),this.setAccounts(n),this.events.emit("connect",{chainId:Nh(this.chainId)})}return r}catch(r){throw this.signer.logger.error(r),r}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{const{params:r}=e,{event:i}=r;i.name==="accountsChanged"?(this.accounts=this.parseAccounts(i.data),this.events.emit("accountsChanged",this.accounts)):i.name==="chainChanged"?this.setChainId(this.formatChainId(i.data)):this.events.emit(i.name,i.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{const r=parseInt(e);this.chainId=r,this.events.emit("chainChanged",Nh(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",h1(fc({},Gt("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var r,i;this.rpc.showQrModal&&((r=this.modal)==null||r.closeModal(),(i=this.modal)==null||i.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return typeof e=="string"?e.startsWith(`${this.namespace}:`):!1}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){const r=e.filter(i=>this.isCompatibleChainId(i)).map(i=>this.parseChainId(i));r.length&&(this.chainId=r[0],this.events.emit("chainChanged",Nh(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){const r=this.parseChainId(e);this.chainId=r,this.switchEthereumChain(r)}}parseAccountId(e){const[r,i,n]=e.split(":");return{chainId:`${r}:${i}`,address:n}}setAccounts(e){this.accounts=e.filter(r=>this.parseChainId(this.parseAccountId(r).chainId)===this.chainId).map(r=>this.parseAccountId(r).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var r,i;const n=(r=e?.chains)!=null?r:[],s=(i=e?.optionalChains)!=null?i:[],a=n.concat(s);if(!a.length)throw new Error("No chains specified in either `chains` or `optionalChains`");const u=n.length?e?.methods||Ph:[],l=n.length?e?.events||$h:[],d=e?.optionalMethods||[],b=e?.optionalEvents||[],w=e?.rpcMap||this.buildRpcMap(a,e.projectId),I=e?.qrModalOptions||void 0;return{chains:n?.map(S=>this.formatChainId(S)),optionalChains:s.map(S=>this.formatChainId(S)),methods:u,events:l,optionalMethods:d,optionalEvents:b,rpcMap:w,showQrModal:!!(e!=null&&e.showQrModal),qrModalOptions:I,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,r){const i={};return e.forEach(n=>{i[n]=this.getRpcUrl(n,r)}),i}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?Rh(this.rpc.chains):Rh(this.rpc.optionalChains),this.signer=await hR.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions,customStoragePrefix:e.customStoragePrefix,telemetryEnabled:e.telemetryEnabled}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let r;try{const{WalletConnectModal:i}=await Promise.resolve().then(function(){return HR});r=i}catch{throw new Error("To use QR modal, please install @walletconnect/modal package")}if(r)try{this.modal=new r(fc({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(i){throw this.signer.logger.error(i),new Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;const{chains:r,optionalChains:i,rpcMap:n}=e;r&&ss(r)&&(this.rpc.chains=r.map(s=>this.formatChainId(s)),r.forEach(s=>{this.rpc.rpcMap[s]=n?.[s]||this.getRpcUrl(s)})),i&&ss(i)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=i?.map(s=>this.formatChainId(s)),i.forEach(s=>{this.rpc.rpcMap[s]=n?.[s]||this.getRpcUrl(s)}))}getRpcUrl(e,r){var i;return((i=this.rpc.rpcMap)==null?void 0:i[e])||`${gR}?chainId=eip155:${e}&projectId=${r||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{const e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),r=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:r?.accounts),this.setAccounts(r?.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(r=>this.signer.logger.warn(r))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return typeof e=="string"||e instanceof String?[this.parseAccount(e)]:e.map(r=>this.parseAccount(r))}}const ER=Th,AR=Symbol(),u6=Object.getPrototypeOf,l1=new WeakMap,xR=t=>t&&(l1.has(t)?l1.get(t):u6(t)===Object.prototype||u6(t)===Array.prototype),SR=t=>xR(t)&&t[AR]||null,f6=(t,e=!0)=>{l1.set(t,e)},d1=t=>typeof t=="object"&&t!==null,so=new WeakMap,Lh=new WeakSet,IR=(t=Object.is,e=(d,b)=>new Proxy(d,b),r=d=>d1(d)&&!Lh.has(d)&&(Array.isArray(d)||!(Symbol.iterator in d))&&!(d instanceof WeakMap)&&!(d instanceof WeakSet)&&!(d instanceof Error)&&!(d instanceof Number)&&!(d instanceof Date)&&!(d instanceof String)&&!(d instanceof RegExp)&&!(d instanceof ArrayBuffer),i=d=>{switch(d.status){case"fulfilled":return d.value;case"rejected":throw d.reason;default:throw d}},n=new WeakMap,s=(d,b,w=i)=>{const I=n.get(d);if(I?.[0]===b)return I[1];const S=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d));return f6(S,!0),n.set(d,[b,S]),Reflect.ownKeys(d).forEach(D=>{if(Object.getOwnPropertyDescriptor(S,D))return;const L=Reflect.get(d,D),K={value:L,enumerable:!0,configurable:!0};if(Lh.has(L))f6(L,!1);else if(L instanceof Promise)delete K.value,K.get=()=>w(L);else if(so.has(L)){const[H,U]=so.get(L);K.value=s(H,U(),w)}Object.defineProperty(S,D,K)}),Object.preventExtensions(S)},a=new WeakMap,u=[1,1],l=d=>{if(!d1(d))throw new Error("object required");const b=a.get(d);if(b)return b;let w=u[0];const I=new Set,S=(X,re=++u[0])=>{w!==re&&(w=re,I.forEach(T=>T(X,re)))};let D=u[1];const L=(X=++u[1])=>(D!==X&&!I.size&&(D=X,H.forEach(([re])=>{const T=re[1](X);T>w&&(w=T)})),w),K=X=>(re,T)=>{const y=[...re];y[1]=[X,...y[1]],S(y,T)},H=new Map,U=(X,re)=>{if(H.has(X))throw new Error("prop listener already exists");if(I.size){const T=re[3](K(X));H.set(X,[re,T])}else H.set(X,[re])},W=X=>{var re;const T=H.get(X);T&&(H.delete(X),(re=T[1])==null||re.call(T))},R=X=>(I.add(X),I.size===1&&H.forEach(([T,y],f)=>{if(y)throw new Error("remove already exists");const h=T[3](K(f));H.set(f,[T,h])}),()=>{I.delete(X),I.size===0&&H.forEach(([T,y],f)=>{y&&(y(),H.set(f,[T]))})}),k=Array.isArray(d)?[]:Object.create(Object.getPrototypeOf(d)),_=e(k,{deleteProperty(X,re){const T=Reflect.get(X,re);W(re);const y=Reflect.deleteProperty(X,re);return y&&S(["delete",[re],T]),y},set(X,re,T,y){const f=Reflect.has(X,re),h=Reflect.get(X,re,y);if(f&&(t(h,T)||a.has(T)&&t(h,a.get(T))))return!0;W(re),d1(T)&&(T=SR(T)||T);let v=T;if(T instanceof Promise)T.then(E=>{T.status="fulfilled",T.value=E,S(["resolve",[re],E])}).catch(E=>{T.status="rejected",T.reason=E,S(["reject",[re],E])});else{!so.has(T)&&r(T)&&(v=l(T));const E=!Lh.has(v)&&so.get(v);E&&U(re,E)}return Reflect.set(X,re,v,y),S(["set",[re],T,h]),!0}});a.set(d,_);const B=[k,L,s,R];return so.set(_,B),Reflect.ownKeys(d).forEach(X=>{const re=Object.getOwnPropertyDescriptor(d,X);"value"in re&&(_[X]=d[X],delete re.value,delete re.writable),Object.defineProperty(k,X,re)}),_})=>[l,so,Lh,t,e,r,i,n,s,a,u],[MR]=IR();function oo(t={}){return MR(t)}function Qo(t,e,r){const i=so.get(t);i||console.warn("Please use proxy object");let n;const s=[],a=i[3];let u=!1;const d=a(b=>{if(s.push(b),r){e(s.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,u&&e(s.splice(0))}))});return u=!0,()=>{u=!1,d()}}function CR(t,e){const r=so.get(t);r||console.warn("Please use proxy object");const[i,n,s]=r;return s(i,n(),e)}const Nr=oo({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),ur={state:Nr,subscribe(t){return Qo(Nr,()=>t(Nr))},push(t,e){t!==Nr.view&&(Nr.view=t,e&&(Nr.data=e),Nr.history.push(t))},reset(t){Nr.view=t,Nr.history=[t]},replace(t){Nr.history.length>1&&(Nr.history[Nr.history.length-1]=t,Nr.view=t)},goBack(){if(Nr.history.length>1){Nr.history.pop();const[t]=Nr.history.slice(-1);Nr.view=t}},setData(t){Nr.data=t}},Qe={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile(){return typeof window<"u"?!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)):!1},isAndroid(){return Qe.isMobile()&&navigator.userAgent.toLowerCase().includes("android")},isIos(){const t=navigator.userAgent.toLowerCase();return Qe.isMobile()&&(t.includes("iphone")||t.includes("ipad"))},isHttpUrl(t){return t.startsWith("http://")||t.startsWith("https://")},isArray(t){return Array.isArray(t)&&t.length>0},formatNativeUrl(t,e,r){if(Qe.isHttpUrl(t))return this.formatUniversalUrl(t,e,r);let i=t;i.includes("://")||(i=t.replaceAll("/","").replaceAll(":",""),i=`${i}://`),i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,r);const n=encodeURIComponent(e);return`${i}wc?uri=${n}`},formatUniversalUrl(t,e,r){if(!Qe.isHttpUrl(t))return this.formatNativeUrl(t,e,r);let i=t;i.endsWith("/")||(i=`${i}/`),this.setWalletConnectDeepLink(i,r);const n=encodeURIComponent(e);return`${i}wc?uri=${n}`},async wait(t){return new Promise(e=>{setTimeout(e,t)})},openHref(t,e){window.open(t,e,"noreferrer noopener")},setWalletConnectDeepLink(t,e){try{localStorage.setItem(Qe.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:e}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(t){try{const[e]=t.split("?");localStorage.setItem(Qe.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(Qe.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{typeof localStorage<"u"&&localStorage.setItem(Qe.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var t;const e=(t=ur.state.data)==null?void 0:t.Wallet;if(!e)throw new Error('Missing "Wallet" view data');return e}},DR=typeof location<"u"&&(location.hostname.includes("localhost")||location.protocol.includes("https")),Jr=oo({enabled:DR,userSessionId:"",events:[],connectedWalletId:void 0}),h6={state:Jr,subscribe(t){return Qo(Jr.events,()=>t(CR(Jr.events[Jr.events.length-1])))},initialize(){Jr.enabled&&typeof(crypto==null?void 0:crypto.randomUUID)<"u"&&(Jr.userSessionId=crypto.randomUUID())},setConnectedWalletId(t){Jr.connectedWalletId=t},click(t){if(Jr.enabled){const e={type:"CLICK",name:t.name,userSessionId:Jr.userSessionId,timestamp:Date.now(),data:t};Jr.events.push(e)}},track(t){if(Jr.enabled){const e={type:"TRACK",name:t.name,userSessionId:Jr.userSessionId,timestamp:Date.now(),data:t};Jr.events.push(e)}},view(t){if(Jr.enabled){const e={type:"VIEW",name:t.name,userSessionId:Jr.userSessionId,timestamp:Date.now(),data:t};Jr.events.push(e)}}},ps=oo({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),br={state:ps,subscribe(t){return Qo(ps,()=>t(ps))},setChains(t){ps.chains=t},setWalletConnectUri(t){ps.walletConnectUri=t},setIsCustomDesktop(t){ps.isCustomDesktop=t},setIsCustomMobile(t){ps.isCustomMobile=t},setIsDataLoaded(t){ps.isDataLoaded=t},setIsUiLoaded(t){ps.isUiLoaded=t},setIsAuth(t){ps.isAuth=t}},Bh=oo({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),Fi={state:Bh,subscribe(t){return Qo(Bh,()=>t(Bh))},setConfig(t){var e,r;h6.initialize(),br.setChains(t.chains),br.setIsAuth(!!t.enableAuthMode),br.setIsCustomMobile(!!((e=t.mobileWallets)!=null&&e.length)),br.setIsCustomDesktop(!!((r=t.desktopWallets)!=null&&r.length)),Qe.setModalVersionInStorage(),Object.assign(Bh,t)}};var OR=Object.defineProperty,l6=Object.getOwnPropertySymbols,PR=Object.prototype.hasOwnProperty,$R=Object.prototype.propertyIsEnumerable,d6=(t,e,r)=>e in t?OR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,RR=(t,e)=>{for(var r in e||(e={}))PR.call(e,r)&&d6(t,r,e[r]);if(l6)for(var r of l6(e))$R.call(e,r)&&d6(t,r,e[r]);return t};const p1="https://explorer-api.walletconnect.com",g1="wcm",v1="js-2.6.2";async function Fh(t,e){const r=RR({sdkType:g1,sdkVersion:v1},e),i=new URL(t,p1);return i.searchParams.append("projectId",Fi.state.projectId),Object.entries(r).forEach(([n,s])=>{s&&i.searchParams.append(n,String(s))}),(await fetch(i)).json()}const Zo={async getDesktopListings(t){return Fh("/w3m/v1/getDesktopListings",t)},async getMobileListings(t){return Fh("/w3m/v1/getMobileListings",t)},async getInjectedListings(t){return Fh("/w3m/v1/getInjectedListings",t)},async getAllListings(t){return Fh("/w3m/v1/getAllListings",t)},getWalletImageUrl(t){return`${p1}/w3m/v1/getWalletImage/${t}?projectId=${Fi.state.projectId}&sdkType=${g1}&sdkVersion=${v1}`},getAssetImageUrl(t){return`${p1}/w3m/v1/getAssetImage/${t}?projectId=${Fi.state.projectId}&sdkType=${g1}&sdkVersion=${v1}`}};var NR=Object.defineProperty,p6=Object.getOwnPropertySymbols,TR=Object.prototype.hasOwnProperty,LR=Object.prototype.propertyIsEnumerable,g6=(t,e,r)=>e in t?NR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,BR=(t,e)=>{for(var r in e||(e={}))TR.call(e,r)&&g6(t,r,e[r]);if(p6)for(var r of p6(e))LR.call(e,r)&&g6(t,r,e[r]);return t};const v6=Qe.isMobile(),gs=oo({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),Ai={state:gs,async getRecomendedWallets(){const{explorerRecommendedWalletIds:t,explorerExcludedWalletIds:e}=Fi.state;if(t==="NONE"||e==="ALL"&&!t)return gs.recomendedWallets;if(Qe.isArray(t)){const r={recommendedIds:t.join(",")},{listings:i}=await Zo.getAllListings(r),n=Object.values(i);n.sort((s,a)=>{const u=t.indexOf(s.id),l=t.indexOf(a.id);return u-l}),gs.recomendedWallets=n}else{const{chains:r,isAuth:i}=br.state,n=r?.join(","),s=Qe.isArray(e),a={page:1,sdks:i?"auth_v1":void 0,entries:Qe.RECOMMENDED_WALLET_AMOUNT,chains:n,version:2,excludedIds:s?e.join(","):void 0},{listings:u}=v6?await Zo.getMobileListings(a):await Zo.getDesktopListings(a);gs.recomendedWallets=Object.values(u)}return gs.recomendedWallets},async getWallets(t){const e=BR({},t),{explorerRecommendedWalletIds:r,explorerExcludedWalletIds:i}=Fi.state,{recomendedWallets:n}=gs;if(i==="ALL")return gs.wallets;n.length?e.excludedIds=n.map(w=>w.id).join(","):Qe.isArray(r)&&(e.excludedIds=r.join(",")),Qe.isArray(i)&&(e.excludedIds=[e.excludedIds,i].filter(Boolean).join(",")),br.state.isAuth&&(e.sdks="auth_v1");const{page:s,search:a}=t,{listings:u,total:l}=v6?await Zo.getMobileListings(e):await Zo.getDesktopListings(e),d=Object.values(u),b=a?"search":"wallets";return gs[b]={listings:[...gs[b].listings,...d],total:l,page:s??1},{listings:d,total:l}},getWalletImageUrl(t){return Zo.getWalletImageUrl(t)},getAssetImageUrl(t){return Zo.getAssetImageUrl(t)},resetSearch(){gs.search={listings:[],total:0,page:1}}},hc=oo({open:!1}),Xo={state:hc,subscribe(t){return Qo(hc,()=>t(hc))},async open(t){return new Promise(e=>{const{isUiLoaded:r,isDataLoaded:i}=br.state;if(Qe.removeWalletConnectDeepLink(),br.setWalletConnectUri(t?.uri),br.setChains(t?.chains),ur.reset("ConnectWallet"),r&&i)hc.open=!0,e();else{const n=setInterval(()=>{const s=br.state;s.isUiLoaded&&s.isDataLoaded&&(clearInterval(n),hc.open=!0,e())},200)}})},close(){hc.open=!1}};var FR=Object.defineProperty,m6=Object.getOwnPropertySymbols,UR=Object.prototype.hasOwnProperty,kR=Object.prototype.propertyIsEnumerable,b6=(t,e,r)=>e in t?FR(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,jR=(t,e)=>{for(var r in e||(e={}))UR.call(e,r)&&b6(t,r,e[r]);if(m6)for(var r of m6(e))kR.call(e,r)&&b6(t,r,e[r]);return t};function qR(){return typeof matchMedia<"u"&&matchMedia("(prefers-color-scheme: dark)").matches}const Nu=oo({themeMode:qR()?"dark":"light"}),ao={state:Nu,subscribe(t){return Qo(Nu,()=>t(Nu))},setThemeConfig(t){const{themeMode:e,themeVariables:r}=t;e&&(Nu.themeMode=e),r&&(Nu.themeVariables=jR({},r))}},ea=oo({open:!1,message:"",variant:"success"}),co={state:ea,subscribe(t){return Qo(ea,()=>t(ea))},openToast(t,e){ea.open=!0,ea.message=t,ea.variant=e},closeToast(){ea.open=!1}};class zR{constructor(e){this.openModal=Xo.open,this.closeModal=Xo.close,this.subscribeModal=Xo.subscribe,this.setTheme=ao.setThemeConfig,ao.setThemeConfig(e),Fi.setConfig(e),this.initUi()}async initUi(){if(typeof window<"u"){await Promise.resolve().then(function(){return ZB});const e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),br.setIsUiLoaded(!0)}}}var HR=Object.freeze({__proto__:null,WalletConnectModal:zR});/**
70
70
  * @license
71
71
  * Copyright 2019 Google LLC
72
72
  * SPDX-License-Identifier: BSD-3-Clause
73
- */const Fh=window,m1=Fh.ShadowRoot&&(Fh.ShadyCSS===void 0||Fh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,b1=Symbol(),_6=new WeakMap;class E6{constructor(e,r,i){if(this._$cssResult$=!0,i!==b1)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(m1&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=_6.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&_6.set(r,e))}return e}toString(){return this.cssText}}const eN=t=>new E6(typeof t=="string"?t:t+"",void 0,b1),zt=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new E6(r,t,b1)},tN=(t,e)=>{m1?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),n=Fh.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},A6=m1?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return eN(r)})(t):t;/**
73
+ */const Uh=window,m1=Uh.ShadowRoot&&(Uh.ShadyCSS===void 0||Uh.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,b1=Symbol(),y6=new WeakMap;class w6{constructor(e,r,i){if(this._$cssResult$=!0,i!==b1)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(m1&&e===void 0){const i=r!==void 0&&r.length===1;i&&(e=y6.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&y6.set(r,e))}return e}toString(){return this.cssText}}const KR=t=>new w6(typeof t=="string"?t:t+"",void 0,b1),zt=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((i,n,s)=>i+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(n)+t[s+1],t[0]);return new w6(r,t,b1)},WR=(t,e)=>{m1?t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet):e.forEach(r=>{const i=document.createElement("style"),n=Uh.litNonce;n!==void 0&&i.setAttribute("nonce",n),i.textContent=r.cssText,t.appendChild(i)})},_6=m1?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const i of e.cssRules)r+=i.cssText;return KR(r)})(t):t;/**
74
74
  * @license
75
75
  * Copyright 2017 Google LLC
76
76
  * SPDX-License-Identifier: BSD-3-Clause
77
- */var y1;const Uh=window,x6=Uh.trustedTypes,rN=x6?x6.emptyScript:"",S6=Uh.reactiveElementPolyfillSupport,w1={toAttribute(t,e){switch(e){case Boolean:t=t?rN:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},I6=(t,e)=>e!==t&&(e==e||t==t),_1={attribute:!0,type:String,converter:w1,reflect:!1,hasChanged:I6},E1="finalized";class lc extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,i)=>{const n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=_1){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){const s=this[e];this[r]=n,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||_1}static finalize(){if(this.hasOwnProperty(E1))return!1;this[E1]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const n of i)this.createProperty(n,r[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)r.unshift(A6(n))}else e!==void 0&&r.push(A6(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return tN(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=_1){var n;const s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){const a=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:w1).toAttribute(r,i.type);this._$El=e,a==null?this.removeAttribute(s):this.setAttribute(s,a),this._$El=null}}_$AK(e,r){var i;const n=this.constructor,s=n._$Ev.get(e);if(s!==void 0&&this._$El!==s){const a=n.getPropertyOptions(s),u=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:w1;this._$El=s,this[s]=u.fromAttribute(r,a.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||I6)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,s)=>this[s]=n),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var s;return(s=n.hostUpdate)===null||s===void 0?void 0:s.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}lc[E1]=!0,lc.elementProperties=new Map,lc.elementStyles=[],lc.shadowRootOptions={mode:"open"},S6?.({ReactiveElement:lc}),((y1=Uh.reactiveElementVersions)!==null&&y1!==void 0?y1:Uh.reactiveElementVersions=[]).push("1.6.3");/**
77
+ */var y1;const kh=window,E6=kh.trustedTypes,VR=E6?E6.emptyScript:"",A6=kh.reactiveElementPolyfillSupport,w1={toAttribute(t,e){switch(e){case Boolean:t=t?VR:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},x6=(t,e)=>e!==t&&(e==e||t==t),_1={attribute:!0,type:String,converter:w1,reflect:!1,hasChanged:x6},E1="finalized";class lc extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var r;this.finalize(),((r=this.h)!==null&&r!==void 0?r:this.h=[]).push(e)}static get observedAttributes(){this.finalize();const e=[];return this.elementProperties.forEach((r,i)=>{const n=this._$Ep(i,r);n!==void 0&&(this._$Ev.set(n,i),e.push(n))}),e}static createProperty(e,r=_1){if(r.state&&(r.attribute=!1),this.finalize(),this.elementProperties.set(e,r),!r.noAccessor&&!this.prototype.hasOwnProperty(e)){const i=typeof e=="symbol"?Symbol():"__"+e,n=this.getPropertyDescriptor(e,i,r);n!==void 0&&Object.defineProperty(this.prototype,e,n)}}static getPropertyDescriptor(e,r,i){return{get(){return this[r]},set(n){const s=this[e];this[r]=n,this.requestUpdate(e,s,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||_1}static finalize(){if(this.hasOwnProperty(E1))return!1;this[E1]=!0;const e=Object.getPrototypeOf(this);if(e.finalize(),e.h!==void 0&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){const r=this.properties,i=[...Object.getOwnPropertyNames(r),...Object.getOwnPropertySymbols(r)];for(const n of i)this.createProperty(n,r[n])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const i=new Set(e.flat(1/0).reverse());for(const n of i)r.unshift(_6(n))}else e!==void 0&&r.push(_6(e));return r}static _$Ep(e,r){const i=r.attribute;return i===!1?void 0:typeof i=="string"?i:typeof e=="string"?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$Eg(),this.requestUpdate(),(e=this.constructor.h)===null||e===void 0||e.forEach(r=>r(this))}addController(e){var r,i;((r=this._$ES)!==null&&r!==void 0?r:this._$ES=[]).push(e),this.renderRoot!==void 0&&this.isConnected&&((i=e.hostConnected)===null||i===void 0||i.call(e))}removeController(e){var r;(r=this._$ES)===null||r===void 0||r.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,r)=>{this.hasOwnProperty(r)&&(this._$Ei.set(r,this[r]),delete this[r])})}createRenderRoot(){var e;const r=(e=this.shadowRoot)!==null&&e!==void 0?e:this.attachShadow(this.constructor.shadowRootOptions);return WR(r,this.constructor.elementStyles),r}connectedCallback(){var e;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostConnected)===null||i===void 0?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$ES)===null||e===void 0||e.forEach(r=>{var i;return(i=r.hostDisconnected)===null||i===void 0?void 0:i.call(r)})}attributeChangedCallback(e,r,i){this._$AK(e,i)}_$EO(e,r,i=_1){var n;const s=this.constructor._$Ep(e,i);if(s!==void 0&&i.reflect===!0){const a=(((n=i.converter)===null||n===void 0?void 0:n.toAttribute)!==void 0?i.converter:w1).toAttribute(r,i.type);this._$El=e,a==null?this.removeAttribute(s):this.setAttribute(s,a),this._$El=null}}_$AK(e,r){var i;const n=this.constructor,s=n._$Ev.get(e);if(s!==void 0&&this._$El!==s){const a=n.getPropertyOptions(s),u=typeof a.converter=="function"?{fromAttribute:a.converter}:((i=a.converter)===null||i===void 0?void 0:i.fromAttribute)!==void 0?a.converter:w1;this._$El=s,this[s]=u.fromAttribute(r,a.type),this._$El=null}}requestUpdate(e,r,i){let n=!0;e!==void 0&&(((i=i||this.constructor.getPropertyOptions(e)).hasChanged||x6)(this[e],r)?(this._$AL.has(e)||this._$AL.set(e,r),i.reflect===!0&&this._$El!==e&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(e,i))):n=!1),!this.isUpdatePending&&n&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((n,s)=>this[s]=n),this._$Ei=void 0);let r=!1;const i=this._$AL;try{r=this.shouldUpdate(i),r?(this.willUpdate(i),(e=this._$ES)===null||e===void 0||e.forEach(n=>{var s;return(s=n.hostUpdate)===null||s===void 0?void 0:s.call(n)}),this.update(i)):this._$Ek()}catch(n){throw r=!1,this._$Ek(),n}r&&this._$AE(i)}willUpdate(e){}_$AE(e){var r;(r=this._$ES)===null||r===void 0||r.forEach(i=>{var n;return(n=i.hostUpdated)===null||n===void 0?void 0:n.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){this._$EC!==void 0&&(this._$EC.forEach((r,i)=>this._$EO(i,this[i],r)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}lc[E1]=!0,lc.elementProperties=new Map,lc.elementStyles=[],lc.shadowRootOptions={mode:"open"},A6?.({ReactiveElement:lc}),((y1=kh.reactiveElementVersions)!==null&&y1!==void 0?y1:kh.reactiveElementVersions=[]).push("1.6.3");/**
78
78
  * @license
79
79
  * Copyright 2017 Google LLC
80
80
  * SPDX-License-Identifier: BSD-3-Clause
81
- */var A1;const kh=window,dc=kh.trustedTypes,M6=dc?dc.createPolicy("lit-html",{createHTML:t=>t}):void 0,x1="$lit$",uo=`lit$${(Math.random()+"").slice(9)}$`,C6="?"+uo,iN=`<${C6}>`,ta=document,Tu=()=>ta.createComment(""),Lu=t=>t===null||typeof t!="object"&&typeof t!="function",D6=Array.isArray,nN=t=>D6(t)||typeof t?.[Symbol.iterator]=="function",S1=`[
82
- \f\r]`,Bu=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O6=/-->/g,P6=/>/g,ra=RegExp(`>|${S1}(?:([^\\s"'>=/]+)(${S1}*=${S1}*(?:[^
83
- \f\r"'\`<>=]|("|')|))|$)`,"g"),$6=/'/g,R6=/"/g,N6=/^(?:script|style|textarea|title)$/i,T6=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),Se=T6(1),dr=T6(2),ia=Symbol.for("lit-noChange"),Sr=Symbol.for("lit-nothing"),L6=new WeakMap,na=ta.createTreeWalker(ta,129,null,!1);function B6(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return M6!==void 0?M6.createHTML(e):e}const sN=(t,e)=>{const r=t.length-1,i=[];let n,s=e===2?"<svg>":"",a=Bu;for(let u=0;u<r;u++){const l=t[u];let d,b,w=-1,S=0;for(;S<l.length&&(a.lastIndex=S,b=a.exec(l),b!==null);)S=a.lastIndex,a===Bu?b[1]==="!--"?a=O6:b[1]!==void 0?a=P6:b[2]!==void 0?(N6.test(b[2])&&(n=RegExp("</"+b[2],"g")),a=ra):b[3]!==void 0&&(a=ra):a===ra?b[0]===">"?(a=n??Bu,w=-1):b[1]===void 0?w=-2:(w=a.lastIndex-b[2].length,d=b[1],a=b[3]===void 0?ra:b[3]==='"'?R6:$6):a===R6||a===$6?a=ra:a===O6||a===P6?a=Bu:(a=ra,n=void 0);const I=a===ra&&t[u+1].startsWith("/>")?" ":"";s+=a===Bu?l+iN:w>=0?(i.push(d),l.slice(0,w)+x1+l.slice(w)+uo+I):l+uo+(w===-2?(i.push(void 0),u):I)}return[B6(t,s+(t[r]||"<?>")+(e===2?"</svg>":"")),i]};class Fu{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,a=0;const u=e.length-1,l=this.parts,[d,b]=sN(e,r);if(this.el=Fu.createElement(d,i),na.currentNode=this.el.content,r===2){const w=this.el.content,S=w.firstChild;S.remove(),w.append(...S.childNodes)}for(;(n=na.nextNode())!==null&&l.length<u;){if(n.nodeType===1){if(n.hasAttributes()){const w=[];for(const S of n.getAttributeNames())if(S.endsWith(x1)||S.startsWith(uo)){const I=b[a++];if(w.push(S),I!==void 0){const D=n.getAttribute(I.toLowerCase()+x1).split(uo),L=/([.?@])?(.*)/.exec(I);l.push({type:1,index:s,name:L[2],strings:D,ctor:L[1]==="."?aN:L[1]==="?"?uN:L[1]==="@"?fN:jh})}else l.push({type:6,index:s})}for(const S of w)n.removeAttribute(S)}if(N6.test(n.tagName)){const w=n.textContent.split(uo),S=w.length-1;if(S>0){n.textContent=dc?dc.emptyScript:"";for(let I=0;I<S;I++)n.append(w[I],Tu()),na.nextNode(),l.push({type:2,index:++s});n.append(w[S],Tu())}}}else if(n.nodeType===8)if(n.data===C6)l.push({type:2,index:s});else{let w=-1;for(;(w=n.data.indexOf(uo,w+1))!==-1;)l.push({type:7,index:s}),w+=uo.length-1}s++}}static createElement(e,r){const i=ta.createElement("template");return i.innerHTML=e,i}}function pc(t,e,r=t,i){var n,s,a,u;if(e===ia)return e;let l=i!==void 0?(n=r._$Co)===null||n===void 0?void 0:n[i]:r._$Cl;const d=Lu(e)?void 0:e._$litDirective$;return l?.constructor!==d&&((s=l?._$AO)===null||s===void 0||s.call(l,!1),d===void 0?l=void 0:(l=new d(t),l._$AT(t,r,i)),i!==void 0?((a=(u=r)._$Co)!==null&&a!==void 0?a:u._$Co=[])[i]=l:r._$Cl=l),l!==void 0&&(e=pc(t,l._$AS(t,e.values),l,i)),e}class oN{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;const{el:{content:i},parts:n}=this._$AD,s=((r=e?.creationScope)!==null&&r!==void 0?r:ta).importNode(i,!0);na.currentNode=s;let a=na.nextNode(),u=0,l=0,d=n[0];for(;d!==void 0;){if(u===d.index){let b;d.type===2?b=new Uu(a,a.nextSibling,this,e):d.type===1?b=new d.ctor(a,d.name,d.strings,this,e):d.type===6&&(b=new hN(a,this,e)),this._$AV.push(b),d=n[++l]}u!==d?.index&&(a=na.nextNode(),u++)}return na.currentNode=ta,s}v(e){let r=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}}class Uu{constructor(e,r,i,n){var s;this.type=2,this._$AH=Sr,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cp=(s=n?.isConnected)===null||s===void 0||s}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=pc(this,e,r),Lu(e)?e===Sr||e==null||e===""?(this._$AH!==Sr&&this._$AR(),this._$AH=Sr):e!==this._$AH&&e!==ia&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):nN(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Sr&&Lu(this._$AH)?this._$AA.nextSibling.data=e:this.$(ta.createTextNode(e)),this._$AH=e}g(e){var r;const{values:i,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Fu.createElement(B6(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===s)this._$AH.v(i);else{const a=new oN(s,this),u=a.u(this.options);a.v(i),this.$(u),this._$AH=a}}_$AC(e){let r=L6.get(e.strings);return r===void 0&&L6.set(e.strings,r=new Fu(e)),r}T(e){D6(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let i,n=0;for(const s of e)n===r.length?r.push(i=new Uu(this.k(Tu()),this.k(Tu()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,r);e&&e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class jh{constructor(e,r,i,n,s){this.type=1,this._$AH=Sr,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Sr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){const s=this.strings;let a=!1;if(s===void 0)e=pc(this,e,r,0),a=!Lu(e)||e!==this._$AH&&e!==ia,a&&(this._$AH=e);else{const u=e;let l,d;for(e=s[0],l=0;l<s.length-1;l++)d=pc(this,u[i+l],r,l),d===ia&&(d=this._$AH[l]),a||(a=!Lu(d)||d!==this._$AH[l]),d===Sr?e=Sr:e!==Sr&&(e+=(d??"")+s[l+1]),this._$AH[l]=d}a&&!n&&this.j(e)}j(e){e===Sr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class aN extends jh{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Sr?void 0:e}}const cN=dc?dc.emptyScript:"";class uN extends jh{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Sr?this.element.setAttribute(this.name,cN):this.element.removeAttribute(this.name)}}class fN extends jh{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){var i;if((e=(i=pc(this,e,r,0))!==null&&i!==void 0?i:Sr)===ia)return;const n=this._$AH,s=e===Sr&&n!==Sr||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,a=e!==Sr&&(n===Sr||s);s&&this.element.removeEventListener(this.name,this,n),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,i;typeof this._$AH=="function"?this._$AH.call((i=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}}class hN{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){pc(this,e)}}const F6=kh.litHtmlPolyfillSupport;F6?.(Fu,Uu),((A1=kh.litHtmlVersions)!==null&&A1!==void 0?A1:kh.litHtmlVersions=[]).push("2.8.0");const lN=(t,e,r)=>{var i,n;const s=(i=r?.renderBefore)!==null&&i!==void 0?i:e;let a=s._$litPart$;if(a===void 0){const u=(n=r?.renderBefore)!==null&&n!==void 0?n:null;s._$litPart$=a=new Uu(e.insertBefore(Tu(),u),u,void 0,r??{})}return a._$AI(t),a};/**
81
+ */var A1;const jh=window,dc=jh.trustedTypes,S6=dc?dc.createPolicy("lit-html",{createHTML:t=>t}):void 0,x1="$lit$",uo=`lit$${(Math.random()+"").slice(9)}$`,I6="?"+uo,GR=`<${I6}>`,ta=document,Tu=()=>ta.createComment(""),Lu=t=>t===null||typeof t!="object"&&typeof t!="function",M6=Array.isArray,YR=t=>M6(t)||typeof t?.[Symbol.iterator]=="function",S1=`[
82
+ \f\r]`,Bu=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,C6=/-->/g,D6=/>/g,ra=RegExp(`>|${S1}(?:([^\\s"'>=/]+)(${S1}*=${S1}*(?:[^
83
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),O6=/'/g,P6=/"/g,$6=/^(?:script|style|textarea|title)$/i,R6=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),Se=R6(1),dr=R6(2),ia=Symbol.for("lit-noChange"),Sr=Symbol.for("lit-nothing"),N6=new WeakMap,na=ta.createTreeWalker(ta,129,null,!1);function T6(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return S6!==void 0?S6.createHTML(e):e}const JR=(t,e)=>{const r=t.length-1,i=[];let n,s=e===2?"<svg>":"",a=Bu;for(let u=0;u<r;u++){const l=t[u];let d,b,w=-1,I=0;for(;I<l.length&&(a.lastIndex=I,b=a.exec(l),b!==null);)I=a.lastIndex,a===Bu?b[1]==="!--"?a=C6:b[1]!==void 0?a=D6:b[2]!==void 0?($6.test(b[2])&&(n=RegExp("</"+b[2],"g")),a=ra):b[3]!==void 0&&(a=ra):a===ra?b[0]===">"?(a=n??Bu,w=-1):b[1]===void 0?w=-2:(w=a.lastIndex-b[2].length,d=b[1],a=b[3]===void 0?ra:b[3]==='"'?P6:O6):a===P6||a===O6?a=ra:a===C6||a===D6?a=Bu:(a=ra,n=void 0);const S=a===ra&&t[u+1].startsWith("/>")?" ":"";s+=a===Bu?l+GR:w>=0?(i.push(d),l.slice(0,w)+x1+l.slice(w)+uo+S):l+uo+(w===-2?(i.push(void 0),u):S)}return[T6(t,s+(t[r]||"<?>")+(e===2?"</svg>":"")),i]};class Fu{constructor({strings:e,_$litType$:r},i){let n;this.parts=[];let s=0,a=0;const u=e.length-1,l=this.parts,[d,b]=JR(e,r);if(this.el=Fu.createElement(d,i),na.currentNode=this.el.content,r===2){const w=this.el.content,I=w.firstChild;I.remove(),w.append(...I.childNodes)}for(;(n=na.nextNode())!==null&&l.length<u;){if(n.nodeType===1){if(n.hasAttributes()){const w=[];for(const I of n.getAttributeNames())if(I.endsWith(x1)||I.startsWith(uo)){const S=b[a++];if(w.push(I),S!==void 0){const D=n.getAttribute(S.toLowerCase()+x1).split(uo),L=/([.?@])?(.*)/.exec(S);l.push({type:1,index:s,name:L[2],strings:D,ctor:L[1]==="."?ZR:L[1]==="?"?eN:L[1]==="@"?tN:qh})}else l.push({type:6,index:s})}for(const I of w)n.removeAttribute(I)}if($6.test(n.tagName)){const w=n.textContent.split(uo),I=w.length-1;if(I>0){n.textContent=dc?dc.emptyScript:"";for(let S=0;S<I;S++)n.append(w[S],Tu()),na.nextNode(),l.push({type:2,index:++s});n.append(w[I],Tu())}}}else if(n.nodeType===8)if(n.data===I6)l.push({type:2,index:s});else{let w=-1;for(;(w=n.data.indexOf(uo,w+1))!==-1;)l.push({type:7,index:s}),w+=uo.length-1}s++}}static createElement(e,r){const i=ta.createElement("template");return i.innerHTML=e,i}}function pc(t,e,r=t,i){var n,s,a,u;if(e===ia)return e;let l=i!==void 0?(n=r._$Co)===null||n===void 0?void 0:n[i]:r._$Cl;const d=Lu(e)?void 0:e._$litDirective$;return l?.constructor!==d&&((s=l?._$AO)===null||s===void 0||s.call(l,!1),d===void 0?l=void 0:(l=new d(t),l._$AT(t,r,i)),i!==void 0?((a=(u=r)._$Co)!==null&&a!==void 0?a:u._$Co=[])[i]=l:r._$Cl=l),l!==void 0&&(e=pc(t,l._$AS(t,e.values),l,i)),e}class QR{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var r;const{el:{content:i},parts:n}=this._$AD,s=((r=e?.creationScope)!==null&&r!==void 0?r:ta).importNode(i,!0);na.currentNode=s;let a=na.nextNode(),u=0,l=0,d=n[0];for(;d!==void 0;){if(u===d.index){let b;d.type===2?b=new Uu(a,a.nextSibling,this,e):d.type===1?b=new d.ctor(a,d.name,d.strings,this,e):d.type===6&&(b=new rN(a,this,e)),this._$AV.push(b),d=n[++l]}u!==d?.index&&(a=na.nextNode(),u++)}return na.currentNode=ta,s}v(e){let r=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(e,i,r),r+=i.strings.length-2):i._$AI(e[r])),r++}}class Uu{constructor(e,r,i,n){var s;this.type=2,this._$AH=Sr,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=i,this.options=n,this._$Cp=(s=n?.isConnected)===null||s===void 0||s}get _$AU(){var e,r;return(r=(e=this._$AM)===null||e===void 0?void 0:e._$AU)!==null&&r!==void 0?r:this._$Cp}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&e?.nodeType===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=pc(this,e,r),Lu(e)?e===Sr||e==null||e===""?(this._$AH!==Sr&&this._$AR(),this._$AH=Sr):e!==this._$AH&&e!==ia&&this._(e):e._$litType$!==void 0?this.g(e):e.nodeType!==void 0?this.$(e):YR(e)?this.T(e):this._(e)}k(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}$(e){this._$AH!==e&&(this._$AR(),this._$AH=this.k(e))}_(e){this._$AH!==Sr&&Lu(this._$AH)?this._$AA.nextSibling.data=e:this.$(ta.createTextNode(e)),this._$AH=e}g(e){var r;const{values:i,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Fu.createElement(T6(n.h,n.h[0]),this.options)),n);if(((r=this._$AH)===null||r===void 0?void 0:r._$AD)===s)this._$AH.v(i);else{const a=new QR(s,this),u=a.u(this.options);a.v(i),this.$(u),this._$AH=a}}_$AC(e){let r=N6.get(e.strings);return r===void 0&&N6.set(e.strings,r=new Fu(e)),r}T(e){M6(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let i,n=0;for(const s of e)n===r.length?r.push(i=new Uu(this.k(Tu()),this.k(Tu()),this,this.options)):i=r[n],i._$AI(s),n++;n<r.length&&(this._$AR(i&&i._$AB.nextSibling,n),r.length=n)}_$AR(e=this._$AA.nextSibling,r){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,r);e&&e!==this._$AB;){const n=e.nextSibling;e.remove(),e=n}}setConnected(e){var r;this._$AM===void 0&&(this._$Cp=e,(r=this._$AP)===null||r===void 0||r.call(this,e))}}class qh{constructor(e,r,i,n,s){this.type=1,this._$AH=Sr,this._$AN=void 0,this.element=e,this.name=r,this._$AM=n,this.options=s,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=Sr}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,r=this,i,n){const s=this.strings;let a=!1;if(s===void 0)e=pc(this,e,r,0),a=!Lu(e)||e!==this._$AH&&e!==ia,a&&(this._$AH=e);else{const u=e;let l,d;for(e=s[0],l=0;l<s.length-1;l++)d=pc(this,u[i+l],r,l),d===ia&&(d=this._$AH[l]),a||(a=!Lu(d)||d!==this._$AH[l]),d===Sr?e=Sr:e!==Sr&&(e+=(d??"")+s[l+1]),this._$AH[l]=d}a&&!n&&this.j(e)}j(e){e===Sr?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class ZR extends qh{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===Sr?void 0:e}}const XR=dc?dc.emptyScript:"";class eN extends qh{constructor(){super(...arguments),this.type=4}j(e){e&&e!==Sr?this.element.setAttribute(this.name,XR):this.element.removeAttribute(this.name)}}class tN extends qh{constructor(e,r,i,n,s){super(e,r,i,n,s),this.type=5}_$AI(e,r=this){var i;if((e=(i=pc(this,e,r,0))!==null&&i!==void 0?i:Sr)===ia)return;const n=this._$AH,s=e===Sr&&n!==Sr||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,a=e!==Sr&&(n===Sr||s);s&&this.element.removeEventListener(this.name,this,n),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r,i;typeof this._$AH=="function"?this._$AH.call((i=(r=this.options)===null||r===void 0?void 0:r.host)!==null&&i!==void 0?i:this.element,e):this._$AH.handleEvent(e)}}class rN{constructor(e,r,i){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(e){pc(this,e)}}const L6=jh.litHtmlPolyfillSupport;L6?.(Fu,Uu),((A1=jh.litHtmlVersions)!==null&&A1!==void 0?A1:jh.litHtmlVersions=[]).push("2.8.0");const iN=(t,e,r)=>{var i,n;const s=(i=r?.renderBefore)!==null&&i!==void 0?i:e;let a=s._$litPart$;if(a===void 0){const u=(n=r?.renderBefore)!==null&&n!==void 0?n:null;s._$litPart$=a=new Uu(e.insertBefore(Tu(),u),u,void 0,r??{})}return a._$AI(t),a};/**
84
84
  * @license
85
85
  * Copyright 2017 Google LLC
86
86
  * SPDX-License-Identifier: BSD-3-Clause
87
- */var I1,M1;class Ct extends lc{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=lN(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return ia}}Ct.finalized=!0,Ct._$litElement$=!0,(I1=globalThis.litElementHydrateSupport)===null||I1===void 0||I1.call(globalThis,{LitElement:Ct});const U6=globalThis.litElementPolyfillSupport;U6?.({LitElement:Ct}),((M1=globalThis.litElementVersions)!==null&&M1!==void 0?M1:globalThis.litElementVersions=[]).push("3.3.3");/**
87
+ */var I1,M1;class Ct extends lc{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,r;const i=super.createRenderRoot();return(e=(r=this.renderOptions).renderBefore)!==null&&e!==void 0||(r.renderBefore=i.firstChild),i}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=iN(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)===null||e===void 0||e.setConnected(!1)}render(){return ia}}Ct.finalized=!0,Ct._$litElement$=!0,(I1=globalThis.litElementHydrateSupport)===null||I1===void 0||I1.call(globalThis,{LitElement:Ct});const B6=globalThis.litElementPolyfillSupport;B6?.({LitElement:Ct}),((M1=globalThis.litElementVersions)!==null&&M1!==void 0?M1:globalThis.litElementVersions=[]).push("3.3.3");/**
88
88
  * @license
89
89
  * Copyright 2017 Google LLC
90
90
  * SPDX-License-Identifier: BSD-3-Clause
@@ -92,7 +92,7 @@ function print() { __p += __j.call(arguments, '') }
92
92
  * @license
93
93
  * Copyright 2017 Google LLC
94
94
  * SPDX-License-Identifier: BSD-3-Clause
95
- */const dN=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},pN=(t,e,r)=>{e.constructor.createProperty(r,t)};function At(t){return(e,r)=>r!==void 0?pN(t,e,r):dN(t,e)}/**
95
+ */const nN=(t,e)=>e.kind==="method"&&e.descriptor&&!("value"in e.descriptor)?{...e,finisher(r){r.createProperty(e.key,t)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:e.key,initializer(){typeof e.initializer=="function"&&(this[e.key]=e.initializer.call(this))},finisher(r){r.createProperty(e.key,t)}},sN=(t,e,r)=>{e.constructor.createProperty(r,t)};function At(t){return(e,r)=>r!==void 0?sN(t,e,r):nN(t,e)}/**
96
96
  * @license
97
97
  * Copyright 2017 Google LLC
98
98
  * SPDX-License-Identifier: BSD-3-Clause
@@ -104,20 +104,20 @@ function print() { __p += __j.call(arguments, '') }
104
104
  * @license
105
105
  * Copyright 2017 Google LLC
106
106
  * SPDX-License-Identifier: BSD-3-Clause
107
- */const gN={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},vN=t=>(...e)=>({_$litDirective$:t,values:e});class mN{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
107
+ */const oN={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},aN=t=>(...e)=>({_$litDirective$:t,values:e});class cN{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,i){this._$Ct=e,this._$AM=r,this._$Ci=i}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
108
108
  * @license
109
109
  * Copyright 2018 Google LLC
110
110
  * SPDX-License-Identifier: BSD-3-Clause
111
- */const Ls=vN(class extends mN{constructor(t){var e;if(super(t),t.type!==gN.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,i;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!(!((r=this.nt)===null||r===void 0)&&r.has(s))&&this.it.add(s);return this.render(e)}const n=t.element.classList;this.it.forEach(s=>{s in e||(n.remove(s),this.it.delete(s))});for(const s in e){const a=!!e[s];a===this.it.has(s)||!((i=this.nt)===null||i===void 0)&&i.has(s)||(a?(n.add(s),this.it.add(s)):(n.remove(s),this.it.delete(s)))}return ia}});function bN(t,e){t.indexOf(e)===-1&&t.push(e)}const k6=(t,e,r)=>Math.min(Math.max(r,t),e),rn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},qh=t=>typeof t=="number",gc=t=>Array.isArray(t)&&!qh(t[0]),yN=(t,e,r)=>{const i=e-t;return((r-t)%i+i)%i+t};function wN(t,e){return gc(t)?t[yN(0,t.length,e)]:t}const j6=(t,e,r)=>-r*t+r*e+t,q6=()=>{},fo=t=>t,D1=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function z6(t,e){const r=t[t.length-1];for(let i=1;i<=e;i++){const n=D1(0,e,i);t.push(j6(r,1,n))}}function _N(t){const e=[0];return z6(e,t-1),e}function EN(t,e=_N(t.length),r=fo){const i=t.length,n=i-e.length;return n>0&&z6(e,n),s=>{let a=0;for(;a<i-2&&!(s<e[a+1]);a++);let u=k6(0,1,D1(e[a],e[a+1],s));return u=wN(r,a)(u),j6(t[a],t[a+1],u)}}const H6=t=>Array.isArray(t)&&qh(t[0]),O1=t=>typeof t=="object"&&!!t.createAnimation,sa=t=>typeof t=="function",AN=t=>typeof t=="string",ku={ms:t=>t*1e3,s:t=>t/1e3},K6=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,xN=1e-7,SN=12;function IN(t,e,r,i,n){let s,a,u=0;do a=e+(r-e)/2,s=K6(a,i,n)-t,s>0?r=a:e=a;while(Math.abs(s)>xN&&++u<SN);return a}function ju(t,e,r,i){if(t===e&&r===i)return fo;const n=s=>IN(s,0,1,t,r);return s=>s===0||s===1?s:K6(n(s),e,i)}const MN=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const i=r*t,n=e==="end"?Math.floor(i):Math.ceil(i);return k6(0,1,n/t)},W6={ease:ju(.25,.1,.25,1),"ease-in":ju(.42,0,1,1),"ease-in-out":ju(.42,0,.58,1),"ease-out":ju(0,0,.58,1)},CN=/\((.*?)\)/;function V6(t){if(sa(t))return t;if(H6(t))return ju(...t);if(W6[t])return W6[t];if(t.startsWith("steps")){const e=CN.exec(t);if(e){const r=e[1].split(",");return MN(parseFloat(r[0]),r[1].trim())}}return fo}class G6{constructor(e,r=[0,1],{easing:i,duration:n=rn.duration,delay:s=rn.delay,endDelay:a=rn.endDelay,repeat:u=rn.repeat,offset:l,direction:d="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=fo,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((w,S)=>{this.resolve=w,this.reject=S}),i=i||rn.easing,O1(i)){const w=i.createAnimation(r);i=w.easing,r=w.keyframes||r,n=w.duration||n}this.repeat=u,this.easing=gc(i)?fo:V6(i),this.updateDuration(n);const b=EN(r,l,gc(i)?i.map(V6):fo);this.tick=w=>{var S;s=s;let I=0;this.pauseTime!==void 0?I=this.pauseTime:I=(w-this.startTime)*this.rate,this.t=I,I/=1e3,I=Math.max(I-s,0),this.playState==="finished"&&this.pauseTime===void 0&&(I=this.totalDuration);const D=I/this.duration;let L=Math.floor(D),K=D%1;!K&&D>=1&&(K=1),K===1&&L--;const H=L%2;(d==="reverse"||d==="alternate"&&H||d==="alternate-reverse"&&!H)&&(K=1-K);const U=I>=this.totalDuration?1:Math.min(K,1),W=b(this.easing(U));e(W),this.pauseTime===void 0&&(this.playState==="finished"||I>=this.totalDuration+a)?(this.playState="finished",(S=this.resolve)===null||S===void 0||S.call(this,W)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var P1=function(){};process.env.NODE_ENV!=="production"&&(P1=function(t,e){if(!t)throw new Error(e)});class DN{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const $1=new WeakMap;function Y6(t){return $1.has(t)||$1.set(t,{transforms:[],values:new Map}),$1.get(t)}function ON(t,e){return t.has(e)||t.set(e,new DN),t.get(e)}const PN=["","X","Y","Z"],$N=["translate","scale","rotate","skew"],zh={x:"translateX",y:"translateY",z:"translateZ"},J6={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},RN={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:J6,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:fo},skew:J6},qu=new Map,R1=t=>`--motion-${t}`,Hh=["x","y","z"];$N.forEach(t=>{PN.forEach(e=>{Hh.push(t+e),qu.set(R1(t+e),RN[t])})});const NN=(t,e)=>Hh.indexOf(t)-Hh.indexOf(e),TN=new Set(Hh),Q6=t=>TN.has(t),LN=(t,e)=>{zh[e]&&(e=zh[e]);const{transforms:r}=Y6(t);bN(r,e),t.style.transform=BN(r)},BN=t=>t.sort(NN).reduce(FN,"").trim(),FN=(t,e)=>`${t} ${e}(var(${R1(e)}))`,N1=t=>t.startsWith("--"),Z6=new Set;function UN(t){if(!Z6.has(t)){Z6.add(t);try{const{syntax:e,initialValue:r}=qu.has(t)?qu.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const T1=(t,e)=>document.createElement("div").animate(t,e),X6={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{T1({opacity:[1]})}catch{return!1}return!0},finished:()=>!!T1({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{T1({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},L1={},vc={};for(const t in X6)vc[t]=()=>(L1[t]===void 0&&(L1[t]=X6[t]()),L1[t]);const kN=.015,jN=(t,e)=>{let r="";const i=Math.round(e/kN);for(let n=0;n<i;n++)r+=t(D1(0,i-1,n))+", ";return r.substring(0,r.length-2)},ey=(t,e)=>sa(t)?vc.linearEasing()?`linear(${jN(t,e)})`:rn.easing:H6(t)?qN(t):t,qN=([t,e,r,i])=>`cubic-bezier(${t}, ${e}, ${r}, ${i})`;function zN(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const HN=t=>Array.isArray(t)?t:[t];function B1(t){return zh[t]&&(t=zh[t]),Q6(t)?R1(t):t}const Kh={get:(t,e)=>{e=B1(e);let r=N1(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const i=qu.get(e);i&&(r=i.initialValue)}return r},set:(t,e,r)=>{e=B1(e),N1(e)?t.style.setProperty(e,r):t.style[e]=r}};function ty(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function KN(t,e){var r;let i=e?.toDefaultUnit||fo;const n=t[t.length-1];if(AN(n)){const s=((r=n.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";s&&(i=a=>a+s)}return i}function WN(){return window.__MOTION_DEV_TOOLS_RECORD}function VN(t,e,r,i={},n){const s=WN(),a=i.record!==!1&&s;let u,{duration:l=rn.duration,delay:d=rn.delay,endDelay:b=rn.endDelay,repeat:w=rn.repeat,easing:S=rn.easing,persist:I=!1,direction:D,offset:L,allowWebkitAcceleration:K=!1}=i;const H=Y6(t),U=Q6(e);let W=vc.waapi();U&&LN(t,e);const R=B1(e),k=ON(H.values,R),z=qu.get(R);return ty(k.animation,!(O1(S)&&k.generator)&&i.record!==!1),()=>{const _=()=>{var re,T;return(T=(re=Kh.get(t,R))!==null&&re!==void 0?re:z?.initialValue)!==null&&T!==void 0?T:0};let B=zN(HN(r),_);const X=KN(B,z);if(O1(S)){const re=S.createAnimation(B,e!=="opacity",_,R,k);S=re.easing,B=re.keyframes||B,l=re.duration||l}if(N1(R)&&(vc.cssRegisterProperty()?UN(R):W=!1),U&&!vc.linearEasing()&&(sa(S)||gc(S)&&S.some(sa))&&(W=!1),W){z&&(B=B.map(y=>qh(y)?z.toDefaultUnit(y):y)),B.length===1&&(!vc.partialKeyframes()||a)&&B.unshift(_());const re={delay:ku.ms(d),duration:ku.ms(l),endDelay:ku.ms(b),easing:gc(S)?void 0:ey(S,l),direction:D,iterations:w+1,fill:"both"};u=t.animate({[R]:B,offset:L,easing:gc(S)?S.map(y=>ey(y,l)):void 0},re),u.finished||(u.finished=new Promise((y,f)=>{u.onfinish=y,u.oncancel=f}));const T=B[B.length-1];u.finished.then(()=>{I||(Kh.set(t,R,T),u.cancel())}).catch(q6),K||(u.playbackRate=1.000001)}else if(n&&U)B=B.map(re=>typeof re=="string"?parseFloat(re):re),B.length===1&&B.unshift(parseFloat(_())),u=new n(re=>{Kh.set(t,R,X?X(re):re)},B,Object.assign(Object.assign({},i),{duration:l,easing:S}));else{const re=B[B.length-1];Kh.set(t,R,z&&qh(re)?z.toDefaultUnit(re):re)}return a&&s(t,e,B,{duration:l,delay:d,easing:S,repeat:w,offset:L},"motion-one"),k.setAnimation(u),u}}const GN=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function ry(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const YN=t=>t(),iy=(t,e,r=rn.duration)=>new Proxy({animations:t.map(YN).filter(Boolean),duration:r,options:e},QN),JN=t=>t.animations[0],QN={get:(t,e)=>{const r=JN(t);switch(e){case"duration":return t.duration;case"currentTime":return ku.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(ZN)).catch(q6)),t.finished;case"stop":return()=>{t.animations.forEach(i=>ty(i))};case"forEachNative":return i=>{t.animations.forEach(n=>i(n,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(i=>i[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=ku.ms(r);case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=r;return!0}return!1}},ZN=t=>t.finished;function XN(t,e,r){return sa(t)?t(e,r):t}function eT(t){return function(r,i,n={}){r=ry(r);const s=r.length;P1(!!s,"No valid element provided."),P1(!!i,"No keyframes defined.");const a=[];for(let u=0;u<s;u++){const l=r[u];for(const d in i){const b=GN(n,d);b.delay=XN(b.delay,u,s);const w=VN(l,d,i[d],b,t);a.push(w)}}return iy(a,n,n.duration)}}const tT=eT(G6);function rT(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}typeof SuppressedError=="function"&&SuppressedError;const iT={any:0,all:1};function nT(t,e,{root:r,margin:i,amount:n="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=ry(t),a=new WeakMap,u=d=>{d.forEach(b=>{const w=a.get(b.target);if(b.isIntersecting!==!!w)if(b.isIntersecting){const S=e(b);sa(S)?a.set(b.target,S):l.unobserve(b.target)}else w&&(w(b),a.delete(b.target))})},l=new IntersectionObserver(u,{root:r,rootMargin:i,threshold:typeof n=="number"?n:iT[n]});return s.forEach(d=>l.observe(d)),()=>l.disconnect()}function F1(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function ny(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const sT={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:i={}})=>{const{once:n}=i,s=rT(i,["once"]);return nT(t,a=>{if(e(),ny(t,"viewenter",a),!n)return u=>{r(),ny(t,"viewleave",u)}},s)}},sy=(t,e,r)=>i=>{i.pointerType&&i.pointerType!=="mouse"||(r(),F1(t,e,i))};[...Object.keys({inView:sT,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const i=sy(t,"hoverstart",e),n=sy(t,"hoverend",r);return t.addEventListener("pointerenter",i),t.addEventListener("pointerleave",n),()=>{t.removeEventListener("pointerenter",i),t.removeEventListener("pointerleave",n)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const i=s=>{r(),F1(t,"pressend",s),window.removeEventListener("pointerup",i)},n=s=>{e(),F1(t,"pressstart",s),window.addEventListener("pointerup",i)};return t.addEventListener("pointerdown",n),()=>{t.removeEventListener("pointerdown",n),window.removeEventListener("pointerup",i)}}}})];function oT(t,e={}){return iy([()=>{const r=new G6(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function oa(t,e,r){return(sa(t)?oT:tT)(t,e,r)}/**
111
+ */const Ls=aN(class extends cN{constructor(t){var e;if(super(t),t.type!==oN.ATTRIBUTE||t.name!=="class"||((e=t.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){var r,i;if(this.it===void 0){this.it=new Set,t.strings!==void 0&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(s=>s!=="")));for(const s in e)e[s]&&!(!((r=this.nt)===null||r===void 0)&&r.has(s))&&this.it.add(s);return this.render(e)}const n=t.element.classList;this.it.forEach(s=>{s in e||(n.remove(s),this.it.delete(s))});for(const s in e){const a=!!e[s];a===this.it.has(s)||!((i=this.nt)===null||i===void 0)&&i.has(s)||(a?(n.add(s),this.it.add(s)):(n.remove(s),this.it.delete(s)))}return ia}});function uN(t,e){t.indexOf(e)===-1&&t.push(e)}const F6=(t,e,r)=>Math.min(Math.max(r,t),e),rn={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},zh=t=>typeof t=="number",gc=t=>Array.isArray(t)&&!zh(t[0]),fN=(t,e,r)=>{const i=e-t;return((r-t)%i+i)%i+t};function hN(t,e){return gc(t)?t[fN(0,t.length,e)]:t}const U6=(t,e,r)=>-r*t+r*e+t,k6=()=>{},fo=t=>t,D1=(t,e,r)=>e-t===0?1:(r-t)/(e-t);function j6(t,e){const r=t[t.length-1];for(let i=1;i<=e;i++){const n=D1(0,e,i);t.push(U6(r,1,n))}}function lN(t){const e=[0];return j6(e,t-1),e}function dN(t,e=lN(t.length),r=fo){const i=t.length,n=i-e.length;return n>0&&j6(e,n),s=>{let a=0;for(;a<i-2&&!(s<e[a+1]);a++);let u=F6(0,1,D1(e[a],e[a+1],s));return u=hN(r,a)(u),U6(t[a],t[a+1],u)}}const q6=t=>Array.isArray(t)&&zh(t[0]),O1=t=>typeof t=="object"&&!!t.createAnimation,sa=t=>typeof t=="function",pN=t=>typeof t=="string",ku={ms:t=>t*1e3,s:t=>t/1e3},z6=(t,e,r)=>(((1-3*r+3*e)*t+(3*r-6*e))*t+3*e)*t,gN=1e-7,vN=12;function mN(t,e,r,i,n){let s,a,u=0;do a=e+(r-e)/2,s=z6(a,i,n)-t,s>0?r=a:e=a;while(Math.abs(s)>gN&&++u<vN);return a}function ju(t,e,r,i){if(t===e&&r===i)return fo;const n=s=>mN(s,0,1,t,r);return s=>s===0||s===1?s:z6(n(s),e,i)}const bN=(t,e="end")=>r=>{r=e==="end"?Math.min(r,.999):Math.max(r,.001);const i=r*t,n=e==="end"?Math.floor(i):Math.ceil(i);return F6(0,1,n/t)},H6={ease:ju(.25,.1,.25,1),"ease-in":ju(.42,0,1,1),"ease-in-out":ju(.42,0,.58,1),"ease-out":ju(0,0,.58,1)},yN=/\((.*?)\)/;function K6(t){if(sa(t))return t;if(q6(t))return ju(...t);if(H6[t])return H6[t];if(t.startsWith("steps")){const e=yN.exec(t);if(e){const r=e[1].split(",");return bN(parseFloat(r[0]),r[1].trim())}}return fo}class W6{constructor(e,r=[0,1],{easing:i,duration:n=rn.duration,delay:s=rn.delay,endDelay:a=rn.endDelay,repeat:u=rn.repeat,offset:l,direction:d="normal"}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=fo,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((w,I)=>{this.resolve=w,this.reject=I}),i=i||rn.easing,O1(i)){const w=i.createAnimation(r);i=w.easing,r=w.keyframes||r,n=w.duration||n}this.repeat=u,this.easing=gc(i)?fo:K6(i),this.updateDuration(n);const b=dN(r,l,gc(i)?i.map(K6):fo);this.tick=w=>{var I;s=s;let S=0;this.pauseTime!==void 0?S=this.pauseTime:S=(w-this.startTime)*this.rate,this.t=S,S/=1e3,S=Math.max(S-s,0),this.playState==="finished"&&this.pauseTime===void 0&&(S=this.totalDuration);const D=S/this.duration;let L=Math.floor(D),K=D%1;!K&&D>=1&&(K=1),K===1&&L--;const H=L%2;(d==="reverse"||d==="alternate"&&H||d==="alternate-reverse"&&!H)&&(K=1-K);const U=S>=this.totalDuration?1:Math.min(K,1),W=b(this.easing(U));e(W),this.pauseTime===void 0&&(this.playState==="finished"||S>=this.totalDuration+a)?(this.playState="finished",(I=this.resolve)===null||I===void 0||I.call(this,W)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},this.play()}play(){const e=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(e=this.reject)===null||e===void 0||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){this.pauseTime!==void 0||this.rate===0?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var P1=function(){};process.env.NODE_ENV!=="production"&&(P1=function(t,e){if(!t)throw new Error(e)});class wN{setAnimation(e){this.animation=e,e?.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const $1=new WeakMap;function V6(t){return $1.has(t)||$1.set(t,{transforms:[],values:new Map}),$1.get(t)}function _N(t,e){return t.has(e)||t.set(e,new wN),t.get(e)}const EN=["","X","Y","Z"],AN=["translate","scale","rotate","skew"],Hh={x:"translateX",y:"translateY",z:"translateZ"},G6={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:t=>t+"deg"},xN={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:t=>t+"px"},rotate:G6,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:fo},skew:G6},qu=new Map,R1=t=>`--motion-${t}`,Kh=["x","y","z"];AN.forEach(t=>{EN.forEach(e=>{Kh.push(t+e),qu.set(R1(t+e),xN[t])})});const SN=(t,e)=>Kh.indexOf(t)-Kh.indexOf(e),IN=new Set(Kh),Y6=t=>IN.has(t),MN=(t,e)=>{Hh[e]&&(e=Hh[e]);const{transforms:r}=V6(t);uN(r,e),t.style.transform=CN(r)},CN=t=>t.sort(SN).reduce(DN,"").trim(),DN=(t,e)=>`${t} ${e}(var(${R1(e)}))`,N1=t=>t.startsWith("--"),J6=new Set;function ON(t){if(!J6.has(t)){J6.add(t);try{const{syntax:e,initialValue:r}=qu.has(t)?qu.get(t):{};CSS.registerProperty({name:t,inherits:!1,syntax:e,initialValue:r})}catch{}}}const T1=(t,e)=>document.createElement("div").animate(t,e),Q6={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{T1({opacity:[1]})}catch{return!1}return!0},finished:()=>!!T1({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{T1({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},L1={},vc={};for(const t in Q6)vc[t]=()=>(L1[t]===void 0&&(L1[t]=Q6[t]()),L1[t]);const PN=.015,$N=(t,e)=>{let r="";const i=Math.round(e/PN);for(let n=0;n<i;n++)r+=t(D1(0,i-1,n))+", ";return r.substring(0,r.length-2)},Z6=(t,e)=>sa(t)?vc.linearEasing()?`linear(${$N(t,e)})`:rn.easing:q6(t)?RN(t):t,RN=([t,e,r,i])=>`cubic-bezier(${t}, ${e}, ${r}, ${i})`;function NN(t,e){for(let r=0;r<t.length;r++)t[r]===null&&(t[r]=r?t[r-1]:e());return t}const TN=t=>Array.isArray(t)?t:[t];function B1(t){return Hh[t]&&(t=Hh[t]),Y6(t)?R1(t):t}const Wh={get:(t,e)=>{e=B1(e);let r=N1(e)?t.style.getPropertyValue(e):getComputedStyle(t)[e];if(!r&&r!==0){const i=qu.get(e);i&&(r=i.initialValue)}return r},set:(t,e,r)=>{e=B1(e),N1(e)?t.style.setProperty(e,r):t.style[e]=r}};function X6(t,e=!0){if(!(!t||t.playState==="finished"))try{t.stop?t.stop():(e&&t.commitStyles(),t.cancel())}catch{}}function LN(t,e){var r;let i=e?.toDefaultUnit||fo;const n=t[t.length-1];if(pN(n)){const s=((r=n.match(/(-?[\d.]+)([a-z%]*)/))===null||r===void 0?void 0:r[2])||"";s&&(i=a=>a+s)}return i}function BN(){return window.__MOTION_DEV_TOOLS_RECORD}function FN(t,e,r,i={},n){const s=BN(),a=i.record!==!1&&s;let u,{duration:l=rn.duration,delay:d=rn.delay,endDelay:b=rn.endDelay,repeat:w=rn.repeat,easing:I=rn.easing,persist:S=!1,direction:D,offset:L,allowWebkitAcceleration:K=!1}=i;const H=V6(t),U=Y6(e);let W=vc.waapi();U&&MN(t,e);const R=B1(e),k=_N(H.values,R),z=qu.get(R);return X6(k.animation,!(O1(I)&&k.generator)&&i.record!==!1),()=>{const _=()=>{var re,T;return(T=(re=Wh.get(t,R))!==null&&re!==void 0?re:z?.initialValue)!==null&&T!==void 0?T:0};let B=NN(TN(r),_);const X=LN(B,z);if(O1(I)){const re=I.createAnimation(B,e!=="opacity",_,R,k);I=re.easing,B=re.keyframes||B,l=re.duration||l}if(N1(R)&&(vc.cssRegisterProperty()?ON(R):W=!1),U&&!vc.linearEasing()&&(sa(I)||gc(I)&&I.some(sa))&&(W=!1),W){z&&(B=B.map(y=>zh(y)?z.toDefaultUnit(y):y)),B.length===1&&(!vc.partialKeyframes()||a)&&B.unshift(_());const re={delay:ku.ms(d),duration:ku.ms(l),endDelay:ku.ms(b),easing:gc(I)?void 0:Z6(I,l),direction:D,iterations:w+1,fill:"both"};u=t.animate({[R]:B,offset:L,easing:gc(I)?I.map(y=>Z6(y,l)):void 0},re),u.finished||(u.finished=new Promise((y,f)=>{u.onfinish=y,u.oncancel=f}));const T=B[B.length-1];u.finished.then(()=>{S||(Wh.set(t,R,T),u.cancel())}).catch(k6),K||(u.playbackRate=1.000001)}else if(n&&U)B=B.map(re=>typeof re=="string"?parseFloat(re):re),B.length===1&&B.unshift(parseFloat(_())),u=new n(re=>{Wh.set(t,R,X?X(re):re)},B,Object.assign(Object.assign({},i),{duration:l,easing:I}));else{const re=B[B.length-1];Wh.set(t,R,z&&zh(re)?z.toDefaultUnit(re):re)}return a&&s(t,e,B,{duration:l,delay:d,easing:I,repeat:w,offset:L},"motion-one"),k.setAnimation(u),u}}const UN=(t,e)=>t[e]?Object.assign(Object.assign({},t),t[e]):Object.assign({},t);function ey(t,e){var r;return typeof t=="string"?e?((r=e[t])!==null&&r!==void 0||(e[t]=document.querySelectorAll(t)),t=e[t]):t=document.querySelectorAll(t):t instanceof Element&&(t=[t]),Array.from(t||[])}const kN=t=>t(),ty=(t,e,r=rn.duration)=>new Proxy({animations:t.map(kN).filter(Boolean),duration:r,options:e},qN),jN=t=>t.animations[0],qN={get:(t,e)=>{const r=jN(t);switch(e){case"duration":return t.duration;case"currentTime":return ku.s(r?.[e]||0);case"playbackRate":case"playState":return r?.[e];case"finished":return t.finished||(t.finished=Promise.all(t.animations.map(zN)).catch(k6)),t.finished;case"stop":return()=>{t.animations.forEach(i=>X6(i))};case"forEachNative":return i=>{t.animations.forEach(n=>i(n,t))};default:return typeof r?.[e]>"u"?void 0:()=>t.animations.forEach(i=>i[e]())}},set:(t,e,r)=>{switch(e){case"currentTime":r=ku.ms(r);case"playbackRate":for(let i=0;i<t.animations.length;i++)t.animations[i][e]=r;return!0}return!1}},zN=t=>t.finished;function HN(t,e,r){return sa(t)?t(e,r):t}function KN(t){return function(r,i,n={}){r=ey(r);const s=r.length;P1(!!s,"No valid element provided."),P1(!!i,"No keyframes defined.");const a=[];for(let u=0;u<s;u++){const l=r[u];for(const d in i){const b=UN(n,d);b.delay=HN(b.delay,u,s);const w=FN(l,d,i[d],b,t);a.push(w)}}return ty(a,n,n.duration)}}const WN=KN(W6);function VN(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}typeof SuppressedError=="function"&&SuppressedError;const GN={any:0,all:1};function YN(t,e,{root:r,margin:i,amount:n="any"}={}){if(typeof IntersectionObserver>"u")return()=>{};const s=ey(t),a=new WeakMap,u=d=>{d.forEach(b=>{const w=a.get(b.target);if(b.isIntersecting!==!!w)if(b.isIntersecting){const I=e(b);sa(I)?a.set(b.target,I):l.unobserve(b.target)}else w&&(w(b),a.delete(b.target))})},l=new IntersectionObserver(u,{root:r,rootMargin:i,threshold:typeof n=="number"?n:GN[n]});return s.forEach(d=>l.observe(d)),()=>l.disconnect()}function F1(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEvent:r}}))}function ry(t,e,r){t.dispatchEvent(new CustomEvent(e,{detail:{originalEntry:r}}))}const JN={isActive:t=>!!t.inView,subscribe:(t,{enable:e,disable:r},{inViewOptions:i={}})=>{const{once:n}=i,s=VN(i,["once"]);return YN(t,a=>{if(e(),ry(t,"viewenter",a),!n)return u=>{r(),ry(t,"viewleave",u)}},s)}},iy=(t,e,r)=>i=>{i.pointerType&&i.pointerType!=="mouse"||(r(),F1(t,e,i))};[...Object.keys({inView:JN,hover:{isActive:t=>!!t.hover,subscribe:(t,{enable:e,disable:r})=>{const i=iy(t,"hoverstart",e),n=iy(t,"hoverend",r);return t.addEventListener("pointerenter",i),t.addEventListener("pointerleave",n),()=>{t.removeEventListener("pointerenter",i),t.removeEventListener("pointerleave",n)}}},press:{isActive:t=>!!t.press,subscribe:(t,{enable:e,disable:r})=>{const i=s=>{r(),F1(t,"pressend",s),window.removeEventListener("pointerup",i)},n=s=>{e(),F1(t,"pressstart",s),window.addEventListener("pointerup",i)};return t.addEventListener("pointerdown",n),()=>{t.removeEventListener("pointerdown",n),window.removeEventListener("pointerup",i)}}}})];function QN(t,e={}){return ty([()=>{const r=new W6(t,[0,1],e);return r.finished.catch(()=>{}),r}],e,e.duration)}function oa(t,e,r){return(sa(t)?QN:WN)(t,e,r)}/**
112
112
  * @license
113
113
  * Copyright 2018 Google LLC
114
114
  * SPDX-License-Identifier: BSD-3-Clause
115
- */const fi=t=>t??Sr;var zu={},aT=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},oy={},Ui={};let U1;const cT=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Ui.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},Ui.getSymbolTotalCodewords=function(e){return cT[e]},Ui.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Ui.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');U1=e},Ui.isKanjiModeEnabled=function(){return typeof U1<"u"},Ui.toSJIS=function(e){return U1(e)};var Wh={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(Wh);function ay(){this.buffer=[],this.length=0}ay.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var uT=ay;function Hu(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Hu.prototype.set=function(t,e,r,i){const n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)},Hu.prototype.get=function(t,e){return this.data[t*this.size+e]},Hu.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},Hu.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var fT=Hu,cy={};(function(t){const e=Ui.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const n=Math.floor(i/7)+2,s=e(i),a=s===145?26:Math.ceil((s-13)/(2*n-2))*2,u=[s-7];for(let l=1;l<n-1;l++)u[l]=u[l-1]-a;return u.push(6),u.reverse()},t.getPositions=function(i){const n=[],s=t.getRowColCoords(i),a=s.length;for(let u=0;u<a;u++)for(let l=0;l<a;l++)u===0&&l===0||u===0&&l===a-1||u===a-1&&l===0||n.push([s[u],s[l]]);return n}})(cy);var uy={};const hT=Ui.getSymbolSize,fy=7;uy.getPositions=function(e){const r=hT(e);return[[0,0],[r-fy,0],[0,r-fy]]};var hy={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){const s=n.size;let a=0,u=0,l=0,d=null,b=null;for(let w=0;w<s;w++){u=l=0,d=b=null;for(let S=0;S<s;S++){let I=n.get(w,S);I===d?u++:(u>=5&&(a+=e.N1+(u-5)),d=I,u=1),I=n.get(S,w),I===b?l++:(l>=5&&(a+=e.N1+(l-5)),b=I,l=1)}u>=5&&(a+=e.N1+(u-5)),l>=5&&(a+=e.N1+(l-5))}return a},t.getPenaltyN2=function(n){const s=n.size;let a=0;for(let u=0;u<s-1;u++)for(let l=0;l<s-1;l++){const d=n.get(u,l)+n.get(u,l+1)+n.get(u+1,l)+n.get(u+1,l+1);(d===4||d===0)&&a++}return a*e.N2},t.getPenaltyN3=function(n){const s=n.size;let a=0,u=0,l=0;for(let d=0;d<s;d++){u=l=0;for(let b=0;b<s;b++)u=u<<1&2047|n.get(d,b),b>=10&&(u===1488||u===93)&&a++,l=l<<1&2047|n.get(b,d),b>=10&&(l===1488||l===93)&&a++}return a*e.N3},t.getPenaltyN4=function(n){let s=0;const a=n.data.length;for(let l=0;l<a;l++)s+=n.data[l];return Math.abs(Math.ceil(s*100/a/5)-10)*e.N4};function r(i,n,s){switch(i){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(n,s){const a=s.size;for(let u=0;u<a;u++)for(let l=0;l<a;l++)s.isReserved(l,u)||s.xor(l,u,r(n,l,u))},t.getBestMask=function(n,s){const a=Object.keys(t.Patterns).length;let u=0,l=1/0;for(let d=0;d<a;d++){s(d),t.applyMask(d,n);const b=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(d,n),b<l&&(l=b,u=d)}return u}})(hy);var Vh={};const ho=Wh,Gh=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Yh=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Vh.getBlocksCount=function(e,r){switch(r){case ho.L:return Gh[(e-1)*4+0];case ho.M:return Gh[(e-1)*4+1];case ho.Q:return Gh[(e-1)*4+2];case ho.H:return Gh[(e-1)*4+3];default:return}},Vh.getTotalCodewordsCount=function(e,r){switch(r){case ho.L:return Yh[(e-1)*4+0];case ho.M:return Yh[(e-1)*4+1];case ho.Q:return Yh[(e-1)*4+2];case ho.H:return Yh[(e-1)*4+3];default:return}};var ly={},Jh={};const Ku=new Uint8Array(512),Qh=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)Ku[r]=e,Qh[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)Ku[r]=Ku[r-255]})(),Jh.log=function(e){if(e<1)throw new Error("log("+e+")");return Qh[e]},Jh.exp=function(e){return Ku[e]},Jh.mul=function(e,r){return e===0||r===0?0:Ku[Qh[e]+Qh[r]]},function(t){const e=Jh;t.mul=function(i,n){const s=new Uint8Array(i.length+n.length-1);for(let a=0;a<i.length;a++)for(let u=0;u<n.length;u++)s[a+u]^=e.mul(i[a],n[u]);return s},t.mod=function(i,n){let s=new Uint8Array(i);for(;s.length-n.length>=0;){const a=s[0];for(let l=0;l<n.length;l++)s[l]^=e.mul(n[l],a);let u=0;for(;u<s.length&&s[u]===0;)u++;s=s.slice(u)}return s},t.generateECPolynomial=function(i){let n=new Uint8Array([1]);for(let s=0;s<i;s++)n=t.mul(n,new Uint8Array([1,e.exp(s)]));return n}}(ly);const dy=ly;function k1(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}k1.prototype.initialize=function(e){this.degree=e,this.genPoly=dy.generateECPolynomial(this.degree)},k1.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const i=dy.mod(r,this.genPoly),n=this.degree-i.length;if(n>0){const s=new Uint8Array(this.degree);return s.set(i,n),s}return i};var lT=k1,py={},lo={},j1={};j1.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var vs={};const gy="[0-9]+",dT="[A-Z $%*+\\-./:]+";let Wu="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Wu=Wu.replace(/u/g,"\\u");const pT="(?:(?![A-Z0-9 $%*+\\-./:]|"+Wu+`)(?:.|[\r
116
- ]))+`;vs.KANJI=new RegExp(Wu,"g"),vs.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),vs.BYTE=new RegExp(pT,"g"),vs.NUMERIC=new RegExp(gy,"g"),vs.ALPHANUMERIC=new RegExp(dT,"g");const gT=new RegExp("^"+Wu+"$"),vT=new RegExp("^"+gy+"$"),mT=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");vs.testKanji=function(e){return gT.test(e)},vs.testNumeric=function(e){return vT.test(e)},vs.testAlphanumeric=function(e){return mT.test(e)},function(t){const e=j1,r=vs;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,a){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?s.ccBits[0]:a<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}t.from=function(s,a){if(t.isValid(s))return s;try{return i(s)}catch{return a}}}(lo),function(t){const e=Ui,r=Vh,i=Wh,n=lo,s=j1,a=7973,u=e.getBCHDigit(a);function l(S,I,D){for(let L=1;L<=40;L++)if(I<=t.getCapacity(L,D,S))return L}function d(S,I){return n.getCharCountIndicator(S,I)+4}function b(S,I){let D=0;return S.forEach(function(L){const K=d(L.mode,I);D+=K+L.getBitsLength()}),D}function w(S,I){for(let D=1;D<=40;D++)if(b(S,D)<=t.getCapacity(D,I,n.MIXED))return D}t.from=function(I,D){return s.isValid(I)?parseInt(I,10):D},t.getCapacity=function(I,D,L){if(!s.isValid(I))throw new Error("Invalid QR Code version");typeof L>"u"&&(L=n.BYTE);const K=e.getSymbolTotalCodewords(I),H=r.getTotalCodewordsCount(I,D),U=(K-H)*8;if(L===n.MIXED)return U;const W=U-d(L,I);switch(L){case n.NUMERIC:return Math.floor(W/10*3);case n.ALPHANUMERIC:return Math.floor(W/11*2);case n.KANJI:return Math.floor(W/13);case n.BYTE:default:return Math.floor(W/8)}},t.getBestVersionForData=function(I,D){let L;const K=i.from(D,i.M);if(Array.isArray(I)){if(I.length>1)return w(I,K);if(I.length===0)return 1;L=I[0]}else L=I;return l(L.mode,L.getLength(),K)},t.getEncodedBits=function(I){if(!s.isValid(I)||I<7)throw new Error("Invalid QR Code version");let D=I<<12;for(;e.getBCHDigit(D)-u>=0;)D^=a<<e.getBCHDigit(D)-u;return I<<12|D}}(py);var vy={};const q1=Ui,my=1335,bT=21522,by=q1.getBCHDigit(my);vy.getEncodedBits=function(e,r){const i=e.bit<<3|r;let n=i<<10;for(;q1.getBCHDigit(n)-by>=0;)n^=my<<q1.getBCHDigit(n)-by;return(i<<10|n)^bT};var yy={};const yT=lo;function mc(t){this.mode=yT.NUMERIC,this.data=t.toString()}mc.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},mc.prototype.getLength=function(){return this.data.length},mc.prototype.getBitsLength=function(){return mc.getBitsLength(this.data.length)},mc.prototype.write=function(e){let r,i,n;for(r=0;r+3<=this.data.length;r+=3)i=this.data.substr(r,3),n=parseInt(i,10),e.put(n,10);const s=this.data.length-r;s>0&&(i=this.data.substr(r),n=parseInt(i,10),e.put(n,s*3+1))};var wT=mc;const _T=lo,z1=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function bc(t){this.mode=_T.ALPHANUMERIC,this.data=t}bc.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},bc.prototype.getLength=function(){return this.data.length},bc.prototype.getBitsLength=function(){return bc.getBitsLength(this.data.length)},bc.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let i=z1.indexOf(this.data[r])*45;i+=z1.indexOf(this.data[r+1]),e.put(i,11)}this.data.length%2&&e.put(z1.indexOf(this.data[r]),6)};var ET=bc,AT=function(e){for(var r=[],i=e.length,n=0;n<i;n++){var s=e.charCodeAt(n);if(s>=55296&&s<=56319&&i>n+1){var a=e.charCodeAt(n+1);a>=56320&&a<=57343&&(s=(s-55296)*1024+a-56320+65536,n+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const xT=AT,ST=lo;function yc(t){this.mode=ST.BYTE,typeof t=="string"&&(t=xT(t)),this.data=new Uint8Array(t)}yc.getBitsLength=function(e){return e*8},yc.prototype.getLength=function(){return this.data.length},yc.prototype.getBitsLength=function(){return yc.getBitsLength(this.data.length)},yc.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var IT=yc;const MT=lo,CT=Ui;function wc(t){this.mode=MT.KANJI,this.data=t}wc.getBitsLength=function(e){return e*13},wc.prototype.getLength=function(){return this.data.length},wc.prototype.getBitsLength=function(){return wc.getBitsLength(this.data.length)},wc.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=CT.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
117
- Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var DT=wc,wy={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,i,n){var s={},a={};a[i]=0;var u=e.PriorityQueue.make();u.push(i,0);for(var l,d,b,w,S,I,D,L,K;!u.empty();){l=u.pop(),d=l.value,w=l.cost,S=r[d]||{};for(b in S)S.hasOwnProperty(b)&&(I=S[b],D=w+I,L=a[b],K=typeof a[b]>"u",(K||L>D)&&(a[b]=D,u.push(b,D),s[b]=d))}if(typeof n<"u"&&typeof a[n]>"u"){var H=["Could not find a path from ",i," to ",n,"."].join("");throw new Error(H)}return s},extract_shortest_path_from_predecessor_list:function(r,i){for(var n=[],s=i;s;)n.push(s),r[s],s=r[s];return n.reverse(),n},find_path:function(r,i,n){var s=e.single_source_shortest_paths(r,i,n);return e.extract_shortest_path_from_predecessor_list(s,n)},PriorityQueue:{make:function(r){var i=e.PriorityQueue,n={},s;r=r||{};for(s in i)i.hasOwnProperty(s)&&(n[s]=i[s]);return n.queue=[],n.sorter=r.sorter||i.default_sorter,n},default_sorter:function(r,i){return r.cost-i.cost},push:function(r,i){var n={value:r,cost:i};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(wy),function(t){const e=lo,r=wT,i=ET,n=IT,s=DT,a=vs,u=Ui,l=wy.exports;function d(H){return unescape(encodeURIComponent(H)).length}function b(H,U,W){const R=[];let k;for(;(k=H.exec(W))!==null;)R.push({data:k[0],index:k.index,mode:U,length:k[0].length});return R}function w(H){const U=b(a.NUMERIC,e.NUMERIC,H),W=b(a.ALPHANUMERIC,e.ALPHANUMERIC,H);let R,k;return u.isKanjiModeEnabled()?(R=b(a.BYTE,e.BYTE,H),k=b(a.KANJI,e.KANJI,H)):(R=b(a.BYTE_KANJI,e.BYTE,H),k=[]),U.concat(W,R,k).sort(function(_,B){return _.index-B.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function S(H,U){switch(U){case e.NUMERIC:return r.getBitsLength(H);case e.ALPHANUMERIC:return i.getBitsLength(H);case e.KANJI:return s.getBitsLength(H);case e.BYTE:return n.getBitsLength(H)}}function I(H){return H.reduce(function(U,W){const R=U.length-1>=0?U[U.length-1]:null;return R&&R.mode===W.mode?(U[U.length-1].data+=W.data,U):(U.push(W),U)},[])}function D(H){const U=[];for(let W=0;W<H.length;W++){const R=H[W];switch(R.mode){case e.NUMERIC:U.push([R,{data:R.data,mode:e.ALPHANUMERIC,length:R.length},{data:R.data,mode:e.BYTE,length:R.length}]);break;case e.ALPHANUMERIC:U.push([R,{data:R.data,mode:e.BYTE,length:R.length}]);break;case e.KANJI:U.push([R,{data:R.data,mode:e.BYTE,length:d(R.data)}]);break;case e.BYTE:U.push([{data:R.data,mode:e.BYTE,length:d(R.data)}])}}return U}function L(H,U){const W={},R={start:{}};let k=["start"];for(let z=0;z<H.length;z++){const _=H[z],B=[];for(let X=0;X<_.length;X++){const re=_[X],T=""+z+X;B.push(T),W[T]={node:re,lastCount:0},R[T]={};for(let y=0;y<k.length;y++){const f=k[y];W[f]&&W[f].node.mode===re.mode?(R[f][T]=S(W[f].lastCount+re.length,re.mode)-S(W[f].lastCount,re.mode),W[f].lastCount+=re.length):(W[f]&&(W[f].lastCount=re.length),R[f][T]=S(re.length,re.mode)+4+e.getCharCountIndicator(re.mode,U))}}k=B}for(let z=0;z<k.length;z++)R[k[z]].end=0;return{map:R,table:W}}function K(H,U){let W;const R=e.getBestModeForData(H);if(W=e.from(U,R),W!==e.BYTE&&W.bit<R.bit)throw new Error('"'+H+'" cannot be encoded with mode '+e.toString(W)+`.
118
- Suggested mode is: `+e.toString(R));switch(W===e.KANJI&&!u.isKanjiModeEnabled()&&(W=e.BYTE),W){case e.NUMERIC:return new r(H);case e.ALPHANUMERIC:return new i(H);case e.KANJI:return new s(H);case e.BYTE:return new n(H)}}t.fromArray=function(U){return U.reduce(function(W,R){return typeof R=="string"?W.push(K(R,null)):R.data&&W.push(K(R.data,R.mode)),W},[])},t.fromString=function(U,W){const R=w(U,u.isKanjiModeEnabled()),k=D(R),z=L(k,W),_=l.find_path(z.map,"start","end"),B=[];for(let X=1;X<_.length-1;X++)B.push(z.table[_[X]].node);return t.fromArray(I(B))},t.rawSplit=function(U){return t.fromArray(w(U,u.isKanjiModeEnabled()))}}(yy);const Zh=Ui,H1=Wh,OT=uT,PT=fT,$T=cy,RT=uy,K1=hy,W1=Vh,NT=lT,Xh=py,TT=vy,LT=lo,V1=yy;function BT(t,e){const r=t.size,i=RT.getPositions(e);for(let n=0;n<i.length;n++){const s=i[n][0],a=i[n][1];for(let u=-1;u<=7;u++)if(!(s+u<=-1||r<=s+u))for(let l=-1;l<=7;l++)a+l<=-1||r<=a+l||(u>=0&&u<=6&&(l===0||l===6)||l>=0&&l<=6&&(u===0||u===6)||u>=2&&u<=4&&l>=2&&l<=4?t.set(s+u,a+l,!0,!0):t.set(s+u,a+l,!1,!0))}}function FT(t){const e=t.size;for(let r=8;r<e-8;r++){const i=r%2===0;t.set(r,6,i,!0),t.set(6,r,i,!0)}}function UT(t,e){const r=$T.getPositions(e);for(let i=0;i<r.length;i++){const n=r[i][0],s=r[i][1];for(let a=-2;a<=2;a++)for(let u=-2;u<=2;u++)a===-2||a===2||u===-2||u===2||a===0&&u===0?t.set(n+a,s+u,!0,!0):t.set(n+a,s+u,!1,!0)}}function kT(t,e){const r=t.size,i=Xh.getEncodedBits(e);let n,s,a;for(let u=0;u<18;u++)n=Math.floor(u/3),s=u%3+r-8-3,a=(i>>u&1)===1,t.set(n,s,a,!0),t.set(s,n,a,!0)}function G1(t,e,r){const i=t.size,n=TT.getEncodedBits(e,r);let s,a;for(s=0;s<15;s++)a=(n>>s&1)===1,s<6?t.set(s,8,a,!0):s<8?t.set(s+1,8,a,!0):t.set(i-15+s,8,a,!0),s<8?t.set(8,i-s-1,a,!0):s<9?t.set(8,15-s-1+1,a,!0):t.set(8,15-s-1,a,!0);t.set(i-8,8,1,!0)}function jT(t,e){const r=t.size;let i=-1,n=r-1,s=7,a=0;for(let u=r-1;u>0;u-=2)for(u===6&&u--;;){for(let l=0;l<2;l++)if(!t.isReserved(n,u-l)){let d=!1;a<e.length&&(d=(e[a]>>>s&1)===1),t.set(n,u-l,d),s--,s===-1&&(a++,s=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}function qT(t,e,r){const i=new OT;r.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),LT.getCharCountIndicator(l.mode,t)),l.write(i)});const n=Zh.getSymbolTotalCodewords(t),s=W1.getTotalCodewordsCount(t,e),a=(n-s)*8;for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const u=(a-i.getLengthInBits())/8;for(let l=0;l<u;l++)i.put(l%2?17:236,8);return zT(i,t,e)}function zT(t,e,r){const i=Zh.getSymbolTotalCodewords(e),n=W1.getTotalCodewordsCount(e,r),s=i-n,a=W1.getBlocksCount(e,r),u=i%a,l=a-u,d=Math.floor(i/a),b=Math.floor(s/a),w=b+1,S=d-b,I=new NT(S);let D=0;const L=new Array(a),K=new Array(a);let H=0;const U=new Uint8Array(t.buffer);for(let _=0;_<a;_++){const B=_<l?b:w;L[_]=U.slice(D,D+B),K[_]=I.encode(L[_]),D+=B,H=Math.max(H,B)}const W=new Uint8Array(i);let R=0,k,z;for(k=0;k<H;k++)for(z=0;z<a;z++)k<L[z].length&&(W[R++]=L[z][k]);for(k=0;k<S;k++)for(z=0;z<a;z++)W[R++]=K[z][k];return W}function HT(t,e,r,i){let n;if(Array.isArray(t))n=V1.fromArray(t);else if(typeof t=="string"){let d=e;if(!d){const b=V1.rawSplit(t);d=Xh.getBestVersionForData(b,r)}n=V1.fromString(t,d||40)}else throw new Error("Invalid data");const s=Xh.getBestVersionForData(n,r);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=s;else if(e<s)throw new Error(`
115
+ */const fi=t=>t??Sr;var zu={},ZN=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},ny={},Ui={};let U1;const XN=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Ui.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},Ui.getSymbolTotalCodewords=function(e){return XN[e]},Ui.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},Ui.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');U1=e},Ui.isKanjiModeEnabled=function(){return typeof U1<"u"},Ui.toSJIS=function(e){return U1(e)};var Vh={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+r)}}t.isValid=function(i){return i&&typeof i.bit<"u"&&i.bit>=0&&i.bit<4},t.from=function(i,n){if(t.isValid(i))return i;try{return e(i)}catch{return n}}})(Vh);function sy(){this.buffer=[],this.length=0}sy.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let r=0;r<e;r++)this.putBit((t>>>e-r-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var eT=sy;function Hu(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}Hu.prototype.set=function(t,e,r,i){const n=t*this.size+e;this.data[n]=r,i&&(this.reservedBit[n]=!0)},Hu.prototype.get=function(t,e){return this.data[t*this.size+e]},Hu.prototype.xor=function(t,e,r){this.data[t*this.size+e]^=r},Hu.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var tT=Hu,oy={};(function(t){const e=Ui.getSymbolSize;t.getRowColCoords=function(i){if(i===1)return[];const n=Math.floor(i/7)+2,s=e(i),a=s===145?26:Math.ceil((s-13)/(2*n-2))*2,u=[s-7];for(let l=1;l<n-1;l++)u[l]=u[l-1]-a;return u.push(6),u.reverse()},t.getPositions=function(i){const n=[],s=t.getRowColCoords(i),a=s.length;for(let u=0;u<a;u++)for(let l=0;l<a;l++)u===0&&l===0||u===0&&l===a-1||u===a-1&&l===0||n.push([s[u],s[l]]);return n}})(oy);var ay={};const rT=Ui.getSymbolSize,cy=7;ay.getPositions=function(e){const r=rT(e);return[[0,0],[r-cy,0],[0,r-cy]]};var uy={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},t.from=function(n){return t.isValid(n)?parseInt(n,10):void 0},t.getPenaltyN1=function(n){const s=n.size;let a=0,u=0,l=0,d=null,b=null;for(let w=0;w<s;w++){u=l=0,d=b=null;for(let I=0;I<s;I++){let S=n.get(w,I);S===d?u++:(u>=5&&(a+=e.N1+(u-5)),d=S,u=1),S=n.get(I,w),S===b?l++:(l>=5&&(a+=e.N1+(l-5)),b=S,l=1)}u>=5&&(a+=e.N1+(u-5)),l>=5&&(a+=e.N1+(l-5))}return a},t.getPenaltyN2=function(n){const s=n.size;let a=0;for(let u=0;u<s-1;u++)for(let l=0;l<s-1;l++){const d=n.get(u,l)+n.get(u,l+1)+n.get(u+1,l)+n.get(u+1,l+1);(d===4||d===0)&&a++}return a*e.N2},t.getPenaltyN3=function(n){const s=n.size;let a=0,u=0,l=0;for(let d=0;d<s;d++){u=l=0;for(let b=0;b<s;b++)u=u<<1&2047|n.get(d,b),b>=10&&(u===1488||u===93)&&a++,l=l<<1&2047|n.get(b,d),b>=10&&(l===1488||l===93)&&a++}return a*e.N3},t.getPenaltyN4=function(n){let s=0;const a=n.data.length;for(let l=0;l<a;l++)s+=n.data[l];return Math.abs(Math.ceil(s*100/a/5)-10)*e.N4};function r(i,n,s){switch(i){case t.Patterns.PATTERN000:return(n+s)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return s%3===0;case t.Patterns.PATTERN011:return(n+s)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(s/3))%2===0;case t.Patterns.PATTERN101:return n*s%2+n*s%3===0;case t.Patterns.PATTERN110:return(n*s%2+n*s%3)%2===0;case t.Patterns.PATTERN111:return(n*s%3+(n+s)%2)%2===0;default:throw new Error("bad maskPattern:"+i)}}t.applyMask=function(n,s){const a=s.size;for(let u=0;u<a;u++)for(let l=0;l<a;l++)s.isReserved(l,u)||s.xor(l,u,r(n,l,u))},t.getBestMask=function(n,s){const a=Object.keys(t.Patterns).length;let u=0,l=1/0;for(let d=0;d<a;d++){s(d),t.applyMask(d,n);const b=t.getPenaltyN1(n)+t.getPenaltyN2(n)+t.getPenaltyN3(n)+t.getPenaltyN4(n);t.applyMask(d,n),b<l&&(l=b,u=d)}return u}})(uy);var Gh={};const ho=Vh,Yh=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],Jh=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];Gh.getBlocksCount=function(e,r){switch(r){case ho.L:return Yh[(e-1)*4+0];case ho.M:return Yh[(e-1)*4+1];case ho.Q:return Yh[(e-1)*4+2];case ho.H:return Yh[(e-1)*4+3];default:return}},Gh.getTotalCodewordsCount=function(e,r){switch(r){case ho.L:return Jh[(e-1)*4+0];case ho.M:return Jh[(e-1)*4+1];case ho.Q:return Jh[(e-1)*4+2];case ho.H:return Jh[(e-1)*4+3];default:return}};var fy={},Qh={};const Ku=new Uint8Array(512),Zh=new Uint8Array(256);(function(){let e=1;for(let r=0;r<255;r++)Ku[r]=e,Zh[e]=r,e<<=1,e&256&&(e^=285);for(let r=255;r<512;r++)Ku[r]=Ku[r-255]})(),Qh.log=function(e){if(e<1)throw new Error("log("+e+")");return Zh[e]},Qh.exp=function(e){return Ku[e]},Qh.mul=function(e,r){return e===0||r===0?0:Ku[Zh[e]+Zh[r]]},function(t){const e=Qh;t.mul=function(i,n){const s=new Uint8Array(i.length+n.length-1);for(let a=0;a<i.length;a++)for(let u=0;u<n.length;u++)s[a+u]^=e.mul(i[a],n[u]);return s},t.mod=function(i,n){let s=new Uint8Array(i);for(;s.length-n.length>=0;){const a=s[0];for(let l=0;l<n.length;l++)s[l]^=e.mul(n[l],a);let u=0;for(;u<s.length&&s[u]===0;)u++;s=s.slice(u)}return s},t.generateECPolynomial=function(i){let n=new Uint8Array([1]);for(let s=0;s<i;s++)n=t.mul(n,new Uint8Array([1,e.exp(s)]));return n}}(fy);const hy=fy;function k1(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}k1.prototype.initialize=function(e){this.degree=e,this.genPoly=hy.generateECPolynomial(this.degree)},k1.prototype.encode=function(e){if(!this.genPoly)throw new Error("Encoder not initialized");const r=new Uint8Array(e.length+this.degree);r.set(e);const i=hy.mod(r,this.genPoly),n=this.degree-i.length;if(n>0){const s=new Uint8Array(this.degree);return s.set(i,n),s}return i};var iT=k1,ly={},lo={},j1={};j1.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40};var vs={};const dy="[0-9]+",nT="[A-Z $%*+\\-./:]+";let Wu="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Wu=Wu.replace(/u/g,"\\u");const sT="(?:(?![A-Z0-9 $%*+\\-./:]|"+Wu+`)(?:.|[\r
116
+ ]))+`;vs.KANJI=new RegExp(Wu,"g"),vs.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),vs.BYTE=new RegExp(sT,"g"),vs.NUMERIC=new RegExp(dy,"g"),vs.ALPHANUMERIC=new RegExp(nT,"g");const oT=new RegExp("^"+Wu+"$"),aT=new RegExp("^"+dy+"$"),cT=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");vs.testKanji=function(e){return oT.test(e)},vs.testNumeric=function(e){return aT.test(e)},vs.testAlphanumeric=function(e){return cT.test(e)},function(t){const e=j1,r=vs;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(s,a){if(!s.ccBits)throw new Error("Invalid mode: "+s);if(!e.isValid(a))throw new Error("Invalid version: "+a);return a>=1&&a<10?s.ccBits[0]:a<27?s.ccBits[1]:s.ccBits[2]},t.getBestModeForData=function(s){return r.testNumeric(s)?t.NUMERIC:r.testAlphanumeric(s)?t.ALPHANUMERIC:r.testKanji(s)?t.KANJI:t.BYTE},t.toString=function(s){if(s&&s.id)return s.id;throw new Error("Invalid mode")},t.isValid=function(s){return s&&s.bit&&s.ccBits};function i(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}t.from=function(s,a){if(t.isValid(s))return s;try{return i(s)}catch{return a}}}(lo),function(t){const e=Ui,r=Gh,i=Vh,n=lo,s=j1,a=7973,u=e.getBCHDigit(a);function l(I,S,D){for(let L=1;L<=40;L++)if(S<=t.getCapacity(L,D,I))return L}function d(I,S){return n.getCharCountIndicator(I,S)+4}function b(I,S){let D=0;return I.forEach(function(L){const K=d(L.mode,S);D+=K+L.getBitsLength()}),D}function w(I,S){for(let D=1;D<=40;D++)if(b(I,D)<=t.getCapacity(D,S,n.MIXED))return D}t.from=function(S,D){return s.isValid(S)?parseInt(S,10):D},t.getCapacity=function(S,D,L){if(!s.isValid(S))throw new Error("Invalid QR Code version");typeof L>"u"&&(L=n.BYTE);const K=e.getSymbolTotalCodewords(S),H=r.getTotalCodewordsCount(S,D),U=(K-H)*8;if(L===n.MIXED)return U;const W=U-d(L,S);switch(L){case n.NUMERIC:return Math.floor(W/10*3);case n.ALPHANUMERIC:return Math.floor(W/11*2);case n.KANJI:return Math.floor(W/13);case n.BYTE:default:return Math.floor(W/8)}},t.getBestVersionForData=function(S,D){let L;const K=i.from(D,i.M);if(Array.isArray(S)){if(S.length>1)return w(S,K);if(S.length===0)return 1;L=S[0]}else L=S;return l(L.mode,L.getLength(),K)},t.getEncodedBits=function(S){if(!s.isValid(S)||S<7)throw new Error("Invalid QR Code version");let D=S<<12;for(;e.getBCHDigit(D)-u>=0;)D^=a<<e.getBCHDigit(D)-u;return S<<12|D}}(ly);var py={};const q1=Ui,gy=1335,uT=21522,vy=q1.getBCHDigit(gy);py.getEncodedBits=function(e,r){const i=e.bit<<3|r;let n=i<<10;for(;q1.getBCHDigit(n)-vy>=0;)n^=gy<<q1.getBCHDigit(n)-vy;return(i<<10|n)^uT};var my={};const fT=lo;function mc(t){this.mode=fT.NUMERIC,this.data=t.toString()}mc.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},mc.prototype.getLength=function(){return this.data.length},mc.prototype.getBitsLength=function(){return mc.getBitsLength(this.data.length)},mc.prototype.write=function(e){let r,i,n;for(r=0;r+3<=this.data.length;r+=3)i=this.data.substr(r,3),n=parseInt(i,10),e.put(n,10);const s=this.data.length-r;s>0&&(i=this.data.substr(r),n=parseInt(i,10),e.put(n,s*3+1))};var hT=mc;const lT=lo,z1=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function bc(t){this.mode=lT.ALPHANUMERIC,this.data=t}bc.getBitsLength=function(e){return 11*Math.floor(e/2)+6*(e%2)},bc.prototype.getLength=function(){return this.data.length},bc.prototype.getBitsLength=function(){return bc.getBitsLength(this.data.length)},bc.prototype.write=function(e){let r;for(r=0;r+2<=this.data.length;r+=2){let i=z1.indexOf(this.data[r])*45;i+=z1.indexOf(this.data[r+1]),e.put(i,11)}this.data.length%2&&e.put(z1.indexOf(this.data[r]),6)};var dT=bc,pT=function(e){for(var r=[],i=e.length,n=0;n<i;n++){var s=e.charCodeAt(n);if(s>=55296&&s<=56319&&i>n+1){var a=e.charCodeAt(n+1);a>=56320&&a<=57343&&(s=(s-55296)*1024+a-56320+65536,n+=1)}if(s<128){r.push(s);continue}if(s<2048){r.push(s>>6|192),r.push(s&63|128);continue}if(s<55296||s>=57344&&s<65536){r.push(s>>12|224),r.push(s>>6&63|128),r.push(s&63|128);continue}if(s>=65536&&s<=1114111){r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(s&63|128);continue}r.push(239,191,189)}return new Uint8Array(r).buffer};const gT=pT,vT=lo;function yc(t){this.mode=vT.BYTE,typeof t=="string"&&(t=gT(t)),this.data=new Uint8Array(t)}yc.getBitsLength=function(e){return e*8},yc.prototype.getLength=function(){return this.data.length},yc.prototype.getBitsLength=function(){return yc.getBitsLength(this.data.length)},yc.prototype.write=function(t){for(let e=0,r=this.data.length;e<r;e++)t.put(this.data[e],8)};var mT=yc;const bT=lo,yT=Ui;function wc(t){this.mode=bT.KANJI,this.data=t}wc.getBitsLength=function(e){return e*13},wc.prototype.getLength=function(){return this.data.length},wc.prototype.getBitsLength=function(){return wc.getBitsLength(this.data.length)},wc.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let r=yT.toSJIS(this.data[e]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
117
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),t.put(r,13)}};var wT=wc,by={exports:{}};(function(t){var e={single_source_shortest_paths:function(r,i,n){var s={},a={};a[i]=0;var u=e.PriorityQueue.make();u.push(i,0);for(var l,d,b,w,I,S,D,L,K;!u.empty();){l=u.pop(),d=l.value,w=l.cost,I=r[d]||{};for(b in I)I.hasOwnProperty(b)&&(S=I[b],D=w+S,L=a[b],K=typeof a[b]>"u",(K||L>D)&&(a[b]=D,u.push(b,D),s[b]=d))}if(typeof n<"u"&&typeof a[n]>"u"){var H=["Could not find a path from ",i," to ",n,"."].join("");throw new Error(H)}return s},extract_shortest_path_from_predecessor_list:function(r,i){for(var n=[],s=i;s;)n.push(s),r[s],s=r[s];return n.reverse(),n},find_path:function(r,i,n){var s=e.single_source_shortest_paths(r,i,n);return e.extract_shortest_path_from_predecessor_list(s,n)},PriorityQueue:{make:function(r){var i=e.PriorityQueue,n={},s;r=r||{};for(s in i)i.hasOwnProperty(s)&&(n[s]=i[s]);return n.queue=[],n.sorter=r.sorter||i.default_sorter,n},default_sorter:function(r,i){return r.cost-i.cost},push:function(r,i){var n={value:r,cost:i};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(by),function(t){const e=lo,r=hT,i=dT,n=mT,s=wT,a=vs,u=Ui,l=by.exports;function d(H){return unescape(encodeURIComponent(H)).length}function b(H,U,W){const R=[];let k;for(;(k=H.exec(W))!==null;)R.push({data:k[0],index:k.index,mode:U,length:k[0].length});return R}function w(H){const U=b(a.NUMERIC,e.NUMERIC,H),W=b(a.ALPHANUMERIC,e.ALPHANUMERIC,H);let R,k;return u.isKanjiModeEnabled()?(R=b(a.BYTE,e.BYTE,H),k=b(a.KANJI,e.KANJI,H)):(R=b(a.BYTE_KANJI,e.BYTE,H),k=[]),U.concat(W,R,k).sort(function(_,B){return _.index-B.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function I(H,U){switch(U){case e.NUMERIC:return r.getBitsLength(H);case e.ALPHANUMERIC:return i.getBitsLength(H);case e.KANJI:return s.getBitsLength(H);case e.BYTE:return n.getBitsLength(H)}}function S(H){return H.reduce(function(U,W){const R=U.length-1>=0?U[U.length-1]:null;return R&&R.mode===W.mode?(U[U.length-1].data+=W.data,U):(U.push(W),U)},[])}function D(H){const U=[];for(let W=0;W<H.length;W++){const R=H[W];switch(R.mode){case e.NUMERIC:U.push([R,{data:R.data,mode:e.ALPHANUMERIC,length:R.length},{data:R.data,mode:e.BYTE,length:R.length}]);break;case e.ALPHANUMERIC:U.push([R,{data:R.data,mode:e.BYTE,length:R.length}]);break;case e.KANJI:U.push([R,{data:R.data,mode:e.BYTE,length:d(R.data)}]);break;case e.BYTE:U.push([{data:R.data,mode:e.BYTE,length:d(R.data)}])}}return U}function L(H,U){const W={},R={start:{}};let k=["start"];for(let z=0;z<H.length;z++){const _=H[z],B=[];for(let X=0;X<_.length;X++){const re=_[X],T=""+z+X;B.push(T),W[T]={node:re,lastCount:0},R[T]={};for(let y=0;y<k.length;y++){const f=k[y];W[f]&&W[f].node.mode===re.mode?(R[f][T]=I(W[f].lastCount+re.length,re.mode)-I(W[f].lastCount,re.mode),W[f].lastCount+=re.length):(W[f]&&(W[f].lastCount=re.length),R[f][T]=I(re.length,re.mode)+4+e.getCharCountIndicator(re.mode,U))}}k=B}for(let z=0;z<k.length;z++)R[k[z]].end=0;return{map:R,table:W}}function K(H,U){let W;const R=e.getBestModeForData(H);if(W=e.from(U,R),W!==e.BYTE&&W.bit<R.bit)throw new Error('"'+H+'" cannot be encoded with mode '+e.toString(W)+`.
118
+ Suggested mode is: `+e.toString(R));switch(W===e.KANJI&&!u.isKanjiModeEnabled()&&(W=e.BYTE),W){case e.NUMERIC:return new r(H);case e.ALPHANUMERIC:return new i(H);case e.KANJI:return new s(H);case e.BYTE:return new n(H)}}t.fromArray=function(U){return U.reduce(function(W,R){return typeof R=="string"?W.push(K(R,null)):R.data&&W.push(K(R.data,R.mode)),W},[])},t.fromString=function(U,W){const R=w(U,u.isKanjiModeEnabled()),k=D(R),z=L(k,W),_=l.find_path(z.map,"start","end"),B=[];for(let X=1;X<_.length-1;X++)B.push(z.table[_[X]].node);return t.fromArray(S(B))},t.rawSplit=function(U){return t.fromArray(w(U,u.isKanjiModeEnabled()))}}(my);const Xh=Ui,H1=Vh,_T=eT,ET=tT,AT=oy,xT=ay,K1=uy,W1=Gh,ST=iT,el=ly,IT=py,MT=lo,V1=my;function CT(t,e){const r=t.size,i=xT.getPositions(e);for(let n=0;n<i.length;n++){const s=i[n][0],a=i[n][1];for(let u=-1;u<=7;u++)if(!(s+u<=-1||r<=s+u))for(let l=-1;l<=7;l++)a+l<=-1||r<=a+l||(u>=0&&u<=6&&(l===0||l===6)||l>=0&&l<=6&&(u===0||u===6)||u>=2&&u<=4&&l>=2&&l<=4?t.set(s+u,a+l,!0,!0):t.set(s+u,a+l,!1,!0))}}function DT(t){const e=t.size;for(let r=8;r<e-8;r++){const i=r%2===0;t.set(r,6,i,!0),t.set(6,r,i,!0)}}function OT(t,e){const r=AT.getPositions(e);for(let i=0;i<r.length;i++){const n=r[i][0],s=r[i][1];for(let a=-2;a<=2;a++)for(let u=-2;u<=2;u++)a===-2||a===2||u===-2||u===2||a===0&&u===0?t.set(n+a,s+u,!0,!0):t.set(n+a,s+u,!1,!0)}}function PT(t,e){const r=t.size,i=el.getEncodedBits(e);let n,s,a;for(let u=0;u<18;u++)n=Math.floor(u/3),s=u%3+r-8-3,a=(i>>u&1)===1,t.set(n,s,a,!0),t.set(s,n,a,!0)}function G1(t,e,r){const i=t.size,n=IT.getEncodedBits(e,r);let s,a;for(s=0;s<15;s++)a=(n>>s&1)===1,s<6?t.set(s,8,a,!0):s<8?t.set(s+1,8,a,!0):t.set(i-15+s,8,a,!0),s<8?t.set(8,i-s-1,a,!0):s<9?t.set(8,15-s-1+1,a,!0):t.set(8,15-s-1,a,!0);t.set(i-8,8,1,!0)}function $T(t,e){const r=t.size;let i=-1,n=r-1,s=7,a=0;for(let u=r-1;u>0;u-=2)for(u===6&&u--;;){for(let l=0;l<2;l++)if(!t.isReserved(n,u-l)){let d=!1;a<e.length&&(d=(e[a]>>>s&1)===1),t.set(n,u-l,d),s--,s===-1&&(a++,s=7)}if(n+=i,n<0||r<=n){n-=i,i=-i;break}}}function RT(t,e,r){const i=new _T;r.forEach(function(l){i.put(l.mode.bit,4),i.put(l.getLength(),MT.getCharCountIndicator(l.mode,t)),l.write(i)});const n=Xh.getSymbolTotalCodewords(t),s=W1.getTotalCodewordsCount(t,e),a=(n-s)*8;for(i.getLengthInBits()+4<=a&&i.put(0,4);i.getLengthInBits()%8!==0;)i.putBit(0);const u=(a-i.getLengthInBits())/8;for(let l=0;l<u;l++)i.put(l%2?17:236,8);return NT(i,t,e)}function NT(t,e,r){const i=Xh.getSymbolTotalCodewords(e),n=W1.getTotalCodewordsCount(e,r),s=i-n,a=W1.getBlocksCount(e,r),u=i%a,l=a-u,d=Math.floor(i/a),b=Math.floor(s/a),w=b+1,I=d-b,S=new ST(I);let D=0;const L=new Array(a),K=new Array(a);let H=0;const U=new Uint8Array(t.buffer);for(let _=0;_<a;_++){const B=_<l?b:w;L[_]=U.slice(D,D+B),K[_]=S.encode(L[_]),D+=B,H=Math.max(H,B)}const W=new Uint8Array(i);let R=0,k,z;for(k=0;k<H;k++)for(z=0;z<a;z++)k<L[z].length&&(W[R++]=L[z][k]);for(k=0;k<I;k++)for(z=0;z<a;z++)W[R++]=K[z][k];return W}function TT(t,e,r,i){let n;if(Array.isArray(t))n=V1.fromArray(t);else if(typeof t=="string"){let d=e;if(!d){const b=V1.rawSplit(t);d=el.getBestVersionForData(b,r)}n=V1.fromString(t,d||40)}else throw new Error("Invalid data");const s=el.getBestVersionForData(n,r);if(!s)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=s;else if(e<s)throw new Error(`
119
119
  The chosen QR Code version cannot contain this amount of data.
120
120
  Minimum version required to store current data is: `+s+`.
121
- `);const a=qT(e,r,n),u=Zh.getSymbolSize(e),l=new PT(u);return BT(l,e),FT(l),UT(l,e),G1(l,r,0),e>=7&&kT(l,e),jT(l,a),isNaN(i)&&(i=K1.getBestMask(l,G1.bind(null,l,r))),K1.applyMask(i,l),G1(l,r,i),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:i,segments:n}}oy.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let i=H1.M,n,s;return typeof r<"u"&&(i=H1.from(r.errorCorrectionLevel,H1.M),n=Xh.from(r.version),s=K1.from(r.maskPattern),r.toSJISFunc&&Zh.setToSJISFunction(r.toSJISFunc)),HT(e,n,i,s)};var _y={},Y1={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let i=r.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+r);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(s){return[s,s]}))),i.length===6&&i.push("F","F");const n=parseInt(i.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+i.slice(0,6).join("")}}t.getOptions=function(i){i||(i={}),i.color||(i.color={});const n=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,s=i.width&&i.width>=21?i.width:void 0,a=i.scale||4;return{width:s,scale:s?4:a,margin:n,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,n){return n.width&&n.width>=i+n.margin*2?n.width/(i+n.margin*2):n.scale},t.getImageWidth=function(i,n){const s=t.getScale(i,n);return Math.floor((i+n.margin*2)*s)},t.qrToImageData=function(i,n,s){const a=n.modules.size,u=n.modules.data,l=t.getScale(a,s),d=Math.floor((a+s.margin*2)*l),b=s.margin*l,w=[s.color.light,s.color.dark];for(let S=0;S<d;S++)for(let I=0;I<d;I++){let D=(S*d+I)*4,L=s.color.light;if(S>=b&&I>=b&&S<d-b&&I<d-b){const K=Math.floor((S-b)/l),H=Math.floor((I-b)/l);L=w[u[K*a+H]?1:0]}i[D++]=L.r,i[D++]=L.g,i[D++]=L.b,i[D]=L.a}}})(Y1),function(t){const e=Y1;function r(n,s,a){n.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=a,s.width=a,s.style.height=a+"px",s.style.width=a+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,a,u){let l=u,d=a;typeof l>"u"&&(!a||!a.getContext)&&(l=a,a=void 0),a||(d=i()),l=e.getOptions(l);const b=e.getImageWidth(s.modules.size,l),w=d.getContext("2d"),S=w.createImageData(b,b);return e.qrToImageData(S.data,s,l),r(w,d,b),w.putImageData(S,0,0),d},t.renderToDataURL=function(s,a,u){let l=u;typeof l>"u"&&(!a||!a.getContext)&&(l=a,a=void 0),l||(l={});const d=t.render(s,a,l),b=l.type||"image/png",w=l.rendererOpts||{};return d.toDataURL(b,w.quality)}}(_y);var Ey={};const KT=Y1;function Ay(t,e){const r=t.a/255,i=e+'="'+t.hex+'"';return r<1?i+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function J1(t,e,r){let i=t+e;return typeof r<"u"&&(i+=" "+r),i}function WT(t,e,r){let i="",n=0,s=!1,a=0;for(let u=0;u<t.length;u++){const l=Math.floor(u%e),d=Math.floor(u/e);!l&&!s&&(s=!0),t[u]?(a++,u>0&&l>0&&t[u-1]||(i+=s?J1("M",l+r,.5+d+r):J1("m",n,0),n=0,s=!1),l+1<e&&t[u+1]||(i+=J1("h",a),a=0)):n++}return i}Ey.render=function(e,r,i){const n=KT.getOptions(r),s=e.modules.size,a=e.modules.data,u=s+n.margin*2,l=n.color.light.a?"<path "+Ay(n.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",d="<path "+Ay(n.color.dark,"stroke")+' d="'+WT(a,s,n.margin)+'"/>',b='viewBox="0 0 '+u+" "+u+'"',S='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+b+' shape-rendering="crispEdges">'+l+d+`</svg>
122
- `;return typeof i=="function"&&i(null,S),S};const VT=aT,Q1=oy,xy=_y,GT=Ey;function Z1(t,e,r,i,n){const s=[].slice.call(arguments,1),a=s.length,u=typeof s[a-1]=="function";if(!u&&!VT())throw new Error("Callback required as last argument");if(u){if(a<2)throw new Error("Too few arguments provided");a===2?(n=r,r=e,e=i=void 0):a===3&&(e.getContext&&typeof n>"u"?(n=i,i=void 0):(n=i,i=r,r=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(r=e,e=i=void 0):a===2&&!e.getContext&&(i=r,r=e,e=void 0),new Promise(function(l,d){try{const b=Q1.create(r,i);l(t(b,e,i))}catch(b){d(b)}})}try{const l=Q1.create(r,i);n(null,t(l,e,i))}catch(l){n(l)}}zu.create=Q1.create,zu.toCanvas=Z1.bind(null,xy.render),zu.toDataURL=Z1.bind(null,xy.renderToDataURL),zu.toString=Z1.bind(null,function(t,e,r){return GT.render(t,r)});var YT=Object.defineProperty,Sy=Object.getOwnPropertySymbols,JT=Object.prototype.hasOwnProperty,QT=Object.prototype.propertyIsEnumerable,Iy=(t,e,r)=>e in t?YT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,X1=(t,e)=>{for(var r in e||(e={}))JT.call(e,r)&&Iy(t,r,e[r]);if(Sy)for(var r of Sy(e))QT.call(e,r)&&Iy(t,r,e[r]);return t};function ZT(){var t;const e=(t=ao.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function My(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const Bt={getPreset(t){return My()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=ao.state;if(t){const r=X1(X1(X1({},ZT()),My()),e);Object.entries(r).forEach(([i,n])=>t.style.setProperty(i,n))}},globalCss:zt`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},XT=zt`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var eL=Object.defineProperty,tL=Object.getOwnPropertyDescriptor,_c=(t,e,r,i)=>{for(var n=i>1?void 0:i?tL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&eL(e,r,n),n};let po=class extends Ct{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),Se`<button class="${Ls(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};po.styles=[Bt.globalCss,XT],_c([At({type:Boolean})],po.prototype,"disabled",2),_c([At()],po.prototype,"iconLeft",2),_c([At()],po.prototype,"iconRight",2),_c([At()],po.prototype,"onClick",2),_c([At()],po.prototype,"variant",2),po=_c([kt("wcm-button")],po);const rL=zt`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var iL=Object.defineProperty,nL=Object.getOwnPropertyDescriptor,ep=(t,e,r,i)=>{for(var n=i>1?void 0:i?nL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&iL(e,r,n),n};let Vu=class extends Ct{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"wcm-secondary":this.variant==="secondary"};return Se`<button ?disabled="${this.disabled}" class="${Ls(t)}"><slot></slot></button>`}};Vu.styles=[Bt.globalCss,rL],ep([At({type:Boolean})],Vu.prototype,"disabled",2),ep([At()],Vu.prototype,"variant",2),Vu=ep([kt("wcm-button-big")],Vu);const sL=zt`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var oL=Object.defineProperty,aL=Object.getOwnPropertyDescriptor,cL=(t,e,r,i)=>{for(var n=i>1?void 0:i?aL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&oL(e,r,n),n};let tp=class extends Ct{render(){return Se`<div><slot></slot></div>`}};tp.styles=[Bt.globalCss,sL],tp=cL([kt("wcm-info-footer")],tp);const Wt={CROSS_ICON:dr`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:dr`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:dr`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:dr`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:dr`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:dr`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:dr`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:dr`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:dr`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:dr`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:dr`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:dr`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:dr`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:dr`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:dr`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,SEARCH_ICON:dr`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,WALLET_PLACEHOLDER:dr`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,GLOBE_ICON:dr`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},uL=zt`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var fL=Object.defineProperty,hL=Object.getOwnPropertyDescriptor,lL=(t,e,r,i)=>{for(var n=i>1?void 0:i?hL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&fL(e,r,n),n};let rp=class extends Ct{render(){return Se`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${Wt.WALLET_CONNECT_LOGO} <button @click="${Xo.close}">${Wt.CROSS_ICON}</button></div>`}};rp.styles=[Bt.globalCss,uL],rp=lL([kt("wcm-modal-backcard")],rp);const dL=zt`main{padding:20px;padding-top:0;width:100%}`;var pL=Object.defineProperty,gL=Object.getOwnPropertyDescriptor,vL=(t,e,r,i)=>{for(var n=i>1?void 0:i?gL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&pL(e,r,n),n};let ip=class extends Ct{render(){return Se`<main><slot></slot></main>`}};ip.styles=[Bt.globalCss,dL],ip=vL([kt("wcm-modal-content")],ip);const mL=zt`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var bL=Object.defineProperty,yL=Object.getOwnPropertyDescriptor,wL=(t,e,r,i)=>{for(var n=i>1?void 0:i?yL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&bL(e,r,n),n};let np=class extends Ct{render(){return Se`<footer><slot></slot></footer>`}};np.styles=[Bt.globalCss,mL],np=wL([kt("wcm-modal-footer")],np);const _L=zt`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var EL=Object.defineProperty,AL=Object.getOwnPropertyDescriptor,Gu=(t,e,r,i)=>{for(var n=i>1?void 0:i?AL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&EL(e,r,n),n};let aa=class extends Ct{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return Se`<button class="wcm-back-btn" @click="${ur.goBack}">${Wt.BACK_ICON}</button>`}actionBtnTemplate(){return Se`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"wcm-border":this.border},e=ur.state.history.length>1,r=this.title?Se`<wcm-text variant="big-bold">${this.title}</wcm-text>`:Se`<slot></slot>`;return Se`<header class="${Ls(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};aa.styles=[Bt.globalCss,_L],Gu([At()],aa.prototype,"title",2),Gu([At()],aa.prototype,"onAction",2),Gu([At()],aa.prototype,"actionIcon",2),Gu([At({type:Boolean})],aa.prototype,"border",2),aa=Gu([kt("wcm-modal-header")],aa);const dt={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=Fi.state;return r!=null&&r[t]?r[t]:e?Ai.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e&&t.length>8?`${t.substring(0,8)}..`:t},isMobileAnimation(){return window.innerWidth<=dt.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,i)=>{const n=new Image;n.onload=r,n.onerror=i,n.crossOrigin="anonymous",n.src=t});return Promise.race([e,Qe.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...i)=>{function n(){t(...i)}r&&clearTimeout(r),r=setTimeout(n,e)}},handleMobileLinking(t){const{walletConnectUri:e}=br.state,{mobile:r,name:i}=t,n=r?.native,s=r?.universal;dt.setRecentWallet(t);function a(u){let l="";n?l=Qe.formatUniversalUrl(n,u,i):s&&(l=Qe.formatNativeUrl(s,u,i)),Qe.openHref(l,"_self")}e&&a(e)},handleAndroidLinking(){const{walletConnectUri:t}=br.state;t&&(Qe.setWalletConnectAndroidDeepLink(t),Qe.openHref(t,"_self"))},async handleUriCopy(){const{walletConnectUri:t}=br.state;if(t)try{await navigator.clipboard.writeText(t),co.openToast("Link copied","success")}catch{co.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:t}=Fi.state,e=Object.values(t??{});return Object.values(e)},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},setRecentWallet(t){try{localStorage.setItem(dt.WCM_RECENT_WALLET_DATA,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const t=localStorage.getItem(dt.WCM_RECENT_WALLET_DATA);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Qe.openHref(dt.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:t,mobile:e}=Qe.getWalletRouterData(),r=!!t?.native,i=!!t?.universal,n=!!e?.native||!!e?.universal;return{isDesktop:r,isMobile:n,isWeb:i}},goToConnectingView(t){ur.setData({Wallet:t});const e=Qe.isMobile(),{isDesktop:r,isWeb:i,isMobile:n}=dt.getCachedRouterWalletPlatforms();e?n?ur.push("MobileConnecting"):i?ur.push("WebConnecting"):ur.push("InstallWallet"):r?ur.push("DesktopConnecting"):i?ur.push("WebConnecting"):n?ur.push("MobileQrcodeConnecting"):ur.push("InstallWallet")}},xL=zt`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var SL=Object.defineProperty,IL=Object.getOwnPropertyDescriptor,sp=(t,e,r,i)=>{for(var n=i>1?void 0:i?IL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&SL(e,r,n),n};let Yu=class extends Ct{constructor(){super(),this.view=ur.state.view,this.prevView=ur.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=ur.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&oa(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return dt.getShadowRootElement(this,".wcm-router")}get contentEl(){return dt.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return Se`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return Se`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return Se`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return Se`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return Se`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return Se`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return Se`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return Se`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return Se`<div>Not Found</div>`}}async onChangeRoute(){await oa(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=ur.state.view,oa(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return Se`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};Yu.styles=[Bt.globalCss,xL],sp([xi()],Yu.prototype,"view",2),sp([xi()],Yu.prototype,"prevView",2),Yu=sp([kt("wcm-modal-router")],Yu);const ML=zt`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var CL=Object.defineProperty,DL=Object.getOwnPropertyDescriptor,Cy=(t,e,r,i)=>{for(var n=i>1?void 0:i?DL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&CL(e,r,n),n};let el=class extends Ct{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=co.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>co.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),co.closeToast()}render(){const{message:t,variant:e}=co.state,r={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?Se`<div class="${Ls(r)}">${e==="success"?Wt.CHECKMARK_ICON:null} ${e==="error"?Wt.CROSS_ICON:null}<wcm-text variant="small-regular">${t}</wcm-text></div>`:null}};el.styles=[Bt.globalCss,ML],Cy([xi()],el.prototype,"open",2),el=Cy([kt("wcm-modal-toast")],el);const OL=.1,Dy=2.5,Bs=7;function op(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+OL}function PL(t,e){const r=Array.prototype.slice.call(zu.create(t,{errorCorrectionLevel:e}).modules.data,0),i=Math.sqrt(r.length);return r.reduce((n,s,a)=>(a%i===0?n.push([s]):n[n.length-1].push(s))&&n,[])}const $L={generate(t,e,r){const i="#141414",n="#ffffff",s=[],a=PL(t,"Q"),u=e/a.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:D,y:L})=>{const K=(a.length-Bs)*u*D,H=(a.length-Bs)*u*L,U=.45;for(let W=0;W<l.length;W+=1){const R=u*(Bs-W*2);s.push(dr`<rect fill="${W%2===0?i:n}" height="${R}" rx="${R*U}" ry="${R*U}" width="${R}" x="${K+u*W}" y="${H+u*W}">`)}});const d=Math.floor((r+25)/u),b=a.length/2-d/2,w=a.length/2+d/2-1,S=[];a.forEach((D,L)=>{D.forEach((K,H)=>{if(a[L][H]&&!(L<Bs&&H<Bs||L>a.length-(Bs+1)&&H<Bs||L<Bs&&H>a.length-(Bs+1))&&!(L>b&&L<w&&H>b&&H<w)){const U=L*u+u/2,W=H*u+u/2;S.push([U,W])}})});const I={};return S.forEach(([D,L])=>{I[D]?I[D].push(L):I[D]=[L]}),Object.entries(I).map(([D,L])=>{const K=L.filter(H=>L.every(U=>!op(H,U,u)));return[Number(D),K]}).forEach(([D,L])=>{L.forEach(K=>{s.push(dr`<circle cx="${D}" cy="${K}" fill="${i}" r="${u/Dy}">`)})}),Object.entries(I).filter(([D,L])=>L.length>1).map(([D,L])=>{const K=L.filter(H=>L.some(U=>op(H,U,u)));return[Number(D),K]}).map(([D,L])=>{L.sort((H,U)=>H<U?-1:1);const K=[];for(const H of L){const U=K.find(W=>W.some(R=>op(H,R,u)));U?U.push(H):K.push([H])}return[D,K.map(H=>[H[0],H[H.length-1]])]}).forEach(([D,L])=>{L.forEach(([K,H])=>{s.push(dr`<line x1="${D}" x2="${D}" y1="${K}" y2="${H}" stroke="${i}" stroke-width="${u/(Dy/2)}" stroke-linecap="round">`)})}),s}},RL=zt`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var NL=Object.defineProperty,TL=Object.getOwnPropertyDescriptor,Ec=(t,e,r,i)=>{for(var n=i>1?void 0:i?TL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&NL(e,r,n),n};let Fs=class extends Ct{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const t=ao.state.themeMode==="light"?this.size:this.size-36;return dr`<svg height="${t}" width="${t}">${$L.generate(this.uri,t,t/4)}</svg>`}render(){const t={"wcm-dark":ao.state.themeMode==="dark"};return Se`<div style="${`width: ${this.size}px`}" class="${Ls(t)}">${this.walletId||this.imageUrl?Se`<wcm-wallet-image walletId="${fi(this.walletId)}" imageId="${fi(this.imageId)}" imageUrl="${fi(this.imageUrl)}"></wcm-wallet-image>`:Wt.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Fs.styles=[Bt.globalCss,RL],Ec([At()],Fs.prototype,"uri",2),Ec([At({type:Number})],Fs.prototype,"size",2),Ec([At()],Fs.prototype,"imageId",2),Ec([At()],Fs.prototype,"walletId",2),Ec([At()],Fs.prototype,"imageUrl",2),Fs=Ec([kt("wcm-qrcode")],Fs);const LL=zt`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var BL=Object.defineProperty,FL=Object.getOwnPropertyDescriptor,Oy=(t,e,r,i)=>{for(var n=i>1?void 0:i?FL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&BL(e,r,n),n};let tl=class extends Ct{constructor(){super(...arguments),this.onChange=()=>null}render(){return Se`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Wt.SEARCH_ICON}`}};tl.styles=[Bt.globalCss,LL],Oy([At()],tl.prototype,"onChange",2),tl=Oy([kt("wcm-search-input")],tl);const UL=zt`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var kL=Object.defineProperty,jL=Object.getOwnPropertyDescriptor,qL=(t,e,r,i)=>{for(var n=i>1?void 0:i?jL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&kL(e,r,n),n};let ap=class extends Ct{render(){return Se`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};ap.styles=[Bt.globalCss,UL],ap=qL([kt("wcm-spinner")],ap);const zL=zt`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var HL=Object.defineProperty,KL=Object.getOwnPropertyDescriptor,cp=(t,e,r,i)=>{for(var n=i>1?void 0:i?KL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&HL(e,r,n),n};let Ju=class extends Ct{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return Se`<span><slot class="${Ls(t)}"></slot></span>`}};Ju.styles=[Bt.globalCss,zL],cp([At()],Ju.prototype,"variant",2),cp([At()],Ju.prototype,"color",2),Ju=cp([kt("wcm-text")],Ju);const WL=zt`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var VL=Object.defineProperty,GL=Object.getOwnPropertyDescriptor,go=(t,e,r,i)=>{for(var n=i>1?void 0:i?GL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&VL(e,r,n),n};let ms=class extends Ct{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?Se`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?Se`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){d6.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return Se`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${fi(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(t=this.label)!=null?t:dt.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};ms.styles=[Bt.globalCss,WL],go([At()],ms.prototype,"onClick",2),go([At()],ms.prototype,"name",2),go([At()],ms.prototype,"walletId",2),go([At()],ms.prototype,"label",2),go([At()],ms.prototype,"imageId",2),go([At({type:Boolean})],ms.prototype,"installed",2),go([At({type:Boolean})],ms.prototype,"recent",2),ms=go([kt("wcm-wallet-button")],ms);const YL=zt`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var JL=Object.defineProperty,QL=Object.getOwnPropertyDescriptor,rl=(t,e,r,i)=>{for(var n=i>1?void 0:i?QL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&JL(e,r,n),n};let Ac=class extends Ct{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:dt.getWalletIcon({id:this.walletId,image_id:this.imageId});return Se`${e.length?Se`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:Wt.WALLET_PLACEHOLDER}`}};Ac.styles=[Bt.globalCss,YL],rl([At()],Ac.prototype,"walletId",2),rl([At()],Ac.prototype,"imageId",2),rl([At()],Ac.prototype,"imageUrl",2),Ac=rl([kt("wcm-wallet-image")],Ac);var ZL=Object.defineProperty,XL=Object.getOwnPropertyDescriptor,Py=(t,e,r,i)=>{for(var n=i>1?void 0:i?XL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&ZL(e,r,n),n};let up=class extends Ct{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>dt.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){if(Fi.state.enableExplorer){await Ai.getRecomendedWallets(),br.setIsDataLoaded(!0);const{recomendedWallets:t}=Ai.state,e=t.map(r=>dt.getWalletIcon(r));await this.loadImages(e)}else br.setIsDataLoaded(!0)}async preloadCustomImages(){const t=dt.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),co.openToast("Failed preloading","error")}}};Py([xi()],up.prototype,"preload",2),up=Py([kt("wcm-explorer-context")],up);var eB=Object.defineProperty,tB=Object.getOwnPropertyDescriptor,rB=(t,e,r,i)=>{for(var n=i>1?void 0:i?tB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&eB(e,r,n),n};let $y=class extends Ct{constructor(){super(),this.unsubscribeTheme=void 0,Bt.setTheme(),this.unsubscribeTheme=ao.subscribe(Bt.setTheme)}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}};$y=rB([kt("wcm-theme-context")],$y);const iB=zt`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var nB=Object.defineProperty,sB=Object.getOwnPropertyDescriptor,oB=(t,e,r,i)=>{for(var n=i>1?void 0:i?sB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&nB(e,r,n),n};let fp=class extends Ct{onGoToQrcode(){ur.push("Qrcode")}render(){const{recomendedWallets:t}=Ai.state,e=[...t,...t],r=Qe.RECOMMENDED_WALLET_AMOUNT*2;return Se`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Wt.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${Wt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(r)].map((i,n)=>{const s=e[n%e.length];return s?Se`<wcm-wallet-image walletId="${s.id}" imageId="${s.image_id}"></wcm-wallet-image>`:Wt.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${dt.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};fp.styles=[Bt.globalCss,iB],fp=oB([kt("wcm-android-wallet-selection")],fp);const aB=zt`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var cB=Object.defineProperty,uB=Object.getOwnPropertyDescriptor,xc=(t,e,r,i)=>{for(var n=i>1?void 0:i?uB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&cB(e,r,n),n};let vo=class extends Ct{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=ao.state.themeVariables)==null?void 0:t["--wcm-wallet-icon-large-border-radius"])!=null?e:Bt.getPreset("--wcm-wallet-icon-large-border-radius");let i=0;r.includes("%")?i=88/100*parseInt(r,10):i=parseInt(r,10),i*=1.17;const n=317-i*1.57,s=425-i*1.8;return Se`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${i}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${n}" stroke-dashoffset="${s}"></use></svg>`}render(){const t={"wcm-error":this.isError,"wcm-stale":this.isStale};return Se`<div class="${Ls(t)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${fi(this.walletId)}" imageId="${fi(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};vo.styles=[Bt.globalCss,aB],xc([At()],vo.prototype,"walletId",2),xc([At()],vo.prototype,"imageId",2),xc([At({type:Boolean})],vo.prototype,"isError",2),xc([At({type:Boolean})],vo.prototype,"isStale",2),xc([At()],vo.prototype,"label",2),vo=xc([kt("wcm-connector-waiting")],vo);const Sc={manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:i}=Fi.state,n=(t=Sc.recentWallet())==null?void 0:t.id,s=Qe.isMobile()?r:i,a=s?.filter(u=>n!==u.id);return(e=Qe.isMobile()?a?.map(({id:u,name:l,links:d})=>({id:u,name:l,mobile:d,links:d})):a?.map(({id:u,name:l,links:d})=>({id:u,name:l,desktop:d,links:d})))!=null?e:[]},recentWallet(){return dt.getRecentWallet()},recomendedWallets(t=!1){var e;const r=t||(e=Sc.recentWallet())==null?void 0:e.id,{recomendedWallets:i}=Ai.state;return i.filter(n=>r!==n.id)}},mo={onConnecting(t){dt.goToConnectingView(t)},manualWalletsTemplate(){return Sc.manualWallets().map(t=>Se`<wcm-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(t=!1){return Sc.recomendedWallets(t).map(e=>Se`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){const t=Sc.recentWallet();if(t)return Se`<wcm-wallet-button name="${t.name}" walletId="${t.id}" imageId="${fi(t.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`}},fB=zt`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var hB=Object.defineProperty,lB=Object.getOwnPropertyDescriptor,dB=(t,e,r,i)=>{for(var n=i>1?void 0:i?lB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&hB(e,r,n),n};let hp=class extends Ct{render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=Fi.state,r=t!=="ALL"&&e,i=mo.manualWalletsTemplate(),n=mo.recomendedWalletsTemplate();let s=[mo.recentWalletTemplate(),...i,...n];s=s.filter(Boolean);const a=s.length>4||r;let u=[];a?u=s.slice(0,3):u=s;const l=!!u.length;return Se`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${Wt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${Wt.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${l?Se`<wcm-modal-footer><div class="wcm-desktop-title">${Wt.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${u} ${a?Se`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};hp.styles=[Bt.globalCss,fB],hp=dB([kt("wcm-desktop-wallet-selection")],hp);const pB=zt`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var gB=Object.defineProperty,vB=Object.getOwnPropertyDescriptor,mB=(t,e,r,i)=>{for(var n=i>1?void 0:i?vB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&gB(e,r,n),n};let lp=class extends Ct{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=Fi.state;return t??e?Se`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?Se`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?Se`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};lp.styles=[Bt.globalCss,pB],lp=mB([kt("wcm-legal-notice")],lp);const bB=zt`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var yB=Object.defineProperty,wB=Object.getOwnPropertyDescriptor,_B=(t,e,r,i)=>{for(var n=i>1?void 0:i?wB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&yB(e,r,n),n};let dp=class extends Ct{onQrcode(){ur.push("Qrcode")}render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=Fi.state,r=t!=="ALL"&&e,i=mo.manualWalletsTemplate(),n=mo.recomendedWalletsTemplate();let s=[mo.recentWalletTemplate(),...i,...n];s=s.filter(Boolean);const a=s.length>8||r;let u=[];a?u=s.slice(0,7):u=s;const l=!!u.length;return Se`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Wt.QRCODE_ICON}"></wcm-modal-header>${l?Se`<wcm-modal-content><div>${u} ${a?Se`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};dp.styles=[Bt.globalCss,bB],dp=_B([kt("wcm-mobile-wallet-selection")],dp);const EB=zt`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var AB=Object.defineProperty,xB=Object.getOwnPropertyDescriptor,pp=(t,e,r,i)=>{for(var n=i>1?void 0:i?xB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&AB(e,r,n),n};let Ic=class extends Ct{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Xo.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return dt.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return dt.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&Xo.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=dt.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([oa(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,oa(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=dt.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([oa(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,oa(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Xo.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"wcm-overlay":!0,"wcm-active":this.active};return Se`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${Ls(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?Se`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};Ic.styles=[Bt.globalCss,EB],pp([xi()],Ic.prototype,"open",2),pp([xi()],Ic.prototype,"active",2),Ic=pp([kt("wcm-modal")],Ic);const SB=zt`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var IB=Object.defineProperty,MB=Object.getOwnPropertyDescriptor,Qu=(t,e,r,i)=>{for(var n=i>1?void 0:i?MB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&IB(e,r,n),n};let ca=class extends Ct{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Qe.isMobile()?ur.replace("MobileConnecting"):ur.replace("MobileQrcodeConnecting")}onDesktop(){ur.replace("DesktopConnecting")}onWeb(){ur.replace("WebConnecting")}render(){return Se`<div>${this.isRetry?Se`<slot></slot>`:null} ${this.isMobile?Se`<wcm-button .onClick="${this.onMobile}" .iconLeft="${Wt.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?Se`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${Wt.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?Se`<wcm-button .onClick="${this.onWeb}" .iconLeft="${Wt.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};ca.styles=[Bt.globalCss,SB],Qu([At({type:Boolean})],ca.prototype,"isMobile",2),Qu([At({type:Boolean})],ca.prototype,"isDesktop",2),Qu([At({type:Boolean})],ca.prototype,"isWeb",2),Qu([At({type:Boolean})],ca.prototype,"isRetry",2),ca=Qu([kt("wcm-platform-selection")],ca);const CB=zt`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var DB=Object.defineProperty,OB=Object.getOwnPropertyDescriptor,PB=(t,e,r,i)=>{for(var n=i>1?void 0:i?OB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&DB(e,r,n),n};let gp=class extends Ct{onClick(){ur.push("WalletExplorer")}render(){const{recomendedWallets:t}=Ai.state,e=Sc.manualWallets(),r=[...t,...e].reverse().slice(0,4);return Se`<button @click="${this.onClick}"><div class="wcm-icons">${r.map(i=>{const n=dt.getWalletIcon(i);if(n)return Se`<img crossorigin="anonymous" src="${n}">`;const s=dt.getWalletIcon({id:i.id});return s?Se`<img crossorigin="anonymous" src="${s}">`:Wt.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Wt.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};gp.styles=[Bt.globalCss,CB],gp=PB([kt("wcm-view-all-wallets-button")],gp);const $B=zt`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var RB=Object.defineProperty,NB=Object.getOwnPropertyDescriptor,il=(t,e,r,i)=>{for(var n=i>1?void 0:i?NB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&RB(e,r,n),n};let Mc=class extends Ct{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:t}=br.state;this.uri=t},0)}get overlayEl(){return dt.getShadowRootElement(this,".wcm-qr-container")}render(){return Se`<div class="wcm-qr-container">${this.uri?Se`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${fi(this.walletId)}" imageId="${fi(this.imageId)}"></wcm-qrcode>`:Se`<wcm-spinner></wcm-spinner>`}</div>`}};Mc.styles=[Bt.globalCss,$B],il([At()],Mc.prototype,"walletId",2),il([At()],Mc.prototype,"imageId",2),il([xi()],Mc.prototype,"uri",2),Mc=il([kt("wcm-walletconnect-qr")],Mc);var TB=Object.defineProperty,LB=Object.getOwnPropertyDescriptor,BB=(t,e,r,i)=>{for(var n=i>1?void 0:i?LB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&TB(e,r,n),n};let vp=class extends Ct{viewTemplate(){return Qe.isAndroid()?Se`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:Qe.isMobile()?Se`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:Se`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return Se`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};vp.styles=[Bt.globalCss],vp=BB([kt("wcm-connect-wallet-view")],vp);const FB=zt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var UB=Object.defineProperty,kB=Object.getOwnPropertyDescriptor,Ry=(t,e,r,i)=>{for(var n=i>1?void 0:i?kB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&UB(e,r,n),n};let nl=class extends Ct{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(t){const{desktop:e,name:r}=Qe.getWalletRouterData(),i=e?.native;if(i){const n=Qe.formatNativeUrl(i,t,r);Qe.openHref(n,"_self")}}openDesktopApp(){const{walletConnectUri:t}=br.state,e=Qe.getWalletRouterData();dt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=Qe.getWalletRouterData(),{isMobile:i,isWeb:n}=dt.getCachedRouterWalletPlatforms();return Se`<wcm-modal-header title="${t}" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${fi(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${i}" .isWeb="${n}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Wt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};nl.styles=[Bt.globalCss,FB],Ry([xi()],nl.prototype,"isError",2),nl=Ry([kt("wcm-desktop-connecting-view")],nl);const jB=zt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var qB=Object.defineProperty,zB=Object.getOwnPropertyDescriptor,HB=(t,e,r,i)=>{for(var n=i>1?void 0:i?zB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&qB(e,r,n),n};let mp=class extends Ct{onInstall(t){t&&Qe.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:i}=Qe.getWalletRouterData();return Se`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${fi(r)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(i)}" .iconLeft="${Wt.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};mp.styles=[Bt.globalCss,jB],mp=HB([kt("wcm-install-wallet-view")],mp);const KB=zt`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var WB=Object.defineProperty,VB=Object.getOwnPropertyDescriptor,Ny=(t,e,r,i)=>{for(var n=i>1?void 0:i?VB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&WB(e,r,n),n};let sl=class extends Ct{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(t,e=!1){const{mobile:r,name:i}=Qe.getWalletRouterData(),n=r?.native,s=r?.universal;if(n&&!e){const a=Qe.formatNativeUrl(n,t,i);Qe.openHref(a,"_self")}else if(s){const a=Qe.formatUniversalUrl(s,t,i);Qe.openHref(a,"_self")}}openMobileApp(t=!1){const{walletConnectUri:e}=br.state,r=Qe.getWalletRouterData();dt.setRecentWallet(r),e&&this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&Qe.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:i,mobile:n}=Qe.getWalletRouterData(),{isWeb:s}=dt.getCachedRouterWalletPlatforms(),a=i?.ios,u=n?.universal;return Se`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${fi(r)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${s}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Wt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${u?Se`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${fi(r)}"></wcm-wallet-image><wcm-text>${`Get ${t}`}</wcm-text></div><wcm-button .iconRight="${Wt.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(a)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};sl.styles=[Bt.globalCss,KB],Ny([xi()],sl.prototype,"isError",2),sl=Ny([kt("wcm-mobile-connecting-view")],sl);const GB=zt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var YB=Object.defineProperty,JB=Object.getOwnPropertyDescriptor,QB=(t,e,r,i)=>{for(var n=i>1?void 0:i?JB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&YB(e,r,n),n};let bp=class extends Ct{render(){const{name:t,id:e,image_id:r}=Qe.getWalletRouterData(),{isDesktop:i,isWeb:n}=dt.getCachedRouterWalletPlatforms();return Se`<wcm-modal-header title="${t}" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${fi(r)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${t} app`}</wcm-text><wcm-platform-selection .isDesktop="${i}" .isWeb="${n}"></wcm-platform-selection></wcm-info-footer>`}};bp.styles=[Bt.globalCss,GB],bp=QB([kt("wcm-mobile-qr-connecting-view")],bp);var ZB=Object.defineProperty,XB=Object.getOwnPropertyDescriptor,eF=(t,e,r,i)=>{for(var n=i>1?void 0:i?XB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&ZB(e,r,n),n};let yp=class extends Ct{render(){return Se`<wcm-modal-header title="Scan the code" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};yp.styles=[Bt.globalCss],yp=eF([kt("wcm-qrcode-view")],yp);const tF=zt`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var rF=Object.defineProperty,iF=Object.getOwnPropertyDescriptor,Zu=(t,e,r,i)=>{for(var n=i>1?void 0:i?iF(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&rF(e,r,n),n};const wp=40;let ua=class extends Ct{constructor(){super(...arguments),this.loading=!Ai.state.wallets.listings.length,this.firstFetch=!Ai.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=dt.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,Ai.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),Ai.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return dt.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=Ai.state,{listings:r,total:i}=this.search?e:t;return i<=wp||r.length>=i}async fetchWallets(){var t;const{wallets:e,search:r}=Ai.state,{listings:i,total:n,page:s}=this.search?r:e;if(!this.endReached&&(this.firstFetch||n>wp&&i.length<n))try{this.loading=!0;const a=(t=br.state.chains)==null?void 0:t.join(","),{listings:u}=await Ai.getWallets({page:this.firstFetch?1:s+1,entries:wp,search:this.search,version:2,chains:a}),l=u.map(d=>dt.getWalletIcon(d));await Promise.all([...l.map(async d=>dt.preloadImage(d)),Qe.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),co.openToast(dt.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Qe.isAndroid()?dt.handleMobileLinking(t):dt.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=Ai.state,{listings:r}=this.search?e:t,i=this.loading&&!r.length,n=this.search.length>=3;let s=mo.manualWalletsTemplate(),a=mo.recomendedWalletsTemplate(!0);n&&(s=s.filter(({values:d})=>dt.caseSafeIncludes(d[0],this.search)),a=a.filter(({values:d})=>dt.caseSafeIncludes(d[0],this.search)));const u=!this.loading&&!r.length&&!a.length,l={"wcm-loading":i,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":u};return Se`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${Ls(l)}"><div class="wcm-grid">${i?null:s} ${i?null:a} ${i?null:r.map(d=>Se`${d?Se`<wcm-wallet-button imageId="${d.image_id}" name="${d.name}" walletId="${d.id}" .onClick="${()=>this.onConnect(d)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${u?Se`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!u&&this.loading?Se`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};ua.styles=[Bt.globalCss,tF],Zu([xi()],ua.prototype,"loading",2),Zu([xi()],ua.prototype,"firstFetch",2),Zu([xi()],ua.prototype,"search",2),Zu([xi()],ua.prototype,"endReached",2),ua=Zu([kt("wcm-wallet-explorer-view")],ua);const nF=zt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var sF=Object.defineProperty,oF=Object.getOwnPropertyDescriptor,Ty=(t,e,r,i)=>{for(var n=i>1?void 0:i?oF(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&sF(e,r,n),n};let ol=class extends Ct{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(t){const{desktop:e,name:r}=Qe.getWalletRouterData(),i=e?.universal;if(i){const n=Qe.formatUniversalUrl(i,t,r);Qe.openHref(n,"_blank")}}openWebWallet(){const{walletConnectUri:t}=br.state,e=Qe.getWalletRouterData();dt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=Qe.getWalletRouterData(),{isMobile:i,isDesktop:n}=dt.getCachedRouterWalletPlatforms(),s=Qe.isMobile();return Se`<wcm-modal-header title="${t}" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${fi(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${i}" .isDesktop="${s?!1:n}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Wt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};ol.styles=[Bt.globalCss,nF],Ty([xi()],ol.prototype,"isError",2),ol=Ty([kt("wcm-web-connecting-view")],ol);var aF=Object.freeze({__proto__:null,get WcmModal(){return Ic},get WcmQrCode(){return Fs}});pn.EthereumProvider=PR,pn.OPTIONAL_EVENTS=c6,pn.OPTIONAL_METHODS=a6,pn.REQUIRED_EVENTS=Ph,pn.REQUIRED_METHODS=Oh,pn.default=Nh,Object.defineProperty(pn,"__esModule",{value:!0})});
121
+ `);const a=RT(e,r,n),u=Xh.getSymbolSize(e),l=new ET(u);return CT(l,e),DT(l),OT(l,e),G1(l,r,0),e>=7&&PT(l,e),$T(l,a),isNaN(i)&&(i=K1.getBestMask(l,G1.bind(null,l,r))),K1.applyMask(i,l),G1(l,r,i),{modules:l,version:e,errorCorrectionLevel:r,maskPattern:i,segments:n}}ny.create=function(e,r){if(typeof e>"u"||e==="")throw new Error("No input text");let i=H1.M,n,s;return typeof r<"u"&&(i=H1.from(r.errorCorrectionLevel,H1.M),n=el.from(r.version),s=K1.from(r.maskPattern),r.toSJISFunc&&Xh.setToSJISFunction(r.toSJISFunc)),TT(e,n,i,s)};var yy={},Y1={};(function(t){function e(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let i=r.slice().replace("#","").split("");if(i.length<3||i.length===5||i.length>8)throw new Error("Invalid hex color: "+r);(i.length===3||i.length===4)&&(i=Array.prototype.concat.apply([],i.map(function(s){return[s,s]}))),i.length===6&&i.push("F","F");const n=parseInt(i.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+i.slice(0,6).join("")}}t.getOptions=function(i){i||(i={}),i.color||(i.color={});const n=typeof i.margin>"u"||i.margin===null||i.margin<0?4:i.margin,s=i.width&&i.width>=21?i.width:void 0,a=i.scale||4;return{width:s,scale:s?4:a,margin:n,color:{dark:e(i.color.dark||"#000000ff"),light:e(i.color.light||"#ffffffff")},type:i.type,rendererOpts:i.rendererOpts||{}}},t.getScale=function(i,n){return n.width&&n.width>=i+n.margin*2?n.width/(i+n.margin*2):n.scale},t.getImageWidth=function(i,n){const s=t.getScale(i,n);return Math.floor((i+n.margin*2)*s)},t.qrToImageData=function(i,n,s){const a=n.modules.size,u=n.modules.data,l=t.getScale(a,s),d=Math.floor((a+s.margin*2)*l),b=s.margin*l,w=[s.color.light,s.color.dark];for(let I=0;I<d;I++)for(let S=0;S<d;S++){let D=(I*d+S)*4,L=s.color.light;if(I>=b&&S>=b&&I<d-b&&S<d-b){const K=Math.floor((I-b)/l),H=Math.floor((S-b)/l);L=w[u[K*a+H]?1:0]}i[D++]=L.r,i[D++]=L.g,i[D++]=L.b,i[D]=L.a}}})(Y1),function(t){const e=Y1;function r(n,s,a){n.clearRect(0,0,s.width,s.height),s.style||(s.style={}),s.height=a,s.width=a,s.style.height=a+"px",s.style.width=a+"px"}function i(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(s,a,u){let l=u,d=a;typeof l>"u"&&(!a||!a.getContext)&&(l=a,a=void 0),a||(d=i()),l=e.getOptions(l);const b=e.getImageWidth(s.modules.size,l),w=d.getContext("2d"),I=w.createImageData(b,b);return e.qrToImageData(I.data,s,l),r(w,d,b),w.putImageData(I,0,0),d},t.renderToDataURL=function(s,a,u){let l=u;typeof l>"u"&&(!a||!a.getContext)&&(l=a,a=void 0),l||(l={});const d=t.render(s,a,l),b=l.type||"image/png",w=l.rendererOpts||{};return d.toDataURL(b,w.quality)}}(yy);var wy={};const LT=Y1;function _y(t,e){const r=t.a/255,i=e+'="'+t.hex+'"';return r<1?i+" "+e+'-opacity="'+r.toFixed(2).slice(1)+'"':i}function J1(t,e,r){let i=t+e;return typeof r<"u"&&(i+=" "+r),i}function BT(t,e,r){let i="",n=0,s=!1,a=0;for(let u=0;u<t.length;u++){const l=Math.floor(u%e),d=Math.floor(u/e);!l&&!s&&(s=!0),t[u]?(a++,u>0&&l>0&&t[u-1]||(i+=s?J1("M",l+r,.5+d+r):J1("m",n,0),n=0,s=!1),l+1<e&&t[u+1]||(i+=J1("h",a),a=0)):n++}return i}wy.render=function(e,r,i){const n=LT.getOptions(r),s=e.modules.size,a=e.modules.data,u=s+n.margin*2,l=n.color.light.a?"<path "+_y(n.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",d="<path "+_y(n.color.dark,"stroke")+' d="'+BT(a,s,n.margin)+'"/>',b='viewBox="0 0 '+u+" "+u+'"',I='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+b+' shape-rendering="crispEdges">'+l+d+`</svg>
122
+ `;return typeof i=="function"&&i(null,I),I};const FT=ZN,Q1=ny,Ey=yy,UT=wy;function Z1(t,e,r,i,n){const s=[].slice.call(arguments,1),a=s.length,u=typeof s[a-1]=="function";if(!u&&!FT())throw new Error("Callback required as last argument");if(u){if(a<2)throw new Error("Too few arguments provided");a===2?(n=r,r=e,e=i=void 0):a===3&&(e.getContext&&typeof n>"u"?(n=i,i=void 0):(n=i,i=r,r=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(r=e,e=i=void 0):a===2&&!e.getContext&&(i=r,r=e,e=void 0),new Promise(function(l,d){try{const b=Q1.create(r,i);l(t(b,e,i))}catch(b){d(b)}})}try{const l=Q1.create(r,i);n(null,t(l,e,i))}catch(l){n(l)}}zu.create=Q1.create,zu.toCanvas=Z1.bind(null,Ey.render),zu.toDataURL=Z1.bind(null,Ey.renderToDataURL),zu.toString=Z1.bind(null,function(t,e,r){return UT.render(t,r)});var kT=Object.defineProperty,Ay=Object.getOwnPropertySymbols,jT=Object.prototype.hasOwnProperty,qT=Object.prototype.propertyIsEnumerable,xy=(t,e,r)=>e in t?kT(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,X1=(t,e)=>{for(var r in e||(e={}))jT.call(e,r)&&xy(t,r,e[r]);if(Ay)for(var r of Ay(e))qT.call(e,r)&&xy(t,r,e[r]);return t};function zT(){var t;const e=(t=ao.state.themeMode)!=null?t:"dark",r={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[e];return{"--wcm-color-fg-1":r.foreground[1],"--wcm-color-fg-2":r.foreground[2],"--wcm-color-fg-3":r.foreground[3],"--wcm-color-bg-1":r.background[1],"--wcm-color-bg-2":r.background[2],"--wcm-color-bg-3":r.background[3],"--wcm-color-overlay":r.overlay}}function Sy(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}const Bt={getPreset(t){return Sy()[t]},setTheme(){const t=document.querySelector(":root"),{themeVariables:e}=ao.state;if(t){const r=X1(X1(X1({},zT()),Sy()),e);Object.entries(r).forEach(([i,n])=>t.style.setProperty(i,n))}},globalCss:zt`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},HT=zt`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var KT=Object.defineProperty,WT=Object.getOwnPropertyDescriptor,_c=(t,e,r,i)=>{for(var n=i>1?void 0:i?WT(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&KT(e,r,n),n};let po=class extends Ct{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){const t={"wcm-icon-left":this.iconLeft!==void 0,"wcm-icon-right":this.iconRight!==void 0,"wcm-ghost":this.variant==="ghost","wcm-outline":this.variant==="outline"};let e="inverse";return this.variant==="ghost"&&(e="secondary"),this.variant==="outline"&&(e="accent"),Se`<button class="${Ls(t)}" ?disabled="${this.disabled}" @click="${this.onClick}">${this.iconLeft}<wcm-text variant="small-regular" color="${e}"><slot></slot></wcm-text>${this.iconRight}</button>`}};po.styles=[Bt.globalCss,HT],_c([At({type:Boolean})],po.prototype,"disabled",2),_c([At()],po.prototype,"iconLeft",2),_c([At()],po.prototype,"iconRight",2),_c([At()],po.prototype,"onClick",2),_c([At()],po.prototype,"variant",2),po=_c([kt("wcm-button")],po);const VT=zt`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var GT=Object.defineProperty,YT=Object.getOwnPropertyDescriptor,ep=(t,e,r,i)=>{for(var n=i>1?void 0:i?YT(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&GT(e,r,n),n};let Vu=class extends Ct{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){const t={"wcm-secondary":this.variant==="secondary"};return Se`<button ?disabled="${this.disabled}" class="${Ls(t)}"><slot></slot></button>`}};Vu.styles=[Bt.globalCss,VT],ep([At({type:Boolean})],Vu.prototype,"disabled",2),ep([At()],Vu.prototype,"variant",2),Vu=ep([kt("wcm-button-big")],Vu);const JT=zt`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var QT=Object.defineProperty,ZT=Object.getOwnPropertyDescriptor,XT=(t,e,r,i)=>{for(var n=i>1?void 0:i?ZT(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&QT(e,r,n),n};let tp=class extends Ct{render(){return Se`<div><slot></slot></div>`}};tp.styles=[Bt.globalCss,JT],tp=XT([kt("wcm-info-footer")],tp);const Wt={CROSS_ICON:dr`<svg width="12" height="12" viewBox="0 0 12 12"><path d="M9.94 11A.75.75 0 1 0 11 9.94L7.414 6.353a.5.5 0 0 1 0-.708L11 2.061A.75.75 0 1 0 9.94 1L6.353 4.586a.5.5 0 0 1-.708 0L2.061 1A.75.75 0 0 0 1 2.06l3.586 3.586a.5.5 0 0 1 0 .708L1 9.939A.75.75 0 1 0 2.06 11l3.586-3.586a.5.5 0 0 1 .708 0L9.939 11Z" fill="#fff"/></svg>`,WALLET_CONNECT_LOGO:dr`<svg width="178" height="29" viewBox="0 0 178 29" id="wcm-wc-logo"><path d="M10.683 7.926c5.284-5.17 13.85-5.17 19.134 0l.636.623a.652.652 0 0 1 0 .936l-2.176 2.129a.343.343 0 0 1-.478 0l-.875-.857c-3.686-3.607-9.662-3.607-13.348 0l-.937.918a.343.343 0 0 1-.479 0l-2.175-2.13a.652.652 0 0 1 0-.936l.698-.683Zm23.633 4.403 1.935 1.895a.652.652 0 0 1 0 .936l-8.73 8.543a.687.687 0 0 1-.956 0L20.37 17.64a.172.172 0 0 0-.239 0l-6.195 6.063a.687.687 0 0 1-.957 0l-8.73-8.543a.652.652 0 0 1 0-.936l1.936-1.895a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .239 0l6.195-6.064a.687.687 0 0 1 .957 0l6.196 6.064a.172.172 0 0 0 .24 0l6.195-6.064a.687.687 0 0 1 .956 0ZM48.093 20.948l2.338-9.355c.139-.515.258-1.07.416-1.942.12.872.258 1.427.357 1.942l2.022 9.355h4.181l3.528-13.874h-3.21l-1.943 8.523a24.825 24.825 0 0 0-.456 2.457c-.158-.931-.317-1.625-.495-2.438l-1.883-8.542h-4.201l-2.042 8.542a41.204 41.204 0 0 0-.475 2.438 41.208 41.208 0 0 0-.476-2.438l-1.903-8.542h-3.349l3.508 13.874h4.083ZM63.33 21.304c1.585 0 2.596-.654 3.11-1.605-.059.297-.078.595-.078.892v.357h2.655V15.22c0-2.735-1.248-4.32-4.3-4.32-2.636 0-4.36 1.466-4.52 3.487h2.914c.1-.891.734-1.426 1.705-1.426.911 0 1.407.515 1.407 1.11 0 .435-.258.693-1.03.792l-1.388.159c-2.061.257-3.825 1.01-3.825 3.19 0 1.982 1.645 3.092 3.35 3.092Zm.891-2.041c-.773 0-1.348-.436-1.348-1.19 0-.733.655-1.09 1.645-1.268l.674-.119c.575-.118.892-.218 1.09-.396v.912c0 1.228-.892 2.06-2.06 2.06ZM70.398 7.074v13.874h2.874V7.074h-2.874ZM74.934 7.074v13.874h2.874V7.074h-2.874ZM84.08 21.304c2.735 0 4.5-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922H81.92ZM94.92 21.146c.633 0 1.248-.1 1.525-.179v-2.18c-.218.04-.475.06-.693.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.338v-2.24h-2.338V7.788H91.47v3.448H89.37v2.24h2.1v4.201c0 2.3 1.15 3.469 3.45 3.469ZM104.62 21.304c3.924 0 6.302-2.299 6.599-5.608h-3.111c-.238 1.803-1.506 3.032-3.369 3.032-2.2 0-3.746-1.784-3.746-4.796 0-2.953 1.605-4.638 3.805-4.638 1.883 0 2.953 1.15 3.171 2.834h3.191c-.317-3.448-2.854-5.41-6.342-5.41-3.984 0-7.036 2.695-7.036 7.214 0 4.677 2.676 7.372 6.838 7.372ZM117.449 21.304c2.993 0 5.114-1.882 5.114-5.172 0-3.23-2.121-5.233-5.114-5.233-2.972 0-5.093 2.002-5.093 5.233 0 3.29 2.101 5.172 5.093 5.172Zm0-2.22c-1.327 0-2.18-1.09-2.18-2.952 0-1.903.892-2.973 2.18-2.973 1.308 0 2.2 1.07 2.2 2.973 0 1.862-.872 2.953-2.2 2.953ZM126.569 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.229-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM137.464 20.948v-5.689c0-1.208.753-2.1 1.823-2.1 1.011 0 1.606.773 1.606 2.06v5.729h2.873v-6.144c0-2.339-1.228-3.905-3.428-3.905-1.526 0-2.458.734-2.953 1.606a5.31 5.31 0 0 0 .079-.892v-.377h-2.874v9.712h2.874ZM149.949 21.304c2.735 0 4.499-1.546 4.697-3.567h-2.893c-.139.892-.892 1.387-1.804 1.387-1.228 0-2.12-.99-2.14-2.358h6.897v-.555c0-3.21-1.764-5.312-4.816-5.312-2.933 0-4.994 2.062-4.994 5.173 0 3.37 2.12 5.232 5.053 5.232Zm-2.16-6.421c.119-1.11.932-1.922 2.081-1.922 1.11 0 1.883.772 1.903 1.922h-3.984ZM160.876 21.304c3.013 0 4.658-1.645 4.975-4.201h-2.874c-.099 1.07-.713 1.982-2.001 1.982-1.309 0-2.2-1.21-2.2-2.993 0-1.942 1.03-2.933 2.259-2.933 1.209 0 1.803.872 1.883 1.882h2.873c-.218-2.358-1.823-4.142-4.776-4.142-2.874 0-5.153 1.903-5.153 5.193 0 3.25 1.923 5.212 5.014 5.212ZM172.067 21.146c.634 0 1.248-.1 1.526-.179v-2.18c-.218.04-.476.06-.694.06-1.05 0-1.427-.595-1.427-1.566v-3.805h2.339v-2.24h-2.339V7.788h-2.854v3.448h-2.1v2.24h2.1v4.201c0 2.3 1.15 3.469 3.449 3.469Z" fill="#fff"/></svg>`,WALLET_CONNECT_ICON:dr`<svg width="28" height="20" viewBox="0 0 28 20"><g clip-path="url(#a)"><path d="M7.386 6.482c3.653-3.576 9.575-3.576 13.228 0l.44.43a.451.451 0 0 1 0 .648L19.55 9.033a.237.237 0 0 1-.33 0l-.606-.592c-2.548-2.496-6.68-2.496-9.228 0l-.648.634a.237.237 0 0 1-.33 0L6.902 7.602a.451.451 0 0 1 0-.647l.483-.473Zm16.338 3.046 1.339 1.31a.451.451 0 0 1 0 .648l-6.035 5.909a.475.475 0 0 1-.662 0L14.083 13.2a.119.119 0 0 0-.166 0l-4.283 4.194a.475.475 0 0 1-.662 0l-6.035-5.91a.451.451 0 0 1 0-.647l1.338-1.31a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0l4.283 4.194c.046.044.12.044.166 0l4.283-4.194a.475.475 0 0 1 .662 0Z" fill="#000000"/></g><defs><clipPath id="a"><path fill="#ffffff" d="M0 0h28v20H0z"/></clipPath></defs></svg>`,WALLET_CONNECT_ICON_COLORED:dr`<svg width="96" height="96" fill="none"><path fill="#fff" d="M25.322 33.597c12.525-12.263 32.83-12.263 45.355 0l1.507 1.476a1.547 1.547 0 0 1 0 2.22l-5.156 5.048a.814.814 0 0 1-1.134 0l-2.074-2.03c-8.737-8.555-22.903-8.555-31.64 0l-2.222 2.175a.814.814 0 0 1-1.134 0l-5.156-5.049a1.547 1.547 0 0 1 0-2.22l1.654-1.62Zm56.019 10.44 4.589 4.494a1.547 1.547 0 0 1 0 2.22l-20.693 20.26a1.628 1.628 0 0 1-2.267 0L48.283 56.632a.407.407 0 0 0-.567 0L33.03 71.012a1.628 1.628 0 0 1-2.268 0L10.07 50.75a1.547 1.547 0 0 1 0-2.22l4.59-4.494a1.628 1.628 0 0 1 2.267 0l14.687 14.38c.156.153.41.153.567 0l14.685-14.38a1.628 1.628 0 0 1 2.268 0l14.687 14.38c.156.153.41.153.567 0l14.686-14.38a1.628 1.628 0 0 1 2.268 0Z"/><path stroke="#000" d="M25.672 33.954c12.33-12.072 32.325-12.072 44.655 0l1.508 1.476a1.047 1.047 0 0 1 0 1.506l-5.157 5.048a.314.314 0 0 1-.434 0l-2.074-2.03c-8.932-8.746-23.409-8.746-32.34 0l-2.222 2.174a.314.314 0 0 1-.434 0l-5.157-5.048a1.047 1.047 0 0 1 0-1.506l1.655-1.62Zm55.319 10.44 4.59 4.494a1.047 1.047 0 0 1 0 1.506l-20.694 20.26a1.128 1.128 0 0 1-1.568 0l-14.686-14.38a.907.907 0 0 0-1.267 0L32.68 70.655a1.128 1.128 0 0 1-1.568 0L10.42 50.394a1.047 1.047 0 0 1 0-1.506l4.59-4.493a1.128 1.128 0 0 1 1.567 0l14.687 14.379a.907.907 0 0 0 1.266 0l-.35-.357.35.357 14.686-14.38a1.128 1.128 0 0 1 1.568 0l14.687 14.38a.907.907 0 0 0 1.267 0l14.686-14.38a1.128 1.128 0 0 1 1.568 0Z"/></svg>`,BACK_ICON:dr`<svg width="10" height="18" viewBox="0 0 10 18"><path fill-rule="evenodd" clip-rule="evenodd" d="M8.735.179a.75.75 0 0 1 .087 1.057L2.92 8.192a1.25 1.25 0 0 0 0 1.617l5.902 6.956a.75.75 0 1 1-1.144.97L1.776 10.78a2.75 2.75 0 0 1 0-3.559L7.678.265A.75.75 0 0 1 8.735.18Z" fill="#fff"/></svg>`,COPY_ICON:dr`<svg width="24" height="24" fill="none"><path fill="#fff" fill-rule="evenodd" d="M7.01 7.01c.03-1.545.138-2.5.535-3.28A5 5 0 0 1 9.73 1.545C10.8 1 12.2 1 15 1c2.8 0 4.2 0 5.27.545a5 5 0 0 1 2.185 2.185C23 4.8 23 6.2 23 9c0 2.8 0 4.2-.545 5.27a5 5 0 0 1-2.185 2.185c-.78.397-1.735.505-3.28.534l-.001.01c-.03 1.54-.138 2.493-.534 3.27a5 5 0 0 1-2.185 2.186C13.2 23 11.8 23 9 23c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C1 19.2 1 17.8 1 15c0-2.8 0-4.2.545-5.27A5 5 0 0 1 3.73 7.545C4.508 7.149 5.46 7.04 7 7.01h.01ZM15 15.5c-1.425 0-2.403-.001-3.162-.063-.74-.06-1.139-.172-1.427-.319a3.5 3.5 0 0 1-1.53-1.529c-.146-.288-.257-.686-.318-1.427C8.501 11.403 8.5 10.425 8.5 9c0-1.425.001-2.403.063-3.162.06-.74.172-1.139.318-1.427a3.5 3.5 0 0 1 1.53-1.53c.288-.146.686-.257 1.427-.318.759-.062 1.737-.063 3.162-.063 1.425 0 2.403.001 3.162.063.74.06 1.139.172 1.427.318a3.5 3.5 0 0 1 1.53 1.53c.146.288.257.686.318 1.427.062.759.063 1.737.063 3.162 0 1.425-.001 2.403-.063 3.162-.06.74-.172 1.139-.319 1.427a3.5 3.5 0 0 1-1.529 1.53c-.288.146-.686.257-1.427.318-.759.062-1.737.063-3.162.063ZM7 8.511c-.444.009-.825.025-1.162.052-.74.06-1.139.172-1.427.318a3.5 3.5 0 0 0-1.53 1.53c-.146.288-.257.686-.318 1.427-.062.759-.063 1.737-.063 3.162 0 1.425.001 2.403.063 3.162.06.74.172 1.139.318 1.427a3.5 3.5 0 0 0 1.53 1.53c.288.146.686.257 1.427.318.759.062 1.737.063 3.162.063 1.425 0 2.403-.001 3.162-.063.74-.06 1.139-.172 1.427-.319a3.5 3.5 0 0 0 1.53-1.53c.146-.287.257-.685.318-1.426.027-.337.043-.718.052-1.162H15c-2.8 0-4.2 0-5.27-.545a5 5 0 0 1-2.185-2.185C7 13.2 7 11.8 7 9v-.489Z" clip-rule="evenodd"/></svg>`,RETRY_ICON:dr`<svg width="15" height="16" viewBox="0 0 15 16"><path d="M6.464 2.03A.75.75 0 0 0 5.403.97L2.08 4.293a1 1 0 0 0 0 1.414L5.403 9.03a.75.75 0 0 0 1.06-1.06L4.672 6.177a.25.25 0 0 1 .177-.427h2.085a4 4 0 1 1-3.93 4.746c-.077-.407-.405-.746-.82-.746-.414 0-.755.338-.7.748a5.501 5.501 0 1 0 5.45-6.248H4.848a.25.25 0 0 1-.177-.427L6.464 2.03Z" fill="#fff"/></svg>`,DESKTOP_ICON:dr`<svg width="16" height="16" viewBox="0 0 16 16"><path fill-rule="evenodd" clip-rule="evenodd" d="M0 5.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C2.204 1 3.13 1 4.98 1h6.04c1.85 0 2.775 0 3.466.394a3 3 0 0 1 1.12 1.12C16 3.204 16 4.13 16 5.98v1.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C13.796 12 12.87 12 11.02 12H4.98c-1.85 0-2.775 0-3.466-.394a3 3 0 0 1-1.12-1.12C0 9.796 0 8.87 0 7.02V5.98ZM4.98 2.5h6.04c.953 0 1.568.001 2.034.043.446.04.608.108.69.154a1.5 1.5 0 0 1 .559.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033v1.04c0 .952-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.046-.243.114-.69.154-.466.042-1.08.043-2.033.043H4.98c-.952 0-1.568-.001-2.034-.043-.446-.04-.608-.108-.69-.154a1.5 1.5 0 0 1-.559-.56c-.046-.08-.114-.243-.154-.69-.042-.465-.043-1.08-.043-2.033V5.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.046.243-.114.69-.154.465-.042 1.08-.043 2.033-.043Z" fill="#fff"/><path d="M4 14.25a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,MOBILE_ICON:dr`<svg width="16" height="16" viewBox="0 0 16 16"><path d="M6.75 5a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M3 4.98c0-1.85 0-2.775.394-3.466a3 3 0 0 1 1.12-1.12C5.204 0 6.136 0 8 0s2.795 0 3.486.394a3 3 0 0 1 1.12 1.12C13 2.204 13 3.13 13 4.98v6.04c0 1.85 0 2.775-.394 3.466a3 3 0 0 1-1.12 1.12C10.796 16 9.864 16 8 16s-2.795 0-3.486-.394a3 3 0 0 1-1.12-1.12C3 13.796 3 12.87 3 11.02V4.98Zm8.5 0v6.04c0 .953-.001 1.568-.043 2.034-.04.446-.108.608-.154.69a1.499 1.499 0 0 1-.56.559c-.08.045-.242.113-.693.154-.47.042-1.091.043-2.05.043-.959 0-1.58-.001-2.05-.043-.45-.04-.613-.109-.693-.154a1.5 1.5 0 0 1-.56-.56c-.046-.08-.114-.243-.154-.69-.042-.466-.043-1.08-.043-2.033V4.98c0-.952.001-1.568.043-2.034.04-.446.108-.608.154-.69a1.5 1.5 0 0 1 .56-.559c.08-.045.243-.113.693-.154C6.42 1.501 7.041 1.5 8 1.5c.959 0 1.58.001 2.05.043.45.04.613.109.693.154a1.5 1.5 0 0 1 .56.56c.046.08.114.243.154.69.042.465.043 1.08.043 2.033Z" fill="#fff"/></svg>`,ARROW_DOWN_ICON:dr`<svg width="14" height="14" viewBox="0 0 14 14"><path d="M2.28 7.47a.75.75 0 0 0-1.06 1.06l5.25 5.25a.75.75 0 0 0 1.06 0l5.25-5.25a.75.75 0 0 0-1.06-1.06l-3.544 3.543a.25.25 0 0 1-.426-.177V.75a.75.75 0 0 0-1.5 0v10.086a.25.25 0 0 1-.427.176L2.28 7.47Z" fill="#fff"/></svg>`,ARROW_UP_RIGHT_ICON:dr`<svg width="15" height="14" fill="none"><path d="M4.5 1.75A.75.75 0 0 1 5.25 1H12a1.5 1.5 0 0 1 1.5 1.5v6.75a.75.75 0 0 1-1.5 0V4.164a.25.25 0 0 0-.427-.176L4.061 11.5A.75.75 0 0 1 3 10.44l7.513-7.513a.25.25 0 0 0-.177-.427H5.25a.75.75 0 0 1-.75-.75Z" fill="#fff"/></svg>`,ARROW_RIGHT_ICON:dr`<svg width="6" height="14" viewBox="0 0 6 14"><path fill-rule="evenodd" clip-rule="evenodd" d="M2.181 1.099a.75.75 0 0 1 1.024.279l2.433 4.258a2.75 2.75 0 0 1 0 2.729l-2.433 4.257a.75.75 0 1 1-1.303-.744L4.335 7.62a1.25 1.25 0 0 0 0-1.24L1.902 2.122a.75.75 0 0 1 .28-1.023Z" fill="#fff"/></svg>`,QRCODE_ICON:dr`<svg width="25" height="24" viewBox="0 0 25 24"><path d="M23.748 9a.748.748 0 0 0 .748-.752c-.018-2.596-.128-4.07-.784-5.22a6 6 0 0 0-2.24-2.24c-1.15-.656-2.624-.766-5.22-.784a.748.748 0 0 0-.752.748c0 .414.335.749.748.752 1.015.007 1.82.028 2.494.088.995.09 1.561.256 1.988.5.7.398 1.28.978 1.679 1.678.243.427.41.993.498 1.988.061.675.082 1.479.09 2.493a.753.753 0 0 0 .75.749ZM3.527.788C4.677.132 6.152.022 8.747.004A.748.748 0 0 1 9.5.752a.753.753 0 0 1-.749.752c-1.014.007-1.818.028-2.493.088-.995.09-1.561.256-1.988.5-.7.398-1.28.978-1.679 1.678-.243.427-.41.993-.499 1.988-.06.675-.081 1.479-.088 2.493A.753.753 0 0 1 1.252 9a.748.748 0 0 1-.748-.752c.018-2.596.128-4.07.784-5.22a6 6 0 0 1 2.24-2.24ZM1.252 15a.748.748 0 0 0-.748.752c.018 2.596.128 4.07.784 5.22a6 6 0 0 0 2.24 2.24c1.15.656 2.624.766 5.22.784a.748.748 0 0 0 .752-.748.753.753 0 0 0-.749-.752c-1.014-.007-1.818-.028-2.493-.089-.995-.089-1.561-.255-1.988-.498a4.5 4.5 0 0 1-1.679-1.68c-.243-.426-.41-.992-.499-1.987-.06-.675-.081-1.479-.088-2.493A.753.753 0 0 0 1.252 15ZM22.996 15.749a.753.753 0 0 1 .752-.749c.415 0 .751.338.748.752-.018 2.596-.128 4.07-.784 5.22a6 6 0 0 1-2.24 2.24c-1.15.656-2.624.766-5.22.784a.748.748 0 0 1-.752-.748c0-.414.335-.749.748-.752 1.015-.007 1.82-.028 2.494-.089.995-.089 1.561-.255 1.988-.498a4.5 4.5 0 0 0 1.679-1.68c.243-.426.41-.992.498-1.987.061-.675.082-1.479.09-2.493Z" fill="#fff"/><path fill-rule="evenodd" clip-rule="evenodd" d="M7 4a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 11h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 4H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1ZM13.5 6.5A2.5 2.5 0 0 1 16 4h2a2.5 2.5 0 0 1 2.5 2.5v2A2.5 2.5 0 0 1 18 11h-2a2.5 2.5 0 0 1-2.5-2.5v-2Zm2.5-1h2a1 1 0 0 1 1 1v2a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1ZM7 13a2.5 2.5 0 0 0-2.5 2.5v2A2.5 2.5 0 0 0 7 20h2a2.5 2.5 0 0 0 2.5-2.5v-2A2.5 2.5 0 0 0 9 13H7Zm2 1.5H7a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h2a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1Z" fill="#fff"/><path d="M13.5 15.5c0-.465 0-.697.038-.89a2 2 0 0 1 1.572-1.572C15.303 13 15.535 13 16 13v2.5h-2.5ZM18 13c.465 0 .697 0 .89.038a2 2 0 0 1 1.572 1.572c.038.193.038.425.038.89H18V13ZM18 17.5h2.5c0 .465 0 .697-.038.89a2 2 0 0 1-1.572 1.572C18.697 20 18.465 20 18 20v-2.5ZM13.5 17.5H16V20c-.465 0-.697 0-.89-.038a2 2 0 0 1-1.572-1.572c-.038-.193-.038-.425-.038-.89Z" fill="#fff"/></svg>`,SCAN_ICON:dr`<svg width="16" height="16" fill="none"><path fill="#fff" d="M10 15.216c0 .422.347.763.768.74 1.202-.064 2.025-.222 2.71-.613a5.001 5.001 0 0 0 1.865-1.866c.39-.684.549-1.507.613-2.709a.735.735 0 0 0-.74-.768.768.768 0 0 0-.76.732c-.009.157-.02.306-.032.447-.073.812-.206 1.244-.384 1.555-.31.545-.761.996-1.306 1.306-.311.178-.743.311-1.555.384-.141.013-.29.023-.447.032a.768.768 0 0 0-.732.76ZM10 .784c0 .407.325.737.732.76.157.009.306.02.447.032.812.073 1.244.206 1.555.384a3.5 3.5 0 0 1 1.306 1.306c.178.311.311.743.384 1.555.013.142.023.29.032.447a.768.768 0 0 0 .76.732.734.734 0 0 0 .74-.768c-.064-1.202-.222-2.025-.613-2.71A5 5 0 0 0 13.477.658c-.684-.39-1.507-.549-2.709-.613a.735.735 0 0 0-.768.74ZM5.232.044A.735.735 0 0 1 6 .784a.768.768 0 0 1-.732.76c-.157.009-.305.02-.447.032-.812.073-1.244.206-1.555.384A3.5 3.5 0 0 0 1.96 3.266c-.178.311-.311.743-.384 1.555-.013.142-.023.29-.032.447A.768.768 0 0 1 .784 6a.735.735 0 0 1-.74-.768c.064-1.202.222-2.025.613-2.71A5 5 0 0 1 2.523.658C3.207.267 4.03.108 5.233.044ZM5.268 14.456a.768.768 0 0 1 .732.76.734.734 0 0 1-.768.74c-1.202-.064-2.025-.222-2.71-.613a5 5 0 0 1-1.865-1.866c-.39-.684-.549-1.507-.613-2.709A.735.735 0 0 1 .784 10c.407 0 .737.325.76.732.009.157.02.306.032.447.073.812.206 1.244.384 1.555a3.5 3.5 0 0 0 1.306 1.306c.311.178.743.311 1.555.384.142.013.29.023.447.032Z"/></svg>`,CHECKMARK_ICON:dr`<svg width="13" height="12" viewBox="0 0 13 12"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.155.132a.75.75 0 0 1 .232 1.035L5.821 11.535a1 1 0 0 1-1.626.09L.665 7.21a.75.75 0 1 1 1.17-.937L4.71 9.867a.25.25 0 0 0 .406-.023L11.12.364a.75.75 0 0 1 1.035-.232Z" fill="#fff"/></svg>`,SEARCH_ICON:dr`<svg width="20" height="21"><path fill-rule="evenodd" clip-rule="evenodd" d="M12.432 13.992c-.354-.353-.91-.382-1.35-.146a5.5 5.5 0 1 1 2.265-2.265c-.237.441-.208.997.145 1.35l3.296 3.296a.75.75 0 1 1-1.06 1.061l-3.296-3.296Zm.06-5a4 4 0 1 1-8 0 4 4 0 0 1 8 0Z" fill="#949E9E"/></svg>`,WALLET_PLACEHOLDER:dr`<svg width="60" height="60" fill="none" viewBox="0 0 60 60"><g clip-path="url(#q)"><path id="wallet-placeholder-fill" fill="#fff" d="M0 24.9c0-9.251 0-13.877 1.97-17.332a15 15 0 0 1 5.598-5.597C11.023 0 15.648 0 24.9 0h10.2c9.252 0 13.877 0 17.332 1.97a15 15 0 0 1 5.597 5.598C60 11.023 60 15.648 60 24.9v10.2c0 9.252 0 13.877-1.97 17.332a15.001 15.001 0 0 1-5.598 5.597C48.977 60 44.352 60 35.1 60H24.9c-9.251 0-13.877 0-17.332-1.97a15 15 0 0 1-5.597-5.598C0 48.977 0 44.352 0 35.1V24.9Z"/><path id="wallet-placeholder-dash" stroke="#000" stroke-dasharray="4 4" stroke-width="1.5" d="M.04 41.708a231.598 231.598 0 0 1-.039-4.403l.75-.001L.75 35.1v-2.55H0v-5.1h.75V24.9l.001-2.204h-.75c.003-1.617.011-3.077.039-4.404l.75.016c.034-1.65.099-3.08.218-4.343l-.746-.07c.158-1.678.412-3.083.82-4.316l.713.236c.224-.679.497-1.296.827-1.875a14.25 14.25 0 0 1 1.05-1.585L3.076 5.9A15 15 0 0 1 5.9 3.076l.455.596a14.25 14.25 0 0 1 1.585-1.05c.579-.33 1.196-.603 1.875-.827l-.236-.712C10.812.674 12.217.42 13.895.262l.07.746C15.23.89 16.66.824 18.308.79l-.016-.75C19.62.012 21.08.004 22.695.001l.001.75L24.9.75h2.55V0h5.1v.75h2.55l2.204.001v-.75c1.617.003 3.077.011 4.404.039l-.016.75c1.65.034 3.08.099 4.343.218l.07-.746c1.678.158 3.083.412 4.316.82l-.236.713c.679.224 1.296.497 1.875.827a14.24 14.24 0 0 1 1.585 1.05l.455-.596A14.999 14.999 0 0 1 56.924 5.9l-.596.455c.384.502.735 1.032 1.05 1.585.33.579.602 1.196.827 1.875l.712-.236c.409 1.233.663 2.638.822 4.316l-.747.07c.119 1.264.184 2.694.218 4.343l.75-.016c.028 1.327.036 2.787.039 4.403l-.75.001.001 2.204v2.55H60v5.1h-.75v2.55l-.001 2.204h.75a231.431 231.431 0 0 1-.039 4.404l-.75-.016c-.034 1.65-.099 3.08-.218 4.343l.747.07c-.159 1.678-.413 3.083-.822 4.316l-.712-.236a10.255 10.255 0 0 1-.827 1.875 14.242 14.242 0 0 1-1.05 1.585l.596.455a14.997 14.997 0 0 1-2.824 2.824l-.455-.596c-.502.384-1.032.735-1.585 1.05-.579.33-1.196.602-1.875.827l.236.712c-1.233.409-2.638.663-4.316.822l-.07-.747c-1.264.119-2.694.184-4.343.218l.016.75c-1.327.028-2.787.036-4.403.039l-.001-.75-2.204.001h-2.55V60h-5.1v-.75H24.9l-2.204-.001v.75a231.431 231.431 0 0 1-4.404-.039l.016-.75c-1.65-.034-3.08-.099-4.343-.218l-.07.747c-1.678-.159-3.083-.413-4.316-.822l.236-.712a10.258 10.258 0 0 1-1.875-.827 14.252 14.252 0 0 1-1.585-1.05l-.455.596A14.999 14.999 0 0 1 3.076 54.1l.596-.455a14.24 14.24 0 0 1-1.05-1.585 10.259 10.259 0 0 1-.827-1.875l-.712.236C.674 49.188.42 47.783.262 46.105l.746-.07C.89 44.77.824 43.34.79 41.692l-.75.016Z"/><path fill="#fff" fill-rule="evenodd" d="M35.643 32.145c-.297-.743-.445-1.114-.401-1.275a.42.42 0 0 1 .182-.27c.134-.1.463-.1 1.123-.1.742 0 1.499.046 2.236-.05a6 6 0 0 0 5.166-5.166c.051-.39.051-.855.051-1.784 0-.928 0-1.393-.051-1.783a6 6 0 0 0-5.166-5.165c-.39-.052-.854-.052-1.783-.052h-7.72c-4.934 0-7.401 0-9.244 1.051a8 8 0 0 0-2.985 2.986C16.057 22.28 16.003 24.58 16 29 15.998 31.075 16 33.15 16 35.224A7.778 7.778 0 0 0 23.778 43H28.5c1.394 0 2.09 0 2.67-.116a6 6 0 0 0 4.715-4.714c.115-.58.115-1.301.115-2.744 0-1.31 0-1.964-.114-2.49a4.998 4.998 0 0 0-.243-.792Z" clip-rule="evenodd"/><path fill="#9EA9A9" fill-rule="evenodd" d="M37 18h-7.72c-2.494 0-4.266.002-5.647.126-1.361.122-2.197.354-2.854.728a6.5 6.5 0 0 0-2.425 2.426c-.375.657-.607 1.492-.729 2.853-.11 1.233-.123 2.777-.125 4.867 0 .7 0 1.05.097 1.181.096.13.182.181.343.2.163.02.518-.18 1.229-.581a6.195 6.195 0 0 1 3.053-.8H37c.977 0 1.32-.003 1.587-.038a4.5 4.5 0 0 0 3.874-3.874c.036-.268.039-.611.039-1.588 0-.976-.003-1.319-.038-1.587a4.5 4.5 0 0 0-3.875-3.874C38.32 18.004 37.977 18 37 18Zm-7.364 12.5h-7.414a4.722 4.722 0 0 0-4.722 4.723 6.278 6.278 0 0 0 6.278 6.278H28.5c1.466 0 1.98-.008 2.378-.087a4.5 4.5 0 0 0 3.535-3.536c.08-.397.087-.933.087-2.451 0-1.391-.009-1.843-.08-2.17a3.5 3.5 0 0 0-2.676-2.676c-.328-.072-.762-.08-2.108-.08Z" clip-rule="evenodd"/></g><defs><clipPath id="q"><path fill="#fff" d="M0 0h60v60H0z"/></clipPath></defs></svg>`,GLOBE_ICON:dr`<svg width="16" height="16" fill="none" viewBox="0 0 16 16"><path fill="#fff" fill-rule="evenodd" d="M15.5 8a7.5 7.5 0 1 1-15 0 7.5 7.5 0 0 1 15 0Zm-2.113.75c.301 0 .535.264.47.558a6.01 6.01 0 0 1-2.867 3.896c-.203.116-.42-.103-.334-.32.409-1.018.691-2.274.797-3.657a.512.512 0 0 1 .507-.477h1.427Zm.47-2.058c.065.294-.169.558-.47.558H11.96a.512.512 0 0 1-.507-.477c-.106-1.383-.389-2.638-.797-3.656-.087-.217.13-.437.333-.32a6.01 6.01 0 0 1 2.868 3.895Zm-4.402.558c.286 0 .515-.24.49-.525-.121-1.361-.429-2.534-.83-3.393-.279-.6-.549-.93-.753-1.112a.535.535 0 0 0-.724 0c-.204.182-.474.513-.754 1.112-.4.859-.708 2.032-.828 3.393a.486.486 0 0 0 .49.525h2.909Zm-5.415 0c.267 0 .486-.21.507-.477.106-1.383.389-2.638.797-3.656.087-.217-.13-.437-.333-.32a6.01 6.01 0 0 0-2.868 3.895c-.065.294.169.558.47.558H4.04ZM2.143 9.308c-.065-.294.169-.558.47-.558H4.04c.267 0 .486.21.507.477.106 1.383.389 2.639.797 3.657.087.217-.13.436-.333.32a6.01 6.01 0 0 1-2.868-3.896Zm3.913-.033a.486.486 0 0 1 .49-.525h2.909c.286 0 .515.24.49.525-.121 1.361-.428 2.535-.83 3.394-.279.6-.549.93-.753 1.112a.535.535 0 0 1-.724 0c-.204-.182-.474-.513-.754-1.112-.4-.859-.708-2.033-.828-3.394Z" clip-rule="evenodd"/></svg>`},eL=zt`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var tL=Object.defineProperty,rL=Object.getOwnPropertyDescriptor,iL=(t,e,r,i)=>{for(var n=i>1?void 0:i?rL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&tL(e,r,n),n};let rp=class extends Ct{render(){return Se`<div class="wcm-toolbar-placeholder"></div><div class="wcm-toolbar">${Wt.WALLET_CONNECT_LOGO} <button @click="${Xo.close}">${Wt.CROSS_ICON}</button></div>`}};rp.styles=[Bt.globalCss,eL],rp=iL([kt("wcm-modal-backcard")],rp);const nL=zt`main{padding:20px;padding-top:0;width:100%}`;var sL=Object.defineProperty,oL=Object.getOwnPropertyDescriptor,aL=(t,e,r,i)=>{for(var n=i>1?void 0:i?oL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&sL(e,r,n),n};let ip=class extends Ct{render(){return Se`<main><slot></slot></main>`}};ip.styles=[Bt.globalCss,nL],ip=aL([kt("wcm-modal-content")],ip);const cL=zt`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var uL=Object.defineProperty,fL=Object.getOwnPropertyDescriptor,hL=(t,e,r,i)=>{for(var n=i>1?void 0:i?fL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&uL(e,r,n),n};let np=class extends Ct{render(){return Se`<footer><slot></slot></footer>`}};np.styles=[Bt.globalCss,cL],np=hL([kt("wcm-modal-footer")],np);const lL=zt`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var dL=Object.defineProperty,pL=Object.getOwnPropertyDescriptor,Gu=(t,e,r,i)=>{for(var n=i>1?void 0:i?pL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&dL(e,r,n),n};let aa=class extends Ct{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return Se`<button class="wcm-back-btn" @click="${ur.goBack}">${Wt.BACK_ICON}</button>`}actionBtnTemplate(){return Se`<button class="wcm-action-btn" @click="${this.onAction}">${this.actionIcon}</button>`}render(){const t={"wcm-border":this.border},e=ur.state.history.length>1,r=this.title?Se`<wcm-text variant="big-bold">${this.title}</wcm-text>`:Se`<slot></slot>`;return Se`<header class="${Ls(t)}">${e?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}</header>`}};aa.styles=[Bt.globalCss,lL],Gu([At()],aa.prototype,"title",2),Gu([At()],aa.prototype,"onAction",2),Gu([At()],aa.prototype,"actionIcon",2),Gu([At({type:Boolean})],aa.prototype,"border",2),aa=Gu([kt("wcm-modal-header")],aa);const dt={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(t,e){const r=t.renderRoot.querySelector(e);if(!r)throw new Error(`${e} not found`);return r},getWalletIcon({id:t,image_id:e}){const{walletImages:r}=Fi.state;return r!=null&&r[t]?r[t]:e?Ai.getWalletImageUrl(e):""},getWalletName(t,e=!1){return e&&t.length>8?`${t.substring(0,8)}..`:t},isMobileAnimation(){return window.innerWidth<=dt.MOBILE_BREAKPOINT},async preloadImage(t){const e=new Promise((r,i)=>{const n=new Image;n.onload=r,n.onerror=i,n.crossOrigin="anonymous",n.src=t});return Promise.race([e,Qe.wait(3e3)])},getErrorMessage(t){return t instanceof Error?t.message:"Unknown Error"},debounce(t,e=500){let r;return(...i)=>{function n(){t(...i)}r&&clearTimeout(r),r=setTimeout(n,e)}},handleMobileLinking(t){const{walletConnectUri:e}=br.state,{mobile:r,name:i}=t,n=r?.native,s=r?.universal;dt.setRecentWallet(t);function a(u){let l="";n?l=Qe.formatUniversalUrl(n,u,i):s&&(l=Qe.formatNativeUrl(s,u,i)),Qe.openHref(l,"_self")}e&&a(e)},handleAndroidLinking(){const{walletConnectUri:t}=br.state;t&&(Qe.setWalletConnectAndroidDeepLink(t),Qe.openHref(t,"_self"))},async handleUriCopy(){const{walletConnectUri:t}=br.state;if(t)try{await navigator.clipboard.writeText(t),co.openToast("Link copied","success")}catch{co.openToast("Failed to copy","error")}},getCustomImageUrls(){const{walletImages:t}=Fi.state,e=Object.values(t??{});return Object.values(e)},truncate(t,e=8){return t.length<=e?t:`${t.substring(0,4)}...${t.substring(t.length-4)}`},setRecentWallet(t){try{localStorage.setItem(dt.WCM_RECENT_WALLET_DATA,JSON.stringify(t))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{const t=localStorage.getItem(dt.WCM_RECENT_WALLET_DATA);return t?JSON.parse(t):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes(t,e){return t.toUpperCase().includes(e.toUpperCase())},openWalletExplorerUrl(){Qe.openHref(dt.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){const{desktop:t,mobile:e}=Qe.getWalletRouterData(),r=!!t?.native,i=!!t?.universal,n=!!e?.native||!!e?.universal;return{isDesktop:r,isMobile:n,isWeb:i}},goToConnectingView(t){ur.setData({Wallet:t});const e=Qe.isMobile(),{isDesktop:r,isWeb:i,isMobile:n}=dt.getCachedRouterWalletPlatforms();e?n?ur.push("MobileConnecting"):i?ur.push("WebConnecting"):ur.push("InstallWallet"):r?ur.push("DesktopConnecting"):i?ur.push("WebConnecting"):n?ur.push("MobileQrcodeConnecting"):ur.push("InstallWallet")}},gL=zt`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var vL=Object.defineProperty,mL=Object.getOwnPropertyDescriptor,sp=(t,e,r,i)=>{for(var n=i>1?void 0:i?mL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&vL(e,r,n),n};let Yu=class extends Ct{constructor(){super(),this.view=ur.state.view,this.prevView=ur.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=ur.subscribe(t=>{this.view!==t.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([t])=>{const e=`${t.contentRect.height}px`;this.oldHeight!=="0px"&&oa(this.routerEl,{height:[this.oldHeight,e]},{duration:.2}),this.oldHeight=e}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var t,e;(t=this.unsubscribe)==null||t.call(this),(e=this.resizeObserver)==null||e.disconnect()}get routerEl(){return dt.getShadowRootElement(this,".wcm-router")}get contentEl(){return dt.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return Se`<wcm-connect-wallet-view></wcm-connect-wallet-view>`;case"DesktopConnecting":return Se`<wcm-desktop-connecting-view></wcm-desktop-connecting-view>`;case"MobileConnecting":return Se`<wcm-mobile-connecting-view></wcm-mobile-connecting-view>`;case"WebConnecting":return Se`<wcm-web-connecting-view></wcm-web-connecting-view>`;case"MobileQrcodeConnecting":return Se`<wcm-mobile-qr-connecting-view></wcm-mobile-qr-connecting-view>`;case"WalletExplorer":return Se`<wcm-wallet-explorer-view></wcm-wallet-explorer-view>`;case"Qrcode":return Se`<wcm-qrcode-view></wcm-qrcode-view>`;case"InstallWallet":return Se`<wcm-install-wallet-view></wcm-install-wallet-view>`;default:return Se`<div>Not Found</div>`}}async onChangeRoute(){await oa(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=ur.state.view,oa(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return Se`<div class="wcm-router"><div class="wcm-content">${this.viewTemplate()}</div></div>`}};Yu.styles=[Bt.globalCss,gL],sp([xi()],Yu.prototype,"view",2),sp([xi()],Yu.prototype,"prevView",2),Yu=sp([kt("wcm-modal-router")],Yu);const bL=zt`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var yL=Object.defineProperty,wL=Object.getOwnPropertyDescriptor,Iy=(t,e,r,i)=>{for(var n=i>1?void 0:i?wL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&yL(e,r,n),n};let tl=class extends Ct{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=co.subscribe(t=>{t.open?(this.open=!0,this.timeout=setTimeout(()=>co.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var t;(t=this.unsubscribe)==null||t.call(this),clearTimeout(this.timeout),co.closeToast()}render(){const{message:t,variant:e}=co.state,r={"wcm-success":e==="success","wcm-error":e==="error"};return this.open?Se`<div class="${Ls(r)}">${e==="success"?Wt.CHECKMARK_ICON:null} ${e==="error"?Wt.CROSS_ICON:null}<wcm-text variant="small-regular">${t}</wcm-text></div>`:null}};tl.styles=[Bt.globalCss,bL],Iy([xi()],tl.prototype,"open",2),tl=Iy([kt("wcm-modal-toast")],tl);const _L=.1,My=2.5,Bs=7;function op(t,e,r){return t===e?!1:(t-e<0?e-t:t-e)<=r+_L}function EL(t,e){const r=Array.prototype.slice.call(zu.create(t,{errorCorrectionLevel:e}).modules.data,0),i=Math.sqrt(r.length);return r.reduce((n,s,a)=>(a%i===0?n.push([s]):n[n.length-1].push(s))&&n,[])}const AL={generate(t,e,r){const i="#141414",n="#ffffff",s=[],a=EL(t,"Q"),u=e/a.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];l.forEach(({x:D,y:L})=>{const K=(a.length-Bs)*u*D,H=(a.length-Bs)*u*L,U=.45;for(let W=0;W<l.length;W+=1){const R=u*(Bs-W*2);s.push(dr`<rect fill="${W%2===0?i:n}" height="${R}" rx="${R*U}" ry="${R*U}" width="${R}" x="${K+u*W}" y="${H+u*W}">`)}});const d=Math.floor((r+25)/u),b=a.length/2-d/2,w=a.length/2+d/2-1,I=[];a.forEach((D,L)=>{D.forEach((K,H)=>{if(a[L][H]&&!(L<Bs&&H<Bs||L>a.length-(Bs+1)&&H<Bs||L<Bs&&H>a.length-(Bs+1))&&!(L>b&&L<w&&H>b&&H<w)){const U=L*u+u/2,W=H*u+u/2;I.push([U,W])}})});const S={};return I.forEach(([D,L])=>{S[D]?S[D].push(L):S[D]=[L]}),Object.entries(S).map(([D,L])=>{const K=L.filter(H=>L.every(U=>!op(H,U,u)));return[Number(D),K]}).forEach(([D,L])=>{L.forEach(K=>{s.push(dr`<circle cx="${D}" cy="${K}" fill="${i}" r="${u/My}">`)})}),Object.entries(S).filter(([D,L])=>L.length>1).map(([D,L])=>{const K=L.filter(H=>L.some(U=>op(H,U,u)));return[Number(D),K]}).map(([D,L])=>{L.sort((H,U)=>H<U?-1:1);const K=[];for(const H of L){const U=K.find(W=>W.some(R=>op(H,R,u)));U?U.push(H):K.push([H])}return[D,K.map(H=>[H[0],H[H.length-1]])]}).forEach(([D,L])=>{L.forEach(([K,H])=>{s.push(dr`<line x1="${D}" x2="${D}" y1="${K}" y2="${H}" stroke="${i}" stroke-width="${u/(My/2)}" stroke-linecap="round">`)})}),s}},xL=zt`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var SL=Object.defineProperty,IL=Object.getOwnPropertyDescriptor,Ec=(t,e,r,i)=>{for(var n=i>1?void 0:i?IL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&SL(e,r,n),n};let Fs=class extends Ct{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){const t=ao.state.themeMode==="light"?this.size:this.size-36;return dr`<svg height="${t}" width="${t}">${AL.generate(this.uri,t,t/4)}</svg>`}render(){const t={"wcm-dark":ao.state.themeMode==="dark"};return Se`<div style="${`width: ${this.size}px`}" class="${Ls(t)}">${this.walletId||this.imageUrl?Se`<wcm-wallet-image walletId="${fi(this.walletId)}" imageId="${fi(this.imageId)}" imageUrl="${fi(this.imageUrl)}"></wcm-wallet-image>`:Wt.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}</div>`}};Fs.styles=[Bt.globalCss,xL],Ec([At()],Fs.prototype,"uri",2),Ec([At({type:Number})],Fs.prototype,"size",2),Ec([At()],Fs.prototype,"imageId",2),Ec([At()],Fs.prototype,"walletId",2),Ec([At()],Fs.prototype,"imageUrl",2),Fs=Ec([kt("wcm-qrcode")],Fs);const ML=zt`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var CL=Object.defineProperty,DL=Object.getOwnPropertyDescriptor,Cy=(t,e,r,i)=>{for(var n=i>1?void 0:i?DL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&CL(e,r,n),n};let rl=class extends Ct{constructor(){super(...arguments),this.onChange=()=>null}render(){return Se`<input type="text" @input="${this.onChange}" placeholder="Search wallets"> ${Wt.SEARCH_ICON}`}};rl.styles=[Bt.globalCss,ML],Cy([At()],rl.prototype,"onChange",2),rl=Cy([kt("wcm-search-input")],rl);const OL=zt`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var PL=Object.defineProperty,$L=Object.getOwnPropertyDescriptor,RL=(t,e,r,i)=>{for(var n=i>1?void 0:i?$L(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&PL(e,r,n),n};let ap=class extends Ct{render(){return Se`<svg viewBox="0 0 50 50" width="24" height="24"><circle cx="25" cy="25" r="20" fill="none" stroke-width="4" stroke="#fff"/></svg>`}};ap.styles=[Bt.globalCss,OL],ap=RL([kt("wcm-spinner")],ap);const NL=zt`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var TL=Object.defineProperty,LL=Object.getOwnPropertyDescriptor,cp=(t,e,r,i)=>{for(var n=i>1?void 0:i?LL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&TL(e,r,n),n};let Ju=class extends Ct{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){const t={"wcm-big-bold":this.variant==="big-bold","wcm-medium-regular":this.variant==="medium-regular","wcm-small-regular":this.variant==="small-regular","wcm-small-thin":this.variant==="small-thin","wcm-xsmall-regular":this.variant==="xsmall-regular","wcm-xsmall-bold":this.variant==="xsmall-bold","wcm-color-primary":this.color==="primary","wcm-color-secondary":this.color==="secondary","wcm-color-tertiary":this.color==="tertiary","wcm-color-inverse":this.color==="inverse","wcm-color-accnt":this.color==="accent","wcm-color-error":this.color==="error"};return Se`<span><slot class="${Ls(t)}"></slot></span>`}};Ju.styles=[Bt.globalCss,NL],cp([At()],Ju.prototype,"variant",2),cp([At()],Ju.prototype,"color",2),Ju=cp([kt("wcm-text")],Ju);const BL=zt`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var FL=Object.defineProperty,UL=Object.getOwnPropertyDescriptor,go=(t,e,r,i)=>{for(var n=i>1?void 0:i?UL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&FL(e,r,n),n};let ms=class extends Ct{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?Se`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">RECENT</wcm-text>`:this.installed?Se`<wcm-text class="wcm-sublabel" variant="xsmall-bold" color="tertiary">INSTALLED</wcm-text>`:null}handleClick(){h6.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var t;return Se`<button @click="${this.handleClick.bind(this)}"><div><wcm-wallet-image walletId="${this.walletId}" imageId="${fi(this.imageId)}"></wcm-wallet-image><wcm-text variant="xsmall-regular">${(t=this.label)!=null?t:dt.getWalletName(this.name,!0)}</wcm-text>${this.sublabelTemplate()}</div></button>`}};ms.styles=[Bt.globalCss,BL],go([At()],ms.prototype,"onClick",2),go([At()],ms.prototype,"name",2),go([At()],ms.prototype,"walletId",2),go([At()],ms.prototype,"label",2),go([At()],ms.prototype,"imageId",2),go([At({type:Boolean})],ms.prototype,"installed",2),go([At({type:Boolean})],ms.prototype,"recent",2),ms=go([kt("wcm-wallet-button")],ms);const kL=zt`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var jL=Object.defineProperty,qL=Object.getOwnPropertyDescriptor,il=(t,e,r,i)=>{for(var n=i>1?void 0:i?qL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&jL(e,r,n),n};let Ac=class extends Ct{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var t;const e=(t=this.imageUrl)!=null&&t.length?this.imageUrl:dt.getWalletIcon({id:this.walletId,image_id:this.imageId});return Se`${e.length?Se`<div><img crossorigin="anonymous" src="${e}" alt="${this.id}"></div>`:Wt.WALLET_PLACEHOLDER}`}};Ac.styles=[Bt.globalCss,kL],il([At()],Ac.prototype,"walletId",2),il([At()],Ac.prototype,"imageId",2),il([At()],Ac.prototype,"imageUrl",2),Ac=il([kt("wcm-wallet-image")],Ac);var zL=Object.defineProperty,HL=Object.getOwnPropertyDescriptor,Dy=(t,e,r,i)=>{for(var n=i>1?void 0:i?HL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&zL(e,r,n),n};let up=class extends Ct{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(t){try{t!=null&&t.length&&await Promise.all(t.map(async e=>dt.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",t)}}async preloadListings(){if(Fi.state.enableExplorer){await Ai.getRecomendedWallets(),br.setIsDataLoaded(!0);const{recomendedWallets:t}=Ai.state,e=t.map(r=>dt.getWalletIcon(r));await this.loadImages(e)}else br.setIsDataLoaded(!0)}async preloadCustomImages(){const t=dt.getCustomImageUrls();await this.loadImages(t)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(t){console.error(t),co.openToast("Failed preloading","error")}}};Dy([xi()],up.prototype,"preload",2),up=Dy([kt("wcm-explorer-context")],up);var KL=Object.defineProperty,WL=Object.getOwnPropertyDescriptor,VL=(t,e,r,i)=>{for(var n=i>1?void 0:i?WL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&KL(e,r,n),n};let Oy=class extends Ct{constructor(){super(),this.unsubscribeTheme=void 0,Bt.setTheme(),this.unsubscribeTheme=ao.subscribe(Bt.setTheme)}disconnectedCallback(){var t;(t=this.unsubscribeTheme)==null||t.call(this)}};Oy=VL([kt("wcm-theme-context")],Oy);const GL=zt`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var YL=Object.defineProperty,JL=Object.getOwnPropertyDescriptor,QL=(t,e,r,i)=>{for(var n=i>1?void 0:i?JL(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&YL(e,r,n),n};let fp=class extends Ct{onGoToQrcode(){ur.push("Qrcode")}render(){const{recomendedWallets:t}=Ai.state,e=[...t,...t],r=Qe.RECOMMENDED_WALLET_AMOUNT*2;return Se`<wcm-modal-header title="Connect your wallet" .onAction="${this.onGoToQrcode}" .actionIcon="${Wt.QRCODE_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-title">${Wt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">WalletConnect</wcm-text></div><div class="wcm-slider"><div class="wcm-track">${[...Array(r)].map((i,n)=>{const s=e[n%e.length];return s?Se`<wcm-wallet-image walletId="${s.id}" imageId="${s.image_id}"></wcm-wallet-image>`:Wt.WALLET_PLACEHOLDER})}</div><wcm-button-big @click="${dt.handleAndroidLinking}"><wcm-text variant="medium-regular" color="inverse">Select Wallet</wcm-text></wcm-button-big></div></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">Choose WalletConnect to see supported apps on your device</wcm-text></wcm-info-footer>`}};fp.styles=[Bt.globalCss,GL],fp=QL([kt("wcm-android-wallet-selection")],fp);const ZL=zt`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var XL=Object.defineProperty,eB=Object.getOwnPropertyDescriptor,xc=(t,e,r,i)=>{for(var n=i>1?void 0:i?eB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&XL(e,r,n),n};let vo=class extends Ct{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var t,e;const r=(e=(t=ao.state.themeVariables)==null?void 0:t["--wcm-wallet-icon-large-border-radius"])!=null?e:Bt.getPreset("--wcm-wallet-icon-large-border-radius");let i=0;r.includes("%")?i=88/100*parseInt(r,10):i=parseInt(r,10),i*=1.17;const n=317-i*1.57,s=425-i*1.8;return Se`<svg viewBox="0 0 110 110" width="110" height="110"><rect id="wcm-loader" x="2" y="2" width="106" height="106" rx="${i}"/><use xlink:href="#wcm-loader" stroke-dasharray="106 ${n}" stroke-dashoffset="${s}"></use></svg>`}render(){const t={"wcm-error":this.isError,"wcm-stale":this.isStale};return Se`<div class="${Ls(t)}">${this.svgLoaderTemplate()}<wcm-wallet-image walletId="${fi(this.walletId)}" imageId="${fi(this.imageId)}"></wcm-wallet-image></div><wcm-text variant="medium-regular" color="${this.isError?"error":"primary"}">${this.isError?"Connection declined":this.label}</wcm-text>`}};vo.styles=[Bt.globalCss,ZL],xc([At()],vo.prototype,"walletId",2),xc([At()],vo.prototype,"imageId",2),xc([At({type:Boolean})],vo.prototype,"isError",2),xc([At({type:Boolean})],vo.prototype,"isStale",2),xc([At()],vo.prototype,"label",2),vo=xc([kt("wcm-connector-waiting")],vo);const Sc={manualWallets(){var t,e;const{mobileWallets:r,desktopWallets:i}=Fi.state,n=(t=Sc.recentWallet())==null?void 0:t.id,s=Qe.isMobile()?r:i,a=s?.filter(u=>n!==u.id);return(e=Qe.isMobile()?a?.map(({id:u,name:l,links:d})=>({id:u,name:l,mobile:d,links:d})):a?.map(({id:u,name:l,links:d})=>({id:u,name:l,desktop:d,links:d})))!=null?e:[]},recentWallet(){return dt.getRecentWallet()},recomendedWallets(t=!1){var e;const r=t||(e=Sc.recentWallet())==null?void 0:e.id,{recomendedWallets:i}=Ai.state;return i.filter(n=>r!==n.id)}},mo={onConnecting(t){dt.goToConnectingView(t)},manualWalletsTemplate(){return Sc.manualWallets().map(t=>Se`<wcm-wallet-button walletId="${t.id}" name="${t.name}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`)},recomendedWalletsTemplate(t=!1){return Sc.recomendedWallets(t).map(e=>Se`<wcm-wallet-button name="${e.name}" walletId="${e.id}" imageId="${e.image_id}" .onClick="${()=>this.onConnecting(e)}"></wcm-wallet-button>`)},recentWalletTemplate(){const t=Sc.recentWallet();if(t)return Se`<wcm-wallet-button name="${t.name}" walletId="${t.id}" imageId="${fi(t.image_id)}" .recent="${!0}" .onClick="${()=>this.onConnecting(t)}"></wcm-wallet-button>`}},tB=zt`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var rB=Object.defineProperty,iB=Object.getOwnPropertyDescriptor,nB=(t,e,r,i)=>{for(var n=i>1?void 0:i?iB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&rB(e,r,n),n};let hp=class extends Ct{render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=Fi.state,r=t!=="ALL"&&e,i=mo.manualWalletsTemplate(),n=mo.recomendedWalletsTemplate();let s=[mo.recentWalletTemplate(),...i,...n];s=s.filter(Boolean);const a=s.length>4||r;let u=[];a?u=s.slice(0,3):u=s;const l=!!u.length;return Se`<wcm-modal-header .border="${!0}" title="Connect your wallet" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><div class="wcm-mobile-title"><div class="wcm-subtitle">${Wt.MOBILE_ICON}<wcm-text variant="small-regular" color="accent">Mobile</wcm-text></div><div class="wcm-subtitle">${Wt.SCAN_ICON}<wcm-text variant="small-regular" color="secondary">Scan with your wallet</wcm-text></div></div><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>${l?Se`<wcm-modal-footer><div class="wcm-desktop-title">${Wt.DESKTOP_ICON}<wcm-text variant="small-regular" color="accent">Desktop</wcm-text></div><div class="wcm-grid">${u} ${a?Se`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-footer>`:null}`}};hp.styles=[Bt.globalCss,tB],hp=nB([kt("wcm-desktop-wallet-selection")],hp);const sB=zt`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var oB=Object.defineProperty,aB=Object.getOwnPropertyDescriptor,cB=(t,e,r,i)=>{for(var n=i>1?void 0:i?aB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&oB(e,r,n),n};let lp=class extends Ct{render(){const{termsOfServiceUrl:t,privacyPolicyUrl:e}=Fi.state;return t??e?Se`<div><wcm-text variant="small-regular" color="secondary">By connecting your wallet to this app, you agree to the app's ${t?Se`<a href="${t}" target="_blank" rel="noopener noreferrer">Terms of Service</a>`:null} ${t&&e?"and":null} ${e?Se`<a href="${e}" target="_blank" rel="noopener noreferrer">Privacy Policy</a>`:null}</wcm-text></div>`:null}};lp.styles=[Bt.globalCss,sB],lp=cB([kt("wcm-legal-notice")],lp);const uB=zt`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var fB=Object.defineProperty,hB=Object.getOwnPropertyDescriptor,lB=(t,e,r,i)=>{for(var n=i>1?void 0:i?hB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&fB(e,r,n),n};let dp=class extends Ct{onQrcode(){ur.push("Qrcode")}render(){const{explorerExcludedWalletIds:t,enableExplorer:e}=Fi.state,r=t!=="ALL"&&e,i=mo.manualWalletsTemplate(),n=mo.recomendedWalletsTemplate();let s=[mo.recentWalletTemplate(),...i,...n];s=s.filter(Boolean);const a=s.length>8||r;let u=[];a?u=s.slice(0,7):u=s;const l=!!u.length;return Se`<wcm-modal-header title="Connect your wallet" .onAction="${this.onQrcode}" .actionIcon="${Wt.QRCODE_ICON}"></wcm-modal-header>${l?Se`<wcm-modal-content><div>${u} ${a?Se`<wcm-view-all-wallets-button></wcm-view-all-wallets-button>`:null}</div></wcm-modal-content>`:null}`}};dp.styles=[Bt.globalCss,uB],dp=lB([kt("wcm-mobile-wallet-selection")],dp);const dB=zt`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var pB=Object.defineProperty,gB=Object.getOwnPropertyDescriptor,pp=(t,e,r,i)=>{for(var n=i>1?void 0:i?gB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&pB(e,r,n),n};let Ic=class extends Ct{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=Xo.subscribe(t=>{t.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var t;(t=this.unsubscribeModal)==null||t.call(this)}get overlayEl(){return dt.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return dt.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(t){document.querySelector("body")&&(t?document.getElementById("wcm-styles")?.remove():document.head.insertAdjacentHTML("beforeend",'<style id="wcm-styles">html,body{touch-action:none;overflow:hidden;overscroll-behavior:contain;}</style>'))}onCloseModal(t){t.target===t.currentTarget&&Xo.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{const t=dt.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]},e=.1,r=.2;await Promise.all([oa(this.overlayEl,{opacity:[0,1]},{delay:e,duration:r}).finished,oa(this.containerEl,t,{delay:e,duration:r}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();const t=dt.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]},e=.2;await Promise.all([oa(this.overlayEl,{opacity:[1,0]},{duration:e}).finished,oa(this.containerEl,t,{duration:e}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",t=>{var e;t.key==="Escape"?Xo.close():t.key==="Tab"&&((e=t.target)!=null&&e.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var t;(t=this.abortController)==null||t.abort(),this.abortController=void 0}render(){const t={"wcm-overlay":!0,"wcm-active":this.active};return Se`<wcm-explorer-context></wcm-explorer-context><wcm-theme-context></wcm-theme-context><div id="wcm-modal" class="${Ls(t)}" @click="${this.onCloseModal}" role="alertdialog" aria-modal="true"><div class="wcm-container" tabindex="0">${this.open?Se`<wcm-modal-backcard></wcm-modal-backcard><div class="wcm-card"><wcm-modal-router></wcm-modal-router><wcm-modal-toast></wcm-modal-toast></div>`:null}</div></div>`}};Ic.styles=[Bt.globalCss,dB],pp([xi()],Ic.prototype,"open",2),pp([xi()],Ic.prototype,"active",2),Ic=pp([kt("wcm-modal")],Ic);const vB=zt`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var mB=Object.defineProperty,bB=Object.getOwnPropertyDescriptor,Qu=(t,e,r,i)=>{for(var n=i>1?void 0:i?bB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&mB(e,r,n),n};let ca=class extends Ct{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){Qe.isMobile()?ur.replace("MobileConnecting"):ur.replace("MobileQrcodeConnecting")}onDesktop(){ur.replace("DesktopConnecting")}onWeb(){ur.replace("WebConnecting")}render(){return Se`<div>${this.isRetry?Se`<slot></slot>`:null} ${this.isMobile?Se`<wcm-button .onClick="${this.onMobile}" .iconLeft="${Wt.MOBILE_ICON}" variant="outline">Mobile</wcm-button>`:null} ${this.isDesktop?Se`<wcm-button .onClick="${this.onDesktop}" .iconLeft="${Wt.DESKTOP_ICON}" variant="outline">Desktop</wcm-button>`:null} ${this.isWeb?Se`<wcm-button .onClick="${this.onWeb}" .iconLeft="${Wt.GLOBE_ICON}" variant="outline">Web</wcm-button>`:null}</div>`}};ca.styles=[Bt.globalCss,vB],Qu([At({type:Boolean})],ca.prototype,"isMobile",2),Qu([At({type:Boolean})],ca.prototype,"isDesktop",2),Qu([At({type:Boolean})],ca.prototype,"isWeb",2),Qu([At({type:Boolean})],ca.prototype,"isRetry",2),ca=Qu([kt("wcm-platform-selection")],ca);const yB=zt`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var wB=Object.defineProperty,_B=Object.getOwnPropertyDescriptor,EB=(t,e,r,i)=>{for(var n=i>1?void 0:i?_B(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&wB(e,r,n),n};let gp=class extends Ct{onClick(){ur.push("WalletExplorer")}render(){const{recomendedWallets:t}=Ai.state,e=Sc.manualWallets(),r=[...t,...e].reverse().slice(0,4);return Se`<button @click="${this.onClick}"><div class="wcm-icons">${r.map(i=>{const n=dt.getWalletIcon(i);if(n)return Se`<img crossorigin="anonymous" src="${n}">`;const s=dt.getWalletIcon({id:i.id});return s?Se`<img crossorigin="anonymous" src="${s}">`:Wt.WALLET_PLACEHOLDER})} ${[...Array(4-r.length)].map(()=>Wt.WALLET_PLACEHOLDER)}</div><wcm-text variant="xsmall-regular">View All</wcm-text></button>`}};gp.styles=[Bt.globalCss,yB],gp=EB([kt("wcm-view-all-wallets-button")],gp);const AB=zt`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var xB=Object.defineProperty,SB=Object.getOwnPropertyDescriptor,nl=(t,e,r,i)=>{for(var n=i>1?void 0:i?SB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&xB(e,r,n),n};let Mc=class extends Ct{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{const{walletConnectUri:t}=br.state;this.uri=t},0)}get overlayEl(){return dt.getShadowRootElement(this,".wcm-qr-container")}render(){return Se`<div class="wcm-qr-container">${this.uri?Se`<wcm-qrcode size="${this.overlayEl.offsetWidth}" uri="${this.uri}" walletId="${fi(this.walletId)}" imageId="${fi(this.imageId)}"></wcm-qrcode>`:Se`<wcm-spinner></wcm-spinner>`}</div>`}};Mc.styles=[Bt.globalCss,AB],nl([At()],Mc.prototype,"walletId",2),nl([At()],Mc.prototype,"imageId",2),nl([xi()],Mc.prototype,"uri",2),Mc=nl([kt("wcm-walletconnect-qr")],Mc);var IB=Object.defineProperty,MB=Object.getOwnPropertyDescriptor,CB=(t,e,r,i)=>{for(var n=i>1?void 0:i?MB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&IB(e,r,n),n};let vp=class extends Ct{viewTemplate(){return Qe.isAndroid()?Se`<wcm-android-wallet-selection></wcm-android-wallet-selection>`:Qe.isMobile()?Se`<wcm-mobile-wallet-selection></wcm-mobile-wallet-selection>`:Se`<wcm-desktop-wallet-selection></wcm-desktop-wallet-selection>`}render(){return Se`${this.viewTemplate()}<wcm-legal-notice></wcm-legal-notice>`}};vp.styles=[Bt.globalCss],vp=CB([kt("wcm-connect-wallet-view")],vp);const DB=zt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var OB=Object.defineProperty,PB=Object.getOwnPropertyDescriptor,Py=(t,e,r,i)=>{for(var n=i>1?void 0:i?PB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&OB(e,r,n),n};let sl=class extends Ct{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(t){const{desktop:e,name:r}=Qe.getWalletRouterData(),i=e?.native;if(i){const n=Qe.formatNativeUrl(i,t,r);Qe.openHref(n,"_self")}}openDesktopApp(){const{walletConnectUri:t}=br.state,e=Qe.getWalletRouterData();dt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=Qe.getWalletRouterData(),{isMobile:i,isWeb:n}=dt.getCachedRouterWalletPlatforms();return Se`<wcm-modal-header title="${t}" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${fi(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Connection can continue loading if ${t} is not installed on your device`}</wcm-text><wcm-platform-selection .isMobile="${i}" .isWeb="${n}" .isRetry="${!0}"><wcm-button .onClick="${this.openDesktopApp.bind(this)}" .iconRight="${Wt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};sl.styles=[Bt.globalCss,DB],Py([xi()],sl.prototype,"isError",2),sl=Py([kt("wcm-desktop-connecting-view")],sl);const $B=zt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var RB=Object.defineProperty,NB=Object.getOwnPropertyDescriptor,TB=(t,e,r,i)=>{for(var n=i>1?void 0:i?NB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&RB(e,r,n),n};let mp=class extends Ct{onInstall(t){t&&Qe.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,homepage:i}=Qe.getWalletRouterData();return Se`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${fi(r)}" label="Not Detected" .isStale="${!0}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Download ${t} to continue. If multiple browser extensions are installed, disable non ${t} ones and try again`}</wcm-text><wcm-button .onClick="${()=>this.onInstall(i)}" .iconLeft="${Wt.ARROW_DOWN_ICON}">Download</wcm-button></wcm-info-footer>`}};mp.styles=[Bt.globalCss,$B],mp=TB([kt("wcm-install-wallet-view")],mp);const LB=zt`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var BB=Object.defineProperty,FB=Object.getOwnPropertyDescriptor,$y=(t,e,r,i)=>{for(var n=i>1?void 0:i?FB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&BB(e,r,n),n};let ol=class extends Ct{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(t,e=!1){const{mobile:r,name:i}=Qe.getWalletRouterData(),n=r?.native,s=r?.universal;if(n&&!e){const a=Qe.formatNativeUrl(n,t,i);Qe.openHref(a,"_self")}else if(s){const a=Qe.formatUniversalUrl(s,t,i);Qe.openHref(a,"_self")}}openMobileApp(t=!1){const{walletConnectUri:e}=br.state,r=Qe.getWalletRouterData();dt.setRecentWallet(r),e&&this.onFormatAndRedirect(e,t)}onGoToAppStore(t){t&&Qe.openHref(t,"_blank")}render(){const{name:t,id:e,image_id:r,app:i,mobile:n}=Qe.getWalletRouterData(),{isWeb:s}=dt.getCachedRouterWalletPlatforms(),a=i?.ios,u=n?.universal;return Se`<wcm-modal-header title="${t}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${fi(r)}" label="Tap 'Open' to continue…" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer class="wcm-note"><wcm-platform-selection .isWeb="${s}" .isRetry="${!0}"><wcm-button .onClick="${()=>this.openMobileApp(!1)}" .iconRight="${Wt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection>${u?Se`<wcm-text color="secondary" variant="small-thin">Still doesn't work? <span tabindex="0" @click="${()=>this.openMobileApp(!0)}">Try this alternate link</span></wcm-text>`:null}</wcm-info-footer><wcm-info-footer class="wcm-app-store"><div><wcm-wallet-image walletId="${e}" imageId="${fi(r)}"></wcm-wallet-image><wcm-text>${`Get ${t}`}</wcm-text></div><wcm-button .iconRight="${Wt.ARROW_RIGHT_ICON}" .onClick="${()=>this.onGoToAppStore(a)}" variant="ghost">App Store</wcm-button></wcm-info-footer>`}};ol.styles=[Bt.globalCss,LB],$y([xi()],ol.prototype,"isError",2),ol=$y([kt("wcm-mobile-connecting-view")],ol);const UB=zt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var kB=Object.defineProperty,jB=Object.getOwnPropertyDescriptor,qB=(t,e,r,i)=>{for(var n=i>1?void 0:i?jB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&kB(e,r,n),n};let bp=class extends Ct{render(){const{name:t,id:e,image_id:r}=Qe.getWalletRouterData(),{isDesktop:i,isWeb:n}=dt.getCachedRouterWalletPlatforms();return Se`<wcm-modal-header title="${t}" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr walletId="${e}" imageId="${fi(r)}"></wcm-walletconnect-qr></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`Scan this QR Code with your phone's camera or inside ${t} app`}</wcm-text><wcm-platform-selection .isDesktop="${i}" .isWeb="${n}"></wcm-platform-selection></wcm-info-footer>`}};bp.styles=[Bt.globalCss,UB],bp=qB([kt("wcm-mobile-qr-connecting-view")],bp);var zB=Object.defineProperty,HB=Object.getOwnPropertyDescriptor,KB=(t,e,r,i)=>{for(var n=i>1?void 0:i?HB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&zB(e,r,n),n};let yp=class extends Ct{render(){return Se`<wcm-modal-header title="Scan the code" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-walletconnect-qr></wcm-walletconnect-qr></wcm-modal-content>`}};yp.styles=[Bt.globalCss],yp=KB([kt("wcm-qrcode-view")],yp);const WB=zt`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var VB=Object.defineProperty,GB=Object.getOwnPropertyDescriptor,Zu=(t,e,r,i)=>{for(var n=i>1?void 0:i?GB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&VB(e,r,n),n};const wp=40;let ua=class extends Ct{constructor(){super(...arguments),this.loading=!Ai.state.wallets.listings.length,this.firstFetch=!Ai.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=dt.debounce(t=>{t.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=t,Ai.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),Ai.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var t;(t=this.intersectionObserver)==null||t.disconnect()}get placeholderEl(){return dt.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([t])=>{t.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){const{wallets:t,search:e}=Ai.state,{listings:r,total:i}=this.search?e:t;return i<=wp||r.length>=i}async fetchWallets(){var t;const{wallets:e,search:r}=Ai.state,{listings:i,total:n,page:s}=this.search?r:e;if(!this.endReached&&(this.firstFetch||n>wp&&i.length<n))try{this.loading=!0;const a=(t=br.state.chains)==null?void 0:t.join(","),{listings:u}=await Ai.getWallets({page:this.firstFetch?1:s+1,entries:wp,search:this.search,version:2,chains:a}),l=u.map(d=>dt.getWalletIcon(d));await Promise.all([...l.map(async d=>dt.preloadImage(d)),Qe.wait(300)]),this.endReached=this.isLastPage()}catch(a){console.error(a),co.openToast(dt.getErrorMessage(a),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(t){Qe.isAndroid()?dt.handleMobileLinking(t):dt.goToConnectingView(t)}onSearchChange(t){const{value:e}=t.target;this.searchDebounce(e)}render(){const{wallets:t,search:e}=Ai.state,{listings:r}=this.search?e:t,i=this.loading&&!r.length,n=this.search.length>=3;let s=mo.manualWalletsTemplate(),a=mo.recomendedWalletsTemplate(!0);n&&(s=s.filter(({values:d})=>dt.caseSafeIncludes(d[0],this.search)),a=a.filter(({values:d})=>dt.caseSafeIncludes(d[0],this.search)));const u=!this.loading&&!r.length&&!a.length,l={"wcm-loading":i,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":u};return Se`<wcm-modal-header><wcm-search-input .onChange="${this.onSearchChange.bind(this)}"></wcm-search-input></wcm-modal-header><wcm-modal-content class="${Ls(l)}"><div class="wcm-grid">${i?null:s} ${i?null:a} ${i?null:r.map(d=>Se`${d?Se`<wcm-wallet-button imageId="${d.image_id}" name="${d.name}" walletId="${d.id}" .onClick="${()=>this.onConnect(d)}"></wcm-wallet-button>`:null}`)}</div><div class="wcm-placeholder-block">${u?Se`<wcm-text variant="big-bold" color="secondary">No results found</wcm-text>`:null} ${!u&&this.loading?Se`<wcm-spinner></wcm-spinner>`:null}</div></wcm-modal-content>`}};ua.styles=[Bt.globalCss,WB],Zu([xi()],ua.prototype,"loading",2),Zu([xi()],ua.prototype,"firstFetch",2),Zu([xi()],ua.prototype,"search",2),Zu([xi()],ua.prototype,"endReached",2),ua=Zu([kt("wcm-wallet-explorer-view")],ua);const YB=zt`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var JB=Object.defineProperty,QB=Object.getOwnPropertyDescriptor,Ry=(t,e,r,i)=>{for(var n=i>1?void 0:i?QB(e,r):e,s=t.length-1,a;s>=0;s--)(a=t[s])&&(n=(i?a(e,r,n):a(n))||n);return i&&n&&JB(e,r,n),n};let al=class extends Ct{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(t){const{desktop:e,name:r}=Qe.getWalletRouterData(),i=e?.universal;if(i){const n=Qe.formatUniversalUrl(i,t,r);Qe.openHref(n,"_blank")}}openWebWallet(){const{walletConnectUri:t}=br.state,e=Qe.getWalletRouterData();dt.setRecentWallet(e),t&&this.onFormatAndRedirect(t)}render(){const{name:t,id:e,image_id:r}=Qe.getWalletRouterData(),{isMobile:i,isDesktop:n}=dt.getCachedRouterWalletPlatforms(),s=Qe.isMobile();return Se`<wcm-modal-header title="${t}" .onAction="${dt.handleUriCopy}" .actionIcon="${Wt.COPY_ICON}"></wcm-modal-header><wcm-modal-content><wcm-connector-waiting walletId="${e}" imageId="${fi(r)}" label="${`Continue in ${t}...`}" .isError="${this.isError}"></wcm-connector-waiting></wcm-modal-content><wcm-info-footer><wcm-text color="secondary" variant="small-thin">${`${t} web app has opened in a new tab. Go there, accept the connection, and come back`}</wcm-text><wcm-platform-selection .isMobile="${i}" .isDesktop="${s?!1:n}" .isRetry="${!0}"><wcm-button .onClick="${this.openWebWallet.bind(this)}" .iconRight="${Wt.RETRY_ICON}">Retry</wcm-button></wcm-platform-selection></wcm-info-footer>`}};al.styles=[Bt.globalCss,YB],Ry([xi()],al.prototype,"isError",2),al=Ry([kt("wcm-web-connecting-view")],al);var ZB=Object.freeze({__proto__:null,get WcmModal(){return Ic},get WcmQrCode(){return Fs}});pn.EthereumProvider=ER,pn.OPTIONAL_EVENTS=o6,pn.OPTIONAL_METHODS=s6,pn.REQUIRED_EVENTS=$h,pn.REQUIRED_METHODS=Ph,pn.default=Th,Object.defineProperty(pn,"__esModule",{value:!0})});
123
123
  //# sourceMappingURL=index.umd.js.map