@substrate-system/mergeparty
Version:
Automerge + Partykit
1 lines • 3.52 MB
JavaScript
var cn=Object.create;var Ce=Object.defineProperty;var ln=Object.getOwnPropertyDescriptor;var Bn=Object.getOwnPropertyNames;var dn=Object.getPrototypeOf,En=Object.prototype.hasOwnProperty;var a=(j,A)=>Ce(j,"name",{value:A,configurable:!0});var tA=(j,A)=>()=>(A||j((A={exports:{}}).exports,A),A.exports),Me=(j,A)=>{for(var e in A)Ce(j,e,{get:A[e],enumerable:!0})},fn=(j,A,e,t)=>{if(A&&typeof A=="object"||typeof A=="function")for(let r of Bn(A))!En.call(j,r)&&r!==e&&Ce(j,r,{get:()=>A[r],enumerable:!(t=ln(A,r))||t.enumerable});return j};var vA=(j,A,e)=>(e=j!=null?cn(dn(j)):{},fn(A||!j||!j.__esModule?Ce(e,"default",{value:j,enumerable:!0}):e,j));var Gr=(()=>{for(var j=new Uint8Array(128),A=0;A<64;A++)j[A<26?A+65:A<52?A+71:A<62?A-4:A*4-205]=A;return e=>{for(var t=e.length,r=new Uint8Array((t-(e[t-1]=="=")-(e[t-2]=="="))*3/4|0),o=0,n=0;o<t;){var s=j[e.charCodeAt(o++)],c=j[e.charCodeAt(o++)],B=j[e.charCodeAt(o++)],E=j[e.charCodeAt(o++)];r[n++]=s<<2|c>>4,r[n++]=c<<4|B>>2,r[n++]=B<<6|E}return r}})();var Ur=tA((hE,zr)=>{"use strict";var vj=1e3,Oj=vj*60,Hj=Oj*60,Gj=Hj*24,Xs=Gj*7,Ls=Gj*365.25;zr.exports=function(j,A){A=A||{};var e=typeof j;if(e==="string"&&j.length>0)return Vs(j);if(e==="number"&&isFinite(j))return A.long?Us(j):zs(j);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(j))};function Vs(j){if(j=String(j),!(j.length>100)){var A=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(j);if(A){var e=parseFloat(A[1]),t=(A[2]||"ms").toLowerCase();switch(t){case"years":case"year":case"yrs":case"yr":case"y":return e*Ls;case"weeks":case"week":case"w":return e*Xs;case"days":case"day":case"d":return e*Gj;case"hours":case"hour":case"hrs":case"hr":case"h":return e*Hj;case"minutes":case"minute":case"mins":case"min":case"m":return e*Oj;case"seconds":case"second":case"secs":case"sec":case"s":return e*vj;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return e;default:return}}}}a(Vs,"parse");function zs(j){var A=Math.abs(j);return A>=Gj?Math.round(j/Gj)+"d":A>=Hj?Math.round(j/Hj)+"h":A>=Oj?Math.round(j/Oj)+"m":A>=vj?Math.round(j/vj)+"s":j+"ms"}a(zs,"fmtShort");function Us(j){var A=Math.abs(j);return A>=Gj?j6(j,A,Gj,"day"):A>=Hj?j6(j,A,Hj,"hour"):A>=Oj?j6(j,A,Oj,"minute"):A>=vj?j6(j,A,vj,"second"):j+" ms"}a(Us,"fmtLong");function j6(j,A,e,t){var r=A>=e*1.5;return Math.round(j/e)+" "+t+(r?"s":"")}a(j6,"plural")});var Wr=tA((mE,Qr)=>{"use strict";function Qs(j){e.debug=e,e.default=e,e.coerce=c,e.disable=n,e.enable=r,e.enabled=s,e.humanize=Ur(),e.destroy=B,Object.keys(j).forEach(E=>{e[E]=j[E]}),e.names=[],e.skips=[],e.formatters={};function A(E){let l=0;for(let i=0;i<E.length;i++)l=(l<<5)-l+E.charCodeAt(i),l|=0;return e.colors[Math.abs(l)%e.colors.length]}a(A,"selectColor"),e.selectColor=A;function e(E){let l,i=null,d,f;function m(..._){if(!m.enabled)return;let I=m,F=Number(new Date),k=F-(l||F);I.diff=k,I.prev=l,I.curr=F,l=F,_[0]=e.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let v=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(M,D)=>{if(M==="%%")return"%";v++;let P=e.formatters[D];if(typeof P=="function"){let S=_[v];M=P.call(I,S),_.splice(v,1),v--}return M}),e.formatArgs.call(I,_),(I.log||e.log).apply(I,_)}return a(m,"debug"),m.namespace=E,m.useColors=e.useColors(),m.color=e.selectColor(E),m.extend=t,m.destroy=e.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:a(()=>i!==null?i:(d!==e.namespaces&&(d=e.namespaces,f=e.enabled(E)),f),"get"),set:a(_=>{i=_},"set")}),typeof e.init=="function"&&e.init(m),m}a(e,"createDebug");function t(E,l){let i=e(this.namespace+(typeof l>"u"?":":l)+E);return i.log=this.log,i}a(t,"extend");function r(E){e.save(E),e.namespaces=E,e.names=[],e.skips=[];let l=(typeof E=="string"?E:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let i of l)i[0]==="-"?e.skips.push(i.slice(1)):e.names.push(i)}a(r,"enable");function o(E,l){let i=0,d=0,f=-1,m=0;for(;i<E.length;)if(d<l.length&&(l[d]===E[i]||l[d]==="*"))l[d]==="*"?(f=d,m=i,d++):(i++,d++);else if(f!==-1)d=f+1,m++,i=m;else return!1;for(;d<l.length&&l[d]==="*";)d++;return d===l.length}a(o,"matchesTemplate");function n(){let E=[...e.names,...e.skips.map(l=>"-"+l)].join(",");return e.enable(""),E}a(n,"disable");function s(E){for(let l of e.skips)if(o(E,l))return!1;for(let l of e.names)if(o(E,l))return!0;return!1}a(s,"enabled");function c(E){return E instanceof Error?E.stack||E.message:E}a(c,"coerce");function B(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return a(B,"destroy"),e.enable(e.load()),e}a(Qs,"setup");Qr.exports=Qs});var YA=tA((cA,e6)=>{"use strict";cA.formatArgs=Ns;cA.save=Js;cA.load=Zs;cA.useColors=Ws;cA.storage=Ys();cA.destroy=(()=>{let j=!1;return()=>{j||(j=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();cA.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Ws(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let j;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(j=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(j[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}a(Ws,"useColors");function Ns(j){if(j[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+j[0]+(this.useColors?"%c ":" ")+"+"+e6.exports.humanize(this.diff),!this.useColors)return;let A="color: "+this.color;j.splice(1,0,A,"color: inherit");let e=0,t=0;j[0].replace(/%[a-zA-Z%]/g,r=>{r!=="%%"&&(e++,r==="%c"&&(t=e))}),j.splice(t,0,A)}a(Ns,"formatArgs");cA.log=console.debug||console.log||(()=>{});function Js(j){try{j?cA.storage.setItem("debug",j):cA.storage.removeItem("debug")}catch{}}a(Js,"save");function Zs(){let j;try{j=cA.storage.getItem("debug")||cA.storage.getItem("DEBUG")}catch{}return!j&&typeof process<"u"&&"env"in process&&(j=process.env.DEBUG),j}a(Zs,"load");function Ys(){try{return localStorage}catch{}}a(Ys,"localstorage");e6.exports=Wr()(cA);var{formatters:Ac}=e6.exports;Ac.j=function(j){try{return JSON.stringify(j)}catch(A){return"[UnexpectedJSONParseError]: "+A.message}}});var Jr=tA((_E,dt)=>{"use strict";var jc=Object.prototype.hasOwnProperty,rA="~";function de(){}a(de,"Events");Object.create&&(de.prototype=Object.create(null),new de().__proto__||(rA=!1));function ec(j,A,e){this.fn=j,this.context=A,this.once=e||!1}a(ec,"EE");function Nr(j,A,e,t,r){if(typeof e!="function")throw new TypeError("The listener must be a function");var o=new ec(e,t||j,r),n=rA?rA+A:A;return j._events[n]?j._events[n].fn?j._events[n]=[j._events[n],o]:j._events[n].push(o):(j._events[n]=o,j._eventsCount++),j}a(Nr,"addListener");function t6(j,A){--j._eventsCount===0?j._events=new de:delete j._events[A]}a(t6,"clearEvent");function Z(){this._events=new de,this._eventsCount=0}a(Z,"EventEmitter");Z.prototype.eventNames=a(function(){var A=[],e,t;if(this._eventsCount===0)return A;for(t in e=this._events)jc.call(e,t)&&A.push(rA?t.slice(1):t);return Object.getOwnPropertySymbols?A.concat(Object.getOwnPropertySymbols(e)):A},"eventNames");Z.prototype.listeners=a(function(A){var e=rA?rA+A:A,t=this._events[e];if(!t)return[];if(t.fn)return[t.fn];for(var r=0,o=t.length,n=new Array(o);r<o;r++)n[r]=t[r].fn;return n},"listeners");Z.prototype.listenerCount=a(function(A){var e=rA?rA+A:A,t=this._events[e];return t?t.fn?1:t.length:0},"listenerCount");Z.prototype.emit=a(function(A,e,t,r,o,n){var s=rA?rA+A:A;if(!this._events[s])return!1;var c=this._events[s],B=arguments.length,E,l;if(c.fn){switch(c.once&&this.removeListener(A,c.fn,void 0,!0),B){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,e),!0;case 3:return c.fn.call(c.context,e,t),!0;case 4:return c.fn.call(c.context,e,t,r),!0;case 5:return c.fn.call(c.context,e,t,r,o),!0;case 6:return c.fn.call(c.context,e,t,r,o,n),!0}for(l=1,E=new Array(B-1);l<B;l++)E[l-1]=arguments[l];c.fn.apply(c.context,E)}else{var i=c.length,d;for(l=0;l<i;l++)switch(c[l].once&&this.removeListener(A,c[l].fn,void 0,!0),B){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,e);break;case 3:c[l].fn.call(c[l].context,e,t);break;case 4:c[l].fn.call(c[l].context,e,t,r);break;default:if(!E)for(d=1,E=new Array(B-1);d<B;d++)E[d-1]=arguments[d];c[l].fn.apply(c[l].context,E)}}return!0},"emit");Z.prototype.on=a(function(A,e,t){return Nr(this,A,e,t,!1)},"on");Z.prototype.once=a(function(A,e,t){return Nr(this,A,e,t,!0)},"once");Z.prototype.removeListener=a(function(A,e,t,r){var o=rA?rA+A:A;if(!this._events[o])return this;if(!e)return t6(this,o),this;var n=this._events[o];if(n.fn)n.fn===e&&(!r||n.once)&&(!t||n.context===t)&&t6(this,o);else{for(var s=0,c=[],B=n.length;s<B;s++)(n[s].fn!==e||r&&!n[s].once||t&&n[s].context!==t)&&c.push(n[s]);c.length?this._events[o]=c.length===1?c[0]:c:t6(this,o)}return this},"removeListener");Z.prototype.removeAllListeners=a(function(A){var e;return A?(e=rA?rA+A:A,this._events[e]&&t6(this,e)):(this._events=new de,this._eventsCount=0),this},"removeAllListeners");Z.prototype.off=Z.prototype.removeListener;Z.prototype.addListener=Z.prototype.on;Z.prefixed=rA;Z.EventEmitter=Z;typeof dt<"u"&&(dt.exports=Z)});var T7=tA(h6=>{"use strict";Object.defineProperty(h6,"__esModule",{value:!0});h6.crypto=void 0;h6.crypto=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0});var St=tA(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.wrapXOFConstructorWithOpts=y.wrapConstructorWithOpts=y.wrapConstructor=y.Hash=y.nextTick=y.swap32IfBE=y.byteSwapIfBE=y.swap8IfBE=y.isLE=void 0;y.isBytes=D7;y.anumber=Tt;y.abytes=Mj;y.ahash=ei;y.aexists=ti;y.aoutput=ri;y.u8=ai;y.u32=oi;y.clean=ni;y.createView=si;y.rotr=ci;y.rotl=ii;y.byteSwap=Dt;y.byteSwap32=P7;y.bytesToHex=Bi;y.hexToBytes=di;y.asyncLoop=fi;y.utf8ToBytes=Pt;y.bytesToUtf8=ui;y.toBytes=x6;y.kdfInputToBytes=hi;y.concatBytes=xi;y.checkOpts=mi;y.createHasher=C7;y.createOptHasher=M7;y.createXOFer=R7;y.randomBytes=Gi;var Cj=T7();function D7(j){return j instanceof Uint8Array||ArrayBuffer.isView(j)&&j.constructor.name==="Uint8Array"}a(D7,"isBytes");function Tt(j){if(!Number.isSafeInteger(j)||j<0)throw new Error("positive integer expected, got "+j)}a(Tt,"anumber");function Mj(j,...A){if(!D7(j))throw new Error("Uint8Array expected");if(A.length>0&&!A.includes(j.length))throw new Error("Uint8Array expected of length "+A+", got length="+j.length)}a(Mj,"abytes");function ei(j){if(typeof j!="function"||typeof j.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");Tt(j.outputLen),Tt(j.blockLen)}a(ei,"ahash");function ti(j,A=!0){if(j.destroyed)throw new Error("Hash instance has been destroyed");if(A&&j.finished)throw new Error("Hash#digest() has already been called")}a(ti,"aexists");function ri(j,A){Mj(j);let e=A.outputLen;if(j.length<e)throw new Error("digestInto() expects output buffer of length at least "+e)}a(ri,"aoutput");function ai(j){return new Uint8Array(j.buffer,j.byteOffset,j.byteLength)}a(ai,"u8");function oi(j){return new Uint32Array(j.buffer,j.byteOffset,Math.floor(j.byteLength/4))}a(oi,"u32");function ni(...j){for(let A=0;A<j.length;A++)j[A].fill(0)}a(ni,"clean");function si(j){return new DataView(j.buffer,j.byteOffset,j.byteLength)}a(si,"createView");function ci(j,A){return j<<32-A|j>>>A}a(ci,"rotr");function ii(j,A){return j<<A|j>>>32-A>>>0}a(ii,"rotl");y.isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function Dt(j){return j<<24&4278190080|j<<8&16711680|j>>>8&65280|j>>>24&255}a(Dt,"byteSwap");y.swap8IfBE=y.isLE?j=>j:j=>Dt(j);y.byteSwapIfBE=y.swap8IfBE;function P7(j){for(let A=0;A<j.length;A++)j[A]=Dt(j[A]);return j}a(P7,"byteSwap32");y.swap32IfBE=y.isLE?j=>j:P7;var S7=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",li=Array.from({length:256},(j,A)=>A.toString(16).padStart(2,"0"));function Bi(j){if(Mj(j),S7)return j.toHex();let A="";for(let e=0;e<j.length;e++)A+=li[j[e]];return A}a(Bi,"bytesToHex");var zA={_0:48,_9:57,A:65,F:70,a:97,f:102};function K7(j){if(j>=zA._0&&j<=zA._9)return j-zA._0;if(j>=zA.A&&j<=zA.F)return j-(zA.A-10);if(j>=zA.a&&j<=zA.f)return j-(zA.a-10)}a(K7,"asciiToBase16");function di(j){if(typeof j!="string")throw new Error("hex string expected, got "+typeof j);if(S7)return Uint8Array.fromHex(j);let A=j.length,e=A/2;if(A%2)throw new Error("hex string expected, got unpadded hex of length "+A);let t=new Uint8Array(e);for(let r=0,o=0;r<e;r++,o+=2){let n=K7(j.charCodeAt(o)),s=K7(j.charCodeAt(o+1));if(n===void 0||s===void 0){let c=j[o]+j[o+1];throw new Error('hex string expected, got non-hex character "'+c+'" at index '+o)}t[r]=n*16+s}return t}a(di,"hexToBytes");var Ei=a(async()=>{},"nextTick");y.nextTick=Ei;async function fi(j,A,e){let t=Date.now();for(let r=0;r<j;r++){e(r);let o=Date.now()-t;o>=0&&o<A||(await(0,y.nextTick)(),t+=o)}}a(fi,"asyncLoop");function Pt(j){if(typeof j!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(j))}a(Pt,"utf8ToBytes");function ui(j){return new TextDecoder().decode(j)}a(ui,"bytesToUtf8");function x6(j){return typeof j=="string"&&(j=Pt(j)),Mj(j),j}a(x6,"toBytes");function hi(j){return typeof j=="string"&&(j=Pt(j)),Mj(j),j}a(hi,"kdfInputToBytes");function xi(...j){let A=0;for(let t=0;t<j.length;t++){let r=j[t];Mj(r),A+=r.length}let e=new Uint8Array(A);for(let t=0,r=0;t<j.length;t++){let o=j[t];e.set(o,r),r+=o.length}return e}a(xi,"concatBytes");function mi(j,A){if(A!==void 0&&{}.toString.call(A)!=="[object Object]")throw new Error("options should be object or undefined");return Object.assign(j,A)}a(mi,"checkOpts");var Kt=class{static{a(this,"Hash")}};y.Hash=Kt;function C7(j){let A=a(t=>j().update(x6(t)).digest(),"hashC"),e=j();return A.outputLen=e.outputLen,A.blockLen=e.blockLen,A.create=()=>j(),A}a(C7,"createHasher");function M7(j){let A=a((t,r)=>j(r).update(x6(t)).digest(),"hashC"),e=j({});return A.outputLen=e.outputLen,A.blockLen=e.blockLen,A.create=t=>j(t),A}a(M7,"createOptHasher");function R7(j){let A=a((t,r)=>j(r).update(x6(t)).digest(),"hashC"),e=j({});return A.outputLen=e.outputLen,A.blockLen=e.blockLen,A.create=t=>j(t),A}a(R7,"createXOFer");y.wrapConstructor=C7;y.wrapConstructorWithOpts=M7;y.wrapXOFConstructorWithOpts=R7;function Gi(j=32){if(Cj.crypto&&typeof Cj.crypto.getRandomValues=="function")return Cj.crypto.getRandomValues(new Uint8Array(j));if(Cj.crypto&&typeof Cj.crypto.randomBytes=="function")return Uint8Array.from(Cj.crypto.randomBytes(j));throw new Error("crypto.getRandomValues must be defined")}a(Gi,"randomBytes")});var L7=tA(oA=>{"use strict";Object.defineProperty(oA,"__esModule",{value:!0});oA.SHA512_IV=oA.SHA384_IV=oA.SHA224_IV=oA.SHA256_IV=oA.HashMD=void 0;oA.setBigUint64=X7;oA.Chi=gi;oA.Maj=_i;var DA=St();function X7(j,A,e,t){if(typeof j.setBigUint64=="function")return j.setBigUint64(A,e,t);let r=BigInt(32),o=BigInt(4294967295),n=Number(e>>r&o),s=Number(e&o),c=t?4:0,B=t?0:4;j.setUint32(A+c,n,t),j.setUint32(A+B,s,t)}a(X7,"setBigUint64");function gi(j,A,e){return j&A^~j&e}a(gi,"Chi");function _i(j,A,e){return j&A^j&e^A&e}a(_i,"Maj");var Ct=class extends DA.Hash{static{a(this,"HashMD")}constructor(A,e,t,r){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=A,this.outputLen=e,this.padOffset=t,this.isLE=r,this.buffer=new Uint8Array(A),this.view=(0,DA.createView)(this.buffer)}update(A){(0,DA.aexists)(this),A=(0,DA.toBytes)(A),(0,DA.abytes)(A);let{view:e,buffer:t,blockLen:r}=this,o=A.length;for(let n=0;n<o;){let s=Math.min(r-this.pos,o-n);if(s===r){let c=(0,DA.createView)(A);for(;r<=o-n;n+=r)this.process(c,n);continue}t.set(A.subarray(n,n+s),this.pos),this.pos+=s,n+=s,this.pos===r&&(this.process(e,0),this.pos=0)}return this.length+=A.length,this.roundClean(),this}digestInto(A){(0,DA.aexists)(this),(0,DA.aoutput)(A,this),this.finished=!0;let{buffer:e,view:t,blockLen:r,isLE:o}=this,{pos:n}=this;e[n++]=128,(0,DA.clean)(this.buffer.subarray(n)),this.padOffset>r-n&&(this.process(t,0),n=0);for(let l=n;l<r;l++)e[l]=0;X7(t,r-8,BigInt(this.length*8),o),this.process(t,0);let s=(0,DA.createView)(A),c=this.outputLen;if(c%4)throw new Error("_sha2: outputLen should be aligned to 32bit");let B=c/4,E=this.get();if(B>E.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;l<B;l++)s.setUint32(4*l,E[l],o)}digest(){let{buffer:A,outputLen:e}=this;this.digestInto(A);let t=A.slice(0,e);return this.destroy(),t}_cloneInto(A){A||(A=new this.constructor),A.set(...this.get());let{blockLen:e,buffer:t,length:r,finished:o,destroyed:n,pos:s}=this;return A.destroyed=n,A.finished=o,A.length=r,A.pos=s,r%e&&A.buffer.set(t),A}clone(){return this._cloneInto()}};oA.HashMD=Ct;oA.SHA256_IV=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);oA.SHA224_IV=Uint32Array.from([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]);oA.SHA384_IV=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]);oA.SHA512_IV=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])});var Ba=tA(H=>{"use strict";Object.defineProperty(H,"__esModule",{value:!0});H.toBig=H.shrSL=H.shrSH=H.rotrSL=H.rotrSH=H.rotrBL=H.rotrBH=H.rotr32L=H.rotr32H=H.rotlSL=H.rotlSH=H.rotlBL=H.rotlBH=H.add5L=H.add5H=H.add4L=H.add4H=H.add3L=H.add3H=void 0;H.add=aa;H.fromBig=Rt;H.split=V7;var m6=BigInt(2**32-1),Mt=BigInt(32);function Rt(j,A=!1){return A?{h:Number(j&m6),l:Number(j>>Mt&m6)}:{h:Number(j>>Mt&m6)|0,l:Number(j&m6)|0}}a(Rt,"fromBig");function V7(j,A=!1){let e=j.length,t=new Uint32Array(e),r=new Uint32Array(e);for(let o=0;o<e;o++){let{h:n,l:s}=Rt(j[o],A);[t[o],r[o]]=[n,s]}return[t,r]}a(V7,"split");var z7=a((j,A)=>BigInt(j>>>0)<<Mt|BigInt(A>>>0),"toBig");H.toBig=z7;var U7=a((j,A,e)=>j>>>e,"shrSH");H.shrSH=U7;var Q7=a((j,A,e)=>j<<32-e|A>>>e,"shrSL");H.shrSL=Q7;var W7=a((j,A,e)=>j>>>e|A<<32-e,"rotrSH");H.rotrSH=W7;var N7=a((j,A,e)=>j<<32-e|A>>>e,"rotrSL");H.rotrSL=N7;var J7=a((j,A,e)=>j<<64-e|A>>>e-32,"rotrBH");H.rotrBH=J7;var Z7=a((j,A,e)=>j>>>e-32|A<<64-e,"rotrBL");H.rotrBL=Z7;var Y7=a((j,A)=>A,"rotr32H");H.rotr32H=Y7;var Aa=a((j,A)=>j,"rotr32L");H.rotr32L=Aa;var ja=a((j,A,e)=>j<<e|A>>>32-e,"rotlSH");H.rotlSH=ja;var ea=a((j,A,e)=>A<<e|j>>>32-e,"rotlSL");H.rotlSL=ea;var ta=a((j,A,e)=>A<<e-32|j>>>64-e,"rotlBH");H.rotlBH=ta;var ra=a((j,A,e)=>j<<e-32|A>>>64-e,"rotlBL");H.rotlBL=ra;function aa(j,A,e,t){let r=(A>>>0)+(t>>>0);return{h:j+e+(r/2**32|0)|0,l:r|0}}a(aa,"add");var oa=a((j,A,e)=>(j>>>0)+(A>>>0)+(e>>>0),"add3L");H.add3L=oa;var na=a((j,A,e,t)=>A+e+t+(j/2**32|0)|0,"add3H");H.add3H=na;var sa=a((j,A,e,t)=>(j>>>0)+(A>>>0)+(e>>>0)+(t>>>0),"add4L");H.add4L=sa;var ca=a((j,A,e,t,r)=>A+e+t+r+(j/2**32|0)|0,"add4H");H.add4H=ca;var ia=a((j,A,e,t,r)=>(j>>>0)+(A>>>0)+(e>>>0)+(t>>>0)+(r>>>0),"add5L");H.add5L=ia;var la=a((j,A,e,t,r,o)=>A+e+t+r+o+(j/2**32|0)|0,"add5H");H.add5H=la;var pi={fromBig:Rt,split:V7,toBig:z7,shrSH:U7,shrSL:Q7,rotrSH:W7,rotrSL:N7,rotrBH:J7,rotrBL:Z7,rotr32H:Y7,rotr32L:Aa,rotlSH:ja,rotlSL:ea,rotlBH:ta,rotlBL:ra,add:aa,add3L:oa,add3H:na,add4L:sa,add4H:ca,add5H:la,add5L:ia};H.default=pi});var Ea=tA(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.sha512_224=L.sha512_256=L.sha384=L.sha512=L.sha224=L.sha256=L.SHA512_256=L.SHA512_224=L.SHA384=L.SHA512=L.SHA224=L.SHA256=void 0;var q=L7(),K=Ba(),V=St(),bi=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),aj=new Uint32Array(64),_e=class extends q.HashMD{static{a(this,"SHA256")}constructor(A=32){super(64,A,8,!1),this.A=q.SHA256_IV[0]|0,this.B=q.SHA256_IV[1]|0,this.C=q.SHA256_IV[2]|0,this.D=q.SHA256_IV[3]|0,this.E=q.SHA256_IV[4]|0,this.F=q.SHA256_IV[5]|0,this.G=q.SHA256_IV[6]|0,this.H=q.SHA256_IV[7]|0}get(){let{A,B:e,C:t,D:r,E:o,F:n,G:s,H:c}=this;return[A,e,t,r,o,n,s,c]}set(A,e,t,r,o,n,s,c){this.A=A|0,this.B=e|0,this.C=t|0,this.D=r|0,this.E=o|0,this.F=n|0,this.G=s|0,this.H=c|0}process(A,e){for(let l=0;l<16;l++,e+=4)aj[l]=A.getUint32(e,!1);for(let l=16;l<64;l++){let i=aj[l-15],d=aj[l-2],f=(0,V.rotr)(i,7)^(0,V.rotr)(i,18)^i>>>3,m=(0,V.rotr)(d,17)^(0,V.rotr)(d,19)^d>>>10;aj[l]=m+aj[l-7]+f+aj[l-16]|0}let{A:t,B:r,C:o,D:n,E:s,F:c,G:B,H:E}=this;for(let l=0;l<64;l++){let i=(0,V.rotr)(s,6)^(0,V.rotr)(s,11)^(0,V.rotr)(s,25),d=E+i+(0,q.Chi)(s,c,B)+bi[l]+aj[l]|0,m=((0,V.rotr)(t,2)^(0,V.rotr)(t,13)^(0,V.rotr)(t,22))+(0,q.Maj)(t,r,o)|0;E=B,B=c,c=s,s=n+d|0,n=o,o=r,r=t,t=d+m|0}t=t+this.A|0,r=r+this.B|0,o=o+this.C|0,n=n+this.D|0,s=s+this.E|0,c=c+this.F|0,B=B+this.G|0,E=E+this.H|0,this.set(t,r,o,n,s,c,B,E)}roundClean(){(0,V.clean)(aj)}destroy(){this.set(0,0,0,0,0,0,0,0),(0,V.clean)(this.buffer)}};L.SHA256=_e;var G6=class extends _e{static{a(this,"SHA224")}constructor(){super(28),this.A=q.SHA224_IV[0]|0,this.B=q.SHA224_IV[1]|0,this.C=q.SHA224_IV[2]|0,this.D=q.SHA224_IV[3]|0,this.E=q.SHA224_IV[4]|0,this.F=q.SHA224_IV[5]|0,this.G=q.SHA224_IV[6]|0,this.H=q.SHA224_IV[7]|0}};L.SHA224=G6;var da=K.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(j=>BigInt(j))),$i=da[0],Fi=da[1],oj=new Uint32Array(80),nj=new Uint32Array(80),bj=class extends q.HashMD{static{a(this,"SHA512")}constructor(A=64){super(128,A,16,!1),this.Ah=q.SHA512_IV[0]|0,this.Al=q.SHA512_IV[1]|0,this.Bh=q.SHA512_IV[2]|0,this.Bl=q.SHA512_IV[3]|0,this.Ch=q.SHA512_IV[4]|0,this.Cl=q.SHA512_IV[5]|0,this.Dh=q.SHA512_IV[6]|0,this.Dl=q.SHA512_IV[7]|0,this.Eh=q.SHA512_IV[8]|0,this.El=q.SHA512_IV[9]|0,this.Fh=q.SHA512_IV[10]|0,this.Fl=q.SHA512_IV[11]|0,this.Gh=q.SHA512_IV[12]|0,this.Gl=q.SHA512_IV[13]|0,this.Hh=q.SHA512_IV[14]|0,this.Hl=q.SHA512_IV[15]|0}get(){let{Ah:A,Al:e,Bh:t,Bl:r,Ch:o,Cl:n,Dh:s,Dl:c,Eh:B,El:E,Fh:l,Fl:i,Gh:d,Gl:f,Hh:m,Hl:_}=this;return[A,e,t,r,o,n,s,c,B,E,l,i,d,f,m,_]}set(A,e,t,r,o,n,s,c,B,E,l,i,d,f,m,_){this.Ah=A|0,this.Al=e|0,this.Bh=t|0,this.Bl=r|0,this.Ch=o|0,this.Cl=n|0,this.Dh=s|0,this.Dl=c|0,this.Eh=B|0,this.El=E|0,this.Fh=l|0,this.Fl=i|0,this.Gh=d|0,this.Gl=f|0,this.Hh=m|0,this.Hl=_|0}process(A,e){for(let k=0;k<16;k++,e+=4)oj[k]=A.getUint32(e),nj[k]=A.getUint32(e+=4);for(let k=16;k<80;k++){let v=oj[k-15]|0,T=nj[k-15]|0,M=K.rotrSH(v,T,1)^K.rotrSH(v,T,8)^K.shrSH(v,T,7),D=K.rotrSL(v,T,1)^K.rotrSL(v,T,8)^K.shrSL(v,T,7),P=oj[k-2]|0,S=nj[k-2]|0,yA=K.rotrSH(P,S,19)^K.rotrBH(P,S,61)^K.shrSH(P,S,6),MA=K.rotrSL(P,S,19)^K.rotrBL(P,S,61)^K.shrSL(P,S,6),RA=K.add4L(D,MA,nj[k-7],nj[k-16]),et=K.add4H(RA,M,yA,oj[k-7],oj[k-16]);oj[k]=et|0,nj[k]=RA|0}let{Ah:t,Al:r,Bh:o,Bl:n,Ch:s,Cl:c,Dh:B,Dl:E,Eh:l,El:i,Fh:d,Fl:f,Gh:m,Gl:_,Hh:I,Hl:F}=this;for(let k=0;k<80;k++){let v=K.rotrSH(l,i,14)^K.rotrSH(l,i,18)^K.rotrBH(l,i,41),T=K.rotrSL(l,i,14)^K.rotrSL(l,i,18)^K.rotrBL(l,i,41),M=l&d^~l&m,D=i&f^~i&_,P=K.add5L(F,T,D,Fi[k],nj[k]),S=K.add5H(P,I,v,M,$i[k],oj[k]),yA=P|0,MA=K.rotrSH(t,r,28)^K.rotrBH(t,r,34)^K.rotrBH(t,r,39),RA=K.rotrSL(t,r,28)^K.rotrBL(t,r,34)^K.rotrBL(t,r,39),et=t&o^t&s^o&s,sn=r&n^r&c^n&c;I=m|0,F=_|0,m=d|0,_=f|0,d=l|0,f=i|0,{h:l,l:i}=K.add(B|0,E|0,S|0,yA|0),B=s|0,E=c|0,s=o|0,c=n|0,o=t|0,n=r|0;let mr=K.add3L(yA,RA,sn);t=K.add3H(mr,S,MA,et),r=mr|0}({h:t,l:r}=K.add(this.Ah|0,this.Al|0,t|0,r|0)),{h:o,l:n}=K.add(this.Bh|0,this.Bl|0,o|0,n|0),{h:s,l:c}=K.add(this.Ch|0,this.Cl|0,s|0,c|0),{h:B,l:E}=K.add(this.Dh|0,this.Dl|0,B|0,E|0),{h:l,l:i}=K.add(this.Eh|0,this.El|0,l|0,i|0),{h:d,l:f}=K.add(this.Fh|0,this.Fl|0,d|0,f|0),{h:m,l:_}=K.add(this.Gh|0,this.Gl|0,m|0,_|0),{h:I,l:F}=K.add(this.Hh|0,this.Hl|0,I|0,F|0),this.set(t,r,o,n,s,c,B,E,l,i,d,f,m,_,I,F)}roundClean(){(0,V.clean)(oj,nj)}destroy(){(0,V.clean)(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};L.SHA512=bj;var g6=class extends bj{static{a(this,"SHA384")}constructor(){super(48),this.Ah=q.SHA384_IV[0]|0,this.Al=q.SHA384_IV[1]|0,this.Bh=q.SHA384_IV[2]|0,this.Bl=q.SHA384_IV[3]|0,this.Ch=q.SHA384_IV[4]|0,this.Cl=q.SHA384_IV[5]|0,this.Dh=q.SHA384_IV[6]|0,this.Dl=q.SHA384_IV[7]|0,this.Eh=q.SHA384_IV[8]|0,this.El=q.SHA384_IV[9]|0,this.Fh=q.SHA384_IV[10]|0,this.Fl=q.SHA384_IV[11]|0,this.Gh=q.SHA384_IV[12]|0,this.Gl=q.SHA384_IV[13]|0,this.Hh=q.SHA384_IV[14]|0,this.Hl=q.SHA384_IV[15]|0}};L.SHA384=g6;var AA=Uint32Array.from([2352822216,424955298,1944164710,2312950998,502970286,855612546,1738396948,1479516111,258812777,2077511080,2011393907,79989058,1067287976,1780299464,286451373,2446758561]),jA=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]),_6=class extends bj{static{a(this,"SHA512_224")}constructor(){super(28),this.Ah=AA[0]|0,this.Al=AA[1]|0,this.Bh=AA[2]|0,this.Bl=AA[3]|0,this.Ch=AA[4]|0,this.Cl=AA[5]|0,this.Dh=AA[6]|0,this.Dl=AA[7]|0,this.Eh=AA[8]|0,this.El=AA[9]|0,this.Fh=AA[10]|0,this.Fl=AA[11]|0,this.Gh=AA[12]|0,this.Gl=AA[13]|0,this.Hh=AA[14]|0,this.Hl=AA[15]|0}};L.SHA512_224=_6;var p6=class extends bj{static{a(this,"SHA512_256")}constructor(){super(32),this.Ah=jA[0]|0,this.Al=jA[1]|0,this.Bh=jA[2]|0,this.Bl=jA[3]|0,this.Ch=jA[4]|0,this.Cl=jA[5]|0,this.Dh=jA[6]|0,this.Dl=jA[7]|0,this.Eh=jA[8]|0,this.El=jA[9]|0,this.Fh=jA[10]|0,this.Fl=jA[11]|0,this.Gh=jA[12]|0,this.Gl=jA[13]|0,this.Hh=jA[14]|0,this.Hl=jA[15]|0}};L.SHA512_256=p6;L.sha256=(0,V.createHasher)(()=>new _e);L.sha224=(0,V.createHasher)(()=>new G6);L.sha512=(0,V.createHasher)(()=>new bj);L.sha384=(0,V.createHasher)(()=>new g6);L.sha512_256=(0,V.createHasher)(()=>new p6);L.sha512_224=(0,V.createHasher)(()=>new _6)});var fa=tA(PA=>{"use strict";Object.defineProperty(PA,"__esModule",{value:!0});PA.sha224=PA.SHA224=PA.sha256=PA.SHA256=void 0;var b6=Ea();PA.SHA256=b6.SHA256;PA.sha256=b6.sha256;PA.SHA224=b6.SHA224;PA.sha224=b6.sha224});var ha=tA((Cf,ua)=>{"use strict";function Ii(j){if(j.length>=255)throw new TypeError("Alphabet too long");for(var A=new Uint8Array(256),e=0;e<A.length;e++)A[e]=255;for(var t=0;t<j.length;t++){var r=j.charAt(t),o=r.charCodeAt(0);if(A[o]!==255)throw new TypeError(r+" is ambiguous");A[o]=t}var n=j.length,s=j.charAt(0),c=Math.log(n)/Math.log(256),B=Math.log(256)/Math.log(n);function E(d){if(d instanceof Uint8Array||(ArrayBuffer.isView(d)?d=new Uint8Array(d.buffer,d.byteOffset,d.byteLength):Array.isArray(d)&&(d=Uint8Array.from(d))),!(d instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(d.length===0)return"";for(var f=0,m=0,_=0,I=d.length;_!==I&&d[_]===0;)_++,f++;for(var F=(I-_)*B+1>>>0,k=new Uint8Array(F);_!==I;){for(var v=d[_],T=0,M=F-1;(v!==0||T<m)&&M!==-1;M--,T++)v+=256*k[M]>>>0,k[M]=v%n>>>0,v=v/n>>>0;if(v!==0)throw new Error("Non-zero carry");m=T,_++}for(var D=F-m;D!==F&&k[D]===0;)D++;for(var P=s.repeat(f);D<F;++D)P+=j.charAt(k[D]);return P}a(E,"encode");function l(d){if(typeof d!="string")throw new TypeError("Expected String");if(d.length===0)return new Uint8Array;for(var f=0,m=0,_=0;d[f]===s;)m++,f++;for(var I=(d.length-f)*c+1>>>0,F=new Uint8Array(I);d[f];){var k=d.charCodeAt(f);if(k>255)return;var v=A[k];if(v===255)return;for(var T=0,M=I-1;(v!==0||T<_)&&M!==-1;M--,T++)v+=n*F[M]>>>0,F[M]=v%256>>>0,v=v/256>>>0;if(v!==0)throw new Error("Non-zero carry");_=T,f++}for(var D=I-_;D!==I&&F[D]===0;)D++;for(var P=new Uint8Array(m+(I-D)),S=m;D!==I;)P[S++]=F[D++];return P}a(l,"decodeUnsafe");function i(d){var f=l(d);if(f)return f;throw new Error("Non-base"+n+" character")}return a(i,"decode"),{encode:E,decodeUnsafe:l,decode:i}}a(Ii,"base");ua.exports=Ii});var ma=tA((Rf,xa)=>{"use strict";var ki=ha(),qi="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";xa.exports=ki(qi)});var ga=tA((Xf,Ga)=>{"use strict";var Xt=ma();Ga.exports=function(j){function A(o){var n=Uint8Array.from(o),s=j(n),c=n.length+4,B=new Uint8Array(c);return B.set(n,0),B.set(s.subarray(0,4),n.length),Xt.encode(B,c)}a(A,"encode");function e(o){var n=o.slice(0,-4),s=o.slice(-4),c=j(n);if(!(s[0]^c[0]|s[1]^c[1]|s[2]^c[2]|s[3]^c[3]))return n}a(e,"decodeRaw");function t(o){var n=Xt.decodeUnsafe(o);if(n)return e(n)}a(t,"decodeUnsafe");function r(o){var n=Xt.decode(o),s=e(n,j);if(!s)throw new Error("Invalid checksum");return s}return a(r,"decode"),{encode:A,decode:r,decodeUnsafe:t}}});var ba=tA((Vf,pa)=>{"use strict";var{sha256:_a}=fa(),wi=ga();function yi(j){return _a(_a(j))}a(yi,"sha256x2");pa.exports=wi(yi)});var Ro=tA((Mo,L6)=>{"use strict";(function(j,A){var e={};A(e);var t=e.default;for(var r in e)t[r]=e[r];typeof L6=="object"&&typeof L6.exports=="object"?L6.exports=t:typeof define=="function"&&define.amd?define(function(){return t}):j.sha256=t})(Mo,function(j){"use strict";j.__esModule=!0,j.digestLength=32,j.blockSize=64;var A=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function e(l,i,d,f,m){for(var _,I,F,k,v,T,M,D,P,S,yA,MA,RA;m>=64;){for(_=i[0],I=i[1],F=i[2],k=i[3],v=i[4],T=i[5],M=i[6],D=i[7],S=0;S<16;S++)yA=f+S*4,l[S]=(d[yA]&255)<<24|(d[yA+1]&255)<<16|(d[yA+2]&255)<<8|d[yA+3]&255;for(S=16;S<64;S++)P=l[S-2],MA=(P>>>17|P<<15)^(P>>>19|P<<13)^P>>>10,P=l[S-15],RA=(P>>>7|P<<25)^(P>>>18|P<<14)^P>>>3,l[S]=(MA+l[S-7]|0)+(RA+l[S-16]|0);for(S=0;S<64;S++)MA=(((v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7))+(v&T^~v&M)|0)+(D+(A[S]+l[S]|0)|0)|0,RA=((_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10))+(_&I^_&F^I&F)|0,D=M,M=T,T=v,v=k+MA|0,k=F,F=I,I=_,_=MA+RA|0;i[0]+=_,i[1]+=I,i[2]+=F,i[3]+=k,i[4]+=v,i[5]+=T,i[6]+=M,i[7]+=D,f+=64,m-=64}return f}a(e,"hashBlocks");var t=(function(){function l(){this.digestLength=j.digestLength,this.blockSize=j.blockSize,this.state=new Int32Array(8),this.temp=new Int32Array(64),this.buffer=new Uint8Array(128),this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this.reset()}return a(l,"Hash"),l.prototype.reset=function(){return this.state[0]=1779033703,this.state[1]=3144134277,this.state[2]=1013904242,this.state[3]=2773480762,this.state[4]=1359893119,this.state[5]=2600822924,this.state[6]=528734635,this.state[7]=1541459225,this.bufferLength=0,this.bytesHashed=0,this.finished=!1,this},l.prototype.clean=function(){for(var i=0;i<this.buffer.length;i++)this.buffer[i]=0;for(var i=0;i<this.temp.length;i++)this.temp[i]=0;this.reset()},l.prototype.update=function(i,d){if(d===void 0&&(d=i.length),this.finished)throw new Error("SHA256: can't update because hash was finished.");var f=0;if(this.bytesHashed+=d,this.bufferLength>0){for(;this.bufferLength<64&&d>0;)this.buffer[this.bufferLength++]=i[f++],d--;this.bufferLength===64&&(e(this.temp,this.state,this.buffer,0,64),this.bufferLength=0)}for(d>=64&&(f=e(this.temp,this.state,i,f,d),d%=64);d>0;)this.buffer[this.bufferLength++]=i[f++],d--;return this},l.prototype.finish=function(i){if(!this.finished){var d=this.bytesHashed,f=this.bufferLength,m=d/536870912|0,_=d<<3,I=d%64<56?64:128;this.buffer[f]=128;for(var F=f+1;F<I-8;F++)this.buffer[F]=0;this.buffer[I-8]=m>>>24&255,this.buffer[I-7]=m>>>16&255,this.buffer[I-6]=m>>>8&255,this.buffer[I-5]=m>>>0&255,this.buffer[I-4]=_>>>24&255,this.buffer[I-3]=_>>>16&255,this.buffer[I-2]=_>>>8&255,this.buffer[I-1]=_>>>0&255,e(this.temp,this.state,this.buffer,0,I),this.finished=!0}for(var F=0;F<8;F++)i[F*4+0]=this.state[F]>>>24&255,i[F*4+1]=this.state[F]>>>16&255,i[F*4+2]=this.state[F]>>>8&255,i[F*4+3]=this.state[F]>>>0&255;return this},l.prototype.digest=function(){var i=new Uint8Array(this.digestLength);return this.finish(i),i},l.prototype._saveState=function(i){for(var d=0;d<this.state.length;d++)i[d]=this.state[d]},l.prototype._restoreState=function(i,d){for(var f=0;f<this.state.length;f++)this.state[f]=i[f];this.bytesHashed=d,this.finished=!1,this.bufferLength=0},l})();j.Hash=t;var r=(function(){function l(i){this.inner=new t,this.outer=new t,this.blockSize=this.inner.blockSize,this.digestLength=this.inner.digestLength;var d=new Uint8Array(this.blockSize);if(i.length>this.blockSize)new t().update(i).finish(d).clean();else for(var f=0;f<i.length;f++)d[f]=i[f];for(var f=0;f<d.length;f++)d[f]^=54;this.inner.update(d);for(var f=0;f<d.length;f++)d[f]^=106;this.outer.update(d),this.istate=new Uint32Array(8),this.ostate=new Uint32Array(8),this.inner._saveState(this.istate),this.outer._saveState(this.ostate);for(var f=0;f<d.length;f++)d[f]=0}return a(l,"HMAC"),l.prototype.reset=function(){return this.inner._restoreState(this.istate,this.inner.blockSize),this.outer._restoreState(this.ostate,this.outer.blockSize),this},l.prototype.clean=function(){for(var i=0;i<this.istate.length;i++)this.ostate[i]=this.istate[i]=0;this.inner.clean(),this.outer.clean()},l.prototype.update=function(i){return this.inner.update(i),this},l.prototype.finish=function(i){return this.outer.finished?this.outer.finish(i):(this.inner.finish(i),this.outer.update(i,this.digestLength).finish(i)),this},l.prototype.digest=function(){var i=new Uint8Array(this.digestLength);return this.finish(i),i},l})();j.HMAC=r;function o(l){var i=new t().update(l),d=i.digest();return i.clean(),d}a(o,"hash"),j.hash=o,j.default=o;function n(l,i){var d=new r(l).update(i),f=d.digest();return d.clean(),f}a(n,"hmac"),j.hmac=n;function s(l,i,d,f){var m=f[0];if(m===0)throw new Error("hkdf: cannot expand more");i.reset(),m>1&&i.update(l),d&&i.update(d),i.update(f),i.finish(l),f[0]++}a(s,"fillBuffer");var c=new Uint8Array(j.digestLength);function B(l,i,d,f){i===void 0&&(i=c),f===void 0&&(f=32);for(var m=new Uint8Array([1]),_=n(i,l),I=new r(_),F=new Uint8Array(I.digestLength),k=F.length,v=new Uint8Array(f),T=0;T<f;T++)k===F.length&&(s(F,I,d,m),k=0),v[T]=F[k++];return I.clean(),F.fill(0),m.fill(0),v}a(B,"hkdf"),j.hkdf=B;function E(l,i,d,f){for(var m=new r(l),_=m.digestLength,I=new Uint8Array(4),F=new Uint8Array(_),k=new Uint8Array(_),v=new Uint8Array(f),T=0;T*_<f;T++){var M=T+1;I[0]=M>>>24&255,I[1]=M>>>16&255,I[2]=M>>>8&255,I[3]=M>>>0&255,m.reset(),m.update(i),m.update(I),m.finish(k);for(var D=0;D<_;D++)F[D]=k[D];for(var D=2;D<=d;D++){m.reset(),m.update(k).finish(k);for(var P=0;P<_;P++)F[P]^=k[P]}for(var D=0;D<_&&T*_+D<f;D++)v[T*_+D]=F[D]}for(var T=0;T<_;T++)F[T]=k[T]=0;for(var T=0;T<4;T++)I[T]=0;return m.clean(),v}a(E,"pbkdf2"),j.pbkdf2=E})});var b={};Me(b,{Counter:()=>uA,Float64:()=>oe,ImmutableString:()=>OA,Int:()=>re,RawString:()=>Rs,Uint:()=>ae,applyChanges:()=>Rr,applyPatch:()=>ct,applyPatches:()=>Tr,block:()=>vs,change:()=>Yn,changeAt:()=>As,clone:()=>Nn,decodeChange:()=>Xr,decodeSyncMessage:()=>gs,decodeSyncState:()=>Es,deleteAt:()=>Ln,diff:()=>ls,dump:()=>ps,emptyChange:()=>js,encodeChange:()=>ms,encodeSyncMessage:()=>Gs,encodeSyncState:()=>ds,equals:()=>Ye,free:()=>Jn,from:()=>Zn,generateSyncMessage:()=>fs,getActorId:()=>os,getAllChanges:()=>Mr,getBackend:()=>zn,getChanges:()=>cs,getChangesMetaSince:()=>Qn,getChangesSince:()=>Un,getConflicts:()=>ns,getCursor:()=>Ds,getCursorPosition:()=>Ps,getHeads:()=>Lr,getHistory:()=>is,getLastLocalChange:()=>ss,getMissingDeps:()=>_s,getObjectId:()=>Cr,hasHeads:()=>Fs,hasOurChanges:()=>hs,init:()=>A6,initSyncState:()=>xs,initializeBase64Wasm:()=>vr,initializeWasm:()=>st,insertAt:()=>Xn,inspectChange:()=>ks,isAutomerge:()=>mj,isCounter:()=>Qe,isImmutableString:()=>qj,isRawString:()=>Ms,isWasmInitialized:()=>Hr,joinBlock:()=>Hs,load:()=>es,loadIncremental:()=>Sr,mark:()=>it,marks:()=>Ss,marksAt:()=>Cs,merge:()=>as,receiveSyncMessage:()=>us,save:()=>rs,saveIncremental:()=>ts,saveSince:()=>$s,spans:()=>ys,splice:()=>Je,splitBlock:()=>Os,stats:()=>qs,toJS:()=>bs,topoHistoryTraversal:()=>Is,unmark:()=>lt,updateBlock:()=>Ts,updateSpans:()=>Ks,updateText:()=>ws,use:()=>Vn,view:()=>Wn,wasmInitialized:()=>Or});var ZA=Symbol.for("_am_meta"),dj=Symbol.for("_am_trace"),Ej=Symbol.for("_am_objectId"),je=Symbol.for("_am_isProxy"),ee=Symbol.for("_am_clearCache"),Re=Symbol.for("_am_uint"),Xe=Symbol.for("_am_int"),Le=Symbol.for("_am_f64"),te=Symbol.for("_am_counter"),md=Symbol.for("_am_text"),Ve=Symbol.for("_am_immutableString");var uA=class{static{a(this,"Counter")}constructor(A){this.value=A||0,Reflect.defineProperty(this,te,{value:!0})}valueOf(){return this.value}toString(){return this.valueOf().toString()}toJSON(){return this.value}increment(A){throw new Error("Counters should not be incremented outside of a change callback")}decrement(A){throw new Error("Counters should not be decremented outside of a change callback")}},tt=class extends uA{static{a(this,"WriteableCounter")}constructor(A,e,t,r,o){super(A),this.context=e,this.path=t,this.objectId=r,this.key=o}increment(A){return A=typeof A=="number"?A:1,this.context.increment(this.objectId,this.key,A),this.value+=A,this.value}decrement(A){return this.increment(typeof A=="number"?-A:-1)}};function gr(j,A,e,t,r){return new tt(j,A,e,t,r)}a(gr,"getWriteableCounter");var _r,OA=class{static{a(this,"ImmutableString")}constructor(A){this[_r]=!0,this.val=A}toString(){return this.val}toJSON(){return this.val}};_r=Ve;function XA(j){if(typeof j=="string"&&/^[0-9]+$/.test(j)&&(j=parseInt(j,10)),typeof j!="number")return j;if(j<0||isNaN(j)||j===1/0||j===-1/0)throw new RangeError("A list index must be positive, but you passed "+j);return j}a(XA,"parseListIndex");function lA(j,A){let{context:e,objectId:t,path:r}=j,o=e.getWithType(t,A);if(o===null)return;let n=o[0],s=o[1];switch(n){case void 0:return;case"map":return fj(e,s,[...r,A]);case"list":return kj(e,s,[...r,A]);case"text":return e.text(s);case"str":return new OA(s);case"uint":return s;case"int":return s;case"f64":return s;case"boolean":return s;case"null":return null;case"bytes":return s;case"timestamp":return s;case"counter":return gr(s,e,r,t,A);default:throw RangeError(`datatype ${n} unimplemented`)}}a(lA,"valueAt");function ze(j,A,e){let t=typeof j;switch(t){case"object":if(j==null)return[null,"null"];if(j[Re])return[j.value,"uint"];if(j[Xe])return[j.value,"int"];if(j[Le])return[j.value,"f64"];if(j[te])return[j.value,"counter"];if(j instanceof Date)return[j.getTime(),"timestamp"];if(qj(j))return[j.toString(),"str"];if(j instanceof Uint8Array)return[j,"bytes"];if(j instanceof Array)return[j,"list"];if(Object.prototype.toString.call(j)==="[object Object]")return[j,"map"];throw Ue(j,e)?new RangeError("Cannot create a reference to an existing document object"):new RangeError(`Cannot assign unknown object: ${j}`);case"boolean":return[j,"boolean"];case"number":return Number.isInteger(j)?[j,"int"]:[j,"f64"];case"string":return[j,"text"];case"undefined":throw new RangeError([`Cannot assign undefined value at ${pr(A)}, `,"because `undefined` is not a valid JSON data type. ","You might consider setting the property's value to `null`, ","or using `delete` to remove it altogether."].join(""));default:throw new RangeError([`Cannot assign ${t} value at ${pr(A)}. `,"All JSON primitive datatypes (object, array, string, number, boolean, null) ",`are supported in an Automerge document; ${t} values are not. `].join(""))}}a(ze,"import_value");function Ue(j,A){var e,t;return j instanceof Date?!1:!!(j&&((t=(e=j[ZA])===null||e===void 0?void 0:e.handle)===null||t===void 0?void 0:t.__wbg_ptr)===A.__wbg_ptr)}a(Ue,"isSameDocument");var un={get(j,A){let{context:e,objectId:t,cache:r}=j;return A===Symbol.toStringTag?j[Symbol.toStringTag]:A===Ej?t:A===je?!0:A===dj?j.trace:A===ZA?{handle:e}:(r[A]||(r[A]=lA(j,A)),r[A])},set(j,A,e){let{context:t,objectId:r,path:o}=j;if(j.cache={},Ue(e,t))throw new RangeError("Cannot create a reference to an existing document object");if(A===dj)return j.trace=e,!0;if(A===ee)return!0;let[n,s]=ze(e,[...o,A],t);switch(s){case"list":{let c=t.putObject(r,A,[]),B=kj(t,c,[...o,A]);for(let E=0;E<n.length;E++)B[E]=n[E];break}case"text":{t.putObject(r,A,n);break}case"map":{let c=t.putObject(r,A,{}),B=fj(t,c,[...o,A]);for(let E in n)B[E]=n[E];break}default:t.put(r,A,n,s)}return!0},deleteProperty(j,A){let{context:e,objectId:t}=j;return j.cache={},e.delete(t,A),!0},has(j,A){return this.get(j,A)!==void 0},getOwnPropertyDescriptor(j,A){let e=this.get(j,A);if(typeof e<"u")return{configurable:!0,enumerable:!0,value:e}},ownKeys(j){let{context:A,objectId:e}=j,t=A.keys(e);return[...new Set(t)]}},hn={get(j,A){let{context:e,objectId:t}=j;return A=XA(A),A===Symbol.hasInstance?r=>Array.isArray(r):A===Symbol.toStringTag?j[Symbol.toStringTag]:A===Ej?t:A===je?!0:A===dj?j.trace:A===ZA?{handle:e}:A==="length"?e.length(t):typeof A=="number"?lA(j,A):xn(j)[A]},set(j,A,e){let{context:t,objectId:r,path:o}=j;if(A=XA(A),Ue(e,t))throw new RangeError("Cannot create a reference to an existing document object");if(A===ee)return!0;if(A===dj)return j.trace=e,!0;if(typeof A=="string")throw new RangeError("list index must be a number");let[n,s]=ze(e,[...o,A],t);switch(s){case"list":{let c;A>=t.length(r)?c=t.insertObject(r,A,[]):c=t.putObject(r,A,[]),kj(t,c,[...o,A]).splice(0,0,...n);break}case"text":{A>=t.length(r)?t.insertObject(r,A,n):t.putObject(r,A,n);break}case"map":{let c;A>=t.length(r)?c=t.insertObject(r,A,{}):c=t.putObject(r,A,{});let B=fj(t,c,[...o,A]);for(let E in n)B[E]=n[E];break}default:A>=t.length(r)?t.insert(r,A,n,s):t.put(r,A,n,s)}return!0},deleteProperty(j,A){let{context:e,objectId:t}=j;A=XA(A);let r=e.get(t,A);if(r!=null&&r[0]=="counter")throw new TypeError("Unsupported operation: deleting a counter from a list");return e.delete(t,A),!0},has(j,A){let{context:e,objectId:t}=j;return A=XA(A),typeof A=="number"?A<e.length(t):A==="length"},getOwnPropertyDescriptor(j,A){let{context:e,objectId:t}=j;return A==="length"?{writable:!0,value:e.length(t)}:A===Ej?{configurable:!1,enumerable:!1,value:t}:(A=XA(A),{configurable:!0,enumerable:!0,value:lA(j,A)})},getPrototypeOf(j){return Object.getPrototypeOf(j)},ownKeys(){let j=[];return j.push("length"),j}};function fj(j,A,e){let t={context:j,objectId:A,path:e||[],cache:{}},r={};return Object.assign(r,t),new Proxy(r,un)}a(fj,"mapProxy");function kj(j,A,e){let t={context:j,objectId:A,path:e||[],cache:{}},r=[];return Object.assign(r,t),new Proxy(r,hn)}a(kj,"listProxy");function br(j){return fj(j,"_root",[])}a(br,"rootProxy");function xn(j){let{context:A,objectId:e,path:t}=j;return{at(o){return lA(j,o)},deleteAt(o,n){return typeof n=="number"?A.splice(e,o,n):A.delete(e,o),this},fill(o,n,s){let[c,B]=ze(o,[...t,n],A),E=A.length(e);n=XA(n||0),s=XA(s||E);for(let l=n;l<Math.min(s,E);l++)B==="list"||B==="map"||B==="text"?A.putObject(e,l,c):A.put(e,l,c,B);return this},indexOf(o,n=0){let s=A.length(e);for(let c=n;c<s;c++){let B=A.getWithType(e,c);if(!B)continue;let[E,l]=B;if(!["map","list","text"].includes(E)){if(l===o)return c;continue}if(E==="text"&&typeof o=="string"&&o===lA(j,c)||o[Ej]===l)return c}return-1},insertAt(o,...n){return this.splice(o,0,...n),this},pop(){let o=A.length(e);if(o==0)return;let n=lA(j,o-1);return A.delete(e,o-1),n},push(...o){let n=A.length(e);return this.splice(n,0,...o),A.length(e)},shift(){if(A.length(e)==0)return;let o=lA(j,0);return A.delete(e,0),o},splice(o,n,...s){o=XA(o),typeof n!="number"&&(n=A.length(e)-o),n=XA(n);for(let E of s)if(Ue(E,A))throw new RangeError("Cannot create a reference to an existing document object");let c=[];for(let E=0;E<n;E++){let l=lA(j,o);l!==void 0&&c.push(l),A.delete(e,o)}let B=s.map((E,l)=>{try{return ze(E,[...t],A)}catch(i){throw i instanceof RangeError?new RangeError(`${i.message} (at index ${l} in the input)`):i}});for(let[E,l]of B){switch(l){case"list":{let i=A.insertObject(e,o,[]);kj(A,i,[...t,o]).splice(0,0,...E);break}case"text":{A.insertObject(e,o,E);break}case"map":{let i=A.insertObject(e,o,{}),d=fj(A,i,[...t,o]);for(let f in E)d[f]=E[f];break}default:A.insert(e,o,E,l)}o+=1}return c},unshift(...o){return this.splice(0,0,...o),A.length(e)},entries(){let o=0;return{next:a(()=>{let s=lA(j,o);return s===void 0?{value:void 0,done:!0}:{value:[o++,s],done:!1}},"next"),[Symbol.iterator](){return this}}},keys(){let o=0,n=A.length(e);return{next:a(()=>o<n?{value:o++,done:!1}:{value:void 0,done:!0},"next"),[Symbol.iterator](){return this}}},values(){let o=0;return{next:a(()=>{let s=lA(j,o++);return s===void 0?{value:void 0,done:!0}:{value:s,done:!1}},"next"),[Symbol.iterator](){return this}}},toArray(){let o=[],n;do n=lA(j,o.length),n!==void 0&&o.push(n);while(n!==void 0);return o},map(o){return this.toArray().map(o)},toString(){return this.toArray().toString()},toLocaleString(){return this.toArray().toLocaleString()},forEach(o){return this.toArray().forEach(o)},concat(o){return this.toArray().concat(o)},every(o){return this.toArray().every(o)},filter(o){return this.toArray().filter(o)},find(o){let n=0;for(let s of this){if(o(s,n))return s;n+=1}},findIndex(o){let n=0;for(let s of this){if(o(s,n))return n;n+=1}return-1},includes(o){return this.find(n=>n===o)!==void 0},join(o){return this.toArray().join(o)},reduce(o,n){return this.toArray().reduce(o,n)},reduceRight(o,n){return this.toArray().reduceRight(o,n)},lastIndexOf(o,n=1/0){return this.toArray().lastIndexOf(o,n)},slice(o,n){return this.toArray().slice(o,n)},some(o){let n=0;for(let s of this){if(o(s,n))return!0;n+=1}return!1},[Symbol.iterator]:function*(){let o=0,n=lA(j,o);for(;n!==void 0;)yield n,o+=1,n=lA(j,o)}}}a(xn,"listMethods");function pr(j){let A=j.map(e=>{if(typeof e=="number")return e.toString();if(typeof e=="string")return e.replace(/~/g,"~0").replace(/\//g,"~1")});return j.length===0?"":"/"+A.join("/")}a(pr,"printPath");function qj(j){return typeof j=="object"&&j!==null&&Object.prototype.hasOwnProperty.call(j,Ve)}a(qj,"isImmutableString");function Qe(j){return typeof j=="object"&&j!==null&&Object.prototype.hasOwnProperty.call(j,te)}a(Qe,"isCounter");var re=class{static{a(this,"Int")}constructor(A){if(!(Number.isInteger(A)&&A<=Number.MAX_SAFE_INTEGER&&A>=Number.MIN_SAFE_INTEGER))throw new RangeError(`Value ${A} cannot be a uint`);this.value=A,Reflect.defineProperty(this,Xe,{value:!0}),Object.freeze(this)}},ae=class{static{a(this,"Uint")}constructor(A){if(!(Number.isInteger(A)&&A<=Number.MAX_SAFE_INTEGER&&A>=0))throw new RangeError(`Value ${A} cannot be a uint`);this.value=A,Reflect.defineProperty(this,Re,{value:!0}),Object.freeze(this)}},oe=class{static{a(this,"