import{e as ft}from"./index-BNXDN8h1.js";import{a as Fn,p as Se}from"./thirdweb-Co3M1EyP.js";import{c as _n}from"./index-DnKfU2ei.js";import{g as ge}from"./ui-BJj_Hssx.js";var Pe={};/*! *****************************************************************************
Copyright (c) Microsoft Corporation.

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var rt=function(e,t){return rt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},rt(e,t)};function An(e,t){rt(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var nt=function(){return nt=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},nt.apply(this,arguments)};function vn(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function Sn(e,t,r,n){var i=arguments.length,o=i<3?t:n===null?n=Object.getOwnPropertyDescriptor(t,r):n,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(i<3?s(o):i>3?s(t,r,o):s(t,r))||o);return i>3&&o&&Object.defineProperty(t,r,o),o}function Cn(e,t){return function(r,n){t(r,n,e)}}function xn(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function On(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(c){try{l(n.next(c))}catch(g){s(g)}}function u(c){try{l(n.throw(c))}catch(g){s(g)}}function l(c){c.done?o(c.value):i(c.value).then(a,u)}l((n=n.apply(e,t||[])).next())})}function Bn(e,t){var r={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,s;return s={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(l){return function(c){return u([l,c])}}function u(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,i&&(o=l[0]&2?i.return:l[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,l[1])).done)return o;switch(i=0,o&&(l=[l[0]&2,o.value]),l[0]){case 0:case 1:o=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,i=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!o||l[1]>o[0]&&l[1]<o[3])){r.label=l[1];break}if(l[0]===6&&r.label<o[1]){r.label=o[1],o=l;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(l);break}o[2]&&r.ops.pop(),r.trys.pop();continue}l=t.call(e,r)}catch(c){l=[6,c],i=0}finally{n=o=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Un(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}function Tn(e,t){for(var r in e)r!=="default"&&!t.hasOwnProperty(r)&&(t[r]=e[r])}function ot(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function mr(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function Rn(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(mr(arguments[t]));return e}function Nn(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function Ee(e){return this instanceof Ee?(this.v=e,this):new Ee(e)}function In(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i;function s(w){n[w]&&(i[w]=function(E){return new Promise(function(h,D){o.push([w,E,h,D])>1||a(w,E)})})}function a(w,E){try{u(n[w](E))}catch(h){g(o[0][3],h)}}function u(w){w.value instanceof Ee?Promise.resolve(w.value.v).then(l,c):g(o[0][2],w)}function l(w){a("next",w)}function c(w){a("throw",w)}function g(w,E){w(E),o.shift(),o.length&&a(o[0][0],o[0][1])}}function Mn(e){var t,r;return t={},n("next"),n("throw",function(i){throw i}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(i,o){t[i]=e[i]?function(s){return(r=!r)?{value:Ee(e[i](s)),done:i==="return"}:o?o(s):s}:o}}function Pn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof ot=="function"?ot(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(s){return new Promise(function(a,u){s=e[o](s),i(a,u,s.done,s.value)})}}function i(o,s,a,u){Promise.resolve(u).then(function(l){o({value:l,done:a})},s)}}function kn(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function jn(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function Ln(e){return e&&e.__esModule?e:{default:e}}function Wn(e,t){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return t.get(e)}function Hn(e,t,r){if(!t.has(e))throw new TypeError("attempted to set private field on non-instance");return t.set(e,r),r}const zn=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return nt},__asyncDelegator:Mn,__asyncGenerator:In,__asyncValues:Pn,__await:Ee,__awaiter:On,__classPrivateFieldGet:Wn,__classPrivateFieldSet:Hn,__createBinding:Un,__decorate:Sn,__exportStar:Tn,__extends:An,__generator:Bn,__importDefault:Ln,__importStar:jn,__makeTemplateObject:kn,__metadata:xn,__param:Cn,__read:mr,__rest:vn,__spread:Rn,__spreadArrays:Nn,__values:ot},Symbol.toStringTag,{value:"Module"})),Be=Fn(zn);var ke={},de={},Bt;function qn(){if(Bt)return de;Bt=1,Object.defineProperty(de,"__esModule",{value:!0}),de.delay=void 0;function e(t){return new Promise(r=>{setTimeout(()=>{r(!0)},t)})}return de.delay=e,de}var se={},je={},ue={},Ut;function Vn(){return Ut||(Ut=1,Object.defineProperty(ue,"__esModule",{value:!0}),ue.ONE_THOUSAND=ue.ONE_HUNDRED=void 0,ue.ONE_HUNDRED=100,ue.ONE_THOUSAND=1e3),ue}var Le={},Tt;function Yn(){return Tt||(Tt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ONE_YEAR=e.FOUR_WEEKS=e.THREE_WEEKS=e.TWO_WEEKS=e.ONE_WEEK=e.THIRTY_DAYS=e.SEVEN_DAYS=e.FIVE_DAYS=e.THREE_DAYS=e.ONE_DAY=e.TWENTY_FOUR_HOURS=e.TWELVE_HOURS=e.SIX_HOURS=e.THREE_HOURS=e.ONE_HOUR=e.SIXTY_MINUTES=e.THIRTY_MINUTES=e.TEN_MINUTES=e.FIVE_MINUTES=e.ONE_MINUTE=e.SIXTY_SECONDS=e.THIRTY_SECONDS=e.TEN_SECONDS=e.FIVE_SECONDS=e.ONE_SECOND=void 0,e.ONE_SECOND=1,e.FIVE_SECONDS=5,e.TEN_SECONDS=10,e.THIRTY_SECONDS=30,e.SIXTY_SECONDS=60,e.ONE_MINUTE=e.SIXTY_SECONDS,e.FIVE_MINUTES=e.ONE_MINUTE*5,e.TEN_MINUTES=e.ONE_MINUTE*10,e.THIRTY_MINUTES=e.ONE_MINUTE*30,e.SIXTY_MINUTES=e.ONE_MINUTE*60,e.ONE_HOUR=e.SIXTY_MINUTES,e.THREE_HOURS=e.ONE_HOUR*3,e.SIX_HOURS=e.ONE_HOUR*6,e.TWELVE_HOURS=e.ONE_HOUR*12,e.TWENTY_FOUR_HOURS=e.ONE_HOUR*24,e.ONE_DAY=e.TWENTY_FOUR_HOURS,e.THREE_DAYS=e.ONE_DAY*3,e.FIVE_DAYS=e.ONE_DAY*5,e.SEVEN_DAYS=e.ONE_DAY*7,e.THIRTY_DAYS=e.ONE_DAY*30,e.ONE_WEEK=e.SEVEN_DAYS,e.TWO_WEEKS=e.ONE_WEEK*2,e.THREE_WEEKS=e.ONE_WEEK*3,e.FOUR_WEEKS=e.ONE_WEEK*4,e.ONE_YEAR=e.ONE_DAY*365}(Le)),Le}var Rt;function Fr(){return Rt||(Rt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Be;t.__exportStar(Vn(),e),t.__exportStar(Yn(),e)}(je)),je}var Nt;function Gn(){if(Nt)return se;Nt=1,Object.defineProperty(se,"__esModule",{value:!0}),se.fromMiliseconds=se.toMiliseconds=void 0;const e=Fr();function t(n){return n*e.ONE_THOUSAND}se.toMiliseconds=t;function r(n){return Math.floor(n/e.ONE_THOUSAND)}return se.fromMiliseconds=r,se}var It;function Kn(){return It||(It=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Be;t.__exportStar(qn(),e),t.__exportStar(Gn(),e)}(ke)),ke}var ce={},Mt;function Jn(){if(Mt)return ce;Mt=1,Object.defineProperty(ce,"__esModule",{value:!0}),ce.Watch=void 0;class e{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 n=this.get(r);if(typeof n.elapsed<"u")throw new Error(`Watch already stopped for label: ${r}`);const i=Date.now()-n.started;this.timestamps.set(r,{started:n.started,elapsed:i})}get(r){const n=this.timestamps.get(r);if(typeof n>"u")throw new Error(`No timestamp found for label: ${r}`);return n}elapsed(r){const n=this.get(r);return n.elapsed||Date.now()-n.started}}return ce.Watch=e,ce.default=e,ce}var We={},be={},Pt;function Zn(){if(Pt)return be;Pt=1,Object.defineProperty(be,"__esModule",{value:!0}),be.IWatch=void 0;class e{}return be.IWatch=e,be}var kt;function Xn(){return kt||(kt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Be.__exportStar(Zn(),e)}(We)),We}var jt;function Qn(){return jt||(jt=1,function(e){Object.defineProperty(e,"__esModule",{value:!0});const t=Be;t.__exportStar(Kn(),e),t.__exportStar(Jn(),e),t.__exportStar(Xn(),e),t.__exportStar(Fr(),e)}(Pe)),Pe}var lt=Qn();class $n{}let eo=class extends $n{constructor(t){super()}};const Lt=lt.FIVE_SECONDS,to={pulse:"heartbeat_pulse"};class _r extends eo{constructor(t){super(t),this.events=new ft.EventEmitter,this.interval=Lt,this.interval=(t==null?void 0:t.interval)||Lt}static async init(t){const r=new _r(t);return await r.init(),r}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),lt.toMiliseconds(this.interval))}pulse(){this.events.emit(to.pulse)}}const ro=/"(?:_|\\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*:/,no=/"(?: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*:/,oo=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function io(e,t){if(e==="__proto__"||e==="constructor"&&t&&typeof t=="object"&&"prototype"in t){so(e);return}return t}function so(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function Va(e,t={}){if(typeof e!="string")return e;if(e[0]==='"'&&e[e.length-1]==='"'&&e.indexOf("\\")===-1)return e.slice(1,-1);const r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!oo.test(e)){if(t.strict)throw new SyntaxError("[destr] Invalid JSON");return e}try{if(ro.test(e)||no.test(e)){if(t.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(e,io)}return JSON.parse(e)}catch(n){if(t.strict)throw n;return e}}const uo=e=>JSON.stringify(e,(t,r)=>typeof r=="bigint"?r.toString()+"n":r),ao=e=>{const t=/([\[:])?(\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=e.replace(t,'$1"$2n"$3');return JSON.parse(r,(n,i)=>typeof i=="string"&&i.match(/^\d+n$/)?BigInt(i.substring(0,i.length-1)):i)};function Ar(e){if(typeof e!="string")throw new Error(`Cannot safe json parse value of type ${typeof e}`);try{return ao(e)}catch{return e}}function vr(e){return typeof e=="string"?e:uo(e)||""}function co(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Sr(e,...t){if(!co(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Wt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function fo(e,t){Sr(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}const fe=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const He=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function lo(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Cr(e){return typeof e=="string"&&(e=lo(e)),Sr(e),e}class ho{clone(){return this._cloneInto()}}function bo(e){const t=n=>e().update(Cr(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function xr(e=32){if(fe&&typeof fe.getRandomValues=="function")return fe.getRandomValues(new Uint8Array(e));if(fe&&typeof fe.randomBytes=="function")return fe.randomBytes(e);throw new Error("crypto.getRandomValues must be defined")}function Do(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),u=n?4:0,l=n?0:4;e.setUint32(t+u,s,n),e.setUint32(t+l,a,n)}class po extends ho{constructor(t,r,n,i){super(),this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=i,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=He(this.buffer)}update(t){Wt(this);const{view:r,buffer:n,blockLen:i}=this;t=Cr(t);const o=t.length;for(let s=0;s<o;){const a=Math.min(i-this.pos,o-s);if(a===i){const u=He(t);for(;i<=o-s;s+=i)this.process(u,s);continue}n.set(t.subarray(s,s+a),this.pos),this.pos+=a,s+=a,this.pos===i&&(this.process(r,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){Wt(this),fo(t,this),this.finished=!0;const{buffer:r,view:n,blockLen:i,isLE:o}=this;let{pos:s}=this;r[s++]=128,this.buffer.subarray(s).fill(0),this.padOffset>i-s&&(this.process(n,0),s=0);for(let g=s;g<i;g++)r[g]=0;Do(n,i-8,BigInt(this.length*8),o),this.process(n,0);const a=He(t),u=this.outputLen;if(u%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const l=u/4,c=this.get();if(l>c.length)throw new Error("_sha2: outputLen bigger than state");for(let g=0;g<l;g++)a.setUint32(4*g,c[g],o)}digest(){const{buffer:t,outputLen:r}=this;this.digestInto(t);const n=t.slice(0,r);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:r,buffer:n,length:i,finished:o,destroyed:s,pos:a}=this;return t.length=i,t.pos=a,t.finished=o,t.destroyed=s,i%r&&t.buffer.set(n),t}}const _e=BigInt(2**32-1),it=BigInt(32);function Or(e,t=!1){return t?{h:Number(e&_e),l:Number(e>>it&_e)}:{h:Number(e>>it&_e)|0,l:Number(e&_e)|0}}function go(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=Or(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}const wo=(e,t)=>BigInt(e>>>0)<<it|BigInt(t>>>0),Eo=(e,t,r)=>e>>>r,yo=(e,t,r)=>e<<32-r|t>>>r,mo=(e,t,r)=>e>>>r|t<<32-r,Fo=(e,t,r)=>e<<32-r|t>>>r,_o=(e,t,r)=>e<<64-r|t>>>r-32,Ao=(e,t,r)=>e>>>r-32|t<<64-r,vo=(e,t)=>t,So=(e,t)=>e,Co=(e,t,r)=>e<<r|t>>>32-r,xo=(e,t,r)=>t<<r|e>>>32-r,Oo=(e,t,r)=>t<<r-32|e>>>64-r,Bo=(e,t,r)=>e<<r-32|t>>>64-r;function Uo(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:i|0}}const To=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Ro=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,No=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),Io=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,Mo=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),Po=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,C={fromBig:Or,split:go,toBig:wo,shrSH:Eo,shrSL:yo,rotrSH:mo,rotrSL:Fo,rotrBH:_o,rotrBL:Ao,rotr32H:vo,rotr32L:So,rotlSH:Co,rotlSL:xo,rotlBH:Oo,rotlBL:Bo,add:Uo,add3L:To,add3H:Ro,add4L:No,add4H:Io,add5H:Po,add5L:Mo},[ko,jo]=C.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(e=>BigInt(e))),ne=new Uint32Array(80),oe=new Uint32Array(80);class Lo extends po{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:t,Al:r,Bh:n,Bl:i,Ch:o,Cl:s,Dh:a,Dl:u,Eh:l,El:c,Fh:g,Fl:w,Gh:E,Gl:h,Hh:D,Hl:b}=this;return[t,r,n,i,o,s,a,u,l,c,g,w,E,h,D,b]}set(t,r,n,i,o,s,a,u,l,c,g,w,E,h,D,b){this.Ah=t|0,this.Al=r|0,this.Bh=n|0,this.Bl=i|0,this.Ch=o|0,this.Cl=s|0,this.Dh=a|0,this.Dl=u|0,this.Eh=l|0,this.El=c|0,this.Fh=g|0,this.Fl=w|0,this.Gh=E|0,this.Gl=h|0,this.Hh=D|0,this.Hl=b|0}process(t,r){for(let f=0;f<16;f++,r+=4)ne[f]=t.getUint32(r),oe[f]=t.getUint32(r+=4);for(let f=16;f<80;f++){const y=ne[f-15]|0,F=oe[f-15]|0,S=C.rotrSH(y,F,1)^C.rotrSH(y,F,8)^C.shrSH(y,F,7),O=C.rotrSL(y,F,1)^C.rotrSL(y,F,8)^C.shrSL(y,F,7),x=ne[f-2]|0,N=oe[f-2]|0,te=C.rotrSH(x,N,19)^C.rotrBH(x,N,61)^C.shrSH(x,N,6),L=C.rotrSL(x,N,19)^C.rotrBL(x,N,61)^C.shrSL(x,N,6),H=C.add4L(O,L,oe[f-7],oe[f-16]),he=C.add4H(H,S,te,ne[f-7],ne[f-16]);ne[f]=he|0,oe[f]=H|0}let{Ah:n,Al:i,Bh:o,Bl:s,Ch:a,Cl:u,Dh:l,Dl:c,Eh:g,El:w,Fh:E,Fl:h,Gh:D,Gl:b,Hh:d,Hl:p}=this;for(let f=0;f<80;f++){const y=C.rotrSH(g,w,14)^C.rotrSH(g,w,18)^C.rotrBH(g,w,41),F=C.rotrSL(g,w,14)^C.rotrSL(g,w,18)^C.rotrBL(g,w,41),S=g&E^~g&D,O=w&h^~w&b,x=C.add5L(p,F,O,jo[f],oe[f]),N=C.add5H(x,d,y,S,ko[f],ne[f]),te=x|0,L=C.rotrSH(n,i,28)^C.rotrBH(n,i,34)^C.rotrBH(n,i,39),H=C.rotrSL(n,i,28)^C.rotrBL(n,i,34)^C.rotrBL(n,i,39),he=n&o^n&a^o&a,Ie=i&s^i&u^s&u;d=D|0,p=b|0,D=E|0,b=h|0,E=g|0,h=w|0,{h:g,l:w}=C.add(l|0,c|0,N|0,te|0),l=a|0,c=u|0,a=o|0,u=s|0,o=n|0,s=i|0;const A=C.add3L(te,H,Ie);n=C.add3H(A,N,L,he),i=A|0}({h:n,l:i}=C.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:o,l:s}=C.add(this.Bh|0,this.Bl|0,o|0,s|0),{h:a,l:u}=C.add(this.Ch|0,this.Cl|0,a|0,u|0),{h:l,l:c}=C.add(this.Dh|0,this.Dl|0,l|0,c|0),{h:g,l:w}=C.add(this.Eh|0,this.El|0,g|0,w|0),{h:E,l:h}=C.add(this.Fh|0,this.Fl|0,E|0,h|0),{h:D,l:b}=C.add(this.Gh|0,this.Gl|0,D|0,b|0),{h:d,l:p}=C.add(this.Hh|0,this.Hl|0,d|0,p|0),this.set(n,i,o,s,a,u,l,c,g,w,E,h,D,b,d,p)}roundClean(){ne.fill(0),oe.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const Wo=bo(()=>new Lo);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const ht=BigInt(0),Br=BigInt(1),Ho=BigInt(2);function dt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function bt(e){if(!dt(e))throw new Error("Uint8Array expected")}function ze(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}const zo=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Dt(e){bt(e);let t="";for(let r=0;r<e.length;r++)t+=zo[e[r]];return t}function Ur(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?ht:BigInt("0x"+e)}const $={_0:48,_9:57,A:65,F:70,a:97,f:102};function Ht(e){if(e>=$._0&&e<=$._9)return e-$._0;if(e>=$.A&&e<=$.F)return e-($.A-10);if(e>=$.a&&e<=$.f)return e-($.a-10)}function Tr(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let i=0,o=0;i<r;i++,o+=2){const s=Ht(e.charCodeAt(o)),a=Ht(e.charCodeAt(o+1));if(s===void 0||a===void 0){const u=e[o]+e[o+1];throw new Error('hex string expected, got non-hex character "'+u+'" at index '+o)}n[i]=s*16+a}return n}function qo(e){return Ur(Dt(e))}function Ce(e){return bt(e),Ur(Dt(Uint8Array.from(e).reverse()))}function Rr(e,t){return Tr(e.toString(16).padStart(t*2,"0"))}function st(e,t){return Rr(e,t).reverse()}function ee(e,t,r){let n;if(typeof t=="string")try{n=Tr(t)}catch(o){throw new Error(e+" must be hex string or Uint8Array, cause: "+o)}else if(dt(t))n=Uint8Array.from(t);else throw new Error(e+" must be hex string or Uint8Array");const i=n.length;if(typeof r=="number"&&i!==r)throw new Error(e+" of length "+r+" expected, got "+i);return n}function zt(...e){let t=0;for(let n=0;n<e.length;n++){const i=e[n];bt(i),t+=i.length}const r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){const o=e[n];r.set(o,i),i+=o.length}return r}const qe=e=>typeof e=="bigint"&&ht<=e;function Vo(e,t,r){return qe(e)&&qe(t)&&qe(r)&&t<=e&&e<r}function De(e,t,r,n){if(!Vo(t,r,n))throw new Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function Yo(e){let t;for(t=0;e>ht;e>>=Br,t+=1);return t}const Go=e=>(Ho<<BigInt(e-1))-Br,Ko={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||dt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function pt(e,t,r={}){const n=(i,o,s)=>{const a=Ko[o];if(typeof a!="function")throw new Error("invalid validator function");const u=e[i];if(!(s&&u===void 0)&&!a(u,e))throw new Error("param "+String(i)+" is invalid. Expected "+o+", got "+u)};for(const[i,o]of Object.entries(t))n(i,o,!1);for(const[i,o]of Object.entries(r))n(i,o,!0);return e}function qt(e){const t=new WeakMap;return(r,...n)=>{const i=t.get(r);if(i!==void 0)return i;const o=e(r,...n);return t.set(r,o),o}}const W=BigInt(0),k=BigInt(1),ae=BigInt(2),Jo=BigInt(3),ut=BigInt(4),Vt=BigInt(5),Yt=BigInt(8);function j(e,t){const r=e%t;return r>=W?r:t+r}function Zo(e,t,r){if(t<W)throw new Error("invalid exponent, negatives unsupported");if(r<=W)throw new Error("invalid modulus");if(r===k)return W;let n=k;for(;t>W;)t&k&&(n=n*e%r),e=e*e%r,t>>=k;return n}function Z(e,t,r){let n=e;for(;t-- >W;)n*=n,n%=r;return n}function Gt(e,t){if(e===W)throw new Error("invert: expected non-zero number");if(t<=W)throw new Error("invert: expected positive modulus, got "+t);let r=j(e,t),n=t,i=W,o=k;for(;r!==W;){const s=n/r,a=n%r,u=i-o*s;n=r,r=a,i=o,o=u}if(n!==k)throw new Error("invert: does not exist");return j(i,t)}function Xo(e){const t=(e-k)/ae;let r,n,i;for(r=e-k,n=0;r%ae===W;r/=ae,n++);for(i=ae;i<e&&Zo(i,t,e)!==e-k;i++)if(i>1e3)throw new Error("Cannot find square root: likely non-prime P");if(n===1){const s=(e+k)/ut;return function(a,u){const l=a.pow(u,s);if(!a.eql(a.sqr(l),u))throw new Error("Cannot find square root");return l}}const o=(r+k)/ae;return function(s,a){if(s.pow(a,t)===s.neg(s.ONE))throw new Error("Cannot find square root");let u=n,l=s.pow(s.mul(s.ONE,i),r),c=s.pow(a,o),g=s.pow(a,r);for(;!s.eql(g,s.ONE);){if(s.eql(g,s.ZERO))return s.ZERO;let w=1;for(let h=s.sqr(g);w<u&&!s.eql(h,s.ONE);w++)h=s.sqr(h);const E=s.pow(l,k<<BigInt(u-w-1));l=s.sqr(E),c=s.mul(c,E),g=s.mul(g,l),u=w}return c}}function Qo(e){if(e%ut===Jo){const t=(e+k)/ut;return function(r,n){const i=r.pow(n,t);if(!r.eql(r.sqr(i),n))throw new Error("Cannot find square root");return i}}if(e%Yt===Vt){const t=(e-Vt)/Yt;return function(r,n){const i=r.mul(n,ae),o=r.pow(i,t),s=r.mul(n,o),a=r.mul(r.mul(s,ae),o),u=r.mul(s,r.sub(a,r.ONE));if(!r.eql(r.sqr(u),n))throw new Error("Cannot find square root");return u}}return Xo(e)}const $o=(e,t)=>(j(e,t)&k)===k,ei=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ti(e){const t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=ei.reduce((n,i)=>(n[i]="function",n),t);return pt(e,r)}function ri(e,t,r){if(r<W)throw new Error("invalid exponent, negatives unsupported");if(r===W)return e.ONE;if(r===k)return t;let n=e.ONE,i=t;for(;r>W;)r&k&&(n=e.mul(n,i)),i=e.sqr(i),r>>=k;return n}function ni(e,t){const r=new Array(t.length),n=t.reduce((o,s,a)=>e.is0(s)?o:(r[a]=o,e.mul(o,s)),e.ONE),i=e.inv(n);return t.reduceRight((o,s,a)=>e.is0(s)?o:(r[a]=e.mul(o,r[a]),e.mul(o,s)),i),r}function Nr(e,t){const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function Ir(e,t,r=!1,n={}){if(e<=W)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:i,nByteLength:o}=Nr(e,t);if(o>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const a=Object.freeze({ORDER:e,isLE:r,BITS:i,BYTES:o,MASK:Go(i),ZERO:W,ONE:k,create:u=>j(u,e),isValid:u=>{if(typeof u!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof u);return W<=u&&u<e},is0:u=>u===W,isOdd:u=>(u&k)===k,neg:u=>j(-u,e),eql:(u,l)=>u===l,sqr:u=>j(u*u,e),add:(u,l)=>j(u+l,e),sub:(u,l)=>j(u-l,e),mul:(u,l)=>j(u*l,e),pow:(u,l)=>ri(a,u,l),div:(u,l)=>j(u*Gt(l,e),e),sqrN:u=>u*u,addN:(u,l)=>u+l,subN:(u,l)=>u-l,mulN:(u,l)=>u*l,inv:u=>Gt(u,e),sqrt:n.sqrt||(u=>(s||(s=Qo(e)),s(a,u))),invertBatch:u=>ni(a,u),cmov:(u,l,c)=>c?l:u,toBytes:u=>r?st(u,o):Rr(u,o),fromBytes:u=>{if(u.length!==o)throw new Error("Field.fromBytes: expected "+o+" bytes, got "+u.length);return r?Ce(u):qo(u)}});return Object.freeze(a)}const Kt=BigInt(0),Ae=BigInt(1);function Ve(e,t){const r=t.negate();return e?r:t}function Mr(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function Ye(e,t){Mr(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1);return{windows:r,windowSize:n}}function oi(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function ii(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const Ge=new WeakMap,Pr=new WeakMap;function Ke(e){return Pr.get(e)||1}function si(e,t){return{constTimeNegate:Ve,hasPrecomputes(r){return Ke(r)!==1},unsafeLadder(r,n,i=e.ZERO){let o=r;for(;n>Kt;)n&Ae&&(i=i.add(o)),o=o.double(),n>>=Ae;return i},precomputeWindow(r,n){const{windows:i,windowSize:o}=Ye(n,t),s=[];let a=r,u=a;for(let l=0;l<i;l++){u=a,s.push(u);for(let c=1;c<o;c++)u=u.add(a),s.push(u);a=u.double()}return s},wNAF(r,n,i){const{windows:o,windowSize:s}=Ye(r,t);let a=e.ZERO,u=e.BASE;const l=BigInt(2**r-1),c=2**r,g=BigInt(r);for(let w=0;w<o;w++){const E=w*s;let h=Number(i&l);i>>=g,h>s&&(h-=c,i+=Ae);const D=E,b=E+Math.abs(h)-1,d=w%2!==0,p=h<0;h===0?u=u.add(Ve(d,n[D])):a=a.add(Ve(p,n[b]))}return{p:a,f:u}},wNAFUnsafe(r,n,i,o=e.ZERO){const{windows:s,windowSize:a}=Ye(r,t),u=BigInt(2**r-1),l=2**r,c=BigInt(r);for(let g=0;g<s;g++){const w=g*a;if(i===Kt)break;let E=Number(i&u);if(i>>=c,E>a&&(E-=l,i+=Ae),E===0)continue;let h=n[w+Math.abs(E)-1];E<0&&(h=h.negate()),o=o.add(h)}return o},getPrecomputes(r,n,i){let o=Ge.get(n);return o||(o=this.precomputeWindow(n,r),r!==1&&Ge.set(n,i(o))),o},wNAFCached(r,n,i){const o=Ke(r);return this.wNAF(o,this.getPrecomputes(o,r,i),n)},wNAFCachedUnsafe(r,n,i,o){const s=Ke(r);return s===1?this.unsafeLadder(r,n,o):this.wNAFUnsafe(s,this.getPrecomputes(s,r,i),n,o)},setWindowSize(r,n){Mr(n,t),Pr.set(r,n),Ge.delete(r)}}}function ui(e,t,r,n){if(oi(r,e),ii(n,t),r.length!==n.length)throw new Error("arrays of points and scalars must have equal length");const i=e.ZERO,o=Yo(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,a=(1<<s)-1,u=new Array(a+1).fill(i),l=Math.floor((t.BITS-1)/s)*s;let c=i;for(let g=l;g>=0;g-=s){u.fill(i);for(let E=0;E<n.length;E++){const h=n[E],D=Number(h>>BigInt(g)&BigInt(a));u[D]=u[D].add(r[E])}let w=i;for(let E=u.length-1,h=i;E>0;E--)h=h.add(u[E]),w=w.add(h);if(c=c.add(w),g!==0)for(let E=0;E<s;E++)c=c.double()}return c}function ai(e){return ti(e.Fp),pt(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...Nr(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}const J=BigInt(0),G=BigInt(1),ve=BigInt(2),ci=BigInt(8),fi={zip215:!0};function li(e){const t=ai(e);return pt(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function hi(e){const t=li(e),{Fp:r,n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:u}=t,l=ve<<BigInt(a*8)-G,c=r.create,g=Ir(t.n,t.nBitLength),w=t.uvRatio||((A,m)=>{try{return{isValid:!0,value:r.sqrt(A*r.inv(m))}}catch{return{isValid:!1,value:J}}}),E=t.adjustScalarBytes||(A=>A),h=t.domain||((A,m,_)=>{if(ze("phflag",_),m.length||_)throw new Error("Contexts/pre-hash are not supported");return A});function D(A,m){De("coordinate "+A,m,J,l)}function b(A){if(!(A instanceof f))throw new Error("ExtendedPoint expected")}const d=qt((A,m)=>{const{ex:_,ey:v,ez:B}=A,U=A.is0();m==null&&(m=U?ci:r.inv(B));const T=c(_*m),M=c(v*m),I=c(B*m);if(U)return{x:J,y:G};if(I!==G)throw new Error("invZ was invalid");return{x:T,y:M}}),p=qt(A=>{const{a:m,d:_}=t;if(A.is0())throw new Error("bad point: ZERO");const{ex:v,ey:B,ez:U,et:T}=A,M=c(v*v),I=c(B*B),P=c(U*U),z=c(P*P),Y=c(M*m),X=c(P*c(Y+I)),Q=c(z+c(_*c(M*I)));if(X!==Q)throw new Error("bad point: equation left != right (1)");const K=c(v*B),re=c(U*T);if(K!==re)throw new Error("bad point: equation left != right (2)");return!0});class f{constructor(m,_,v,B){this.ex=m,this.ey=_,this.ez=v,this.et=B,D("x",m),D("y",_),D("z",v),D("t",B),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(m){if(m instanceof f)throw new Error("extended point not allowed");const{x:_,y:v}=m||{};return D("x",_),D("y",v),new f(_,v,G,c(_*v))}static normalizeZ(m){const _=r.invertBatch(m.map(v=>v.ez));return m.map((v,B)=>v.toAffine(_[B])).map(f.fromAffine)}static msm(m,_){return ui(f,g,m,_)}_setWindowSize(m){S.setWindowSize(this,m)}assertValidity(){p(this)}equals(m){b(m);const{ex:_,ey:v,ez:B}=this,{ex:U,ey:T,ez:M}=m,I=c(_*M),P=c(U*B),z=c(v*M),Y=c(T*B);return I===P&&z===Y}is0(){return this.equals(f.ZERO)}negate(){return new f(c(-this.ex),this.ey,this.ez,c(-this.et))}double(){const{a:m}=t,{ex:_,ey:v,ez:B}=this,U=c(_*_),T=c(v*v),M=c(ve*c(B*B)),I=c(m*U),P=_+v,z=c(c(P*P)-U-T),Y=I+T,X=Y-M,Q=I-T,K=c(z*X),re=c(Y*Q),ie=c(z*Q),Fe=c(X*Y);return new f(K,re,Fe,ie)}add(m){b(m);const{a:_,d:v}=t,{ex:B,ey:U,ez:T,et:M}=this,{ex:I,ey:P,ez:z,et:Y}=m;if(_===BigInt(-1)){const _t=c((U-B)*(P+I)),At=c((U+B)*(P-I)),Me=c(At-_t);if(Me===J)return this.double();const vt=c(T*ve*Y),St=c(M*ve*z),Ct=St+vt,xt=At+_t,Ot=St-vt,wn=c(Ct*Me),En=c(xt*Ot),yn=c(Ct*Ot),mn=c(Me*xt);return new f(wn,En,mn,yn)}const X=c(B*I),Q=c(U*P),K=c(M*v*Y),re=c(T*z),ie=c((B+U)*(I+P)-X-Q),Fe=re-K,mt=re+K,Ft=c(Q-_*X),bn=c(ie*Fe),Dn=c(mt*Ft),pn=c(ie*Ft),gn=c(Fe*mt);return new f(bn,Dn,gn,pn)}subtract(m){return this.add(m.negate())}wNAF(m){return S.wNAFCached(this,m,f.normalizeZ)}multiply(m){const _=m;De("scalar",_,G,n);const{p:v,f:B}=this.wNAF(_);return f.normalizeZ([v,B])[0]}multiplyUnsafe(m,_=f.ZERO){const v=m;return De("scalar",v,J,n),v===J?F:this.is0()||v===G?this:S.wNAFCachedUnsafe(this,v,f.normalizeZ,_)}isSmallOrder(){return this.multiplyUnsafe(u).is0()}isTorsionFree(){return S.unsafeLadder(this,n).is0()}toAffine(m){return d(this,m)}clearCofactor(){const{h:m}=t;return m===G?this:this.multiplyUnsafe(m)}static fromHex(m,_=!1){const{d:v,a:B}=t,U=r.BYTES;m=ee("pointHex",m,U),ze("zip215",_);const T=m.slice(),M=m[U-1];T[U-1]=M&-129;const I=Ce(T),P=_?l:r.ORDER;De("pointHex.y",I,J,P);const z=c(I*I),Y=c(z-G),X=c(v*z-B);let{isValid:Q,value:K}=w(Y,X);if(!Q)throw new Error("Point.fromHex: invalid y coordinate");const re=(K&G)===G,ie=(M&128)!==0;if(!_&&K===J&&ie)throw new Error("Point.fromHex: x=0 and x_0=1");return ie!==re&&(K=c(-K)),f.fromAffine({x:K,y:I})}static fromPrivateKey(m){return N(m).point}toRawBytes(){const{x:m,y:_}=this.toAffine(),v=st(_,r.BYTES);return v[v.length-1]|=m&G?128:0,v}toHex(){return Dt(this.toRawBytes())}}f.BASE=new f(t.Gx,t.Gy,G,c(t.Gx*t.Gy)),f.ZERO=new f(J,G,G,J);const{BASE:y,ZERO:F}=f,S=si(f,a*8);function O(A){return j(A,n)}function x(A){return O(Ce(A))}function N(A){const m=r.BYTES;A=ee("private key",A,m);const _=ee("hashed private key",o(A),2*m),v=E(_.slice(0,m)),B=_.slice(m,2*m),U=x(v),T=y.multiply(U),M=T.toRawBytes();return{head:v,prefix:B,scalar:U,point:T,pointBytes:M}}function te(A){return N(A).pointBytes}function L(A=new Uint8Array,...m){const _=zt(...m);return x(o(h(_,ee("context",A),!!i)))}function H(A,m,_={}){A=ee("message",A),i&&(A=i(A));const{prefix:v,scalar:B,pointBytes:U}=N(m),T=L(_.context,v,A),M=y.multiply(T).toRawBytes(),I=L(_.context,M,U,A),P=O(T+I*B);De("signature.s",P,J,n);const z=zt(M,st(P,r.BYTES));return ee("result",z,r.BYTES*2)}const he=fi;function Ie(A,m,_,v=he){const{context:B,zip215:U}=v,T=r.BYTES;A=ee("signature",A,2*T),m=ee("message",m),_=ee("publicKey",_,T),U!==void 0&&ze("zip215",U),i&&(m=i(m));const M=Ce(A.slice(T,2*T));let I,P,z;try{I=f.fromHex(_,U),P=f.fromHex(A.slice(0,T),U),z=y.multiplyUnsafe(M)}catch{return!1}if(!U&&I.isSmallOrder())return!1;const Y=L(B,P.toRawBytes(),I.toRawBytes(),m);return P.add(I.multiplyUnsafe(Y)).subtract(z).clearCofactor().equals(f.ZERO)}return y._setWindowSize(8),{CURVE:t,getPublicKey:te,sign:H,verify:Ie,ExtendedPoint:f,utils:{getExtendedPublicKey:N,randomPrivateKey:()=>s(r.BYTES),precompute(A=8,m=f.BASE){return m._setWindowSize(A),m.multiply(BigInt(3)),m}}}}BigInt(0),BigInt(1);const gt=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),Jt=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);const di=BigInt(1),Zt=BigInt(2);BigInt(3);const bi=BigInt(5),Di=BigInt(8);function pi(e){const t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=gt,s=e*e%o*e%o,a=Z(s,Zt,o)*s%o,u=Z(a,di,o)*e%o,l=Z(u,bi,o)*u%o,c=Z(l,t,o)*l%o,g=Z(c,r,o)*c%o,w=Z(g,n,o)*g%o,E=Z(w,i,o)*w%o,h=Z(E,i,o)*w%o,D=Z(h,t,o)*l%o;return{pow_p_5_8:Z(D,Zt,o)*e%o,b2:s}}function gi(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function wi(e,t){const r=gt,n=j(t*t*t,r),i=j(n*n*t,r),o=pi(e*i).pow_p_5_8;let s=j(e*n*o,r);const a=j(t*s*s,r),u=s,l=j(s*Jt,r),c=a===e,g=a===j(-e,r),w=a===j(-e*Jt,r);return c&&(s=u),(g||w)&&(s=l),$o(s,r)&&(s=j(-s,r)),{isValid:c||g,value:s}}const Ei=Ir(gt,void 0,!0),yi={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:Ei,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:Di,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:Wo,randomBytes:xr,adjustScalarBytes:gi,uvRatio:wi},kr=hi(yi),mi="EdDSA",Fi="JWT",xe=".",Ue="base64url",jr="utf8",Lr="utf8",_i=":",Ai="did",vi="key",Xt="base58btc",Si="z",Ci="K36",xi=32;function wt(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function Wr(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?wt(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Hr(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=Wr(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return wt(r)}function Oi(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=e.length,u=e.charAt(0),l=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function g(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var D=0,b=0,d=0,p=h.length;d!==p&&h[d]===0;)d++,D++;for(var f=(p-d)*c+1>>>0,y=new Uint8Array(f);d!==p;){for(var F=h[d],S=0,O=f-1;(F!==0||S<b)&&O!==-1;O--,S++)F+=256*y[O]>>>0,y[O]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");b=S,d++}for(var x=f-b;x!==f&&y[x]===0;)x++;for(var N=u.repeat(D);x<f;++x)N+=e.charAt(y[x]);return N}function w(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var D=0;if(h[D]!==" "){for(var b=0,d=0;h[D]===u;)b++,D++;for(var p=(h.length-D)*l+1>>>0,f=new Uint8Array(p);h[D];){var y=r[h.charCodeAt(D)];if(y===255)return;for(var F=0,S=p-1;(y!==0||F<d)&&S!==-1;S--,F++)y+=a*f[S]>>>0,f[S]=y%256>>>0,y=y/256>>>0;if(y!==0)throw new Error("Non-zero carry");d=F,D++}if(h[D]!==" "){for(var O=p-d;O!==p&&f[O]===0;)O++;for(var x=new Uint8Array(b+(p-O)),N=b;O!==p;)x[N++]=f[O++];return x}}}function E(h){var D=w(h);if(D)return D;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:w,decode:E}}var Bi=Oi,Ui=Bi;const zr=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},Ti=e=>new TextEncoder().encode(e),Ri=e=>new TextDecoder().decode(e);class Ni{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class Ii{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return qr(this,t)}}class Mi{constructor(t){this.decoders=t}or(t){return qr(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const qr=(e,t)=>new Mi({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class Pi{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new Ni(t,r,n),this.decoder=new Ii(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Te=({name:e,prefix:t,encode:r,decode:n})=>new Pi(e,t,r,n),ye=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=Ui(r,t);return Te({prefix:e,name:t,encode:n,decode:o=>zr(i(o))})},ki=(e,t,r,n)=>{const i={};for(let c=0;c<t.length;++c)i[t[c]]=c;let o=e.length;for(;e[o-1]==="=";)--o;const s=new Uint8Array(o*r/8|0);let a=0,u=0,l=0;for(let c=0;c<o;++c){const g=i[e[c]];if(g===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<r|g,a+=r,a>=8&&(a-=8,s[l++]=255&u>>a)}if(a>=r||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s},ji=(e,t,r)=>{const n=t[t.length-1]==="=",i=(1<<r)-1;let o="",s=0,a=0;for(let u=0;u<e.length;++u)for(a=a<<8|e[u],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},q=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Te({prefix:t,name:e,encode(i){return ji(i,n,r)},decode(i){return ki(i,n,r,e)}}),Li=Te({prefix:"\0",name:"identity",encode:e=>Ri(e),decode:e=>Ti(e)});var Wi=Object.freeze({__proto__:null,identity:Li});const Hi=q({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1});var zi=Object.freeze({__proto__:null,base2:Hi});const qi=q({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3});var Vi=Object.freeze({__proto__:null,base8:qi});const Yi=ye({prefix:"9",name:"base10",alphabet:"0123456789"});var Gi=Object.freeze({__proto__:null,base10:Yi});const Ki=q({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Ji=q({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4});var Zi=Object.freeze({__proto__:null,base16:Ki,base16upper:Ji});const Xi=q({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Qi=q({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),$i=q({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),es=q({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),ts=q({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),rs=q({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),ns=q({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),os=q({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),is=q({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5});var ss=Object.freeze({__proto__:null,base32:Xi,base32upper:Qi,base32pad:$i,base32padupper:es,base32hex:ts,base32hexupper:rs,base32hexpad:ns,base32hexpadupper:os,base32z:is});const us=ye({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),as=ye({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"});var cs=Object.freeze({__proto__:null,base36:us,base36upper:as});const fs=ye({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),ls=ye({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"});var hs=Object.freeze({__proto__:null,base58btc:fs,base58flickr:ls});const ds=q({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),bs=q({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ds=q({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ps=q({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6});var gs=Object.freeze({__proto__:null,base64:ds,base64pad:bs,base64url:Ds,base64urlpad:ps});const Vr=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),ws=Vr.reduce((e,t,r)=>(e[r]=t,e),[]),Es=Vr.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function ys(e){return e.reduce((t,r)=>(t+=ws[r],t),"")}function ms(e){const t=[];for(const r of e){const n=Es[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const Fs=Te({prefix:"🚀",name:"base256emoji",encode:ys,decode:ms});var _s=Object.freeze({__proto__:null,base256emoji:Fs}),As=Yr,Qt=128,vs=-128,Ss=Math.pow(2,31);function Yr(e,t,r){t=t||[],r=r||0;for(var n=r;e>=Ss;)t[r++]=e&255|Qt,e/=128;for(;e&vs;)t[r++]=e&255|Qt,e>>>=7;return t[r]=e|0,Yr.bytes=r-n+1,t}var Cs=at,xs=128,$t=127;function at(e,n){var r=0,n=n||0,i=0,o=n,s,a=e.length;do{if(o>=a)throw at.bytes=0,new RangeError("Could not decode varint");s=e[o++],r+=i<28?(s&$t)<<i:(s&$t)*Math.pow(2,i),i+=7}while(s>=xs);return at.bytes=o-n,r}var Os=Math.pow(2,7),Bs=Math.pow(2,14),Us=Math.pow(2,21),Ts=Math.pow(2,28),Rs=Math.pow(2,35),Ns=Math.pow(2,42),Is=Math.pow(2,49),Ms=Math.pow(2,56),Ps=Math.pow(2,63),ks=function(e){return e<Os?1:e<Bs?2:e<Us?3:e<Ts?4:e<Rs?5:e<Ns?6:e<Is?7:e<Ms?8:e<Ps?9:10},js={encode:As,decode:Cs,encodingLength:ks},Gr=js;const er=(e,t,r=0)=>(Gr.encode(e,t,r),t),tr=e=>Gr.encodingLength(e),ct=(e,t)=>{const r=t.byteLength,n=tr(e),i=n+tr(r),o=new Uint8Array(i+r);return er(e,o,0),er(r,o,n),o.set(t,i),new Ls(e,r,t,o)};class Ls{constructor(t,r,n,i){this.code=t,this.size=r,this.digest=n,this.bytes=i}}const Kr=({name:e,code:t,encode:r})=>new Ws(e,t,r);class Ws{constructor(t,r,n){this.name=t,this.code=r,this.encode=n}digest(t){if(t instanceof Uint8Array){const r=this.encode(t);return r instanceof Uint8Array?ct(this.code,r):r.then(n=>ct(this.code,n))}else throw Error("Unknown type, must be binary type")}}const Jr=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),Hs=Kr({name:"sha2-256",code:18,encode:Jr("SHA-256")}),zs=Kr({name:"sha2-512",code:19,encode:Jr("SHA-512")});var qs=Object.freeze({__proto__:null,sha256:Hs,sha512:zs});const Zr=0,Vs="identity",Xr=zr,Ys=e=>ct(Zr,Xr(e)),Gs={code:Zr,name:Vs,encode:Xr,digest:Ys};var Ks=Object.freeze({__proto__:null,identity:Gs});new TextEncoder,new TextDecoder;const rr={...Wi,...zi,...Vi,...Gi,...Zi,...ss,...cs,...hs,...gs,..._s};({...qs,...Ks});function Qr(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const nr=Qr("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Je=Qr("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=Wr(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),$r={utf8:nr,"utf-8":nr,hex:rr.base16,latin1:Je,ascii:Je,binary:Je,...rr};function Re(e,t="utf8"){const r=$r[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function le(e,t="utf8"){const r=$r[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?wt(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function or(e){return Ar(Re(le(e,Ue),jr))}function Oe(e){return Re(le(vr(e),jr),Ue)}function Js(e){const t=le(Ci,Xt),r=Si+Re(Hr([t,e]),Xt);return[Ai,vi,r].join(_i)}function Zs(e){return Re(e,Ue)}function Xs(e){return le(e,Ue)}function Qs(e){return le([Oe(e.header),Oe(e.payload)].join(xe),Lr)}function $s(e){return[Oe(e.header),Oe(e.payload),Zs(e.signature)].join(xe)}function Ya(e){const t=e.split(xe),r=or(t[0]),n=or(t[1]),i=Xs(t[2]),o=le(t.slice(0,2).join(xe),Lr);return{header:r,payload:n,signature:i,data:o}}function Ga(e=xr(xi)){const t=kr.getPublicKey(e);return{secretKey:Hr([e,t]),publicKey:t}}async function Ka(e,t,r,n,i=lt.fromMiliseconds(Date.now())){const o={alg:mi,typ:Fi},s=Js(n.publicKey),a=i+r,u={iss:s,sub:e,aud:t,iat:i,exp:a},l=Qs({header:o,payload:u}),c=kr.sign(l,n.secretKey.slice(0,32));return $s({header:o,payload:u,signature:c})}var ir=function(e,t,r){if(r||arguments.length===2)for(var n=0,i=t.length,o;n<i;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return e.concat(o||Array.prototype.slice.call(t))},eu=function(){function e(t,r,n){this.name=t,this.version=r,this.os=n,this.type="browser"}return e}(),tu=function(){function e(t){this.version=t,this.type="node",this.name="node",this.os=Se.platform}return e}(),ru=function(){function e(t,r,n,i){this.name=t,this.version=r,this.os=n,this.bot=i,this.type="bot-device"}return e}(),nu=function(){function e(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}return e}(),ou=function(){function e(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}return e}(),iu=/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/,su=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,sr=3,uu=[["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",iu]],ur=[["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 Ja(e){return typeof document>"u"&&typeof navigator<"u"&&navigator.product==="ReactNative"?new ou:typeof navigator<"u"?cu(navigator.userAgent):lu()}function au(e){return e!==""&&uu.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1)}function cu(e){var t=au(e);if(!t)return null;var r=t[0],n=t[1];if(r==="searchbot")return new nu;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<sr&&(i=ir(ir([],i,!0),hu(sr-i.length),!0)):i=[];var o=i.join("."),s=fu(e),a=su.exec(e);return a&&a[1]?new ru(r,o,s,a[1]):new eu(r,o,s)}function fu(e){for(var t=0,r=ur.length;t<r;t++){var n=ur[t],i=n[0],o=n[1],s=o.exec(e);if(s)return i}return null}function lu(){var e=typeof Se<"u"&&Se.version;return e?new tu(Se.version.slice(1)):null}function hu(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var R={},ar;function en(){if(ar)return R;ar=1,Object.defineProperty(R,"__esModule",{value:!0}),R.getLocalStorage=R.getLocalStorageOrThrow=R.getCrypto=R.getCryptoOrThrow=R.getLocation=R.getLocationOrThrow=R.getNavigator=R.getNavigatorOrThrow=R.getDocument=R.getDocumentOrThrow=R.getFromWindowOrThrow=R.getFromWindow=void 0;function e(w){let E;return typeof window<"u"&&typeof window[w]<"u"&&(E=window[w]),E}R.getFromWindow=e;function t(w){const E=e(w);if(!E)throw new Error(`${w} is not defined in Window`);return E}R.getFromWindowOrThrow=t;function r(){return t("document")}R.getDocumentOrThrow=r;function n(){return e("document")}R.getDocument=n;function i(){return t("navigator")}R.getNavigatorOrThrow=i;function o(){return e("navigator")}R.getNavigator=o;function s(){return t("location")}R.getLocationOrThrow=s;function a(){return e("location")}R.getLocation=a;function u(){return t("crypto")}R.getCryptoOrThrow=u;function l(){return e("crypto")}R.getCrypto=l;function c(){return t("localStorage")}R.getLocalStorageOrThrow=c;function g(){return e("localStorage")}return R.getLocalStorage=g,R}var Za=en(),pe={},cr;function du(){if(cr)return pe;cr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.getWindowMetadata=void 0;const e=en();function t(){let r,n;try{r=e.getDocumentOrThrow(),n=e.getLocationOrThrow()}catch{return null}function i(){const E=r.getElementsByTagName("link"),h=[];for(let D=0;D<E.length;D++){const b=E[D],d=b.getAttribute("rel");if(d&&d.toLowerCase().indexOf("icon")>-1){const p=b.getAttribute("href");if(p)if(p.toLowerCase().indexOf("https:")===-1&&p.toLowerCase().indexOf("http:")===-1&&p.indexOf("//")!==0){let f=n.protocol+"//"+n.host;if(p.indexOf("/")===0)f+=p;else{const y=n.pathname.split("/");y.pop();const F=y.join("/");f+=F+"/"+p}h.push(f)}else if(p.indexOf("//")===0){const f=n.protocol+p;h.push(f)}else h.push(p)}}return h}function o(...E){const h=r.getElementsByTagName("meta");for(let D=0;D<h.length;D++){const b=h[D],d=["itemprop","property","name"].map(p=>b.getAttribute(p)).filter(p=>p?E.includes(p):!1);if(d.length&&d){const p=b.getAttribute("content");if(p)return p}}return""}function s(){let E=o("name","og:site_name","og:title","twitter:title");return E||(E=r.title),E}function a(){return o("description","og:description","twitter:description","keywords")}const u=s(),l=a(),c=n.origin,g=i();return{description:l,url:c,icons:g,name:u}}return pe.getWindowMetadata=t,pe}var Xa=du();function Et(e){return globalThis.Buffer!=null?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function tn(e=0){return globalThis.Buffer!=null&&globalThis.Buffer.allocUnsafe!=null?Et(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function Qa(e,t){t||(t=e.reduce((i,o)=>i+o.length,0));const r=tn(t);let n=0;for(const i of e)r.set(i,n),n+=i.length;return Et(r)}function bu(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(r[s]!==255)throw new TypeError(o+" is ambiguous");r[s]=i}var a=e.length,u=e.charAt(0),l=Math.log(a)/Math.log(256),c=Math.log(256)/Math.log(a);function g(h){if(h instanceof Uint8Array||(ArrayBuffer.isView(h)?h=new Uint8Array(h.buffer,h.byteOffset,h.byteLength):Array.isArray(h)&&(h=Uint8Array.from(h))),!(h instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(h.length===0)return"";for(var D=0,b=0,d=0,p=h.length;d!==p&&h[d]===0;)d++,D++;for(var f=(p-d)*c+1>>>0,y=new Uint8Array(f);d!==p;){for(var F=h[d],S=0,O=f-1;(F!==0||S<b)&&O!==-1;O--,S++)F+=256*y[O]>>>0,y[O]=F%a>>>0,F=F/a>>>0;if(F!==0)throw new Error("Non-zero carry");b=S,d++}for(var x=f-b;x!==f&&y[x]===0;)x++;for(var N=u.repeat(D);x<f;++x)N+=e.charAt(y[x]);return N}function w(h){if(typeof h!="string")throw new TypeError("Expected String");if(h.length===0)return new Uint8Array;var D=0;if(h[D]!==" "){for(var b=0,d=0;h[D]===u;)b++,D++;for(var p=(h.length-D)*l+1>>>0,f=new Uint8Array(p);h[D];){var y=r[h.charCodeAt(D)];if(y===255)return;for(var F=0,S=p-1;(y!==0||F<d)&&S!==-1;S--,F++)y+=a*f[S]>>>0,f[S]=y%256>>>0,y=y/256>>>0;if(y!==0)throw new Error("Non-zero carry");d=F,D++}if(h[D]!==" "){for(var O=p-d;O!==p&&f[O]===0;)O++;for(var x=new Uint8Array(b+(p-O)),N=b;O!==p;)x[N++]=f[O++];return x}}}function E(h){var D=w(h);if(D)return D;throw new Error(`Non-${t} character`)}return{encode:g,decodeUnsafe:w,decode:E}}var Du=bu,pu=Du;const gu=e=>{if(e instanceof Uint8Array&&e.constructor.name==="Uint8Array")return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},wu=e=>new TextEncoder().encode(e),Eu=e=>new TextDecoder().decode(e);class yu{constructor(t,r,n){this.name=t,this.prefix=r,this.baseEncode=n}encode(t){if(t instanceof Uint8Array)return`${this.prefix}${this.baseEncode(t)}`;throw Error("Unknown type, must be binary type")}}class mu{constructor(t,r,n){if(this.name=t,this.prefix=r,r.codePointAt(0)===void 0)throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}decode(t){if(typeof t=="string"){if(t.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(t)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(t.slice(this.prefix.length))}else throw Error("Can only multibase decode strings")}or(t){return rn(this,t)}}class Fu{constructor(t){this.decoders=t}or(t){return rn(this,t)}decode(t){const r=t[0],n=this.decoders[r];if(n)return n.decode(t);throw RangeError(`Unable to decode multibase string ${JSON.stringify(t)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}const rn=(e,t)=>new Fu({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class _u{constructor(t,r,n,i){this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new yu(t,r,n),this.decoder=new mu(t,r,i)}encode(t){return this.encoder.encode(t)}decode(t){return this.decoder.decode(t)}}const Ne=({name:e,prefix:t,encode:r,decode:n})=>new _u(e,t,r,n),me=({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=pu(r,t);return Ne({prefix:e,name:t,encode:n,decode:o=>gu(i(o))})},Au=(e,t,r,n)=>{const i={};for(let c=0;c<t.length;++c)i[t[c]]=c;let o=e.length;for(;e[o-1]==="=";)--o;const s=new Uint8Array(o*r/8|0);let a=0,u=0,l=0;for(let c=0;c<o;++c){const g=i[e[c]];if(g===void 0)throw new SyntaxError(`Non-${n} character`);u=u<<r|g,a+=r,a>=8&&(a-=8,s[l++]=255&u>>a)}if(a>=r||255&u<<8-a)throw new SyntaxError("Unexpected end of data");return s},vu=(e,t,r)=>{const n=t[t.length-1]==="=",i=(1<<r)-1;let o="",s=0,a=0;for(let u=0;u<e.length;++u)for(a=a<<8|e[u],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},V=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>Ne({prefix:t,name:e,encode(i){return vu(i,n,r)},decode(i){return Au(i,n,r,e)}}),Su=Ne({prefix:"\0",name:"identity",encode:e=>Eu(e),decode:e=>wu(e)}),Cu=Object.freeze(Object.defineProperty({__proto__:null,identity:Su},Symbol.toStringTag,{value:"Module"})),xu=V({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),Ou=Object.freeze(Object.defineProperty({__proto__:null,base2:xu},Symbol.toStringTag,{value:"Module"})),Bu=V({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),Uu=Object.freeze(Object.defineProperty({__proto__:null,base8:Bu},Symbol.toStringTag,{value:"Module"})),Tu=me({prefix:"9",name:"base10",alphabet:"0123456789"}),Ru=Object.freeze(Object.defineProperty({__proto__:null,base10:Tu},Symbol.toStringTag,{value:"Module"})),Nu=V({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),Iu=V({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),Mu=Object.freeze(Object.defineProperty({__proto__:null,base16:Nu,base16upper:Iu},Symbol.toStringTag,{value:"Module"})),Pu=V({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),ku=V({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),ju=V({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Lu=V({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Wu=V({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Hu=V({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),zu=V({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),qu=V({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),Vu=V({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),Yu=Object.freeze(Object.defineProperty({__proto__:null,base32:Pu,base32hex:Wu,base32hexpad:zu,base32hexpadupper:qu,base32hexupper:Hu,base32pad:ju,base32padupper:Lu,base32upper:ku,base32z:Vu},Symbol.toStringTag,{value:"Module"})),Gu=me({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ku=me({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Ju=Object.freeze(Object.defineProperty({__proto__:null,base36:Gu,base36upper:Ku},Symbol.toStringTag,{value:"Module"})),Zu=me({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Xu=me({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Qu=Object.freeze(Object.defineProperty({__proto__:null,base58btc:Zu,base58flickr:Xu},Symbol.toStringTag,{value:"Module"})),$u=V({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),ea=V({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),ta=V({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ra=V({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),na=Object.freeze(Object.defineProperty({__proto__:null,base64:$u,base64pad:ea,base64url:ta,base64urlpad:ra},Symbol.toStringTag,{value:"Module"})),nn=Array.from("🚀🪐☄🛰🌌🌑🌒🌓🌔🌕🌖🌗🌘🌍🌏🌎🐉☀💻🖥💾💿😂❤😍🤣😊🙏💕😭😘👍😅👏😁🔥🥰💔💖💙😢🤔😆🙄💪😉☺👌🤗💜😔😎😇🌹🤦🎉💞✌✨🤷😱😌🌸🙌😋💗💚😏💛🙂💓🤩😄😀🖤😃💯🙈👇🎶😒🤭❣😜💋👀😪😑💥🙋😞😩😡🤪👊🥳😥🤤👉💃😳✋😚😝😴🌟😬🙃🍀🌷😻😓⭐✅🥺🌈😈🤘💦✔😣🏃💐☹🎊💘😠☝😕🌺🎂🌻😐🖕💝🙊😹🗣💫💀👑🎵🤞😛🔴😤🌼😫⚽🤙☕🏆🤫👈😮🙆🍻🍃🐶💁😲🌿🧡🎁⚡🌞🎈❌✊👋😰🤨😶🤝🚶💰🍓💢🤟🙁🚨💨🤬✈🎀🍺🤓😙💟🌱😖👶🥴▶➡❓💎💸⬇😨🌚🦋😷🕺⚠🙅😟😵👎🤲🤠🤧📌🔵💅🧐🐾🍒😗🤑🌊🤯🐷☎💧😯💆👆🎤🙇🍑❄🌴💣🐸💌📍🥀🤢👅💡💩👐📸👻🤐🤮🎼🥵🚩🍎🍊👼💍📣🥂"),oa=nn.reduce((e,t,r)=>(e[r]=t,e),[]),ia=nn.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);function sa(e){return e.reduce((t,r)=>(t+=oa[r],t),"")}function ua(e){const t=[];for(const r of e){const n=ia[r.codePointAt(0)];if(n===void 0)throw new Error(`Non-base256emoji character: ${r}`);t.push(n)}return new Uint8Array(t)}const aa=Ne({prefix:"🚀",name:"base256emoji",encode:sa,decode:ua}),ca=Object.freeze(Object.defineProperty({__proto__:null,base256emoji:aa},Symbol.toStringTag,{value:"Module"}));new TextEncoder;new TextDecoder;const fr={...Cu,...Ou,...Uu,...Ru,...Mu,...Yu,...Ju,...Qu,...na,...ca};function on(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}const lr=on("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),Ze=on("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{e=e.substring(1);const t=tn(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),sn={utf8:lr,"utf-8":lr,hex:fr.base16,latin1:Ze,ascii:Ze,binary:Ze,...fr};function $a(e,t="utf8"){const r=sn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?Et(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function ec(e,t="utf8"){const r=sn[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return(t==="utf8"||t==="utf-8")&&globalThis.Buffer!=null&&globalThis.Buffer.from!=null?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}const tc={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"}};var Xe,hr;function un(){if(hr)return Xe;hr=1;const e="Input must be an string, Buffer or Uint8Array";function t(s){let a;if(s instanceof Uint8Array)a=s;else if(typeof s=="string")a=new TextEncoder().encode(s);else throw new Error(e);return a}function r(s){return Array.prototype.map.call(s,function(a){return(a<16?"0":"")+a.toString(16)}).join("")}function n(s){return(4294967296+s).toString(16).substring(1)}function i(s,a,u){let l=`
`+s+" = ";for(let c=0;c<a.length;c+=2){if(u===32)l+=n(a[c]).toUpperCase(),l+=" ",l+=n(a[c+1]).toUpperCase();else if(u===64)l+=n(a[c+1]).toUpperCase(),l+=n(a[c]).toUpperCase();else throw new Error("Invalid size "+u);c%6===4?l+=`
`+new Array(s.length+4).join(" "):c<a.length-2&&(l+=" ")}console.log(l)}function o(s,a,u){let l=new Date().getTime();const c=new Uint8Array(a);for(let w=0;w<a;w++)c[w]=w%256;const g=new Date().getTime();console.log("Generated random input in "+(g-l)+"ms"),l=g;for(let w=0;w<u;w++){const E=s(c),h=new Date().getTime(),D=h-l;l=h,console.log("Hashed in "+D+"ms: "+E.substring(0,20)+"..."),console.log(Math.round(a/(1<<20)/(D/1e3)*100)/100+" MB PER SECOND")}}return Xe={normalizeInput:t,toHex:r,debugPrint:i,testSpeed:o},Xe}var Qe,dr;function fa(){if(dr)return Qe;dr=1;const e=un();function t(d,p,f){const y=d[p]+d[f];let F=d[p+1]+d[f+1];y>=4294967296&&F++,d[p]=y,d[p+1]=F}function r(d,p,f,y){let F=d[p]+f;f<0&&(F+=4294967296);let S=d[p+1]+y;F>=4294967296&&S++,d[p]=F,d[p+1]=S}function n(d,p){return d[p]^d[p+1]<<8^d[p+2]<<16^d[p+3]<<24}function i(d,p,f,y,F,S){const O=l[F],x=l[F+1],N=l[S],te=l[S+1];t(u,d,p),r(u,d,O,x);let L=u[y]^u[d],H=u[y+1]^u[d+1];u[y]=H,u[y+1]=L,t(u,f,y),L=u[p]^u[f],H=u[p+1]^u[f+1],u[p]=L>>>24^H<<8,u[p+1]=H>>>24^L<<8,t(u,d,p),r(u,d,N,te),L=u[y]^u[d],H=u[y+1]^u[d+1],u[y]=L>>>16^H<<16,u[y+1]=H>>>16^L<<16,t(u,f,y),L=u[p]^u[f],H=u[p+1]^u[f+1],u[p]=H>>>31^L<<1,u[p+1]=L>>>31^H<<1}const o=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3],a=new Uint8Array(s.map(function(d){return d*2})),u=new Uint32Array(32),l=new Uint32Array(32);function c(d,p){let f=0;for(f=0;f<16;f++)u[f]=d.h[f],u[f+16]=o[f];for(u[24]=u[24]^d.t,u[25]=u[25]^d.t/4294967296,p&&(u[28]=~u[28],u[29]=~u[29]),f=0;f<32;f++)l[f]=n(d.b,4*f);for(f=0;f<12;f++)i(0,8,16,24,a[f*16+0],a[f*16+1]),i(2,10,18,26,a[f*16+2],a[f*16+3]),i(4,12,20,28,a[f*16+4],a[f*16+5]),i(6,14,22,30,a[f*16+6],a[f*16+7]),i(0,10,20,30,a[f*16+8],a[f*16+9]),i(2,12,22,24,a[f*16+10],a[f*16+11]),i(4,14,16,26,a[f*16+12],a[f*16+13]),i(6,8,18,28,a[f*16+14],a[f*16+15]);for(f=0;f<16;f++)d.h[f]=d.h[f]^u[f]^u[f+16]}const g=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function w(d,p,f,y){if(d===0||d>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(p&&p.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(f&&f.length!==16)throw new Error("Illegal salt, expected Uint8Array with length is 16");if(y&&y.length!==16)throw new Error("Illegal personal, expected Uint8Array with length is 16");const F={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:d};g.fill(0),g[0]=d,p&&(g[1]=p.length),g[2]=1,g[3]=1,f&&g.set(f,32),y&&g.set(y,48);for(let S=0;S<16;S++)F.h[S]=o[S]^n(g,S*4);return p&&(E(F,p),F.c=128),F}function E(d,p){for(let f=0;f<p.length;f++)d.c===128&&(d.t+=d.c,c(d,!1),d.c=0),d.b[d.c++]=p[f]}function h(d){for(d.t+=d.c;d.c<128;)d.b[d.c++]=0;c(d,!0);const p=new Uint8Array(d.outlen);for(let f=0;f<d.outlen;f++)p[f]=d.h[f>>2]>>8*(f&3);return p}function D(d,p,f,y,F){f=f||64,d=e.normalizeInput(d),y&&(y=e.normalizeInput(y)),F&&(F=e.normalizeInput(F));const S=w(f,p,y,F);return E(S,d),h(S)}function b(d,p,f,y,F){const S=D(d,p,f,y,F);return e.toHex(S)}return Qe={blake2b:D,blake2bHex:b,blake2bInit:w,blake2bUpdate:E,blake2bFinal:h},Qe}var $e,br;function la(){if(br)return $e;br=1;const e=un();function t(h,D){return h[D]^h[D+1]<<8^h[D+2]<<16^h[D+3]<<24}function r(h,D,b,d,p,f){s[h]=s[h]+s[D]+p,s[d]=n(s[d]^s[h],16),s[b]=s[b]+s[d],s[D]=n(s[D]^s[b],12),s[h]=s[h]+s[D]+f,s[d]=n(s[d]^s[h],8),s[b]=s[b]+s[d],s[D]=n(s[D]^s[b],7)}function n(h,D){return h>>>D^h<<32-D}const i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),o=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0]),s=new Uint32Array(16),a=new Uint32Array(16);function u(h,D){let b=0;for(b=0;b<8;b++)s[b]=h.h[b],s[b+8]=i[b];for(s[12]^=h.t,s[13]^=h.t/4294967296,D&&(s[14]=~s[14]),b=0;b<16;b++)a[b]=t(h.b,4*b);for(b=0;b<10;b++)r(0,4,8,12,a[o[b*16+0]],a[o[b*16+1]]),r(1,5,9,13,a[o[b*16+2]],a[o[b*16+3]]),r(2,6,10,14,a[o[b*16+4]],a[o[b*16+5]]),r(3,7,11,15,a[o[b*16+6]],a[o[b*16+7]]),r(0,5,10,15,a[o[b*16+8]],a[o[b*16+9]]),r(1,6,11,12,a[o[b*16+10]],a[o[b*16+11]]),r(2,7,8,13,a[o[b*16+12]],a[o[b*16+13]]),r(3,4,9,14,a[o[b*16+14]],a[o[b*16+15]]);for(b=0;b<8;b++)h.h[b]^=s[b]^s[b+8]}function l(h,D){if(!(h>0&&h<=32))throw new Error("Incorrect output length, should be in [1, 32]");const b=D?D.length:0;if(D&&!(b>0&&b<=32))throw new Error("Incorrect key length, should be in [1, 32]");const d={h:new Uint32Array(i),b:new Uint8Array(64),c:0,t:0,outlen:h};return d.h[0]^=16842752^b<<8^h,b>0&&(c(d,D),d.c=64),d}function c(h,D){for(let b=0;b<D.length;b++)h.c===64&&(h.t+=h.c,u(h,!1),h.c=0),h.b[h.c++]=D[b]}function g(h){for(h.t+=h.c;h.c<64;)h.b[h.c++]=0;u(h,!0);const D=new Uint8Array(h.outlen);for(let b=0;b<h.outlen;b++)D[b]=h.h[b>>2]>>8*(b&3)&255;return D}function w(h,D,b){b=b||32,h=e.normalizeInput(h);const d=l(b,D);return c(d,h),g(d)}function E(h,D,b){const d=w(h,D,b);return e.toHex(d)}return $e={blake2s:w,blake2sHex:E,blake2sInit:l,blake2sUpdate:c,blake2sFinal:g},$e}var et,Dr;function ha(){if(Dr)return et;Dr=1;const e=fa(),t=la();return et={blake2b:e.blake2b,blake2bHex:e.blake2bHex,blake2bInit:e.blake2bInit,blake2bUpdate:e.blake2bUpdate,blake2bFinal:e.blake2bFinal,blake2s:t.blake2s,blake2sHex:t.blake2sHex,blake2sInit:t.blake2sInit,blake2sUpdate:t.blake2sUpdate,blake2sFinal:t.blake2sFinal},et}var rc=ha();const da="PARSE_ERROR",ba="INVALID_REQUEST",Da="METHOD_NOT_FOUND",pa="INVALID_PARAMS",an="INTERNAL_ERROR",yt="SERVER_ERROR",ga=[-32700,-32600,-32601,-32602,-32603],we={[da]:{code:-32700,message:"Parse error"},[ba]:{code:-32600,message:"Invalid Request"},[Da]:{code:-32601,message:"Method not found"},[pa]:{code:-32602,message:"Invalid params"},[an]:{code:-32603,message:"Internal error"},[yt]:{code:-32e3,message:"Server error"}},cn=yt;function wa(e){return ga.includes(e)}function pr(e){return Object.keys(we).includes(e)?we[e]:we[cn]}function Ea(e){const t=Object.values(we).find(r=>r.code===e);return t||we[cn]}function ya(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?new Error(`Unavailable ${r} RPC url at ${t}`):e}function fn(e=3){const t=Date.now()*Math.pow(10,e),r=Math.floor(Math.random()*Math.pow(10,e));return t+r}function ma(e=6){return BigInt(fn(e))}function Fa(e,t,r){return{id:r||fn(),jsonrpc:"2.0",method:e,params:t}}function nc(e,t){return{id:e,jsonrpc:"2.0",result:t}}function _a(e,t,r){return{id:e,jsonrpc:"2.0",error:Aa(t)}}function Aa(e,t){return typeof e>"u"?pr(an):(typeof e=="string"&&(e=Object.assign(Object.assign({},pr(yt)),{message:e})),wa(e.code)&&(e=Ea(e.code)),e)}class va{}class Sa extends va{constructor(){super()}}class Ca extends Sa{constructor(t){super()}}const xa="^https?:",Oa="^wss?:";function Ba(e){const t=e.match(new RegExp(/^\w+:/,"gi"));if(!(!t||!t.length))return t[0]}function ln(e,t){const r=Ba(e);return typeof r>"u"?!1:new RegExp(t).test(r)}function oc(e){return ln(e,xa)}function gr(e){return ln(e,Oa)}function Ua(e){return new RegExp("wss?://localhost(:d{2,5})?").test(e)}function hn(e){return typeof e=="object"&&"id"in e&&"jsonrpc"in e&&e.jsonrpc==="2.0"}function ic(e){return hn(e)&&"method"in e}function Ta(e){return hn(e)&&(Ra(e)||dn(e))}function Ra(e){return"result"in e}function dn(e){return"error"in e}class sc extends Ca{constructor(t){super(t),this.events=new ft.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(t),this.connection.connected&&this.registerEventListeners()}async connect(t=this.connection){await this.open(t)}async disconnect(){await this.close()}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async request(t,r){return this.requestStrict(Fa(t.method,t.params||[],t.id||ma().toString()),r)}async requestStrict(t,r){return new Promise(async(n,i)=>{if(!this.connection.connected)try{await this.open()}catch(o){i(o)}this.events.on(`${t.id}`,o=>{dn(o)?i(o.error):n(o.result)});try{await this.connection.send(t,r)}catch(o){i(o)}})}setConnection(t=this.connection){return t}onPayload(t){this.events.emit("payload",t),Ta(t)?this.events.emit(`${t.id}`,t):this.events.emit("message",{type:t.method,data:t.params})}onClose(t){t&&t.code===3e3&&this.events.emit("error",new Error(`WebSocket connection closed abnormally with code: ${t.code} ${t.reason?`(${t.reason})`:""}`)),this.events.emit("disconnect")}async open(t=this.connection){this.connection===t&&this.connection.connected||(this.connection.connected&&this.close(),typeof t=="string"&&(await this.connection.open(t),t=this.connection),this.connection=this.setConnection(t),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",t=>this.onPayload(t)),this.connection.on("close",t=>this.onClose(t)),this.connection.on("error",t=>this.events.emit("error",t)),this.connection.on("register_error",t=>this.onClose()),this.hasRegisteredEventListeners=!0)}}var tt,wr;function Na(){return wr||(wr=1,tt=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),tt}const Ia=()=>typeof WebSocket<"u"?WebSocket:typeof ge<"u"&&typeof ge.WebSocket<"u"?ge.WebSocket:typeof window<"u"&&typeof window.WebSocket<"u"?window.WebSocket:typeof self<"u"&&typeof self.WebSocket<"u"?self.WebSocket:Na(),Ma=()=>typeof WebSocket<"u"||typeof ge<"u"&&typeof ge.WebSocket<"u"||typeof window<"u"&&typeof window.WebSocket<"u"||typeof self<"u"&&typeof self.WebSocket<"u",Er=e=>e.split("?")[0],yr=10,Pa=Ia();class uc{constructor(t){if(this.url=t,this.events=new ft.EventEmitter,this.registering=!1,!gr(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);this.url=t}get connected(){return typeof this.socket<"u"}get connecting(){return this.registering}on(t,r){this.events.on(t,r)}once(t,r){this.events.once(t,r)}off(t,r){this.events.off(t,r)}removeListener(t,r){this.events.removeListener(t,r)}async open(t=this.url){await this.register(t)}async close(){return new Promise((t,r)=>{if(typeof this.socket>"u"){r(new Error("Connection already closed"));return}this.socket.onclose=n=>{this.onClose(n),t()},this.socket.close()})}async send(t){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(vr(t))}catch(r){this.onError(t.id,r)}}register(t=this.url){if(!gr(t))throw new Error(`Provided URL is not compatible with WebSocket connection: ${t}`);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((n,i)=>{this.events.once("register_error",o=>{this.resetMaxListeners(),i(o)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return i(new Error("WebSocket connection is missing or invalid"));n(this.socket)})})}return this.url=t,this.registering=!0,new Promise((r,n)=>{const i=_n.isReactNative()?void 0:{rejectUnauthorized:!Ua(t)},o=new Pa(t,[],i);Ma()?o.onerror=s=>{const a=s;n(this.emitError(a.error))}:o.on("error",s=>{n(this.emitError(s))}),o.onopen=()=>{this.onOpen(o),r(o)}})}onOpen(t){t.onmessage=r=>this.onPayload(r),t.onclose=r=>this.onClose(r),this.socket=t,this.registering=!1,this.events.emit("open")}onClose(t){this.socket=void 0,this.registering=!1,this.events.emit("close",t)}onPayload(t){if(typeof t.data>"u")return;const r=typeof t.data=="string"?Ar(t.data):t.data;this.events.emit("payload",r)}onError(t,r){const n=this.parseError(r),i=n.message||n.toString(),o=_a(t,i);this.events.emit("payload",o)}parseError(t,r=this.url){return ya(t,Er(r),"WS")}resetMaxListeners(){this.events.getMaxListeners()>yr&&this.events.setMaxListeners(yr)}emitError(t){const r=this.parseError(new Error((t==null?void 0:t.message)||`WebSocket connection failed for host: ${Er(this.url)}`));return this.events.emit("register_error",r),r}}function ka(e){if(e.length>=255)throw new TypeError("Alphabet too long");const t=new Uint8Array(256);for(let l=0;l<t.length;l++)t[l]=255;for(let l=0;l<e.length;l++){const c=e.charAt(l),g=c.charCodeAt(0);if(t[g]!==255)throw new TypeError(c+" is ambiguous");t[g]=l}const r=e.length,n=e.charAt(0),i=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function s(l){if(l instanceof Uint8Array||(ArrayBuffer.isView(l)?l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength):Array.isArray(l)&&(l=Uint8Array.from(l))),!(l instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(l.length===0)return"";let c=0,g=0,w=0;const E=l.length;for(;w!==E&&l[w]===0;)w++,c++;const h=(E-w)*o+1>>>0,D=new Uint8Array(h);for(;w!==E;){let p=l[w],f=0;for(let y=h-1;(p!==0||f<g)&&y!==-1;y--,f++)p+=256*D[y]>>>0,D[y]=p%r>>>0,p=p/r>>>0;if(p!==0)throw new Error("Non-zero carry");g=f,w++}let b=h-g;for(;b!==h&&D[b]===0;)b++;let d=n.repeat(c);for(;b<h;++b)d+=e.charAt(D[b]);return d}function a(l){if(typeof l!="string")throw new TypeError("Expected String");if(l.length===0)return new Uint8Array;let c=0,g=0,w=0;for(;l[c]===n;)g++,c++;const E=(l.length-c)*i+1>>>0,h=new Uint8Array(E);for(;c<l.length;){const p=l.charCodeAt(c);if(p>255)return;let f=t[p];if(f===255)return;let y=0;for(let F=E-1;(f!==0||y<w)&&F!==-1;F--,y++)f+=r*h[F]>>>0,h[F]=f%256>>>0,f=f/256>>>0;if(f!==0)throw new Error("Non-zero carry");w=y,c++}let D=E-w;for(;D!==E&&h[D]===0;)D++;const b=new Uint8Array(g+(E-D));let d=g;for(;D!==E;)b[d++]=h[D++];return b}function u(l){const c=a(l);if(c)return c;throw new Error("Non-base"+r+" character")}return{encode:s,decodeUnsafe:a,decode:u}}var ja="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";const ac=ka(ja);export{dn as A,fn as B,tc as C,ac as D,$n as I,Ga as P,Js as Q,Ar as a,nc as b,Fa as c,Va as d,Xa as e,_a as f,$a as g,lt as h,oc as i,Za as j,Ja as k,Qa as l,Ya as m,rc as n,sc as o,ya as p,_r as q,to as r,vr as s,ec as t,uc as u,ic as v,Ta as w,Ka as x,ma as y,Ra as z};
