@learncard/vpqr-plugin 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/vpqr-plugin.cjs.development.js +91 -711
- package/dist/vpqr-plugin.cjs.development.js.map +4 -4
- package/dist/vpqr-plugin.cjs.production.min.js +3 -3
- package/dist/vpqr-plugin.cjs.production.min.js.map +4 -4
- package/dist/vpqr-plugin.esm.js +91 -710
- package/dist/vpqr-plugin.esm.js.map +4 -4
- package/package.json +2 -2
@@ -1,5 +1,5 @@
|
|
1
|
-
"use strict";var So=Object.create;var ke=Object.defineProperty;var Oo=Object.getOwnPropertyDescriptor;var Do=Object.getOwnPropertyNames;var Io=Object.getPrototypeOf,Ro=Object.prototype.hasOwnProperty;var a=(t,e)=>ke(t,"name",{value:e,configurable:!0});var Wt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Uo=(t,e)=>{for(var r in e)ke(t,r,{get:e[r],enumerable:!0})},Zt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Do(e))!Ro.call(t,o)&&o!==r&&ke(t,o,{get:()=>e[o],enumerable:!(n=Oo(e,o))||n.enumerable});return t};var Xt=(t,e,r)=>(r=t!=null?So(Io(t)):{},Zt(e||!t||!t.__esModule?ke(r,"default",{value:t,enumerable:!0}):r,t)),ko=t=>Zt(ke({},"__esModule",{value:!0}),t);var In=Wt((vf,Dn)=>{var Li="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",Ni="0123456789ABCDEFGHIJKLMNOPQRSTUV",Pi="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Fi(t,e){var r=t.indexOf(e);if(r===-1)throw new Error("Invalid character found: "+e);return r}a(Fi,"readChar");Dn.exports=a(function(e,r){var n;switch(r){case"RFC3548":case"RFC4648":n=Li,e=e.replace(/=+$/,"");break;case"RFC4648-HEX":n=Ni,e=e.replace(/=+$/,"");break;case"Crockford":n=Pi,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,s=0,c=0,f=new Uint8Array(o*5/8|0),u=0;u<o;u++)s=s<<5|Fi(n,e[u]),i+=5,i>=8&&(f[c++]=s>>>i-8&255,i-=8);return f.buffer},"base32Decode")});var no=Wt((bf,mt)=>{var Rn,Un,kn,Mn,Ln,Nn,Pn,Fn,$n,jn,zn,Vn,Qn,dt,$t,Hn,Kn,Gn,De,Wn,Zn,Xn,Jn,Yn,qn,eo,to,ro,ht;(function(t){var e=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(n){t(r(e,r(n)))}):typeof mt=="object"&&typeof mt.exports=="object"?t(r(e,r(mt.exports))):t(r(e));function r(n,o){return n!==e&&(typeof Object.create=="function"?Object.defineProperty(n,"__esModule",{value:!0}):n.__esModule=!0),function(i,s){return n[i]=o?o(i,s):s}}a(r,"createExporter")})(function(t){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(n[i]=o[i])};Rn=a(function(n,o){if(typeof o!="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");e(n,o);function i(){this.constructor=n}a(i,"__"),n.prototype=o===null?Object.create(o):(i.prototype=o.prototype,new i)},"__extends"),Un=Object.assign||function(n){for(var o,i=1,s=arguments.length;i<s;i++){o=arguments[i];for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(n[c]=o[c])}return n},kn=a(function(n,o){var i={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&o.indexOf(s)<0&&(i[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var c=0,s=Object.getOwnPropertySymbols(n);c<s.length;c++)o.indexOf(s[c])<0&&Object.prototype.propertyIsEnumerable.call(n,s[c])&&(i[s[c]]=n[s[c]]);return i},"__rest"),Mn=a(function(n,o,i,s){var c=arguments.length,f=c<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,i):s,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(n,o,i,s);else for(var d=n.length-1;d>=0;d--)(u=n[d])&&(f=(c<3?u(f):c>3?u(o,i,f):u(o,i))||f);return c>3&&f&&Object.defineProperty(o,i,f),f},"__decorate"),Ln=a(function(n,o){return function(i,s){o(i,s,n)}},"__param"),Nn=a(function(n,o,i,s,c,f){function u(j){if(j!==void 0&&typeof j!="function")throw new TypeError("Function expected");return j}a(u,"accept");for(var d=s.kind,g=d==="getter"?"get":d==="setter"?"set":"value",h=!o&&n?s.static?n:n.prototype:null,y=o||(h?Object.getOwnPropertyDescriptor(h,s.name):{}),x,v=!1,B=i.length-1;B>=0;B--){var U={};for(var F in s)U[F]=F==="access"?{}:s[F];for(var F in s.access)U.access[F]=s.access[F];U.addInitializer=function(j){if(v)throw new TypeError("Cannot add initializers after decoration has completed");f.push(u(j||null))};var $=(0,i[B])(d==="accessor"?{get:y.get,set:y.set}:y[g],U);if(d==="accessor"){if($===void 0)continue;if($===null||typeof $!="object")throw new TypeError("Object expected");(x=u($.get))&&(y.get=x),(x=u($.set))&&(y.set=x),(x=u($.init))&&c.push(x)}else(x=u($))&&(d==="field"?c.push(x):y[g]=x)}h&&Object.defineProperty(h,s.name,y),v=!0},"__esDecorate"),Pn=a(function(n,o,i){for(var s=arguments.length>2,c=0;c<o.length;c++)i=s?o[c].call(n,i):o[c].call(n);return s?i:void 0},"__runInitializers"),Fn=a(function(n){return typeof n=="symbol"?n:"".concat(n)},"__propKey"),$n=a(function(n,o,i){return typeof o=="symbol"&&(o=o.description?"[".concat(o.description,"]"):""),Object.defineProperty(n,"name",{configurable:!0,value:i?"".concat(i," ",o):o})},"__setFunctionName"),jn=a(function(n,o){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(n,o)},"__metadata"),zn=a(function(n,o,i,s){function c(f){return f instanceof i?f:new i(function(u){u(f)})}return a(c,"adopt"),new(i||(i=Promise))(function(f,u){function d(y){try{h(s.next(y))}catch(x){u(x)}}a(d,"fulfilled");function g(y){try{h(s.throw(y))}catch(x){u(x)}}a(g,"rejected");function h(y){y.done?f(y.value):c(y.value).then(d,g)}a(h,"step"),h((s=s.apply(n,o||[])).next())})},"__awaiter"),Vn=a(function(n,o){var i={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},s,c,f,u;return u={next:d(0),throw:d(1),return:d(2)},typeof Symbol=="function"&&(u[Symbol.iterator]=function(){return this}),u;function d(h){return function(y){return g([h,y])}}function g(h){if(s)throw new TypeError("Generator is already executing.");for(;u&&(u=0,h[0]&&(i=0)),i;)try{if(s=1,c&&(f=h[0]&2?c.return:h[0]?c.throw||((f=c.return)&&f.call(c),0):c.next)&&!(f=f.call(c,h[1])).done)return f;switch(c=0,f&&(h=[h[0]&2,f.value]),h[0]){case 0:case 1:f=h;break;case 4:return i.label++,{value:h[1],done:!1};case 5:i.label++,c=h[1],h=[0];continue;case 7:h=i.ops.pop(),i.trys.pop();continue;default:if(f=i.trys,!(f=f.length>0&&f[f.length-1])&&(h[0]===6||h[0]===2)){i=0;continue}if(h[0]===3&&(!f||h[1]>f[0]&&h[1]<f[3])){i.label=h[1];break}if(h[0]===6&&i.label<f[1]){i.label=f[1],f=h;break}if(f&&i.label<f[2]){i.label=f[2],i.ops.push(h);break}f[2]&&i.ops.pop(),i.trys.pop();continue}h=o.call(n,i)}catch(y){h=[6,y],c=0}finally{s=f=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}},"__generator"),Qn=a(function(n,o){for(var i in n)i!=="default"&&!Object.prototype.hasOwnProperty.call(o,i)&&ht(o,n,i)},"__exportStar"),ht=Object.create?function(n,o,i,s){s===void 0&&(s=i);var c=Object.getOwnPropertyDescriptor(o,i);(!c||("get"in c?!o.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return o[i]}}),Object.defineProperty(n,s,c)}:function(n,o,i,s){s===void 0&&(s=i),n[s]=o[i]},dt=a(function(n){var o=typeof Symbol=="function"&&Symbol.iterator,i=o&&n[o],s=0;if(i)return i.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&s>=n.length&&(n=void 0),{value:n&&n[s++],done:!n}}};throw new TypeError(o?"Object is not iterable.":"Symbol.iterator is not defined.")},"__values"),$t=a(function(n,o){var i=typeof Symbol=="function"&&n[Symbol.iterator];if(!i)return n;var s=i.call(n),c,f=[],u;try{for(;(o===void 0||o-- >0)&&!(c=s.next()).done;)f.push(c.value)}catch(d){u={error:d}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(u)throw u.error}}return f},"__read"),Hn=a(function(){for(var n=[],o=0;o<arguments.length;o++)n=n.concat($t(arguments[o]));return n},"__spread"),Kn=a(function(){for(var n=0,o=0,i=arguments.length;o<i;o++)n+=arguments[o].length;for(var s=Array(n),c=0,o=0;o<i;o++)for(var f=arguments[o],u=0,d=f.length;u<d;u++,c++)s[c]=f[u];return s},"__spreadArrays"),Gn=a(function(n,o,i){if(i||arguments.length===2)for(var s=0,c=o.length,f;s<c;s++)(f||!(s in o))&&(f||(f=Array.prototype.slice.call(o,0,s)),f[s]=o[s]);return n.concat(f||Array.prototype.slice.call(o))},"__spreadArray"),De=a(function(n){return this instanceof De?(this.v=n,this):new De(n)},"__await"),Wn=a(function(n,o,i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=i.apply(n,o||[]),c,f=[];return c={},u("next"),u("throw"),u("return"),c[Symbol.asyncIterator]=function(){return this},c;function u(v){s[v]&&(c[v]=function(B){return new Promise(function(U,F){f.push([v,B,U,F])>1||d(v,B)})})}function d(v,B){try{g(s[v](B))}catch(U){x(f[0][3],U)}}function g(v){v.value instanceof De?Promise.resolve(v.value.v).then(h,y):x(f[0][2],v)}function h(v){d("next",v)}function y(v){d("throw",v)}function x(v,B){v(B),f.shift(),f.length&&d(f[0][0],f[0][1])}},"__asyncGenerator"),Zn=a(function(n){var o,i;return o={},s("next"),s("throw",function(c){throw c}),s("return"),o[Symbol.iterator]=function(){return this},o;function s(c,f){o[c]=n[c]?function(u){return(i=!i)?{value:De(n[c](u)),done:!1}:f?f(u):u}:f}},"__asyncDelegator"),Xn=a(function(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var o=n[Symbol.asyncIterator],i;return o?o.call(n):(n=typeof dt=="function"?dt(n):n[Symbol.iterator](),i={},s("next"),s("throw"),s("return"),i[Symbol.asyncIterator]=function(){return this},i);function s(f){i[f]=n[f]&&function(u){return new Promise(function(d,g){u=n[f](u),c(d,g,u.done,u.value)})}}function c(f,u,d,g){Promise.resolve(g).then(function(h){f({value:h,done:d})},u)}},"__asyncValues"),Jn=a(function(n,o){return Object.defineProperty?Object.defineProperty(n,"raw",{value:o}):n.raw=o,n},"__makeTemplateObject");var r=Object.create?function(n,o){Object.defineProperty(n,"default",{enumerable:!0,value:o})}:function(n,o){n.default=o};Yn=a(function(n){if(n&&n.__esModule)return n;var o={};if(n!=null)for(var i in n)i!=="default"&&Object.prototype.hasOwnProperty.call(n,i)&&ht(o,n,i);return r(o,n),o},"__importStar"),qn=a(function(n){return n&&n.__esModule?n:{default:n}},"__importDefault"),eo=a(function(n,o,i,s){if(i==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof o=="function"?n!==o||!s:!o.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?s:i==="a"?s.call(n):s?s.value:o.get(n)},"__classPrivateFieldGet"),to=a(function(n,o,i,s,c){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!c)throw new TypeError("Private accessor was defined without a setter");if(typeof o=="function"?n!==o||!c:!o.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?c.call(n,i):c?c.value=i:o.set(n,i),i},"__classPrivateFieldSet"),ro=a(function(n,o){if(o===null||typeof o!="object"&&typeof o!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof n=="function"?o===n:n.has(o)},"__classPrivateFieldIn"),t("__extends",Rn),t("__assign",Un),t("__rest",kn),t("__decorate",Mn),t("__param",Ln),t("__esDecorate",Nn),t("__runInitializers",Pn),t("__propKey",Fn),t("__setFunctionName",$n),t("__metadata",jn),t("__awaiter",zn),t("__generator",Vn),t("__exportStar",Qn),t("__createBinding",ht),t("__values",dt),t("__read",$t),t("__spread",Hn),t("__spreadArrays",Kn),t("__spreadArray",Gn),t("__await",De),t("__asyncGenerator",Wn),t("__asyncDelegator",Zn),t("__asyncValues",Xn),t("__makeTemplateObject",Jn),t("__importStar",Yn),t("__importDefault",qn),t("__classPrivateFieldGet",eo),t("__classPrivateFieldSet",to),t("__classPrivateFieldIn",ro)})});var as={};Uo(as,{getVpqrPlugin:()=>ss});module.exports=ko(as);var Mo=["string","number","bigint","symbol"],Lo=["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 Jt(t){if(t===null)return"null";if(t===void 0)return"undefined";if(t===!0||t===!1)return"boolean";let e=typeof t;if(Mo.includes(e))return e;if(e==="function")return"Function";if(Array.isArray(t))return"Array";if(No(t))return"Buffer";let r=Po(t);return r||"Object"}a(Jt,"is");function No(t){return t&&t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer.call(null,t)}a(No,"isBuffer");function Po(t){let e=Object.prototype.toString.call(t).slice(8,-1);if(Lo.includes(e))return e}a(Po,"getObjectType");var l=class{constructor(e,r,n){this.major=e,this.majorEncoded=e<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};a(l,"Type");l.uint=new l(0,"uint",!0);l.negint=new l(1,"negint",!0);l.bytes=new l(2,"bytes",!0);l.string=new l(3,"string",!0);l.array=new l(4,"array",!1);l.map=new l(5,"map",!1);l.tag=new l(6,"tag",!1);l.float=new l(7,"float",!0);l.false=new l(7,"false",!0);l.true=new l(7,"true",!0);l.null=new l(7,"null",!0);l.undefined=new l(7,"undefined",!0);l.break=new l(7,"break",!0);var p=class{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}`}};a(p,"Token");var be=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",Fo=new TextDecoder,$o=new TextEncoder;function We(t){return be&&globalThis.Buffer.isBuffer(t)}a(We,"isBuffer");function xt(t){return t instanceof Uint8Array?We(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t:Uint8Array.from(t)}a(xt,"asU8A");var tr=be?(t,e,r)=>r-e>64?globalThis.Buffer.from(t.subarray(e,r)).toString("utf8"):qt(t,e,r):(t,e,r)=>r-e>64?Fo.decode(t.subarray(e,r)):qt(t,e,r),rr=be?t=>t.length>64?globalThis.Buffer.from(t):Yt(t):t=>t.length>64?$o.encode(t):Yt(t),G=a(t=>Uint8Array.from(t),"fromArray"),Ee=be?(t,e,r)=>We(t)?new Uint8Array(t.subarray(e,r)):t.slice(e,r):(t,e,r)=>t.slice(e,r),nr=be?(t,e)=>(t=t.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),xt(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},or=be?t=>globalThis.Buffer.allocUnsafe(t):t=>new Uint8Array(t);function ir(t,e){if(We(t)&&We(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}a(ir,"compare");function Yt(t,e=1/0){let r,n=t.length,o=null,i=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}a(Yt,"utf8ToBytes");function qt(t,e,r){let n=[];for(;e<r;){let o=t[e],i=null,s=o>239?4:o>223?3:o>191?2:1;if(e+s<=r){let c,f,u,d;switch(s){case 1:o<128&&(i=o);break;case 2:c=t[e+1],(c&192)===128&&(d=(o&31)<<6|c&63,d>127&&(i=d));break;case 3:c=t[e+1],f=t[e+2],(c&192)===128&&(f&192)===128&&(d=(o&15)<<12|(c&63)<<6|f&63,d>2047&&(d<55296||d>57343)&&(i=d));break;case 4:c=t[e+1],f=t[e+2],u=t[e+3],(c&192)===128&&(f&192)===128&&(u&192)===128&&(d=(o&15)<<18|(c&63)<<12|(f&63)<<6|u&63,d>65535&&d<1114112&&(i=d))}}i===null?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),e+=s}return jo(n)}a(qt,"utf8Slice");var er=4096;function jo(t){let e=t.length;if(e<=er)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=er));return r}a(jo,"decodeCodePointsArray");var zo=256,Te=class{constructor(e=zo){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=or(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=Ee(n,0,this.cursor)}else r=nr(this.chunks,this.cursor);return e&&this.reset(),r}};a(Te,"Bl");var w="CBOR decode error:",vt="CBOR encode error:",Me=[];Me[23]=1;Me[24]=2;Me[25]=3;Me[26]=5;Me[27]=9;function Z(t,e,r){if(t.length-e<r)throw new Error(`${w} not enough data for type`)}a(Z,"assertEnoughData");var C=[24,256,65536,4294967296,BigInt("18446744073709551616")];function k(t,e,r){Z(t,e,1);let n=t[e];if(r.strict===!0&&n<C[0])throw new Error(`${w} integer encoded in more bytes than necessary (strict decode)`);return n}a(k,"readUint8");function M(t,e,r){Z(t,e,2);let n=t[e]<<8|t[e+1];if(r.strict===!0&&n<C[1])throw new Error(`${w} integer encoded in more bytes than necessary (strict decode)`);return n}a(M,"readUint16");function L(t,e,r){Z(t,e,4);let n=t[e]*16777216+(t[e+1]<<16)+(t[e+2]<<8)+t[e+3];if(r.strict===!0&&n<C[2])throw new Error(`${w} integer encoded in more bytes than necessary (strict decode)`);return n}a(L,"readUint32");function N(t,e,r){Z(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<C[3])throw new Error(`${w} 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(`${w} integers outside of the safe integer range are not supported`)}a(N,"readUint64");function sr(t,e,r,n){return new p(l.uint,k(t,e+1,n),2)}a(sr,"decodeUint8");function ar(t,e,r,n){return new p(l.uint,M(t,e+1,n),3)}a(ar,"decodeUint16");function cr(t,e,r,n){return new p(l.uint,L(t,e+1,n),5)}a(cr,"decodeUint32");function fr(t,e,r,n){return new p(l.uint,N(t,e+1,n),9)}a(fr,"decodeUint64");function z(t,e){return S(t,0,e.value)}a(z,"encodeUint");function S(t,e,r){if(r<C[0]){let n=Number(r);t.push([e|n])}else if(r<C[1]){let n=Number(r);t.push([e|24,n])}else if(r<C[2]){let n=Number(r);t.push([e|25,n>>>8,n&255])}else if(r<C[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<C[4]){let o=[e|27,0,0,0,0,0,0,0],i=Number(n&BigInt(4294967295)),s=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]=s&255,s=s>>8,o[3]=s&255,s=s>>8,o[2]=s&255,s=s>>8,o[1]=s&255,t.push(o)}else throw new Error(`${w} encountered BigInt larger than allowable range`)}}a(S,"encodeUintValue");z.encodedSize=a(function(e){return S.encodedSize(e.value)},"encodedSize");S.encodedSize=a(function(e){return e<C[0]?1:e<C[1]?2:e<C[2]?3:e<C[3]?5:9},"encodedSize");z.compareTokens=a(function(e,r){return e.value<r.value?-1:e.value>r.value?1:0},"compareTokens");function ur(t,e,r,n){return new p(l.negint,-1-k(t,e+1,n),2)}a(ur,"decodeNegint8");function lr(t,e,r,n){return new p(l.negint,-1-M(t,e+1,n),3)}a(lr,"decodeNegint16");function pr(t,e,r,n){return new p(l.negint,-1-L(t,e+1,n),5)}a(pr,"decodeNegint32");var _t=BigInt(-1),dr=BigInt(1);function hr(t,e,r,n){let o=N(t,e+1,n);if(typeof o!="bigint"){let i=-1-o;if(i>=Number.MIN_SAFE_INTEGER)return new p(l.negint,i,9)}if(n.allowBigInt!==!0)throw new Error(`${w} integers outside of the safe integer range are not supported`);return new p(l.negint,_t-BigInt(o),9)}a(hr,"decodeNegint64");function Ze(t,e){let r=e.value,n=typeof r=="bigint"?r*_t-dr:r*-1-1;S(t,e.type.majorEncoded,n)}a(Ze,"encodeNegint");Ze.encodedSize=a(function(e){let r=e.value,n=typeof r=="bigint"?r*_t-dr:r*-1-1;return n<C[0]?1:n<C[1]?2:n<C[2]?3:n<C[3]?5:9},"encodedSize");Ze.compareTokens=a(function(e,r){return e.value<r.value?1:e.value>r.value?-1:0},"compareTokens");function Le(t,e,r,n){Z(t,e,r+n);let o=Ee(t,e+r,e+r+n);return new p(l.bytes,o,r+n)}a(Le,"toToken");function mr(t,e,r,n){return Le(t,e,1,r)}a(mr,"decodeBytesCompact");function yr(t,e,r,n){return Le(t,e,2,k(t,e+1,n))}a(yr,"decodeBytes8");function gr(t,e,r,n){return Le(t,e,3,M(t,e+1,n))}a(gr,"decodeBytes16");function wr(t,e,r,n){return Le(t,e,5,L(t,e+1,n))}a(wr,"decodeBytes32");function xr(t,e,r,n){let o=N(t,e+1,n);if(typeof o=="bigint")throw new Error(`${w} 64-bit integer bytes lengths not supported`);return Le(t,e,9,o)}a(xr,"decodeBytes64");function Xe(t){return t.encodedBytes===void 0&&(t.encodedBytes=t.type===l.string?rr(t.value):t.value),t.encodedBytes}a(Xe,"tokenBytes");function Ae(t,e){let r=Xe(e);S(t,e.type.majorEncoded,r.length),t.push(r)}a(Ae,"encodeBytes");Ae.encodedSize=a(function(e){let r=Xe(e);return S.encodedSize(r.length)+r.length},"encodedSize");Ae.compareTokens=a(function(e,r){return Qo(Xe(e),Xe(r))},"compareTokens");function Qo(t,e){return t.length<e.length?-1:t.length>e.length?1:ir(t,e)}a(Qo,"compareBytes");function Ne(t,e,r,n,o){let i=r+n;Z(t,e,i);let s=new p(l.string,tr(t,e+r,e+i),i);return o.retainStringBytes===!0&&(s.byteValue=Ee(t,e+r,e+i)),s}a(Ne,"toToken");function vr(t,e,r,n){return Ne(t,e,1,r,n)}a(vr,"decodeStringCompact");function _r(t,e,r,n){return Ne(t,e,2,k(t,e+1,n),n)}a(_r,"decodeString8");function br(t,e,r,n){return Ne(t,e,3,M(t,e+1,n),n)}a(br,"decodeString16");function Er(t,e,r,n){return Ne(t,e,5,L(t,e+1,n),n)}a(Er,"decodeString32");function Tr(t,e,r,n){let o=N(t,e+1,n);if(typeof o=="bigint")throw new Error(`${w} 64-bit integer string lengths not supported`);return Ne(t,e,9,o,n)}a(Tr,"decodeString64");var Ar=Ae;function Ce(t,e,r,n){return new p(l.array,n,r)}a(Ce,"toToken");function Cr(t,e,r,n){return Ce(t,e,1,r)}a(Cr,"decodeArrayCompact");function Br(t,e,r,n){return Ce(t,e,2,k(t,e+1,n))}a(Br,"decodeArray8");function Sr(t,e,r,n){return Ce(t,e,3,M(t,e+1,n))}a(Sr,"decodeArray16");function Or(t,e,r,n){return Ce(t,e,5,L(t,e+1,n))}a(Or,"decodeArray32");function Dr(t,e,r,n){let o=N(t,e+1,n);if(typeof o=="bigint")throw new Error(`${w} 64-bit integer array lengths not supported`);return Ce(t,e,9,o)}a(Dr,"decodeArray64");function Ir(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${w} indefinite length items not allowed`);return Ce(t,e,1,1/0)}a(Ir,"decodeArrayIndefinite");function Je(t,e){S(t,l.array.majorEncoded,e.value)}a(Je,"encodeArray");Je.compareTokens=z.compareTokens;Je.encodedSize=a(function(e){return S.encodedSize(e.value)},"encodedSize");function Be(t,e,r,n){return new p(l.map,n,r)}a(Be,"toToken");function Rr(t,e,r,n){return Be(t,e,1,r)}a(Rr,"decodeMapCompact");function Ur(t,e,r,n){return Be(t,e,2,k(t,e+1,n))}a(Ur,"decodeMap8");function kr(t,e,r,n){return Be(t,e,3,M(t,e+1,n))}a(kr,"decodeMap16");function Mr(t,e,r,n){return Be(t,e,5,L(t,e+1,n))}a(Mr,"decodeMap32");function Lr(t,e,r,n){let o=N(t,e+1,n);if(typeof o=="bigint")throw new Error(`${w} 64-bit integer map lengths not supported`);return Be(t,e,9,o)}a(Lr,"decodeMap64");function Nr(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${w} indefinite length items not allowed`);return Be(t,e,1,1/0)}a(Nr,"decodeMapIndefinite");function Ye(t,e){S(t,l.map.majorEncoded,e.value)}a(Ye,"encodeMap");Ye.compareTokens=z.compareTokens;Ye.encodedSize=a(function(e){return S.encodedSize(e.value)},"encodedSize");function Pr(t,e,r,n){return new p(l.tag,r,1)}a(Pr,"decodeTagCompact");function Fr(t,e,r,n){return new p(l.tag,k(t,e+1,n),2)}a(Fr,"decodeTag8");function $r(t,e,r,n){return new p(l.tag,M(t,e+1,n),3)}a($r,"decodeTag16");function jr(t,e,r,n){return new p(l.tag,L(t,e+1,n),5)}a(jr,"decodeTag32");function zr(t,e,r,n){return new p(l.tag,N(t,e+1,n),9)}a(zr,"decodeTag64");function qe(t,e){S(t,l.tag.majorEncoded,e.value)}a(qe,"encodeTag");qe.compareTokens=z.compareTokens;qe.encodedSize=a(function(e){return S.encodedSize(e.value)},"encodedSize");var Xo=20,Jo=21,Yo=22,qo=23;function Vr(t,e,r,n){if(n.allowUndefined===!1)throw new Error(`${w} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new p(l.null,null,1):new p(l.undefined,void 0,1)}a(Vr,"decodeUndefined");function Qr(t,e,r,n){if(n.allowIndefinite===!1)throw new Error(`${w} indefinite length items not allowed`);return new p(l.break,void 0,1)}a(Qr,"decodeBreak");function bt(t,e,r){if(r){if(r.allowNaN===!1&&Number.isNaN(t))throw new Error(`${w} NaN values are not supported`);if(r.allowInfinity===!1&&(t===1/0||t===-1/0))throw new Error(`${w} Infinity values are not supported`)}return new p(l.float,t,e)}a(bt,"createToken");function Hr(t,e,r,n){return bt(Et(t,e+1),3,n)}a(Hr,"decodeFloat16");function Kr(t,e,r,n){return bt(Tt(t,e+1),5,n)}a(Kr,"decodeFloat32");function Gr(t,e,r,n){return bt(Jr(t,e+1),9,n)}a(Gr,"decodeFloat64");function et(t,e,r){let n=e.value;if(n===!1)t.push([l.float.majorEncoded|Xo]);else if(n===!0)t.push([l.float.majorEncoded|Jo]);else if(n===null)t.push([l.float.majorEncoded|Yo]);else if(n===void 0)t.push([l.float.majorEncoded|qo]);else{let o,i=!1;(!r||r.float64!==!0)&&(Zr(n),o=Et(Q,1),n===o||Number.isNaN(n)?(Q[0]=249,t.push(Q.slice(0,3)),i=!0):(Xr(n),o=Tt(Q,1),n===o&&(Q[0]=250,t.push(Q.slice(0,5)),i=!0))),i||(ei(n),o=Jr(Q,1),Q[0]=251,t.push(Q.slice(0,9)))}}a(et,"encodeFloat");et.encodedSize=a(function(e,r){let n=e.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Zr(n);let o=Et(Q,1);if(n===o||Number.isNaN(n))return 3;if(Xr(n),o=Tt(Q,1),n===o)return 5}return 9},"encodedSize");var Wr=new ArrayBuffer(9),V=new DataView(Wr,1),Q=new Uint8Array(Wr,0);function Zr(t){if(t===1/0)V.setUint16(0,31744,!1);else if(t===-1/0)V.setUint16(0,64512,!1);else if(Number.isNaN(t))V.setUint16(0,32256,!1);else{V.setFloat32(0,t);let e=V.getUint32(0),r=(e&2139095040)>>23,n=e&8388607;if(r===255)V.setUint16(0,31744,!1);else if(r===0)V.setUint16(0,(t&2147483648)>>16|n>>13,!1);else{let o=r-127;o<-24?V.setUint16(0,0):o<-14?V.setUint16(0,(e&2147483648)>>16|1<<24+o,!1):V.setUint16(0,(e&2147483648)>>16|o+15<<10|n>>13,!1)}}}a(Zr,"encodeFloat16");function Et(t,e){if(t.length-e<2)throw new Error(`${w} 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}a(Et,"readFloat16");function Xr(t){V.setFloat32(0,t,!1)}a(Xr,"encodeFloat32");function Tt(t,e){if(t.length-e<4)throw new Error(`${w} not enough data for float32`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,4).getFloat32(0,!1)}a(Tt,"readFloat32");function ei(t){V.setFloat64(0,t,!1)}a(ei,"encodeFloat64");function Jr(t,e){if(t.length-e<8)throw new Error(`${w} not enough data for float64`);let r=(t.byteOffset||0)+e;return new DataView(t.buffer,r,8).getFloat64(0,!1)}a(Jr,"readFloat64");et.compareTokens=z.compareTokens;function _(t,e,r){throw new Error(`${w} encountered invalid minor (${r}) for major ${t[e]>>>5}`)}a(_,"invalidMinor");function tt(t){return()=>{throw new Error(`${w} ${t}`)}}a(tt,"errorer");var m=[];for(let t=0;t<=23;t++)m[t]=_;m[24]=sr;m[25]=ar;m[26]=cr;m[27]=fr;m[28]=_;m[29]=_;m[30]=_;m[31]=_;for(let t=32;t<=55;t++)m[t]=_;m[56]=ur;m[57]=lr;m[58]=pr;m[59]=hr;m[60]=_;m[61]=_;m[62]=_;m[63]=_;for(let t=64;t<=87;t++)m[t]=mr;m[88]=yr;m[89]=gr;m[90]=wr;m[91]=xr;m[92]=_;m[93]=_;m[94]=_;m[95]=tt("indefinite length bytes/strings are not supported");for(let t=96;t<=119;t++)m[t]=vr;m[120]=_r;m[121]=br;m[122]=Er;m[123]=Tr;m[124]=_;m[125]=_;m[126]=_;m[127]=tt("indefinite length bytes/strings are not supported");for(let t=128;t<=151;t++)m[t]=Cr;m[152]=Br;m[153]=Sr;m[154]=Or;m[155]=Dr;m[156]=_;m[157]=_;m[158]=_;m[159]=Ir;for(let t=160;t<=183;t++)m[t]=Rr;m[184]=Ur;m[185]=kr;m[186]=Mr;m[187]=Lr;m[188]=_;m[189]=_;m[190]=_;m[191]=Nr;for(let t=192;t<=215;t++)m[t]=Pr;m[216]=Fr;m[217]=$r;m[218]=jr;m[219]=zr;m[220]=_;m[221]=_;m[222]=_;m[223]=_;for(let t=224;t<=243;t++)m[t]=tt("simple values are not supported");m[244]=_;m[245]=_;m[246]=_;m[247]=Vr;m[248]=tt("simple values are not supported");m[249]=Hr;m[250]=Kr;m[251]=Gr;m[252]=_;m[253]=_;m[254]=_;m[255]=Qr;var H=[];for(let t=0;t<24;t++)H[t]=new p(l.uint,t,1);for(let t=-1;t>=-24;t--)H[31-t]=new p(l.negint,t,1);H[64]=new p(l.bytes,new Uint8Array(0),1);H[96]=new p(l.string,"",1);H[128]=new p(l.array,0,1);H[160]=new p(l.map,0,1);H[244]=new p(l.false,!1,1);H[245]=new p(l.true,!0,1);H[246]=new p(l.null,null,1);function Yr(t){switch(t.type){case l.false:return G([244]);case l.true:return G([245]);case l.null:return G([246]);case l.bytes:return t.value.length?void 0:G([64]);case l.string:return t.value===""?G([96]):void 0;case l.array:return t.value===0?G([128]):void 0;case l.map:return t.value===0?G([160]):void 0;case l.uint:return t.value<24?G([Number(t.value)]):void 0;case l.negint:if(t.value>=-24)return G([31-Number(t.value)])}}a(Yr,"quickEncodeToken");var ri={float64:!1,mapSorter:ii,quickEncodeToken:Yr};function ni(){let t=[];return t[l.uint.major]=z,t[l.negint.major]=Ze,t[l.bytes.major]=Ae,t[l.string.major]=Ar,t[l.array.major]=Je,t[l.map.major]=Ye,t[l.tag.major]=qe,t[l.float.major]=et,t}a(ni,"makeCborEncoders");var qr=ni(),At=new Te,le=class{constructor(e,r){this.obj=e,this.parent=r}includes(e){let r=this;do if(r.obj===e)return!0;while(r=r.parent);return!1}static createCheck(e,r){if(e&&e.includes(r))throw new Error(`${vt} object contains circular references`);return new le(r,e)}};a(le,"Ref");var J={null:new p(l.null,null),undefined:new p(l.undefined,void 0),true:new p(l.true,!0),false:new p(l.false,!1),emptyArray:new p(l.array,0),emptyMap:new p(l.map,0)},Y={number(t,e,r,n){return!Number.isInteger(t)||!Number.isSafeInteger(t)?new p(l.float,t):t>=0?new p(l.uint,t):new p(l.negint,t)},bigint(t,e,r,n){return t>=BigInt(0)?new p(l.uint,t):new p(l.negint,t)},Uint8Array(t,e,r,n){return new p(l.bytes,t)},string(t,e,r,n){return new p(l.string,t)},boolean(t,e,r,n){return t?J.true:J.false},null(t,e,r,n){return J.null},undefined(t,e,r,n){return J.undefined},ArrayBuffer(t,e,r,n){return new p(l.bytes,new Uint8Array(t))},DataView(t,e,r,n){return new p(l.bytes,new Uint8Array(t.buffer,t.byteOffset,t.byteLength))},Array(t,e,r,n){if(!t.length)return r.addBreakTokens===!0?[J.emptyArray,new p(l.break)]:J.emptyArray;n=le.createCheck(n,t);let o=[],i=0;for(let s of t)o[i++]=rt(s,r,n);return r.addBreakTokens?[new p(l.array,t.length),o,new p(l.break)]:[new p(l.array,t.length),o]},Object(t,e,r,n){let o=e!=="Object",i=o?t.keys():Object.keys(t),s=o?t.size:i.length;if(!s)return r.addBreakTokens===!0?[J.emptyMap,new p(l.break)]:J.emptyMap;n=le.createCheck(n,t);let c=[],f=0;for(let u of i)c[f++]=[rt(u,r,n),rt(o?t.get(u):t[u],r,n)];return oi(c,r),r.addBreakTokens?[new p(l.map,s),c,new p(l.break)]:[new p(l.map,s),c]}};Y.Map=Y.Object;Y.Buffer=Y.Uint8Array;for(let t of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))Y[`${t}Array`]=Y.DataView;function rt(t,e={},r){let n=Jt(t),o=e&&e.typeEncoders&&e.typeEncoders[n]||Y[n];if(typeof o=="function"){let s=o(t,n,e,r);if(s!=null)return s}let i=Y[n];if(!i)throw new Error(`${vt} unsupported type: ${n}`);return i(t,n,e,r)}a(rt,"objectToTokens");function oi(t,e){e.mapSorter&&t.sort(e.mapSorter)}a(oi,"sortMapEntries");function ii(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=qr[o].compareTokens(r,n);return i===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),i}a(ii,"mapSorter");function en(t,e,r,n){if(Array.isArray(e))for(let o of e)en(t,o,r,n);else r[e.type.major](t,e,n)}a(en,"tokensToEncoded");function si(t,e,r){let n=rt(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 s=i.encodedSize(n,r),c=new Te(s);if(i(c,n,r),c.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return xt(c.chunks[0])}}return At.reset(),en(At,n,e,r),At.toBytes(!0)}a(si,"encodeCustom");function Pe(t,e){return e=Object.assign({},ri,e),si(t,qr,e)}a(Pe,"encode");var ai={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},nt=class{constructor(e,r={}){this.pos=0,this.data=e,this.options=r}done(){return this.pos>=this.data.length}next(){let e=this.data[this.pos],r=H[e];if(r===void 0){let n=m[e];if(!n)throw new Error(`${w} 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}};a(nt,"Tokeniser");var Fe=Symbol.for("DONE"),ot=Symbol.for("BREAK");function ci(t,e,r){let n=[];for(let o=0;o<t.value;o++){let i=$e(e,r);if(i===ot){if(t.value===1/0)break;throw new Error(`${w} got unexpected break to lengthed array`)}if(i===Fe)throw new Error(`${w} found array but not enough entries (got ${o}, expected ${t.value})`);n[o]=i}return n}a(ci,"tokenToArray");function fi(t,e,r){let n=r.useMaps===!0,o=n?void 0:{},i=n?new Map:void 0;for(let s=0;s<t.value;s++){let c=$e(e,r);if(c===ot){if(t.value===1/0)break;throw new Error(`${w} got unexpected break to lengthed map`)}if(c===Fe)throw new Error(`${w} found map but not enough entries (got ${s} [no key], expected ${t.value})`);if(n!==!0&&typeof c!="string")throw new Error(`${w} non-string keys not supported (got ${typeof c})`);if(r.rejectDuplicateMapKeys===!0&&(n&&i.has(c)||!n&&c in o))throw new Error(`${w} found repeat map key "${c}"`);let f=$e(e,r);if(f===Fe)throw new Error(`${w} found map but not enough entries (got ${s} [no value], expected ${t.value})`);n?i.set(c,f):o[c]=f}return n?i:o}a(fi,"tokenToMap");function $e(t,e){if(t.done())return Fe;let r=t.next();if(r.type===l.break)return ot;if(r.type.terminal)return r.value;if(r.type===l.array)return ci(r,t,e);if(r.type===l.map)return fi(r,t,e);if(r.type===l.tag){if(e.tags&&typeof e.tags[r.value]=="function"){let n=$e(t,e);return e.tags[r.value](n)}throw new Error(`${w} tag not supported (${r.value})`)}throw new Error("unsupported")}a($e,"tokensToObject");function je(t,e){if(!(t instanceof Uint8Array))throw new Error(`${w} data to decode must be a Uint8Array`);e=Object.assign({},ai,e);let r=e.tokenizer||new nt(t,e),n=$e(r,e);if(n===Fe)throw new Error(`${w} did not find any content to decode`);if(n===ot)throw new Error(`${w} got unexpected break`);if(!r.done())throw new Error(`${w} too many terminals, data makes no sense`);return n}a(je,"decode");var E=class extends Error{constructor(e,r){super(),this.message=r,this.value=e,this.stack=new Error(`${e}: ${r}`).stack,this.name=this.constructor.name}};a(E,"CborldError");var A=class{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.")}};a(A,"CborldDecoder");var Ct=new Map,Bt=new Map;O(16,"https://www.w3.org/ns/activitystreams");O(17,"https://www.w3.org/2018/credentials/v1");O(18,"https://www.w3.org/ns/did/v1");O(19,"https://w3id.org/security/suites/ed25519-2018/v1");O(20,"https://w3id.org/security/suites/ed25519-2020/v1");O(21,"https://w3id.org/cit/v1");O(22,"https://w3id.org/age/v1");O(23,"https://w3id.org/security/suites/x25519-2020/v1");O(24,"https://w3id.org/veres-one/v1");O(25,"https://w3id.org/webkms/v1");O(26,"https://w3id.org/zcap/v1");O(27,"https://w3id.org/security/suites/hmac-2019/v1");O(28,"https://w3id.org/security/suites/aes-2019/v1");O(29,"https://w3id.org/vaccination/v1");O(30,"https://w3id.org/vc-revocation-list-2020/v1");O(31,"https://w3id.org/dcc/v1c");O(32,"https://w3id.org/vc/status-list/v1");function O(t,e){Bt.set(e,t),Ct.set(t,e)}a(O,"_addRegistration");var q=class extends A{constructor({reverseAppContextMap:e}={}){super(),this.reverseAppContextMap=e}decode({value:e}={}){if(typeof e!="number")return St(e);let r=Ct.get(e)||this.reverseAppContextMap.get(e);if(r===void 0)throw new E("ERR_UNDEFINED_COMPRESSED_CONTEXT",`Undefined compressed context "${e}".`);return r}static createDecoder({transformer:e}={}){let{reverseAppContextMap:r}=e;return new q({reverseAppContextMap:r})}};a(q,"ContextDecoder");function St(t){if(Array.isArray(t))return t.map(St);if(!(t instanceof Map))return t;let e={};for(let[r,n]of t)e[r]=St(n);return e}a(St,"_mapToObject");var an="3.7.5",ui=an,li=typeof atob=="function",pi=typeof btoa=="function",Oe=typeof Buffer=="function",tn=typeof TextDecoder=="function"?new TextDecoder:void 0,rn=typeof TextEncoder=="function"?new TextEncoder:void 0,di="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",ze=Array.prototype.slice.call(di),st=(t=>{let e={};return t.forEach((r,n)=>e[r]=n),e})(ze),hi=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,D=String.fromCharCode.bind(String),nn=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):t=>new Uint8Array(Array.prototype.slice.call(t,0)),cn=a(t=>t.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),"_mkUriSafe"),fn=a(t=>t.replace(/[^A-Za-z0-9\+\/]/g,""),"_tidyB64"),un=a(t=>{let e,r,n,o,i="",s=t.length%3;for(let c=0;c<t.length;){if((r=t.charCodeAt(c++))>255||(n=t.charCodeAt(c++))>255||(o=t.charCodeAt(c++))>255)throw new TypeError("invalid character found");e=r<<16|n<<8|o,i+=ze[e>>18&63]+ze[e>>12&63]+ze[e>>6&63]+ze[e&63]}return s?i.slice(0,s-3)+"===".substring(s):i},"btoaPolyfill"),It=pi?t=>btoa(t):Oe?t=>Buffer.from(t,"binary").toString("base64"):un,Ot=Oe?t=>Buffer.from(t).toString("base64"):t=>{let r=[];for(let n=0,o=t.length;n<o;n+=4096)r.push(D.apply(null,t.subarray(n,n+4096)));return It(r.join(""))},at=a((t,e=!1)=>e?cn(Ot(t)):Ot(t),"fromUint8Array"),mi=a(t=>{if(t.length<2){var e=t.charCodeAt(0);return e<128?t:e<2048?D(192|e>>>6)+D(128|e&63):D(224|e>>>12&15)+D(128|e>>>6&63)+D(128|e&63)}else{var e=65536+(t.charCodeAt(0)-55296)*1024+(t.charCodeAt(1)-56320);return D(240|e>>>18&7)+D(128|e>>>12&63)+D(128|e>>>6&63)+D(128|e&63)}},"cb_utob"),yi=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,ln=a(t=>t.replace(yi,mi),"utob"),on=Oe?t=>Buffer.from(t,"utf8").toString("base64"):rn?t=>Ot(rn.encode(t)):t=>It(ln(t)),Se=a((t,e=!1)=>e?cn(on(t)):on(t),"encode"),sn=a(t=>Se(t,!0),"encodeURI"),gi=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,wi=a(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 D((r>>>10)+55296)+D((r&1023)+56320);case 3:return D((15&t.charCodeAt(0))<<12|(63&t.charCodeAt(1))<<6|63&t.charCodeAt(2));default:return D((31&t.charCodeAt(0))<<6|63&t.charCodeAt(1))}},"cb_btou"),pn=a(t=>t.replace(gi,wi),"btou"),dn=a(t=>{if(t=t.replace(/\s+/g,""),!hi.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=st[t.charAt(i++)]<<18|st[t.charAt(i++)]<<12|(n=st[t.charAt(i++)])<<6|(o=st[t.charAt(i++)]),r+=n===64?D(e>>16&255):o===64?D(e>>16&255,e>>8&255):D(e>>16&255,e>>8&255,e&255);return r},"atobPolyfill"),Rt=li?t=>atob(fn(t)):Oe?t=>Buffer.from(t,"base64").toString("binary"):dn,hn=Oe?t=>nn(Buffer.from(t,"base64")):t=>nn(Rt(t).split("").map(e=>e.charCodeAt(0))),mn=a(t=>hn(yn(t)),"toUint8Array"),xi=Oe?t=>Buffer.from(t,"base64").toString("utf8"):tn?t=>tn.decode(hn(t)):t=>pn(Rt(t)),yn=a(t=>fn(t.replace(/[-_]/g,e=>e=="-"?"+":"/")),"_unURI"),Dt=a(t=>xi(yn(t)),"decode"),vi=a(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"),gn=a(t=>({value:t,enumerable:!1,writable:!0,configurable:!0}),"_noEnum"),wn=a(function(){let t=a((e,r)=>Object.defineProperty(String.prototype,e,gn(r)),"_add");t("fromBase64",function(){return Dt(this)}),t("toBase64",function(e){return Se(this,e)}),t("toBase64URI",function(){return Se(this,!0)}),t("toBase64URL",function(){return Se(this,!0)}),t("toUint8Array",function(){return mn(this)})},"extendString"),xn=a(function(){let t=a((e,r)=>Object.defineProperty(Uint8Array.prototype,e,gn(r)),"_add");t("toBase64",function(e){return at(this,e)}),t("toBase64URI",function(){return at(this,!0)}),t("toBase64URL",function(){return at(this,!0)})},"extendUint8Array"),_i=a(()=>{wn(),xn()},"extendBuiltins"),ct={version:an,VERSION:ui,atob:Rt,atobPolyfill:dn,btoa:It,btoaPolyfill:un,fromBase64:Dt,toBase64:Se,encode:Se,encodeURI:sn,encodeURL:sn,utob:ln,btou:pn,decode:Dt,isValid:vi,fromUint8Array:at,toUint8Array:mn,extendString:wn,extendUint8Array:xn,extendBuiltins:_i};var vn={};function _n(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,s=e.charAt(0),c=[0];for(o=0;o<t.length;++o){let f=t[o];for(let u=0;u<c.length;++u)f+=c[u]<<8,c[u]=f%i,f=f/i|0;for(;f>0;)c.push(f%i),f=f/i|0}for(o=0;t[o]===0&&o<t.length-1;++o)n+=s;for(o=c.length-1;o>=0;--o)n+=e[c[o]];if(r){let f=new RegExp(".{1,"+r+"}","g");n=n.match(f).join(`\r
|
2
|
-
`)}return n}a(_n,"encode");function bn(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=vn[e];if(!r){r=vn[e]=[];for(let s=0;s<e.length;++s)r[e.charCodeAt(s)]=s}t=t.replace(/\s/g,"");let n=e.length,o=e.charAt(0),i=[0];for(let s=0;s<t.length;s++){let c=r[t.charCodeAt(s)];if(c===void 0)return;let f=c;for(let u=0;u<i.length;++u)f+=i[u]*n,i[u]=f&255,f>>=8;for(;f>0;)i.push(f&255),f>>=8}for(let s=0;t[s]===o&&s<t.length-1;++s)i.push(0);return new Uint8Array(i.reverse())}a(bn,"decode");var En="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function Ve(t,e){return _n(t,En,e)}a(Ve,"encode");function ft(t){return bn(t,En)}a(ft,"decode");var pe=class 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${Ve(i)}`:e[0]===77?`M${ct.fromUint8Array(i)}`:e}static createDecoder({value:e}={}){if(!(e instanceof Uint8Array))return!1;if(e[0]===122||e[0]===77)return new pe}};a(pe,"MultibaseDecoder");var K=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]]),ut=100;var de=class{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:s,scopedContextMap:c,termMap:f}=o,u=this._getEntries({obj:e,transformMap:r,transformer:this,termMap:f});for(let[d,g]of u){let{term:h}=d;if(h==="@id"||s.id.has(h)){this._transformObjectId({obj:e,transformMap:r,termInfo:d,value:g});continue}if(h==="@type"||s.type.has(h)){this._transformObjectType({obj:e,transformMap:r,termInfo:d,value:g});continue}let y=i,x,v=c.get(h);v&&(x=await this._applyEmbeddedContexts({obj:{"@context":v},contextStack:n}),y=n.slice());let{plural:B,def:U}=d,F=this._getTermType({activeCtx:x||o,def:U}),$=B?g:[g],j=[];for(let fe of $){if(fe===null){j.push(null);continue}if(!this._transformTypedValue({entries:j,termType:F,value:fe,termInfo:d})){if(typeof fe!="object"){j.push(fe);continue}if(Array.isArray(fe)){await this._transformArray({entries:j,contextStack:y,value:fe});continue}await this._transformObject({entries:j,contextStack:y,value:fe})}}x&&x.revert(),this._assignEntries({entries:j,obj:e,transformMap:r,termInfo:d})}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,s=[],c=["@type",...i.type];for(let u of c){let d=e[u];Array.isArray(d)?s.push(...d):s.push(d)}s=[...new Set(s)].sort();let{scopedContextMap:f}=o;for(let u of s){let d=f.get(u);d&&(await this._updateContextStack({contextStack:r,contexts:d}),o=r[r.length-1],{scopedContextMap:f}=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 s=o.get(i);if(!s){let h=i,y;typeof i=="string"&&(y=i,{"@context":h}=await this._getDocument({url:y})),s=await this._addContext({context:h,contextUrl:y,transformer:n})}let c={aliases:{id:new Set(s.aliases.id),type:new Set(s.aliases.type)},context:i,scopedContextMap:new Map(s.scopedContextMap),termMap:new Map(s.termMap)},f=e[e.length-1];if(e.push(c),!f)continue;let{aliases:u,termMap:d}=c;for(let h of["id","type"])for(let y of f.aliases[h])i[y]===null||c.termMap.has(y)||u[h].add(y);let{scopedContextMap:g}=c;for(let[h,y]of f.scopedContextMap)i[h]===null||g.has(h)||g.set(h,y);for(let[h,y]of f.termMap)i[h]===null||d.has(h)||d.set(h,y)}}async _addContext({context:e,contextUrl:r}){let{contextMap:n,termToId:o,idToTerm:i}=this,s=e["@import"];if(s){let g=n.get(s);if(!g){let{"@context":h}=await this._getDocument({url:s});g=await this._addContext({context:h,contextUrl:s})}e={...g.context,...e}}let c=new Map,f=new Map,u={aliases:{id:new Set,type:new Set},context:e,scopedContextMap:c,termMap:f},d=Object.keys(e).sort();for(let g of d){let h=e[g];if(!h||(h==="@id"||h.id==="@id"?u.aliases.id.add(g):(h==="@type"||h.id==="@type")&&u.aliases.type.add(g),K.has(g)))continue;if(!o.has(g)){let x=this.nextTermId;this.nextTermId+=2,o.set(g,x),i&&i.set(x,g)}f.set(g,h);let y=h["@context"];y&&c.set(g,y)}return n.set(r||e,u),u}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(":"),s=e.termMap.get(o);if(s===void 0)return n;if(typeof s=="string")return s+i.join(":");if(!(typeof s=="object"&&typeof s["@id"]=="string"))throw new E("ERR_INVALID_TERM_DEFINITION",'JSON-LD term definitions must be strings or objects with "@id".');return s["@id"]+i.join(":")}_getIdForTerm({term:e,plural:r}){let n=this.termToId.get(e);if(n===void 0)throw new E("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}}};a(de,"Transformer");var Tn=new Map([[1024,"did:v1:nym:"],[1025,"did:key:"]]),ee=class extends A{decode({value:e}={}){let r=Tn.get(e[0]);return typeof e[1]=="string"?r+=e[1]:r+=`z${Ve(e[1])}`,e.length>2&&(typeof e[2]=="string"?r+=`#${e[2]}`:r+=`#z${Ve(e[2])}`),r}static createDecoder({value:e}={}){return!(Array.isArray(e)&&e.length>1&&e.length<=3)||!Tn.has(e[0])?!1:new ee}};a(ee,"Base58DidUrlDecoder");var te=class 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 te({secure:e[0]===2}):!1}};a(te,"HttpUrlDecoder");var An=/^(?:[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 bi(t){return typeof t=="string"&&An.test(t)}a(bi,"validate");var lt=bi;var I=[];for(pt=0;pt<256;++pt)I.push((pt+256).toString(16).substr(1));var pt;function Ei(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(I[t[e+0]]+I[t[e+1]]+I[t[e+2]]+I[t[e+3]]+"-"+I[t[e+4]]+I[t[e+5]]+"-"+I[t[e+6]]+I[t[e+7]]+"-"+I[t[e+8]]+I[t[e+9]]+"-"+I[t[e+10]]+I[t[e+11]]+I[t[e+12]]+I[t[e+13]]+I[t[e+14]]+I[t[e+15]]).toLowerCase();if(!lt(r))throw TypeError("Stringified UUID is invalid");return r}a(Ei,"stringify");var Ut=Ei;function Ti(t){if(!lt(t))throw TypeError("Invalid UUID");var 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}a(Ti,"parse");var kt=Ti;var he=class extends A{decode({value:e}={}){return`urn:uuid:${typeof e[1]=="string"?e[1]:Ut(e[1])}`}static createDecoder({value:e}={}){if(e.length===2&&(typeof e[1]=="string"||e[1]instanceof Uint8Array))return new he}};a(he,"UuidUrnDecoder");var Ai=new Map([[1,te],[2,te],[3,he],[1024,ee],[1025,ee]]),re=class extends A{static createDecoder({value:e}={}){if(!(Array.isArray(e)||e.length>1))return!1;let r=Ai.get(e[0]);return r&&r.createDecoder({value:e})}};a(re,"UriDecoder");var W=class extends A{constructor({term:e}={}){super(),this.term=e}decode(){return this.term}static createDecoder({value:e,transformer:r}={}){if(Array.isArray(e))return re.createDecoder({value:e,transformer:r});let n=r.idToTerm.get(e);if(n!==void 0)return new W({term:n})}};a(W,"VocabTermDecoder");var me=class 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 me}};a(me,"XsdDateDecoder");var ne=class 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 ne;if(Array.isArray(e)&&e.length===2&&(typeof e[0]=="number"||typeof e[1]=="number"))return new ne}};a(ne,"XsdDateTimeDecoder");function oe(t,e){return JSON.stringify(t,null,2)}a(oe,"inspect");var Ci=new Map([["@id",re],["@vocab",W],["https://w3id.org/security#multibase",pe],["http://www.w3.org/2001/XMLSchema#date",me],["http://www.w3.org/2001/XMLSchema#dateTime",ne]]),Mt=K.get("@context"),Cn=Mt+1,Qe=class extends de{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(K),this.nextTermId=ut,this.idToTerm=new Map;for(let[c,f]of this.termToId)this.idToTerm.set(f,c);let n=je(e,{useMaps:!0});r&&(r("Diagnostic CBOR-LD decompression transform map(s):"),r(oe(n,{depth:null,colors:!0})));let o=[],i=Array.isArray(n),s=i?n:[n];for(let c of s){let f={};await this._transform({obj:f,transformMap:c}),o.push(f)}return i?o:o[0]}_beforeObjectContexts({obj:e,transformMap:r}){let n=r.get(Mt);if(n){let i=q.createDecoder({value:n,transformer:this});e["@context"]=i?i.decode({value:n}):n}let o=r.get(Cn);if(o){if(n)throw new E("ERR_INVALID_ENCODED_CONTEXT","Both singular and plural context IDs were found in the CBOR-LD input.");if(!Array.isArray(o))throw new E("ERR_INVALID_ENCODED_CONTEXT","Encoded plural context value must be an array.");let i=[];for(let s of o){let c=q.createDecoder({value:s,transformer:this});i.push(c?c.decode({value:s}):s)}e["@context"]=i}}_beforeTypeScopedContexts({activeCtx:e,obj:r,transformMap:n}){let{termToId:o}=this,i=["@type",...e.aliases.type];for(let s of i){let c=o.get(s),f=n.get(c);if(f===void 0&&(f=n.get(c+1)),f!==void 0)if(Array.isArray(f))r[s]=f.map(u=>{let d=W.createDecoder({value:u,transformer:this});return d?d.decode({value:u}):u});else{let u=W.createDecoder({value:f,transformer:this});r[s]=u?u.decode({value:f}):f}}}_getEntries({transformMap:e,termMap:r}){let n=[];for(let[o,i]of e){if(o===Mt||o===Cn)continue;let{term:s,plural:c}=this._getTermForId({id:o});if(s===void 0)throw new E("ERR_UNKNOWN_CBORLD_TERM_ID",`Unknown term ID '${o}' was detected in the CBOR-LD input.`);let f=r.get(s);if(f===void 0&&!(s.startsWith("@")&&K.has(s)))throw new E("ERR_UNKNOWN_CBORLD_TERM",`Unknown term "${s}" was detected in the CBOR-LD input.`);n.push([{term:s,termId:o,plural:c,def:f},i])}return n.sort(Bi)}_getTermInfo({termMap:e,key:r}){let{term:n,plural:o}=this._getTermForId({id:r});if(n===void 0)throw new E("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("@")&&K.has(n)))throw new E("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=re.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,s=i?n:[n],c=[];for(let f of s){let u=W.createDecoder({value:f,transformer:this});c.push(u?u.decode({value:f}):f)}e[o]=i?c:c[0]}_transformTypedValue({entries:e,termType:r,value:n}){let o=Ci.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 s={};o.push(s),await this._transform({obj:s,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]}};a(Qe,"Decompressor");function Bi([{term:t}],[{term:e}]){return t<e?-1:t>e?1:0}a(Bi,"_sortEntriesByTerm");async function Lt({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 E("ERR_NOT_CBORLD",'CBOR-LD must start with a CBOR major type "Tag" header of `0xd9`.');if(t[o++]!==5)throw new E("ERR_NOT_CBORLD","CBOR-LD 16-bit tag must start with `0x05`.");let i=t[o];if(i===void 0)throw new E("ERR_NOT_CBORLD","Truncated CBOR-LD 16-bit tag.");if(!(i===0||i===1))throw new E("ERR_NOT_CBORLD",`Unsupported CBOR-LD compression mode "${i}".`);o++;let{buffer:s,byteOffset:c,length:f}=t,u=new Uint8Array(s,c+o,f-o);if(i===0)return je(u,{useMaps:!1});let g=await new Qe({documentLoader:e,appContextMap:r}).decompress({compressedBytes:u,diagnose:n});return n&&(n("Diagnostic JSON-LD result:"),n(oe(g,{depth:null,colors:!0}))),g}a(Lt,"decode");var b=class{encode(){throw new Error("Must be implemented by derived class.")}static createEncoder({value:e}={}){throw new Error("Must be implemented by derived class.")}};a(b,"CborldEncoder");var ye=class extends b{constructor({context:e,appContextMap:r}={}){super(),this.context=e,this.appContextMap=r}encode(){let{context:e}=this,r=Bt.get(e)||this.appContextMap.get(e);return r===void 0?new p(l.string,e):new p(l.uint,r)}static createEncoder({value:e,transformer:r}={}){if(typeof e!="string")return!1;let{appContextMap:n}=r;return new ye({context:e,appContextMap:n})}};a(ye,"ContextEncoder");var ge=class extends b{constructor({value:e}={}){super(),this.value=e}encode(){let{value:e}=this,r,n;e[0]==="z"?(r=122,n=ft(e.substr(1))):e[0]==="M"&&(r=77,n=ct.toUint8Array(e.substr(1)));let o=new Uint8Array(1+n.length);return o[0]=r,o.set(n,1),new p(l.bytes,o)}static createEncoder({value:e}={}){if(typeof e!="string")return!1;if(e[0]==="z"||e[0]==="M")return new ge({value:e})}};a(ge,"MultibaseEncoder");var Bn=new Map([["did:v1:nym:",1024],["did:key:",1025]]),ie=class 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("#"),s=[new p(l.uint,Bn.get(r)),Sn(o)];return i!==void 0&&s.push(Sn(i)),[new p(l.array,s.length),s]}static createEncoder({value:e}={}){let r=[...Bn.keys()];for(let n of r)if(e.startsWith(n))return new ie({value:e,scheme:n})}};a(ie,"Base58DidUrlEncoder");function Sn(t){if(t.startsWith("z")){let e=ft(t.substr(1));if(e)return new p(l.bytes,e)}return new p(l.string,t)}a(Sn,"_multibase58ToToken");var X=class 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 p(l.uint,r?2:1),new p(l.string,e.substr(n))];return[new p(l.array,o.length),o]}static createEncoder({value:e}={}){if(e.startsWith("https://"))return new X({value:e,secure:!0});if(e.startsWith("http://"))return new X({value:e,secure:!1})}};a(X,"HttpUrlEncoder");var we=class extends b{constructor({value:e}={}){super(),this.value=e}encode(){let{value:e}=this,r=e.substr(9),n=[new p(l.uint,3)];if(r.toLowerCase()===r){let o=kt(r);n.push(new p(l.bytes,o))}else n.push(new p(l.string,r));return[new p(l.array,n.length),n]}static createEncoder({value:e}={}){if(e.startsWith("urn:uuid:"))return new we({value:e})}};a(we,"UuidUrnEncoder");var Si=new Map([["http",X],["https",X],["urn:uuid",we],["did:v1:nym",ie],["did:key",ie]]),se=class 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 s=e.split(":");s.pop(),r=s.join(":")}catch{return!1}let n=Si.get(r);return n&&n.createEncoder({value:e})}};a(se,"UriEncoder");var ae=class extends b{constructor({termId:e}={}){super(),this.termId=e}encode(){return new p(l.uint,this.termId)}static createEncoder({value:e,transformer:r}={}){let{termToId:n}=r,o=n.get(e);return o!==void 0?new ae({termId:o}):se.createEncoder({value:e})}};a(ae,"VocabTermEncoder");var xe=class 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 p(l.string,e):new p(l.uint,n)}static createEncoder({value:e}={}){if(e.includes("T"))return!1;let r=Date.parse(e);return isNaN(r)?!1:new xe({value:e,parsed:r})}};a(xe,"XsdDateEncoder");var ve=class 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 p(l.uint,n),i=e.indexOf(".");if(i===-1){let u=new Date(n*1e3).toISOString().replace(".000Z","Z");return e!==u?new p(l.string,e):o}let s=parseInt(e.substr(i+1),10),c=new Date(n*1e3+s).toISOString();if(e!==c)return new p(l.string,e);let f=[o,new p(l.uint,s)];return[new p(l.array,f.length),f]}static createEncoder({value:e}={}){if(!e.includes("T"))return!1;let r=Date.parse(e);return isNaN(r)?!1:new ve({value:e,parsed:r})}};a(ve,"XsdDateTimeEncoder");var Oi=new Map([["@id",se],["@vocab",ae],["https://w3id.org/security#multibase",ge],["http://www.w3.org/2001/XMLSchema#date",xe],["http://www.w3.org/2001/XMLSchema#dateTime",ve]]),On=K.get("@context"),Di=On+1,Ii={Object(t){if(t instanceof b)return t.encode({obj:t})}},He=class extends de{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(oe(n,{depth:null,colors:!0}))),Pe(n,{typeEncoders:Ii})}async _createTransformMaps({jsonldDocument:e}){this.contextMap=new Map,this.termToId=new Map(K),this.nextTermId=ut;let r=[],n=Array.isArray(e),o=n?e:[e];for(let i of o){let s=new Map;await this._transform({obj:i,transformMap:s}),r.push(s)}return n?r:r[0]}_afterObjectContexts({obj:e,transformMap:r}){let n=e["@context"];if(!n)return;let o=[],i=Array.isArray(n),s=i?n:[n];for(let f of s){let u=ye.createEncoder({value:f,transformer:this});o.push(u||f)}let c=i?Di:On;r.set(c,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 s=r.get(i);if(s===void 0&&!(i.startsWith("@")&&K.has(i)))throw new E("ERR_UNKNOWN_CBORLD_TERM",`Unknown term '${i}' was detected in the JSON-LD input.`);let c=e[i],f=Array.isArray(c),u=this._getIdForTerm({term:i,plural:f});n.push([{term:i,termId:u,plural:f,def:s},c])}return n}_transformObjectId({transformMap:e,termInfo:r,value:n}){let{termId:o}=r,i=se.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,s=i?n:[n],c=[];for(let f of s){let u=ae.createEncoder({value:f,transformer:this,termInfo:r});c.push(u||f)}e.set(o,i?c:c[0])}_transformTypedValue({entries:e,termType:r,value:n,termInfo:o}){let i=Oi.get(r),s=i&&i.createEncoder({value:n,transformer:this,termInfo:o});if(s)return e.push(s),!0}async _transformArray({entries:e,contextStack:r,value:n}){let o=[];for(let i of n){let s=new Map;o.push(s),await this._transform({obj:i,transformMap:s,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])}};a(He,"Compressor");async function Nt({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]),s;n===0?s=Pe(t):s=await new He({documentLoader:e,appContextMap:r}).compress({jsonldDocument:t,diagnose:o});let c=i.length+s.length,f=new Uint8Array(c);return f.set(i),f.set(s,i.length),o&&(o("Diagnostic CBOR-LD result:"),o(oe(f,{depth:null,colors:!0}))),f}a(Nt,"encode");function Pt(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")}a(Pt,"toDataView");var Ui="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",ki="0123456789ABCDEFGHIJKLMNOPQRSTUV",Mi="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Ft(t,e,r){r=r||{};let n,o;switch(e){case"RFC3548":case"RFC4648":n=Ui,o=!0;break;case"RFC4648-HEX":n=ki,o=!0;break;case"Crockford":n=Mi,o=!1;break;default:throw new Error("Unknown base32 variant: "+e)}let i=r.padding!==void 0?r.padding:o,s=Pt(t),c=0,f=0,u="";for(let d=0;d<s.byteLength;d++)for(f=f<<8|s.getUint8(d),c+=8;c>=5;)u+=n[f>>>c-5&31],c-=5;if(c>0&&(u+=n[f<<5-c&31]),i)for(;u.length%8!==0;)u+="=";return u}a(Ft,"base32Encode");var Ao=Xt(In(),1);var T;(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"})(T||(T={}));var oo=Xt(no(),1),{__extends:ce,__assign:Ef,__rest:Tf,__decorate:Af,__param:Cf,__esDecorate:Bf,__runInitializers:Sf,__propKey:Of,__setFunctionName:Df,__metadata:If,__awaiter:Rf,__generator:Uf,__exportStar:kf,__createBinding:Mf,__values:Lf,__read:Nf,__spread:Pf,__spreadArrays:Ff,__spreadArray:$f,__await:jf,__asyncGenerator:zf,__asyncDelegator:Vf,__asyncValues:Qf,__makeTemplateObject:Hf,__importStar:Kf,__importDefault:Gf,__classPrivateFieldGet:Wf,__classPrivateFieldSet:Zf,__classPrivateFieldIn:Xf}=oo.default;var Ie=function(){function t(e,r){this.bytes=[],this.mode=e,this.data=r}return a(t,"QRData"),t.prototype.getLength=function(){return this.bytes.length},t.prototype.getLengthInBits=function(e){var r=this.mode,n=new Error("illegal mode: ".concat(r));if(1<=e&&e<10)switch(r){case T.Numeric:return 10;case T.Alphanumeric:return 9;case T.Byte:return 8;case T.Kanji:return 8;default:throw n}else if(e<27)switch(r){case T.Numeric:return 12;case T.Alphanumeric:return 11;case T.Byte:return 16;case T.Kanji:return 10;default:throw n}else if(e<41)switch(r){case T.Numeric:return 14;case T.Alphanumeric:return 13;case T.Byte:return 16;case T.Kanji:return 12;default:throw n}else throw new Error("illegal version: ".concat(e))},t}();function io(t){for(var e=0,r=t.length,n=[],o=0;o<r;o++){var 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}a(io,"encode");var so=function(t){ce(e,t);function e(r,n){var o=t.call(this,T.Byte,r)||this;if(o.encoding=-1,typeof n=="function"){var i=n(r),s=i.encoding,c=i.bytes;o.bytes=c,o.encoding=s}else o.bytes=io(r),o.encoding=26;return o}return a(e,"QRByte"),e.prototype.writeTo=function(r){for(var n=this.bytes,o=0,i=n;o<i.length;o++){var s=i[o];r.put(s,8)}},e}(Ie);var _e=[],jt=[];for(R=0;R<256;R++)jt[R]=0,_e[R]=R<8?1<<R:_e[R-4]^_e[R-5]^_e[R-6]^_e[R-8];var R;for(R=0;R<255;R++)jt[_e[R]]=R;var R;function Re(t){if(t<1)throw new Error("illegal log: ".concat(t));return jt[t]}a(Re,"glog");function Ke(t){for(;t<0;)t+=255;for(;t>=256;)t-=255;return _e[t]}a(Ke,"gexp");var Ge=function(){function t(e,r){r===void 0&&(r=0);for(var n=0,o=e.length;n<o&&e[n]===0;)n++;o-=n;for(var i=[],s=0;s<o;s++)i.push(e[n+s]);for(var s=0;s<r;s++)i.push(0);this.num=i}return a(t,"Polynomial"),t.prototype.getAt=function(e){return this.num[e]},t.prototype.getLength=function(){return this.num.length},t.prototype.multiply=function(e){for(var r=[],n=e.getLength(),o=this.getLength(),i=o+n-1,s=0;s<i;s++)r.push(0);for(var s=0;s<o;s++)for(var c=0;c<n;c++)r[s+c]^=Ke(Re(this.getAt(s))+Re(e.getAt(c)));return new t(r)},t.prototype.mod=function(e){var r=e.getLength(),n=this.getLength();if(n-r<0)return this;for(var o=Re(this.getAt(0))-Re(e.getAt(0)),i=[],s=0;s<n;s++)i.push(this.getAt(s));for(var s=0;s<r;s++)i[s]^=Ke(Re(e.getAt(s))+o);return new t(i).mod(e)},t}();var $i=3,ji=3,ao=40,zi=10,Vi=[[],[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]],Qi=1<<14|1<<12|1<<10|1<<4|1<<1,lo=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,po=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0;function ho(t){return Vi[t-1]}a(ho,"getAlignmentPattern");function mo(t){for(var e=new Ge([1]),r=0;r<t;r++)e=e.multiply(new Ge([1,Ke(r)]));return e}a(mo,"getErrorCorrectionPolynomial");function Ue(t){for(var e=0;t!==0;)e++,t>>>=1;return e}a(Ue,"getBCHDigit");var co=Ue(po);function yo(t){for(var e=t<<12;Ue(e)-co>=0;)e^=po<<Ue(e)-co;return t<<12|e}a(yo,"getBCHVersion");var fo=Ue(lo);function go(t){for(var e=t<<10;Ue(e)-fo>=0;)e^=lo<<Ue(e)-fo;return(t<<10|e)^Qi}a(go,"getBCHVersionInfo");function uo(t,e){for(var r=t.getMatrixSize(),n=0,o=0;o<r;o++)for(var i=!1,s=0,c=0;c<r;c++){var f=e?t.isDark(o,c):t.isDark(c,o);f===i?(s++,s===5?n+=$i:s>5&&n++):(i=f,s=1)}return n}a(uo,"applyMaskPenaltyRule1Internal");function Hi(t){return uo(t,!0)+uo(t,!1)}a(Hi,"applyMaskPenaltyRule1");function Ki(t){for(var e=t.getMatrixSize(),r=0,n=0;n<e-1;n++)for(var o=0;o<e-1;o++){var 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+=ji)}return r}a(Ki,"applyMaskPenaltyRule2");function yt(t,e,r,n,o){r=Math.max(r,0),n=Math.min(n,t.getMatrixSize());for(var i=r;i<n;i++){var s=o?t.isDark(e,i):t.isDark(i,e);if(s)return!1}return!0}a(yt,"isFourWhite");function Gi(t){for(var e=t.getMatrixSize(),r=0,n=0;n<e;n++)for(var 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)&&(yt(t,n,o-4,o,!0)||yt(t,n,o+7,o+11,!0))&&(r+=ao),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)&&(yt(t,o,n-4,n,!1)||yt(t,o,n+7,n+11,!1))&&(r+=ao);return r}a(Gi,"applyMaskPenaltyRule3");function Wi(t){for(var e=t.getMatrixSize(),r=0,n=0;n<e;n++)for(var o=0;o<e;o++)t.isDark(n,o)&&r++;var i=e*e,s=Math.floor(Math.abs(r*20-i*10)/i);return s*zi}a(Wi,"applyMaskPenaltyRule4");function wo(t){return Hi(t)+Ki(t)+Gi(t)+Wi(t)}a(wo,"calculateMaskPenalty");var P;(function(t){t[t.L=1]="L",t[t.M=0]="M",t[t.Q=3]="Q",t[t.H=2]="H"})(P||(P={}));var xo=function(){function t(e,r){this.dataCount=r,this.totalCount=e}return a(t,"RSBlock"),t.prototype.getDataCount=function(){return this.dataCount},t.prototype.getTotalCount=function(){return this.totalCount},t.getRSBlocks=function(e,r){for(var n=[],o=t.getRSBlockTable(e,r),i=o.length/3,s=0;s<i;s++)for(var c=o[s*3+0],f=o[s*3+1],u=o[s*3+2],d=0;d<c;d++)n.push(new t(f,u));return n},t.getRSBlockTable=function(e,r){switch(r){case P.L:return t.RS_BLOCK_TABLE[(e-1)*4+0];case P.M:return t.RS_BLOCK_TABLE[(e-1)*4+1];case P.Q:return t.RS_BLOCK_TABLE[(e-1)*4+2];case P.H:return t.RS_BLOCK_TABLE[(e-1)*4+3];default:throw new Error("illegal error correction level: ".concat(r))}},t.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]],t}();var zt=function(){function t(){this.length=0,this.buffer=[]}return a(t,"BitBuffer"),t.prototype.getBuffer=function(){return this.buffer},t.prototype.getLengthInBits=function(){return this.length},t.prototype.getBit=function(e){return(this.buffer[e/8>>0]>>>7-e%8&1)===1},t.prototype.put=function(e,r){for(var n=0;n<r;n++)this.putBit((e>>>r-n-1&1)===1)},t.prototype.putBit=function(e){var r=this.buffer;this.length===r.length*8&&r.push(0),e&&(r[this.length/8>>0]|=128>>>this.length%8),this.length++},t}();var gt=function(){function t(){}return a(t,"OutputStream"),t.prototype.writeBytes=function(e,r,n){r===void 0&&(r=0),n===void 0&&(n=e.length);for(var o=0;o<n;o++)this.writeByte(e[o+r])},t.prototype.flush=function(){},t.prototype.close=function(){this.flush()},t}();var wt=function(t){ce(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.bytes=[],r}return a(e,"ByteArrayOutputStream"),e.prototype.writeByte=function(r){this.bytes.push(r)},e.prototype.writeInt16=function(r){this.bytes.push(r,r>>>8)},e.prototype.toByteArray=function(){return this.bytes},e}(gt);function Zi(t){if(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: ".concat(String.fromCharCode(t)))}a(Zi,"encode");var vo=function(t){ce(e,t);function e(r){var n=t.call(this)||this;return n.buffer=0,n.length=0,n.bufLength=0,n.stream=r,n}return a(e,"Base64EncodeOutputStream"),e.prototype.writeByte=function(r){for(this.buffer=this.buffer<<8|r&255,this.bufLength+=8,this.length++;this.bufLength>=6;)this.writeEncoded(this.buffer>>>this.bufLength-6),this.bufLength-=6},e.prototype.flush=function(){this.bufLength>0&&(this.writeEncoded(this.buffer<<6-this.bufLength),this.buffer=0,this.bufLength=0);var r=this.stream;if(this.length%3!=0)for(var n=3-this.length%3,o=0;o<n;o++)r.writeByte(61)},e.prototype.writeEncoded=function(r){this.stream.writeByte(Zi(r&63))},e}(gt);function Xi(t){var e=new wt,r=new vo(e);return r.writeBytes(t),r.close(),e.close(),e.toByteArray()}a(Xi,"encodeToBase64");var Ji=function(){function t(){this.size=0,this.map={}}return a(t,"LZWTable"),t.prototype.add=function(e){this.contains(e)||(this.map[e]=this.size++)},t.prototype.getSize=function(){return this.size},t.prototype.indexOf=function(e){return this.map[e]},t.prototype.contains=function(e){return this.map[e]>=0},t}(),Yi=function(){function t(e){this.output=e,this.bitLength=0,this.bitBuffer=0}return a(t,"BitOutputStream"),t.prototype.write=function(e,r){if(e>>>r!==0)throw new Error("length overflow");for(var n=this.output;this.bitLength+r>=8;)n.writeByte(255&(e<<this.bitLength|this.bitBuffer)),r-=8-this.bitLength,e>>>=8-this.bitLength,this.bitBuffer=0,this.bitLength=0;this.bitBuffer=e<<this.bitLength|this.bitBuffer,this.bitLength=this.bitLength+r},t.prototype.flush=function(){var e=this.output;this.bitLength>0&&e.writeByte(this.bitBuffer),e.flush()},t.prototype.close=function(){this.flush(),this.output.close()},t}(),_o=function(){function t(e,r){this.data=[],this.width=e,this.height=r;for(var n=e*r,o=0;o<n;o++)this.data[o]=0}return a(t,"GIFImage"),t.prototype.getLZWRaster=function(e){for(var r=new Ji,n=String.fromCharCode,o=1<<e,i=(1<<e)+1,s=0;s<o;s++)r.add(n(s));r.add(n(o)),r.add(n(i));var c=e+1,f=new wt,u=new Yi(f);try{var d=this.data,g=d.length,h=String.fromCharCode;u.write(o,c);for(var y=0,x=h(d[y++]);y<g;){var v=h(d[y++]);r.contains(x+v)?x+=v:(u.write(r.indexOf(x),c),r.getSize()<4095&&(r.getSize()===1<<c&&c++,r.add(x+v)),x=v)}u.write(r.indexOf(x),c),u.write(i,c)}finally{u.close()}return f.toByteArray()},t.prototype.setPixel=function(e,r,n){var o=this,i=o.width,s=o.height;if(e<0||i<=e)throw new Error("illegal x axis: ".concat(e));if(r<0||s<=r)throw new Error("illegal y axis: ".concat(r));this.data[r*i+e]=n},t.prototype.getPixel=function(e,r){var n=this,o=n.width,i=n.height;if(e<0||o<=e)throw new Error("illegal x axis: ".concat(e));if(r<0||i<=r)throw new Error("illegal y axis: ".concat(r));return this.data[r*o+e]},t.prototype.write=function(e){var r=this,n=r.width,o=r.height;e.writeByte(71),e.writeByte(73),e.writeByte(70),e.writeByte(56),e.writeByte(55),e.writeByte(97),e.writeInt16(n),e.writeInt16(o),e.writeByte(128),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(0),e.writeByte(255),e.writeByte(255),e.writeByte(255),e.writeByte(44),e.writeInt16(0),e.writeInt16(0),e.writeInt16(n),e.writeInt16(o),e.writeByte(0);var i=2,s=this.getLZWRaster(i),c=s.length;e.writeByte(i);for(var f=0;c-f>255;)e.writeByte(255),e.writeBytes(s,f,255),f+=255;var u=c-f;e.writeByte(u),e.writeBytes(s,f,u),e.writeByte(0),e.writeByte(59)},t.prototype.toDataURL=function(){var e=new wt;this.write(e);var r=Xi(e.toByteArray());e.close();for(var n=r.length,o=String.fromCharCode,i="data:image/gif;base64,",s=0;s<n;s++)i+=o(r[s]);return i},t}();function bo(t){switch(t){case 0:return function(e,r){return(e+r&1)===0};case 1:return function(e,r){return(r&1)===0};case 2:return function(e,r){return e%3===0};case 3:return function(e,r){return(e+r)%3===0};case 4:return function(e,r){return((e/3>>0)+(r/2>>0)&1)===0};case 5:return function(e,r){return(e*r&1)+e*r%3===0};case 6:return function(e,r){return((e*r&1)+e*r%3&1)===0};case 7:return function(e,r){return(e*r%3+(e+r&1)&1)===0};default:throw new Error("illegal mask: ".concat(t))}}a(bo,"getMaskFunc");var qi=236,es=17,ts=Object.prototype.toString;function rs(t,e){if(t<0||t>=1e6)throw new Error("byte mode encoding hint out of range");e.put(T.ECI,4),t<1<<7?e.put(t,8):t<1<<14?(e.put(2,2),e.put(t,14)):(e.put(6,3),e.put(t,21))}a(rs,"appendECI");function Eo(t,e,r,n){for(var o=new zt,i=xo.getRSBlocks(t,e),s=0,c=n;s<c.length;s++){var f=c[s],u=f.mode;r&&u===T.Byte&&rs(f.encoding,o),o.put(u,4),o.put(f.getLength(),f.getLengthInBits(t)),f.writeTo(o)}for(var d=0,g=0,h=i;g<h.length;g++){var y=h[g];d+=y.getDataCount()}return d*=8,[o,i,d]}a(Eo,"prepareData");function ns(t,e){for(var r=0,n=0,o=0,i=[],s=[],c=e.length,f=t.getBuffer(),u=0;u<c;u++){var d=e[u],g=d.getDataCount(),h=d.getTotalCount()-g;n=Math.max(n,g),o=Math.max(o,h),i[u]=[];for(var y=0;y<g;y++)i[u][y]=255&f[y+r];r+=g;var x=mo(h),v=x.getLength()-1,B=new Ge(i[u],v),U=B.mod(x),F=U.getLength();s[u]=[];for(var y=0;y<v;y++){var $=y+F-v;s[u][y]=$>=0?U.getAt($):0}}t=new zt;for(var y=0;y<n;y++)for(var u=0;u<c;u++)y<i[u].length&&t.put(i[u][y],8);for(var y=0;y<o;y++)for(var u=0;u<c;u++)y<s[u].length&&t.put(s[u][y],8);return t}a(ns,"createBytes");function os(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(qi,8),t.getLengthInBits()>=r));)t.put(es,8);return ns(t,e)}a(os,"createData");var Vt=function(){function t(e){e===void 0&&(e={}),this.matrixSize=0,this.chunks=[],this.matrix=[];var r=e.version,n=r===void 0?0:r,o=e.encodingHint,i=o===void 0?!1:o,s=e.errorCorrectionLevel,c=s===void 0?P.L:s;this.setVersion(n),this.setEncodingHint(i),this.setErrorCorrectionLevel(c)}return a(t,"Encoder"),t.prototype.getMatrix=function(){return this.matrix},t.prototype.getMatrixSize=function(){return this.matrixSize},t.prototype.getVersion=function(){return this.version},t.prototype.setVersion=function(e){return this.version=Math.min(40,Math.max(0,e>>0)),this.auto=this.version===0,this},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.setErrorCorrectionLevel=function(e){switch(e){case P.L:case P.M:case P.Q:case P.H:this.errorCorrectionLevel=e}return this},t.prototype.getEncodingHint=function(){return this.encodingHint},t.prototype.setEncodingHint=function(e){return this.encodingHint=e,this},t.prototype.write=function(e){var r=this.chunks;if(e instanceof Ie)r.push(e);else{var n=ts.call(e);if(n==="[object String]")r.push(new so(e));else throw new Error("illegal data: ".concat(e))}return this},t.prototype.isDark=function(e,r){return this.matrix[e][r]===!0},t.prototype.setupFinderPattern=function(e,r){for(var n=this.matrix,o=this.matrixSize,i=-1;i<=7;i++)for(var s=-1;s<=7;s++)e+i<=-1||o<=e+i||r+s<=-1||o<=r+s||(0<=i&&i<=6&&(s===0||s===6)||0<=s&&s<=6&&(i===0||i===6)||2<=i&&i<=4&&2<=s&&s<=4?n[e+i][r+s]=!0:n[e+i][r+s]=!1)},t.prototype.setupAlignmentPattern=function(){for(var e=this.matrix,r=ho(this.version),n=r.length,o=0;o<n;o++)for(var i=0;i<n;i++){var s=r[o],c=r[i];if(e[s][c]===null)for(var f=-2;f<=2;f++)for(var u=-2;u<=2;u++)f===-2||f===2||u===-2||u===2||f===0&&u===0?e[s+f][c+u]=!0:e[s+f][c+u]=!1}},t.prototype.setupTimingPattern=function(){for(var e=this.matrix,r=this.matrixSize-8,n=8;n<r;n++){var o=n%2===0;e[n][6]===null&&(e[n][6]=o),e[6][n]===null&&(e[6][n]=o)}},t.prototype.setupFormatInfo=function(e){for(var r=this.matrix,n=this.errorCorrectionLevel<<3|e,o=go(n),i=this.matrixSize,s=0;s<15;s++){var c=(o>>s&1)===1;s<6?r[s][8]=c:s<8?r[s+1][8]=c:r[i-15+s][8]=c,s<8?r[8][i-s-1]=c:s<9?r[8][15-s-1+1]=c:r[8][15-s-1]=c}r[i-8][8]=!0},t.prototype.setupVersionInfo=function(){if(this.version>=7)for(var e=this.matrix,r=this.matrixSize,n=yo(this.version),o=0;o<18;o++){var 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}},t.prototype.setupCodewords=function(e,r){for(var n=this.matrix,o=this.matrixSize,i=e.getLengthInBits(),s=bo(r),c=0,f=o-1;f>=1;f-=2){f===6&&(f=5);for(var u=0;u<o;u++)for(var d=0;d<2;d++){var g=f-d,h=(f+1&2)===0,y=h?o-1-u:u;if(n[y][g]===null){var x=!1;c<i&&(x=e.getBit(c++));var v=s(g,y);v&&(x=!x),n[y][g]=x}}}},t.prototype.buildMatrix=function(e,r){for(var n=[],o=this.matrixSize,i=0;i<o;i++){n[i]=[];for(var s=0;s<o;s++)n[i][s]=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)},t.prototype.make=function(){var e,r,n,o,i,s=this,c=s.chunks,f=s.errorCorrectionLevel;if(this.auto){for(var u=1;u<=40&&(e=Eo(u,f,this.encodingHint,c),n=e[0],o=e[1],i=e[2],!(n.getLengthInBits()<=i));u++);var d=n.getLengthInBits();if(d>i)throw new Error("data overflow: ".concat(d," > ").concat(i));this.version=u}else r=Eo(this.version,f,this.encodingHint,c),n=r[0],o=r[1],i=r[2];this.matrixSize=this.version*4+17;for(var g=[],h=os(n,o,i),y=-1,x=Number.MAX_VALUE,v=0;v<8;v++){this.buildMatrix(h,v),g.push(this.matrix);var B=wo(this);B<x&&(x=B,y=v)}return this.matrix=g[y],this},t.prototype.toDataURL=function(e,r){e===void 0&&(e=2),r===void 0&&(r=e*4),e=Math.max(1,e>>0),r=Math.max(0,r>>0);for(var n=this.matrixSize,o=e*n+r*2,i=r,s=o-r,c=new _o(o,o),f=0;f<o;f++)for(var u=0;u<o;u++)if(i<=u&&u<s&&i<=f&&f<s){var d=(f-i)/e>>0,g=(u-i)/e>>0;c.setPixel(u,f,this.isDark(d,g)?0:1)}else c.setPixel(u,f,1);return c.toDataURL()},t.prototype.clear=function(){this.chunks=[]},t}();function To(t){for(var e=t.length,r=[],n=0;n<e;n++)r.push(t.charCodeAt(n));return r}a(To,"encode");function Qt(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: ".concat(String.fromCharCode(t)))}}a(Qt,"getByte");var Ht=function(t){ce(e,t);function e(r){var n=t.call(this,T.Alphanumeric,r)||this;return n.bytes=To(r),n}return a(e,"QRAlphanumeric"),e.prototype.writeTo=function(r){for(var n=0,o=this.bytes,i=o.length;n+1<i;)r.put(Qt(o[n])*45+Qt(o[n+1]),11),n+=2;n<i&&r.put(Qt(o[n]),6)},e}(Ie);var Co="VP1",Bo="B";function is({bytes:t,size:e}){let r=new Vt;r.setEncodingHint(!0);let n=Ft(t,"RFC4648",{padding:!1}),o=`${Co}-${Bo}${n}`;return r.write(new Ht(o)),r.make(),{payload:o,encodedCborld:n,version:r.getVersion(),imageDataUrl:r.toDataURL(e)}}a(is,"_bytesToQrCodeDataUrl");async function Kt({vp:t,documentLoader:e,size:r,diagnose:n}={}){let o=await Nt({jsonldDocument:t,documentLoader:e,diagnose:n}),{payload:i,imageDataUrl:s,encodedCborld:c,version:f}=is({bytes:o,size:r});return{payload:i,imageDataUrl:s,encodedCborld:c,rawCborldBytes:o,version:f}}a(Kt,"toQrCode");async function Gt({text:t,documentLoader:e,diagnose:r}={}){let n=Co+"-";if(!(t&&t.startsWith(n)))throw TypeError("Unsupported VP QR format.");let o=t.slice(n.length);if(!o.startsWith(Bo))throw TypeError("Payload must be multibase base32 (RFC4648) encoded.");let i=(0,Ao.default)(o.slice(1),"RFC4648"),s=new Uint8Array(i);return{vp:await Lt({cborldBytes:s,documentLoader:e,diagnose:r})}}a(Gt,"fromQrCode");var ss=a(t=>({name:"Vpqr",displayName:"VP QR",description:"Allows reading and creating QR codes with Verifiable Presentations in them",methods:{vpFromQrCode:async(e,r)=>(await Gt({text:r,documentLoader:async n=>({document:await t.invoke.contextLoader(n)})}))?.vp,vpToQrCode:async(e,r)=>(await Kt({vp:r,documentLoader:async n=>({document:await t.invoke.contextLoader(n)})}))?.imageDataUrl}}),"getVpqrPlugin");
|
1
|
+
var Gn=Object.create;var Rt=Object.defineProperty;var Zn=Object.getOwnPropertyDescriptor;var Xn=Object.getOwnPropertyNames;var Jn=Object.getPrototypeOf,Yn=Object.prototype.hasOwnProperty;var s=(e,t)=>Rt(e,"name",{value:t,configurable:!0});var qn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),to=(e,t)=>{for(var r in t)Rt(e,r,{get:t[r],enumerable:!0})},Qe=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Xn(t))!Yn.call(e,o)&&o!==r&&Rt(e,o,{get:()=>t[o],enumerable:!(n=Zn(t,o))||n.enumerable});return e};var eo=(e,t,r)=>(r=e!=null?Gn(Jn(e)):{},Qe(t||!e||!e.__esModule?Rt(r,"default",{value:e,enumerable:!0}):r,e)),ro=e=>Qe(Rt({},"__esModule",{value:!0}),e);var Cn=qn((zc,Tn)=>{var ii="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",si="0123456789ABCDEFGHIJKLMNOPQRSTUV",ai="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function ci(e,t){var r=e.indexOf(t);if(r===-1)throw new Error("Invalid character found: "+t);return r}s(ci,"readChar");Tn.exports=s(function(t,r){var n;switch(r){case"RFC3548":case"RFC4648":n=ii,t=t.replace(/=+$/,"");break;case"RFC4648-HEX":n=si,t=t.replace(/=+$/,"");break;case"Crockford":n=ai,t=t.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1");break;default:throw new Error("Unknown base32 variant: "+r)}for(var o=t.length,i=0,a=0,f=0,u=new Uint8Array(o*5/8|0),p=0;p<o;p++)a=a<<5|ci(n,t[p]),i+=5,i>=8&&(u[f++]=a>>>i-8&255,i-=8);return u.buffer},"base32Decode")});var Ri={};to(Ri,{getVpqrPlugin:()=>Oi});module.exports=ro(Ri);var no=["string","number","bigint","symbol"],oo=["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 He(e){if(e===null)return"null";if(e===void 0)return"undefined";if(e===!0||e===!1)return"boolean";let t=typeof e;if(no.includes(t))return t;if(t==="function")return"Function";if(Array.isArray(e))return"Array";if(io(e))return"Buffer";let r=so(e);return r||"Object"}s(He,"is");function io(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}s(io,"isBuffer");function so(e){let t=Object.prototype.toString.call(e).slice(8,-1);if(oo.includes(t))return t}s(so,"getObjectType");var c=class{constructor(t,r,n){this.major=t,this.majorEncoded=t<<5,this.name=r,this.terminal=n}toString(){return`Type[${this.major}].${this.name}`}compare(t){return this.major<t.major?-1:this.major>t.major?1:0}};s(c,"Type");c.uint=new c(0,"uint",!0);c.negint=new c(1,"negint",!0);c.bytes=new c(2,"bytes",!0);c.string=new c(3,"string",!0);c.array=new c(4,"array",!1);c.map=new c(5,"map",!1);c.tag=new c(6,"tag",!1);c.float=new c(7,"float",!0);c.false=new c(7,"false",!0);c.true=new c(7,"true",!0);c.null=new c(7,"null",!0);c.undefined=new c(7,"undefined",!0);c.break=new c(7,"break",!0);var l=class{constructor(t,r,n){this.type=t,this.value=r,this.encodedLength=n,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};s(l,"Token");var xt=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&typeof globalThis.Buffer.isBuffer=="function",ao=new TextDecoder,co=new TextEncoder;function Kt(e){return xt&&globalThis.Buffer.isBuffer(e)}s(Kt,"isBuffer");function me(e){return e instanceof Uint8Array?Kt(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}s(me,"asU8A");var Ze=xt?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):We(e,t,r):(e,t,r)=>r-t>64?ao.decode(e.subarray(t,r)):We(e,t,r),Xe=xt?e=>e.length>64?globalThis.Buffer.from(e):Ke(e):e=>e.length>64?co.encode(e):Ke(e),z=s(e=>Uint8Array.from(e),"fromArray"),vt=xt?(e,t,r)=>Kt(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),Je=xt?(e,t)=>(e=e.map(r=>r instanceof Uint8Array?r:globalThis.Buffer.from(r)),me(globalThis.Buffer.concat(e,t))):(e,t)=>{let r=new Uint8Array(t),n=0;for(let o of e)n+o.length>r.length&&(o=o.subarray(0,r.length-n)),r.set(o,n),n+=o.length;return r},Ye=xt?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function qe(e,t){if(Kt(e)&&Kt(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}s(qe,"compare");function Ke(e,t=1/0){let r,n=e.length,o=null,i=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}s(Ke,"utf8ToBytes");function We(e,t,r){let n=[];for(;t<r;){let o=e[t],i=null,a=o>239?4:o>223?3:o>191?2:1;if(t+a<=r){let f,u,p,h;switch(a){case 1:o<128&&(i=o);break;case 2:f=e[t+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(i=h));break;case 3:f=e[t+1],u=e[t+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=e[t+1],u=e[t+2],p=e[t+3],(f&192)===128&&(u&192)===128&&(p&192)===128&&(h=(o&15)<<18|(f&63)<<12|(u&63)<<6|p&63,h>65535&&h<1114112&&(i=h))}}i===null?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|i&1023),n.push(i),t+=a}return fo(n)}s(We,"utf8Slice");var Ge=4096;function fo(e){let t=e.length;if(t<=Ge)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Ge));return r}s(fo,"decodeCodePointsArray");var uo=256,bt=class{constructor(t=uo){this.chunkSize=t,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(t){let r=this.chunks[this.chunks.length-1];if(this.cursor+t.length<=this.maxCursor+1){let o=r.length-(this.maxCursor-this.cursor)-1;r.set(t,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)}t.length<64&&t.length<this.chunkSize?(r=Ye(this.chunkSize),this.chunks.push(r),this.maxCursor+=r.length,this._initReuseChunk===null&&(this._initReuseChunk=r),r.set(t,0)):(this.chunks.push(t),this.maxCursor+=t.length)}this.cursor+=t.length}toBytes(t=!1){let r;if(this.chunks.length===1){let n=this.chunks[0];t&&this.cursor>n.length/2?(r=this.cursor===n.length?n:n.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):r=vt(n,0,this.cursor)}else r=Je(this.chunks,this.cursor);return t&&this.reset(),r}};s(bt,"Bl");var y="CBOR decode error:",ye="CBOR encode error:",Dt=[];Dt[23]=1;Dt[24]=2;Dt[25]=3;Dt[26]=5;Dt[27]=9;function Q(e,t,r){if(e.length-t<r)throw new Error(`${y} not enough data for type`)}s(Q,"assertEnoughData");var A=[24,256,65536,4294967296,BigInt("18446744073709551616")];function U(e,t,r){Q(e,t,1);let n=e[t];if(r.strict===!0&&n<A[0])throw new Error(`${y} integer encoded in more bytes than necessary (strict decode)`);return n}s(U,"readUint8");function I(e,t,r){Q(e,t,2);let n=e[t]<<8|e[t+1];if(r.strict===!0&&n<A[1])throw new Error(`${y} integer encoded in more bytes than necessary (strict decode)`);return n}s(I,"readUint16");function k(e,t,r){Q(e,t,4);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(r.strict===!0&&n<A[2])throw new Error(`${y} integer encoded in more bytes than necessary (strict decode)`);return n}s(k,"readUint32");function M(e,t,r){Q(e,t,8);let n=e[t]*16777216+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],o=e[t+4]*16777216+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],i=(BigInt(n)<<BigInt(32))+BigInt(o);if(r.strict===!0&&i<A[3])throw new Error(`${y} 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(`${y} integers outside of the safe integer range are not supported`)}s(M,"readUint64");function tr(e,t,r,n){return new l(c.uint,U(e,t+1,n),2)}s(tr,"decodeUint8");function er(e,t,r,n){return new l(c.uint,I(e,t+1,n),3)}s(er,"decodeUint16");function rr(e,t,r,n){return new l(c.uint,k(e,t+1,n),5)}s(rr,"decodeUint32");function nr(e,t,r,n){return new l(c.uint,M(e,t+1,n),9)}s(nr,"decodeUint64");function N(e,t){return B(e,0,t.value)}s(N,"encodeUint");function B(e,t,r){if(r<A[0]){let n=Number(r);e.push([t|n])}else if(r<A[1]){let n=Number(r);e.push([t|24,n])}else if(r<A[2]){let n=Number(r);e.push([t|25,n>>>8,n&255])}else if(r<A[3]){let n=Number(r);e.push([t|26,n>>>24&255,n>>>16&255,n>>>8&255,n&255])}else{let n=BigInt(r);if(n<A[4]){let o=[t|27,0,0,0,0,0,0,0],i=Number(n&BigInt(4294967295)),a=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]=a&255,a=a>>8,o[3]=a&255,a=a>>8,o[2]=a&255,a=a>>8,o[1]=a&255,e.push(o)}else throw new Error(`${y} encountered BigInt larger than allowable range`)}}s(B,"encodeUintValue");N.encodedSize=s(function(t){return B.encodedSize(t.value)},"encodedSize");B.encodedSize=s(function(t){return t<A[0]?1:t<A[1]?2:t<A[2]?3:t<A[3]?5:9},"encodedSize");N.compareTokens=s(function(t,r){return t.value<r.value?-1:t.value>r.value?1:0},"compareTokens");function or(e,t,r,n){return new l(c.negint,-1-U(e,t+1,n),2)}s(or,"decodeNegint8");function ir(e,t,r,n){return new l(c.negint,-1-I(e,t+1,n),3)}s(ir,"decodeNegint16");function sr(e,t,r,n){return new l(c.negint,-1-k(e,t+1,n),5)}s(sr,"decodeNegint32");var ge=BigInt(-1),ar=BigInt(1);function cr(e,t,r,n){let o=M(e,t+1,n);if(typeof o!="bigint"){let i=-1-o;if(i>=Number.MIN_SAFE_INTEGER)return new l(c.negint,i,9)}if(n.allowBigInt!==!0)throw new Error(`${y} integers outside of the safe integer range are not supported`);return new l(c.negint,ge-BigInt(o),9)}s(cr,"decodeNegint64");function Wt(e,t){let r=t.value,n=typeof r=="bigint"?r*ge-ar:r*-1-1;B(e,t.type.majorEncoded,n)}s(Wt,"encodeNegint");Wt.encodedSize=s(function(t){let r=t.value,n=typeof r=="bigint"?r*ge-ar:r*-1-1;return n<A[0]?1:n<A[1]?2:n<A[2]?3:n<A[3]?5:9},"encodedSize");Wt.compareTokens=s(function(t,r){return t.value<r.value?1:t.value>r.value?-1:0},"compareTokens");function Ut(e,t,r,n){Q(e,t,r+n);let o=vt(e,t+r,t+r+n);return new l(c.bytes,o,r+n)}s(Ut,"toToken");function fr(e,t,r,n){return Ut(e,t,1,r)}s(fr,"decodeBytesCompact");function ur(e,t,r,n){return Ut(e,t,2,U(e,t+1,n))}s(ur,"decodeBytes8");function pr(e,t,r,n){return Ut(e,t,3,I(e,t+1,n))}s(pr,"decodeBytes16");function lr(e,t,r,n){return Ut(e,t,5,k(e,t+1,n))}s(lr,"decodeBytes32");function dr(e,t,r,n){let o=M(e,t+1,n);if(typeof o=="bigint")throw new Error(`${y} 64-bit integer bytes lengths not supported`);return Ut(e,t,9,o)}s(dr,"decodeBytes64");function Gt(e){return e.encodedBytes===void 0&&(e.encodedBytes=e.type===c.string?Xe(e.value):e.value),e.encodedBytes}s(Gt,"tokenBytes");function _t(e,t){let r=Gt(t);B(e,t.type.majorEncoded,r.length),e.push(r)}s(_t,"encodeBytes");_t.encodedSize=s(function(t){let r=Gt(t);return B.encodedSize(r.length)+r.length},"encodedSize");_t.compareTokens=s(function(t,r){return lo(Gt(t),Gt(r))},"compareTokens");function lo(e,t){return e.length<t.length?-1:e.length>t.length?1:qe(e,t)}s(lo,"compareBytes");function It(e,t,r,n,o){let i=r+n;Q(e,t,i);let a=new l(c.string,Ze(e,t+r,t+i),i);return o.retainStringBytes===!0&&(a.byteValue=vt(e,t+r,t+i)),a}s(It,"toToken");function hr(e,t,r,n){return It(e,t,1,r,n)}s(hr,"decodeStringCompact");function mr(e,t,r,n){return It(e,t,2,U(e,t+1,n),n)}s(mr,"decodeString8");function yr(e,t,r,n){return It(e,t,3,I(e,t+1,n),n)}s(yr,"decodeString16");function gr(e,t,r,n){return It(e,t,5,k(e,t+1,n),n)}s(gr,"decodeString32");function wr(e,t,r,n){let o=M(e,t+1,n);if(typeof o=="bigint")throw new Error(`${y} 64-bit integer string lengths not supported`);return It(e,t,9,o,n)}s(wr,"decodeString64");var xr=_t;function Et(e,t,r,n){return new l(c.array,n,r)}s(Et,"toToken");function vr(e,t,r,n){return Et(e,t,1,r)}s(vr,"decodeArrayCompact");function br(e,t,r,n){return Et(e,t,2,U(e,t+1,n))}s(br,"decodeArray8");function _r(e,t,r,n){return Et(e,t,3,I(e,t+1,n))}s(_r,"decodeArray16");function Er(e,t,r,n){return Et(e,t,5,k(e,t+1,n))}s(Er,"decodeArray32");function Tr(e,t,r,n){let o=M(e,t+1,n);if(typeof o=="bigint")throw new Error(`${y} 64-bit integer array lengths not supported`);return Et(e,t,9,o)}s(Tr,"decodeArray64");function Cr(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${y} indefinite length items not allowed`);return Et(e,t,1,1/0)}s(Cr,"decodeArrayIndefinite");function Zt(e,t){B(e,c.array.majorEncoded,t.value)}s(Zt,"encodeArray");Zt.compareTokens=N.compareTokens;Zt.encodedSize=s(function(t){return B.encodedSize(t.value)},"encodedSize");function Tt(e,t,r,n){return new l(c.map,n,r)}s(Tt,"toToken");function Ar(e,t,r,n){return Tt(e,t,1,r)}s(Ar,"decodeMapCompact");function Br(e,t,r,n){return Tt(e,t,2,U(e,t+1,n))}s(Br,"decodeMap8");function Sr(e,t,r,n){return Tt(e,t,3,I(e,t+1,n))}s(Sr,"decodeMap16");function Or(e,t,r,n){return Tt(e,t,5,k(e,t+1,n))}s(Or,"decodeMap32");function Rr(e,t,r,n){let o=M(e,t+1,n);if(typeof o=="bigint")throw new Error(`${y} 64-bit integer map lengths not supported`);return Tt(e,t,9,o)}s(Rr,"decodeMap64");function Dr(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${y} indefinite length items not allowed`);return Tt(e,t,1,1/0)}s(Dr,"decodeMapIndefinite");function Xt(e,t){B(e,c.map.majorEncoded,t.value)}s(Xt,"encodeMap");Xt.compareTokens=N.compareTokens;Xt.encodedSize=s(function(t){return B.encodedSize(t.value)},"encodedSize");function Ur(e,t,r,n){return new l(c.tag,r,1)}s(Ur,"decodeTagCompact");function Ir(e,t,r,n){return new l(c.tag,U(e,t+1,n),2)}s(Ir,"decodeTag8");function kr(e,t,r,n){return new l(c.tag,I(e,t+1,n),3)}s(kr,"decodeTag16");function Mr(e,t,r,n){return new l(c.tag,k(e,t+1,n),5)}s(Mr,"decodeTag32");function Lr(e,t,r,n){return new l(c.tag,M(e,t+1,n),9)}s(Lr,"decodeTag64");function Jt(e,t){B(e,c.tag.majorEncoded,t.value)}s(Jt,"encodeTag");Jt.compareTokens=N.compareTokens;Jt.encodedSize=s(function(t){return B.encodedSize(t.value)},"encodedSize");var xo=20,vo=21,bo=22,_o=23;function Nr(e,t,r,n){if(n.allowUndefined===!1)throw new Error(`${y} undefined values are not supported`);return n.coerceUndefinedToNull===!0?new l(c.null,null,1):new l(c.undefined,void 0,1)}s(Nr,"decodeUndefined");function Pr(e,t,r,n){if(n.allowIndefinite===!1)throw new Error(`${y} indefinite length items not allowed`);return new l(c.break,void 0,1)}s(Pr,"decodeBreak");function we(e,t,r){if(r){if(r.allowNaN===!1&&Number.isNaN(e))throw new Error(`${y} NaN values are not supported`);if(r.allowInfinity===!1&&(e===1/0||e===-1/0))throw new Error(`${y} Infinity values are not supported`)}return new l(c.float,e,t)}s(we,"createToken");function Fr(e,t,r,n){return we(xe(e,t+1),3,n)}s(Fr,"decodeFloat16");function $r(e,t,r,n){return we(ve(e,t+1),5,n)}s($r,"decodeFloat32");function jr(e,t,r,n){return we(Hr(e,t+1),9,n)}s(jr,"decodeFloat64");function Yt(e,t,r){let n=t.value;if(n===!1)e.push([c.float.majorEncoded|xo]);else if(n===!0)e.push([c.float.majorEncoded|vo]);else if(n===null)e.push([c.float.majorEncoded|bo]);else if(n===void 0)e.push([c.float.majorEncoded|_o]);else{let o,i=!1;(!r||r.float64!==!0)&&(Vr(n),o=xe(F,1),n===o||Number.isNaN(n)?(F[0]=249,e.push(F.slice(0,3)),i=!0):(Qr(n),o=ve(F,1),n===o&&(F[0]=250,e.push(F.slice(0,5)),i=!0))),i||(Eo(n),o=Hr(F,1),F[0]=251,e.push(F.slice(0,9)))}}s(Yt,"encodeFloat");Yt.encodedSize=s(function(t,r){let n=t.value;if(n===!1||n===!0||n===null||n===void 0)return 1;if(!r||r.float64!==!0){Vr(n);let o=xe(F,1);if(n===o||Number.isNaN(n))return 3;if(Qr(n),o=ve(F,1),n===o)return 5}return 9},"encodedSize");var zr=new ArrayBuffer(9),P=new DataView(zr,1),F=new Uint8Array(zr,0);function Vr(e){if(e===1/0)P.setUint16(0,31744,!1);else if(e===-1/0)P.setUint16(0,64512,!1);else if(Number.isNaN(e))P.setUint16(0,32256,!1);else{P.setFloat32(0,e);let t=P.getUint32(0),r=(t&2139095040)>>23,n=t&8388607;if(r===255)P.setUint16(0,31744,!1);else if(r===0)P.setUint16(0,(e&2147483648)>>16|n>>13,!1);else{let o=r-127;o<-24?P.setUint16(0,0):o<-14?P.setUint16(0,(t&2147483648)>>16|1<<24+o,!1):P.setUint16(0,(t&2147483648)>>16|o+15<<10|n>>13,!1)}}}s(Vr,"encodeFloat16");function xe(e,t){if(e.length-t<2)throw new Error(`${y} not enough data for float16`);let r=(e[t]<<8)+e[t+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(xe,"readFloat16");function Qr(e){P.setFloat32(0,e,!1)}s(Qr,"encodeFloat32");function ve(e,t){if(e.length-t<4)throw new Error(`${y} not enough data for float32`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}s(ve,"readFloat32");function Eo(e){P.setFloat64(0,e,!1)}s(Eo,"encodeFloat64");function Hr(e,t){if(e.length-t<8)throw new Error(`${y} not enough data for float64`);let r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}s(Hr,"readFloat64");Yt.compareTokens=N.compareTokens;function x(e,t,r){throw new Error(`${y} encountered invalid minor (${r}) for major ${e[t]>>>5}`)}s(x,"invalidMinor");function qt(e){return()=>{throw new Error(`${y} ${e}`)}}s(qt,"errorer");var d=[];for(let e=0;e<=23;e++)d[e]=x;d[24]=tr;d[25]=er;d[26]=rr;d[27]=nr;d[28]=x;d[29]=x;d[30]=x;d[31]=x;for(let e=32;e<=55;e++)d[e]=x;d[56]=or;d[57]=ir;d[58]=sr;d[59]=cr;d[60]=x;d[61]=x;d[62]=x;d[63]=x;for(let e=64;e<=87;e++)d[e]=fr;d[88]=ur;d[89]=pr;d[90]=lr;d[91]=dr;d[92]=x;d[93]=x;d[94]=x;d[95]=qt("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)d[e]=hr;d[120]=mr;d[121]=yr;d[122]=gr;d[123]=wr;d[124]=x;d[125]=x;d[126]=x;d[127]=qt("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)d[e]=vr;d[152]=br;d[153]=_r;d[154]=Er;d[155]=Tr;d[156]=x;d[157]=x;d[158]=x;d[159]=Cr;for(let e=160;e<=183;e++)d[e]=Ar;d[184]=Br;d[185]=Sr;d[186]=Or;d[187]=Rr;d[188]=x;d[189]=x;d[190]=x;d[191]=Dr;for(let e=192;e<=215;e++)d[e]=Ur;d[216]=Ir;d[217]=kr;d[218]=Mr;d[219]=Lr;d[220]=x;d[221]=x;d[222]=x;d[223]=x;for(let e=224;e<=243;e++)d[e]=qt("simple values are not supported");d[244]=x;d[245]=x;d[246]=x;d[247]=Nr;d[248]=qt("simple values are not supported");d[249]=Fr;d[250]=$r;d[251]=jr;d[252]=x;d[253]=x;d[254]=x;d[255]=Pr;var $=[];for(let e=0;e<24;e++)$[e]=new l(c.uint,e,1);for(let e=-1;e>=-24;e--)$[31-e]=new l(c.negint,e,1);$[64]=new l(c.bytes,new Uint8Array(0),1);$[96]=new l(c.string,"",1);$[128]=new l(c.array,0,1);$[160]=new l(c.map,0,1);$[244]=new l(c.false,!1,1);$[245]=new l(c.true,!0,1);$[246]=new l(c.null,null,1);function Kr(e){switch(e.type){case c.false:return z([244]);case c.true:return z([245]);case c.null:return z([246]);case c.bytes:return e.value.length?void 0:z([64]);case c.string:return e.value===""?z([96]):void 0;case c.array:return e.value===0?z([128]):void 0;case c.map:return e.value===0?z([160]):void 0;case c.uint:return e.value<24?z([Number(e.value)]):void 0;case c.negint:if(e.value>=-24)return z([31-Number(e.value)])}}s(Kr,"quickEncodeToken");var Co={float64:!1,mapSorter:So,quickEncodeToken:Kr};function Ao(){let e=[];return e[c.uint.major]=N,e[c.negint.major]=Wt,e[c.bytes.major]=_t,e[c.string.major]=xr,e[c.array.major]=Zt,e[c.map.major]=Xt,e[c.tag.major]=Jt,e[c.float.major]=Yt,e}s(Ao,"makeCborEncoders");var Wr=Ao(),be=new bt,st=class{constructor(t,r){this.obj=t,this.parent=r}includes(t){let r=this;do if(r.obj===t)return!0;while(r=r.parent);return!1}static createCheck(t,r){if(t&&t.includes(r))throw new Error(`${ye} object contains circular references`);return new st(r,t)}};s(st,"Ref");var K={null:new l(c.null,null),undefined:new l(c.undefined,void 0),true:new l(c.true,!0),false:new l(c.false,!1),emptyArray:new l(c.array,0),emptyMap:new l(c.map,0)},W={number(e,t,r,n){return!Number.isInteger(e)||!Number.isSafeInteger(e)?new l(c.float,e):e>=0?new l(c.uint,e):new l(c.negint,e)},bigint(e,t,r,n){return e>=BigInt(0)?new l(c.uint,e):new l(c.negint,e)},Uint8Array(e,t,r,n){return new l(c.bytes,e)},string(e,t,r,n){return new l(c.string,e)},boolean(e,t,r,n){return e?K.true:K.false},null(e,t,r,n){return K.null},undefined(e,t,r,n){return K.undefined},ArrayBuffer(e,t,r,n){return new l(c.bytes,new Uint8Array(e))},DataView(e,t,r,n){return new l(c.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},Array(e,t,r,n){if(!e.length)return r.addBreakTokens===!0?[K.emptyArray,new l(c.break)]:K.emptyArray;n=st.createCheck(n,e);let o=[],i=0;for(let a of e)o[i++]=te(a,r,n);return r.addBreakTokens?[new l(c.array,e.length),o,new l(c.break)]:[new l(c.array,e.length),o]},Object(e,t,r,n){let o=t!=="Object",i=o?e.keys():Object.keys(e),a=o?e.size:i.length;if(!a)return r.addBreakTokens===!0?[K.emptyMap,new l(c.break)]:K.emptyMap;n=st.createCheck(n,e);let f=[],u=0;for(let p of i)f[u++]=[te(p,r,n),te(o?e.get(p):e[p],r,n)];return Bo(f,r),r.addBreakTokens?[new l(c.map,a),f,new l(c.break)]:[new l(c.map,a),f]}};W.Map=W.Object;W.Buffer=W.Uint8Array;for(let e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))W[`${e}Array`]=W.DataView;function te(e,t={},r){let n=He(e),o=t&&t.typeEncoders&&t.typeEncoders[n]||W[n];if(typeof o=="function"){let a=o(e,n,t,r);if(a!=null)return a}let i=W[n];if(!i)throw new Error(`${ye} unsupported type: ${n}`);return i(e,n,t,r)}s(te,"objectToTokens");function Bo(e,t){t.mapSorter&&e.sort(t.mapSorter)}s(Bo,"sortMapEntries");function So(e,t){let r=Array.isArray(e[0])?e[0][0]:e[0],n=Array.isArray(t[0])?t[0][0]:t[0];if(r.type!==n.type)return r.type.compare(n.type);let o=r.type.major,i=Wr[o].compareTokens(r,n);return i===0&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),i}s(So,"mapSorter");function Gr(e,t,r,n){if(Array.isArray(t))for(let o of t)Gr(e,o,r,n);else r[t.type.major](e,t,n)}s(Gr,"tokensToEncoded");function Oo(e,t,r){let n=te(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){let o=r.quickEncodeToken(n);if(o)return o;let i=t[n.type.major];if(i.encodedSize){let a=i.encodedSize(n,r),f=new bt(a);if(i(f,n,r),f.chunks.length!==1)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return me(f.chunks[0])}}return be.reset(),Gr(be,n,t,r),be.toBytes(!0)}s(Oo,"encodeCustom");function kt(e,t){return t=Object.assign({},Co,t),Oo(e,Wr,t)}s(kt,"encode");var Ro={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},ee=class{constructor(t,r={}){this.pos=0,this.data=t,this.options=r}done(){return this.pos>=this.data.length}next(){let t=this.data[this.pos],r=$[t];if(r===void 0){let n=d[t];if(!n)throw new Error(`${y} no decoder for major type ${t>>>5} (byte 0x${t.toString(16).padStart(2,"0")})`);let o=t&31;r=n(this.data,this.pos,o,this.options)}return this.pos+=r.encodedLength,r}};s(ee,"Tokeniser");var Mt=Symbol.for("DONE"),re=Symbol.for("BREAK");function Do(e,t,r){let n=[];for(let o=0;o<e.value;o++){let i=Lt(t,r);if(i===re){if(e.value===1/0)break;throw new Error(`${y} got unexpected break to lengthed array`)}if(i===Mt)throw new Error(`${y} found array but not enough entries (got ${o}, expected ${e.value})`);n[o]=i}return n}s(Do,"tokenToArray");function Uo(e,t,r){let n=r.useMaps===!0,o=n?void 0:{},i=n?new Map:void 0;for(let a=0;a<e.value;a++){let f=Lt(t,r);if(f===re){if(e.value===1/0)break;throw new Error(`${y} got unexpected break to lengthed map`)}if(f===Mt)throw new Error(`${y} found map but not enough entries (got ${a} [no key], expected ${e.value})`);if(n!==!0&&typeof f!="string")throw new Error(`${y} non-string keys not supported (got ${typeof f})`);if(r.rejectDuplicateMapKeys===!0&&(n&&i.has(f)||!n&&f in o))throw new Error(`${y} found repeat map key "${f}"`);let u=Lt(t,r);if(u===Mt)throw new Error(`${y} found map but not enough entries (got ${a} [no value], expected ${e.value})`);n?i.set(f,u):o[f]=u}return n?i:o}s(Uo,"tokenToMap");function Lt(e,t){if(e.done())return Mt;let r=e.next();if(r.type===c.break)return re;if(r.type.terminal)return r.value;if(r.type===c.array)return Do(r,e,t);if(r.type===c.map)return Uo(r,e,t);if(r.type===c.tag){if(t.tags&&typeof t.tags[r.value]=="function"){let n=Lt(e,t);return t.tags[r.value](n)}throw new Error(`${y} tag not supported (${r.value})`)}throw new Error("unsupported")}s(Lt,"tokensToObject");function Nt(e,t){if(!(e instanceof Uint8Array))throw new Error(`${y} data to decode must be a Uint8Array`);t=Object.assign({},Ro,t);let r=t.tokenizer||new ee(e,t),n=Lt(r,t);if(n===Mt)throw new Error(`${y} did not find any content to decode`);if(n===re)throw new Error(`${y} got unexpected break`);if(!r.done())throw new Error(`${y} too many terminals, data makes no sense`);return n}s(Nt,"decode");var _=class extends Error{constructor(t,r){super(),this.message=r,this.value=t,this.stack=new Error(`${t}: ${r}`).stack,this.name=this.constructor.name}};s(_,"CborldError");var T=class{decode({value:t}={}){throw new Error("Must be implemented by derived class.")}static createDecoder({value:t,transformer:r}={}){throw new Error("Must be implemented by derived class.")}};s(T,"CborldDecoder");var _e=new Map,Ee=new Map;S(16,"https://www.w3.org/ns/activitystreams");S(17,"https://www.w3.org/2018/credentials/v1");S(18,"https://www.w3.org/ns/did/v1");S(19,"https://w3id.org/security/suites/ed25519-2018/v1");S(20,"https://w3id.org/security/suites/ed25519-2020/v1");S(21,"https://w3id.org/cit/v1");S(22,"https://w3id.org/age/v1");S(23,"https://w3id.org/security/suites/x25519-2020/v1");S(24,"https://w3id.org/veres-one/v1");S(25,"https://w3id.org/webkms/v1");S(26,"https://w3id.org/zcap/v1");S(27,"https://w3id.org/security/suites/hmac-2019/v1");S(28,"https://w3id.org/security/suites/aes-2019/v1");S(29,"https://w3id.org/vaccination/v1");S(30,"https://w3id.org/vc-revocation-list-2020/v1");S(31,"https://w3id.org/dcc/v1c");S(32,"https://w3id.org/vc/status-list/v1");function S(e,t){Ee.set(t,e),_e.set(e,t)}s(S,"_addRegistration");var G=class extends T{constructor({reverseAppContextMap:t}={}){super(),this.reverseAppContextMap=t}decode({value:t}={}){if(typeof t!="number")return Te(t);let r=_e.get(t)||this.reverseAppContextMap.get(t);if(r===void 0)throw new _("ERR_UNDEFINED_COMPRESSED_CONTEXT",`Undefined compressed context "${t}".`);return r}static createDecoder({transformer:t}={}){let{reverseAppContextMap:r}=t;return new G({reverseAppContextMap:r})}};s(G,"ContextDecoder");function Te(e){if(Array.isArray(e))return e.map(Te);if(!(e instanceof Map))return e;let t={};for(let[r,n]of e)t[r]=Te(n);return t}s(Te,"_mapToObject");var tn="3.7.5",Io=tn,ko=typeof atob=="function",Mo=typeof btoa=="function",At=typeof Buffer=="function",Zr=typeof TextDecoder=="function"?new TextDecoder:void 0,Xr=typeof TextEncoder=="function"?new TextEncoder:void 0,Lo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Pt=Array.prototype.slice.call(Lo),oe=(e=>{let t={};return e.forEach((r,n)=>t[r]=n),t})(Pt),No=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,O=String.fromCharCode.bind(String),Jr=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):e=>new Uint8Array(Array.prototype.slice.call(e,0)),en=s(e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),"_mkUriSafe"),rn=s(e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),"_tidyB64"),nn=s(e=>{let t,r,n,o,i="",a=e.length%3;for(let f=0;f<e.length;){if((r=e.charCodeAt(f++))>255||(n=e.charCodeAt(f++))>255||(o=e.charCodeAt(f++))>255)throw new TypeError("invalid character found");t=r<<16|n<<8|o,i+=Pt[t>>18&63]+Pt[t>>12&63]+Pt[t>>6&63]+Pt[t&63]}return a?i.slice(0,a-3)+"===".substring(a):i},"btoaPolyfill"),Be=Mo?e=>btoa(e):At?e=>Buffer.from(e,"binary").toString("base64"):nn,Ce=At?e=>Buffer.from(e).toString("base64"):e=>{let r=[];for(let n=0,o=e.length;n<o;n+=4096)r.push(O.apply(null,e.subarray(n,n+4096)));return Be(r.join(""))},ie=s((e,t=!1)=>t?en(Ce(e)):Ce(e),"fromUint8Array"),Po=s(e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?O(192|t>>>6)+O(128|t&63):O(224|t>>>12&15)+O(128|t>>>6&63)+O(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return O(240|t>>>18&7)+O(128|t>>>12&63)+O(128|t>>>6&63)+O(128|t&63)}},"cb_utob"),Fo=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,on=s(e=>e.replace(Fo,Po),"utob"),Yr=At?e=>Buffer.from(e,"utf8").toString("base64"):Xr?e=>Ce(Xr.encode(e)):e=>Be(on(e)),Ct=s((e,t=!1)=>t?en(Yr(e)):Yr(e),"encode"),qr=s(e=>Ct(e,!0),"encodeURI"),$o=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,jo=s(e=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return O((r>>>10)+55296)+O((r&1023)+56320);case 3:return O((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return O((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},"cb_btou"),sn=s(e=>e.replace($o,jo),"btou"),an=s(e=>{if(e=e.replace(/\s+/g,""),!No.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r="",n,o;for(let i=0;i<e.length;)t=oe[e.charAt(i++)]<<18|oe[e.charAt(i++)]<<12|(n=oe[e.charAt(i++)])<<6|(o=oe[e.charAt(i++)]),r+=n===64?O(t>>16&255):o===64?O(t>>16&255,t>>8&255):O(t>>16&255,t>>8&255,t&255);return r},"atobPolyfill"),Se=ko?e=>atob(rn(e)):At?e=>Buffer.from(e,"base64").toString("binary"):an,cn=At?e=>Jr(Buffer.from(e,"base64")):e=>Jr(Se(e).split("").map(t=>t.charCodeAt(0))),fn=s(e=>cn(un(e)),"toUint8Array"),zo=At?e=>Buffer.from(e,"base64").toString("utf8"):Zr?e=>Zr.decode(cn(e)):e=>sn(Se(e)),un=s(e=>rn(e.replace(/[-_]/g,t=>t=="-"?"+":"/")),"_unURI"),Ae=s(e=>zo(un(e)),"decode"),Vo=s(e=>{if(typeof e!="string")return!1;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},"isValid"),pn=s(e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),"_noEnum"),ln=s(function(){let e=s((t,r)=>Object.defineProperty(String.prototype,t,pn(r)),"_add");e("fromBase64",function(){return Ae(this)}),e("toBase64",function(t){return Ct(this,t)}),e("toBase64URI",function(){return Ct(this,!0)}),e("toBase64URL",function(){return Ct(this,!0)}),e("toUint8Array",function(){return fn(this)})},"extendString"),dn=s(function(){let e=s((t,r)=>Object.defineProperty(Uint8Array.prototype,t,pn(r)),"_add");e("toBase64",function(t){return ie(this,t)}),e("toBase64URI",function(){return ie(this,!0)}),e("toBase64URL",function(){return ie(this,!0)})},"extendUint8Array"),Qo=s(()=>{ln(),dn()},"extendBuiltins"),se={version:tn,VERSION:Io,atob:Se,atobPolyfill:an,btoa:Be,btoaPolyfill:nn,fromBase64:Ae,toBase64:Ct,encode:Ct,encodeURI:qr,encodeURL:qr,utob:on,btou:sn,decode:Ae,isValid:Vo,fromUint8Array:ie,toUint8Array:fn,extendString:ln,extendUint8Array:dn,extendBuiltins:Qo};var hn={};function mn(e,t,r){if(!(e instanceof Uint8Array))throw new TypeError('"input" must be a Uint8Array.');if(typeof t!="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(e.length===0)return"";let n="",o=0,i=t.length,a=t.charAt(0),f=[0];for(o=0;o<e.length;++o){let u=e[o];for(let p=0;p<f.length;++p)u+=f[p]<<8,f[p]=u%i,u=u/i|0;for(;u>0;)f.push(u%i),u=u/i|0}for(o=0;e[o]===0&&o<e.length-1;++o)n+=a;for(o=f.length-1;o>=0;--o)n+=t[f[o]];if(r){let u=new RegExp(".{1,"+r+"}","g");n=n.match(u).join(`\r
|
2
|
+
`)}return n}s(mn,"encode");function yn(e,t){if(typeof e!="string")throw new TypeError('"input" must be a string.');if(typeof t!="string")throw new TypeError('"alphabet" must be a string.');if(e.length===0)return new Uint8Array;let r=hn[t];if(!r){r=hn[t]=[];for(let a=0;a<t.length;++a)r[t.charCodeAt(a)]=a}e=e.replace(/\s/g,"");let n=t.length,o=t.charAt(0),i=[0];for(let a=0;a<e.length;a++){let f=r[e.charCodeAt(a)];if(f===void 0)return;let u=f;for(let p=0;p<i.length;++p)u+=i[p]*n,i[p]=u&255,u>>=8;for(;u>0;)i.push(u&255),u>>=8}for(let a=0;e[a]===o&&a<e.length-1;++a)i.push(0);return new Uint8Array(i.reverse())}s(yn,"decode");var gn="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";function Ft(e,t){return mn(e,gn,t)}s(Ft,"encode");function ae(e){return yn(e,gn)}s(ae,"decode");var at=class extends T{decode({value:t}={}){let{buffer:r,byteOffset:n,length:o}=t,i=new Uint8Array(r,n+1,o-1);return t[0]===122?`z${Ft(i)}`:t[0]===77?`M${se.fromUint8Array(i)}`:t}static createDecoder({value:t}={}){if(!(t instanceof Uint8Array))return!1;if(t[0]===122||t[0]===77)return new at}};s(at,"MultibaseDecoder");var j=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]]),ce=100;var ct=class{constructor({appContextMap:t,documentLoader:r}={}){this.appContextMap=t,this.documentLoader=r}_beforeObjectContexts(){}_afterObjectContexts(){}_beforeTypeScopedContexts(){}async _transform({obj:t,transformMap:r,contextStack:n=[]}){this._beforeObjectContexts({obj:t,transformMap:r});let o=await this._applyEmbeddedContexts({obj:t,contextStack:n});this._afterObjectContexts({obj:t,transformMap:r});let i=n.slice();this._beforeTypeScopedContexts({activeCtx:o,obj:t,transformMap:r}),o=await this._applyTypeScopedContexts({obj:t,contextStack:n});let{aliases:a,scopedContextMap:f,termMap:u}=o,p=this._getEntries({obj:t,transformMap:r,transformer:this,termMap:u});for(let[h,g]of p){let{term:w}=h;if(w==="@id"||a.id.has(w)){this._transformObjectId({obj:t,transformMap:r,termInfo:h,value:g});continue}if(w==="@type"||a.type.has(w)){this._transformObjectType({obj:t,transformMap:r,termInfo:h,value:g});continue}let m=i,v,C=f.get(w);C&&(v=await this._applyEmbeddedContexts({obj:{"@context":C},contextStack:n}),m=n.slice());let{plural:gt,def:Qt}=h,he=this._getTermType({activeCtx:v||o,def:Qt}),Ht=gt?g:[g],wt=[];for(let ot of Ht){if(ot===null){wt.push(null);continue}if(!this._transformTypedValue({entries:wt,termType:he,value:ot,termInfo:h})){if(typeof ot!="object"){wt.push(ot);continue}if(Array.isArray(ot)){await this._transformArray({entries:wt,contextStack:m,value:ot});continue}await this._transformObject({entries:wt,contextStack:m,value:ot})}}v&&v.revert(),this._assignEntries({entries:wt,obj:t,transformMap:r,termInfo:h})}o.revert()}async _applyEmbeddedContexts({obj:t,contextStack:r}){let n=r.length,o=t["@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:t,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,a=[],f=["@type",...i.type];for(let p of f){let h=t[p];Array.isArray(h)?a.push(...h):a.push(h)}a=[...new Set(a)].sort();let{scopedContextMap:u}=o;for(let p of a){let h=u.get(p);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:t,contexts:r,transformer:n}){if(!r)return;Array.isArray(r)||(r=[r]);let{contextMap:o}=this;for(let i of r){let a=o.get(i);if(!a){let w=i,m;typeof i=="string"&&(m=i,{"@context":w}=await this._getDocument({url:m})),a=await this._addContext({context:w,contextUrl:m,transformer:n})}let f={aliases:{id:new Set(a.aliases.id),type:new Set(a.aliases.type)},context:i,scopedContextMap:new Map(a.scopedContextMap),termMap:new Map(a.termMap)},u=t[t.length-1];if(t.push(f),!u)continue;let{aliases:p,termMap:h}=f;for(let w of["id","type"])for(let m of u.aliases[w])i[m]===null||f.termMap.has(m)||p[w].add(m);let{scopedContextMap:g}=f;for(let[w,m]of u.scopedContextMap)i[w]===null||g.has(w)||g.set(w,m);for(let[w,m]of u.termMap)i[w]===null||h.has(w)||h.set(w,m)}}async _addContext({context:t,contextUrl:r}){let{contextMap:n,termToId:o,idToTerm:i}=this,a=t["@import"];if(a){let g=n.get(a);if(!g){let{"@context":w}=await this._getDocument({url:a});g=await this._addContext({context:w,contextUrl:a})}t={...g.context,...t}}let f=new Map,u=new Map,p={aliases:{id:new Set,type:new Set},context:t,scopedContextMap:f,termMap:u},h=Object.keys(t).sort();for(let g of h){let w=t[g];if(!w||(w==="@id"||w.id==="@id"?p.aliases.id.add(g):(w==="@type"||w.id==="@type")&&p.aliases.type.add(g),j.has(g)))continue;if(!o.has(g)){let v=this.nextTermId;this.nextTermId+=2,o.set(g,v),i&&i.set(v,g)}u.set(g,w);let m=w["@context"];m&&f.set(g,m)}return n.set(r||t,p),p}async _getDocument({url:t}){let{document:r}=await this.documentLoader(t);return typeof r=="string"?JSON.parse(r):r}_getTermType({activeCtx:t,def:r}){let{"@type":n}=r;if(!n)return;let[o,...i]=n.split(":"),a=t.termMap.get(o);if(a===void 0)return n;if(typeof a=="string")return a+i.join(":");if(!(typeof a=="object"&&typeof a["@id"]=="string"))throw new _("ERR_INVALID_TERM_DEFINITION",'JSON-LD term definitions must be strings or objects with "@id".');return a["@id"]+i.join(":")}_getIdForTerm({term:t,plural:r}){let n=this.termToId.get(t);if(n===void 0)throw new _("ERR_UNDEFINED_TERM","CBOR-LD compression requires all terms to be defined in a JSON-LD context.");return r?n+1:n}_getTermForId({id:t}){let r=(t&1)===1;return{term:this.idToTerm.get(r?t-1:t),plural:r}}};s(ct,"Transformer");var wn=new Map([[1024,"did:v1:nym:"],[1025,"did:key:"]]),Z=class extends T{decode({value:t}={}){let r=wn.get(t[0]);return typeof t[1]=="string"?r+=t[1]:r+=`z${Ft(t[1])}`,t.length>2&&(typeof t[2]=="string"?r+=`#${t[2]}`:r+=`#z${Ft(t[2])}`),r}static createDecoder({value:t}={}){return!(Array.isArray(t)&&t.length>1&&t.length<=3)||!wn.has(t[0])?!1:new Z}};s(Z,"Base58DidUrlDecoder");var X=class extends T{constructor({secure:t}={}){super(),this.secure=t}decode({value:t}={}){return`${this.secure?"https://":"http://"}${t[1]}`}static createDecoder({value:t}={}){return t.length===2&&typeof t[1]=="string"?new X({secure:t[0]===2}):!1}};s(X,"HttpUrlDecoder");var xn=/^(?:[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 Ho(e){return typeof e=="string"&&xn.test(e)}s(Ho,"validate");var fe=Ho;var R=[];for(ue=0;ue<256;++ue)R.push((ue+256).toString(16).substr(1));var ue;function Ko(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=(R[e[t+0]]+R[e[t+1]]+R[e[t+2]]+R[e[t+3]]+"-"+R[e[t+4]]+R[e[t+5]]+"-"+R[e[t+6]]+R[e[t+7]]+"-"+R[e[t+8]]+R[e[t+9]]+"-"+R[e[t+10]]+R[e[t+11]]+R[e[t+12]]+R[e[t+13]]+R[e[t+14]]+R[e[t+15]]).toLowerCase();if(!fe(r))throw TypeError("Stringified UUID is invalid");return r}s(Ko,"stringify");var Oe=Ko;function Wo(e){if(!fe(e))throw TypeError("Invalid UUID");var t,r=new Uint8Array(16);return r[0]=(t=parseInt(e.slice(0,8),16))>>>24,r[1]=t>>>16&255,r[2]=t>>>8&255,r[3]=t&255,r[4]=(t=parseInt(e.slice(9,13),16))>>>8,r[5]=t&255,r[6]=(t=parseInt(e.slice(14,18),16))>>>8,r[7]=t&255,r[8]=(t=parseInt(e.slice(19,23),16))>>>8,r[9]=t&255,r[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,r[11]=t/4294967296&255,r[12]=t>>>24&255,r[13]=t>>>16&255,r[14]=t>>>8&255,r[15]=t&255,r}s(Wo,"parse");var Re=Wo;var ft=class extends T{decode({value:t}={}){return`urn:uuid:${typeof t[1]=="string"?t[1]:Oe(t[1])}`}static createDecoder({value:t}={}){if(t.length===2&&(typeof t[1]=="string"||t[1]instanceof Uint8Array))return new ft}};s(ft,"UuidUrnDecoder");var Go=new Map([[1,X],[2,X],[3,ft],[1024,Z],[1025,Z]]),J=class extends T{static createDecoder({value:t}={}){if(!(Array.isArray(t)||t.length>1))return!1;let r=Go.get(t[0]);return r&&r.createDecoder({value:t})}};s(J,"UriDecoder");var V=class extends T{constructor({term:t}={}){super(),this.term=t}decode(){return this.term}static createDecoder({value:t,transformer:r}={}){if(Array.isArray(t))return J.createDecoder({value:t,transformer:r});let n=r.idToTerm.get(t);if(n!==void 0)return new V({term:n})}};s(V,"VocabTermDecoder");var ut=class extends T{decode({value:t}={}){let r=new Date(t*1e3).toISOString();return r.substring(0,r.indexOf("T"))}static createDecoder({value:t}={}){if(typeof t=="number")return new ut}};s(ut,"XsdDateDecoder");var Y=class extends T{constructor({value:t}={}){super(),this.value=t}decode({value:t}={}){return typeof t=="number"?new Date(t*1e3).toISOString().replace(".000Z","Z"):new Date(t[0]*1e3+t[1]).toISOString()}static createDecoder({value:t}={}){if(typeof t=="number")return new Y;if(Array.isArray(t)&&t.length===2&&(typeof t[0]=="number"||typeof t[1]=="number"))return new Y}};s(Y,"XsdDateTimeDecoder");function q(e,t){return JSON.stringify(e,null,2)}s(q,"inspect");var Zo=new Map([["@id",J],["@vocab",V],["https://w3id.org/security#multibase",at],["http://www.w3.org/2001/XMLSchema#date",ut],["http://www.w3.org/2001/XMLSchema#dateTime",Y]]),De=j.get("@context"),vn=De+1,$t=class extends ct{constructor({documentLoader:t,appContextMap:r}={}){if(super({documentLoader:t,appContextMap:r}),this.reverseAppContextMap=new Map,r)for(let[n,o]of r)this.reverseAppContextMap.set(o,n)}async decompress({compressedBytes:t,diagnose:r}={}){this.contextMap=new Map,this.termToId=new Map(j),this.nextTermId=ce,this.idToTerm=new Map;for(let[f,u]of this.termToId)this.idToTerm.set(u,f);let n=Nt(t,{useMaps:!0});r&&(r("Diagnostic CBOR-LD decompression transform map(s):"),r(q(n,{depth:null,colors:!0})));let o=[],i=Array.isArray(n),a=i?n:[n];for(let f of a){let u={};await this._transform({obj:u,transformMap:f}),o.push(u)}return i?o:o[0]}_beforeObjectContexts({obj:t,transformMap:r}){let n=r.get(De);if(n){let i=G.createDecoder({value:n,transformer:this});t["@context"]=i?i.decode({value:n}):n}let o=r.get(vn);if(o){if(n)throw new _("ERR_INVALID_ENCODED_CONTEXT","Both singular and plural context IDs were found in the CBOR-LD input.");if(!Array.isArray(o))throw new _("ERR_INVALID_ENCODED_CONTEXT","Encoded plural context value must be an array.");let i=[];for(let a of o){let f=G.createDecoder({value:a,transformer:this});i.push(f?f.decode({value:a}):a)}t["@context"]=i}}_beforeTypeScopedContexts({activeCtx:t,obj:r,transformMap:n}){let{termToId:o}=this,i=["@type",...t.aliases.type];for(let a of i){let f=o.get(a),u=n.get(f);if(u===void 0&&(u=n.get(f+1)),u!==void 0)if(Array.isArray(u))r[a]=u.map(p=>{let h=V.createDecoder({value:p,transformer:this});return h?h.decode({value:p}):p});else{let p=V.createDecoder({value:u,transformer:this});r[a]=p?p.decode({value:u}):u}}}_getEntries({transformMap:t,termMap:r}){let n=[];for(let[o,i]of t){if(o===De||o===vn)continue;let{term:a,plural:f}=this._getTermForId({id:o});if(a===void 0)throw new _("ERR_UNKNOWN_CBORLD_TERM_ID",`Unknown term ID '${o}' was detected in the CBOR-LD input.`);let u=r.get(a);if(u===void 0&&!(a.startsWith("@")&&j.has(a)))throw new _("ERR_UNKNOWN_CBORLD_TERM",`Unknown term "${a}" was detected in the CBOR-LD input.`);n.push([{term:a,termId:o,plural:f,def:u},i])}return n.sort(Xo)}_getTermInfo({termMap:t,key:r}){let{term:n,plural:o}=this._getTermForId({id:r});if(n===void 0)throw new _("ERR_UNKNOWN_CBORLD_TERM_ID",`Unknown term ID '${r}' was detected in the CBOR-LD input.`);let i=t.get(n);if(i===void 0&&!(n.startsWith("@")&&j.has(n)))throw new _("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:t,termInfo:r,value:n}){let o=J.createDecoder({value:n});t[r.term]=o?o.decode({value:n}):n}_transformObjectType({obj:t,termInfo:r,value:n}){let{term:o,plural:i}=r,a=i?n:[n],f=[];for(let u of a){let p=V.createDecoder({value:u,transformer:this});f.push(p?p.decode({value:u}):u)}t[o]=i?f:f[0]}_transformTypedValue({entries:t,termType:r,value:n}){let o=Zo.get(r),i=o&&o.createDecoder({value:n,transformer:this});if(i)return t.push(i.decode({value:n})),!0}async _transformArray({entries:t,contextStack:r,value:n}){let o=[];for(let i of n){let a={};o.push(a),await this._transform({obj:a,transformMap:i,contextStack:r})}t.push(o)}async _transformObject({entries:t,contextStack:r,value:n}){let o={};return t.push(o),this._transform({obj:o,transformMap:n,contextStack:r})}_assignEntries({entries:t,obj:r,termInfo:n}){let{term:o,plural:i}=n;r[o]=i?t:t[0]}};s($t,"Decompressor");function Xo([{term:e}],[{term:t}]){return e<t?-1:e>t?1:0}s(Xo,"_sortEntriesByTerm");async function Ue({cborldBytes:e,documentLoader:t,appContextMap:r=new Map,diagnose:n}){if(!(e instanceof Uint8Array))throw new TypeError('"cborldBytes" must be a Uint8Array.');let o=0;if(e[o++]!==217)throw new _("ERR_NOT_CBORLD",'CBOR-LD must start with a CBOR major type "Tag" header of `0xd9`.');if(e[o++]!==5)throw new _("ERR_NOT_CBORLD","CBOR-LD 16-bit tag must start with `0x05`.");let i=e[o];if(i===void 0)throw new _("ERR_NOT_CBORLD","Truncated CBOR-LD 16-bit tag.");if(!(i===0||i===1))throw new _("ERR_NOT_CBORLD",`Unsupported CBOR-LD compression mode "${i}".`);o++;let{buffer:a,byteOffset:f,length:u}=e,p=new Uint8Array(a,f+o,u-o);if(i===0)return Nt(p,{useMaps:!1});let g=await new $t({documentLoader:t,appContextMap:r}).decompress({compressedBytes:p,diagnose:n});return n&&(n("Diagnostic JSON-LD result:"),n(q(g,{depth:null,colors:!0}))),g}s(Ue,"decode");var b=class{encode(){throw new Error("Must be implemented by derived class.")}static createEncoder({value:t}={}){throw new Error("Must be implemented by derived class.")}};s(b,"CborldEncoder");var pt=class extends b{constructor({context:t,appContextMap:r}={}){super(),this.context=t,this.appContextMap=r}encode(){let{context:t}=this,r=Ee.get(t)||this.appContextMap.get(t);return r===void 0?new l(c.string,t):new l(c.uint,r)}static createEncoder({value:t,transformer:r}={}){if(typeof t!="string")return!1;let{appContextMap:n}=r;return new pt({context:t,appContextMap:n})}};s(pt,"ContextEncoder");var lt=class extends b{constructor({value:t}={}){super(),this.value=t}encode(){let{value:t}=this,r,n;t[0]==="z"?(r=122,n=ae(t.substr(1))):t[0]==="M"&&(r=77,n=se.toUint8Array(t.substr(1)));let o=new Uint8Array(1+n.length);return o[0]=r,o.set(n,1),new l(c.bytes,o)}static createEncoder({value:t}={}){if(typeof t!="string")return!1;if(t[0]==="z"||t[0]==="M")return new lt({value:t})}};s(lt,"MultibaseEncoder");var bn=new Map([["did:v1:nym:",1024],["did:key:",1025]]),tt=class extends b{constructor({value:t,scheme:r}={}){super(),this.value=t,this.scheme=r}encode(){let{value:t,scheme:r}=this,n=t.substr(r.length),[o,i]=n.split("#"),a=[new l(c.uint,bn.get(r)),_n(o)];return i!==void 0&&a.push(_n(i)),[new l(c.array,a.length),a]}static createEncoder({value:t}={}){let r=[...bn.keys()];for(let n of r)if(t.startsWith(n))return new tt({value:t,scheme:n})}};s(tt,"Base58DidUrlEncoder");function _n(e){if(e.startsWith("z")){let t=ae(e.substr(1));if(t)return new l(c.bytes,t)}return new l(c.string,e)}s(_n,"_multibase58ToToken");var H=class extends b{constructor({value:t,secure:r}={}){super(),this.value=t,this.secure=r}encode(){let{value:t,secure:r}=this,n=r?8:7,o=[new l(c.uint,r?2:1),new l(c.string,t.substr(n))];return[new l(c.array,o.length),o]}static createEncoder({value:t}={}){if(t.startsWith("https://"))return new H({value:t,secure:!0});if(t.startsWith("http://"))return new H({value:t,secure:!1})}};s(H,"HttpUrlEncoder");var dt=class extends b{constructor({value:t}={}){super(),this.value=t}encode(){let{value:t}=this,r=t.substr(9),n=[new l(c.uint,3)];if(r.toLowerCase()===r){let o=Re(r);n.push(new l(c.bytes,o))}else n.push(new l(c.string,r));return[new l(c.array,n.length),n]}static createEncoder({value:t}={}){if(t.startsWith("urn:uuid:"))return new dt({value:t})}};s(dt,"UuidUrnEncoder");var Jo=new Map([["http",H],["https",H],["urn:uuid",dt],["did:v1:nym",tt],["did:key",tt]]),et=class extends b{static createEncoder({value:t}={}){if(typeof t!="string")return!1;let r;try{let{protocol:o,pathname:i}=new URL(t);r=o,i.includes(":")&&(r+=i);let a=t.split(":");a.pop(),r=a.join(":")}catch{return!1}let n=Jo.get(r);return n&&n.createEncoder({value:t})}};s(et,"UriEncoder");var rt=class extends b{constructor({termId:t}={}){super(),this.termId=t}encode(){return new l(c.uint,this.termId)}static createEncoder({value:t,transformer:r}={}){let{termToId:n}=r,o=n.get(t);return o!==void 0?new rt({termId:o}):et.createEncoder({value:t})}};s(rt,"VocabTermEncoder");var ht=class extends b{constructor({value:t,parsed:r}={}){super(),this.value=t,this.parsed=r}encode(){let{value:t,parsed:r}=this,n=Math.floor(r/1e3),o=new Date(n*1e3).toISOString(),i=o.substring(0,o.indexOf("T"));return t!==i?new l(c.string,t):new l(c.uint,n)}static createEncoder({value:t}={}){if(t.includes("T"))return!1;let r=Date.parse(t);return isNaN(r)?!1:new ht({value:t,parsed:r})}};s(ht,"XsdDateEncoder");var mt=class extends b{constructor({value:t,parsed:r}={}){super(),this.value=t,this.parsed=r}encode(){let{value:t,parsed:r}=this,n=Math.floor(r/1e3),o=new l(c.uint,n),i=t.indexOf(".");if(i===-1){let p=new Date(n*1e3).toISOString().replace(".000Z","Z");return t!==p?new l(c.string,t):o}let a=parseInt(t.substr(i+1),10),f=new Date(n*1e3+a).toISOString();if(t!==f)return new l(c.string,t);let u=[o,new l(c.uint,a)];return[new l(c.array,u.length),u]}static createEncoder({value:t}={}){if(!t.includes("T"))return!1;let r=Date.parse(t);return isNaN(r)?!1:new mt({value:t,parsed:r})}};s(mt,"XsdDateTimeEncoder");var Yo=new Map([["@id",et],["@vocab",rt],["https://w3id.org/security#multibase",lt],["http://www.w3.org/2001/XMLSchema#date",ht],["http://www.w3.org/2001/XMLSchema#dateTime",mt]]),En=j.get("@context"),qo=En+1,ti={Object(e){if(e instanceof b)return e.encode({obj:e})}},jt=class extends ct{constructor({documentLoader:t,appContextMap:r}={}){super({documentLoader:t,appContextMap:r})}async compress({jsonldDocument:t,diagnose:r}={}){let n=await this._createTransformMaps({jsonldDocument:t});return r&&(r("Diagnostic CBOR-LD compression transform map(s):"),r(q(n,{depth:null,colors:!0}))),kt(n,{typeEncoders:ti})}async _createTransformMaps({jsonldDocument:t}){this.contextMap=new Map,this.termToId=new Map(j),this.nextTermId=ce;let r=[],n=Array.isArray(t),o=n?t:[t];for(let i of o){let a=new Map;await this._transform({obj:i,transformMap:a}),r.push(a)}return n?r:r[0]}_afterObjectContexts({obj:t,transformMap:r}){let n=t["@context"];if(!n)return;let o=[],i=Array.isArray(n),a=i?n:[n];for(let u of a){let p=pt.createEncoder({value:u,transformer:this});o.push(p||u)}let f=i?qo:En;r.set(f,i?o:o[0])}_getEntries({obj:t,termMap:r}){let n=[],o=Object.keys(t).sort();for(let i of o){if(i==="@context")continue;let a=r.get(i);if(a===void 0&&!(i.startsWith("@")&&j.has(i)))throw new _("ERR_UNKNOWN_CBORLD_TERM",`Unknown term '${i}' was detected in the JSON-LD input.`);let f=t[i],u=Array.isArray(f),p=this._getIdForTerm({term:i,plural:u});n.push([{term:i,termId:p,plural:u,def:a},f])}return n}_transformObjectId({transformMap:t,termInfo:r,value:n}){let{termId:o}=r,i=et.createEncoder({value:n,transformer:this,termInfo:r});t.set(o,i||n)}_transformObjectType({transformMap:t,termInfo:r,value:n}){let{termId:o,plural:i}=r,a=i?n:[n],f=[];for(let u of a){let p=rt.createEncoder({value:u,transformer:this,termInfo:r});f.push(p||u)}t.set(o,i?f:f[0])}_transformTypedValue({entries:t,termType:r,value:n,termInfo:o}){let i=Yo.get(r),a=i&&i.createEncoder({value:n,transformer:this,termInfo:o});if(a)return t.push(a),!0}async _transformArray({entries:t,contextStack:r,value:n}){let o=[];for(let i of n){let a=new Map;o.push(a),await this._transform({obj:i,transformMap:a,contextStack:r})}t.push(o)}async _transformObject({entries:t,contextStack:r,value:n}){let o=new Map;t.push(o),await this._transform({obj:n,transformMap:o,contextStack:r})}_assignEntries({entries:t,transformMap:r,termInfo:n}){let{termId:o,plural:i}=n;r.set(o,i?t:t[0])}};s(jt,"Compressor");async function Ie({jsonldDocument:e,documentLoader:t,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]),a;n===0?a=kt(e):a=await new jt({documentLoader:t,appContextMap:r}).compress({jsonldDocument:e,diagnose:o});let f=i.length+a.length,u=new Uint8Array(f);return u.set(i),u.set(a,i.length),o&&(o("Diagnostic CBOR-LD result:"),o(q(u,{depth:null,colors:!0}))),u}s(Ie,"encode");function ke(e){if(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray)return new DataView(e.buffer,e.byteOffset,e.byteLength);if(e instanceof ArrayBuffer)return new DataView(e);throw new TypeError("Expected `data` to be an ArrayBuffer, Buffer, Int8Array, Uint8Array or Uint8ClampedArray")}s(ke,"toDataView");var ri="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",ni="0123456789ABCDEFGHIJKLMNOPQRSTUV",oi="0123456789ABCDEFGHJKMNPQRSTVWXYZ";function Me(e,t,r){r=r||{};let n,o;switch(t){case"RFC3548":case"RFC4648":n=ri,o=!0;break;case"RFC4648-HEX":n=ni,o=!0;break;case"Crockford":n=oi,o=!1;break;default:throw new Error("Unknown base32 variant: "+t)}let i=r.padding!==void 0?r.padding:o,a=ke(e),f=0,u=0,p="";for(let h=0;h<a.byteLength;h++)for(u=u<<8|a.getUint8(h),f+=8;f>=5;)p+=n[u>>>f-5&31],f-=5;if(f>0&&(p+=n[u<<5-f&31]),i)for(;p.length%8!==0;)p+="=";return p}s(Me,"base32Encode");var Hn=eo(Cn(),1);var E;(function(e){e[e.Terminator=0]="Terminator",e[e.Numeric=1]="Numeric",e[e.Alphanumeric=2]="Alphanumeric",e[e.StructuredAppend=3]="StructuredAppend",e[e.Byte=4]="Byte",e[e.Kanji=8]="Kanji",e[e.ECI=7]="ECI"})(E||(E={}));var Le=s(function(e,t){return Le=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},Le(e,t)},"extendStatics");function nt(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Le(e,t);function r(){this.constructor=e}s(r,"__"),e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}s(nt,"__extends");var Bt=function(){function e(t,r){this.bytes=[],this.mode=t,this.data=r}return s(e,"QRData"),e.prototype.getLength=function(){return this.bytes.length},e.prototype.getLengthInBits=function(t){var r=this.mode,n=new Error("illegal mode: ".concat(r));if(1<=t&&t<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(t<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(t<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: ".concat(t))},e}();function An(e){for(var t=0,r=e.length,n=[],o=0;o<r;o++){var i=e.charCodeAt(o);i<128?n[t++]=i:i<2048?(n[t++]=i>>6|192,n[t++]=i&63|128):(i&64512)===55296&&o+1<r&&(e.charCodeAt(o+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++o)&1023),n[t++]=i>>18|240,n[t++]=i>>12&63|128,n[t++]=i>>6&63|128,n[t++]=i&63|128):(n[t++]=i>>12|224,n[t++]=i>>6&63|128,n[t++]=i&63|128)}return n}s(An,"encode");var Bn=function(e){nt(t,e);function t(r,n){var o=e.call(this,E.Byte,r)||this;if(o.encoding=-1,typeof n=="function"){var i=n(r),a=i.encoding,f=i.bytes;o.bytes=f,o.encoding=a}else o.bytes=An(r),o.encoding=26;return o}return s(t,"QRByte"),t.prototype.writeTo=function(r){for(var n=this.bytes,o=0,i=n;o<i.length;o++){var a=i[o];r.put(a,8)}},t}(Bt);var yt=[],Ne=[];for(D=0;D<256;D++)Ne[D]=0,yt[D]=D<8?1<<D:yt[D-4]^yt[D-5]^yt[D-6]^yt[D-8];var D;for(D=0;D<255;D++)Ne[yt[D]]=D;var D;function St(e){if(e<1)throw new Error("illegal log: ".concat(e));return Ne[e]}s(St,"glog");function zt(e){for(;e<0;)e+=255;for(;e>=256;)e-=255;return yt[e]}s(zt,"gexp");var Vt=function(){function e(t,r){r===void 0&&(r=0);for(var n=0,o=t.length;n<o&&t[n]===0;)n++;o-=n;for(var i=[],a=0;a<o;a++)i.push(t[n+a]);for(var a=0;a<r;a++)i.push(0);this.num=i}return s(e,"Polynomial"),e.prototype.getAt=function(t){return this.num[t]},e.prototype.getLength=function(){return this.num.length},e.prototype.multiply=function(t){for(var r=[],n=t.getLength(),o=this.getLength(),i=o+n-1,a=0;a<i;a++)r.push(0);for(var a=0;a<o;a++)for(var f=0;f<n;f++)r[a+f]^=zt(St(this.getAt(a))+St(t.getAt(f)));return new e(r)},e.prototype.mod=function(t){var r=t.getLength(),n=this.getLength();if(n-r<0)return this;for(var o=St(this.getAt(0))-St(t.getAt(0)),i=[],a=0;a<n;a++)i.push(this.getAt(a));for(var a=0;a<r;a++)i[a]^=zt(St(t.getAt(a))+o);return new e(i).mod(t)},e}();var fi=3,ui=3,Sn=40,pi=10,li=[[],[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]],di=1<<14|1<<12|1<<10|1<<4|1<<1,Un=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,In=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0;function kn(e){return li[e-1]}s(kn,"getAlignmentPattern");function Mn(e){for(var t=new Vt([1]),r=0;r<e;r++)t=t.multiply(new Vt([1,zt(r)]));return t}s(Mn,"getErrorCorrectionPolynomial");function Ot(e){for(var t=0;e!==0;)t++,e>>>=1;return t}s(Ot,"getBCHDigit");var On=Ot(In);function Ln(e){for(var t=e<<12;Ot(t)-On>=0;)t^=In<<Ot(t)-On;return e<<12|t}s(Ln,"getBCHVersion");var Rn=Ot(Un);function Nn(e){for(var t=e<<10;Ot(t)-Rn>=0;)t^=Un<<Ot(t)-Rn;return(e<<10|t)^di}s(Nn,"getBCHVersionInfo");function Dn(e,t){for(var r=e.getMatrixSize(),n=0,o=0;o<r;o++)for(var i=!1,a=0,f=0;f<r;f++){var u=t?e.isDark(o,f):e.isDark(f,o);u===i?(a++,a===5?n+=fi:a>5&&n++):(i=u,a=1)}return n}s(Dn,"applyMaskPenaltyRule1Internal");function hi(e){return Dn(e,!0)+Dn(e,!1)}s(hi,"applyMaskPenaltyRule1");function mi(e){for(var t=e.getMatrixSize(),r=0,n=0;n<t-1;n++)for(var o=0;o<t-1;o++){var i=e.isDark(n,o);i===e.isDark(n,o+1)&&i===e.isDark(n+1,o)&&i===e.isDark(n+1,o+1)&&(r+=ui)}return r}s(mi,"applyMaskPenaltyRule2");function pe(e,t,r,n,o){r=Math.max(r,0),n=Math.min(n,e.getMatrixSize());for(var i=r;i<n;i++){var a=o?e.isDark(t,i):e.isDark(i,t);if(a)return!1}return!0}s(pe,"isFourWhite");function yi(e){for(var t=e.getMatrixSize(),r=0,n=0;n<t;n++)for(var o=0;o<t;o++)o+6<t&&e.isDark(n,o)&&!e.isDark(n,o+1)&&e.isDark(n,o+2)&&e.isDark(n,o+3)&&e.isDark(n,o+4)&&!e.isDark(n,o+5)&&e.isDark(n,o+6)&&(pe(e,n,o-4,o,!0)||pe(e,n,o+7,o+11,!0))&&(r+=Sn),n+6<t&&e.isDark(n,o)&&!e.isDark(n+1,o)&&e.isDark(n+2,o)&&e.isDark(n+3,o)&&e.isDark(n+4,o)&&!e.isDark(n+5,o)&&e.isDark(n+6,o)&&(pe(e,o,n-4,n,!1)||pe(e,o,n+7,n+11,!1))&&(r+=Sn);return r}s(yi,"applyMaskPenaltyRule3");function gi(e){for(var t=e.getMatrixSize(),r=0,n=0;n<t;n++)for(var o=0;o<t;o++)e.isDark(n,o)&&r++;var i=t*t,a=Math.floor(Math.abs(r*20-i*10)/i);return a*pi}s(gi,"applyMaskPenaltyRule4");function Pn(e){return hi(e)+mi(e)+yi(e)+gi(e)}s(Pn,"calculateMaskPenalty");var L;(function(e){e[e.L=1]="L",e[e.M=0]="M",e[e.Q=3]="Q",e[e.H=2]="H"})(L||(L={}));var Fn=function(){function e(t,r){this.dataCount=r,this.totalCount=t}return s(e,"RSBlock"),e.prototype.getDataCount=function(){return this.dataCount},e.prototype.getTotalCount=function(){return this.totalCount},e.getRSBlocks=function(t,r){for(var n=[],o=e.getRSBlockTable(t,r),i=o.length/3,a=0;a<i;a++)for(var f=o[a*3+0],u=o[a*3+1],p=o[a*3+2],h=0;h<f;h++)n.push(new e(u,p));return n},e.getRSBlockTable=function(t,r){switch(r){case L.L:return e.RS_BLOCK_TABLE[(t-1)*4+0];case L.M:return e.RS_BLOCK_TABLE[(t-1)*4+1];case L.Q:return e.RS_BLOCK_TABLE[(t-1)*4+2];case L.H:return e.RS_BLOCK_TABLE[(t-1)*4+3];default:throw new Error("illegal error correction level: ".concat(r))}},e.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]],e}();var Pe=function(){function e(){this.length=0,this.buffer=[]}return s(e,"BitBuffer"),e.prototype.getBuffer=function(){return this.buffer},e.prototype.getLengthInBits=function(){return this.length},e.prototype.getBit=function(t){return(this.buffer[t/8>>0]>>>7-t%8&1)===1},e.prototype.put=function(t,r){for(var n=0;n<r;n++)this.putBit((t>>>r-n-1&1)===1)},e.prototype.putBit=function(t){var r=this.buffer;this.length===r.length*8&&r.push(0),t&&(r[this.length/8>>0]|=128>>>this.length%8),this.length++},e}();var le=function(){function e(){}return s(e,"OutputStream"),e.prototype.writeBytes=function(t,r,n){r===void 0&&(r=0),n===void 0&&(n=t.length);for(var o=0;o<n;o++)this.writeByte(t[o+r])},e.prototype.flush=function(){},e.prototype.close=function(){this.flush()},e}();var de=function(e){nt(t,e);function t(){var r=e!==null&&e.apply(this,arguments)||this;return r.bytes=[],r}return s(t,"ByteArrayOutputStream"),t.prototype.writeByte=function(r){this.bytes.push(r)},t.prototype.writeInt16=function(r){this.bytes.push(r,r>>>8)},t.prototype.toByteArray=function(){return this.bytes},t}(le);function wi(e){if(e>=0){if(e<26)return 65+e;if(e<52)return 97+(e-26);if(e<62)return 48+(e-52);if(e===62)return 43;if(e===63)return 47}throw new Error("illegal char: ".concat(String.fromCharCode(e)))}s(wi,"encode");var $n=function(e){nt(t,e);function t(r){var n=e.call(this)||this;return n.buffer=0,n.length=0,n.bufLength=0,n.stream=r,n}return s(t,"Base64EncodeOutputStream"),t.prototype.writeByte=function(r){for(this.buffer=this.buffer<<8|r&255,this.bufLength+=8,this.length++;this.bufLength>=6;)this.writeEncoded(this.buffer>>>this.bufLength-6),this.bufLength-=6},t.prototype.flush=function(){this.bufLength>0&&(this.writeEncoded(this.buffer<<6-this.bufLength),this.buffer=0,this.bufLength=0);var r=this.stream;if(this.length%3!=0)for(var n=3-this.length%3,o=0;o<n;o++)r.writeByte(61)},t.prototype.writeEncoded=function(r){this.stream.writeByte(wi(r&63))},t}(le);function xi(e){var t=new de,r=new $n(t);return r.writeBytes(e),r.close(),t.close(),t.toByteArray()}s(xi,"encodeToBase64");var vi=function(){function e(){this.size=0,this.map={}}return s(e,"LZWTable"),e.prototype.add=function(t){this.contains(t)||(this.map[t]=this.size++)},e.prototype.getSize=function(){return this.size},e.prototype.indexOf=function(t){return this.map[t]},e.prototype.contains=function(t){return this.map[t]>=0},e}(),bi=function(){function e(t){this.output=t,this.bitLength=0,this.bitBuffer=0}return s(e,"BitOutputStream"),e.prototype.write=function(t,r){if(t>>>r!==0)throw new Error("length overflow");for(var n=this.output;this.bitLength+r>=8;)n.writeByte(255&(t<<this.bitLength|this.bitBuffer)),r-=8-this.bitLength,t>>>=8-this.bitLength,this.bitBuffer=0,this.bitLength=0;this.bitBuffer=t<<this.bitLength|this.bitBuffer,this.bitLength=this.bitLength+r},e.prototype.flush=function(){var t=this.output;this.bitLength>0&&t.writeByte(this.bitBuffer),t.flush()},e.prototype.close=function(){this.flush(),this.output.close()},e}(),jn=function(){function e(t,r){this.data=[],this.width=t,this.height=r;for(var n=t*r,o=0;o<n;o++)this.data[o]=0}return s(e,"GIFImage"),e.prototype.getLZWRaster=function(t){for(var r=new vi,n=String.fromCharCode,o=1<<t,i=(1<<t)+1,a=0;a<o;a++)r.add(n(a));r.add(n(o)),r.add(n(i));var f=t+1,u=new de,p=new bi(u);try{var h=this.data,g=h.length,w=String.fromCharCode;p.write(o,f);for(var m=0,v=w(h[m++]);m<g;){var C=w(h[m++]);r.contains(v+C)?v+=C:(p.write(r.indexOf(v),f),r.getSize()<4095&&(r.getSize()===1<<f&&f++,r.add(v+C)),v=C)}p.write(r.indexOf(v),f),p.write(i,f)}finally{p.close()}return u.toByteArray()},e.prototype.setPixel=function(t,r,n){var o=this,i=o.width,a=o.height;if(t<0||i<=t)throw new Error("illegal x axis: ".concat(t));if(r<0||a<=r)throw new Error("illegal y axis: ".concat(r));this.data[r*i+t]=n},e.prototype.getPixel=function(t,r){var n=this,o=n.width,i=n.height;if(t<0||o<=t)throw new Error("illegal x axis: ".concat(t));if(r<0||i<=r)throw new Error("illegal y axis: ".concat(r));return this.data[r*o+t]},e.prototype.write=function(t){var r=this,n=r.width,o=r.height;t.writeByte(71),t.writeByte(73),t.writeByte(70),t.writeByte(56),t.writeByte(55),t.writeByte(97),t.writeInt16(n),t.writeInt16(o),t.writeByte(128),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(0),t.writeByte(255),t.writeByte(255),t.writeByte(255),t.writeByte(44),t.writeInt16(0),t.writeInt16(0),t.writeInt16(n),t.writeInt16(o),t.writeByte(0);var i=2,a=this.getLZWRaster(i),f=a.length;t.writeByte(i);for(var u=0;f-u>255;)t.writeByte(255),t.writeBytes(a,u,255),u+=255;var p=f-u;t.writeByte(p),t.writeBytes(a,u,p),t.writeByte(0),t.writeByte(59)},e.prototype.toDataURL=function(){var t=new de;this.write(t);var r=xi(t.toByteArray());t.close();for(var n=r.length,o=String.fromCharCode,i="data:image/gif;base64,",a=0;a<n;a++)i+=o(r[a]);return i},e}();function zn(e){switch(e){case 0:return function(t,r){return(t+r&1)===0};case 1:return function(t,r){return(r&1)===0};case 2:return function(t,r){return t%3===0};case 3:return function(t,r){return(t+r)%3===0};case 4:return function(t,r){return((t/3>>0)+(r/2>>0)&1)===0};case 5:return function(t,r){return(t*r&1)+t*r%3===0};case 6:return function(t,r){return((t*r&1)+t*r%3&1)===0};case 7:return function(t,r){return(t*r%3+(t+r&1)&1)===0};default:throw new Error("illegal mask: ".concat(e))}}s(zn,"getMaskFunc");var _i=236,Ei=17,Ti=Object.prototype.toString;function Ci(e,t){if(e<0||e>=1e6)throw new Error("byte mode encoding hint out of range");t.put(E.ECI,4),e<1<<7?t.put(e,8):e<1<<14?(t.put(2,2),t.put(e,14)):(t.put(6,3),t.put(e,21))}s(Ci,"appendECI");function Vn(e,t,r,n){for(var o=new Pe,i=Fn.getRSBlocks(e,t),a=0,f=n;a<f.length;a++){var u=f[a],p=u.mode;r&&p===E.Byte&&Ci(u.encoding,o),o.put(p,4),o.put(u.getLength(),u.getLengthInBits(e)),u.writeTo(o)}for(var h=0,g=0,w=i;g<w.length;g++){var m=w[g];h+=m.getDataCount()}return h*=8,[o,i,h]}s(Vn,"prepareData");function Ai(e,t){for(var r=0,n=0,o=0,i=[],a=[],f=t.length,u=e.getBuffer(),p=0;p<f;p++){var h=t[p],g=h.getDataCount(),w=h.getTotalCount()-g;n=Math.max(n,g),o=Math.max(o,w),i[p]=[];for(var m=0;m<g;m++)i[p][m]=255&u[m+r];r+=g;var v=Mn(w),C=v.getLength()-1,gt=new Vt(i[p],C),Qt=gt.mod(v),he=Qt.getLength();a[p]=[];for(var m=0;m<C;m++){var Ht=m+he-C;a[p][m]=Ht>=0?Qt.getAt(Ht):0}}e=new Pe;for(var m=0;m<n;m++)for(var p=0;p<f;p++)m<i[p].length&&e.put(i[p][m],8);for(var m=0;m<o;m++)for(var p=0;p<f;p++)m<a[p].length&&e.put(a[p][m],8);return e}s(Ai,"createBytes");function Bi(e,t,r){for(e.getLengthInBits()+4<=r&&e.put(0,4);e.getLengthInBits()%8!==0;)e.putBit(!1);for(;!(e.getLengthInBits()>=r||(e.put(_i,8),e.getLengthInBits()>=r));)e.put(Ei,8);return Ai(e,t)}s(Bi,"createData");var Fe=function(){function e(t){t===void 0&&(t={}),this.matrixSize=0,this.chunks=[],this.matrix=[];var r=t.version,n=r===void 0?0:r,o=t.encodingHint,i=o===void 0?!1:o,a=t.errorCorrectionLevel,f=a===void 0?L.L:a;this.setVersion(n),this.setEncodingHint(i),this.setErrorCorrectionLevel(f)}return s(e,"Encoder"),e.prototype.getMatrix=function(){return this.matrix},e.prototype.getMatrixSize=function(){return this.matrixSize},e.prototype.getVersion=function(){return this.version},e.prototype.setVersion=function(t){return this.version=Math.min(40,Math.max(0,t>>0)),this.auto=this.version===0,this},e.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},e.prototype.setErrorCorrectionLevel=function(t){switch(t){case L.L:case L.M:case L.Q:case L.H:this.errorCorrectionLevel=t}return this},e.prototype.getEncodingHint=function(){return this.encodingHint},e.prototype.setEncodingHint=function(t){return this.encodingHint=t,this},e.prototype.write=function(t){var r=this.chunks;if(t instanceof Bt)r.push(t);else{var n=Ti.call(t);if(n==="[object String]")r.push(new Bn(t));else throw new Error("illegal data: ".concat(t))}return this},e.prototype.isDark=function(t,r){return this.matrix[t][r]===!0},e.prototype.setupFinderPattern=function(t,r){for(var n=this.matrix,o=this.matrixSize,i=-1;i<=7;i++)for(var a=-1;a<=7;a++)t+i<=-1||o<=t+i||r+a<=-1||o<=r+a||(0<=i&&i<=6&&(a===0||a===6)||0<=a&&a<=6&&(i===0||i===6)||2<=i&&i<=4&&2<=a&&a<=4?n[t+i][r+a]=!0:n[t+i][r+a]=!1)},e.prototype.setupAlignmentPattern=function(){for(var t=this.matrix,r=kn(this.version),n=r.length,o=0;o<n;o++)for(var i=0;i<n;i++){var a=r[o],f=r[i];if(t[a][f]===null)for(var u=-2;u<=2;u++)for(var p=-2;p<=2;p++)u===-2||u===2||p===-2||p===2||u===0&&p===0?t[a+u][f+p]=!0:t[a+u][f+p]=!1}},e.prototype.setupTimingPattern=function(){for(var t=this.matrix,r=this.matrixSize-8,n=8;n<r;n++){var o=n%2===0;t[n][6]===null&&(t[n][6]=o),t[6][n]===null&&(t[6][n]=o)}},e.prototype.setupFormatInfo=function(t){for(var r=this.matrix,n=this.errorCorrectionLevel<<3|t,o=Nn(n),i=this.matrixSize,a=0;a<15;a++){var f=(o>>a&1)===1;a<6?r[a][8]=f:a<8?r[a+1][8]=f:r[i-15+a][8]=f,a<8?r[8][i-a-1]=f:a<9?r[8][15-a-1+1]=f:r[8][15-a-1]=f}r[i-8][8]=!0},e.prototype.setupVersionInfo=function(){if(this.version>=7)for(var t=this.matrix,r=this.matrixSize,n=Ln(this.version),o=0;o<18;o++){var i=(n>>o&1)===1;t[o/3>>0][o%3+r-8-3]=i,t[o%3+r-8-3][o/3>>0]=i}},e.prototype.setupCodewords=function(t,r){for(var n=this.matrix,o=this.matrixSize,i=t.getLengthInBits(),a=zn(r),f=0,u=o-1;u>=1;u-=2){u===6&&(u=5);for(var p=0;p<o;p++)for(var h=0;h<2;h++){var g=u-h,w=(u+1&2)===0,m=w?o-1-p:p;if(n[m][g]===null){var v=!1;f<i&&(v=t.getBit(f++));var C=a(g,m);C&&(v=!v),n[m][g]=v}}}},e.prototype.buildMatrix=function(t,r){for(var n=[],o=this.matrixSize,i=0;i<o;i++){n[i]=[];for(var a=0;a<o;a++)n[i][a]=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(t,r)},e.prototype.make=function(){var t,r,n,o,i,a=this,f=a.chunks,u=a.errorCorrectionLevel;if(this.auto){for(var p=1;p<=40&&(t=Vn(p,u,this.encodingHint,f),n=t[0],o=t[1],i=t[2],!(n.getLengthInBits()<=i));p++);var h=n.getLengthInBits();if(h>i)throw new Error("data overflow: ".concat(h," > ").concat(i));this.version=p}else r=Vn(this.version,u,this.encodingHint,f),n=r[0],o=r[1],i=r[2];this.matrixSize=this.version*4+17;for(var g=[],w=Bi(n,o,i),m=-1,v=Number.MAX_VALUE,C=0;C<8;C++){this.buildMatrix(w,C),g.push(this.matrix);var gt=Pn(this);gt<v&&(v=gt,m=C)}return this.matrix=g[m],this},e.prototype.toDataURL=function(t,r){t===void 0&&(t=2),r===void 0&&(r=t*4),t=Math.max(1,t>>0),r=Math.max(0,r>>0);for(var n=this.matrixSize,o=t*n+r*2,i=r,a=o-r,f=new jn(o,o),u=0;u<o;u++)for(var p=0;p<o;p++)if(i<=p&&p<a&&i<=u&&u<a){var h=(u-i)/t>>0,g=(p-i)/t>>0;f.setPixel(p,u,this.isDark(h,g)?0:1)}else f.setPixel(p,u,1);return f.toDataURL()},e.prototype.clear=function(){this.chunks=[]},e}();function Qn(e){for(var t=e.length,r=[],n=0;n<t;n++)r.push(e.charCodeAt(n));return r}s(Qn,"encode");function $e(e){if(48<=e&&e<=57)return e-48;if(65<=e&&e<=90)return e-65+10;switch(e){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: ".concat(String.fromCharCode(e)))}}s($e,"getByte");var je=function(e){nt(t,e);function t(r){var n=e.call(this,E.Alphanumeric,r)||this;return n.bytes=Qn(r),n}return s(t,"QRAlphanumeric"),t.prototype.writeTo=function(r){for(var n=0,o=this.bytes,i=o.length;n+1<i;)r.put($e(o[n])*45+$e(o[n+1]),11),n+=2;n<i&&r.put($e(o[n]),6)},t}(Bt);var Kn="VP1",Wn="B";function Si({bytes:e,size:t}){let r=new Fe;r.setEncodingHint(!0);let n=Me(e,"RFC4648",{padding:!1}),o=`${Kn}-${Wn}${n}`;return r.write(new je(o)),r.make(),{payload:o,encodedCborld:n,version:r.getVersion(),imageDataUrl:r.toDataURL(t)}}s(Si,"_bytesToQrCodeDataUrl");async function ze({vp:e,documentLoader:t,size:r,diagnose:n}={}){let o=await Ie({jsonldDocument:e,documentLoader:t,diagnose:n}),{payload:i,imageDataUrl:a,encodedCborld:f,version:u}=Si({bytes:o,size:r});return{payload:i,imageDataUrl:a,encodedCborld:f,rawCborldBytes:o,version:u}}s(ze,"toQrCode");async function Ve({text:e,documentLoader:t,diagnose:r}={}){let n=Kn+"-";if(!(e&&e.startsWith(n)))throw TypeError("Unsupported VP QR format.");let o=e.slice(n.length);if(!o.startsWith(Wn))throw TypeError("Payload must be multibase base32 (RFC4648) encoded.");let i=(0,Hn.default)(o.slice(1),"RFC4648"),a=new Uint8Array(i);return{vp:await Ue({cborldBytes:a,documentLoader:t,diagnose:r})}}s(Ve,"fromQrCode");var Oi=s(e=>({name:"Vpqr",displayName:"VP QR",description:"Allows reading and creating QR codes with Verifiable Presentations in them",methods:{vpFromQrCode:async(t,r)=>(await Ve({text:r,documentLoader:async n=>({document:await e.invoke.contextLoader(n)})}))?.vp,vpToQrCode:async(t,r)=>(await ze({vp:r,documentLoader:async n=>({document:await e.invoke.contextLoader(n)})}))?.imageDataUrl}}),"getVpqrPlugin");
|
3
3
|
/*!
|
4
4
|
* Copyright (c) 2019-2022 Digital Bazaar, Inc. All rights reserved.
|
5
5
|
*/
|
@@ -16,7 +16,7 @@
|
|
16
16
|
* @module QRCode
|
17
17
|
* @package @nuintun/qrcode
|
18
18
|
* @license MIT
|
19
|
-
* @version 3.3.
|
19
|
+
* @version 3.3.5
|
20
20
|
* @author nuintun <nuintun@qq.com>
|
21
21
|
* @description A pure JavaScript QRCode encode and decode library.
|
22
22
|
* @see https://github.com/nuintun/qrcode#readme
|