@learncard/didkit-plugin 1.10.11 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/didkit/didkit_wasm.d.ts +5 -23
- package/dist/didkit/didkit_wasm.js +18 -168
- package/dist/didkit/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit/didkit_wasm_bg.wasm.d.ts +4 -13
- package/dist/didkit/index.d.ts +1 -1
- package/dist/didkit/index.d.ts.map +1 -1
- package/dist/didkit-plugin.cjs.development.cjs +28 -30
- package/dist/didkit-plugin.cjs.development.cjs.map +2 -2
- package/dist/didkit-plugin.cjs.production.min.cjs +2 -2
- package/dist/didkit-plugin.cjs.production.min.cjs.map +3 -3
- package/dist/didkit-plugin.esm.js +28 -30
- package/dist/didkit-plugin.esm.js.map +2 -2
- package/dist/didkit_wasm.d.ts +5 -23
- package/dist/didkit_wasm.js +18 -168
- package/dist/didkit_wasm_bg.wasm +0 -0
- package/dist/didkit_wasm_bg.wasm.d.ts +4 -13
- package/dist/plugin.d.ts +8 -1
- package/dist/plugin.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/didkit/index.ts +13 -20
- package/src/didkit/pkg/didkit_wasm.d.ts +5 -23
- package/src/didkit/pkg/didkit_wasm.js +18 -168
- package/src/didkit/pkg/didkit_wasm_bg.wasm +0 -0
- package/src/didkit/pkg/didkit_wasm_bg.wasm.d.ts +4 -13
- package/src/plugin.ts +9 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
"use strict";var U=Object.defineProperty;var
|
|
2
|
-
${t.stack}`:r}i(Z,"debugString");var ce=typeof FinalizationRegistry>"u"?{register:i(()=>{},"register"),unregister:i(()=>{},"unregister")}:new FinalizationRegistry(t=>{_.__wbindgen_export_3.get(t.dtor)(t.a,t.b)});function se(t,e,n,r){let o={a:t,b:e,cnt:1,dtor:n},s=i((...a)=>{o.cnt++;let d=o.a;o.a=0;try{return r(d,o.b,...a)}finally{--o.cnt===0?(_.__wbindgen_export_3.get(o.dtor)(d,o.b),ce.unregister(o)):o.a=d}},"real");return s.original=o,ce.register(s,o,o),s}i(se,"makeMutClosure");function ae(t,e,n){let r=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),o=b,s=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),a=b,d=f(n,_.__wbindgen_export_0,_.__wbindgen_export_1),g=b,w=_.verifyPresentation(r,o,s,a,d,g);return y(w)}i(ae,"verifyPresentation");function ee(t){let e=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),n=b,r=_.contextLoader(e,n);return y(r)}i(ee,"contextLoader");function ue(){let t=_.clearCache();return y(t)}i(ue,"clearCache");function de(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=_.didResolver(n,r,o,s);return y(a)}i(de,"didResolver");function be(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=_.resolveDID(n,r,o,s);return y(a)}i(be,"resolveDID");function ge(t,e){let n,r;try{let p=_.__wbindgen_add_to_stack_pointer(-16),m=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),E=b,$=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),L=b;_.keyToDID(p,m,E,$,L);var o=l().getInt32(p+0,!0),s=l().getInt32(p+4,!0),a=l().getInt32(p+8,!0),d=l().getInt32(p+12,!0),g=o,w=s;if(d)throw g=0,w=0,y(a);return n=g,r=w,D(g,w)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_4(n,r,1)}}i(ge,"keyToDID");function fe(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=_.keyToVerificationMethod(n,r,o,s);return y(a)}i(fe,"keyToVerificationMethod");function we(t){let e=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),n=b,r=_.didToVerificationMethod(e,n);return y(r)}i(we,"didToVerificationMethod");function le(t,e,n,r){let o=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),d=b,g=f(n,_.__wbindgen_export_0,_.__wbindgen_export_1),w=b,p=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),m=b,E=_.issueCredential(o,s,a,d,g,w,p,m);return y(E)}i(le,"issueCredential");function pe(t,e,n){let r=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),o=b,s=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),a=b,d=f(n,_.__wbindgen_export_0,_.__wbindgen_export_1),g=b,w=_.verifyCredential(r,o,s,a,d,g);return y(w)}i(pe,"verifyCredential");function ye(t,e,n,r){let o=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b,a=f(e,_.__wbindgen_export_0,_.__wbindgen_export_1),d=b,g=f(n,_.__wbindgen_export_0,_.__wbindgen_export_1),w=b,p=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),m=b,E=_.issuePresentation(o,s,a,d,g,w,p,m);return y(E)}i(ye,"issuePresentation");function xe(t,e){let n=e(t.length*1,1)>>>0;return v().set(t,n/1),b=t.length,n}i(xe,"passArray8ToWasm0");function he(t){let e,n;try{let w=_.__wbindgen_add_to_stack_pointer(-16),p=xe(t,_.__wbindgen_export_0),m=b;_.generateEd25519KeyFromBytes(w,p,m);var r=l().getInt32(w+0,!0),o=l().getInt32(w+4,!0),s=l().getInt32(w+8,!0),a=l().getInt32(w+12,!0),d=r,g=o;if(a)throw d=0,g=0,y(s);return e=d,n=g,D(d,g)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_4(e,n,1)}}i(he,"generateEd25519KeyFromBytes");function me(t){let e,n;try{let w=_.__wbindgen_add_to_stack_pointer(-16),p=xe(t,_.__wbindgen_export_0),m=b;_.generateSecp256k1KeyFromBytes(w,p,m);var r=l().getInt32(w+0,!0),o=l().getInt32(w+4,!0),s=l().getInt32(w+8,!0),a=l().getInt32(w+12,!0),d=r,g=o;if(a)throw d=0,g=0,y(s);return e=d,n=g,D(d,g)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_export_4(e,n,1)}}i(me,"generateSecp256k1KeyFromBytes");function P(t,e){let n=e(t.length*4,4)>>>0,r=l();for(let o=0;o<t.length;o++)r.setUint32(n+4*o,u(t[o]),!0);return b=t.length,n}i(P,"passArrayJsValueToWasm0");function De(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=P(e,_.__wbindgen_export_0),s=b,a=_.createJwe(n,r,o,s);return y(a)}i(De,"createJwe");function Ie(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=P(e,_.__wbindgen_export_0),s=b,a=_.decryptJwe(n,r,o,s);return y(a)}i(Ie,"decryptJwe");function Se(t,e){let n=P(e,_.__wbindgen_export_0),r=b,o=_.createDagJwe(u(t),n,r);return y(o)}i(Se,"createDagJwe");function Te(t,e){let n=f(t,_.__wbindgen_export_0,_.__wbindgen_export_1),r=b,o=P(e,_.__wbindgen_export_0),s=b,a=_.decryptDagJwe(n,r,o,s);return y(a)}i(Te,"decryptDagJwe");function Ye(t,e,n){_.__wbindgen_export_5(t,e,u(n))}i(Ye,"__wbg_adapter_6");function Qe(t,e){_.__wbindgen_export_6(t,e)}i(Qe,"__wbg_adapter_19");function Ze(t,e,n,r){_.__wbindgen_export_7(t,e,u(n),u(r))}i(Ze,"__wbg_adapter_107");var et=["default","no-store","reload","no-cache","force-cache","only-if-cached"],tt=["omit","same-origin","include"],nt=["same-origin","no-cors","cors","navigate"],rt=new Set(["basic","cors","default"]);async function ot(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.ok&&rt.has(t.type)&&t.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{let n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}i(ot,"__wbg_load");function _t(){let t={};return t.wbg={},t.wbg.__wbg_Error_e17e777aac105295=function(e,n){let r=Error(D(e,n));return u(r)},t.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){let r=String(c(n)),o=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b;l().setInt32(e+4,s,!0),l().setInt32(e+0,o,!0)},t.wbg.__wbg_abort_67e1b49bf6614565=function(e){c(e).abort()},t.wbg.__wbg_abort_d830bf2e9aa6ec5b=function(e,n){c(e).abort(c(n))},t.wbg.__wbg_append_72a3c0addd2bce38=function(){return x(function(e,n,r,o,s){c(e).append(D(n,r),D(o,s))},arguments)},t.wbg.__wbg_arrayBuffer_9c99b8e2809e8cbb=function(){return x(function(e){let n=c(e).arrayBuffer();return u(n)},arguments)},t.wbg.__wbg_call_13410aac570ffff7=function(){return x(function(e,n){let r=c(e).call(c(n));return u(r)},arguments)},t.wbg.__wbg_call_a5400b25a865cfd8=function(){return x(function(e,n,r){let o=c(e).call(c(n),c(r));return u(o)},arguments)},t.wbg.__wbg_clearTimeout_42d9ccd50822fd3a=function(e){let n=clearTimeout(y(e));return u(n)},t.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){let n=c(e).crypto;return u(n)},t.wbg.__wbg_done_75ed0ee6dd243d9d=function(e){return c(e).done},t.wbg.__wbg_entries_2be2f15bd5554996=function(e){let n=Object.entries(c(e));return u(n)},t.wbg.__wbg_fetch_6bbc32f991730587=function(e){let n=fetch(c(e));return u(n)},t.wbg.__wbg_fetch_87aed7f306ec6d63=function(e,n){let r=c(e).fetch(c(n));return u(r)},t.wbg.__wbg_from_88bc52ce20ba6318=function(e){let n=Array.from(c(e));return u(n)},t.wbg.__wbg_getRandomValues_1c61fac11405ffdc=function(){return x(function(e,n){globalThis.crypto.getRandomValues(O(e,n))},arguments)},t.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return x(function(e,n){c(e).getRandomValues(c(n))},arguments)},t.wbg.__wbg_getTime_6bb3f64e0f18f817=function(e){return c(e).getTime()},t.wbg.__wbg_get_0da715ceaecea5c8=function(e,n){let r=c(e)[n>>>0];return u(r)},t.wbg.__wbg_get_458e874b43b18b25=function(){return x(function(e,n){let r=Reflect.get(c(e),c(n));return u(r)},arguments)},t.wbg.__wbg_has_b89e451f638123e3=function(){return x(function(e,n){return Reflect.has(c(e),c(n))},arguments)},t.wbg.__wbg_headers_29fec3c72865cd75=function(e){let n=c(e).headers;return u(n)},t.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd=function(e){let n;try{n=c(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_instanceof_Map_ebb01a5b6b5ffd0b=function(e){let n;try{n=c(e)instanceof Map}catch{n=!1}return n},t.wbg.__wbg_instanceof_Response_50fde2cd696850bf=function(e){let n;try{n=c(e)instanceof Response}catch{n=!1}return n},t.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7=function(e){let n;try{n=c(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_isArray_030cce220591fb41=function(e){return Array.isArray(c(e))},t.wbg.__wbg_isSafeInteger_1c0d1af5542e102a=function(e){return Number.isSafeInteger(c(e))},t.wbg.__wbg_iterator_f370b34483c71a1c=function(){return u(Symbol.iterator)},t.wbg.__wbg_keys_ef52390b2ae0e714=function(e){let n=Object.keys(c(e));return u(n)},t.wbg.__wbg_length_186546c51cd61acd=function(e){return c(e).length},t.wbg.__wbg_length_6bb7e81f9d7713e4=function(e){return c(e).length},t.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){let n=c(e).msCrypto;return u(n)},t.wbg.__wbg_new0_b0a0a38c201e6df5=function(){return u(new Date)},t.wbg.__wbg_new_19c25a3f2fa63a02=function(){let e=new Object;return u(e)},t.wbg.__wbg_new_1f3a344cf3123716=function(){let e=new Array;return u(e)},t.wbg.__wbg_new_2e3c58a15f39f5f9=function(e,n){try{var r={a:e,b:n},o=i((a,d)=>{let g=r.a;r.a=0;try{return Ze(g,r.b,a,d)}finally{r.a=g}},"cb0");let s=new Promise(o);return u(s)}finally{r.a=r.b=0}},t.wbg.__wbg_new_2ff1f68f3676ea53=function(){return u(new Map)},t.wbg.__wbg_new_638ebfaedbf32a5e=function(e){let n=new Uint8Array(c(e));return u(n)},t.wbg.__wbg_new_66b9434b4e59b63e=function(){return x(function(){let e=new AbortController;return u(e)},arguments)},t.wbg.__wbg_new_f6e53210afea8e45=function(){return x(function(){let e=new Headers;return u(e)},arguments)},t.wbg.__wbg_newfromslice_074c56947bd43469=function(e,n){let r=new Uint8Array(O(e,n));return u(r)},t.wbg.__wbg_newnoargs_254190557c45b4ec=function(e,n){let r=new Function(D(e,n));return u(r)},t.wbg.__wbg_newwithlength_a167dcc7aaa3ba77=function(e){let n=new Uint8Array(e>>>0);return u(n)},t.wbg.__wbg_newwithstrandinit_b5d168a29a3fd85f=function(){return x(function(e,n,r){let o=new Request(D(e,n),c(r));return u(o)},arguments)},t.wbg.__wbg_next_5b3530e612fde77d=function(e){let n=c(e).next;return u(n)},t.wbg.__wbg_next_692e82279131b03c=function(){return x(function(e){let n=c(e).next();return u(n)},arguments)},t.wbg.__wbg_node_905d3e251edff8a2=function(e){let n=c(e).node;return u(n)},t.wbg.__wbg_now_886b39d7ec380719=function(e){return c(e).now()},t.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){let n=c(e).process;return u(n)},t.wbg.__wbg_prototypesetcall_3d4a26c1ed734349=function(e,n,r){Uint8Array.prototype.set.call(O(e,n),c(r))},t.wbg.__wbg_push_330b2eb93e4e1212=function(e,n){return c(e).push(c(n))},t.wbg.__wbg_queueMicrotask_25d0739ac89e8c88=function(e){queueMicrotask(c(e))},t.wbg.__wbg_queueMicrotask_4488407636f5bf24=function(e){let n=c(e).queueMicrotask;return u(n)},t.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return x(function(e,n){c(e).randomFillSync(y(n))},arguments)},t.wbg.__wbg_require_60cc747a6bc5215a=function(){return x(function(){let e=module.require;return u(e)},arguments)},t.wbg.__wbg_resolve_4055c623acdd6a1b=function(e){let n=Promise.resolve(c(e));return u(n)},t.wbg.__wbg_setTimeout_4ec014681668a581=function(e,n){let r=setTimeout(c(e),n);return u(r)},t.wbg.__wbg_set_1353b2a5e96bc48c=function(e,n,r){c(e).set(O(n,r))},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,r){c(e)[y(n)]=y(r)},t.wbg.__wbg_set_453345bcda80b89a=function(){return x(function(e,n,r){return Reflect.set(c(e),c(n),c(r))},arguments)},t.wbg.__wbg_set_90f6c0f7bd8c0415=function(e,n,r){c(e)[n>>>0]=y(r)},t.wbg.__wbg_set_b7f1cf4fae26fe2a=function(e,n,r){let o=c(e).set(c(n),c(r));return u(o)},t.wbg.__wbg_setbody_c8460bdf44147df8=function(e,n){c(e).body=c(n)},t.wbg.__wbg_setcache_90ca4ad8a8ad40d3=function(e,n){c(e).cache=et[n]},t.wbg.__wbg_setcredentials_9cd60d632c9d5dfc=function(e,n){c(e).credentials=tt[n]},t.wbg.__wbg_setheaders_0052283e2f3503d1=function(e,n){c(e).headers=c(n)},t.wbg.__wbg_setmethod_9b504d5b855b329c=function(e,n,r){c(e).method=D(n,r)},t.wbg.__wbg_setmode_a23e1a2ad8b512f8=function(e,n){c(e).mode=nt[n]},t.wbg.__wbg_setsignal_8c45ad1247a74809=function(e,n){c(e).signal=c(n)},t.wbg.__wbg_signal_da4d466ce86118b5=function(e){let n=c(e).signal;return u(n)},t.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12=function(){let e=typeof global>"u"?null:global;return I(e)?0:u(e)},t.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184=function(){let e=typeof globalThis>"u"?null:globalThis;return I(e)?0:u(e)},t.wbg.__wbg_static_accessor_SELF_995b214ae681ff99=function(){let e=typeof self>"u"?null:self;return I(e)?0:u(e)},t.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea=function(){let e=typeof window>"u"?null:window;return I(e)?0:u(e)},t.wbg.__wbg_status_3fea3036088621d6=function(e){return c(e).status},t.wbg.__wbg_stringify_b98c93d0a190446a=function(){return x(function(e){let n=JSON.stringify(c(e));return u(n)},arguments)},t.wbg.__wbg_subarray_70fd07feefe14294=function(e,n,r){let o=c(e).subarray(n>>>0,r>>>0);return u(o)},t.wbg.__wbg_then_b33a773d723afa3e=function(e,n,r){let o=c(e).then(c(n),c(r));return u(o)},t.wbg.__wbg_then_e22500defe16819f=function(e,n){let r=c(e).then(c(n));return u(r)},t.wbg.__wbg_url_e5720dfacf77b05e=function(e,n){let r=c(n).url,o=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b;l().setInt32(e+4,s,!0),l().setInt32(e+0,o,!0)},t.wbg.__wbg_value_dd9372230531eade=function(e){let n=c(e).value;return u(n)},t.wbg.__wbg_versions_c01dfd4722a88165=function(e){let n=c(e).versions;return u(n)},t.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1=function(e,n){let r=c(n),o=typeof r=="bigint"?r:void 0;l().setBigInt64(e+8,I(o)?BigInt(0):o,!0),l().setInt32(e+0,!I(o),!0)},t.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746=function(e){let n=c(e),r=typeof n=="boolean"?n:void 0;return I(r)?16777215:r?1:0},t.wbg.__wbg_wbindgencbdrop_eb10308566512b88=function(e){let n=c(e).original;return n.cnt--==1?(n.a=0,!0):!1},t.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d=function(e,n){let r=Z(c(n)),o=f(r,_.__wbindgen_export_0,_.__wbindgen_export_1),s=b;l().setInt32(e+4,s,!0),l().setInt32(e+0,o,!0)},t.wbg.__wbg_wbindgenin_d7a1ee10933d2d55=function(e,n){return c(e)in c(n)},t.wbg.__wbg_wbindgenisbigint_ecb90cc08a5a9154=function(e){return typeof c(e)=="bigint"},t.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74=function(e){return typeof c(e)=="function"},t.wbg.__wbg_wbindgenisnull_f3037694abe4d97a=function(e){return c(e)===null},t.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8=function(e){let n=c(e);return typeof n=="object"&&n!==null},t.wbg.__wbg_wbindgenisstring_d4fa939789f003b0=function(e){return typeof c(e)=="string"},t.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5=function(e){return c(e)===void 0},t.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58=function(e,n){return c(e)===c(n)},t.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1=function(e,n){return c(e)==c(n)},t.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb=function(e,n){let r=c(n),o=typeof r=="number"?r:void 0;l().setFloat64(e+8,I(o)?0:o,!0),l().setInt32(e+0,!I(o),!0)},t.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f=function(e,n){let r=c(n),o=typeof r=="string"?r:void 0;var s=I(o)?0:f(o,_.__wbindgen_export_0,_.__wbindgen_export_1),a=b;l().setInt32(e+4,a,!0),l().setInt32(e+0,s,!0)},t.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6=function(e,n){throw new Error(D(e,n))},t.wbg.__wbindgen_cast_1eaafab1968e741d=function(e,n){let r=se(e,n,639,Qe);return u(r)},t.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,n){let r=D(e,n);return u(r)},t.wbg.__wbindgen_cast_2ddd8a25ff58642a=function(e,n){let r=BigInt.asUintN(64,e)|n<<BigInt(64);return u(r)},t.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){let n=BigInt.asUintN(64,e);return u(n)},t.wbg.__wbindgen_cast_67d14185bb436b4e=function(e,n){let r=se(e,n,726,Ye);return u(r)},t.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return u(e)},t.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,n){let r=O(e,n);return u(r)},t.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return u(e)},t.wbg.__wbindgen_object_clone_ref=function(e){let n=c(e);return u(n)},t.wbg.__wbindgen_object_drop_ref=function(e){y(e)},t}i(_t,"__wbg_get_imports");function it(t,e){return _=t.exports,Ee.__wbindgen_wasm_module=e,C=null,M=null,_}i(it,"__wbg_finalize_init");async function Ee(t){if(_!==void 0)return _;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("didkit_wasm_bg.wasm",ct.url));let e=_t();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:r}=await ot(await t,e);return it(n,r)}i(Ee,"__wbg_init");var Ce=Ee;var st="https://assets.learncard.ai/didkit/sha256-ba3e2ec2208f6da57d94e47c332b3226f048e11d7a23093d50b184d849b6bc0b/didkit_wasm_bg.wasm",ve=!1,B=!1,at=i(async(t=st)=>{for(;B;)await new Promise(e=>setTimeout(e,250));if(!ve)try{B=!0,await Ce({module_or_path:t}),B=!1,ve=!0}catch(e){throw B=!1,e}},"init"),Re=at;var Ae=i(t=>{let e=[],n=i(r=>{if(typeof r!="object"||r===null)return;let o="@context"in r?r["@context"]:void 0;for(let s of Array.isArray(o)?o:[o])typeof s=="string"&&e.push(s);Object.values(r).forEach(n)},"traverse");return n(t),e},"getContextURIs"),R=i(async(t,e,n=!1)=>{let r=Ae(e),o=await Promise.all(r.map(async s=>t.context.resolveDocument(s,n)));return r.reduce((s,a,d)=>{let g=o[d];return g&&(s[a]=JSON.stringify(g)),s},{})},"getDocumentMap");var Ne=1e4,ke=6e4,We=64,Fe=new Set([101,204,205,304]),j=!1,K,W=1e4,te=64,A=0,h=new Map,T=new Map,ne=new Map,re=i(t=>new URL(t).href,"normalizeAbsoluteUrl"),ut=i(t=>{let e=[];return t.forEach((n,r)=>{e.push([r.toLowerCase(),n])}),e.sort((n,r)=>n[0]<r[0]?-1:n[0]>r[0]?1:n[1]<r[1]?-1:n[1]>r[1]?1:0),e},"headersToSortedTuples"),dt=i((t,e)=>new Request(t,e),"normalizeRequest"),bt=i(t=>({method:t.method.toUpperCase(),url:re(t.url),headers:ut(t.headers),credentials:t.credentials,mode:t.mode,cache:t.cache,redirect:t.redirect,referrerPolicy:t.referrerPolicy}),"describeSemanticsFromRequest"),gt=i(t=>JSON.stringify([t.method,t.url,t.headers,t.credentials,t.mode,t.cache,t.redirect,t.referrerPolicy]),"semanticsKey"),ft=i((t,e)=>new Request(t,{signal:e}),"sharedNetworkRequest"),wt=i(t=>typeof t=="string"?t:t instanceof URL?t.href:t.url,"peekRequestUrl"),lt=i((t,e)=>e?.method?e.method.toUpperCase():t instanceof Request?t.method.toUpperCase():"GET","peekMethod"),pt=i((t,e)=>typeof e?.integrity=="string"&&e.integrity.length>0||t instanceof Request&&t.integrity.length>0,"peekHasIntegrity"),yt=i((t,e)=>e?.cache?e.cache:t instanceof Request?t.cache:"default","peekCacheMode"),xt=i(t=>{try{let e=new URL(t).pathname;return e==="/did.json"||e.endsWith("/did.json")}catch{let e=t.split(/[?#]/,1)[0]??t;return e==="did.json"||e.endsWith("/did.json")}},"peekIsDidWebDocumentUrl"),G=i(t=>{try{let e=new URL(t).pathname;return e==="/did.json"||e.endsWith("/did.json")}catch{return!1}},"isDidWebDocumentUrl"),oe=i(t=>{if(!t.startsWith("did:web:"))return;let e=t.slice(8).split(":"),n=e[0];if(!n)return;let r=n.replace(/%3A/gi,":"),o=e.length>1?e.slice(1).join("/"):".well-known",s=r.startsWith("localhost")?"http":"https";try{return re(`${s}://${r}/${o}/did.json`)}catch{return}},"didWebToDocumentUrl"),V=i(t=>ne.get(t)??0,"getUrlGeneration"),ht=i(t=>{ne.set(t,V(t)+1);for(let e of[...T.keys()])try{JSON.parse(e)[1]===t&&T.delete(e)}catch{}},"bumpUrlGeneration"),mt=i(t=>{let e=[];return t.forEach((n,r)=>{e.push([r,n])}),e},"headersToTuples"),Dt=i(t=>{let e=t.get("cache-control");if(!e)return;let n=e.toLowerCase().split(",").map(r=>r.trim());if(n.some(r=>r==="no-store"||r==="no-cache"))return 0;for(let r of n){let o=/^max-age=(\d+)$/.exec(r);if(o)return Number(o[1])*1e3}},"parseCacheControlMaxAgeMs"),Je=i(t=>{let e=t.body===null||Fe.has(t.status)?null:t.body.slice(0),n=new Response(e,{status:t.status,statusText:t.statusText,headers:t.headers});try{Object.defineProperty(n,"url",{value:t.url,writable:!1,enumerable:!0,configurable:!0})}catch{}return n},"storedToResponse"),It=i(async(t,e,n)=>{let r=Fe.has(t.status)?null:await t.arrayBuffer();return{expiresAt:Date.now()+e,status:t.status,statusText:t.statusText,headers:mt(t.headers),body:r,url:t.url||n}},"readResponse"),St=i((t=Date.now())=>{for(let[e,n]of h)n.expiresAt<=t&&h.delete(e)},"sweepExpired"),Le=i((t,e)=>{for(h.delete(t),h.set(t,e);h.size>te;){let n=h.keys().next().value;if(n===void 0)break;h.delete(n)}},"touchLru"),Tt=i((t,e=Date.now())=>{St(e);let n=h.get(t);if(n){if(n.expiresAt<=e){h.delete(t);return}return Le(t,n),n}},"getFreshSuccess"),z=i(()=>{if(typeof DOMException=="function")return new DOMException("The operation was aborted.","AbortError");let t=new Error("The operation was aborted.");return t.name="AbortError",t},"abortError"),Et=i(t=>new Promise((e,n)=>{if(t.aborted){n(z());return}t.addEventListener("abort",()=>n(z()),{once:!0})}),"waitForAbort"),Ct=i((t,e)=>{e.waiters-=1,!(e.waiters>0)&&(T.get(t)===e&&T.delete(t),e.controller.signal.aborted||e.controller.abort())},"releaseInflightWaiter");async function Oe(t,e,n){e.waiters+=1;try{if(n?.aborted)throw z();let r=n?await Promise.race([e.promise,Et(n)]):await e.promise;return Je(r)}finally{Ct(t,e)}}i(Oe,"joinInflight");var Me=i(t=>t==="no-store"||t==="reload"||t==="no-cache","shouldBypassRequestCacheMode");async function vt(t,e){let n=K;if(!n){if(typeof globalThis.fetch!="function")throw new TypeError("globalThis.fetch is not available");return globalThis.fetch(t,e)}if(pt(t,e)||lt(t,e)!=="GET"||!xt(wt(t))||Me(yt(t,e)))return n(t,e);let r;try{r=dt(t,e)}catch{return n(t,e)}let o=bt(r);if(o.method!=="GET"||!G(o.url)||Me(o.cache))return n(t,e);let s=r.signal;if(s.aborted)throw z();let a=gt(o),d=Tt(a);if(d)return Je(d);let g=T.get(a);if(g&&g.generation===A)return Oe(a,g,s);let w=A,p=V(o.url),m=new AbortController,E=ft(r,m.signal),$=(async()=>{let X=await n(E),Y=Dt(X.headers),_e=Y===void 0?W:Math.max(0,Math.min(W,Y)),ie=await It(X,_e||W,o.url),Pe=w===A&&p===V(o.url);return X.ok&&Y!==0&&_e>0&&Pe&&w===A&&p===V(o.url)&&Le(a,ie),ie})(),L={generation:w,controller:m,promise:$,waiters:0,semanticsKey:a};return T.set(a,L),Oe(a,L,s)}i(vt,"cachedFetch");var F=i((t={})=>{if(typeof globalThis.fetch!="function")throw new TypeError("installDidWebDocumentFetchCache requires globalThis.fetch; none is available");typeof t.ttlMs=="number"&&t.ttlMs>0&&(W=t.ttlMs),typeof t.maxEntries=="number"&&t.maxEntries>0&&(te=t.maxEntries),!(j&&!t.force)&&(j&&t.force&&K&&(globalThis.fetch=K),K=globalThis.fetch.bind(globalThis),globalThis.fetch=vt,j=!0)},"installDidWebDocumentFetchCache"),Ue=i(()=>{F({ttlMs:6e4})},"installWalletDidWebDocumentFetchCache"),H=i(()=>{A+=1,h.clear(),T.clear(),ne.clear()},"clearDidWebDocumentFetchCache"),J=i(t=>{let e=t.startsWith("did:")?oe(t):G(t)?t:void 0;if(!e)return;let n;try{n=re(e)}catch{return}for(let r of[...h.keys()])try{JSON.parse(r)[1]===n&&h.delete(r)}catch{}ht(n)},"invalidateDidWebDocument"),qe=i(()=>({installed:j,ttlMs:W,maxEntries:te,successEntries:h.size,inflightEntries:T.size,cacheGeneration:A}),"getDidWebDocumentFetchCacheStats");var Rt=i(async(t,e=!1)=>{F(),await Re(t);let n={};return{name:"DIDKit",displayName:"DIDKit",description:"Provides an interface to DIDKit, which allows for the generation of key material, as well as signing and verifying credentials and presentations",context:{resolveStaticDocument:i(async(r,o)=>{if(typeof o=="string")try{return JSON.parse(await ee(o)??"")||void 0}catch(s){r.debug?.(s);return}},"resolveStaticDocument")},methods:{generateEd25519KeyFromBytes:i((r,o)=>JSON.parse(he(o)),"generateEd25519KeyFromBytes"),generateSecp256k1KeyFromBytes:i((r,o)=>JSON.parse(me(o)),"generateSecp256k1KeyFromBytes"),keyToDid:i((r,o,s)=>ge(o,JSON.stringify(s)),"keyToDid"),keyToVerificationMethod:i(async(r,o,s)=>fe(o,JSON.stringify(s)),"keyToVerificationMethod"),didToVerificationMethod:i(async(r,o)=>we(o),"didToVerificationMethod"),issueCredential:i(async(r,o,s,a)=>JSON.parse(await le(JSON.stringify(o),JSON.stringify(s),JSON.stringify(a),JSON.stringify(await R(r,o,e)))),"issueCredential"),verifyCredential:i(async(r,o,s={})=>JSON.parse(await pe(JSON.stringify(o),JSON.stringify(s),JSON.stringify(await R(r,o,e)))),"verifyCredential"),issuePresentation:i(async(r,o,s,a)=>{let d=s.proofFormat==="jwt",g=await ye(JSON.stringify(o),JSON.stringify(s),JSON.stringify(a),JSON.stringify(await R(r,o,e)));return d?g:JSON.parse(g)},"issuePresentation"),verifyPresentation:i(async(r,o,s={})=>{let a=typeof o=="string";return JSON.parse(await ae(a?o:JSON.stringify(o),JSON.stringify(s),a?"{}":JSON.stringify(await R(r,o,e))))},"verifyPresentation"),contextLoader:i(async(r,o)=>{if(typeof o=="string")try{return JSON.parse(await ee(o)??"")||void 0}catch(s){r.debug?.(s);return}},"contextLoader"),resolveDid:i(async(r,o,s={})=>(s.noCache&&J(o),JSON.parse(await be(o,JSON.stringify(s)))),"resolveDid"),didResolver:i(async(r,o,s={})=>(s.noCache&&J(o),JSON.parse(await de(o,JSON.stringify(s)))),"didResolver"),createJwe:i(async(r,o,s)=>JSON.parse(await De(o,s)),"createJwe"),decryptJwe:i(async(r,o,s)=>Ie(JSON.stringify(o),s.map(a=>JSON.stringify(a))),"decryptJwe"),createDagJwe:i(async(r,o,s)=>JSON.parse(await Se(o,s)),"createDagJwe"),decryptDagJwe:i(async(r,o,s)=>{let a=i(d=>{if(d==null)return d;if(typeof d=="bigint")return Number(d);if(Array.isArray(d))return d.map(a);if(typeof d!="object"||!Object.values(d).some(p=>typeof p=="bigint"||typeof p=="object"&&p!==null))return d;let w={};for(let p in d)w[p]=a(d[p]);return w},"convertBigIntsToNumbers");return a(await Te(JSON.stringify(o),s.map(d=>JSON.stringify(d))))},"decryptDagJwe"),clearDidWebCache:i(async()=>{H(),await ue()},"clearDidWebCache")}}},"getDidKitPlugin");
|
|
1
|
+
"use strict";var U=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Be=Object.getOwnPropertyNames;var je=Object.prototype.hasOwnProperty;var i=(t,e)=>U(t,"name",{value:e,configurable:!0});var Ke=(t,e)=>{for(var n in e)U(t,n,{get:e[n],enumerable:!0})},Ve=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Be(e))!je.call(t,o)&&o!==n&&U(t,o,{get:()=>e[o],enumerable:!(r=qe(e,o))||r.enumerable});return t};var ze=t=>Ve(U({},"__esModule",{value:!0}),t);var Ot={};Ke(Ot,{DEFAULT_DID_WEB_DOCUMENT_CACHE_MAX_ENTRIES:()=>We,DEFAULT_DID_WEB_DOCUMENT_TTL_MS:()=>Me,WALLET_DID_WEB_DOCUMENT_TTL_MS:()=>Ne,clearDidWebDocumentFetchCache:()=>G,didWebToDocumentUrl:()=>ie,getContextURIs:()=>Ae,getDidKitPlugin:()=>At,getDidWebDocumentFetchCacheStats:()=>Ue,getDocumentMap:()=>A,initDidKit:()=>Ct,installDidWebDocumentFetchCache:()=>F,installWalletDidWebDocumentFetchCache:()=>Le,invalidateDidWebDocument:()=>J,isDidWebDocumentUrl:()=>z});module.exports=ze(Ot);var st={};var s,M=null;function C(){return(M===null||M.byteLength===0)&&(M=new Uint8Array(s.memory.buffer)),M}i(C,"getUint8ArrayMemory0");var P=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});P.decode();var Ge=2146435072,Y=0;function He(t,e){return Y+=e,Y>=Ge&&(P=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),P.decode(),Y=e),P.decode(C().subarray(t,t+e))}i(He,"decodeText");function D(t,e){return t=t>>>0,He(t,e)}i(D,"getStringFromWasm0");var S=new Array(128).fill(void 0);S.push(void 0,null,!0,!1);var N=S.length;function u(t){N===S.length&&S.push(S.length+1);let e=N;return N=S[e],S[e]=t,e}i(u,"addHeapObject");function c(t){return S[t]}i(c,"getObject");var f=0,W=new TextEncoder;"encodeInto"in W||(W.encodeInto=function(t,e){let n=W.encode(t);return e.set(n),{read:t.length,written:n.length}});function b(t,e,n){if(n===void 0){let d=W.encode(t),g=e(d.length,1)>>>0;return C().subarray(g,g+d.length).set(d),f=d.length,g}let r=t.length,o=e(r,1)>>>0,_=C(),a=0;for(;a<r;a++){let d=t.charCodeAt(a);if(d>127)break;_[o+a]=d}if(a!==r){a!==0&&(t=t.slice(a)),o=n(o,r,r=a+t.length*3,1)>>>0;let d=C().subarray(o+a,o+r),g=W.encodeInto(t,d);a+=g.written,o=n(o,r,a,1)>>>0}return f=a,o}i(b,"passStringToWasm0");var R=null;function l(){return(R===null||R.buffer.detached===!0||R.buffer.detached===void 0&&R.buffer!==s.memory.buffer)&&(R=new DataView(s.memory.buffer)),R}i(l,"getDataViewMemory0");function h(t,e){try{return t.apply(this,e)}catch(n){s.__wbindgen_export_2(u(n))}}i(h,"handleError");function $e(t){t<132||(S[t]=N,N=t)}i($e,"dropObject");function y(t){let e=c(t);return $e(t),e}i(y,"takeObject");function v(t,e){return t=t>>>0,C().subarray(t/1,t/1+e)}i(v,"getArrayU8FromWasm0");function I(t){return t==null}i(I,"isLikeNone");function Q(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let o=t.description;return o==null?"Symbol":`Symbol(${o})`}if(e=="function"){let o=t.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(t)){let o=t.length,_="[";o>0&&(_+=Q(t[0]));for(let a=1;a<o;a++)_+=", "+Q(t[a]);return _+="]",_}let n=/\[object ([^\]]+)\]/.exec(toString.call(t)),r;if(n&&n.length>1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
|
|
2
|
+
${t.stack}`:r}i(Q,"debugString");var _e=typeof FinalizationRegistry>"u"?{register:i(()=>{},"register"),unregister:i(()=>{},"unregister")}:new FinalizationRegistry(t=>{s.__wbindgen_export_3.get(t.dtor)(t.a,t.b)});function ae(t,e,n,r){let o={a:t,b:e,cnt:1,dtor:n},_=i((...a)=>{o.cnt++;let d=o.a;o.a=0;try{return r(d,o.b,...a)}finally{--o.cnt===0?(s.__wbindgen_export_3.get(o.dtor)(d,o.b),_e.unregister(o)):o.a=d}},"real");return _.original=o,_e.register(_,o,o),_}i(ae,"makeMutClosure");function ue(t,e,n){let r=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),o=f,_=b(e,s.__wbindgen_export_0,s.__wbindgen_export_1),a=f,d=b(n,s.__wbindgen_export_0,s.__wbindgen_export_1),g=f,w=s.verifyPresentation(r,o,_,a,d,g);return y(w)}i(ue,"verifyPresentation");function Z(t){let e=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),n=f,r=s.contextLoader(e,n);return y(r)}i(Z,"contextLoader");function de(){let t=s.clearCache();return y(t)}i(de,"clearCache");function fe(t,e){let n=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),r=f,o=b(e,s.__wbindgen_export_0,s.__wbindgen_export_1),_=f,a=s.didResolver(n,r,o,_);return y(a)}i(fe,"didResolver");function ge(t,e){let n=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),r=f,o=b(e,s.__wbindgen_export_0,s.__wbindgen_export_1),_=f,a=s.resolveDID(n,r,o,_);return y(a)}i(ge,"resolveDID");function be(t,e){let n,r;try{let p=s.__wbindgen_add_to_stack_pointer(-16),x=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),E=f,H=b(e,s.__wbindgen_export_0,s.__wbindgen_export_1),L=f;s.keyToDID(p,x,E,H,L);var o=l().getInt32(p+0,!0),_=l().getInt32(p+4,!0),a=l().getInt32(p+8,!0),d=l().getInt32(p+12,!0),g=o,w=_;if(d)throw g=0,w=0,y(a);return n=g,r=w,D(g,w)}finally{s.__wbindgen_add_to_stack_pointer(16),s.__wbindgen_export_4(n,r,1)}}i(be,"keyToDID");function we(t,e){let n=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),r=f,o=b(e,s.__wbindgen_export_0,s.__wbindgen_export_1),_=f,a=s.keyToVerificationMethod(n,r,o,_);return y(a)}i(we,"keyToVerificationMethod");function le(t){let e=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),n=f,r=s.didToVerificationMethod(e,n);return y(r)}i(le,"didToVerificationMethod");function pe(t,e,n,r){let o=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),_=f,a=b(e,s.__wbindgen_export_0,s.__wbindgen_export_1),d=f,g=b(n,s.__wbindgen_export_0,s.__wbindgen_export_1),w=f,p=b(r,s.__wbindgen_export_0,s.__wbindgen_export_1),x=f,E=s.issueCredential(o,_,a,d,g,w,p,x);return y(E)}i(pe,"issueCredential");function ye(t,e,n){let r=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),o=f,_=b(e,s.__wbindgen_export_0,s.__wbindgen_export_1),a=f,d=b(n,s.__wbindgen_export_0,s.__wbindgen_export_1),g=f,w=s.verifyCredential(r,o,_,a,d,g);return y(w)}i(ye,"verifyCredential");function he(t,e,n,r){let o=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),_=f,a=b(e,s.__wbindgen_export_0,s.__wbindgen_export_1),d=f,g=b(n,s.__wbindgen_export_0,s.__wbindgen_export_1),w=f,p=b(r,s.__wbindgen_export_0,s.__wbindgen_export_1),x=f,E=s.issuePresentation(o,_,a,d,g,w,p,x);return y(E)}i(he,"issuePresentation");function me(t,e){let n=e(t.length*1,1)>>>0;return C().set(t,n/1),f=t.length,n}i(me,"passArray8ToWasm0");function xe(t){let e,n;try{let w=s.__wbindgen_add_to_stack_pointer(-16),p=me(t,s.__wbindgen_export_0),x=f;s.generateEd25519KeyFromBytes(w,p,x);var r=l().getInt32(w+0,!0),o=l().getInt32(w+4,!0),_=l().getInt32(w+8,!0),a=l().getInt32(w+12,!0),d=r,g=o;if(a)throw d=0,g=0,y(_);return e=d,n=g,D(d,g)}finally{s.__wbindgen_add_to_stack_pointer(16),s.__wbindgen_export_4(e,n,1)}}i(xe,"generateEd25519KeyFromBytes");function De(t){let e,n;try{let w=s.__wbindgen_add_to_stack_pointer(-16),p=me(t,s.__wbindgen_export_0),x=f;s.generateSecp256k1KeyFromBytes(w,p,x);var r=l().getInt32(w+0,!0),o=l().getInt32(w+4,!0),_=l().getInt32(w+8,!0),a=l().getInt32(w+12,!0),d=r,g=o;if(a)throw d=0,g=0,y(_);return e=d,n=g,D(d,g)}finally{s.__wbindgen_add_to_stack_pointer(16),s.__wbindgen_export_4(e,n,1)}}i(De,"generateSecp256k1KeyFromBytes");function q(t,e){let n=e(t.length*4,4)>>>0,r=l();for(let o=0;o<t.length;o++)r.setUint32(n+4*o,u(t[o]),!0);return f=t.length,n}i(q,"passArrayJsValueToWasm0");function Ie(t,e){let n=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),r=f,o=q(e,s.__wbindgen_export_0),_=f,a=s.createJwe(n,r,o,_);return y(a)}i(Ie,"createJwe");function Se(t,e){let n=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),r=f,o=q(e,s.__wbindgen_export_0),_=f,a=s.decryptJwe(n,r,o,_);return y(a)}i(Se,"decryptJwe");function Te(t,e){let n=q(e,s.__wbindgen_export_0),r=f,o=s.createDagJwe(u(t),n,r);return y(o)}i(Te,"createDagJwe");function Ee(t,e){let n=b(t,s.__wbindgen_export_0,s.__wbindgen_export_1),r=f,o=q(e,s.__wbindgen_export_0),_=f,a=s.decryptDagJwe(n,r,o,_);return y(a)}i(Ee,"decryptDagJwe");function Xe(t,e){s.__wbindgen_export_5(t,e)}i(Xe,"__wbg_adapter_12");function Ye(t,e,n){s.__wbindgen_export_6(t,e,u(n))}i(Ye,"__wbg_adapter_17");function Qe(t,e,n,r){s.__wbindgen_export_7(t,e,u(n),u(r))}i(Qe,"__wbg_adapter_98");var Ze=["default","no-store","reload","no-cache","force-cache","only-if-cached"],et=["omit","same-origin","include"],tt=["same-origin","no-cors","cors","navigate"],nt=new Set(["basic","cors","default"]);async function rt(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.ok&&nt.has(t.type)&&t.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{let n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}i(rt,"__wbg_load");function ot(){let t={};return t.wbg={},t.wbg.__wbg_Error_e17e777aac105295=function(e,n){let r=Error(D(e,n));return u(r)},t.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){let r=String(c(n)),o=b(r,s.__wbindgen_export_0,s.__wbindgen_export_1),_=f;l().setInt32(e+4,_,!0),l().setInt32(e+0,o,!0)},t.wbg.__wbg_abort_67e1b49bf6614565=function(e){c(e).abort()},t.wbg.__wbg_abort_d830bf2e9aa6ec5b=function(e,n){c(e).abort(c(n))},t.wbg.__wbg_append_72a3c0addd2bce38=function(){return h(function(e,n,r,o,_){c(e).append(D(n,r),D(o,_))},arguments)},t.wbg.__wbg_arrayBuffer_9c99b8e2809e8cbb=function(){return h(function(e){let n=c(e).arrayBuffer();return u(n)},arguments)},t.wbg.__wbg_call_13410aac570ffff7=function(){return h(function(e,n){let r=c(e).call(c(n));return u(r)},arguments)},t.wbg.__wbg_call_a5400b25a865cfd8=function(){return h(function(e,n,r){let o=c(e).call(c(n),c(r));return u(o)},arguments)},t.wbg.__wbg_clearTimeout_42d9ccd50822fd3a=function(e){let n=clearTimeout(y(e));return u(n)},t.wbg.__wbg_crypto_574e78ad8b13b65f=function(e){let n=c(e).crypto;return u(n)},t.wbg.__wbg_done_75ed0ee6dd243d9d=function(e){return c(e).done},t.wbg.__wbg_entries_2be2f15bd5554996=function(e){let n=Object.entries(c(e));return u(n)},t.wbg.__wbg_fetch_6bbc32f991730587=function(e){let n=fetch(c(e));return u(n)},t.wbg.__wbg_fetch_87aed7f306ec6d63=function(e,n){let r=c(e).fetch(c(n));return u(r)},t.wbg.__wbg_from_88bc52ce20ba6318=function(e){let n=Array.from(c(e));return u(n)},t.wbg.__wbg_getRandomValues_1c61fac11405ffdc=function(){return h(function(e,n){globalThis.crypto.getRandomValues(v(e,n))},arguments)},t.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e=function(){return h(function(e,n){c(e).getRandomValues(c(n))},arguments)},t.wbg.__wbg_getTime_6bb3f64e0f18f817=function(e){return c(e).getTime()},t.wbg.__wbg_get_0da715ceaecea5c8=function(e,n){let r=c(e)[n>>>0];return u(r)},t.wbg.__wbg_get_458e874b43b18b25=function(){return h(function(e,n){let r=Reflect.get(c(e),c(n));return u(r)},arguments)},t.wbg.__wbg_has_b89e451f638123e3=function(){return h(function(e,n){return Reflect.has(c(e),c(n))},arguments)},t.wbg.__wbg_headers_29fec3c72865cd75=function(e){let n=c(e).headers;return u(n)},t.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd=function(e){let n;try{n=c(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_instanceof_Map_ebb01a5b6b5ffd0b=function(e){let n;try{n=c(e)instanceof Map}catch{n=!1}return n},t.wbg.__wbg_instanceof_Response_50fde2cd696850bf=function(e){let n;try{n=c(e)instanceof Response}catch{n=!1}return n},t.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7=function(e){let n;try{n=c(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_isArray_030cce220591fb41=function(e){return Array.isArray(c(e))},t.wbg.__wbg_isSafeInteger_1c0d1af5542e102a=function(e){return Number.isSafeInteger(c(e))},t.wbg.__wbg_iterator_f370b34483c71a1c=function(){return u(Symbol.iterator)},t.wbg.__wbg_keys_ef52390b2ae0e714=function(e){let n=Object.keys(c(e));return u(n)},t.wbg.__wbg_length_186546c51cd61acd=function(e){return c(e).length},t.wbg.__wbg_length_6bb7e81f9d7713e4=function(e){return c(e).length},t.wbg.__wbg_msCrypto_a61aeb35a24c1329=function(e){let n=c(e).msCrypto;return u(n)},t.wbg.__wbg_new0_b0a0a38c201e6df5=function(){return u(new Date)},t.wbg.__wbg_new_19c25a3f2fa63a02=function(){let e=new Object;return u(e)},t.wbg.__wbg_new_1f3a344cf3123716=function(){let e=new Array;return u(e)},t.wbg.__wbg_new_2e3c58a15f39f5f9=function(e,n){try{var r={a:e,b:n},o=i((a,d)=>{let g=r.a;r.a=0;try{return Qe(g,r.b,a,d)}finally{r.a=g}},"cb0");let _=new Promise(o);return u(_)}finally{r.a=r.b=0}},t.wbg.__wbg_new_2ff1f68f3676ea53=function(){return u(new Map)},t.wbg.__wbg_new_638ebfaedbf32a5e=function(e){let n=new Uint8Array(c(e));return u(n)},t.wbg.__wbg_new_66b9434b4e59b63e=function(){return h(function(){let e=new AbortController;return u(e)},arguments)},t.wbg.__wbg_new_f6e53210afea8e45=function(){return h(function(){let e=new Headers;return u(e)},arguments)},t.wbg.__wbg_newfromslice_074c56947bd43469=function(e,n){let r=new Uint8Array(v(e,n));return u(r)},t.wbg.__wbg_newnoargs_254190557c45b4ec=function(e,n){let r=new Function(D(e,n));return u(r)},t.wbg.__wbg_newwithlength_a167dcc7aaa3ba77=function(e){let n=new Uint8Array(e>>>0);return u(n)},t.wbg.__wbg_newwithstrandinit_b5d168a29a3fd85f=function(){return h(function(e,n,r){let o=new Request(D(e,n),c(r));return u(o)},arguments)},t.wbg.__wbg_next_5b3530e612fde77d=function(e){let n=c(e).next;return u(n)},t.wbg.__wbg_next_692e82279131b03c=function(){return h(function(e){let n=c(e).next();return u(n)},arguments)},t.wbg.__wbg_node_905d3e251edff8a2=function(e){let n=c(e).node;return u(n)},t.wbg.__wbg_now_886b39d7ec380719=function(e){return c(e).now()},t.wbg.__wbg_process_dc0fbacc7c1c06f7=function(e){let n=c(e).process;return u(n)},t.wbg.__wbg_prototypesetcall_3d4a26c1ed734349=function(e,n,r){Uint8Array.prototype.set.call(v(e,n),c(r))},t.wbg.__wbg_push_330b2eb93e4e1212=function(e,n){return c(e).push(c(n))},t.wbg.__wbg_queueMicrotask_25d0739ac89e8c88=function(e){queueMicrotask(c(e))},t.wbg.__wbg_queueMicrotask_4488407636f5bf24=function(e){let n=c(e).queueMicrotask;return u(n)},t.wbg.__wbg_randomFillSync_ac0988aba3254290=function(){return h(function(e,n){c(e).randomFillSync(y(n))},arguments)},t.wbg.__wbg_require_60cc747a6bc5215a=function(){return h(function(){let e=module.require;return u(e)},arguments)},t.wbg.__wbg_resolve_4055c623acdd6a1b=function(e){let n=Promise.resolve(c(e));return u(n)},t.wbg.__wbg_setTimeout_4ec014681668a581=function(e,n){let r=setTimeout(c(e),n);return u(r)},t.wbg.__wbg_set_1353b2a5e96bc48c=function(e,n,r){c(e).set(v(n,r))},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,r){c(e)[y(n)]=y(r)},t.wbg.__wbg_set_453345bcda80b89a=function(){return h(function(e,n,r){return Reflect.set(c(e),c(n),c(r))},arguments)},t.wbg.__wbg_set_90f6c0f7bd8c0415=function(e,n,r){c(e)[n>>>0]=y(r)},t.wbg.__wbg_set_b7f1cf4fae26fe2a=function(e,n,r){let o=c(e).set(c(n),c(r));return u(o)},t.wbg.__wbg_setbody_c8460bdf44147df8=function(e,n){c(e).body=c(n)},t.wbg.__wbg_setcache_90ca4ad8a8ad40d3=function(e,n){c(e).cache=Ze[n]},t.wbg.__wbg_setcredentials_9cd60d632c9d5dfc=function(e,n){c(e).credentials=et[n]},t.wbg.__wbg_setheaders_0052283e2f3503d1=function(e,n){c(e).headers=c(n)},t.wbg.__wbg_setmethod_9b504d5b855b329c=function(e,n,r){c(e).method=D(n,r)},t.wbg.__wbg_setmode_a23e1a2ad8b512f8=function(e,n){c(e).mode=tt[n]},t.wbg.__wbg_setsignal_8c45ad1247a74809=function(e,n){c(e).signal=c(n)},t.wbg.__wbg_signal_da4d466ce86118b5=function(e){let n=c(e).signal;return u(n)},t.wbg.__wbg_static_accessor_GLOBAL_8921f820c2ce3f12=function(){let e=typeof global>"u"?null:global;return I(e)?0:u(e)},t.wbg.__wbg_static_accessor_GLOBAL_THIS_f0a4409105898184=function(){let e=typeof globalThis>"u"?null:globalThis;return I(e)?0:u(e)},t.wbg.__wbg_static_accessor_SELF_995b214ae681ff99=function(){let e=typeof self>"u"?null:self;return I(e)?0:u(e)},t.wbg.__wbg_static_accessor_WINDOW_cde3890479c675ea=function(){let e=typeof window>"u"?null:window;return I(e)?0:u(e)},t.wbg.__wbg_status_3fea3036088621d6=function(e){return c(e).status},t.wbg.__wbg_stringify_b98c93d0a190446a=function(){return h(function(e){let n=JSON.stringify(c(e));return u(n)},arguments)},t.wbg.__wbg_subarray_70fd07feefe14294=function(e,n,r){let o=c(e).subarray(n>>>0,r>>>0);return u(o)},t.wbg.__wbg_then_b33a773d723afa3e=function(e,n,r){let o=c(e).then(c(n),c(r));return u(o)},t.wbg.__wbg_then_e22500defe16819f=function(e,n){let r=c(e).then(c(n));return u(r)},t.wbg.__wbg_url_e5720dfacf77b05e=function(e,n){let r=c(n).url,o=b(r,s.__wbindgen_export_0,s.__wbindgen_export_1),_=f;l().setInt32(e+4,_,!0),l().setInt32(e+0,o,!0)},t.wbg.__wbg_value_dd9372230531eade=function(e){let n=c(e).value;return u(n)},t.wbg.__wbg_versions_c01dfd4722a88165=function(e){let n=c(e).versions;return u(n)},t.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1=function(e,n){let r=c(n),o=typeof r=="bigint"?r:void 0;l().setBigInt64(e+8,I(o)?BigInt(0):o,!0),l().setInt32(e+0,!I(o),!0)},t.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746=function(e){let n=c(e),r=typeof n=="boolean"?n:void 0;return I(r)?16777215:r?1:0},t.wbg.__wbg_wbindgencbdrop_eb10308566512b88=function(e){let n=c(e).original;return n.cnt--==1?(n.a=0,!0):!1},t.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d=function(e,n){let r=Q(c(n)),o=b(r,s.__wbindgen_export_0,s.__wbindgen_export_1),_=f;l().setInt32(e+4,_,!0),l().setInt32(e+0,o,!0)},t.wbg.__wbg_wbindgenin_d7a1ee10933d2d55=function(e,n){return c(e)in c(n)},t.wbg.__wbg_wbindgenisbigint_ecb90cc08a5a9154=function(e){return typeof c(e)=="bigint"},t.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74=function(e){return typeof c(e)=="function"},t.wbg.__wbg_wbindgenisnull_f3037694abe4d97a=function(e){return c(e)===null},t.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8=function(e){let n=c(e);return typeof n=="object"&&n!==null},t.wbg.__wbg_wbindgenisstring_d4fa939789f003b0=function(e){return typeof c(e)=="string"},t.wbg.__wbg_wbindgenisundefined_c4b71d073b92f3c5=function(e){return c(e)===void 0},t.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58=function(e,n){return c(e)===c(n)},t.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1=function(e,n){return c(e)==c(n)},t.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb=function(e,n){let r=c(n),o=typeof r=="number"?r:void 0;l().setFloat64(e+8,I(o)?0:o,!0),l().setInt32(e+0,!I(o),!0)},t.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f=function(e,n){let r=c(n),o=typeof r=="string"?r:void 0;var _=I(o)?0:b(o,s.__wbindgen_export_0,s.__wbindgen_export_1),a=f;l().setInt32(e+4,a,!0),l().setInt32(e+0,_,!0)},t.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6=function(e,n){throw new Error(D(e,n))},t.wbg.__wbindgen_cast_2241b6af4c4b2941=function(e,n){let r=D(e,n);return u(r)},t.wbg.__wbindgen_cast_2ddd8a25ff58642a=function(e,n){let r=BigInt.asUintN(64,e)|n<<BigInt(64);return u(r)},t.wbg.__wbindgen_cast_4625c577ab2ec9ee=function(e){let n=BigInt.asUintN(64,e);return u(n)},t.wbg.__wbindgen_cast_97b2994476861e36=function(e,n){let r=ae(e,n,580,Ye);return u(r)},t.wbg.__wbindgen_cast_9ae0607507abb057=function(e){return u(e)},t.wbg.__wbindgen_cast_cb9088102bce6b30=function(e,n){let r=v(e,n);return u(r)},t.wbg.__wbindgen_cast_cfb4a7783b62dc83=function(e,n){let r=ae(e,n,487,Xe);return u(r)},t.wbg.__wbindgen_cast_d6cd19b81560fd6e=function(e){return u(e)},t.wbg.__wbindgen_object_clone_ref=function(e){let n=c(e);return u(n)},t.wbg.__wbindgen_object_drop_ref=function(e){y(e)},t}i(ot,"__wbg_get_imports");function it(t,e){return s=t.exports,Re.__wbindgen_wasm_module=e,R=null,M=null,s}i(it,"__wbg_finalize_init");async function Re(t){if(s!==void 0)return s;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("didkit_wasm_bg.wasm",st.url));let e=ot();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:r}=await rt(await t,e);return it(n,r)}i(Re,"__wbg_init");var Ce=Re;var ct="https://assets.learncard.ai/didkit/sha256-ded761c91910068261077c0e2e0c574b6c8c6ba638c8805ad9550a4b90e4138e/didkit_wasm_bg.wasm",ee,_t=i((t=ct)=>(ee??(ee=Ce({module_or_path:t}).then(()=>{},e=>{throw ee=void 0,e})),ee),"init"),te=_t;var Ae=i(t=>{let e=[],n=i(r=>{if(typeof r!="object"||r===null)return;let o="@context"in r?r["@context"]:void 0;for(let _ of Array.isArray(o)?o:[o])typeof _=="string"&&e.push(_);Object.values(r).forEach(n)},"traverse");return n(t),e},"getContextURIs"),A=i(async(t,e,n=!1)=>{let r=Ae(e),o=await Promise.all(r.map(async _=>t.context.resolveDocument(_,n)));return r.reduce((_,a,d)=>{let g=o[d];return g&&(_[a]=JSON.stringify(g)),_},{})},"getDocumentMap");var Me=1e4,Ne=6e4,We=64,ke=new Set([101,204,205,304]),B=!1,j,k=1e4,ne=64,O=0,m=new Map,T=new Map,re=new Map,oe=i(t=>new URL(t).href,"normalizeAbsoluteUrl"),at=i(t=>{let e=[];return t.forEach((n,r)=>{e.push([r.toLowerCase(),n])}),e.sort((n,r)=>n[0]<r[0]?-1:n[0]>r[0]?1:n[1]<r[1]?-1:n[1]>r[1]?1:0),e},"headersToSortedTuples"),ut=i((t,e)=>new Request(t,e),"normalizeRequest"),dt=i(t=>({method:t.method.toUpperCase(),url:oe(t.url),headers:at(t.headers),credentials:t.credentials,mode:t.mode,cache:t.cache,redirect:t.redirect,referrerPolicy:t.referrerPolicy}),"describeSemanticsFromRequest"),ft=i(t=>JSON.stringify([t.method,t.url,t.headers,t.credentials,t.mode,t.cache,t.redirect,t.referrerPolicy]),"semanticsKey"),gt=i((t,e)=>new Request(t,{signal:e}),"sharedNetworkRequest"),bt=i(t=>typeof t=="string"?t:t instanceof URL?t.href:t.url,"peekRequestUrl"),wt=i((t,e)=>e?.method?e.method.toUpperCase():t instanceof Request?t.method.toUpperCase():"GET","peekMethod"),lt=i((t,e)=>typeof e?.integrity=="string"&&e.integrity.length>0||t instanceof Request&&t.integrity.length>0,"peekHasIntegrity"),pt=i((t,e)=>e?.cache?e.cache:t instanceof Request?t.cache:"default","peekCacheMode"),yt=i(t=>{try{let e=new URL(t).pathname;return e==="/did.json"||e.endsWith("/did.json")}catch{let e=t.split(/[?#]/,1)[0]??t;return e==="did.json"||e.endsWith("/did.json")}},"peekIsDidWebDocumentUrl"),z=i(t=>{try{let e=new URL(t).pathname;return e==="/did.json"||e.endsWith("/did.json")}catch{return!1}},"isDidWebDocumentUrl"),ie=i(t=>{if(!t.startsWith("did:web:"))return;let e=t.slice(8).split(":"),n=e[0];if(!n)return;let r=n.replace(/%3A/gi,":"),o=e.length>1?e.slice(1).join("/"):".well-known",_=r.startsWith("localhost")?"http":"https";try{return oe(`${_}://${r}/${o}/did.json`)}catch{return}},"didWebToDocumentUrl"),K=i(t=>re.get(t)??0,"getUrlGeneration"),ht=i(t=>{re.set(t,K(t)+1);for(let e of[...T.keys()])try{JSON.parse(e)[1]===t&&T.delete(e)}catch{}},"bumpUrlGeneration"),mt=i(t=>{let e=[];return t.forEach((n,r)=>{e.push([r,n])}),e},"headersToTuples"),xt=i(t=>{let e=t.get("cache-control");if(!e)return;let n=e.toLowerCase().split(",").map(r=>r.trim());if(n.some(r=>r==="no-store"||r==="no-cache"))return 0;for(let r of n){let o=/^max-age=(\d+)$/.exec(r);if(o)return Number(o[1])*1e3}},"parseCacheControlMaxAgeMs"),Fe=i(t=>{let e=t.body===null||ke.has(t.status)?null:t.body.slice(0),n=new Response(e,{status:t.status,statusText:t.statusText,headers:t.headers});try{Object.defineProperty(n,"url",{value:t.url,writable:!1,enumerable:!0,configurable:!0})}catch{}return n},"storedToResponse"),Dt=i(async(t,e,n)=>{let r=ke.has(t.status)?null:await t.arrayBuffer();return{expiresAt:Date.now()+e,status:t.status,statusText:t.statusText,headers:mt(t.headers),body:r,url:t.url||n}},"readResponse"),It=i((t=Date.now())=>{for(let[e,n]of m)n.expiresAt<=t&&m.delete(e)},"sweepExpired"),Je=i((t,e)=>{for(m.delete(t),m.set(t,e);m.size>ne;){let n=m.keys().next().value;if(n===void 0)break;m.delete(n)}},"touchLru"),St=i((t,e=Date.now())=>{It(e);let n=m.get(t);if(n){if(n.expiresAt<=e){m.delete(t);return}return Je(t,n),n}},"getFreshSuccess"),V=i(()=>{if(typeof DOMException=="function")return new DOMException("The operation was aborted.","AbortError");let t=new Error("The operation was aborted.");return t.name="AbortError",t},"abortError"),Tt=i(t=>new Promise((e,n)=>{if(t.aborted){n(V());return}t.addEventListener("abort",()=>n(V()),{once:!0})}),"waitForAbort"),Et=i((t,e)=>{e.waiters-=1,!(e.waiters>0)&&(T.get(t)===e&&T.delete(t),e.controller.signal.aborted||e.controller.abort())},"releaseInflightWaiter");async function Oe(t,e,n){e.waiters+=1;try{if(n?.aborted)throw V();let r=n?await Promise.race([e.promise,Tt(n)]):await e.promise;return Fe(r)}finally{Et(t,e)}}i(Oe,"joinInflight");var ve=i(t=>t==="no-store"||t==="reload"||t==="no-cache","shouldBypassRequestCacheMode");async function Rt(t,e){let n=j;if(!n){if(typeof globalThis.fetch!="function")throw new TypeError("globalThis.fetch is not available");return globalThis.fetch(t,e)}if(lt(t,e)||wt(t,e)!=="GET"||!yt(bt(t))||ve(pt(t,e)))return n(t,e);let r;try{r=ut(t,e)}catch{return n(t,e)}let o=dt(r);if(o.method!=="GET"||!z(o.url)||ve(o.cache))return n(t,e);let _=r.signal;if(_.aborted)throw V();let a=ft(o),d=St(a);if(d)return Fe(d);let g=T.get(a);if(g&&g.generation===O)return Oe(a,g,_);let w=O,p=K(o.url),x=new AbortController,E=gt(r,x.signal),H=(async()=>{let $=await n(E),X=xt($.headers),se=X===void 0?k:Math.max(0,Math.min(k,X)),ce=await Dt($,se||k,o.url),Pe=w===O&&p===K(o.url);return $.ok&&X!==0&&se>0&&Pe&&w===O&&p===K(o.url)&&Je(a,ce),ce})(),L={generation:w,controller:x,promise:H,waiters:0,semanticsKey:a};return T.set(a,L),Oe(a,L,_)}i(Rt,"cachedFetch");var F=i((t={})=>{if(typeof globalThis.fetch!="function")throw new TypeError("installDidWebDocumentFetchCache requires globalThis.fetch; none is available");typeof t.ttlMs=="number"&&t.ttlMs>0&&(k=t.ttlMs),typeof t.maxEntries=="number"&&t.maxEntries>0&&(ne=t.maxEntries),!(B&&!t.force)&&(B&&t.force&&j&&(globalThis.fetch=j),j=globalThis.fetch.bind(globalThis),globalThis.fetch=Rt,B=!0)},"installDidWebDocumentFetchCache"),Le=i(()=>{F({ttlMs:6e4})},"installWalletDidWebDocumentFetchCache"),G=i(()=>{O+=1,m.clear(),T.clear(),re.clear()},"clearDidWebDocumentFetchCache"),J=i(t=>{let e=t.startsWith("did:")?ie(t):z(t)?t:void 0;if(!e)return;let n;try{n=oe(e)}catch{return}for(let r of[...m.keys()])try{JSON.parse(r)[1]===n&&m.delete(r)}catch{}ht(n)},"invalidateDidWebDocument"),Ue=i(()=>({installed:B,ttlMs:k,maxEntries:ne,successEntries:m.size,inflightEntries:T.size,cacheGeneration:O}),"getDidWebDocumentFetchCacheStats");var Ct=i(t=>te(t),"initDidKit"),At=i(async(t,e=!1)=>{F(),await te(t);let n={};return{name:"DIDKit",displayName:"DIDKit",description:"Provides an interface to DIDKit, which allows for the generation of key material, as well as signing and verifying credentials and presentations",context:{resolveStaticDocument:i(async(r,o)=>{if(typeof o=="string")try{return JSON.parse(await Z(o)??"")||void 0}catch(_){r.debug?.(_);return}},"resolveStaticDocument")},methods:{generateEd25519KeyFromBytes:i((r,o)=>JSON.parse(xe(o)),"generateEd25519KeyFromBytes"),generateSecp256k1KeyFromBytes:i((r,o)=>JSON.parse(De(o)),"generateSecp256k1KeyFromBytes"),keyToDid:i((r,o,_)=>be(o,JSON.stringify(_)),"keyToDid"),keyToVerificationMethod:i(async(r,o,_)=>we(o,JSON.stringify(_)),"keyToVerificationMethod"),didToVerificationMethod:i(async(r,o)=>le(o),"didToVerificationMethod"),issueCredential:i(async(r,o,_,a)=>JSON.parse(await pe(JSON.stringify(o),JSON.stringify(_),JSON.stringify(a),JSON.stringify(await A(r,o,e)))),"issueCredential"),verifyCredential:i(async(r,o,_={})=>JSON.parse(await ye(JSON.stringify(o),JSON.stringify(_),JSON.stringify(await A(r,o,e)))),"verifyCredential"),issuePresentation:i(async(r,o,_,a)=>{let d=_.proofFormat==="jwt",g=await he(JSON.stringify(o),JSON.stringify(_),JSON.stringify(a),JSON.stringify(await A(r,o,e)));return d?g:JSON.parse(g)},"issuePresentation"),verifyPresentation:i(async(r,o,_={})=>{let a=typeof o=="string";return JSON.parse(await ue(a?o:JSON.stringify(o),JSON.stringify(_),a?"{}":JSON.stringify(await A(r,o,e))))},"verifyPresentation"),contextLoader:i(async(r,o)=>{if(typeof o=="string")try{return JSON.parse(await Z(o)??"")||void 0}catch(_){r.debug?.(_);return}},"contextLoader"),resolveDid:i(async(r,o,_={})=>(_.noCache&&J(o),JSON.parse(await ge(o,JSON.stringify(_)))),"resolveDid"),didResolver:i(async(r,o,_={})=>(_.noCache&&J(o),JSON.parse(await fe(o,JSON.stringify(_)))),"didResolver"),createJwe:i(async(r,o,_)=>JSON.parse(await Ie(o,_)),"createJwe"),decryptJwe:i(async(r,o,_)=>Se(JSON.stringify(o),_.map(a=>JSON.stringify(a))),"decryptJwe"),createDagJwe:i(async(r,o,_)=>JSON.parse(await Te(o,_)),"createDagJwe"),decryptDagJwe:i(async(r,o,_)=>{let a=i(d=>{if(d==null)return d;if(typeof d=="bigint")return Number(d);if(Array.isArray(d))return d.map(a);if(typeof d!="object"||!Object.values(d).some(p=>typeof p=="bigint"||typeof p=="object"&&p!==null))return d;let w={};for(let p in d)w[p]=a(d[p]);return w},"convertBigIntsToNumbers");return a(await Ee(JSON.stringify(o),_.map(d=>JSON.stringify(d))))},"decryptDagJwe"),clearDidWebCache:i(async()=>{G(),await de()},"clearDidWebCache")}}},"getDidKitPlugin");
|
|
3
3
|
//# sourceMappingURL=didkit-plugin.cjs.production.min.cjs.map
|