1 | var globalThis=globalThis||{};globalThis.webnative=(()=>{var GB=Object.create;var Hh=Object.defineProperty;var WB=Object.getOwnPropertyDescriptor;var YB=Object.getOwnPropertyNames;var VB=Object.getPrototypeOf,JB=Object.prototype.hasOwnProperty;var lv=t=>Hh(t,"__esModule",{value:!0});var Nf=t=>{if(typeof require!="undefined")return require(t);throw new Error('Dynamic require of "'+t+'" is not supported')};var Y=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),mr=(t,e)=>{lv(t);for(var r in e)Hh(t,r,{get:e[r],enumerable:!0})},XB=(t,e,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of YB(e))!JB.call(t,n)&&n!=="default"&&Hh(t,n,{get:()=>e[n],enumerable:!(r=WB(e,n))||r.enumerable});return t},xr=t=>XB(lv(Hh(t!=null?GB(VB(t)):{},"default",t&&t.__esModule&&"default"in t?{get:()=>t.default,enumerable:!0}:{value:t,enumerable:!0})),t);var jh=Y((hv,rm)=>{(function(t){if(typeof hv=="object"&&typeof rm!="undefined")rm.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window!="undefined"?e=window:typeof global!="undefined"?e=global:typeof self!="undefined"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return function n(o,a,u){function c(y,w){if(!a[y]){if(!o[y]){var F=typeof Nf=="function"&&Nf;if(!w&&F)return F(y,!0);if(p)return p(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var U=a[y]={exports:{}};o[y][0].call(U.exports,function(V){var Se=o[y][1][V];return c(Se||V)},U,U.exports,n,o,a,u)}return a[y].exports}for(var p=typeof Nf=="function"&&Nf,l=0;l<u.length;l++)c(u[l]);return c}({1:[function(n,o,a){(function(u){"use strict";var c=u.MutationObserver||u.WebKitMutationObserver,p;if(c){var l=0,y=new c(V),w=u.document.createTextNode("");y.observe(w,{characterData:!0}),p=function(){w.data=l=++l%2}}else if(!u.setImmediate&&typeof u.MessageChannel!="undefined"){var F=new u.MessageChannel;F.port1.onmessage=V,p=function(){F.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?p=function(){var Q=u.document.createElement("script");Q.onreadystatechange=function(){V(),Q.onreadystatechange=null,Q.parentNode.removeChild(Q),Q=null},u.document.documentElement.appendChild(Q)}:p=function(){setTimeout(V,0)};var _,U=[];function V(){_=!0;for(var Q,ue,J=U.length;J;){for(ue=U,U=[],Q=-1;++Q<J;)ue[Q]();J=U.length}_=!1}o.exports=Se;function Se(Q){U.push(Q)===1&&!_&&p()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,o,a){"use strict";var u=n(1);function c(){}var p={},l=["REJECTED"],y=["FULFILLED"],w=["PENDING"];o.exports=F;function F(Z){if(typeof Z!="function")throw new TypeError("resolver must be a function");this.state=w,this.queue=[],this.outcome=void 0,Z!==c&&Se(this,Z)}F.prototype.catch=function(Z){return this.then(null,Z)},F.prototype.then=function(Z,re){if(typeof Z!="function"&&this.state===y||typeof re!="function"&&this.state===l)return this;var Ce=new this.constructor(c);if(this.state!==w){var et=this.state===y?Z:re;U(Ce,et,this.outcome)}else this.queue.push(new _(Ce,Z,re));return Ce};function _(Z,re,Ce){this.promise=Z,typeof re=="function"&&(this.onFulfilled=re,this.callFulfilled=this.otherCallFulfilled),typeof Ce=="function"&&(this.onRejected=Ce,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(Z){p.resolve(this.promise,Z)},_.prototype.otherCallFulfilled=function(Z){U(this.promise,this.onFulfilled,Z)},_.prototype.callRejected=function(Z){p.reject(this.promise,Z)},_.prototype.otherCallRejected=function(Z){U(this.promise,this.onRejected,Z)};function U(Z,re,Ce){u(function(){var et;try{et=re(Ce)}catch(ct){return p.reject(Z,ct)}et===Z?p.reject(Z,new TypeError("Cannot resolve promise with itself")):p.resolve(Z,et)})}p.resolve=function(Z,re){var Ce=Q(V,re);if(Ce.status==="error")return p.reject(Z,Ce.value);var et=Ce.value;if(et)Se(Z,et);else{Z.state=y,Z.outcome=re;for(var ct=-1,vt=Z.queue.length;++ct<vt;)Z.queue[ct].callFulfilled(re)}return Z},p.reject=function(Z,re){Z.state=l,Z.outcome=re;for(var Ce=-1,et=Z.queue.length;++Ce<et;)Z.queue[Ce].callRejected(re);return Z};function V(Z){var re=Z&&Z.then;if(Z&&(typeof Z=="object"||typeof Z=="function")&&typeof re=="function")return function(){re.apply(Z,arguments)}}function Se(Z,re){var Ce=!1;function et(He){Ce||(Ce=!0,p.reject(Z,He))}function ct(He){Ce||(Ce=!0,p.resolve(Z,He))}function vt(){re(ct,et)}var ht=Q(vt);ht.status==="error"&&et(ht.value)}function Q(Z,re){var Ce={};try{Ce.value=Z(re),Ce.status="success"}catch(et){Ce.status="error",Ce.value=et}return Ce}F.resolve=ue;function ue(Z){return Z instanceof this?Z:p.resolve(new this(c),Z)}F.reject=J;function J(Z){var re=new this(c);return p.reject(re,Z)}F.all=ye;function ye(Z){var re=this;if(Object.prototype.toString.call(Z)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Ce=Z.length,et=!1;if(!Ce)return this.resolve([]);for(var ct=new Array(Ce),vt=0,ht=-1,He=new this(c);++ht<Ce;)Bt(Z[ht],ht);return He;function Bt(Rt,ir){re.resolve(Rt).then(Wr,function(vr){et||(et=!0,p.reject(He,vr))});function Wr(vr){ct[ir]=vr,++vt===Ce&&!et&&(et=!0,p.resolve(He,ct))}}}F.race=Fe;function Fe(Z){var re=this;if(Object.prototype.toString.call(Z)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Ce=Z.length,et=!1;if(!Ce)return this.resolve([]);for(var ct=-1,vt=new this(c);++ct<Ce;)ht(Z[ct]);return vt;function ht(He){re.resolve(He).then(function(Bt){et||(et=!0,p.resolve(vt,Bt))},function(Bt){et||(et=!0,p.reject(vt,Bt))})}}},{"1":1}],3:[function(n,o,a){(function(u){"use strict";typeof u.Promise!="function"&&(u.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"2":2}],4:[function(n,o,a){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E};function c(E,R){if(!(E instanceof R))throw new TypeError("Cannot call a class as a function")}function p(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(E){return}}var l=p();function y(){try{if(!l||!l.open)return!1;var E=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),R=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!E||R)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(T){return!1}}function w(E,R){E=E||[],R=R||{};try{return new Blob(E,R)}catch(M){if(M.name!=="TypeError")throw M;for(var T=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,K=new T,H=0;H<E.length;H+=1)K.append(E[H]);return K.getBlob(R.type)}}typeof Promise=="undefined"&&n(3);var F=Promise;function _(E,R){R&&E.then(function(T){R(null,T)},function(T){R(T)})}function U(E,R,T){typeof R=="function"&&E.then(R),typeof T=="function"&&E.catch(T)}function V(E){return typeof E!="string"&&(console.warn(E+" used as a key, but it is not a string."),E=String(E)),E}function Se(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var Q="local-forage-detect-blob-support",ue=void 0,J={},ye=Object.prototype.toString,Fe="readonly",Z="readwrite";function re(E){for(var R=E.length,T=new ArrayBuffer(R),K=new Uint8Array(T),H=0;H<R;H++)K[H]=E.charCodeAt(H);return T}function Ce(E){return new F(function(R){var T=E.transaction(Q,Z),K=w([""]);T.objectStore(Q).put(K,"key"),T.onabort=function(H){H.preventDefault(),H.stopPropagation(),R(!1)},T.oncomplete=function(){var H=navigator.userAgent.match(/Chrome\/(\d+)/),M=navigator.userAgent.match(/Edge\//);R(M||!H||parseInt(H[1],10)>=43)}}).catch(function(){return!1})}function et(E){return typeof ue=="boolean"?F.resolve(ue):Ce(E).then(function(R){return ue=R,ue})}function ct(E){var R=J[E.name],T={};T.promise=new F(function(K,H){T.resolve=K,T.reject=H}),R.deferredOperations.push(T),R.dbReady?R.dbReady=R.dbReady.then(function(){return T.promise}):R.dbReady=T.promise}function vt(E){var R=J[E.name],T=R.deferredOperations.pop();if(T)return T.resolve(),T.promise}function ht(E,R){var T=J[E.name],K=T.deferredOperations.pop();if(K)return K.reject(R),K.promise}function He(E,R){return new F(function(T,K){if(J[E.name]=J[E.name]||Nt(),E.db)if(R)ct(E),E.db.close();else return T(E.db);var H=[E.name];R&&H.push(E.version);var M=l.open.apply(l,H);R&&(M.onupgradeneeded=function(ae){var ge=M.result;try{ge.createObjectStore(E.storeName),ae.oldVersion<=1&&ge.createObjectStore(Q)}catch(_e){if(_e.name==="ConstraintError")console.warn('The database "'+E.name+'" has been upgraded from version '+ae.oldVersion+" to version "+ae.newVersion+', but the storage "'+E.storeName+'" already exists.');else throw _e}}),M.onerror=function(ae){ae.preventDefault(),K(M.error)},M.onsuccess=function(){T(M.result),vt(E)}})}function Bt(E){return He(E,!1)}function Rt(E){return He(E,!0)}function ir(E,R){if(!E.db)return!0;var T=!E.db.objectStoreNames.contains(E.storeName),K=E.version<E.db.version,H=E.version>E.db.version;if(K&&(E.version!==R&&console.warn('The database "'+E.name+`" can't be downgraded from version `+E.db.version+" to version "+E.version+"."),E.version=E.db.version),H||T){if(T){var M=E.db.version+1;M>E.version&&(E.version=M)}return!0}return!1}function Wr(E){return new F(function(R,T){var K=new FileReader;K.onerror=T,K.onloadend=function(H){var M=btoa(H.target.result||"");R({__local_forage_encoded_blob:!0,data:M,type:E.type})},K.readAsBinaryString(E)})}function vr(E){var R=re(atob(E.data));return w([R],{type:E.type})}function fr(E){return E&&E.__local_forage_encoded_blob}function Zn(E){var R=this,T=R._initReady().then(function(){var K=J[R._dbInfo.name];if(K&&K.dbReady)return K.dbReady});return U(T,E,E),T}function Gt(E){ct(E);for(var R=J[E.name],T=R.forages,K=0;K<T.length;K++){var H=T[K];H._dbInfo.db&&(H._dbInfo.db.close(),H._dbInfo.db=null)}return E.db=null,Bt(E).then(function(M){return E.db=M,ir(E)?Rt(E):M}).then(function(M){E.db=R.db=M;for(var ae=0;ae<T.length;ae++)T[ae]._dbInfo.db=M}).catch(function(M){throw ht(E,M),M})}function dt(E,R,T,K){K===void 0&&(K=1);try{var H=E.db.transaction(E.storeName,R);T(null,H)}catch(M){if(K>0&&(!E.db||M.name==="InvalidStateError"||M.name==="NotFoundError"))return F.resolve().then(function(){if(!E.db||M.name==="NotFoundError"&&!E.db.objectStoreNames.contains(E.storeName)&&E.version<=E.db.version)return E.db&&(E.version=E.db.version+1),Rt(E)}).then(function(){return Gt(E).then(function(){dt(E,R,T,K-1)})}).catch(T);T(M)}}function Nt(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ct(E){var R=this,T={db:null};if(E)for(var K in E)T[K]=E[K];var H=J[T.name];H||(H=Nt(),J[T.name]=H),H.forages.push(R),R._initReady||(R._initReady=R.ready,R.ready=Zn);var M=[];function ae(){return F.resolve()}for(var ge=0;ge<H.forages.length;ge++){var _e=H.forages[ge];_e!==R&&M.push(_e._initReady().catch(ae))}var ke=H.forages.slice(0);return F.all(M).then(function(){return T.db=H.db,Bt(T)}).then(function(Ae){return T.db=Ae,ir(T,R._defaultConfig.version)?Rt(T):Ae}).then(function(Ae){T.db=H.db=Ae,R._dbInfo=T;for(var qe=0;qe<ke.length;qe++){var rt=ke[qe];rt!==R&&(rt._dbInfo.db=T.db,rt._dbInfo.version=T.version)}})}function k(E,R){var T=this;E=V(E);var K=new F(function(H,M){T.ready().then(function(){dt(T._dbInfo,Fe,function(ae,ge){if(ae)return M(ae);try{var _e=ge.objectStore(T._dbInfo.storeName),ke=_e.get(E);ke.onsuccess=function(){var Ae=ke.result;Ae===void 0&&(Ae=null),fr(Ae)&&(Ae=vr(Ae)),H(Ae)},ke.onerror=function(){M(ke.error)}}catch(Ae){M(Ae)}})}).catch(M)});return _(K,R),K}function ce(E,R){var T=this,K=new F(function(H,M){T.ready().then(function(){dt(T._dbInfo,Fe,function(ae,ge){if(ae)return M(ae);try{var _e=ge.objectStore(T._dbInfo.storeName),ke=_e.openCursor(),Ae=1;ke.onsuccess=function(){var qe=ke.result;if(qe){var rt=qe.value;fr(rt)&&(rt=vr(rt));var ft=E(rt,qe.key,Ae++);ft!==void 0?H(ft):qe.continue()}else H()},ke.onerror=function(){M(ke.error)}}catch(qe){M(qe)}})}).catch(M)});return _(K,R),K}function de(E,R,T){var K=this;E=V(E);var H=new F(function(M,ae){var ge;K.ready().then(function(){return ge=K._dbInfo,ye.call(R)==="[object Blob]"?et(ge.db).then(function(_e){return _e?R:Wr(R)}):R}).then(function(_e){dt(K._dbInfo,Z,function(ke,Ae){if(ke)return ae(ke);try{var qe=Ae.objectStore(K._dbInfo.storeName);_e===null&&(_e=void 0);var rt=qe.put(_e,E);Ae.oncomplete=function(){_e===void 0&&(_e=null),M(_e)},Ae.onabort=Ae.onerror=function(){var ft=rt.error?rt.error:rt.transaction.error;ae(ft)}}catch(ft){ae(ft)}})}).catch(ae)});return _(H,T),H}function Be(E,R){var T=this;E=V(E);var K=new F(function(H,M){T.ready().then(function(){dt(T._dbInfo,Z,function(ae,ge){if(ae)return M(ae);try{var _e=ge.objectStore(T._dbInfo.storeName),ke=_e.delete(E);ge.oncomplete=function(){H()},ge.onerror=function(){M(ke.error)},ge.onabort=function(){var Ae=ke.error?ke.error:ke.transaction.error;M(Ae)}}catch(Ae){M(Ae)}})}).catch(M)});return _(K,R),K}function De(E){var R=this,T=new F(function(K,H){R.ready().then(function(){dt(R._dbInfo,Z,function(M,ae){if(M)return H(M);try{var ge=ae.objectStore(R._dbInfo.storeName),_e=ge.clear();ae.oncomplete=function(){K()},ae.onabort=ae.onerror=function(){var ke=_e.error?_e.error:_e.transaction.error;H(ke)}}catch(ke){H(ke)}})}).catch(H)});return _(T,E),T}function $e(E){var R=this,T=new F(function(K,H){R.ready().then(function(){dt(R._dbInfo,Fe,function(M,ae){if(M)return H(M);try{var ge=ae.objectStore(R._dbInfo.storeName),_e=ge.count();_e.onsuccess=function(){K(_e.result)},_e.onerror=function(){H(_e.error)}}catch(ke){H(ke)}})}).catch(H)});return _(T,E),T}function We(E,R){var T=this,K=new F(function(H,M){if(E<0){H(null);return}T.ready().then(function(){dt(T._dbInfo,Fe,function(ae,ge){if(ae)return M(ae);try{var _e=ge.objectStore(T._dbInfo.storeName),ke=!1,Ae=_e.openKeyCursor();Ae.onsuccess=function(){var qe=Ae.result;if(!qe){H(null);return}E===0||ke?H(qe.key):(ke=!0,qe.advance(E))},Ae.onerror=function(){M(Ae.error)}}catch(qe){M(qe)}})}).catch(M)});return _(K,R),K}function Oe(E){var R=this,T=new F(function(K,H){R.ready().then(function(){dt(R._dbInfo,Fe,function(M,ae){if(M)return H(M);try{var ge=ae.objectStore(R._dbInfo.storeName),_e=ge.openKeyCursor(),ke=[];_e.onsuccess=function(){var Ae=_e.result;if(!Ae){K(ke);return}ke.push(Ae.key),Ae.continue()},_e.onerror=function(){H(_e.error)}}catch(Ae){H(Ae)}})}).catch(H)});return _(T,E),T}function Ut(E,R){R=Se.apply(this,arguments);var T=this.config();E=typeof E!="function"&&E||{},E.name||(E.name=E.name||T.name,E.storeName=E.storeName||T.storeName);var K=this,H;if(!E.name)H=F.reject("Invalid arguments");else{var M=E.name===T.name&&K._dbInfo.db,ae=M?F.resolve(K._dbInfo.db):Bt(E).then(function(ge){var _e=J[E.name],ke=_e.forages;_e.db=ge;for(var Ae=0;Ae<ke.length;Ae++)ke[Ae]._dbInfo.db=ge;return ge});E.storeName?H=ae.then(function(ge){if(!!ge.objectStoreNames.contains(E.storeName)){var _e=ge.version+1;ct(E);var ke=J[E.name],Ae=ke.forages;ge.close();for(var qe=0;qe<Ae.length;qe++){var rt=Ae[qe];rt._dbInfo.db=null,rt._dbInfo.version=_e}var ft=new F(function(kt,Wt){var Lt=l.open(E.name,_e);Lt.onerror=function(Ar){var Ii=Lt.result;Ii.close(),Wt(Ar)},Lt.onupgradeneeded=function(){var Ar=Lt.result;Ar.deleteObjectStore(E.storeName)},Lt.onsuccess=function(){var Ar=Lt.result;Ar.close(),kt(Ar)}});return ft.then(function(kt){ke.db=kt;for(var Wt=0;Wt<Ae.length;Wt++){var Lt=Ae[Wt];Lt._dbInfo.db=kt,vt(Lt._dbInfo)}}).catch(function(kt){throw(ht(E,kt)||F.resolve()).catch(function(){}),kt})}}):H=ae.then(function(ge){ct(E);var _e=J[E.name],ke=_e.forages;ge.close();for(var Ae=0;Ae<ke.length;Ae++){var qe=ke[Ae];qe._dbInfo.db=null}var rt=new F(function(ft,kt){var Wt=l.deleteDatabase(E.name);Wt.onerror=Wt.onblocked=function(Lt){var Ar=Wt.result;Ar&&Ar.close(),kt(Lt)},Wt.onsuccess=function(){var Lt=Wt.result;Lt&&Lt.close(),ft(Lt)}});return rt.then(function(ft){_e.db=ft;for(var kt=0;kt<ke.length;kt++){var Wt=ke[kt];vt(Wt._dbInfo)}}).catch(function(ft){throw(ht(E,ft)||F.resolve()).catch(function(){}),ft})})}return _(H,R),H}var Xe={_driver:"asyncStorage",_initStorage:Ct,_support:y(),iterate:ce,getItem:k,setItem:de,removeItem:Be,clear:De,length:$e,key:We,keys:Oe,dropInstance:Ut};function mt(){return typeof openDatabase=="function"}var Cr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ai="~~local_forage_type~",Yr=/^~~local_forage_type~([^~]+)~/,ar="__lfsc__:",Or=ar.length,hr="arbf",fe="blob",Kr="si08",G="ui08",te="uic8",me="si16",Ie="si32",Ke="ur16",jt="ui32",Ze="fl32",Qe="fl64",Ue=Or+hr.length,at=Object.prototype.toString;function st(E){var R=E.length*.75,T=E.length,K,H=0,M,ae,ge,_e;E[E.length-1]==="="&&(R--,E[E.length-2]==="="&&R--);var ke=new ArrayBuffer(R),Ae=new Uint8Array(ke);for(K=0;K<T;K+=4)M=Cr.indexOf(E[K]),ae=Cr.indexOf(E[K+1]),ge=Cr.indexOf(E[K+2]),_e=Cr.indexOf(E[K+3]),Ae[H++]=M<<2|ae>>4,Ae[H++]=(ae&15)<<4|ge>>2,Ae[H++]=(ge&3)<<6|_e&63;return ke}function Qt(E){var R=new Uint8Array(E),T="",K;for(K=0;K<R.length;K+=3)T+=Cr[R[K]>>2],T+=Cr[(R[K]&3)<<4|R[K+1]>>4],T+=Cr[(R[K+1]&15)<<2|R[K+2]>>6],T+=Cr[R[K+2]&63];return R.length%3==2?T=T.substring(0,T.length-1)+"=":R.length%3==1&&(T=T.substring(0,T.length-2)+"=="),T}function Mn(E,R){var T="";if(E&&(T=at.call(E)),E&&(T==="[object ArrayBuffer]"||E.buffer&&at.call(E.buffer)==="[object ArrayBuffer]")){var K,H=ar;E instanceof ArrayBuffer?(K=E,H+=hr):(K=E.buffer,T==="[object Int8Array]"?H+=Kr:T==="[object Uint8Array]"?H+=G:T==="[object Uint8ClampedArray]"?H+=te:T==="[object Int16Array]"?H+=me:T==="[object Uint16Array]"?H+=Ke:T==="[object Int32Array]"?H+=Ie:T==="[object Uint32Array]"?H+=jt:T==="[object Float32Array]"?H+=Ze:T==="[object Float64Array]"?H+=Qe:R(new Error("Failed to get type for BinaryArray"))),R(H+Qt(K))}else if(T==="[object Blob]"){var M=new FileReader;M.onload=function(){var ae=Ai+E.type+"~"+Qt(this.result);R(ar+fe+ae)},M.readAsArrayBuffer(E)}else try{R(JSON.stringify(E))}catch(ae){console.error("Couldn't convert value into a JSON string: ",E),R(null,ae)}}function Qi(E){if(E.substring(0,Or)!==ar)return JSON.parse(E);var R=E.substring(Ue),T=E.substring(Or,Ue),K;if(T===fe&&Yr.test(R)){var H=R.match(Yr);K=H[1],R=R.substring(H[0].length)}var M=st(R);switch(T){case hr:return M;case fe:return w([M],{type:K});case Kr:return new Int8Array(M);case G:return new Uint8Array(M);case te:return new Uint8ClampedArray(M);case me:return new Int16Array(M);case Ke:return new Uint16Array(M);case Ie:return new Int32Array(M);case jt:return new Uint32Array(M);case Ze:return new Float32Array(M);case Qe:return new Float64Array(M);default:throw new Error("Unkown type: "+T)}}var Ei={serialize:Mn,deserialize:Qi,stringToBuffer:st,bufferToString:Qt};function Si(E,R,T,K){E.executeSql("CREATE TABLE IF NOT EXISTS "+R.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],T,K)}function Pi(E){var R=this,T={db:null};if(E)for(var K in E)T[K]=typeof E[K]!="string"?E[K].toString():E[K];var H=new F(function(M,ae){try{T.db=openDatabase(T.name,String(T.version),T.description,T.size)}catch(ge){return ae(ge)}T.db.transaction(function(ge){Si(ge,T,function(){R._dbInfo=T,M()},function(_e,ke){ae(ke)})},ae)});return T.serializer=Ei,H}function nn(E,R,T,K,H,M){E.executeSql(T,K,H,function(ae,ge){ge.code===ge.SYNTAX_ERR?ae.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[R.storeName],function(_e,ke){ke.rows.length?M(_e,ge):Si(_e,R,function(){_e.executeSql(T,K,H,M)},M)},M):M(ae,ge)},M)}function No(E,R){var T=this;E=V(E);var K=new F(function(H,M){T.ready().then(function(){var ae=T._dbInfo;ae.db.transaction(function(ge){nn(ge,ae,"SELECT * FROM "+ae.storeName+" WHERE key = ? LIMIT 1",[E],function(_e,ke){var Ae=ke.rows.length?ke.rows.item(0).value:null;Ae&&(Ae=ae.serializer.deserialize(Ae)),H(Ae)},function(_e,ke){M(ke)})})}).catch(M)});return _(K,R),K}function Uo(E,R){var T=this,K=new F(function(H,M){T.ready().then(function(){var ae=T._dbInfo;ae.db.transaction(function(ge){nn(ge,ae,"SELECT * FROM "+ae.storeName,[],function(_e,ke){for(var Ae=ke.rows,qe=Ae.length,rt=0;rt<qe;rt++){var ft=Ae.item(rt),kt=ft.value;if(kt&&(kt=ae.serializer.deserialize(kt)),kt=E(kt,ft.key,rt+1),kt!==void 0){H(kt);return}}H()},function(_e,ke){M(ke)})})}).catch(M)});return _(K,R),K}function eo(E,R,T,K){var H=this;E=V(E);var M=new F(function(ae,ge){H.ready().then(function(){R===void 0&&(R=null);var _e=R,ke=H._dbInfo;ke.serializer.serialize(R,function(Ae,qe){qe?ge(qe):ke.db.transaction(function(rt){nn(rt,ke,"INSERT OR REPLACE INTO "+ke.storeName+" (key, value) VALUES (?, ?)",[E,Ae],function(){ae(_e)},function(ft,kt){ge(kt)})},function(rt){if(rt.code===rt.QUOTA_ERR){if(K>0){ae(eo.apply(H,[E,_e,T,K-1]));return}ge(rt)}})})}).catch(ge)});return _(M,T),M}function Ti(E,R,T){return eo.apply(this,[E,R,T,1])}function to(E,R){var T=this;E=V(E);var K=new F(function(H,M){T.ready().then(function(){var ae=T._dbInfo;ae.db.transaction(function(ge){nn(ge,ae,"DELETE FROM "+ae.storeName+" WHERE key = ?",[E],function(){H()},function(_e,ke){M(ke)})})}).catch(M)});return _(K,R),K}function Lo(E){var R=this,T=new F(function(K,H){R.ready().then(function(){var M=R._dbInfo;M.db.transaction(function(ae){nn(ae,M,"DELETE FROM "+M.storeName,[],function(){K()},function(ge,_e){H(_e)})})}).catch(H)});return _(T,E),T}function Mo(E){var R=this,T=new F(function(K,H){R.ready().then(function(){var M=R._dbInfo;M.db.transaction(function(ae){nn(ae,M,"SELECT COUNT(key) as c FROM "+M.storeName,[],function(ge,_e){var ke=_e.rows.item(0).c;K(ke)},function(ge,_e){H(_e)})})}).catch(H)});return _(T,E),T}function Bi(E,R){var T=this,K=new F(function(H,M){T.ready().then(function(){var ae=T._dbInfo;ae.db.transaction(function(ge){nn(ge,ae,"SELECT key FROM "+ae.storeName+" WHERE id = ? LIMIT 1",[E+1],function(_e,ke){var Ae=ke.rows.length?ke.rows.item(0).key:null;H(Ae)},function(_e,ke){M(ke)})})}).catch(M)});return _(K,R),K}function Oo(E){var R=this,T=new F(function(K,H){R.ready().then(function(){var M=R._dbInfo;M.db.transaction(function(ae){nn(ae,M,"SELECT key FROM "+M.storeName,[],function(ge,_e){for(var ke=[],Ae=0;Ae<_e.rows.length;Ae++)ke.push(_e.rows.item(Ae).key);K(ke)},function(ge,_e){H(_e)})})}).catch(H)});return _(T,E),T}function Ci(E){return new F(function(R,T){E.transaction(function(K){K.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(H,M){for(var ae=[],ge=0;ge<M.rows.length;ge++)ae.push(M.rows.item(ge).name);R({db:E,storeNames:ae})},function(H,M){T(M)})},function(K){T(K)})})}function sr(E,R){R=Se.apply(this,arguments);var T=this.config();E=typeof E!="function"&&E||{},E.name||(E.name=E.name||T.name,E.storeName=E.storeName||T.storeName);var K=this,H;return E.name?H=new F(function(M){var ae;E.name===T.name?ae=K._dbInfo.db:ae=openDatabase(E.name,"","",0),E.storeName?M({db:ae,storeNames:[E.storeName]}):M(Ci(ae))}).then(function(M){return new F(function(ae,ge){M.db.transaction(function(_e){function ke(ft){return new F(function(kt,Wt){_e.executeSql("DROP TABLE IF EXISTS "+ft,[],function(){kt()},function(Lt,Ar){Wt(Ar)})})}for(var Ae=[],qe=0,rt=M.storeNames.length;qe<rt;qe++)Ae.push(ke(M.storeNames[qe]));F.all(Ae).then(function(){ae()}).catch(function(ft){ge(ft)})},function(_e){ge(_e)})})}):H=F.reject("Invalid arguments"),_(H,R),H}var _r={_driver:"webSQLStorage",_initStorage:Pi,_support:mt(),iterate:Uo,getItem:No,setItem:Ti,removeItem:to,clear:Lo,length:Mo,key:Bi,keys:Oo,dropInstance:sr};function Qn(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(E){return!1}}function On(E,R){var T=E.name+"/";return E.storeName!==R.storeName&&(T+=E.storeName+"/"),T}function ro(){var E="_localforage_support_test";try{return localStorage.setItem(E,!0),localStorage.removeItem(E),!1}catch(R){return!0}}function no(){return!ro()||localStorage.length>0}function io(E){var R=this,T={};if(E)for(var K in E)T[K]=E[K];return T.keyPrefix=On(E,R._defaultConfig),no()?(R._dbInfo=T,T.serializer=Ei,F.resolve()):F.reject()}function Ko(E){var R=this,T=R.ready().then(function(){for(var K=R._dbInfo.keyPrefix,H=localStorage.length-1;H>=0;H--){var M=localStorage.key(H);M.indexOf(K)===0&&localStorage.removeItem(M)}});return _(T,E),T}function oo(E,R){var T=this;E=V(E);var K=T.ready().then(function(){var H=T._dbInfo,M=localStorage.getItem(H.keyPrefix+E);return M&&(M=H.serializer.deserialize(M)),M});return _(K,R),K}function zo(E,R){var T=this,K=T.ready().then(function(){for(var H=T._dbInfo,M=H.keyPrefix,ae=M.length,ge=localStorage.length,_e=1,ke=0;ke<ge;ke++){var Ae=localStorage.key(ke);if(Ae.indexOf(M)===0){var qe=localStorage.getItem(Ae);if(qe&&(qe=H.serializer.deserialize(qe)),qe=E(qe,Ae.substring(ae),_e++),qe!==void 0)return qe}}});return _(K,R),K}function qo(E,R){var T=this,K=T.ready().then(function(){var H=T._dbInfo,M;try{M=localStorage.key(E)}catch(ae){M=null}return M&&(M=M.substring(H.keyPrefix.length)),M});return _(K,R),K}function ei(E){var R=this,T=R.ready().then(function(){for(var K=R._dbInfo,H=localStorage.length,M=[],ae=0;ae<H;ae++){var ge=localStorage.key(ae);ge.indexOf(K.keyPrefix)===0&&M.push(ge.substring(K.keyPrefix.length))}return M});return _(T,E),T}function Ho(E){var R=this,T=R.keys().then(function(K){return K.length});return _(T,E),T}function jo(E,R){var T=this;E=V(E);var K=T.ready().then(function(){var H=T._dbInfo;localStorage.removeItem(H.keyPrefix+E)});return _(K,R),K}function ao(E,R,T){var K=this;E=V(E);var H=K.ready().then(function(){R===void 0&&(R=null);var M=R;return new F(function(ae,ge){var _e=K._dbInfo;_e.serializer.serialize(R,function(ke,Ae){if(Ae)ge(Ae);else try{localStorage.setItem(_e.keyPrefix+E,ke),ae(M)}catch(qe){(qe.name==="QuotaExceededError"||qe.name==="NS_ERROR_DOM_QUOTA_REACHED")&&ge(qe),ge(qe)}})})});return _(H,T),H}function pn(E,R){if(R=Se.apply(this,arguments),E=typeof E!="function"&&E||{},!E.name){var T=this.config();E.name=E.name||T.name,E.storeName=E.storeName||T.storeName}var K=this,H;return E.name?H=new F(function(M){E.storeName?M(On(E,K._defaultConfig)):M(E.name+"/")}).then(function(M){for(var ae=localStorage.length-1;ae>=0;ae--){var ge=localStorage.key(ae);ge.indexOf(M)===0&&localStorage.removeItem(ge)}}):H=F.reject("Invalid arguments"),_(H,R),H}var $o={_driver:"localStorageWrapper",_initStorage:io,_support:Qn(),iterate:zo,getItem:oo,setItem:ao,removeItem:jo,clear:Ko,length:Ho,key:qo,keys:ei,dropInstance:pn},es=function(R,T){return R===T||typeof R=="number"&&typeof T=="number"&&isNaN(R)&&isNaN(T)},Ou=function(R,T){for(var K=R.length,H=0;H<K;){if(es(R[H],T))return!0;H++}return!1},Ku=Array.isArray||function(E){return Object.prototype.toString.call(E)==="[object Array]"},so={},ts={},kn={INDEXEDDB:Xe,WEBSQL:_r,LOCALSTORAGE:$o},rs=[kn.INDEXEDDB._driver,kn.WEBSQL._driver,kn.LOCALSTORAGE._driver],ba=["dropInstance"],ns=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ba),zu={description:"",driver:rs.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Ks(E,R){E[R]=function(){var T=arguments;return E.ready().then(function(){return E[R].apply(E,T)})}}function Go(){for(var E=1;E<arguments.length;E++){var R=arguments[E];if(R)for(var T in R)R.hasOwnProperty(T)&&(Ku(R[T])?arguments[0][T]=R[T].slice():arguments[0][T]=R[T])}return arguments[0]}var uo=function(){function E(R){c(this,E);for(var T in kn)if(kn.hasOwnProperty(T)){var K=kn[T],H=K._driver;this[T]=H,so[H]||this.defineDriver(K)}this._defaultConfig=Go({},zu),this._config=Go({},this._defaultConfig,R),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return E.prototype.config=function(T){if((typeof T=="undefined"?"undefined":u(T))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var K in T){if(K==="storeName"&&(T[K]=T[K].replace(/\W/g,"_")),K==="version"&&typeof T[K]!="number")return new Error("Database version must be a number.");this._config[K]=T[K]}return"driver"in T&&T.driver?this.setDriver(this._config.driver):!0}else return typeof T=="string"?this._config[T]:this._config},E.prototype.defineDriver=function(T,K,H){var M=new F(function(ae,ge){try{var _e=T._driver,ke=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!T._driver){ge(ke);return}for(var Ae=ns.concat("_initStorage"),qe=0,rt=Ae.length;qe<rt;qe++){var ft=Ae[qe],kt=!Ou(ba,ft);if((kt||T[ft])&&typeof T[ft]!="function"){ge(ke);return}}var Wt=function(){for(var Ii=function(Hu){return function(){var Di=new Error("Method "+Hu+" is not implemented by the current driver"),ju=F.reject(Di);return _(ju,arguments[arguments.length-1]),ju}},Wo=0,qu=ba.length;Wo<qu;Wo++){var zs=ba[Wo];T[zs]||(T[zs]=Ii(zs))}};Wt();var Lt=function(Ii){so[_e]&&console.info("Redefining LocalForage driver: "+_e),so[_e]=T,ts[_e]=Ii,ae()};"_support"in T?T._support&&typeof T._support=="function"?T._support().then(Lt,ge):Lt(!!T._support):Lt(!0)}catch(Ar){ge(Ar)}});return U(M,K,H),M},E.prototype.driver=function(){return this._driver||null},E.prototype.getDriver=function(T,K,H){var M=so[T]?F.resolve(so[T]):F.reject(new Error("Driver not found."));return U(M,K,H),M},E.prototype.getSerializer=function(T){var K=F.resolve(Ei);return U(K,T),K},E.prototype.ready=function(T){var K=this,H=K._driverSet.then(function(){return K._ready===null&&(K._ready=K._initDriver()),K._ready});return U(H,T,T),H},E.prototype.setDriver=function(T,K,H){var M=this;Ku(T)||(T=[T]);var ae=this._getSupportedDrivers(T);function ge(){M._config.driver=M.driver()}function _e(qe){return M._extend(qe),ge(),M._ready=M._initStorage(M._config),M._ready}function ke(qe){return function(){var rt=0;function ft(){for(;rt<qe.length;){var kt=qe[rt];return rt++,M._dbInfo=null,M._ready=null,M.getDriver(kt).then(_e).catch(ft)}ge();var Wt=new Error("No available storage method found.");return M._driverSet=F.reject(Wt),M._driverSet}return ft()}}var Ae=this._driverSet!==null?this._driverSet.catch(function(){return F.resolve()}):F.resolve();return this._driverSet=Ae.then(function(){var qe=ae[0];return M._dbInfo=null,M._ready=null,M.getDriver(qe).then(function(rt){M._driver=rt._driver,ge(),M._wrapLibraryMethodsWithReady(),M._initDriver=ke(ae)})}).catch(function(){ge();var qe=new Error("No available storage method found.");return M._driverSet=F.reject(qe),M._driverSet}),U(this._driverSet,K,H),this._driverSet},E.prototype.supports=function(T){return!!ts[T]},E.prototype._extend=function(T){Go(this,T)},E.prototype._getSupportedDrivers=function(T){for(var K=[],H=0,M=T.length;H<M;H++){var ae=T[H];this.supports(ae)&&K.push(ae)}return K},E.prototype._wrapLibraryMethodsWithReady=function(){for(var T=0,K=ns.length;T<K;T++)Ks(this,ns[T])},E.prototype.createInstance=function(T){return new E(T)},E}(),Fi=new uo;o.exports=Fi},{"3":3}]},{},[4])(4)})});var gv=Y($h=>{"use strict";$h.byteLength=rC;$h.toByteArray=iC;$h.fromByteArray=sC;var ra=[],Oi=[],eC=typeof Uint8Array!="undefined"?Uint8Array:Array,am="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var dc=0,tC=am.length;dc<tC;++dc)ra[dc]=am[dc],Oi[am.charCodeAt(dc)]=dc;Oi["-".charCodeAt(0)]=62;Oi["_".charCodeAt(0)]=63;function yv(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function rC(t){var e=yv(t),r=e[0],n=e[1];return(r+n)*3/4-n}function nC(t,e,r){return(e+r)*3/4-r}function iC(t){var e,r=yv(t),n=r[0],o=r[1],a=new eC(nC(t,n,o)),u=0,c=o>0?n-4:n,p;for(p=0;p<c;p+=4)e=Oi[t.charCodeAt(p)]<<18|Oi[t.charCodeAt(p+1)]<<12|Oi[t.charCodeAt(p+2)]<<6|Oi[t.charCodeAt(p+3)],a[u++]=e>>16&255,a[u++]=e>>8&255,a[u++]=e&255;return o===2&&(e=Oi[t.charCodeAt(p)]<<2|Oi[t.charCodeAt(p+1)]>>4,a[u++]=e&255),o===1&&(e=Oi[t.charCodeAt(p)]<<10|Oi[t.charCodeAt(p+1)]<<4|Oi[t.charCodeAt(p+2)]>>2,a[u++]=e>>8&255,a[u++]=e&255),a}function oC(t){return ra[t>>18&63]+ra[t>>12&63]+ra[t>>6&63]+ra[t&63]}function aC(t,e,r){for(var n,o=[],a=e;a<r;a+=3)n=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(t[a+2]&255),o.push(oC(n));return o.join("")}function sC(t){for(var e,r=t.length,n=r%3,o=[],a=16383,u=0,c=r-n;u<c;u+=a)o.push(aC(t,u,u+a>c?c:u+a));return n===1?(e=t[r-1],o.push(ra[e>>2]+ra[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],o.push(ra[e>>10]+ra[e>>4&63]+ra[e<<2&63]+"=")),o.join("")}});var bv=Y(sm=>{sm.read=function(t,e,r,n,o){var a,u,c=o*8-n-1,p=(1<<c)-1,l=p>>1,y=-7,w=r?o-1:0,F=r?-1:1,_=t[e+w];for(w+=F,a=_&(1<<-y)-1,_>>=-y,y+=c;y>0;a=a*256+t[e+w],w+=F,y-=8);for(u=a&(1<<-y)-1,a>>=-y,y+=n;y>0;u=u*256+t[e+w],w+=F,y-=8);if(a===0)a=1-l;else{if(a===p)return u?NaN:(_?-1:1)*Infinity;u=u+Math.pow(2,n),a=a-l}return(_?-1:1)*u*Math.pow(2,a-n)};sm.write=function(t,e,r,n,o,a){var u,c,p,l=a*8-o-1,y=(1<<l)-1,w=y>>1,F=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:a-1,U=n?1:-1,V=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===Infinity?(c=isNaN(e)?1:0,u=y):(u=Math.floor(Math.log(e)/Math.LN2),e*(p=Math.pow(2,-u))<1&&(u--,p*=2),u+w>=1?e+=F/p:e+=F*Math.pow(2,1-w),e*p>=2&&(u++,p/=2),u+w>=y?(c=0,u=y):u+w>=1?(c=(e*p-1)*Math.pow(2,o),u=u+w):(c=e*Math.pow(2,w-1)*Math.pow(2,o),u=0));o>=8;t[r+_]=c&255,_+=U,c/=256,o-=8);for(u=u<<o|c,l+=o;l>0;t[r+_]=u&255,_+=U,u/=256,l-=8);t[r+_-U]|=V*128}});var Na=Y(gc=>{"use strict";var um=gv(),pc=bv(),vv=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;gc.Buffer=ne;gc.SlowBuffer=dC;gc.INSPECT_MAX_BYTES=50;var Gh=2147483647;gc.kMaxLength=Gh;ne.TYPED_ARRAY_SUPPORT=uC();!ne.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function uC(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(ne.prototype,"parent",{enumerable:!0,get:function(){if(!!ne.isBuffer(this))return this.buffer}});Object.defineProperty(ne.prototype,"offset",{enumerable:!0,get:function(){if(!!ne.isBuffer(this))return this.byteOffset}});function Ra(t){if(t>Gh)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,ne.prototype),e}function ne(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return cm(t)}return _v(t,e,r)}ne.poolSize=8192;function _v(t,e,r){if(typeof t=="string")return fC(t,e);if(ArrayBuffer.isView(t))return lC(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(na(t,ArrayBuffer)||t&&na(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(na(t,SharedArrayBuffer)||t&&na(t.buffer,SharedArrayBuffer)))return lm(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return ne.from(n,e,r);let o=hC(t);if(o)return o;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return ne.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}ne.from=function(t,e,r){return _v(t,e,r)};Object.setPrototypeOf(ne.prototype,Uint8Array.prototype);Object.setPrototypeOf(ne,Uint8Array);function wv(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function cC(t,e,r){return wv(t),t<=0?Ra(t):e!==void 0?typeof r=="string"?Ra(t).fill(e,r):Ra(t).fill(e):Ra(t)}ne.alloc=function(t,e,r){return cC(t,e,r)};function cm(t){return wv(t),Ra(t<0?0:hm(t)|0)}ne.allocUnsafe=function(t){return cm(t)};ne.allocUnsafeSlow=function(t){return cm(t)};function fC(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!ne.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=xv(t,e)|0,n=Ra(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}function fm(t){let e=t.length<0?0:hm(t.length)|0,r=Ra(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function lC(t){if(na(t,Uint8Array)){let e=new Uint8Array(t);return lm(e.buffer,e.byteOffset,e.byteLength)}return fm(t)}function lm(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,ne.prototype),n}function hC(t){if(ne.isBuffer(t)){let e=hm(t.length)|0,r=Ra(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||mm(t.length)?Ra(0):fm(t);if(t.type==="Buffer"&&Array.isArray(t.data))return fm(t.data)}function hm(t){if(t>=Gh)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Gh.toString(16)+" bytes");return t|0}function dC(t){return+t!=t&&(t=0),ne.alloc(+t)}ne.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==ne.prototype};ne.compare=function(e,r){if(na(e,Uint8Array)&&(e=ne.from(e,e.offset,e.byteLength)),na(r,Uint8Array)&&(r=ne.from(r,r.offset,r.byteLength)),!ne.isBuffer(e)||!ne.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,o=r.length;for(let a=0,u=Math.min(n,o);a<u;++a)if(e[a]!==r[a]){n=e[a],o=r[a];break}return n<o?-1:o<n?1:0};ne.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};ne.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return ne.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let o=ne.allocUnsafe(r),a=0;for(n=0;n<e.length;++n){let u=e[n];if(na(u,Uint8Array))a+u.length>o.length?(ne.isBuffer(u)||(u=ne.from(u)),u.copy(o,a)):Uint8Array.prototype.set.call(o,u,a);else if(ne.isBuffer(u))u.copy(o,a);else throw new TypeError('"list" argument must be an Array of Buffers');a+=u.length}return o};function xv(t,e){if(ne.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||na(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return pm(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Rv(t).length;default:if(o)return n?-1:pm(t).length;e=(""+e).toLowerCase(),o=!0}}ne.byteLength=xv;function pC(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return AC(this,e,r);case"utf8":case"utf-8":return Ev(this,e,r);case"ascii":return xC(this,e,r);case"latin1":case"binary":return kC(this,e,r);case"base64":return _C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return EC(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}ne.prototype._isBuffer=!0;function uu(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}ne.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)uu(this,r,r+1);return this};ne.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)uu(this,r,r+3),uu(this,r+1,r+2);return this};ne.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)uu(this,r,r+7),uu(this,r+1,r+6),uu(this,r+2,r+5),uu(this,r+3,r+4);return this};ne.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Ev(this,0,e):pC.apply(this,arguments)};ne.prototype.toLocaleString=ne.prototype.toString;ne.prototype.equals=function(e){if(!ne.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:ne.compare(this,e)===0};ne.prototype.inspect=function(){let e="",r=gc.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};vv&&(ne.prototype[vv]=ne.prototype.inspect);ne.prototype.compare=function(e,r,n,o,a){if(na(e,Uint8Array)&&(e=ne.from(e,e.offset,e.byteLength)),!ne.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),a===void 0&&(a=this.length),r<0||n>e.length||o<0||a>this.length)throw new RangeError("out of range index");if(o>=a&&r>=n)return 0;if(o>=a)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,a>>>=0,this===e)return 0;let u=a-o,c=n-r,p=Math.min(u,c),l=this.slice(o,a),y=e.slice(r,n);for(let w=0;w<p;++w)if(l[w]!==y[w]){u=l[w],c=y[w];break}return u<c?-1:c<u?1:0};function kv(t,e,r,n,o){if(t.length===0)return-1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,mm(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=ne.from(e,n)),ne.isBuffer(e))return e.length===0?-1:Av(t,e,r,n,o);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Av(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function Av(t,e,r,n,o){let a=1,u=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;a=2,u/=2,c/=2,r/=2}function p(y,w){return a===1?y[w]:y.readUInt16BE(w*a)}let l;if(o){let y=-1;for(l=r;l<u;l++)if(p(t,l)===p(e,y===-1?0:l-y)){if(y===-1&&(y=l),l-y+1===c)return y*a}else y!==-1&&(l-=l-y),y=-1}else for(r+c>u&&(r=u-c),l=r;l>=0;l--){let y=!0;for(let w=0;w<c;w++)if(p(t,l+w)!==p(e,w)){y=!1;break}if(y)return l}return-1}ne.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};ne.prototype.indexOf=function(e,r,n){return kv(this,e,r,n,!0)};ne.prototype.lastIndexOf=function(e,r,n){return kv(this,e,r,n,!1)};function mC(t,e,r,n){r=Number(r)||0;let o=t.length-r;n?(n=Number(n),n>o&&(n=o)):n=o;let a=e.length;n>a/2&&(n=a/2);let u;for(u=0;u<n;++u){let c=parseInt(e.substr(u*2,2),16);if(mm(c))return u;t[r+u]=c}return u}function yC(t,e,r,n){return Wh(pm(e,t.length-r),t,r,n)}function gC(t,e,r,n){return Wh(BC(e),t,r,n)}function bC(t,e,r,n){return Wh(Rv(e),t,r,n)}function vC(t,e,r,n){return Wh(CC(e,t.length-r),t,r,n)}ne.prototype.write=function(e,r,n,o){if(r===void 0)o="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")o=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let a=this.length-r;if((n===void 0||n>a)&&(n=a),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let u=!1;for(;;)switch(o){case"hex":return mC(this,e,r,n);case"utf8":case"utf-8":return yC(this,e,r,n);case"ascii":case"latin1":case"binary":return gC(this,e,r,n);case"base64":return bC(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return vC(this,e,r,n);default:if(u)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),u=!0}};ne.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _C(t,e,r){return e===0&&r===t.length?um.fromByteArray(t):um.fromByteArray(t.slice(e,r))}function Ev(t,e,r){r=Math.min(t.length,r);let n=[],o=e;for(;o<r;){let a=t[o],u=null,c=a>239?4:a>223?3:a>191?2:1;if(o+c<=r){let p,l,y,w;switch(c){case 1:a<128&&(u=a);break;case 2:p=t[o+1],(p&192)==128&&(w=(a&31)<<6|p&63,w>127&&(u=w));break;case 3:p=t[o+1],l=t[o+2],(p&192)==128&&(l&192)==128&&(w=(a&15)<<12|(p&63)<<6|l&63,w>2047&&(w<55296||w>57343)&&(u=w));break;case 4:p=t[o+1],l=t[o+2],y=t[o+3],(p&192)==128&&(l&192)==128&&(y&192)==128&&(w=(a&15)<<18|(p&63)<<12|(l&63)<<6|y&63,w>65535&&w<1114112&&(u=w))}}u===null?(u=65533,c=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|u&1023),n.push(u),o+=c}return wC(n)}var Sv=4096;function wC(t){let e=t.length;if(e<=Sv)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Sv));return r}function xC(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]&127);return n}function kC(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function AC(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let a=e;a<r;++a)o+=FC[t[a]];return o}function EC(t,e,r){let n=t.slice(e,r),o="";for(let a=0;a<n.length-1;a+=2)o+=String.fromCharCode(n[a]+n[a+1]*256);return o}ne.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let o=this.subarray(e,r);return Object.setPrototypeOf(o,ne.prototype),o};function Xr(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}ne.prototype.readUintLE=ne.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Xr(e,r,this.length);let o=this[e],a=1,u=0;for(;++u<r&&(a*=256);)o+=this[e+u]*a;return o};ne.prototype.readUintBE=ne.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Xr(e,r,this.length);let o=this[e+--r],a=1;for(;r>0&&(a*=256);)o+=this[e+--r]*a;return o};ne.prototype.readUint8=ne.prototype.readUInt8=function(e,r){return e=e>>>0,r||Xr(e,1,this.length),this[e]};ne.prototype.readUint16LE=ne.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Xr(e,2,this.length),this[e]|this[e+1]<<8};ne.prototype.readUint16BE=ne.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Xr(e,2,this.length),this[e]<<8|this[e+1]};ne.prototype.readUint32LE=ne.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Xr(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};ne.prototype.readUint32BE=ne.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Xr(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};ne.prototype.readBigUInt64LE=gs(function(e){e=e>>>0,yc(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Lf(e,this.length-8);let o=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,a=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(o)+(BigInt(a)<<BigInt(32))});ne.prototype.readBigUInt64BE=gs(function(e){e=e>>>0,yc(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Lf(e,this.length-8);let o=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],a=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(o)<<BigInt(32))+BigInt(a)});ne.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Xr(e,r,this.length);let o=this[e],a=1,u=0;for(;++u<r&&(a*=256);)o+=this[e+u]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*r)),o};ne.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Xr(e,r,this.length);let o=r,a=1,u=this[e+--o];for(;o>0&&(a*=256);)u+=this[e+--o]*a;return a*=128,u>=a&&(u-=Math.pow(2,8*r)),u};ne.prototype.readInt8=function(e,r){return e=e>>>0,r||Xr(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};ne.prototype.readInt16LE=function(e,r){e=e>>>0,r||Xr(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};ne.prototype.readInt16BE=function(e,r){e=e>>>0,r||Xr(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};ne.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Xr(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};ne.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Xr(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};ne.prototype.readBigInt64LE=gs(function(e){e=e>>>0,yc(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Lf(e,this.length-8);let o=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(o)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});ne.prototype.readBigInt64BE=gs(function(e){e=e>>>0,yc(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&Lf(e,this.length-8);let o=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(o)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});ne.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Xr(e,4,this.length),pc.read(this,e,!0,23,4)};ne.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Xr(e,4,this.length),pc.read(this,e,!1,23,4)};ne.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Xr(e,8,this.length),pc.read(this,e,!0,52,8)};ne.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Xr(e,8,this.length),pc.read(this,e,!1,52,8)};function Wn(t,e,r,n,o,a){if(!ne.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}ne.prototype.writeUintLE=ne.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r>>>0,n=n>>>0,!o){let c=Math.pow(2,8*n)-1;Wn(this,e,r,n,c,0)}let a=1,u=0;for(this[r]=e&255;++u<n&&(a*=256);)this[r+u]=e/a&255;return r+n};ne.prototype.writeUintBE=ne.prototype.writeUIntBE=function(e,r,n,o){if(e=+e,r=r>>>0,n=n>>>0,!o){let c=Math.pow(2,8*n)-1;Wn(this,e,r,n,c,0)}let a=n-1,u=1;for(this[r+a]=e&255;--a>=0&&(u*=256);)this[r+a]=e/u&255;return r+n};ne.prototype.writeUint8=ne.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,1,255,0),this[r]=e&255,r+1};ne.prototype.writeUint16LE=ne.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};ne.prototype.writeUint16BE=ne.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};ne.prototype.writeUint32LE=ne.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};ne.prototype.writeUint32BE=ne.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Pv(t,e,r,n,o){Dv(e,n,o,t,r,7);let a=Number(e&BigInt(4294967295));t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=u,u=u>>8,t[r++]=u,u=u>>8,t[r++]=u,u=u>>8,t[r++]=u,r}function Tv(t,e,r,n,o){Dv(e,n,o,t,r,7);let a=Number(e&BigInt(4294967295));t[r+7]=a,a=a>>8,t[r+6]=a,a=a>>8,t[r+5]=a,a=a>>8,t[r+4]=a;let u=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=u,u=u>>8,t[r+2]=u,u=u>>8,t[r+1]=u,u=u>>8,t[r]=u,r+8}ne.prototype.writeBigUInt64LE=gs(function(e,r=0){return Pv(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});ne.prototype.writeBigUInt64BE=gs(function(e,r=0){return Tv(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});ne.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r>>>0,!o){let p=Math.pow(2,8*n-1);Wn(this,e,r,n,p-1,-p)}let a=0,u=1,c=0;for(this[r]=e&255;++a<n&&(u*=256);)e<0&&c===0&&this[r+a-1]!==0&&(c=1),this[r+a]=(e/u>>0)-c&255;return r+n};ne.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r>>>0,!o){let p=Math.pow(2,8*n-1);Wn(this,e,r,n,p-1,-p)}let a=n-1,u=1,c=0;for(this[r+a]=e&255;--a>=0&&(u*=256);)e<0&&c===0&&this[r+a+1]!==0&&(c=1),this[r+a]=(e/u>>0)-c&255;return r+n};ne.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};ne.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};ne.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};ne.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};ne.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||Wn(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};ne.prototype.writeBigInt64LE=gs(function(e,r=0){return Pv(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});ne.prototype.writeBigInt64BE=gs(function(e,r=0){return Tv(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Bv(t,e,r,n,o,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Cv(t,e,r,n,o){return e=+e,r=r>>>0,o||Bv(t,e,r,4,34028234663852886e22,-34028234663852886e22),pc.write(t,e,r,n,23,4),r+4}ne.prototype.writeFloatLE=function(e,r,n){return Cv(this,e,r,!0,n)};ne.prototype.writeFloatBE=function(e,r,n){return Cv(this,e,r,!1,n)};function Fv(t,e,r,n,o){return e=+e,r=r>>>0,o||Bv(t,e,r,8,17976931348623157e292,-17976931348623157e292),pc.write(t,e,r,n,52,8),r+8}ne.prototype.writeDoubleLE=function(e,r,n){return Fv(this,e,r,!0,n)};ne.prototype.writeDoubleBE=function(e,r,n){return Fv(this,e,r,!1,n)};ne.prototype.copy=function(e,r,n,o){if(!ne.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o<n&&(o=n),o===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r<o-n&&(o=e.length-r+n);let a=o-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,o):Uint8Array.prototype.set.call(e,this.subarray(n,o),r),a};ne.prototype.fill=function(e,r,n,o){if(typeof e=="string"){if(typeof r=="string"?(o=r,r=0,n=this.length):typeof n=="string"&&(o=n,n=this.length),o!==void 0&&typeof o!="string")throw new TypeError("encoding must be a string");if(typeof o=="string"&&!ne.isEncoding(o))throw new TypeError("Unknown encoding: "+o);if(e.length===1){let u=e.charCodeAt(0);(o==="utf8"&&u<128||o==="latin1")&&(e=u)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let a;if(typeof e=="number")for(a=r;a<n;++a)this[a]=e;else{let u=ne.isBuffer(e)?e:ne.from(e,o),c=u.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=u[a%c]}return this};var mc={};function dm(t,e,r){mc[t]=class extends r{constructor(){super();Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}dm("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);dm("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);dm("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=Iv(String(r)):typeof r=="bigint"&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=Iv(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n},RangeError);function Iv(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function SC(t,e,r){yc(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Lf(e,t.length-(r+1))}function Dv(t,e,r,n,o,a){if(t>r||t<e){let u=typeof e=="bigint"?"n":"",c;throw a>3?e===0||e===BigInt(0)?c=`>= 0${u} and < 2${u} ** ${(a+1)*8}${u}`:c=`>= -(2${u} ** ${(a+1)*8-1}${u}) and < 2 ** ${(a+1)*8-1}${u}`:c=`>= ${e}${u} and <= ${r}${u}`,new mc.ERR_OUT_OF_RANGE("value",c,t)}SC(n,o,a)}function yc(t,e){if(typeof t!="number")throw new mc.ERR_INVALID_ARG_TYPE(e,"number",t)}function Lf(t,e,r){throw Math.floor(t)!==t?(yc(t,r),new mc.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new mc.ERR_BUFFER_OUT_OF_BOUNDS:new mc.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var PC=/[^+/0-9A-Za-z-_]/g;function TC(t){if(t=t.split("=")[0],t=t.trim().replace(PC,""),t.length<2)return"";for(;t.length%4!=0;)t=t+"=";return t}function pm(t,e){e=e||Infinity;let r,n=t.length,o=null,a=[];for(let u=0;u<n;++u){if(r=t.charCodeAt(u),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(u+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function BC(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function CC(t,e){let r,n,o,a=[];for(let u=0;u<t.length&&!((e-=2)<0);++u)r=t.charCodeAt(u),n=r>>8,o=r%256,a.push(o),a.push(n);return a}function Rv(t){return um.toByteArray(TC(t))}function Wh(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function na(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function mm(t){return t!==t}var FC=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function gs(t){return typeof BigInt=="undefined"?IC:t}function IC(){throw new Error("BigInt not supported")}});var Yh=Y(()=>{});var Gv=Y(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.utils=kr.verify=kr.sign=kr.getPublicKey=kr.SignResult=kr.Signature=kr.Point=kr.ExtendedPoint=kr.CURVE=void 0;var Pr={a:-1n,d:37095705934669439343138083508754565189542113879843219016388785533085940283555n,P:2n**255n-19n,n:2n**252n+27742317777372353535851937790883648493n,h:8n,Gx:15112221349535400772501151409588531511454012693041857206046113283949847762202n,Gy:46316835694926478169428394003475163141307993866256225615783033603165251855960n};kr.CURVE=Pr;var Cn=32,Of=19681161376707505956807079304988542015446066515923890162744021073123829784752n,RC=25063068953384623474111414158702152701244531502492656460079210482610430750235n,NC=54469307008909316920995813868745141605393597292927456921205312896311721017578n,UC=1159843021668779879193775521855586647937357759715417654439879720876111806838n,LC=40440834346308536858101042469323190826248399146238708352240133220865137265952n,ur=class{constructor(e,r,n,o){this.x=e,this.y=r,this.z=n,this.t=o}static fromAffine(e){if(!(e instanceof yr))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(yr.ZERO)?ur.ZERO:new ur(e.x,e.y,1n,xe(e.x*e.y))}static toAffineBatch(e){let r=OC(e.map(n=>n.z));return e.map((n,o)=>n.toAffine(r[o]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}static fromRistrettoHash(e){let r=wm(e.slice(0,Cn)),n=this.calcElligatorRistrettoMap(r),o=wm(e.slice(Cn,Cn*2)),a=this.calcElligatorRistrettoMap(o);return n.add(a)}static calcElligatorRistrettoMap(e){let{d:r}=Pr,n=xe(Of*e*e),o=xe((n+1n)*UC),a=-1n,u=xe((a-r*n)*xe(n+r)),{isValid:c,value:p}=km(o,u),l=xe(p*e);vs(l)||(l=xe(-l)),c||(p=l),c||(a=n);let y=xe(a*(n-1n)*LC-u),w=p*p,F=xe((p+p)*u),_=xe(y*RC),U=xe(1n-w),V=xe(1n+w);return new ur(xe(F*V),xe(U*_),xe(_*V),xe(F*U))}static fromRistrettoBytes(e){let{a:r,d:n}=Pr,o="ExtendedPoint.fromRistrettoBytes: Cannot convert bytes to Ristretto Point",a=wm(e);if(!qC(zv(a,Cn),e)||vs(a))throw new Error(o);let u=xe(a*a),c=xe(1n+r*u),p=xe(1n-r*u),l=xe(c*c),y=xe(p*p),w=xe(r*n*l-y),{isValid:F,value:_}=Hv(xe(w*y)),U=xe(_*p),V=xe(_*U*w),Se=xe((a+a)*U);vs(Se)&&(Se=xe(-Se));let Q=xe(c*V),ue=xe(Se*Q);if(!F||vs(ue)||Q===0n)throw new Error(o);return new ur(Se,Q,1n,ue)}toRistrettoBytes(){let{x:e,y:r,z:n,t:o}=this,a=xe((n+r)*(n-r)),u=xe(e*r),{value:c}=Hv(xe(a*u**2n)),p=xe(c*a),l=xe(c*u),y=xe(p*l*o),w;vs(o*y)?([e,r]=[xe(r*Of),xe(e*Of)],w=xe(p*NC)):w=l,vs(e*y)&&(r=xe(-r));let F=xe((n-r)*w);return vs(F)&&(F=xe(-F)),zv(F,Cn)}equals(e){let r=this,n=e,[o,a,u,c]=[r.t,n.t,r.z,n.z];return xe(o*c)===xe(a*u)}negate(){return new ur(xe(-this.x),this.y,this.z,xe(-this.t))}double(){let e=this.x,r=this.y,n=this.z,{a:o}=Pr,a=xe(e**2n),u=xe(r**2n),c=xe(2n*n**2n),p=xe(o*a),l=xe((e+r)**2n-a-u),y=xe(p+u),w=xe(y-c),F=xe(p-u),_=xe(l*w),U=xe(y*F),V=xe(l*F),Se=xe(w*y);return new ur(_,U,Se,V)}add(e){let r=this.x,n=this.y,o=this.z,a=this.t,u=e.x,c=e.y,p=e.z,l=e.t,y=xe((n-r)*(c+u)),w=xe((n+r)*(c-u)),F=xe(w-y);if(F===0n)return this.double();let _=xe(o*2n*l),U=xe(a*2n*p),V=xe(U+_),Se=xe(w+y),Q=xe(U-_),ue=xe(V*F),J=xe(Se*Q),ye=xe(V*Q),Fe=xe(F*Se);return new ur(ue,J,Fe,ye)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){if(!qv(e))throw new TypeError("Point#multiply: expected number or bigint");let r=xe(BigInt(e),Pr.n);if(r===1n)return this;let n=ur.ZERO,o=this;for(;r>0n;)r&1n&&(n=n.add(o)),o=o.double(),r>>=1n;return n}precomputeWindow(e){let r=256/e+1,n=[],o=this,a=o;for(let u=0;u<r;u++){a=o,n.push(a);for(let c=1;c<2**(e-1);c++)a=a.add(o),n.push(a);o=a.double()}return n}wNAF(e,r){!r&&this.equals(ur.BASE)&&(r=yr.BASE);let n=r&&r._WINDOW_SIZE||1;if(256%n)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let o=r&&vm.get(r);o||(o=this.precomputeWindow(n),r&&n!==1&&(o=ur.normalizeZ(o),vm.set(r,o)));let a=ur.ZERO,u=ur.ZERO,c=256/n+1,p=2**(n-1),l=BigInt(2**n-1),y=2**n,w=BigInt(n);for(let F=0;F<c;F++){let _=F*p,U=Number(e&l);if(e>>=w,U>p&&(U-=y,e+=1n),U===0)u=u.add(F%2?o[_].negate():o[_]);else{let V=o[_+Math.abs(U)-1];a=a.add(U<0?V.negate():V)}}return[a,u]}multiply(e,r){if(!qv(e))throw new TypeError("Point#multiply: expected number or bigint");let n=xe(BigInt(e),Pr.n);return ur.normalizeZ(this.wNAF(n,r))[0]}toAffine(e=xm(this.z)){let r=xe(this.x*e),n=xe(this.y*e);return new yr(r,n)}};kr.ExtendedPoint=ur;ur.BASE=new ur(Pr.Gx,Pr.Gy,1n,xe(Pr.Gx*Pr.Gy));ur.ZERO=new ur(0n,1n,1n,0n);var vm=new WeakMap,yr=class{constructor(e,r){this.x=e,this.y=r}_setWindowSize(e){this._WINDOW_SIZE=e,vm.delete(this)}static fromHex(e){let{d:r,P:n}=Pr,o=e instanceof Uint8Array?e:Kf(e);if(o.length!==32)throw new Error("Point.fromHex: expected 32 bytes");let a=o[31],u=a&~128,c=(a&128)!=0,p=Uint8Array.from(Array.from(o.slice(0,31)).concat(u)),l=zf(p);if(l>=n)throw new Error("Point.fromHex expects hex <= Fp");let y=xe(l*l),w=xe(y-1n),F=xe(r*y+1n),{isValid:_,value:U}=km(w,F);if(!_)throw new Error("Point.fromHex: invalid y coordinate");let V=(U&1n)===1n;return c!==V&&(U=xe(-U)),new yr(U,l)}static async fromPrivateKey(e){let r=await kr.utils.sha512($v(e));return yr.BASE.multiply(jv(r))}toRawBytes(){let e=_m(this.y),r=new Uint8Array(Cn);for(let o=e.length-2,a=0;a<Cn&&o>=0;o-=2,a++)r[a]=Number.parseInt(e[o]+e[o+1],16);let n=this.x&1n?128:0;return r[Cn-1]|=n,r}toHex(){return Kv(this.toRawBytes())}toX25519(){return xe((1n+this.y)*xm(1n-this.y))}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new yr(xe(-this.x),this.y)}add(e){return ur.fromAffine(this).add(ur.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return ur.fromAffine(this).multiply(e,this).toAffine()}};kr.Point=yr;yr.BASE=new yr(Pr.Gx,Pr.Gy);yr.ZERO=new yr(0n,1n);var bs=class{constructor(e,r){this.r=e,this.s=r}static fromHex(e){e=Em(e);let r=yr.fromHex(e.slice(0,32)),n=zf(e.slice(32));if(!HC(n))throw new Error("Signature.fromHex expects s <= CURVE.n");return new bs(r,n)}toRawBytes(){let e=Kf(_m(this.s)).reverse(),r=new Uint8Array(Cn);r.set(e);let n=new Uint8Array(Cn*2);return n.set(this.r.toRawBytes()),n.set(r,32),n}toHex(){return Kv(this.toRawBytes())}};kr.Signature=bs;kr.SignResult=bs;function MC(...t){if(t.length===1)return t[0];let e=t.reduce((n,o)=>n+o.length,0),r=new Uint8Array(e);for(let n=0,o=0;n<t.length;n++){let a=t[n];r.set(a,o),o+=a.length}return r}function Kv(t){let e="";for(let r=0;r<t.length;r++)e+=t[r].toString(16).padStart(2,"0");return e}function Kf(t){if(typeof t!="string"||t.length%2)throw new Error("Expected valid hex");let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let n=r*2;e[r]=Number.parseInt(t.slice(n,n+2),16)}return e}function _m(t){let e=t.toString(16);return e.length&1?`0${e}`:e}function zv(t,e=Cn){let r=_m(t).padStart(e*2,"0");return Kf(r).reverse()}function vs(t){return(xe(t)&1n)===1n}function qv(t){return!!(typeof t=="bigint"&&t>0n||typeof t=="number"&&t>0&&Number.isSafeInteger(t))}function zf(t){let e=0n;for(let r=0;r<t.length;r++)e+=BigInt(t[r])<<8n*BigInt(r);return e}function wm(t){return xe(zf(t)&2n**255n-1n)}function xe(t,e=Pr.P){let r=t%e;return r>=0n?r:e+r}function xm(t,e=Pr.P){if(t===0n||e<=0n)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=xe(t,e),n=e,[o,a,u,c]=[0n,1n,1n,0n];for(;r!==0n;){let l=n/r,y=n%r,w=o-u*l,F=a-c*l;[n,r]=[r,y],[o,a]=[u,c],[u,c]=[w,F]}if(n!==1n)throw new Error("invert: does not exist");return xe(o,e)}function OC(t,e=Pr.P){let r=t.length,n=new Array(r),o=1n;for(let a=0;a<r;a++)t[a]!==0n&&(n[a]=o,o=xe(o*t[a],e));o=xm(o,e);for(let a=r-1;a>=0;a--){if(t[a]===0n)continue;let u=xe(o*t[a],e);t[a]=xe(o*n[a],e),o=u}return t}function ia(t,e){let{P:r}=Pr,n=t;for(;e-- >0n;)n*=n,n%=r;return n}function KC(t){let{P:e}=Pr,n=t*t%e*t%e,o=ia(n,2n)*n%e,a=ia(o,1n)*t%e,u=ia(a,5n)*a%e,c=ia(u,10n)*u%e,p=ia(c,20n)*c%e,l=ia(p,40n)*p%e,y=ia(l,80n)*l%e,w=ia(y,80n)*l%e,F=ia(w,10n)*u%e;return ia(F,2n)*t%e}function km(t,e){let r=xe(e*e*e),n=xe(r*r*e),o=xe(t*r*KC(t*n)),a=xe(e*o*o),u=o,c=xe(o*Of),p=a===t,l=a===xe(-t),y=a===xe(-t*Of);return p&&(o=u),(l||y)&&(o=c),vs(o)&&(o=xe(-o)),{isValid:p||l,value:o}}function Hv(t){return km(1n,t)}async function Am(...t){let e=MC(...t),r=await kr.utils.sha512(e),n=zf(r);return xe(n,Pr.n)}function zC(t){return t.slice(Cn)}function jv(t){let e=Cn-1,r=t.slice(0,Cn);return r[0]&=248,r[e]&=127,r[e]|=64,xe(zf(r),Pr.n)}function qC(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function Em(t){return t instanceof Uint8Array?t:Kf(t)}function HC(t){return 0<t&&t<Pr.n}function $v(t){let e;if((typeof t=="bigint"||typeof t=="number"&&Number.isSafeInteger(t)&&t>0)&&(e=BigInt(t),t=e.toString(16).padStart(Cn*2,"0")),typeof t=="string"){if(t.length!==64)throw new Error("Expected 32 bytes of private key");return Kf(t)}else if(t instanceof Uint8Array){if(t.length!==32)throw new Error("Expected 32 bytes of private key");return t}else throw new TypeError("Expected valid private key")}async function jC(t){let e=await yr.fromPrivateKey(t);return typeof t=="string"?e.toHex():e.toRawBytes()}kr.getPublicKey=jC;async function $C(t,e){let r=await kr.utils.sha512($v(e)),n=jv(r),o=yr.BASE.multiply(n),a=Em(t),u=await Am(zC(r),a),c=yr.BASE.multiply(u),p=await Am(c.toRawBytes(),o.toRawBytes(),a),l=xe(u+p*n,Pr.n),y=new bs(c,l);return typeof t=="string"?y.toHex():y.toRawBytes()}kr.sign=$C;async function GC(t,e,r){e=Em(e),r instanceof yr||(r=yr.fromHex(r)),t instanceof bs||(t=bs.fromHex(t));let n=await Am(t.r.toRawBytes(),r.toRawBytes(),e),o=ur.fromAffine(r).multiplyUnsafe(n),a=ur.BASE.multiply(t.s);return ur.fromAffine(t.r).add(o).subtract(a).multiplyUnsafe(8n).equals(ur.ZERO)}kr.verify=GC;yr.BASE._setWindowSize(8);kr.utils={TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],randomPrivateKey:(t=32)=>{if(typeof window=="object"&&"crypto"in window)return window.crypto.getRandomValues(new Uint8Array(t));if(typeof process=="object"&&"node"in process.versions){let{randomBytes:e}=Yh();return new Uint8Array(e(t).buffer)}else throw new Error("The environment doesn't have randomBytes function")},sha512:async t=>{if(typeof window=="object"&&"crypto"in window){let e=await window.crypto.subtle.digest("SHA-512",t.buffer);return new Uint8Array(e)}else if(typeof process=="object"&&"node"in process.versions){let{createHash:e}=Yh(),r=e("sha512");return r.update(t),Uint8Array.from(r.digest())}else throw new Error("The environment doesn't have sha512 function")},precompute(t=8,e=yr.BASE){let r=e.equals(yr.BASE)?e:new yr(e.x,e.y);return r._setWindowSize(t),r.multiply(1n),r}}});var Ki=Y(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});var WC;(function(t){t.ECC="ecc",t.RSA="rsa"})(WC=Zr.CryptoSystem||(Zr.CryptoSystem={}));var YC;(function(t){t.P_256="P-256",t.P_384="P-384",t.P_521="P-521"})(YC=Zr.EccCurve||(Zr.EccCurve={}));var VC;(function(t){t[t.B1024=1024]="B1024",t[t.B2048=2048]="B2048",t[t.B4096=4096]="B4096"})(VC=Zr.RsaSize||(Zr.RsaSize={}));var JC;(function(t){t.AES_CTR="AES-CTR",t.AES_CBC="AES-CBC"})(JC=Zr.SymmAlg||(Zr.SymmAlg={}));var XC;(function(t){t[t.B128=128]="B128",t[t.B192=192]="B192",t[t.B256=256]="B256"})(XC=Zr.SymmKeyLength||(Zr.SymmKeyLength={}));var ZC;(function(t){t.SHA_1="SHA-1",t.SHA_256="SHA-256",t.SHA_384="SHA-384",t.SHA_512="SHA-512"})(ZC=Zr.HashAlg||(Zr.HashAlg={}));var QC;(function(t){t[t.B8=8]="B8",t[t.B16=16]="B16"})(QC=Zr.CharSize||(Zr.CharSize={}));var eF;(function(t){t.Read="read",t.Write="write"})(eF=Zr.KeyUse||(Zr.KeyUse={}))});var cu=Y(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});var bc=Ki();Tt.ECC_READ_ALG="ECDH";Tt.ECC_WRITE_ALG="ECDSA";Tt.RSA_READ_ALG="RSA-OAEP";Tt.RSA_WRITE_ALG="RSASSA-PKCS1-v1_5";Tt.SALT_LENGTH=128;Tt.DEFAULT_CRYPTOSYSTEM="ecc";Tt.DEFAULT_ECC_CURVE=bc.EccCurve.P_256;Tt.DEFAULT_RSA_SIZE=bc.RsaSize.B2048;Tt.DEFAULT_SYMM_ALG=bc.SymmAlg.AES_CTR;Tt.DEFAULT_SYMM_LEN=bc.SymmKeyLength.B256;Tt.DEFAULT_CTR_LEN=64;Tt.DEFAULT_HASH_ALG=bc.HashAlg.SHA_256;Tt.DEFAULT_CHAR_SIZE=bc.CharSize.B16;Tt.DEFAULT_STORE_NAME="keystore";Tt.DEFAULT_READ_KEY_NAME="read-key";Tt.DEFAULT_WRITE_KEY_NAME="write-key";Tt.default={ECC_READ_ALG:Tt.ECC_READ_ALG,ECC_WRITE_ALG:Tt.ECC_WRITE_ALG,RSA_READ_ALG:Tt.RSA_READ_ALG,RSA_WRITE_ALG:Tt.RSA_WRITE_ALG,SALT_LENGTH:Tt.SALT_LENGTH,DEFAULT_CRYPTOSYSTEM:Tt.DEFAULT_CRYPTOSYSTEM,DEFAULT_ECC_CURVE:Tt.DEFAULT_ECC_CURVE,DEFAULT_RSA_SIZE:Tt.DEFAULT_RSA_SIZE,DEFAULT_SYMM_ALG:Tt.DEFAULT_SYMM_ALG,DEFAULT_CTR_LEN:Tt.DEFAULT_CTR_LEN,DEFAULT_HASH_ALG:Tt.DEFAULT_HASH_ALG,DEFAULT_CHAR_SIZE:Tt.DEFAULT_CHAR_SIZE,DEFAULT_STORE_NAME:Tt.DEFAULT_STORE_NAME,DEFAULT_READ_KEY_NAME:Tt.DEFAULT_READ_KEY_NAME,DEFAULT_WRITE_KEY_NAME:Tt.DEFAULT_WRITE_KEY_NAME}});var ui=Y(nr=>{"use strict";var tF=nr&&nr.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},rF=nr&&nr.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(nr,"__esModule",{value:!0});var Wv=Ki(),Yv=Na();function Sm(t,e){var r=e===8?new Uint8Array(t):new Uint16Array(t);return Array.from(r).map(function(n){return String.fromCharCode(n)}).join("")}nr.arrBufToStr=Sm;function Vv(t){var e=Sm(t,8);return Yv.Buffer.from(e,"binary").toString("base64")}nr.arrBufToBase64=Vv;function qf(t,e){for(var r=e===8?new Uint8Array(t.length):new Uint16Array(t.length),n=0,o=t.length;n<o;n++)r[n]=t.charCodeAt(n);return r.buffer}nr.strToArrBuf=qf;function Pm(t){var e=Yv.Buffer.from(t,"base64").toString("binary");return qf(e,8)}nr.base64ToArrBuf=Pm;function Jv(){return new Uint8Array([1,0,1])}nr.publicExponent=Jv;function Xv(t){var e=new Uint8Array(t);return globalThis.crypto.getRandomValues(e),e.buffer}nr.randomBuf=Xv;function Zv(t,e){var r=new Uint8Array(t),n=new Uint8Array(e),o=new Uint8Array(r.length+n.length);return o.set(r),o.set(n,r.length),o.buffer}nr.joinBufs=Zv;nr.normalizeUtf8ToBuf=function(t){return nr.normalizeToBuf(t,function(e){return qf(e,Wv.CharSize.B8)})};nr.normalizeUtf16ToBuf=function(t){return nr.normalizeToBuf(t,function(e){return qf(e,Wv.CharSize.B16)})};nr.normalizeBase64ToBuf=function(t){return nr.normalizeToBuf(t,Pm)};nr.normalizeUnicodeToBuf=function(t,e){switch(e){case 8:return nr.normalizeUtf8ToBuf(t);default:return nr.normalizeUtf16ToBuf(t)}};nr.normalizeToBuf=function(t,e){if(typeof t=="string")return e(t);if(typeof t=="object"&&t.byteLength!==void 0){var r=new Uint8Array(t);return r.buffer}else throw new Error("Improper value. Must be a string, ArrayBuffer, Uint8Array")};function Qv(t){return tF(this,void 0,void 0,function(){return rF(this,function(e){return[2,new Promise(function(r){var n=new MessageChannel,o=n.port1,a=n.port2;a.onmessage=function(u){return r(u.data)},o.postMessage(t)})]})})}nr.structuralClone=Qv;nr.default={arrBufToStr:Sm,arrBufToBase64:Vv,strToArrBuf:qf,base64ToArrBuf:Pm,publicExponent:Jv,randomBuf:Xv,joinBufs:Zv,normalizeUtf8ToBuf:nr.normalizeUtf8ToBuf,normalizeUtf16ToBuf:nr.normalizeUtf16ToBuf,normalizeBase64ToBuf:nr.normalizeBase64ToBuf,normalizeToBuf:nr.normalizeToBuf,structuralClone:Qv}});var Hf=Y(dr=>{"use strict";Object.defineProperty(dr,"__esModule",{value:!0});var Vh=Ki();dr.KeyDoesNotExist=new Error("Key does not exist. Make sure you properly instantiated the keystore.");dr.NotKeyPair=new Error("Retrieved a symmetric key when an asymmetric keypair was expected. Please use a different key name.");dr.NotKey=new Error("Retrieved an asymmetric keypair when an symmetric key was expected. Please use a different key name.");dr.ECCNotEnabled=new Error("ECC is not enabled for this browser. Please use RSA instead.");dr.UnsupportedCrypto=new Error("Cryptosystem not supported. Please use ECC or RSA");dr.InvalidKeyUse=new Error("Invalid key use. Please use 'read' or 'write");function e2(t){if(!t||t===null)throw dr.KeyDoesNotExist;if(t.privateKey===void 0)throw dr.NotKeyPair;return t}dr.checkIsKeyPair=e2;function t2(t){if(!t||t===null)throw dr.KeyDoesNotExist;if(t.privateKey!==void 0||t.algorithm===void 0)throw dr.NotKey;return t}dr.checkIsKey=t2;function r2(t){i2(t,[Vh.CryptoSystem.ECC,Vh.CryptoSystem.RSA],dr.UnsupportedCrypto)}dr.checkValidCryptoSystem=r2;function n2(t){i2(t,[Vh.KeyUse.Read,Vh.KeyUse.Write],dr.InvalidKeyUse)}dr.checkValidKeyUse=n2;function i2(t,e,r){var n=e.some(function(o){return o===t});if(!n)throw r}dr.default={KeyDoesNotExist:dr.KeyDoesNotExist,NotKeyPair:dr.NotKeyPair,NotKey:dr.NotKey,ECCNotEnabled:dr.ECCNotEnabled,UnsupportedCrypto:dr.UnsupportedCrypto,InvalidKeyUse:dr.InvalidKeyUse,checkIsKeyPair:e2,checkIsKey:t2,checkValidCryptoSystem:r2,checkValidKeyUse:n2}});var jf=Y(Ua=>{"use strict";var o2=Ua&&Ua.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},a2=Ua&&Ua.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(Ua,"__esModule",{value:!0});var Jh=cu(),Xh=Ki(),s2=ui(),u2=Hf();function c2(t,e,r){return o2(this,void 0,void 0,function(){var n,o;return a2(this,function(a){return u2.checkValidKeyUse(r),n=r===Xh.KeyUse.Read?Jh.RSA_READ_ALG:Jh.RSA_WRITE_ALG,o=r===Xh.KeyUse.Read?["encrypt","decrypt"]:["sign","verify"],[2,globalThis.crypto.subtle.generateKey({name:n,modulusLength:t,publicExponent:s2.default.publicExponent(),hash:{name:e}},!1,o)]})})}Ua.makeKeypair=c2;function nF(t){return t.replace(`-----BEGIN PUBLIC KEY-----
|
2 | `,"").replace(`
|
3 | -----END PUBLIC KEY-----`,"")}function f2(t,e,r){return o2(this,void 0,void 0,function(){var n,o,a;return a2(this,function(u){return u2.checkValidKeyUse(r),n=r===Xh.KeyUse.Read?Jh.RSA_READ_ALG:Jh.RSA_WRITE_ALG,o=r===Xh.KeyUse.Read?["encrypt"]:["verify"],a=s2.default.base64ToArrBuf(nF(t)),[2,globalThis.crypto.subtle.importKey("spki",a,{name:n,hash:{name:e}},!0,o)]})})}Ua.importPublicKey=f2;Ua.default={makeKeypair:c2,importPublicKey:f2}});var Zh=Y(zi=>{"use strict";var $f=zi&&zi.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},Gf=zi&&zi.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(zi,"__esModule",{value:!0});var l2=jf(),vc=ui(),yo=cu(),h2=Ki();function d2(t,e,r){return r===void 0&&(r=yo.DEFAULT_CHAR_SIZE),$f(this,void 0,void 0,function(){return Gf(this,function(n){return[2,globalThis.crypto.subtle.sign({name:yo.RSA_WRITE_ALG,saltLength:yo.SALT_LENGTH},e,vc.normalizeUnicodeToBuf(t,r))]})})}zi.sign=d2;function p2(t,e,r,n,o){return n===void 0&&(n=yo.DEFAULT_CHAR_SIZE),o===void 0&&(o=yo.DEFAULT_HASH_ALG),$f(this,void 0,void 0,function(){var a,u,c,p;return Gf(this,function(l){switch(l.label){case 0:return u=(a=globalThis.crypto.subtle).verify,c=[{name:yo.RSA_WRITE_ALG,saltLength:yo.SALT_LENGTH}],typeof r!="string"?[3,2]:[4,l2.default.importPublicKey(r,o,h2.KeyUse.Write)];case 1:return p=l.sent(),[3,3];case 2:p=r,l.label=3;case 3:return[2,u.apply(a,c.concat([p,vc.normalizeBase64ToBuf(e),vc.normalizeUnicodeToBuf(t,n)]))]}})})}zi.verify=p2;function m2(t,e,r,n){return r===void 0&&(r=yo.DEFAULT_CHAR_SIZE),n===void 0&&(n=yo.DEFAULT_HASH_ALG),$f(this,void 0,void 0,function(){var o,a,u,c;return Gf(this,function(p){switch(p.label){case 0:return a=(o=globalThis.crypto.subtle).encrypt,u=[{name:yo.RSA_READ_ALG}],typeof e!="string"?[3,2]:[4,l2.default.importPublicKey(e,n,h2.KeyUse.Read)];case 1:return c=p.sent(),[3,3];case 2:c=e,p.label=3;case 3:return[2,a.apply(o,u.concat([c,vc.normalizeUnicodeToBuf(t,r)]))]}})})}zi.encrypt=m2;function y2(t,e){return $f(this,void 0,void 0,function(){var r;return Gf(this,function(n){return r=vc.normalizeBase64ToBuf(t),[2,globalThis.crypto.subtle.decrypt({name:yo.RSA_READ_ALG},e,r)]})})}zi.decrypt=y2;function g2(t){return $f(this,void 0,void 0,function(){var e;return Gf(this,function(r){switch(r.label){case 0:return[4,globalThis.crypto.subtle.exportKey("spki",t.publicKey)];case 1:return e=r.sent(),[2,vc.default.arrBufToBase64(e)]}})})}zi.getPublicKey=g2;zi.default={sign:d2,verify:p2,encrypt:m2,decrypt:y2,getPublicKey:g2}});var Im=Y(un=>{"use strict";var La=un&&un.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},Ma=un&&un.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(un,"__esModule",{value:!0});var Oa=jh(),b2=Hf();function v2(t){return Oa.default.createInstance({name:t})}un.createStore=v2;function _2(t,e,r){return r===void 0&&(r=Oa.default),La(this,void 0,void 0,function(){var n;return Ma(this,function(o){switch(o.label){case 0:return[4,Cm(t,r)];case 1:return o.sent()?[2]:[4,e()];case 2:return n=o.sent(),[4,Tm(t,n,r)];case 3:return o.sent(),[2]}})})}un.createIfDoesNotExist=_2;function Tm(t,e,r){return r===void 0&&(r=Oa.default),La(this,void 0,void 0,function(){return Ma(this,function(n){return[2,r.setItem(t,e)]})})}un.put=Tm;function w2(t,e){return e===void 0&&(e=Oa.default),La(this,void 0,void 0,function(){return Ma(this,function(r){return[2,Bm(t,b2.checkIsKeyPair,e)]})})}un.getKeypair=w2;function x2(t,e){return e===void 0&&(e=Oa.default),La(this,void 0,void 0,function(){return Ma(this,function(r){return[2,Bm(t,b2.checkIsKey,e)]})})}un.getKey=x2;function Bm(t,e,r){return r===void 0&&(r=Oa.default),La(this,void 0,void 0,function(){var n;return Ma(this,function(o){switch(o.label){case 0:return[4,r.getItem(t)];case 1:return n=o.sent(),[2,n===null?null:e(n)]}})})}un.get=Bm;function Cm(t,e){return e===void 0&&(e=Oa.default),La(this,void 0,void 0,function(){var r;return Ma(this,function(n){switch(n.label){case 0:return[4,e.getItem(t)];case 1:return r=n.sent(),[2,r!==null]}})})}un.exists=Cm;function k2(t,e){return e===void 0&&(e=Oa.default),La(this,void 0,void 0,function(){return Ma(this,function(r){return[2,e.removeItem(t)]})})}un.rm=k2;function Fm(t){return La(this,void 0,void 0,function(){return Ma(this,function(e){return[2,t.dropInstance()]})})}un.dropStore=Fm;function A2(t){return La(this,void 0,void 0,function(){return Ma(this,function(e){return t?[2,Fm(t)]:[2,Oa.default.clear()]})})}un.clear=A2;un.default={createStore:v2,createIfDoesNotExist:_2,put:Tm,getKeypair:w2,getKey:x2,exists:Cm,rm:k2,dropStore:Fm,clear:A2}});var C2=Y(Ka=>{"use strict";var E2=Ka&&Ka.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},S2=Ka&&Ka.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(Ka,"__esModule",{value:!0});var iF=ui(),Qh=cu(),ed=Ki(),P2=Hf();function T2(t,e){return E2(this,void 0,void 0,function(){var r,n;return S2(this,function(o){return P2.checkValidKeyUse(e),r=e===ed.KeyUse.Read?Qh.ECC_READ_ALG:Qh.ECC_WRITE_ALG,n=e===ed.KeyUse.Read?["deriveKey","deriveBits"]:["sign","verify"],[2,globalThis.crypto.subtle.generateKey({name:r,namedCurve:t},!1,n)]})})}Ka.makeKeypair=T2;function B2(t,e,r){return E2(this,void 0,void 0,function(){var n,o,a;return S2(this,function(u){return P2.checkValidKeyUse(r),n=r===ed.KeyUse.Read?Qh.ECC_READ_ALG:Qh.ECC_WRITE_ALG,o=r===ed.KeyUse.Read?[]:["verify"],a=iF.default.base64ToArrBuf(t),[2,globalThis.crypto.subtle.importKey("raw",a,{name:n,namedCurve:e},!0,o)]})})}Ka.importPublicKey=B2;Ka.default={makeKeypair:T2,importPublicKey:B2}});var Rm=Y(cn=>{"use strict";var _c=cn&&cn.__assign||function(){return _c=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},_c.apply(this,arguments)},oF=cn&&cn.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},aF=cn&&cn.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(cn,"__esModule",{value:!0});var sF=C2(),go=cu(),Dm=Ki(),uF=ui();cn.defaultConfig={type:go.DEFAULT_CRYPTOSYSTEM,curve:go.DEFAULT_ECC_CURVE,rsaSize:go.DEFAULT_RSA_SIZE,symmAlg:go.DEFAULT_SYMM_ALG,symmLen:go.DEFAULT_SYMM_LEN,hashAlg:go.DEFAULT_HASH_ALG,charSize:go.DEFAULT_CHAR_SIZE,storeName:go.DEFAULT_STORE_NAME,readKeyName:go.DEFAULT_READ_KEY_NAME,writeKeyName:go.DEFAULT_WRITE_KEY_NAME};function F2(t,e){e===void 0&&(e=!0);var r;return t?r=_c(_c({},cn.defaultConfig),t):r=cn.defaultConfig,(t==null?void 0:t.type)||(r.type=e?Dm.CryptoSystem.ECC:Dm.CryptoSystem.RSA),r}cn.normalize=F2;function I2(){return oF(this,void 0,void 0,function(){var t,e;return aF(this,function(r){switch(r.label){case 0:return[4,sF.default.makeKeypair(go.DEFAULT_ECC_CURVE,Dm.KeyUse.Read)];case 1:t=r.sent(),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,uF.default.structuralClone(t)];case 3:return r.sent(),[3,5];case 4:return e=r.sent(),[2,!1];case 5:return[2,!0]}})})}cn.eccEnabled=I2;function D2(t,e){return e===void 0&&(e={}),_c(_c({},t),e)}cn.merge=D2;function R2(t){return{alg:t.symmAlg,length:t.symmLen}}cn.symmKeyOpts=R2;cn.default={defaultConfig:cn.defaultConfig,normalize:F2,eccEnabled:I2,merge:D2,symmKeyOpts:R2}});var rd=Y(za=>{"use strict";var N2=za&&za.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},U2=za&&za.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(za,"__esModule",{value:!0});var cF=ui(),td=cu();function L2(t){return N2(this,void 0,void 0,function(){return U2(this,function(e){return[2,globalThis.crypto.subtle.generateKey({name:(t==null?void 0:t.alg)||td.DEFAULT_SYMM_ALG,length:(t==null?void 0:t.length)||td.DEFAULT_SYMM_LEN},!0,["encrypt","decrypt"])]})})}za.makeKey=L2;function M2(t,e){return N2(this,void 0,void 0,function(){var r;return U2(this,function(n){return r=cF.default.base64ToArrBuf(t),[2,globalThis.crypto.subtle.importKey("raw",r,{name:(e==null?void 0:e.alg)||td.DEFAULT_SYMM_ALG,length:(e==null?void 0:e.length)||td.DEFAULT_SYMM_LEN},!0,["encrypt","decrypt"])]})})}za.importKey=M2;za.default={makeKey:L2,importKey:M2}});var Lm=Y(qi=>{"use strict";var Wf=qi&&qi.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},Yf=qi&&qi.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(qi,"__esModule",{value:!0});var O2=rd(),fu=ui(),nd=cu(),wc=Ki();function Nm(t,e,r){return Wf(this,void 0,void 0,function(){var n,o,a,u,c,p;return Yf(this,function(l){switch(l.label){case 0:return n=fu.default.normalizeUtf16ToBuf(t),typeof e!="string"?[3,2]:[4,O2.default.importKey(e,r)];case 1:return a=l.sent(),[3,3];case 2:a=e,l.label=3;case 3:return o=a,u=(r==null?void 0:r.alg)||nd.DEFAULT_SYMM_ALG,c=(r==null?void 0:r.iv)||fu.default.randomBuf(16),[4,globalThis.crypto.subtle.encrypt({name:u,iv:u===wc.SymmAlg.AES_CTR?void 0:c,counter:u===wc.SymmAlg.AES_CTR?new Uint8Array(c):void 0,length:u===wc.SymmAlg.AES_CTR?nd.DEFAULT_CTR_LEN:void 0},o,n)];case 4:return p=l.sent(),[2,fu.default.joinBufs(c,p)]}})})}qi.encryptBytes=Nm;function Um(t,e,r){return Wf(this,void 0,void 0,function(){var n,o,a,u,c,p,l;return Yf(this,function(y){switch(y.label){case 0:return n=fu.default.normalizeBase64ToBuf(t),typeof e!="string"?[3,2]:[4,O2.default.importKey(e,r)];case 1:return a=y.sent(),[3,3];case 2:a=e,y.label=3;case 3:return o=a,u=(r==null?void 0:r.alg)||nd.DEFAULT_SYMM_ALG,c=n.slice(0,16),p=n.slice(16),[4,globalThis.crypto.subtle.decrypt({name:u,iv:u===wc.SymmAlg.AES_CTR?void 0:c,counter:u===wc.SymmAlg.AES_CTR?new Uint8Array(c):void 0,length:u===wc.SymmAlg.AES_CTR?nd.DEFAULT_CTR_LEN:void 0},o,p)];case 4:return l=y.sent(),[2,l]}})})}qi.decryptBytes=Um;function K2(t,e,r){return Wf(this,void 0,void 0,function(){var n;return Yf(this,function(o){switch(o.label){case 0:return[4,Nm(t,e,r)];case 1:return n=o.sent(),[2,fu.default.arrBufToBase64(n)]}})})}qi.encrypt=K2;function z2(t,e,r){return Wf(this,void 0,void 0,function(){var n;return Yf(this,function(o){switch(o.label){case 0:return[4,Um(t,e,r)];case 1:return n=o.sent(),[2,fu.default.arrBufToStr(n,16)]}})})}qi.decrypt=z2;function q2(t){return Wf(this,void 0,void 0,function(){var e;return Yf(this,function(r){switch(r.label){case 0:return[4,globalThis.crypto.subtle.exportKey("raw",t)];case 1:return e=r.sent(),[2,fu.default.arrBufToBase64(e)]}})})}qi.exportKey=q2;qi.default={encryptBytes:Nm,decryptBytes:Um,encrypt:K2,decrypt:z2,exportKey:q2}});var Mm=Y(lu=>{"use strict";var id=lu&&lu.__assign||function(){return id=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},id.apply(this,arguments)};function H2(t){for(var e in t)lu.hasOwnProperty(e)||(lu[e]=t[e])}Object.defineProperty(lu,"__esModule",{value:!0});var fF=rd(),lF=Lm();H2(rd());H2(Lm());lu.default=id(id({},fF.default),lF.default)});var $2=Y(hu=>{"use strict";var oa=hu&&hu.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},aa=hu&&hu.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(hu,"__esModule",{value:!0});var Vf=Mm(),_s=Im(),od=ui(),ws=Rm(),j2=Hf(),hF=function(){function t(e,r){this.cfg=e,this.store=r}return t.prototype.writeKey=function(){return oa(this,void 0,void 0,function(){var e;return aa(this,function(r){switch(r.label){case 0:return[4,_s.default.getKeypair(this.cfg.writeKeyName,this.store)];case 1:return e=r.sent(),[2,j2.checkIsKeyPair(e)]}})})},t.prototype.readKey=function(){return oa(this,void 0,void 0,function(){var e;return aa(this,function(r){switch(r.label){case 0:return[4,_s.default.getKeypair(this.cfg.readKeyName,this.store)];case 1:return e=r.sent(),[2,j2.checkIsKeyPair(e)]}})})},t.prototype.getSymmKey=function(e,r){return oa(this,void 0,void 0,function(){var n,o,a;return aa(this,function(u){switch(u.label){case 0:return n=ws.default.merge(this.cfg,r),[4,_s.default.getKey(e,this.store)];case 1:return o=u.sent(),o!==null?[2,o]:[4,Vf.default.makeKey(ws.default.symmKeyOpts(n))];case 2:return a=u.sent(),[4,_s.default.put(e,a,this.store)];case 3:return u.sent(),[2,a]}})})},t.prototype.keyExists=function(e){return oa(this,void 0,void 0,function(){var r;return aa(this,function(n){switch(n.label){case 0:return[4,_s.default.getKey(e,this.store)];case 1:return r=n.sent(),[2,r!==null]}})})},t.prototype.deleteKey=function(e){return oa(this,void 0,void 0,function(){return aa(this,function(r){return[2,_s.default.rm(e,this.store)]})})},t.prototype.destroy=function(){return oa(this,void 0,void 0,function(){return aa(this,function(e){return[2,_s.default.dropStore(this.store)]})})},t.prototype.importSymmKey=function(e,r,n){return oa(this,void 0,void 0,function(){var o,a;return aa(this,function(u){switch(u.label){case 0:return o=ws.default.merge(this.cfg,n),[4,Vf.default.importKey(e,ws.default.symmKeyOpts(o))];case 1:return a=u.sent(),[4,_s.default.put(r,a,this.store)];case 2:return u.sent(),[2]}})})},t.prototype.exportSymmKey=function(e,r){return oa(this,void 0,void 0,function(){var n;return aa(this,function(o){switch(o.label){case 0:return[4,this.getSymmKey(e,r)];case 1:return n=o.sent(),[2,Vf.default.exportKey(n)]}})})},t.prototype.encryptWithSymmKey=function(e,r,n){return oa(this,void 0,void 0,function(){var o,a,u;return aa(this,function(c){switch(c.label){case 0:return o=ws.default.merge(this.cfg,n),[4,this.getSymmKey(r,n)];case 1:return a=c.sent(),[4,Vf.default.encryptBytes(od.default.strToArrBuf(e,o.charSize),a,ws.default.symmKeyOpts(o))];case 2:return u=c.sent(),[2,od.default.arrBufToBase64(u)]}})})},t.prototype.decryptWithSymmKey=function(e,r,n){return oa(this,void 0,void 0,function(){var o,a,u;return aa(this,function(c){switch(c.label){case 0:return o=ws.default.merge(this.cfg,n),[4,this.getSymmKey(r,n)];case 1:return a=c.sent(),[4,Vf.default.decryptBytes(od.default.base64ToArrBuf(e),a,ws.default.symmKeyOpts(o))];case 2:return u=c.sent(),[2,od.default.arrBufToStr(u,o.charSize)]}})})},t}();hu.default=hF});var qm=Y(Hi=>{"use strict";var dF=Hi&&Hi.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ad=Hi&&Hi.__assign||function(){return ad=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},ad.apply(this,arguments)},du=Hi&&Hi.__awaiter||function(t,e,r,n){function o(a){return a instanceof r?a:new r(function(u){u(a)})}return new(r||(r=Promise))(function(a,u){function c(y){try{l(n.next(y))}catch(w){u(w)}}function p(y){try{l(n.throw(y))}catch(w){u(w)}}function l(y){y.done?a(y.value):o(y.value).then(c,p)}l((n=n.apply(t,e||[])).next())})},pu=Hi&&Hi.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}};Object.defineProperty(Hi,"__esModule",{value:!0});var Om=Im(),G2=jf(),xc=Zh(),Jf=Rm(),Km=ui(),pF=$2(),zm=Ki(),W2=function(t){dF(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.init=function(r){return du(this,void 0,void 0,function(){var n,o,a,u,c,p,l;return pu(this,function(y){switch(y.label){case 0:return n=Jf.default.normalize(ad(ad({},r||{}),{type:zm.CryptoSystem.RSA})),o=n.rsaSize,a=n.hashAlg,u=n.storeName,c=n.readKeyName,p=n.writeKeyName,l=Om.default.createStore(u),[4,Om.default.createIfDoesNotExist(c,function(){return G2.default.makeKeypair(o,a,zm.KeyUse.Read)},l)];case 1:return y.sent(),[4,Om.default.createIfDoesNotExist(p,function(){return G2.default.makeKeypair(o,a,zm.KeyUse.Write)},l)];case 2:return y.sent(),[2,new e(n,l)]}})})},e.prototype.sign=function(r,n){return du(this,void 0,void 0,function(){var o,a,u,c;return pu(this,function(p){switch(p.label){case 0:return o=Jf.default.merge(this.cfg,n),[4,this.writeKey()];case 1:return a=p.sent(),c=(u=Km.default).arrBufToBase64,[4,xc.default.sign(r,a.privateKey,o.charSize)];case 2:return[2,c.apply(u,[p.sent()])]}})})},e.prototype.verify=function(r,n,o,a){return du(this,void 0,void 0,function(){var u;return pu(this,function(c){return u=Jf.default.merge(this.cfg,a),[2,xc.default.verify(r,n,o,u.charSize,u.hashAlg)]})})},e.prototype.encrypt=function(r,n,o){return du(this,void 0,void 0,function(){var a,u,c;return pu(this,function(p){switch(p.label){case 0:return a=Jf.default.merge(this.cfg,o),c=(u=Km.default).arrBufToBase64,[4,xc.default.encrypt(r,n,a.charSize,a.hashAlg)];case 1:return[2,c.apply(u,[p.sent()])]}})})},e.prototype.decrypt=function(r,n,o){return du(this,void 0,void 0,function(){var a,u,c,p;return pu(this,function(l){switch(l.label){case 0:return[4,this.readKey()];case 1:return a=l.sent(),u=Jf.default.merge(this.cfg,o),p=(c=Km.default).arrBufToStr,[4,xc.default.decrypt(r,a.privateKey)];case 2:return[2,p.apply(c,[l.sent(),u.charSize])]}})})},e.prototype.publicReadKey=function(){return du(this,void 0,void 0,function(){var r;return pu(this,function(n){switch(n.label){case 0:return[4,this.readKey()];case 1:return r=n.sent(),[2,xc.default.getPublicKey(r)]}})})},e.prototype.publicWriteKey=function(){return du(this,void 0,void 0,function(){var r;return pu(this,function(n){switch(n.label){case 0:return[4,this.writeKey()];case 1:return r=n.sent(),[2,xc.default.getPublicKey(r)]}})})},e}(pF.default);Hi.RSAKeyStore=W2;Hi.default=W2});var Y2=Y(mu=>{"use strict";var Xf=mu&&mu.__assign||function(){return Xf=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Xf.apply(this,arguments)};function Hm(t){for(var e in t)mu.hasOwnProperty(e)||(mu[e]=t[e])}Object.defineProperty(mu,"__esModule",{value:!0});var mF=jf(),yF=Zh(),gF=qm();Hm(jf());Hm(Zh());Hm(qm());mu.default=Xf(Xf(Xf({},mF.default),yF.default),gF.default)});var J2=Y((jm,$m)=>{(function(t,e){typeof jm=="object"&&typeof $m!="undefined"?$m.exports=e():typeof define=="function"&&define.amd?define(e):(t=t||self,t.keystore=e())})(jm,function(){"use strict";var t=function(g,d){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(h,b){h.__proto__=b}||function(h,b){for(var S in b)b.hasOwnProperty(S)&&(h[S]=b[S])},t(g,d)};function e(g,d){t(g,d);function h(){this.constructor=g}g.prototype=d===null?Object.create(d):(h.prototype=d.prototype,new h)}var r=function(){return r=Object.assign||function(d){for(var h,b=1,S=arguments.length;b<S;b++){h=arguments[b];for(var C in h)Object.prototype.hasOwnProperty.call(h,C)&&(d[C]=h[C])}return d},r.apply(this,arguments)};function n(g,d,h,b){return new(h||(h=Promise))(function(S,C){function I(ee){try{oe(b.next(ee))}catch(Me){C(Me)}}function W(ee){try{oe(b.throw(ee))}catch(Me){C(Me)}}function oe(ee){ee.done?S(ee.value):new h(function(Me){Me(ee.value)}).then(I,W)}oe((b=b.apply(g,d||[])).next())})}function o(g,d){var h={label:0,sent:function(){if(C[0]&1)throw C[1];return C[1]},trys:[],ops:[]},b,S,C,I;return I={next:W(0),throw:W(1),return:W(2)},typeof Symbol=="function"&&(I[Symbol.iterator]=function(){return this}),I;function W(ee){return function(Me){return oe([ee,Me])}}function oe(ee){if(b)throw new TypeError("Generator is already executing.");for(;h;)try{if(b=1,S&&(C=ee[0]&2?S.return:ee[0]?S.throw||((C=S.return)&&C.call(S),0):S.next)&&!(C=C.call(S,ee[1])).done)return C;switch(S=0,C&&(ee=[ee[0]&2,C.value]),ee[0]){case 0:case 1:C=ee;break;case 4:return h.label++,{value:ee[1],done:!1};case 5:h.label++,S=ee[1],ee=[0];continue;case 7:ee=h.ops.pop(),h.trys.pop();continue;default:if(C=h.trys,!(C=C.length>0&&C[C.length-1])&&(ee[0]===6||ee[0]===2)){h=0;continue}if(ee[0]===3&&(!C||ee[1]>C[0]&&ee[1]<C[3])){h.label=ee[1];break}if(ee[0]===6&&h.label<C[1]){h.label=C[1],C=ee;break}if(C&&h.label<C[2]){h.label=C[2],h.ops.push(ee);break}C[2]&&h.ops.pop(),h.trys.pop();continue}ee=d.call(g,h)}catch(Me){ee=[6,Me],S=0}finally{b=C=0}if(ee[0]&5)throw ee[1];return{value:ee[0]?ee[1]:void 0,done:!0}}}(function(g){typeof globalThis!="object"&&(this?d():(g.defineProperty(g.prototype,"_T_",{configurable:!0,get:d}),_T_));function d(){var h=this||self;h.globalThis=h,delete g.prototype._T_}})(Object);var a=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function u(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function c(g,d){return d={exports:{}},g(d,d.exports),d.exports}var p=c(function(g,d){(function(h){g.exports=h()})(function(){return function h(b,S,C){function I(ee,Me){if(!S[ee]){if(!b[ee]){var be=typeof u=="function"&&u;if(!Me&&be)return be(ee,!0);if(W)return W(ee,!0);var Je=new Error("Cannot find module '"+ee+"'");throw Je.code="MODULE_NOT_FOUND",Je}var Et=S[ee]={exports:{}};b[ee][0].call(Et.exports,function(Yt){var on=b[ee][1][Yt];return I(on||Yt)},Et,Et.exports,h,b,S,C)}return S[ee].exports}for(var W=typeof u=="function"&&u,oe=0;oe<C.length;oe++)I(C[oe]);return I}({1:[function(h,b,S){(function(C){var I=C.MutationObserver||C.WebKitMutationObserver,W;if(I){var oe=0,ee=new I(Yt),Me=C.document.createTextNode("");ee.observe(Me,{characterData:!0}),W=function(){Me.data=oe=++oe%2}}else if(!C.setImmediate&&typeof C.MessageChannel!="undefined"){var be=new C.MessageChannel;be.port1.onmessage=Yt,W=function(){be.port2.postMessage(0)}}else"document"in C&&"onreadystatechange"in C.document.createElement("script")?W=function(){var Ir=C.document.createElement("script");Ir.onreadystatechange=function(){Yt(),Ir.onreadystatechange=null,Ir.parentNode.removeChild(Ir),Ir=null},C.document.documentElement.appendChild(Ir)}:W=function(){setTimeout(Yt,0)};var Je,Et=[];function Yt(){Je=!0;for(var Ir,Ri,Mt=Et.length;Mt;){for(Ri=Et,Et=[],Ir=-1;++Ir<Mt;)Ri[Ir]();Mt=Et.length}Je=!1}b.exports=on;function on(Ir){Et.push(Ir)===1&&!Je&&W()}}).call(this,typeof a!="undefined"?a:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(h,b,S){var C=h(1);function I(){}var W={},oe=["REJECTED"],ee=["FULFILLED"],Me=["PENDING"];b.exports=be;function be(Le){if(typeof Le!="function")throw new TypeError("resolver must be a function");this.state=Me,this.queue=[],this.outcome=void 0,Le!==I&&on(this,Le)}be.prototype.catch=function(Le){return this.then(null,Le)},be.prototype.then=function(Le,Ft){if(typeof Le!="function"&&this.state===ee||typeof Ft!="function"&&this.state===oe)return this;var _t=new this.constructor(I);if(this.state!==Me){var rr=this.state===ee?Le:Ft;Et(_t,rr,this.outcome)}else this.queue.push(new Je(_t,Le,Ft));return _t};function Je(Le,Ft,_t){this.promise=Le,typeof Ft=="function"&&(this.onFulfilled=Ft,this.callFulfilled=this.otherCallFulfilled),typeof _t=="function"&&(this.onRejected=_t,this.callRejected=this.otherCallRejected)}Je.prototype.callFulfilled=function(Le){W.resolve(this.promise,Le)},Je.prototype.otherCallFulfilled=function(Le){Et(this.promise,this.onFulfilled,Le)},Je.prototype.callRejected=function(Le){W.reject(this.promise,Le)},Je.prototype.otherCallRejected=function(Le){Et(this.promise,this.onRejected,Le)};function Et(Le,Ft,_t){C(function(){var rr;try{rr=Ft(_t)}catch(qr){return W.reject(Le,qr)}rr===Le?W.reject(Le,new TypeError("Cannot resolve promise with itself")):W.resolve(Le,rr)})}W.resolve=function(Le,Ft){var _t=Ir(Yt,Ft);if(_t.status==="error")return W.reject(Le,_t.value);var rr=_t.value;if(rr)on(Le,rr);else{Le.state=ee,Le.outcome=Ft;for(var qr=-1,En=Le.queue.length;++qr<En;)Le.queue[qr].callFulfilled(Ft)}return Le},W.reject=function(Le,Ft){Le.state=oe,Le.outcome=Ft;for(var _t=-1,rr=Le.queue.length;++_t<rr;)Le.queue[_t].callRejected(Ft);return Le};function Yt(Le){var Ft=Le&&Le.then;if(Le&&(typeof Le=="object"||typeof Le=="function")&&typeof Ft=="function")return function(){Ft.apply(Le,arguments)}}function on(Le,Ft){var _t=!1;function rr(Hr){_t||(_t=!0,W.reject(Le,Hr))}function qr(Hr){_t||(_t=!0,W.resolve(Le,Hr))}function En(){Ft(qr,rr)}var Kn=Ir(En);Kn.status==="error"&&rr(Kn.value)}function Ir(Le,Ft){var _t={};try{_t.value=Le(Ft),_t.status="success"}catch(rr){_t.status="error",_t.value=rr}return _t}be.resolve=Ri;function Ri(Le){return Le instanceof this?Le:W.resolve(new this(I),Le)}be.reject=Mt;function Mt(Le){var Ft=new this(I);return W.reject(Ft,Le)}be.all=qs;function qs(Le){var Ft=this;if(Object.prototype.toString.call(Le)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _t=Le.length,rr=!1;if(!_t)return this.resolve([]);for(var qr=new Array(_t),En=0,Kn=-1,Hr=new this(I);++Kn<_t;)co(Le[Kn],Kn);return Hr;function co(Hs,os){Ft.resolve(Hs).then(Zu,function(Sn){rr||(rr=!0,W.reject(Hr,Sn))});function Zu(Sn){qr[os]=Sn,++En===_t&&!rr&&(rr=!0,W.resolve(Hr,qr))}}}be.race=ti;function ti(Le){var Ft=this;if(Object.prototype.toString.call(Le)!=="[object Array]")return this.reject(new TypeError("must be an array"));var _t=Le.length,rr=!1;if(!_t)return this.resolve([]);for(var qr=-1,En=new this(I);++qr<_t;)Kn(Le[qr]);return En;function Kn(Hr){Ft.resolve(Hr).then(function(co){rr||(rr=!0,W.resolve(En,co))},function(co){rr||(rr=!0,W.reject(En,co))})}}},{"1":1}],3:[function(h,b,S){(function(C){typeof C.Promise!="function"&&(C.Promise=h(2))}).call(this,typeof a!="undefined"?a:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{"2":2}],4:[function(h,b,S){var C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(x){return typeof x}:function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x};function I(x,N){if(!(x instanceof N))throw new TypeError("Cannot call a class as a function")}function W(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(x){return}}var oe=W();function ee(){try{if(!oe)return!1;var x=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),N=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!x||N)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(B){return!1}}function Me(x,N){x=x||[],N=N||{};try{return new Blob(x,N)}catch(O){if(O.name!=="TypeError")throw O;for(var B=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,z=new B,j=0;j<x.length;j+=1)z.append(x[j]);return z.getBlob(N.type)}}typeof Promise=="undefined"&&h(3);var be=Promise;function Je(x,N){N&&x.then(function(B){N(null,B)},function(B){N(B)})}function Et(x,N,B){typeof N=="function"&&x.then(N),typeof B=="function"&&x.catch(B)}function Yt(x){return typeof x!="string"&&(console.warn(x+" used as a key, but it is not a string."),x=String(x)),x}function on(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var Ir="local-forage-detect-blob-support",Ri=void 0,Mt={},qs=Object.prototype.toString,ti="readonly",Le="readwrite";function Ft(x){for(var N=x.length,B=new ArrayBuffer(N),z=new Uint8Array(B),j=0;j<N;j++)z[j]=x.charCodeAt(j);return B}function _t(x){return new be(function(N){var B=x.transaction(Ir,Le),z=Me([""]);B.objectStore(Ir).put(z,"key"),B.onabort=function(j){j.preventDefault(),j.stopPropagation(),N(!1)},B.oncomplete=function(){var j=navigator.userAgent.match(/Chrome\/(\d+)/),O=navigator.userAgent.match(/Edge\//);N(O||!j||parseInt(j[1],10)>=43)}}).catch(function(){return!1})}function rr(x){return typeof Ri=="boolean"?be.resolve(Ri):_t(x).then(function(N){return Ri=N,Ri})}function qr(x){var N=Mt[x.name],B={};B.promise=new be(function(z,j){B.resolve=z,B.reject=j}),N.deferredOperations.push(B),N.dbReady?N.dbReady=N.dbReady.then(function(){return B.promise}):N.dbReady=B.promise}function En(x){var N=Mt[x.name],B=N.deferredOperations.pop();if(B)return B.resolve(),B.promise}function Kn(x,N){var B=Mt[x.name],z=B.deferredOperations.pop();if(z)return z.reject(N),z.promise}function Hr(x,N){return new be(function(B,z){if(Mt[x.name]=Mt[x.name]||xa(),x.db)if(N)qr(x),x.db.close();else return B(x.db);var j=[x.name];N&&j.push(x.version);var O=oe.open.apply(oe,j);N&&(O.onupgradeneeded=function(le){var we=O.result;try{we.createObjectStore(x.storeName),le.oldVersion<=1&&we.createObjectStore(Ir)}catch(Pe){if(Pe.name==="ConstraintError")console.warn('The database "'+x.name+'" has been upgraded from version '+le.oldVersion+" to version "+le.newVersion+', but the storage "'+x.storeName+'" already exists.');else throw Pe}}),O.onerror=function(le){le.preventDefault(),z(O.error)},O.onsuccess=function(){B(O.result),En(x)}})}function co(x){return Hr(x,!1)}function Hs(x){return Hr(x,!0)}function os(x,N){if(!x.db)return!0;var B=!x.db.objectStoreNames.contains(x.storeName),z=x.version<x.db.version,j=x.version>x.db.version;if(z&&(x.version!==N&&console.warn('The database "'+x.name+`" can't be downgraded from version `+x.db.version+" to version "+x.version+"."),x.version=x.db.version),j||B){if(B){var O=x.db.version+1;O>x.version&&(x.version=O)}return!0}return!1}function Zu(x){return new be(function(N,B){var z=new FileReader;z.onerror=B,z.onloadend=function(j){var O=btoa(j.target.result||"");N({__local_forage_encoded_blob:!0,data:O,type:x.type})},z.readAsBinaryString(x)})}function Sn(x){var N=Ft(atob(x.data));return Me([N],{type:x.type})}function js(x){return x&&x.__local_forage_encoded_blob}function Wp(x){var N=this,B=N._initReady().then(function(){var z=Mt[N._dbInfo.name];if(z&&z.dbReady)return z.dbReady});return Et(B,x,x),B}function Yp(x){qr(x);for(var N=Mt[x.name],B=N.forages,z=0;z<B.length;z++){var j=B[z];j._dbInfo.db&&(j._dbInfo.db.close(),j._dbInfo.db=null)}return x.db=null,co(x).then(function(O){return x.db=O,os(x)?Hs(x):O}).then(function(O){x.db=N.db=O;for(var le=0;le<B.length;le++)B[le]._dbInfo.db=O}).catch(function(O){throw Kn(x,O),O})}function fo(x,N,B,z){z===void 0&&(z=1);try{var j=x.db.transaction(x.storeName,N);B(null,j)}catch(O){if(z>0&&(!x.db||O.name==="InvalidStateError"||O.name==="NotFoundError"))return be.resolve().then(function(){if(!x.db||O.name==="NotFoundError"&&!x.db.objectStoreNames.contains(x.storeName)&&x.version<=x.db.version)return x.db&&(x.version=x.db.version+1),Hs(x)}).then(function(){return Yp(x).then(function(){fo(x,N,B,z-1)})}).catch(B);B(O)}}function xa(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ri(x){var N=this,B={db:null};if(x)for(var z in x)B[z]=x[z];var j=Mt[B.name];j||(j=xa(),Mt[B.name]=j),j.forages.push(N),N._initReady||(N._initReady=N.ready,N.ready=Wp);var O=[];function le(){return be.resolve()}for(var we=0;we<j.forages.length;we++){var Pe=j.forages[we];Pe!==N&&O.push(Pe._initReady().catch(le))}var Te=j.forages.slice(0);return be.all(O).then(function(){return B.db=j.db,co(B)}).then(function(Ee){return B.db=Ee,os(B,N._defaultConfig.version)?Hs(B):Ee}).then(function(Ee){B.db=j.db=Ee,N._dbInfo=B;for(var Ge=0;Ge<Te.length;Ge++){var gt=Te[Ge];gt!==N&&(gt._dbInfo.db=B.db,gt._dbInfo.version=B.version)}})}function sh(x,N){var B=this;x=Yt(x);var z=new be(function(j,O){B.ready().then(function(){fo(B._dbInfo,ti,function(le,we){if(le)return O(le);try{var Pe=we.objectStore(B._dbInfo.storeName),Te=Pe.get(x);Te.onsuccess=function(){var Ee=Te.result;Ee===void 0&&(Ee=null),js(Ee)&&(Ee=Sn(Ee)),j(Ee)},Te.onerror=function(){O(Te.error)}}catch(Ee){O(Ee)}})}).catch(O)});return Je(z,N),z}function Vp(x,N){var B=this,z=new be(function(j,O){B.ready().then(function(){fo(B._dbInfo,ti,function(le,we){if(le)return O(le);try{var Pe=we.objectStore(B._dbInfo.storeName),Te=Pe.openCursor(),Ee=1;Te.onsuccess=function(){var Ge=Te.result;if(Ge){var gt=Ge.value;js(gt)&&(gt=Sn(gt));var zt=x(gt,Ge.key,Ee++);zt!==void 0?j(zt):Ge.continue()}else j()},Te.onerror=function(){O(Te.error)}}catch(Ge){O(Ge)}})}).catch(O)});return Je(z,N),z}function Jp(x,N,B){var z=this;x=Yt(x);var j=new be(function(O,le){var we;z.ready().then(function(){return we=z._dbInfo,qs.call(N)==="[object Blob]"?rr(we.db).then(function(Pe){return Pe?N:Zu(N)}):N}).then(function(Pe){fo(z._dbInfo,Le,function(Te,Ee){if(Te)return le(Te);try{var Ge=Ee.objectStore(z._dbInfo.storeName);Pe===null&&(Pe=void 0);var gt=Ge.put(Pe,x);Ee.oncomplete=function(){Pe===void 0&&(Pe=null),O(Pe)},Ee.onabort=Ee.onerror=function(){var zt=gt.error?gt.error:gt.transaction.error;le(zt)}}catch(zt){le(zt)}})}).catch(le)});return Je(j,B),j}function Xp(x,N){var B=this;x=Yt(x);var z=new be(function(j,O){B.ready().then(function(){fo(B._dbInfo,Le,function(le,we){if(le)return O(le);try{var Pe=we.objectStore(B._dbInfo.storeName),Te=Pe.delete(x);we.oncomplete=function(){j()},we.onerror=function(){O(Te.error)},we.onabort=function(){var Ee=Te.error?Te.error:Te.transaction.error;O(Ee)}}catch(Ee){O(Ee)}})}).catch(O)});return Je(z,N),z}function Zp(x){var N=this,B=new be(function(z,j){N.ready().then(function(){fo(N._dbInfo,Le,function(O,le){if(O)return j(O);try{var we=le.objectStore(N._dbInfo.storeName),Pe=we.clear();le.oncomplete=function(){z()},le.onabort=le.onerror=function(){var Te=Pe.error?Pe.error:Pe.transaction.error;j(Te)}}catch(Te){j(Te)}})}).catch(j)});return Je(B,x),B}function Qp(x){var N=this,B=new be(function(z,j){N.ready().then(function(){fo(N._dbInfo,ti,function(O,le){if(O)return j(O);try{var we=le.objectStore(N._dbInfo.storeName),Pe=we.count();Pe.onsuccess=function(){z(Pe.result)},Pe.onerror=function(){j(Pe.error)}}catch(Te){j(Te)}})}).catch(j)});return Je(B,x),B}function Jo(x,N){var B=this,z=new be(function(j,O){if(x<0){j(null);return}B.ready().then(function(){fo(B._dbInfo,ti,function(le,we){if(le)return O(le);try{var Pe=we.objectStore(B._dbInfo.storeName),Te=!1,Ee=Pe.openCursor();Ee.onsuccess=function(){var Ge=Ee.result;if(!Ge){j(null);return}x===0||Te?j(Ge.key):(Te=!0,Ge.advance(x))},Ee.onerror=function(){O(Ee.error)}}catch(Ge){O(Ge)}})}).catch(O)});return Je(z,N),z}function q(x){var N=this,B=new be(function(z,j){N.ready().then(function(){fo(N._dbInfo,ti,function(O,le){if(O)return j(O);try{var we=le.objectStore(N._dbInfo.storeName),Pe=we.openCursor(),Te=[];Pe.onsuccess=function(){var Ee=Pe.result;if(!Ee){z(Te);return}Te.push(Ee.key),Ee.continue()},Pe.onerror=function(){j(Pe.error)}}catch(Ee){j(Ee)}})}).catch(j)});return Je(B,x),B}function ie(x,N){N=on.apply(this,arguments);var B=this.config();x=typeof x!="function"&&x||{},x.name||(x.name=x.name||B.name,x.storeName=x.storeName||B.storeName);var z=this,j;if(!x.name)j=be.reject("Invalid arguments");else{var O=x.name===B.name&&z._dbInfo.db,le=O?be.resolve(z._dbInfo.db):co(x).then(function(we){var Pe=Mt[x.name],Te=Pe.forages;Pe.db=we;for(var Ee=0;Ee<Te.length;Ee++)Te[Ee]._dbInfo.db=we;return we});x.storeName?j=le.then(function(we){if(!!we.objectStoreNames.contains(x.storeName)){var Pe=we.version+1;qr(x);var Te=Mt[x.name],Ee=Te.forages;we.close();for(var Ge=0;Ge<Ee.length;Ge++){var gt=Ee[Ge];gt._dbInfo.db=null,gt._dbInfo.version=Pe}var zt=new be(function($t,Rr){var Vt=oe.open(x.name,Pe);Vt.onerror=function(an){var tu=Vt.result;tu.close(),Rr(an)},Vt.onupgradeneeded=function(){var an=Vt.result;an.deleteObjectStore(x.storeName)},Vt.onsuccess=function(){var an=Vt.result;an.close(),$t(an)}});return zt.then(function($t){Te.db=$t;for(var Rr=0;Rr<Ee.length;Rr++){var Vt=Ee[Rr];Vt._dbInfo.db=$t,En(Vt._dbInfo)}}).catch(function($t){throw(Kn(x,$t)||be.resolve()).catch(function(){}),$t})}}):j=le.then(function(we){qr(x);var Pe=Mt[x.name],Te=Pe.forages;we.close();for(var Ee=0;Ee<Te.length;Ee++){var Ge=Te[Ee];Ge._dbInfo.db=null}var gt=new be(function(zt,$t){var Rr=oe.deleteDatabase(x.name);Rr.onerror=Rr.onblocked=function(Vt){var an=Rr.result;an&&an.close(),$t(Vt)},Rr.onsuccess=function(){var Vt=Rr.result;Vt&&Vt.close(),zt(Vt)}});return gt.then(function(zt){Pe.db=zt;for(var $t=0;$t<Te.length;$t++){var Rr=Te[$t];En(Rr._dbInfo)}}).catch(function(zt){throw(Kn(x,zt)||be.resolve()).catch(function(){}),zt})})}return Je(j,N),j}var X={_driver:"asyncStorage",_initStorage:ri,_support:ee(),iterate:Vp,getItem:sh,setItem:Jp,removeItem:Xp,clear:Zp,length:Qp,key:Jo,keys:q,dropInstance:ie};function ze(){return typeof openDatabase=="function"}var tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",It="~~local_forage_type~",Er=/^~~local_forage_type~([^~]+)~/,Ot="__lfsc__:",$s=Ot.length,vf="arbf",gn="blob",Gs="si08",uh="ui08",ka="uic8",Ws="si16",Ys="si32",Kt="ur16",ch="ui32",_f="fl32",Vs="fl64",fh=$s+vf.length,lh=Object.prototype.toString;function hh(x){var N=x.length*.75,B=x.length,z,j=0,O,le,we,Pe;x[x.length-1]==="="&&(N--,x[x.length-2]==="="&&N--);var Te=new ArrayBuffer(N),Ee=new Uint8Array(Te);for(z=0;z<B;z+=4)O=tt.indexOf(x[z]),le=tt.indexOf(x[z+1]),we=tt.indexOf(x[z+2]),Pe=tt.indexOf(x[z+3]),Ee[j++]=O<<2|le>>4,Ee[j++]=(le&15)<<4|we>>2,Ee[j++]=(we&3)<<6|Pe&63;return Te}function as(x){var N=new Uint8Array(x),B="",z;for(z=0;z<N.length;z+=3)B+=tt[N[z]>>2],B+=tt[(N[z]&3)<<4|N[z+1]>>4],B+=tt[(N[z+1]&15)<<2|N[z+2]>>6],B+=tt[N[z+2]&63];return N.length%3==2?B=B.substring(0,B.length-1)+"=":N.length%3==1&&(B=B.substring(0,B.length-2)+"=="),B}function Xo(x,N){var B="";if(x&&(B=lh.call(x)),x&&(B==="[object ArrayBuffer]"||x.buffer&&lh.call(x.buffer)==="[object ArrayBuffer]")){var z,j=Ot;x instanceof ArrayBuffer?(z=x,j+=vf):(z=x.buffer,B==="[object Int8Array]"?j+=Gs:B==="[object Uint8Array]"?j+=uh:B==="[object Uint8ClampedArray]"?j+=ka:B==="[object Int16Array]"?j+=Ws:B==="[object Uint16Array]"?j+=Kt:B==="[object Int32Array]"?j+=Ys:B==="[object Uint32Array]"?j+=ch:B==="[object Float32Array]"?j+=_f:B==="[object Float64Array]"?j+=Vs:N(new Error("Failed to get type for BinaryArray"))),N(j+as(z))}else if(B==="[object Blob]"){var O=new FileReader;O.onload=function(){var le=It+x.type+"~"+as(this.result);N(Ot+gn+le)},O.readAsArrayBuffer(x)}else try{N(JSON.stringify(x))}catch(le){console.error("Couldn't convert value into a JSON string: ",x),N(null,le)}}function Qu(x){if(x.substring(0,$s)!==Ot)return JSON.parse(x);var N=x.substring(fh),B=x.substring($s,fh),z;if(B===gn&&Er.test(N)){var j=N.match(Er);z=j[1],N=N.substring(j[0].length)}var O=hh(N);switch(B){case vf:return O;case gn:return Me([O],{type:z});case Gs:return new Int8Array(O);case uh:return new Uint8Array(O);case ka:return new Uint8ClampedArray(O);case Ws:return new Int16Array(O);case Kt:return new Uint16Array(O);case Ys:return new Int32Array(O);case ch:return new Uint32Array(O);case _f:return new Float32Array(O);case Vs:return new Float64Array(O);default:throw new Error("Unkown type: "+B)}}var ec={serialize:Xo,deserialize:Qu,stringToBuffer:hh,bufferToString:as};function Js(x,N,B,z){x.executeSql("CREATE TABLE IF NOT EXISTS "+N.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],B,z)}function dh(x){var N=this,B={db:null};if(x)for(var z in x)B[z]=typeof x[z]!="string"?x[z].toString():x[z];var j=new be(function(O,le){try{B.db=openDatabase(B.name,String(B.version),B.description,B.size)}catch(we){return le(we)}B.db.transaction(function(we){Js(we,B,function(){N._dbInfo=B,O()},function(Pe,Te){le(Te)})},le)});return B.serializer=ec,j}function lo(x,N,B,z,j,O){x.executeSql(B,z,j,function(le,we){we.code===we.SYNTAX_ERR?le.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[N.storeName],function(Pe,Te){Te.rows.length?O(Pe,we):Js(Pe,N,function(){Pe.executeSql(B,z,j,O)},O)},O):O(le,we)},O)}function tc(x,N){var B=this;x=Yt(x);var z=new be(function(j,O){B.ready().then(function(){var le=B._dbInfo;le.db.transaction(function(we){lo(we,le,"SELECT * FROM "+le.storeName+" WHERE key = ? LIMIT 1",[x],function(Pe,Te){var Ee=Te.rows.length?Te.rows.item(0).value:null;Ee&&(Ee=le.serializer.deserialize(Ee)),j(Ee)},function(Pe,Te){O(Te)})})}).catch(O)});return Je(z,N),z}function ph(x,N){var B=this,z=new be(function(j,O){B.ready().then(function(){var le=B._dbInfo;le.db.transaction(function(we){lo(we,le,"SELECT * FROM "+le.storeName,[],function(Pe,Te){for(var Ee=Te.rows,Ge=Ee.length,gt=0;gt<Ge;gt++){var zt=Ee.item(gt),$t=zt.value;if($t&&($t=le.serializer.deserialize($t)),$t=x($t,zt.key,gt+1),$t!==void 0){j($t);return}}j()},function(Pe,Te){O(Te)})})}).catch(O)});return Je(z,N),z}function ss(x,N,B,z){var j=this;x=Yt(x);var O=new be(function(le,we){j.ready().then(function(){N===void 0&&(N=null);var Pe=N,Te=j._dbInfo;Te.serializer.serialize(N,function(Ee,Ge){Ge?we(Ge):Te.db.transaction(function(gt){lo(gt,Te,"INSERT OR REPLACE INTO "+Te.storeName+" (key, value) VALUES (?, ?)",[x,Ee],function(){le(Pe)},function(zt,$t){we($t)})},function(gt){if(gt.code===gt.QUOTA_ERR){if(z>0){le(ss.apply(j,[x,Pe,B,z-1]));return}we(gt)}})})}).catch(we)});return Je(O,B),O}function Aa(x,N,B){return ss.apply(this,[x,N,B,1])}function rc(x,N){var B=this;x=Yt(x);var z=new be(function(j,O){B.ready().then(function(){var le=B._dbInfo;le.db.transaction(function(we){lo(we,le,"DELETE FROM "+le.storeName+" WHERE key = ?",[x],function(){j()},function(Pe,Te){O(Te)})})}).catch(O)});return Je(z,N),z}function e0(x){var N=this,B=new be(function(z,j){N.ready().then(function(){var O=N._dbInfo;O.db.transaction(function(le){lo(le,O,"DELETE FROM "+O.storeName,[],function(){z()},function(we,Pe){j(Pe)})})}).catch(j)});return Je(B,x),B}function t0(x){var N=this,B=new be(function(z,j){N.ready().then(function(){var O=N._dbInfo;O.db.transaction(function(le){lo(le,O,"SELECT COUNT(key) as c FROM "+O.storeName,[],function(we,Pe){var Te=Pe.rows.item(0).c;z(Te)},function(we,Pe){j(Pe)})})}).catch(j)});return Je(B,x),B}function r0(x,N){var B=this,z=new be(function(j,O){B.ready().then(function(){var le=B._dbInfo;le.db.transaction(function(we){lo(we,le,"SELECT key FROM "+le.storeName+" WHERE id = ? LIMIT 1",[x+1],function(Pe,Te){var Ee=Te.rows.length?Te.rows.item(0).key:null;j(Ee)},function(Pe,Te){O(Te)})})}).catch(O)});return Je(z,N),z}function nc(x){var N=this,B=new be(function(z,j){N.ready().then(function(){var O=N._dbInfo;O.db.transaction(function(le){lo(le,O,"SELECT key FROM "+O.storeName,[],function(we,Pe){for(var Te=[],Ee=0;Ee<Pe.rows.length;Ee++)Te.push(Pe.rows.item(Ee).key);z(Te)},function(we,Pe){j(Pe)})})}).catch(j)});return Je(B,x),B}function ic(x){return new be(function(N,B){x.transaction(function(z){z.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(j,O){for(var le=[],we=0;we<O.rows.length;we++)le.push(O.rows.item(we).name);N({db:x,storeNames:le})},function(j,O){B(O)})},function(z){B(z)})})}function wf(x,N){N=on.apply(this,arguments);var B=this.config();x=typeof x!="function"&&x||{},x.name||(x.name=x.name||B.name,x.storeName=x.storeName||B.storeName);var z=this,j;return x.name?j=new be(function(O){var le;x.name===B.name?le=z._dbInfo.db:le=openDatabase(x.name,"","",0),x.storeName?O({db:le,storeNames:[x.storeName]}):O(ic(le))}).then(function(O){return new be(function(le,we){O.db.transaction(function(Pe){function Te(zt){return new be(function($t,Rr){Pe.executeSql("DROP TABLE IF EXISTS "+zt,[],function(){$t()},function(Vt,an){Rr(an)})})}for(var Ee=[],Ge=0,gt=O.storeNames.length;Ge<gt;Ge++)Ee.push(Te(O.storeNames[Ge]));be.all(Ee).then(function(){le()}).catch(function(zt){we(zt)})},function(Pe){we(Pe)})})}):j=be.reject("Invalid arguments"),Je(j,N),j}var n0={_driver:"webSQLStorage",_initStorage:dh,_support:ze(),iterate:ph,getItem:tc,setItem:Aa,removeItem:rc,clear:e0,length:t0,key:r0,keys:nc,dropInstance:wf};function mh(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(x){return!1}}function yh(x,N){var B=x.name+"/";return x.storeName!==N.storeName&&(B+=x.storeName+"/"),B}function i0(){var x="_localforage_support_test";try{return localStorage.setItem(x,!0),localStorage.removeItem(x),!1}catch(N){return!0}}function Dr(){return!i0()||localStorage.length>0}function Vr(x){var N=this,B={};if(x)for(var z in x)B[z]=x[z];return B.keyPrefix=yh(x,N._defaultConfig),Dr()?(N._dbInfo=B,B.serializer=ec,be.resolve()):be.reject()}function o0(x){var N=this,B=N.ready().then(function(){for(var z=N._dbInfo.keyPrefix,j=localStorage.length-1;j>=0;j--){var O=localStorage.key(j);O.indexOf(z)===0&&localStorage.removeItem(O)}});return Je(B,x),B}function a0(x,N){var B=this;x=Yt(x);var z=B.ready().then(function(){var j=B._dbInfo,O=localStorage.getItem(j.keyPrefix+x);return O&&(O=j.serializer.deserialize(O)),O});return Je(z,N),z}function gh(x,N){var B=this,z=B.ready().then(function(){for(var j=B._dbInfo,O=j.keyPrefix,le=O.length,we=localStorage.length,Pe=1,Te=0;Te<we;Te++){var Ee=localStorage.key(Te);if(Ee.indexOf(O)===0){var Ge=localStorage.getItem(Ee);if(Ge&&(Ge=j.serializer.deserialize(Ge)),Ge=x(Ge,Ee.substring(le),Pe++),Ge!==void 0)return Ge}}});return Je(z,N),z}function s0(x,N){var B=this,z=B.ready().then(function(){var j=B._dbInfo,O;try{O=localStorage.key(x)}catch(le){O=null}return O&&(O=O.substring(j.keyPrefix.length)),O});return Je(z,N),z}function xf(x){var N=this,B=N.ready().then(function(){for(var z=N._dbInfo,j=localStorage.length,O=[],le=0;le<j;le++){var we=localStorage.key(le);we.indexOf(z.keyPrefix)===0&&O.push(we.substring(z.keyPrefix.length))}return O});return Je(B,x),B}function Xs(x){var N=this,B=N.keys().then(function(z){return z.length});return Je(B,x),B}function kf(x,N){var B=this;x=Yt(x);var z=B.ready().then(function(){var j=B._dbInfo;localStorage.removeItem(j.keyPrefix+x)});return Je(z,N),z}function us(x,N,B){var z=this;x=Yt(x);var j=z.ready().then(function(){N===void 0&&(N=null);var O=N;return new be(function(le,we){var Pe=z._dbInfo;Pe.serializer.serialize(N,function(Te,Ee){if(Ee)we(Ee);else try{localStorage.setItem(Pe.keyPrefix+x,Te),le(O)}catch(Ge){(Ge.name==="QuotaExceededError"||Ge.name==="NS_ERROR_DOM_QUOTA_REACHED")&&we(Ge),we(Ge)}})})});return Je(j,B),j}function Zs(x,N){if(N=on.apply(this,arguments),x=typeof x!="function"&&x||{},!x.name){var B=this.config();x.name=x.name||B.name,x.storeName=x.storeName||B.storeName}var z=this,j;return x.name?j=new be(function(O){x.storeName?O(yh(x,z._defaultConfig)):O(x.name+"/")}).then(function(O){for(var le=localStorage.length-1;le>=0;le--){var we=localStorage.key(le);we.indexOf(O)===0&&localStorage.removeItem(we)}}):j=be.reject("Invalid arguments"),Je(j,N),j}var Qs={_driver:"localStorageWrapper",_initStorage:Vr,_support:mh(),iterate:gh,getItem:a0,setItem:us,removeItem:kf,clear:o0,length:Xs,key:s0,keys:xf,dropInstance:Zs},oc=function(N,B){return N===B||typeof N=="number"&&typeof B=="number"&&isNaN(N)&&isNaN(B)},cs=function(N,B){for(var z=N.length,j=0;j<z;){if(oc(N[j],B))return!0;j++}return!1},bh=Array.isArray||function(x){return Object.prototype.toString.call(x)==="[object Array]"},eu={},vh={},fs={INDEXEDDB:X,WEBSQL:n0,LOCALSTORAGE:Qs},u0=[fs.INDEXEDDB._driver,fs.WEBSQL._driver,fs.LOCALSTORAGE._driver],Ea=["dropInstance"],Sa=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Ea),_h={description:"",driver:u0.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function A(x,N){x[N]=function(){var B=arguments;return x.ready().then(function(){return x[N].apply(x,B)})}}function Zo(){for(var x=1;x<arguments.length;x++){var N=arguments[x];if(N)for(var B in N)N.hasOwnProperty(B)&&(bh(N[B])?arguments[0][B]=N[B].slice():arguments[0][B]=N[B])}return arguments[0]}var ac=function(){function x(N){I(this,x);for(var B in fs)if(fs.hasOwnProperty(B)){var z=fs[B],j=z._driver;this[B]=j,eu[j]||this.defineDriver(z)}this._defaultConfig=Zo({},_h),this._config=Zo({},this._defaultConfig,N),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return x.prototype.config=function(B){if((typeof B=="undefined"?"undefined":C(B))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var z in B){if(z==="storeName"&&(B[z]=B[z].replace(/\W/g,"_")),z==="version"&&typeof B[z]!="number")return new Error("Database version must be a number.");this._config[z]=B[z]}return"driver"in B&&B.driver?this.setDriver(this._config.driver):!0}else return typeof B=="string"?this._config[B]:this._config},x.prototype.defineDriver=function(B,z,j){var O=new be(function(le,we){try{var Pe=B._driver,Te=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!B._driver){we(Te);return}for(var Ee=Sa.concat("_initStorage"),Ge=0,gt=Ee.length;Ge<gt;Ge++){var zt=Ee[Ge],$t=!cs(Ea,zt);if(($t||B[zt])&&typeof B[zt]!="function"){we(Te);return}}var Rr=function(){for(var tu=function(f0){return function(){var l0=new Error("Method "+f0+" is not implemented by the current driver"),qn=be.reject(l0);return Je(qn,arguments[arguments.length-1]),qn}},Af=0,c0=Ea.length;Af<c0;Af++){var Ef=Ea[Af];B[Ef]||(B[Ef]=tu(Ef))}};Rr();var Vt=function(tu){eu[Pe]&&console.info("Redefining LocalForage driver: "+Pe),eu[Pe]=B,vh[Pe]=tu,le()};"_support"in B?B._support&&typeof B._support=="function"?B._support().then(Vt,we):Vt(!!B._support):Vt(!0)}catch(an){we(an)}});return Et(O,z,j),O},x.prototype.driver=function(){return this._driver||null},x.prototype.getDriver=function(B,z,j){var O=eu[B]?be.resolve(eu[B]):be.reject(new Error("Driver not found."));return Et(O,z,j),O},x.prototype.getSerializer=function(B){var z=be.resolve(ec);return Et(z,B),z},x.prototype.ready=function(B){var z=this,j=z._driverSet.then(function(){return z._ready===null&&(z._ready=z._initDriver()),z._ready});return Et(j,B,B),j},x.prototype.setDriver=function(B,z,j){var O=this;bh(B)||(B=[B]);var le=this._getSupportedDrivers(B);function we(){O._config.driver=O.driver()}function Pe(Ge){return O._extend(Ge),we(),O._ready=O._initStorage(O._config),O._ready}function Te(Ge){return function(){var gt=0;function zt(){for(;gt<Ge.length;){var $t=Ge[gt];return gt++,O._dbInfo=null,O._ready=null,O.getDriver($t).then(Pe).catch(zt)}we();var Rr=new Error("No available storage method found.");return O._driverSet=be.reject(Rr),O._driverSet}return zt()}}var Ee=this._driverSet!==null?this._driverSet.catch(function(){return be.resolve()}):be.resolve();return this._driverSet=Ee.then(function(){var Ge=le[0];return O._dbInfo=null,O._ready=null,O.getDriver(Ge).then(function(gt){O._driver=gt._driver,we(),O._wrapLibraryMethodsWithReady(),O._initDriver=Te(le)})}).catch(function(){we();var Ge=new Error("No available storage method found.");return O._driverSet=be.reject(Ge),O._driverSet}),Et(this._driverSet,z,j),this._driverSet},x.prototype.supports=function(B){return!!vh[B]},x.prototype._extend=function(B){Zo(this,B)},x.prototype._getSupportedDrivers=function(B){for(var z=[],j=0,O=B.length;j<O;j++){var le=B[j];this.supports(le)&&z.push(le)}return z},x.prototype._wrapLibraryMethodsWithReady=function(){for(var B=0,z=Sa.length;B<z;B++)A(this,Sa[B])},x.prototype.createInstance=function(B){return new x(B)},x}(),zn=new ac;b.exports=zn},{"3":3}]},{},[4])(4)})}),l;(function(g){g.ECC="ecc",g.RSA="rsa"})(l||(l={}));var y;(function(g){g.P_256="P-256",g.P_384="P-384",g.P_521="P-521"})(y||(y={}));var w;(function(g){g[g.B1024=1024]="B1024",g[g.B2048=2048]="B2048",g[g.B4096=4096]="B4096"})(w||(w={}));var F;(function(g){g.AES_CTR="AES-CTR",g.AES_CBC="AES-CBC"})(F||(F={}));var _;(function(g){g[g.B128=128]="B128",g[g.B192=192]="B192",g[g.B256=256]="B256"})(_||(_={}));var U;(function(g){g.SHA_1="SHA-1",g.SHA_256="SHA-256",g.SHA_384="SHA-384",g.SHA_512="SHA-512"})(U||(U={}));var V;(function(g){g[g.B8=8]="B8",g[g.B16=16]="B16"})(V||(V={}));var Se;(function(g){g.Read="read",g.Write="write"})(Se||(Se={}));var Q=Object.freeze({__proto__:null,get CryptoSystem(){return l},get EccCurve(){return y},get RsaSize(){return w},get SymmAlg(){return F},get SymmKeyLength(){return _},get HashAlg(){return U},get CharSize(){return V},get KeyUse(){return Se}}),ue=new Error("Key does not exist. Make sure you properly instantiated the keystore."),J=new Error("Retrieved a symmetric key when an asymmetric keypair was expected. Please use a different key name."),ye=new Error("Retrieved an asymmetric keypair when an symmetric key was expected. Please use a different key name."),Fe=new Error("ECC is not enabled for this browser. Please use RSA instead."),Z=new Error("Cryptosystem not supported. Please use ECC or RSA"),re=new Error("Invalid key use. Please use 'read' or 'write");function Ce(g){if(!g||g===null)throw ue;if(g.privateKey===void 0)throw J;return g}function et(g){if(!g||g===null)throw ue;if(g.privateKey!==void 0||g.algorithm===void 0)throw ye;return g}function ct(g){ht(g,[l.ECC,l.RSA],Z)}function vt(g){ht(g,[Se.Read,Se.Write],re)}function ht(g,d,h){var b=d.some(function(S){return S===g});if(!b)throw h}function He(g){return p.createInstance({name:g})}function Bt(g,d,h){return h===void 0&&(h=p),n(this,void 0,void 0,function(){var b;return o(this,function(S){switch(S.label){case 0:return[4,fr(g,h)];case 1:return S.sent()?[2]:[4,d()];case 2:return b=S.sent(),[4,Rt(g,b,h)];case 3:return S.sent(),[2]}})})}function Rt(g,d,h){return h===void 0&&(h=p),n(this,void 0,void 0,function(){return o(this,function(b){return[2,h.setItem(g,d)]})})}function ir(g,d){return d===void 0&&(d=p),n(this,void 0,void 0,function(){return o(this,function(h){return[2,vr(g,Ce,d)]})})}function Wr(g,d){return d===void 0&&(d=p),n(this,void 0,void 0,function(){return o(this,function(h){return[2,vr(g,et,d)]})})}function vr(g,d,h){return h===void 0&&(h=p),n(this,void 0,void 0,function(){var b;return o(this,function(S){switch(S.label){case 0:return[4,h.getItem(g)];case 1:return b=S.sent(),[2,b===null?null:d(b)]}})})}function fr(g,d){return d===void 0&&(d=p),n(this,void 0,void 0,function(){var h;return o(this,function(b){switch(b.label){case 0:return[4,d.getItem(g)];case 1:return h=b.sent(),[2,h!==null]}})})}function Zn(g,d){return d===void 0&&(d=p),n(this,void 0,void 0,function(){return o(this,function(h){return[2,d.removeItem(g)]})})}function Gt(g){return n(this,void 0,void 0,function(){return o(this,function(d){return[2,g.dropInstance()]})})}function dt(g){return n(this,void 0,void 0,function(){return o(this,function(d){return g?[2,Gt(g)]:[2,p.clear()]})})}var Nt={createStore:He,createIfDoesNotExist:Bt,put:Rt,getKeypair:ir,getKey:Wr,exists:fr,rm:Zn,dropStore:Gt,clear:dt},Ct=Object.freeze({__proto__:null,createStore:He,createIfDoesNotExist:Bt,put:Rt,getKeypair:ir,getKey:Wr,get:vr,exists:fr,rm:Zn,dropStore:Gt,clear:dt,default:Nt}),k=typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{},ce=[],de=[],Be=typeof Uint8Array!="undefined"?Uint8Array:Array,De=!1;function $e(){De=!0;for(var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,h=g.length;d<h;++d)ce[d]=g[d],de[g.charCodeAt(d)]=d;de["-".charCodeAt(0)]=62,de["_".charCodeAt(0)]=63}function We(g){De||$e();var d,h,b,S,C,I,W=g.length;if(W%4>0)throw new Error("Invalid string. Length must be a multiple of 4");C=g[W-2]==="="?2:g[W-1]==="="?1:0,I=new Be(W*3/4-C),b=C>0?W-4:W;var oe=0;for(d=0,h=0;d<b;d+=4,h+=3)S=de[g.charCodeAt(d)]<<18|de[g.charCodeAt(d+1)]<<12|de[g.charCodeAt(d+2)]<<6|de[g.charCodeAt(d+3)],I[oe++]=S>>16&255,I[oe++]=S>>8&255,I[oe++]=S&255;return C===2?(S=de[g.charCodeAt(d)]<<2|de[g.charCodeAt(d+1)]>>4,I[oe++]=S&255):C===1&&(S=de[g.charCodeAt(d)]<<10|de[g.charCodeAt(d+1)]<<4|de[g.charCodeAt(d+2)]>>2,I[oe++]=S>>8&255,I[oe++]=S&255),I}function Oe(g){return ce[g>>18&63]+ce[g>>12&63]+ce[g>>6&63]+ce[g&63]}function Ut(g,d,h){for(var b,S=[],C=d;C<h;C+=3)b=(g[C]<<16)+(g[C+1]<<8)+g[C+2],S.push(Oe(b));return S.join("")}function Xe(g){De||$e();for(var d,h=g.length,b=h%3,S="",C=[],I=16383,W=0,oe=h-b;W<oe;W+=I)C.push(Ut(g,W,W+I>oe?oe:W+I));return b===1?(d=g[h-1],S+=ce[d>>2],S+=ce[d<<4&63],S+="=="):b===2&&(d=(g[h-2]<<8)+g[h-1],S+=ce[d>>10],S+=ce[d>>4&63],S+=ce[d<<2&63],S+="="),C.push(S),C.join("")}function mt(g,d,h,b,S){var C,I,W=S*8-b-1,oe=(1<<W)-1,ee=oe>>1,Me=-7,be=h?S-1:0,Je=h?-1:1,Et=g[d+be];for(be+=Je,C=Et&(1<<-Me)-1,Et>>=-Me,Me+=W;Me>0;C=C*256+g[d+be],be+=Je,Me-=8);for(I=C&(1<<-Me)-1,C>>=-Me,Me+=b;Me>0;I=I*256+g[d+be],be+=Je,Me-=8);if(C===0)C=1-ee;else{if(C===oe)return I?NaN:(Et?-1:1)*Infinity;I=I+Math.pow(2,b),C=C-ee}return(Et?-1:1)*I*Math.pow(2,C-b)}function Cr(g,d,h,b,S,C){var I,W,oe,ee=C*8-S-1,Me=(1<<ee)-1,be=Me>>1,Je=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,Et=b?0:C-1,Yt=b?1:-1,on=d<0||d===0&&1/d<0?1:0;for(d=Math.abs(d),isNaN(d)||d===Infinity?(W=isNaN(d)?1:0,I=Me):(I=Math.floor(Math.log(d)/Math.LN2),d*(oe=Math.pow(2,-I))<1&&(I--,oe*=2),I+be>=1?d+=Je/oe:d+=Je*Math.pow(2,1-be),d*oe>=2&&(I++,oe/=2),I+be>=Me?(W=0,I=Me):I+be>=1?(W=(d*oe-1)*Math.pow(2,S),I=I+be):(W=d*Math.pow(2,be-1)*Math.pow(2,S),I=0));S>=8;g[h+Et]=W&255,Et+=Yt,W/=256,S-=8);for(I=I<<S|W,ee+=S;ee>0;g[h+Et]=I&255,Et+=Yt,I/=256,ee-=8);g[h+Et-Yt]|=on*128}var Ai={}.toString,Yr=Array.isArray||function(g){return Ai.call(g)=="[object Array]"};var ar=50;fe.TYPED_ARRAY_SUPPORT=k.TYPED_ARRAY_SUPPORT!==void 0?k.TYPED_ARRAY_SUPPORT:!0;function Or(){return fe.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function hr(g,d){if(Or()<d)throw new RangeError("Invalid typed array length");return fe.TYPED_ARRAY_SUPPORT?(g=new Uint8Array(d),g.__proto__=fe.prototype):(g===null&&(g=new fe(d)),g.length=d),g}function fe(g,d,h){if(!fe.TYPED_ARRAY_SUPPORT&&!(this instanceof fe))return new fe(g,d,h);if(typeof g=="number"){if(typeof d=="string")throw new Error("If encoding is specified then the first argument must be a string");return me(this,g)}return Kr(this,g,d,h)}fe.poolSize=8192,fe._augment=function(g){return g.__proto__=fe.prototype,g};function Kr(g,d,h,b){if(typeof d=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer!="undefined"&&d instanceof ArrayBuffer?jt(g,d,h,b):typeof d=="string"?Ie(g,d,h):Ze(g,d)}fe.from=function(g,d,h){return Kr(null,g,d,h)},fe.TYPED_ARRAY_SUPPORT&&(fe.prototype.__proto__=Uint8Array.prototype,fe.__proto__=Uint8Array);function G(g){if(typeof g!="number")throw new TypeError('"size" argument must be a number');if(g<0)throw new RangeError('"size" argument must not be negative')}function te(g,d,h,b){return G(d),d<=0?hr(g,d):h!==void 0?typeof b=="string"?hr(g,d).fill(h,b):hr(g,d).fill(h):hr(g,d)}fe.alloc=function(g,d,h){return te(null,g,d,h)};function me(g,d){if(G(d),g=hr(g,d<0?0:Qe(d)|0),!fe.TYPED_ARRAY_SUPPORT)for(var h=0;h<d;++h)g[h]=0;return g}fe.allocUnsafe=function(g){return me(null,g)},fe.allocUnsafeSlow=function(g){return me(null,g)};function Ie(g,d,h){if((typeof h!="string"||h==="")&&(h="utf8"),!fe.isEncoding(h))throw new TypeError('"encoding" must be a valid string encoding');var b=at(d,h)|0;g=hr(g,b);var S=g.write(d,h);return S!==b&&(g=g.slice(0,S)),g}function Ke(g,d){var h=d.length<0?0:Qe(d.length)|0;g=hr(g,h);for(var b=0;b<h;b+=1)g[b]=d[b]&255;return g}function jt(g,d,h,b){if(d.byteLength,h<0||d.byteLength<h)throw new RangeError("'offset' is out of bounds");if(d.byteLength<h+(b||0))throw new RangeError("'length' is out of bounds");return h===void 0&&b===void 0?d=new Uint8Array(d):b===void 0?d=new Uint8Array(d,h):d=new Uint8Array(d,h,b),fe.TYPED_ARRAY_SUPPORT?(g=d,g.__proto__=fe.prototype):g=Ke(g,d),g}function Ze(g,d){if(Ue(d)){var h=Qe(d.length)|0;return g=hr(g,h),g.length===0||d.copy(g,0,0,h),g}if(d){if(typeof ArrayBuffer!="undefined"&&d.buffer instanceof ArrayBuffer||"length"in d)return typeof d.length!="number"||$o(d.length)?hr(g,0):Ke(g,d);if(d.type==="Buffer"&&Yr(d.data))return Ke(g,d.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function Qe(g){if(g>=Or())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Or().toString(16)+" bytes");return g|0}fe.isBuffer=es;function Ue(g){return!!(g!=null&&g._isBuffer)}fe.compare=function(d,h){if(!Ue(d)||!Ue(h))throw new TypeError("Arguments must be Buffers");if(d===h)return 0;for(var b=d.length,S=h.length,C=0,I=Math.min(b,S);C<I;++C)if(d[C]!==h[C]){b=d[C],S=h[C];break}return b<S?-1:S<b?1:0},fe.isEncoding=function(d){switch(String(d).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},fe.concat=function(d,h){if(!Yr(d))throw new TypeError('"list" argument must be an Array of Buffers');if(d.length===0)return fe.alloc(0);var b;if(h===void 0)for(h=0,b=0;b<d.length;++b)h+=d[b].length;var S=fe.allocUnsafe(h),C=0;for(b=0;b<d.length;++b){var I=d[b];if(!Ue(I))throw new TypeError('"list" argument must be an Array of Buffers');I.copy(S,C),C+=I.length}return S};function at(g,d){if(Ue(g))return g.length;if(typeof ArrayBuffer!="undefined"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(g)||g instanceof ArrayBuffer))return g.byteLength;typeof g!="string"&&(g=""+g);var h=g.length;if(h===0)return 0;for(var b=!1;;)switch(d){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":case void 0:return ei(g).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return ao(g).length;default:if(b)return ei(g).length;d=(""+d).toLowerCase(),b=!0}}fe.byteLength=at;function st(g,d,h){var b=!1;if((d===void 0||d<0)&&(d=0),d>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,d>>>=0,h<=d))return"";for(g||(g="utf8");;)switch(g){case"hex":return Oo(this,d,h);case"utf8":case"utf-8":return Ti(this,d,h);case"ascii":return Mo(this,d,h);case"latin1":case"binary":return Bi(this,d,h);case"base64":return eo(this,d,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ci(this,d,h);default:if(b)throw new TypeError("Unknown encoding: "+g);g=(g+"").toLowerCase(),b=!0}}fe.prototype._isBuffer=!0;function Qt(g,d,h){var b=g[d];g[d]=g[h],g[h]=b}fe.prototype.swap16=function(){var d=this.length;if(d%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var h=0;h<d;h+=2)Qt(this,h,h+1);return this},fe.prototype.swap32=function(){var d=this.length;if(d%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var h=0;h<d;h+=4)Qt(this,h,h+3),Qt(this,h+1,h+2);return this},fe.prototype.swap64=function(){var d=this.length;if(d%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var h=0;h<d;h+=8)Qt(this,h,h+7),Qt(this,h+1,h+6),Qt(this,h+2,h+5),Qt(this,h+3,h+4);return this},fe.prototype.toString=function(){var d=this.length|0;return d===0?"":arguments.length===0?Ti(this,0,d):st.apply(this,arguments)},fe.prototype.equals=function(d){if(!Ue(d))throw new TypeError("Argument must be a Buffer");return this===d?!0:fe.compare(this,d)===0},fe.prototype.inspect=function(){var d="",h=ar;return this.length>0&&(d=this.toString("hex",0,h).match(/.{2}/g).join(" "),this.length>h&&(d+=" ... ")),"<Buffer "+d+">"},fe.prototype.compare=function(d,h,b,S,C){if(!Ue(d))throw new TypeError("Argument must be a Buffer");if(h===void 0&&(h=0),b===void 0&&(b=d?d.length:0),S===void 0&&(S=0),C===void 0&&(C=this.length),h<0||b>d.length||S<0||C>this.length)throw new RangeError("out of range index");if(S>=C&&h>=b)return 0;if(S>=C)return-1;if(h>=b)return 1;if(h>>>=0,b>>>=0,S>>>=0,C>>>=0,this===d)return 0;for(var I=C-S,W=b-h,oe=Math.min(I,W),ee=this.slice(S,C),Me=d.slice(h,b),be=0;be<oe;++be)if(ee[be]!==Me[be]){I=ee[be],W=Me[be];break}return I<W?-1:W<I?1:0};function Mn(g,d,h,b,S){if(g.length===0)return-1;if(typeof h=="string"?(b=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,isNaN(h)&&(h=S?0:g.length-1),h<0&&(h=g.length+h),h>=g.length){if(S)return-1;h=g.length-1}else if(h<0)if(S)h=0;else return-1;if(typeof d=="string"&&(d=fe.from(d,b)),Ue(d))return d.length===0?-1:Qi(g,d,h,b,S);if(typeof d=="number")return d=d&255,fe.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?S?Uint8Array.prototype.indexOf.call(g,d,h):Uint8Array.prototype.lastIndexOf.call(g,d,h):Qi(g,[d],h,b,S);throw new TypeError("val must be string, number or Buffer")}function Qi(g,d,h,b,S){var C=1,I=g.length,W=d.length;if(b!==void 0&&(b=String(b).toLowerCase(),b==="ucs2"||b==="ucs-2"||b==="utf16le"||b==="utf-16le")){if(g.length<2||d.length<2)return-1;C=2,I/=2,W/=2,h/=2}function oe(Et,Yt){return C===1?Et[Yt]:Et.readUInt16BE(Yt*C)}var ee;if(S){var Me=-1;for(ee=h;ee<I;ee++)if(oe(g,ee)===oe(d,Me===-1?0:ee-Me)){if(Me===-1&&(Me=ee),ee-Me+1===W)return Me*C}else Me!==-1&&(ee-=ee-Me),Me=-1}else for(h+W>I&&(h=I-W),ee=h;ee>=0;ee--){for(var be=!0,Je=0;Je<W;Je++)if(oe(g,ee+Je)!==oe(d,Je)){be=!1;break}if(be)return ee}return-1}fe.prototype.includes=function(d,h,b){return this.indexOf(d,h,b)!==-1},fe.prototype.indexOf=function(d,h,b){return Mn(this,d,h,b,!0)},fe.prototype.lastIndexOf=function(d,h,b){return Mn(this,d,h,b,!1)};function Ei(g,d,h,b){h=Number(h)||0;var S=g.length-h;b?(b=Number(b),b>S&&(b=S)):b=S;var C=d.length;if(C%2!=0)throw new TypeError("Invalid hex string");b>C/2&&(b=C/2);for(var I=0;I<b;++I){var W=parseInt(d.substr(I*2,2),16);if(isNaN(W))return I;g[h+I]=W}return I}function Si(g,d,h,b){return pn(ei(d,g.length-h),g,h,b)}function Pi(g,d,h,b){return pn(Ho(d),g,h,b)}function nn(g,d,h,b){return Pi(g,d,h,b)}function No(g,d,h,b){return pn(ao(d),g,h,b)}function Uo(g,d,h,b){return pn(jo(d,g.length-h),g,h,b)}fe.prototype.write=function(d,h,b,S){if(h===void 0)S="utf8",b=this.length,h=0;else if(b===void 0&&typeof h=="string")S=h,b=this.length,h=0;else if(isFinite(h))h=h|0,isFinite(b)?(b=b|0,S===void 0&&(S="utf8")):(S=b,b=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var C=this.length-h;if((b===void 0||b>C)&&(b=C),d.length>0&&(b<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");S||(S="utf8");for(var I=!1;;)switch(S){case"hex":return Ei(this,d,h,b);case"utf8":case"utf-8":return Si(this,d,h,b);case"ascii":return Pi(this,d,h,b);case"latin1":case"binary":return nn(this,d,h,b);case"base64":return No(this,d,h,b);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Uo(this,d,h,b);default:if(I)throw new TypeError("Unknown encoding: "+S);S=(""+S).toLowerCase(),I=!0}},fe.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function eo(g,d,h){return d===0&&h===g.length?Xe(g):Xe(g.slice(d,h))}function Ti(g,d,h){h=Math.min(g.length,h);for(var b=[],S=d;S<h;){var C=g[S],I=null,W=C>239?4:C>223?3:C>191?2:1;if(S+W<=h){var oe,ee,Me,be;switch(W){case 1:C<128&&(I=C);break;case 2:oe=g[S+1],(oe&192)==128&&(be=(C&31)<<6|oe&63,be>127&&(I=be));break;case 3:oe=g[S+1],ee=g[S+2],(oe&192)==128&&(ee&192)==128&&(be=(C&15)<<12|(oe&63)<<6|ee&63,be>2047&&(be<55296||be>57343)&&(I=be));break;case 4:oe=g[S+1],ee=g[S+2],Me=g[S+3],(oe&192)==128&&(ee&192)==128&&(Me&192)==128&&(be=(C&15)<<18|(oe&63)<<12|(ee&63)<<6|Me&63,be>65535&&be<1114112&&(I=be))}}I===null?(I=65533,W=1):I>65535&&(I-=65536,b.push(I>>>10&1023|55296),I=56320|I&1023),b.push(I),S+=W}return Lo(b)}var to=4096;function Lo(g){var d=g.length;if(d<=to)return String.fromCharCode.apply(String,g);for(var h="",b=0;b<d;)h+=String.fromCharCode.apply(String,g.slice(b,b+=to));return h}function Mo(g,d,h){var b="";h=Math.min(g.length,h);for(var S=d;S<h;++S)b+=String.fromCharCode(g[S]&127);return b}function Bi(g,d,h){var b="";h=Math.min(g.length,h);for(var S=d;S<h;++S)b+=String.fromCharCode(g[S]);return b}function Oo(g,d,h){var b=g.length;(!d||d<0)&&(d=0),(!h||h<0||h>b)&&(h=b);for(var S="",C=d;C<h;++C)S+=qo(g[C]);return S}function Ci(g,d,h){for(var b=g.slice(d,h),S="",C=0;C<b.length;C+=2)S+=String.fromCharCode(b[C]+b[C+1]*256);return S}fe.prototype.slice=function(d,h){var b=this.length;d=~~d,h=h===void 0?b:~~h,d<0?(d+=b,d<0&&(d=0)):d>b&&(d=b),h<0?(h+=b,h<0&&(h=0)):h>b&&(h=b),h<d&&(h=d);var S;if(fe.TYPED_ARRAY_SUPPORT)S=this.subarray(d,h),S.__proto__=fe.prototype;else{var C=h-d;S=new fe(C,void 0);for(var I=0;I<C;++I)S[I]=this[I+d]}return S};function sr(g,d,h){if(g%1!=0||g<0)throw new RangeError("offset is not uint");if(g+d>h)throw new RangeError("Trying to access beyond buffer length")}fe.prototype.readUIntLE=function(d,h,b){d=d|0,h=h|0,b||sr(d,h,this.length);for(var S=this[d],C=1,I=0;++I<h&&(C*=256);)S+=this[d+I]*C;return S},fe.prototype.readUIntBE=function(d,h,b){d=d|0,h=h|0,b||sr(d,h,this.length);for(var S=this[d+--h],C=1;h>0&&(C*=256);)S+=this[d+--h]*C;return S},fe.prototype.readUInt8=function(d,h){return h||sr(d,1,this.length),this[d]},fe.prototype.readUInt16LE=function(d,h){return h||sr(d,2,this.length),this[d]|this[d+1]<<8},fe.prototype.readUInt16BE=function(d,h){return h||sr(d,2,this.length),this[d]<<8|this[d+1]},fe.prototype.readUInt32LE=function(d,h){return h||sr(d,4,this.length),(this[d]|this[d+1]<<8|this[d+2]<<16)+this[d+3]*16777216},fe.prototype.readUInt32BE=function(d,h){return h||sr(d,4,this.length),this[d]*16777216+(this[d+1]<<16|this[d+2]<<8|this[d+3])},fe.prototype.readIntLE=function(d,h,b){d=d|0,h=h|0,b||sr(d,h,this.length);for(var S=this[d],C=1,I=0;++I<h&&(C*=256);)S+=this[d+I]*C;return C*=128,S>=C&&(S-=Math.pow(2,8*h)),S},fe.prototype.readIntBE=function(d,h,b){d=d|0,h=h|0,b||sr(d,h,this.length);for(var S=h,C=1,I=this[d+--S];S>0&&(C*=256);)I+=this[d+--S]*C;return C*=128,I>=C&&(I-=Math.pow(2,8*h)),I},fe.prototype.readInt8=function(d,h){return h||sr(d,1,this.length),this[d]&128?(255-this[d]+1)*-1:this[d]},fe.prototype.readInt16LE=function(d,h){h||sr(d,2,this.length);var b=this[d]|this[d+1]<<8;return b&32768?b|4294901760:b},fe.prototype.readInt16BE=function(d,h){h||sr(d,2,this.length);var b=this[d+1]|this[d]<<8;return b&32768?b|4294901760:b},fe.prototype.readInt32LE=function(d,h){return h||sr(d,4,this.length),this[d]|this[d+1]<<8|this[d+2]<<16|this[d+3]<<24},fe.prototype.readInt32BE=function(d,h){return h||sr(d,4,this.length),this[d]<<24|this[d+1]<<16|this[d+2]<<8|this[d+3]},fe.prototype.readFloatLE=function(d,h){return h||sr(d,4,this.length),mt(this,d,!0,23,4)},fe.prototype.readFloatBE=function(d,h){return h||sr(d,4,this.length),mt(this,d,!1,23,4)},fe.prototype.readDoubleLE=function(d,h){return h||sr(d,8,this.length),mt(this,d,!0,52,8)},fe.prototype.readDoubleBE=function(d,h){return h||sr(d,8,this.length),mt(this,d,!1,52,8)};function _r(g,d,h,b,S,C){if(!Ue(g))throw new TypeError('"buffer" argument must be a Buffer instance');if(d>S||d<C)throw new RangeError('"value" argument is out of bounds');if(h+b>g.length)throw new RangeError("Index out of range")}fe.prototype.writeUIntLE=function(d,h,b,S){if(d=+d,h=h|0,b=b|0,!S){var C=Math.pow(2,8*b)-1;_r(this,d,h,b,C,0)}var I=1,W=0;for(this[h]=d&255;++W<b&&(I*=256);)this[h+W]=d/I&255;return h+b},fe.prototype.writeUIntBE=function(d,h,b,S){if(d=+d,h=h|0,b=b|0,!S){var C=Math.pow(2,8*b)-1;_r(this,d,h,b,C,0)}var I=b-1,W=1;for(this[h+I]=d&255;--I>=0&&(W*=256);)this[h+I]=d/W&255;return h+b},fe.prototype.writeUInt8=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,1,255,0),fe.TYPED_ARRAY_SUPPORT||(d=Math.floor(d)),this[h]=d&255,h+1};function Qn(g,d,h,b){d<0&&(d=65535+d+1);for(var S=0,C=Math.min(g.length-h,2);S<C;++S)g[h+S]=(d&255<<8*(b?S:1-S))>>>(b?S:1-S)*8}fe.prototype.writeUInt16LE=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,2,65535,0),fe.TYPED_ARRAY_SUPPORT?(this[h]=d&255,this[h+1]=d>>>8):Qn(this,d,h,!0),h+2},fe.prototype.writeUInt16BE=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,2,65535,0),fe.TYPED_ARRAY_SUPPORT?(this[h]=d>>>8,this[h+1]=d&255):Qn(this,d,h,!1),h+2};function On(g,d,h,b){d<0&&(d=4294967295+d+1);for(var S=0,C=Math.min(g.length-h,4);S<C;++S)g[h+S]=d>>>(b?S:3-S)*8&255}fe.prototype.writeUInt32LE=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,4,4294967295,0),fe.TYPED_ARRAY_SUPPORT?(this[h+3]=d>>>24,this[h+2]=d>>>16,this[h+1]=d>>>8,this[h]=d&255):On(this,d,h,!0),h+4},fe.prototype.writeUInt32BE=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,4,4294967295,0),fe.TYPED_ARRAY_SUPPORT?(this[h]=d>>>24,this[h+1]=d>>>16,this[h+2]=d>>>8,this[h+3]=d&255):On(this,d,h,!1),h+4},fe.prototype.writeIntLE=function(d,h,b,S){if(d=+d,h=h|0,!S){var C=Math.pow(2,8*b-1);_r(this,d,h,b,C-1,-C)}var I=0,W=1,oe=0;for(this[h]=d&255;++I<b&&(W*=256);)d<0&&oe===0&&this[h+I-1]!==0&&(oe=1),this[h+I]=(d/W>>0)-oe&255;return h+b},fe.prototype.writeIntBE=function(d,h,b,S){if(d=+d,h=h|0,!S){var C=Math.pow(2,8*b-1);_r(this,d,h,b,C-1,-C)}var I=b-1,W=1,oe=0;for(this[h+I]=d&255;--I>=0&&(W*=256);)d<0&&oe===0&&this[h+I+1]!==0&&(oe=1),this[h+I]=(d/W>>0)-oe&255;return h+b},fe.prototype.writeInt8=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,1,127,-128),fe.TYPED_ARRAY_SUPPORT||(d=Math.floor(d)),d<0&&(d=255+d+1),this[h]=d&255,h+1},fe.prototype.writeInt16LE=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,2,32767,-32768),fe.TYPED_ARRAY_SUPPORT?(this[h]=d&255,this[h+1]=d>>>8):Qn(this,d,h,!0),h+2},fe.prototype.writeInt16BE=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,2,32767,-32768),fe.TYPED_ARRAY_SUPPORT?(this[h]=d>>>8,this[h+1]=d&255):Qn(this,d,h,!1),h+2},fe.prototype.writeInt32LE=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,4,2147483647,-2147483648),fe.TYPED_ARRAY_SUPPORT?(this[h]=d&255,this[h+1]=d>>>8,this[h+2]=d>>>16,this[h+3]=d>>>24):On(this,d,h,!0),h+4},fe.prototype.writeInt32BE=function(d,h,b){return d=+d,h=h|0,b||_r(this,d,h,4,2147483647,-2147483648),d<0&&(d=4294967295+d+1),fe.TYPED_ARRAY_SUPPORT?(this[h]=d>>>24,this[h+1]=d>>>16,this[h+2]=d>>>8,this[h+3]=d&255):On(this,d,h,!1),h+4};function ro(g,d,h,b,S,C){if(h+b>g.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function no(g,d,h,b,S){return S||ro(g,d,h,4),Cr(g,d,h,b,23,4),h+4}fe.prototype.writeFloatLE=function(d,h,b){return no(this,d,h,!0,b)},fe.prototype.writeFloatBE=function(d,h,b){return no(this,d,h,!1,b)};function io(g,d,h,b,S){return S||ro(g,d,h,8),Cr(g,d,h,b,52,8),h+8}fe.prototype.writeDoubleLE=function(d,h,b){return io(this,d,h,!0,b)},fe.prototype.writeDoubleBE=function(d,h,b){return io(this,d,h,!1,b)},fe.prototype.copy=function(d,h,b,S){if(b||(b=0),!S&&S!==0&&(S=this.length),h>=d.length&&(h=d.length),h||(h=0),S>0&&S<b&&(S=b),S===b||d.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(b<0||b>=this.length)throw new RangeError("sourceStart out of bounds");if(S<0)throw new RangeError("sourceEnd out of bounds");S>this.length&&(S=this.length),d.length-h<S-b&&(S=d.length-h+b);var C=S-b,I;if(this===d&&b<h&&h<S)for(I=C-1;I>=0;--I)d[I+h]=this[I+b];else if(C<1e3||!fe.TYPED_ARRAY_SUPPORT)for(I=0;I<C;++I)d[I+h]=this[I+b];else Uint8Array.prototype.set.call(d,this.subarray(b,b+C),h);return C},fe.prototype.fill=function(d,h,b,S){if(typeof d=="string"){if(typeof h=="string"?(S=h,h=0,b=this.length):typeof b=="string"&&(S=b,b=this.length),d.length===1){var C=d.charCodeAt(0);C<256&&(d=C)}if(S!==void 0&&typeof S!="string")throw new TypeError("encoding must be a string");if(typeof S=="string"&&!fe.isEncoding(S))throw new TypeError("Unknown encoding: "+S)}else typeof d=="number"&&(d=d&255);if(h<0||this.length<h||this.length<b)throw new RangeError("Out of range index");if(b<=h)return this;h=h>>>0,b=b===void 0?this.length:b>>>0,d||(d=0);var I;if(typeof d=="number")for(I=h;I<b;++I)this[I]=d;else{var W=Ue(d)?d:ei(new fe(d,S).toString()),oe=W.length;for(I=0;I<b-h;++I)this[I+h]=W[I%oe]}return this};var Ko=/[^+\/0-9A-Za-z-_]/g;function oo(g){if(g=zo(g).replace(Ko,""),g.length<2)return"";for(;g.length%4!=0;)g=g+"=";return g}function zo(g){return g.trim?g.trim():g.replace(/^\s+|\s+$/g,"")}function qo(g){return g<16?"0"+g.toString(16):g.toString(16)}function ei(g,d){d=d||Infinity;for(var h,b=g.length,S=null,C=[],I=0;I<b;++I){if(h=g.charCodeAt(I),h>55295&&h<57344){if(!S){if(h>56319){(d-=3)>-1&&C.push(239,191,189);continue}else if(I+1===b){(d-=3)>-1&&C.push(239,191,189);continue}S=h;continue}if(h<56320){(d-=3)>-1&&C.push(239,191,189),S=h;continue}h=(S-55296<<10|h-56320)+65536}else S&&(d-=3)>-1&&C.push(239,191,189);if(S=null,h<128){if((d-=1)<0)break;C.push(h)}else if(h<2048){if((d-=2)<0)break;C.push(h>>6|192,h&63|128)}else if(h<65536){if((d-=3)<0)break;C.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((d-=4)<0)break;C.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return C}function Ho(g){for(var d=[],h=0;h<g.length;++h)d.push(g.charCodeAt(h)&255);return d}function jo(g,d){for(var h,b,S,C=[],I=0;I<g.length&&!((d-=2)<0);++I)h=g.charCodeAt(I),b=h>>8,S=h%256,C.push(S),C.push(b);return C}function ao(g){return We(oo(g))}function pn(g,d,h,b){for(var S=0;S<b&&!(S+h>=d.length||S>=g.length);++S)d[S+h]=g[S];return S}function $o(g){return g!==g}function es(g){return g!=null&&(!!g._isBuffer||Ou(g)||Ku(g))}function Ou(g){return!!g.constructor&&typeof g.constructor.isBuffer=="function"&&g.constructor.isBuffer(g)}function Ku(g){return typeof g.readFloatLE=="function"&&typeof g.slice=="function"&&Ou(g.slice(0,0))}function so(g,d){var h=d===8?new Uint8Array(g):new Uint16Array(g);return Array.from(h).map(function(b){return String.fromCharCode(b)}).join("")}function ts(g){var d=so(g,8);return fe.from(d,"binary").toString("base64")}function kn(g,d){for(var h=d===8?new Uint8Array(g.length):new Uint16Array(g.length),b=0,S=g.length;b<S;b++)h[b]=g.charCodeAt(b);return h.buffer}function rs(g){var d=fe.from(g,"base64").toString("binary");return kn(d,8)}function ba(){return new Uint8Array([1,0,1])}function ns(g){var d=new Uint8Array(g);return globalThis.crypto.getRandomValues(d),d.buffer}function zu(g,d){var h=new Uint8Array(g),b=new Uint8Array(d),S=new Uint8Array(h.length+b.length);return S.set(h),S.set(b,h.length),S.buffer}var Ks=function(g){return E(g,function(d){return kn(d,V.B8)})},Go=function(g){return E(g,function(d){return kn(d,V.B16)})},uo=function(g){return E(g,rs)},Fi=function(g,d){switch(d){case 8:return Ks(g);default:return Go(g)}},E=function(g,d){if(typeof g=="string")return d(g);if(typeof g=="object"&&g.byteLength!==void 0){var h=new Uint8Array(g);return h.buffer}else throw new Error("Improper value. Must be a string, ArrayBuffer, Uint8Array")};function R(g){return n(this,void 0,void 0,function(){return o(this,function(d){return[2,new Promise(function(h){var b=new MessageChannel,S=b.port1,C=b.port2;C.onmessage=function(I){return h(I.data)},S.postMessage(g)})]})})}var T={arrBufToStr:so,arrBufToBase64:ts,strToArrBuf:kn,base64ToArrBuf:rs,publicExponent:ba,randomBuf:ns,joinBufs:zu,normalizeUtf8ToBuf:Ks,normalizeUtf16ToBuf:Go,normalizeBase64ToBuf:uo,normalizeToBuf:E,structuralClone:R},K=Object.freeze({__proto__:null,arrBufToStr:so,arrBufToBase64:ts,strToArrBuf:kn,base64ToArrBuf:rs,publicExponent:ba,randomBuf:ns,joinBufs:zu,normalizeUtf8ToBuf:Ks,normalizeUtf16ToBuf:Go,normalizeBase64ToBuf:uo,normalizeUnicodeToBuf:Fi,normalizeToBuf:E,structuralClone:R,default:T}),H="ECDH",M="ECDSA",ae="RSA-OAEP",ge="RSASSA-PKCS1-v1_5",_e=128,ke="ecc",Ae=y.P_256,qe=w.B2048,rt=F.AES_CTR,ft=_.B256,kt=64,Wt=U.SHA_256,Lt=V.B16,Ar="keystore",Ii="read-key",Wo="write-key",qu={ECC_READ_ALG:H,ECC_WRITE_ALG:M,RSA_READ_ALG:ae,RSA_WRITE_ALG:ge,SALT_LENGTH:_e,DEFAULT_CRYPTOSYSTEM:ke,DEFAULT_ECC_CURVE:Ae,DEFAULT_RSA_SIZE:qe,DEFAULT_SYMM_ALG:rt,DEFAULT_CTR_LEN:kt,DEFAULT_HASH_ALG:Wt,DEFAULT_CHAR_SIZE:Lt,DEFAULT_STORE_NAME:Ar,DEFAULT_READ_KEY_NAME:Ii,DEFAULT_WRITE_KEY_NAME:Wo},zs=Object.freeze({__proto__:null,ECC_READ_ALG:H,ECC_WRITE_ALG:M,RSA_READ_ALG:ae,RSA_WRITE_ALG:ge,SALT_LENGTH:_e,DEFAULT_CRYPTOSYSTEM:ke,DEFAULT_ECC_CURVE:Ae,DEFAULT_RSA_SIZE:qe,DEFAULT_SYMM_ALG:rt,DEFAULT_SYMM_LEN:ft,DEFAULT_CTR_LEN:kt,DEFAULT_HASH_ALG:Wt,DEFAULT_CHAR_SIZE:Lt,DEFAULT_STORE_NAME:Ar,DEFAULT_READ_KEY_NAME:Ii,DEFAULT_WRITE_KEY_NAME:Wo,default:qu});function ff(g,d){return n(this,void 0,void 0,function(){var h,b;return o(this,function(S){return vt(d),h=d===Se.Read?H:M,b=d===Se.Read?["deriveKey","deriveBits"]:["sign","verify"],[2,globalThis.crypto.subtle.generateKey({name:h,namedCurve:g},!1,b)]})})}function Hu(g,d,h){return n(this,void 0,void 0,function(){var b,S,C;return o(this,function(I){return vt(h),b=h===Se.Read?H:M,S=h===Se.Read?[]:["verify"],C=T.base64ToArrBuf(g),[2,globalThis.crypto.subtle.importKey("raw",C,{name:b,namedCurve:d},!0,S)]})})}var Di={makeKeypair:ff,importPublicKey:Hu};function ju(g){return n(this,void 0,void 0,function(){return o(this,function(d){return[2,globalThis.crypto.subtle.generateKey({name:(g==null?void 0:g.alg)||rt,length:(g==null?void 0:g.length)||ft},!0,["encrypt","decrypt"])]})})}function zp(g,d){return n(this,void 0,void 0,function(){var h;return o(this,function(b){return h=T.base64ToArrBuf(g),[2,globalThis.crypto.subtle.importKey("raw",h,{name:(d==null?void 0:d.alg)||rt,length:(d==null?void 0:d.length)||ft},!0,["encrypt","decrypt"])]})})}var lf={makeKey:ju,importKey:zp};function Ql(g,d,h){return n(this,void 0,void 0,function(){var b,S,C,I,W,oe;return o(this,function(ee){switch(ee.label){case 0:return b=T.normalizeUtf16ToBuf(g),typeof d!="string"?[3,2]:[4,lf.importKey(d,h)];case 1:return C=ee.sent(),[3,3];case 2:C=d,ee.label=3;case 3:return S=C,I=(h==null?void 0:h.alg)||rt,W=(h==null?void 0:h.iv)||T.randomBuf(16),[4,globalThis.crypto.subtle.encrypt({name:I,iv:I===F.AES_CTR?void 0:W,counter:I===F.AES_CTR?new Uint8Array(W):void 0,length:I===F.AES_CTR?kt:void 0},S,b)];case 4:return oe=ee.sent(),[2,T.joinBufs(W,oe)]}})})}function $u(g,d,h){return n(this,void 0,void 0,function(){var b,S,C,I,W,oe,ee;return o(this,function(Me){switch(Me.label){case 0:return b=T.normalizeBase64ToBuf(g),typeof d!="string"?[3,2]:[4,lf.importKey(d,h)];case 1:return C=Me.sent(),[3,3];case 2:C=d,Me.label=3;case 3:return S=C,I=(h==null?void 0:h.alg)||rt,W=b.slice(0,16),oe=b.slice(16),[4,globalThis.crypto.subtle.decrypt({name:I,iv:I===F.AES_CTR?void 0:W,counter:I===F.AES_CTR?new Uint8Array(W):void 0,length:I===F.AES_CTR?kt:void 0},S,oe)];case 4:return ee=Me.sent(),[2,ee]}})})}function qp(g,d,h){return n(this,void 0,void 0,function(){var b;return o(this,function(S){switch(S.label){case 0:return[4,Ql(g,d,h)];case 1:return b=S.sent(),[2,T.arrBufToBase64(b)]}})})}function Hp(g,d,h){return n(this,void 0,void 0,function(){var b;return o(this,function(S){switch(S.label){case 0:return[4,$u(g,d,h)];case 1:return b=S.sent(),[2,T.arrBufToStr(b,16)]}})})}function jp(g){return n(this,void 0,void 0,function(){var d;return o(this,function(h){switch(h.label){case 0:return[4,globalThis.crypto.subtle.exportKey("raw",g)];case 1:return d=h.sent(),[2,T.arrBufToBase64(d)]}})})}var $p={encryptBytes:Ql,decryptBytes:$u,encrypt:qp,decrypt:Hp,exportKey:jp},va=r(r({},lf),$p);function or(g,d,h,b){return h===void 0&&(h=Lt),b===void 0&&(b=Wt),n(this,void 0,void 0,function(){return o(this,function(S){return[2,globalThis.crypto.subtle.sign({name:M,hash:{name:b}},d,Fi(g,h))]})})}function er(g,d,h,b,S,C){return b===void 0&&(b=Lt),S===void 0&&(S=Ae),C===void 0&&(C=Wt),n(this,void 0,void 0,function(){var I,W,oe,ee;return o(this,function(Me){switch(Me.label){case 0:return W=(I=globalThis.crypto.subtle).verify,oe=[{name:M,hash:{name:C}}],typeof h!="string"?[3,2]:[4,Di.importPublicKey(h,S,Se.Write)];case 1:return ee=Me.sent(),[3,3];case 2:ee=h,Me.label=3;case 3:return[2,W.apply(I,oe.concat([ee,uo(d),Fi(g,b)]))]}})})}function eh(g,d,h,b,S,C){return b===void 0&&(b=Lt),S===void 0&&(S=Ae),n(this,void 0,void 0,function(){var I,W,oe;return o(this,function(ee){switch(ee.label){case 0:return typeof h!="string"?[3,2]:[4,Di.importPublicKey(h,S,Se.Read)];case 1:return W=ee.sent(),[3,3];case 2:W=h,ee.label=3;case 3:return I=W,[4,Gu(d,I,C)];case 4:return oe=ee.sent(),[2,va.encryptBytes(Fi(g,b),oe,C)]}})})}function th(g,d,h,b,S){return b===void 0&&(b=Ae),n(this,void 0,void 0,function(){var C,I,W;return o(this,function(oe){switch(oe.label){case 0:return typeof h!="string"?[3,2]:[4,Di.importPublicKey(h,b,Se.Read)];case 1:return I=oe.sent(),[3,3];case 2:I=h,oe.label=3;case 3:return C=I,[4,Gu(d,C,S)];case 4:return W=oe.sent(),[2,va.decryptBytes(uo(g),W,S)]}})})}function rh(g){return n(this,void 0,void 0,function(){var d;return o(this,function(h){switch(h.label){case 0:return[4,globalThis.crypto.subtle.exportKey("raw",g.publicKey)];case 1:return d=h.sent(),[2,T.arrBufToBase64(d)]}})})}function Gu(g,d,h){return n(this,void 0,void 0,function(){return o(this,function(b){return[2,globalThis.crypto.subtle.deriveKey({name:H,public:d},g,{name:(h==null?void 0:h.alg)||rt,length:(h==null?void 0:h.length)||ft},!1,["encrypt","decrypt"])]})})}var _a={sign:or,verify:er,encrypt:eh,decrypt:th,getPublicKey:rh,getSharedKey:Gu},Wu={type:ke,curve:Ae,rsaSize:qe,symmAlg:rt,symmLen:ft,hashAlg:Wt,charSize:Lt,storeName:Ar,readKeyName:Ii,writeKeyName:Wo};function hf(g,d){d===void 0&&(d=!0);var h;return g?h=r(r({},Wu),g):h=Wu,(g==null?void 0:g.type)||(h.type=d?l.ECC:l.RSA),h}function nh(){return n(this,void 0,void 0,function(){var g,d;return o(this,function(h){switch(h.label){case 0:return[4,Di.makeKeypair(Ae,Se.Read)];case 1:g=h.sent(),h.label=2;case 2:return h.trys.push([2,4,,5]),[4,T.structuralClone(g)];case 3:return h.sent(),[3,5];case 4:return d=h.sent(),[2,!1];case 5:return[2,!0]}})})}function Fr(g,d){return d===void 0&&(d={}),r(r({},g),d)}function Yu(g){return{alg:g.symmAlg,length:g.symmLen}}var tr={defaultConfig:Wu,normalize:hf,eccEnabled:nh,merge:Fr,symmKeyOpts:Yu},ih=Object.freeze({__proto__:null,defaultConfig:Wu,normalize:hf,eccEnabled:nh,merge:Fr,symmKeyOpts:Yu,default:tr}),Vu=function(){function g(d,h){this.cfg=d,this.store=h}return g.prototype.writeKey=function(){return n(this,void 0,void 0,function(){var d;return o(this,function(h){switch(h.label){case 0:return[4,Nt.getKeypair(this.cfg.writeKeyName,this.store)];case 1:return d=h.sent(),[2,Ce(d)]}})})},g.prototype.readKey=function(){return n(this,void 0,void 0,function(){var d;return o(this,function(h){switch(h.label){case 0:return[4,Nt.getKeypair(this.cfg.readKeyName,this.store)];case 1:return d=h.sent(),[2,Ce(d)]}})})},g.prototype.getSymmKey=function(d,h){return n(this,void 0,void 0,function(){var b,S,C;return o(this,function(I){switch(I.label){case 0:return b=tr.merge(this.cfg,h),[4,Nt.getKey(d,this.store)];case 1:return S=I.sent(),S!==null?[2,S]:[4,va.makeKey(tr.symmKeyOpts(b))];case 2:return C=I.sent(),[4,Nt.put(d,C,this.store)];case 3:return I.sent(),[2,C]}})})},g.prototype.keyExists=function(d){return n(this,void 0,void 0,function(){var h;return o(this,function(b){switch(b.label){case 0:return[4,Nt.getKey(d,this.store)];case 1:return h=b.sent(),[2,h!==null]}})})},g.prototype.deleteKey=function(d){return n(this,void 0,void 0,function(){return o(this,function(h){return[2,Nt.rm(d,this.store)]})})},g.prototype.destroy=function(){return n(this,void 0,void 0,function(){return o(this,function(d){return[2,Nt.dropStore(this.store)]})})},g.prototype.importSymmKey=function(d,h,b){return n(this,void 0,void 0,function(){var S,C;return o(this,function(I){switch(I.label){case 0:return S=tr.merge(this.cfg,b),[4,va.importKey(d,tr.symmKeyOpts(S))];case 1:return C=I.sent(),[4,Nt.put(h,C,this.store)];case 2:return I.sent(),[2]}})})},g.prototype.exportSymmKey=function(d,h){return n(this,void 0,void 0,function(){var b;return o(this,function(S){switch(S.label){case 0:return[4,this.getSymmKey(d,h)];case 1:return b=S.sent(),[2,va.exportKey(b)]}})})},g.prototype.encryptWithSymmKey=function(d,h,b){return n(this,void 0,void 0,function(){var S,C,I;return o(this,function(W){switch(W.label){case 0:return S=tr.merge(this.cfg,b),[4,this.getSymmKey(h,b)];case 1:return C=W.sent(),[4,va.encryptBytes(T.strToArrBuf(d,S.charSize),C,tr.symmKeyOpts(S))];case 2:return I=W.sent(),[2,T.arrBufToBase64(I)]}})})},g.prototype.decryptWithSymmKey=function(d,h,b){return n(this,void 0,void 0,function(){var S,C,I;return o(this,function(W){switch(W.label){case 0:return S=tr.merge(this.cfg,b),[4,this.getSymmKey(h,b)];case 1:return C=W.sent(),[4,va.decryptBytes(T.base64ToArrBuf(d),C,tr.symmKeyOpts(S))];case 2:return I=W.sent(),[2,T.arrBufToStr(I,S.charSize)]}})})},g}(),mn=function(g){e(d,g);function d(){return g!==null&&g.apply(this,arguments)||this}return d.init=function(h){return n(this,void 0,void 0,function(){var b,S,C,I,W,oe;return o(this,function(ee){switch(ee.label){case 0:return b=tr.normalize(r(r({},h||{}),{type:l.ECC})),S=b.curve,C=b.storeName,I=b.readKeyName,W=b.writeKeyName,oe=Nt.createStore(C),[4,Nt.createIfDoesNotExist(I,function(){return Di.makeKeypair(S,Se.Read)},oe)];case 1:return ee.sent(),[4,Nt.createIfDoesNotExist(W,function(){return Di.makeKeypair(S,Se.Write)},oe)];case 2:return ee.sent(),[2,new d(b,oe)]}})})},d.prototype.sign=function(h,b){return n(this,void 0,void 0,function(){var S,C,I,W;return o(this,function(oe){switch(oe.label){case 0:return S=tr.merge(this.cfg,b),[4,this.writeKey()];case 1:return C=oe.sent(),W=(I=T).arrBufToBase64,[4,_a.sign(h,C.privateKey,S.charSize,S.hashAlg)];case 2:return[2,W.apply(I,[oe.sent()])]}})})},d.prototype.verify=function(h,b,S,C){return n(this,void 0,void 0,function(){var I;return o(this,function(W){return I=tr.merge(this.cfg,C),[2,_a.verify(h,b,S,I.charSize,I.curve,I.hashAlg)]})})},d.prototype.encrypt=function(h,b,S){return n(this,void 0,void 0,function(){var C,I,W,oe;return o(this,function(ee){switch(ee.label){case 0:return C=tr.merge(this.cfg,S),[4,this.readKey()];case 1:return I=ee.sent(),oe=(W=T).arrBufToBase64,[4,_a.encrypt(h,I.privateKey,b,C.charSize,C.curve)];case 2:return[2,oe.apply(W,[ee.sent()])]}})})},d.prototype.decrypt=function(h,b,S){return n(this,void 0,void 0,function(){var C,I,W,oe;return o(this,function(ee){switch(ee.label){case 0:return C=tr.merge(this.cfg,S),[4,this.readKey()];case 1:return I=ee.sent(),oe=(W=T).arrBufToStr,[4,_a.decrypt(h,I.privateKey,b,C.curve)];case 2:return[2,oe.apply(W,[ee.sent(),C.charSize])]}})})},d.prototype.publicReadKey=function(){return n(this,void 0,void 0,function(){var h;return o(this,function(b){switch(b.label){case 0:return[4,this.readKey()];case 1:return h=b.sent(),[2,_a.getPublicKey(h)]}})})},d.prototype.publicWriteKey=function(){return n(this,void 0,void 0,function(){var h;return o(this,function(b){switch(b.label){case 0:return[4,this.writeKey()];case 1:return h=b.sent(),[2,_a.getPublicKey(h)]}})})},d}(Vu);function df(g,d,h){return n(this,void 0,void 0,function(){var b,S;return o(this,function(C){return vt(h),b=h===Se.Read?ae:ge,S=h===Se.Read?["encrypt","decrypt"]:["sign","verify"],[2,globalThis.crypto.subtle.generateKey({name:b,modulusLength:g,publicExponent:T.publicExponent(),hash:{name:d}},!1,S)]})})}function oh(g){return g.replace(`-----BEGIN PUBLIC KEY-----
|
4 | `,"").replace(`
|
5 | -----END PUBLIC KEY-----`,"")}function pf(g,d,h){return n(this,void 0,void 0,function(){var b,S,C;return o(this,function(I){return vt(h),b=h===Se.Read?ae:ge,S=h===Se.Read?["encrypt"]:["verify"],C=T.base64ToArrBuf(oh(g)),[2,globalThis.crypto.subtle.importKey("spki",C,{name:b,hash:{name:d}},!0,S)]})})}var is={makeKeypair:df,importPublicKey:pf};function mf(g,d,h){return h===void 0&&(h=Lt),n(this,void 0,void 0,function(){return o(this,function(b){return[2,globalThis.crypto.subtle.sign({name:ge,saltLength:_e},d,Fi(g,h))]})})}function yf(g,d,h,b,S){return b===void 0&&(b=Lt),S===void 0&&(S=Wt),n(this,void 0,void 0,function(){var C,I,W,oe;return o(this,function(ee){switch(ee.label){case 0:return I=(C=globalThis.crypto.subtle).verify,W=[{name:ge,saltLength:_e}],typeof h!="string"?[3,2]:[4,is.importPublicKey(h,S,Se.Write)];case 1:return oe=ee.sent(),[3,3];case 2:oe=h,ee.label=3;case 3:return[2,I.apply(C,W.concat([oe,uo(d),Fi(g,b)]))]}})})}function yn(g,d,h,b){return h===void 0&&(h=Lt),b===void 0&&(b=Wt),n(this,void 0,void 0,function(){var S,C,I,W;return o(this,function(oe){switch(oe.label){case 0:return C=(S=globalThis.crypto.subtle).encrypt,I=[{name:ae}],typeof d!="string"?[3,2]:[4,is.importPublicKey(d,b,Se.Read)];case 1:return W=oe.sent(),[3,3];case 2:W=d,oe.label=3;case 3:return[2,C.apply(S,I.concat([W,Fi(g,h)]))]}})})}function ah(g,d){return n(this,void 0,void 0,function(){var h;return o(this,function(b){return h=uo(g),[2,globalThis.crypto.subtle.decrypt({name:ae},d,h)]})})}function An(g){return n(this,void 0,void 0,function(){var d;return o(this,function(h){switch(h.label){case 0:return[4,globalThis.crypto.subtle.exportKey("spki",g.publicKey)];case 1:return d=h.sent(),[2,T.arrBufToBase64(d)]}})})}var wa={sign:mf,verify:yf,encrypt:yn,decrypt:ah,getPublicKey:An},Ju=function(g){e(d,g);function d(){return g!==null&&g.apply(this,arguments)||this}return d.init=function(h){return n(this,void 0,void 0,function(){var b,S,C,I,W,oe,ee;return o(this,function(Me){switch(Me.label){case 0:return b=tr.normalize(r(r({},h||{}),{type:l.RSA})),S=b.rsaSize,C=b.hashAlg,I=b.storeName,W=b.readKeyName,oe=b.writeKeyName,ee=Nt.createStore(I),[4,Nt.createIfDoesNotExist(W,function(){return is.makeKeypair(S,C,Se.Read)},ee)];case 1:return Me.sent(),[4,Nt.createIfDoesNotExist(oe,function(){return is.makeKeypair(S,C,Se.Write)},ee)];case 2:return Me.sent(),[2,new d(b,ee)]}})})},d.prototype.sign=function(h,b){return n(this,void 0,void 0,function(){var S,C,I,W;return o(this,function(oe){switch(oe.label){case 0:return S=tr.merge(this.cfg,b),[4,this.writeKey()];case 1:return C=oe.sent(),W=(I=T).arrBufToBase64,[4,wa.sign(h,C.privateKey,S.charSize)];case 2:return[2,W.apply(I,[oe.sent()])]}})})},d.prototype.verify=function(h,b,S,C){return n(this,void 0,void 0,function(){var I;return o(this,function(W){return I=tr.merge(this.cfg,C),[2,wa.verify(h,b,S,I.charSize,I.hashAlg)]})})},d.prototype.encrypt=function(h,b,S){return n(this,void 0,void 0,function(){var C,I,W;return o(this,function(oe){switch(oe.label){case 0:return C=tr.merge(this.cfg,S),W=(I=T).arrBufToBase64,[4,wa.encrypt(h,b,C.charSize,C.hashAlg)];case 1:return[2,W.apply(I,[oe.sent()])]}})})},d.prototype.decrypt=function(h,b,S){return n(this,void 0,void 0,function(){var C,I,W,oe;return o(this,function(ee){switch(ee.label){case 0:return[4,this.readKey()];case 1:return C=ee.sent(),I=tr.merge(this.cfg,S),oe=(W=T).arrBufToStr,[4,wa.decrypt(h,C.privateKey)];case 2:return[2,oe.apply(W,[ee.sent(),I.charSize])]}})})},d.prototype.publicReadKey=function(){return n(this,void 0,void 0,function(){var h;return o(this,function(b){switch(b.label){case 0:return[4,this.readKey()];case 1:return h=b.sent(),[2,wa.getPublicKey(h)]}})})},d.prototype.publicWriteKey=function(){return n(this,void 0,void 0,function(){var h;return o(this,function(b){switch(b.label){case 0:return[4,this.writeKey()];case 1:return h=b.sent(),[2,wa.getPublicKey(h)]}})})},d}(Vu);function Yo(g){return n(this,void 0,void 0,function(){var d,h;return o(this,function(b){switch(b.label){case 0:return[4,tr.eccEnabled()];case 1:if(d=b.sent(),!d&&(g==null?void 0:g.type)==="ecc")throw Fe;return h=tr.normalize(g,d),ct(h.type),h.type==="ecc"?[2,mn.init(h)]:[2,Ju.init(h)]}})})}function Xu(){return n(this,void 0,void 0,function(){return o(this,function(g){return[2,Nt.clear()]})})}var gf=r(r(r({},Di),_a),mn),lr=Object.freeze({__proto__:null,default:gf,makeKeypair:ff,importPublicKey:Hu,sign:or,verify:er,encrypt:eh,decrypt:th,getPublicKey:rh,getSharedKey:Gu,ECCKeyStore:mn}),Vo=r(r(r({},is),wa),Ju),bf=Object.freeze({__proto__:null,default:Vo,makeKeypair:df,importPublicKey:pf,sign:mf,verify:yf,encrypt:yn,decrypt:ah,getPublicKey:An,RSAKeyStore:Ju}),Gp=r(r(r(r(r({init:Yo,clear:Xu},Q),zs),ih),K),{ecc:lr,rsa:bf,idb:Ct});return Gp})});var hd=Y(fy=>{"use strict";var SF=t=>{let{name:e,message:r,stack:n,code:o,detail:a}=t;return{name:e,message:r,stack:n,code:o,detail:a}};fy.encodeError=SF;var PF=t=>{if(t instanceof Error)return t;{let{name:e,message:r,stack:n,code:o}=t;return Object.assign(TF(e,r),{name:e,stack:n,code:o})}};fy.decodeError=PF;var TF=(t,e)=>{switch(t){case"RangeError":return new RangeError(e);case"ReferenceError":return ReferenceError(e);case"SyntaxError":return new SyntaxError(e);case"TypeError":return new TypeError(e);case"URIError":return new URIError(e);default:return new Error(e)}}});var ly=Y(B_=>{"use strict";var BF=t=>new Set(t);B_.ensureUniqueBuffers=BF});var C_=Y(dd=>{"use strict";dd.TimeoutError=class extends Error{get name(){return this.constructor.name}};dd.AbortError=class extends Error{get name(){return this.constructor.name}};dd.DisconnectError=class extends Error{get name(){return this.constructor.name}}});var I_=Y((e7,F_)=>{"use strict";var{decodeError:CF}=hd(),{ensureUniqueBuffers:FF}=ly(),{DisconnectError:IF,TimeoutError:DF,AbortError:RF}=C_();F_.exports=class pd{constructor(e){this.port=null,this.id=Math.random().toString(32).slice(2),this.nextID=0,this.queries=Object.create(null),e&&this.connect(e)}execute(e){let r=`${this.id}@${this.nextID++}`;return this.queries[r]=e,e.timeout>0&&e.timeout<Infinity&&(e.timerID=setTimeout(pd.timeout,e.timeout,this,r)),e.signal&&e.signal.addEventListener("abort",()=>this.abort(r),{once:!0}),this.port&&pd.postQuery(this.port,r,e),e.result}connect(e){if(this.port)throw new Error("Transport is already open");this.port=e,this.port.addEventListener("message",this),this.port.start();for(let[r,n]of Object.entries(this.queries))pd.postQuery(e,r,n)}disconnect(){let e=new IF;for(let[r,n]of Object.entries(this.queries))n.fail(e),this.abort(r);this.port&&(this.port.removeEventListener("message",this),this.port.close())}static timeout(e,r){let{queries:n}=e,o=n[r];o&&(delete n[r],o.fail(new DF("request timed out")),e.port&&e.port.postMessage({type:"abort",id:r}))}abort(e){let{queries:r}=this,n=r[e];n&&(delete r[e],n.fail(new RF),this.port&&this.port.postMessage({type:"abort",id:e}),n.timerID!=null&&clearTimeout(n.timerID))}static postQuery(e,r,n){e.postMessage({type:"query",namespace:n.namespace,method:n.method,id:r,input:n.toJSON()},FF(n.transfer()||[]))}handleEvent(e){let{id:r,result:n}=e.data,o=this.queries[r];o&&(delete this.queries[r],n.ok?o.succeed(n.value):o.fail(CF(n.error)),o.timerID!=null&&clearTimeout(o.timerID))}}});var R_=Y((r7,D_)=>{"use strict";D_.exports=class{constructor(e,r,n){this.result=new Promise((o,a)=>{this.succeed=o,this.fail=a,this.signal=n.signal,this.input=n,this.namespace=e,this.method=r,this.timeout=n.timeout==null?Infinity:n.timeout,this.timerID=null})}toJSON(){return this.input}transfer(){return this.input.transfer}}});var U_=Y((i7,N_)=>{"use strict";var NF=R_();N_.exports=class{constructor(e,r,n){this.transport=n;let o=this;for(let a of r)o[a]=u=>this.transport.execute(new NF(e,a.toString(),u))}}});var Ic=Y((a7,L_)=>{"use strict";var UF=U_();L_.exports=class{constructor(e,r,n){this.remote=new UF(e,r,n)}}});var O_=Y((s7,M_)=>{"use strict";function LF(t){if(t.length>=255)throw new TypeError("Alphabet too long");for(var e=new Uint8Array(256),r=0;r<e.length;r++)e[r]=255;for(var n=0;n<t.length;n++){var o=t.charAt(n),a=o.charCodeAt(0);if(e[a]!==255)throw new TypeError(o+" is ambiguous");e[a]=n}var u=t.length,c=t.charAt(0),p=Math.log(u)/Math.log(256),l=Math.log(256)/Math.log(u);function y(_){if(_ instanceof Uint8Array||(ArrayBuffer.isView(_)?_=new Uint8Array(_.buffer,_.byteOffset,_.byteLength):Array.isArray(_)&&(_=Uint8Array.from(_))),!(_ instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(_.length===0)return"";for(var U=0,V=0,Se=0,Q=_.length;Se!==Q&&_[Se]===0;)Se++,U++;for(var ue=(Q-Se)*l+1>>>0,J=new Uint8Array(ue);Se!==Q;){for(var ye=_[Se],Fe=0,Z=ue-1;(ye!==0||Fe<V)&&Z!==-1;Z--,Fe++)ye+=256*J[Z]>>>0,J[Z]=ye%u>>>0,ye=ye/u>>>0;if(ye!==0)throw new Error("Non-zero carry");V=Fe,Se++}for(var re=ue-V;re!==ue&&J[re]===0;)re++;for(var Ce=c.repeat(U);re<ue;++re)Ce+=t.charAt(J[re]);return Ce}function w(_){if(typeof _!="string")throw new TypeError("Expected String");if(_.length===0)return new Uint8Array;var U=0;if(_[U]!==" "){for(var V=0,Se=0;_[U]===c;)V++,U++;for(var Q=(_.length-U)*p+1>>>0,ue=new Uint8Array(Q);_[U];){var J=e[_.charCodeAt(U)];if(J===255)return;for(var ye=0,Fe=Q-1;(J!==0||ye<Se)&&Fe!==-1;Fe--,ye++)J+=u*ue[Fe]>>>0,ue[Fe]=J%256>>>0,J=J/256>>>0;if(J!==0)throw new Error("Non-zero carry");Se=ye,U++}if(_[U]!==" "){for(var Z=Q-Se;Z!==Q&&ue[Z]===0;)Z++;for(var re=new Uint8Array(V+(Q-Z)),Ce=V;Z!==Q;)re[Ce++]=ue[Z++];return re}}}function F(_){var U=w(_);if(U)return U;throw new Error("Non-base"+u+" character")}return{encode:y,decodeUnsafe:w,decode:F}}M_.exports=LF});var md=Y((u7,K_)=>{"use strict";var MF=new TextDecoder,OF=t=>MF.decode(t),KF=new TextEncoder,zF=t=>KF.encode(t);function qF(t,e){let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}K_.exports={decodeText:OF,encodeText:zF,concat:qF}});var H_=Y((c7,q_)=>{"use strict";var{encodeText:HF}=md(),z_=class{constructor(e,r,n,o){this.name=e,this.code=r,this.codeBuf=HF(this.code),this.alphabet=o,this.codec=n(o)}encode(e){return this.codec.encode(e)}decode(e){for(let r of e)if(this.alphabet&&this.alphabet.indexOf(r)<0)throw new Error(`invalid character '${r}' in '${e}'`);return this.codec.decode(e)}};q_.exports=z_});var $_=Y((f7,j_)=>{"use strict";var jF=(t,e,r)=>{let n={};for(let l=0;l<e.length;++l)n[e[l]]=l;let o=t.length;for(;t[o-1]==="=";)--o;let a=new Uint8Array(o*r/8|0),u=0,c=0,p=0;for(let l=0;l<o;++l){let y=n[t[l]];if(y===void 0)throw new SyntaxError("Invalid character "+t[l]);c=c<<r|y,u+=r,u>=8&&(u-=8,a[p++]=255&c>>u)}if(u>=r||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return a},$F=(t,e,r)=>{let n=e[e.length-1]==="=",o=(1<<r)-1,a="",u=0,c=0;for(let p=0;p<t.length;++p)for(c=c<<8|t[p],u+=8;u>r;)u-=r,a+=e[o&c>>u];if(u&&(a+=e[o&c<<r-u]),n)for(;a.length*r&7;)a+="=";return a},GF=t=>e=>({encode(r){return $F(r,e,t)},decode(r){return jF(r,e,t)}});j_.exports={rfc4648:GF}});var V_=Y((l7,Y_)=>{"use strict";var rl=O_(),WF=H_(),{rfc4648:fn}=$_(),{decodeText:YF,encodeText:VF}=md(),JF=()=>({encode:YF,decode:VF}),G_=[["identity","\0",JF,""],["base2","0",fn(1),"01"],["base8","7",fn(3),"01234567"],["base10","9",rl,"0123456789"],["base16","f",fn(4),"0123456789abcdef"],["base16upper","F",fn(4),"0123456789ABCDEF"],["base32hex","v",fn(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",fn(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",fn(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",fn(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",fn(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",fn(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",fn(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",fn(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",fn(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",rl,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",rl,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",rl,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",rl,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",fn(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",fn(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",fn(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",fn(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],W_=G_.reduce((t,e)=>(t[e[0]]=new WF(e[0],e[1],e[2],e[3]),t),{}),XF=G_.reduce((t,e)=>(t[e[1]]=W_[e[0]],t),{});Y_.exports={names:W_,codes:XF}});var nl=Y((qa,X_)=>{"use strict";var Dc=V_(),{encodeText:ZF,decodeText:yd,concat:J_}=md();function QF(t,e){if(!e)throw new Error("requires an encoded Uint8Array");let{name:r,codeBuf:n}=bu(t);return n5(r,e),J_([n,e],n.length+e.length)}function e5(t,e){let r=bu(t),n=ZF(r.encode(e));return J_([r.codeBuf,n],r.codeBuf.length+n.length)}function t5(t){t instanceof Uint8Array&&(t=yd(t));let e=t[0];return["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(e)&&(t=t.toLowerCase()),bu(t[0]).decode(t.substring(1))}function r5(t){if(t instanceof Uint8Array&&(t=yd(t)),Object.prototype.toString.call(t)!=="[object String]")return!1;try{return bu(t[0]).name}catch(e){return!1}}function n5(t,e){bu(t).decode(yd(e))}function bu(t){if(Object.prototype.hasOwnProperty.call(Dc.names,t))return Dc.names[t];if(Object.prototype.hasOwnProperty.call(Dc.codes,t))return Dc.codes[t];throw new Error(`Unsupported encoding: ${t}`)}function i5(t){return t instanceof Uint8Array&&(t=yd(t)),bu(t[0])}qa=X_.exports=QF;qa.encode=e5;qa.decode=t5;qa.isEncoded=r5;qa.encoding=bu;qa.encodingFromData=i5;var o5=Object.freeze(Dc.names),a5=Object.freeze(Dc.codes);qa.names=o5;qa.codes=a5});var tw=Y((h7,ew)=>{ew.exports=Q_;var Z_=128,s5=127,u5=~s5,c5=Math.pow(2,31);function Q_(t,e,r){e=e||[],r=r||0;for(var n=r;t>=c5;)e[r++]=t&255|Z_,t/=128;for(;t&u5;)e[r++]=t&255|Z_,t>>>=7;return e[r]=t|0,Q_.bytes=r-n+1,e}});var iw=Y((d7,nw)=>{nw.exports=hy;var f5=128,rw=127;function hy(t,e){var r=0,e=e||0,n=0,o=e,a,u=t.length;do{if(o>=u)throw hy.bytes=0,new RangeError("Could not decode varint");a=t[o++],r+=n<28?(a&rw)<<n:(a&rw)*Math.pow(2,n),n+=7}while(a>=f5);return hy.bytes=o-e,r}});var aw=Y((p7,ow)=>{var l5=Math.pow(2,7),h5=Math.pow(2,14),d5=Math.pow(2,21),p5=Math.pow(2,28),m5=Math.pow(2,35),y5=Math.pow(2,42),g5=Math.pow(2,49),b5=Math.pow(2,56),v5=Math.pow(2,63);ow.exports=function(t){return t<l5?1:t<h5?2:t<d5?3:t<p5?4:t<m5?5:t<y5?6:t<g5?7:t<b5?8:t<v5?9:10}});var uw=Y((m7,sw)=>{sw.exports={encode:tw(),decode:iw(),encodingLength:aw()}});var fw=Y((y7,cw)=>{"use strict";var _5=Object.freeze({identity:0,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,"murmur3-128":34,"murmur3-32":35,"dbl-sha2-256":86,md4:212,md5:213,bmt:214,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082});cw.exports={names:_5}});var il=Y((g7,lw)=>{"use strict";var{encoding:w5}=nl(),x5=new TextDecoder("utf8");function k5(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCharCode(t[r]);return e}function A5(t,e="utf8"){return e==="utf8"||e==="utf-8"?x5.decode(t):e==="ascii"?k5(t):w5(e).encode(t)}lw.exports=A5});var Rc=Y((b7,hw)=>{"use strict";var{encoding:E5}=nl(),S5=new TextEncoder;function P5(t){let e=new Uint8Array(t.length);for(let r=0;r<t.length;r++)e[r]=t.charCodeAt(r);return e}function T5(t,e="utf8"){return e==="utf8"||e==="utf-8"?S5.encode(t):e==="ascii"?P5(t):E5(e).decode(t)}hw.exports=T5});var gd=Y((v7,dw)=>{"use strict";function B5(t,e){e||(e=t.reduce((o,a)=>o+a.length,0));let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}dw.exports=B5});var al=Y((_7,vw)=>{"use strict";var pw=nl(),Nc=uw(),{names:ol}=fw(),bd=il(),C5=Rc(),F5=gd(),Uc={};for(let t in ol){let e=t;Uc[ol[e]]=e}Object.freeze(Uc);function I5(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return bd(t,"base16")}function D5(t){return C5(t,"base16")}function R5(t){if(!(t instanceof Uint8Array))throw new Error("must be passed a Uint8Array");return bd(pw.encode("base58btc",t)).slice(1)}function N5(t){let e=t instanceof Uint8Array?bd(t):t;return pw.decode("z"+e)}function mw(t){if(!(t instanceof Uint8Array))throw new Error("multihash must be a Uint8Array");if(t.length<2)throw new Error("multihash too short. must be > 2 bytes.");let e=Nc.decode(t);if(!gw(e))throw new Error(`multihash unknown function code: 0x${e.toString(16)}`);t=t.slice(Nc.decode.bytes);let r=Nc.decode(t);if(r<0)throw new Error(`multihash invalid length: ${r}`);if(t=t.slice(Nc.decode.bytes),t.length!==r)throw new Error(`multihash length inconsistent: 0x${bd(t,"base16")}`);return{code:e,name:Uc[e],length:r,digest:t}}function U5(t,e,r){if(!t||e===void 0)throw new Error("multihash encode requires at least two args: digest, code");let n=yw(e);if(!(t instanceof Uint8Array))throw new Error("digest should be a Uint8Array");if(r==null&&(r=t.length),r&&t.length!==r)throw new Error("digest length should be equal to specified length.");let o=Nc.encode(n),a=Nc.encode(r);return F5([o,a,t],o.length+a.length+t.length)}function yw(t){let e=t;if(typeof t=="string"){if(ol[t]===void 0)throw new Error(`Unrecognized hash function named: ${t}`);e=ol[t]}if(typeof e!="number")throw new Error(`Hash function code should be a number. Got: ${e}`);if(Uc[e]===void 0&&!dy(e))throw new Error(`Unrecognized function code: ${e}`);return e}function dy(t){return t>0&&t<16}function gw(t){return!!(dy(t)||Uc[t])}function bw(t){mw(t)}function L5(t){return bw(t),t.subarray(0,2)}vw.exports={names:ol,codes:Uc,toHexString:I5,fromHexString:D5,toB58String:R5,fromB58String:N5,decode:mw,encode:U5,coerceCode:yw,isAppCode:dy,validate:bw,prefix:L5,isValidCode:gw}});var kw=Y((w7,xw)=>{xw.exports=ww;var _w=128,M5=127,O5=~M5,K5=Math.pow(2,31);function ww(t,e,r){e=e||[],r=r||0;for(var n=r;t>=K5;)e[r++]=t&255|_w,t/=128;for(;t&O5;)e[r++]=t&255|_w,t>>>=7;return e[r]=t|0,ww.bytes=r-n+1,e}});var Sw=Y((x7,Ew)=>{Ew.exports=py;var z5=128,Aw=127;function py(t,e){var r=0,e=e||0,n=0,o=e,a,u=t.length;do{if(o>=u)throw py.bytes=0,new RangeError("Could not decode varint");a=t[o++],r+=n<28?(a&Aw)<<n:(a&Aw)*Math.pow(2,n),n+=7}while(a>=z5);return py.bytes=o-e,r}});var Tw=Y((k7,Pw)=>{var q5=Math.pow(2,7),H5=Math.pow(2,14),j5=Math.pow(2,21),$5=Math.pow(2,28),G5=Math.pow(2,35),W5=Math.pow(2,42),Y5=Math.pow(2,49),V5=Math.pow(2,56),J5=Math.pow(2,63);Pw.exports=function(t){return t<q5?1:t<H5?2:t<j5?3:t<$5?4:t<G5?5:t<W5?6:t<Y5?7:t<V5?8:t<J5?9:10}});var my=Y((A7,Bw)=>{Bw.exports={encode:kw(),decode:Sw(),encodingLength:Tw()}});var yy=Y((E7,Iw)=>{"use strict";var Cw=my(),X5=il(),Z5=Rc();Iw.exports={numberToUint8Array:Q5,uint8ArrayToNumber:Fw,varintUint8ArrayEncode:eI,varintEncode:tI};function Fw(t){return parseInt(X5(t,"base16"),16)}function Q5(t){let e=t.toString(16);return e.length%2==1&&(e="0"+e),Z5(e,"base16")}function eI(t){return Uint8Array.from(Cw.encode(Fw(t)))}function tI(t){return Uint8Array.from(Cw.encode(t))}});var Rw=Y((S7,Dw)=>{"use strict";var rI=Object.freeze({identity:0,cidv1:1,cidv2:2,cidv3:3,ip4:4,tcp:6,sha1:17,"sha2-256":18,"sha2-512":19,"sha3-512":20,"sha3-384":21,"sha3-256":22,"sha3-224":23,"shake-128":24,"shake-256":25,"keccak-224":26,"keccak-256":27,"keccak-384":28,"keccak-512":29,blake3:30,dccp:33,"murmur3-128":34,"murmur3-32":35,ip6:41,ip6zone:42,path:47,multicodec:48,multihash:49,multiaddr:50,multibase:51,dns:53,dns4:54,dns6:55,dnsaddr:56,protobuf:80,cbor:81,raw:85,"dbl-sha2-256":86,rlp:96,bencode:99,"dag-pb":112,"dag-cbor":113,"libp2p-key":114,"git-raw":120,"torrent-info":123,"torrent-file":124,"leofcoin-block":129,"leofcoin-tx":130,"leofcoin-pr":131,sctp:132,"dag-jose":133,"dag-cose":134,"eth-block":144,"eth-block-list":145,"eth-tx-trie":146,"eth-tx":147,"eth-tx-receipt-trie":148,"eth-tx-receipt":149,"eth-state-trie":150,"eth-account-snapshot":151,"eth-storage-trie":152,"bitcoin-block":176,"bitcoin-tx":177,"bitcoin-witness-commitment":178,"zcash-block":192,"zcash-tx":193,docid:206,"stellar-block":208,"stellar-tx":209,md4:212,md5:213,bmt:214,"decred-block":224,"decred-tx":225,"ipld-ns":226,"ipfs-ns":227,"swarm-ns":228,"ipns-ns":229,zeronet:230,"secp256k1-pub":231,"bls12_381-g1-pub":234,"bls12_381-g2-pub":235,"x25519-pub":236,"ed25519-pub":237,"bls12_381-g1g2-pub":238,"dash-block":240,"dash-tx":241,"swarm-manifest":250,"swarm-feed":251,udp:273,"p2p-webrtc-star":275,"p2p-webrtc-direct":276,"p2p-stardust":277,"p2p-circuit":290,"dag-json":297,udt:301,utp:302,unix:400,thread:406,p2p:421,ipfs:421,https:443,onion:444,onion3:445,garlic64:446,garlic32:447,tls:448,quic:460,ws:477,wss:478,"p2p-websocket-star":479,http:480,json:512,messagepack:513,"libp2p-peer-record":769,"sha2-256-trunc254-padded":4114,"ripemd-128":4178,"ripemd-160":4179,"ripemd-256":4180,"ripemd-320":4181,x11:4352,"p256-pub":4608,"p384-pub":4609,"p521-pub":4610,"ed448-pub":4611,"x448-pub":4612,"ed25519-priv":4864,kangarootwelve:7425,"sm3-256":21325,"blake2b-8":45569,"blake2b-16":45570,"blake2b-24":45571,"blake2b-32":45572,"blake2b-40":45573,"blake2b-48":45574,"blake2b-56":45575,"blake2b-64":45576,"blake2b-72":45577,"blake2b-80":45578,"blake2b-88":45579,"blake2b-96":45580,"blake2b-104":45581,"blake2b-112":45582,"blake2b-120":45583,"blake2b-128":45584,"blake2b-136":45585,"blake2b-144":45586,"blake2b-152":45587,"blake2b-160":45588,"blake2b-168":45589,"blake2b-176":45590,"blake2b-184":45591,"blake2b-192":45592,"blake2b-200":45593,"blake2b-208":45594,"blake2b-216":45595,"blake2b-224":45596,"blake2b-232":45597,"blake2b-240":45598,"blake2b-248":45599,"blake2b-256":45600,"blake2b-264":45601,"blake2b-272":45602,"blake2b-280":45603,"blake2b-288":45604,"blake2b-296":45605,"blake2b-304":45606,"blake2b-312":45607,"blake2b-320":45608,"blake2b-328":45609,"blake2b-336":45610,"blake2b-344":45611,"blake2b-352":45612,"blake2b-360":45613,"blake2b-368":45614,"blake2b-376":45615,"blake2b-384":45616,"blake2b-392":45617,"blake2b-400":45618,"blake2b-408":45619,"blake2b-416":45620,"blake2b-424":45621,"blake2b-432":45622,"blake2b-440":45623,"blake2b-448":45624,"blake2b-456":45625,"blake2b-464":45626,"blake2b-472":45627,"blake2b-480":45628,"blake2b-488":45629,"blake2b-496":45630,"blake2b-504":45631,"blake2b-512":45632,"blake2s-8":45633,"blake2s-16":45634,"blake2s-24":45635,"blake2s-32":45636,"blake2s-40":45637,"blake2s-48":45638,"blake2s-56":45639,"blake2s-64":45640,"blake2s-72":45641,"blake2s-80":45642,"blake2s-88":45643,"blake2s-96":45644,"blake2s-104":45645,"blake2s-112":45646,"blake2s-120":45647,"blake2s-128":45648,"blake2s-136":45649,"blake2s-144":45650,"blake2s-152":45651,"blake2s-160":45652,"blake2s-168":45653,"blake2s-176":45654,"blake2s-184":45655,"blake2s-192":45656,"blake2s-200":45657,"blake2s-208":45658,"blake2s-216":45659,"blake2s-224":45660,"blake2s-232":45661,"blake2s-240":45662,"blake2s-248":45663,"blake2s-256":45664,"skein256-8":45825,"skein256-16":45826,"skein256-24":45827,"skein256-32":45828,"skein256-40":45829,"skein256-48":45830,"skein256-56":45831,"skein256-64":45832,"skein256-72":45833,"skein256-80":45834,"skein256-88":45835,"skein256-96":45836,"skein256-104":45837,"skein256-112":45838,"skein256-120":45839,"skein256-128":45840,"skein256-136":45841,"skein256-144":45842,"skein256-152":45843,"skein256-160":45844,"skein256-168":45845,"skein256-176":45846,"skein256-184":45847,"skein256-192":45848,"skein256-200":45849,"skein256-208":45850,"skein256-216":45851,"skein256-224":45852,"skein256-232":45853,"skein256-240":45854,"skein256-248":45855,"skein256-256":45856,"skein512-8":45857,"skein512-16":45858,"skein512-24":45859,"skein512-32":45860,"skein512-40":45861,"skein512-48":45862,"skein512-56":45863,"skein512-64":45864,"skein512-72":45865,"skein512-80":45866,"skein512-88":45867,"skein512-96":45868,"skein512-104":45869,"skein512-112":45870,"skein512-120":45871,"skein512-128":45872,"skein512-136":45873,"skein512-144":45874,"skein512-152":45875,"skein512-160":45876,"skein512-168":45877,"skein512-176":45878,"skein512-184":45879,"skein512-192":45880,"skein512-200":45881,"skein512-208":45882,"skein512-216":45883,"skein512-224":45884,"skein512-232":45885,"skein512-240":45886,"skein512-248":45887,"skein512-256":45888,"skein512-264":45889,"skein512-272":45890,"skein512-280":45891,"skein512-288":45892,"skein512-296":45893,"skein512-304":45894,"skein512-312":45895,"skein512-320":45896,"skein512-328":45897,"skein512-336":45898,"skein512-344":45899,"skein512-352":45900,"skein512-360":45901,"skein512-368":45902,"skein512-376":45903,"skein512-384":45904,"skein512-392":45905,"skein512-400":45906,"skein512-408":45907,"skein512-416":45908,"skein512-424":45909,"skein512-432":45910,"skein512-440":45911,"skein512-448":45912,"skein512-456":45913,"skein512-464":45914,"skein512-472":45915,"skein512-480":45916,"skein512-488":45917,"skein512-496":45918,"skein512-504":45919,"skein512-512":45920,"skein1024-8":45921,"skein1024-16":45922,"skein1024-24":45923,"skein1024-32":45924,"skein1024-40":45925,"skein1024-48":45926,"skein1024-56":45927,"skein1024-64":45928,"skein1024-72":45929,"skein1024-80":45930,"skein1024-88":45931,"skein1024-96":45932,"skein1024-104":45933,"skein1024-112":45934,"skein1024-120":45935,"skein1024-128":45936,"skein1024-136":45937,"skein1024-144":45938,"skein1024-152":45939,"skein1024-160":45940,"skein1024-168":45941,"skein1024-176":45942,"skein1024-184":45943,"skein1024-192":45944,"skein1024-200":45945,"skein1024-208":45946,"skein1024-216":45947,"skein1024-224":45948,"skein1024-232":45949,"skein1024-240":45950,"skein1024-248":45951,"skein1024-256":45952,"skein1024-264":45953,"skein1024-272":45954,"skein1024-280":45955,"skein1024-288":45956,"skein1024-296":45957,"skein1024-304":45958,"skein1024-312":45959,"skein1024-320":45960,"skein1024-328":45961,"skein1024-336":45962,"skein1024-344":45963,"skein1024-352":45964,"skein1024-360":45965,"skein1024-368":45966,"skein1024-376":45967,"skein1024-384":45968,"skein1024-392":45969,"skein1024-400":45970,"skein1024-408":45971,"skein1024-416":45972,"skein1024-424":45973,"skein1024-432":45974,"skein1024-440":45975,"skein1024-448":45976,"skein1024-456":45977,"skein1024-464":45978,"skein1024-472":45979,"skein1024-480":45980,"skein1024-488":45981,"skein1024-496":45982,"skein1024-504":45983,"skein1024-512":45984,"skein1024-520":45985,"skein1024-528":45986,"skein1024-536":45987,"skein1024-544":45988,"skein1024-552":45989,"skein1024-560":45990,"skein1024-568":45991,"skein1024-576":45992,"skein1024-584":45993,"skein1024-592":45994,"skein1024-600":45995,"skein1024-608":45996,"skein1024-616":45997,"skein1024-624":45998,"skein1024-632":45999,"skein1024-640":46e3,"skein1024-648":46001,"skein1024-656":46002,"skein1024-664":46003,"skein1024-672":46004,"skein1024-680":46005,"skein1024-688":46006,"skein1024-696":46007,"skein1024-704":46008,"skein1024-712":46009,"skein1024-720":46010,"skein1024-728":46011,"skein1024-736":46012,"skein1024-744":46013,"skein1024-752":46014,"skein1024-760":46015,"skein1024-768":46016,"skein1024-776":46017,"skein1024-784":46018,"skein1024-792":46019,"skein1024-800":46020,"skein1024-808":46021,"skein1024-816":46022,"skein1024-824":46023,"skein1024-832":46024,"skein1024-840":46025,"skein1024-848":46026,"skein1024-856":46027,"skein1024-864":46028,"skein1024-872":46029,"skein1024-880":46030,"skein1024-888":46031,"skein1024-896":46032,"skein1024-904":46033,"skein1024-912":46034,"skein1024-920":46035,"skein1024-928":46036,"skein1024-936":46037,"skein1024-944":46038,"skein1024-952":46039,"skein1024-960":46040,"skein1024-968":46041,"skein1024-976":46042,"skein1024-984":46043,"skein1024-992":46044,"skein1024-1000":46045,"skein1024-1008":46046,"skein1024-1016":46047,"skein1024-1024":46048,"poseidon-bls12_381-a2-fc1":46081,"poseidon-bls12_381-a2-fc1-sc":46082,"zeroxcert-imprint-256":52753,"fil-commitment-unsealed":61697,"fil-commitment-sealed":61698,"holochain-adr-v0":8417572,"holochain-adr-v1":8483108,"holochain-key-v0":9728292,"holochain-key-v1":9793828,"holochain-sig-v0":10645796,"holochain-sig-v1":10711332,"skynet-ns":11639056});Dw.exports={baseTable:rI}});var Uw=Y((P7,Nw)=>{"use strict";var{baseTable:gy}=Rw(),nI=yy().varintEncode,by={},vy={},vd={};for(let t in gy){let e=t,r=gy[e];by[e]=nI(r);let n=e.toUpperCase().replace(/-/g,"_");vy[n]=r,vd[r]||(vd[r]=e)}Object.freeze(by);Object.freeze(vy);Object.freeze(vd);var iI=Object.freeze(gy);Nw.exports={nameToVarint:by,constantToCode:vy,nameToCode:iI,codeToName:vd}});var wy=Y((T7,$w)=>{"use strict";var _d=my(),oI=gd(),Lw=yy(),{nameToVarint:wd,constantToCode:aI,nameToCode:Mw,codeToName:_y}=Uw();function sI(t,e){let r;if(t instanceof Uint8Array)r=Lw.varintUint8ArrayEncode(t);else if(wd[t])r=wd[t];else throw new Error("multicodec not recognized");return oI([r,e],r.length+e.length)}function uI(t){return _d.decode(t),t.slice(_d.decode.bytes)}function Ow(t){let e=_d.decode(t),r=_y[e];if(r===void 0)throw new Error(`Code "${e}" not found`);return r}function Kw(t){return _y[t]}function zw(t){let e=Mw[t];if(e===void 0)throw new Error(`Codec "${t}" not found`);return e}function qw(t){return _d.decode(t)}function Hw(t){let e=wd[t];if(e===void 0)throw new Error(`Codec "${t}" not found`);return e}function jw(t){return Lw.varintEncode(t)}function cI(t){return Ow(t)}function fI(t){return Kw(t)}function lI(t){return zw(t)}function hI(t){return qw(t)}function dI(t){return Hw(t)}function pI(t){return Array.from(jw(t))}$w.exports={addPrefix:sI,rmPrefix:uI,getNameFromData:Ow,getNameFromCode:Kw,getCodeFromName:zw,getCodeFromData:qw,getVarintFromName:Hw,getVarintFromCode:jw,getCodec:cI,getName:fI,getNumber:lI,getCode:hI,getCodeVarint:dI,getVarint:pI,...aI,nameToVarint:wd,nameToCode:Mw,codeToName:_y}});var Ww=Y((B7,Gw)=>{"use strict";var mI=al(),yI={checkCIDComponents:function(t){if(t==null)return"null values are not valid CIDs";if(!(t.version===0||t.version===1))return"Invalid version, must be a number equal to 1 or 0";if(typeof t.codec!="string")return"codec must be string";if(t.version===0){if(t.codec!=="dag-pb")return"codec must be 'dag-pb' for CIDv0";if(t.multibaseName!=="base58btc")return"multibaseName must be 'base58btc' for CIDv0"}if(!(t.multihash instanceof Uint8Array))return"multihash must be a Uint8Array";try{mI.validate(t.multihash)}catch(e){let r=e.message;return r||(r="Multihash validation failed"),r}}};Gw.exports=yI});var xd=Y((C7,Yw)=>{"use strict";function gI(t,e){if(t===e)return!0;if(t.byteLength!==e.byteLength)return!1;for(let r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}Yw.exports=gI});var Ss=Y((F7,Xw)=>{"use strict";var kd=al(),xy=nl(),vu=wy(),bI=Ww(),Vw=gd(),vI=il(),_I=xd(),Ad=vu.nameToCode,wI=Object.keys(Ad).reduce((t,e)=>(t[Ad[e]]=e,t),{}),Jw=Symbol.for("@ipld/js-cid/CID"),xo=class{constructor(e,r,n,o){if(this.version,this.codec,this.multihash,Object.defineProperty(this,Jw,{value:!0}),xo.isCID(e)){let a=e;this.version=a.version,this.codec=a.codec,this.multihash=a.multihash,this.multibaseName=a.multibaseName||(a.version===0?"base58btc":"base32");return}if(typeof e=="string"){let a=xy.isEncoded(e);if(a){let u=xy.decode(e);this.version=parseInt(u[0].toString(),16),this.codec=vu.getCodec(u.slice(1)),this.multihash=vu.rmPrefix(u.slice(1)),this.multibaseName=a}else this.version=0,this.codec="dag-pb",this.multihash=kd.fromB58String(e),this.multibaseName="base58btc";xo.validateCID(this),Object.defineProperty(this,"string",{value:e});return}if(e instanceof Uint8Array){let a=parseInt(e[0].toString(),16);if(a===1){let u=e;this.version=a,this.codec=vu.getCodec(u.slice(1)),this.multihash=vu.rmPrefix(u.slice(1)),this.multibaseName="base32"}else this.version=0,this.codec="dag-pb",this.multihash=e,this.multibaseName="base58btc";xo.validateCID(this);return}this.version=e,typeof r=="number"&&(r=wI[r]),this.codec=r,this.multihash=n,this.multibaseName=o||(e===0?"base58btc":"base32"),xo.validateCID(this)}get bytes(){let e=this._bytes;if(!e){if(this.version===0)e=this.multihash;else if(this.version===1){let r=vu.getCodeVarint(this.codec);e=Vw([[1],r,this.multihash],1+r.byteLength+this.multihash.byteLength)}else throw new Error("unsupported version");Object.defineProperty(this,"_bytes",{value:e})}return e}get prefix(){let e=vu.getCodeVarint(this.codec),r=kd.prefix(this.multihash);return Vw([[this.version],e,r],1+e.byteLength+r.byteLength)}get code(){return Ad[this.codec]}toV0(){if(this.codec!=="dag-pb")throw new Error("Cannot convert a non dag-pb CID to CIDv0");let{name:e,length:r}=kd.decode(this.multihash);if(e!=="sha2-256")throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");if(r!==32)throw new Error("Cannot convert non 32 byte multihash CID to CIDv0");return new xo(0,this.codec,this.multihash)}toV1(){return new xo(1,this.codec,this.multihash)}toBaseEncodedString(e=this.multibaseName){if(this.string&&this.string.length!==0&&e===this.multibaseName)return this.string;let r;if(this.version===0){if(e!=="base58btc")throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");r=kd.toB58String(this.multihash)}else if(this.version===1)r=vI(xy.encode(e,this.bytes));else throw new Error("unsupported version");return e===this.multibaseName&&Object.defineProperty(this,"string",{value:r}),r}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}toString(e){return this.toBaseEncodedString(e)}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(e){return this.codec===e.codec&&this.version===e.version&&_I(this.multihash,e.multihash)}static validateCID(e){let r=bI.checkCIDComponents(e);if(r)throw new Error(r)}static isCID(e){return e instanceof xo||Boolean(e&&e[Jw])}};xo.codecs=Ad;Xw.exports=xo});var Ps=Y(Ed=>{"use strict";var Zw=Ss(),xI=(t,e)=>(e&&e.push(t.multihash.buffer),t);Ed.encodeCID=xI;var kI=t=>{let e=t;return Object.setPrototypeOf(e.multihash,Uint8Array.prototype),Object.setPrototypeOf(e,Zw.prototype),Object.defineProperty(e,Symbol.for("@ipld/js-cid/CID"),{value:!0}),e};Ed.decodeCID=kI;Ed.CID=Zw});var Qw=Y((D7,AI)=>{AI.exports={name:"ipld-block",version:"0.11.1",description:"JavaScript Implementation of IPLD Block",leadMaintainer:"Volker Mische <volker.mische@gmail.com>",main:"src/index.js",types:"dist/src/index.d.ts",scripts:{lint:"aegir lint",check:"tsc --noEmit --noErrorTruncation",test:"aegir test","test:node":"aegir test --target node","test:browser":"aegir test --target browser",release:"aegir release --docs","release-minor":"aegir release --type minor --docs","release-major":"aegir release --type major --docs",coverage:"aegir coverage","coverage-publish":"aegir coverage --provider coveralls",docs:"aegir docs",prepare:"aegir build --no-bundle",prepublishOnly:"aegir build"},"pre-push":["lint","test"],repository:{type:"git",url:"git+https://github.com/ipld/js-ipld-block.git"},keywords:["IPLD"],license:"MIT",bugs:{url:"https://github.com/ipld/js-ipld-block/issues"},homepage:"https://github.com/ipld/js-ipld-block#readme",devDependencies:{aegir:"^31.0.4",uint8arrays:"^2.1.3"},dependencies:{cids:"^1.0.0"},engines:{node:">=6.0.0",npm:">=3.0.0"},contributors:["David Dias <daviddias.p@gmail.com>","Volker Mische <volker.mische@gmail.com>","Friedel Ziegelmayer <dignifiedquire@gmail.com>","Irakli Gozalishvili <contact@gozala.io>","achingbrain <alex@achingbrain.net>","\u1D20\u026A\u1D04\u1D1B\u1D0F\u0280 \u0299\u1D0A\u1D07\u029F\u1D0B\u029C\u1D0F\u029F\u1D0D <victorbjelkholm@gmail.com>","Alan Shaw <alan.shaw@protocol.ai>","Charlie <the_charlie_daly@hotmail.co.uk>","Diogo Silva <fsdiogo@gmail.com>","Hugo Dias <hugomrdias@gmail.com>","Mikeal Rogers <mikeal.rogers@gmail.com>","Richard Littauer <richard.littauer@gmail.com>","Richard Schneider <makaretu@gmail.com>","Xmader <xmader@outlook.com>"]}});var ox=Y((R7,ix)=>{"use strict";var EI=Ss(),{version:SI}=Qw(),ex=Symbol.for("@ipld/js-ipld-block/block"),tx={writable:!1,configurable:!1,enumerable:!0},rx=class{constructor(e,r){if(!e||!(e instanceof Uint8Array))throw new Error("first argument must be a Uint8Array");if(!r||!EI.isCID(r))throw new Error("second argument must be a CID");this.data=e,this.cid=r,Object.defineProperties(this,{data:tx,cid:tx})}get _data(){return TI(),this.data}get _cid(){return PI(),this.cid}get[Symbol.toStringTag](){return"Block"}get[ex](){return!0}static isBlock(e){return Boolean(e&&e[ex])}},nx=(t,e)=>{let r=!1;return()=>{if(t.test(SI))r||(r=!0,console.warn(e));else throw new Error(e)}},PI=nx(/^0\.10|^0\.11/,"block._cid is deprecated and will be removed in 0.12 release. Please use block.cid instead"),TI=nx(/^0\.10|^0.11/,"block._data is deprecated and will be removed in 0.12 release. Please use block.data instead");ix.exports=rx});var sx=Y(Sd=>{"use strict";var{encodeCID:BI,decodeCID:CI}=Ps(),ax=ox(),FI=({cid:t,data:e},r)=>(r&&r.push(e.buffer),{cid:BI(t,r),data:e});Sd.encodeBlock=FI;var II=({cid:t,data:e})=>new ax(e,CI(t));Sd.decodeBlock=II;Sd.Block=ax});var hx=Y((U7,lx)=>{"use strict";var DI=Ic(),{encodeCID:sl,decodeCID:ux}=Ps(),{decodeError:RI}=hd(),{encodeBlock:NI,decodeBlock:cx}=sx(),fx=class extends DI{constructor(e){super("block",["put","get","rm","stat"],e)}async get(e,r={}){let{transfer:n}=r,{block:o}=await this.remote.get({...r,cid:sl(e,n)});return cx(o)}async put(e,r={}){let{transfer:n}=r;delete r.progress;let o=await this.remote.put({...r,cid:r.cid==null?void 0:sl(r.cid,n),block:e instanceof Uint8Array?e:NI(e,n)});return cx(o.block)}async*rm(e,r={}){let{transfer:n}=r;yield*(await this.remote.rm({...r,cids:Array.isArray(e)?e.map(a=>sl(a,n)):[sl(e,n)]})).map(UI)}async stat(e,r={}){let{transfer:n}=r,o=await this.remote.stat({...r,cid:sl(e,n)});return{...o,cid:ux(o.cid)}}},UI=t=>{let e=ux(t.cid);return t.error?{cid:e,error:RI(t.error)}:{cid:e}};lx.exports=fx});var dx=Y(Ay=>{"use strict";var{encodeCID:LI,decodeCID:MI,CID:OI}=Ps(),KI=({dagNode:t,cids:e})=>{for(let r of e)MI(r);return t};Ay.decodeNode=KI;var zI=(t,e)=>{let r=[];return ky(t,r,e),{dagNode:t,cids:r}};Ay.encodeNode=zI;var ky=(t,e,r)=>{if(t!=null&&typeof t=="object")if(OI.isCID(t))e.push(t),LI(t,r);else if(t instanceof ArrayBuffer)r&&r.push(t);else if(ArrayBuffer.isView(t))r&&r.push(t.buffer);else if(Array.isArray(t))for(let n of t)ky(n,e,r);else for(let n of Object.values(t))ky(n,e,r)}});var gx=Y((M7,yx)=>{"use strict";var qI=Ic(),{encodeCID:Pd,decodeCID:px}=Ps(),{encodeNode:HI,decodeNode:jI}=dx(),mx=class extends qI{constructor(e){super("dag",["put","get","resolve","tree"],e)}async put(e,r={}){let{cid:n}=r,o=await this.remote.put({...r,cid:n!=null?Pd(n):void 0,dagNode:HI(e,r.transfer)});return px(o)}async get(e,r={}){let{value:n,remainderPath:o}=await this.remote.get({...r,cid:Pd(e,r.transfer)});return{value:jI(n),remainderPath:o}}async resolve(e,r={}){let{cid:n,remainderPath:o}=await this.remote.resolve({...r,cid:$I(e,r.transfer)});return{cid:px(n),remainderPath:o}}async*tree(e,r={}){yield*await this.remote.tree({...r,cid:Pd(e,r.transfer)})}},$I=(t,e)=>typeof t=="string"?t:Pd(t,e);yx.exports=mx});var bx=Y(ul=>{"use strict";var{encodeError:GI,decodeError:WI}=hd(),{ensureUniqueBuffers:YI}=ly(),VI=async function*({port:t},e){let r=u=>{},n=()=>new Promise(u=>r=u),o=()=>(t.postMessage({method:"next"}),n());t.onmessage=u=>r(u.data);let a=!1;try{for(;!a;){let{done:u,value:c,error:p}=await o();if(a=u,p!=null)throw WI(p);c!=null&&(yield e(c))}}finally{a||t.postMessage({method:"return"}),t.close()}};ul.decodeIterable=VI;var JI=(t,e,r)=>{let{port1:n,port2:o}=new MessageChannel,a=XI(t);return n.onmessage=async({data:{method:u}})=>{switch(u){case"next":{try{let{done:c,value:p}=await a.next();if(c)n.postMessage({type:"next",done:!0}),n.close();else{let l=[],y=e(p,l);n.postMessage({type:"next",done:!1,value:y},YI(l))}}catch(c){n.postMessage({type:"throw",error:GI(c)}),n.close()}break}case"return":{n.close(),a.return&&a.return();break}default:break}},n.start(),r.push(o),{type:"RemoteIterable",port:o}};ul.encodeIterable=JI;var XI=t=>{if(t!=null){if(typeof t[Symbol.asyncIterator]=="function")return t[Symbol.asyncIterator]();if(typeof t[Symbol.iterator]=="function")return t[Symbol.iterator]()}throw TypeError("Value must be async or sync iterable")},ZI=(t,e)=>{let{port1:r,port2:n}=new MessageChannel;return r.onmessage=({data:o})=>t.apply(null,o),e.push(n),{type:"RemoteCallback",port:n}};ul.encodeCallback=ZI;var QI=({port:t})=>(r,n=[])=>{t.postMessage(r,new Set(n))};ul.decodeCallback=QI});var _x=Y((K7,vx)=>{"use strict";async function*eD(t,e={}){let r=t.getReader();try{for(;;){let n=await r.read();if(n.done)return;yield n.value}}finally{e.preventCancel!==!0&&r.cancel(),r.releaseLock()}}vx.exports=eD});var Tx=Y((z7,Px)=>{"use strict";var tD=Ic(),{encodeCID:wx,decodeCID:xx,CID:kx}=Ps(),{decodeIterable:Ey,encodeIterable:Ha,encodeCallback:Ax}=bx(),Sy=_x(),Ex=class extends tD{constructor(e){super("core",["add","addAll","cat","ls"],e)}async*addAll(e,r={}){let{timeout:n,signal:o}=r,a=[...r.transfer||[]],u=r.progress?Ax(r.progress,a):void 0,c=await this.remote.addAll({...r,input:oD(e,a),progress:u,transfer:a,timeout:n,signal:o});yield*Ey(c.data,Sx)}async add(e,r={}){let{timeout:n,signal:o}=r,a=[...r.transfer||[]],u=r.progress?Ax(r.progress,a):void 0,c=await this.remote.add({...r,input:iD(e,a),progress:u,transfer:a,timeout:n,signal:o});return Sx(c.data)}async*cat(e,r={}){let n=kx.isCID(e)?wx(e):e,o=await this.remote.cat({...r,path:n});yield*Ey(o.data,nD)}async*ls(e,r={}){let n=kx.isCID(e)?wx(e):e,o=await this.remote.ls({...r,path:n});yield*Ey(o.data,rD)}},Sx=({path:t,cid:e,mode:r,mtime:n,size:o})=>({path:t,cid:xx(e),mode:r,mtime:n,size:o}),rD=({depth:t,name:e,path:r,size:n,cid:o,type:a,mode:u,mtime:c})=>({cid:xx(o),type:a,name:e,path:r,mode:u,mtime:c,size:n,depth:t}),nD=t=>t,iD=(t,e)=>{if(t instanceof Blob)return t;if(typeof t=="string")return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t;{let r=By(t);if(r)return Ha(r,Py,e);let n=Cy(t);if(n)return Ha(n,Lc,e);let o=Fy(t);if(o)return Ha(Sy(o),Lc,e);let a=Iy(t);if(a)return Ty(a,e);throw TypeError("Unexpected input: "+typeof t)}},oD=(t,e)=>{let r=By(t);if(r)return Ha(r,Py,e);let n=Cy(t);if(n)return Ha(n,Lc,e);let o=Fy(t);if(o)return Ha(Sy(o),Lc,e);throw TypeError("Unexpected input: "+typeof t)},Lc=(t,e)=>{if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t;if(t instanceof Blob)return{path:"",content:t};if(typeof t=="string")return{path:"",content:t};{let r=Iy(t);if(r)return Ty(r,e);throw TypeError("Unexpected input: "+typeof t)}},Py=(t,e)=>{if(typeof t=="number")throw TypeError("Iterable of numbers is not supported");if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t;if(t instanceof Blob)return{path:"",content:t};if(typeof t=="string")return{path:"",content:t};{let r=Iy(t);if(r)return Ty(r,e);throw TypeError("Unexpected input: "+typeof t)}},Ty=({path:t,mode:e,mtime:r,content:n},o)=>({path:t,mode:e,mtime:r,content:n?aD(n,o):void 0}),aD=(t,e)=>{if(t==null)return"";if(t instanceof ArrayBuffer||ArrayBuffer.isView(t))return t;if(t instanceof Blob)return t;if(typeof t=="string")return t;{let r=By(t);if(r)return Ha(r,Py,e);let n=Cy(t);if(n)return Ha(n,Lc,e);let o=Fy(t);if(o)return Ha(Sy(o),Lc,e);throw TypeError("Unexpected input: "+typeof t)}},By=t=>{let e=t;return e&&typeof e[Symbol.iterator]=="function"?e:null},Cy=t=>{let e=t;return e&&typeof e[Symbol.asyncIterator]=="function"?e:null},Fy=t=>t&&typeof t.getReader=="function"?t:null,Iy=t=>typeof t=="object"&&(t.path||t.content)?t:null;Px.exports=Ex});var Fx=Y((q7,Cx)=>{"use strict";var sD=Ic(),{decodeCID:uD,CID:cD}=Ps(),Bx=class extends sD{constructor(e){super("files",["stat"],e)}async stat(e,r={}){let{size:n,hash:o,withLocal:a,timeout:u,signal:c}=r,{stat:p}=await this.remote.stat({path:fD(e),size:n,hash:o,withLocal:a,timeout:u,signal:c});return lD(p)}};Cx.exports=Bx;var fD=t=>cD.isCID(t)?`/ipfs/${t.toString()}`:t,lD=t=>({...t,cid:uD(t.cid)})});var Rx=Y((H7,Dx)=>{"use strict";var hD=Ic(),{decodeCID:dD,CID:pD}=Ps(),Ix=class extends hD{constructor(e){super("pin",["add"],e)}async add(e,r={}){let{recursive:n,timeout:o,signal:a}=r,{cid:u}=await this.remote.add({path:mD(e),recursive:n,timeout:o,signal:a});return dD(u)}};Dx.exports=Ix;var mD=t=>pD.isCID(t)?`/ipfs/${t.toString()}`:`${t}`});var Lx=Y((j7,Ux)=>{"use strict";var Nx=I_(),yD=hx(),gD=gx(),bD=Tx(),vD=Fx(),_D=Rx(),cl=class extends bD{constructor(e){super(e);this.transport=e,this.block=new yD(this.transport),this.dag=new gD(this.transport),this.files=new vD(this.transport),this.pin=new _D(this.transport)}static attach(e,r){e.transport.connect(r)}static detached(){return new cl(new Nx(void 0))}static from(e){return new cl(new Nx(e))}};Ux.exports=cl});var zx=Y((W7,Kx)=>{"use strict";Kx.exports=xD;function xD(t,e){for(var r=new Array(arguments.length-1),n=0,o=2,a=!0;o<arguments.length;)r[n++]=arguments[o++];return new Promise(function(c,p){r[n]=function(y){if(a)if(a=!1,y)p(y);else{for(var w=new Array(arguments.length-1),F=0;F<w.length;)w[F++]=arguments[F];c.apply(null,w)}};try{t.apply(e||null,r)}catch(l){a&&(a=!1,p(l))}})}});var $x=Y(jx=>{"use strict";var Bd=jx;Bd.length=function(e){var r=e.length;if(!r)return 0;for(var n=0;--r%4>1&&e.charAt(r)==="=";)++n;return Math.ceil(e.length*3)/4-n};var Mc=new Array(64),qx=new Array(123);for(var ua=0;ua<64;)qx[Mc[ua]=ua<26?ua+65:ua<52?ua+71:ua<62?ua-4:ua-59|43]=ua++;Bd.encode=function(e,r,n){for(var o=null,a=[],u=0,c=0,p;r<n;){var l=e[r++];switch(c){case 0:a[u++]=Mc[l>>2],p=(l&3)<<4,c=1;break;case 1:a[u++]=Mc[p|l>>4],p=(l&15)<<2,c=2;break;case 2:a[u++]=Mc[p|l>>6],a[u++]=Mc[l&63],c=0;break}u>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),u=0)}return c&&(a[u++]=Mc[p],a[u++]=61,c===1&&(a[u++]=61)),o?(u&&o.push(String.fromCharCode.apply(String,a.slice(0,u))),o.join("")):String.fromCharCode.apply(String,a.slice(0,u))};var Hx="invalid encoding";Bd.decode=function(e,r,n){for(var o=n,a=0,u,c=0;c<e.length;){var p=e.charCodeAt(c++);if(p===61&&a>1)break;if((p=qx[p])===void 0)throw Error(Hx);switch(a){case 0:u=p,a=1;break;case 1:r[n++]=u<<2|(p&48)>>4,u=p,a=2;break;case 2:r[n++]=(u&15)<<4|(p&60)>>2,u=p,a=3;break;case 3:r[n++]=(u&3)<<6|p,a=0;break}}if(a===1)throw Error(Hx);return n-o};Bd.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var Wx=Y((V7,Gx)=>{"use strict";Gx.exports=Cd;function Cd(){this._listeners={}}Cd.prototype.on=function(e,r,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:r,ctx:n||this}),this};Cd.prototype.off=function(e,r){if(e===void 0)this._listeners={};else if(r===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],o=0;o<n.length;)n[o].fn===r?n.splice(o,1):++o;return this};Cd.prototype.emit=function(e){var r=this._listeners[e];if(r){for(var n=[],o=1;o<arguments.length;)n.push(arguments[o++]);for(o=0;o<r.length;)r[o].fn.apply(r[o++].ctx,n)}return this}});var e3=Y((J7,Qx)=>{"use strict";Qx.exports=Yx(Yx);function Yx(t){return typeof Float32Array!="undefined"?function(){var e=new Float32Array([-0]),r=new Uint8Array(e.buffer),n=r[3]===128;function o(p,l,y){e[0]=p,l[y]=r[0],l[y+1]=r[1],l[y+2]=r[2],l[y+3]=r[3]}function a(p,l,y){e[0]=p,l[y]=r[3],l[y+1]=r[2],l[y+2]=r[1],l[y+3]=r[0]}t.writeFloatLE=n?o:a,t.writeFloatBE=n?a:o;function u(p,l){return r[0]=p[l],r[1]=p[l+1],r[2]=p[l+2],r[3]=p[l+3],e[0]}function c(p,l){return r[3]=p[l],r[2]=p[l+1],r[1]=p[l+2],r[0]=p[l+3],e[0]}t.readFloatLE=n?u:c,t.readFloatBE=n?c:u}():function(){function e(n,o,a,u){var c=o<0?1:0;if(c&&(o=-o),o===0)n(1/o>0?0:2147483648,a,u);else if(isNaN(o))n(2143289344,a,u);else if(o>34028234663852886e22)n((c<<31|2139095040)>>>0,a,u);else if(o<11754943508222875e-54)n((c<<31|Math.round(o/1401298464324817e-60))>>>0,a,u);else{var p=Math.floor(Math.log(o)/Math.LN2),l=Math.round(o*Math.pow(2,-p)*8388608)&8388607;n((c<<31|p+127<<23|l)>>>0,a,u)}}t.writeFloatLE=e.bind(null,Vx),t.writeFloatBE=e.bind(null,Jx);function r(n,o,a){var u=n(o,a),c=(u>>31)*2+1,p=u>>>23&255,l=u&8388607;return p===255?l?NaN:c*Infinity:p===0?c*1401298464324817e-60*l:c*Math.pow(2,p-150)*(l+8388608)}t.readFloatLE=r.bind(null,Xx),t.readFloatBE=r.bind(null,Zx)}(),typeof Float64Array!="undefined"?function(){var e=new Float64Array([-0]),r=new Uint8Array(e.buffer),n=r[7]===128;function o(p,l,y){e[0]=p,l[y]=r[0],l[y+1]=r[1],l[y+2]=r[2],l[y+3]=r[3],l[y+4]=r[4],l[y+5]=r[5],l[y+6]=r[6],l[y+7]=r[7]}function a(p,l,y){e[0]=p,l[y]=r[7],l[y+1]=r[6],l[y+2]=r[5],l[y+3]=r[4],l[y+4]=r[3],l[y+5]=r[2],l[y+6]=r[1],l[y+7]=r[0]}t.writeDoubleLE=n?o:a,t.writeDoubleBE=n?a:o;function u(p,l){return r[0]=p[l],r[1]=p[l+1],r[2]=p[l+2],r[3]=p[l+3],r[4]=p[l+4],r[5]=p[l+5],r[6]=p[l+6],r[7]=p[l+7],e[0]}function c(p,l){return r[7]=p[l],r[6]=p[l+1],r[5]=p[l+2],r[4]=p[l+3],r[3]=p[l+4],r[2]=p[l+5],r[1]=p[l+6],r[0]=p[l+7],e[0]}t.readDoubleLE=n?u:c,t.readDoubleBE=n?c:u}():function(){function e(n,o,a,u,c,p){var l=u<0?1:0;if(l&&(u=-u),u===0)n(0,c,p+o),n(1/u>0?0:2147483648,c,p+a);else if(isNaN(u))n(0,c,p+o),n(2146959360,c,p+a);else if(u>17976931348623157e292)n(0,c,p+o),n((l<<31|2146435072)>>>0,c,p+a);else{var y;if(u<22250738585072014e-324)y=u/5e-324,n(y>>>0,c,p+o),n((l<<31|y/4294967296)>>>0,c,p+a);else{var w=Math.floor(Math.log(u)/Math.LN2);w===1024&&(w=1023),y=u*Math.pow(2,-w),n(y*4503599627370496>>>0,c,p+o),n((l<<31|w+1023<<20|y*1048576&1048575)>>>0,c,p+a)}}}t.writeDoubleLE=e.bind(null,Vx,0,4),t.writeDoubleBE=e.bind(null,Jx,4,0);function r(n,o,a,u,c){var p=n(u,c+o),l=n(u,c+a),y=(l>>31)*2+1,w=l>>>20&2047,F=4294967296*(l&1048575)+p;return w===2047?F?NaN:y*Infinity:w===0?y*5e-324*F:y*Math.pow(2,w-1075)*(F+4503599627370496)}t.readDoubleLE=r.bind(null,Xx,0,4),t.readDoubleBE=r.bind(null,Zx,4,0)}(),t}function Vx(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}function Jx(t,e,r){e[r]=t>>>24,e[r+1]=t>>>16&255,e[r+2]=t>>>8&255,e[r+3]=t&255}function Xx(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function Zx(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}});var t3=Y((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(t){}return null}});var n3=Y(r3=>{"use strict";var Dy=r3;Dy.length=function(e){for(var r=0,n=0,o=0;o<e.length;++o)n=e.charCodeAt(o),n<128?r+=1:n<2048?r+=2:(n&64512)==55296&&(e.charCodeAt(o+1)&64512)==56320?(++o,r+=4):r+=3;return r};Dy.read=function(e,r,n){var o=n-r;if(o<1)return"";for(var a=null,u=[],c=0,p;r<n;)p=e[r++],p<128?u[c++]=p:p>191&&p<224?u[c++]=(p&31)<<6|e[r++]&63:p>239&&p<365?(p=((p&7)<<18|(e[r++]&63)<<12|(e[r++]&63)<<6|e[r++]&63)-65536,u[c++]=55296+(p>>10),u[c++]=56320+(p&1023)):u[c++]=(p&15)<<12|(e[r++]&63)<<6|e[r++]&63,c>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,u)),c=0);return a?(c&&a.push(String.fromCharCode.apply(String,u.slice(0,c))),a.join("")):String.fromCharCode.apply(String,u.slice(0,c))};Dy.write=function(e,r,n){for(var o=n,a,u,c=0;c<e.length;++c)a=e.charCodeAt(c),a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=a&63|128):(a&64512)==55296&&((u=e.charCodeAt(c+1))&64512)==56320?(a=65536+((a&1023)<<10)+(u&1023),++c,r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=a&63|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=a&63|128);return n-o}});var o3=Y((Z7,i3)=>{"use strict";i3.exports=kD;function kD(t,e,r){var n=r||8192,o=n>>>1,a=null,u=n;return function(p){if(p<1||p>o)return t(p);u+p>n&&(a=t(n),u=0);var l=e.call(a,u,u+=p);return u&7&&(u=(u|7)+1),l}}});var s3=Y((Q7,a3)=>{"use strict";a3.exports=en;var fl=Bs();function en(t,e){this.lo=t>>>0,this.hi=e>>>0}var _u=en.zero=new en(0,0);_u.toNumber=function(){return 0};_u.zzEncode=_u.zzDecode=function(){return this};_u.length=function(){return 1};var AD=en.zeroHash="\0\0\0\0\0\0\0\0";en.fromNumber=function(e){if(e===0)return _u;var r=e<0;r&&(e=-e);var n=e>>>0,o=(e-n)/4294967296>>>0;return r&&(o=~o>>>0,n=~n>>>0,++n>4294967295&&(n=0,++o>4294967295&&(o=0))),new en(n,o)};en.from=function(e){if(typeof e=="number")return en.fromNumber(e);if(fl.isString(e))if(fl.Long)e=fl.Long.fromString(e);else return en.fromNumber(parseInt(e,10));return e.low||e.high?new en(e.low>>>0,e.high>>>0):_u};en.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var r=~this.lo+1>>>0,n=~this.hi>>>0;return r||(n=n+1>>>0),-(r+n*4294967296)}return this.lo+this.hi*4294967296};en.prototype.toLong=function(e){return fl.Long?new fl.Long(this.lo|0,this.hi|0,Boolean(e)):{low:this.lo|0,high:this.hi|0,unsigned:Boolean(e)}};var Ts=String.prototype.charCodeAt;en.fromHash=function(e){return e===AD?_u:new en((Ts.call(e,0)|Ts.call(e,1)<<8|Ts.call(e,2)<<16|Ts.call(e,3)<<24)>>>0,(Ts.call(e,4)|Ts.call(e,5)<<8|Ts.call(e,6)<<16|Ts.call(e,7)<<24)>>>0)};en.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};en.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};en.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};en.prototype.length=function(){var e=this.lo,r=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?r===0?e<16384?e<128?1:2:e<2097152?3:4:r<16384?r<128?5:6:r<2097152?7:8:n<128?9:10}});var Bs=Y(Ry=>{"use strict";var Ve=Ry;Ve.asPromise=zx();Ve.base64=$x();Ve.EventEmitter=Wx();Ve.float=e3();Ve.inquire=t3();Ve.utf8=n3();Ve.pool=o3();Ve.LongBits=s3();Ve.isNode=Boolean(typeof global!="undefined"&&global&&global.process&&global.process.versions&&global.process.versions.node);Ve.global=Ve.isNode&&global||typeof window!="undefined"&&window||typeof self!="undefined"&&self||Ry;Ve.emptyArray=Object.freeze?Object.freeze([]):[];Ve.emptyObject=Object.freeze?Object.freeze({}):{};Ve.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};Ve.isString=function(e){return typeof e=="string"||e instanceof String};Ve.isObject=function(e){return e&&typeof e=="object"};Ve.isset=Ve.isSet=function(e,r){var n=e[r];return n!=null&&e.hasOwnProperty(r)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};Ve.Buffer=function(){try{var t=Ve.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(e){return null}}();Ve._Buffer_from=null;Ve._Buffer_allocUnsafe=null;Ve.newBuffer=function(e){return typeof e=="number"?Ve.Buffer?Ve._Buffer_allocUnsafe(e):new Ve.Array(e):Ve.Buffer?Ve._Buffer_from(e):typeof Uint8Array=="undefined"?e:new Uint8Array(e)};Ve.Array=typeof Uint8Array!="undefined"?Uint8Array:Array;Ve.Long=Ve.global.dcodeIO&&Ve.global.dcodeIO.Long||Ve.global.Long||Ve.inquire("long");Ve.key2Re=/^true|false|0|1$/;Ve.key32Re=/^-?(?:0|[1-9][0-9]*)$/;Ve.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;Ve.longToHash=function(e){return e?Ve.LongBits.from(e).toHash():Ve.LongBits.zeroHash};Ve.longFromHash=function(e,r){var n=Ve.LongBits.fromHash(e);return Ve.Long?Ve.Long.fromBits(n.lo,n.hi,r):n.toNumber(Boolean(r))};function u3(t,e,r){for(var n=Object.keys(e),o=0;o<n.length;++o)(t[n[o]]===void 0||!r)&&(t[n[o]]=e[n[o]]);return t}Ve.merge=u3;Ve.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function c3(t){function e(r,n){if(!(this instanceof e))return new e(r,n);Object.defineProperty(this,"message",{get:function(){return r}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&u3(this,n)}return(e.prototype=Object.create(Error.prototype)).constructor=e,Object.defineProperty(e.prototype,"name",{get:function(){return t}}),e.prototype.toString=function(){return this.name+": "+this.message},e}Ve.newError=c3;Ve.ProtocolError=c3("ProtocolError");Ve.oneOfGetter=function(e){for(var r={},n=0;n<e.length;++n)r[e[n]]=1;return function(){for(var o=Object.keys(this),a=o.length-1;a>-1;--a)if(r[o[a]]===1&&this[o[a]]!==void 0&&this[o[a]]!==null)return o[a]}};Ve.oneOfSetter=function(e){return function(r){for(var n=0;n<e.length;++n)e[n]!==r&&delete this[e[n]]}};Ve.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};Ve._configure=function(){var t=Ve.Buffer;if(!t){Ve._Buffer_from=Ve._Buffer_allocUnsafe=null;return}Ve._Buffer_from=t.from!==Uint8Array.from&&t.from||function(r,n){return new t(r,n)},Ve._Buffer_allocUnsafe=t.allocUnsafe||function(r){return new t(r)}}});var zy=Y((t9,d3)=>{"use strict";d3.exports=Dt;var ji=Bs(),Ny,Fd=ji.LongBits,f3=ji.base64,l3=ji.utf8;function ll(t,e,r){this.fn=t,this.len=e,this.next=void 0,this.val=r}function Uy(){}function ED(t){this.head=t.head,this.tail=t.tail,this.len=t.len,this.next=t.states}function Dt(){this.len=0,this.head=new ll(Uy,0,0),this.tail=this.head,this.states=null}var h3=function(){return ji.Buffer?function(){return(Dt.create=function(){return new Ny})()}:function(){return new Dt}};Dt.create=h3();Dt.alloc=function(e){return new ji.Array(e)};ji.Array!==Array&&(Dt.alloc=ji.pool(Dt.alloc,ji.Array.prototype.subarray));Dt.prototype._push=function(e,r,n){return this.tail=this.tail.next=new ll(e,r,n),this.len+=r,this};function Ly(t,e,r){e[r]=t&255}function SD(t,e,r){for(;t>127;)e[r++]=t&127|128,t>>>=7;e[r]=t}function My(t,e){this.len=t,this.next=void 0,this.val=e}My.prototype=Object.create(ll.prototype);My.prototype.fn=SD;Dt.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new My((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};Dt.prototype.int32=function(e){return e<0?this._push(Oy,10,Fd.fromNumber(e)):this.uint32(e)};Dt.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function Oy(t,e,r){for(;t.hi;)e[r++]=t.lo&127|128,t.lo=(t.lo>>>7|t.hi<<25)>>>0,t.hi>>>=7;for(;t.lo>127;)e[r++]=t.lo&127|128,t.lo=t.lo>>>7;e[r++]=t.lo}Dt.prototype.uint64=function(e){var r=Fd.from(e);return this._push(Oy,r.length(),r)};Dt.prototype.int64=Dt.prototype.uint64;Dt.prototype.sint64=function(e){var r=Fd.from(e).zzEncode();return this._push(Oy,r.length(),r)};Dt.prototype.bool=function(e){return this._push(Ly,1,e?1:0)};function Ky(t,e,r){e[r]=t&255,e[r+1]=t>>>8&255,e[r+2]=t>>>16&255,e[r+3]=t>>>24}Dt.prototype.fixed32=function(e){return this._push(Ky,4,e>>>0)};Dt.prototype.sfixed32=Dt.prototype.fixed32;Dt.prototype.fixed64=function(e){var r=Fd.from(e);return this._push(Ky,4,r.lo)._push(Ky,4,r.hi)};Dt.prototype.sfixed64=Dt.prototype.fixed64;Dt.prototype.float=function(e){return this._push(ji.float.writeFloatLE,4,e)};Dt.prototype.double=function(e){return this._push(ji.float.writeDoubleLE,8,e)};var PD=ji.Array.prototype.set?function(e,r,n){r.set(e,n)}:function(e,r,n){for(var o=0;o<e.length;++o)r[n+o]=e[o]};Dt.prototype.bytes=function(e){var r=e.length>>>0;if(!r)return this._push(Ly,1,0);if(ji.isString(e)){var n=Dt.alloc(r=f3.length(e));f3.decode(e,n,0),e=n}return this.uint32(r)._push(PD,r,e)};Dt.prototype.string=function(e){var r=l3.length(e);return r?this.uint32(r)._push(l3.write,r,e):this._push(Ly,1,0)};Dt.prototype.fork=function(){return this.states=new ED(this),this.head=this.tail=new ll(Uy,0,0),this.len=0,this};Dt.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new ll(Uy,0,0),this.len=0),this};Dt.prototype.ldelim=function(){var e=this.head,r=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=r,this.len+=n),this};Dt.prototype.finish=function(){for(var e=this.head.next,r=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,r,n),n+=e.len,e=e.next;return r};Dt._configure=function(t){Ny=t,Dt.create=h3(),Ny._configure()}});var y3=Y((r9,m3)=>{"use strict";m3.exports=ca;var p3=zy();(ca.prototype=Object.create(p3.prototype)).constructor=ca;var Cs=Bs();function ca(){p3.call(this)}ca._configure=function(){ca.alloc=Cs._Buffer_allocUnsafe,ca.writeBytesBuffer=Cs.Buffer&&Cs.Buffer.prototype instanceof Uint8Array&&Cs.Buffer.prototype.set.name==="set"?function(e,r,n){r.set(e,n)}:function(e,r,n){if(e.copy)e.copy(r,n,0,e.length);else for(var o=0;o<e.length;)r[n++]=e[o++]}};ca.prototype.bytes=function(e){Cs.isString(e)&&(e=Cs._Buffer_from(e,"base64"));var r=e.length>>>0;return this.uint32(r),r&&this._push(ca.writeBytesBuffer,r,e),this};function TD(t,e,r){t.length<40?Cs.utf8.write(t,e,r):e.utf8Write?e.utf8Write(t,r):e.write(t,r)}ca.prototype.string=function(e){var r=Cs.Buffer.byteLength(e);return this.uint32(r),r&&this._push(TD,r,e),this};ca._configure()});var jy=Y((n9,w3)=>{"use strict";w3.exports=Lr;var fa=Bs(),qy,g3=fa.LongBits,BD=fa.utf8;function ko(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Lr(t){this.buf=t,this.pos=0,this.len=t.length}var b3=typeof Uint8Array!="undefined"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new Lr(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new Lr(e);throw Error("illegal buffer")},v3=function(){return fa.Buffer?function(r){return(Lr.create=function(o){return fa.Buffer.isBuffer(o)?new qy(o):b3(o)})(r)}:b3};Lr.create=v3();Lr.prototype._slice=fa.Array.prototype.subarray||fa.Array.prototype.slice;Lr.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,ko(this,10);return e}}();Lr.prototype.int32=function(){return this.uint32()|0};Lr.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function Hy(){var t=new g3(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(this.buf[this.pos]&127)<<28)>>>0,t.hi=(t.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw ko(this);if(t.lo=(t.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw ko(this);if(t.hi=(t.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}Lr.prototype.bool=function(){return this.uint32()!==0};function Id(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}Lr.prototype.fixed32=function(){if(this.pos+4>this.len)throw ko(this,4);return Id(this.buf,this.pos+=4)};Lr.prototype.sfixed32=function(){if(this.pos+4>this.len)throw ko(this,4);return Id(this.buf,this.pos+=4)|0};function _3(){if(this.pos+8>this.len)throw ko(this,8);return new g3(Id(this.buf,this.pos+=4),Id(this.buf,this.pos+=4))}Lr.prototype.float=function(){if(this.pos+4>this.len)throw ko(this,4);var e=fa.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};Lr.prototype.double=function(){if(this.pos+8>this.len)throw ko(this,4);var e=fa.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};Lr.prototype.bytes=function(){var e=this.uint32(),r=this.pos,n=this.pos+e;if(n>this.len)throw ko(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(r,n):r===n?new this.buf.constructor(0):this._slice.call(this.buf,r,n)};Lr.prototype.string=function(){var e=this.bytes();return BD.read(e,0,e.length)};Lr.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw ko(this,e);this.pos+=e}else do if(this.pos>=this.len)throw ko(this);while(this.buf[this.pos++]&128);return this};Lr.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(t=this.uint32()&7)!=4;)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this};Lr._configure=function(t){qy=t,Lr.create=v3(),qy._configure();var e=fa.Long?"toLong":"toNumber";fa.merge(Lr.prototype,{int64:function(){return Hy.call(this)[e](!1)},uint64:function(){return Hy.call(this)[e](!0)},sint64:function(){return Hy.call(this).zzDecode()[e](!1)},fixed64:function(){return _3.call(this)[e](!0)},sfixed64:function(){return _3.call(this)[e](!1)}})}});var E3=Y((i9,A3)=>{"use strict";A3.exports=wu;var x3=jy();(wu.prototype=Object.create(x3.prototype)).constructor=wu;var k3=Bs();function wu(t){x3.call(this,t)}wu._configure=function(){k3.Buffer&&(wu.prototype._slice=k3.Buffer.prototype.slice)};wu.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};wu._configure()});var P3=Y((o9,S3)=>{"use strict";S3.exports=hl;var $y=Bs();(hl.prototype=Object.create($y.EventEmitter.prototype)).constructor=hl;function hl(t,e,r){if(typeof t!="function")throw TypeError("rpcImpl must be a function");$y.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=Boolean(e),this.responseDelimited=Boolean(r)}hl.prototype.rpcCall=function t(e,r,n,o,a){if(!o)throw TypeError("request must be specified");var u=this;if(!a)return $y.asPromise(t,u,e,r,n,o);if(!u.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return u.rpcImpl(e,r[u.requestDelimited?"encodeDelimited":"encode"](o).finish(),function(p,l){if(p)return u.emit("error",p,e),a(p);if(l===null){u.end(!0);return}if(!(l instanceof n))try{l=n[u.responseDelimited?"decodeDelimited":"decode"](l)}catch(y){return u.emit("error",y,e),a(y)}return u.emit("data",l,e),a(null,l)})}catch(c){u.emit("error",c,e),setTimeout(function(){a(c)},0);return}};hl.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var B3=Y(T3=>{"use strict";var CD=T3;CD.Service=P3()});var F3=Y((s9,C3)=>{"use strict";C3.exports={}});var R3=Y(D3=>{"use strict";var Yn=D3;Yn.build="minimal";Yn.Writer=zy();Yn.BufferWriter=y3();Yn.Reader=jy();Yn.BufferReader=E3();Yn.util=Bs();Yn.rpc=B3();Yn.roots=F3();Yn.configure=I3;function I3(){Yn.util._configure(),Yn.Writer._configure(Yn.BufferWriter),Yn.Reader._configure(Yn.BufferReader)}I3()});var Gy=Y((c9,N3)=>{"use strict";N3.exports=R3()});var Wy=Y((f9,L3)=>{"use strict";var xu=Gy(),Dd=xu.Reader,U3=xu.Writer,Br=xu.util,fi=xu.roots.default||(xu.roots.default={});fi.PBLink=function(){function t(e){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)e[r[n]]!=null&&(this[r[n]]=e[r[n]])}return t.prototype.Hash=Br.newBuffer([]),t.prototype.Name="",t.prototype.Tsize=Br.Long?Br.Long.fromBits(0,0,!0):0,t.encode=function(r,n){return n||(n=U3.create()),r.Hash!=null&&Object.hasOwnProperty.call(r,"Hash")&&n.uint32(10).bytes(r.Hash),r.Name!=null&&Object.hasOwnProperty.call(r,"Name")&&n.uint32(18).string(r.Name),r.Tsize!=null&&Object.hasOwnProperty.call(r,"Tsize")&&n.uint32(24).uint64(r.Tsize),n},t.decode=function(r,n){r instanceof Dd||(r=Dd.create(r));for(var o=n===void 0?r.len:r.pos+n,a=new fi.PBLink;r.pos<o;){var u=r.uint32();switch(u>>>3){case 1:a.Hash=r.bytes();break;case 2:a.Name=r.string();break;case 3:a.Tsize=r.uint64();break;default:r.skipType(u&7);break}}return a},t.fromObject=function(r){if(r instanceof fi.PBLink)return r;var n=new fi.PBLink;return r.Hash!=null&&(typeof r.Hash=="string"?Br.base64.decode(r.Hash,n.Hash=Br.newBuffer(Br.base64.length(r.Hash)),0):r.Hash.length&&(n.Hash=r.Hash)),r.Name!=null&&(n.Name=String(r.Name)),r.Tsize!=null&&(Br.Long?(n.Tsize=Br.Long.fromValue(r.Tsize)).unsigned=!0:typeof r.Tsize=="string"?n.Tsize=parseInt(r.Tsize,10):typeof r.Tsize=="number"?n.Tsize=r.Tsize:typeof r.Tsize=="object"&&(n.Tsize=new Br.LongBits(r.Tsize.low>>>0,r.Tsize.high>>>0).toNumber(!0))),n},t.toObject=function(r,n){n||(n={});var o={};if(n.defaults)if(n.bytes===String?o.Hash="":(o.Hash=[],n.bytes!==Array&&(o.Hash=Br.newBuffer(o.Hash))),o.Name="",Br.Long){var a=new Br.Long(0,0,!0);o.Tsize=n.longs===String?a.toString():n.longs===Number?a.toNumber():a}else o.Tsize=n.longs===String?"0":0;return r.Hash!=null&&r.hasOwnProperty("Hash")&&(o.Hash=n.bytes===String?Br.base64.encode(r.Hash,0,r.Hash.length):n.bytes===Array?Array.prototype.slice.call(r.Hash):r.Hash),r.Name!=null&&r.hasOwnProperty("Name")&&(o.Name=r.Name),r.Tsize!=null&&r.hasOwnProperty("Tsize")&&(typeof r.Tsize=="number"?o.Tsize=n.longs===String?String(r.Tsize):r.Tsize:o.Tsize=n.longs===String?Br.Long.prototype.toString.call(r.Tsize):n.longs===Number?new Br.LongBits(r.Tsize.low>>>0,r.Tsize.high>>>0).toNumber(!0):r.Tsize),o},t.prototype.toJSON=function(){return this.constructor.toObject(this,xu.util.toJSONOptions)},t}();fi.PBNode=function(){function t(e){if(this.Links=[],e)for(var r=Object.keys(e),n=0;n<r.length;++n)e[r[n]]!=null&&(this[r[n]]=e[r[n]])}return t.prototype.Links=Br.emptyArray,t.prototype.Data=Br.newBuffer([]),t.encode=function(r,n){if(n||(n=U3.create()),r.Data!=null&&Object.hasOwnProperty.call(r,"Data")&&n.uint32(10).bytes(r.Data),r.Links!=null&&r.Links.length)for(var o=0;o<r.Links.length;++o)fi.PBLink.encode(r.Links[o],n.uint32(18).fork()).ldelim();return n},t.decode=function(r,n){r instanceof Dd||(r=Dd.create(r));for(var o=n===void 0?r.len:r.pos+n,a=new fi.PBNode;r.pos<o;){var u=r.uint32();switch(u>>>3){case 2:a.Links&&a.Links.length||(a.Links=[]),a.Links.push(fi.PBLink.decode(r,r.uint32()));break;case 1:a.Data=r.bytes();break;default:r.skipType(u&7);break}}return a},t.fromObject=function(r){if(r instanceof fi.PBNode)return r;var n=new fi.PBNode;if(r.Links){if(!Array.isArray(r.Links))throw TypeError(".PBNode.Links: array expected");n.Links=[];for(var o=0;o<r.Links.length;++o){if(typeof r.Links[o]!="object")throw TypeError(".PBNode.Links: object expected");n.Links[o]=fi.PBLink.fromObject(r.Links[o])}}return r.Data!=null&&(typeof r.Data=="string"?Br.base64.decode(r.Data,n.Data=Br.newBuffer(Br.base64.length(r.Data)),0):r.Data.length&&(n.Data=r.Data)),n},t.toObject=function(r,n){n||(n={});var o={};if((n.arrays||n.defaults)&&(o.Links=[]),n.defaults&&(n.bytes===String?o.Data="":(o.Data=[],n.bytes!==Array&&(o.Data=Br.newBuffer(o.Data)))),r.Data!=null&&r.hasOwnProperty("Data")&&(o.Data=n.bytes===String?Br.base64.encode(r.Data,0,r.Data.length):n.bytes===Array?Array.prototype.slice.call(r.Data):r.Data),r.Links&&r.Links.length){o.Links=[];for(var a=0;a<r.Links.length;++a)o.Links[a]=fi.PBLink.toObject(r.Links[a],n)}return o},t.prototype.toJSON=function(){return this.constructor.toObject(this,xu.util.toJSONOptions)},t}();L3.exports=fi});var ku=Y((l9,O3)=>{"use strict";var FD=Ss(),ID=Rc(),M3=class{constructor(e,r,n){if(!n)throw new Error("A link requires a cid to point to");this.Name=e||"",this.Tsize=r,this.Hash=new FD(n),Object.defineProperties(this,{_nameBuf:{value:null,writable:!0,enumerable:!1}})}toString(){return`DAGLink <${this.Hash.toBaseEncodedString()} - name: "${this.Name}", size: ${this.Tsize}>`}toJSON(){return this._json||(this._json=Object.freeze({name:this.Name,size:this.Tsize,cid:this.Hash.toBaseEncodedString()})),Object.assign({},this._json)}get nameAsBuffer(){return this._nameBuf!=null?this._nameBuf:(this._nameBuf=ID(this.Name),this._nameBuf)}};O3.exports=M3});var K3=Y((Yy,Vy)=>{(function(t,e){typeof Yy=="object"&&typeof Vy!="undefined"?Vy.exports=e():typeof define=="function"&&define.amd?define(e):t.stable=e()})(Yy,function(){"use strict";var t=function(n,o){return e(n.slice(),o)};t.inplace=function(n,o){var a=e(n,o);return a!==n&&r(a,null,n.length,n),n};function e(n,o){typeof o!="function"&&(o=function(l,y){return String(l).localeCompare(y)});var a=n.length;if(a<=1)return n;for(var u=new Array(a),c=1;c<a;c*=2){r(n,o,c,u);var p=n;n=u,u=p}return n}var r=function(n,o,a,u){var c=n.length,p=0,l=a*2,y,w,F,_,U;for(y=0;y<c;y+=l)for(w=y+a,F=w+a,w>c&&(w=c),F>c&&(F=c),_=y,U=w;;)if(_<w&&U<F)o(n[_],n[U])<=0?u[p++]=n[_++]:u[p++]=n[U++];else if(_<w)u[p++]=n[_++];else if(U<F)u[p++]=n[U++];else break};return t})});var q3=Y((h9,z3)=>{"use strict";function DD(t,e){for(let r=0;r<t.byteLength;r++){if(t[r]<e[r])return-1;if(t[r]>e[r])return 1}return t.byteLength>e.byteLength?1:t.byteLength<e.byteLength?-1:0}z3.exports=DD});var Jy=Y((d9,H3)=>{"use strict";var RD=K3(),ND=q3(),UD=(t,e)=>{let r=t.nameAsBuffer,n=e.nameAsBuffer;return ND(r,n)},LD=t=>{RD.inplace(t,UD)};H3.exports=LD});var Xy=Y((p9,j3)=>{"use strict";var MD=ku();function OD(t){return new MD(t.Name||t.name||"",t.Tsize||t.Size||t.size||0,t.Hash||t.hash||t.multihash||t.cid)}j3.exports={createDagLinkFromB58EncodedHash:OD}});var Zy=Y((m9,W3)=>{"use strict";var KD=Gy(),{PBLink:zD}=Wy(),{createDagLinkFromB58EncodedHash:qD}=Xy(),$3=t=>{let e={};return t.Data&&t.Data.byteLength>0?e.Data=t.Data:e.Data=null,t.Links&&t.Links.length>0?e.Links=t.Links.map(r=>({Hash:r.Hash.bytes,Name:r.Name,Tsize:r.Tsize})):e.Links=null,e},HD=t=>G3($3(t)),jD=(t,e=[])=>{let r={Data:t,Links:e.map(n=>qD(n))};return G3($3(r))};W3.exports={serializeDAGNode:HD,serializeDAGNodeLike:jD};function G3(t){let e=KD.Writer.create();if(t.Links!=null)for(let r=0;r<t.Links.length;r++)zD.encode(t.Links[r],e.uint32(18).fork()).ldelim();return t.Data!=null&&e.uint32(10).bytes(t.Data),e.finish()}});var J3=Y((y9,V3)=>{"use strict";function Y3(t,e){for(let r in e)Object.defineProperty(t,r,{value:e[r],enumerable:!0,configurable:!0});return t}function $D(t,e,r){if(!t||typeof t=="string")throw new TypeError("Please pass an Error to err-code");r||(r={}),typeof e=="object"&&(r=e,e=""),e&&(r.code=e);try{return Y3(t,r)}catch(n){r.message=t.message,r.stack=t.stack;let o=function(){};return o.prototype=Object.create(Object.getPrototypeOf(t)),Y3(new o,r)}}V3.exports=$D});var X3=Y((g9,Rd)=>{(function(){"use strict";var t="input is invalid type",e="finalize already called",r=typeof window=="object",n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var o=!r&&typeof self=="object",a=!n.JS_SHA3_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;a?n=global:o&&(n=self);var u=!n.JS_SHA3_NO_COMMON_JS&&typeof Rd=="object"&&Rd.exports,c=typeof define=="function"&&define.amd,p=!n.JS_SHA3_NO_ARRAY_BUFFER&&typeof ArrayBuffer!="undefined",l="0123456789abcdef".split(""),y=[31,7936,2031616,520093696],w=[4,1024,262144,67108864],F=[1,256,65536,16777216],_=[6,1536,393216,100663296],U=[0,8,16,24],V=[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],Se=[224,256,384,512],Q=[128,256],ue=["hex","buffer","arrayBuffer","array","digest"],J={"128":168,"256":136};(n.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(k){return Object.prototype.toString.call(k)==="[object Array]"}),p&&(n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(k){return typeof k=="object"&&k.buffer&&k.buffer.constructor===ArrayBuffer});for(var ye=function(k,ce,de){return function(Be){return new dt(k,ce,k).update(Be)[de]()}},Fe=function(k,ce,de){return function(Be,De){return new dt(k,ce,De).update(Be)[de]()}},Z=function(k,ce,de){return function(Be,De,$e,We){return Bt["cshake"+k].update(Be,De,$e,We)[de]()}},re=function(k,ce,de){return function(Be,De,$e,We){return Bt["kmac"+k].update(Be,De,$e,We)[de]()}},Ce=function(k,ce,de,Be){for(var De=0;De<ue.length;++De){var $e=ue[De];k[$e]=ce(de,Be,$e)}return k},et=function(k,ce){var de=ye(k,ce,"hex");return de.create=function(){return new dt(k,ce,k)},de.update=function(Be){return de.create().update(Be)},Ce(de,ye,k,ce)},ct=function(k,ce){var de=Fe(k,ce,"hex");return de.create=function(Be){return new dt(k,ce,Be)},de.update=function(Be,De){return de.create(De).update(Be)},Ce(de,Fe,k,ce)},vt=function(k,ce){var de=J[k],Be=Z(k,ce,"hex");return Be.create=function(De,$e,We){return!$e&&!We?Bt["shake"+k].create(De):new dt(k,ce,De).bytepad([$e,We],de)},Be.update=function(De,$e,We,Oe){return Be.create($e,We,Oe).update(De)},Ce(Be,Z,k,ce)},ht=function(k,ce){var de=J[k],Be=re(k,ce,"hex");return Be.create=function(De,$e,We){return new Nt(k,ce,$e).bytepad(["KMAC",We],de).bytepad([De],de)},Be.update=function(De,$e,We,Oe){return Be.create(De,We,Oe).update($e)},Ce(Be,re,k,ce)},He=[{name:"keccak",padding:F,bits:Se,createMethod:et},{name:"sha3",padding:_,bits:Se,createMethod:et},{name:"shake",padding:y,bits:Q,createMethod:ct},{name:"cshake",padding:w,bits:Q,createMethod:vt},{name:"kmac",padding:w,bits:Q,createMethod:ht}],Bt={},Rt=[],ir=0;ir<He.length;++ir)for(var Wr=He[ir],vr=Wr.bits,fr=0;fr<vr.length;++fr){var Zn=Wr.name+"_"+vr[fr];if(Rt.push(Zn),Bt[Zn]=Wr.createMethod(vr[fr],Wr.padding),Wr.name!=="sha3"){var Gt=Wr.name+vr[fr];Rt.push(Gt),Bt[Gt]=Bt[Zn]}}function dt(k,ce,de){this.blocks=[],this.s=[],this.padding=ce,this.outputBits=de,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(k<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=de>>5,this.extraBytes=(de&31)>>3;for(var Be=0;Be<50;++Be)this.s[Be]=0}dt.prototype.update=function(k){if(this.finalized)throw new Error(e);var ce,de=typeof k;if(de!=="string"){if(de==="object"){if(k===null)throw new Error(t);if(p&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!p||!ArrayBuffer.isView(k)))throw new Error(t)}else throw new Error(t);ce=!0}for(var Be=this.blocks,De=this.byteCount,$e=k.length,We=this.blockCount,Oe=0,Ut=this.s,Xe,mt;Oe<$e;){if(this.reset)for(this.reset=!1,Be[0]=this.block,Xe=1;Xe<We+1;++Xe)Be[Xe]=0;if(ce)for(Xe=this.start;Oe<$e&&Xe<De;++Oe)Be[Xe>>2]|=k[Oe]<<U[Xe++&3];else for(Xe=this.start;Oe<$e&&Xe<De;++Oe)mt=k.charCodeAt(Oe),mt<128?Be[Xe>>2]|=mt<<U[Xe++&3]:mt<2048?(Be[Xe>>2]|=(192|mt>>6)<<U[Xe++&3],Be[Xe>>2]|=(128|mt&63)<<U[Xe++&3]):mt<55296||mt>=57344?(Be[Xe>>2]|=(224|mt>>12)<<U[Xe++&3],Be[Xe>>2]|=(128|mt>>6&63)<<U[Xe++&3],Be[Xe>>2]|=(128|mt&63)<<U[Xe++&3]):(mt=65536+((mt&1023)<<10|k.charCodeAt(++Oe)&1023),Be[Xe>>2]|=(240|mt>>18)<<U[Xe++&3],Be[Xe>>2]|=(128|mt>>12&63)<<U[Xe++&3],Be[Xe>>2]|=(128|mt>>6&63)<<U[Xe++&3],Be[Xe>>2]|=(128|mt&63)<<U[Xe++&3]);if(this.lastByteIndex=Xe,Xe>=De){for(this.start=Xe-De,this.block=Be[We],Xe=0;Xe<We;++Xe)Ut[Xe]^=Be[Xe];Ct(Ut),this.reset=!0}else this.start=Xe}return this},dt.prototype.encode=function(k,ce){var de=k&255,Be=1,De=[de];for(k=k>>8,de=k&255;de>0;)De.unshift(de),k=k>>8,de=k&255,++Be;return ce?De.push(Be):De.unshift(Be),this.update(De),De.length},dt.prototype.encodeString=function(k){var ce,de=typeof k;if(de!=="string"){if(de==="object"){if(k===null)throw new Error(t);if(p&&k.constructor===ArrayBuffer)k=new Uint8Array(k);else if(!Array.isArray(k)&&(!p||!ArrayBuffer.isView(k)))throw new Error(t)}else throw new Error(t);ce=!0}var Be=0,De=k.length;if(ce)Be=De;else for(var $e=0;$e<k.length;++$e){var We=k.charCodeAt($e);We<128?Be+=1:We<2048?Be+=2:We<55296||We>=57344?Be+=3:(We=65536+((We&1023)<<10|k.charCodeAt(++$e)&1023),Be+=4)}return Be+=this.encode(Be*8),this.update(k),Be},dt.prototype.bytepad=function(k,ce){for(var de=this.encode(ce),Be=0;Be<k.length;++Be)de+=this.encodeString(k[Be]);var De=ce-de%ce,$e=[];return $e.length=De,this.update($e),this},dt.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var k=this.blocks,ce=this.lastByteIndex,de=this.blockCount,Be=this.s;if(k[ce>>2]|=this.padding[ce&3],this.lastByteIndex===this.byteCount)for(k[0]=k[de],ce=1;ce<de+1;++ce)k[ce]=0;for(k[de-1]|=2147483648,ce=0;ce<de;++ce)Be[ce]^=k[ce];Ct(Be)}},dt.prototype.toString=dt.prototype.hex=function(){this.finalize();for(var k=this.blockCount,ce=this.s,de=this.outputBlocks,Be=this.extraBytes,De=0,$e=0,We="",Oe;$e<de;){for(De=0;De<k&&$e<de;++De,++$e)Oe=ce[De],We+=l[Oe>>4&15]+l[Oe&15]+l[Oe>>12&15]+l[Oe>>8&15]+l[Oe>>20&15]+l[Oe>>16&15]+l[Oe>>28&15]+l[Oe>>24&15];$e%k==0&&(Ct(ce),De=0)}return Be&&(Oe=ce[De],We+=l[Oe>>4&15]+l[Oe&15],Be>1&&(We+=l[Oe>>12&15]+l[Oe>>8&15]),Be>2&&(We+=l[Oe>>20&15]+l[Oe>>16&15])),We},dt.prototype.arrayBuffer=function(){this.finalize();var k=this.blockCount,ce=this.s,de=this.outputBlocks,Be=this.extraBytes,De=0,$e=0,We=this.outputBits>>3,Oe;Be?Oe=new ArrayBuffer(de+1<<2):Oe=new ArrayBuffer(We);for(var Ut=new Uint32Array(Oe);$e<de;){for(De=0;De<k&&$e<de;++De,++$e)Ut[$e]=ce[De];$e%k==0&&Ct(ce)}return Be&&(Ut[De]=ce[De],Oe=Oe.slice(0,We)),Oe},dt.prototype.buffer=dt.prototype.arrayBuffer,dt.prototype.digest=dt.prototype.array=function(){this.finalize();for(var k=this.blockCount,ce=this.s,de=this.outputBlocks,Be=this.extraBytes,De=0,$e=0,We=[],Oe,Ut;$e<de;){for(De=0;De<k&&$e<de;++De,++$e)Oe=$e<<2,Ut=ce[De],We[Oe]=Ut&255,We[Oe+1]=Ut>>8&255,We[Oe+2]=Ut>>16&255,We[Oe+3]=Ut>>24&255;$e%k==0&&Ct(ce)}return Be&&(Oe=$e<<2,Ut=ce[De],We[Oe]=Ut&255,Be>1&&(We[Oe+1]=Ut>>8&255),Be>2&&(We[Oe+2]=Ut>>16&255)),We};function Nt(k,ce,de){dt.call(this,k,ce,de)}Nt.prototype=new dt,Nt.prototype.finalize=function(){return this.encode(this.outputBits,!0),dt.prototype.finalize.call(this)};var Ct=function(k){var ce,de,Be,De,$e,We,Oe,Ut,Xe,mt,Cr,Ai,Yr,ar,Or,hr,fe,Kr,G,te,me,Ie,Ke,jt,Ze,Qe,Ue,at,st,Qt,Mn,Qi,Ei,Si,Pi,nn,No,Uo,eo,Ti,to,Lo,Mo,Bi,Oo,Ci,sr,_r,Qn,On,ro,no,io,Ko,oo,zo,qo,ei,Ho,jo,ao,pn,$o;for(Be=0;Be<48;Be+=2)De=k[0]^k[10]^k[20]^k[30]^k[40],$e=k[1]^k[11]^k[21]^k[31]^k[41],We=k[2]^k[12]^k[22]^k[32]^k[42],Oe=k[3]^k[13]^k[23]^k[33]^k[43],Ut=k[4]^k[14]^k[24]^k[34]^k[44],Xe=k[5]^k[15]^k[25]^k[35]^k[45],mt=k[6]^k[16]^k[26]^k[36]^k[46],Cr=k[7]^k[17]^k[27]^k[37]^k[47],Ai=k[8]^k[18]^k[28]^k[38]^k[48],Yr=k[9]^k[19]^k[29]^k[39]^k[49],ce=Ai^(We<<1|Oe>>>31),de=Yr^(Oe<<1|We>>>31),k[0]^=ce,k[1]^=de,k[10]^=ce,k[11]^=de,k[20]^=ce,k[21]^=de,k[30]^=ce,k[31]^=de,k[40]^=ce,k[41]^=de,ce=De^(Ut<<1|Xe>>>31),de=$e^(Xe<<1|Ut>>>31),k[2]^=ce,k[3]^=de,k[12]^=ce,k[13]^=de,k[22]^=ce,k[23]^=de,k[32]^=ce,k[33]^=de,k[42]^=ce,k[43]^=de,ce=We^(mt<<1|Cr>>>31),de=Oe^(Cr<<1|mt>>>31),k[4]^=ce,k[5]^=de,k[14]^=ce,k[15]^=de,k[24]^=ce,k[25]^=de,k[34]^=ce,k[35]^=de,k[44]^=ce,k[45]^=de,ce=Ut^(Ai<<1|Yr>>>31),de=Xe^(Yr<<1|Ai>>>31),k[6]^=ce,k[7]^=de,k[16]^=ce,k[17]^=de,k[26]^=ce,k[27]^=de,k[36]^=ce,k[37]^=de,k[46]^=ce,k[47]^=de,ce=mt^(De<<1|$e>>>31),de=Cr^($e<<1|De>>>31),k[8]^=ce,k[9]^=de,k[18]^=ce,k[19]^=de,k[28]^=ce,k[29]^=de,k[38]^=ce,k[39]^=de,k[48]^=ce,k[49]^=de,ar=k[0],Or=k[1],Ci=k[11]<<4|k[10]>>>28,sr=k[10]<<4|k[11]>>>28,at=k[20]<<3|k[21]>>>29,st=k[21]<<3|k[20]>>>29,jo=k[31]<<9|k[30]>>>23,ao=k[30]<<9|k[31]>>>23,Lo=k[40]<<18|k[41]>>>14,Mo=k[41]<<18|k[40]>>>14,Si=k[2]<<1|k[3]>>>31,Pi=k[3]<<1|k[2]>>>31,hr=k[13]<<12|k[12]>>>20,fe=k[12]<<12|k[13]>>>20,_r=k[22]<<10|k[23]>>>22,Qn=k[23]<<10|k[22]>>>22,Qt=k[33]<<13|k[32]>>>19,Mn=k[32]<<13|k[33]>>>19,pn=k[42]<<2|k[43]>>>30,$o=k[43]<<2|k[42]>>>30,Ko=k[5]<<30|k[4]>>>2,oo=k[4]<<30|k[5]>>>2,nn=k[14]<<6|k[15]>>>26,No=k[15]<<6|k[14]>>>26,Kr=k[25]<<11|k[24]>>>21,G=k[24]<<11|k[25]>>>21,On=k[34]<<15|k[35]>>>17,ro=k[35]<<15|k[34]>>>17,Qi=k[45]<<29|k[44]>>>3,Ei=k[44]<<29|k[45]>>>3,jt=k[6]<<28|k[7]>>>4,Ze=k[7]<<28|k[6]>>>4,zo=k[17]<<23|k[16]>>>9,qo=k[16]<<23|k[17]>>>9,Uo=k[26]<<25|k[27]>>>7,eo=k[27]<<25|k[26]>>>7,te=k[36]<<21|k[37]>>>11,me=k[37]<<21|k[36]>>>11,no=k[47]<<24|k[46]>>>8,io=k[46]<<24|k[47]>>>8,Bi=k[8]<<27|k[9]>>>5,Oo=k[9]<<27|k[8]>>>5,Qe=k[18]<<20|k[19]>>>12,Ue=k[19]<<20|k[18]>>>12,ei=k[29]<<7|k[28]>>>25,Ho=k[28]<<7|k[29]>>>25,Ti=k[38]<<8|k[39]>>>24,to=k[39]<<8|k[38]>>>24,Ie=k[48]<<14|k[49]>>>18,Ke=k[49]<<14|k[48]>>>18,k[0]=ar^~hr&Kr,k[1]=Or^~fe&G,k[10]=jt^~Qe&at,k[11]=Ze^~Ue&st,k[20]=Si^~nn&Uo,k[21]=Pi^~No&eo,k[30]=Bi^~Ci&_r,k[31]=Oo^~sr&Qn,k[40]=Ko^~zo&ei,k[41]=oo^~qo&Ho,k[2]=hr^~Kr&te,k[3]=fe^~G&me,k[12]=Qe^~at&Qt,k[13]=Ue^~st&Mn,k[22]=nn^~Uo&Ti,k[23]=No^~eo&to,k[32]=Ci^~_r&On,k[33]=sr^~Qn&ro,k[42]=zo^~ei&jo,k[43]=qo^~Ho&ao,k[4]=Kr^~te&Ie,k[5]=G^~me&Ke,k[14]=at^~Qt&Qi,k[15]=st^~Mn&Ei,k[24]=Uo^~Ti&Lo,k[25]=eo^~to&Mo,k[34]=_r^~On&no,k[35]=Qn^~ro&io,k[44]=ei^~jo&pn,k[45]=Ho^~ao&$o,k[6]=te^~Ie&ar,k[7]=me^~Ke&Or,k[16]=Qt^~Qi&jt,k[17]=Mn^~Ei&Ze,k[26]=Ti^~Lo&Si,k[27]=to^~Mo&Pi,k[36]=On^~no&Bi,k[37]=ro^~io&Oo,k[46]=jo^~pn&Ko,k[47]=ao^~$o&oo,k[8]=Ie^~ar&hr,k[9]=Ke^~Or&fe,k[18]=Qi^~jt&Qe,k[19]=Ei^~Ze&Ue,k[28]=Lo^~Si&nn,k[29]=Mo^~Pi&No,k[38]=no^~Bi&Ci,k[39]=io^~Oo&sr,k[48]=pn^~Ko&zo,k[49]=$o^~oo&qo,k[0]^=V[Be],k[1]^=V[Be+1]};if(u)Rd.exports=Bt;else{for(ir=0;ir<Rt.length;++ir)n[Rt[ir]]=Bt[Rt[ir]];c&&define(function(){return Bt})}})()});var Z3=Y((dl,Nd)=>{(function(t,e){"use strict";var r={version:"3.0.0",x86:{},x64:{},inputValidation:!0};function n(_){if(!Array.isArray(_)&&!ArrayBuffer.isView(_))return!1;for(var U=0;U<_.length;U++)if(!Number.isInteger(_[U])||_[U]<0||_[U]>255)return!1;return!0}function o(_,U){return(_&65535)*U+(((_>>>16)*U&65535)<<16)}function a(_,U){return _<<U|_>>>32-U}function u(_){return _^=_>>>16,_=o(_,2246822507),_^=_>>>13,_=o(_,3266489909),_^=_>>>16,_}function c(_,U){_=[_[0]>>>16,_[0]&65535,_[1]>>>16,_[1]&65535],U=[U[0]>>>16,U[0]&65535,U[1]>>>16,U[1]&65535];var V=[0,0,0,0];return V[3]+=_[3]+U[3],V[2]+=V[3]>>>16,V[3]&=65535,V[2]+=_[2]+U[2],V[1]+=V[2]>>>16,V[2]&=65535,V[1]+=_[1]+U[1],V[0]+=V[1]>>>16,V[1]&=65535,V[0]+=_[0]+U[0],V[0]&=65535,[V[0]<<16|V[1],V[2]<<16|V[3]]}function p(_,U){_=[_[0]>>>16,_[0]&65535,_[1]>>>16,_[1]&65535],U=[U[0]>>>16,U[0]&65535,U[1]>>>16,U[1]&65535];var V=[0,0,0,0];return V[3]+=_[3]*U[3],V[2]+=V[3]>>>16,V[3]&=65535,V[2]+=_[2]*U[3],V[1]+=V[2]>>>16,V[2]&=65535,V[2]+=_[3]*U[2],V[1]+=V[2]>>>16,V[2]&=65535,V[1]+=_[1]*U[3],V[0]+=V[1]>>>16,V[1]&=65535,V[1]+=_[2]*U[2],V[0]+=V[1]>>>16,V[1]&=65535,V[1]+=_[3]*U[1],V[0]+=V[1]>>>16,V[1]&=65535,V[0]+=_[0]*U[3]+_[1]*U[2]+_[2]*U[1]+_[3]*U[0],V[0]&=65535,[V[0]<<16|V[1],V[2]<<16|V[3]]}function l(_,U){return U%=64,U===32?[_[1],_[0]]:U<32?[_[0]<<U|_[1]>>>32-U,_[1]<<U|_[0]>>>32-U]:(U-=32,[_[1]<<U|_[0]>>>32-U,_[0]<<U|_[1]>>>32-U])}function y(_,U){return U%=64,U===0?_:U<32?[_[0]<<U|_[1]>>>32-U,_[1]<<U]:[_[1]<<U-32,0]}function w(_,U){return[_[0]^U[0],_[1]^U[1]]}function F(_){return _=w(_,[0,_[0]>>>1]),_=p(_,[4283543511,3981806797]),_=w(_,[0,_[0]>>>1]),_=p(_,[3301882366,444984403]),_=w(_,[0,_[0]>>>1]),_}r.x86.hash32=function(_,U){if(r.inputValidation&&!n(_))return e;U=U||0;for(var V=_.length%4,Se=_.length-V,Q=U,ue=0,J=3432918353,ye=461845907,Fe=0;Fe<Se;Fe=Fe+4)ue=_[Fe]|_[Fe+1]<<8|_[Fe+2]<<16|_[Fe+3]<<24,ue=o(ue,J),ue=a(ue,15),ue=o(ue,ye),Q^=ue,Q=a(Q,13),Q=o(Q,5)+3864292196;switch(ue=0,V){case 3:ue^=_[Fe+2]<<16;case 2:ue^=_[Fe+1]<<8;case 1:ue^=_[Fe],ue=o(ue,J),ue=a(ue,15),ue=o(ue,ye),Q^=ue}return Q^=_.length,Q=u(Q),Q>>>0},r.x86.hash128=function(_,U){if(r.inputValidation&&!n(_))return e;U=U||0;for(var V=_.length%16,Se=_.length-V,Q=U,ue=U,J=U,ye=U,Fe=0,Z=0,re=0,Ce=0,et=597399067,ct=2869860233,vt=951274213,ht=2716044179,He=0;He<Se;He=He+16)Fe=_[He]|_[He+1]<<8|_[He+2]<<16|_[He+3]<<24,Z=_[He+4]|_[He+5]<<8|_[He+6]<<16|_[He+7]<<24,re=_[He+8]|_[He+9]<<8|_[He+10]<<16|_[He+11]<<24,Ce=_[He+12]|_[He+13]<<8|_[He+14]<<16|_[He+15]<<24,Fe=o(Fe,et),Fe=a(Fe,15),Fe=o(Fe,ct),Q^=Fe,Q=a(Q,19),Q+=ue,Q=o(Q,5)+1444728091,Z=o(Z,ct),Z=a(Z,16),Z=o(Z,vt),ue^=Z,ue=a(ue,17),ue+=J,ue=o(ue,5)+197830471,re=o(re,vt),re=a(re,17),re=o(re,ht),J^=re,J=a(J,15),J+=ye,J=o(J,5)+2530024501,Ce=o(Ce,ht),Ce=a(Ce,18),Ce=o(Ce,et),ye^=Ce,ye=a(ye,13),ye+=Q,ye=o(ye,5)+850148119;switch(Fe=0,Z=0,re=0,Ce=0,V){case 15:Ce^=_[He+14]<<16;case 14:Ce^=_[He+13]<<8;case 13:Ce^=_[He+12],Ce=o(Ce,ht),Ce=a(Ce,18),Ce=o(Ce,et),ye^=Ce;case 12:re^=_[He+11]<<24;case 11:re^=_[He+10]<<16;case 10:re^=_[He+9]<<8;case 9:re^=_[He+8],re=o(re,vt),re=a(re,17),re=o(re,ht),J^=re;case 8:Z^=_[He+7]<<24;case 7:Z^=_[He+6]<<16;case 6:Z^=_[He+5]<<8;case 5:Z^=_[He+4],Z=o(Z,ct),Z=a(Z,16),Z=o(Z,vt),ue^=Z;case 4:Fe^=_[He+3]<<24;case 3:Fe^=_[He+2]<<16;case 2:Fe^=_[He+1]<<8;case 1:Fe^=_[He],Fe=o(Fe,et),Fe=a(Fe,15),Fe=o(Fe,ct),Q^=Fe}return Q^=_.length,ue^=_.length,J^=_.length,ye^=_.length,Q+=ue,Q+=J,Q+=ye,ue+=Q,J+=Q,ye+=Q,Q=u(Q),ue=u(ue),J=u(J),ye=u(ye),Q+=ue,Q+=J,Q+=ye,ue+=Q,J+=Q,ye+=Q,("00000000"+(Q>>>0).toString(16)).slice(-8)+("00000000"+(ue>>>0).toString(16)).slice(-8)+("00000000"+(J>>>0).toString(16)).slice(-8)+("00000000"+(ye>>>0).toString(16)).slice(-8)},r.x64.hash128=function(_,U){if(r.inputValidation&&!n(_))return e;U=U||0;for(var V=_.length%16,Se=_.length-V,Q=[0,U],ue=[0,U],J=[0,0],ye=[0,0],Fe=[2277735313,289559509],Z=[1291169091,658871167],re=0;re<Se;re=re+16)J=[_[re+4]|_[re+5]<<8|_[re+6]<<16|_[re+7]<<24,_[re]|_[re+1]<<8|_[re+2]<<16|_[re+3]<<24],ye=[_[re+12]|_[re+13]<<8|_[re+14]<<16|_[re+15]<<24,_[re+8]|_[re+9]<<8|_[re+10]<<16|_[re+11]<<24],J=p(J,Fe),J=l(J,31),J=p(J,Z),Q=w(Q,J),Q=l(Q,27),Q=c(Q,ue),Q=c(p(Q,[0,5]),[0,1390208809]),ye=p(ye,Z),ye=l(ye,33),ye=p(ye,Fe),ue=w(ue,ye),ue=l(ue,31),ue=c(ue,Q),ue=c(p(ue,[0,5]),[0,944331445]);switch(J=[0,0],ye=[0,0],V){case 15:ye=w(ye,y([0,_[re+14]],48));case 14:ye=w(ye,y([0,_[re+13]],40));case 13:ye=w(ye,y([0,_[re+12]],32));case 12:ye=w(ye,y([0,_[re+11]],24));case 11:ye=w(ye,y([0,_[re+10]],16));case 10:ye=w(ye,y([0,_[re+9]],8));case 9:ye=w(ye,[0,_[re+8]]),ye=p(ye,Z),ye=l(ye,33),ye=p(ye,Fe),ue=w(ue,ye);case 8:J=w(J,y([0,_[re+7]],56));case 7:J=w(J,y([0,_[re+6]],48));case 6:J=w(J,y([0,_[re+5]],40));case 5:J=w(J,y([0,_[re+4]],32));case 4:J=w(J,y([0,_[re+3]],24));case 3:J=w(J,y([0,_[re+2]],16));case 2:J=w(J,y([0,_[re+1]],8));case 1:J=w(J,[0,_[re]]),J=p(J,Fe),J=l(J,31),J=p(J,Z),Q=w(Q,J)}return Q=w(Q,[0,_.length]),ue=w(ue,[0,_.length]),Q=c(Q,ue),ue=c(ue,Q),Q=F(Q),ue=F(ue),Q=c(Q,ue),ue=c(ue,Q),("00000000"+(Q[0]>>>0).toString(16)).slice(-8)+("00000000"+(Q[1]>>>0).toString(16)).slice(-8)+("00000000"+(ue[0]>>>0).toString(16)).slice(-8)+("00000000"+(ue[1]>>>0).toString(16)).slice(-8)},typeof dl!="undefined"?(typeof Nd!="undefined"&&Nd.exports&&(dl=Nd.exports=r),dl.murmurHash3=r):typeof define=="function"&&define.amd?define([],function(){return r}):(r._murmurHash3=t.murmurHash3,r.noConflict=function(){return t.murmurHash3=r._murmurHash3,r._murmurHash3=e,r.noConflict=e,r},t.murmurHash3=r)})(dl)});var e4=Y((b9,Q3)=>{Q3.exports=Z3()});var r4=Y((v9,t4)=>{"use strict";var GD=al(),Oc=self.crypto||self.msCrypto,Qy=async(t,e)=>{if(typeof self=="undefined"||!Oc)throw new Error("Please use a browser with webcrypto support and ensure the code has been delivered securely via HTTPS/TLS and run within a Secure Context");switch(e){case"sha1":return new Uint8Array(await Oc.subtle.digest({name:"SHA-1"},t));case"sha2-256":return new Uint8Array(await Oc.subtle.digest({name:"SHA-256"},t));case"sha2-512":return new Uint8Array(await Oc.subtle.digest({name:"SHA-512"},t));case"dbl-sha2-256":{let r=await Oc.subtle.digest({name:"SHA-256"},t);return new Uint8Array(await Oc.subtle.digest({name:"SHA-256"},r))}default:throw new Error(`${e} is not a supported algorithm`)}};t4.exports={factory:t=>async e=>Qy(e,t),digest:Qy,multihashing:async(t,e,r)=>{let n=await Qy(t,e);return GD.encode(n,e,r)}}});var i4=Y((_9,n4)=>{"use strict";var WD=t=>{let e=new Uint8Array(4);for(let r=0;r<4;r++)e[r]=t&255,t=t>>8;return e};n4.exports={fromNumberTo32BitBuf:WD}});var e1=Y((w9,o4)=>{var YD="Input must be an string, Buffer or Uint8Array";function VD(t){var e;if(t instanceof Uint8Array)e=t;else if(t instanceof Buffer)e=new Uint8Array(t);else if(typeof t=="string")e=new Uint8Array(Buffer.from(t,"utf8"));else throw new Error(YD);return e}function JD(t){return Array.prototype.map.call(t,function(e){return(e<16?"0":"")+e.toString(16)}).join("")}function Ud(t){return(4294967296+t).toString(16).substring(1)}function XD(t,e,r){for(var n=`
|
6 | `+t+" = ",o=0;o<e.length;o+=2){if(r===32)n+=Ud(e[o]).toUpperCase(),n+=" ",n+=Ud(e[o+1]).toUpperCase();else if(r===64)n+=Ud(e[o+1]).toUpperCase(),n+=Ud(e[o]).toUpperCase();else throw new Error("Invalid size "+r);o%6==4?n+=`
|
7 | `+new Array(t.length+4).join(" "):o<e.length-2&&(n+=" ")}console.log(n)}function ZD(t,e,r){for(var n=new Date().getTime(),o=new Uint8Array(e),a=0;a<e;a++)o[a]=a%256;var u=new Date().getTime();for(console.log("Generated random input in "+(u-n)+"ms"),n=u,a=0;a<r;a++){var c=t(o),p=new Date().getTime(),l=p-n;n=p,console.log("Hashed in "+l+"ms: "+c.substring(0,20)+"..."),console.log(Math.round(e/(1<<20)/(l/1e3)*100)/100+" MB PER SECOND")}}o4.exports={normalizeInput:VD,toHex:JD,debugPrint:XD,testSpeed:ZD}});var p4=Y((x9,d4)=>{var a4=e1();function Ld(t,e,r){var n=t[e]+t[r],o=t[e+1]+t[r+1];n>=4294967296&&o++,t[e]=n,t[e+1]=o}function s4(t,e,r,n){var o=t[e]+r;r<0&&(o+=4294967296);var a=t[e+1]+n;o>=4294967296&&a++,t[e]=o,t[e+1]=a}function QD(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function Fs(t,e,r,n,o,a){var u=pl[o],c=pl[o+1],p=pl[a],l=pl[a+1];Ld(pt,t,e),s4(pt,t,u,c);var y=pt[n]^pt[t],w=pt[n+1]^pt[t+1];pt[n]=w,pt[n+1]=y,Ld(pt,r,n),y=pt[e]^pt[r],w=pt[e+1]^pt[r+1],pt[e]=y>>>24^w<<8,pt[e+1]=w>>>24^y<<8,Ld(pt,t,e),s4(pt,t,p,l),y=pt[n]^pt[t],w=pt[n+1]^pt[t+1],pt[n]=y>>>16^w<<16,pt[n+1]=w>>>16^y<<16,Ld(pt,r,n),y=pt[e]^pt[r],w=pt[e+1]^pt[r+1],pt[e]=w>>>31^y<<1,pt[e+1]=y>>>31^w<<1}var u4=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),eR=[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],_n=new Uint8Array(eR.map(function(t){return t*2})),pt=new Uint32Array(32),pl=new Uint32Array(32);function c4(t,e){var r=0;for(r=0;r<16;r++)pt[r]=t.h[r],pt[r+16]=u4[r];for(pt[24]=pt[24]^t.t,pt[25]=pt[25]^t.t/4294967296,e&&(pt[28]=~pt[28],pt[29]=~pt[29]),r=0;r<32;r++)pl[r]=QD(t.b,4*r);for(r=0;r<12;r++)Fs(0,8,16,24,_n[r*16+0],_n[r*16+1]),Fs(2,10,18,26,_n[r*16+2],_n[r*16+3]),Fs(4,12,20,28,_n[r*16+4],_n[r*16+5]),Fs(6,14,22,30,_n[r*16+6],_n[r*16+7]),Fs(0,10,20,30,_n[r*16+8],_n[r*16+9]),Fs(2,12,22,24,_n[r*16+10],_n[r*16+11]),Fs(4,14,16,26,_n[r*16+12],_n[r*16+13]),Fs(6,8,18,28,_n[r*16+14],_n[r*16+15]);for(r=0;r<16;r++)t.h[r]=t.h[r]^pt[r]^pt[r+16]}function f4(t,e){if(t===0||t>64)throw new Error("Illegal output length, expected 0 < length <= 64");if(e&&e.length>64)throw new Error("Illegal key, expected Uint8Array with 0 < length <= 64");for(var r={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:t},n=0;n<16;n++)r.h[n]=u4[n];var o=e?e.length:0;return r.h[0]^=16842752^o<<8^t,e&&(t1(r,e),r.c=128),r}function t1(t,e){for(var r=0;r<e.length;r++)t.c===128&&(t.t+=t.c,c4(t,!1),t.c=0),t.b[t.c++]=e[r]}function l4(t){for(t.t+=t.c;t.c<128;)t.b[t.c++]=0;c4(t,!0);for(var e=new Uint8Array(t.outlen),r=0;r<t.outlen;r++)e[r]=t.h[r>>2]>>8*(r&3);return e}function h4(t,e,r){r=r||64,t=a4.normalizeInput(t);var n=f4(r,e);return t1(n,t),l4(n)}function tR(t,e,r){var n=h4(t,e,r);return a4.toHex(n)}d4.exports={blake2b:h4,blake2bHex:tR,blake2bInit:f4,blake2bUpdate:t1,blake2bFinal:l4}});var x4=Y((k9,w4)=>{var m4=e1();function rR(t,e){return t[e]^t[e+1]<<8^t[e+2]<<16^t[e+3]<<24}function Is(t,e,r,n,o,a){qt[t]=qt[t]+qt[e]+o,qt[n]=Md(qt[n]^qt[t],16),qt[r]=qt[r]+qt[n],qt[e]=Md(qt[e]^qt[r],12),qt[t]=qt[t]+qt[e]+a,qt[n]=Md(qt[n]^qt[t],8),qt[r]=qt[r]+qt[n],qt[e]=Md(qt[e]^qt[r],7)}function Md(t,e){return t>>>e^t<<32-e}var y4=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),wn=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]),qt=new Uint32Array(16),ln=new Uint32Array(16);function g4(t,e){var r=0;for(r=0;r<8;r++)qt[r]=t.h[r],qt[r+8]=y4[r];for(qt[12]^=t.t,qt[13]^=t.t/4294967296,e&&(qt[14]=~qt[14]),r=0;r<16;r++)ln[r]=rR(t.b,4*r);for(r=0;r<10;r++)Is(0,4,8,12,ln[wn[r*16+0]],ln[wn[r*16+1]]),Is(1,5,9,13,ln[wn[r*16+2]],ln[wn[r*16+3]]),Is(2,6,10,14,ln[wn[r*16+4]],ln[wn[r*16+5]]),Is(3,7,11,15,ln[wn[r*16+6]],ln[wn[r*16+7]]),Is(0,5,10,15,ln[wn[r*16+8]],ln[wn[r*16+9]]),Is(1,6,11,12,ln[wn[r*16+10]],ln[wn[r*16+11]]),Is(2,7,8,13,ln[wn[r*16+12]],ln[wn[r*16+13]]),Is(3,4,9,14,ln[wn[r*16+14]],ln[wn[r*16+15]]);for(r=0;r<8;r++)t.h[r]^=qt[r]^qt[r+8]}function b4(t,e){if(!(t>0&&t<=32))throw new Error("Incorrect output length, should be in [1, 32]");var r=e?e.length:0;if(e&&!(r>0&&r<=32))throw new Error("Incorrect key length, should be in [1, 32]");var n={h:new Uint32Array(y4),b:new Uint32Array(64),c:0,t:0,outlen:t};return n.h[0]^=16842752^r<<8^t,r>0&&(r1(n,e),n.c=64),n}function r1(t,e){for(var r=0;r<e.length;r++)t.c===64&&(t.t+=t.c,g4(t,!1),t.c=0),t.b[t.c++]=e[r]}function v4(t){for(t.t+=t.c;t.c<64;)t.b[t.c++]=0;g4(t,!0);for(var e=new Uint8Array(t.outlen),r=0;r<t.outlen;r++)e[r]=t.h[r>>2]>>8*(r&3)&255;return e}function _4(t,e,r){r=r||32,t=m4.normalizeInput(t);var n=b4(r,e);return r1(n,t),v4(n)}function nR(t,e,r){var n=_4(t,e,r);return m4.toHex(n)}w4.exports={blake2s:_4,blake2sHex:nR,blake2sInit:b4,blake2sUpdate:r1,blake2sFinal:v4}});var A4=Y((A9,k4)=>{var ml=p4(),yl=x4();k4.exports={blake2b:ml.blake2b,blake2bHex:ml.blake2bHex,blake2bInit:ml.blake2bInit,blake2bUpdate:ml.blake2bUpdate,blake2bFinal:ml.blake2bFinal,blake2s:yl.blake2s,blake2sHex:yl.blake2sHex,blake2sInit:yl.blake2sInit,blake2sUpdate:yl.blake2sUpdate,blake2sFinal:yl.blake2sFinal}});var P4=Y((E9,S4)=>{"use strict";var Kc=A4(),iR=45569,oR=45633,aR={init:Kc.blake2bInit,update:Kc.blake2bUpdate,digest:Kc.blake2bFinal},sR={init:Kc.blake2sInit,update:Kc.blake2sUpdate,digest:Kc.blake2sFinal},E4=(t,e)=>async r=>{let n=e.init(t,null);return e.update(n,r),e.digest(n)};S4.exports=t=>{for(let e=0;e<64;e++)t[iR+e]=E4(e+1,aR);for(let e=0;e<32;e++)t[oR+e]=E4(e+1,sR)}});var C4=Y((S9,B4)=>{"use strict";var la=X3(),T4=e4(),{factory:Od}=r4(),{fromNumberTo32BitBuf:uR}=i4(),cR=Rc(),$i=t=>async e=>{switch(t){case"sha3-224":return new Uint8Array(la.sha3_224.arrayBuffer(e));case"sha3-256":return new Uint8Array(la.sha3_256.arrayBuffer(e));case"sha3-384":return new Uint8Array(la.sha3_384.arrayBuffer(e));case"sha3-512":return new Uint8Array(la.sha3_512.arrayBuffer(e));case"shake-128":return new Uint8Array(la.shake128.create(128).update(e).arrayBuffer());case"shake-256":return new Uint8Array(la.shake256.create(256).update(e).arrayBuffer());case"keccak-224":return new Uint8Array(la.keccak224.arrayBuffer(e));case"keccak-256":return new Uint8Array(la.keccak256.arrayBuffer(e));case"keccak-384":return new Uint8Array(la.keccak384.arrayBuffer(e));case"keccak-512":return new Uint8Array(la.keccak512.arrayBuffer(e));case"murmur3-128":return cR(T4.x64.hash128(e),"base16");case"murmur3-32":return uR(T4.x86.hash32(e));default:throw new TypeError(`${t} is not a supported algorithm`)}},fR=t=>t;B4.exports={identity:fR,sha1:Od("sha1"),sha2256:Od("sha2-256"),sha2512:Od("sha2-512"),dblSha2256:Od("dbl-sha2-256"),sha3224:$i("sha3-224"),sha3256:$i("sha3-256"),sha3384:$i("sha3-384"),sha3512:$i("sha3-512"),shake128:$i("shake-128"),shake256:$i("shake-256"),keccak224:$i("keccak-224"),keccak256:$i("keccak-256"),keccak384:$i("keccak-384"),keccak512:$i("keccak-512"),murmur3128:$i("murmur3-128"),murmur332:$i("murmur3-32"),addBlake:P4()}});var D4=Y((P9,I4)=>{"use strict";var F4=J3(),Kd=al(),tn=C4(),lR=xd();async function Gi(t,e,r){let n=await Gi.digest(t,e,r);return Kd.encode(n,e,r)}Gi.multihash=Kd;Gi.digest=async(t,e,r)=>{let o=await Gi.createHash(e)(t);return r?o.slice(0,r):o};Gi.createHash=function(t){if(!t)throw F4(new Error("hash algorithm must be specified"),"ERR_HASH_ALGORITHM_NOT_SPECIFIED");let e=Kd.coerceCode(t);if(!Gi.functions[e])throw F4(new Error(`multihash function '${t}' not yet supported`),"ERR_HASH_ALGORITHM_NOT_SUPPORTED");return Gi.functions[e]};Gi.functions={0:tn.identity,17:tn.sha1,18:tn.sha2256,19:tn.sha2512,20:tn.sha3512,21:tn.sha3384,22:tn.sha3256,23:tn.sha3224,24:tn.shake128,25:tn.shake256,26:tn.keccak224,27:tn.keccak256,28:tn.keccak384,29:tn.keccak512,34:tn.murmur3128,35:tn.murmur332,86:tn.dblSha2256};tn.addBlake(Gi.functions);Gi.validate=async(t,e)=>{let r=await Gi(t,Kd.decode(e).name);return lR(e,r)};I4.exports=Gi});var n1=Y((T9,O4)=>{"use strict";var hR=Ss(),R4=wy(),N4=D4(),{multihash:U4}=N4,L4=R4.DAG_PB,M4=U4.names["sha2-256"],dR=async(t,e={})=>{let r={cidVersion:e.cidVersion==null?1:e.cidVersion,hashAlg:e.hashAlg==null?M4:e.hashAlg},n=U4.codes[r.hashAlg],o=await N4(t,n),a=R4.getNameFromCode(L4);return new hR(r.cidVersion,a,o)};O4.exports={codec:L4,defaultHashAlg:M4,cid:dR}});var z4=Y((B9,K4)=>{"use strict";var pR=ku(),mR=n1(),yR=async(t,e={})=>{let r=t.serialize(),n=await mR.cid(r,e);return new pR(e.name||"",t.size,n)};K4.exports=yR});var j4=Y((C9,H4)=>{"use strict";var gR=Jy(),q4=ku(),bR=t=>{if(t instanceof q4)return t;if(!("cid"in t||"hash"in t||"Hash"in t||"multihash"in t))throw new Error("Link must be a DAGLink or DAGLink-like. Convert the DAGNode into a DAGLink via `node.toDAGLink()`.");return new q4(t.Name||t.name,t.Tsize||t.size,t.Hash||t.multihash||t.hash||t.cid)},vR=(t,e)=>{let r=bR(e);t.Links.push(r),gR(t.Links)};H4.exports=vR});var W4=Y((F9,G4)=>{"use strict";var _R=Ss(),$4=xd(),wR=(t,e)=>{let r=null;if(typeof e=="string"?r=n=>n.Name===e:e instanceof Uint8Array?r=n=>$4(n.Hash.bytes,e):_R.isCID(e)&&(r=n=>$4(n.Hash.bytes,e.bytes)),r){let n=t.Links,o=0;for(;o<n.length;){let a=n[o];r(a)?n.splice(o,1):o++}}else throw new Error("second arg needs to be a name or CID")};G4.exports=wR});var i1=Y((I9,V4)=>{"use strict";var xR=Jy(),kR=ku(),{createDagLinkFromB58EncodedHash:AR}=Xy(),{serializeDAGNode:ER}=Zy(),SR=z4(),PR=j4(),TR=W4(),BR=Rc(),CR=il(),Y4=class{constructor(e,r=[],n=null){if(e||(e=new Uint8Array(0)),typeof e=="string"&&(e=BR(e)),!(e instanceof Uint8Array))throw new Error("Passed 'data' is not a Uint8Array or a String!");if(n!==null&&typeof n!="number")throw new Error("Passed 'serializedSize' must be a number!");let o=r.map(a=>a instanceof kR?a:AR(a));xR(o),this.Data=e,this.Links=o,Object.defineProperties(this,{_serializedSize:{value:n,writable:!0,enumerable:!1},_size:{value:null,writable:!0,enumerable:!1}})}toJSON(){return this._json||(this._json=Object.freeze({data:this.Data,links:this.Links.map(e=>e.toJSON()),size:this.size})),Object.assign({},this._json)}toString(){return`DAGNode <data: "${CR(this.Data,"base64urlpad")}", links: ${this.Links.length}, size: ${this.size}>`}_invalidateCached(){this._serializedSize=null,this._size=null}addLink(e){return this._invalidateCached(),PR(this,e)}rmLink(e){return this._invalidateCached(),TR(this,e)}toDAGLink(e){return SR(this,e)}serialize(){let e=ER(this);return this._serializedSize=e.length,e}get size(){if(this._size==null){let e;e==null&&(this._serializedSize=this.serialize().length,e=this._serializedSize),this._size=this.Links.reduce((r,n)=>r+n.Tsize,e)}return this._size}set size(e){throw new Error("Can't set property: 'size' is immutable")}};V4.exports=Y4});var a1=Y((D9,Z4)=>{"use strict";var{PBNode:J4}=Wy(),FR=ku(),X4=i1(),{serializeDAGNode:IR,serializeDAGNodeLike:DR}=Zy(),o1=n1(),RR=(t,e)=>o1.cid(t,e),NR=t=>t instanceof X4?IR(t):DR(t.Data,t.Links),UR=t=>{let e=J4.decode(t),r=J4.toObject(e,{defaults:!1,arrays:!0,longs:Number,objects:!1}),n=r.Links.map(a=>new FR(a.Name,a.Tsize,a.Hash)),o=r.Data==null?new Uint8Array(0):r.Data;return new X4(o,n,t.byteLength)};Z4.exports={codec:o1.codec,defaultHashAlg:o1.defaultHashAlg,serialize:NR,deserialize:UR,cid:RR}});var ek=Y(s1=>{"use strict";var LR=Ss(),Q4=a1();s1.resolve=(t,e="/")=>{let r=Q4.deserialize(t),n=e.split("/").filter(Boolean);for(;n.length;){let o=n.shift();if(r[o]===void 0){for(let a of r.Links)if(a.Name===o)return{value:a.Hash,remainderPath:n.join("/")};throw new Error(`Object has no property '${o}'`)}if(r=r[o],LR.isCID(r))return{value:r,remainderPath:n.join("/")}}return{value:r,remainderPath:""}};s1.tree=function*(t){let e=Q4.deserialize(t);yield"Data",yield"Links";for(let r=0;r<e.Links.length;r++)yield`Links/${r}`,yield`Links/${r}/Name`,yield`Links/${r}/Tsize`,yield`Links/${r}/Hash`}});var zd=Y((N9,tk)=>{"use strict";var MR=ek(),u1=a1(),OR=i1(),KR=ku(),zR={DAGNode:OR,DAGLink:KR,resolver:MR,util:u1,codec:u1.codec,defaultHashAlg:u1.defaultHashAlg};tk.exports=zR});var yA=Y(tp=>{"use strict";Object.defineProperty(tp,"__esModule",{value:!0});var pA="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",mA={};function hN(t,e,r=pA){if(!(t instanceof Uint8Array))throw new TypeError('"input" must be a Uint8Array.');if(typeof r!="string")throw new TypeError('"alphabet" must be a string.');if(e!==void 0&&typeof e!="number")throw new TypeError('"maxline" must be a number.');if(t.length===0)return"";let n="",o=0,a=r.length,u=r.charAt(0),c=[0];for(o=0;o<t.length;++o){let p=t[o];for(let l=0;l<c.length;++l)p+=c[l]<<8,c[l]=p%a,p=p/a|0;for(;p>0;)c.push(p%a),p=p/a|0}for(o=0;t[o]===0&&o<t.length-1;++o)n+=u;for(o=c.length-1;o>=0;--o)n+=r[c[o]];if(e){let p=new RegExp(".{1,"+e+"}","g");n=n.match(p).join(`\r
|
8 | `)}return n}function dN(t,e=pA){if(typeof t!="string")throw new TypeError('"input" must be a string.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(t.length===0)return new Uint8Array;let r=mA[e];if(!r){r=mA[e]=[];for(let u=0;u<e.length;++u)r[e.charCodeAt(u)]=u}t=t.replace(/\s/g,"");let n=e.length,o=e.charAt(0),a=[0];for(let u=0;u<t.length;u++){let c=r[t.charCodeAt(u)];if(c===void 0)return;let p=c;for(let l=0;l<a.length;++l)p+=a[l]*n,a[l]=p&255,p>>=8;for(;p>0;)a.push(p&255),p>>=8}for(let u=0;t[u]===o&&u<t.length-1;++u)a.push(0);return new Uint8Array(a.reverse())}tp.decode=dN;tp.encode=hN});var bA=Y(rp=>{"use strict";Object.defineProperty(rp,"__esModule",{value:!0});var gA=yA();rp.decode=gA.decode;rp.encode=gA.encode});var HA=Y((qA,vp)=>{(function(t){var e={36:n(Math.pow(36,5)),16:n(Math.pow(16,7)),10:n(Math.pow(10,9)),2:n(Math.pow(2,30))},r={36:n(36),16:n(16),10:n(10),2:n(2)};function n(c,p){if(!(this instanceof n))return new n(c,p);if(this._low=0,this._high=0,this.remainder=null,typeof p=="undefined")return a.call(this,c);if(typeof c=="string")return u.call(this,c,p);o.call(this,c,p)}function o(c,p){return this._low=c|0,this._high=p|0,this}n.prototype.fromBits=o;function a(c){return this._low=c&65535,this._high=c>>>16,this}n.prototype.fromNumber=a;function u(c,p){var l=parseInt(c,p||10);return this._low=l&65535,this._high=l>>>16,this}n.prototype.fromString=u,n.prototype.toNumber=function(){return this._high*65536+this._low},n.prototype.toString=function(c){return this.toNumber().toString(c||10)},n.prototype.add=function(c){var p=this._low+c._low,l=p>>>16;return l+=this._high+c._high,this._low=p&65535,this._high=l&65535,this},n.prototype.subtract=function(c){return this.add(c.clone().negate())},n.prototype.multiply=function(c){var p=this._high,l=this._low,y=c._high,w=c._low,F,_;return _=l*w,F=_>>>16,F+=p*w,F&=65535,F+=l*y,this._low=_&65535,this._high=F&65535,this},n.prototype.div=function(c){if(c._low==0&&c._high==0)throw Error("division by zero");if(c._high==0&&c._low==1)return this.remainder=new n(0),this;if(c.gt(this))return this.remainder=this.clone(),this._low=0,this._high=0,this;if(this.eq(c))return this.remainder=new n(0),this._low=1,this._high=0,this;for(var p=c.clone(),l=-1;!this.lt(p);)p.shiftLeft(1,!0),l++;for(this.remainder=this.clone(),this._low=0,this._high=0;l>=0;l--)p.shiftRight(1),this.remainder.lt(p)||(this.remainder.subtract(p),l>=16?this._high|=1<<l-16:this._low|=1<<l);return this},n.prototype.negate=function(){var c=(~this._low&65535)+1;return this._low=c&65535,this._high=~this._high+(c>>>16)&65535,this},n.prototype.equals=n.prototype.eq=function(c){return this._low==c._low&&this._high==c._high},n.prototype.greaterThan=n.prototype.gt=function(c){return this._high>c._high?!0:this._high<c._high?!1:this._low>c._low},n.prototype.lessThan=n.prototype.lt=function(c){return this._high<c._high?!0:this._high>c._high?!1:this._low<c._low},n.prototype.or=function(c){return this._low|=c._low,this._high|=c._high,this},n.prototype.and=function(c){return this._low&=c._low,this._high&=c._high,this},n.prototype.not=function(){return this._low=~this._low&65535,this._high=~this._high&65535,this},n.prototype.xor=function(c){return this._low^=c._low,this._high^=c._high,this},n.prototype.shiftRight=n.prototype.shiftr=function(c){return c>16?(this._low=this._high>>c-16,this._high=0):c==16?(this._low=this._high,this._high=0):(this._low=this._low>>c|this._high<<16-c&65535,this._high>>=c),this},n.prototype.shiftLeft=n.prototype.shiftl=function(c,p){return c>16?(this._high=this._low<<c-16,this._low=0,p||(this._high&=65535)):c==16?(this._high=this._low,this._low=0):(this._high=this._high<<c|this._low>>16-c,this._low=this._low<<c&65535,p||(this._high&=65535)),this},n.prototype.rotateLeft=n.prototype.rotl=function(c){var p=this._high<<16|this._low;return p=p<<c|p>>>32-c,this._low=p&65535,this._high=p>>>16,this},n.prototype.rotateRight=n.prototype.rotr=function(c){var p=this._high<<16|this._low;return p=p>>>c|p<<32-c,this._low=p&65535,this._high=p>>>16,this},n.prototype.clone=function(){return new n(this._low,this._high)},typeof define!="undefined"&&define.amd?define([],function(){return n}):typeof vp!="undefined"&&vp.exports?vp.exports=n:t.UINT32=n})(qA)});var $A=Y((jA,_p)=>{(function(t){var e={16:n(Math.pow(16,5)),10:n(Math.pow(10,5)),2:n(Math.pow(2,5))},r={16:n(16),10:n(10),2:n(2)};function n(c,p,l,y){if(!(this instanceof n))return new n(c,p,l,y);if(this.remainder=null,typeof c=="string")return u.call(this,c,p);if(typeof p=="undefined")return a.call(this,c);o.apply(this,arguments)}function o(c,p,l,y){return typeof l=="undefined"?(this._a00=c&65535,this._a16=c>>>16,this._a32=p&65535,this._a48=p>>>16,this):(this._a00=c|0,this._a16=p|0,this._a32=l|0,this._a48=y|0,this)}n.prototype.fromBits=o;function a(c){return this._a00=c&65535,this._a16=c>>>16,this._a32=0,this._a48=0,this}n.prototype.fromNumber=a;function u(c,p){p=p||10,this._a00=0,this._a16=0,this._a32=0,this._a48=0;for(var l=e[p]||new n(Math.pow(p,5)),y=0,w=c.length;y<w;y+=5){var F=Math.min(5,w-y),_=parseInt(c.slice(y,y+F),p);this.multiply(F<5?new n(Math.pow(p,F)):l).add(new n(_))}return this}n.prototype.fromString=u,n.prototype.toNumber=function(){return this._a16*65536+this._a00},n.prototype.toString=function(c){c=c||10;var p=r[c]||new n(c);if(!this.gt(p))return this.toNumber().toString(c);for(var l=this.clone(),y=new Array(64),w=63;w>=0&&(l.div(p),y[w]=l.remainder.toNumber().toString(c),!!l.gt(p));w--);return y[w-1]=l.toNumber().toString(c),y.join("")},n.prototype.add=function(c){var p=this._a00+c._a00,l=p>>>16;l+=this._a16+c._a16;var y=l>>>16;y+=this._a32+c._a32;var w=y>>>16;return w+=this._a48+c._a48,this._a00=p&65535,this._a16=l&65535,this._a32=y&65535,this._a48=w&65535,this},n.prototype.subtract=function(c){return this.add(c.clone().negate())},n.prototype.multiply=function(c){var p=this._a00,l=this._a16,y=this._a32,w=this._a48,F=c._a00,_=c._a16,U=c._a32,V=c._a48,Se=p*F,Q=Se>>>16;Q+=p*_;var ue=Q>>>16;Q&=65535,Q+=l*F,ue+=Q>>>16,ue+=p*U;var J=ue>>>16;return ue&=65535,ue+=l*_,J+=ue>>>16,ue&=65535,ue+=y*F,J+=ue>>>16,J+=p*V,J&=65535,J+=l*U,J&=65535,J+=y*_,J&=65535,J+=w*F,this._a00=Se&65535,this._a16=Q&65535,this._a32=ue&65535,this._a48=J&65535,this},n.prototype.div=function(c){if(c._a16==0&&c._a32==0&&c._a48==0){if(c._a00==0)throw Error("division by zero");if(c._a00==1)return this.remainder=new n(0),this}if(c.gt(this))return this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0,this;if(this.eq(c))return this.remainder=new n(0),this._a00=1,this._a16=0,this._a32=0,this._a48=0,this;for(var p=c.clone(),l=-1;!this.lt(p);)p.shiftLeft(1,!0),l++;for(this.remainder=this.clone(),this._a00=0,this._a16=0,this._a32=0,this._a48=0;l>=0;l--)p.shiftRight(1),this.remainder.lt(p)||(this.remainder.subtract(p),l>=48?this._a48|=1<<l-48:l>=32?this._a32|=1<<l-32:l>=16?this._a16|=1<<l-16:this._a00|=1<<l);return this},n.prototype.negate=function(){var c=(~this._a00&65535)+1;return this._a00=c&65535,c=(~this._a16&65535)+(c>>>16),this._a16=c&65535,c=(~this._a32&65535)+(c>>>16),this._a32=c&65535,this._a48=~this._a48+(c>>>16)&65535,this},n.prototype.equals=n.prototype.eq=function(c){return this._a48==c._a48&&this._a00==c._a00&&this._a32==c._a32&&this._a16==c._a16},n.prototype.greaterThan=n.prototype.gt=function(c){return this._a48>c._a48?!0:this._a48<c._a48?!1:this._a32>c._a32?!0:this._a32<c._a32?!1:this._a16>c._a16?!0:this._a16<c._a16?!1:this._a00>c._a00},n.prototype.lessThan=n.prototype.lt=function(c){return this._a48<c._a48?!0:this._a48>c._a48?!1:this._a32<c._a32?!0:this._a32>c._a32?!1:this._a16<c._a16?!0:this._a16>c._a16?!1:this._a00<c._a00},n.prototype.or=function(c){return this._a00|=c._a00,this._a16|=c._a16,this._a32|=c._a32,this._a48|=c._a48,this},n.prototype.and=function(c){return this._a00&=c._a00,this._a16&=c._a16,this._a32&=c._a32,this._a48&=c._a48,this},n.prototype.xor=function(c){return this._a00^=c._a00,this._a16^=c._a16,this._a32^=c._a32,this._a48^=c._a48,this},n.prototype.not=function(){return this._a00=~this._a00&65535,this._a16=~this._a16&65535,this._a32=~this._a32&65535,this._a48=~this._a48&65535,this},n.prototype.shiftRight=n.prototype.shiftr=function(c){return c%=64,c>=48?(this._a00=this._a48>>c-48,this._a16=0,this._a32=0,this._a48=0):c>=32?(c-=32,this._a00=(this._a32>>c|this._a48<<16-c)&65535,this._a16=this._a48>>c&65535,this._a32=0,this._a48=0):c>=16?(c-=16,this._a00=(this._a16>>c|this._a32<<16-c)&65535,this._a16=(this._a32>>c|this._a48<<16-c)&65535,this._a32=this._a48>>c&65535,this._a48=0):(this._a00=(this._a00>>c|this._a16<<16-c)&65535,this._a16=(this._a16>>c|this._a32<<16-c)&65535,this._a32=(this._a32>>c|this._a48<<16-c)&65535,this._a48=this._a48>>c&65535),this},n.prototype.shiftLeft=n.prototype.shiftl=function(c,p){return c%=64,c>=48?(this._a48=this._a00<<c-48,this._a32=0,this._a16=0,this._a00=0):c>=32?(c-=32,this._a48=this._a16<<c|this._a00>>16-c,this._a32=this._a00<<c&65535,this._a16=0,this._a00=0):c>=16?(c-=16,this._a48=this._a32<<c|this._a16>>16-c,this._a32=(this._a16<<c|this._a00>>16-c)&65535,this._a16=this._a00<<c&65535,this._a00=0):(this._a48=this._a48<<c|this._a32>>16-c,this._a32=(this._a32<<c|this._a16>>16-c)&65535,this._a16=(this._a16<<c|this._a00>>16-c)&65535,this._a00=this._a00<<c&65535),p||(this._a48&=65535),this},n.prototype.rotateLeft=n.prototype.rotl=function(c){if(c%=64,c==0)return this;if(c>=32){var p=this._a00;if(this._a00=this._a32,this._a32=p,p=this._a48,this._a48=this._a16,this._a16=p,c==32)return this;c-=32}var l=this._a48<<16|this._a32,y=this._a16<<16|this._a00,w=l<<c|y>>>32-c,F=y<<c|l>>>32-c;return this._a00=F&65535,this._a16=F>>>16,this._a32=w&65535,this._a48=w>>>16,this},n.prototype.rotateRight=n.prototype.rotr=function(c){if(c%=64,c==0)return this;if(c>=32){var p=this._a00;if(this._a00=this._a32,this._a32=p,p=this._a48,this._a48=this._a16,this._a16=p,c==32)return this;c-=32}var l=this._a48<<16|this._a32,y=this._a16<<16|this._a00,w=l>>>c|y<<32-c,F=y>>>c|l<<32-c;return this._a00=F&65535,this._a16=F>>>16,this._a32=w&65535,this._a48=w>>>16,this},n.prototype.clone=function(){return new n(this._a00,this._a16,this._a32,this._a48)},typeof define!="undefined"&&define.amd?define([],function(){return n}):typeof _p!="undefined"&&_p.exports?_p.exports=n:t.UINT64=n})(jA)});var W1=Y(G1=>{G1.UINT32=HA();G1.UINT64=$A()});var JA=Y((Kq,VA)=>{var Ya=W1().UINT32;Ya.prototype.xxh_update=function(t,e){var r=Il._low,n=Il._high,o,a;a=t*r,o=a>>>16,o+=e*r,o&=65535,o+=t*n;var u=this._low+(a&65535),c=u>>>16;c+=this._high+(o&65535);var p=c<<16|u&65535;p=p<<13|p>>>19,u=p&65535,c=p>>>16,r=Fl._low,n=Fl._high,a=u*r,o=a>>>16,o+=c*r,o&=65535,o+=u*n,this._low=a&65535,this._high=o&65535};var Fl=Ya("2654435761"),Il=Ya("2246822519"),GA=Ya("3266489917"),IN=Ya("668265263"),WA=Ya("374761393");function DN(t){for(var e=[],r=0,n=t.length;r<n;r++){var o=t.charCodeAt(r);o<128?e.push(o):o<2048?e.push(192|o>>6,128|o&63):o<55296||o>=57344?e.push(224|o>>12,128|o>>6&63,128|o&63):(r++,o=65536+((o&1023)<<10|t.charCodeAt(r)&1023),e.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63))}return new Uint8Array(e)}function Pu(){if(arguments.length==2)return new Pu(arguments[1]).update(arguments[0]).digest();if(!(this instanceof Pu))return new Pu(arguments[0]);YA.call(this,arguments[0])}function YA(t){return this.seed=t instanceof Ya?t.clone():Ya(t),this.v1=this.seed.clone().add(Fl).add(Il),this.v2=this.seed.clone().add(Il),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(Fl),this.total_len=0,this.memsize=0,this.memory=null,this}Pu.prototype.init=YA;Pu.prototype.update=function(t){var e=typeof t=="string",r;e&&(t=DN(t),e=!1,r=!0),typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer&&(r=!0,t=new Uint8Array(t));var n=0,o=t.length,a=n+o;if(o==0)return this;if(this.total_len+=o,this.memsize==0&&(e?this.memory="":r?this.memory=new Uint8Array(16):this.memory=new Buffer(16)),this.memsize+o<16)return e?this.memory+=t:r?this.memory.set(t.subarray(0,o),this.memsize):t.copy(this.memory,this.memsize,0,o),this.memsize+=o,this;if(this.memsize>0){e?this.memory+=t.slice(0,16-this.memsize):r?this.memory.set(t.subarray(0,16-this.memsize),this.memsize):t.copy(this.memory,this.memsize,0,16-this.memsize);var u=0;e?(this.v1.xxh_update(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2)),u+=4,this.v2.xxh_update(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2)),u+=4,this.v3.xxh_update(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2)),u+=4,this.v4.xxh_update(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2))):(this.v1.xxh_update(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2]),u+=4,this.v2.xxh_update(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2]),u+=4,this.v3.xxh_update(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2]),u+=4,this.v4.xxh_update(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2])),n+=16-this.memsize,this.memsize=0,e&&(this.memory="")}if(n<=a-16){var c=a-16;do e?(this.v1.xxh_update(t.charCodeAt(n+1)<<8|t.charCodeAt(n),t.charCodeAt(n+3)<<8|t.charCodeAt(n+2)),n+=4,this.v2.xxh_update(t.charCodeAt(n+1)<<8|t.charCodeAt(n),t.charCodeAt(n+3)<<8|t.charCodeAt(n+2)),n+=4,this.v3.xxh_update(t.charCodeAt(n+1)<<8|t.charCodeAt(n),t.charCodeAt(n+3)<<8|t.charCodeAt(n+2)),n+=4,this.v4.xxh_update(t.charCodeAt(n+1)<<8|t.charCodeAt(n),t.charCodeAt(n+3)<<8|t.charCodeAt(n+2))):(this.v1.xxh_update(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2]),n+=4,this.v2.xxh_update(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2]),n+=4,this.v3.xxh_update(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2]),n+=4,this.v4.xxh_update(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2])),n+=4;while(n<=c)}return n<a&&(e?this.memory+=t.slice(n):r?this.memory.set(t.subarray(n,a),this.memsize):t.copy(this.memory,this.memsize,n,a),this.memsize=a-n),this};Pu.prototype.digest=function(){var t=this.memory,e=typeof t=="string",r=0,n=this.memsize,o,a,u=new Ya;for(this.total_len>=16?o=this.v1.rotl(1).add(this.v2.rotl(7).add(this.v3.rotl(12).add(this.v4.rotl(18)))):o=this.seed.clone().add(WA),o.add(u.fromNumber(this.total_len));r<=n-4;)e?u.fromBits(t.charCodeAt(r+1)<<8|t.charCodeAt(r),t.charCodeAt(r+3)<<8|t.charCodeAt(r+2)):u.fromBits(t[r+1]<<8|t[r],t[r+3]<<8|t[r+2]),o.add(u.multiply(GA)).rotl(17).multiply(IN),r+=4;for(;r<n;)u.fromBits(e?t.charCodeAt(r++):t[r++],0),o.add(u.multiply(WA)).rotl(11).multiply(Fl);return a=o.clone().shiftRight(15),o.xor(a).multiply(Il),a=o.clone().shiftRight(13),o.xor(a).multiply(GA),a=o.clone().shiftRight(16),o.xor(a),this.init(this.seed),o};VA.exports=Pu});var t8=Y((zq,e8)=>{var gr=W1().UINT64,Zt=gr("11400714785074694791"),pr=gr("14029467366897019727"),XA=gr("1609587929392839161"),Dl=gr("9650029242287828579"),ZA=gr("2870177450012600261");function RN(t){for(var e=[],r=0,n=t.length;r<n;r++){var o=t.charCodeAt(r);o<128?e.push(o):o<2048?e.push(192|o>>6,128|o&63):o<55296||o>=57344?e.push(224|o>>12,128|o>>6&63,128|o&63):(r++,o=65536+((o&1023)<<10|t.charCodeAt(r)&1023),e.push(240|o>>18,128|o>>12&63,128|o>>6&63,128|o&63))}return new Uint8Array(e)}function Tu(){if(arguments.length==2)return new Tu(arguments[1]).update(arguments[0]).digest();if(!(this instanceof Tu))return new Tu(arguments[0]);QA.call(this,arguments[0])}function QA(t){return this.seed=t instanceof gr?t.clone():gr(t),this.v1=this.seed.clone().add(Zt).add(pr),this.v2=this.seed.clone().add(pr),this.v3=this.seed.clone(),this.v4=this.seed.clone().subtract(Zt),this.total_len=0,this.memsize=0,this.memory=null,this}Tu.prototype.init=QA;Tu.prototype.update=function(t){var e=typeof t=="string",r;e&&(t=RN(t),e=!1,r=!0),typeof ArrayBuffer!="undefined"&&t instanceof ArrayBuffer&&(r=!0,t=new Uint8Array(t));var n=0,o=t.length,a=n+o;if(o==0)return this;if(this.total_len+=o,this.memsize==0&&(e?this.memory="":r?this.memory=new Uint8Array(32):this.memory=new Buffer(32)),this.memsize+o<32)return e?this.memory+=t:r?this.memory.set(t.subarray(0,o),this.memsize):t.copy(this.memory,this.memsize,0,o),this.memsize+=o,this;if(this.memsize>0){e?this.memory+=t.slice(0,32-this.memsize):r?this.memory.set(t.subarray(0,32-this.memsize),this.memsize):t.copy(this.memory,this.memsize,0,32-this.memsize);var u=0;if(e){var c;c=gr(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2),this.memory.charCodeAt(u+5)<<8|this.memory.charCodeAt(u+4),this.memory.charCodeAt(u+7)<<8|this.memory.charCodeAt(u+6)),this.v1.add(c.multiply(pr)).rotl(31).multiply(Zt),u+=8,c=gr(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2),this.memory.charCodeAt(u+5)<<8|this.memory.charCodeAt(u+4),this.memory.charCodeAt(u+7)<<8|this.memory.charCodeAt(u+6)),this.v2.add(c.multiply(pr)).rotl(31).multiply(Zt),u+=8,c=gr(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2),this.memory.charCodeAt(u+5)<<8|this.memory.charCodeAt(u+4),this.memory.charCodeAt(u+7)<<8|this.memory.charCodeAt(u+6)),this.v3.add(c.multiply(pr)).rotl(31).multiply(Zt),u+=8,c=gr(this.memory.charCodeAt(u+1)<<8|this.memory.charCodeAt(u),this.memory.charCodeAt(u+3)<<8|this.memory.charCodeAt(u+2),this.memory.charCodeAt(u+5)<<8|this.memory.charCodeAt(u+4),this.memory.charCodeAt(u+7)<<8|this.memory.charCodeAt(u+6)),this.v4.add(c.multiply(pr)).rotl(31).multiply(Zt)}else{var c;c=gr(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2],this.memory[u+5]<<8|this.memory[u+4],this.memory[u+7]<<8|this.memory[u+6]),this.v1.add(c.multiply(pr)).rotl(31).multiply(Zt),u+=8,c=gr(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2],this.memory[u+5]<<8|this.memory[u+4],this.memory[u+7]<<8|this.memory[u+6]),this.v2.add(c.multiply(pr)).rotl(31).multiply(Zt),u+=8,c=gr(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2],this.memory[u+5]<<8|this.memory[u+4],this.memory[u+7]<<8|this.memory[u+6]),this.v3.add(c.multiply(pr)).rotl(31).multiply(Zt),u+=8,c=gr(this.memory[u+1]<<8|this.memory[u],this.memory[u+3]<<8|this.memory[u+2],this.memory[u+5]<<8|this.memory[u+4],this.memory[u+7]<<8|this.memory[u+6]),this.v4.add(c.multiply(pr)).rotl(31).multiply(Zt)}n+=32-this.memsize,this.memsize=0,e&&(this.memory="")}if(n<=a-32){var p=a-32;do{if(e){var c;c=gr(t.charCodeAt(n+1)<<8|t.charCodeAt(n),t.charCodeAt(n+3)<<8|t.charCodeAt(n+2),t.charCodeAt(n+5)<<8|t.charCodeAt(n+4),t.charCodeAt(n+7)<<8|t.charCodeAt(n+6)),this.v1.add(c.multiply(pr)).rotl(31).multiply(Zt),n+=8,c=gr(t.charCodeAt(n+1)<<8|t.charCodeAt(n),t.charCodeAt(n+3)<<8|t.charCodeAt(n+2),t.charCodeAt(n+5)<<8|t.charCodeAt(n+4),t.charCodeAt(n+7)<<8|t.charCodeAt(n+6)),this.v2.add(c.multiply(pr)).rotl(31).multiply(Zt),n+=8,c=gr(t.charCodeAt(n+1)<<8|t.charCodeAt(n),t.charCodeAt(n+3)<<8|t.charCodeAt(n+2),t.charCodeAt(n+5)<<8|t.charCodeAt(n+4),t.charCodeAt(n+7)<<8|t.charCodeAt(n+6)),this.v3.add(c.multiply(pr)).rotl(31).multiply(Zt),n+=8,c=gr(t.charCodeAt(n+1)<<8|t.charCodeAt(n),t.charCodeAt(n+3)<<8|t.charCodeAt(n+2),t.charCodeAt(n+5)<<8|t.charCodeAt(n+4),t.charCodeAt(n+7)<<8|t.charCodeAt(n+6)),this.v4.add(c.multiply(pr)).rotl(31).multiply(Zt)}else{var c;c=gr(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2],t[n+5]<<8|t[n+4],t[n+7]<<8|t[n+6]),this.v1.add(c.multiply(pr)).rotl(31).multiply(Zt),n+=8,c=gr(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2],t[n+5]<<8|t[n+4],t[n+7]<<8|t[n+6]),this.v2.add(c.multiply(pr)).rotl(31).multiply(Zt),n+=8,c=gr(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2],t[n+5]<<8|t[n+4],t[n+7]<<8|t[n+6]),this.v3.add(c.multiply(pr)).rotl(31).multiply(Zt),n+=8,c=gr(t[n+1]<<8|t[n],t[n+3]<<8|t[n+2],t[n+5]<<8|t[n+4],t[n+7]<<8|t[n+6]),this.v4.add(c.multiply(pr)).rotl(31).multiply(Zt)}n+=8}while(n<=p)}return n<a&&(e?this.memory+=t.slice(n):r?this.memory.set(t.subarray(n,a),this.memsize):t.copy(this.memory,this.memsize,n,a),this.memsize=a-n),this};Tu.prototype.digest=function(){var t=this.memory,e=typeof t=="string",r=0,n=this.memsize,o,a,u=new gr;for(this.total_len>=32?(o=this.v1.clone().rotl(1),o.add(this.v2.clone().rotl(7)),o.add(this.v3.clone().rotl(12)),o.add(this.v4.clone().rotl(18)),o.xor(this.v1.multiply(pr).rotl(31).multiply(Zt)),o.multiply(Zt).add(Dl),o.xor(this.v2.multiply(pr).rotl(31).multiply(Zt)),o.multiply(Zt).add(Dl),o.xor(this.v3.multiply(pr).rotl(31).multiply(Zt)),o.multiply(Zt).add(Dl),o.xor(this.v4.multiply(pr).rotl(31).multiply(Zt)),o.multiply(Zt).add(Dl)):o=this.seed.clone().add(ZA),o.add(u.fromNumber(this.total_len));r<=n-8;)e?u.fromBits(t.charCodeAt(r+1)<<8|t.charCodeAt(r),t.charCodeAt(r+3)<<8|t.charCodeAt(r+2),t.charCodeAt(r+5)<<8|t.charCodeAt(r+4),t.charCodeAt(r+7)<<8|t.charCodeAt(r+6)):u.fromBits(t[r+1]<<8|t[r],t[r+3]<<8|t[r+2],t[r+5]<<8|t[r+4],t[r+7]<<8|t[r+6]),u.multiply(pr).rotl(31).multiply(Zt),o.xor(u).rotl(27).multiply(Zt).add(Dl),r+=8;for(r+4<=n&&(e?u.fromBits(t.charCodeAt(r+1)<<8|t.charCodeAt(r),t.charCodeAt(r+3)<<8|t.charCodeAt(r+2),0,0):u.fromBits(t[r+1]<<8|t[r],t[r+3]<<8|t[r+2],0,0),o.xor(u.multiply(Zt)).rotl(23).multiply(pr).add(XA),r+=4);r<n;)u.fromBits(e?t.charCodeAt(r++):t[r++],0,0,0),o.xor(u.multiply(ZA)).rotl(11).multiply(Zt);return a=o.clone().shiftRight(33),o.xor(a).multiply(pr),a=o.clone().shiftRight(29),o.xor(a).multiply(XA),a=o.clone().shiftRight(32),o.xor(a),this.init(this.seed),o};e8.exports=Tu});var n8=Y((qq,r8)=>{r8.exports={h32:JA(),h64:t8()}});var Vi=Y(br=>{"use strict";var NN=br&&br.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},UN=br&&br.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(br,"__esModule",{value:!0});var Rn=UN(n8()),LN=Na();function MN(t,e){for(var r=new Array(t),n=typeof e=="function"?e:function(){return e},o=0;o<t;o++)r[o]=n();return r}br.allocateArray=MN;function Y1(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=Va());var n=Rn.default.h64(t,r+1),o=Rn.default.h64(t,r+2);if(e)return{first:n.toNumber(),second:o.toNumber()};var a=n.toString(16);a.length<16&&(a="0".repeat(16-a.length)+a);var u=o.toString(16);return u.length<16&&(u="0".repeat(16-u.length)+u),{first:Number(a),second:Number(u)}}br.hashTwice=Y1;function ON(t,e){e===void 0&&(e=Va());var r=Rn.default.h64(t,e+1),n=Rn.default.h64(t,e+2),o=r.toString(16);o.length<16&&(o="0".repeat(16-o.length)+o);var a=n.toString(16);return a.length<16&&(a="0".repeat(16-a.length)+a),{first:o,second:a}}br.hashTwiceAsString=ON;function KN(t,e){e===void 0&&(e=Va());var r=Rn.default.h64(t,e+1),n=Rn.default.h64(t,e+2),o=r.toString(16);o.length<16&&(o="0".repeat(16-o.length)+o);var a=n.toString(16);return a.length<16&&(a="0".repeat(16-a.length)+a),{int:{first:r.toNumber(),second:n.toNumber()},string:{first:o,second:a}}}br.allInOneHashTwice=KN;function V1(t,e,r,n){return Math.abs((e+t*r)%n)}br.doubleHashing=V1;function zN(t,e,r,n){n===void 0&&(n=Va());function o(a,u,c,p,l){if(l===void 0&&(l=[]),l.length===p)return l;var y=Y1(u,!0,n+c%a),w=V1(a,y.first,y.second,c);return l.includes(w)||l.push(w),o(a+1,u,c,p,l)}return o(1,t,e,r)}br.getDistinctIndices=zN;function qN(t,e,r,n){n===void 0&&(n=Va());for(var o=[],a=1;a<=r;a++){var u=Y1(t,!0,n+e%a);o.push(V1(a,u.first,u.second,e))}if(o.length!==r)throw new Error("report this, please, shouldnt be of different size");return o}br.getIndices=qN;function HN(t,e,r){r===void 0&&(r=Math.random),t=Math.ceil(t),e=Math.floor(e);var n=r();return Math.floor(n*(e-t+1))+t}br.randomInt=HN;function jN(t,e){for(var r=Math.max(t.length,e.length),n=LN.Buffer.allocUnsafe(r).fill(0),o=0;o<r;++o)o<t.length&&o<e.length?n[r-o-1]=t[t.length-o-1]^e[e.length-o-1]:o<t.length&&o>=e.length?n[r-o-1]^=t[t.length-o-1]:o<e.length&&o>=t.length&&(n[r-o-1]^=e[e.length-o-1]);for(var a=0,u=n.values(),c=u.next();!c.done&&c.value===0;)a++,c=u.next();var p=n.slice(a);return p}br.xorBuffer=jN;function $N(t){var e,r;if(t===null||!t)return!0;try{for(var n=NN(t),o=n.next();!o.done;o=n.next()){var a=o.value;if(a!==0)return!1}}catch(u){e={error:u}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}return!0}br.isEmptyBuffer=$N;function GN(t,e,r){switch(e===void 0&&(e=Va()),r){case 32:return Rn.default.h32(t,e).toNumber();case 64:return Rn.default.h64(t,e).toNumber();default:return Rn.default.h64(t,e).toNumber()}}br.hashAsInt=GN;function WN(t,e,r,n){e===void 0&&(e=Va()),r===void 0&&(r=16),n===void 0&&(n=64);var o;switch(n){case 32:o=Rn.default.h32(t,e);break;case 64:o=Rn.default.h64(t,e);break;default:o=Rn.default.h64(t,e);break}var a="";return r===16?(a=o.toString(r),a.length<n/4&&(a="0".repeat(n/4-a.length)+a)):r===2&&(a=J1(o.toString(16)),a.length<n&&(a="0".repeat(n-a.length)+a)),a}br.hashAsString=WN;function YN(t,e,r,n){e===void 0&&(e=Va()),r===void 0&&(r=16),n===void 0&&(n=64);var o;switch(n){case 32:o=Rn.default.h32(t,e);break;case 64:o=Rn.default.h64(t,e);break;default:o=Rn.default.h64(t,e);break}var a="";return r===16?(a=o.toString(r),a.length<n/4&&(a="0".repeat(n/4-a.length)+a)):r===2&&(a=J1(o.toString(16)),a.length<n&&(a="0".repeat(n-a.length)+a)),{int:o.toNumber(),string:a}}br.hashIntAndString=YN;function Va(){return 78187493520}br.getDefaultSeed=Va;function VN(t){return Math.ceil(Math.pow(2,Math.floor(Math.log(t)/Math.log(2))))}br.power2=VN;function J1(t){return parseInt(t,16).toString(2)}br.hex2bin=J1;function JN(t){return[128,64,32,16,8,4,2,1].map(function(e){return(e&t)>0?1:0})}br.uint8ToBits=JN;function XN(t){return t.reduce(function(e,r,n){if(r===0)return e;if(r===1)return e+Math.pow(2,7-n);throw new Error("Not binary")},0)}br.bitsToUint8=XN});var o8=Y((i8,X1)=>{(function(t,e,r){function n(c){var p=this,l=u();p.next=function(){var y=2091639*p.s0+p.c*23283064365386963e-26;return p.s0=p.s1,p.s1=p.s2,p.s2=y-(p.c=y|0)},p.c=1,p.s0=l(" "),p.s1=l(" "),p.s2=l(" "),p.s0-=l(c),p.s0<0&&(p.s0+=1),p.s1-=l(c),p.s1<0&&(p.s1+=1),p.s2-=l(c),p.s2<0&&(p.s2+=1),l=null}function o(c,p){return p.c=c.c,p.s0=c.s0,p.s1=c.s1,p.s2=c.s2,p}function a(c,p){var l=new n(c),y=p&&p.state,w=l.next;return w.int32=function(){return l.next()*4294967296|0},w.double=function(){return w()+(w()*2097152|0)*11102230246251565e-32},w.quick=w,y&&(typeof y=="object"&&o(y,l),w.state=function(){return o(l,{})}),w}function u(){var c=4022871197,p=function(l){l=String(l);for(var y=0;y<l.length;y++){c+=l.charCodeAt(y);var w=.02519603282416938*c;c=w>>>0,w-=c,w*=c,c=w>>>0,w-=c,c+=w*4294967296}return(c>>>0)*23283064365386963e-26};return p}e&&e.exports?e.exports=a:r&&r.amd?r(function(){return a}):this.alea=a})(i8,typeof X1=="object"&&X1,typeof define=="function"&&define)});var s8=Y((a8,Z1)=>{(function(t,e,r){function n(u){var c=this,p="";c.x=0,c.y=0,c.z=0,c.w=0,c.next=function(){var y=c.x^c.x<<11;return c.x=c.y,c.y=c.z,c.z=c.w,c.w^=c.w>>>19^y^y>>>8},u===(u|0)?c.x=u:p+=u;for(var l=0;l<p.length+64;l++)c.x^=p.charCodeAt(l)|0,c.next()}function o(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c}function a(u,c){var p=new n(u),l=c&&c.state,y=function(){return(p.next()>>>0)/4294967296};return y.double=function(){do var w=p.next()>>>11,F=(p.next()>>>0)/4294967296,_=(w+F)/(1<<21);while(_===0);return _},y.int32=p.next,y.quick=y,l&&(typeof l=="object"&&o(l,p),y.state=function(){return o(p,{})}),y}e&&e.exports?e.exports=a:r&&r.amd?r(function(){return a}):this.xor128=a})(a8,typeof Z1=="object"&&Z1,typeof define=="function"&&define)});var c8=Y((u8,Q1)=>{(function(t,e,r){function n(u){var c=this,p="";c.next=function(){var y=c.x^c.x>>>2;return c.x=c.y,c.y=c.z,c.z=c.w,c.w=c.v,(c.d=c.d+362437|0)+(c.v=c.v^c.v<<4^(y^y<<1))|0},c.x=0,c.y=0,c.z=0,c.w=0,c.v=0,u===(u|0)?c.x=u:p+=u;for(var l=0;l<p.length+64;l++)c.x^=p.charCodeAt(l)|0,l==p.length&&(c.d=c.x<<10^c.x>>>4),c.next()}function o(u,c){return c.x=u.x,c.y=u.y,c.z=u.z,c.w=u.w,c.v=u.v,c.d=u.d,c}function a(u,c){var p=new n(u),l=c&&c.state,y=function(){return(p.next()>>>0)/4294967296};return y.double=function(){do var w=p.next()>>>11,F=(p.next()>>>0)/4294967296,_=(w+F)/(1<<21);while(_===0);return _},y.int32=p.next,y.quick=y,l&&(typeof l=="object"&&o(l,p),y.state=function(){return o(p,{})}),y}e&&e.exports?e.exports=a:r&&r.amd?r(function(){return a}):this.xorwow=a})(u8,typeof Q1=="object"&&Q1,typeof define=="function"&&define)});var l8=Y((f8,eg)=>{(function(t,e,r){function n(u){var c=this;c.next=function(){var l=c.x,y=c.i,w,F,_;return w=l[y],w^=w>>>7,F=w^w<<24,w=l[y+1&7],F^=w^w>>>10,w=l[y+3&7],F^=w^w>>>3,w=l[y+4&7],F^=w^w<<7,w=l[y+7&7],w=w^w<<13,F^=w^w<<9,l[y]=F,c.i=y+1&7,F};function p(l,y){var w,F,_=[];if(y===(y|0))F=_[0]=y;else for(y=""+y,w=0;w<y.length;++w)_[w&7]=_[w&7]<<15^y.charCodeAt(w)+_[w+1&7]<<13;for(;_.length<8;)_.push(0);for(w=0;w<8&&_[w]===0;++w);for(w==8?F=_[7]=-1:F=_[w],l.x=_,l.i=0,w=256;w>0;--w)l.next()}p(c,u)}function o(u,c){return c.x=u.x.slice(),c.i=u.i,c}function a(u,c){u==null&&(u=+new Date);var p=new n(u),l=c&&c.state,y=function(){return(p.next()>>>0)/4294967296};return y.double=function(){do var w=p.next()>>>11,F=(p.next()>>>0)/4294967296,_=(w+F)/(1<<21);while(_===0);return _},y.int32=p.next,y.quick=y,l&&(l.x&&o(l,p),y.state=function(){return o(p,{})}),y}e&&e.exports?e.exports=a:r&&r.amd?r(function(){return a}):this.xorshift7=a})(f8,typeof eg=="object"&&eg,typeof define=="function"&&define)});var d8=Y((h8,tg)=>{(function(t,e,r){function n(u){var c=this;c.next=function(){var l=c.w,y=c.X,w=c.i,F,_;return c.w=l=l+1640531527|0,_=y[w+34&127],F=y[w=w+1&127],_^=_<<13,F^=F<<17,_^=_>>>15,F^=F>>>12,_=y[w]=_^F,c.i=w,_+(l^l>>>16)|0};function p(l,y){var w,F,_,U,V,Se=[],Q=128;for(y===(y|0)?(F=y,y=null):(y=y+"\0",F=0,Q=Math.max(Q,y.length)),_=0,U=-32;U<Q;++U)y&&(F^=y.charCodeAt((U+32)%y.length)),U===0&&(V=F),F^=F<<10,F^=F>>>15,F^=F<<4,F^=F>>>13,U>=0&&(V=V+1640531527|0,w=Se[U&127]^=F+V,_=w==0?_+1:0);for(_>=128&&(Se[(y&&y.length||0)&127]=-1),_=127,U=4*128;U>0;--U)F=Se[_+34&127],w=Se[_=_+1&127],F^=F<<13,w^=w<<17,F^=F>>>15,w^=w>>>12,Se[_]=F^w;l.w=V,l.X=Se,l.i=_}p(c,u)}function o(u,c){return c.i=u.i,c.w=u.w,c.X=u.X.slice(),c}function a(u,c){u==null&&(u=+new Date);var p=new n(u),l=c&&c.state,y=function(){return(p.next()>>>0)/4294967296};return y.double=function(){do var w=p.next()>>>11,F=(p.next()>>>0)/4294967296,_=(w+F)/(1<<21);while(_===0);return _},y.int32=p.next,y.quick=y,l&&(l.X&&o(l,p),y.state=function(){return o(p,{})}),y}e&&e.exports?e.exports=a:r&&r.amd?r(function(){return a}):this.xor4096=a})(h8,typeof tg=="object"&&tg,typeof define=="function"&&define)});var m8=Y((p8,rg)=>{(function(t,e,r){function n(u){var c=this,p="";c.next=function(){var y=c.b,w=c.c,F=c.d,_=c.a;return y=y<<25^y>>>7^w,w=w-F|0,F=F<<24^F>>>8^_,_=_-y|0,c.b=y=y<<20^y>>>12^w,c.c=w=w-F|0,c.d=F<<16^w>>>16^_,c.a=_-y|0},c.a=0,c.b=0,c.c=2654435769|0,c.d=1367130551,u===Math.floor(u)?(c.a=u/4294967296|0,c.b=u|0):p+=u;for(var l=0;l<p.length+20;l++)c.b^=p.charCodeAt(l)|0,c.next()}function o(u,c){return c.a=u.a,c.b=u.b,c.c=u.c,c.d=u.d,c}function a(u,c){var p=new n(u),l=c&&c.state,y=function(){return(p.next()>>>0)/4294967296};return y.double=function(){do var w=p.next()>>>11,F=(p.next()>>>0)/4294967296,_=(w+F)/(1<<21);while(_===0);return _},y.int32=p.next,y.quick=y,l&&(typeof l=="object"&&o(l,p),y.state=function(){return o(p,{})}),y}e&&e.exports?e.exports=a:r&&r.amd?r(function(){return a}):this.tychei=a})(p8,typeof rg=="object"&&rg,typeof define=="function"&&define)});var g8=Y((y8,wp)=>{(function(t,e,r){var n=256,o=6,a=52,u="random",c=r.pow(n,o),p=r.pow(2,a),l=p*2,y=n-1,w;function F(J,ye,Fe){var Z=[];ye=ye==!0?{entropy:!0}:ye||{};var re=Se(V(ye.entropy?[J,ue(e)]:J??Q(),3),Z),Ce=new _(Z),et=function(){for(var ct=Ce.g(o),vt=c,ht=0;ct<p;)ct=(ct+ht)*n,vt*=n,ht=Ce.g(1);for(;ct>=l;)ct/=2,vt/=2,ht>>>=1;return(ct+ht)/vt};return et.int32=function(){return Ce.g(4)|0},et.quick=function(){return Ce.g(4)/4294967296},et.double=et,Se(ue(Ce.S),e),(ye.pass||Fe||function(ct,vt,ht,He){return He&&(He.S&&U(He,Ce),ct.state=function(){return U(Ce,{})}),ht?(r[u]=ct,vt):ct})(et,re,"global"in ye?ye.global:this==r,ye.state)}function _(J){var ye,Fe=J.length,Z=this,re=0,Ce=Z.i=Z.j=0,et=Z.S=[];for(Fe||(J=[Fe++]);re<n;)et[re]=re++;for(re=0;re<n;re++)et[re]=et[Ce=y&Ce+J[re%Fe]+(ye=et[re])],et[Ce]=ye;(Z.g=function(ct){for(var vt,ht=0,He=Z.i,Bt=Z.j,Rt=Z.S;ct--;)vt=Rt[He=y&He+1],ht=ht*n+Rt[y&(Rt[He]=Rt[Bt=y&Bt+vt])+(Rt[Bt]=vt)];return Z.i=He,Z.j=Bt,ht})(n)}function U(J,ye){return ye.i=J.i,ye.j=J.j,ye.S=J.S.slice(),ye}function V(J,ye){var Fe=[],Z=typeof J,re;if(ye&&Z=="object")for(re in J)try{Fe.push(V(J[re],ye-1))}catch(Ce){}return Fe.length?Fe:Z=="string"?J:J+"\0"}function Se(J,ye){for(var Fe=J+"",Z,re=0;re<Fe.length;)ye[y&re]=y&(Z^=ye[y&re]*19)+Fe.charCodeAt(re++);return ue(ye)}function Q(){try{var J;return w&&(J=w.randomBytes)?J=J(n):(J=new Uint8Array(n),(t.crypto||t.msCrypto).getRandomValues(J)),ue(J)}catch(Z){var ye=t.navigator,Fe=ye&&ye.plugins;return[+new Date,t,Fe,t.screen,ue(e)]}}function ue(J){return String.fromCharCode.apply(0,J)}if(Se(r.random(),e),typeof wp=="object"&&wp.exports){wp.exports=F;try{w=Yh()}catch(J){}}else typeof define=="function"&&define.amd?define(function(){return F}):r["seed"+u]=F})(typeof self!="undefined"?self:y8,[],Math)});var v8=Y((jq,b8)=>{var ZN=o8(),QN=s8(),eU=c8(),tU=l8(),rU=d8(),nU=m8(),Bu=g8();Bu.alea=ZN;Bu.xor128=QN;Bu.xorwow=eU;Bu.xorshift7=tU;Bu.xor4096=rU;Bu.tychei=nU;b8.exports=Bu});var Fo=Y(Cu=>{"use strict";var iU=Cu&&Cu.__importStar||function(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},oU=Cu&&Cu.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Cu,"__esModule",{value:!0});var aU=iU(Vi()),_8=oU(v8()),sU=function(){function t(){this._seed=aU.getDefaultSeed(),this._rng=_8.default(""+this._seed)}return Object.defineProperty(t.prototype,"seed",{get:function(){return this._seed},set:function(e){this._seed=e,this._rng=_8.default(""+this._seed)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"random",{get:function(){return this._rng},enumerable:!0,configurable:!0}),t.prototype.saveAsJSON=function(){throw new Error("not-implemented")},t.fromJSON=function(e){throw new Error("not-implemented")},t}();Cu.default=sU});var x8=Y(()=>{var w8;(function(t){(function(e){var r=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:Function("return this;")(),n=o(t);typeof r.Reflect=="undefined"?r.Reflect=t:n=o(r.Reflect,n),e(n);function o(a,u){return function(c,p){typeof a[c]!="function"&&Object.defineProperty(a,c,{configurable:!0,writable:!0,value:p}),u&&u(c,p)}}})(function(e){var r=Object.prototype.hasOwnProperty,n=typeof Symbol=="function",o=n&&typeof Symbol.toPrimitive!="undefined"?Symbol.toPrimitive:"@@toPrimitive",a=n&&typeof Symbol.iterator!="undefined"?Symbol.iterator:"@@iterator",u=typeof Object.create=="function",c={__proto__:[]}instanceof Array,p=!u&&!c,l={create:u?function(){return Kr(Object.create(null))}:c?function(){return Kr({__proto__:null})}:function(){return Kr({})},has:p?function(G,te){return r.call(G,te)}:function(G,te){return te in G},get:p?function(G,te){return r.call(G,te)?G[te]:void 0}:function(G,te){return G[te]}},y=Object.getPrototypeOf(Function),w=typeof process=="object"&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL==="true",F=!w&&typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Or(),_=!w&&typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:hr(),U=!w&&typeof WeakMap=="function"?WeakMap:fe(),V=new U;function Se(G,te,me,Ie){if(Gt(me)){if(!$e(G))throw new TypeError;if(!Oe(te))throw new TypeError;return ct(G,te)}else{if(!$e(G))throw new TypeError;if(!Ct(te))throw new TypeError;if(!Ct(Ie)&&!Gt(Ie)&&!dt(Ie))throw new TypeError;return dt(Ie)&&(Ie=void 0),me=De(me),vt(G,te,me,Ie)}}e("decorate",Se);function Q(G,te){function me(Ie,Ke){if(!Ct(Ie))throw new TypeError;if(!Gt(Ke)&&!Ut(Ke))throw new TypeError;Wr(G,te,Ie,Ke)}return me}e("metadata",Q);function ue(G,te,me,Ie){if(!Ct(me))throw new TypeError;return Gt(Ie)||(Ie=De(Ie)),Wr(G,te,me,Ie)}e("defineMetadata",ue);function J(G,te,me){if(!Ct(te))throw new TypeError;return Gt(me)||(me=De(me)),He(G,te,me)}e("hasMetadata",J);function ye(G,te,me){if(!Ct(te))throw new TypeError;return Gt(me)||(me=De(me)),Bt(G,te,me)}e("hasOwnMetadata",ye);function Fe(G,te,me){if(!Ct(te))throw new TypeError;return Gt(me)||(me=De(me)),Rt(G,te,me)}e("getMetadata",Fe);function Z(G,te,me){if(!Ct(te))throw new TypeError;return Gt(me)||(me=De(me)),ir(G,te,me)}e("getOwnMetadata",Z);function re(G,te){if(!Ct(G))throw new TypeError;return Gt(te)||(te=De(te)),vr(G,te)}e("getMetadataKeys",re);function Ce(G,te){if(!Ct(G))throw new TypeError;return Gt(te)||(te=De(te)),fr(G,te)}e("getOwnMetadataKeys",Ce);function et(G,te,me){if(!Ct(te))throw new TypeError;Gt(me)||(me=De(me));var Ie=ht(te,me,!1);if(Gt(Ie)||!Ie.delete(G))return!1;if(Ie.size>0)return!0;var Ke=V.get(te);return Ke.delete(me),Ke.size>0||V.delete(te),!0}e("deleteMetadata",et);function ct(G,te){for(var me=G.length-1;me>=0;--me){var Ie=G[me],Ke=Ie(te);if(!Gt(Ke)&&!dt(Ke)){if(!Oe(Ke))throw new TypeError;te=Ke}}return te}function vt(G,te,me,Ie){for(var Ke=G.length-1;Ke>=0;--Ke){var jt=G[Ke],Ze=jt(te,me,Ie);if(!Gt(Ze)&&!dt(Ze)){if(!Ct(Ze))throw new TypeError;Ie=Ze}}return Ie}function ht(G,te,me){var Ie=V.get(G);if(Gt(Ie)){if(!me)return;Ie=new F,V.set(G,Ie)}var Ke=Ie.get(te);if(Gt(Ke)){if(!me)return;Ke=new F,Ie.set(te,Ke)}return Ke}function He(G,te,me){var Ie=Bt(G,te,me);if(Ie)return!0;var Ke=ar(te);return dt(Ke)?!1:He(G,Ke,me)}function Bt(G,te,me){var Ie=ht(te,me,!1);return Gt(Ie)?!1:de(Ie.has(G))}function Rt(G,te,me){var Ie=Bt(G,te,me);if(Ie)return ir(G,te,me);var Ke=ar(te);if(!dt(Ke))return Rt(G,Ke,me)}function ir(G,te,me){var Ie=ht(te,me,!1);if(!Gt(Ie))return Ie.get(G)}function Wr(G,te,me,Ie){var Ke=ht(me,Ie,!0);Ke.set(G,te)}function vr(G,te){var me=fr(G,te),Ie=ar(G);if(Ie===null)return me;var Ke=vr(Ie,te);if(Ke.length<=0)return me;if(me.length<=0)return Ke;for(var jt=new _,Ze=[],Qe=0,Ue=me;Qe<Ue.length;Qe++){var at=Ue[Qe],st=jt.has(at);st||(jt.add(at),Ze.push(at))}for(var Qt=0,Mn=Ke;Qt<Mn.length;Qt++){var at=Mn[Qt],st=jt.has(at);st||(jt.add(at),Ze.push(at))}return Ze}function fr(G,te){var me=[],Ie=ht(G,te,!1);if(Gt(Ie))return me;for(var Ke=Ie.keys(),jt=mt(Ke),Ze=0;;){var Qe=Ai(jt);if(!Qe)return me.length=Ze,me;var Ue=Cr(Qe);try{me[Ze]=Ue}catch(at){try{Yr(jt)}finally{throw at}}Ze++}}function Zn(G){if(G===null)return 1;switch(typeof G){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return G===null?1:6;default:return 6}}function Gt(G){return G===void 0}function dt(G){return G===null}function Nt(G){return typeof G=="symbol"}function Ct(G){return typeof G=="object"?G!==null:typeof G=="function"}function k(G,te){switch(Zn(G)){case 0:return G;case 1:return G;case 2:return G;case 3:return G;case 4:return G;case 5:return G}var me=te===3?"string":te===5?"number":"default",Ie=Xe(G,o);if(Ie!==void 0){var Ke=Ie.call(G,me);if(Ct(Ke))throw new TypeError;return Ke}return ce(G,me==="default"?"number":me)}function ce(G,te){if(te==="string"){var me=G.toString;if(We(me)){var Ie=me.call(G);if(!Ct(Ie))return Ie}var Ke=G.valueOf;if(We(Ke)){var Ie=Ke.call(G);if(!Ct(Ie))return Ie}}else{var Ke=G.valueOf;if(We(Ke)){var Ie=Ke.call(G);if(!Ct(Ie))return Ie}var jt=G.toString;if(We(jt)){var Ie=jt.call(G);if(!Ct(Ie))return Ie}}throw new TypeError}function de(G){return!!G}function Be(G){return""+G}function De(G){var te=k(G,3);return Nt(te)?te:Be(te)}function $e(G){return Array.isArray?Array.isArray(G):G instanceof Object?G instanceof Array:Object.prototype.toString.call(G)==="[object Array]"}function We(G){return typeof G=="function"}function Oe(G){return typeof G=="function"}function Ut(G){switch(Zn(G)){case 3:return!0;case 4:return!0;default:return!1}}function Xe(G,te){var me=G[te];if(me!=null){if(!We(me))throw new TypeError;return me}}function mt(G){var te=Xe(G,a);if(!We(te))throw new TypeError;var me=te.call(G);if(!Ct(me))throw new TypeError;return me}function Cr(G){return G.value}function Ai(G){var te=G.next();return te.done?!1:te}function Yr(G){var te=G.return;te&&te.call(G)}function ar(G){var te=Object.getPrototypeOf(G);if(typeof G!="function"||G===y||te!==y)return te;var me=G.prototype,Ie=me&&Object.getPrototypeOf(me);if(Ie==null||Ie===Object.prototype)return te;var Ke=Ie.constructor;return typeof Ke!="function"||Ke===G?te:Ke}function Or(){var G={},te=[],me=function(){function Ze(Qe,Ue,at){this._index=0,this._keys=Qe,this._values=Ue,this._selector=at}return Ze.prototype["@@iterator"]=function(){return this},Ze.prototype[a]=function(){return this},Ze.prototype.next=function(){var Qe=this._index;if(Qe>=0&&Qe<this._keys.length){var Ue=this._selector(this._keys[Qe],this._values[Qe]);return Qe+1>=this._keys.length?(this._index=-1,this._keys=te,this._values=te):this._index++,{value:Ue,done:!1}}return{value:void 0,done:!0}},Ze.prototype.throw=function(Qe){throw this._index>=0&&(this._index=-1,this._keys=te,this._values=te),Qe},Ze.prototype.return=function(Qe){return this._index>=0&&(this._index=-1,this._keys=te,this._values=te),{value:Qe,done:!0}},Ze}();return function(){function Ze(){this._keys=[],this._values=[],this._cacheKey=G,this._cacheIndex=-2}return Object.defineProperty(Ze.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),Ze.prototype.has=function(Qe){return this._find(Qe,!1)>=0},Ze.prototype.get=function(Qe){var Ue=this._find(Qe,!1);return Ue>=0?this._values[Ue]:void 0},Ze.prototype.set=function(Qe,Ue){var at=this._find(Qe,!0);return this._values[at]=Ue,this},Ze.prototype.delete=function(Qe){var Ue=this._find(Qe,!1);if(Ue>=0){for(var at=this._keys.length,st=Ue+1;st<at;st++)this._keys[st-1]=this._keys[st],this._values[st-1]=this._values[st];return this._keys.length--,this._values.length--,Qe===this._cacheKey&&(this._cacheKey=G,this._cacheIndex=-2),!0}return!1},Ze.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=G,this._cacheIndex=-2},Ze.prototype.keys=function(){return new me(this._keys,this._values,Ie)},Ze.prototype.values=function(){return new me(this._keys,this._values,Ke)},Ze.prototype.entries=function(){return new me(this._keys,this._values,jt)},Ze.prototype["@@iterator"]=function(){return this.entries()},Ze.prototype[a]=function(){return this.entries()},Ze.prototype._find=function(Qe,Ue){return this._cacheKey!==Qe&&(this._cacheIndex=this._keys.indexOf(this._cacheKey=Qe)),this._cacheIndex<0&&Ue&&(this._cacheIndex=this._keys.length,this._keys.push(Qe),this._values.push(void 0)),this._cacheIndex},Ze}();function Ie(Ze,Qe){return Ze}function Ke(Ze,Qe){return Qe}function jt(Ze,Qe){return[Ze,Qe]}}function hr(){return function(){function G(){this._map=new F}return Object.defineProperty(G.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),G.prototype.has=function(te){return this._map.has(te)},G.prototype.add=function(te){return this._map.set(te,te),this},G.prototype.delete=function(te){return this._map.delete(te)},G.prototype.clear=function(){this._map.clear()},G.prototype.keys=function(){return this._map.keys()},G.prototype.values=function(){return this._map.values()},G.prototype.entries=function(){return this._map.entries()},G.prototype["@@iterator"]=function(){return this.keys()},G.prototype[a]=function(){return this.keys()},G}()}function fe(){var G=16,te=l.create(),me=Ie();return function(){function Ue(){this._key=Ie()}return Ue.prototype.has=function(at){var st=Ke(at,!1);return st!==void 0?l.has(st,this._key):!1},Ue.prototype.get=function(at){var st=Ke(at,!1);return st!==void 0?l.get(st,this._key):void 0},Ue.prototype.set=function(at,st){var Qt=Ke(at,!0);return Qt[this._key]=st,this},Ue.prototype.delete=function(at){var st=Ke(at,!1);return st!==void 0?delete st[this._key]:!1},Ue.prototype.clear=function(){this._key=Ie()},Ue}();function Ie(){var Ue;do Ue="@@WeakMap@@"+Qe();while(l.has(te,Ue));return te[Ue]=!0,Ue}function Ke(Ue,at){if(!r.call(Ue,me)){if(!at)return;Object.defineProperty(Ue,me,{value:l.create()})}return Ue[me]}function jt(Ue,at){for(var st=0;st<at;++st)Ue[st]=Math.random()*255|0;return Ue}function Ze(Ue){return typeof Uint8Array=="function"?typeof crypto!="undefined"?crypto.getRandomValues(new Uint8Array(Ue)):typeof msCrypto!="undefined"?msCrypto.getRandomValues(new Uint8Array(Ue)):jt(new Uint8Array(Ue),Ue):jt(new Array(Ue),Ue)}function Qe(){var Ue=Ze(G);Ue[6]=Ue[6]&79|64,Ue[8]=Ue[8]&191|128;for(var at="",st=0;st<G;++st){var Qt=Ue[st];(st===4||st===6||st===8)&&(at+="-"),Qt<16&&(at+="0"),at+=Qt.toString(16).toLowerCase()}return at}}function Kr(G){return G.__=void 0,delete G.__,G}})})(w8||(w8={}))});var yi=Y(Ji=>{"use strict";var uU=Ji&&Ji.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,a=[],u;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(c){u={error:c}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return a},cU=Ji&&Ji.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(uU(arguments[e]));return t};Object.defineProperty(Ji,"__esModule",{value:!0});x8();function Rl(t){return t==null?t:Array.isArray(t)?t.map(Rl):typeof t=="object"?"saveAsJSON"in t?t.saveAsJSON():Object.assign({},t):t}Ji.cloneField=Rl;function fU(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(n){var o={type:t};return e.forEach(function(a){o[a]=Rl(n[a])}),o}}Ji.cloneObject=fU;function lU(t){return function(e){return e.prototype.saveAsJSON=function(){return t.export(this)},e.fromJSON=function(r){return t.import(r)},e}}Ji.Exportable=lU;var ng=Symbol("bloom-filters:exportable:class-name"),Yc=Symbol("bloom-filters:exportable:fields"),Vc=Symbol("bloom-filters:exportable:constructor-parameters");function hU(t,e){return t===void 0&&(t=Rl),e===void 0&&(e=function(r){return r}),function(r,n){var o=[];Reflect.hasMetadata(Yc,r)&&(o=Reflect.getMetadata(Yc,r)),o.push({name:n,exporter:t,importer:e}),Reflect.defineMetadata(Yc,o,r)}}Ji.Field=hU;function dU(t){return function(e,r,n){var o=new Map;Reflect.hasMetadata(Vc,e)&&(o=Reflect.getMetadata(Vc,e)),o.set(t,n),Reflect.defineMetadata(Vc,o,e)}}Ji.Parameter=dU;function pU(t,e){return e===void 0&&(e=[]),function(r){if(Reflect.defineMetadata(ng,t,r.prototype),!Reflect.hasMetadata(Yc,r.prototype)||e.length===0)throw new SyntaxError("No exported fields declared when @AutoExportable is called");Reflect.hasMetadata(Vc,r)||Reflect.defineMetadata(Vc,new Map,r),r.prototype.saveAsJSON=function(){var n=this,o={type:Reflect.getMetadata(ng,r.prototype)},a=Reflect.getMetadata(Yc,r.prototype);return a.forEach(function(u){o[u.name]=u.exporter(n[u.name])}),e.forEach(function(u){o[u]=Rl(n[u])}),o},r.fromJSON=function(n){var o=Reflect.getMetadata(ng,r.prototype),a=Reflect.getMetadata(Vc,r),u=Reflect.getMetadata(Yc,r.prototype);if(n.type!==o)throw new Error("Cannot create an object "+o+' from a JSON export with type "'+n.type+'"');var c=[],p=[];e.map(function(y){return{name:y,importer:function(w){return w}}}).concat(u).forEach(function(y){if(!(y.name in n))throw new Error('Invalid import: required field "'+y+'" not found in JSON export "'+n+'"');a.has(y.name)?c[a.get(y.name)]=y.importer(n[y.name]):p.push({name:y.name,value:y.importer(n[y.name])})});var l=new(r.bind.apply(r,cU([void 0],c)));return p.forEach(function(y){l[y.name]=y.value}),l}}}Ji.AutoExportable=pU});var kp=Y(xp=>{"use strict";Object.defineProperty(xp,"__esModule",{value:!0});function mU(t,e){return Math.ceil(-(t*Math.log(e)/Math.pow(Math.log(2),2)))}xp.optimalFilterSize=mU;function yU(t,e){return Math.ceil(t/e*Math.log(2))}xp.optimalHashes=yU});var E8=Y(gi=>{"use strict";var gU=gi&&gi.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Nl=gi&&gi.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},Ul=gi&&gi.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},k8=gi&&gi.__param||function(t,e){return function(r,n){e(r,n,t)}},bU=gi&&gi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gi,"__esModule",{value:!0});var vU=bU(Fo()),Fu=yi(),A8=kp(),Ll=Vi(),_U=function(t){gU(e,t);function e(n,o){var a=t.call(this)||this;if(o<1)throw new Error("A BloomFilter cannot uses less than one hash function, while you tried to use "+o+".");return a._size=n,a._nbHashes=o,a._filter=Ll.allocateArray(a._size,0),a._length=0,a}r=e,e.create=function(n,o){var a=A8.optimalFilterSize(n,o),u=A8.optimalHashes(a,n);return new r(a,u)},e.from=function(n,o){var a=Array.from(n),u=r.create(a.length,o);return a.forEach(function(c){return u.add(c)}),u},e.fromBytes=function(n,o){for(var a=[],u=0;u<n.length;u++){var c=Ll.uint8ToBits(n[u]);a=a.concat(c)}var p=new r(a.length,o);return p._filter=a,p},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),e.prototype.add=function(n){for(var o=Ll.getDistinctIndices(n,this._size,this._nbHashes,this.seed),a=0;a<o.length;a++)this._filter[o[a]]=1;this._length++},e.prototype.has=function(n){for(var o=Ll.getDistinctIndices(n,this._size,this._nbHashes,this.seed),a=0;a<o.length;a++)if(!this._filter[o[a]])return!1;return!0},e.prototype.rate=function(){return Math.pow(1-Math.exp(-this._nbHashes*this._length/this._size),this._nbHashes)},e.prototype.equals=function(n){return this._size!==n._size||this._nbHashes!==n._nbHashes?!1:this._filter.every(function(o,a){return n._filter[a]===o})},e.prototype.toBytes=function(){for(var n=new Uint8Array(Math.ceil(this._size/8)),o=0;o<n.length;o++){var a=this._filter.slice(o*8,o*8+8);n[o]=Ll.bitsToUint8(a)}return n};var r;return Nl([Fu.Field(),Ul("design:type",Number)],e.prototype,"_size",void 0),Nl([Fu.Field(),Ul("design:type",Number)],e.prototype,"_nbHashes",void 0),Nl([Fu.Field(),Ul("design:type",Array)],e.prototype,"_filter",void 0),Nl([Fu.Field(),Ul("design:type",Number)],e.prototype,"_length",void 0),e=r=Nl([Fu.AutoExportable("BloomFilter",["_seed"]),k8(0,Fu.Parameter("_size")),k8(1,Fu.Parameter("_nbHashes")),Ul("design:paramtypes",[Number,Number])],e),e}(vU.default);gi.default=_U});var T8=Y(bi=>{"use strict";var wU=bi&&bi.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ml=bi&&bi.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},Ol=bi&&bi.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},S8=bi&&bi.__param||function(t,e){return function(r,n){e(r,n,t)}},xU=bi&&bi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(bi,"__esModule",{value:!0});var kU=xU(Fo()),Iu=yi(),P8=kp(),Ap=Vi(),AU=function(t){wU(e,t);function e(n,o){var a=t.call(this)||this;if(o<1)throw new Error("A CountingBloomFilter must used at least one hash function, but you tried to use "+o+" functions. Consider increasing it.");return a._size=n,a._nbHashes=o,a._filter=Ap.allocateArray(a._size,function(){return[0,0]}),a._length=0,a}r=e,e.create=function(n,o){var a=P8.optimalFilterSize(n,o);return new r(a,P8.optimalHashes(a,n))},e.from=function(n,o){var a=Array.from(n),u=r.create(a.length,o);return a.forEach(function(c){return u.add(c)}),u},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),e.prototype.add=function(n){for(var o=Ap.getDistinctIndices(n,this._size,this._nbHashes,this.seed),a=0;a<o.length;a++)this._filter[o[a]][1]+=1,this._filter[o[a]][1]>0&&(this._filter[o[a]][0]=1);this._length++},e.prototype.remove=function(n){for(var o=Ap.getDistinctIndices(n,this._size,this._nbHashes,this.seed),a=!0,u=0;u<o.length;u++)this._filter[o[u]][1]-=1,this._filter[o[u]][1]<=0&&(this._filter[o[u]][0]=0);return this._length--,a},e.prototype.has=function(n){for(var o=Ap.getDistinctIndices(n,this._size,this._nbHashes,this.seed),a=0;a<o.length;a++)if(!this._filter[o[a]][0])return!1;return!0},e.prototype.rate=function(){return Math.pow(1-Math.exp(-this._nbHashes*this._length/this._size),this._nbHashes)},e.prototype.equals=function(n){return this._size!==n._size||this._nbHashes!==n._nbHashes||this._length!==n._length?!1:this._filter.every(function(o,a){return n._filter[a][0]===o[0]&&n._filter[a][1]===o[1]})};var r;return Ml([Iu.Field(),Ol("design:type",Number)],e.prototype,"_size",void 0),Ml([Iu.Field(),Ol("design:type",Number)],e.prototype,"_nbHashes",void 0),Ml([Iu.Field(),Ol("design:type",Array)],e.prototype,"_filter",void 0),Ml([Iu.Field(),Ol("design:type",Number)],e.prototype,"_length",void 0),e=r=Ml([Iu.AutoExportable("CountingBloomFilter",["_seed"]),S8(0,Iu.Parameter("_size")),S8(1,Iu.Parameter("_nbHashes")),Ol("design:paramtypes",[Number,Number])],e),e}(kU.default);bi.default=AU});var B8=Y(vi=>{"use strict";var EU=vi&&vi.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Us=vi&&vi.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},Ls=vi&&vi.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},Ep=vi&&vi.__param||function(t,e){return function(r,n){e(r,n,t)}},SU=vi&&vi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(vi,"__esModule",{value:!0});var PU=SU(Fo()),Xi=yi(),Sp=Vi();function TU(t,e){return Math.ceil(Math.log(t)/Math.log(e))}function BU(t,e,r){return Math.ceil(t*-Math.log(e)/(Math.log(r)*Math.log(1-r)))}function CU(t,e,r){return Math.ceil(t*(Math.log(e)*Math.log(1-e))/-(r*Math.log(e)))}var FU=function(t){EU(e,t);function e(n,o,a,u){var c=t.call(this)||this;return c._size=n,c._nbHashes=o,c._loadFactor=a,c._m=Math.ceil(c._size/c._nbHashes),c._filter=Sp.allocateArray(c._nbHashes,function(){return Sp.allocateArray(c._m,0)}),c._capacity=u!==void 0?u:CU(c._size,a,o),c._length=0,c}r=e,e.create=function(n,o,a){a===void 0&&(a=.5);var u=BU(n,o,a),c=TU(o,a);return new r(u,c,a,n)},e.from=function(n,o,a){a===void 0&&(a=.5);var u=Array.from(n),c=r.create(u.length,o,a);return u.forEach(function(p){return c.add(p)}),c},Object.defineProperty(e.prototype,"capacity",{get:function(){return this._capacity},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"loadFactor",{get:function(){return this._loadFactor},enumerable:!0,configurable:!0}),e.prototype.add=function(n){for(var o=Sp.getIndices(n,this._m,this._nbHashes,this.seed),a=0;a<this._nbHashes;a++)this._filter[a][o[a]]=1;this._length++},e.prototype.has=function(n){for(var o=Sp.getIndices(n,this._m,this._nbHashes,this.seed),a=0;a<this._nbHashes;a++)if(!this._filter[a][o[a]])return!1;return!0},e.prototype.rate=function(){var n=this._currentload();return Math.pow(n,this._nbHashes)},e.prototype.equals=function(n){return this._size!==n._size||this._nbHashes!==n._nbHashes||this._length!==n._length||this._loadFactor!==n._loadFactor?!1:this._filter.every(function(o,a){return n._filter[a].every(function(u,c){return o[c]===u})})},e.prototype._currentload=function(){var n=this._filter.map(function(a){return a.reduce(function(u,c){return u+c},0)}),o=n.reduce(function(a,u){return a+u},0);return o/this._size};var r;return Us([Xi.Field(),Ls("design:type",Number)],e.prototype,"_size",void 0),Us([Xi.Field(),Ls("design:type",Number)],e.prototype,"_nbHashes",void 0),Us([Xi.Field(),Ls("design:type",Number)],e.prototype,"_loadFactor",void 0),Us([Xi.Field(),Ls("design:type",Number)],e.prototype,"_m",void 0),Us([Xi.Field(),Ls("design:type",Array)],e.prototype,"_filter",void 0),Us([Xi.Field(),Ls("design:type",Number)],e.prototype,"_capacity",void 0),Us([Xi.Field(),Ls("design:type",Number)],e.prototype,"_length",void 0),e=r=Us([Xi.AutoExportable("PartitionedBloomFilter",["_seed"]),Ep(0,Xi.Parameter("_size")),Ep(1,Xi.Parameter("_nbHashes")),Ep(2,Xi.Parameter("_loadFactor")),Ep(3,Xi.Parameter("_capacity")),Ls("design:paramtypes",[Number,Number,Number,Number])],e),e}(PU.default);vi.default=FU});var ig=Y(Nn=>{"use strict";var IU=Nn&&Nn.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Kl=Nn&&Nn.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},zl=Nn&&Nn.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},C8=Nn&&Nn.__param||function(t,e){return function(r,n){e(r,n,t)}},DU=Nn&&Nn.__values||function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},RU=Nn&&Nn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Nn,"__esModule",{value:!0});var NU=RU(Fo()),Du=yi(),Pp=Vi(),UU=function(t){IU(e,t);function e(n,o){var a=t.call(this)||this;return a._columns=n,a._rows=o,a._matrix=Pp.allocateArray(a._rows,function(){return Pp.allocateArray(a._columns,0)}),a._allSums=0,a}r=e,e.create=function(n,o){o===void 0&&(o=.999);var a=Math.ceil(Math.E/n),u=Math.ceil(Math.log(1/o));return new r(a,u)},e.from=function(n,o,a){var u,c;a===void 0&&(a=.999);var p=r.create(o,a);try{for(var l=DU(n),y=l.next();!y.done;y=l.next()){var w=y.value;p.update(w)}}catch(F){u={error:F}}finally{try{y&&!y.done&&(c=l.return)&&c.call(l)}finally{if(u)throw u.error}}return p},Object.defineProperty(e.prototype,"columns",{get:function(){return this._columns},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"sum",{get:function(){return this._allSums},enumerable:!0,configurable:!0}),e.prototype.update=function(n,o){o===void 0&&(o=1),this._allSums+=o;for(var a=Pp.getDistinctIndices(n,this._columns,this._rows,this.seed),u=0;u<this._rows;u++)this._matrix[u][a[u]]+=o},e.prototype.count=function(n){for(var o=Infinity,a=Pp.getDistinctIndices(n,this._columns,this._rows,this.seed),u=0;u<this._rows;u++){var c=this._matrix[u][a[u]];o=Math.min(c,o)}return o},e.prototype.equals=function(n){if(this._columns!==n._columns||this._rows!==n._rows)return!1;for(var o=0;o<this._rows;o++)for(var a=0;a<this._columns;a++)if(this._matrix[o][a]!==n._matrix[o][a])return!1;return!0},e.prototype.merge=function(n){if(this._columns!==n._columns)throw new Error("Cannot merge two sketches with different number of columns");if(this._rows!==n._rows)throw new Error("Cannot merge two sketches with different number of rows");for(var o=0;o<this._rows;o++)for(var a=0;a<this._columns;a++)this._matrix[o][a]+=n._matrix[o][a]},e.prototype.clone=function(){var n=new r(this._columns,this._rows);return n.merge(this),n.seed=this.seed,n};var r;return Kl([Du.Field(),zl("design:type",Number)],e.prototype,"_columns",void 0),Kl([Du.Field(),zl("design:type",Number)],e.prototype,"_rows",void 0),Kl([Du.Field(),zl("design:type",Array)],e.prototype,"_matrix",void 0),Kl([Du.Field(),zl("design:type",Number)],e.prototype,"_allSums",void 0),e=r=Kl([Du.AutoExportable("CountMinSketch",["_seed"]),C8(0,Du.Parameter("_columns")),C8(1,Du.Parameter("_rows")),zl("design:paramtypes",[Number,Number])],e),e}(NU.default);Nn.default=UU});var I8=Y(_i=>{"use strict";var LU=_i&&_i.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),ql=_i&&_i.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},Hl=_i&&_i.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},MU=_i&&_i.__param||function(t,e){return function(r,n){e(r,n,t)}},OU=_i&&_i.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(_i,"__esModule",{value:!0});var KU=OU(Fo()),Jc=yi(),F8=Vi(),og=Math.pow(2,32);function zU(t){switch(t){case 16:return .673;case 32:return .697;case 64:return .709;default:return .7213/(1+1.079/t)}}var qU=function(t){LU(e,t);function e(n){var o=t.call(this)||this;return o._nbRegisters=n,o._nbBytesPerHash=Math.round(Math.log2(n)),o._correctionBias=zU(n),o._registers=F8.allocateArray(o._nbRegisters,0),o}r=e,Object.defineProperty(e.prototype,"nbRegisters",{get:function(){return this._nbRegisters},enumerable:!0,configurable:!0}),e.prototype.update=function(n){for(var o=F8.hashAsInt(n,this.seed).toString(2),a=1+parseInt(o.slice(0,this._nbBytesPerHash-1),2),u=o.slice(this._nbBytesPerHash),c=0;u[c]!=="1"&&c<u.length-1;)c++;this._registers[a]=Math.max(this._registers[a],c)},e.prototype.count=function(n){n===void 0&&(n=!1);var o=this._registers.reduce(function(u,c){return u+Math.pow(2,-c)},0),a=this._correctionBias*Math.pow(this._nbRegisters,2)/o;return a>og/30&&(a=-og*Math.log(1-a/og)),n&&(a=Math.round(a)),a},e.prototype.accuracy=function(){return 1.04/Math.sqrt(this._nbRegisters)},e.prototype.merge=function(n){if(this.nbRegisters!==n.nbRegisters)throw new Error("Two HyperLogLog must have the same number of registers to be merged. Tried to merge two HyperLogLog with m = "+this.nbRegisters+" and m = "+n.nbRegisters);for(var o=new r(this.nbRegisters),a=0;a<this.nbRegisters-1;a++)o._registers[a]=Math.max(this._registers[a],n._registers[a]);return o},e.prototype.equals=function(n){if(this.nbRegisters!==n.nbRegisters)return!1;for(var o=0;o<this.nbRegisters-1;o++)if(this._registers[o]!==n._registers[o])return!1;return!0};var r;return ql([Jc.Field(),Hl("design:type",Number)],e.prototype,"_nbRegisters",void 0),ql([Jc.Field(),Hl("design:type",Number)],e.prototype,"_nbBytesPerHash",void 0),ql([Jc.Field(),Hl("design:type",Number)],e.prototype,"_correctionBias",void 0),ql([Jc.Field(),Hl("design:type",Array)],e.prototype,"_registers",void 0),e=r=ql([Jc.AutoExportable("HyperLogLog",["_seed"]),MU(0,Jc.Parameter("_nbRegisters")),Hl("design:paramtypes",[Number])],e),e}(KU.default);_i.default=qU});var Tp=Y((Xc,jl)=>{(function(){var t,e="4.17.21",r=200,n="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,p="__lodash_placeholder__",l=1,y=2,w=4,F=1,_=2,U=1,V=2,Se=4,Q=8,ue=16,J=32,ye=64,Fe=128,Z=256,re=512,Ce=30,et="...",ct=800,vt=16,ht=1,He=2,Bt=3,Rt=1/0,ir=9007199254740991,Wr=17976931348623157e292,vr=0/0,fr=4294967295,Zn=fr-1,Gt=fr>>>1,dt=[["ary",Fe],["bind",U],["bindKey",V],["curry",Q],["curryRight",ue],["flip",re],["partial",J],["partialRight",ye],["rearg",Z]],Nt="[object Arguments]",Ct="[object Array]",k="[object AsyncFunction]",ce="[object Boolean]",de="[object Date]",Be="[object DOMException]",De="[object Error]",$e="[object Function]",We="[object GeneratorFunction]",Oe="[object Map]",Ut="[object Number]",Xe="[object Null]",mt="[object Object]",Cr="[object Promise]",Ai="[object Proxy]",Yr="[object RegExp]",ar="[object Set]",Or="[object String]",hr="[object Symbol]",fe="[object Undefined]",Kr="[object WeakMap]",G="[object WeakSet]",te="[object ArrayBuffer]",me="[object DataView]",Ie="[object Float32Array]",Ke="[object Float64Array]",jt="[object Int8Array]",Ze="[object Int16Array]",Qe="[object Int32Array]",Ue="[object Uint8Array]",at="[object Uint8ClampedArray]",st="[object Uint16Array]",Qt="[object Uint32Array]",Mn=/\b__p \+= '';/g,Qi=/\b(__p \+=) '' \+/g,Ei=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Si=/&(?:amp|lt|gt|quot|#39);/g,Pi=/[&<>"']/g,nn=RegExp(Si.source),No=RegExp(Pi.source),Uo=/<%-([\s\S]+?)%>/g,eo=/<%([\s\S]+?)%>/g,Ti=/<%=([\s\S]+?)%>/g,to=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Lo=/^\w*$/,Mo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Bi=/[\\^$.*+?()[\]{}|]/g,Oo=RegExp(Bi.source),Ci=/^\s+/,sr=/\s/,_r=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Qn=/\{\n\/\* \[wrapped with (.+)\] \*/,On=/,? & /,ro=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,no=/[()=,{}\[\]\/\s]/,io=/\\(\\)?/g,Ko=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,oo=/\w*$/,zo=/^[-+]0x[0-9a-f]+$/i,qo=/^0b[01]+$/i,ei=/^\[object .+?Constructor\]$/,Ho=/^0o[0-7]+$/i,jo=/^(?:0|[1-9]\d*)$/,ao=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pn=/($^)/,$o=/['\n\r\u2028\u2029\\]/g,es="\\ud800-\\udfff",Ou="\\u0300-\\u036f",Ku="\\ufe20-\\ufe2f",so="\\u20d0-\\u20ff",ts=Ou+Ku+so,kn="\\u2700-\\u27bf",rs="a-z\\xdf-\\xf6\\xf8-\\xff",ba="\\xac\\xb1\\xd7\\xf7",ns="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zu="\\u2000-\\u206f",Ks=" \\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",Go="A-Z\\xc0-\\xd6\\xd8-\\xde",uo="\\ufe0e\\ufe0f",Fi=ba+ns+zu+Ks,E="['\u2019]",R="["+es+"]",T="["+Fi+"]",K="["+ts+"]",H="\\d+",M="["+kn+"]",ae="["+rs+"]",ge="[^"+es+Fi+H+kn+rs+Go+"]",_e="\\ud83c[\\udffb-\\udfff]",ke="(?:"+K+"|"+_e+")",Ae="[^"+es+"]",qe="(?:\\ud83c[\\udde6-\\uddff]){2}",rt="[\\ud800-\\udbff][\\udc00-\\udfff]",ft="["+Go+"]",kt="\\u200d",Wt="(?:"+ae+"|"+ge+")",Lt="(?:"+ft+"|"+ge+")",Ar="(?:"+E+"(?:d|ll|m|re|s|t|ve))?",Ii="(?:"+E+"(?:D|LL|M|RE|S|T|VE))?",Wo=ke+"?",qu="["+uo+"]?",zs="(?:"+kt+"(?:"+[Ae,qe,rt].join("|")+")"+qu+Wo+")*",ff="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Hu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Di=qu+Wo+zs,ju="(?:"+[M,qe,rt].join("|")+")"+Di,zp="(?:"+[Ae+K+"?",K,qe,rt,R].join("|")+")",lf=RegExp(E,"g"),Ql=RegExp(K,"g"),$u=RegExp(_e+"(?="+_e+")|"+zp+Di,"g"),qp=RegExp([ft+"?"+ae+"+"+Ar+"(?="+[T,ft,"$"].join("|")+")",Lt+"+"+Ii+"(?="+[T,ft+Wt,"$"].join("|")+")",ft+"?"+Wt+"+"+Ar,ft+"+"+Ii,Hu,ff,H,ju].join("|"),"g"),Hp=RegExp("["+kt+es+ts+uo+"]"),jp=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,$p=["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"],va=-1,or={};or[Ie]=or[Ke]=or[jt]=or[Ze]=or[Qe]=or[Ue]=or[at]=or[st]=or[Qt]=!0,or[Nt]=or[Ct]=or[te]=or[ce]=or[me]=or[de]=or[De]=or[$e]=or[Oe]=or[Ut]=or[mt]=or[Yr]=or[ar]=or[Or]=or[Kr]=!1;var er={};er[Nt]=er[Ct]=er[te]=er[me]=er[ce]=er[de]=er[Ie]=er[Ke]=er[jt]=er[Ze]=er[Qe]=er[Oe]=er[Ut]=er[mt]=er[Yr]=er[ar]=er[Or]=er[hr]=er[Ue]=er[at]=er[st]=er[Qt]=!0,er[De]=er[$e]=er[Kr]=!1;var eh={\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"},th={"&":"&","<":"<",">":">",'"':""","'":"'"},rh={"&":"&","<":"<",">":">",""":'"',"'":"'"},Gu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},_a=parseFloat,Wu=parseInt,hf=typeof global=="object"&&global&&global.Object===Object&&global,nh=typeof self=="object"&&self&&self.Object===Object&&self,Fr=hf||nh||Function("return this")(),Yu=typeof Xc=="object"&&Xc&&!Xc.nodeType&&Xc,tr=Yu&&typeof jl=="object"&&jl&&!jl.nodeType&&jl,ih=tr&&tr.exports===Yu,Vu=ih&&hf.process,mn=function(){try{var q=tr&&tr.require&&tr.require("util").types;return q||Vu&&Vu.binding&&Vu.binding("util")}catch(ie){}}(),df=mn&&mn.isArrayBuffer,oh=mn&&mn.isDate,pf=mn&&mn.isMap,is=mn&&mn.isRegExp,mf=mn&&mn.isSet,yf=mn&&mn.isTypedArray;function yn(q,ie,X){switch(X.length){case 0:return q.call(ie);case 1:return q.call(ie,X[0]);case 2:return q.call(ie,X[0],X[1]);case 3:return q.call(ie,X[0],X[1],X[2])}return q.apply(ie,X)}function ah(q,ie,X,ze){for(var tt=-1,It=q==null?0:q.length;++tt<It;){var Er=q[tt];ie(ze,Er,X(Er),q)}return ze}function An(q,ie){for(var X=-1,ze=q==null?0:q.length;++X<ze&&ie(q[X],X,q)!==!1;);return q}function wa(q,ie){for(var X=q==null?0:q.length;X--&&ie(q[X],X,q)!==!1;);return q}function Ju(q,ie){for(var X=-1,ze=q==null?0:q.length;++X<ze;)if(!ie(q[X],X,q))return!1;return!0}function Yo(q,ie){for(var X=-1,ze=q==null?0:q.length,tt=0,It=[];++X<ze;){var Er=q[X];ie(Er,X,q)&&(It[tt++]=Er)}return It}function Xu(q,ie){var X=q==null?0:q.length;return!!X&&I(q,ie,0)>-1}function gf(q,ie,X){for(var ze=-1,tt=q==null?0:q.length;++ze<tt;)if(X(ie,q[ze]))return!0;return!1}function lr(q,ie){for(var X=-1,ze=q==null?0:q.length,tt=Array(ze);++X<ze;)tt[X]=ie(q[X],X,q);return tt}function Vo(q,ie){for(var X=-1,ze=ie.length,tt=q.length;++X<ze;)q[tt+X]=ie[X];return q}function bf(q,ie,X,ze){var tt=-1,It=q==null?0:q.length;for(ze&&It&&(X=q[++tt]);++tt<It;)X=ie(X,q[tt],tt,q);return X}function Gp(q,ie,X,ze){var tt=q==null?0:q.length;for(ze&&tt&&(X=q[--tt]);tt--;)X=ie(X,q[tt],tt,q);return X}function g(q,ie){for(var X=-1,ze=q==null?0:q.length;++X<ze;)if(ie(q[X],X,q))return!0;return!1}var d=Me("length");function h(q){return q.split("")}function b(q){return q.match(ro)||[]}function S(q,ie,X){var ze;return X(q,function(tt,It,Er){if(ie(tt,It,Er))return ze=It,!1}),ze}function C(q,ie,X,ze){for(var tt=q.length,It=X+(ze?1:-1);ze?It--:++It<tt;)if(ie(q[It],It,q))return It;return-1}function I(q,ie,X){return ie===ie?Yp(q,ie,X):C(q,oe,X)}function W(q,ie,X,ze){for(var tt=X-1,It=q.length;++tt<It;)if(ze(q[tt],ie))return tt;return-1}function oe(q){return q!==q}function ee(q,ie){var X=q==null?0:q.length;return X?Yt(q,ie)/X:vr}function Me(q){return function(ie){return ie==null?t:ie[q]}}function be(q){return function(ie){return q==null?t:q[ie]}}function Je(q,ie,X,ze,tt){return tt(q,function(It,Er,Ot){X=ze?(ze=!1,It):ie(X,It,Er,Ot)}),X}function Et(q,ie){var X=q.length;for(q.sort(ie);X--;)q[X]=q[X].value;return q}function Yt(q,ie){for(var X,ze=-1,tt=q.length;++ze<tt;){var It=ie(q[ze]);It!==t&&(X=X===t?It:X+It)}return X}function on(q,ie){for(var X=-1,ze=Array(q);++X<q;)ze[X]=ie(X);return ze}function Ir(q,ie){return lr(ie,function(X){return[X,q[X]]})}function Ri(q){return q&&q.slice(0,sh(q)+1).replace(Ci,"")}function Mt(q){return function(ie){return q(ie)}}function qs(q,ie){return lr(ie,function(X){return q[X]})}function ti(q,ie){return q.has(ie)}function Le(q,ie){for(var X=-1,ze=q.length;++X<ze&&I(ie,q[X],0)>-1;);return X}function Ft(q,ie){for(var X=q.length;X--&&I(ie,q[X],0)>-1;);return X}function _t(q,ie){for(var X=q.length,ze=0;X--;)q[X]===ie&&++ze;return ze}var rr=be(eh),qr=be(th);function En(q){return"\\"+Gu[q]}function Kn(q,ie){return q==null?t:q[ie]}function Hr(q){return Hp.test(q)}function co(q){return jp.test(q)}function Hs(q){for(var ie,X=[];!(ie=q.next()).done;)X.push(ie.value);return X}function os(q){var ie=-1,X=Array(q.size);return q.forEach(function(ze,tt){X[++ie]=[tt,ze]}),X}function Zu(q,ie){return function(X){return q(ie(X))}}function Sn(q,ie){for(var X=-1,ze=q.length,tt=0,It=[];++X<ze;){var Er=q[X];(Er===ie||Er===p)&&(q[X]=p,It[tt++]=X)}return It}function js(q){var ie=-1,X=Array(q.size);return q.forEach(function(ze){X[++ie]=ze}),X}function Wp(q){var ie=-1,X=Array(q.size);return q.forEach(function(ze){X[++ie]=[ze,ze]}),X}function Yp(q,ie,X){for(var ze=X-1,tt=q.length;++ze<tt;)if(q[ze]===ie)return ze;return-1}function fo(q,ie,X){for(var ze=X+1;ze--;)if(q[ze]===ie)return ze;return ze}function xa(q){return Hr(q)?Jp(q):d(q)}function ri(q){return Hr(q)?Xp(q):h(q)}function sh(q){for(var ie=q.length;ie--&&sr.test(q.charAt(ie)););return ie}var Vp=be(rh);function Jp(q){for(var ie=$u.lastIndex=0;$u.test(q);)++ie;return ie}function Xp(q){return q.match($u)||[]}function Zp(q){return q.match(qp)||[]}var Qp=function q(ie){ie=ie==null?Fr:Jo.defaults(Fr.Object(),ie,Jo.pick(Fr,$p));var X=ie.Array,ze=ie.Date,tt=ie.Error,It=ie.Function,Er=ie.Math,Ot=ie.Object,$s=ie.RegExp,vf=ie.String,gn=ie.TypeError,Gs=X.prototype,uh=It.prototype,ka=Ot.prototype,Ws=ie["__core-js_shared__"],Ys=uh.toString,Kt=ka.hasOwnProperty,ch=0,_f=function(){var i=/[^.]+$/.exec(Ws&&Ws.keys&&Ws.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Vs=ka.toString,fh=Ys.call(Ot),lh=Fr._,hh=$s("^"+Ys.call(Kt).replace(Bi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),as=ih?ie.Buffer:t,Xo=ie.Symbol,Qu=ie.Uint8Array,ec=as?as.allocUnsafe:t,Js=Zu(Ot.getPrototypeOf,Ot),dh=Ot.create,lo=ka.propertyIsEnumerable,tc=Gs.splice,ph=Xo?Xo.isConcatSpreadable:t,ss=Xo?Xo.iterator:t,Aa=Xo?Xo.toStringTag:t,rc=function(){try{var i=iu(Ot,"defineProperty");return i({},"",{}),i}catch(s){}}(),e0=ie.clearTimeout!==Fr.clearTimeout&&ie.clearTimeout,t0=ze&&ze.now!==Fr.Date.now&&ze.now,r0=ie.setTimeout!==Fr.setTimeout&&ie.setTimeout,nc=Er.ceil,ic=Er.floor,wf=Ot.getOwnPropertySymbols,n0=as?as.isBuffer:t,mh=ie.isFinite,yh=Gs.join,i0=Zu(Ot.keys,Ot),Dr=Er.max,Vr=Er.min,o0=ze.now,a0=ie.parseInt,gh=Er.random,s0=Gs.reverse,xf=iu(ie,"DataView"),Xs=iu(ie,"Map"),kf=iu(ie,"Promise"),us=iu(ie,"Set"),Zs=iu(ie,"WeakMap"),Qs=iu(Ot,"create"),oc=Zs&&new Zs,cs={},bh=ou(xf),eu=ou(Xs),vh=ou(kf),fs=ou(us),u0=ou(Zs),Ea=Xo?Xo.prototype:t,Sa=Ea?Ea.valueOf:t,_h=Ea?Ea.toString:t;function A(i){if(Sr(i)&&!lt(i)&&!(i instanceof x)){if(i instanceof zn)return i;if(Kt.call(i,"__wrapped__"))return Cb(i)}return new zn(i)}var Zo=function(){function i(){}return function(s){if(!wr(s))return{};if(dh)return dh(s);i.prototype=s;var f=new i;return i.prototype=t,f}}();function ac(){}function zn(i,s){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!s,this.__index__=0,this.__values__=t}A.templateSettings={escape:Uo,evaluate:eo,interpolate:Ti,variable:"",imports:{_:A}},A.prototype=ac.prototype,A.prototype.constructor=A,zn.prototype=Zo(ac.prototype),zn.prototype.constructor=zn;function x(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=fr,this.__views__=[]}function N(){var i=new x(this.__wrapped__);return i.__actions__=Hn(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=Hn(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=Hn(this.__views__),i}function B(){if(this.__filtered__){var i=new x(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function z(){var i=this.__wrapped__.value(),s=this.__dir__,f=lt(i),m=s<0,v=f?i.length:0,P=vE(0,v,this.__views__),D=P.start,L=P.end,$=L-D,he=m?L:D-1,pe=this.__iteratees__,ve=pe.length,Ne=0,Ye=Vr($,this.__takeCount__);if(!f||!m&&v==$&&Ye==$)return Qg(i,this.__actions__);var it=[];e:for(;$--&&Ne<Ye;){he+=s;for(var bt=-1,ot=i[he];++bt<ve;){var At=pe[bt],St=At.iteratee,oi=At.type,Bn=St(ot);if(oi==He)ot=Bn;else if(!Bn){if(oi==ht)continue e;break e}}it[Ne++]=ot}return it}x.prototype=Zo(ac.prototype),x.prototype.constructor=x;function j(i){var s=-1,f=i==null?0:i.length;for(this.clear();++s<f;){var m=i[s];this.set(m[0],m[1])}}function O(){this.__data__=Qs?Qs(null):{},this.size=0}function le(i){var s=this.has(i)&&delete this.__data__[i];return this.size-=s?1:0,s}function we(i){var s=this.__data__;if(Qs){var f=s[i];return f===u?t:f}return Kt.call(s,i)?s[i]:t}function Pe(i){var s=this.__data__;return Qs?s[i]!==t:Kt.call(s,i)}function Te(i,s){var f=this.__data__;return this.size+=this.has(i)?0:1,f[i]=Qs&&s===t?u:s,this}j.prototype.clear=O,j.prototype.delete=le,j.prototype.get=we,j.prototype.has=Pe,j.prototype.set=Te;function Ee(i){var s=-1,f=i==null?0:i.length;for(this.clear();++s<f;){var m=i[s];this.set(m[0],m[1])}}function Ge(){this.__data__=[],this.size=0}function gt(i){var s=this.__data__,f=wh(s,i);if(f<0)return!1;var m=s.length-1;return f==m?s.pop():tc.call(s,f,1),--this.size,!0}function zt(i){var s=this.__data__,f=wh(s,i);return f<0?t:s[f][1]}function $t(i){return wh(this.__data__,i)>-1}function Rr(i,s){var f=this.__data__,m=wh(f,i);return m<0?(++this.size,f.push([i,s])):f[m][1]=s,this}Ee.prototype.clear=Ge,Ee.prototype.delete=gt,Ee.prototype.get=zt,Ee.prototype.has=$t,Ee.prototype.set=Rr;function Vt(i){var s=-1,f=i==null?0:i.length;for(this.clear();++s<f;){var m=i[s];this.set(m[0],m[1])}}function an(){this.size=0,this.__data__={hash:new j,map:new(Xs||Ee),string:new j}}function tu(i){var s=Dh(this,i).delete(i);return this.size-=s?1:0,s}function Af(i){return Dh(this,i).get(i)}function c0(i){return Dh(this,i).has(i)}function Ef(i,s){var f=Dh(this,i),m=f.size;return f.set(i,s),this.size+=f.size==m?0:1,this}Vt.prototype.clear=an,Vt.prototype.delete=tu,Vt.prototype.get=Af,Vt.prototype.has=c0,Vt.prototype.set=Ef;function ls(i){var s=-1,f=i==null?0:i.length;for(this.__data__=new Vt;++s<f;)this.add(i[s])}function f0(i){return this.__data__.set(i,u),this}function l0(i){return this.__data__.has(i)}ls.prototype.add=ls.prototype.push=f0,ls.prototype.has=l0;function qn(i){var s=this.__data__=new Ee(i);this.size=s.size}function E6(){this.__data__=new Ee,this.size=0}function S6(i){var s=this.__data__,f=s.delete(i);return this.size=s.size,f}function P6(i){return this.__data__.get(i)}function T6(i){return this.__data__.has(i)}function B6(i,s){var f=this.__data__;if(f instanceof Ee){var m=f.__data__;if(!Xs||m.length<r-1)return m.push([i,s]),this.size=++f.size,this;f=this.__data__=new Vt(m)}return f.set(i,s),this.size=f.size,this}qn.prototype.clear=E6,qn.prototype.delete=S6,qn.prototype.get=P6,qn.prototype.has=T6,qn.prototype.set=B6;function Cg(i,s){var f=lt(i),m=!f&&au(i),v=!f&&!m&&ys(i),P=!f&&!m&&!v&&fc(i),D=f||m||v||P,L=D?on(i.length,vf):[],$=L.length;for(var he in i)(s||Kt.call(i,he))&&!(D&&(he=="length"||v&&(he=="offset"||he=="parent")||P&&(he=="buffer"||he=="byteLength"||he=="byteOffset")||Ca(he,$)))&&L.push(he);return L}function Fg(i){var s=i.length;return s?i[x0(0,s-1)]:t}function C6(i,s){return Rh(Hn(i),ru(s,0,i.length))}function F6(i){return Rh(Hn(i))}function h0(i,s,f){(f!==t&&!ho(i[s],f)||f===t&&!(s in i))&&Pa(i,s,f)}function Sf(i,s,f){var m=i[s];(!(Kt.call(i,s)&&ho(m,f))||f===t&&!(s in i))&&Pa(i,s,f)}function wh(i,s){for(var f=i.length;f--;)if(ho(i[f][0],s))return f;return-1}function I6(i,s,f,m){return hs(i,function(v,P,D){s(m,v,f(v),D)}),m}function Ig(i,s){return i&&ea(s,Jr(s),i)}function D6(i,s){return i&&ea(s,$n(s),i)}function Pa(i,s,f){s=="__proto__"&&rc?rc(i,s,{configurable:!0,enumerable:!0,value:f,writable:!0}):i[s]=f}function d0(i,s){for(var f=-1,m=s.length,v=X(m),P=i==null;++f<m;)v[f]=P?t:W0(i,s[f]);return v}function ru(i,s,f){return i===i&&(f!==t&&(i=i<=f?i:f),s!==t&&(i=i>=s?i:s)),i}function Ni(i,s,f,m,v,P){var D,L=s&l,$=s&y,he=s&w;if(f&&(D=v?f(i,m,v,P):f(i)),D!==t)return D;if(!wr(i))return i;var pe=lt(i);if(pe){if(D=wE(i),!L)return Hn(i,D)}else{var ve=bn(i),Ne=ve==$e||ve==We;if(ys(i))return rb(i,L);if(ve==mt||ve==Nt||Ne&&!v){if(D=$||Ne?{}:wb(i),!L)return $?fE(i,D6(D,i)):cE(i,Ig(D,i))}else{if(!er[ve])return v?i:{};D=xE(i,ve,L)}}P||(P=new qn);var Ye=P.get(i);if(Ye)return Ye;P.set(i,D),Jb(i)?i.forEach(function(ot){D.add(Ni(ot,s,f,ot,i,P))}):Yb(i)&&i.forEach(function(ot,At){D.set(At,Ni(ot,s,f,At,i,P))});var it=he?$?D0:I0:$?$n:Jr,bt=pe?t:it(i);return An(bt||i,function(ot,At){bt&&(At=ot,ot=i[At]),Sf(D,At,Ni(ot,s,f,At,i,P))}),D}function R6(i){var s=Jr(i);return function(f){return Dg(f,i,s)}}function Dg(i,s,f){var m=f.length;if(i==null)return!m;for(i=Ot(i);m--;){var v=f[m],P=s[v],D=i[v];if(D===t&&!(v in i)||!P(D))return!1}return!0}function Rg(i,s,f){if(typeof i!="function")throw new gn(o);return Df(function(){i.apply(t,f)},s)}function Pf(i,s,f,m){var v=-1,P=Xu,D=!0,L=i.length,$=[],he=s.length;if(!L)return $;f&&(s=lr(s,Mt(f))),m?(P=gf,D=!1):s.length>=r&&(P=ti,D=!1,s=new ls(s));e:for(;++v<L;){var pe=i[v],ve=f==null?pe:f(pe);if(pe=m||pe!==0?pe:0,D&&ve===ve){for(var Ne=he;Ne--;)if(s[Ne]===ve)continue e;$.push(pe)}else P(s,ve,m)||$.push(pe)}return $}var hs=sb(Qo),Ng=sb(m0,!0);function N6(i,s){var f=!0;return hs(i,function(m,v,P){return f=!!s(m,v,P),f}),f}function xh(i,s,f){for(var m=-1,v=i.length;++m<v;){var P=i[m],D=s(P);if(D!=null&&(L===t?D===D&&!ii(D):f(D,L)))var L=D,$=P}return $}function U6(i,s,f,m){var v=i.length;for(f=yt(f),f<0&&(f=-f>v?0:v+f),m=m===t||m>v?v:yt(m),m<0&&(m+=v),m=f>m?0:Zb(m);f<m;)i[f++]=s;return i}function Ug(i,s){var f=[];return hs(i,function(m,v,P){s(m,v,P)&&f.push(m)}),f}function sn(i,s,f,m,v){var P=-1,D=i.length;for(f||(f=AE),v||(v=[]);++P<D;){var L=i[P];s>0&&f(L)?s>1?sn(L,s-1,f,m,v):Vo(v,L):m||(v[v.length]=L)}return v}var p0=ub(),Lg=ub(!0);function Qo(i,s){return i&&p0(i,s,Jr)}function m0(i,s){return i&&Lg(i,s,Jr)}function kh(i,s){return Yo(s,function(f){return Fa(i[f])})}function nu(i,s){s=ps(s,i);for(var f=0,m=s.length;i!=null&&f<m;)i=i[ta(s[f++])];return f&&f==m?i:t}function Mg(i,s,f){var m=s(i);return lt(i)?m:Vo(m,f(i))}function Pn(i){return i==null?i===t?fe:Xe:Aa&&Aa in Ot(i)?bE(i):FE(i)}function y0(i,s){return i>s}function L6(i,s){return i!=null&&Kt.call(i,s)}function M6(i,s){return i!=null&&s in Ot(i)}function O6(i,s,f){return i>=Vr(s,f)&&i<Dr(s,f)}function g0(i,s,f){for(var m=f?gf:Xu,v=i[0].length,P=i.length,D=P,L=X(P),$=Infinity,he=[];D--;){var pe=i[D];D&&s&&(pe=lr(pe,Mt(s))),$=Vr(pe.length,$),L[D]=!f&&(s||v>=120&&pe.length>=120)?new ls(D&&pe):t}pe=i[0];var ve=-1,Ne=L[0];e:for(;++ve<v&&he.length<$;){var Ye=pe[ve],it=s?s(Ye):Ye;if(Ye=f||Ye!==0?Ye:0,!(Ne?ti(Ne,it):m(he,it,f))){for(D=P;--D;){var bt=L[D];if(!(bt?ti(bt,it):m(i[D],it,f)))continue e}Ne&&Ne.push(it),he.push(Ye)}}return he}function K6(i,s,f,m){return Qo(i,function(v,P,D){s(m,f(v),P,D)}),m}function Tf(i,s,f){s=ps(s,i),i=Eb(i,s);var m=i==null?i:i[ta(Li(s))];return m==null?t:yn(m,i,f)}function Og(i){return Sr(i)&&Pn(i)==Nt}function z6(i){return Sr(i)&&Pn(i)==te}function q6(i){return Sr(i)&&Pn(i)==de}function Bf(i,s,f,m,v){return i===s?!0:i==null||s==null||!Sr(i)&&!Sr(s)?i!==i&&s!==s:H6(i,s,f,m,Bf,v)}function H6(i,s,f,m,v,P){var D=lt(i),L=lt(s),$=D?Ct:bn(i),he=L?Ct:bn(s);$=$==Nt?mt:$,he=he==Nt?mt:he;var pe=$==mt,ve=he==mt,Ne=$==he;if(Ne&&ys(i)){if(!ys(s))return!1;D=!0,pe=!1}if(Ne&&!pe)return P||(P=new qn),D||fc(i)?bb(i,s,f,m,v,P):yE(i,s,$,f,m,v,P);if(!(f&F)){var Ye=pe&&Kt.call(i,"__wrapped__"),it=ve&&Kt.call(s,"__wrapped__");if(Ye||it){var bt=Ye?i.value():i,ot=it?s.value():s;return P||(P=new qn),v(bt,ot,f,m,P)}}return Ne?(P||(P=new qn),gE(i,s,f,m,v,P)):!1}function j6(i){return Sr(i)&&bn(i)==Oe}function b0(i,s,f,m){var v=f.length,P=v,D=!m;if(i==null)return!P;for(i=Ot(i);v--;){var L=f[v];if(D&&L[2]?L[1]!==i[L[0]]:!(L[0]in i))return!1}for(;++v<P;){L=f[v];var $=L[0],he=i[$],pe=L[1];if(D&&L[2]){if(he===t&&!($ in i))return!1}else{var ve=new qn;if(m)var Ne=m(he,pe,$,i,s,ve);if(!(Ne===t?Bf(pe,he,F|_,m,ve):Ne))return!1}}return!0}function Kg(i){if(!wr(i)||SE(i))return!1;var s=Fa(i)?hh:ei;return s.test(ou(i))}function $6(i){return Sr(i)&&Pn(i)==Yr}function G6(i){return Sr(i)&&bn(i)==ar}function W6(i){return Sr(i)&&Kh(i.length)&&!!or[Pn(i)]}function zg(i){return typeof i=="function"?i:i==null?Gn:typeof i=="object"?lt(i)?jg(i[0],i[1]):Hg(i):cv(i)}function v0(i){if(!If(i))return i0(i);var s=[];for(var f in Ot(i))Kt.call(i,f)&&f!="constructor"&&s.push(f);return s}function Y6(i){if(!wr(i))return CE(i);var s=If(i),f=[];for(var m in i)m=="constructor"&&(s||!Kt.call(i,m))||f.push(m);return f}function _0(i,s){return i<s}function qg(i,s){var f=-1,m=jn(i)?X(i.length):[];return hs(i,function(v,P,D){m[++f]=s(v,P,D)}),m}function Hg(i){var s=N0(i);return s.length==1&&s[0][2]?kb(s[0][0],s[0][1]):function(f){return f===i||b0(f,i,s)}}function jg(i,s){return L0(i)&&xb(s)?kb(ta(i),s):function(f){var m=W0(f,i);return m===t&&m===s?Y0(f,i):Bf(s,m,F|_)}}function Ah(i,s,f,m,v){i!==s&&p0(s,function(P,D){if(v||(v=new qn),wr(P))V6(i,s,D,f,Ah,m,v);else{var L=m?m(O0(i,D),P,D+"",i,s,v):t;L===t&&(L=P),h0(i,D,L)}},$n)}function V6(i,s,f,m,v,P,D){var L=O0(i,f),$=O0(s,f),he=D.get($);if(he){h0(i,f,he);return}var pe=P?P(L,$,f+"",i,s,D):t,ve=pe===t;if(ve){var Ne=lt($),Ye=!Ne&&ys($),it=!Ne&&!Ye&&fc($);pe=$,Ne||Ye||it?lt(L)?pe=L:Nr(L)?pe=Hn(L):Ye?(ve=!1,pe=rb($,!0)):it?(ve=!1,pe=nb($,!0)):pe=[]:Rf($)||au($)?(pe=L,au(L)?pe=Qb(L):(!wr(L)||Fa(L))&&(pe=wb($))):ve=!1}ve&&(D.set($,pe),v(pe,$,m,P,D),D.delete($)),h0(i,f,pe)}function $g(i,s){var f=i.length;if(!!f)return s+=s<0?f:0,Ca(s,f)?i[s]:t}function Gg(i,s,f){s.length?s=lr(s,function(P){return lt(P)?function(D){return nu(D,P.length===1?P[0]:P)}:P}):s=[Gn];var m=-1;s=lr(s,Mt(nt()));var v=qg(i,function(P,D,L){var $=lr(s,function(he){return he(P)});return{criteria:$,index:++m,value:P}});return Et(v,function(P,D){return uE(P,D,f)})}function J6(i,s){return Wg(i,s,function(f,m){return Y0(i,m)})}function Wg(i,s,f){for(var m=-1,v=s.length,P={};++m<v;){var D=s[m],L=nu(i,D);f(L,D)&&Cf(P,ps(D,i),L)}return P}function X6(i){return function(s){return nu(s,i)}}function w0(i,s,f,m){var v=m?W:I,P=-1,D=s.length,L=i;for(i===s&&(s=Hn(s)),f&&(L=lr(i,Mt(f)));++P<D;)for(var $=0,he=s[P],pe=f?f(he):he;($=v(L,pe,$,m))>-1;)L!==i&&tc.call(L,$,1),tc.call(i,$,1);return i}function Yg(i,s){for(var f=i?s.length:0,m=f-1;f--;){var v=s[f];if(f==m||v!==P){var P=v;Ca(v)?tc.call(i,v,1):E0(i,v)}}return i}function x0(i,s){return i+ic(gh()*(s-i+1))}function Z6(i,s,f,m){for(var v=-1,P=Dr(nc((s-i)/(f||1)),0),D=X(P);P--;)D[m?P:++v]=i,i+=f;return D}function k0(i,s){var f="";if(!i||s<1||s>ir)return f;do s%2&&(f+=i),s=ic(s/2),s&&(i+=i);while(s);return f}function wt(i,s){return K0(Ab(i,s,Gn),i+"")}function Q6(i){return Fg(lc(i))}function eE(i,s){var f=lc(i);return Rh(f,ru(s,0,f.length))}function Cf(i,s,f,m){if(!wr(i))return i;s=ps(s,i);for(var v=-1,P=s.length,D=P-1,L=i;L!=null&&++v<P;){var $=ta(s[v]),he=f;if($==="__proto__"||$==="constructor"||$==="prototype")return i;if(v!=D){var pe=L[$];he=m?m(pe,$,L):t,he===t&&(he=wr(pe)?pe:Ca(s[v+1])?[]:{})}Sf(L,$,he),L=L[$]}return i}var Vg=oc?function(i,s){return oc.set(i,s),i}:Gn,tE=rc?function(i,s){return rc(i,"toString",{configurable:!0,enumerable:!1,value:J0(s),writable:!0})}:Gn;function rE(i){return Rh(lc(i))}function Ui(i,s,f){var m=-1,v=i.length;s<0&&(s=-s>v?0:v+s),f=f>v?v:f,f<0&&(f+=v),v=s>f?0:f-s>>>0,s>>>=0;for(var P=X(v);++m<v;)P[m]=i[m+s];return P}function nE(i,s){var f;return hs(i,function(m,v,P){return f=s(m,v,P),!f}),!!f}function Eh(i,s,f){var m=0,v=i==null?m:i.length;if(typeof s=="number"&&s===s&&v<=Gt){for(;m<v;){var P=m+v>>>1,D=i[P];D!==null&&!ii(D)&&(f?D<=s:D<s)?m=P+1:v=P}return v}return A0(i,s,Gn,f)}function A0(i,s,f,m){var v=0,P=i==null?0:i.length;if(P===0)return 0;s=f(s);for(var D=s!==s,L=s===null,$=ii(s),he=s===t;v<P;){var pe=ic((v+P)/2),ve=f(i[pe]),Ne=ve!==t,Ye=ve===null,it=ve===ve,bt=ii(ve);if(D)var ot=m||it;else he?ot=it&&(m||Ne):L?ot=it&&Ne&&(m||!Ye):$?ot=it&&Ne&&!Ye&&(m||!bt):Ye||bt?ot=!1:ot=m?ve<=s:ve<s;ot?v=pe+1:P=pe}return Vr(P,Zn)}function Jg(i,s){for(var f=-1,m=i.length,v=0,P=[];++f<m;){var D=i[f],L=s?s(D):D;if(!f||!ho(L,$)){var $=L;P[v++]=D===0?0:D}}return P}function Xg(i){return typeof i=="number"?i:ii(i)?vr:+i}function ni(i){if(typeof i=="string")return i;if(lt(i))return lr(i,ni)+"";if(ii(i))return _h?_h.call(i):"";var s=i+"";return s=="0"&&1/i==-Rt?"-0":s}function ds(i,s,f){var m=-1,v=Xu,P=i.length,D=!0,L=[],$=L;if(f)D=!1,v=gf;else if(P>=r){var he=s?null:pE(i);if(he)return js(he);D=!1,v=ti,$=new ls}else $=s?[]:L;e:for(;++m<P;){var pe=i[m],ve=s?s(pe):pe;if(pe=f||pe!==0?pe:0,D&&ve===ve){for(var Ne=$.length;Ne--;)if($[Ne]===ve)continue e;s&&$.push(ve),L.push(pe)}else v($,ve,f)||($!==L&&$.push(ve),L.push(pe))}return L}function E0(i,s){return s=ps(s,i),i=Eb(i,s),i==null||delete i[ta(Li(s))]}function Zg(i,s,f,m){return Cf(i,s,f(nu(i,s)),m)}function Sh(i,s,f,m){for(var v=i.length,P=m?v:-1;(m?P--:++P<v)&&s(i[P],P,i););return f?Ui(i,m?0:P,m?P+1:v):Ui(i,m?P+1:0,m?v:P)}function Qg(i,s){var f=i;return f instanceof x&&(f=f.value()),bf(s,function(m,v){return v.func.apply(v.thisArg,Vo([m],v.args))},f)}function S0(i,s,f){var m=i.length;if(m<2)return m?ds(i[0]):[];for(var v=-1,P=X(m);++v<m;)for(var D=i[v],L=-1;++L<m;)L!=v&&(P[v]=Pf(P[v]||D,i[L],s,f));return ds(sn(P,1),s,f)}function eb(i,s,f){for(var m=-1,v=i.length,P=s.length,D={};++m<v;){var L=m<P?s[m]:t;f(D,i[m],L)}return D}function P0(i){return Nr(i)?i:[]}function T0(i){return typeof i=="function"?i:Gn}function ps(i,s){return lt(i)?i:L0(i,s)?[i]:Bb(Jt(i))}var iE=wt;function ms(i,s,f){var m=i.length;return f=f===t?m:f,!s&&f>=m?i:Ui(i,s,f)}var tb=e0||function(i){return Fr.clearTimeout(i)};function rb(i,s){if(s)return i.slice();var f=i.length,m=ec?ec(f):new i.constructor(f);return i.copy(m),m}function B0(i){var s=new i.constructor(i.byteLength);return new Qu(s).set(new Qu(i)),s}function oE(i,s){var f=s?B0(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.byteLength)}function aE(i){var s=new i.constructor(i.source,oo.exec(i));return s.lastIndex=i.lastIndex,s}function sE(i){return Sa?Ot(Sa.call(i)):{}}function nb(i,s){var f=s?B0(i.buffer):i.buffer;return new i.constructor(f,i.byteOffset,i.length)}function ib(i,s){if(i!==s){var f=i!==t,m=i===null,v=i===i,P=ii(i),D=s!==t,L=s===null,$=s===s,he=ii(s);if(!L&&!he&&!P&&i>s||P&&D&&$&&!L&&!he||m&&D&&$||!f&&$||!v)return 1;if(!m&&!P&&!he&&i<s||he&&f&&v&&!m&&!P||L&&f&&v||!D&&v||!$)return-1}return 0}function uE(i,s,f){for(var m=-1,v=i.criteria,P=s.criteria,D=v.length,L=f.length;++m<D;){var $=ib(v[m],P[m]);if($){if(m>=L)return $;var he=f[m];return $*(he=="desc"?-1:1)}}return i.index-s.index}function ob(i,s,f,m){for(var v=-1,P=i.length,D=f.length,L=-1,$=s.length,he=Dr(P-D,0),pe=X($+he),ve=!m;++L<$;)pe[L]=s[L];for(;++v<D;)(ve||v<P)&&(pe[f[v]]=i[v]);for(;he--;)pe[L++]=i[v++];return pe}function ab(i,s,f,m){for(var v=-1,P=i.length,D=-1,L=f.length,$=-1,he=s.length,pe=Dr(P-L,0),ve=X(pe+he),Ne=!m;++v<pe;)ve[v]=i[v];for(var Ye=v;++$<he;)ve[Ye+$]=s[$];for(;++D<L;)(Ne||v<P)&&(ve[Ye+f[D]]=i[v++]);return ve}function Hn(i,s){var f=-1,m=i.length;for(s||(s=X(m));++f<m;)s[f]=i[f];return s}function ea(i,s,f,m){var v=!f;f||(f={});for(var P=-1,D=s.length;++P<D;){var L=s[P],$=m?m(f[L],i[L],L,f,i):t;$===t&&($=i[L]),v?Pa(f,L,$):Sf(f,L,$)}return f}function cE(i,s){return ea(i,U0(i),s)}function fE(i,s){return ea(i,vb(i),s)}function Ph(i,s){return function(f,m){var v=lt(f)?ah:I6,P=s?s():{};return v(f,i,nt(m,2),P)}}function sc(i){return wt(function(s,f){var m=-1,v=f.length,P=v>1?f[v-1]:t,D=v>2?f[2]:t;for(P=i.length>3&&typeof P=="function"?(v--,P):t,D&&Tn(f[0],f[1],D)&&(P=v<3?t:P,v=1),s=Ot(s);++m<v;){var L=f[m];L&&i(s,L,m,P)}return s})}function sb(i,s){return function(f,m){if(f==null)return f;if(!jn(f))return i(f,m);for(var v=f.length,P=s?v:-1,D=Ot(f);(s?P--:++P<v)&&m(D[P],P,D)!==!1;);return f}}function ub(i){return function(s,f,m){for(var v=-1,P=Ot(s),D=m(s),L=D.length;L--;){var $=D[i?L:++v];if(f(P[$],$,P)===!1)break}return s}}function lE(i,s,f){var m=s&U,v=Ff(i);function P(){var D=this&&this!==Fr&&this instanceof P?v:i;return D.apply(m?f:this,arguments)}return P}function cb(i){return function(s){s=Jt(s);var f=Hr(s)?ri(s):t,m=f?f[0]:s.charAt(0),v=f?ms(f,1).join(""):s.slice(1);return m[i]()+v}}function uc(i){return function(s){return bf(sv(av(s).replace(lf,"")),i,"")}}function Ff(i){return function(){var s=arguments;switch(s.length){case 0:return new i;case 1:return new i(s[0]);case 2:return new i(s[0],s[1]);case 3:return new i(s[0],s[1],s[2]);case 4:return new i(s[0],s[1],s[2],s[3]);case 5:return new i(s[0],s[1],s[2],s[3],s[4]);case 6:return new i(s[0],s[1],s[2],s[3],s[4],s[5]);case 7:return new i(s[0],s[1],s[2],s[3],s[4],s[5],s[6])}var f=Zo(i.prototype),m=i.apply(f,s);return wr(m)?m:f}}function hE(i,s,f){var m=Ff(i);function v(){for(var P=arguments.length,D=X(P),L=P,$=cc(v);L--;)D[L]=arguments[L];var he=P<3&&D[0]!==$&&D[P-1]!==$?[]:Sn(D,$);if(P-=he.length,P<f)return pb(i,s,Th,v.placeholder,t,D,he,t,t,f-P);var pe=this&&this!==Fr&&this instanceof v?m:i;return yn(pe,this,D)}return v}function fb(i){return function(s,f,m){var v=Ot(s);if(!jn(s)){var P=nt(f,3);s=Jr(s),f=function(L){return P(v[L],L,v)}}var D=i(s,f,m);return D>-1?v[P?s[D]:D]:t}}function lb(i){return Ba(function(s){var f=s.length,m=f,v=zn.prototype.thru;for(i&&s.reverse();m--;){var P=s[m];if(typeof P!="function")throw new gn(o);if(v&&!D&&Ih(P)=="wrapper")var D=new zn([],!0)}for(m=D?m:f;++m<f;){P=s[m];var L=Ih(P),$=L=="wrapper"?R0(P):t;$&&M0($[0])&&$[1]==(Fe|Q|J|Z)&&!$[4].length&&$[9]==1?D=D[Ih($[0])].apply(D,$[3]):D=P.length==1&&M0(P)?D[L]():D.thru(P)}return function(){var he=arguments,pe=he[0];if(D&&he.length==1&<(pe))return D.plant(pe).value();for(var ve=0,Ne=f?s[ve].apply(this,he):pe;++ve<f;)Ne=s[ve].call(this,Ne);return Ne}})}function Th(i,s,f,m,v,P,D,L,$,he){var pe=s&Fe,ve=s&U,Ne=s&V,Ye=s&(Q|ue),it=s&re,bt=Ne?t:Ff(i);function ot(){for(var At=arguments.length,St=X(At),oi=At;oi--;)St[oi]=arguments[oi];if(Ye)var Bn=cc(ot),ai=_t(St,Bn);if(m&&(St=ob(St,m,v,Ye)),P&&(St=ab(St,P,D,Ye)),At-=ai,Ye&&At<he){var Ur=Sn(St,Bn);return pb(i,s,Th,ot.placeholder,f,St,Ur,L,$,he-At)}var po=ve?f:this,Da=Ne?po[i]:i;return At=St.length,L?St=IE(St,L):it&&At>1&&St.reverse(),pe&&$<At&&(St.length=$),this&&this!==Fr&&this instanceof ot&&(Da=bt||Ff(Da)),Da.apply(po,St)}return ot}function hb(i,s){return function(f,m){return K6(f,i,s(m),{})}}function Bh(i,s){return function(f,m){var v;if(f===t&&m===t)return s;if(f!==t&&(v=f),m!==t){if(v===t)return m;typeof f=="string"||typeof m=="string"?(f=ni(f),m=ni(m)):(f=Xg(f),m=Xg(m)),v=i(f,m)}return v}}function C0(i){return Ba(function(s){return s=lr(s,Mt(nt())),wt(function(f){var m=this;return i(s,function(v){return yn(v,m,f)})})})}function Ch(i,s){s=s===t?" ":ni(s);var f=s.length;if(f<2)return f?k0(s,i):s;var m=k0(s,nc(i/xa(s)));return Hr(s)?ms(ri(m),0,i).join(""):m.slice(0,i)}function dE(i,s,f,m){var v=s&U,P=Ff(i);function D(){for(var L=-1,$=arguments.length,he=-1,pe=m.length,ve=X(pe+$),Ne=this&&this!==Fr&&this instanceof D?P:i;++he<pe;)ve[he]=m[he];for(;$--;)ve[he++]=arguments[++L];return yn(Ne,v?f:this,ve)}return D}function db(i){return function(s,f,m){return m&&typeof m!="number"&&Tn(s,f,m)&&(f=m=t),s=Ia(s),f===t?(f=s,s=0):f=Ia(f),m=m===t?s<f?1:-1:Ia(m),Z6(s,f,m,i)}}function Fh(i){return function(s,f){return typeof s=="string"&&typeof f=="string"||(s=Mi(s),f=Mi(f)),i(s,f)}}function pb(i,s,f,m,v,P,D,L,$,he){var pe=s&Q,ve=pe?D:t,Ne=pe?t:D,Ye=pe?P:t,it=pe?t:P;s|=pe?J:ye,s&=~(pe?ye:J),s&Se||(s&=~(U|V));var bt=[i,s,v,Ye,ve,it,Ne,L,$,he],ot=f.apply(t,bt);return M0(i)&&Sb(ot,bt),ot.placeholder=m,Pb(ot,i,s)}function F0(i){var s=Er[i];return function(f,m){if(f=Mi(f),m=m==null?0:Vr(yt(m),292),m&&mh(f)){var v=(Jt(f)+"e").split("e"),P=s(v[0]+"e"+(+v[1]+m));return v=(Jt(P)+"e").split("e"),+(v[0]+"e"+(+v[1]-m))}return s(f)}}var pE=us&&1/js(new us([,-0]))[1]==Rt?function(i){return new us(i)}:Q0;function mb(i){return function(s){var f=bn(s);return f==Oe?os(s):f==ar?Wp(s):Ir(s,i(s))}}function Ta(i,s,f,m,v,P,D,L){var $=s&V;if(!$&&typeof i!="function")throw new gn(o);var he=m?m.length:0;if(he||(s&=~(J|ye),m=v=t),D=D===t?D:Dr(yt(D),0),L=L===t?L:yt(L),he-=v?v.length:0,s&ye){var pe=m,ve=v;m=v=t}var Ne=$?t:R0(i),Ye=[i,s,f,m,v,pe,ve,P,D,L];if(Ne&&BE(Ye,Ne),i=Ye[0],s=Ye[1],f=Ye[2],m=Ye[3],v=Ye[4],L=Ye[9]=Ye[9]===t?$?0:i.length:Dr(Ye[9]-he,0),!L&&s&(Q|ue)&&(s&=~(Q|ue)),!s||s==U)var it=lE(i,s,f);else s==Q||s==ue?it=hE(i,s,L):(s==J||s==(U|J))&&!v.length?it=dE(i,s,f,m):it=Th.apply(t,Ye);var bt=Ne?Vg:Sb;return Pb(bt(it,Ye),i,s)}function yb(i,s,f,m){return i===t||ho(i,ka[f])&&!Kt.call(m,f)?s:i}function gb(i,s,f,m,v,P){return wr(i)&&wr(s)&&(P.set(s,i),Ah(i,s,t,gb,P),P.delete(s)),i}function mE(i){return Rf(i)?t:i}function bb(i,s,f,m,v,P){var D=f&F,L=i.length,$=s.length;if(L!=$&&!(D&&$>L))return!1;var he=P.get(i),pe=P.get(s);if(he&&pe)return he==s&&pe==i;var ve=-1,Ne=!0,Ye=f&_?new ls:t;for(P.set(i,s),P.set(s,i);++ve<L;){var it=i[ve],bt=s[ve];if(m)var ot=D?m(bt,it,ve,s,i,P):m(it,bt,ve,i,s,P);if(ot!==t){if(ot)continue;Ne=!1;break}if(Ye){if(!g(s,function(At,St){if(!ti(Ye,St)&&(it===At||v(it,At,f,m,P)))return Ye.push(St)})){Ne=!1;break}}else if(!(it===bt||v(it,bt,f,m,P))){Ne=!1;break}}return P.delete(i),P.delete(s),Ne}function yE(i,s,f,m,v,P,D){switch(f){case me:if(i.byteLength!=s.byteLength||i.byteOffset!=s.byteOffset)return!1;i=i.buffer,s=s.buffer;case te:return!(i.byteLength!=s.byteLength||!P(new Qu(i),new Qu(s)));case ce:case de:case Ut:return ho(+i,+s);case De:return i.name==s.name&&i.message==s.message;case Yr:case Or:return i==s+"";case Oe:var L=os;case ar:var $=m&F;if(L||(L=js),i.size!=s.size&&!$)return!1;var he=D.get(i);if(he)return he==s;m|=_,D.set(i,s);var pe=bb(L(i),L(s),m,v,P,D);return D.delete(i),pe;case hr:if(Sa)return Sa.call(i)==Sa.call(s)}return!1}function gE(i,s,f,m,v,P){var D=f&F,L=I0(i),$=L.length,he=I0(s),pe=he.length;if($!=pe&&!D)return!1;for(var ve=$;ve--;){var Ne=L[ve];if(!(D?Ne in s:Kt.call(s,Ne)))return!1}var Ye=P.get(i),it=P.get(s);if(Ye&&it)return Ye==s&&it==i;var bt=!0;P.set(i,s),P.set(s,i);for(var ot=D;++ve<$;){Ne=L[ve];var At=i[Ne],St=s[Ne];if(m)var oi=D?m(St,At,Ne,s,i,P):m(At,St,Ne,i,s,P);if(!(oi===t?At===St||v(At,St,f,m,P):oi)){bt=!1;break}ot||(ot=Ne=="constructor")}if(bt&&!ot){var Bn=i.constructor,ai=s.constructor;Bn!=ai&&"constructor"in i&&"constructor"in s&&!(typeof Bn=="function"&&Bn instanceof Bn&&typeof ai=="function"&&ai instanceof ai)&&(bt=!1)}return P.delete(i),P.delete(s),bt}function Ba(i){return K0(Ab(i,t,Db),i+"")}function I0(i){return Mg(i,Jr,U0)}function D0(i){return Mg(i,$n,vb)}var R0=oc?function(i){return oc.get(i)}:Q0;function Ih(i){for(var s=i.name+"",f=cs[s],m=Kt.call(cs,s)?f.length:0;m--;){var v=f[m],P=v.func;if(P==null||P==i)return v.name}return s}function cc(i){var s=Kt.call(A,"placeholder")?A:i;return s.placeholder}function nt(){var i=A.iteratee||X0;return i=i===X0?zg:i,arguments.length?i(arguments[0],arguments[1]):i}function Dh(i,s){var f=i.__data__;return EE(s)?f[typeof s=="string"?"string":"hash"]:f.map}function N0(i){for(var s=Jr(i),f=s.length;f--;){var m=s[f],v=i[m];s[f]=[m,v,xb(v)]}return s}function iu(i,s){var f=Kn(i,s);return Kg(f)?f:t}function bE(i){var s=Kt.call(i,Aa),f=i[Aa];try{i[Aa]=t;var m=!0}catch(P){}var v=Vs.call(i);return m&&(s?i[Aa]=f:delete i[Aa]),v}var U0=wf?function(i){return i==null?[]:(i=Ot(i),Yo(wf(i),function(s){return lo.call(i,s)}))}:em,vb=wf?function(i){for(var s=[];i;)Vo(s,U0(i)),i=Js(i);return s}:em,bn=Pn;(xf&&bn(new xf(new ArrayBuffer(1)))!=me||Xs&&bn(new Xs)!=Oe||kf&&bn(kf.resolve())!=Cr||us&&bn(new us)!=ar||Zs&&bn(new Zs)!=Kr)&&(bn=function(i){var s=Pn(i),f=s==mt?i.constructor:t,m=f?ou(f):"";if(m)switch(m){case bh:return me;case eu:return Oe;case vh:return Cr;case fs:return ar;case u0:return Kr}return s});function vE(i,s,f){for(var m=-1,v=f.length;++m<v;){var P=f[m],D=P.size;switch(P.type){case"drop":i+=D;break;case"dropRight":s-=D;break;case"take":s=Vr(s,i+D);break;case"takeRight":i=Dr(i,s-D);break}}return{start:i,end:s}}function _E(i){var s=i.match(Qn);return s?s[1].split(On):[]}function _b(i,s,f){s=ps(s,i);for(var m=-1,v=s.length,P=!1;++m<v;){var D=ta(s[m]);if(!(P=i!=null&&f(i,D)))break;i=i[D]}return P||++m!=v?P:(v=i==null?0:i.length,!!v&&Kh(v)&&Ca(D,v)&&(lt(i)||au(i)))}function wE(i){var s=i.length,f=new i.constructor(s);return s&&typeof i[0]=="string"&&Kt.call(i,"index")&&(f.index=i.index,f.input=i.input),f}function wb(i){return typeof i.constructor=="function"&&!If(i)?Zo(Js(i)):{}}function xE(i,s,f){var m=i.constructor;switch(s){case te:return B0(i);case ce:case de:return new m(+i);case me:return oE(i,f);case Ie:case Ke:case jt:case Ze:case Qe:case Ue:case at:case st:case Qt:return nb(i,f);case Oe:return new m;case Ut:case Or:return new m(i);case Yr:return aE(i);case ar:return new m;case hr:return sE(i)}}function kE(i,s){var f=s.length;if(!f)return i;var m=f-1;return s[m]=(f>1?"& ":"")+s[m],s=s.join(f>2?", ":" "),i.replace(_r,`{
|
9 | /* [wrapped with `+s+`] */
|
10 | `)}function AE(i){return lt(i)||au(i)||!!(ph&&i&&i[ph])}function Ca(i,s){var f=typeof i;return s=s??ir,!!s&&(f=="number"||f!="symbol"&&jo.test(i))&&i>-1&&i%1==0&&i<s}function Tn(i,s,f){if(!wr(f))return!1;var m=typeof s;return(m=="number"?jn(f)&&Ca(s,f.length):m=="string"&&s in f)?ho(f[s],i):!1}function L0(i,s){if(lt(i))return!1;var f=typeof i;return f=="number"||f=="symbol"||f=="boolean"||i==null||ii(i)?!0:Lo.test(i)||!to.test(i)||s!=null&&i in Ot(s)}function EE(i){var s=typeof i;return s=="string"||s=="number"||s=="symbol"||s=="boolean"?i!=="__proto__":i===null}function M0(i){var s=Ih(i),f=A[s];if(typeof f!="function"||!(s in x.prototype))return!1;if(i===f)return!0;var m=R0(f);return!!m&&i===m[0]}function SE(i){return!!_f&&_f in i}var PE=Ws?Fa:tm;function If(i){var s=i&&i.constructor,f=typeof s=="function"&&s.prototype||ka;return i===f}function xb(i){return i===i&&!wr(i)}function kb(i,s){return function(f){return f==null?!1:f[i]===s&&(s!==t||i in Ot(f))}}function TE(i){var s=Mh(i,function(m){return f.size===c&&f.clear(),m}),f=s.cache;return s}function BE(i,s){var f=i[1],m=s[1],v=f|m,P=v<(U|V|Fe),D=m==Fe&&f==Q||m==Fe&&f==Z&&i[7].length<=s[8]||m==(Fe|Z)&&s[7].length<=s[8]&&f==Q;if(!(P||D))return i;m&U&&(i[2]=s[2],v|=f&U?0:Se);var L=s[3];if(L){var $=i[3];i[3]=$?ob($,L,s[4]):L,i[4]=$?Sn(i[3],p):s[4]}return L=s[5],L&&($=i[5],i[5]=$?ab($,L,s[6]):L,i[6]=$?Sn(i[5],p):s[6]),L=s[7],L&&(i[7]=L),m&Fe&&(i[8]=i[8]==null?s[8]:Vr(i[8],s[8])),i[9]==null&&(i[9]=s[9]),i[0]=s[0],i[1]=v,i}function CE(i){var s=[];if(i!=null)for(var f in Ot(i))s.push(f);return s}function FE(i){return Vs.call(i)}function Ab(i,s,f){return s=Dr(s===t?i.length-1:s,0),function(){for(var m=arguments,v=-1,P=Dr(m.length-s,0),D=X(P);++v<P;)D[v]=m[s+v];v=-1;for(var L=X(s+1);++v<s;)L[v]=m[v];return L[s]=f(D),yn(i,this,L)}}function Eb(i,s){return s.length<2?i:nu(i,Ui(s,0,-1))}function IE(i,s){for(var f=i.length,m=Vr(s.length,f),v=Hn(i);m--;){var P=s[m];i[m]=Ca(P,f)?v[P]:t}return i}function O0(i,s){if(!(s==="constructor"&&typeof i[s]=="function")&&s!="__proto__")return i[s]}var Sb=Tb(Vg),Df=r0||function(i,s){return Fr.setTimeout(i,s)},K0=Tb(tE);function Pb(i,s,f){var m=s+"";return K0(i,kE(m,DE(_E(m),f)))}function Tb(i){var s=0,f=0;return function(){var m=o0(),v=vt-(m-f);if(f=m,v>0){if(++s>=ct)return arguments[0]}else s=0;return i.apply(t,arguments)}}function Rh(i,s){var f=-1,m=i.length,v=m-1;for(s=s===t?m:s;++f<s;){var P=x0(f,v),D=i[P];i[P]=i[f],i[f]=D}return i.length=s,i}var Bb=TE(function(i){var s=[];return i.charCodeAt(0)===46&&s.push(""),i.replace(Mo,function(f,m,v,P){s.push(v?P.replace(io,"$1"):m||f)}),s});function ta(i){if(typeof i=="string"||ii(i))return i;var s=i+"";return s=="0"&&1/i==-Rt?"-0":s}function ou(i){if(i!=null){try{return Ys.call(i)}catch(s){}try{return i+""}catch(s){}}return""}function DE(i,s){return An(dt,function(f){var m="_."+f[0];s&f[1]&&!Xu(i,m)&&i.push(m)}),i.sort()}function Cb(i){if(i instanceof x)return i.clone();var s=new zn(i.__wrapped__,i.__chain__);return s.__actions__=Hn(i.__actions__),s.__index__=i.__index__,s.__values__=i.__values__,s}function RE(i,s,f){(f?Tn(i,s,f):s===t)?s=1:s=Dr(yt(s),0);var m=i==null?0:i.length;if(!m||s<1)return[];for(var v=0,P=0,D=X(nc(m/s));v<m;)D[P++]=Ui(i,v,v+=s);return D}function NE(i){for(var s=-1,f=i==null?0:i.length,m=0,v=[];++s<f;){var P=i[s];P&&(v[m++]=P)}return v}function UE(){var i=arguments.length;if(!i)return[];for(var s=X(i-1),f=arguments[0],m=i;m--;)s[m-1]=arguments[m];return Vo(lt(f)?Hn(f):[f],sn(s,1))}var LE=wt(function(i,s){return Nr(i)?Pf(i,sn(s,1,Nr,!0)):[]}),ME=wt(function(i,s){var f=Li(s);return Nr(f)&&(f=t),Nr(i)?Pf(i,sn(s,1,Nr,!0),nt(f,2)):[]}),OE=wt(function(i,s){var f=Li(s);return Nr(f)&&(f=t),Nr(i)?Pf(i,sn(s,1,Nr,!0),t,f):[]});function KE(i,s,f){var m=i==null?0:i.length;return m?(s=f||s===t?1:yt(s),Ui(i,s<0?0:s,m)):[]}function zE(i,s,f){var m=i==null?0:i.length;return m?(s=f||s===t?1:yt(s),s=m-s,Ui(i,0,s<0?0:s)):[]}function qE(i,s){return i&&i.length?Sh(i,nt(s,3),!0,!0):[]}function HE(i,s){return i&&i.length?Sh(i,nt(s,3),!0):[]}function jE(i,s,f,m){var v=i==null?0:i.length;return v?(f&&typeof f!="number"&&Tn(i,s,f)&&(f=0,m=v),U6(i,s,f,m)):[]}function Fb(i,s,f){var m=i==null?0:i.length;if(!m)return-1;var v=f==null?0:yt(f);return v<0&&(v=Dr(m+v,0)),C(i,nt(s,3),v)}function Ib(i,s,f){var m=i==null?0:i.length;if(!m)return-1;var v=m-1;return f!==t&&(v=yt(f),v=f<0?Dr(m+v,0):Vr(v,m-1)),C(i,nt(s,3),v,!0)}function Db(i){var s=i==null?0:i.length;return s?sn(i,1):[]}function $E(i){var s=i==null?0:i.length;return s?sn(i,Rt):[]}function GE(i,s){var f=i==null?0:i.length;return f?(s=s===t?1:yt(s),sn(i,s)):[]}function WE(i){for(var s=-1,f=i==null?0:i.length,m={};++s<f;){var v=i[s];m[v[0]]=v[1]}return m}function Rb(i){return i&&i.length?i[0]:t}function YE(i,s,f){var m=i==null?0:i.length;if(!m)return-1;var v=f==null?0:yt(f);return v<0&&(v=Dr(m+v,0)),I(i,s,v)}function VE(i){var s=i==null?0:i.length;return s?Ui(i,0,-1):[]}var JE=wt(function(i){var s=lr(i,P0);return s.length&&s[0]===i[0]?g0(s):[]}),XE=wt(function(i){var s=Li(i),f=lr(i,P0);return s===Li(f)?s=t:f.pop(),f.length&&f[0]===i[0]?g0(f,nt(s,2)):[]}),ZE=wt(function(i){var s=Li(i),f=lr(i,P0);return s=typeof s=="function"?s:t,s&&f.pop(),f.length&&f[0]===i[0]?g0(f,t,s):[]});function QE(i,s){return i==null?"":yh.call(i,s)}function Li(i){var s=i==null?0:i.length;return s?i[s-1]:t}function eS(i,s,f){var m=i==null?0:i.length;if(!m)return-1;var v=m;return f!==t&&(v=yt(f),v=v<0?Dr(m+v,0):Vr(v,m-1)),s===s?fo(i,s,v):C(i,oe,v,!0)}function tS(i,s){return i&&i.length?$g(i,yt(s)):t}var rS=wt(Nb);function Nb(i,s){return i&&i.length&&s&&s.length?w0(i,s):i}function nS(i,s,f){return i&&i.length&&s&&s.length?w0(i,s,nt(f,2)):i}function iS(i,s,f){return i&&i.length&&s&&s.length?w0(i,s,t,f):i}var oS=Ba(function(i,s){var f=i==null?0:i.length,m=d0(i,s);return Yg(i,lr(s,function(v){return Ca(v,f)?+v:v}).sort(ib)),m});function aS(i,s){var f=[];if(!(i&&i.length))return f;var m=-1,v=[],P=i.length;for(s=nt(s,3);++m<P;){var D=i[m];s(D,m,i)&&(f.push(D),v.push(m))}return Yg(i,v),f}function z0(i){return i==null?i:s0.call(i)}function sS(i,s,f){var m=i==null?0:i.length;return m?(f&&typeof f!="number"&&Tn(i,s,f)?(s=0,f=m):(s=s==null?0:yt(s),f=f===t?m:yt(f)),Ui(i,s,f)):[]}function uS(i,s){return Eh(i,s)}function cS(i,s,f){return A0(i,s,nt(f,2))}function fS(i,s){var f=i==null?0:i.length;if(f){var m=Eh(i,s);if(m<f&&ho(i[m],s))return m}return-1}function lS(i,s){return Eh(i,s,!0)}function hS(i,s,f){return A0(i,s,nt(f,2),!0)}function dS(i,s){var f=i==null?0:i.length;if(f){var m=Eh(i,s,!0)-1;if(ho(i[m],s))return m}return-1}function pS(i){return i&&i.length?Jg(i):[]}function mS(i,s){return i&&i.length?Jg(i,nt(s,2)):[]}function yS(i){var s=i==null?0:i.length;return s?Ui(i,1,s):[]}function gS(i,s,f){return i&&i.length?(s=f||s===t?1:yt(s),Ui(i,0,s<0?0:s)):[]}function bS(i,s,f){var m=i==null?0:i.length;return m?(s=f||s===t?1:yt(s),s=m-s,Ui(i,s<0?0:s,m)):[]}function vS(i,s){return i&&i.length?Sh(i,nt(s,3),!1,!0):[]}function _S(i,s){return i&&i.length?Sh(i,nt(s,3)):[]}var wS=wt(function(i){return ds(sn(i,1,Nr,!0))}),xS=wt(function(i){var s=Li(i);return Nr(s)&&(s=t),ds(sn(i,1,Nr,!0),nt(s,2))}),kS=wt(function(i){var s=Li(i);return s=typeof s=="function"?s:t,ds(sn(i,1,Nr,!0),t,s)});function AS(i){return i&&i.length?ds(i):[]}function ES(i,s){return i&&i.length?ds(i,nt(s,2)):[]}function SS(i,s){return s=typeof s=="function"?s:t,i&&i.length?ds(i,t,s):[]}function q0(i){if(!(i&&i.length))return[];var s=0;return i=Yo(i,function(f){if(Nr(f))return s=Dr(f.length,s),!0}),on(s,function(f){return lr(i,Me(f))})}function Ub(i,s){if(!(i&&i.length))return[];var f=q0(i);return s==null?f:lr(f,function(m){return yn(s,t,m)})}var PS=wt(function(i,s){return Nr(i)?Pf(i,s):[]}),TS=wt(function(i){return S0(Yo(i,Nr))}),BS=wt(function(i){var s=Li(i);return Nr(s)&&(s=t),S0(Yo(i,Nr),nt(s,2))}),CS=wt(function(i){var s=Li(i);return s=typeof s=="function"?s:t,S0(Yo(i,Nr),t,s)}),FS=wt(q0);function IS(i,s){return eb(i||[],s||[],Sf)}function DS(i,s){return eb(i||[],s||[],Cf)}var RS=wt(function(i){var s=i.length,f=s>1?i[s-1]:t;return f=typeof f=="function"?(i.pop(),f):t,Ub(i,f)});function Lb(i){var s=A(i);return s.__chain__=!0,s}function NS(i,s){return s(i),i}function Nh(i,s){return s(i)}var US=Ba(function(i){var s=i.length,f=s?i[0]:0,m=this.__wrapped__,v=function(P){return d0(P,i)};return s>1||this.__actions__.length||!(m instanceof x)||!Ca(f)?this.thru(v):(m=m.slice(f,+f+(s?1:0)),m.__actions__.push({func:Nh,args:[v],thisArg:t}),new zn(m,this.__chain__).thru(function(P){return s&&!P.length&&P.push(t),P}))});function LS(){return Lb(this)}function MS(){return new zn(this.value(),this.__chain__)}function OS(){this.__values__===t&&(this.__values__=Xb(this.value()));var i=this.__index__>=this.__values__.length,s=i?t:this.__values__[this.__index__++];return{done:i,value:s}}function KS(){return this}function zS(i){for(var s,f=this;f instanceof ac;){var m=Cb(f);m.__index__=0,m.__values__=t,s?v.__wrapped__=m:s=m;var v=m;f=f.__wrapped__}return v.__wrapped__=i,s}function qS(){var i=this.__wrapped__;if(i instanceof x){var s=i;return this.__actions__.length&&(s=new x(this)),s=s.reverse(),s.__actions__.push({func:Nh,args:[z0],thisArg:t}),new zn(s,this.__chain__)}return this.thru(z0)}function HS(){return Qg(this.__wrapped__,this.__actions__)}var jS=Ph(function(i,s,f){Kt.call(i,f)?++i[f]:Pa(i,f,1)});function $S(i,s,f){var m=lt(i)?Ju:N6;return f&&Tn(i,s,f)&&(s=t),m(i,nt(s,3))}function GS(i,s){var f=lt(i)?Yo:Ug;return f(i,nt(s,3))}var WS=fb(Fb),YS=fb(Ib);function VS(i,s){return sn(Uh(i,s),1)}function JS(i,s){return sn(Uh(i,s),Rt)}function XS(i,s,f){return f=f===t?1:yt(f),sn(Uh(i,s),f)}function Mb(i,s){var f=lt(i)?An:hs;return f(i,nt(s,3))}function Ob(i,s){var f=lt(i)?wa:Ng;return f(i,nt(s,3))}var ZS=Ph(function(i,s,f){Kt.call(i,f)?i[f].push(s):Pa(i,f,[s])});function QS(i,s,f,m){i=jn(i)?i:lc(i),f=f&&!m?yt(f):0;var v=i.length;return f<0&&(f=Dr(v+f,0)),zh(i)?f<=v&&i.indexOf(s,f)>-1:!!v&&I(i,s,f)>-1}var eP=wt(function(i,s,f){var m=-1,v=typeof s=="function",P=jn(i)?X(i.length):[];return hs(i,function(D){P[++m]=v?yn(s,D,f):Tf(D,s,f)}),P}),tP=Ph(function(i,s,f){Pa(i,f,s)});function Uh(i,s){var f=lt(i)?lr:qg;return f(i,nt(s,3))}function rP(i,s,f,m){return i==null?[]:(lt(s)||(s=s==null?[]:[s]),f=m?t:f,lt(f)||(f=f==null?[]:[f]),Gg(i,s,f))}var nP=Ph(function(i,s,f){i[f?0:1].push(s)},function(){return[[],[]]});function iP(i,s,f){var m=lt(i)?bf:Je,v=arguments.length<3;return m(i,nt(s,4),f,v,hs)}function oP(i,s,f){var m=lt(i)?Gp:Je,v=arguments.length<3;return m(i,nt(s,4),f,v,Ng)}function aP(i,s){var f=lt(i)?Yo:Ug;return f(i,Oh(nt(s,3)))}function sP(i){var s=lt(i)?Fg:Q6;return s(i)}function uP(i,s,f){(f?Tn(i,s,f):s===t)?s=1:s=yt(s);var m=lt(i)?C6:eE;return m(i,s)}function cP(i){var s=lt(i)?F6:rE;return s(i)}function fP(i){if(i==null)return 0;if(jn(i))return zh(i)?xa(i):i.length;var s=bn(i);return s==Oe||s==ar?i.size:v0(i).length}function lP(i,s,f){var m=lt(i)?g:nE;return f&&Tn(i,s,f)&&(s=t),m(i,nt(s,3))}var hP=wt(function(i,s){if(i==null)return[];var f=s.length;return f>1&&Tn(i,s[0],s[1])?s=[]:f>2&&Tn(s[0],s[1],s[2])&&(s=[s[0]]),Gg(i,sn(s,1),[])}),Lh=t0||function(){return Fr.Date.now()};function dP(i,s){if(typeof s!="function")throw new gn(o);return i=yt(i),function(){if(--i<1)return s.apply(this,arguments)}}function Kb(i,s,f){return s=f?t:s,s=i&&s==null?i.length:s,Ta(i,Fe,t,t,t,t,s)}function zb(i,s){var f;if(typeof s!="function")throw new gn(o);return i=yt(i),function(){return--i>0&&(f=s.apply(this,arguments)),i<=1&&(s=t),f}}var H0=wt(function(i,s,f){var m=U;if(f.length){var v=Sn(f,cc(H0));m|=J}return Ta(i,m,s,f,v)}),qb=wt(function(i,s,f){var m=U|V;if(f.length){var v=Sn(f,cc(qb));m|=J}return Ta(s,m,i,f,v)});function Hb(i,s,f){s=f?t:s;var m=Ta(i,Q,t,t,t,t,t,s);return m.placeholder=Hb.placeholder,m}function jb(i,s,f){s=f?t:s;var m=Ta(i,ue,t,t,t,t,t,s);return m.placeholder=jb.placeholder,m}function $b(i,s,f){var m,v,P,D,L,$,he=0,pe=!1,ve=!1,Ne=!0;if(typeof i!="function")throw new gn(o);s=Mi(s)||0,wr(f)&&(pe=!!f.leading,ve="maxWait"in f,P=ve?Dr(Mi(f.maxWait)||0,s):P,Ne="trailing"in f?!!f.trailing:Ne);function Ye(Ur){var po=m,Da=v;return m=v=t,he=Ur,D=i.apply(Da,po),D}function it(Ur){return he=Ur,L=Df(At,s),pe?Ye(Ur):D}function bt(Ur){var po=Ur-$,Da=Ur-he,fv=s-po;return ve?Vr(fv,P-Da):fv}function ot(Ur){var po=Ur-$,Da=Ur-he;return $===t||po>=s||po<0||ve&&Da>=P}function At(){var Ur=Lh();if(ot(Ur))return St(Ur);L=Df(At,bt(Ur))}function St(Ur){return L=t,Ne&&m?Ye(Ur):(m=v=t,D)}function oi(){L!==t&&tb(L),he=0,m=$=v=L=t}function Bn(){return L===t?D:St(Lh())}function ai(){var Ur=Lh(),po=ot(Ur);if(m=arguments,v=this,$=Ur,po){if(L===t)return it($);if(ve)return tb(L),L=Df(At,s),Ye($)}return L===t&&(L=Df(At,s)),D}return ai.cancel=oi,ai.flush=Bn,ai}var pP=wt(function(i,s){return Rg(i,1,s)}),mP=wt(function(i,s,f){return Rg(i,Mi(s)||0,f)});function yP(i){return Ta(i,re)}function Mh(i,s){if(typeof i!="function"||s!=null&&typeof s!="function")throw new gn(o);var f=function(){var m=arguments,v=s?s.apply(this,m):m[0],P=f.cache;if(P.has(v))return P.get(v);var D=i.apply(this,m);return f.cache=P.set(v,D)||P,D};return f.cache=new(Mh.Cache||Vt),f}Mh.Cache=Vt;function Oh(i){if(typeof i!="function")throw new gn(o);return function(){var s=arguments;switch(s.length){case 0:return!i.call(this);case 1:return!i.call(this,s[0]);case 2:return!i.call(this,s[0],s[1]);case 3:return!i.call(this,s[0],s[1],s[2])}return!i.apply(this,s)}}function gP(i){return zb(2,i)}var bP=iE(function(i,s){s=s.length==1&<(s[0])?lr(s[0],Mt(nt())):lr(sn(s,1),Mt(nt()));var f=s.length;return wt(function(m){for(var v=-1,P=Vr(m.length,f);++v<P;)m[v]=s[v].call(this,m[v]);return yn(i,this,m)})}),j0=wt(function(i,s){var f=Sn(s,cc(j0));return Ta(i,J,t,s,f)}),Gb=wt(function(i,s){var f=Sn(s,cc(Gb));return Ta(i,ye,t,s,f)}),vP=Ba(function(i,s){return Ta(i,Z,t,t,t,s)});function _P(i,s){if(typeof i!="function")throw new gn(o);return s=s===t?s:yt(s),wt(i,s)}function wP(i,s){if(typeof i!="function")throw new gn(o);return s=s==null?0:Dr(yt(s),0),wt(function(f){var m=f[s],v=ms(f,0,s);return m&&Vo(v,m),yn(i,this,v)})}function xP(i,s,f){var m=!0,v=!0;if(typeof i!="function")throw new gn(o);return wr(f)&&(m="leading"in f?!!f.leading:m,v="trailing"in f?!!f.trailing:v),$b(i,s,{leading:m,maxWait:s,trailing:v})}function kP(i){return Kb(i,1)}function AP(i,s){return j0(T0(s),i)}function EP(){if(!arguments.length)return[];var i=arguments[0];return lt(i)?i:[i]}function SP(i){return Ni(i,w)}function PP(i,s){return s=typeof s=="function"?s:t,Ni(i,w,s)}function TP(i){return Ni(i,l|w)}function BP(i,s){return s=typeof s=="function"?s:t,Ni(i,l|w,s)}function CP(i,s){return s==null||Dg(i,s,Jr(s))}function ho(i,s){return i===s||i!==i&&s!==s}var FP=Fh(y0),IP=Fh(function(i,s){return i>=s}),au=Og(function(){return arguments}())?Og:function(i){return Sr(i)&&Kt.call(i,"callee")&&!lo.call(i,"callee")},lt=X.isArray,DP=df?Mt(df):z6;function jn(i){return i!=null&&Kh(i.length)&&!Fa(i)}function Nr(i){return Sr(i)&&jn(i)}function RP(i){return i===!0||i===!1||Sr(i)&&Pn(i)==ce}var ys=n0||tm,NP=oh?Mt(oh):q6;function UP(i){return Sr(i)&&i.nodeType===1&&!Rf(i)}function LP(i){if(i==null)return!0;if(jn(i)&&(lt(i)||typeof i=="string"||typeof i.splice=="function"||ys(i)||fc(i)||au(i)))return!i.length;var s=bn(i);if(s==Oe||s==ar)return!i.size;if(If(i))return!v0(i).length;for(var f in i)if(Kt.call(i,f))return!1;return!0}function MP(i,s){return Bf(i,s)}function OP(i,s,f){f=typeof f=="function"?f:t;var m=f?f(i,s):t;return m===t?Bf(i,s,t,f):!!m}function $0(i){if(!Sr(i))return!1;var s=Pn(i);return s==De||s==Be||typeof i.message=="string"&&typeof i.name=="string"&&!Rf(i)}function KP(i){return typeof i=="number"&&mh(i)}function Fa(i){if(!wr(i))return!1;var s=Pn(i);return s==$e||s==We||s==k||s==Ai}function Wb(i){return typeof i=="number"&&i==yt(i)}function Kh(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=ir}function wr(i){var s=typeof i;return i!=null&&(s=="object"||s=="function")}function Sr(i){return i!=null&&typeof i=="object"}var Yb=pf?Mt(pf):j6;function zP(i,s){return i===s||b0(i,s,N0(s))}function qP(i,s,f){return f=typeof f=="function"?f:t,b0(i,s,N0(s),f)}function HP(i){return Vb(i)&&i!=+i}function jP(i){if(PE(i))throw new tt(n);return Kg(i)}function $P(i){return i===null}function GP(i){return i==null}function Vb(i){return typeof i=="number"||Sr(i)&&Pn(i)==Ut}function Rf(i){if(!Sr(i)||Pn(i)!=mt)return!1;var s=Js(i);if(s===null)return!0;var f=Kt.call(s,"constructor")&&s.constructor;return typeof f=="function"&&f instanceof f&&Ys.call(f)==fh}var G0=is?Mt(is):$6;function WP(i){return Wb(i)&&i>=-ir&&i<=ir}var Jb=mf?Mt(mf):G6;function zh(i){return typeof i=="string"||!lt(i)&&Sr(i)&&Pn(i)==Or}function ii(i){return typeof i=="symbol"||Sr(i)&&Pn(i)==hr}var fc=yf?Mt(yf):W6;function YP(i){return i===t}function VP(i){return Sr(i)&&bn(i)==Kr}function JP(i){return Sr(i)&&Pn(i)==G}var XP=Fh(_0),ZP=Fh(function(i,s){return i<=s});function Xb(i){if(!i)return[];if(jn(i))return zh(i)?ri(i):Hn(i);if(ss&&i[ss])return Hs(i[ss]());var s=bn(i),f=s==Oe?os:s==ar?js:lc;return f(i)}function Ia(i){if(!i)return i===0?i:0;if(i=Mi(i),i===Rt||i===-Rt){var s=i<0?-1:1;return s*Wr}return i===i?i:0}function yt(i){var s=Ia(i),f=s%1;return s===s?f?s-f:s:0}function Zb(i){return i?ru(yt(i),0,fr):0}function Mi(i){if(typeof i=="number")return i;if(ii(i))return vr;if(wr(i)){var s=typeof i.valueOf=="function"?i.valueOf():i;i=wr(s)?s+"":s}if(typeof i!="string")return i===0?i:+i;i=Ri(i);var f=qo.test(i);return f||Ho.test(i)?Wu(i.slice(2),f?2:8):zo.test(i)?vr:+i}function Qb(i){return ea(i,$n(i))}function QP(i){return i?ru(yt(i),-ir,ir):i===0?i:0}function Jt(i){return i==null?"":ni(i)}var eT=sc(function(i,s){if(If(s)||jn(s)){ea(s,Jr(s),i);return}for(var f in s)Kt.call(s,f)&&Sf(i,f,s[f])}),ev=sc(function(i,s){ea(s,$n(s),i)}),qh=sc(function(i,s,f,m){ea(s,$n(s),i,m)}),tT=sc(function(i,s,f,m){ea(s,Jr(s),i,m)}),rT=Ba(d0);function nT(i,s){var f=Zo(i);return s==null?f:Ig(f,s)}var iT=wt(function(i,s){i=Ot(i);var f=-1,m=s.length,v=m>2?s[2]:t;for(v&&Tn(s[0],s[1],v)&&(m=1);++f<m;)for(var P=s[f],D=$n(P),L=-1,$=D.length;++L<$;){var he=D[L],pe=i[he];(pe===t||ho(pe,ka[he])&&!Kt.call(i,he))&&(i[he]=P[he])}return i}),oT=wt(function(i){return i.push(t,gb),yn(tv,t,i)});function aT(i,s){return S(i,nt(s,3),Qo)}function sT(i,s){return S(i,nt(s,3),m0)}function uT(i,s){return i==null?i:p0(i,nt(s,3),$n)}function cT(i,s){return i==null?i:Lg(i,nt(s,3),$n)}function fT(i,s){return i&&Qo(i,nt(s,3))}function lT(i,s){return i&&m0(i,nt(s,3))}function hT(i){return i==null?[]:kh(i,Jr(i))}function dT(i){return i==null?[]:kh(i,$n(i))}function W0(i,s,f){var m=i==null?t:nu(i,s);return m===t?f:m}function pT(i,s){return i!=null&&_b(i,s,L6)}function Y0(i,s){return i!=null&&_b(i,s,M6)}var mT=hb(function(i,s,f){s!=null&&typeof s.toString!="function"&&(s=Vs.call(s)),i[s]=f},J0(Gn)),yT=hb(function(i,s,f){s!=null&&typeof s.toString!="function"&&(s=Vs.call(s)),Kt.call(i,s)?i[s].push(f):i[s]=[f]},nt),gT=wt(Tf);function Jr(i){return jn(i)?Cg(i):v0(i)}function $n(i){return jn(i)?Cg(i,!0):Y6(i)}function bT(i,s){var f={};return s=nt(s,3),Qo(i,function(m,v,P){Pa(f,s(m,v,P),m)}),f}function vT(i,s){var f={};return s=nt(s,3),Qo(i,function(m,v,P){Pa(f,v,s(m,v,P))}),f}var _T=sc(function(i,s,f){Ah(i,s,f)}),tv=sc(function(i,s,f,m){Ah(i,s,f,m)}),wT=Ba(function(i,s){var f={};if(i==null)return f;var m=!1;s=lr(s,function(P){return P=ps(P,i),m||(m=P.length>1),P}),ea(i,D0(i),f),m&&(f=Ni(f,l|y|w,mE));for(var v=s.length;v--;)E0(f,s[v]);return f});function xT(i,s){return rv(i,Oh(nt(s)))}var kT=Ba(function(i,s){return i==null?{}:J6(i,s)});function rv(i,s){if(i==null)return{};var f=lr(D0(i),function(m){return[m]});return s=nt(s),Wg(i,f,function(m,v){return s(m,v[0])})}function AT(i,s,f){s=ps(s,i);var m=-1,v=s.length;for(v||(v=1,i=t);++m<v;){var P=i==null?t:i[ta(s[m])];P===t&&(m=v,P=f),i=Fa(P)?P.call(i):P}return i}function ET(i,s,f){return i==null?i:Cf(i,s,f)}function ST(i,s,f,m){return m=typeof m=="function"?m:t,i==null?i:Cf(i,s,f,m)}var nv=mb(Jr),iv=mb($n);function PT(i,s,f){var m=lt(i),v=m||ys(i)||fc(i);if(s=nt(s,4),f==null){var P=i&&i.constructor;v?f=m?new P:[]:wr(i)?f=Fa(P)?Zo(Js(i)):{}:f={}}return(v?An:Qo)(i,function(D,L,$){return s(f,D,L,$)}),f}function TT(i,s){return i==null?!0:E0(i,s)}function BT(i,s,f){return i==null?i:Zg(i,s,T0(f))}function CT(i,s,f,m){return m=typeof m=="function"?m:t,i==null?i:Zg(i,s,T0(f),m)}function lc(i){return i==null?[]:qs(i,Jr(i))}function FT(i){return i==null?[]:qs(i,$n(i))}function IT(i,s,f){return f===t&&(f=s,s=t),f!==t&&(f=Mi(f),f=f===f?f:0),s!==t&&(s=Mi(s),s=s===s?s:0),ru(Mi(i),s,f)}function DT(i,s,f){return s=Ia(s),f===t?(f=s,s=0):f=Ia(f),i=Mi(i),O6(i,s,f)}function RT(i,s,f){if(f&&typeof f!="boolean"&&Tn(i,s,f)&&(s=f=t),f===t&&(typeof s=="boolean"?(f=s,s=t):typeof i=="boolean"&&(f=i,i=t)),i===t&&s===t?(i=0,s=1):(i=Ia(i),s===t?(s=i,i=0):s=Ia(s)),i>s){var m=i;i=s,s=m}if(f||i%1||s%1){var v=gh();return Vr(i+v*(s-i+_a("1e-"+((v+"").length-1))),s)}return x0(i,s)}var NT=uc(function(i,s,f){return s=s.toLowerCase(),i+(f?ov(s):s)});function ov(i){return V0(Jt(i).toLowerCase())}function av(i){return i=Jt(i),i&&i.replace(ao,rr).replace(Ql,"")}function UT(i,s,f){i=Jt(i),s=ni(s);var m=i.length;f=f===t?m:ru(yt(f),0,m);var v=f;return f-=s.length,f>=0&&i.slice(f,v)==s}function LT(i){return i=Jt(i),i&&No.test(i)?i.replace(Pi,qr):i}function MT(i){return i=Jt(i),i&&Oo.test(i)?i.replace(Bi,"\\$&"):i}var OT=uc(function(i,s,f){return i+(f?"-":"")+s.toLowerCase()}),KT=uc(function(i,s,f){return i+(f?" ":"")+s.toLowerCase()}),zT=cb("toLowerCase");function qT(i,s,f){i=Jt(i),s=yt(s);var m=s?xa(i):0;if(!s||m>=s)return i;var v=(s-m)/2;return Ch(ic(v),f)+i+Ch(nc(v),f)}function HT(i,s,f){i=Jt(i),s=yt(s);var m=s?xa(i):0;return s&&m<s?i+Ch(s-m,f):i}function jT(i,s,f){i=Jt(i),s=yt(s);var m=s?xa(i):0;return s&&m<s?Ch(s-m,f)+i:i}function $T(i,s,f){return f||s==null?s=0:s&&(s=+s),a0(Jt(i).replace(Ci,""),s||0)}function GT(i,s,f){return(f?Tn(i,s,f):s===t)?s=1:s=yt(s),k0(Jt(i),s)}function WT(){var i=arguments,s=Jt(i[0]);return i.length<3?s:s.replace(i[1],i[2])}var YT=uc(function(i,s,f){return i+(f?"_":"")+s.toLowerCase()});function VT(i,s,f){return f&&typeof f!="number"&&Tn(i,s,f)&&(s=f=t),f=f===t?fr:f>>>0,f?(i=Jt(i),i&&(typeof s=="string"||s!=null&&!G0(s))&&(s=ni(s),!s&&Hr(i))?ms(ri(i),0,f):i.split(s,f)):[]}var JT=uc(function(i,s,f){return i+(f?" ":"")+V0(s)});function XT(i,s,f){return i=Jt(i),f=f==null?0:ru(yt(f),0,i.length),s=ni(s),i.slice(f,f+s.length)==s}function ZT(i,s,f){var m=A.templateSettings;f&&Tn(i,s,f)&&(s=t),i=Jt(i),s=qh({},s,m,yb);var v=qh({},s.imports,m.imports,yb),P=Jr(v),D=qs(v,P),L,$,he=0,pe=s.interpolate||pn,ve="__p += '",Ne=$s((s.escape||pn).source+"|"+pe.source+"|"+(pe===Ti?Ko:pn).source+"|"+(s.evaluate||pn).source+"|$","g"),Ye="//# sourceURL="+(Kt.call(s,"sourceURL")?(s.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++va+"]")+`
|
11 | `;i.replace(Ne,function(ot,At,St,oi,Bn,ai){return St||(St=oi),ve+=i.slice(he,ai).replace($o,En),At&&(L=!0,ve+=`' +
|
12 | __e(`+At+`) +
|
13 | '`),Bn&&($=!0,ve+=`';
|
14 | `+Bn+`;
|
15 | __p += '`),St&&(ve+=`' +
|
16 | ((__t = (`+St+`)) == null ? '' : __t) +
|
17 | '`),he=ai+ot.length,ot}),ve+=`';
|
18 | `;var it=Kt.call(s,"variable")&&s.variable;if(!it)ve=`with (obj) {
|
19 | `+ve+`
|
20 | }
|
21 | `;else if(no.test(it))throw new tt(a);ve=($?ve.replace(Mn,""):ve).replace(Qi,"$1").replace(Ei,"$1;"),ve="function("+(it||"obj")+`) {
|
22 | `+(it?"":`obj || (obj = {});
|
23 | `)+"var __t, __p = ''"+(L?", __e = _.escape":"")+($?`, __j = Array.prototype.join;
|
24 | function print() { __p += __j.call(arguments, '') }
|
25 | `:`;
|
26 | `)+ve+`return __p
|
27 | }`;var bt=uv(function(){return It(P,Ye+"return "+ve).apply(t,D)});if(bt.source=ve,$0(bt))throw bt;return bt}function QT(i){return Jt(i).toLowerCase()}function eB(i){return Jt(i).toUpperCase()}function tB(i,s,f){if(i=Jt(i),i&&(f||s===t))return Ri(i);if(!i||!(s=ni(s)))return i;var m=ri(i),v=ri(s),P=Le(m,v),D=Ft(m,v)+1;return ms(m,P,D).join("")}function rB(i,s,f){if(i=Jt(i),i&&(f||s===t))return i.slice(0,sh(i)+1);if(!i||!(s=ni(s)))return i;var m=ri(i),v=Ft(m,ri(s))+1;return ms(m,0,v).join("")}function nB(i,s,f){if(i=Jt(i),i&&(f||s===t))return i.replace(Ci,"");if(!i||!(s=ni(s)))return i;var m=ri(i),v=Le(m,ri(s));return ms(m,v).join("")}function iB(i,s){var f=Ce,m=et;if(wr(s)){var v="separator"in s?s.separator:v;f="length"in s?yt(s.length):f,m="omission"in s?ni(s.omission):m}i=Jt(i);var P=i.length;if(Hr(i)){var D=ri(i);P=D.length}if(f>=P)return i;var L=f-xa(m);if(L<1)return m;var $=D?ms(D,0,L).join(""):i.slice(0,L);if(v===t)return $+m;if(D&&(L+=$.length-L),G0(v)){if(i.slice(L).search(v)){var he,pe=$;for(v.global||(v=$s(v.source,Jt(oo.exec(v))+"g")),v.lastIndex=0;he=v.exec(pe);)var ve=he.index;$=$.slice(0,ve===t?L:ve)}}else if(i.indexOf(ni(v),L)!=L){var Ne=$.lastIndexOf(v);Ne>-1&&($=$.slice(0,Ne))}return $+m}function oB(i){return i=Jt(i),i&&nn.test(i)?i.replace(Si,Vp):i}var aB=uc(function(i,s,f){return i+(f?" ":"")+s.toUpperCase()}),V0=cb("toUpperCase");function sv(i,s,f){return i=Jt(i),s=f?t:s,s===t?co(i)?Zp(i):b(i):i.match(s)||[]}var uv=wt(function(i,s){try{return yn(i,t,s)}catch(f){return $0(f)?f:new tt(f)}}),sB=Ba(function(i,s){return An(s,function(f){f=ta(f),Pa(i,f,H0(i[f],i))}),i});function uB(i){var s=i==null?0:i.length,f=nt();return i=s?lr(i,function(m){if(typeof m[1]!="function")throw new gn(o);return[f(m[0]),m[1]]}):[],wt(function(m){for(var v=-1;++v<s;){var P=i[v];if(yn(P[0],this,m))return yn(P[1],this,m)}})}function cB(i){return R6(Ni(i,l))}function J0(i){return function(){return i}}function fB(i,s){return i==null||i!==i?s:i}var lB=lb(),hB=lb(!0);function Gn(i){return i}function X0(i){return zg(typeof i=="function"?i:Ni(i,l))}function dB(i){return Hg(Ni(i,l))}function pB(i,s){return jg(i,Ni(s,l))}var mB=wt(function(i,s){return function(f){return Tf(f,i,s)}}),yB=wt(function(i,s){return function(f){return Tf(i,f,s)}});function Z0(i,s,f){var m=Jr(s),v=kh(s,m);f==null&&!(wr(s)&&(v.length||!m.length))&&(f=s,s=i,i=this,v=kh(s,Jr(s)));var P=!(wr(f)&&"chain"in f)||!!f.chain,D=Fa(i);return An(v,function(L){var $=s[L];i[L]=$,D&&(i.prototype[L]=function(){var he=this.__chain__;if(P||he){var pe=i(this.__wrapped__),ve=pe.__actions__=Hn(this.__actions__);return ve.push({func:$,args:arguments,thisArg:i}),pe.__chain__=he,pe}return $.apply(i,Vo([this.value()],arguments))})}),i}function gB(){return Fr._===this&&(Fr._=lh),this}function Q0(){}function bB(i){return i=yt(i),wt(function(s){return $g(s,i)})}var vB=C0(lr),_B=C0(Ju),wB=C0(g);function cv(i){return L0(i)?Me(ta(i)):X6(i)}function xB(i){return function(s){return i==null?t:nu(i,s)}}var kB=db(),AB=db(!0);function em(){return[]}function tm(){return!1}function EB(){return{}}function SB(){return""}function PB(){return!0}function TB(i,s){if(i=yt(i),i<1||i>ir)return[];var f=fr,m=Vr(i,fr);s=nt(s),i-=fr;for(var v=on(m,s);++f<i;)s(f);return v}function BB(i){return lt(i)?lr(i,ta):ii(i)?[i]:Hn(Bb(Jt(i)))}function CB(i){var s=++ch;return Jt(i)+s}var FB=Bh(function(i,s){return i+s},0),IB=F0("ceil"),DB=Bh(function(i,s){return i/s},1),RB=F0("floor");function NB(i){return i&&i.length?xh(i,Gn,y0):t}function UB(i,s){return i&&i.length?xh(i,nt(s,2),y0):t}function LB(i){return ee(i,Gn)}function MB(i,s){return ee(i,nt(s,2))}function OB(i){return i&&i.length?xh(i,Gn,_0):t}function KB(i,s){return i&&i.length?xh(i,nt(s,2),_0):t}var zB=Bh(function(i,s){return i*s},1),qB=F0("round"),HB=Bh(function(i,s){return i-s},0);function jB(i){return i&&i.length?Yt(i,Gn):0}function $B(i,s){return i&&i.length?Yt(i,nt(s,2)):0}return A.after=dP,A.ary=Kb,A.assign=eT,A.assignIn=ev,A.assignInWith=qh,A.assignWith=tT,A.at=rT,A.before=zb,A.bind=H0,A.bindAll=sB,A.bindKey=qb,A.castArray=EP,A.chain=Lb,A.chunk=RE,A.compact=NE,A.concat=UE,A.cond=uB,A.conforms=cB,A.constant=J0,A.countBy=jS,A.create=nT,A.curry=Hb,A.curryRight=jb,A.debounce=$b,A.defaults=iT,A.defaultsDeep=oT,A.defer=pP,A.delay=mP,A.difference=LE,A.differenceBy=ME,A.differenceWith=OE,A.drop=KE,A.dropRight=zE,A.dropRightWhile=qE,A.dropWhile=HE,A.fill=jE,A.filter=GS,A.flatMap=VS,A.flatMapDeep=JS,A.flatMapDepth=XS,A.flatten=Db,A.flattenDeep=$E,A.flattenDepth=GE,A.flip=yP,A.flow=lB,A.flowRight=hB,A.fromPairs=WE,A.functions=hT,A.functionsIn=dT,A.groupBy=ZS,A.initial=VE,A.intersection=JE,A.intersectionBy=XE,A.intersectionWith=ZE,A.invert=mT,A.invertBy=yT,A.invokeMap=eP,A.iteratee=X0,A.keyBy=tP,A.keys=Jr,A.keysIn=$n,A.map=Uh,A.mapKeys=bT,A.mapValues=vT,A.matches=dB,A.matchesProperty=pB,A.memoize=Mh,A.merge=_T,A.mergeWith=tv,A.method=mB,A.methodOf=yB,A.mixin=Z0,A.negate=Oh,A.nthArg=bB,A.omit=wT,A.omitBy=xT,A.once=gP,A.orderBy=rP,A.over=vB,A.overArgs=bP,A.overEvery=_B,A.overSome=wB,A.partial=j0,A.partialRight=Gb,A.partition=nP,A.pick=kT,A.pickBy=rv,A.property=cv,A.propertyOf=xB,A.pull=rS,A.pullAll=Nb,A.pullAllBy=nS,A.pullAllWith=iS,A.pullAt=oS,A.range=kB,A.rangeRight=AB,A.rearg=vP,A.reject=aP,A.remove=aS,A.rest=_P,A.reverse=z0,A.sampleSize=uP,A.set=ET,A.setWith=ST,A.shuffle=cP,A.slice=sS,A.sortBy=hP,A.sortedUniq=pS,A.sortedUniqBy=mS,A.split=VT,A.spread=wP,A.tail=yS,A.take=gS,A.takeRight=bS,A.takeRightWhile=vS,A.takeWhile=_S,A.tap=NS,A.throttle=xP,A.thru=Nh,A.toArray=Xb,A.toPairs=nv,A.toPairsIn=iv,A.toPath=BB,A.toPlainObject=Qb,A.transform=PT,A.unary=kP,A.union=wS,A.unionBy=xS,A.unionWith=kS,A.uniq=AS,A.uniqBy=ES,A.uniqWith=SS,A.unset=TT,A.unzip=q0,A.unzipWith=Ub,A.update=BT,A.updateWith=CT,A.values=lc,A.valuesIn=FT,A.without=PS,A.words=sv,A.wrap=AP,A.xor=TS,A.xorBy=BS,A.xorWith=CS,A.zip=FS,A.zipObject=IS,A.zipObjectDeep=DS,A.zipWith=RS,A.entries=nv,A.entriesIn=iv,A.extend=ev,A.extendWith=qh,Z0(A,A),A.add=FB,A.attempt=uv,A.camelCase=NT,A.capitalize=ov,A.ceil=IB,A.clamp=IT,A.clone=SP,A.cloneDeep=TP,A.cloneDeepWith=BP,A.cloneWith=PP,A.conformsTo=CP,A.deburr=av,A.defaultTo=fB,A.divide=DB,A.endsWith=UT,A.eq=ho,A.escape=LT,A.escapeRegExp=MT,A.every=$S,A.find=WS,A.findIndex=Fb,A.findKey=aT,A.findLast=YS,A.findLastIndex=Ib,A.findLastKey=sT,A.floor=RB,A.forEach=Mb,A.forEachRight=Ob,A.forIn=uT,A.forInRight=cT,A.forOwn=fT,A.forOwnRight=lT,A.get=W0,A.gt=FP,A.gte=IP,A.has=pT,A.hasIn=Y0,A.head=Rb,A.identity=Gn,A.includes=QS,A.indexOf=YE,A.inRange=DT,A.invoke=gT,A.isArguments=au,A.isArray=lt,A.isArrayBuffer=DP,A.isArrayLike=jn,A.isArrayLikeObject=Nr,A.isBoolean=RP,A.isBuffer=ys,A.isDate=NP,A.isElement=UP,A.isEmpty=LP,A.isEqual=MP,A.isEqualWith=OP,A.isError=$0,A.isFinite=KP,A.isFunction=Fa,A.isInteger=Wb,A.isLength=Kh,A.isMap=Yb,A.isMatch=zP,A.isMatchWith=qP,A.isNaN=HP,A.isNative=jP,A.isNil=GP,A.isNull=$P,A.isNumber=Vb,A.isObject=wr,A.isObjectLike=Sr,A.isPlainObject=Rf,A.isRegExp=G0,A.isSafeInteger=WP,A.isSet=Jb,A.isString=zh,A.isSymbol=ii,A.isTypedArray=fc,A.isUndefined=YP,A.isWeakMap=VP,A.isWeakSet=JP,A.join=QE,A.kebabCase=OT,A.last=Li,A.lastIndexOf=eS,A.lowerCase=KT,A.lowerFirst=zT,A.lt=XP,A.lte=ZP,A.max=NB,A.maxBy=UB,A.mean=LB,A.meanBy=MB,A.min=OB,A.minBy=KB,A.stubArray=em,A.stubFalse=tm,A.stubObject=EB,A.stubString=SB,A.stubTrue=PB,A.multiply=zB,A.nth=tS,A.noConflict=gB,A.noop=Q0,A.now=Lh,A.pad=qT,A.padEnd=HT,A.padStart=jT,A.parseInt=$T,A.random=RT,A.reduce=iP,A.reduceRight=oP,A.repeat=GT,A.replace=WT,A.result=AT,A.round=qB,A.runInContext=q,A.sample=sP,A.size=fP,A.snakeCase=YT,A.some=lP,A.sortedIndex=uS,A.sortedIndexBy=cS,A.sortedIndexOf=fS,A.sortedLastIndex=lS,A.sortedLastIndexBy=hS,A.sortedLastIndexOf=dS,A.startCase=JT,A.startsWith=XT,A.subtract=HB,A.sum=jB,A.sumBy=$B,A.template=ZT,A.times=TB,A.toFinite=Ia,A.toInteger=yt,A.toLength=Zb,A.toLower=QT,A.toNumber=Mi,A.toSafeInteger=QP,A.toString=Jt,A.toUpper=eB,A.trim=tB,A.trimEnd=rB,A.trimStart=nB,A.truncate=iB,A.unescape=oB,A.uniqueId=CB,A.upperCase=aB,A.upperFirst=V0,A.each=Mb,A.eachRight=Ob,A.first=Rb,Z0(A,function(){var i={};return Qo(A,function(s,f){Kt.call(A.prototype,f)||(i[f]=s)}),i}(),{chain:!1}),A.VERSION=e,An(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){A[i].placeholder=A}),An(["drop","take"],function(i,s){x.prototype[i]=function(f){f=f===t?1:Dr(yt(f),0);var m=this.__filtered__&&!s?new x(this):this.clone();return m.__filtered__?m.__takeCount__=Vr(f,m.__takeCount__):m.__views__.push({size:Vr(f,fr),type:i+(m.__dir__<0?"Right":"")}),m},x.prototype[i+"Right"]=function(f){return this.reverse()[i](f).reverse()}}),An(["filter","map","takeWhile"],function(i,s){var f=s+1,m=f==ht||f==Bt;x.prototype[i]=function(v){var P=this.clone();return P.__iteratees__.push({iteratee:nt(v,3),type:f}),P.__filtered__=P.__filtered__||m,P}}),An(["head","last"],function(i,s){var f="take"+(s?"Right":"");x.prototype[i]=function(){return this[f](1).value()[0]}}),An(["initial","tail"],function(i,s){var f="drop"+(s?"":"Right");x.prototype[i]=function(){return this.__filtered__?new x(this):this[f](1)}}),x.prototype.compact=function(){return this.filter(Gn)},x.prototype.find=function(i){return this.filter(i).head()},x.prototype.findLast=function(i){return this.reverse().find(i)},x.prototype.invokeMap=wt(function(i,s){return typeof i=="function"?new x(this):this.map(function(f){return Tf(f,i,s)})}),x.prototype.reject=function(i){return this.filter(Oh(nt(i)))},x.prototype.slice=function(i,s){i=yt(i);var f=this;return f.__filtered__&&(i>0||s<0)?new x(f):(i<0?f=f.takeRight(-i):i&&(f=f.drop(i)),s!==t&&(s=yt(s),f=s<0?f.dropRight(-s):f.take(s-i)),f)},x.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},x.prototype.toArray=function(){return this.take(fr)},Qo(x.prototype,function(i,s){var f=/^(?:filter|find|map|reject)|While$/.test(s),m=/^(?:head|last)$/.test(s),v=A[m?"take"+(s=="last"?"Right":""):s],P=m||/^find/.test(s);!v||(A.prototype[s]=function(){var D=this.__wrapped__,L=m?[1]:arguments,$=D instanceof x,he=L[0],pe=$||lt(D),ve=function(At){var St=v.apply(A,Vo([At],L));return m&&Ne?St[0]:St};pe&&f&&typeof he=="function"&&he.length!=1&&($=pe=!1);var Ne=this.__chain__,Ye=!!this.__actions__.length,it=P&&!Ne,bt=$&&!Ye;if(!P&&pe){D=bt?D:new x(this);var ot=i.apply(D,L);return ot.__actions__.push({func:Nh,args:[ve],thisArg:t}),new zn(ot,Ne)}return it&&bt?i.apply(this,L):(ot=this.thru(ve),it?m?ot.value()[0]:ot.value():ot)})}),An(["pop","push","shift","sort","splice","unshift"],function(i){var s=Gs[i],f=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",m=/^(?:pop|shift)$/.test(i);A.prototype[i]=function(){var v=arguments;if(m&&!this.__chain__){var P=this.value();return s.apply(lt(P)?P:[],v)}return this[f](function(D){return s.apply(lt(D)?D:[],v)})}}),Qo(x.prototype,function(i,s){var f=A[s];if(f){var m=f.name+"";Kt.call(cs,m)||(cs[m]=[]),cs[m].push({name:s,func:f})}}),cs[Th(t,V).name]=[{name:"wrapper",func:t}],x.prototype.clone=N,x.prototype.reverse=B,x.prototype.value=z,A.prototype.at=US,A.prototype.chain=LS,A.prototype.commit=MS,A.prototype.next=OS,A.prototype.plant=zS,A.prototype.reverse=qS,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=HS,A.prototype.first=A.prototype.head,ss&&(A.prototype[ss]=KS),A},Jo=Qp();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(Fr._=Jo,define(function(){return Jo})):tr?((tr.exports=Jo)._=Jo,Yu._=Jo):Fr._=Jo}).call(Xc)});var R8=Y(Un=>{"use strict";var HU=Un&&Un.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zc=Un&&Un.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},Qc=Un&&Un.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},ag=Un&&Un.__param||function(t,e){return function(r,n){e(r,n,t)}},jU=Un&&Un.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},D8=Un&&Un.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Un,"__esModule",{value:!0});var $U=D8(Fo()),sg=D8(ig()),Ja=yi(),GU=Tp(),ug=function(){function t(){this._content=[]}return Object.defineProperty(t.prototype,"length",{get:function(){return this._content.length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this._content},set:function(e){this._content=e},enumerable:!0,configurable:!0}),t.prototype.get=function(e){return this._content[e]},t.prototype.add=function(e){var r=GU.sortedIndexBy(this._content,e,function(n){return n.frequency});this._content.splice(r,0,e)},t.prototype.remove=function(e){this._content.splice(e,1)},t.prototype.popMin=function(){return this._content.shift()},t.prototype.indexOf=function(e){return this._content.findIndex(function(r){return r.value===e})},t.prototype.clear=function(){this._content=[]},t}(),WU=function(t){HU(e,t);function e(r,n,o){var a=t.call(this)||this;return a._k=r,a._errorRate=n,a._accuracy=o,a._sketch=sg.default.create(n,o),a._heap=new ug,a}return e.prototype.add=function(r){this._sketch.update(r);var n=this._sketch.count(r);if(this._heap.length<this._k||n>=this._heap.get(0).frequency){var o=this._heap.indexOf(r);o>-1&&this._heap.remove(o),this._heap.add({value:r,frequency:n}),this._heap.length>this._k&&this._heap.popMin()}},e.prototype.clear=function(){this._sketch=sg.default.create(this._errorRate,this._accuracy),this._heap.clear()},e.prototype.values=function(){for(var r=[],n=this._heap.length-1;n>=0;n--){var o=this._heap.get(n);r.push({value:o.value,frequency:o.frequency,rank:this._heap.length-n})}return r},e.prototype.iterator=function(){var r=this._heap;return function(){var n,o;return jU(this,function(a){switch(a.label){case 0:n=r.length-1,a.label=1;case 1:return n>=0?(o=r.get(n),[4,{value:o.value,frequency:o.frequency,rank:r.length-n}]):[3,4];case 2:a.sent(),a.label=3;case 3:return n--,[3,1];case 4:return[2]}})}()},Zc([Ja.Field(),Qc("design:type",Number)],e.prototype,"_k",void 0),Zc([Ja.Field(),Qc("design:type",Number)],e.prototype,"_errorRate",void 0),Zc([Ja.Field(),Qc("design:type",Number)],e.prototype,"_accuracy",void 0),Zc([Ja.Field(),Qc("design:type",sg.default)],e.prototype,"_sketch",void 0),Zc([Ja.Field(function(r){return r.content},function(r){var n=new ug;return n.content=r,n}),Qc("design:type",ug)],e.prototype,"_heap",void 0),e=Zc([Ja.AutoExportable("TopK",["_seed"]),ag(0,Ja.Parameter("_k")),ag(1,Ja.Parameter("_errorRate")),ag(2,Ja.Parameter("_accuracy")),Qc("design:paramtypes",[Number,Number,Number])],e),e}($U.default);Un.default=WU});var cg=Y(hn=>{"use strict";var N8=hn&&hn.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Bp=hn&&hn.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},Cp=hn&&hn.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},U8=hn&&hn.__param||function(t,e){return function(r,n){e(r,n,t)}},YU=hn&&hn.__read||function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,a=[],u;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(c){u={error:c}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(u)throw u.error}}return a},VU=hn&&hn.__spread||function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(YU(arguments[e]));return t},JU=hn&&hn.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(hn,"__esModule",{value:!0});var XU=JU(Fo()),ef=yi(),ZU=Vi(),QU=Tp(),eL=function(t){N8(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(Error);function L8(t,e){return(e.a*t+e.b)%e.c}var tL=function(t){N8(e,t);function e(r,n){var o=t.call(this)||this;return o._nbHashes=r,o._hashFunctions=n,o._signature=ZU.allocateArray(o._nbHashes,Infinity),o}return Object.defineProperty(e.prototype,"nbHashes",{get:function(){return this._nbHashes},enumerable:!0,configurable:!0}),e.prototype.isEmpty=function(){return this._signature[0]===Infinity},e.prototype.add=function(r){for(var n=0;n<this._nbHashes;n++)this._signature[n]=Math.min(this._signature[n],L8(r,this._hashFunctions[n]))},e.prototype.bulkLoad=function(r){for(var n=this,o=function(c){var p=r.map(function(l){return L8(l,n._hashFunctions[c])});a._signature[c]=Math.min.apply(Math,VU([a._signature[c]],p))},a=this,u=0;u<this._nbHashes;u++)o(u)},e.prototype.compareWith=function(r){if(this.isEmpty()||r.isEmpty())throw new eL("Cannot compute a Jaccard similairty with a MinHash that contains no values");return QU.intersection(this._signature,r._signature).length/this._nbHashes},Bp([ef.Field(),Cp("design:type",Number)],e.prototype,"_nbHashes",void 0),Bp([ef.Field(),Cp("design:type",Array)],e.prototype,"_hashFunctions",void 0),Bp([ef.Field(),Cp("design:type",Array)],e.prototype,"_signature",void 0),e=Bp([ef.AutoExportable("MinHash",["_seed"]),U8(0,ef.Parameter("_nbHashes")),U8(1,ef.Parameter("_hashFunctions")),Cp("design:paramtypes",[Number,Array])],e),e}(XU.default);hn.MinHash=tL});var O8=Y(fg=>{"use strict";Object.defineProperty(fg,"__esModule",{value:!0});var rL=cg(),M8=Tp();function nL(t){if(t!==2&&t%2==0)return!1;for(var e=2;e<Math.sqrt(t);e++)if(t%e==0)return!1;return!0}function iL(t){for(var e=0;;){if(nL(t+e))return t+e;e++}}var oL=function(){function t(e,r){this._nbHashes=e,this._maxValue=r,this._hashFunctions=[];for(var n=iL(this._maxValue),o=0;o<this._nbHashes;o++){var a=M8.random(0,this._maxValue,!1),u=M8.random(0,this._maxValue,!1);this._hashFunctions.push({a,b:u,c:n})}}return t.prototype.create=function(){return new rL.MinHash(this._nbHashes,this._hashFunctions)},t}();fg.default=oL});var z8=Y((iH,K8)=>{function aL(t,e){return t===e||t!==t&&e!==e}K8.exports=aL});var G8=Y((oH,$8)=>{var q8=1/0,sL=17976931348623157e292,H8=0/0,uL="[object Symbol]",cL=/^\s+|\s+$/g,fL=/^[-+]0x[0-9a-f]+$/i,lL=/^0b[01]+$/i,hL=/^0o[0-7]+$/i,dL=parseInt;function pL(t,e,r,n){for(var o=t.length,a=r+(n?1:-1);n?a--:++a<o;)if(e(t[a],a,t))return a;return-1}function mL(t,e,r){if(e!==e)return pL(t,yL,r);for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}function yL(t){return t!==t}var gL=Object.prototype,bL=gL.toString,vL=Math.max;function _L(t,e,r){var n=t?t.length:0;if(!n)return-1;var o=r==null?0:AL(r);return o<0&&(o=vL(n+o,0)),mL(t,e,o)}function j8(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function wL(t){return!!t&&typeof t=="object"}function xL(t){return typeof t=="symbol"||wL(t)&&bL.call(t)==uL}function kL(t){if(!t)return t===0?t:0;if(t=EL(t),t===q8||t===-q8){var e=t<0?-1:1;return e*sL}return t===t?t:0}function AL(t){var e=kL(t),r=e%1;return e===e?r?e-r:e:0}function EL(t){if(typeof t=="number")return t;if(xL(t))return H8;if(j8(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=j8(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=t.replace(cL,"");var r=lL.test(t);return r||hL.test(t)?dL(t.slice(2),r?2:8):fL.test(t)?H8:+t}$8.exports=_L});var V8=Y(Io=>{"use strict";var SL=Io&&Io.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},PL=Io&&Io.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},W8=Io&&Io.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},TL=Io&&Io.__importStar||function(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};Object.defineProperty(Io,"__esModule",{value:!0});var BL=W8(z8()),lg=W8(G8()),Y8=TL(Vi()),CL=yi(),FL=yi(),IL=function(){function t(r){this._elements=Y8.allocateArray(r,null),this._size=r,this._length=0}e=t,Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),t.prototype.isFree=function(){return this._length<this._size},t.prototype.nextEmptySlot=function(){return lg.default(this._elements,null)},t.prototype.at=function(r){return this._elements[r]},t.prototype.add=function(r){return r===null||!this.isFree()?!1:(this.set(this.nextEmptySlot(),r),this._length++,!0)},t.prototype.remove=function(r){var n=lg.default(this._elements,r);return n<=-1?!1:(this.unset(n),!0)},t.prototype.has=function(r){return lg.default(this._elements,r)>-1},t.prototype.set=function(r,n){this._elements[r]=n},t.prototype.unset=function(r){this._elements[r]=null,this._length--},t.prototype.swapRandom=function(r,n){n===void 0&&(n=Math.random);var o=Y8.randomInt(0,this._length-1,n),a=this._elements[o];return this._elements[o]=r,a},t.prototype.swap=function(r,n){var o=this._elements[r];return this._elements[r]=n,o},t.prototype.equals=function(r){return this._size!==r.size||this._length!==r.length?!1:this._elements.every(function(n,o){return BL.default(r.at(o),n)})};var e;return t=e=SL([CL.Exportable({export:FL.cloneObject("Bucket","_size","_elements"),import:function(r){if(r.type!=="Bucket"||"_size"in r,!("_elements"in r))throw new Error("Cannot create a Bucket from a JSON export which does not represent a bucket");var n=new e(r._size);return r._elements.forEach(function(o,a){o!==null&&(n._elements[a]=o,n._length++)}),n}}),PL("design:paramtypes",[Number])],t),t}();Io.default=IL});var Q8=Y(Do=>{"use strict";var DL=Do&&Do.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),RL=Do&&Do.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},NL=Do&&Do.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},J8=Do&&Do.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Do,"__esModule",{value:!0});var UL=J8(Fo()),X8=J8(V8()),Z8=yi(),$l=Vi();function LL(t,e){var r=Math.ceil(Math.log2(1/e)+Math.log2(2*t));return Math.ceil(r/4)}var ML=function(t){DL(e,t);function e(n,o,a,u){u===void 0&&(u=500);var c=t.call(this)||this;return c._filter=$l.allocateArray(n,function(){return new X8.default(a)}),c._size=n,c._bucketSize=a,c._fingerprintLength=o,c._length=0,c._maxKicks=u,c}r=e,e.create=function(n,o,a,u){a===void 0&&(a=4),u===void 0&&(u=500);var c=LL(a,o),p=Math.ceil(n/a/.955);return new r(p,c,a,u)},e.from=function(n,o,a,u){a===void 0&&(a=4),u===void 0&&(u=500);var c=Array.from(n),p=r.create(c.length,o,a,u);return c.forEach(function(l){return p.add(l)}),p},Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fullSize",{get:function(){return this.size*this.bucketSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fingerprintLength",{get:function(){return this._fingerprintLength},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bucketSize",{get:function(){return this._bucketSize},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxKicks",{get:function(){return this._maxKicks},enumerable:!0,configurable:!0}),e.prototype.add=function(n,o,a){o===void 0&&(o=!1),a===void 0&&(a=!1);var u=this._locations(n);if(this._filter[u.firstIndex].isFree())this._filter[u.firstIndex].add(u.fingerprint);else if(this._filter[u.secondIndex].isFree())this._filter[u.secondIndex].add(u.fingerprint);else{for(var c=this.random()<.5?u.firstIndex:u.secondIndex,p=u.fingerprint,l=[],y=0;y<this._maxKicks;y++){var w=$l.randomInt(0,this._filter[c].length-1,this.random),F=this._filter[c].at(w);l.push([c,w,F]),this._filter[c].set(w,p),p=F;var _=$l.hashAsInt(p,this.seed,64);if(c=Math.abs(c^Math.abs(_))%this._filter.length,this._filter[c].isFree())return this._filter[c].add(p),this._length++,!0}if(!a)for(var U=l.length-1;U>=0;U--){var V=l[U];this._filter[V[0]].set(V[1],V[2])}if(o)throw new Error('The Cuckoo Filter is full, cannot insert element "'+n+'"');return!1}return this._length++,!0},e.prototype.remove=function(n){var o=this._locations(n);return this._filter[o.firstIndex].has(o.fingerprint)?(this._filter[o.firstIndex].remove(o.fingerprint),this._length--,!0):this._filter[o.secondIndex].has(o.fingerprint)?(this._filter[o.secondIndex].remove(o.fingerprint),this._length--,!0):!1},e.prototype.has=function(n){var o=this._locations(n);return this._filter[o.firstIndex].has(o.fingerprint)||this._filter[o.secondIndex].has(o.fingerprint)},e.prototype.rate=function(){var n=this._computeHashTableLoad(),o=this._fingerprintLength/n.load;return Math.pow(2,Math.log2(2*this._bucketSize)-n.load*o)},e.prototype._computeHashTableLoad=function(){var n=this._filter.length*this._bucketSize,o=this._filter.reduce(function(a,u){return a+u.length},0);return{used:o,free:n-o,size:n,load:o/n}},e.prototype._locations=function(n){var o=$l.hashIntAndString(n,this.seed,16,64),a=o.int;if(this._fingerprintLength>o.string.length)throw new Error("The fingerprint length ("+this._fingerprintLength+") is higher than the hash length ("+o.string.length+"). Please reduce the fingerprint length or report if it is an unexpected behavior.");var u=o.string.substring(0,this._fingerprintLength),c=Math.abs(a),p=Math.abs($l.hashAsInt(u,this.seed,64)),l=Math.abs(c^p),y={fingerprint:u,firstIndex:c%this._size,secondIndex:l%this._size};return y},e.prototype.equals=function(n){for(var o=0,a=!0;a&&o<this._filter.length;){var u=this._filter[o];n._filter[o].equals(u)||(a=!1),o++}return a};var r;return e=r=RL([Z8.Exportable({export:Z8.cloneObject("CuckooFilter","_size","_fingerprintLength","_length","_maxKicks","_filter","_seed"),import:function(n){if(n.type!=="CuckooFilter"||!("_size"in n)||!("_fingerprintLength"in n)||!("_length"in n)||!("_maxKicks"in n)||!("_filter"in n)||!("_seed"in n))throw new Error("Cannot create a CuckooFilter from a JSON export which does not represent a cuckoo filter");var o=new r(n._size,n._fingerprintLength,n._bucketSize,n._maxKicks);return o._length=n._length,o._filter=n._filter.map(function(a){var u=new X8.default(a._size);return a._elements.forEach(function(c,p){c!==null&&(u._elements[p]=c,u._length++)}),u}),o.seed=n.seed,o}}),NL("design:paramtypes",[Number,Number,Number,Number])],e),e}(UL.default);Do.default=ML});var dg=Y(wi=>{"use strict";var OL=wi&&wi.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fp=wi&&wi.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},Ip=wi&&wi.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},hg=wi&&wi.__param||function(t,e){return function(r,n){e(r,n,t)}},KL=wi&&wi.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(wi,"__esModule",{value:!0});var Ru=Na(),Gl=Vi(),Nu=yi(),zL=KL(Fo()),qL=Symbol.for("nodejs.util.inspect.custom"),HL=function(t){OL(e,t);function e(n,o,a){var u=t.call(this)||this;return u._idSum=n,u._hashSum=o,u._count=a,u}r=e,e.empty=function(){return new r(Ru.Buffer.allocUnsafe(0).fill(0),Ru.Buffer.allocUnsafe(0).fill(0),0)},e.prototype[qL]=function(){return"Cell:<"+JSON.stringify(this._idSum.toJSON().data)+", "+JSON.stringify(this._hashSum.toJSON().data)+", "+this._count+">"},Object.defineProperty(e.prototype,"idSum",{get:function(){return this._idSum},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hashSum",{get:function(){return this._hashSum},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!0,configurable:!0}),e.prototype.add=function(n,o){this._idSum=Gl.xorBuffer(this._idSum,n),this._hashSum=Gl.xorBuffer(this._hashSum,o),this._count++},e.prototype.xorm=function(n){return new r(Gl.xorBuffer(this._idSum,n.idSum),Gl.xorBuffer(this._hashSum,n.hashSum),this._count-n.count)},e.prototype.isEmpty=function(){return this._idSum.equals(Ru.Buffer.from(""))&&this._hashSum.equals(Ru.Buffer.from(""))&&this._count===0},e.prototype.equals=function(n){return this._count===n.count&&this._idSum.equals(n.idSum)&&this._hashSum.equals(n.hashSum)},e.prototype.isPure=function(){if(this.isEmpty()||this._count!==1&&this._count!==-1)return!1;var n=Gl.hashTwiceAsString(JSON.stringify(this._idSum.toJSON()),this.seed);return this._hashSum.equals(Ru.Buffer.from(n.first))};var r;return Fp([Nu.Field(function(n){return n.toString()},Ru.Buffer.from),Ip("design:type",Object)],e.prototype,"_idSum",void 0),Fp([Nu.Field(function(n){return n.toString()},Ru.Buffer.from),Ip("design:type",Object)],e.prototype,"_hashSum",void 0),Fp([Nu.Field(),Ip("design:type",Number)],e.prototype,"_count",void 0),e=r=Fp([Nu.AutoExportable("Cell",["_seed"]),hg(0,Nu.Parameter("_idSum")),hg(1,Nu.Parameter("_hashSum")),hg(2,Nu.Parameter("_count")),Ip("design:paramtypes",[Object,Object,Number])],e),e}(zL.default);wi.default=HL});var i6=Y(Ln=>{"use strict";var jL=Ln&&Ln.__extends||function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},t(e,r)};return function(e,r){t(e,r);function n(){this.constructor=e}e.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),Dp=Ln&&Ln.__decorate||function(t,e,r,n){var o=arguments.length,a=o<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,r):n,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,n);else for(var c=t.length-1;c>=0;c--)(u=t[c])&&(a=(o<3?u(a):o>3?u(e,r,a):u(e,r))||a);return o>3&&a&&Object.defineProperty(e,r,a),a},Rp=Ln&&Ln.__metadata||function(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)},e6=Ln&&Ln.__param||function(t,e){return function(r,n){e(r,n,t)}},t6=Ln&&Ln.__generator||function(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,u;return u={next:c(0),throw:c(1),return:c(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function c(l){return function(y){return p([l,y])}}function p(l){if(n)throw new TypeError("Generator is already executing.");for(;r;)try{if(n=1,o&&(a=l[0]&2?o.return:l[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,l[1])).done)return a;switch(o=0,a&&(l=[l[0]&2,a.value]),l[0]){case 0:case 1:a=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,o=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){r.label=l[1];break}if(l[0]===6&&r.label<a[1]){r.label=a[1],a=l;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(l);break}a[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(y){l=[6,y],o=0}finally{n=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},r6=Ln&&Ln.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Ln,"__esModule",{value:!0});var Uu=Na(),$L=r6(Fo()),Np=r6(dg()),tf=yi(),Xa=Vi(),n6=kp(),GL=function(t){jL(e,t);function e(n,o){o===void 0&&(o=3);var a=t.call(this)||this;if(Uu.Buffer===void 0)throw new Error('No native Buffer implementation bound in your JavaScript env. If you are in a Web browser, consider importing the polyfill "feross/buffer" (https://github.com/feross/buffer).');if(o<=0)throw new Error("The hashCount must be a non-zero, positive integer");return a._size=n,a._hashCount=o,a._elements=Xa.allocateArray(a._size,function(){return Np.default.empty()}),a}r=e,e.create=function(n,o){var a=n6.optimalFilterSize(n,o),u=n6.optimalHashes(a,n);return new r(a,u)},e.from=function(n,o){var a=Array.from(n),u=r.create(a.length,o);return a.forEach(function(c){return u.add(c)}),u},Object.defineProperty(e.prototype,"hashCount",{get:function(){return this._hashCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"length",{get:function(){return this._elements.reduce(function(n,o){return n+o.count},0)/this._hashCount},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"elements",{get:function(){return this._elements},enumerable:!0,configurable:!0}),e.prototype.add=function(n){for(var o=Xa.allInOneHashTwice(JSON.stringify(n.toJSON()),this.seed),a=Xa.getDistinctIndices(o.string.first,this._size,this._hashCount,this.seed),u=0;u<this._hashCount;++u)this._elements[a[u]].add(n,Uu.Buffer.from(o.string.first))},e.prototype.remove=function(n){for(var o=Xa.allInOneHashTwice(JSON.stringify(n.toJSON()),this.seed),a=Xa.getDistinctIndices(o.string.first,this.size,this._hashCount,this.seed),u=0;u<this._hashCount;++u)this._elements[a[u]]=this._elements[a[u]].xorm(new Np.default(Uu.Buffer.from(n),Uu.Buffer.from(o.string.first),1));return!0},e.prototype.has=function(n){for(var o=Xa.allInOneHashTwice(JSON.stringify(n.toJSON()),this.seed),a=Xa.getDistinctIndices(o.string.first,this.size,this._hashCount,this.seed),u=0;u<this._hashCount;++u){if(this._elements[a[u]].count===0)return!1;if(this._elements[a[u]].count===1)return!!this._elements[a[u]].idSum.equals(n)}return!0},e.prototype.listEntries=function(){var n=this,o=[];return function(){var a,u,c;return t6(this,function(p){switch(p.label){case 0:a=function(l){var y;return t6(this,function(w){switch(w.label){case 0:return y=n._elements[l],y.count>0&&o.findIndex(function(F){return F.equals(y.idSum)})===-1?n.has(y.idSum)?(o.push(y.idSum),[4,y.idSum]):[3,2]:[3,3];case 1:return w.sent(),[3,3];case 2:return[2,{value:!1}];case 3:return[2]}})},u=0,p.label=1;case 1:return u<n._elements.length-1?[5,a(u)]:[3,4];case 2:if(c=p.sent(),typeof c=="object")return[2,c.value];p.label=3;case 3:return u++,[3,1];case 4:return[2,!0]}})}()},e.prototype.substract=function(n){if(this.size!==n.size)throw new Error("The two Invertible Bloom Filters must be of the same size");var o=new r(n._size,n._hashCount);o.seed=this.seed;for(var a=0;a<this.size;++a)o._elements[a]=this._elements[a].xorm(n._elements[a]);return o},e.prototype.equals=function(n){if(n._size!==this._size||n._hashCount!==this._hashCount||n.seed!==this.seed)return!1;for(var o=0;o<n._elements.length;++o)if(!n._elements[o].equals(this._elements[o]))return!1;return!0},e.prototype.decode=function(n,o){n===void 0&&(n=[]),o===void 0&&(o=[]);for(var a=[],u=null,c=0;c<this._elements.length;++c)u=this._elements[c],u.isPure()&&a.push(c);for(;a.length!==0;){u=this._elements[a.pop()];var p=u.idSum,l=u.count;if(u.isPure()){if(l===1)n.push(p);else if(l===-1)o.push(p);else throw new Error("Please report, not possible");for(var y=Xa.allInOneHashTwice(JSON.stringify(p.toJSON()),this.seed),w=Xa.getDistinctIndices(y.string.first,this._size,this._hashCount,this.seed),c=0;c<w.length;++c)this._elements[w[c]]=this._elements[w[c]].xorm(new Np.default(p,Uu.Buffer.from(y.string.first),l)),this._elements[w[c]].isPure()&&a.push(w[c])}}return this._elements.findIndex(function(F){return!F.isEmpty()})>-1?{success:!1,reason:{cell:u,iblt:this},additional:n,missing:o}:{success:!0,additional:n,missing:o}};var r;return Dp([tf.Field(),Rp("design:type",Number)],e.prototype,"_size",void 0),Dp([tf.Field(),Rp("design:type",Number)],e.prototype,"_hashCount",void 0),Dp([tf.Field(void 0,function(n){return n.map(function(o){var a=new Np.default(Uu.Buffer.from(o._idSum),Uu.Buffer.from(o._hashSum),o._count);return a.seed=o._seed,a})}),Rp("design:type",Array)],e.prototype,"_elements",void 0),e=r=Dp([tf.AutoExportable("InvertibleBloomFilter",["_seed"]),e6(0,tf.Parameter("_size")),e6(1,tf.Parameter("_hashCount")),Rp("design:paramtypes",[Number,Number])],e),e}($L.default);Ln.default=GL});var o6=Y(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});var WL=E8();xi.BloomFilter=WL.default;var YL=T8();xi.CountingBloomFilter=YL.default;var VL=B8();xi.PartitionedBloomFilter=VL.default;var JL=ig();xi.CountMinSketch=JL.default;var XL=I8();xi.HyperLogLog=XL.default;var ZL=R8();xi.TopK=ZL.default;var QL=cg();xi.MinHash=QL.MinHash;var eM=O8();xi.MinHashFactory=eM.default;var tM=Q8();xi.CuckooFilter=tM.default;var rM=i6();xi.InvertibleBloomFilter=rM.default;var nM=dg();xi.Cell=nM.default});var $M={};mr($M,{InitialisationError:()=>Zl,Scenario:()=>Mu,VERSION:()=>cd,apps:()=>Sg,authenticatedUsername:()=>EM,cbor:()=>w1,crypto:()=>ry,dataRoot:()=>kg,did:()=>N1,dns:()=>om,errors:()=>Ag,fs:()=>KM,initialise:()=>OM,initialize:()=>OM,ipfs:()=>x1,isSupported:()=>x6,keystore:()=>Ym,leave:()=>SM,loadFileSystem:()=>Eg,lobby:()=>Pg,machinery:()=>Qm,path:()=>cy,redirectToLobby:()=>PM,setup:()=>Tg,ucan:()=>_g});var Bg=xr(jh());var Qm={};mr(Qm,{UCANS_STORAGE_KEY:()=>Pc,USERNAME_STORAGE_KEY:()=>Tc,VERSION:()=>cd,api:()=>si,arrContains:()=>kF,arrbufs:()=>Uf,assertBrowser:()=>Tr,asyncWaterfall:()=>AF,authenticatedUsername:()=>_o,base64:()=>mo,blob:()=>Mf,isBlob:()=>Xm,isBool:()=>ud,isBrowser:()=>V2,isDefined:()=>x_,isJust:()=>sd,isNum:()=>vo,isObject:()=>cr,isString:()=>vn,isValue:()=>Jm,mapObj:()=>Zm,mapObjAsync:()=>xF,notNull:()=>Vm,removeKeyFromObj:()=>Qf,updateOrRemoveKeyFromObj:()=>wF});var si={};mr(si,{did:()=>ZB});var om={};mr(om,{cloudflareLookup:()=>mv,dnsOverHttps:()=>nm,googleLookup:()=>pv,lookupDnsLink:()=>im,lookupTxtRecord:()=>hc});function dv(t){return new Promise((e,r)=>{for(let n of t)n.then(e,r)})}async function hc(t){return dv([pv(t),mv(t)])}async function pv(t){return nm(`https://dns.google/resolve?name=${t}&type=txt`)}function mv(t){return nm(`https://cloudflare-dns.com/dns-query?name=${t}&type=txt`)}function nm(t){return fetch(t,{headers:{accept:"application/dns-json"}}).then(e=>e.json()).then(e=>{if(e.Answer){let r=e.Answer.map(n=>(n.data||"").replace(/^"+|"+$/g,""));return r[0][3]===";"?r.sort((n,o)=>n.slice(0,4).localeCompare(o.slice(0,4))).map(n=>n.slice(4)).join(""):r.join("")}else return null})}async function im(t){let e=await hc(t.startsWith("_dnslink.")?t:`_dnslink.${t}`);return e&&!e.includes("/ipns/")?e.replace(/^dnslink=/,"").replace(/^\/ipfs\//,""):null}var Pt={debug:!1,endpoints:{api:"https://runfission.com",lobby:"https://auth.fission.codes",user:"fission.name"}};var su={did:null,host:null,lastFetched:0};async function ZB(){let t=Pt.endpoints.api.replace(/^https?:\/\//,"").replace(/\/$/,""),e=Date.now();if((su.host!==t||su.lastFetched+1e3*60*60*3<=e)&&(su.did=await hc("_did."+t),su.host=t,su.lastFetched=e),!su.did)throw new Error("Couldn't get the Fission API DID");return su.did}var Uf={};mr(Uf,{equal:()=>QB});var QB=(t,e)=>{let r=new Uint8Array(t),n=new Uint8Array(e);if(r.length!==n.length)return!1;for(let o=0;o<r.length;o++)if(r[o]!==n[o])return!1;return!0};var mo={};mr(mo,{decode:()=>Nv,encode:()=>Uv,makeUrlSafe:()=>Lv,makeUrlUnsafe:()=>Mv,urlDecode:()=>DC,urlEncode:()=>gm});var ym=xr(Na());function Nv(t){return ym.Buffer.from(t,"base64").toString("binary")}function Uv(t){return ym.Buffer.from(t,"binary").toString("base64")}function DC(t){return Nv(Mv(t))}function gm(t){return Lv(Uv(t))}function Lv(t){return t.replace(/\//g,"_").replace(/\+/g,"-").replace(/=+$/,"")}function Mv(t){return t.replace(/_/g,"/").replace(/-/g,"+")}var Mf={};mr(Mf,{toBuffer:()=>bm});var Ov=xr(Na()),bm=async t=>new Promise((e,r)=>{let n=()=>r(new Error("Failed to read file")),o=new FileReader;o.addEventListener("load",a=>{let u=a?.target?.result||null;u===null&&n(),e(Ov.Buffer.from(u))}),o.addEventListener("error",()=>o.abort()),o.addEventListener("abort",n),o.readAsArrayBuffer(t)});var Q2=xr(Gv()),e_=xr(Y2()),kc=xr(ui()),yu=xr(Mm()),Ac=xr(Ki());var V2=typeof self!="undefined"&&typeof self.location=="object",Tr=t=>{if(!V2)throw new Error(`Must be in browser to use method. Provide a node-compatible implementation for ${t}`)};var Ym={};mr(Ym,{clear:()=>Wm,create:()=>bF,get:()=>bo,set:()=>vF});var Gm=xr(J2()),X2=xr(Ki()),Z2={type:X2.CryptoSystem.RSA},xs=null,Wm=async()=>{xs=await bo(),await xs.destroy(),xs=null},bF=async()=>await Gm.default.init(Z2),vF=async t=>{xs=t},bo=async()=>xs||(xs=await Gm.default.init(Z2),xs);var t_=async(t,e)=>{Tr("aes.encrypt");let r=await yu.default.importKey(e,{length:Ac.SymmKeyLength.B256}),n=await yu.default.encryptBytes(t.buffer,r);return new Uint8Array(n)},r_=async(t,e)=>{Tr("aes.decrypt");let r=await yu.default.importKey(e,{length:Ac.SymmKeyLength.B256}),n=await yu.default.decryptBytes(t.buffer,r);return new Uint8Array(n)},n_=async()=>{Tr("aes.genKeyStr");let t=await yu.default.makeKey({length:Ac.SymmKeyLength.B256});return yu.default.exportKey(t)},i_=async(t,e,r)=>{Tr("aes.decryptGCM");let n=kc.default.base64ToArrBuf(r),o=await crypto.subtle.importKey("raw",kc.default.base64ToArrBuf(e),"AES-GCM",!1,["encrypt","decrypt"]),a=await crypto.subtle.decrypt({name:"AES-GCM",iv:n},o,kc.default.base64ToArrBuf(t));return kc.default.arrBufToStr(a,Ac.CharSize.B8)},o_=async t=>{Tr("hash.sha256");let e=t.buffer,r=await crypto.subtle.digest("SHA-256",e);return new Uint8Array(r)},a_=(t,e,r)=>{Tr("rsa.verify");let n=kc.default.arrBufToBase64(r.buffer);return e_.default.verify(t,e,n)},s_=(t,e,r)=>Q2.verify(e,t,r),u_=async()=>(Tr("keystore.publicReadKey"),(await bo()).publicReadKey()),c_=async()=>(Tr("keystore.publicWriteKey"),(await bo()).publicWriteKey()),f_=async t=>(Tr("keystore.decrypt"),(await bo()).decrypt(t)),l_=async(t,e)=>(Tr("keystore.sign"),(await bo()).sign(t,{charSize:e})),h_=async(t,e)=>(Tr("keystore.importSymmKey"),(await bo()).importSymmKey(t,e)),d_=async t=>(Tr("keystore.exportSymmKey"),(await bo()).exportSymmKey(t)),p_=async t=>(Tr("keystore.keyExists"),(await bo()).keyExists(t)),m_=async()=>(Tr("keystore.getAlg"),(await bo()).cfg.type),y_=async()=>(Tr("keystore.clear"),Wm());var Zf=xr(jh());var g_=t=>(Tr("storage.getItem"),Zf.default.getItem(t)),b_=(t,e)=>(Tr("storage.setItem"),Zf.default.setItem(t,e)),v_=t=>(Tr("storage.removeItem"),Zf.default.removeItem(t)),__=()=>(Tr("storage.clear"),Zf.default.clear());var _F={hash:{sha256:o_},aes:{encrypt:t_,decrypt:r_,genKeyStr:n_,decryptGCM:i_},rsa:{verify:a_},ed25519:{verify:s_},keystore:{publicReadKey:u_,publicWriteKey:c_,decrypt:f_,sign:l_,importSymmKey:h_,exportSymmKey:d_,keyExists:p_,getAlg:m_,clear:y_},storage:{getItem:g_,setItem:b_,removeItem:v_,clear:__}},Xt=_F,w_=t=>(Xt={hash:Ec(Xt.hash,t.hash),aes:Ec(Xt.aes,t.aes),rsa:Ec(Xt.rsa,t.rsa),ed25519:Ec(Xt.ed25519,t.ed25519),keystore:Ec(Xt.keystore,t.keystore),storage:Ec(Xt.storage,t.storage)},Xt),Ec=(t,e)=>({...t,...e||{}});var ks=t=>Xt.storage.getItem(t),gu=(t,e)=>Xt.storage.setItem(t,e),Sc=t=>Xt.storage.removeItem(t);var x_=t=>t!==void 0,Vm=t=>t!==null,sd=Vm,Jm=t=>x_(t)&&Vm(t),ud=t=>typeof t=="boolean",vo=t=>typeof t=="number",vn=t=>typeof t=="string",cr=t=>t!==null&&typeof t=="object",Xm=t=>typeof Blob=="undefined"?!1:t instanceof Blob||cr(t)&&t?.constructor?.name==="Blob";var Qf=(t,e)=>{let{[e]:r,...n}=t;return n},wF=(t,e,r)=>r===null?Qf(t,e):{...t,[e]:r},Zm=(t,e)=>{let r={};return Object.entries(t).forEach(([n,o])=>{r[n]=e(o,n)}),r},xF=async(t,e)=>{let r={};return await Promise.all(Object.entries(t).map(async([n,o])=>{r[n]=await e(o,n)})),r},kF=(t,e)=>t.indexOf(e)>-1,AF=async(t,e)=>{let r=t;for(let n=0;n<e.length;n++)r=await e[n](r);return r};var cd="0.26.0";var Pc="webnative.auth_ucans",Tc="webnative.auth_username";async function _o(){return ks(Tc).then(t=>t||null)}var ry={};mr(ry,{aes:()=>ci,ed25519:()=>ty,hash:()=>sa,keystore:()=>Qr,rsa:()=>ey,sha256Str:()=>E_});var A_=xr(ui());var Bc=t=>Array.prototype.map.call(t,e=>("00"+e.toString(16)).slice(-2)).join(""),k_=t=>{let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++)e[r]=parseInt(t.slice(r*2,r*2+2),16);return e};var E_=async t=>{let e=(0,A_.strToArrBuf)(t,8),r=new Uint8Array(e),n=await Xt.hash.sha256(r);return Bc(n)},sa={sha256:t=>Xt.hash.sha256(t),sha256Str:E_},ci={encrypt:(t,e)=>Xt.aes.encrypt(t,e),decrypt:(t,e)=>Xt.aes.decrypt(t,e),genKeyStr:()=>Xt.aes.genKeyStr(),decryptGCM:(t,e,r)=>Xt.aes.decryptGCM(t,e,r)},ey={verify:(t,e,r)=>Xt.rsa.verify(t,e,r)},ty={verify:(t,e,r)=>Xt.ed25519.verify(t,e,r)},Qr={publicReadKey:()=>Xt.keystore.publicReadKey(),publicWriteKey:()=>Xt.keystore.publicWriteKey(),decrypt:t=>Xt.keystore.decrypt(t),sign:(t,e)=>Xt.keystore.sign(t,e),importSymmKey:(t,e)=>Xt.keystore.importSymmKey(t,e),exportSymmKey:t=>Xt.keystore.exportSymmKey(t),keyExists:t=>Xt.keystore.keyExists(t),getAlg:()=>Xt.keystore.getAlg(),clear:()=>Xt.keystore.clear()};var cy={};mr(cy,{Branch:()=>xt,Kind:()=>el,combine:()=>Cc,directory:()=>wo,file:()=>ny,fromPosix:()=>iy,isBranch:()=>tl,isDirectory:()=>jr,isFile:()=>As,isRootDirectory:()=>P_,isSameBranch:()=>oy,isSameKind:()=>ay,kind:()=>fd,log:()=>Es,map:()=>sy,parent:()=>uy,removeBranch:()=>EF,root:()=>S_,toPosix:()=>zr,unwrap:()=>$r});var xt;(function(a){a.Public="public",a.Pretty="p",a.Private="private",a.PrivateLog="privateLog",a.Version="version"})(xt||(xt={}));var el;(function(r){r.Directory="directory",r.File="file"})(el||(el={}));function wo(...t){if(t.some(e=>e.includes("/")))throw new Error("Forward slashes `/` are not allowed");return{directory:t}}function ny(...t){if(t.some(e=>e.includes("/")))throw new Error("Forward slashes `/` are not allowed");return{file:t}}function S_(){return{directory:[]}}function iy(t){let e=t.replace(/^\/+/,"").split("/");return t.endsWith("/")?{directory:e.slice(0,-1)}:t===""?S_():{file:e}}function zr(t,{absolute:e}={absolute:!1}){let r=e?"/":"",n=$r(t).join("/");return jr(t)?r+n+(n.length?"/":""):r+n}function Cc(t,e){return sy(r=>$r(t).concat(r),e)}function tl(t,e){return $r(e)[0]===t}function jr(t){return!!t.directory}function As(t){return!!t.file}function P_(t){return t.directory.length===0}function oy(t,e){return $r(t)[0]===$r(e)[0]}function ay(t,e){return jr(t)&&jr(e)?!0:!!(As(t)&&As(e))}function fd(t){return jr(t)?el.Directory:el.File}function sy(t,e){return jr(e)?{directory:t(e.directory)}:As(e)?{file:t(e.file)}:e}function uy(t){return jr(t)&&P_(t)?null:wo(...$r(t).slice(0,-1))}function EF(t){return sy(e=>jr(t)||e.length>1?e.slice(1):e,t)}function $r(t){return jr(t)?t.directory:As(t)?t.file:[]}function Es(t){return`[ ${t.join(", ")} ]`}async function ld({path:t}){return`wnfs__bareNameFilter__${await sa.sha256Str(T_(t))}`}async function Fc({path:t}){return`wnfs__readKey__${await sa.sha256Str(T_(t))}`}function T_(t){return"/"+$r(t).join("/")}var x1={};mr(x1,{DAG_NODE_DATA:()=>f1,add:()=>gl,attemptPin:()=>qd,cat:()=>bl,catBuf:()=>zc,catRaw:()=>sk,dagGet:()=>qc,dagPut:()=>uk,dagPutLinks:()=>vl,encoded:()=>So,get:()=>ja,iframe:()=>Ox,ls:()=>l1,set:()=>wD,size:()=>Au});var Mx=xr(Lx());var Td=null,wD=t=>{Td=t},ja=async()=>{if(!Td){let t=await Ox();Td=Mx.default.from(t)}return Td};function Ox(){return new Promise((t,e)=>{let r=document.createElement("iframe");r.id="webnative-ipfs",r.style.width="0",r.style.height="0",r.style.border="none",r.style.display="none",document.body.appendChild(r),r.onload=()=>{let n=new MessageChannel;n.port1.onmessage=({ports:o})=>t(o[0]),r.contentWindow?r.contentWindow.postMessage("connect","*",[n.port2]):e(new Error("Don't have access to iframe.contentWindow"))},r.src=`${Pt.endpoints.lobby}/ipfs.html`})}var ik=xr(Na()),ok=xr(Ss()),ak=xr(zd());var c1=xr(zd()),qR=t=>new c1.default.DAGLink(t.Name,t.Tsize,t.Hash),rk=t=>{let e=t?.value?.Data,r=t?.value?.Links?.map(qR);return new c1.default.DAGNode(e,r)};var nk=xr(Na()),f1=nk.Buffer.from([8,1]);var gl=async t=>{let r=await(await ja()).add(t,{cidVersion:1,pin:!0});return{cid:r.cid.toString(),size:r.size,isFile:!0}},sk=async t=>{let e=await ja(),r=[];await qd(t);for await(let n of e.cat(t))r.push(n);return r},zc=async t=>{let e=await sk(t);return ik.Buffer.concat(e)},bl=async t=>(await zc(t)).toString(),l1=async t=>{let e=await ja(),r=[];for await(let n of e.ls(t))r.push(n);return r},qc=async t=>{let e=await ja();await qd(t);let r=await e.dag.get(new ok.default(t));return rk(r)},uk=async t=>{let n=(await(await ja()).dag.put(t,{format:"dag-pb",hashAlg:"sha2-256"})).toV1().toString();await qd(n);let o=await Au(n);return{cid:n,size:o,isFile:!1}},vl=async t=>{let e=new ak.default.DAGNode(f1,t);return uk(e)},Au=async t=>(await(await ja()).files.stat(`/ipfs/${t}`)).cumulativeSize,qd=async t=>{let e=await ja();try{await e.pin.add(t,{recursive:!1})}catch(r){if(!r.message||!r.message.includes("already pinned recursively"))throw new Error(r)}};var So={};mr(So,{add:()=>fN,catAndDecode:()=>lN});var w1={};mr(w1,{Token:()=>je,Type:()=>se,decode:()=>Qd,encode:()=>Xd});var HR=["string","number","bigint","symbol"],jR=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function ck(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if(HR.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if($R(t))return"Buffer";let r=GR(t);return r||"Object"}function $R(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}function GR(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(jR.includes(e))return e}var se=class{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};se.uint=new se(0,"uint",!0);se.negint=new se(1,"negint",!0);se.bytes=new se(2,"bytes",!0);se.string=new se(3,"string",!0);se.array=new se(4,"array",!1);se.map=new se(5,"map",!1);se.tag=new se(6,"tag",!1);se.float=new se(7,"float",!0);se.false=new se(7,"false",!0);se.true=new se(7,"true",!0);se.null=new se(7,"null",!0);se.undefined=new se(7,"undefined",!0);se.break=new se(7,"break",!0);var je=class{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0}toString(){return`Token[${this.type}].${this.value}`}};var Hc=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",WR=new TextDecoder,YR=new TextEncoder;function Hd(t){return Hc&&globalThis.Buffer.isBuffer(t)}function h1(t){return t instanceof Uint8Array?Hd(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}var fk=Hc?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):yk(t,e,r):(t,e,r)=>r-e>64?WR.decode(t.subarray(e,r)):yk(t,e,r),lk=Hc?t=>t.length>64?globalThis.Buffer.from(t):mk(t):t=>t.length>64?YR.encode(t):mk(t),ha=t=>Uint8Array.from(t),jd=Hc?(t,e,r)=>Hd(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),hk=Hc?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),h1(globalThis.Buffer.concat(t,e))):(t,e)=>{let r=new Uint8Array(e),n=0;for(let o of t)n+o.length>r.length&&(o=o.subarray(0,r.length-n)),r.set(o,n),n+=o.length;return r},dk=Hc?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function pk(t,e){if(Hd(t)&&Hd(e))return t.compare(e);for(let r=0;r<t.length;r++)if(t[r]!==e[r])return t[r]<e[r]?-1:1;return 0}function mk(t,e=Infinity){let r,n=t.length,o=null,a=[];for(let u=0;u<n;++u){if(r=t.charCodeAt(u),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}else if(u+1===n){(e-=3)>-1&&a.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&a.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return a}function yk(t,e,r){let n=[];for(;e<r;){let o=t[e],a=null,u=o>239?4:o>223?3:o>191?2:1;if(e+u<=r){let c,p,l,y;switch(u){case 1:o<128&&(a=o);break;case 2:c=t[e+1],(c&192)==128&&(y=(o&31)<<6|c&63,y>127&&(a=y));break;case 3:c=t[e+1],p=t[e+2],(c&192)==128&&(p&192)==128&&(y=(o&15)<<12|(c&63)<<6|p&63,y>2047&&(y<55296||y>57343)&&(a=y));break;case 4:c=t[e+1],p=t[e+2],l=t[e+3],(c&192)==128&&(p&192)==128&&(l&192)==128&&(y=(o&15)<<18|(c&63)<<12|(p&63)<<6|l&63,y>65535&&y<1114112&&(a=y))}}a===null?(a=65533,u=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),e+=u}return VR(n)}var gk=4096;function VR(t){let e=t.length;if(e<=gk)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=gk));return r}var JR=256,$d=class{constructor(e=JR){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.chunks=[],this.cursor=0,this.maxCursor=-1,this._initReuseChunk!==null&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let r=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){let o=r.length-(this.maxCursor-this.cursor)-1;r.set(e,o)}else{if(r){let o=r.length-(this.maxCursor-this.cursor)-1;o<r.length&&(this.chunks[this.chunks.length-1]=r.subarray(0,o),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(r=dk(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];e&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=jd(n,0,this.cursor)}else r=hk(this.chunks,this.cursor);return e&&this.reset(),r}};var ut="CBOR decode error:",d1="CBOR encode error:",_l=[];_l[23]=1;_l[24]=2;_l[25]=3;_l[26]=5;_l[27]=9;function $a(t,e,r){if(t.length-e<r)throw new Error(`${ut} not enough data for type`)}var rn=[24,256,65536,4294967296,BigInt("18446744073709551616")];function li(t,e,r){$a(t,e,1);let n=t[e];if(r.strict===!0&&n<rn[0])throw new Error(`${ut} integer encoded in more bytes than necessary (strict decode)`);return n}function hi(t,e,r){$a(t,e,2);let n=t[e]<<8|t[e+1];if(r.strict===!0&&n<rn[1])throw new Error(`${ut} integer encoded in more bytes than necessary (strict decode)`);return n}function di(t,e,r){$a(t,e,4);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3];if(r.strict===!0&&n<rn[2])throw new Error(`${ut} integer encoded in more bytes than necessary (strict decode)`);return n}function pi(t,e,r){$a(t,e,8);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3],o=t[e+4]*16777216+(t[e+5]<<16)+(t[e+6]<<8)+t[e+7],a=(BigInt(n)<<BigInt(32))+BigInt(o);if(r.strict===!0&&a<rn[3])throw new Error(`${ut} integer encoded in more bytes than necessary (strict decode)`);if(a<=Number.MAX_SAFE_INTEGER)return Number(a);if(r.allowBigInt===!0)return a;throw new Error(`${ut} integers outside of the safe integer range are not supported`)}function bk(t,e,r,n){return new je(se.uint,li(t,e+1,n),2)}function vk(t,e,r,n){return new je(se.uint,hi(t,e+1,n),3)}function _k(t,e,r,n){return new je(se.uint,di(t,e+1,n),5)}function wk(t,e,r,n){return new je(se.uint,pi(t,e+1,n),9)}function Wi(t,e){return Vn(t,0,e.value)}function Vn(t,e,r){if(r<rn[0]){let n=Number(r);t.push([e|n])}else if(r<rn[1]){let n=Number(r);t.push([e|24,n])}else if(r<rn[2]){let n=Number(r);t.push([e|25,n>>>8,n&255])}else if(r<rn[3]){let n=Number(r);t.push([e|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<rn[4]){let o=[e|27,0,0,0,0,0,0,0],a=Number(n&BigInt(4294967295)),u=Number(n>>BigInt(32)&BigInt(4294967295));o[8]=a&255,a=a>>8,o[7]=a&255,a=a>>8,o[6]=a&255,a=a>>8,o[5]=a&255,o[4]=u&255,u=u>>8,o[3]=u&255,u=u>>8,o[2]=u&255,u=u>>8,o[1]=u&255,t.push(o)}else throw new Error(`${ut} encountered BigInt larger than allowable range`)}}Wi.encodedSize=function(e){return Vn.encodedSize(e.value)};Vn.encodedSize=function(e){return e<rn[0]?1:e<rn[1]?2:e<rn[2]?3:e<rn[3]?5:9};Wi.compareTokens=function(e,r){return e.value<r.value?-1:e.value>r.value?1:0};function xk(t,e,r,n){return new je(se.negint,-1-li(t,e+1,n),2)}function kk(t,e,r,n){return new je(se.negint,-1-hi(t,e+1,n),3)}function Ak(t,e,r,n){return new je(se.negint,-1-di(t,e+1,n),5)}var p1=BigInt(-1),Ek=BigInt(1);function Sk(t,e,r,n){let o=pi(t,e+1,n);if(typeof o!="bigint"){let a=-1-o;if(a>=Number.MIN_SAFE_INTEGER)return new je(se.negint,a,9)}if(n.allowBigInt!==!0)throw new Error(`${ut} integers outside of the safe integer range are not supported`);return new je(se.negint,p1-BigInt(o),9)}function Gd(t,e){let r=e.value,n=typeof r=="bigint"?r*p1-Ek:r*-1-1;Vn(t,e.type.majorEncoded,n)}Gd.encodedSize=function(e){let r=e.value,n=typeof r=="bigint"?r*p1-Ek:r*-1-1;return n<rn[0]?1:n<rn[1]?2:n<rn[2]?3:n<rn[3]?5:9};Gd.compareTokens=function(e,r){return e.value<r.value?1:e.value>r.value?-1:0};function wl(t,e,r,n){$a(t,e,r+n);let o=jd(t,e+r,e+r+n);return new je(se.bytes,o,r+n)}function Pk(t,e,r,n){return wl(t,e,1,r)}function Tk(t,e,r,n){return wl(t,e,2,li(t,e+1,n))}function Bk(t,e,r,n){return wl(t,e,3,hi(t,e+1,n))}function Ck(t,e,r,n){return wl(t,e,5,di(t,e+1,n))}function Fk(t,e,r,n){let o=pi(t,e+1,n);if(typeof o=="bigint")throw new Error(`${ut} 64-bit integer bytes lengths not supported`);return wl(t,e,9,o)}function Wd(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===se.string?lk(t.value):t.value),t.encodedBytes}function jc(t,e){let r=Wd(e);Vn(t,e.type.majorEncoded,r.length),t.push(r)}jc.encodedSize=function(e){let r=Wd(e);return Vn.encodedSize(r.length)+r.length};jc.compareTokens=function(e,r){return XR(Wd(e),Wd(r))};function XR(t,e){return t.length<e.length?-1:t.length>e.length?1:pk(t,e)}function xl(t,e,r,n){let o=r+n;return $a(t,e,o),new je(se.string,fk(t,e+r,e+o),o)}function Ik(t,e,r,n){return xl(t,e,1,r)}function Dk(t,e,r,n){return xl(t,e,2,li(t,e+1,n))}function Rk(t,e,r,n){return xl(t,e,3,hi(t,e+1,n))}function Nk(t,e,r,n){return xl(t,e,5,di(t,e+1,n))}function Uk(t,e,r,n){let o=pi(t,e+1,n);if(typeof o=="bigint")throw new Error(`${ut} 64-bit integer string lengths not supported`);return xl(t,e,9,o)}var Lk=jc;function $c(t,e,r,n){return new je(se.array,n,r)}function Mk(t,e,r,n){return $c(t,e,1,r)}function Ok(t,e,r,n){return $c(t,e,2,li(t,e+1,n))}function Kk(t,e,r,n){return $c(t,e,3,hi(t,e+1,n))}function zk(t,e,r,n){return $c(t,e,5,di(t,e+1,n))}function qk(t,e,r,n){let o=pi(t,e+1,n);if(typeof o=="bigint")throw new Error(`${ut} 64-bit integer array lengths not supported`);return $c(t,e,9,o)}function Hk(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${ut} indefinite length items not allowed`);return $c(t,e,1,Infinity)}function m1(t,e){Vn(t,se.array.majorEncoded,e.value)}m1.compareTokens=Wi.compareTokens;function Gc(t,e,r,n){return new je(se.map,n,r)}function jk(t,e,r,n){return Gc(t,e,1,r)}function $k(t,e,r,n){return Gc(t,e,2,li(t,e+1,n))}function Gk(t,e,r,n){return Gc(t,e,3,hi(t,e+1,n))}function Wk(t,e,r,n){return Gc(t,e,5,di(t,e+1,n))}function Yk(t,e,r,n){let o=pi(t,e+1,n);if(typeof o=="bigint")throw new Error(`${ut} 64-bit integer map lengths not supported`);return Gc(t,e,9,o)}function Vk(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${ut} indefinite length items not allowed`);return Gc(t,e,1,Infinity)}function y1(t,e){Vn(t,se.map.majorEncoded,e.value)}y1.compareTokens=Wi.compareTokens;function Jk(t,e,r,n){return new je(se.tag,r,1)}function Xk(t,e,r,n){return new je(se.tag,li(t,e+1,n),2)}function Zk(t,e,r,n){return new je(se.tag,hi(t,e+1,n),3)}function Qk(t,e,r,n){return new je(se.tag,di(t,e+1,n),5)}function eA(t,e,r,n){return new je(se.tag,pi(t,e+1,n),9)}function g1(t,e){Vn(t,se.tag.majorEncoded,e.value)}g1.compareTokens=Wi.compareTokens;var ZR=20,QR=21,eN=22,tN=23;function tA(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${ut} undefined values are not supported`);return new je(se.undefined,void 0,1)}function rA(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${ut} indefinite length items not allowed`);return new je(se.break,void 0,1)}function b1(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${ut} NaN values are not supported`);if(r.allowInfinity===!1&&(t===Infinity||t===-Infinity))throw new Error(`${ut} Infinity values are not supported`)}return new je(se.float,t,e)}function nA(t,e,r,n){return b1(v1(t,e+1),3,n)}function iA(t,e,r,n){return b1(_1(t,e+1),5,n)}function oA(t,e,r,n){return b1(cA(t,e+1),9,n)}function Yd(t,e,r){let n=e.value;if(n===!1)t.push([se.float.majorEncoded|ZR]);else if(n===!0)t.push([se.float.majorEncoded|QR]);else if(n===null)t.push([se.float.majorEncoded|eN]);else if(n===void 0)t.push([se.float.majorEncoded|tN]);else{let o,a=!1;(!r||r.float64!==!0)&&(sA(n),o=v1(Ao,1),n===o||Number.isNaN(n)?(Ao[0]=249,t.push(Ao.slice(0,3)),a=!0):(uA(n),o=_1(Ao,1),n===o&&(Ao[0]=250,t.push(Ao.slice(0,5)),a=!0))),a||(rN(n),o=cA(Ao,1),Ao[0]=251,t.push(Ao.slice(0,9)))}}Yd.encodedSize=function(e,r){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;let o;if(!r||r.float64!==!0){if(sA(n),o=v1(Ao,1),n===o||Number.isNaN(n))return 3;if(uA(n),o=_1(Ao,1),n===o)return 5}return 9};var aA=new ArrayBuffer(9),Yi=new DataView(aA,1),Ao=new Uint8Array(aA,0);function sA(t){if(t===Infinity)Yi.setUint16(0,31744,!1);else if(t===-Infinity)Yi.setUint16(0,64512,!1);else if(Number.isNaN(t))Yi.setUint16(0,32256,!1);else{Yi.setFloat32(0,t);let e=Yi.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)Yi.setUint16(0,31744,!1);else if(r===0)Yi.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{let o=r-127;o<-24?Yi.setUint16(0,0):o<-14?Yi.setUint16(0,(e&2147483648)>>16|1<<24+o,!1):Yi.setUint16(0,(e&2147483648)>>16|o+15<<10|n>>13,!1)}}}function v1(t,e){if(t.length-e<2)throw new Error(`${ut} not enough data for float16`);let r=(t[e]<<8)+t[e+1];if(r===31744)return Infinity;if(r===64512)return-Infinity;if(r===32256)return NaN;let n=r>>10&31,o=r&1023,a;return n===0?a=o*2**-24:n!==31?a=(o+1024)*2**(n-25):a=o===0?Infinity:NaN,r&32768?-a:a}function uA(t){Yi.setFloat32(0,t,!1)}function _1(t,e){if(t.length-e<4)throw new Error(`${ut} not enough data for float32`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}function rN(t){Yi.setFloat64(0,t,!1)}function cA(t,e){if(t.length-e<8)throw new Error(`${ut} not enough data for float64`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}Yd.compareTokens=Wi.compareTokens;function Ht(t,e,r){throw new Error(`${ut} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}function Vd(t){return()=>{throw new Error(`${ut} ${t}`)}}var Re=[];for(let t=0;t<=23;t++)Re[t]=Ht;Re[24]=bk;Re[25]=vk;Re[26]=_k;Re[27]=wk;Re[28]=Ht;Re[29]=Ht;Re[30]=Ht;Re[31]=Ht;for(let t=32;t<=55;t++)Re[t]=Ht;Re[56]=xk;Re[57]=kk;Re[58]=Ak;Re[59]=Sk;Re[60]=Ht;Re[61]=Ht;Re[62]=Ht;Re[63]=Ht;for(let t=64;t<=87;t++)Re[t]=Pk;Re[88]=Tk;Re[89]=Bk;Re[90]=Ck;Re[91]=Fk;Re[92]=Ht;Re[93]=Ht;Re[94]=Ht;Re[95]=Vd("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)Re[t]=Ik;Re[120]=Dk;Re[121]=Rk;Re[122]=Nk;Re[123]=Uk;Re[124]=Ht;Re[125]=Ht;Re[126]=Ht;Re[127]=Vd("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)Re[t]=Mk;Re[152]=Ok;Re[153]=Kk;Re[154]=zk;Re[155]=qk;Re[156]=Ht;Re[157]=Ht;Re[158]=Ht;Re[159]=Hk;for(let t=160;t<=183;t++)Re[t]=jk;Re[184]=$k;Re[185]=Gk;Re[186]=Wk;Re[187]=Yk;Re[188]=Ht;Re[189]=Ht;Re[190]=Ht;Re[191]=Vk;for(let t=192;t<=215;t++)Re[t]=Jk;Re[216]=Xk;Re[217]=Zk;Re[218]=Qk;Re[219]=eA;Re[220]=Ht;Re[221]=Ht;Re[222]=Ht;Re[223]=Ht;for(let t=224;t<=243;t++)Re[t]=Vd("simple values are not supported");Re[244]=Ht;Re[245]=Ht;Re[246]=Ht;Re[247]=tA;Re[248]=Vd("simple values are not supported");Re[249]=nA;Re[250]=iA;Re[251]=oA;Re[252]=Ht;Re[253]=Ht;Re[254]=Ht;Re[255]=rA;var Eo=[];for(let t=0;t<24;t++)Eo[t]=new je(se.uint,t,1);for(let t=-1;t>=-24;t--)Eo[31-t]=new je(se.negint,t,1);Eo[64]=new je(se.bytes,new Uint8Array(0),1);Eo[96]=new je(se.string,"",1);Eo[128]=new je(se.array,0,1);Eo[160]=new je(se.map,0,1);Eo[244]=new je(se.false,!1,1);Eo[245]=new je(se.true,!0,1);Eo[246]=new je(se.null,null,1);function fA(t){switch(t.type){case se.false:return ha([244]);case se.true:return ha([245]);case se.null:return ha([246]);case se.bytes:return t.value.length?void 0:ha([64]);case se.string:return t.value===""?ha([96]):void 0;case se.array:return t.value===0?ha([128]):void 0;case se.map:return t.value===0?ha([160]):void 0;case se.uint:return t.value<24?ha([Number(t.value)]):void 0;case se.negint:if(t.value>=-24)return ha([31-Number(t.value)])}}var nN={float64:!1,mapSorter:oN,quickEncodeToken:fA},da=[];da[se.uint.major]=Wi;da[se.negint.major]=Gd;da[se.bytes.major]=jc;da[se.string.major]=Lk;da[se.array.major]=m1;da[se.map.major]=y1;da[se.tag.major]=g1;da[se.float.major]=Yd;var lA=new $d,kl=class{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${d1} object contains circular references`);return new kl(r,e)}},Ds={null:new je(se.null,null),undefined:new je(se.undefined,void 0),true:new je(se.true,!0),false:new je(se.false,!1),emptyArray:new je(se.array,0),emptyMap:new je(se.map,0)},Rs={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new je(se.float,t):t>=0?new je(se.uint,t):new je(se.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new je(se.uint,t):new je(se.negint,t)},Uint8Array(t,e,r,n){return new je(se.bytes,t)},string(t,e,r,n){return new je(se.string,t)},boolean(t,e,r,n){return t?Ds.true:Ds.false},null(t,e,r,n){return Ds.null},undefined(t,e,r,n){return Ds.undefined},ArrayBuffer(t,e,r,n){return new je(se.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new je(se.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[Ds.emptyArray,new je(se.break)]:Ds.emptyArray;n=kl.createCheck(n,t);let o=[],a=0;for(let u of t)o[a++]=Jd(u,r,n);return r.addBreakTokens?[new je(se.array,t.length),o,new je(se.break)]:[new je(se.array,t.length),o]},Object(t,e,r,n){let o=e!=="Object",a=o?t.keys():Object.keys(t),u=o?t.size:a.length;if(!u)return r.addBreakTokens===!0?[Ds.emptyMap,new je(se.break)]:Ds.emptyMap;n=kl.createCheck(n,t);let c=[],p=0;for(let l of a)c[p++]=[Jd(l,r,n),Jd(o?t.get(l):t[l],r,n)];return iN(c,r),r.addBreakTokens?[new je(se.map,u),c,new je(se.break)]:[new je(se.map,u),c]}};Rs.Map=Rs.Object;Rs.Buffer=Rs.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Rs[`${t}Array`]=Rs.DataView;function Jd(t,e={},r){let n=ck(t),o=e&&e.typeEncoders&&e.typeEncoders[n]||Rs[n];if(typeof o=="function"){let u=o(t,n,e,r);if(u!=null)return u}let a=Rs[n];if(!a)throw new Error(`${d1} unsupported type: ${n}`);return a(t,n,e,r)}function iN(t,e){e.mapSorter&&t.sort(e.mapSorter)}function oN(t,e){let r=Array.isArray(t[0])?t[0][0]:t[0],n=Array.isArray(e[0])?e[0][0]:e[0];if(r.type!==n.type)return r.type.compare(n.type);let o=r.type.major,a=da[o].compareTokens(r,n);return a===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),a}function hA(t,e,r,n){if(Array.isArray(e))for(let o of e)hA(t,o,r,n);else r[e.type.major](t,e,n)}function aN(t,e,r){let n=Jd(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){let o=r.quickEncodeToken(n);if(o)return o;let a=e[n.type.major];if(a.encodedSize){let u=a.encodedSize(n,r),c=new $d(u);if(a(c,n,r),c.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return h1(c.chunks[0])}}return hA(lA,n,e,r),lA.toBytes(!0)}function Xd(t,e){return e=Object.assign({},nN,e),aN(t,da,e)}var sN={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},dA=class{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],r=Eo[e];if(r===void 0){let n=Re[e];if(!n)throw new Error(`${ut} no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);let o=e&31;r=n(this.data,this.pos,o,this.options)}return this.pos+=r.encodedLength,r}},Al=Symbol.for("DONE"),Zd=Symbol.for("BREAK");function uN(t,e,r){let n=[];for(let o=0;o<t.value;o++){let a=El(e,r);if(a===Zd){if(t.value===Infinity)break;throw new Error(`${ut} got unexpected break to lengthed array`)}if(a===Al)throw new Error(`${ut} found array but not enough entries (got ${o}, expected ${t.value})`);n[o]=a}return n}function cN(t,e,r){let n=r.useMaps===!0,o=n?void 0:{},a=n?new Map:void 0;for(let u=0;u<t.value;u++){let c=El(e,r);if(c===Zd){if(t.value===Infinity)break;throw new Error(`${ut} got unexpected break to lengthed map`)}if(c===Al)throw new Error(`${ut} found map but not enough entries (got ${u} [no key], expected ${t.value})`);if(n!==!0&&typeof c!="string")throw new Error(`${ut} non-string keys not supported (got ${typeof c})`);let p=El(e,r);if(p===Al)throw new Error(`${ut} found map but not enough entries (got ${u} [no value], expected ${t.value})`);n?a.set(c,p):o[c]=p}return n?a:o}function El(t,e){if(t.done())return Al;let r=t.next();if(r.type===se.break)return Zd;if(r.type.terminal)return r.value;if(r.type===se.array)return uN(r,t,e);if(r.type===se.map)return cN(r,t,e);if(r.type===se.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=El(t,e);return e.tags[r.value](n)}throw new Error(`${ut} tag not supported (${r.value})`)}throw new Error("unsupported")}function Qd(t,e){if(!(t instanceof Uint8Array))throw new Error(`${ut} data to decode must be a Uint8Array`);e=Object.assign({},sN,e);let r=e.tokenizer||new dA(t,e),n=El(r,e);if(n===Al)throw new Error(`${ut} did not find any content to decode`);if(n===Zd)throw new Error(`${ut} got unexpected break`);if(!r.done())throw new Error(`${ut} too many terminals, data makes no sense`);return n}var fN=async(t,e)=>{let r=Xm(t)?await bm(t):t,n=Xd(r),o=sd(e)?await ci.encrypt(n,e):n;return gl(o)},lN=async(t,e)=>{let r=await zc(t),n=sd(e)?await ci.decrypt(r,e):r;return Qd(n)};function Sl(t){return wo(xt.Private,"Apps",t.creator,t.name)}function ep(t){let e=[];return t.app&&e.push(Sl(t.app)),t.fs?.private&&(e=e.concat(t.fs?.private.map(r=>Cc(wo(xt.Private),r)))),t.fs?.public&&(e=e.concat(t.fs?.public.map(r=>Cc(wo(xt.Public),r)))),e}var ma={};mr(ma,{WNFS_PREFIX:()=>I1,compile:()=>D1,filesystemPrefix:()=>cp,lookup:()=>pa,lookupAppUcan:()=>yN,lookupFilesystemUcan:()=>gN,resourceLabel:()=>up});var k1=xr(bA()),vA=k1.default.encode,_A=k1.default.decode;var Wc=xr(ui());var xn;(function(n){n.RSA="rsa",n.Edwards="ed25519",n.BLS="bls12-381"})(xn||(xn={}));var A1=new Uint8Array([237,1]),E1=new Uint8Array([234,1]),S1=new Uint8Array([0,245,2]),np="did:key:z";function wA(t){switch(t){case xn.Edwards:return A1;case xn.RSA:return S1;case xn.BLS:return E1;default:return null}}var xA=t=>{if(P1(t,S1))return{keyBuffer:t.slice(S1.byteLength),type:xn.RSA};if(P1(t,A1))return{keyBuffer:t.slice(A1.byteLength),type:xn.Edwards};if(P1(t,E1))return{keyBuffer:t.slice(E1.byteLength),type:xn.BLS};throw new Error("Unsupported key algorithm. Try using RSA.")},P1=(t,e)=>Uf.equal(e,t.slice(0,e.byteLength)),T1=t=>{switch(t){case"rsa":return xn.RSA;case"ed25519":return xn.Edwards;case"bls12-381":return xn.BLS}throw new Error(`Key Type ${t} not supported`)};function ip(t,e){let r=Wc.base64ToArrBuf(t),n=wA(e);if(n===null)throw new Error(`Key type '${e}' not supported`);let o=Wc.joinBufs(n,r);return np+vA(new Uint8Array(o))}function B1(t){if(!t.startsWith(np))throw new Error("Please use a base58-encoded DID formatted `did:key:z...`");let e=t.substr(np.length),r=_A(e),{keyBuffer:n,type:o}=xA(r);return{publicKey:Wc.arrBufToBase64(n),type:o}}async function Pl(){let t=await Qr.publicReadKey(),e=await Qr.getAlg();return ip(t,T1(e))}async function Fn(){let t=await Qr.publicWriteKey(),e=await Qr.getAlg();return ip(t,T1(e))}var Tl=xr(ui());async function C1({charSize:t=16,data:e,did:r,signature:n}){try{let{type:o,publicKey:a}=B1(r),u=new Uint8Array(Tl.base64ToArrBuf(n)),c=new Uint8Array(Tl.normalizeUnicodeToBuf(e,t)),p=new Uint8Array(Tl.base64ToArrBuf(a));switch(o){case xn.Edwards:return await ty.verify(c,u,p);case xn.RSA:return await ey.verify(c,u,p);default:return!1}}catch(o){return!1}}async function Po({addSignature:t=!0,audience:e,facts:r=[],issuer:n,lifetimeInSeconds:o=30,expiration:a,potency:u="APPEND",proof:c,resource:p}){let l=Math.floor(Date.now()/1e3),y=c&&In(c),w=await Qr.getAlg(),F={alg:pN(w)||"UnknownAlgorithm",typ:"JWT",uav:"1.0.0"},_=a||l+o,U=l-60;if(y){let Q=y.payload;_=Math.min(Q.exp,_),U=Math.max(Q.nbf,U)}let V={aud:e,exp:_,fct:r,iss:n||await Fn(),nbf:U,prf:c||null,ptc:u,rsc:p||(y?y.payload.rsc:"*")},Se=t?await AA(F,V):null;return{header:F,payload:V,signature:Se}}function In(t){let e=t.split("."),r=JSON.parse(mo.urlDecode(e[0])),n=JSON.parse(mo.urlDecode(e[1]));return{header:r,payload:n,signature:e[2]||null}}function To(t){let e=op(t.header),r=ap(t.payload);return e+"."+r+"."+t.signature}function op(t){return mo.urlEncode(JSON.stringify(t))}function ap(t){return mo.urlEncode(JSON.stringify({...t}))}function Bo(t){return t.payload.exp<=Math.floor(Date.now()/1e3)}async function kA(t){let e=op(t.header),r=ap(t.payload),n=await C1({charSize:8,data:`${e}.${r}`,did:t.payload.iss,signature:mo.makeUrlUnsafe(t.signature||"")});if(!n)return n;if(!t.payload.prf)return!0;let o=In(t.payload.prf),a=o.payload.aud===t.payload.iss;return a&&await kA(o)}function sp(t,e=0){let r=mN(t,e);return r.prf?sp(r.prf,e+1):r.iss}async function AA(t,e){let r=op(t),n=ap(e);return mo.makeUrlSafe(await Qr.sign(`${r}.${n}`,8))}function pN(t){switch(t){case"ed25519":return"EdDSA";case"rsa":return"RS256";default:return null}}function mN(t,e){try{return JSON.parse(mo.urlDecode(t.split(".")[1]))}catch(r){throw new Error(`Invalid UCAN (${e} level${e===1?"":"s"} deep): \`${t}\``)}}var F1={};function Ga(){return F1}function EA(t){F1=t}async function SA(){F1={},await Sc(Pc)}var I1="wnfs";function D1(t){return t.reduce((e,r)=>{let n=In(r);if(Bo(n))return e;let o=up(n.payload.rsc);return{...e,[o]:r}},{})}function up(t){if(typeof t!="object")return t;let e=Array.from(Object.entries(t))[0];return e[0]+":"+(e[0]===I1?e[1].replace(/^\/+/,""):e[1])}function cp(t){return I1+":"}function pa(t){return Ga()[t]}async function yN(t){let e=Ga();return e["*"]||e["app:*"]||e[`app:${t}`]}async function gN(t){if(pa("*"))return pa("*");let e=t==="*",r=e?!1:jr(t),n=e?["*"]:$r(t),o=await _o(),a=o?cp(o):"";return n.reduce((u,c,p)=>{if(u)return u;let l=p===0,y=n.slice(0,n.length-p),w=zr(l&&!r?ny(...y):wo(...y));return pa(`${a}${w}`)||null},null)}async function Bl(t){let r=(await ks(Pc)||[]).concat(t);EA(D1(r));let n=bN();await gu(Pc,n)}function R1({app:t,fs:e,raw:r},n){let o=cp(n),a=pa("*");if(a&&!Bo(In(a)))return!0;if(t){let u=o+zr(Sl(t)),c=pa(u);if(!c||Bo(In(c)))return!1}return!(e?.private&&!e.private.every(c=>{let p=`${o}private/`+zr(c),l=pa(p);return l&&!Bo(In(l))})||e?.public&&!e.public.every(c=>{let p=`${o}public/`+zr(c),l=pa(p);return l&&!Bo(In(l))})||r&&!r.every(c=>{let p=up(c.rsc),l=pa(p);return l&&!Bo(In(l))}))}function bN(){return Object.values(Ga())}var N1={};mr(N1,{KeyType:()=>xn,didToPublicKey:()=>B1,exchange:()=>Pl,ownRoot:()=>vN,publicKeyToDid:()=>ip,root:()=>PA,ucan:()=>Fn,verifySignedData:()=>C1,write:()=>Fn});async function PA(t){let e=Pt.endpoints.user;try{let r=await hc(`_did.${t}.${e}`);if(r!==null)return r}catch(r){}throw new Error("Could not locate user DID in DNS.")}async function vN(){let t=Ga(),e=Object.values(t)[0];if(e!==void 0)return sp(e[1]);let r=await _o();if(!vn(r))throw new Error("No logged in user");return PA(r)}function TA(t,e,r,n){var o,a=!1,u=0;function c(){o&&clearTimeout(o)}function p(){c(),a=!0}typeof e!="boolean"&&(n=r,r=e,e=void 0);function l(){for(var y=arguments.length,w=new Array(y),F=0;F<y;F++)w[F]=arguments[F];var _=this,U=Date.now()-u;if(a)return;function V(){u=Date.now(),r.apply(_,w)}function Se(){o=void 0}n&&!o&&V(),c(),n===void 0&&U>t?V():e!==!0&&(o=setTimeout(n?Se:V,n===void 0?t-U:t))}return l.cancel=p,l}var IA=xr(zd());var U1=(t,e,r)=>({major:t,minor:e,patch:r});var BA=t=>{let{major:e,minor:r,patch:n}=t;return`${e}.${r}.${n}`},CA=U1(0,0,0),fp=U1(1,0,0),FA=U1(1,0,0);var lp;(function(u){u.Raw="raw",u.Directory="dir",u.File="file",u.Metadata="metadata",u.Symlink="symlink",u.HAMTShard="hamtShard"})(lp||(lp={}));var _N=t=>({mtime:Date.now(),ctime:Date.now(),mode:t?644:755,_type:t?lp.File:lp.Directory}),Ns=t=>({isFile:t,version:FA,unixMeta:_N(t)}),hp=t=>({...t,unixMeta:{...t.unixMeta,mtime:Date.now()}});function dp(t){let e=Math.floor(t/1e3);return{secs:e,nsecs:(t-e*1e3)*1e3}}var pp=t=>{let{name:e,cid:r,size:n}=t;return new IA.default.DAGLink(e,n,r)},DA=t=>{let{name:e="",cid:r,size:n,mtime:o,type:a}=t;return{name:e,cid:r.toString(),size:n,mtime:o,isFile:a!=="dir"}},mp=t=>{let e=t.Name,r=t.Hash.toString(),n=t.Tsize;return{name:e,cid:r,size:n}},Dn=(t,e,r,n)=>({name:t,cid:e,size:n,isFile:r,mtime:dp(Date.now())}),L1=t=>t.reduce((e,r)=>(e[r.name]=r,e),{});var Mr={};mr(Mr,{getEncryptedFile:()=>xN,getFile:()=>wN,getLinks:()=>yp,getSimpleLinks:()=>K1,putEncryptedFile:()=>O1,putFile:()=>M1,putLinks:()=>Eu});var wN=async t=>zc(t),xN=async(t,e)=>So.catAndDecode(t,e),M1=async t=>gl(t),O1=async(t,e)=>So.add(t,e),K1=async t=>{let e=await qc(t);return L1(e.Links.map(mp))},yp=async t=>{let e=await l1(t),r=L1(e.map(DA));return(await qc(t)).Links.forEach(o=>{r[o.Name]&&r[o.Name].size===0&&(r[o.Name].size=o.Tsize)}),r},Eu=async t=>{let e=Object.values(t).filter(r=>r!==void 0).map(pp);return vl(e)};var Co={};mr(Co,{checkValue:()=>MA,get:()=>TN,getAndCheckValue:()=>$1,getValue:()=>LA,getValueFromLinks:()=>j1,normalizeFileContent:()=>OA,putAndMakeLink:()=>bp,putFile:()=>PN,putTree:()=>SN});var Gr=t=>cr(t)&&t.content!==void 0;var z1=t=>cr(t)&&vn(t.name)&&vo(t.size)&&ud(t.isFile),kN=t=>z1(t)&&mi(t.cid),RA=t=>cr(t)&&Object.values(t).every(kN),AN=t=>cr(t)&&vo(t.mtime)&&vo(t.ctime)&&vo(t.mode)&&vn(t._type),Su=t=>cr(t)&&AN(t.unixMeta)&&ud(t.isFile)&&EN(t.version),gp=t=>cr(t)&&Object.values(t).every(e=>cr(e)&&mi(e.cid)&&mi(e.userland)&&mi(e.metadata)&&gp(e.subSkeleton)),q1=t=>cr(t)&&gp(t.skeleton)&&Su(t.metadata)&&t.metadata.isFile===!1,NA=t=>q1(t)&&mi(t.userland),H1=t=>cr(t)&&Su(t.metadata)&&t.metadata.isFile===!0,UA=t=>H1(t)&&mi(t.userland),mi=t=>vn(t);var EN=t=>{if(!cr(t))return!1;let{major:e,minor:r,patch:n}=t;return vo(e)&&vo(r)&&vo(n)};var SN=async(t,e,r,n)=>{let o=await Eu(t),a=Dn("userland",o.cid,!0,o.size),[u,c]=await Promise.all([bp("metadata",r),bp("skeleton",e)]),p=n!=null?Dn("previous",n,!1,await Au(n)):void 0,l={metadata:u,skeleton:c,userland:a,previous:p},{cid:y,size:w}=await Eu(l);return{cid:y,userland:a.cid,metadata:u.cid,size:w,isFile:!1,skeleton:e}},PN=async(t,e,r)=>{let n=await M1(await OA(t)),o=Dn("userland",n.cid,!0,n.size),a=await bp("metadata",e),u=r!=null?Dn("previous",r,!1,await Au(r)):void 0,c={metadata:a,userland:o,previous:u},{cid:p,size:l}=await Eu(c);return{cid:p,userland:o.cid,metadata:a.cid,size:l,isFile:!0,skeleton:{}}},bp=async(t,e)=>{let{cid:r,size:n}=await So.add(e,null);return Dn(t,r,!0,n)},TN=async t=>{let e=await yp(t),r=await $1(e,"metadata",Su),n=r.isFile?void 0:await $1(e,"skeleton",gp),o=e.userland?.cid||null;if(!mi(o))throw new Error("Could not find userland");let a=e.previous?.cid||void 0;return{userland:o,metadata:r,previous:a,skeleton:n}},LA=async(t,e)=>{if(vn(t)){let r=await yp(t);return j1(r,e)}return j1(t,e)},j1=async(t,e)=>{let r=t[e]?.cid;return r?So.catAndDecode(r,null):null},$1=async(t,e,r,n=!1)=>{let o=await LA(t,e);return MA(o,e,r,n)},MA=(t,e,r,n=!1)=>{if(!Jm(t)){if(n)return t;throw new Error(`Could not find header value: ${e}`)}if(r(t))return t;throw new Error(`Improperly formatted header value: ${e}`)};async function OA(t){if(t instanceof Uint8Array)return t;if(typeof Blob!="undefined"&&t instanceof Blob)return await Mf.toBuffer(t);let e=new TextEncoder;if(typeof t=="string")return e.encode(t);let r=JSON.stringify(t);return e.encode(r)}var dn={};mr(dn,{addNode:()=>hM,findLatestRevision:()=>h6,getByCID:()=>Up,getByLatestName:()=>f6,getByName:()=>dM,getLatestByBareNameFilter:()=>pM,getLatestByCID:()=>l6,getRevision:()=>mg,readNode:()=>c6});var KA=t=>Cl(t)||Wa(t),Wa=t=>cr(t)&&Su(t.metadata)&&t.metadata.isFile&&vn(t.key)&&mi(t.content),Cl=t=>cr(t)&&Su(t.metadata)&&t.metadata.isFile===!1&&vo(t.revision)&&CN(t.links)&&zA(t.skeleton),BN=t=>z1(t)&&vn(t.key)&&vn(t.pointer),CN=t=>cr(t)&&Object.values(t).every(BN),zA=t=>cr(t)&&Object.values(t).every(FN),FN=t=>cr(t)&&mi(t.cid)&&vn(t.key)&&zA(t.subSkeleton);var a6=xr(o6());var iM=1024,oM=16,aM=320,pg=async t=>{let e="0".repeat(iM/4);return ya(e,t)},ya=async(t,e)=>{let r=u6(t),n=await sa.sha256Str(e);return r.add(n),await cM(r)},Za=async(t,e,r)=>await ya(t,`${r}${e}`),Qa=async t=>{let e=await s6(u6(t));return sM(e)},sM=async t=>{let e=new Uint8Array(t.toBytes()),r=await sa.sha256(e);return Bc(r)};var s6=async(t,e=aM)=>{if(e>t.toBytes().byteLength*8)throw new Error("threshold is bigger than filter size");if(uM(t)>=e)return t;let n=t.toBytes(),o=n;do{let a=await sa.sha256(o);t.add(Bc(a)),o=a}while(fM(n,t.toBytes()));return s6(t,e)},uM=t=>{let e=new Uint32Array(t.toBytes()),r=0;for(let n=0;n<e.length;n++)r+=lM(e[n]);return r},cM=t=>Bc(t.toBytes()),u6=t=>{let e=k_(t);return a6.BloomFilter.fromBytes(e,oM)},fM=(t,e)=>{if(t.byteLength!==e.byteLength)return!1;let r=new Uint8Array(t),n=new Uint8Array(e);for(let o=0;o<r.length;o++)if(r[o]!==n[o])return!1;return!0},lM=t=>{let e=t-(t>>1&1431655765),r=(e&858993459)+(e>>2&858993459);return(r+(r>>4)&252645135)*16843009>>24};var hM=async(t,e,r)=>{let{cid:n,size:o}=await O1(e,r),a=await Za(e.bareNameFilter,r,e.revision),u=await Qa(a);if(await t.add(u,n),Wa(e)){let l=await ya(e.bareNameFilter,e.key),y=await Za(l,e.key,e.revision),w=await Qa(y);await t.add(w,e.content)}let[c,p]=Wa(e)?[{},!0]:[e.skeleton,!1];return{cid:n,name:u,key:r,size:o,isFile:p,skeleton:c}},c6=async(t,e)=>{let r=await So.catAndDecode(t,e);if(!KA(r))throw new Error(`Could not parse a valid filesystem object, ${t}`);return r},dM=async(t,e,r)=>{let n=await t.get(e);return n===null?null:Up(n,r)},Up=async(t,e)=>await c6(t,e),f6=async(t,e,r)=>{let n=await t.get(e);return n===null?null:l6(t,n,r)},l6=async(t,e,r)=>{let n=await Up(e,r),o=await h6(t,n.bareNameFilter,r,n.revision);return o?.cid?await Up(o?.cid,r):n},pM=async(t,e,r)=>{let n=await Za(e,r,1),o=await Qa(n);return f6(t,o,r)},h6=async(t,e,r,n)=>{let o=n,a=null,u=0,c=null;for(;a===null;){let p=n+Math.pow(2,u),l=await mg(t,e,r,p);l!==null?(c=l,o=p):a=p,u++}for(;o<a-1;){let p=Math.floor((a+o)/2),l=await mg(t,e,r,p);l!==null?(c=l,o=p):a=p}return c},mg=async(t,e,r,n)=>{let o=await Za(e,r,n),a=await Qa(o),u=await t.get(a);return u?{cid:u,name:a,number:n}:null};var d6=class{constructor(e){this.content=e}async put(){let{cid:e}=await this.putDetailed();return e}async updateContent(e){return this.content=e,this}},rf=d6;var Wl=class extends rf{static create(e){return new Wl(e)}static async fromCID(e){let r=await Mr.getFile(e);return new Wl(r)}static instanceOf(e){return cr(e)&&e.content!==void 0}async put(){let{cid:e}=await this.putDetailed();return e}async putDetailed(){return Mr.putFile(await Co.normalizeFileContent(this.content))}},Yl=Wl;var p6=class{constructor(e){this.version=e}async put(){let{cid:e}=await this.putDetailed();return e}async ls(e){let r=await this.get(e);if(r===null)throw new Error("Path does not exist");if(Gr(r))throw new Error("Can not `ls` a file");return r.getLinks()}async cat(e){let r=await this.get(e);if(r===null)throw new Error("Path does not exist");if(!Gr(r))throw new Error("Can not `cat` a directory");return r.content}async mkdir(e){return this.mkdirRecurse(e,()=>this.put())}async mkdirRecurse(e,r){let[n,...o]=e;if(!n)throw new Error("Invalid path: empty");let a=await this.getOrCreateDirectChild(n,r);if(Gr(a))throw new Error(`There is a file along the given path: ${Es(e)}`);return o.length&&await a.mkdirRecurse(o,()=>this.updateDirectChild(a,n,r)),this}async add(e,r){return await this.addRecurse(e,r,()=>this.put()),this}async addRecurse(e,r,n){let[o,...a]=e;if(!o)throw new Error("Invalid path: empty");if(a.length===0)await this.createOrUpdateChildFile(r,o,n);else{let u=await this.getOrCreateDirectChild(o,n);if(Gr(u))throw new Error(`There is a file along the given path: ${Es(e)}`);await u.addRecurse(a,r,async()=>{await this.updateDirectChild(u,o,n)})}return this}async rm(e){return await this.rmRecurse(e,()=>this.put()),this}async rmRecurse(e,r){let[n,...o]=e;if(!n)throw new Error("Invalid path: empty");if(o.length===0)this.removeDirectChild(n),r&&await r();else{let a=await this.getDirectChild(n);if(a===null)throw new Error("Invalid path: does not exist");if(Gr(a))throw new Error(`There is a file along the given path: ${Es(e)}`);await a.rmRecurse(o,async()=>{await this.updateDirectChild(a,n,r)})}return this}async mv(e,r){let n=await this.get(e);if(n===null)throw new Error(`Path does not exist: ${Es(e)}`);if(r.length<1)throw new Error(`Path does not exist: ${Es(r)}`);let o=r.slice(0,-1),a=await this.get(o);if(!a)await this.mkdir(o),a=await this.get(o);else if(Gr(a))throw new Error(`Can not \`mv\` to a file: ${Es(o)}`);return await this.rm(e),await[...r].reverse().reduce((u,c,p)=>u.then(async l=>{let y=r.slice(0,-(p+1)),w=y.length?await this.get(y):this;if(w&&!Gr(w))return await w.updateDirectChild(l,c,null),w;throw new Error("Failed to update tree while moving node")}),Promise.resolve(n)),this}async exists(e){return await this.get(e)!==null}read(e){return this.get(e)}write(e,r){return this.add(e,r)}async getOrCreateDirectChild(e,r){let n=await this.getDirectChild(e);return n!==null?n:this.createChildTree(e,r)}},nf=p6;var Ms=class extends nf{constructor(e){super(CA);this.links=e,this.children={}}static async empty(){return new Ms({})}static async fromCID(e){let r=await Mr.getLinks(e);return new Ms(r)}static fromLinks(e){return new Ms(e)}async createChildTree(e,r){let n=await Ms.empty(),o=this.children[e];if(o){if(Yl.instanceOf(o))throw new Error(`There is a file at the given path: ${e}`);return o}return await this.updateDirectChild(n,e,r),n}async createOrUpdateChildFile(e,r,n){let o=await this.getDirectChild(r),a;if(o===null)a=await Yl.create(e);else if(Yl.instanceOf(o))a=await o.updateContent(e);else throw new Error(`There is already a directory with that name: ${r}`);return await this.updateDirectChild(a,r,n),a}async putDetailed(){return Mr.putLinks(this.links)}async putAndUpdateLink(e,r,n){let o=await e.putDetailed();return this.updateLink(r,o),n&&await n(),this}async updateDirectChild(e,r,n){return this.children[r]=e,this.putAndUpdateLink(e,r,n)}removeDirectChild(e){return delete this.links[e],this.children[e]&&delete this.children[e],this}async getDirectChild(e){if(this.children[e])return this.children[e];let r=this.links[e]||null;if(r===null)return null;let n=r.isFile?await Yl.fromCID(r.cid):await Ms.fromCID(r.cid);return this.children[e]?this.children[e]:(this.children[e]=n,n)}async get(e){let[r,...n]=e;if(!r)return this;let o=await this.getDirectChild(r);if(n.length){if(o===null||Gr(o))return null}else return o;return o.get(n)}updateLink(e,r){let{cid:n,size:o,isFile:a}=r;return this.links[e]=Dn(e,n,a,o),this}getLinks(){return this.links}},Lp=Ms;var mM={"0":!0,"1":!0,"2":!0,"3":!0,"4":!0,"5":!0,"6":!0,"7":!0,"8":!0,"9":!0,a:!0,b:!0,c:!0,d:!0,e:!0,f:!0},yM=t=>mM[t]===!0,Zi=class{constructor(e){this.links=e,this.children={}}static create(){return new Zi({})}static async fromCID(e){let r=await K1(e);return new Zi(r)}async putDetailed(){return Eu(this.links)}async put(){let{cid:e}=await this.putDetailed();return e}async add(e,r){if(!yM(e[0]))throw new Error("Not a valid name, must be hexadecimal");let n=this.nextTreeOrSiblingName(e);if(e!==n)if(n===null)this.links[e]=Dn(e,r,!0,0);else if(n.length===1)await(await this.getDirectChild(n)).add(e.slice(1),r),await this.putAndUpdateChildLink(n);else{let o=this.addEmptyChild(e[0]),a=this.links[n].cid;this.removeChild(n),await Promise.all([o.add(e.slice(1),r),o.add(n.slice(1),a)]),await this.putAndUpdateChildLink(e[0])}}async putAndUpdateChildLink(e){let r=this.links[e]?.cid,{cid:n,size:o}=await this.children[e].putDetailed(),a=this.links[e]?.cid;if(r!=a)return await this.putAndUpdateChildLink(e);this.links[e]=Dn(e,n,!1,o)}addEmptyChild(e){let r=Zi.create();return this.children[e]=r,r}async get(e){let r=this.nextTreeName(e);return r===null?null:r.length>1?this.links[r].cid:(await this.getDirectChild(r)).get(e.slice(1))}async exists(e){return await this.get(e)!==null}async members(){return(await Promise.all(Object.values(this.links).map(async({name:r,cid:n})=>r.length>1?[{name:r,cid:n}]:(await(await Zi.fromCID(n)).members()).map(u=>({...u,name:r+u.name}))))).reduce((r,n)=>r.concat(n))}async getDirectChild(e){if(this.children[e])return this.children[e];let r=await Zi.fromCID(this.links[e].cid);return this.children[e]?this.children[e]:(this.children[e]=r,r)}removeChild(e){delete this.links[e],this.children[e]&&delete this.children[e]}directChildExists(e){return this.links[e]!==void 0||this.children[e]!==void 0}nextTreeName(e){return this.directChildExists(e[0])?e[0]:this.directChildExists(e)?e:null}nextTreeOrSiblingName(e){let r=e[0];return this.directChildExists(r)?r:Object.keys(this.links).find(n=>r===n[0])||null}};var ki=class{constructor(e){this.node=e}back(e=-1){let r=Math.abs(Math.min(e,-1));return Array.from({length:r},(n,o)=>o).reduce(n=>n.then(o=>o?ki._getPreviousVersion(o):null),Promise.resolve(this.node))}async prior(e){return ki._prior(this.node,e)}async list(e=5){let{acc:r}=await Array.from({length:e},(n,o)=>o).reduce((n,o)=>n.then(({node:a,acc:u})=>a?ki._getPreviousVersion(a).then(c=>({node:c,acc:[...u,{delta:-(o+1),timestamp:a.header.metadata.unixMeta.mtime}]})):Promise.resolve({node:null,acc:u})),ki._getPreviousVersion(this.node).then(n=>({node:n,acc:[]})));return r}static async _getPreviousVersion(e){return e.header.previous?e.constructor.fromCID(e.header.previous):Promise.resolve(null)}static async _prior(e,r){if(e.header.metadata.unixMeta.mtime<r)return e;let n=await ki._getPreviousVersion(e);return n?ki._prior(n,r):null}};var of=class extends rf{constructor({content:e,header:r,cid:n}){super(e);this.cid=n,this.header=r,this.history=new ki(this)}static instanceOf(e){return cr(e)&&e.content!==void 0&&H1(e.header)}static async create(e){return new of({content:e,header:{metadata:Ns(!0)},cid:null})}static async fromCID(e){let r=await Co.get(e);return of.fromInfo(r,e)}static async fromInfo(e,r){let{userland:n,metadata:o,previous:a}=e,u=await Mr.getFile(n);return new of({content:u,header:{metadata:o,previous:a},cid:r})}async putDetailed(){let e=await Co.putFile(this.content,hp(this.header.metadata),this.cid);return this.cid=e.cid,e}},af=of;var yg=(t,e)=>{let r=e[0],n=t[r]||null,o=gM(e);return n===null||o===null?n:yg(n.subSkeleton,o)};function gM(t){let e=t.slice(1);return e.length<1?null:e}var ga=class extends nf{constructor({links:e,header:r,cid:n}){super(r.metadata.version);this.children={},this.cid=n,this.links=e,this.header=r,this.history=new ki(this)}static async empty(){return new ga({links:{},header:{metadata:Ns(!1),skeleton:{}},cid:null})}static async fromCID(e){let r=await Co.get(e);if(!NA(r))throw new Error(`Could not parse a valid public tree at: ${e}`);return ga.fromInfo(r,e)}static async fromInfo(e,r){let{userland:n,metadata:o,previous:a,skeleton:u}=e,c=await Mr.getLinks(n);return new ga({links:c,header:{metadata:o,previous:a,skeleton:u},cid:r})}static instanceOf(e){return RA(e.links)&&q1(e.header)}async createChildTree(e,r){let n=await ga.empty(),o=this.children[e];if(o){if(af.instanceOf(o))throw new Error(`There is a file at the given path: ${e}`);if(ga.instanceOf(o))return o;throw new Error(`Not a public tree at the given path: ${e}`)}return await this.updateDirectChild(n,e,r),n}async createOrUpdateChildFile(e,r,n){let o=await this.getDirectChild(r),a;if(o===null)a=await af.create(e);else if(af.instanceOf(o))a=await o.updateContent(e);else throw new Error(`There is already a directory with that name: ${r}`);return await this.updateDirectChild(a,r,n),a}async putDetailed(){let e=await Co.putTree(this.links,this.header.skeleton,this.header.metadata,this.cid);return this.header.previous=this.cid||void 0,this.cid=e.cid,e}async updateDirectChild(e,r,n){this.children[r]=e;let o=await e.putDetailed();return this.updateLink(r,o),n&&await n(),this}removeDirectChild(e){return delete this.links[e],delete this.header.skeleton[e],this.children[e]&&delete this.children[e],this}async getDirectChild(e){if(this.children[e])return this.children[e];let r=this.header.skeleton[e]||null;if(r===null)return null;let n=r.isFile?await af.fromCID(r.cid):await ga.fromCID(r.cid);return this.children[e]?this.children[e]:(this.children[e]=n,n)}async get(e){if(e.length<1)return this;let r=yg(this.header.skeleton,e);if(r===null)return null;let n=await Co.get(r.cid);return UA(n)?af.fromInfo(n,r.cid):ga.fromInfo(n,r.cid)}getLinks(){return Object.values(this.links).reduce((e,r)=>({...e,[r.name]:{...r,isFile:this.header.skeleton[r.name]?.isFile}}),{})}updateLink(e,r){let{cid:n,metadata:o,userland:a,size:u,isFile:c,skeleton:p}=r;return this.links[e]=Dn(e,n,!1,u),this.header.skeleton[e]={cid:n,metadata:o,userland:a,subSkeleton:p,isFile:c},this.header.metadata.unixMeta.mtime=Date.now(),this}},sf=ga;var uf=class{constructor(e){this.node=e}async back(e=-1){let r=Math.min(e,-1),n=this.node.header?.revision;return n&&await this._getRevision(n+r)||null}async prior(e){return this.node.header.metadata.unixMeta.mtime<e?this.node:this._prior(this.node.header.revision-1,e)}async list(e=5){let r=this.node.header.revision;return Promise.all(Array.from({length:e},(n,o)=>{let a=o+1;return this._getRevisionInfoFromNumber(r-a).then(u=>({revisionInfo:u,delta:-a}))})).then(n=>n.filter(o=>!!o.revisionInfo)).then(n=>n.map(o=>{let a=o.revisionInfo.metadata.unixMeta.mtime;return{delta:o.delta,timestamp:a}}))}async _getRevision(e){let r=await this._getRevisionInfoFromNumber(e);return r&&await this.node.constructor.fromInfo(this.node.mmpt,this.node.key,r)}_getRevisionInfo(e){return dn.readNode(e.cid,this.node.key)}async _getRevisionInfoFromNumber(e){let{key:r,mmpt:n}=this.node,{bareNameFilter:o}=this.node.header,a=await dn.getRevision(n,o,r,e);return a&&this._getRevisionInfo(a)}async _prior(e,r){let n=await this._getRevisionInfoFromNumber(e);return n?.revision?n.metadata.unixMeta.mtime<r?this._getRevision(n.revision):this._prior(n.revision-1,r):null}};var Lu=class extends rf{constructor({content:e,mmpt:r,key:n,header:o}){super(e);this.header=o,this.history=new uf(this),this.key=n,this.mmpt=r}static instanceOf(e){return cr(e)&&e.content!==void 0&&e.mmpt!==void 0&&Wa(e.header)}static async create(e,r,n,o){let a=await ya(n,o),u=await ci.genKeyStr(),c=await Mr.putEncryptedFile(r,u);return new Lu({content:r,mmpt:e,key:o,header:{bareNameFilter:a,key:u,revision:1,metadata:Ns(!0),content:c.cid}})}static async fromBareNameFilter(e,r,n){let o=await dn.getLatestByBareNameFilter(e,r,n);return this.fromInfo(e,n,o)}static async fromLatestName(e,r,n){let o=await dn.getByLatestName(e,r,n);return Lu.fromInfo(e,n,o)}static async fromName(e,r,n){let o=await dn.getByName(e,r,n);return Lu.fromInfo(e,n,o)}static async fromInfo(e,r,n){if(!Wa(n))throw new Error("Could not parse a valid private file using the given key");let o=await Mr.getEncryptedFile(n.content,n.key);return new Lu({content:o,key:r,mmpt:e,header:n})}async getName(){let{bareNameFilter:e,revision:r}=this.header,n=await Za(e,this.key,r);return Qa(n)}async updateParentNameFilter(e){return this.header.bareNameFilter=await ya(e,this.header.key),this}async updateContent(e){let r=await Mr.putEncryptedFile(e,this.header.key);return this.content=e,this.header={...this.header,revision:this.header.revision+1,content:r.cid},this}async putDetailed(){return dn.addNode(this.mmpt,{...this.header,metadata:hp(this.header.metadata)},this.key)}},Ro=Lu;var Jn=class extends nf{constructor({mmpt:e,key:r,header:n}){super(fp);this.children={},this.header=n,this.history=new uf(this),this.key=r,this.mmpt=e}static instanceOf(e){return cr(e)&&e.mmpt!==void 0&&Cl(e.header)}static async create(e,r,n){let o=n?await ya(n,r):await pg(r);return new Jn({mmpt:e,key:r,header:{metadata:Ns(!1),bareNameFilter:o,revision:1,links:{},skeleton:{}}})}static async fromBaseKey(e,r){let n=await pg(r);return this.fromBareNameFilter(e,n,r)}static async fromBareNameFilter(e,r,n){let o=await dn.getLatestByBareNameFilter(e,r,n);return this.fromInfo(e,n,o)}static async fromLatestName(e,r,n){let o=await dn.getByLatestName(e,r,n);return this.fromInfo(e,n,o)}static async fromName(e,r,n){let o=await dn.getByName(e,r,n);return this.fromInfo(e,n,o)}static async fromInfo(e,r,n){if(!Cl(n))throw new Error("Could not parse a valid private tree using the given key");return new Jn({mmpt:e,key:r,header:n})}async createChildTree(e,r){let n=await ci.genKeyStr(),o=await Jn.create(this.mmpt,n,this.header.bareNameFilter),a=this.children[e];if(a){if(Ro.instanceOf(a))throw new Error(`There is a file at the given path: ${e}`);return a}return await this.updateDirectChild(o,e,r),o}async createOrUpdateChildFile(e,r,n){let o=await this.getDirectChild(r),a;if(o===null){let u=await ci.genKeyStr();a=await Ro.create(this.mmpt,e,this.header.bareNameFilter,u)}else if(Ro.instanceOf(o))a=await o.updateContent(e);else throw new Error(`There is already a directory with that name: ${r}`);return await this.updateDirectChild(a,r,n),a}async putDetailed(){let e=Object.assign({},this.header);return dn.addNode(this.mmpt,e,this.key)}async updateDirectChild(e,r,n){await e.updateParentNameFilter(this.header.bareNameFilter),this.children[r]=e;let o=await e.putDetailed();return this.updateLink(r,o),n&&await n(),this}removeDirectChild(e){return this.header={...this.header,revision:this.header.revision+1,links:Qf(this.header.links,e),skeleton:Qf(this.header.skeleton,e)},this.children[e]&&delete this.children[e],this}async getDirectChild(e){if(this.children[e])return this.children[e];let r=this.header.links[e];if(r===void 0)return null;let n=r.isFile?await Ro.fromLatestName(this.mmpt,r.pointer,r.key):await Jn.fromLatestName(this.mmpt,r.pointer,r.key);return this.children[e]?this.children[e]:(this.children[e]=n,n)}async getName(){let{bareNameFilter:e,revision:r}=this.header,n=await Za(e,this.key,r);return Qa(n)}async updateParentNameFilter(e){return this.header.bareNameFilter=await ya(e,this.key),this}async get(e){if(e.length===0)return this;let[r,...n]=e,o=this.header.skeleton[r];if(o===void 0)return null;let a=await this.getRecurse(o,n);return a===null?null:Wa(a.node)?Ro.fromInfo(this.mmpt,a.key,a.node):Jn.fromInfo(this.mmpt,a.key,a.node)}async getRecurse(e,r){let[n,...o]=r;if(n===void 0)return{key:e.key,node:await dn.getLatestByCID(this.mmpt,e.cid,e.key)};let a=e.subSkeleton[n];if(a!==void 0)return this.getRecurse(a,o);let u=await dn.getLatestByCID(this.mmpt,e.cid,e.key);if(!Cl(u))return null;let c=u.skeleton[n];return c===void 0?null:this.getRecurse(c,o)}getLinks(){return Zm(this.header.links,e=>{let{key:r,...n}=e;return{...n}})}updateLink(e,r){let n=Date.now(),{cid:o,size:a,key:u,isFile:c,skeleton:p}=r,l=r.name;return this.header.links[e]={name:e,key:u,pointer:l,size:a,isFile:c,mtime:dp(n)},this.header.skeleton[e]={cid:o,key:u,subSkeleton:p},this.header.revision=this.header.revision+1,this.header.metadata.unixMeta.mtime=n,this}};var cf=class{constructor({links:e,mmpt:r,privateLog:n,publicTree:o,prettyTree:a,privateNodes:u}){this.links=e,this.mmpt=r,this.privateLog=n,this.publicTree=o,this.prettyTree=a,this.privateNodes=u}static async empty({rootKey:e}){let r=await sf.empty(),n=await Lp.empty(),o=Zi.create(),a=zr(wo(xt.Private)),u=await Jn.create(o,e,null);await u.put();let c=new cf({links:{},mmpt:o,privateLog:[],publicTree:r,prettyTree:n,privateNodes:{[a]:u}});return await cf.storeRootKey(e),c.setVersion(fp),await Promise.all([c.updatePuttable(xt.Public,r),c.updatePuttable(xt.Pretty,n),c.updatePuttable(xt.Private,o)]),c}static async fromCID({cid:e,permissions:r}){let n=await Mr.getLinks(e),o=r?await _M(r):[],a=n[xt.Public]?.cid||null,u=a===null?await sf.empty():await sf.fromCID(a),c=n[xt.Pretty]?await Lp.fromCID(n[xt.Pretty].cid):await Lp.empty(),p=n[xt.Private]?.cid||null,l,y;p===null?(l=await Zi.create(),y={}):(l=await Zi.fromCID(p),y=await vM(o,l));let w=n[xt.PrivateLog]?.cid,F=w?await qc(w).then(U=>U.Links.map(mp)).then(U=>U.sort((V,Se)=>parseInt(V.name,10)-parseInt(Se.name,10))):[];return new cf({links:n,mmpt:l,privateLog:F,publicTree:u,prettyTree:c,privateNodes:y})}async put(){let{cid:e}=await this.putDetailed();return e}async putDetailed(){return Mr.putLinks(this.links)}updateLink(e,r){let{cid:n,size:o,isFile:a}=r;return this.links[e]=Dn(e,n,a,o),this}async updatePuttable(e,r){return this.updateLink(e,await r.putDetailed())}static async storeRootKey(e){let r=wo(xt.Private),n=await Fc({path:r});await Qr.importSymmKey(e,n)}findPrivateNode(e){return gg(this.privateNodes,e)}async addPrivateLogEntry(e){let r=[...this.privateLog],n=Math.max(0,r.length-1),o=r[n]?.cid?(await bl(r[n].cid)).split(","):[];o.length+1>cf.LOG_CHUNK_SIZE&&(n=n+1,o=[]);let u=await sa.sha256Str(e),c=[...o,u],p=await Mr.putFile(c.join(","));r[n]={name:n.toString(),cid:p.cid,size:p.size};let l=await vl(r.map(pp));this.updateLink(xt.PrivateLog,{cid:l.cid,isFile:!1,size:await Au(l.cid)}),this.privateLog=r}async setVersion(e){let r=await Mr.putFile(BA(e));return this.updateLink(xt.Version,r)}},Os=cf;Os.LOG_CHUNK_SIZE=1020;async function bM(t,e){let r=await ld({path:e}),n=await ks(r);if(n)return n;let[o,a]=gg(t,e);if(!a)return null;let c=$r(e).slice($r(o).length);return Ro.instanceOf(a)?c.length===0?a.header.bareNameFilter:null:(a.exists(c)||(jr(e)?await a.mkdir(c):await a.add(c,"")),a.get(c).then(p=>p?p.header.bareNameFilter:null))}function gg(t,e){let r=t[zr(e)];if(r)return[e,r];let n=uy(e);return n?gg(t,n):[e,null]}function vM(t,e){return wM(t).reduce((r,{path:n,key:o})=>r.then(async a=>{let u,c=$r(n);if(c.length===1&&c[0]===xt.Private)u=await Jn.fromBaseKey(e,o);else{let l=await bM(a,n);if(!l)throw new Error(`Was trying to load the PrivateTree for the path \`${n}\`, but couldn't find the bare name filter for it.`);jr(n)?u=await Jn.fromBareNameFilter(e,l,o):u=await Ro.fromBareNameFilter(e,l,o)}let p=zr(n);return{...a,[p]:u}}),Promise.resolve({}))}async function _M(t){return ep(t).reduce(async(e,r)=>{if(tl(xt.Public,r))return e;let n=await Fc({path:r}),o=await Qr.exportSymmKey(n),a={path:r,key:o};return e.then(u=>[...u,a])},Promise.resolve([]))}function wM(t){return t.sort((e,r)=>zr(e.path).localeCompare(zr(r.path)))}var xM="webnative.wnfs_cid_log";function bg(){return xM+"-"+Pt.endpoints.lobby}async function vg(){return await ks(bg())||[]}async function m6(t){let e=await vg();return[e.indexOf(t),e.length]}async function Mp(){return(await vg())[0]}async function Op(t){let e=await vg(),r=[t,...e].slice(0,1e3);await gu(bg(),r)}async function y6(){await Sc(bg())}var kg={};mr(kg,{lookup:()=>wg,lookupOnFisson:()=>b6,update:()=>xg});function Xn(...t){Pt.debug&&console.log(...t)}var _g={};mr(_g,{build:()=>Po,decode:()=>In,dictionary:()=>ma,encode:()=>To,encodeHeader:()=>op,encodePayload:()=>ap,isExpired:()=>Bo,isValid:()=>kA,rootIssuer:()=>sp,sign:()=>AA});var g6="Qmc5m94Gu7z62RC8waSKkZUrCCBJPyHbkpmGzEePxy2oXJ";async function wg(t){let e=await b6(t);if(e===g6)return null;if(e!==null)return e;try{let r=await im(t+".files."+Pt.endpoints.user);return r===g6?null:r}catch(r){throw console.error(r),new Error("Could not locate user root in dns")}}async function b6(t){try{let r=await(await fetch(`${Pt.endpoints.api}/user/data/${t}`,{cache:"reload"})).json();if(!mi(r))throw new Error("Did not receive a CID");return r}catch(e){return Xn("Could not locate user root on Fission server: ",e.toString()),null}}async function xg(t,e){let r=Pt.endpoints.api;return Xn("\u{1F30A} Updating your DNSLink:",t),await v6(`${r}/user/data/${t}`,{headers:async()=>({authorization:`Bearer ${To(await Po({audience:await si.did(),issuer:await Fn(),potency:"APPEND",proof:e,resource:In(e).payload.rsc}))}`}),retries:100,retryDelay:5e3,retryOn:[502,503,504]},{method:"PATCH"}).then(n=>(n.status<300?Xn("\u{1FAB4} DNSLink updated:",t):Xn("\u{1F525} Failed to update DNSLink for:",t),{success:n.status<300})).catch(n=>(Xn("\u{1F525} Failed to update DNSLink for:",t),console.error(n),{success:!1}))}async function v6(t,e,r,n=0){let o=await e.headers(),a=await fetch(t,{...r,headers:{...r.headers,...o}});if(e.retryOn.includes(a.status)){if(n<e.retries)return await new Promise((u,c)=>setTimeout(()=>v6(t,e,r,n+1).then(u,c),e.retryDelay));throw new Error("Too many retries for fetch")}return a}var Ag={};mr(Ag,{NoPermissionError:()=>Vl});var Vl=class extends Error{constructor(e){super(e);this.name="NoPermissionError"}};var Jl=class{constructor({root:e,permissions:r,localOnly:n}){this.localOnly=n||!1,this.proofs={},this.publishHooks=[],this.root=e,this._publishWhenOnline=[],this._publishing=!1,this._whenOnline=this._whenOnline.bind(this),this._beforeLeaving=this._beforeLeaving.bind(this);let o=globalThis;o.filesystems=o.filesystems||[],o.filesystems.push(this),r&&r.app&&r.app.creator&&r.app.name&&(this.appPath=kM(r));let a=c=>{Op(c),Xn("\u{1F4D3} Adding to the CID ledger:",c)},u=TA(3e3,!1,(c,p)=>{if(globalThis.navigator.onLine)return this._publishing=[c,!0],xg(c,p).then(()=>{this._publishing&&this._publishing[0]===c&&(this._publishing=!1)});this._publishWhenOnline.push([c,p])},!1);this.publishHooks.push(a),this.publishHooks.push(u),this.localOnly||(globalThis.addEventListener("online",this._whenOnline),globalThis.addEventListener("beforeunload",this._beforeLeaving))}static async empty(e={}){let{permissions:r,localOnly:n}=e,o=e.rootKey||await ci.genKeyStr(),a=await Os.empty({rootKey:o});return new Jl({root:a,permissions:r,localOnly:n})}static async fromCID(e,r={}){let{permissions:n,localOnly:o}=r,a=await Os.fromCID({cid:e,permissions:n});return new Jl({root:a,permissions:n,localOnly:o})}deactivate(){if(this.localOnly)return;let e=globalThis;e.filesystems=e.filesystems.filter(r=>r!==this),e.removeEventListener("online",this._whenOnline),e.removeEventListener("beforeunload",this._beforeLeaving)}async ls(e){if(As(e))throw new Error("`ls` only accepts directory paths");return this.runOnNode(e,!1,(r,n)=>{if(Gr(r))throw new Error("Tried to `ls` a file");return r.ls(n)})}async mkdir(e,r={}){if(As(e))throw new Error("`mkdir` only accepts directory paths");return await this.runOnNode(e,!0,(n,o)=>{if(Gr(n))throw new Error("Tried to `mkdir` a file");return n.mkdir(o)}),r.publish&&await this.publish(),this}async add(e,r,n={}){if(jr(e))throw new Error("`add` only accepts file paths");return await this.runOnNode(e,!0,async(o,a)=>Gr(o)?o.updateContent(r):o.add(a,r)),n.publish&&await this.publish(),this}async cat(e){if(jr(e))throw new Error("`cat` only accepts file paths");return this.runOnNode(e,!1,async(r,n)=>Gr(r)?r.content:r.cat(n))}async read(e){if(jr(e))throw new Error("`read` only accepts file paths");return this.cat(e)}async write(e,r,n={}){if(jr(e))throw new Error("`write` only accepts file paths");return this.add(e,r,n)}async exists(e){return this.runOnNode(e,!1,async(r,n)=>Gr(r)?!0:r.exists(n))}async get(e){return this.runOnNode(e,!1,async(r,n)=>Gr(r)?r:r.get(n))}async mv(e,r){let n=oy(e,r);if(!ay(e,r)){let o=fd(e),a=fd(r);throw new Error(`Can't move to a different kind of path, from is a ${o} and to is a ${a}`)}if(!n)throw new Error("`mv` is only supported on the same tree for now");if(await this.exists(r))throw new Error("Destination already exists");return await this.runOnNode(e,!0,(o,a)=>{if(Gr(o))throw new Error("Tried to `mv` within a file");let[u,...c]=$r(r);return o.mv(a,c)}),this}async rm(e){return await this.runOnNode(e,!0,(r,n)=>{if(Gr(r))throw new Error("Cannot `rm` a file you've asked permission for");return r.rm(n)}),this}async publish(){let e=Array.from(Object.entries(this.proofs));this.proofs={};let r=await this.root.put();return e.forEach(([n,o])=>{this.publishHooks.forEach(a=>a(r,o))}),r}async runOnNode(e,r,n){let o=$r(e),a=o[0],u=o.slice(1),c=r?"make changes to":"query";if(!this.localOnly){let y=await ma.lookupFilesystemUcan(e),w=y&&In(y);if(!y||!w||Bo(w)||!w.signature)throw new Vl(`I don't have the necessary permissions to ${c} the file system at "${zr(e)}"`);this.proofs[w.signature]=y}let p,l;if(a===xt.Public)p=await n(this.root.publicTree,u),r&&sf.instanceOf(p)&&(l=await n(this.root.prettyTree,u),this.root.publicTree=p,this.root.prettyTree=l,await Promise.all([this.root.updatePuttable(xt.Public,this.root.publicTree),this.root.updatePuttable(xt.Pretty,this.root.prettyTree)]));else if(a===xt.Private){let[y,w]=this.root.findPrivateNode(e);if(!w)throw new Vl(`I don't have the necessary permissions to ${c} the file system at "${zr(e)}"`);if(p=await n(w,o.slice($r(y).length)),r&&(Jn.instanceOf(p)||Ro.instanceOf(p))){this.root.privateNodes[zr(y)]=p,await p.put(),await this.root.updatePuttable(xt.Private,this.root.mmpt);let F=await this.root.mmpt.put();await this.root.addPrivateLogEntry(F)}}else{if(a===xt.Pretty&&r)throw new Error("The pretty path is read only");if(a===xt.Pretty)p=await n(this.root.prettyTree,u);else throw new Error("Not a valid FileSystem path")}return p}_whenOnline(){let e=[...this._publishWhenOnline];this._publishWhenOnline=[],e.forEach(([r,n])=>{this.publishHooks.forEach(o=>o(r,n))})}_beforeLeaving(e){let r="Are you sure you want to leave? We don't control the browser so you may lose your data.";if(this._publishing||this._publishWhenOnline.length)return(e||globalThis.event).returnValue=r,r}},_6=Jl;function kM(t){if(!t.app)throw Error("Only works with app permissions");let e=Sl(t.app);return r=>r?Cc(e,r):e}var Xl=_6;async function Eg(t,e,r){let n,o;if(e=e||await _o()||void 0,!e)throw new Error("User hasn't authenticated yet");await Bl([]);let a=navigator.onLine?await wg(e):null,[u,c]=a?await m6(a):[-1,0];if(!navigator.onLine)n=await Mp();else if(!a)n=await Mp(),n?Xn("\u{1F4D3} No DNSLink, using local CID:",n):Xn("\u{1F4D3} Creating a new file system");else if(u===0)n=a,Xn("\u{1F4D3} DNSLink is up to date:",n);else if(u>0){n=await Mp();let l=u===1?"1 newer local entry":u+" newer local entries";Xn("\u{1F4D3} DNSLink is outdated ("+l+"), using local CID:",n)}else n=a,await Op(n),Xn("\u{1F4D3} DNSLink is newer:",n);let p=t||void 0;if(o=n?await Xl.fromCID(n,{permissions:p}):null,o)return o;if(!r)throw new Error("Can't make new filesystem without a root AES key");return o=await Xl.empty({permissions:p,rootKey:r}),await AM(o),o}async function AM(t){await t.mkdir({directory:[xt.Private,"Apps"]}),await t.mkdir({directory:[xt.Private,"Audio"]}),await t.mkdir({directory:[xt.Private,"Documents"]}),await t.mkdir({directory:[xt.Private,"Photos"]}),await t.mkdir({directory:[xt.Private,"Video"]}),await t.publish()}async function EM(){return _o()}async function SM({withoutRedirect:t}={}){await Sc(Tc),await SA(),await y6(),await Qr.clear(),(globalThis.filesystems||[]).forEach(e=>e.deactivate()),!t&&globalThis.location&&(globalThis.location.href=Pt.endpoints.lobby)}async function PM(t,e){let r=t?.app,n=t?.fs,o=t?.platform,a=t?.raw,u=await Pl(),c=await Fn(),p=!!document.body.querySelector("iframe#webnative-ipfs")&&typeof SharedWorker=="function";e=e||window.location.href;let l=[["didExchange",u],["didWrite",c],["redirectTo",e],["sdk",cd.toString()],["sharedRepo",p?"t":"f"]].concat(r?[["appFolder",`${r.creator}/${r.name}`]]:[],n?.private?n.private.map(y=>["privatePath",zr(y,{absolute:!0})]):[],n?.public?n.public.map(y=>["publicPath",zr(y,{absolute:!0})]):[],a?[["raw",gm(JSON.stringify(a))]]:[]).concat((()=>{let y=o?.apps;switch(typeof y){case"string":return[["app",y]];case"object":return y.map(w=>["app",w]);default:return[]}})());window.location.href=Pt.endpoints.lobby+"?"+l.map(([y,w])=>encodeURIComponent(y)+"="+encodeURIComponent(w)).join("&")}var Sg={};mr(Sg,{create:()=>BM,deleteByDomain:()=>CM,index:()=>TM,publish:()=>FM});async function TM(){let t=Pt.endpoints.api,e=await ma.lookupAppUcan("*");if(e===null)throw"Could not find your local UCAN";let r=To(await Po({audience:await si.did(),issuer:await Fn(),proof:e,potency:null})),o=await(await fetch(`${t}/app`,{method:"GET",headers:{authorization:`Bearer ${r}`}})).json();return Object.values(o).filter(a=>a.length>0).map(a=>({domain:a[0]}))}async function BM(t){let e=Pt.endpoints.api,r=await ma.lookupAppUcan("*");if(r===null)throw"Could not find your local UCAN";let n=To(await Po({audience:await si.did(),issuer:await Fn(),proof:r,potency:null})),o=vn(t)?`${e}/app?subdomain=${encodeURIComponent(t)}`:`${e}/app`;return{domain:await(await fetch(o,{method:"POST",headers:{authorization:`Bearer ${n}`}})).json()}}async function CM(t){let e=Pt.endpoints.api,r=await ma.lookupAppUcan(t);if(r===null)throw new Error("Could not find your local UCAN");let n=To(await Po({audience:await si.did(),issuer:await Fn(),proof:r,potency:null})),a=await(await fetch(`${e}/app`,{method:"GET",headers:{authorization:`Bearer ${n}`}})).json(),u=Object.entries(a).find(([c,p])=>p.includes(t));if(u==null)throw new Error(`Couldn't find an app with domain ${t}`);await fetch(`${e}/app/${encodeURIComponent(u[0])}`,{method:"DELETE",headers:{authorization:`Bearer ${n}`}})}async function FM(t,e){let r=Pt.endpoints.api,n=await ma.lookupAppUcan(t);if(n===null)throw"Could not find your local UCAN";let o=To(await Po({audience:await si.did(),issuer:await Fn(),proof:n,potency:null})),a=`${r}/app/${t}/${e}`;await fetch(a,{method:"PATCH",headers:{authorization:`Bearer ${o}`}})}var Pg={};mr(Pg,{createAccount:()=>RM,isUsernameAvailable:()=>IM,isUsernameValid:()=>DM,resendVerificationEmail:()=>NM,storeFileSystemRootKey:()=>UM});var w6=["fission","ipfs","ipns","did","id","identity",".htaccess","htaccess",".htpasswd","htpasswd",".well-known","well-known","400","401","403","404","405","406","407","408","409","410","411","412","413","414","415","416","417","421","422","423","424","426","428","429","431","500","501","502","503","504","505","506","507","508","509","510","511","_domainkey","about","about-us","abuse","access","account","accounts","ad","add","admin","administration","administrator","ads","ads.txt","advertise","advertising","aes128-ctr","aes128-gcm","aes192-ctr","aes256-ctr","aes256-gcm","affiliate","affiliates","ajax","alert","alerts","alpha","amp","analytics","api","app","app-ads.txt","apps","asc","assets","atom","auth","authentication","authorize","autoconfig","autodiscover","avatar","backup","banner","banners","bbs","beta","billing","billings","blog","blogs","board","bookmark","bookmarks","broadcasthost","business","buy","cache","calendar","campaign","captcha","careers","cart","cas","categories","category","cdn","cgi","cgi-bin","chacha20-poly1305","change","channel","channels","chart","chat","checkout","clear","client","close","cloud","cms","com","comment","comments","community","compare","compose","config","connect","contact","contest","cookies","copy","copyright","count","cp","cpanel","create","crossdomain.xml","css","curve25519-sha256","customer","customers","customize","dashboard","db","deals","debug","delete","desc","destroy","dev","developer","developers","diffie-hellman-group-exchange-sha256","diffie-hellman-group14-sha1","disconnect","discuss","dns","dns0","dns1","dns2","dns3","dns4","docs","documentation","domain","download","downloads","downvote","draft","drop","ecdh-sha2-nistp256","ecdh-sha2-nistp384","ecdh-sha2-nistp521","edit","editor","email","enterprise","error","errors","event","events","example","exception","exit","explore","export","extensions","false","family","faq","faqs","favicon.ico","features","feed","feedback","feeds","file","files","filter","follow","follower","followers","following","fonts","forgot","forgot-password","forgotpassword","form","forms","forum","forums","friend","friends","ftp","get","git","go","graphql","group","groups","guest","guidelines","guides","head","header","help","hide","hmac-sha","hmac-sha1","hmac-sha1-etm","hmac-sha2-256","hmac-sha2-256-etm","hmac-sha2-512","hmac-sha2-512-etm","home","host","hosting","hostmaster","htpasswd","http","httpd","https","humans.txt","icons","images","imap","img","import","index","info","insert","investors","invitations","invite","invites","invoice","is","isatap","issues","it","jobs","join","js","json","keybase.txt","learn","legal","license","licensing","like","limit","live","load","local","localdomain","localhost","lock","login","logout","lost-password","m","mail","mail0","mail1","mail2","mail3","mail4","mail5","mail6","mail7","mail8","mail9","mailer-daemon","mailerdaemon","map","marketing","marketplace","master","me","media","member","members","message","messages","metrics","mis","mobile","moderator","modify","more","mx","mx1","my","net","network","new","news","newsletter","newsletters","next","nil","no-reply","nobody","noc","none","noreply","notification","notifications","ns","ns0","ns1","ns2","ns3","ns4","ns5","ns6","ns7","ns8","ns9","null","oauth","oauth2","offer","offers","online","openid","order","orders","overview","owa","owner","page","pages","partners","passwd","password","pay","payment","payments","photo","photos","pixel","plans","plugins","policies","policy","pop","pop3","popular","portal","portfolio","post","postfix","postmaster","poweruser","preferences","premium","press","previous","pricing","print","privacy","privacy-policy","private","prod","product","production","profile","profiles","project","projects","public","purchase","put","quota","recover","recovery","redirect","reduce","refund","refunds","register","registration","remove","replies","reply","report","request","request-password","reset","reset-password","response","return","returns","review","reviews","robots.txt","root","rootuser","rsa-sha2-2","rsa-sha2-512","rss","rules","sales","save","script","sdk","search","secure","security","select","services","session","sessions","settings","setup","share","shift","shop","signin","signup","site","sitemap","sites","smtp","sort","source","sql","ssh","ssh-rsa","ssl","ssladmin","ssladministrator","sslwebmaster","stage","staging","stat","static","statistics","stats","status","store","style","styles","stylesheet","stylesheets","subdomain","subscribe","sudo","super","superuser","support","survey","sync","sysadmin","system","tablet","tag","tags","team","telnet","terms","terms-of-use","test","testimonials","theme","themes","today","tools","topic","topics","tour","training","translate","translations","trending","trial","true","umac-128","umac-128-etm","umac-64","umac-64-etm","undefined","unfollow","unlike","unsubscribe","update","upgrade","usenet","user","username","users","uucp","var","verify","video","view","void","vote","vpn","webmail","webmaster","website","widget","widgets","wiki","wpad","write","www","www-data","www1","www2","www3","www4","you","yourname","yourusername","zlib"];async function IM(t){return!(await fetch(`${Pt.endpoints.api}/user/data/${t}`)).ok}function DM(t){return!t.startsWith("-")&&!t.endsWith("-")&&!t.startsWith("_")&&/^[a-zA-Z0-9_-]+$/.test(t)&&!w6.includes(t.toLowerCase())}async function RM(t){let e=Pt.endpoints.api,r=To(await Po({audience:await si.did(),issuer:await Fn()}));return{success:(await fetch(`${e}/user`,{method:"PUT",headers:{authorization:`Bearer ${r}`,"content-type":"application/json"},body:JSON.stringify(t)})).status<300}}async function NM(){let t=Pt.endpoints.api,e=Object.values(Ga())[0];if(e===null)throw"Could not find your local UCAN";let r=To(await Po({audience:await si.did(),issuer:await Fn(),proof:e,potency:null}));return{success:(await fetch(`${t}/user/email/resend`,{method:"POST",headers:{authorization:`Bearer ${r}`}})).status<300}}function UM(t){return Os.storeRootKey(t)}var Tg={};mr(Tg,{debug:()=>LM,endpoints:()=>MM,setDependencies:()=>w_});function LM({enabled:t}){return Pt.debug=t,Pt.debug}function MM(t){return Pt.endpoints={...Pt.endpoints,...t},{...Pt.endpoints}}var Mu;(function(o){o.NotAuthorised="NOT_AUTHORISED",o.AuthSucceeded="AUTH_SUCCEEDED",o.AuthCancelled="AUTH_CANCELLED",o.Continuation="CONTINUATION"})(Mu||(Mu={}));var Zl;(function(r){r.InsecureContext="INSECURE_CONTEXT",r.UnsupportedBrowser="UNSUPPORTED_BROWSER"})(Zl||(Zl={}));async function OM(t){t=t||{};let e=t.permissions||null,{autoRemoveUrlParams:r=!0,rootKey:n}=t,o=async l=>t.loadFileSystem===!1?void 0:await Eg(e,l,n);if(globalThis.isSecureContext===!1)throw Zl.InsecureContext;if(await x6()===!1)throw Zl.UnsupportedBrowser;let a=new URL(window.location.href),u=a.searchParams.get("authorised"),c=a.searchParams.get("cancelled");if(u){let l=a.searchParams.get("newUser")==="t",y=a.searchParams.get("username")||"";return await HM(u==="via-postmessage"?await jM():await bl(u)),await gu(Tc,y),r&&(a.searchParams.delete("authorised"),a.searchParams.delete("newUser"),a.searchParams.delete("username"),history.replaceState(null,document.title,a.toString())),e&&await A6(e)===!1?(console.warn("Unable to validate filesystem secrets"),Kp(e)):e&&R1(e,y)===!1?(console.warn("Unable to validate UCAN permissions"),Kp(e)):zM(e,l,y,await o(y))}else if(c){let l=(()=>{switch(c){case"DENIED":return"User denied authorisation";default:return"Unknown reason"}})();return qM(e,l)}else await Bl([]);let p=await _o();if(p&&e){let l=await A6(e),y=R1(e,p);return l&&y?k6(e,p,await o(p)):Kp(e)}else return p?k6(e,p,await o(p)):Kp(e)}async function x6(){return Bg.default.supports(Bg.default.INDEXEDDB)&&await(()=>new Promise(t=>{let e=indexedDB.open("testDatabase");e.onsuccess=()=>t(!0),e.onerror=()=>t(!1)}))()}var KM=Xl;function zM(t,e,r,n){return{scenario:Mu.AuthSucceeded,permissions:t,authenticated:!0,throughLobby:!0,fs:n,newUser:e,username:r}}function qM(t,e){return{scenario:Mu.AuthCancelled,permissions:t,authenticated:!1,throughLobby:!0,cancellationReason:e}}function k6(t,e,r){return{scenario:Mu.Continuation,permissions:t,authenticated:!0,newUser:!1,throughLobby:!1,fs:r,username:e}}function Kp(t){return{scenario:Mu.NotAuthorised,permissions:t,authenticated:!1}}async function HM(t){let e=JSON.parse(t),r=await Qr.decrypt(e.sessionKey),n=await ci.decryptGCM(e.secrets,r,e.iv),o=JSON.parse(n),a=o.fs,u=o.ucans;await Promise.all(Object.entries(a).map(async([c,{bareNameFilter:p,key:l}])=>{let y=iy(c),w=await Fc({path:y}),F=await ld({path:y});await Qr.importSymmKey(l,w),await gu(F,p)})),await Bl(u)}async function jM(){let t=await new Promise(e=>{let r=document.createElement("iframe");r.id="webnative-secret-exchange",r.style.width="0",r.style.height="0",r.style.border="none",r.style.display="none",document.body.appendChild(r),r.onload=()=>{e(r)},r.src=`${Pt.endpoints.lobby}/exchange.html`});try{let e=new Promise((n,o)=>{window.addEventListener("message",a);function a(u){window.removeEventListener("message",a),u.data?n(u.data):o(new Error("Can't import UCANs & readKey(s): Missing data"))}});if(t.contentWindow==null)throw new Error("Can't import UCANs & readKey(s): No access to its contentWindow");let r={webnative:"exchange-secrets",didExchange:await Pl()};return t.contentWindow.postMessage(r,t.src),await e}finally{document.body.removeChild(t)}}async function A6(t){return ep(t).reduce((e,r)=>e.then(async n=>{if(n===!1||tl(xt.Public,r))return n;let o=await Fc({path:r});return await Qr.keyExists(o)}),Promise.resolve(!0))}return $M;})();
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 |
|
88 |
|
89 |
|
90 |
|
91 |
|
92 |
|
93 |
|
94 |
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 |
|