@learncard/vpqr-plugin 1.1.22 → 1.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var Po=Object.create;var he=Object.defineProperty;var zo=Object.getOwnPropertyDescriptor;var jo=Object.getOwnPropertyNames;var Vo=Object.getPrototypeOf,Ho=Object.prototype.hasOwnProperty;var s=(t,e)=>he(t,"name",{value:e,configurable:!0});var Ko=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Wo=(t,e)=>{for(var r in e)he(t,r,{get:e[r],enumerable:!0})},Nr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of jo(e))!Ho.call(t,o)&&o!==r&&he(t,o,{get:()=>e[o],enumerable:!(n=zo(e,o))||n.enumerable});return t};var Qo=(t,e,r)=>(r=t!=null?Po(Vo(t)):{},Nr(e||!t||!t.__esModule?he(r,"default",{value:t,enumerable:!0}):r,t)),Xo=t=>Nr(he({},"__esModule",{value:!0}),t);var wo=Ko((ku,yo)=>{"use strict";var Gi="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Zi="0123456789ABCDEFGHIJKLMNOPQRSTUV",Ji="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Yi(t,e){var r=t.indexOf(e);if(r===-1)throw new Error("Invalid character found: "+e);return r}s(Yi,"readChar");yo.exports=s(function(e,r){var n;switch(r){case"RFC3548":case"RFC4648":n=Gi,e=e.replace(/=+$/,"");break;case"RFC4648-HEX":n=Zi,e=e.replace(/=+$/,"");break;case"Crockford":n=Ji,e=e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1");break;default:throw new Error("Unknown base32 variant: "+r)}for(var o=e.length,i=0,c=0,f=0,u=new Uint8Array(o*5/8|0),d=0;d<o;d++)c=c<<5|Yi(n,e[d]),i+=5,i>=8&&(u[f++]=c>>>i-8&255,i-=8);return u.buffer},"base32Decode")});var xs={};Wo(xs,{getVpqrPlugin:()=>ms});module.exports=Xo(xs);var Go=["string","number","bigint","symbol"],Zo=["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 Lr(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if(Go.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(Jo(t))return"Buffer";let r=Yo(t);return r||"Object"}s(Lr,"is");function Jo(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}s(Jo,"isBuffer");function Yo(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(Zo.includes(e))return e}s(Yo,"getObjectType");var Pt=class Pt{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}};s(Pt,"Type");var a=Pt;a.uint=new a(0,"uint",!0);a.negint=new a(1,"negint",!0);a.bytes=new a(2,"bytes",!0);a.string=new a(3,"string",!0);a.array=new a(4,"array",!1);a.map=new a(5,"map",!1);a.tag=new a(6,"tag",!1);a.float=new a(7,"float",!0);a.false=new a(7,"false",!0);a.true=new a(7,"true",!0);a.null=new a(7,"null",!0);a.undefined=new a(7,"undefined",!0);a.break=new a(7,"break",!0);var zt=class zt{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};s(zt,"Token");var l=zt;var re=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",qo=new TextDecoder,ei=new TextEncoder;function ze(t){return re&&globalThis.Buffer.isBuffer(t)}s(ze,"isBuffer");function jt(t){return t instanceof Uint8Array?ze(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}s(jt,"asU8A");var zr=re?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):$r(t,e,r):(t,e,r)=>r-e>64?qo.decode(t.subarray(e,r)):$r(t,e,r),jr=re?t=>t.length>64?globalThis.Buffer.from(t):Fr(t):t=>t.length>64?ei.encode(t):Fr(t),z=s(t=>Uint8Array.from(t),"fromArray"),ne=re?(t,e,r)=>ze(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),Vr=re?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),jt(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},Hr=re?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function je(t,e){if(ze(t)&&ze(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}s(je,"compare");function Fr(t){let e=[],r=0;for(let n=0;n<t.length;n++){let o=t.charCodeAt(n);o<128?e[r++]=o:o<2048?(e[r++]=o>>6|192,e[r++]=o&63|128):(o&64512)===55296&&n+1<t.length&&(t.charCodeAt(n+1)&64512)===56320?(o=65536+((o&1023)<<10)+(t.charCodeAt(++n)&1023),e[r++]=o>>18|240,e[r++]=o>>12&63|128,e[r++]=o>>6&63|128,e[r++]=o&63|128):(e[r++]=o>>12|224,e[r++]=o>>6&63|128,e[r++]=o&63|128)}return e}s(Fr,"utf8ToBytes");function $r(t,e,r){let n=[];for(;e<r;){let o=t[e],i=null,c=o>239?4:o>223?3:o>191?2:1;if(e+c<=r){let f,u,d,h;switch(c){case 1:o<128&&(i=o);break;case 2:f=t[e+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(i=h));break;case 3:f=t[e+1],u=t[e+2],(f&192)===128&&(u&192)===128&&(h=(o&15)<<12|(f&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(i=h));break;case 4:f=t[e+1],u=t[e+2],d=t[e+3],(f&192)===128&&(u&192)===128&&(d&192)===128&&(h=(o&15)<<18|(f&63)<<12|(u&63)<<6|d&63,h>65535&&h<1114112&&(i=h))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),e+=c}return ti(n)}s($r,"utf8Slice");var Pr=4096;function ti(t){let e=t.length;if(e<=Pr)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Pr));return r}s(ti,"decodeCodePointsArray");var ri=256,Vt=class Vt{constructor(e=ri){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),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=Hr(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=ne(n,0,this.cursor)}else r=Vr(this.chunks,this.cursor);return e&&this.reset(),r}};s(Vt,"Bl");var me=Vt;var m="CBOR decode error:",Ht="CBOR encode error:",xe=[];xe[23]=1;xe[24]=2;xe[25]=3;xe[26]=5;xe[27]=9;function j(t,e,r){if(t.length-e<r)throw new Error(`${m} not enough data for type`)}s(j,"assertEnoughData");var B=[24,256,65536,4294967296,BigInt("18446744073709551616")];function S(t,e,r){j(t,e,1);let n=t[e];if(r.strict===!0&&n<B[0])throw new Error(`${m} integer encoded in more bytes than necessary (strict decode)`);return n}s(S,"readUint8");function I(t,e,r){j(t,e,2);let n=t[e]<<8|t[e+1];if(r.strict===!0&&n<B[1])throw new Error(`${m} integer encoded in more bytes than necessary (strict decode)`);return n}s(I,"readUint16");function M(t,e,r){j(t,e,4);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3];if(r.strict===!0&&n<B[2])throw new Error(`${m} integer encoded in more bytes than necessary (strict decode)`);return n}s(M,"readUint32");function R(t,e,r){j(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],i=(BigInt(n)<<BigInt(32))+BigInt(o);if(r.strict===!0&&i<B[3])throw new Error(`${m} integer encoded in more bytes than necessary (strict decode)`);if(i<=Number.MAX_SAFE_INTEGER)return Number(i);if(r.allowBigInt===!0)return i;throw new Error(`${m} integers outside of the safe integer range are not supported`)}s(R,"readUint64");function Kr(t,e,r,n){return new l(a.uint,S(t,e+1,n),2)}s(Kr,"decodeUint8");function Wr(t,e,r,n){return new l(a.uint,I(t,e+1,n),3)}s(Wr,"decodeUint16");function Qr(t,e,r,n){return new l(a.uint,M(t,e+1,n),5)}s(Qr,"decodeUint32");function Xr(t,e,r,n){return new l(a.uint,R(t,e+1,n),9)}s(Xr,"decodeUint64");function v(t,e){return _(t,0,e.value)}s(v,"encodeUint");function _(t,e,r){if(r<B[0]){let n=Number(r);t.push([e|n])}else if(r<B[1]){let n=Number(r);t.push([e|24,n])}else if(r<B[2]){let n=Number(r);t.push([e|25,n>>>8,n&255])}else if(r<B[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<B[4]){let o=[e|27,0,0,0,0,0,0,0],i=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));o[8]=i&255,i=i>>8,o[7]=i&255,i=i>>8,o[6]=i&255,i=i>>8,o[5]=i&255,o[4]=c&255,c=c>>8,o[3]=c&255,c=c>>8,o[2]=c&255,c=c>>8,o[1]=c&255,t.push(o)}else throw new Error(`${m} encountered BigInt larger than allowable range`)}}s(_,"encodeUintValue");v.encodedSize=s(function(e){return _.encodedSize(e.value)},"encodedSize");_.encodedSize=s(function(e){return e<B[0]?1:e<B[1]?2:e<B[2]?3:e<B[3]?5:9},"encodedSize");v.compareTokens=s(function(e,r){return e.value<r.value?-1:e.value>r.value?1:0},"compareTokens");function Gr(t,e,r,n){return new l(a.negint,-1-S(t,e+1,n),2)}s(Gr,"decodeNegint8");function Zr(t,e,r,n){return new l(a.negint,-1-I(t,e+1,n),3)}s(Zr,"decodeNegint16");function Jr(t,e,r,n){return new l(a.negint,-1-M(t,e+1,n),5)}s(Jr,"decodeNegint32");var Kt=BigInt(-1),Yr=BigInt(1);function qr(t,e,r,n){let o=R(t,e+1,n);if(typeof o!="bigint"){let i=-1-o;if(i>=Number.MIN_SAFE_INTEGER)return new l(a.negint,i,9)}if(n.allowBigInt!==!0)throw new Error(`${m} integers outside of the safe integer range are not supported`);return new l(a.negint,Kt-BigInt(o),9)}s(qr,"decodeNegint64");function Ve(t,e){let r=e.value,n=typeof r=="bigint"?r*Kt-Yr:r*-1-1;_(t,e.type.majorEncoded,n)}s(Ve,"encodeNegint");Ve.encodedSize=s(function(e){let r=e.value,n=typeof r=="bigint"?r*Kt-Yr:r*-1-1;return n<B[0]?1:n<B[1]?2:n<B[2]?3:n<B[3]?5:9},"encodedSize");Ve.compareTokens=s(function(e,r){return e.value<r.value?1:e.value>r.value?-1:0},"compareTokens");function ge(t,e,r,n){j(t,e,r+n);let o=ne(t,e+r,e+r+n);return new l(a.bytes,o,r+n)}s(ge,"toToken");function en(t,e,r,n){return ge(t,e,1,r)}s(en,"decodeBytesCompact");function tn(t,e,r,n){return ge(t,e,2,S(t,e+1,n))}s(tn,"decodeBytes8");function rn(t,e,r,n){return ge(t,e,3,I(t,e+1,n))}s(rn,"decodeBytes16");function nn(t,e,r,n){return ge(t,e,5,M(t,e+1,n))}s(nn,"decodeBytes32");function on(t,e,r,n){let o=R(t,e+1,n);if(typeof o=="bigint")throw new Error(`${m} 64-bit integer bytes lengths not supported`);return ge(t,e,9,o)}s(on,"decodeBytes64");function He(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===a.string?jr(t.value):t.value),t.encodedBytes}s(He,"tokenBytes");function oe(t,e){let r=He(e);_(t,e.type.majorEncoded,r.length),t.push(r)}s(oe,"encodeBytes");oe.encodedSize=s(function(e){let r=He(e);return _.encodedSize(r.length)+r.length},"encodedSize");oe.compareTokens=s(function(e,r){return oi(He(e),He(r))},"compareTokens");function oi(t,e){return t.length<e.length?-1:t.length>e.length?1:je(t,e)}s(oi,"compareBytes");function ye(t,e,r,n,o){let i=r+n;j(t,e,i);let c=new l(a.string,zr(t,e+r,e+i),i);return o.retainStringBytes===!0&&(c.byteValue=ne(t,e+r,e+i)),c}s(ye,"toToken");function sn(t,e,r,n){return ye(t,e,1,r,n)}s(sn,"decodeStringCompact");function cn(t,e,r,n){return ye(t,e,2,S(t,e+1,n),n)}s(cn,"decodeString8");function an(t,e,r,n){return ye(t,e,3,I(t,e+1,n),n)}s(an,"decodeString16");function fn(t,e,r,n){return ye(t,e,5,M(t,e+1,n),n)}s(fn,"decodeString32");function un(t,e,r,n){let o=R(t,e+1,n);if(typeof o=="bigint")throw new Error(`${m} 64-bit integer string lengths not supported`);return ye(t,e,9,o,n)}s(un,"decodeString64");var dn=oe;function ie(t,e,r,n){return new l(a.array,n,r)}s(ie,"toToken");function ln(t,e,r,n){return ie(t,e,1,r)}s(ln,"decodeArrayCompact");function pn(t,e,r,n){return ie(t,e,2,S(t,e+1,n))}s(pn,"decodeArray8");function hn(t,e,r,n){return ie(t,e,3,I(t,e+1,n))}s(hn,"decodeArray16");function mn(t,e,r,n){return ie(t,e,5,M(t,e+1,n))}s(mn,"decodeArray32");function xn(t,e,r,n){let o=R(t,e+1,n);if(typeof o=="bigint")throw new Error(`${m} 64-bit integer array lengths not supported`);return ie(t,e,9,o)}s(xn,"decodeArray64");function gn(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${m} indefinite length items not allowed`);return ie(t,e,1,1/0)}s(gn,"decodeArrayIndefinite");function Ke(t,e){_(t,a.array.majorEncoded,e.value)}s(Ke,"encodeArray");Ke.compareTokens=v.compareTokens;Ke.encodedSize=s(function(e){return _.encodedSize(e.value)},"encodedSize");function se(t,e,r,n){return new l(a.map,n,r)}s(se,"toToken");function yn(t,e,r,n){return se(t,e,1,r)}s(yn,"decodeMapCompact");function wn(t,e,r,n){return se(t,e,2,S(t,e+1,n))}s(wn,"decodeMap8");function bn(t,e,r,n){return se(t,e,3,I(t,e+1,n))}s(bn,"decodeMap16");function En(t,e,r,n){return se(t,e,5,M(t,e+1,n))}s(En,"decodeMap32");function Cn(t,e,r,n){let o=R(t,e+1,n);if(typeof o=="bigint")throw new Error(`${m} 64-bit integer map lengths not supported`);return se(t,e,9,o)}s(Cn,"decodeMap64");function Tn(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${m} indefinite length items not allowed`);return se(t,e,1,1/0)}s(Tn,"decodeMapIndefinite");function We(t,e){_(t,a.map.majorEncoded,e.value)}s(We,"encodeMap");We.compareTokens=v.compareTokens;We.encodedSize=s(function(e){return _.encodedSize(e.value)},"encodedSize");function An(t,e,r,n){return new l(a.tag,r,1)}s(An,"decodeTagCompact");function Bn(t,e,r,n){return new l(a.tag,S(t,e+1,n),2)}s(Bn,"decodeTag8");function _n(t,e,r,n){return new l(a.tag,I(t,e+1,n),3)}s(_n,"decodeTag16");function kn(t,e,r,n){return new l(a.tag,M(t,e+1,n),5)}s(kn,"decodeTag32");function Dn(t,e,r,n){return new l(a.tag,R(t,e+1,n),9)}s(Dn,"decodeTag64");function Qe(t,e){_(t,a.tag.majorEncoded,e.value)}s(Qe,"encodeTag");Qe.compareTokens=v.compareTokens;Qe.encodedSize=s(function(e){return _.encodedSize(e.value)},"encodedSize");var ui=20,di=21,li=22,pi=23;function Un(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${m} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new l(a.null,null,1):new l(a.undefined,void 0,1)}s(Un,"decodeUndefined");function Sn(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${m} indefinite length items not allowed`);return new l(a.break,void 0,1)}s(Sn,"decodeBreak");function Wt(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${m} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${m} Infinity values are not supported`)}return new l(a.float,t,e)}s(Wt,"createToken");function In(t,e,r,n){return Wt(Qt(t,e+1),3,n)}s(In,"decodeFloat16");function Mn(t,e,r,n){return Wt(Xt(t,e+1),5,n)}s(Mn,"decodeFloat32");function Rn(t,e,r,n){return Wt(Ln(t,e+1),9,n)}s(Rn,"decodeFloat64");function Xe(t,e,r){let n=e.value;if(n===!1)t.push([a.float.majorEncoded|ui]);else if(n===!0)t.push([a.float.majorEncoded|di]);else if(n===null)t.push([a.float.majorEncoded|li]);else if(n===void 0)t.push([a.float.majorEncoded|pi]);else{let o,i=!1;(!r||r.float64!==!0)&&(vn(n),o=Qt(F,1),n===o||Number.isNaN(n)?(F[0]=249,t.push(F.slice(0,3)),i=!0):(Nn(n),o=Xt(F,1),n===o&&(F[0]=250,t.push(F.slice(0,5)),i=!0))),i||(hi(n),o=Ln(F,1),F[0]=251,t.push(F.slice(0,9)))}}s(Xe,"encodeFloat");Xe.encodedSize=s(function(e,r){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){vn(n);let o=Qt(F,1);if(n===o||Number.isNaN(n))return 3;if(Nn(n),o=Xt(F,1),n===o)return 5}return 9},"encodedSize");var On=new ArrayBuffer(9),N=new DataView(On,1),F=new Uint8Array(On,0);function vn(t){if(t===1/0)N.setUint16(0,31744,!1);else if(t===-1/0)N.setUint16(0,64512,!1);else if(Number.isNaN(t))N.setUint16(0,32256,!1);else{N.setFloat32(0,t);let e=N.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)N.setUint16(0,31744,!1);else if(r===0)N.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{let o=r-127;o<-24?N.setUint16(0,0):o<-14?N.setUint16(0,(e&2147483648)>>16|1<<24+o,!1):N.setUint16(0,(e&2147483648)>>16|o+15<<10|n>>13,!1)}}}s(vn,"encodeFloat16");function Qt(t,e){if(t.length-e<2)throw new Error(`${m} not enough data for float16`);let r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,o=r&1023,i;return n===0?i=o*2**-24:n!==31?i=(o+1024)*2**(n-25):i=o===0?1/0:NaN,r&32768?-i:i}s(Qt,"readFloat16");function Nn(t){N.setFloat32(0,t,!1)}s(Nn,"encodeFloat32");function Xt(t,e){if(t.length-e<4)throw new Error(`${m} not enough data for float32`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}s(Xt,"readFloat32");function hi(t){N.setFloat64(0,t,!1)}s(hi,"encodeFloat64");function Ln(t,e){if(t.length-e<8)throw new Error(`${m} not enough data for float64`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}s(Ln,"readFloat64");Xe.compareTokens=v.compareTokens;function y(t,e,r){throw new Error(`${m} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}s(y,"invalidMinor");function Ge(t){return()=>{throw new Error(`${m} ${t}`)}}s(Ge,"errorer");var p=[];for(let t=0;t<=23;t++)p[t]=y;p[24]=Kr;p[25]=Wr;p[26]=Qr;p[27]=Xr;p[28]=y;p[29]=y;p[30]=y;p[31]=y;for(let t=32;t<=55;t++)p[t]=y;p[56]=Gr;p[57]=Zr;p[58]=Jr;p[59]=qr;p[60]=y;p[61]=y;p[62]=y;p[63]=y;for(let t=64;t<=87;t++)p[t]=en;p[88]=tn;p[89]=rn;p[90]=nn;p[91]=on;p[92]=y;p[93]=y;p[94]=y;p[95]=Ge("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)p[t]=sn;p[120]=cn;p[121]=an;p[122]=fn;p[123]=un;p[124]=y;p[125]=y;p[126]=y;p[127]=Ge("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)p[t]=ln;p[152]=pn;p[153]=hn;p[154]=mn;p[155]=xn;p[156]=y;p[157]=y;p[158]=y;p[159]=gn;for(let t=160;t<=183;t++)p[t]=yn;p[184]=wn;p[185]=bn;p[186]=En;p[187]=Cn;p[188]=y;p[189]=y;p[190]=y;p[191]=Tn;for(let t=192;t<=215;t++)p[t]=An;p[216]=Bn;p[217]=_n;p[218]=kn;p[219]=Dn;p[220]=y;p[221]=y;p[222]=y;p[223]=y;for(let t=224;t<=243;t++)p[t]=Ge("simple values are not supported");p[244]=y;p[245]=y;p[246]=y;p[247]=Un;p[248]=Ge("simple values are not supported");p[249]=In;p[250]=Mn;p[251]=Rn;p[252]=y;p[253]=y;p[254]=y;p[255]=Sn;var $=[];for(let t=0;t<24;t++)$[t]=new l(a.uint,t,1);for(let t=-1;t>=-24;t--)$[31-t]=new l(a.negint,t,1);$[64]=new l(a.bytes,new Uint8Array(0),1);$[96]=new l(a.string,"",1);$[128]=new l(a.array,0,1);$[160]=new l(a.map,0,1);$[244]=new l(a.false,!1,1);$[245]=new l(a.true,!0,1);$[246]=new l(a.null,null,1);function Gt(t){switch(t.type){case a.false:return z([244]);case a.true:return z([245]);case a.null:return z([246]);case a.bytes:return t.value.length?void 0:z([64]);case a.string:return t.value===""?z([96]):void 0;case a.array:return t.value===0?z([128]):void 0;case a.map:return t.value===0?z([160]):void 0;case a.uint:return t.value<24?z([Number(t.value)]):void 0;case a.negint:if(t.value>=-24)return z([31-Number(t.value)])}}s(Gt,"quickEncodeToken");var xi={float64:!1,mapSorter:wi,quickEncodeToken:Gt},$n=Object.freeze({float64:!0,mapSorter:bi,quickEncodeToken:Gt});function gi(){let t=[];return t[a.uint.major]=v,t[a.negint.major]=Ve,t[a.bytes.major]=oe,t[a.string.major]=dn,t[a.array.major]=Ke,t[a.map.major]=We,t[a.tag.major]=Qe,t[a.float.major]=Xe,t}s(gi,"makeCborEncoders");var Jt=gi(),Zt=new me,Ye=class Ye{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(`${Ht} object contains circular references`);return new Ye(r,e)}};s(Ye,"Ref");var Je=Ye,H={null:new l(a.null,null),undefined:new l(a.undefined,void 0),true:new l(a.true,!0),false:new l(a.false,!1),emptyArray:new l(a.array,0),emptyMap:new l(a.map,0)},K={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new l(a.float,t):t>=0?new l(a.uint,t):new l(a.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new l(a.uint,t):new l(a.negint,t)},Uint8Array(t,e,r,n){return new l(a.bytes,t)},string(t,e,r,n){return new l(a.string,t)},boolean(t,e,r,n){return t?H.true:H.false},null(t,e,r,n){return H.null},undefined(t,e,r,n){return H.undefined},ArrayBuffer(t,e,r,n){return new l(a.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new l(a.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[H.emptyArray,new l(a.break)]:H.emptyArray;n=Je.createCheck(n,t);let o=[],i=0;for(let c of t)o[i++]=Ze(c,r,n);return r.addBreakTokens?[new l(a.array,t.length),o,new l(a.break)]:[new l(a.array,t.length),o]},Object(t,e,r,n){let o=e!=="Object",i=o?t.keys():Object.keys(t),c=o?t.size:i.length;if(!c)return r.addBreakTokens===!0?[H.emptyMap,new l(a.break)]:H.emptyMap;n=Je.createCheck(n,t);let f=[],u=0;for(let d of i)f[u++]=[Ze(d,r,n),Ze(o?t.get(d):t[d],r,n)];return yi(f,r),r.addBreakTokens?[new l(a.map,c),f,new l(a.break)]:[new l(a.map,c),f]}};K.Map=K.Object;K.Buffer=K.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))K[`${t}Array`]=K.DataView;function Ze(t,e={},r){let n=Lr(t),o=e&&e.typeEncoders&&e.typeEncoders[n]||K[n];if(typeof o=="function"){let c=o(t,n,e,r);if(c!=null)return c}let i=K[n];if(!i)throw new Error(`${Ht} unsupported type: ${n}`);return i(t,n,e,r)}s(Ze,"objectToTokens");function yi(t,e){e.mapSorter&&t.sort(e.mapSorter)}s(yi,"sortMapEntries");function wi(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,i=Jt[o].compareTokens(r,n);return i===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),i}s(wi,"mapSorter");function bi(t,e){if(t[0]instanceof l&&e[0]instanceof l){let r=t[0],n=e[0];return r._keyBytes||(r._keyBytes=Fn(r.value)),n._keyBytes||(n._keyBytes=Fn(n.value)),je(r._keyBytes,n._keyBytes)}throw new Error("rfc8949MapSorter: complex key types are not supported yet")}s(bi,"rfc8949MapSorter");function Fn(t){return zn(t,Jt,$n)}s(Fn,"encodeRfc8949");function Pn(t,e,r,n){if(Array.isArray(e))for(let o of e)Pn(t,o,r,n);else r[e.type.major](t,e,n)}s(Pn,"tokensToEncoded");function zn(t,e,r){let n=Ze(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){let o=r.quickEncodeToken(n);if(o)return o;let i=e[n.type.major];if(i.encodedSize){let c=i.encodedSize(n,r),f=new me(c);if(i(f,n,r),f.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return jt(f.chunks[0])}}return Zt.reset(),Pn(Zt,n,e,r),Zt.toBytes(!0)}s(zn,"encodeCustom");function we(t,e){return e=Object.assign({},xi,e),zn(t,Jt,e)}s(we,"encode");var Ei={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Yt=class Yt{constructor(e,r={}){this._pos=0,this.data=e,this.options=r}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],r=$[e];if(r===void 0){let n=p[e];if(!n)throw new Error(`${m} 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}};s(Yt,"Tokeniser");var qe=Yt,be=Symbol.for("DONE"),et=Symbol.for("BREAK");function Ci(t,e,r){let n=[];for(let o=0;o<t.value;o++){let i=ce(e,r);if(i===et){if(t.value===1/0)break;throw new Error(`${m} got unexpected break to lengthed array`)}if(i===be)throw new Error(`${m} found array but not enough entries (got ${o}, expected ${t.value})`);n[o]=i}return n}s(Ci,"tokenToArray");function Ti(t,e,r){let n=r.useMaps===!0,o=n?void 0:{},i=n?new Map:void 0;for(let c=0;c<t.value;c++){let f=ce(e,r);if(f===et){if(t.value===1/0)break;throw new Error(`${m} got unexpected break to lengthed map`)}if(f===be)throw new Error(`${m} found map but not enough entries (got ${c} [no key], expected ${t.value})`);if(n!==!0&&typeof f!="string")throw new Error(`${m} non-string keys not supported (got ${typeof f})`);if(r.rejectDuplicateMapKeys===!0&&(n&&i.has(f)||!n&&f in o))throw new Error(`${m} found repeat map key "${f}"`);let u=ce(e,r);if(u===be)throw new Error(`${m} found map but not enough entries (got ${c} [no value], expected ${t.value})`);n?i.set(f,u):o[f]=u}return n?i:o}s(Ti,"tokenToMap");function ce(t,e){if(t.done())return be;let r=t.next();if(r.type===a.break)return et;if(r.type.terminal)return r.value;if(r.type===a.array)return Ci(r,t,e);if(r.type===a.map)return Ti(r,t,e);if(r.type===a.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=ce(t,e);return e.tags[r.value](n)}throw new Error(`${m} tag not supported (${r.value})`)}throw new Error("unsupported")}s(ce,"tokensToObject");function jn(t,e){if(!(t instanceof Uint8Array))throw new Error(`${m} data to decode must be a Uint8Array`);e=Object.assign({},Ei,e);let r=e.tokenizer||new qe(t,e),n=ce(r,e);if(n===be)throw new Error(`${m} did not find any content to decode`);if(n===et)throw new Error(`${m} got unexpected break`);return[n,t.subarray(r.pos())]}s(jn,"decodeFirst");function Ee(t,e){let[r,n]=jn(t,e);if(n.length>0)throw new Error(`${m} too many terminals, data makes no sense`);return r}s(Ee,"decode");var qt=class qt extends Error{constructor(e,r){super(),this.message=r,this.value=e,this.stack=new Error(`${e}: ${r}`).stack,this.name=this.constructor.name}};s(qt,"CborldError");var C=qt;var P=new Map([["@context",0],["@type",2],["@id",4],["@value",6],["@direction",8],["@graph",10],["@included",12],["@index",14],["@json",16],["@language",18],["@list",20],["@nest",22],["@reverse",24],["@base",26],["@container",28],["@default",30],["@embed",32],["@explicit",34],["@none",36],["@omitDefault",38],["@prefix",40],["@preserve",42],["@protected",44],["@requireAll",46],["@set",48],["@version",50],["@vocab",52]]),rt=100;var er=class er{decode({value:e}={}){throw new Error("Must be implemented by derived class.")}static createDecoder({value:e,transformer:r}={}){throw new Error("Must be implemented by derived class.")}};s(er,"CborldDecoder");var A=er;var tr=new Map,rr=new Map;T(16,"https://www.w3.org/ns/activitystreams");T(17,"https://www.w3.org/2018/credentials/v1");T(18,"https://www.w3.org/ns/did/v1");T(19,"https://w3id.org/security/suites/ed25519-2018/v1");T(20,"https://w3id.org/security/suites/ed25519-2020/v1");T(21,"https://w3id.org/cit/v1");T(22,"https://w3id.org/age/v1");T(23,"https://w3id.org/security/suites/x25519-2020/v1");T(24,"https://w3id.org/veres-one/v1");T(25,"https://w3id.org/webkms/v1");T(26,"https://w3id.org/zcap/v1");T(27,"https://w3id.org/security/suites/hmac-2019/v1");T(28,"https://w3id.org/security/suites/aes-2019/v1");T(29,"https://w3id.org/vaccination/v1");T(30,"https://w3id.org/vc-revocation-list-2020/v1");T(31,"https://w3id.org/dcc/v1");T(32,"https://w3id.org/vc/status-list/v1");T(48,"https://w3id.org/security/data-integrity/v1");T(49,"https://w3id.org/security/multikey/v1");T(50,"https://purl.imsglobal.org/spec/ob/v3p0/context.json");T(51,"https://w3id.org/security/data-integrity/v2");function T(t,e){rr.set(e,t),tr.set(t,e)}s(T,"_addRegistration");var nt=class nt extends A{constructor({reverseAppContextMap:e}={}){super(),this.reverseAppContextMap=e}decode({value:e}={}){if(typeof e!="number")return nr(e);let r=tr.get(e)||this.reverseAppContextMap.get(e);if(r===void 0)throw new C("ERR_UNDEFINED_COMPRESSED_CONTEXT",`Undefined compressed context "${e}".`);return r}static createDecoder({transformer:e}={}){let{reverseAppContextMap:r}=e;return new nt({reverseAppContextMap:r})}};s(nt,"ContextDecoder");var Ce=nt;function nr(t){if(Array.isArray(t))return t.map(nr);if(!(t instanceof Map))return t;let e={};for(let[r,n]of t)e[r]=nr(n);return e}s(nr,"_mapToObject");function W(t,e){return JSON.stringify(t,null,2)}s(W,"inspect");var Xn="3.7.8",Ai=Xn,fe=typeof Buffer=="function",Vn=typeof TextDecoder=="function"?new TextDecoder:void 0,Hn=typeof TextEncoder=="function"?new TextEncoder:void 0,Bi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Te=Array.prototype.slice.call(Bi),ot=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(Te),_i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,k=String.fromCharCode.bind(String),Kn=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),Gn=s(t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),"_mkUriSafe"),Zn=s(t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),"_tidyB64"),Jn=s(t=>{let e,r,n,o,i="",c=t.length%3;for(let f=0;f<t.length;){if((r=t.charCodeAt(f++))>255||(n=t.charCodeAt(f++))>255||(o=t.charCodeAt(f++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|o,i+=Te[e>>18&63]+Te[e>>12&63]+Te[e>>6&63]+Te[e&63]}return c?i.slice(0,c-3)+"===".substring(c):i},"btoaPolyfill"),sr=typeof btoa=="function"?t=>btoa(t):fe?t=>Buffer.from(t,"binary").toString("base64"):Jn,or=fe?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,o=t.length;n<o;n+=4096)r.push(k.apply(null,t.subarray(n,n+4096)));return sr(r.join(""))},it=s((t,e=!1)=>e?Gn(or(t)):or(t),"fromUint8Array"),ki=s(t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?k(192|e>>>6)+k(128|e&63):k(224|e>>>12&15)+k(128|e>>>6&63)+k(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return k(240|e>>>18&7)+k(128|e>>>12&63)+k(128|e>>>6&63)+k(128|e&63)}},"cb_utob"),Di=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Yn=s(t=>t.replace(Di,ki),"utob"),Wn=fe?t=>Buffer.from(t,"utf8").toString("base64"):Hn?t=>or(Hn.encode(t)):t=>sr(Yn(t)),ae=s((t,e=!1)=>e?Gn(Wn(t)):Wn(t),"encode"),Qn=s(t=>ae(t,!0),"encodeURI"),Ui=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Si=s(t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return k((r>>>10)+55296)+k((r&1023)+56320);case 3:return k((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return k((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},"cb_btou"),qn=s(t=>t.replace(Ui,Si),"btou"),eo=s(t=>{if(t=t.replace(/\s+/g,""),!_i.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r,n,o=[];for(let i=0;i<t.length;)e=ot[t.charAt(i++)]<<18|ot[t.charAt(i++)]<<12|(r=ot[t.charAt(i++)])<<6|(n=ot[t.charAt(i++)]),r===64?o.push(k(e>>16&255)):n===64?o.push(k(e>>16&255,e>>8&255)):o.push(k(e>>16&255,e>>8&255,e&255));return o.join("")},"atobPolyfill"),cr=typeof atob=="function"?t=>atob(Zn(t)):fe?t=>Buffer.from(t,"base64").toString("binary"):eo,to=fe?t=>Kn(Buffer.from(t,"base64")):t=>Kn(cr(t).split("").map(e=>e.charCodeAt(0))),ro=s(t=>to(no(t)),"toUint8Array"),Ii=fe?t=>Buffer.from(t,"base64").toString("utf8"):Vn?t=>Vn.decode(to(t)):t=>qn(cr(t)),no=s(t=>Zn(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),"_unURI"),ir=s(t=>Ii(no(t)),"decode"),Mi=s(t=>{if(typeof t!="string")return!1;let e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},"isValid"),oo=s(t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),"_noEnum"),io=s(function(){let t=s((e,r)=>Object.defineProperty(String.prototype,e,oo(r)),"_add");t("fromBase64",function(){return ir(this)}),t("toBase64",function(e){return ae(this,e)}),t("toBase64URI",function(){return ae(this,!0)}),t("toBase64URL",function(){return ae(this,!0)}),t("toUint8Array",function(){return ro(this)})},"extendString"),so=s(function(){let t=s((e,r)=>Object.defineProperty(Uint8Array.prototype,e,oo(r)),"_add");t("toBase64",function(e){return it(this,e)}),t("toBase64URI",function(){return it(this,!0)}),t("toBase64URL",function(){return it(this,!0)})},"extendUint8Array"),Ri=s(()=>{io(),so()},"extendBuiltins"),st={version:Xn,VERSION:Ai,atob:cr,atobPolyfill:eo,btoa:sr,btoaPolyfill:Jn,fromBase64:ir,toBase64:ae,encode:ae,encodeURI:Qn,encodeURL:Qn,utob:Yn,btou:qn,decode:ir,isValid:Mi,fromUint8Array:it,toUint8Array:ro,extendString:io,extendUint8Array:so,extendBuiltins:Ri};var co={};function ao(t,e,r){if(!(t instanceof Uint8Array))throw new TypeError('"input" must be a Uint8Array.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');if(t.length===0)return"";let n="",o=0,i=e.length,c=e.charAt(0),f=[0];for(o=0;o<t.length;++o){let u=t[o];for(let d=0;d<f.length;++d)u+=f[d]<<8,f[d]=u%i,u=u/i|0;for(;u>0;)f.push(u%i),u=u/i|0}for(o=0;t[o]===0&&o<t.length-1;++o)n+=c;for(o=f.length-1;o>=0;--o)n+=e[f[o]];if(r){let u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r
1
+ "use strict";var Po=Object.create;var he=Object.defineProperty;var zo=Object.getOwnPropertyDescriptor;var jo=Object.getOwnPropertyNames;var Vo=Object.getPrototypeOf,Ho=Object.prototype.hasOwnProperty;var s=(t,e)=>he(t,"name",{value:e,configurable:!0});var Ko=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Wo=(t,e)=>{for(var r in e)he(t,r,{get:e[r],enumerable:!0})},Nr=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of jo(e))!Ho.call(t,o)&&o!==r&&he(t,o,{get:()=>e[o],enumerable:!(n=zo(e,o))||n.enumerable});return t};var Qo=(t,e,r)=>(r=t!=null?Po(Vo(t)):{},Nr(e||!t||!t.__esModule?he(r,"default",{value:t,enumerable:!0}):r,t)),Xo=t=>Nr(he({},"__esModule",{value:!0}),t);var wo=Ko((ku,yo)=>{"use strict";var Gi="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Zi="0123456789ABCDEFGHIJKLMNOPQRSTUV",Ji="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Yi(t,e){var r=t.indexOf(e);if(r===-1)throw new Error("Invalid character found: "+e);return r}s(Yi,"readChar");yo.exports=s(function(e,r){var n;switch(r){case"RFC3548":case"RFC4648":n=Gi,e=e.replace(/=+$/,"");break;case"RFC4648-HEX":n=Zi,e=e.replace(/=+$/,"");break;case"Crockford":n=Ji,e=e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1");break;default:throw new Error("Unknown base32 variant: "+r)}for(var o=e.length,i=0,c=0,f=0,u=new Uint8Array(o*5/8|0),d=0;d<o;d++)c=c<<5|Yi(n,e[d]),i+=5,i>=8&&(u[f++]=c>>>i-8&255,i-=8);return u.buffer},"base32Decode")});var xs={};Wo(xs,{getVpqrPlugin:()=>ms});module.exports=Xo(xs);var Go=["string","number","bigint","symbol"],Zo=["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 Lr(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if(Go.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(Jo(t))return"Buffer";let r=Yo(t);return r||"Object"}s(Lr,"is");function Jo(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}s(Jo,"isBuffer");function Yo(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(Zo.includes(e))return e}s(Yo,"getObjectType");var Pt=class Pt{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}};s(Pt,"Type");var a=Pt;a.uint=new a(0,"uint",!0);a.negint=new a(1,"negint",!0);a.bytes=new a(2,"bytes",!0);a.string=new a(3,"string",!0);a.array=new a(4,"array",!1);a.map=new a(5,"map",!1);a.tag=new a(6,"tag",!1);a.float=new a(7,"float",!0);a.false=new a(7,"false",!0);a.true=new a(7,"true",!0);a.null=new a(7,"null",!0);a.undefined=new a(7,"undefined",!0);a.break=new a(7,"break",!0);var zt=class zt{constructor(e,r,n){this.type=e,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};s(zt,"Token");var l=zt;var re=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",qo=new TextDecoder,ei=new TextEncoder;function ze(t){return re&&globalThis.Buffer.isBuffer(t)}s(ze,"isBuffer");function jt(t){return t instanceof Uint8Array?ze(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}s(jt,"asU8A");var zr=re?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):$r(t,e,r):(t,e,r)=>r-e>64?qo.decode(t.subarray(e,r)):$r(t,e,r),jr=re?t=>t.length>64?globalThis.Buffer.from(t):Fr(t):t=>t.length>64?ei.encode(t):Fr(t),z=s(t=>Uint8Array.from(t),"fromArray"),ne=re?(t,e,r)=>ze(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),Vr=re?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),jt(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},Hr=re?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function je(t,e){if(ze(t)&&ze(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}s(je,"compare");function Fr(t){let e=[],r=0;for(let n=0;n<t.length;n++){let o=t.charCodeAt(n);o<128?e[r++]=o:o<2048?(e[r++]=o>>6|192,e[r++]=o&63|128):(o&64512)===55296&&n+1<t.length&&(t.charCodeAt(n+1)&64512)===56320?(o=65536+((o&1023)<<10)+(t.charCodeAt(++n)&1023),e[r++]=o>>18|240,e[r++]=o>>12&63|128,e[r++]=o>>6&63|128,e[r++]=o&63|128):(e[r++]=o>>12|224,e[r++]=o>>6&63|128,e[r++]=o&63|128)}return e}s(Fr,"utf8ToBytes");function $r(t,e,r){let n=[];for(;e<r;){let o=t[e],i=null,c=o>239?4:o>223?3:o>191?2:1;if(e+c<=r){let f,u,d,h;switch(c){case 1:o<128&&(i=o);break;case 2:f=t[e+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(i=h));break;case 3:f=t[e+1],u=t[e+2],(f&192)===128&&(u&192)===128&&(h=(o&15)<<12|(f&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(i=h));break;case 4:f=t[e+1],u=t[e+2],d=t[e+3],(f&192)===128&&(u&192)===128&&(d&192)===128&&(h=(o&15)<<18|(f&63)<<12|(u&63)<<6|d&63,h>65535&&h<1114112&&(i=h))}}i===null?(i=65533,c=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),e+=c}return ti(n)}s($r,"utf8Slice");var Pr=4096;function ti(t){let e=t.length;if(e<=Pr)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Pr));return r}s(ti,"decodeCodePointsArray");var ri=256,Vt=class Vt{constructor(e=ri){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),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=Hr(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=ne(n,0,this.cursor)}else r=Vr(this.chunks,this.cursor);return e&&this.reset(),r}};s(Vt,"Bl");var me=Vt;var m="CBOR decode error:",Ht="CBOR encode error:",xe=[];xe[23]=1;xe[24]=2;xe[25]=3;xe[26]=5;xe[27]=9;function j(t,e,r){if(t.length-e<r)throw new Error(`${m} not enough data for type`)}s(j,"assertEnoughData");var B=[24,256,65536,4294967296,BigInt("18446744073709551616")];function S(t,e,r){j(t,e,1);let n=t[e];if(r.strict===!0&&n<B[0])throw new Error(`${m} integer encoded in more bytes than necessary (strict decode)`);return n}s(S,"readUint8");function I(t,e,r){j(t,e,2);let n=t[e]<<8|t[e+1];if(r.strict===!0&&n<B[1])throw new Error(`${m} integer encoded in more bytes than necessary (strict decode)`);return n}s(I,"readUint16");function M(t,e,r){j(t,e,4);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3];if(r.strict===!0&&n<B[2])throw new Error(`${m} integer encoded in more bytes than necessary (strict decode)`);return n}s(M,"readUint32");function R(t,e,r){j(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],i=(BigInt(n)<<BigInt(32))+BigInt(o);if(r.strict===!0&&i<B[3])throw new Error(`${m} integer encoded in more bytes than necessary (strict decode)`);if(i<=Number.MAX_SAFE_INTEGER)return Number(i);if(r.allowBigInt===!0)return i;throw new Error(`${m} integers outside of the safe integer range are not supported`)}s(R,"readUint64");function Kr(t,e,r,n){return new l(a.uint,S(t,e+1,n),2)}s(Kr,"decodeUint8");function Wr(t,e,r,n){return new l(a.uint,I(t,e+1,n),3)}s(Wr,"decodeUint16");function Qr(t,e,r,n){return new l(a.uint,M(t,e+1,n),5)}s(Qr,"decodeUint32");function Xr(t,e,r,n){return new l(a.uint,R(t,e+1,n),9)}s(Xr,"decodeUint64");function v(t,e){return _(t,0,e.value)}s(v,"encodeUint");function _(t,e,r){if(r<B[0]){let n=Number(r);t.push([e|n])}else if(r<B[1]){let n=Number(r);t.push([e|24,n])}else if(r<B[2]){let n=Number(r);t.push([e|25,n>>>8,n&255])}else if(r<B[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<B[4]){let o=[e|27,0,0,0,0,0,0,0],i=Number(n&BigInt(4294967295)),c=Number(n>>BigInt(32)&BigInt(4294967295));o[8]=i&255,i=i>>8,o[7]=i&255,i=i>>8,o[6]=i&255,i=i>>8,o[5]=i&255,o[4]=c&255,c=c>>8,o[3]=c&255,c=c>>8,o[2]=c&255,c=c>>8,o[1]=c&255,t.push(o)}else throw new Error(`${m} encountered BigInt larger than allowable range`)}}s(_,"encodeUintValue");v.encodedSize=s(function(e){return _.encodedSize(e.value)},"encodedSize");_.encodedSize=s(function(e){return e<B[0]?1:e<B[1]?2:e<B[2]?3:e<B[3]?5:9},"encodedSize");v.compareTokens=s(function(e,r){return e.value<r.value?-1:e.value>r.value?1:0},"compareTokens");function Gr(t,e,r,n){return new l(a.negint,-1-S(t,e+1,n),2)}s(Gr,"decodeNegint8");function Zr(t,e,r,n){return new l(a.negint,-1-I(t,e+1,n),3)}s(Zr,"decodeNegint16");function Jr(t,e,r,n){return new l(a.negint,-1-M(t,e+1,n),5)}s(Jr,"decodeNegint32");var Kt=BigInt(-1),Yr=BigInt(1);function qr(t,e,r,n){let o=R(t,e+1,n);if(typeof o!="bigint"){let i=-1-o;if(i>=Number.MIN_SAFE_INTEGER)return new l(a.negint,i,9)}if(n.allowBigInt!==!0)throw new Error(`${m} integers outside of the safe integer range are not supported`);return new l(a.negint,Kt-BigInt(o),9)}s(qr,"decodeNegint64");function Ve(t,e){let r=e.value,n=typeof r=="bigint"?r*Kt-Yr:r*-1-1;_(t,e.type.majorEncoded,n)}s(Ve,"encodeNegint");Ve.encodedSize=s(function(e){let r=e.value,n=typeof r=="bigint"?r*Kt-Yr:r*-1-1;return n<B[0]?1:n<B[1]?2:n<B[2]?3:n<B[3]?5:9},"encodedSize");Ve.compareTokens=s(function(e,r){return e.value<r.value?1:e.value>r.value?-1:0},"compareTokens");function ge(t,e,r,n){j(t,e,r+n);let o=ne(t,e+r,e+r+n);return new l(a.bytes,o,r+n)}s(ge,"toToken");function en(t,e,r,n){return ge(t,e,1,r)}s(en,"decodeBytesCompact");function tn(t,e,r,n){return ge(t,e,2,S(t,e+1,n))}s(tn,"decodeBytes8");function rn(t,e,r,n){return ge(t,e,3,I(t,e+1,n))}s(rn,"decodeBytes16");function nn(t,e,r,n){return ge(t,e,5,M(t,e+1,n))}s(nn,"decodeBytes32");function on(t,e,r,n){let o=R(t,e+1,n);if(typeof o=="bigint")throw new Error(`${m} 64-bit integer bytes lengths not supported`);return ge(t,e,9,o)}s(on,"decodeBytes64");function He(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===a.string?jr(t.value):t.value),t.encodedBytes}s(He,"tokenBytes");function oe(t,e){let r=He(e);_(t,e.type.majorEncoded,r.length),t.push(r)}s(oe,"encodeBytes");oe.encodedSize=s(function(e){let r=He(e);return _.encodedSize(r.length)+r.length},"encodedSize");oe.compareTokens=s(function(e,r){return oi(He(e),He(r))},"compareTokens");function oi(t,e){return t.length<e.length?-1:t.length>e.length?1:je(t,e)}s(oi,"compareBytes");function ye(t,e,r,n,o){let i=r+n;j(t,e,i);let c=new l(a.string,zr(t,e+r,e+i),i);return o.retainStringBytes===!0&&(c.byteValue=ne(t,e+r,e+i)),c}s(ye,"toToken");function sn(t,e,r,n){return ye(t,e,1,r,n)}s(sn,"decodeStringCompact");function cn(t,e,r,n){return ye(t,e,2,S(t,e+1,n),n)}s(cn,"decodeString8");function an(t,e,r,n){return ye(t,e,3,I(t,e+1,n),n)}s(an,"decodeString16");function fn(t,e,r,n){return ye(t,e,5,M(t,e+1,n),n)}s(fn,"decodeString32");function un(t,e,r,n){let o=R(t,e+1,n);if(typeof o=="bigint")throw new Error(`${m} 64-bit integer string lengths not supported`);return ye(t,e,9,o,n)}s(un,"decodeString64");var dn=oe;function ie(t,e,r,n){return new l(a.array,n,r)}s(ie,"toToken");function ln(t,e,r,n){return ie(t,e,1,r)}s(ln,"decodeArrayCompact");function pn(t,e,r,n){return ie(t,e,2,S(t,e+1,n))}s(pn,"decodeArray8");function hn(t,e,r,n){return ie(t,e,3,I(t,e+1,n))}s(hn,"decodeArray16");function mn(t,e,r,n){return ie(t,e,5,M(t,e+1,n))}s(mn,"decodeArray32");function xn(t,e,r,n){let o=R(t,e+1,n);if(typeof o=="bigint")throw new Error(`${m} 64-bit integer array lengths not supported`);return ie(t,e,9,o)}s(xn,"decodeArray64");function gn(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${m} indefinite length items not allowed`);return ie(t,e,1,1/0)}s(gn,"decodeArrayIndefinite");function Ke(t,e){_(t,a.array.majorEncoded,e.value)}s(Ke,"encodeArray");Ke.compareTokens=v.compareTokens;Ke.encodedSize=s(function(e){return _.encodedSize(e.value)},"encodedSize");function se(t,e,r,n){return new l(a.map,n,r)}s(se,"toToken");function yn(t,e,r,n){return se(t,e,1,r)}s(yn,"decodeMapCompact");function wn(t,e,r,n){return se(t,e,2,S(t,e+1,n))}s(wn,"decodeMap8");function bn(t,e,r,n){return se(t,e,3,I(t,e+1,n))}s(bn,"decodeMap16");function En(t,e,r,n){return se(t,e,5,M(t,e+1,n))}s(En,"decodeMap32");function Cn(t,e,r,n){let o=R(t,e+1,n);if(typeof o=="bigint")throw new Error(`${m} 64-bit integer map lengths not supported`);return se(t,e,9,o)}s(Cn,"decodeMap64");function Tn(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${m} indefinite length items not allowed`);return se(t,e,1,1/0)}s(Tn,"decodeMapIndefinite");function We(t,e){_(t,a.map.majorEncoded,e.value)}s(We,"encodeMap");We.compareTokens=v.compareTokens;We.encodedSize=s(function(e){return _.encodedSize(e.value)},"encodedSize");function An(t,e,r,n){return new l(a.tag,r,1)}s(An,"decodeTagCompact");function Bn(t,e,r,n){return new l(a.tag,S(t,e+1,n),2)}s(Bn,"decodeTag8");function _n(t,e,r,n){return new l(a.tag,I(t,e+1,n),3)}s(_n,"decodeTag16");function kn(t,e,r,n){return new l(a.tag,M(t,e+1,n),5)}s(kn,"decodeTag32");function Dn(t,e,r,n){return new l(a.tag,R(t,e+1,n),9)}s(Dn,"decodeTag64");function Qe(t,e){_(t,a.tag.majorEncoded,e.value)}s(Qe,"encodeTag");Qe.compareTokens=v.compareTokens;Qe.encodedSize=s(function(e){return _.encodedSize(e.value)},"encodedSize");var ui=20,di=21,li=22,pi=23;function Un(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${m} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new l(a.null,null,1):new l(a.undefined,void 0,1)}s(Un,"decodeUndefined");function Sn(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${m} indefinite length items not allowed`);return new l(a.break,void 0,1)}s(Sn,"decodeBreak");function Wt(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${m} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${m} Infinity values are not supported`)}return new l(a.float,t,e)}s(Wt,"createToken");function In(t,e,r,n){return Wt(Qt(t,e+1),3,n)}s(In,"decodeFloat16");function Mn(t,e,r,n){return Wt(Xt(t,e+1),5,n)}s(Mn,"decodeFloat32");function Rn(t,e,r,n){return Wt(Ln(t,e+1),9,n)}s(Rn,"decodeFloat64");function Xe(t,e,r){let n=e.value;if(n===!1)t.push([a.float.majorEncoded|ui]);else if(n===!0)t.push([a.float.majorEncoded|di]);else if(n===null)t.push([a.float.majorEncoded|li]);else if(n===void 0)t.push([a.float.majorEncoded|pi]);else{let o,i=!1;(!r||r.float64!==!0)&&(vn(n),o=Qt(F,1),n===o||Number.isNaN(n)?(F[0]=249,t.push(F.slice(0,3)),i=!0):(Nn(n),o=Xt(F,1),n===o&&(F[0]=250,t.push(F.slice(0,5)),i=!0))),i||(hi(n),o=Ln(F,1),F[0]=251,t.push(F.slice(0,9)))}}s(Xe,"encodeFloat");Xe.encodedSize=s(function(e,r){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){vn(n);let o=Qt(F,1);if(n===o||Number.isNaN(n))return 3;if(Nn(n),o=Xt(F,1),n===o)return 5}return 9},"encodedSize");var On=new ArrayBuffer(9),N=new DataView(On,1),F=new Uint8Array(On,0);function vn(t){if(t===1/0)N.setUint16(0,31744,!1);else if(t===-1/0)N.setUint16(0,64512,!1);else if(Number.isNaN(t))N.setUint16(0,32256,!1);else{N.setFloat32(0,t);let e=N.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)N.setUint16(0,31744,!1);else if(r===0)N.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{let o=r-127;o<-24?N.setUint16(0,0):o<-14?N.setUint16(0,(e&2147483648)>>16|1<<24+o,!1):N.setUint16(0,(e&2147483648)>>16|o+15<<10|n>>13,!1)}}}s(vn,"encodeFloat16");function Qt(t,e){if(t.length-e<2)throw new Error(`${m} not enough data for float16`);let r=(t[e]<<8)+t[e+1];if(r===31744)return 1/0;if(r===64512)return-1/0;if(r===32256)return NaN;let n=r>>10&31,o=r&1023,i;return n===0?i=o*2**-24:n!==31?i=(o+1024)*2**(n-25):i=o===0?1/0:NaN,r&32768?-i:i}s(Qt,"readFloat16");function Nn(t){N.setFloat32(0,t,!1)}s(Nn,"encodeFloat32");function Xt(t,e){if(t.length-e<4)throw new Error(`${m} not enough data for float32`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}s(Xt,"readFloat32");function hi(t){N.setFloat64(0,t,!1)}s(hi,"encodeFloat64");function Ln(t,e){if(t.length-e<8)throw new Error(`${m} not enough data for float64`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}s(Ln,"readFloat64");Xe.compareTokens=v.compareTokens;function y(t,e,r){throw new Error(`${m} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}s(y,"invalidMinor");function Ge(t){return()=>{throw new Error(`${m} ${t}`)}}s(Ge,"errorer");var p=[];for(let t=0;t<=23;t++)p[t]=y;p[24]=Kr;p[25]=Wr;p[26]=Qr;p[27]=Xr;p[28]=y;p[29]=y;p[30]=y;p[31]=y;for(let t=32;t<=55;t++)p[t]=y;p[56]=Gr;p[57]=Zr;p[58]=Jr;p[59]=qr;p[60]=y;p[61]=y;p[62]=y;p[63]=y;for(let t=64;t<=87;t++)p[t]=en;p[88]=tn;p[89]=rn;p[90]=nn;p[91]=on;p[92]=y;p[93]=y;p[94]=y;p[95]=Ge("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)p[t]=sn;p[120]=cn;p[121]=an;p[122]=fn;p[123]=un;p[124]=y;p[125]=y;p[126]=y;p[127]=Ge("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)p[t]=ln;p[152]=pn;p[153]=hn;p[154]=mn;p[155]=xn;p[156]=y;p[157]=y;p[158]=y;p[159]=gn;for(let t=160;t<=183;t++)p[t]=yn;p[184]=wn;p[185]=bn;p[186]=En;p[187]=Cn;p[188]=y;p[189]=y;p[190]=y;p[191]=Tn;for(let t=192;t<=215;t++)p[t]=An;p[216]=Bn;p[217]=_n;p[218]=kn;p[219]=Dn;p[220]=y;p[221]=y;p[222]=y;p[223]=y;for(let t=224;t<=243;t++)p[t]=Ge("simple values are not supported");p[244]=y;p[245]=y;p[246]=y;p[247]=Un;p[248]=Ge("simple values are not supported");p[249]=In;p[250]=Mn;p[251]=Rn;p[252]=y;p[253]=y;p[254]=y;p[255]=Sn;var $=[];for(let t=0;t<24;t++)$[t]=new l(a.uint,t,1);for(let t=-1;t>=-24;t--)$[31-t]=new l(a.negint,t,1);$[64]=new l(a.bytes,new Uint8Array(0),1);$[96]=new l(a.string,"",1);$[128]=new l(a.array,0,1);$[160]=new l(a.map,0,1);$[244]=new l(a.false,!1,1);$[245]=new l(a.true,!0,1);$[246]=new l(a.null,null,1);function Gt(t){switch(t.type){case a.false:return z([244]);case a.true:return z([245]);case a.null:return z([246]);case a.bytes:return t.value.length?void 0:z([64]);case a.string:return t.value===""?z([96]):void 0;case a.array:return t.value===0?z([128]):void 0;case a.map:return t.value===0?z([160]):void 0;case a.uint:return t.value<24?z([Number(t.value)]):void 0;case a.negint:if(t.value>=-24)return z([31-Number(t.value)])}}s(Gt,"quickEncodeToken");var xi={float64:!1,mapSorter:wi,quickEncodeToken:Gt},$n=Object.freeze({float64:!0,mapSorter:bi,quickEncodeToken:Gt});function gi(){let t=[];return t[a.uint.major]=v,t[a.negint.major]=Ve,t[a.bytes.major]=oe,t[a.string.major]=dn,t[a.array.major]=Ke,t[a.map.major]=We,t[a.tag.major]=Qe,t[a.float.major]=Xe,t}s(gi,"makeCborEncoders");var Jt=gi(),Zt=new me,Ye=class Ye{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(`${Ht} object contains circular references`);return new Ye(r,e)}};s(Ye,"Ref");var Je=Ye,H={null:new l(a.null,null),undefined:new l(a.undefined,void 0),true:new l(a.true,!0),false:new l(a.false,!1),emptyArray:new l(a.array,0),emptyMap:new l(a.map,0)},K={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new l(a.float,t):t>=0?new l(a.uint,t):new l(a.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new l(a.uint,t):new l(a.negint,t)},Uint8Array(t,e,r,n){return new l(a.bytes,t)},string(t,e,r,n){return new l(a.string,t)},boolean(t,e,r,n){return t?H.true:H.false},null(t,e,r,n){return H.null},undefined(t,e,r,n){return H.undefined},ArrayBuffer(t,e,r,n){return new l(a.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new l(a.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[H.emptyArray,new l(a.break)]:H.emptyArray;n=Je.createCheck(n,t);let o=[],i=0;for(let c of t)o[i++]=Ze(c,r,n);return r.addBreakTokens?[new l(a.array,t.length),o,new l(a.break)]:[new l(a.array,t.length),o]},Object(t,e,r,n){let o=e!=="Object",i=o?t.keys():Object.keys(t),c=o?t.size:i.length;if(!c)return r.addBreakTokens===!0?[H.emptyMap,new l(a.break)]:H.emptyMap;n=Je.createCheck(n,t);let f=[],u=0;for(let d of i)f[u++]=[Ze(d,r,n),Ze(o?t.get(d):t[d],r,n)];return yi(f,r),r.addBreakTokens?[new l(a.map,c),f,new l(a.break)]:[new l(a.map,c),f]}};K.Map=K.Object;K.Buffer=K.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))K[`${t}Array`]=K.DataView;function Ze(t,e={},r){let n=Lr(t),o=e&&e.typeEncoders&&e.typeEncoders[n]||K[n];if(typeof o=="function"){let c=o(t,n,e,r);if(c!=null)return c}let i=K[n];if(!i)throw new Error(`${Ht} unsupported type: ${n}`);return i(t,n,e,r)}s(Ze,"objectToTokens");function yi(t,e){e.mapSorter&&t.sort(e.mapSorter)}s(yi,"sortMapEntries");function wi(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,i=Jt[o].compareTokens(r,n);return i===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),i}s(wi,"mapSorter");function bi(t,e){if(t[0]instanceof l&&e[0]instanceof l){let r=t[0],n=e[0];return r._keyBytes||(r._keyBytes=Fn(r.value)),n._keyBytes||(n._keyBytes=Fn(n.value)),je(r._keyBytes,n._keyBytes)}throw new Error("rfc8949MapSorter: complex key types are not supported yet")}s(bi,"rfc8949MapSorter");function Fn(t){return zn(t,Jt,$n)}s(Fn,"encodeRfc8949");function Pn(t,e,r,n){if(Array.isArray(e))for(let o of e)Pn(t,o,r,n);else r[e.type.major](t,e,n)}s(Pn,"tokensToEncoded");function zn(t,e,r){let n=Ze(t,r);if(!Array.isArray(n)&&r.quickEncodeToken){let o=r.quickEncodeToken(n);if(o)return o;let i=e[n.type.major];if(i.encodedSize){let c=i.encodedSize(n,r),f=new me(c);if(i(f,n,r),f.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return jt(f.chunks[0])}}return Zt.reset(),Pn(Zt,n,e,r),Zt.toBytes(!0)}s(zn,"encodeCustom");function we(t,e){return e=Object.assign({},xi,e),zn(t,Jt,e)}s(we,"encode");var Ei={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},Yt=class Yt{constructor(e,r={}){this._pos=0,this.data=e,this.options=r}pos(){return this._pos}done(){return this._pos>=this.data.length}next(){let e=this.data[this._pos],r=$[e];if(r===void 0){let n=p[e];if(!n)throw new Error(`${m} 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}};s(Yt,"Tokeniser");var qe=Yt,be=Symbol.for("DONE"),et=Symbol.for("BREAK");function Ci(t,e,r){let n=[];for(let o=0;o<t.value;o++){let i=ce(e,r);if(i===et){if(t.value===1/0)break;throw new Error(`${m} got unexpected break to lengthed array`)}if(i===be)throw new Error(`${m} found array but not enough entries (got ${o}, expected ${t.value})`);n[o]=i}return n}s(Ci,"tokenToArray");function Ti(t,e,r){let n=r.useMaps===!0,o=n?void 0:{},i=n?new Map:void 0;for(let c=0;c<t.value;c++){let f=ce(e,r);if(f===et){if(t.value===1/0)break;throw new Error(`${m} got unexpected break to lengthed map`)}if(f===be)throw new Error(`${m} found map but not enough entries (got ${c} [no key], expected ${t.value})`);if(n!==!0&&typeof f!="string")throw new Error(`${m} non-string keys not supported (got ${typeof f})`);if(r.rejectDuplicateMapKeys===!0&&(n&&i.has(f)||!n&&f in o))throw new Error(`${m} found repeat map key "${f}"`);let u=ce(e,r);if(u===be)throw new Error(`${m} found map but not enough entries (got ${c} [no value], expected ${t.value})`);n?i.set(f,u):o[f]=u}return n?i:o}s(Ti,"tokenToMap");function ce(t,e){if(t.done())return be;let r=t.next();if(r.type===a.break)return et;if(r.type.terminal)return r.value;if(r.type===a.array)return Ci(r,t,e);if(r.type===a.map)return Ti(r,t,e);if(r.type===a.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=ce(t,e);return e.tags[r.value](n)}throw new Error(`${m} tag not supported (${r.value})`)}throw new Error("unsupported")}s(ce,"tokensToObject");function jn(t,e){if(!(t instanceof Uint8Array))throw new Error(`${m} data to decode must be a Uint8Array`);e=Object.assign({},Ei,e);let r=e.tokenizer||new qe(t,e),n=ce(r,e);if(n===be)throw new Error(`${m} did not find any content to decode`);if(n===et)throw new Error(`${m} got unexpected break`);return[n,t.subarray(r.pos())]}s(jn,"decodeFirst");function Ee(t,e){let[r,n]=jn(t,e);if(n.length>0)throw new Error(`${m} too many terminals, data makes no sense`);return r}s(Ee,"decode");var qt=class qt extends Error{constructor(e,r){super(),this.message=r,this.value=e,this.stack=new Error(`${e}: ${r}`).stack,this.name=this.constructor.name}};s(qt,"CborldError");var C=qt;var P=new Map([["@context",0],["@type",2],["@id",4],["@value",6],["@direction",8],["@graph",10],["@included",12],["@index",14],["@json",16],["@language",18],["@list",20],["@nest",22],["@reverse",24],["@base",26],["@container",28],["@default",30],["@embed",32],["@explicit",34],["@none",36],["@omitDefault",38],["@prefix",40],["@preserve",42],["@protected",44],["@requireAll",46],["@set",48],["@version",50],["@vocab",52]]),rt=100;var er=class er{decode({value:e}={}){throw new Error("Must be implemented by derived class.")}static createDecoder({value:e,transformer:r}={}){throw new Error("Must be implemented by derived class.")}};s(er,"CborldDecoder");var A=er;var tr=new Map,rr=new Map;T(16,"https://www.w3.org/ns/activitystreams");T(17,"https://www.w3.org/2018/credentials/v1");T(18,"https://www.w3.org/ns/did/v1");T(19,"https://w3id.org/security/suites/ed25519-2018/v1");T(20,"https://w3id.org/security/suites/ed25519-2020/v1");T(21,"https://w3id.org/cit/v1");T(22,"https://w3id.org/age/v1");T(23,"https://w3id.org/security/suites/x25519-2020/v1");T(24,"https://w3id.org/veres-one/v1");T(25,"https://w3id.org/webkms/v1");T(26,"https://w3id.org/zcap/v1");T(27,"https://w3id.org/security/suites/hmac-2019/v1");T(28,"https://w3id.org/security/suites/aes-2019/v1");T(29,"https://w3id.org/vaccination/v1");T(30,"https://w3id.org/vc-revocation-list-2020/v1");T(31,"https://w3id.org/dcc/v1");T(32,"https://w3id.org/vc/status-list/v1");T(48,"https://w3id.org/security/data-integrity/v1");T(49,"https://w3id.org/security/multikey/v1");T(50,"https://purl.imsglobal.org/spec/ob/v3p0/context.json");T(51,"https://w3id.org/security/data-integrity/v2");function T(t,e){rr.set(e,t),tr.set(t,e)}s(T,"_addRegistration");var nt=class nt extends A{constructor({reverseAppContextMap:e}={}){super(),this.reverseAppContextMap=e}decode({value:e}={}){if(typeof e!="number")return nr(e);let r=tr.get(e)||this.reverseAppContextMap.get(e);if(r===void 0)throw new C("ERR_UNDEFINED_COMPRESSED_CONTEXT",`Undefined compressed context "${e}".`);return r}static createDecoder({transformer:e}={}){let{reverseAppContextMap:r}=e;return new nt({reverseAppContextMap:r})}};s(nt,"ContextDecoder");var Ce=nt;function nr(t){if(Array.isArray(t))return t.map(nr);if(!(t instanceof Map))return t;let e={};for(let[r,n]of t)e[r]=nr(n);return e}s(nr,"_mapToObject");function W(t,e){return JSON.stringify(t,null,2)}s(W,"inspect");var Xn="3.7.8",Ai=Xn,fe=typeof Buffer=="function",Vn=typeof TextDecoder=="function"?new TextDecoder:void 0,Hn=typeof TextEncoder=="function"?new TextEncoder:void 0,Bi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Te=Array.prototype.slice.call(Bi),ot=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(Te),_i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,k=String.fromCharCode.bind(String),Kn=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),Gn=s(t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),"_mkUriSafe"),Zn=s(t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),"_tidyB64"),Jn=s(t=>{let e,r,n,o,i="",c=t.length%3;for(let f=0;f<t.length;){if((r=t.charCodeAt(f++))>255||(n=t.charCodeAt(f++))>255||(o=t.charCodeAt(f++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|o,i+=Te[e>>18&63]+Te[e>>12&63]+Te[e>>6&63]+Te[e&63]}return c?i.slice(0,c-3)+"===".substring(c):i},"btoaPolyfill"),sr=typeof btoa=="function"?t=>btoa(t):fe?t=>Buffer.from(t,"binary").toString("base64"):Jn,or=fe?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,o=t.length;n<o;n+=4096)r.push(k.apply(null,t.subarray(n,n+4096)));return sr(r.join(""))},it=s((t,e=!1)=>e?Gn(or(t)):or(t),"fromUint8Array"),ki=s(t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?k(192|e>>>6)+k(128|e&63):k(224|e>>>12&15)+k(128|e>>>6&63)+k(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return k(240|e>>>18&7)+k(128|e>>>12&63)+k(128|e>>>6&63)+k(128|e&63)}},"cb_utob"),Di=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Yn=s(t=>t.replace(Di,ki),"utob"),Wn=fe?t=>Buffer.from(t,"utf8").toString("base64"):Hn?t=>or(Hn.encode(t)):t=>sr(Yn(t)),ae=s((t,e=!1)=>e?Gn(Wn(t)):Wn(t),"encode"),Qn=s(t=>ae(t,!0),"encodeURI"),Ui=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Si=s(t=>{switch(t.length){case 4:var e=(7&t.charCodeAt(0))<<18|(63&t.charCodeAt(1))<<12|(63&t.charCodeAt(2))<<6|63&t.charCodeAt(3),r=e-65536;return k((r>>>10)+55296)+k((r&1023)+56320);case 3:return k((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return k((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},"cb_btou"),qn=s(t=>t.replace(Ui,Si),"btou"),eo=s(t=>{if(t=t.replace(/\s+/g,""),!_i.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(t.length&3));let e,r,n,o=[];for(let i=0;i<t.length;)e=ot[t.charAt(i++)]<<18|ot[t.charAt(i++)]<<12|(r=ot[t.charAt(i++)])<<6|(n=ot[t.charAt(i++)]),r===64?o.push(k(e>>16&255)):n===64?o.push(k(e>>16&255,e>>8&255)):o.push(k(e>>16&255,e>>8&255,e&255));return o.join("")},"atobPolyfill"),cr=typeof atob=="function"?t=>atob(Zn(t)):fe?t=>Buffer.from(t,"base64").toString("binary"):eo,to=fe?t=>Kn(Buffer.from(t,"base64")):t=>Kn(cr(t).split("").map(e=>e.charCodeAt(0))),ro=s(t=>to(no(t)),"toUint8Array"),Ii=fe?t=>Buffer.from(t,"base64").toString("utf8"):Vn?t=>Vn.decode(to(t)):t=>qn(cr(t)),no=s(t=>Zn(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),"_unURI"),ir=s(t=>Ii(no(t)),"decode"),Mi=s(t=>{if(typeof t!="string")return!1;let e=t.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},"isValid"),oo=s(t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),"_noEnum"),io=s(function(){let t=s((e,r)=>Object.defineProperty(String.prototype,e,oo(r)),"_add");t("fromBase64",function(){return ir(this)}),t("toBase64",function(e){return ae(this,e)}),t("toBase64URI",function(){return ae(this,!0)}),t("toBase64URL",function(){return ae(this,!0)}),t("toUint8Array",function(){return ro(this)})},"extendString"),so=s(function(){let t=s((e,r)=>Object.defineProperty(Uint8Array.prototype,e,oo(r)),"_add");t("toBase64",function(e){return it(this,e)}),t("toBase64URI",function(){return it(this,!0)}),t("toBase64URL",function(){return it(this,!0)})},"extendUint8Array"),Ri=s(()=>{io(),so()},"extendBuiltins"),st={version:Xn,VERSION:Ai,atob:cr,atobPolyfill:eo,btoa:sr,btoaPolyfill:Jn,fromBase64:ir,toBase64:ae,encode:ae,encodeURI:Qn,encodeURL:Qn,utob:Yn,btou:qn,decode:ir,isValid:Mi,fromUint8Array:it,toUint8Array:ro,extendString:io,extendUint8Array:so,extendBuiltins:Ri};var co={};function ao(t,e,r){if(!(t instanceof Uint8Array))throw new TypeError('"input" must be a Uint8Array.');if(typeof e!="string")throw new TypeError('"alphabet" must be a string.');if(r!==void 0&&typeof r!="number")throw new TypeError('"maxline" must be a number.');if(t.length===0)return"";let n="",o=0,i=e.length,c=e.charAt(0),f=[0];for(o=0;o<t.length;++o){let u=t[o];for(let d=0;d<f.length;++d)u+=f[d]<<8,f[d]=u%i,u=u/i|0;for(;u>0;)f.push(u%i),u=u/i|0}for(o=0;t[o]===0&&o<t.length-1;++o)n+=c;for(o=f.length-1;o>=0;--o)n+=e[f[o]];if(r){let u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r
2
2
  `)}return n}s(ao,"encode");function fo(t,e){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=co[e];if(!r){r=co[e]=[];for(let c=0;c<e.length;++c)r[e.charCodeAt(c)]=c}t=t.replace(/\s/g,"");let n=e.length,o=e.charAt(0),i=[0];for(let c=0;c<t.length;c++){let f=r[t.charCodeAt(c)];if(f===void 0)return;let u=f;for(let d=0;d<i.length;++d)u+=i[d]*n,i[d]=u&255,u>>=8;for(;u>0;)i.push(u&255),u>>=8}for(let c=0;t[c]===o&&c<t.length-1;++c)i.push(0);return new Uint8Array(i.reverse())}s(fo,"decode");var uo="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function Ae(t,e){return ao(t,uo,e)}s(Ae,"encode");function ct(t){return fo(t,uo)}s(ct,"decode");var ft=class ft extends A{decode({value:e}={}){let{buffer:r,byteOffset:n,length:o}=e,i=new Uint8Array(r,n+1,o-1);return e[0]===122?`z${Ae(i)}`:e[0]===77?`M${st.fromUint8Array(i)}`:e}static createDecoder({value:e}={}){if(!(e instanceof Uint8Array))return!1;if(e[0]===122||e[0]===77)return new ft}};s(ft,"MultibaseDecoder");var at=ft;var ar=class ar{constructor({appContextMap:e,documentLoader:r}={}){this.appContextMap=e,this.documentLoader=r}_beforeObjectContexts(){}_afterObjectContexts(){}_beforeTypeScopedContexts(){}async _transform({obj:e,transformMap:r,contextStack:n=[]}){this._beforeObjectContexts({obj:e,transformMap:r});let o=await this._applyEmbeddedContexts({obj:e,contextStack:n});this._afterObjectContexts({obj:e,transformMap:r});let i=n.slice();this._beforeTypeScopedContexts({activeCtx:o,obj:e,transformMap:r}),o=await this._applyTypeScopedContexts({obj:e,contextStack:n});let{aliases:c,scopedContextMap:f,termMap:u}=o,d=this._getEntries({obj:e,transformMap:r,transformer:this,termMap:u});for(let[h,x]of d){let{term:g}=h;if(g==="@id"||c.id.has(g)){this._transformObjectId({obj:e,transformMap:r,termInfo:h,value:x});continue}if(g==="@type"||c.type.has(g)){this._transformObjectType({obj:e,transformMap:r,termInfo:h,value:x});continue}let w=i,U,Fe=f.get(g);Fe&&(U=await this._applyEmbeddedContexts({obj:{"@context":Fe},contextStack:n}),w=n.slice());let{plural:$e,def:$t}=h,L=this._getTermType({activeCtx:U||o,def:$t}),Pe=$e?x:[x],te=[];for(let X of Pe){if(X===null){te.push(null);continue}if(!this._transformTypedValue({entries:te,termType:L,value:X,termInfo:h})){if(typeof X!="object"){te.push(X);continue}if(Array.isArray(X)){await this._transformArray({entries:te,contextStack:w,value:X});continue}await this._transformObject({entries:te,contextStack:w,value:X})}}U&&U.revert(),this._assignEntries({entries:te,obj:e,transformMap:r,termInfo:h})}o.revert()}async _applyEmbeddedContexts({obj:e,contextStack:r}){let n=r.length,o=e["@context"];await this._updateContextStack({contextStack:r,contexts:o});let i=r[r.length-1];return i||(i={aliases:{id:new Set,type:new Set},context:{},scopedContextMap:new Map,termMap:new Map}),{...i,revert(){r.length=n}}}async _applyTypeScopedContexts({obj:e,contextStack:r}){let n=r.length,o=r[r.length-1];o||(o={aliases:{id:new Set,type:new Set},context:{},scopedContextMap:new Map,termMap:new Map});let{aliases:i}=o,c=[],f=["@type",...i.type];for(let d of f){let h=e[d];Array.isArray(h)?c.push(...h):c.push(h)}c=[...new Set(c)].sort();let{scopedContextMap:u}=o;for(let d of c){let h=u.get(d);h&&(await this._updateContextStack({contextStack:r,contexts:h}),o=r[r.length-1],{scopedContextMap:u}=o)}return{...o,revert(){r.length=n}}}async _updateContextStack({contextStack:e,contexts:r,transformer:n}){if(!r)return;Array.isArray(r)||(r=[r]);let{contextMap:o}=this;for(let i of r){let c=o.get(i);if(!c){let g=i,w;typeof i=="string"&&(w=i,{"@context":g}=await this._getDocument({url:w})),c=await this._addContext({context:g,contextUrl:w,transformer:n})}let f={aliases:{id:new Set(c.aliases.id),type:new Set(c.aliases.type)},context:i,scopedContextMap:new Map(c.scopedContextMap),termMap:new Map(c.termMap)},u=e[e.length-1];if(e.push(f),!u)continue;let{aliases:d,termMap:h}=f;for(let g of["id","type"])for(let w of u.aliases[g])i[w]===null||f.termMap.has(w)||d[g].add(w);let{scopedContextMap:x}=f;for(let[g,w]of u.scopedContextMap)i[g]===null||x.has(g)||x.set(g,w);for(let[g,w]of u.termMap)i[g]===null||h.has(g)||h.set(g,w)}}async _addContext({context:e,contextUrl:r}){let{contextMap:n,termToId:o,idToTerm:i}=this,c=e["@import"];if(c){let x=n.get(c);if(!x){let{"@context":g}=await this._getDocument({url:c});x=await this._addContext({context:g,contextUrl:c})}e={...x.context,...e}}let f=new Map,u=new Map,d={aliases:{id:new Set,type:new Set},context:e,scopedContextMap:f,termMap:u},h=Object.keys(e).sort();for(let x of h){let g=e[x];if(!g||(g==="@id"||g.id==="@id"?d.aliases.id.add(x):(g==="@type"||g.id==="@type")&&d.aliases.type.add(x),P.has(x)))continue;if(!o.has(x)){let U=this.nextTermId;this.nextTermId+=2,o.set(x,U),i&&i.set(U,x)}u.set(x,g);let w=g["@context"];w&&f.set(x,w)}return n.set(r||e,d),d}async _getDocument({url:e}){let{document:r}=await this.documentLoader(e);return typeof r=="string"?JSON.parse(r):r}_getTermType({activeCtx:e,def:r}){let{"@type":n}=r;if(!n)return;let[o,...i]=n.split(":"),c=e.termMap.get(o);if(c===void 0)return n;if(typeof c=="string")return c+i.join(":");if(!(typeof c=="object"&&typeof c["@id"]=="string"))throw new C("ERR_INVALID_TERM_DEFINITION",'JSON-LD term definitions must be strings or objects with "@id".');return c["@id"]+i.join(":")}_getIdForTerm({term:e,plural:r}){let n=this.termToId.get(e);if(n===void 0)throw new C("ERR_UNDEFINED_TERM","CBOR-LD compression requires all terms to be defined in a JSON-LD context.");return r?n+1:n}_getTermForId({id:e}){let r=(e&1)===1;return{term:this.idToTerm.get(r?e-1:e),plural:r}}};s(ar,"Transformer");var ue=ar;var lo=new Map([[1024,"did:v1:nym:"],[1025,"did:key:"]]),ut=class ut extends A{decode({value:e}={}){let r=lo.get(e[0]);return typeof e[1]=="string"?r+=e[1]:r+=`z${Ae(e[1])}`,e.length>2&&(typeof e[2]=="string"?r+=`#${e[2]}`:r+=`#z${Ae(e[2])}`),r}static createDecoder({value:e}={}){return!(Array.isArray(e)&&e.length>1&&e.length<=3)||!lo.has(e[0])?!1:new ut}};s(ut,"Base58DidUrlDecoder");var Be=ut;var dt=class dt extends A{constructor({secure:e}={}){super(),this.secure=e}decode({value:e}={}){return`${this.secure?"https://":"http://"}${e[1]}`}static createDecoder({value:e}={}){return e.length===2&&typeof e[1]=="string"?new dt({secure:e[0]===2}):!1}};s(dt,"HttpUrlDecoder");var _e=dt;var po=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Oi(t){return typeof t=="string"&&po.test(t)}s(Oi,"validate");var lt=Oi;var D=[];for(let t=0;t<256;++t)D.push((t+256).toString(16).slice(1));function vi(t,e=0){return D[t[e+0]]+D[t[e+1]]+D[t[e+2]]+D[t[e+3]]+"-"+D[t[e+4]]+D[t[e+5]]+"-"+D[t[e+6]]+D[t[e+7]]+"-"+D[t[e+8]]+D[t[e+9]]+"-"+D[t[e+10]]+D[t[e+11]]+D[t[e+12]]+D[t[e+13]]+D[t[e+14]]+D[t[e+15]]}s(vi,"unsafeStringify");function Ni(t,e=0){let r=vi(t,e);if(!lt(r))throw TypeError("Stringified UUID is invalid");return r}s(Ni,"stringify");var fr=Ni;function Li(t){if(!lt(t))throw TypeError("Invalid UUID");let e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}s(Li,"parse");var ur=Li;var ht=class ht extends A{decode({value:e}={}){return`urn:uuid:${typeof e[1]=="string"?e[1]:fr(e[1])}`}static createDecoder({value:e}={}){if(e.length===2&&(typeof e[1]=="string"||e[1]instanceof Uint8Array))return new ht}};s(ht,"UuidUrnDecoder");var pt=ht;var Fi=new Map([[1,_e],[2,_e],[3,pt],[1024,Be],[1025,Be]]),dr=class dr extends A{static createDecoder({value:e}={}){if(!(Array.isArray(e)||e.length>1))return!1;let r=Fi.get(e[0]);return r&&r.createDecoder({value:e})}};s(dr,"UriDecoder");var Z=dr;var mt=class mt extends A{constructor({term:e}={}){super(),this.term=e}decode(){return this.term}static createDecoder({value:e,transformer:r}={}){if(Array.isArray(e))return Z.createDecoder({value:e,transformer:r});let n=r.idToTerm.get(e);if(n!==void 0)return new mt({term:n})}};s(mt,"VocabTermDecoder");var J=mt;var gt=class gt extends A{decode({value:e}={}){let r=new Date(e*1e3).toISOString();return r.substring(0,r.indexOf("T"))}static createDecoder({value:e}={}){if(typeof e=="number")return new gt}};s(gt,"XsdDateDecoder");var xt=gt;var ke=class ke extends A{constructor({value:e}={}){super(),this.value=e}decode({value:e}={}){return typeof e=="number"?new Date(e*1e3).toISOString().replace(".000Z","Z"):new Date(e[0]*1e3+e[1]).toISOString()}static createDecoder({value:e}={}){if(typeof e=="number")return new ke;if(Array.isArray(e)&&e.length===2&&(typeof e[0]=="number"||typeof e[1]=="number"))return new ke}};s(ke,"XsdDateTimeDecoder");var yt=ke;var $i=new Map([["@id",Z],["@vocab",J],["https://w3id.org/security#multibase",at],["http://www.w3.org/2001/XMLSchema#date",xt],["http://www.w3.org/2001/XMLSchema#dateTime",yt]]),lr=P.get("@context"),ho=lr+1,pr=class pr extends ue{constructor({documentLoader:e,appContextMap:r}={}){if(super({documentLoader:e,appContextMap:r}),this.reverseAppContextMap=new Map,r)for(let[n,o]of r)this.reverseAppContextMap.set(o,n)}async decompress({compressedBytes:e,diagnose:r}={}){this.contextMap=new Map,this.termToId=new Map(P),this.nextTermId=rt,this.idToTerm=new Map;for(let[f,u]of this.termToId)this.idToTerm.set(u,f);let n=Ee(e,{useMaps:!0});r&&(r("Diagnostic CBOR-LD decompression transform map(s):"),r(W(n,{depth:null,colors:!0})));let o=[],i=Array.isArray(n),c=i?n:[n];for(let f of c){let u={};await this._transform({obj:u,transformMap:f}),o.push(u)}return i?o:o[0]}_beforeObjectContexts({obj:e,transformMap:r}){let n=r.get(lr);if(n){let i=Ce.createDecoder({value:n,transformer:this});e["@context"]=i?i.decode({value:n}):n}let o=r.get(ho);if(o){if(n)throw new C("ERR_INVALID_ENCODED_CONTEXT","Both singular and plural context IDs were found in the CBOR-LD input.");if(!Array.isArray(o))throw new C("ERR_INVALID_ENCODED_CONTEXT","Encoded plural context value must be an array.");let i=[];for(let c of o){let f=Ce.createDecoder({value:c,transformer:this});i.push(f?f.decode({value:c}):c)}e["@context"]=i}}_beforeTypeScopedContexts({activeCtx:e,obj:r,transformMap:n}){let{termToId:o}=this,i=["@type",...e.aliases.type];for(let c of i){let f=o.get(c),u=n.get(f);if(u===void 0&&(u=n.get(f+1)),u!==void 0)if(Array.isArray(u))r[c]=u.map(d=>{let h=J.createDecoder({value:d,transformer:this});return h?h.decode({value:d}):d});else{let d=J.createDecoder({value:u,transformer:this});r[c]=d?d.decode({value:u}):u}}}_getEntries({transformMap:e,termMap:r}){let n=[];for(let[o,i]of e){if(o===lr||o===ho)continue;let{term:c,plural:f}=this._getTermForId({id:o});if(c===void 0)throw new C("ERR_UNKNOWN_CBORLD_TERM_ID",`Unknown term ID '${o}' was detected in the CBOR-LD input.`);let u=r.get(c);if(u===void 0&&!(c.startsWith("@")&&P.has(c)))throw new C("ERR_UNKNOWN_CBORLD_TERM",`Unknown term "${c}" was detected in the CBOR-LD input.`);n.push([{term:c,termId:o,plural:f,def:u},i])}return n.sort(Pi)}_getTermInfo({termMap:e,key:r}){let{term:n,plural:o}=this._getTermForId({id:r});if(n===void 0)throw new C("ERR_UNKNOWN_CBORLD_TERM_ID",`Unknown term ID '${r}' was detected in the CBOR-LD input.`);let i=e.get(n);if(i===void 0&&!(n.startsWith("@")&&P.has(n)))throw new C("ERR_UNKNOWN_CBORLD_TERM",`Unknown term "${n}" was detected in the CBOR-LD input.`);return{term:n,termId:r,plural:o,def:i}}_transformObjectId({obj:e,termInfo:r,value:n}){let o=Z.createDecoder({value:n});e[r.term]=o?o.decode({value:n}):n}_transformObjectType({obj:e,termInfo:r,value:n}){let{term:o,plural:i}=r,c=i?n:[n],f=[];for(let u of c){let d=J.createDecoder({value:u,transformer:this});f.push(d?d.decode({value:u}):u)}e[o]=i?f:f[0]}_transformTypedValue({entries:e,termType:r,value:n}){let o=$i.get(r),i=o&&o.createDecoder({value:n,transformer:this});if(i)return e.push(i.decode({value:n})),!0}async _transformArray({entries:e,contextStack:r,value:n}){let o=[];for(let i of n){let c={};o.push(c),await this._transform({obj:c,transformMap:i,contextStack:r})}e.push(o)}async _transformObject({entries:e,contextStack:r,value:n}){let o={};return e.push(o),this._transform({obj:o,transformMap:n,contextStack:r})}_assignEntries({entries:e,obj:r,termInfo:n}){let{term:o,plural:i}=n;r[o]=i?e:e[0]}};s(pr,"Decompressor");var wt=pr;function Pi([{term:t}],[{term:e}]){return t<e?-1:t>e?1:0}s(Pi,"_sortEntriesByTerm");async function hr({cborldBytes:t,documentLoader:e,appContextMap:r=new Map,diagnose:n}){if(!(t instanceof Uint8Array))throw new TypeError('"cborldBytes" must be a Uint8Array.');let o=0;if(t[o++]!==217)throw new C("ERR_NOT_CBORLD",'CBOR-LD must start with a CBOR major type "Tag" header of `0xd9`.');if(t[o++]!==5)throw new C("ERR_NOT_CBORLD","CBOR-LD 16-bit tag must start with `0x05`.");let i=t[o];if(i===void 0)throw new C("ERR_NOT_CBORLD","Truncated CBOR-LD 16-bit tag.");if(!(i===0||i===1))throw new C("ERR_NOT_CBORLD",`Unsupported CBOR-LD compression mode "${i}".`);o++;let{buffer:c,byteOffset:f,length:u}=t,d=new Uint8Array(c,f+o,u-o);if(i===0)return Ee(d,{useMaps:!1});let x=await new wt({documentLoader:e,appContextMap:r}).decompress({compressedBytes:d,diagnose:n});return n&&(n("Diagnostic JSON-LD result:"),n(W(x,{depth:null,colors:!0}))),x}s(hr,"decode");var mr=class mr{encode(){throw new Error("Must be implemented by derived class.")}static createEncoder({value:e}={}){throw new Error("Must be implemented by derived class.")}};s(mr,"CborldEncoder");var b=mr;var Et=class Et extends b{constructor({context:e,appContextMap:r}={}){super(),this.context=e,this.appContextMap=r}encode(){let{context:e}=this,r=rr.get(e)||this.appContextMap.get(e);return r===void 0?new l(a.string,e):new l(a.uint,r)}static createEncoder({value:e,transformer:r}={}){if(typeof e!="string")return!1;let{appContextMap:n}=r;return new Et({context:e,appContextMap:n})}};s(Et,"ContextEncoder");var bt=Et;var Tt=class Tt extends b{constructor({value:e}={}){super(),this.value=e}encode(){let{value:e}=this,r,n;e[0]==="z"?(r=122,n=ct(e.substr(1))):e[0]==="M"&&(r=77,n=st.toUint8Array(e.substr(1)));let o=new Uint8Array(1+n.length);return o[0]=r,o.set(n,1),new l(a.bytes,o)}static createEncoder({value:e}={}){if(typeof e!="string")return!1;if(e[0]==="z"||e[0]==="M")return new Tt({value:e})}};s(Tt,"MultibaseEncoder");var Ct=Tt;var mo=new Map([["did:v1:nym:",1024],["did:key:",1025]]),At=class At extends b{constructor({value:e,scheme:r}={}){super(),this.value=e,this.scheme=r}encode(){let{value:e,scheme:r}=this,n=e.substr(r.length),[o,i]=n.split("#"),c=[new l(a.uint,mo.get(r)),xo(o)];return i!==void 0&&c.push(xo(i)),[new l(a.array,c.length),c]}static createEncoder({value:e}={}){let r=[...mo.keys()];for(let n of r)if(e.startsWith(n))return new At({value:e,scheme:n})}};s(At,"Base58DidUrlEncoder");var De=At;function xo(t){if(t.startsWith("z")){let e=ct(t.substr(1));if(e)return new l(a.bytes,e)}return new l(a.string,t)}s(xo,"_multibase58ToToken");var Ue=class Ue extends b{constructor({value:e,secure:r}={}){super(),this.value=e,this.secure=r}encode(){let{value:e,secure:r}=this,n=r?8:7,o=[new l(a.uint,r?2:1),new l(a.string,e.substr(n))];return[new l(a.array,o.length),o]}static createEncoder({value:e}={}){if(e.startsWith("https://"))return new Ue({value:e,secure:!0});if(e.startsWith("http://"))return new Ue({value:e,secure:!1})}};s(Ue,"HttpUrlEncoder");var Se=Ue;var _t=class _t extends b{constructor({value:e}={}){super(),this.value=e}encode(){let{value:e}=this,r=e.substr(9),n=[new l(a.uint,3)];if(r.toLowerCase()===r){let o=ur(r);n.push(new l(a.bytes,o))}else n.push(new l(a.string,r));return[new l(a.array,n.length),n]}static createEncoder({value:e}={}){if(e.startsWith("urn:uuid:"))return new _t({value:e})}};s(_t,"UuidUrnEncoder");var Bt=_t;var zi=new Map([["http",Se],["https",Se],["urn:uuid",Bt],["did:v1:nym",De],["did:key",De]]),xr=class xr extends b{static createEncoder({value:e}={}){if(typeof e!="string")return!1;let r;try{let{protocol:o,pathname:i}=new URL(e);r=o,i.includes(":")&&(r+=i);let c=e.split(":");c.pop(),r=c.join(":")}catch{return!1}let n=zi.get(r);return n&&n.createEncoder({value:e})}};s(xr,"UriEncoder");var Y=xr;var kt=class kt extends b{constructor({termId:e}={}){super(),this.termId=e}encode(){return new l(a.uint,this.termId)}static createEncoder({value:e,transformer:r}={}){let{termToId:n}=r,o=n.get(e);return o!==void 0?new kt({termId:o}):Y.createEncoder({value:e})}};s(kt,"VocabTermEncoder");var Ie=kt;var Ut=class Ut extends b{constructor({value:e,parsed:r}={}){super(),this.value=e,this.parsed=r}encode(){let{value:e,parsed:r}=this,n=Math.floor(r/1e3),o=new Date(n*1e3).toISOString(),i=o.substring(0,o.indexOf("T"));return e!==i?new l(a.string,e):new l(a.uint,n)}static createEncoder({value:e}={}){if(e.includes("T"))return!1;let r=Date.parse(e);return isNaN(r)?!1:new Ut({value:e,parsed:r})}};s(Ut,"XsdDateEncoder");var Dt=Ut;var It=class It extends b{constructor({value:e,parsed:r}={}){super(),this.value=e,this.parsed=r}encode(){let{value:e,parsed:r}=this,n=Math.floor(r/1e3),o=new l(a.uint,n),i=e.indexOf(".");if(i===-1){let d=new Date(n*1e3).toISOString().replace(".000Z","Z");return e!==d?new l(a.string,e):o}let c=parseInt(e.substr(i+1),10),f=new Date(n*1e3+c).toISOString();if(e!==f)return new l(a.string,e);let u=[o,new l(a.uint,c)];return[new l(a.array,u.length),u]}static createEncoder({value:e}={}){if(!e.includes("T"))return!1;let r=Date.parse(e);return isNaN(r)?!1:new It({value:e,parsed:r})}};s(It,"XsdDateTimeEncoder");var St=It;var ji=new Map([["@id",Y],["@vocab",Ie],["https://w3id.org/security#multibase",Ct],["http://www.w3.org/2001/XMLSchema#date",Dt],["http://www.w3.org/2001/XMLSchema#dateTime",St]]),go=P.get("@context"),Vi=go+1,Hi={Object(t){if(t instanceof b)return t.encode({obj:t})}},gr=class gr extends ue{constructor({documentLoader:e,appContextMap:r}={}){super({documentLoader:e,appContextMap:r})}async compress({jsonldDocument:e,diagnose:r}={}){let n=await this._createTransformMaps({jsonldDocument:e});return r&&(r("Diagnostic CBOR-LD compression transform map(s):"),r(W(n,{depth:null,colors:!0}))),we(n,{typeEncoders:Hi})}async _createTransformMaps({jsonldDocument:e}){this.contextMap=new Map,this.termToId=new Map(P),this.nextTermId=rt;let r=[],n=Array.isArray(e),o=n?e:[e];for(let i of o){let c=new Map;await this._transform({obj:i,transformMap:c}),r.push(c)}return n?r:r[0]}_afterObjectContexts({obj:e,transformMap:r}){let n=e["@context"];if(!n)return;let o=[],i=Array.isArray(n),c=i?n:[n];for(let u of c){let d=bt.createEncoder({value:u,transformer:this});o.push(d||u)}let f=i?Vi:go;r.set(f,i?o:o[0])}_getEntries({obj:e,termMap:r}){let n=[],o=Object.keys(e).sort();for(let i of o){if(i==="@context")continue;let c=r.get(i);if(c===void 0&&!(i.startsWith("@")&&P.has(i)))throw new C("ERR_UNKNOWN_CBORLD_TERM",`Unknown term '${i}' was detected in the JSON-LD input.`);let f=e[i],u=Array.isArray(f),d=this._getIdForTerm({term:i,plural:u});n.push([{term:i,termId:d,plural:u,def:c},f])}return n}_transformObjectId({transformMap:e,termInfo:r,value:n}){let{termId:o}=r,i=Y.createEncoder({value:n,transformer:this,termInfo:r});e.set(o,i||n)}_transformObjectType({transformMap:e,termInfo:r,value:n}){let{termId:o,plural:i}=r,c=i?n:[n],f=[];for(let u of c){let d=Ie.createEncoder({value:u,transformer:this,termInfo:r});f.push(d||u)}e.set(o,i?f:f[0])}_transformTypedValue({entries:e,termType:r,value:n,termInfo:o}){let i=ji.get(r),c=i&&i.createEncoder({value:n,transformer:this,termInfo:o});if(c)return e.push(c),!0}async _transformArray({entries:e,contextStack:r,value:n}){let o=[];for(let i of n){let c=new Map;o.push(c),await this._transform({obj:i,transformMap:c,contextStack:r})}e.push(o)}async _transformObject({entries:e,contextStack:r,value:n}){let o=new Map;e.push(o),await this._transform({obj:n,transformMap:o,contextStack:r})}_assignEntries({entries:e,transformMap:r,termInfo:n}){let{termId:o,plural:i}=n;r.set(o,i?e:e[0])}};s(gr,"Compressor");var Mt=gr;async function yr({jsonldDocument:t,documentLoader:e,appContextMap:r=new Map,compressionMode:n=1,diagnose:o}={}){if(!(n===0||n===1))throw new TypeError('"compressionMode" must be "0" (no compression) or "1" for compression mode version 1.');let i=new Uint8Array([217,5,n]),c;n===0?c=we(t):c=await new Mt({documentLoader:e,appContextMap:r}).compress({jsonldDocument:t,diagnose:o});let f=i.length+c.length,u=new Uint8Array(f);return u.set(i),u.set(c,i.length),o&&(o("Diagnostic CBOR-LD result:"),o(W(u,{depth:null,colors:!0}))),u}s(yr,"encode");function wr(t){if(t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray)return new DataView(t.buffer,t.byteOffset,t.byteLength);if(t instanceof ArrayBuffer)return new DataView(t);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}s(wr,"toDataView");var Wi="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Qi="0123456789ABCDEFGHIJKLMNOPQRSTUV",Xi="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function br(t,e,r){r=r||{};let n,o;switch(e){case"RFC3548":case"RFC4648":n=Wi,o=!0;break;case"RFC4648-HEX":n=Qi,o=!0;break;case"Crockford":n=Xi,o=!1;break;default:throw new Error("Unknown base32 variant: "+e)}let i=r.padding!==void 0?r.padding:o,c=wr(t),f=0,u=0,d="";for(let h=0;h<c.byteLength;h++)for(u=u<<8|c.getUint8(h),f+=8;f>=5;)d+=n[u>>>f-5&31],f-=5;if(f>0&&(d+=n[u<<5-f&31]),i)for(;d.length%8!==0;)d+="=";return d}s(br,"base32Encode");var Lo=Qo(wo(),1);var E;(function(t){t[t.Terminator=0]="Terminator",t[t.Numeric=1]="Numeric",t[t.Alphanumeric=2]="Alphanumeric",t[t.StructuredAppend=3]="StructuredAppend",t[t.Byte=4]="Byte",t[t.Kanji=8]="Kanji",t[t.ECI=7]="ECI"})(E||(E={}));var Er=class Er{constructor(e,r){this.bytes=[],this.mode=e,this.data=r}getLength(){return this.bytes.length}getLengthInBits(e){let r=this.mode,n=new Error(`illegal mode: ${r}`);if(1<=e&&e<10)switch(r){case E.Numeric:return 10;case E.Alphanumeric:return 9;case E.Byte:return 8;case E.Kanji:return 8;default:throw n}else if(e<27)switch(r){case E.Numeric:return 12;case E.Alphanumeric:return 11;case E.Byte:return 16;case E.Kanji:return 10;default:throw n}else if(e<41)switch(r){case E.Numeric:return 14;case E.Alphanumeric:return 13;case E.Byte:return 16;case E.Kanji:return 12;default:throw n}else throw new Error(`illegal version: ${e}`)}};s(Er,"QRData");var Q=Er;function bo(t){let e=0,{length:r}=t,n=[];for(let o=0;o<r;o++){let i=t.charCodeAt(o);i<128?n[e++]=i:i<2048?(n[e++]=i>>6|192,n[e++]=i&63|128):(i&64512)===55296&&o+1<r&&(t.charCodeAt(o+1)&64512)===56320?(i=65536+((i&1023)<<10)+(t.charCodeAt(++o)&1023),n[e++]=i>>18|240,n[e++]=i>>12&63|128,n[e++]=i>>6&63|128,n[e++]=i&63|128):(n[e++]=i>>12|224,n[e++]=i>>6&63|128,n[e++]=i&63|128)}return n}s(bo,"encode");var Cr=class Cr extends Q{constructor(e,r){if(super(E.Byte,e),this.encoding=-1,typeof r=="function"){let{encoding:n,bytes:o}=r(e);this.bytes=o,this.encoding=n}else this.bytes=bo(e),this.encoding=26}writeTo(e){let{bytes:r}=this;for(let n of r)e.put(n,8)}};s(Cr,"QRByte");var Rt=Cr;var q=[],Tr=[];for(let t=0;t<256;t++)Tr[t]=0,q[t]=t<8?1<<t:q[t-4]^q[t-5]^q[t-6]^q[t-8];for(let t=0;t<255;t++)Tr[q[t]]=t;function de(t){if(t<1)throw new Error(`illegal log: ${t}`);return Tr[t]}s(de,"glog");function Me(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return q[t]}s(Me,"gexp");var Re=class Re{constructor(e,r=0){let n=0,{length:o}=e;for(;n<o&&e[n]===0;)n++;o-=n;let i=[];for(let c=0;c<o;c++)i.push(e[n+c]);for(let c=0;c<r;c++)i.push(0);this.num=i}getAt(e){return this.num[e]}getLength(){return this.num.length}multiply(e){let r=[],n=e.getLength(),o=this.getLength(),i=o+n-1;for(let c=0;c<i;c++)r.push(0);for(let c=0;c<o;c++)for(let f=0;f<n;f++)r[c+f]^=Me(de(this.getAt(c))+de(e.getAt(f)));return new Re(r)}mod(e){let r=e.getLength(),n=this.getLength();if(n-r<0)return this;let o=de(this.getAt(0))-de(e.getAt(0)),i=[];for(let c=0;c<n;c++)i.push(this.getAt(c));for(let c=0;c<r;c++)i[c]^=Me(de(e.getAt(c))+o);return new Re(i).mod(e)}};s(Re,"Polynomial");var ee=Re;var qi=3,es=3,Eo=40,ts=10,rs=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],ns=21522,Bo=1335,_o=7973;function ko(t){return rs[t-1]}s(ko,"getAlignmentPattern");function Do(t){let e=new ee([1]);for(let r=0;r<t;r++)e=e.multiply(new ee([1,Me(r)]));return e}s(Do,"getErrorCorrectionPolynomial");function le(t){let e=0;for(;t!==0;)e++,t>>>=1;return e}s(le,"getBCHDigit");var Co=le(_o);function Uo(t){let e=t<<12;for(;le(e)-Co>=0;)e^=_o<<le(e)-Co;return t<<12|e}s(Uo,"getBCHVersion");var To=le(Bo);function So(t){let e=t<<10;for(;le(e)-To>=0;)e^=Bo<<le(e)-To;return(t<<10|e)^ns}s(So,"getBCHVersionInfo");function Ao(t,e){let r=t.getMatrixSize(),n=0;for(let o=0;o<r;o++){let i=!1,c=0;for(let f=0;f<r;f++){let u=e?t.isDark(o,f):t.isDark(f,o);u===i?(c++,c===5?n+=qi:c>5&&n++):(i=u,c=1)}}return n}s(Ao,"applyMaskPenaltyRule1Internal");function os(t){return Ao(t,!0)+Ao(t,!1)}s(os,"applyMaskPenaltyRule1");function is(t){let e=t.getMatrixSize(),r=0;for(let n=0;n<e-1;n++)for(let o=0;o<e-1;o++){let i=t.isDark(n,o);i===t.isDark(n,o+1)&&i===t.isDark(n+1,o)&&i===t.isDark(n+1,o+1)&&(r+=es)}return r}s(is,"applyMaskPenaltyRule2");function Ot(t,e,r,n,o){r=Math.max(r,0),n=Math.min(n,t.getMatrixSize());for(let i=r;i<n;i++)if(o?t.isDark(e,i):t.isDark(i,e))return!1;return!0}s(Ot,"isFourWhite");function ss(t){let e=t.getMatrixSize(),r=0;for(let n=0;n<e;n++)for(let o=0;o<e;o++)o+6<e&&t.isDark(n,o)&&!t.isDark(n,o+1)&&t.isDark(n,o+2)&&t.isDark(n,o+3)&&t.isDark(n,o+4)&&!t.isDark(n,o+5)&&t.isDark(n,o+6)&&(Ot(t,n,o-4,o,!0)||Ot(t,n,o+7,o+11,!0))&&(r+=Eo),n+6<e&&t.isDark(n,o)&&!t.isDark(n+1,o)&&t.isDark(n+2,o)&&t.isDark(n+3,o)&&t.isDark(n+4,o)&&!t.isDark(n+5,o)&&t.isDark(n+6,o)&&(Ot(t,o,n-4,n,!1)||Ot(t,o,n+7,n+11,!1))&&(r+=Eo);return r}s(ss,"applyMaskPenaltyRule3");function cs(t){let e=t.getMatrixSize(),r=0;for(let i=0;i<e;i++)for(let c=0;c<e;c++)t.isDark(i,c)&&r++;let n=e*e;return Math.floor(Math.abs(r*20-n*10)/n)*ts}s(cs,"applyMaskPenaltyRule4");function Io(t){return os(t)+is(t)+ss(t)+cs(t)}s(Io,"calculateMaskPenalty");var O;(function(t){t[t.L=1]="L",t[t.M=0]="M",t[t.Q=3]="Q",t[t.H=2]="H"})(O||(O={}));var V=class V{constructor(e,r){this.dataCount=r,this.totalCount=e}getDataCount(){return this.dataCount}getTotalCount(){return this.totalCount}static getRSBlocks(e,r){let n=[],o=V.getRSBlockTable(e,r),i=o.length/3;for(let c=0;c<i;c++){let f=o[c*3+0],u=o[c*3+1],d=o[c*3+2];for(let h=0;h<f;h++)n.push(new V(u,d))}return n}static getRSBlockTable(e,r){switch(r){case O.L:return V.RS_BLOCK_TABLE[(e-1)*4+0];case O.M:return V.RS_BLOCK_TABLE[(e-1)*4+1];case O.Q:return V.RS_BLOCK_TABLE[(e-1)*4+2];case O.H:return V.RS_BLOCK_TABLE[(e-1)*4+3];default:throw new Error(`illegal error correction level: ${r}`)}}};s(V,"RSBlock");var Oe=V;Oe.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];var Ar=class Ar{constructor(){this.length=0,this.buffer=[]}getBuffer(){return this.buffer}getLengthInBits(){return this.length}getBit(e){return(this.buffer[e/8>>0]>>>7-e%8&1)===1}put(e,r){for(let n=0;n<r;n++)this.putBit((e>>>r-n-1&1)===1)}putBit(e){let{buffer:r}=this;this.length===r.length*8&&r.push(0),e&&(r[this.length/8>>0]|=128>>>this.length%8),this.length++}};s(Ar,"BitBuffer");var ve=Ar;var Br=class Br{constructor(e){let r=1<<e,n=r+1;this.bof=r,this.eof=n,this.depth=e,this.reset()}reset(){let e=this.depth+1;this.bits=e,this.size=1<<e,this.codes=new Map,this.unused=this.eof+1}add(e,r){let{unused:n}=this;if(n>4095)return!1;this.codes.set(e<<8|r,n++);let{bits:o,size:i}=this;return n>i&&(i=1<<++o),this.bits=o,this.size=i,this.unused=n,!0}get(e,r){return this.codes.get(e<<8|r)}};s(Br,"Dict");var vt=Br;var _r=class _r{constructor(e){this.bits=0,this.buffer=0,this.bytes=[],this.dict=e}write(e){let{bits:r}=this,n=this.buffer|e<<r;r+=this.dict.bits;let{bytes:o}=this;for(;r>=8;)o.push(n&255),n>>=8,r-=8;this.bits=r,this.buffer=n}pipe(e){let{bytes:r}=this;this.bits>0&&r.push(this.buffer),e.writeByte(this.dict.depth);let{length:n}=r;for(let o=0;o<n;){let i=n-o;i>=255?(e.writeByte(255),e.writeBytes(r,o,255),o+=255):(e.writeByte(i),e.writeBytes(r,o,i),o=n)}e.writeByte(0)}};s(_r,"DictStream");var Nt=_r;function Mo(t,e,r){let n=new vt(e),o=new Nt(n);if(o.write(n.bof),t.length>0){let i=t[0],{length:c}=t;for(let f=1;f<c;f++){let u=t[f],d=n.get(i,u);d!=null?i=d:(o.write(i),n.add(i,u)||(o.write(n.bof),n.reset()),i=u)}o.write(i)}o.write(n.eof),o.pipe(r)}s(Mo,"compress");var kr=class kr{constructor(){this.bytes=[]}writeByte(e){this.bytes.push(e&255)}writeInt16(e){this.bytes.push(e&255,e>>8&255)}writeBytes(e,r=0,n=e.length){let o=this.bytes;for(let i=0;i<n;i++)o.push(e[r+i]&255)}};s(kr,"ByteStream");var pe=kr;var{fromCharCode:Dr}=String;function Ro(t){if(t&=63,t>=0){if(t<26)return 65+t;if(t<52)return 97+(t-26);if(t<62)return 48+(t-52);if(t===62)return 43;if(t===63)return 47}throw new Error(`illegal char: ${Dr(t)}`)}s(Ro,"encode");var Ur=class Ur{constructor(){this.bits=0,this.buffer=0,this.length=0,this.stream=new pe}get bytes(){return this.stream.bytes}write(e){let r=this.bits+8,{stream:n}=this,o=this.buffer<<8|e&255;for(;r>=6;)n.writeByte(Ro(o>>>r-6)),r-=6;this.length++,this.bits=r,this.buffer=o}close(){let{bits:e,stream:r,length:n}=this;if(e>0&&(r.writeByte(Ro(this.buffer<<6-e)),this.bits=0,this.buffer=0),n%3!=0){let o=3-n%3;for(let i=0;i<o;i++)r.writeByte(61)}}};s(Ur,"Base64Stream");var Lt=Ur;var Sr=class Sr{constructor(e,r,{foreground:n=[0,0,0],background:o=[255,255,255]}={}){this.pixels=[],this.width=e,this.height=r,this.foreground=n,this.background=o}encodeImpl(){let e=new pe,{width:r,height:n,background:o,foreground:i}=this;return e.writeBytes([71,73,70,56,57,97]),e.writeInt16(r),e.writeInt16(n),e.writeBytes([128,0,0]),e.writeBytes([o[0],o[1],o[2]]),e.writeBytes([i[0],i[1],i[2]]),e.writeByte(44),e.writeInt16(0),e.writeInt16(0),e.writeInt16(r),e.writeInt16(n),e.writeByte(0),Mo(this.pixels,2,e),e.writeByte(59),e.bytes}set(e,r,n){this.pixels[r*this.width+e]=n}toDataURL(){let e=this.encodeImpl(),r=new Lt;for(let i of e)r.write(i);r.close();let n=r.bytes,o="data:image/gif;base64,";for(let i of n)o+=Dr(i);return o}};s(Sr,"GIFImage");var Ft=Sr;function Oo(t){switch(t){case 0:return(e,r)=>(e+r&1)===0;case 1:return(e,r)=>(r&1)===0;case 2:return(e,r)=>e%3===0;case 3:return(e,r)=>(e+r)%3===0;case 4:return(e,r)=>((e/3>>0)+(r/2>>0)&1)===0;case 5:return(e,r)=>(e*r&1)+e*r%3===0;case 6:return(e,r)=>((e*r&1)+e*r%3&1)===0;case 7:return(e,r)=>(e*r%3+(e+r&1)&1)===0;default:throw new Error(`illegal mask: ${t}`)}}s(Oo,"getMaskFunc");var as=236,fs=17,{toString:us}=Object.prototype;function ds(t,e){if(t<0||t>=1e6)throw new Error("byte mode encoding hint out of range");e.put(E.ECI,4),t<128?e.put(t,8):t<16384?(e.put(2,2),e.put(t,14)):(e.put(6,3),e.put(t,21))}s(ds,"appendECI");function vo(t,e,r,n){let o=new ve,i=Oe.getRSBlocks(t,e);for(let f of n){let u=f.mode;r&&u===E.Byte&&ds(f.encoding,o),o.put(u,4),o.put(f.getLength(),f.getLengthInBits(t)),f.writeTo(o)}let c=0;for(let f of i)c+=f.getDataCount();return c*=8,[o,i,c]}s(vo,"prepareData");function ls(t,e){let r=0,n=0,o=0,i=[],c=[],f=e.length,u=t.getBuffer();for(let d=0;d<f;d++){let h=e[d],x=h.getDataCount(),g=h.getTotalCount()-x;n=Math.max(n,x),o=Math.max(o,g),i[d]=[];for(let L=0;L<x;L++)i[d][L]=255&u[L+r];r+=x;let w=Do(g),U=w.getLength()-1,$e=new ee(i[d],U).mod(w),$t=$e.getLength();c[d]=[];for(let L=0;L<U;L++){let Pe=L+$t-U;c[d][L]=Pe>=0?$e.getAt(Pe):0}}t=new ve;for(let d=0;d<n;d++)for(let h=0;h<f;h++)d<i[h].length&&t.put(i[h][d],8);for(let d=0;d<o;d++)for(let h=0;h<f;h++)d<c[h].length&&t.put(c[h][d],8);return t}s(ls,"createBytes");function ps(t,e,r){for(t.getLengthInBits()+4<=r&&t.put(0,4);t.getLengthInBits()%8!==0;)t.putBit(!1);for(;!(t.getLengthInBits()>=r||(t.put(as,8),t.getLengthInBits()>=r));)t.put(fs,8);return ls(t,e)}s(ps,"createData");var Ir=class Ir{constructor(e={}){this.matrixSize=0,this.chunks=[],this.matrix=[];let{version:r=0,encodingHint:n=!1,errorCorrectionLevel:o=O.L}=e;this.setVersion(r),this.setEncodingHint(n),this.setErrorCorrectionLevel(o)}getMatrix(){return this.matrix}getMatrixSize(){return this.matrixSize}getVersion(){return this.version}setVersion(e){return this.version=Math.min(40,Math.max(0,e>>0)),this.auto=this.version===0,this}getErrorCorrectionLevel(){return this.errorCorrectionLevel}setErrorCorrectionLevel(e){switch(e){case O.L:case O.M:case O.Q:case O.H:this.errorCorrectionLevel=e}return this}getEncodingHint(){return this.encodingHint}setEncodingHint(e){return this.encodingHint=e,this}write(e){let{chunks:r}=this;if(e instanceof Q)r.push(e);else if(us.call(e)==="[object String]")r.push(new Rt(e));else throw new Error(`illegal data: ${e}`);return this}isDark(e,r){return this.matrix[e][r]===!0}setupFinderPattern(e,r){let{matrix:n}=this,o=this.matrixSize;for(let i=-1;i<=7;i++)for(let c=-1;c<=7;c++)e+i<=-1||o<=e+i||r+c<=-1||o<=r+c||(0<=i&&i<=6&&(c===0||c===6)||0<=c&&c<=6&&(i===0||i===6)||2<=i&&i<=4&&2<=c&&c<=4?n[e+i][r+c]=!0:n[e+i][r+c]=!1)}setupAlignmentPattern(){let{matrix:e}=this,r=ko(this.version),{length:n}=r;for(let o=0;o<n;o++)for(let i=0;i<n;i++){let c=r[o],f=r[i];if(e[c][f]===null)for(let u=-2;u<=2;u++)for(let d=-2;d<=2;d++)u===-2||u===2||d===-2||d===2||u===0&&d===0?e[c+u][f+d]=!0:e[c+u][f+d]=!1}}setupTimingPattern(){let{matrix:e}=this,r=this.matrixSize-8;for(let n=8;n<r;n++){let o=n%2===0;e[n][6]===null&&(e[n][6]=o),e[6][n]===null&&(e[6][n]=o)}}setupFormatInfo(e){let{matrix:r}=this,n=this.errorCorrectionLevel<<3|e,o=So(n),i=this.matrixSize;for(let c=0;c<15;c++){let f=(o>>c&1)===1;c<6?r[c][8]=f:c<8?r[c+1][8]=f:r[i-15+c][8]=f,c<8?r[8][i-c-1]=f:c<9?r[8][15-c-1+1]=f:r[8][15-c-1]=f}r[i-8][8]=!0}setupVersionInfo(){if(this.version>=7){let{matrix:e}=this,r=this.matrixSize,n=Uo(this.version);for(let o=0;o<18;o++){let i=(n>>o&1)===1;e[o/3>>0][o%3+r-8-3]=i,e[o%3+r-8-3][o/3>>0]=i}}}setupCodewords(e,r){let{matrix:n}=this,o=this.matrixSize,i=e.getLengthInBits(),c=Oo(r),f=0;for(let u=o-1;u>=1;u-=2){u===6&&(u=5);for(let d=0;d<o;d++)for(let h=0;h<2;h++){let x=u-h,w=(u+1&2)===0?o-1-d:d;if(n[w][x]!==null)continue;let U=!1;f<i&&(U=e.getBit(f++)),c(x,w)&&(U=!U),n[w][x]=U}}}buildMatrix(e,r){let n=[],o=this.matrixSize;for(let i=0;i<o;i++){n[i]=[];for(let c=0;c<o;c++)n[i][c]=null}this.matrix=n,this.setupFinderPattern(0,0),this.setupFinderPattern(o-7,0),this.setupFinderPattern(0,o-7),this.setupAlignmentPattern(),this.setupTimingPattern(),this.setupFormatInfo(r),this.setupVersionInfo(),this.setupCodewords(e,r)}make(){let e,r,n,{chunks:o,errorCorrectionLevel:i}=this;if(this.auto){let h=1;for(;h<=40&&([e,r,n]=vo(h,i,this.encodingHint,o),!(e.getLengthInBits()<=n));h++);let x=e.getLengthInBits();if(x>n)throw new Error(`data overflow: ${x} > ${n}`);this.version=h}else[e,r,n]=vo(this.version,i,this.encodingHint,o);this.matrixSize=this.version*4+17;let c=[],f=ps(e,r,n),u=-1,d=Number.MAX_VALUE;for(let h=0;h<8;h++){this.buildMatrix(f,h),c.push(this.matrix);let x=Io(this);x<d&&(d=x,u=h)}return this.matrix=c[u],this}toDataURL(e=2,r=e*4,n){e=Math.max(1,e>>0),r=Math.max(0,r>>0);let o=this.matrixSize,i=e*o+r*2,c=r,f=i-r,u=new Ft(i,i,n);for(let d=0;d<i;d++)for(let h=0;h<i;h++)if(c<=h&&h<f&&c<=d&&d<f){let x=(d-c)/e>>0,g=(h-c)/e>>0;u.set(h,d,this.isDark(x,g)?1:0)}else u.set(h,d,0);return u.toDataURL()}clear(){this.chunks=[]}};s(Ir,"Encoder");var Ne=Ir;function No(t){let{length:e}=t,r=[];for(let n=0;n<e;n++)r.push(t.charCodeAt(n));return r}s(No,"encode");function Mr(t){if(48<=t&&t<=57)return t-48;if(65<=t&&t<=90)return t-65+10;switch(t){case 32:return 36;case 36:return 37;case 37:return 38;case 42:return 39;case 43:return 40;case 45:return 41;case 46:return 42;case 47:return 43;case 58:return 44;default:throw new Error(`illegal char: ${String.fromCharCode(t)}`)}}s(Mr,"getByte");var Rr=class Rr extends Q{constructor(e){super(E.Alphanumeric,e),this.bytes=No(e)}writeTo(e){let r=0,{bytes:n}=this,{length:o}=n;for(;r+1<o;)e.put(Mr(n[r])*45+Mr(n[r+1]),11),r+=2;r<o&&e.put(Mr(n[r]),6)}};s(Rr,"QRAlphanumeric");var Le=Rr;var Fo="VP1",$o="B";function hs({bytes:t,size:e}){let r=new Ne;r.setEncodingHint(!0);let n=br(t,"RFC4648",{padding:!1}),o=`${Fo}-${$o}${n}`;return r.write(new Le(o)),r.make(),{payload:o,encodedCborld:n,version:r.getVersion(),imageDataUrl:r.toDataURL(e)}}s(hs,"_bytesToQrCodeDataUrl");async function Or({vp:t,documentLoader:e,size:r,diagnose:n}={}){let o=await yr({jsonldDocument:t,documentLoader:e,diagnose:n}),{payload:i,imageDataUrl:c,encodedCborld:f,version:u}=hs({bytes:o,size:r});return{payload:i,imageDataUrl:c,encodedCborld:f,rawCborldBytes:o,version:u}}s(Or,"toQrCode");async function vr({text:t,documentLoader:e,diagnose:r}={}){let n=Fo+"-";if(!(t&&t.startsWith(n)))throw TypeError("Unsupported VP QR format.");let o=t.slice(n.length);if(!o.startsWith($o))throw TypeError("Payload must be multibase base32 (RFC4648) encoded.");let i=(0,Lo.default)(o.slice(1),"RFC4648"),c=new Uint8Array(i);return{vp:await hr({cborldBytes:c,documentLoader:e,diagnose:r})}}s(vr,"fromQrCode");var ms=s(t=>({name:"Vpqr",displayName:"VP QR",description:"Allows reading and creating QR codes with Verifiable Presentations in them",methods:{vpFromQrCode:s(async(e,r)=>(await vr({text:r,documentLoader:s(async n=>({document:await t.invoke.contextLoader(n)}),"documentLoader")}))?.vp,"vpFromQrCode"),vpToQrCode:s(async(e,r)=>(await Or({vp:r,documentLoader:s(async n=>({document:await t.invoke.contextLoader(n)}),"documentLoader")}))?.imageDataUrl,"vpToQrCode")}}),"getVpqrPlugin");
3
3
  /*! Bundled license information:
4
4