buckyos 0.7.119 → 0.7.121
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/cli/README.md +24 -3
- package/cli/core/app.ts +28 -0
- package/cli/deno.json +2 -1
- package/cli/dist/cli.mjs +777 -169
- package/cli/dist/cli.mjs.map +1 -1
- package/cli/modules/app.ts +213 -94
- package/cli/modules/provision.ts +690 -0
- package/cli/runtime/host.ts +25 -2
- package/cli/runtime/host_deno.ts +4 -0
- package/cli/runtime/host_node.ts +4 -0
- package/cli/version.ts +1 -1
- package/dist/browser.cjs +1 -1
- package/dist/browser.mjs +124 -124
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +124 -124
- package/dist/{ndm_proxy-c00bc561.mjs → ndm_proxy-8f547002.mjs} +113 -216
- package/dist/ndm_proxy-8f547002.mjs.map +1 -0
- package/dist/ndm_proxy-93a8869b.js +13 -0
- package/dist/ndm_proxy-93a8869b.js.map +1 -0
- package/dist/ndn_types-44c69036.js +2 -0
- package/dist/ndn_types-44c69036.js.map +1 -0
- package/dist/{ndn_types-f6c08d20.mjs → ndn_types-d768245f.mjs} +149 -39
- package/dist/ndn_types-d768245f.mjs.map +1 -0
- package/dist/node.cjs +1 -1
- package/dist/node.mjs +124 -124
- package/dist/provision.cjs +6 -6
- package/dist/provision.cjs.map +1 -1
- package/dist/provision.d.ts +2 -0
- package/dist/provision.d.ts.map +1 -1
- package/dist/provision.mjs +1084 -35
- package/dist/provision.mjs.map +1 -1
- package/dist/provision_activate.d.ts +146 -0
- package/dist/provision_activate.d.ts.map +1 -0
- package/dist/{tus_client-573066b3.mjs → tus_client-b1c35e8c.mjs} +2 -2
- package/dist/{tus_client-573066b3.mjs.map → tus_client-b1c35e8c.mjs.map} +1 -1
- package/dist/{tus_client-83ad0f4f.js → tus_client-d0798623.js} +2 -2
- package/dist/{tus_client-83ad0f4f.js.map → tus_client-d0798623.js.map} +1 -1
- package/package.json +1 -1
- package/dist/ndm_proxy-68354a89.js +0 -13
- package/dist/ndm_proxy-68354a89.js.map +0 -1
- package/dist/ndm_proxy-c00bc561.mjs.map +0 -1
- package/dist/ndn_types-859bbd48.js +0 -2
- package/dist/ndn_types-859bbd48.js.map +0 -1
- package/dist/ndn_types-f6c08d20.mjs.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="ARRAYBUFFER not supported by this environment",n="UINT8ARRAY not supported by this environment";function i(e,t,n,i){let r,o,s;const c=t||[0],a=(n=n||0)>>>3,u=-1===i?3:0;for(r=0;r<e.length;r+=1)s=r+a,o=s>>>2,c.length<=o&&c.push(0),c[o]|=e[r]<<8*(u+i*(s%4));return{value:c,binLen:8*e.length+n}}function r(r,o,s){switch(o){case"UTF8":case"UTF16BE":case"UTF16LE":break;default:throw new Error("encoding must be UTF8, UTF16BE, or UTF16LE")}switch(r){case"HEX":return function(e,t,n){return function(e,t,n,i){let r,o,s,c;if(0!=e.length%2)throw new Error("String of HEX type must be in byte increments");const a=t||[0],u=(n=n||0)>>>3,h=-1===i?3:0;for(r=0;r<e.length;r+=2){if(o=parseInt(e.substr(r,2),16),isNaN(o))throw new Error("String of HEX type contains invalid characters");for(c=(r>>>1)+u,s=c>>>2;a.length<=s;)a.push(0);a[s]|=o<<8*(h+i*(c%4))}return{value:a,binLen:4*e.length+n}}(e,t,n,s)};case"TEXT":return function(e,t,n){return function(e,t,n,i,r){let o,s,c,a,u,h,l,d,f=0;const w=n||[0],p=(i=i||0)>>>3;if("UTF8"===t)for(l=-1===r?3:0,c=0;c<e.length;c+=1)for(o=e.charCodeAt(c),s=[],128>o?s.push(o):2048>o?(s.push(192|o>>>6),s.push(128|63&o)):55296>o||57344<=o?s.push(224|o>>>12,128|o>>>6&63,128|63&o):(c+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(c)),s.push(240|o>>>18,128|o>>>12&63,128|o>>>6&63,128|63&o)),a=0;a<s.length;a+=1){for(h=f+p,u=h>>>2;w.length<=u;)w.push(0);w[u]|=s[a]<<8*(l+r*(h%4)),f+=1}else for(l=-1===r?2:0,d="UTF16LE"===t&&1!==r||"UTF16LE"!==t&&1===r,c=0;c<e.length;c+=1){for(o=e.charCodeAt(c),!0===d&&(a=255&o,o=a<<8|o>>>8),h=f+p,u=h>>>2;w.length<=u;)w.push(0);w[u]|=o<<8*(l+r*(h%4)),f+=2}return{value:w,binLen:8*f+i}}(e,o,t,n,s)};case"B64":return function(t,n,i){return function(t,n,i,r){let o,s,c,a,u,h,l,d=0;const f=n||[0],w=(i=i||0)>>>3,p=-1===r?3:0,m=t.indexOf("=");if(-1===t.search(/^[a-zA-Z0-9=+/]+$/))throw new Error("Invalid character in base-64 string");if(t=t.replace(/=/g,""),-1!==m&&m<t.length)throw new Error("Invalid '=' found in base-64 string");for(s=0;s<t.length;s+=4){for(u=t.substr(s,4),a=0,c=0;c<u.length;c+=1)o=e.indexOf(u.charAt(c)),a|=o<<18-6*c;for(c=0;c<u.length-1;c+=1){for(l=d+w,h=l>>>2;f.length<=h;)f.push(0);f[h]|=(a>>>16-8*c&255)<<8*(p+r*(l%4)),d+=1}}return{value:f,binLen:8*d+i}}(t,n,i,s)};case"BYTES":return function(e,t,n){return function(e,t,n,i){let r,o,s,c;const a=t||[0],u=(n=n||0)>>>3,h=-1===i?3:0;for(o=0;o<e.length;o+=1)r=e.charCodeAt(o),c=o+u,s=c>>>2,a.length<=s&&a.push(0),a[s]|=r<<8*(h+i*(c%4));return{value:a,binLen:8*e.length+n}}(e,t,n,s)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(c){throw new Error(t)}return function(e,t,n){return r=t,o=n,c=s,i(new Uint8Array(e),r,o,c);var r,o,c};case"UINT8ARRAY":try{new Uint8Array(0)}catch(c){throw new Error(n)}return function(e,t,n){return i(e,t,n,s)};default:throw new Error("format must be HEX, TEXT, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}function o(i,r,o,s){switch(i){case"HEX":return function(e){return function(e,t,n,i){const r="0123456789abcdef";let o,s,c="";const a=t/8,u=-1===n?3:0;for(o=0;o<a;o+=1)s=e[o>>>2]>>>8*(u+n*(o%4)),c+=r.charAt(s>>>4&15)+r.charAt(15&s);return i.outputUpper?c.toUpperCase():c}(e,r,o,s)};case"B64":return function(t){return function(t,n,i,r){let o,s,c,a,u,h="";const l=n/8,d=-1===i?3:0;for(o=0;o<l;o+=3)for(a=o+1<l?t[o+1>>>2]:0,u=o+2<l?t[o+2>>>2]:0,c=(t[o>>>2]>>>8*(d+i*(o%4))&255)<<16|(a>>>8*(d+i*((o+1)%4))&255)<<8|u>>>8*(d+i*((o+2)%4))&255,s=0;s<4;s+=1)h+=8*o+6*s<=n?e.charAt(c>>>6*(3-s)&63):r.b64Pad;return h}(t,r,o,s)};case"BYTES":return function(e){return function(e,t,n){let i,r,o="";const s=t/8,c=-1===n?3:0;for(i=0;i<s;i+=1)r=e[i>>>2]>>>8*(c+n*(i%4))&255,o+=String.fromCharCode(r);return o}(e,r,o)};case"ARRAYBUFFER":try{new ArrayBuffer(0)}catch(c){throw new Error(t)}return function(e){return function(e,t,n){let i;const r=t/8,o=new ArrayBuffer(r),s=new Uint8Array(o),c=-1===n?3:0;for(i=0;i<r;i+=1)s[i]=e[i>>>2]>>>8*(c+n*(i%4))&255;return o}(e,r,o)};case"UINT8ARRAY":try{new Uint8Array(0)}catch(c){throw new Error(n)}return function(e){return function(e,t,n){let i;const r=t/8,o=-1===n?3:0,s=new Uint8Array(r);for(i=0;i<r;i+=1)s[i]=e[i>>>2]>>>8*(o+n*(i%4))&255;return s}(e,r,o)};default:throw new Error("format must be HEX, B64, BYTES, ARRAYBUFFER, or UINT8ARRAY")}}const s=4294967296,c=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428],u=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],h="Chosen SHA variant is not supported",l="Cannot set numRounds with MAC";function d(e,t){let n,i;const r=e.binLen>>>3,o=t.binLen>>>3,s=r<<3,c=4-r<<3;if(r%4!=0){for(n=0;n<o;n+=4)i=r+n>>>2,e.value[i]|=t.value[n>>>2]<<s,e.value.push(0),e.value[i+1]|=t.value[n>>>2]>>>c;return(e.value.length<<2)-4>=o+r&&e.value.pop(),{value:e.value,binLen:e.binLen+t.binLen}}return{value:e.value.concat(t.value),binLen:e.binLen+t.binLen}}function f(e){const t={outputUpper:!1,b64Pad:"=",outputLen:-1},n=e||{},i="Output length must be a multiple of 8";if(t.outputUpper=n.outputUpper||!1,n.b64Pad&&(t.b64Pad=n.b64Pad),n.outputLen){if(n.outputLen%8!=0)throw new Error(i);t.outputLen=n.outputLen}else if(n.shakeLen){if(n.shakeLen%8!=0)throw new Error(i);t.outputLen=n.shakeLen}if("boolean"!=typeof t.outputUpper)throw new Error("Invalid outputUpper formatting option");if("string"!=typeof t.b64Pad)throw new Error("Invalid b64Pad formatting option");return t}function w(e,t,n,i){const o=e+" must include a value and format";if(!t){if(!i)throw new Error(o);return i}if(void 0===t.value||!t.format)throw new Error(o);return r(t.format,t.encoding||"UTF8",n)(t.value)}class p{constructor(e,t,n){const i=n||{};if(this.t=t,this.i=i.encoding||"UTF8",this.numRounds=i.numRounds||1,isNaN(this.numRounds)||this.numRounds!==parseInt(this.numRounds,10)||1>this.numRounds)throw new Error("numRounds must a integer >= 1");this.o=e,this.h=[],this.u=0,this.l=!1,this.A=0,this.H=!1,this.S=[],this.p=[]}update(e){let t,n=0;const i=this.m>>>5,r=this.C(e,this.h,this.u),o=r.binLen,s=r.value,c=o>>>5;for(t=0;t<c;t+=i)n+this.m<=o&&(this.U=this.v(s.slice(t,t+i),this.U),n+=this.m);return this.A+=n,this.h=s.slice(n>>>5),this.u=o%this.m,this.l=!0,this}getHash(e,t){let n,i,r=this.R;const s=f(t);if(this.K){if(-1===s.outputLen)throw new Error("Output length must be specified in options");r=s.outputLen}const c=o(e,r,this.T,s);if(this.H&&this.g)return c(this.g(s));for(i=this.F(this.h.slice(),this.u,this.A,this.L(this.U),r),n=1;n<this.numRounds;n+=1)this.K&&r%32!=0&&(i[i.length-1]&=16777215>>>24-r%32),i=this.F(i,r,0,this.B(this.o),r);return c(i)}setHMACKey(e,t,n){if(!this.M)throw new Error("Variant does not support HMAC");if(this.l)throw new Error("Cannot set MAC key after calling update");const i=r(t,(n||{}).encoding||"UTF8",this.T);this.k(i(e))}k(e){const t=this.m>>>3,n=t/4-1;let i;if(1!==this.numRounds)throw new Error(l);if(this.H)throw new Error("MAC key already set");for(t<e.binLen/8&&(e.value=this.F(e.value,e.binLen,0,this.B(this.o),this.R));e.value.length<=n;)e.value.push(0);for(i=0;i<=n;i+=1)this.S[i]=909522486^e.value[i],this.p[i]=1549556828^e.value[i];this.U=this.v(this.S,this.U),this.A=this.m,this.H=!0}getHMAC(e,t){const n=f(t);return o(e,this.R,this.T,n)(this.Y())}Y(){let e;if(!this.H)throw new Error("Cannot call getHMAC without first setting MAC key");const t=this.F(this.h.slice(),this.u,this.A,this.L(this.U),this.R);return e=this.v(this.p,this.B(this.o)),e=this.F(t,this.R,this.m,e,this.R),e}}function m(e,t){return e<<t|e>>>32-t}function y(e,t){return e>>>t|e<<32-t}function b(e,t){return e>>>t}function g(e,t,n){return e^t^n}function v(e,t,n){return e&t^~e&n}function _(e,t,n){return e&t^e&n^t&n}function I(e){return y(e,2)^y(e,13)^y(e,22)}function j(e,t){const n=(65535&e)+(65535&t);return(65535&(e>>>16)+(t>>>16)+(n>>>16))<<16|65535&n}function S(e,t,n,i){const r=(65535&e)+(65535&t)+(65535&n)+(65535&i);return(65535&(e>>>16)+(t>>>16)+(n>>>16)+(i>>>16)+(r>>>16))<<16|65535&r}function k(e,t,n,i,r){const o=(65535&e)+(65535&t)+(65535&n)+(65535&i)+(65535&r);return(65535&(e>>>16)+(t>>>16)+(n>>>16)+(i>>>16)+(r>>>16)+(o>>>16))<<16|65535&o}function O(e){return y(e,7)^y(e,18)^b(e,3)}function x(e){return y(e,6)^y(e,11)^y(e,25)}function E(e){return[1732584193,4023233417,2562383102,271733878,3285377520]}function N(e,t){let n,i,r,o,s,c,a;const u=[];for(n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=0;a<80;a+=1)u[a]=a<16?e[a]:m(u[a-3]^u[a-8]^u[a-14]^u[a-16],1),c=a<20?k(m(n,5),v(i,r,o),s,1518500249,u[a]):a<40?k(m(n,5),g(i,r,o),s,1859775393,u[a]):a<60?k(m(n,5),_(i,r,o),s,2400959708,u[a]):k(m(n,5),g(i,r,o),s,3395469782,u[a]),s=o,o=r,r=m(i,30),i=n,n=c;return t[0]=j(n,t[0]),t[1]=j(i,t[1]),t[2]=j(r,t[2]),t[3]=j(o,t[3]),t[4]=j(s,t[4]),t}function T(e,t,n,i){let r;const o=15+(t+65>>>9<<4),c=t+n;for(;e.length<=o;)e.push(0);for(e[t>>>5]|=128<<24-t%32,e[o]=4294967295&c,e[o-1]=c/s|0,r=0;r<e.length;r+=16)i=N(e.slice(r,r+16),i);return i}let D=class extends p{constructor(e,t,n){if("SHA-1"!==e)throw new Error(h);super(e,t,n);const i=n||{};this.M=!0,this.g=this.Y,this.T=-1,this.C=r(this.t,this.i,this.T),this.v=N,this.L=function(e){return e.slice()},this.B=E,this.F=T,this.U=[1732584193,4023233417,2562383102,271733878,3285377520],this.m=512,this.R=160,this.K=!1,i.hmacKey&&this.k(w("hmacKey",i.hmacKey,this.T))}};function A(e){let t;return t="SHA-224"==e?a.slice():u.slice(),t}function J(e,t){let n,i,r,o,s,a,u,h,l,d,f;const w=[];for(n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],a=t[5],u=t[6],h=t[7],f=0;f<64;f+=1)w[f]=f<16?e[f]:S(y(p=w[f-2],17)^y(p,19)^b(p,10),w[f-7],O(w[f-15]),w[f-16]),l=k(h,x(s),v(s,a,u),c[f],w[f]),d=j(I(n),_(n,i,r)),h=u,u=a,a=s,s=j(o,l),o=r,r=i,i=n,n=j(l,d);var p;return t[0]=j(n,t[0]),t[1]=j(i,t[1]),t[2]=j(r,t[2]),t[3]=j(o,t[3]),t[4]=j(s,t[4]),t[5]=j(a,t[5]),t[6]=j(u,t[6]),t[7]=j(h,t[7]),t}let C=class extends p{constructor(e,t,n){if("SHA-224"!==e&&"SHA-256"!==e)throw new Error(h);super(e,t,n);const i=n||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=r(this.t,this.i,this.T),this.v=J,this.L=function(e){return e.slice()},this.B=A,this.F=function(t,n,i,r){return function(e,t,n,i,r){let o,c;const a=15+(t+65>>>9<<4),u=t+n;for(;e.length<=a;)e.push(0);for(e[t>>>5]|=128<<24-t%32,e[a]=4294967295&u,e[a-1]=u/s|0,o=0;o<e.length;o+=16)i=J(e.slice(o,o+16),i);return c="SHA-224"===r?[i[0],i[1],i[2],i[3],i[4],i[5],i[6]]:i,c}(t,n,i,r,e)},this.U=A(e),this.m=512,this.R="SHA-224"===e?224:256,this.K=!1,i.hmacKey&&this.k(w("hmacKey",i.hmacKey,this.T))}};class K{constructor(e,t){this.N=e,this.I=t}}function B(e,t){let n;return t>32?(n=64-t,new K(e.I<<t|e.N>>>n,e.N<<t|e.I>>>n)):0!==t?(n=32-t,new K(e.N<<t|e.I>>>n,e.I<<t|e.N>>>n)):e}function H(e,t){let n;return t<32?(n=32-t,new K(e.N>>>t|e.I<<n,e.I>>>t|e.N<<n)):(n=64-t,new K(e.I>>>t|e.N<<n,e.N>>>t|e.I<<n))}function R(e,t){return new K(e.N>>>t,e.I>>>t|e.N<<32-t)}function P(e,t,n){return new K(e.N&t.N^e.N&n.N^t.N&n.N,e.I&t.I^e.I&n.I^t.I&n.I)}function M(e){const t=H(e,28),n=H(e,34),i=H(e,39);return new K(t.N^n.N^i.N,t.I^n.I^i.I)}function $(e,t){let n,i;n=(65535&e.I)+(65535&t.I),i=(e.I>>>16)+(t.I>>>16)+(n>>>16);const r=(65535&i)<<16|65535&n;return n=(65535&e.N)+(65535&t.N)+(i>>>16),i=(e.N>>>16)+(t.N>>>16)+(n>>>16),new K((65535&i)<<16|65535&n,r)}function U(e,t,n,i){let r,o;r=(65535&e.I)+(65535&t.I)+(65535&n.I)+(65535&i.I),o=(e.I>>>16)+(t.I>>>16)+(n.I>>>16)+(i.I>>>16)+(r>>>16);const s=(65535&o)<<16|65535&r;return r=(65535&e.N)+(65535&t.N)+(65535&n.N)+(65535&i.N)+(o>>>16),o=(e.N>>>16)+(t.N>>>16)+(n.N>>>16)+(i.N>>>16)+(r>>>16),new K((65535&o)<<16|65535&r,s)}function L(e,t,n,i,r){let o,s;o=(65535&e.I)+(65535&t.I)+(65535&n.I)+(65535&i.I)+(65535&r.I),s=(e.I>>>16)+(t.I>>>16)+(n.I>>>16)+(i.I>>>16)+(r.I>>>16)+(o>>>16);const c=(65535&s)<<16|65535&o;return o=(65535&e.N)+(65535&t.N)+(65535&n.N)+(65535&i.N)+(65535&r.N)+(s>>>16),s=(e.N>>>16)+(t.N>>>16)+(n.N>>>16)+(i.N>>>16)+(r.N>>>16)+(o>>>16),new K((65535&s)<<16|65535&o,c)}function z(e,t){return new K(e.N^t.N,e.I^t.I)}function F(e){const t=H(e,19),n=H(e,61),i=R(e,6);return new K(t.N^n.N^i.N,t.I^n.I^i.I)}function Y(e){const t=H(e,1),n=H(e,8),i=R(e,7);return new K(t.N^n.N^i.N,t.I^n.I^i.I)}function q(e){const t=H(e,14),n=H(e,18),i=H(e,41);return new K(t.N^n.N^i.N,t.I^n.I^i.I)}const W=[new K(c[0],3609767458),new K(c[1],602891725),new K(c[2],3964484399),new K(c[3],2173295548),new K(c[4],4081628472),new K(c[5],3053834265),new K(c[6],2937671579),new K(c[7],3664609560),new K(c[8],2734883394),new K(c[9],1164996542),new K(c[10],1323610764),new K(c[11],3590304994),new K(c[12],4068182383),new K(c[13],991336113),new K(c[14],633803317),new K(c[15],3479774868),new K(c[16],2666613458),new K(c[17],944711139),new K(c[18],2341262773),new K(c[19],2007800933),new K(c[20],1495990901),new K(c[21],1856431235),new K(c[22],3175218132),new K(c[23],2198950837),new K(c[24],3999719339),new K(c[25],766784016),new K(c[26],2566594879),new K(c[27],3203337956),new K(c[28],1034457026),new K(c[29],2466948901),new K(c[30],3758326383),new K(c[31],168717936),new K(c[32],1188179964),new K(c[33],1546045734),new K(c[34],1522805485),new K(c[35],2643833823),new K(c[36],2343527390),new K(c[37],1014477480),new K(c[38],1206759142),new K(c[39],344077627),new K(c[40],1290863460),new K(c[41],3158454273),new K(c[42],3505952657),new K(c[43],106217008),new K(c[44],3606008344),new K(c[45],1432725776),new K(c[46],1467031594),new K(c[47],851169720),new K(c[48],3100823752),new K(c[49],1363258195),new K(c[50],3750685593),new K(c[51],3785050280),new K(c[52],3318307427),new K(c[53],3812723403),new K(c[54],2003034995),new K(c[55],3602036899),new K(c[56],1575990012),new K(c[57],1125592928),new K(c[58],2716904306),new K(c[59],442776044),new K(c[60],593698344),new K(c[61],3733110249),new K(c[62],2999351573),new K(c[63],3815920427),new K(3391569614,3928383900),new K(3515267271,566280711),new K(3940187606,3454069534),new K(4118630271,4000239992),new K(116418474,1914138554),new K(174292421,2731055270),new K(289380356,3203993006),new K(460393269,320620315),new K(685471733,587496836),new K(852142971,1086792851),new K(1017036298,365543100),new K(1126000580,2618297676),new K(1288033470,3409855158),new K(1501505948,4234509866),new K(1607167915,987167468),new K(1816402316,1246189591)];function Z(e){return"SHA-384"===e?[new K(3418070365,a[0]),new K(1654270250,a[1]),new K(2438529370,a[2]),new K(355462360,a[3]),new K(1731405415,a[4]),new K(41048885895,a[5]),new K(3675008525,a[6]),new K(1203062813,a[7])]:[new K(u[0],4089235720),new K(u[1],2227873595),new K(u[2],4271175723),new K(u[3],1595750129),new K(u[4],2917565137),new K(u[5],725511199),new K(u[6],4215389547),new K(u[7],327033209)]}function G(e,t){let n,i,r,o,s,c,a,u,h,l,d,f;const w=[];for(n=t[0],i=t[1],r=t[2],o=t[3],s=t[4],c=t[5],a=t[6],u=t[7],d=0;d<80;d+=1)d<16?(f=2*d,w[d]=new K(e[f],e[f+1])):w[d]=U(F(w[d-2]),w[d-7],Y(w[d-15]),w[d-16]),h=L(u,q(s),(m=c,y=a,new K((p=s).N&m.N^~p.N&y.N,p.I&m.I^~p.I&y.I)),W[d],w[d]),l=$(M(n),P(n,i,r)),u=a,a=c,c=s,s=$(o,h),o=r,r=i,i=n,n=$(h,l);var p,m,y;return t[0]=$(n,t[0]),t[1]=$(i,t[1]),t[2]=$(r,t[2]),t[3]=$(o,t[3]),t[4]=$(s,t[4]),t[5]=$(c,t[5]),t[6]=$(a,t[6]),t[7]=$(u,t[7]),t}let V=class extends p{constructor(e,t,n){if("SHA-384"!==e&&"SHA-512"!==e)throw new Error(h);super(e,t,n);const i=n||{};this.g=this.Y,this.M=!0,this.T=-1,this.C=r(this.t,this.i,this.T),this.v=G,this.L=function(e){return e.slice()},this.B=Z,this.F=function(t,n,i,r){return function(e,t,n,i,r){let o,c;const a=31+(t+129>>>10<<5),u=t+n;for(;e.length<=a;)e.push(0);for(e[t>>>5]|=128<<24-t%32,e[a]=4294967295&u,e[a-1]=u/s|0,o=0;o<e.length;o+=32)i=G(e.slice(o,o+32),i);return c="SHA-384"===r?[i[0].N,i[0].I,i[1].N,i[1].I,i[2].N,i[2].I,i[3].N,i[3].I,i[4].N,i[4].I,i[5].N,i[5].I]:[i[0].N,i[0].I,i[1].N,i[1].I,i[2].N,i[2].I,i[3].N,i[3].I,i[4].N,i[4].I,i[5].N,i[5].I,i[6].N,i[6].I,i[7].N,i[7].I],c}(t,n,i,r,e)},this.U=Z(e),this.m=1024,this.R="SHA-384"===e?384:512,this.K=!1,i.hmacKey&&this.k(w("hmacKey",i.hmacKey,this.T))}};const X=[new K(0,1),new K(0,32898),new K(2147483648,32906),new K(2147483648,2147516416),new K(0,32907),new K(0,2147483649),new K(2147483648,2147516545),new K(2147483648,32777),new K(0,138),new K(0,136),new K(0,2147516425),new K(0,2147483658),new K(0,2147516555),new K(2147483648,139),new K(2147483648,32905),new K(2147483648,32771),new K(2147483648,32770),new K(2147483648,128),new K(0,32778),new K(2147483648,2147483658),new K(2147483648,2147516545),new K(2147483648,32896),new K(0,2147483649),new K(2147483648,2147516424)],Q=[[0,36,3,41,18],[1,44,10,45,2],[62,6,43,15,61],[28,55,25,21,56],[27,20,39,8,14]];function ee(e){let t;const n=[];for(t=0;t<5;t+=1)n[t]=[new K(0,0),new K(0,0),new K(0,0),new K(0,0),new K(0,0)];return n}function te(e){let t;const n=[];for(t=0;t<5;t+=1)n[t]=e[t].slice();return n}function ne(e,t){let n,i,r,o;const s=[],c=[];if(null!==e)for(i=0;i<e.length;i+=2)t[(i>>>1)%5][(i>>>1)/5|0]=z(t[(i>>>1)%5][(i>>>1)/5|0],new K(e[i+1],e[i]));for(n=0;n<24;n+=1){for(o=ee(),i=0;i<5;i+=1)s[i]=(a=t[i][0],u=t[i][1],h=t[i][2],l=t[i][3],d=t[i][4],new K(a.N^u.N^h.N^l.N^d.N,a.I^u.I^h.I^l.I^d.I));for(i=0;i<5;i+=1)c[i]=z(s[(i+4)%5],B(s[(i+1)%5],1));for(i=0;i<5;i+=1)for(r=0;r<5;r+=1)t[i][r]=z(t[i][r],c[i]);for(i=0;i<5;i+=1)for(r=0;r<5;r+=1)o[r][(2*i+3*r)%5]=B(t[i][r],Q[i][r]);for(i=0;i<5;i+=1)for(r=0;r<5;r+=1)t[i][r]=z(o[i][r],new K(~o[(i+1)%5][r].N&o[(i+2)%5][r].N,~o[(i+1)%5][r].I&o[(i+2)%5][r].I));t[0][0]=z(t[0][0],X[n])}var a,u,h,l,d;return t}function ie(e){let t,n,i=0;const r=[0,0],o=[4294967295&e,e/s&2097151];for(t=6;t>=0;t--)n=o[t>>2]>>>8*t&255,0===n&&0===i||(r[i+1>>2]|=n<<8*(i+1),i+=1);return i=0!==i?i:1,r[0]|=i,{value:i+1>4?r:[r[0]],binLen:8+8*i}}function re(e){return d(ie(e.binLen),e)}function oe(e,t){let n,i=ie(t);i=d(i,e);const r=t>>>2,o=(r-i.value.length%r)%r;for(n=0;n<o;n++)i.value.push(0);return i.value}let se=class extends p{constructor(e,t,n){let i=6,o=0;super(e,t,n);const s=n||{};if(1!==this.numRounds){if(s.kmacKey||s.hmacKey)throw new Error(l);if("CSHAKE128"===this.o||"CSHAKE256"===this.o)throw new Error("Cannot set numRounds for CSHAKE variants")}switch(this.T=1,this.C=r(this.t,this.i,this.T),this.v=ne,this.L=te,this.B=ee,this.U=ee(),this.K=!1,e){case"SHA3-224":this.m=o=1152,this.R=224,this.M=!0,this.g=this.Y;break;case"SHA3-256":this.m=o=1088,this.R=256,this.M=!0,this.g=this.Y;break;case"SHA3-384":this.m=o=832,this.R=384,this.M=!0,this.g=this.Y;break;case"SHA3-512":this.m=o=576,this.R=512,this.M=!0,this.g=this.Y;break;case"SHAKE128":i=31,this.m=o=1344,this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"SHAKE256":i=31,this.m=o=1088,this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"KMAC128":i=4,this.m=o=1344,this.X(n),this.R=-1,this.K=!0,this.M=!1,this.g=this._;break;case"KMAC256":i=4,this.m=o=1088,this.X(n),this.R=-1,this.K=!0,this.M=!1,this.g=this._;break;case"CSHAKE128":this.m=o=1344,i=this.O(n),this.R=-1,this.K=!0,this.M=!1,this.g=null;break;case"CSHAKE256":this.m=o=1088,i=this.O(n),this.R=-1,this.K=!0,this.M=!1,this.g=null;break;default:throw new Error(h)}this.F=function(e,t,n,r,s){return function(e,t,n,i,r,o,s){let c,a,u=0;const h=[],l=r>>>5,d=t>>>5;for(c=0;c<d&&t>=r;c+=l)i=ne(e.slice(c,c+l),i),t-=r;for(e=e.slice(c),t%=r;e.length<l;)e.push(0);for(c=t>>>3,e[c>>2]^=o<<c%4*8,e[l-1]^=2147483648,i=ne(e,i);32*h.length<s&&(a=i[u%5][u/5|0],h.push(a.I),!(32*h.length>=s));)h.push(a.N),u+=1,0==64*u%r&&(ne(null,i),u=0);return h}(e,t,0,r,o,i,s)},s.hmacKey&&this.k(w("hmacKey",s.hmacKey,this.T))}O(e,t){const n=function(e){const t=e||{};return{funcName:w("funcName",t.funcName,1,{value:[],binLen:0}),customization:w("Customization",t.customization,1,{value:[],binLen:0})}}(e||{});t&&(n.funcName=t);const i=d(re(n.funcName),re(n.customization));if(0!==n.customization.binLen||0!==n.funcName.binLen){const e=oe(i,this.m>>>3);for(let t=0;t<e.length;t+=this.m>>>5)this.U=this.v(e.slice(t,t+(this.m>>>5)),this.U),this.A+=this.m;return 4}return 31}X(e){const t=function(e){const t=e||{};return{kmacKey:w("kmacKey",t.kmacKey,1),funcName:{value:[1128353099],binLen:32},customization:w("Customization",t.customization,1,{value:[],binLen:0})}}(e||{});this.O(e,t.funcName);const n=oe(re(t.kmacKey),this.m>>>3);for(let i=0;i<n.length;i+=this.m>>>5)this.U=this.v(n.slice(i,i+(this.m>>>5)),this.U),this.A+=this.m;this.H=!0}_(e){const t=d({value:this.h.slice(),binLen:this.u},function(e){let t,n,i=0;const r=[0,0],o=[4294967295&e,e/s&2097151];for(t=6;t>=0;t--)n=o[t>>2]>>>8*t&255,0===n&&0===i||(r[i>>2]|=n<<8*i,i+=1);return i=0!==i?i:1,r[i>>2]|=i<<8*i,{value:i+1>4?r:[r[0]],binLen:8+8*i}}(e.outputLen));return this.F(t.value,t.binLen,this.A,this.L(this.U),e.outputLen)}};class ce{constructor(e,t,n){if("SHA-1"==e)this.P=new D(e,t,n);else if("SHA-224"==e||"SHA-256"==e)this.P=new C(e,t,n);else if("SHA-384"==e||"SHA-512"==e)this.P=new V(e,t,n);else{if("SHA3-224"!=e&&"SHA3-256"!=e&&"SHA3-384"!=e&&"SHA3-512"!=e&&"SHAKE128"!=e&&"SHAKE256"!=e&&"CSHAKE128"!=e&&"CSHAKE256"!=e&&"KMAC128"!=e&&"KMAC256"!=e)throw new Error(h);this.P=new se(e,t,n)}}update(e){return this.P.update(e),this}getHash(e,t){return this.P.getHash(e,t)}setHMACKey(e,t,n){this.P.setHMACKey(e,t,n)}getHMAC(e,t){return this.P.getHMAC(e,t)}}const ae="DIDObjectService",ue="buckyos.node_identity.v2";function he(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function le(e){return"string"==typeof e||Array.isArray(e)&&e.every((e=>"string"==typeof e))}function de(e){return!!he(e)&&(le(e["@context"])&&"string"==typeof e.id&&function(e){return Array.isArray(e)}(e.verificationMethod)&&Array.isArray(e.authentication)&&"number"==typeof e.exp&&"number"==typeof e.iat&&function(e){return void 0===e||Array.isArray(e)}(e.service))}function fe(e){return de(e)&&"string"==typeof e.name&&("string"==typeof e.display_name||"string"==typeof e.displayName||"string"==typeof e.full_name)}function we(e){return he(e)&&"string"==typeof e.n&&"string"==typeof e.x&&"number"==typeof e.exp}function pe(e){return de(e)&&"string"==typeof e.owner&&"string"==typeof e.device_type&&"string"==typeof e.name}function me(e){return de(e)&&"string"==typeof e.owner&&he(e.httpServicePorts)}function ye(e){return de(e)&&"string"==typeof e.hostname&&"string"==typeof e.owner&&Array.isArray(e.oods)&&"string"==typeof e.boot_jwt}function be(e){if(!he(e)||!le(e["@context"])||"string"!=typeof e.id)return!1;const t=e.service;return Array.isArray(t)&&t.some((e=>he(e)&&e.type===ae))}const ge="https://www.w3.org/ns/did/v1",ve="https://buckyos.org/ns",_e=15768e4,Ie=31536e4;function je(e){return[ge,`${ve}/${e}/v1`]}function Se(){return Math.floor(Date.now()/1e3)}const ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Oe(e){let t="";for(let n=0;n<e.length;n+=3){const i=e[n],r=n+1<e.length?e[n+1]:0,o=n+2<e.length?e[n+2]:0;t+=ke[i>>2],t+=ke[(3&i)<<4|r>>4],t+=n+1<e.length?ke[(15&r)<<2|o>>6]:"=",t+=n+2<e.length?ke[63&o]:"="}return t}function xe(e){const t=e.replace(/[^A-Za-z0-9+/]/g,""),n=Math.floor(3*t.length/4),i=new Uint8Array(n);let r=0;for(let o=0;o<t.length;o+=4){const e=ke.indexOf(t[o]),n=ke.indexOf(t[o+1]),s=o+2<t.length?ke.indexOf(t[o+2]):-1,c=o+3<t.length?ke.indexOf(t[o+3]):-1;i[r++]=e<<2|n>>4,s>=0&&(i[r++]=(15&n)<<4|s>>2),c>=0&&(i[r++]=(3&s)<<6|c)}return i.subarray(0,r)}function Ee(e){return Oe(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/g,"")}function Ne(e){return xe(e.replace(/-/g,"+").replace(/_/g,"/"))}function Te(e){if("undefined"!=typeof TextEncoder)return(new TextEncoder).encode(e);const t=[];for(let n=0;n<e.length;n++){let i=e.codePointAt(n);i>65535&&n++,i<128?t.push(i):i<2048?t.push(192|i>>6,128|63&i):i<65536?t.push(224|i>>12,128|i>>6&63,128|63&i):t.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i)}return new Uint8Array(t)}function De(e){return Ee(Te(e))}function Ae(e){return function(e){if("undefined"!=typeof TextDecoder)return(new TextDecoder).decode(e);let t="";for(let n=0;n<e.length;){const i=e[n];if(i<128)t+=String.fromCharCode(i),n+=1;else if(i<224)t+=String.fromCharCode((31&i)<<6|63&e[n+1]),n+=2;else if(i<240)t+=String.fromCharCode((15&i)<<12|(63&e[n+1])<<6|63&e[n+2]),n+=3;else{const r=(7&i)<<18|(63&e[n+1])<<12|(63&e[n+2])<<6|63&e[n+3];t+=String.fromCodePoint(r),n+=4}}return t}(Ne(e))}async function Je(){if(!function(){var e;const t=globalThis.process;return Boolean(null==(e=null==t?void 0:t.versions)?void 0:e.node)}())return null;try{return await async function(e){return"function"==typeof require?require(e):Function("name","return import(name)")(e)}("node:crypto")}catch{return null}}function Ce(){var e;const t=null==(e=globalThis.crypto)?void 0:e.subtle;if(!t)throw new Error("namelib: no crypto backend available (need node:crypto or WebCrypto with Ed25519 support)");return t}const Ke=new Uint8Array([48,42,48,5,6,3,43,101,112,3,33,0]);function Be(e){return xe(e.replace(/-----BEGIN [^-]+-----/g,"").replace(/-----END [^-]+-----/g,"").replace(/\s+/g,""))}function He(e){const t=Oe(e),n=[];for(let i=0;i<t.length;i+=64)n.push(t.slice(i,i+64));return`-----BEGIN PRIVATE KEY-----\n${n.join("\n")}\n-----END PRIVATE KEY-----\n`}function Re(e){const t=Ne(e.x);if(32!==t.length)throw new Error(`namelib: invalid Ed25519 jwk, x must be 32 bytes, got ${t.length}`);return function(e,t){const n=new Uint8Array(e.length+t.length);return n.set(e,0),n.set(t,e.length),n}(Ke,t)}function Pe(e){const t=e.x;if("string"!=typeof t||0===t.length)throw new Error("namelib: invalid jwk, missing x");return t}function Me(e){return{kty:"OKP",crv:"Ed25519",x:e}}async function $e(e,t,n){const i=`${De(JSON.stringify(n??{alg:"EdDSA"}))}.${De(JSON.stringify(e))}`,r=await async function(e,t){const n=await Je();if(n){const i=n.createPrivateKey({key:t,format:"pem"});return new Uint8Array(n.sign(null,e,i))}const i=Ce(),r=Be(t),o=await i.importKey("pkcs8",r,{name:"Ed25519"},!1,["sign"]),s=await i.sign({name:"Ed25519"},o,e);return new Uint8Array(s)}(Te(i),t);return`${i}.${Ee(r)}`}function Ue(e){const t=e.split(".");if(3!==t.length)throw new Error("namelib: invalid jwt, parts.len != 3");return JSON.parse(Ae(t[1]))}async function Le(e,t){const n=e.split(".");if(3!==n.length)throw new Error("namelib: invalid jwt, parts.len != 3");const i=JSON.parse(Ae(n[0]));if("EdDSA"!==i.alg)throw new Error(`namelib: unsupported jwt alg: ${i.alg}`);const r=`${n[0]}.${n[1]}`,o=await async function(e,t,n){const i=await Je();if(i){const r=i.createPublicKey({key:{kty:n.kty,crv:n.crv,x:n.x},format:"jwk"});return i.verify(null,e,r,t)}const r=Ce(),o=Re(n),s=await r.importKey("spki",o,{name:"Ed25519"},!1,["verify"]);return r.verify({name:"Ed25519"},s,t,e)}(Te(r),Ne(n[2]),t);if(!o)throw new Error("namelib: jwt signature verify failed");return JSON.parse(Ae(n[1]))}function ze(e){return e.startsWith("{")||e.startsWith("[")?{type:"json",value:JSON.parse(e)}:{type:"jwt",jwt:e}}function Fe(e){return"jwt"===e.type?Ue(e.jwt):e.value}let Ye=null;class qe{constructor(e,t){this.method=e,this.id=t}static undefined(){return new qe("undefined","undefined")}isUndefined(){return"undefined"===this.method}isValid(){return"undefined"!==this.method}static isDid(e){return e.startsWith("did:")}static fromStr(e){const t=e.split(":");if("did"!==t[0]){const t=qe.fromHostName(e);if(t)return t;throw new Error(`namelib: invalid did ${e}`)}return new qe(t[1],t.slice(2).join(":"))}static fromHostName(e){if(e.endsWith(".did")){const t=e.slice(0,-4),n=t.lastIndexOf(".");if(n>0&&n<t.length-1)return new qe(t.slice(n+1),t.slice(0,n))}if(Ye)for(const t of Object.keys(Ye)){const n=Ye[t];if(e.endsWith(n)){if(e===n)break;const i=e.slice(0,e.length-n.length-1);return new qe(t,i)}}return new qe("web",e)}static fromHostNameByBridge(e,t,n){if(e.endsWith(n)&&e!==n){const i=e.slice(0,e.length-n.length-1);return new qe(t,i)}if(e.endsWith(".did")){const t=e.slice(0,-4),n=t.lastIndexOf(".");if(n>0&&n<t.length-1)return new qe(t.slice(n+1),t.slice(0,n))}return new qe("web",e)}toString(){return`did:${this.method}:${this.id}`}isNamedObjId(){return"dev"===this.method}getPathFromId(){const e=this.id.split(":");return e.length>1?e.slice(1).join("/"):null}upperDid(){const e=(this.id.split(":")[0]??"").split("%")[0]??"";switch(this.method){case"web":{if(Ve(e))return null;const t=e.indexOf(".");if(t<0)return null;const n=e.slice(t+1);return n.includes(".")?new qe("web",n):null}case"bns":{const t=e.indexOf(".");return t<0?null:new qe("bns",e.slice(t+1))}default:return null}}toFilename(){const e="0123456789ABCDEF",t=Te(this.toRawHostUri());let n="";for(const i of t){const t=String.fromCharCode(i);/[A-Za-z0-9._-]/.test(t)?n+=t:n+=`%${e[i>>4]}${e[15&i]}`}return n}getEd25519AuthKey(){return"dev"===this.method?Ne(this.id):null}getAuthKeyJwk(){return"dev"===this.method?Me(this.id):null}toRawHostName(){const e=this.id.split(":")[0];return"web"===this.method?e:`${e}.${this.method}.did`}toRawHostUri(){const e=this.toRawHostName(),t=this.getPathFromId();return t?`${e}/${t}`:e}toHostNameByBridge(e){const t=this.id.split(":")[0];return"web"===this.method?t:`${t}.${e}`}toHostName(){const e=this.id.split(":")[0];if("web"===this.method)return e;if(Ye){const t=Ye[this.method];if(t)return`${e}.${t}`}return`${e}.${this.method}.did`}toHostUri(){const e=this.toHostName(),t=this.getPathFromId();return t?`${e}/${t}`:e}equals(e){return this.method===e.method&&this.id===e.id}}function We(e){let t,n="OOD",i=e;e.startsWith("#")?(n="Gateway",i=e.slice(1)):e.startsWith("$")&&(n="OODOnly",i=e.slice(1));const r=i.lastIndexOf("@");let o,s=i;r>=0&&(s=i.slice(0,r),t=i.slice(r+1));let c=s;const a=s.indexOf(":");if(a>=0&&(c=s.slice(0,a),o=s.slice(a+1),!Ve(o)))throw new Error(`namelib: invalid ip addr: ${o}`);if(void 0!==o&&void 0===t&&(t="wan"),!c)throw new Error("namelib: name in OODDescriptionString is empty");return Xe({name:c,nodeType:n,netId:t,ip:o})}function Ze(e){let t;switch(e.nodeType){case"OOD":t=e.name;break;case"Gateway":t=`#${e.name}`;break;case"OODOnly":t=`$${e.name}`;break;default:throw new Error("namelib: node type is not allow in oods")}return void 0!==e.ip?(t+=`:${e.ip}`,void 0!==e.netId&&"wan"!==e.netId&&(t+=`@${e.netId}`),t):(void 0!==e.netId&&(t+=`@${e.netId}`),t)}function Ge(e){return"Gateway"===e||"OOD"===e}function Ve(e){const t=e.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);return t?t.slice(1).every((e=>Number(e)<=255)):/^[0-9a-fA-F:]+$/.test(e)&&e.includes(":")}function Xe(e){for(const t of Object.keys(e))void 0===e[t]&&delete e[t];return e}function Qe(e){return e instanceof qe?e:qe.fromStr(e)}function et(e){const t=Qe(e.did),n=e.now??Se(),i=t.toString();return{"@context":je("owner"),id:i,verificationMethod:[{type:"Ed25519VerificationKey2020",id:"#main_key",controller:i,publicKeyJwk:e.publicKeyJwk}],authentication:["#main_key"],assertion_method:["#main_key"],capabilityInvocation:["#main_key"],exp:n+Ie,iat:n,version_seq:0,name:e.name,display_name:e.displayName,zone_binding_model_version:2}}function tt(e){var t;const n=null==(t=e.binded_zone_list)?void 0:t[0],i=`${e.id}#lastDoc`,r=(e.service??[]).filter((e=>e.id!==i));if(void 0!==n){const t=Qe(n);r.push({id:i,type:"DIDDoc",serviceEndpoint:`https://${t.toHostName()}/resolve/${e.id}`})}e.service=r}function nt(e,t){const n=Qe(t).toString();return(e.binded_zone_list??[]).includes(n)}function it(e){const t=Qe(e.id),n=Qe(e.ownerDid),i=e.now??Se(),r=t.toString();return{"@context":je("zone"),id:r,verificationMethod:[{type:"Ed25519VerificationKey2020",id:"#main_key",controller:n.toString(),publicKeyJwk:e.publicKeyJwk}],authentication:["#main_key"],assertionMethod:["#main_key"],capabilityInvocation:["#main_key"],service:[{id:`${r}#lastDoc`,type:"DIDDoc",serviceEndpoint:`https://${t.toHostName()}/resolve/this_zone`}],exp:i+Ie,iat:i,version_seq:0,hostname:t.toHostName(),owner:n.toString(),oods:[],boot_jwt:""}}function rt(e){return Xe({id:void 0!==e.id?Qe(e.id).toString():void 0,oods:[...e.oods],sn:e.sn,exp:e.exp,owner:void 0!==e.owner?Qe(e.owner).toString():void 0,owner_key:e.ownerKey})}async function ot(e,t){const{id:n,oods:i,sn:r,exp:o,owner:s,owner_key:c,...a}=e;return $e(Xe({id:n,oods:i,sn:r,exp:o,owner:s,...a,owner_key:c}),t)}function st(e){const t=e.now??Se(),n=`did:dev:${e.pkx}`;return{"@context":je("device"),id:n,verificationMethod:[{type:"Ed25519VerificationKey2020",id:"#main_key",controller:n,publicKeyJwk:Me(e.pkx)}],authentication:["#main_key"],assertion_method:["#main_key"],capabilityInvocation:["#main_key"],exp:t+_e,iat:t,version_seq:0,owner:qe.undefined().toString(),device_type:"ood",name:e.name}}function ct(e,t,n){return st({name:e,pkx:Pe(t),now:n})}function at(e,t,n,i){const r=`did:dev:${t.x}`,o={"@context":je("device"),id:r,verificationMethod:[{type:"Ed25519VerificationKey2020",id:"#main_key",controller:r,publicKeyJwk:Me(t.x)}],authentication:["#main_key"],assertion_method:["#main_key"],capabilityInvocation:["#main_key"],exp:t.exp,iat:t.exp-_e,version_seq:0,zone_did:Qe(n).toString(),owner:Qe(i).toString(),device_type:"ood",device_mini_document_jwt:e,name:t.n};return void 0!==t.p&&(o.rtcp_port=t.p),o}async function ut(e,t){if(void 0===e.version_seq)throw new Error("namelib: DeviceDocument version_seq is required when encoding as JWT");return $e(ht(e),t)}function ht(e){const{"@context":t,id:n,verificationMethod:i,authentication:r,assertion_method:o,capabilityInvocation:s,service:c,exp:a,iat:u,version_seq:h,keyScope:l,"buckyos:scopes":d,zone_did:f,owner:w,device_type:p,device_mini_document_jwt:m,name:y,rtcp_port:b,ips:g,net_id:v,ddns_sn_url:_,support_container:I,capbilities:j,...S}=e,k=l??d;return Xe({"@context":t,id:n,verificationMethod:i,authentication:r,assertion_method:o&&o.length>0?o:void 0,capabilityInvocation:s&&s.length>0?s:void 0,service:c&&c.length>0?c:void 0,exp:a,iat:u,version_seq:h,...S,keyScope:k&&Object.keys(k).length>0?k:void 0,zone_did:f,owner:w,device_type:p,device_mini_document_jwt:m,name:y,rtcp_port:b,ips:g&&g.length>0?g:void 0,net_id:v,ddns_sn_url:_,support_container:!1!==I&&void 0,capbilities:j&&Object.keys(j).length>0?j:void 0})}function lt(e){return Xe({n:e.name,x:e.x,p:e.rtcpPort,exp:e.exp})}function dt(e){const t=e.verificationMethod.find((e=>"#main_key"===e.id));if(!t)throw new Error("namelib: device document has no #main_key verification method");return lt({name:e.name,x:Pe(t.publicKeyJwk),rtcpPort:e.rtcp_port,exp:e.exp})}async function ft(e,t){const{n:n,x:i,p:r,exp:o,...s}=e;return $e(Xe({n:n,x:i,p:r,exp:o,...s}),t)}function wt(e){const{"@context":t,id:n,verificationMethod:i,authentication:r,assertion_method:o,capabilityInvocation:s,service:c,exp:a,iat:u,version_seq:h,mini_version_seq:l,valid_iat:d,keyScope:f,"buckyos:scopes":w,name:p,display_name:m,avatar:y,meta:b,zone_binding_model_version:g,binded_zone_list:v,wallets:_,...I}=e,j=f??w;return Xe({"@context":t,id:n,verificationMethod:i,authentication:r,assertion_method:o&&o.length>0?o:void 0,capabilityInvocation:s&&s.length>0?s:void 0,service:c&&c.length>0?c:void 0,exp:a,iat:u,version_seq:h,mini_version_seq:l,valid_iat:d,...I,keyScope:j&&Object.keys(j).length>0?j:void 0,name:p,display_name:m,avatar:y,meta:b,zone_binding_model_version:g,binded_zone_list:v&&v.length>0?v:void 0,wallets:_&&Object.keys(_).length>0?_:void 0})}function pt(e){const{"@context":t,id:n,verificationMethod:i,authentication:r,assertionMethod:o,capabilityInvocation:s,service:c,exp:a,iat:u,version_seq:h,keyScope:l,"buckyos:scopes":d,hostname:f,owner:w,oods:p,boot_jwt:m,mini_device_jwts:y,devices:b,sn:g,...v}=e,_=l??d;return Xe({"@context":t,id:n,verificationMethod:i,authentication:r,assertionMethod:o&&o.length>0?o:void 0,capabilityInvocation:s&&s.length>0?s:void 0,service:c&&c.length>0?c:void 0,exp:a,iat:u,version_seq:h,...v,keyScope:_&&Object.keys(_).length>0?_:void 0,hostname:f,owner:w,oods:p,boot_jwt:m,mini_device_jwts:y&&Object.keys(y).length>0?y:void 0,devices:b&&Object.keys(b).length>0?b:void 0,sn:g})}function mt(e){return wt(e)}function yt(e){return pt(e)}function bt(e){return ht(e)}function gt(e){return e.keyScope??e["buckyos:scopes"]??{}}function vt(e,t){const n=e.verificationMethod??[];if(0===n.length)return null;if(void 0===t)return n[0].publicKeyJwk;const i=n.find((e=>e.id===t));return i?i.publicKeyJwk:null}function _t(e,t){return gt(e)[t]??null}function It(e){return Object.keys(gt(e)).length>0}function jt(e){const t=e.capabilityInvocation;if(Array.isArray(t)&&t.length>0)return t;const n=e.authentication;if(Array.isArray(n)&&n.length>0)return n;if(be(e)){const t=e.assertionMethod;if(Array.isArray(t)&&t.length>0)return t}return null}function St(e,t){const n=e.id;if(t.startsWith(n)){const e=t.slice(n.length);if(e.startsWith("#"))return e}return t}function kt(e,t){return t.startsWith("#")?`${e.id}${t}`:t}function Ot(e,t,n){return t===n||St(e,t)===St(e,n)||kt(e,t)===kt(e,n)}function xt(e,t){for(const n of t){const t=vt(e,St(e,n));if(t)return[n,t]}return null}function Et(e){const t="string"==typeof e?ze(e):e,n="jwt"===t.type,i=Fe(t);if("object"!=typeof i||null===i)throw new Error("namelib: unknown did document");const r=e=>{if(n&&"number"!=typeof i.version_seq)throw new Error(`namelib: ${e} version_seq is required when encoding as JWT`)};if(void 0!==i.verificationMethod&&void 0!==i.name&&(void 0!==i.display_name||void 0!==i.displayName||void 0!==i.full_name))return r("OwnerDocument"),{docType:"owner",doc:i};if(void 0!==i.httpServicePorts)return r("AgentDocument"),{docType:"agent",doc:i};if(void 0!==i.device_type)return r("DeviceDocument"),{docType:"device",doc:i};if(void 0!==i.oods)return r("ZoneDocument"),{docType:"zone",doc:i};if(Array.isArray(i.service)&&i.service.some((e=>(null==e?void 0:e.type)===ae)))return r("DIDObjectCard"),{docType:"did-object",doc:i};throw new Error("namelib: unknown did document")}const Nt=Object.freeze(Object.defineProperty({__proto__:null,BUCKYOS_CONTEXT_BASE:ve,DEFAULT_EXPIRE_TIME:_e,DID:qe,DID_CORE_CONTEXT:ge,DID_DOC_AUTHKEY:"#auth-key",KEY_SCOPE_AGENT_CREATE_CONTENT:"agent:create-content",KEY_SCOPE_AGENT_RECEIVE:"agent:receive",KEY_SCOPE_AGENT_SPEND:"agent:spend",KEY_SCOPE_CONTENT_CREATE:"content:create",KEY_SCOPE_MANUAL:"manual",KEY_SCOPE_MESSAGE_CREATE:"message:create",KEY_SCOPE_ZONE_PUBLISH:"zone:publish",ZONE_BINDING_MODEL_VERSION:2,base64UrlDecodeToBytes:Ne,base64UrlDecodeToString:Ae,base64UrlEncodeBytes:Ee,base64UrlEncodeString:De,buckyosContext:je,buckyosGetUnixTimestamp:Se,createJwkByX:Me,decodeDeviceDocument:async function(e,t){const n=t?await Le(e,t):Ue(e);if(void 0===n.version_seq)throw new Error("namelib: DeviceDocument version_seq is required when decoding from JWT");return n},decodeJwtClaimWithoutVerify:Ue,decodeJwtHeaderWithoutVerify:function(e){const t=e.split(".");if(3!==t.length)throw new Error("namelib: invalid jwt, parts.len != 3");return JSON.parse(Ae(t[0]))},decodeZoneBootDocument:async function(e,t){return t?await Le(e,t):Ue(e)},derToPkcs8Pem:He,deviceDocumentToOrderedJson:bt,deviceMiniDocumentFromJwt:async function(e,t){return t?await Le(e,t):Ue(e)},deviceMiniDocumentToJwt:ft,encodeDeviceDocument:ut,encodeOwnerDocument:async function(e,t){if(void 0===e.version_seq)throw new Error("namelib: OwnerDocument version_seq is required when encoding as JWT");return $e(wt(e),t)},encodeZoneBootDocument:ot,encodeZoneDocument:async function(e,t){if(void 0===e.version_seq)throw new Error("namelib: ZoneDocument version_seq is required when encoding as JWT");return $e(pt(e),t)},encodedDocumentFromStr:ze,encodedDocumentToJsonValue:Fe,encodedDocumentToString:function(e){return"jwt"===e.type?e.jwt:JSON.stringify(e.value)},expandLocalKeyId:kt,generateEd25519KeyPair:async function(){const e=await Je();if(e){const{privateKey:t,publicKey:n}=e.generateKeyPairSync("ed25519");return{privateKeyPem:t.export({type:"pkcs8",format:"pem"}).toString(),publicKeyJwk:Me(n.export({format:"jwk"}).x)}}const t=Ce(),n=await t.generateKey({name:"Ed25519"},!0,["sign","verify"]),i=new Uint8Array(await t.exportKey("pkcs8",n.privateKey)),r=await t.exportKey("jwk",n.publicKey);if(!r.x)throw new Error("namelib: WebCrypto did not return Ed25519 public jwk");return{privateKeyPem:He(i),publicKeyJwk:Me(r.x)}},getDeviceDidFromJwk:function(e){return`did:dev:${Pe(e)}`},getDidDocType:function(e){return e.docType},getDocumentAuthKey:vt,getDocumentDefaultKey:function(e){const t=(e.verificationMethod??[]).find((e=>"#main_key"===e.id));return t?t.publicKeyJwk:null},getDocumentKeyScope:gt,getKeyByScope:function(e,t){const n=_t(e,t);if(n)return xt(e,n);if(It(e))return null;const i=jt(e);if(i){const t=xt(e,i);if(t)return t}const r=vt(e);return r?["",r]:null},getKeyFromKeyIds:xt,getKeyIdsByScope:_t,getKnownWeb3BridgeConfig:function(){return Ye},getPublicKeyXFromPrivatePem:async function(e){const t=await Je();if(t){const n=t.createPrivateKey({key:e,format:"pem"});return t.createPublicKey(n).export({format:"jwk"}).x}const n=Ce(),i=Be(e),r=await n.importKey("pkcs8",i,{name:"Ed25519"},!0,["sign"]),o=await n.exportKey("jwk",r);if(!o.x)throw new Error("namelib: cannot derive public key from private pem");return o.x},getStandardScopeKeyIds:jt,getXFromJwk:Pe,hasKeyScope:It,isKeyAllowedInScope:function(e,t,n){const i=_t(e,t);if(i)return i.some((t=>Ot(e,t,n)));if(It(e))return!1;const r=jt(e);return r?r.some((t=>Ot(e,t,n))):null!==vt(e,St(e,n))},isSameDocumentKeyId:Ot,newDeviceDocument:st,newDeviceDocumentByJwk:ct,newDeviceDocumentByMiniDocument:at,newDeviceMiniDocument:lt,newDeviceMiniDocumentByDeviceDocument:dt,newNodeIdentityConfig:function(e){return{zone_did:Qe(e.zoneDid).toString(),owner_public_key:e.ownerPublicKey,owner_did:Qe(e.ownerDid).toString(),device_doc_jwt:e.deviceDocJwt,device_mini_doc_jwt:e.deviceMiniDocJwt,zone_iat:e.zoneIat}},newOwnerDocument:et,newOwnerDocumentByPkx:function(e,t){const n=e.split(":");if(0===n.length||!n[0])throw new Error("namelib: invalid pkx: empty x");const i=n[0];if(!/^[A-Za-z0-9_-]+$/.test(i))throw new Error("namelib: invalid pkx: x must be base64url");if(32!==Ne(i).length)throw new Error("namelib: invalid pkx: x length must be 32 bytes");const r=Me(i);if(1===n.length){const e=qe.fromStr(t),n=e.id;return et({did:e,name:n,displayName:`${n}@${t}`,publicKeyJwk:r})}if(n.length>=3){const e=n[2];return et({did:new qe(n[1],n[2]),name:e,displayName:`${e}@${t}`,publicKeyJwk:r})}throw new Error(`namelib: invalid pkx: ${e}`)},newZoneBootDocument:rt,newZoneDocument:it,normalizeKeyIdForLocalLookup:St,oodDescriptionToString:Ze,oodNodeTypeIsGateway:Ge,oodNodeTypeIsOod:function(e){return"OOD"===e||"OODOnly"===e},ownerDocumentGetDefaultZoneDid:function(e){var t;return(null==(t=e.binded_zone_list)?void 0:t[0])??null},ownerDocumentGetHistoricalKeys:function(e){return e.verificationMethod.filter((e=>"#main_key"!==e.id)).map((e=>[e.id,e.publicKeyJwk]))},ownerDocumentGetZoneBindingState:function(e,t){const n=e.zone_binding_model_version;return void 0===n?"legacy":2!==n?"unsupported_version":nt(e,t)?"bound_v2":"unbound_v2"},ownerDocumentIsBoundToZone:nt,ownerDocumentRemoveBoundZone:function(e,t){var n;const i=Qe(t).toString(),r=(null==(n=e.binded_zone_list)?void 0:n.length)??0;e.binded_zone_list=(e.binded_zone_list??[]).filter((e=>e!==i));const o=e.binded_zone_list.length!==r;return e.zone_binding_model_version=2,tt(e),o},ownerDocumentSetDefaultZoneDid:function(e,t){const n=Qe(t).toString(),i=(e.binded_zone_list??[]).filter((e=>e!==n));i.unshift(n),e.binded_zone_list=i,e.zone_binding_model_version=2,tt(e)},ownerDocumentToOrderedJson:mt,ownerDocumentValidateJwtRevocation:function(e,t,n){if(void 0===e.mini_version_seq&&void 0===e.valid_iat)return;if("jwt"!==n.type)return;const i=Fe(n);if(void 0!==e.mini_version_seq){const n="number"==typeof(null==i?void 0:i.version_seq)?i.version_seq:void 0;if(void 0===n)throw new Error(`namelib: ${t} JWT missing version_seq required by owner revocation policy`);if(n<=e.mini_version_seq)throw new Error(`namelib: ${t} JWT version_seq ${n} is not greater than owner mini_version_seq ${e.mini_version_seq}`)}if(void 0!==e.valid_iat){const n="number"==typeof(null==i?void 0:i.iat)?i.iat:void 0;if(void 0===n)throw new Error(`namelib: ${t} JWT missing iat required by owner revocation policy`);if(n<=e.valid_iat)throw new Error(`namelib: ${t} JWT iat ${n} is not greater than owner valid_iat ${e.valid_iat}`)}},parseDidDoc:Et,parseDidDocAs:function(e,t){const n=Et(e);if(n.docType!==t)throw new Error(`namelib: expected ${t} document, got ${n.docType}`);return n.doc},parseOODDescription:We,pemToDer:Be,resetKnownWeb3BridgeConfigForTest:function(){Ye=null},setKnownWeb3BridgeConfig:function(e){return null===Ye&&(Ye={...e},!0)},signJwtEdDSA:$e,verifyJwtEdDSA:Le,zoneBootDocumentGetGatewayName:function(e){for(const t of e.oods){const e=We(t);if(Ge(e.nodeType))return e.name}return""},zoneBootDocumentToZoneDocument:function(e,t){if(!e.id||!e.owner_key)throw new Error("namelib: zone boot document needs id and owner_key to build zone document");const n=e.owner?qe.fromStr(e.owner):qe.undefined(),i=it({id:e.id,ownerDid:n,publicKeyJwk:e.owner_key});return i.boot_jwt=t,i.oods=[...e.oods],void 0!==e.sn?i.sn=e.sn:delete i.sn,i.exp=e.exp,i.iat=e.exp-_e,i.version_seq=0,i.owner=e.owner??qe.undefined().toString(),i},zoneDocumentGetDefaultGateway:function(e){for(const t of e.oods){const e=We(t);if(Ge(e.nodeType))return e.name}return null},zoneDocumentGetSnApiUrl:function(e){return void 0!==e.sn?`https://${e.sn}/kapi/sn`:null},zoneDocumentToOrderedJson:yt},Symbol.toStringTag,{value:"Module"}));var Tt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Dt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}const At=Dt((function e(t){if("number"==typeof t&&isNaN(t))throw new Error("NaN is not allowed");if("number"==typeof t&&!isFinite(t))throw new Error("Infinity is not allowed");if(null===t||"object"!=typeof t)return JSON.stringify(t);if(t.toJSON instanceof Function)return e(t.toJSON());if(Array.isArray(t)){return`[${t.reduce(((t,n,i)=>`${t}${0===i?"":","}${e(void 0===n||"symbol"==typeof n?null:n)}`),"")}]`}return`{${Object.keys(t).sort().reduce(((n,i)=>{if(void 0===t[i]||"symbol"==typeof t[i])return n;return`${n}${0===n.length?"":","}${e(i)}:${e(t[i])}`}),"")}}`}));class Jt extends Error{constructor(e,t){super(`${e}: ${t}`),this.kind=e,this.name="NdnError"}}const Ct="cyfile",Kt="cydir",Bt="cypath",Ht="cyinc",Rt="cyrel",Pt="cypack",Mt="cytrie",$t="cytrie-s",Ut="cymap-mtp",Lt="cymap",zt="cylist-mtree",Ft="cylist",Yt="cl",qt="clist",Wt="clist-fix",Zt="cl-sf",Gt="same",Vt="part_of",Xt="0123456789abcdef";function Qt(e){let t="";for(let n=0;n<e.length;n++){const i=e[n];t+=Xt[i>>>4&15],t+=Xt[15&i]}return t}function en(e){if(e.length%2!=0)throw new Jt("InvalidId",`invalid hex length: ${e.length}`);const t=new Uint8Array(e.length/2);for(let n=0;n<t.length;n++){const i=Xt.indexOf(e[2*n].toLowerCase()),r=Xt.indexOf(e[2*n+1].toLowerCase());if(i<0||r<0)throw new Jt("InvalidId","invalid hex char at offset "+2*n);t[n]=i<<4|r}return t}const tn="abcdefghijklmnopqrstuvwxyz234567";function nn(e){let t=0,n=0,i="";for(let r=0;r<e.length;r++)for(n=n<<8|e[r],t+=8;t>=5;)t-=5,i+=tn[n>>>t&31];return t>0&&(i+=tn[n<<5-t&31]),i}function rn(e){const t=e.toLowerCase();let n=0,i=0;const r=[];for(let o=0;o<t.length;o++){const e=t[o],s=tn.indexOf(e);if(s<0)throw new Jt("InvalidId",`invalid base32 char '${e}' at ${o}`);i=i<<5|s,n+=5,n>=8&&(n-=8,r.push(i>>>n&255))}return new Uint8Array(r)}function on(e){if(!Number.isFinite(e)||e<0)throw new Jt("InvalidParam",`varint must be non-negative finite: ${e}`);if(!Number.isSafeInteger(e))throw new Jt("InvalidParam",`varint exceeds safe integer range: ${e}`);const t=[];let n=e;for(;n>=128;)t.push(127&n|128),n=Math.floor(n/128);return t.push(127&n),new Uint8Array(t)}function sn(e,t=0){let n=0,i=1,r=t,o=0;for(;r<e.length;){const t=e[r++];o++;if(n+=(127&t)*i,!Number.isSafeInteger(n))throw new Jt("InvalidData","varint exceeds safe integer range");if(!(128&t))return[n,o];if(i*=128,o>10)throw new Jt("InvalidData","varint too long")}throw new Jt("InvalidData","varint truncated")}function cn(e){const t=new ce("SHA-256","UINT8ARRAY");return t.update(e),t.getHash("UINT8ARRAY")}function an(e){const t=new ce("SHA-256","TEXT",{encoding:"UTF8"});return t.update(e),t.getHash("UINT8ARRAY")}function un(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(!(n<55296||n>57343)){if(n<=56319){const n=e.charCodeAt(t+1);if(t+1<e.length&&n>=56320&&n<=57343){t++;continue}}throw new Jt("InvalidData","JSON string contains lone surrogate")}}}function hn(e){if(function(e){switch(typeof e){case"string":return void un(e);case"number":if(!Number.isFinite(e))throw new Jt("InvalidData","JSON number MUST be finite for JCS");if(Object.is(e,-0))throw new Jt("InvalidData","JSON number MUST NOT be negative zero for JCS");return;case"boolean":case"object":return;case"undefined":throw new Jt("InvalidData","undefined is not a valid JSON value");case"bigint":throw new Jt("InvalidData","bigint is not a valid JSON value");case"function":throw new Jt("InvalidData","function is not a valid JSON value");case"symbol":throw new Jt("InvalidData","symbol is not a valid JSON value")}}(e),null===e||"object"!=typeof e)return e;if(Array.isArray(e)){const t=new Array(e.length);for(let n=0;n<e.length;n++){if(!Object.prototype.hasOwnProperty.call(e,n))throw new Jt("InvalidData","sparse arrays are not valid JSON values");t[n]=hn(e[n])}return t}const t=Object.keys(e).sort(),n={};for(const i of t)un(i),n[i]=hn(e[i]);return n}function ln(e){const t=hn(e),n=At(t);if(void 0===n)throw new Jt("InvalidData","failed to canonicalize JSON value");return n}const dn={Sha256:"sha256",Sha512:"sha512",QCID:"qcid",Blake2s256:"blake2s256",Keccak256:"keccak256",hashResultSize(e){switch(e){case"sha256":case"qcid":case"blake2s256":case"keccak256":return 32;case"sha512":return 64}},parse(e){const t=e.startsWith("mix");return[dn.fromString(e),t]},fromString(e){switch(e){case"sha256":case"mix256":return"sha256";case"sha512":case"mix512":return"sha512";case"qcid":case"mixqcid":return"qcid";case"blake2s256":case"mixblake2s256":return"blake2s256";case"keccak256":case"mixkeccak256":return"keccak256";default:throw new Jt("InvalidData",`Invalid hash method: ${e}`)}}},fn={Sha256:"sha256",Mix256:"mix256",Sha512:"sha512",Mix512:"mix512",QCID:"qcid",Blake2s256:"blake2s256",MixBlake2s256:"mixblake2s256",Keccak256:"keccak256",MixKeccak256:"mixkeccak256",isChunkType(e){switch(e){case"sha256":case"mix256":case"sha512":case"mix512":case"qcid":case"blake2s256":case"mixblake2s256":case"keccak256":case"mixkeccak256":return!0;default:return!1}},isMix(e){switch(e){case"mix256":case"mix512":case"mixblake2s256":case"mixkeccak256":case"qcid":return!0;default:return!1}},fromHashType(e,t){switch(e){case"sha256":return t?"mix256":"sha256";case"sha512":return t?"mix512":"sha512";case"qcid":if(!t)throw new Jt("InvalidObjType","QCID must be mix hash");return"qcid";case"blake2s256":return t?"mixblake2s256":"blake2s256";case"keccak256":return t?"mixkeccak256":"keccak256"}},toHashMethod(e){switch(e){case"sha256":case"mix256":return"sha256";case"sha512":case"mix512":return"sha512";case"qcid":return"qcid";case"blake2s256":case"mixblake2s256":return"blake2s256";case"keccak256":case"mixkeccak256":return"keccak256";default:throw new Jt("InvalidObjType",`invalid chunk type: ${e}`)}}};class wn{constructor(e,t){this.objType=e,this.objHash=t}static fromString(e){const t=e.split(":");if(1===t.length){const e=rn(t[0]);let n=-1;for(let t=0;t<e.length;t++)if(58===e[t]){n=t;break}if(n<0)throw new Jt("InvalidId","separator ':' not found");const i=Kn(e.subarray(0,n)),r=e.slice(n+1);return new wn(i,r)}if(2===t.length)return new wn(t[0],en(t[1]));throw new Jt("InvalidId",e)}static fromBytes(e){if(e.length<3)throw new Jt("InvalidId","objid bytes too short");let t=-1;for(let r=0;r<e.length;r++)if(58===e[r]){t=r;break}if(t<0)throw new Jt("InvalidId","separator ':' not found");const n=Kn(e.subarray(0,t)),i=e.slice(t+1);return new wn(n,i)}static fromValue(e){if("string"==typeof e)return wn.fromString(e);throw new Jt("InvalidData","ObjId MUST be string")}static fromHostname(e){const t=e.split(".")[0];return wn.fromString(t)}static fromPath(e){const t=e.split("/");for(let n=0;n<t.length;n++){const e=t[n];if(0!==e.length)try{const i=wn.fromString(e);return n<t.length-1?{objId:i,subPath:"/"+t.slice(n+1).join("/")}:{objId:i,subPath:null}}catch{}}throw new Jt("InvalidId",`no objid found in path: ${e}`)}static fromRaw(e,t){return new wn(e,t)}isChunk(){return fn.isChunkType(this.objType)}isChunkList(){return this.objType===qt}isJson(){return!this.isChunk()&&!this.isContainer()&&this.objType!==Pt}isDirObject(){return this.objType===Kt}isFileObject(){return this.objType===Ct}isContainer(){switch(this.objType){case Kt:case Mt:case $t:case Ut:case Lt:case zt:case Ft:case Yt:case qt:case Wt:case Zt:return!0;default:return!1}}isBigContainer(){switch(this.objType){case Mt:case Ut:case zt:case Yt:case Wt:return!0;default:return!1}}toString(){return`${this.objType}:${Qt(this.objHash)}`}toFilename(){return`${Qt(this.objHash)}.${this.objType}`}toBase32(){return nn(this.toBytes())}toBytes(){const e=Cn(this.objType),t=new Uint8Array(e.length+1+this.objHash.length);return t.set(e,0),t[e.length]=58,t.set(this.objHash,e.length+1),t}toJSON(){return this.toString()}equals(e){if(this.objType!==e.objType)return!1;if(this.objHash.length!==e.objHash.length)return!1;for(let t=0;t<this.objHash.length;t++)if(this.objHash[t]!==e.objHash[t])return!1;return!0}}class pn{constructor(e,t){this.chunkType=e,this.hashResult=t}static defaultChunkType(){return"mix256"}static fromString(e){const t=wn.fromString(e);if(!t.isChunk())throw new Jt("InvalidId",`invalid chunk id: ${e}`);return new pn(t.objType,t.objHash)}static fromObjId(e){return new pn(e.objType,new Uint8Array(e.objHash))}static fromBytes(e){const t=wn.fromBytes(e);return new pn(t.objType,t.objHash)}static fromHashResult(e,t){return new pn(t,new Uint8Array(e))}static fromMixHashResult(e,t,n){return new pn(n,pn.mixLengthAndHashResult(e,t))}static fromMixHashResultByHashMethod(e,t,n){const i=fn.fromHashType(n,!0);return new pn(i,pn.mixLengthAndHashResult(e,t))}static fromSha256Result(e){return new pn("sha256",new Uint8Array(e))}static fromMix256Result(e,t){return new pn("mix256",pn.mixLengthAndHashResult(e,t))}static mixLengthAndHashResult(e,t){const n=on(e),i=new Uint8Array(n.length+t.length);return i.set(n,0),i.set(t,n.length),i}toObjId(){return new wn(this.chunkType,new Uint8Array(this.hashResult))}toString(){return`${this.chunkType}:${Qt(this.hashResult)}`}toBase32(){const e=Cn(this.chunkType),t=new Uint8Array(e.length+1+this.hashResult.length);return t.set(e,0),t[e.length]=58,t.set(this.hashResult,e.length+1),nn(t)}toDidString(){return`did:${this.chunkType}:${Qt(this.hashResult)}`}toBytes(){return this.toObjId().toBytes()}toJSON(){return this.toString()}getLength(){if(0===this.hashResult.length)return null;if(!fn.isMix(this.chunkType))return null;try{const[e]=sn(this.hashResult,0);return e}catch{return null}}equalsHash(e){if(this.hashResult.length!==e.length)return!1;for(let t=0;t<this.hashResult.length;t++)if(this.hashResult[t]!==e[t])return!1;return!0}}class mn{genObjId(){return bn(this.getObjType(),this.toJSON())}}function yn(e,t){const n=an(t);return wn.fromRaw(e,n)}function bn(e,t){const n=ln(t);return[yn(e,n),n]}function gn(e,t){const[n]=bn(e.objType,t);return e.equals(n)}function vn(e){if(e.indexOf("{")>=0)try{return JSON.parse(e)}catch(t){throw new Jt("InvalidId",`failed to parse obj_str: ${t.message}`)}throw new Jt("Unsupported","JWT-encoded named objects are not supported in this TypeScript port")}class _n{constructor(e={}){this.did=e.did??null,this.name=e.name??"",this.author=e.author??"",this.owner=e.owner??"",this.create_time=e.create_time??0,this.last_update_time=e.last_update_time??0,this.copyright=e.copyright??null,this.tags=e.tags??[],this.categories=e.categories??[],this.base_on=e.base_on??null,this.directory=e.directory??{},this.references=e.references??{},this.exp=e.exp??0}toJSON(){const e={};return null!=this.did&&(e.did=this.did),this.name.length>0&&(e.name=this.name),this.author.length>0&&(e.author=this.author),this.owner.length>0&&(e.owner=this.owner),e.create_time=this.create_time,e.last_update_time=this.last_update_time,null!=this.copyright&&(e.copyright=this.copyright),this.tags.length>0&&(e.tags=this.tags),this.categories.length>0&&(e.categories=this.categories),null!=this.base_on&&(e.base_on=this.base_on.toString()),Object.keys(this.directory).length>0&&(e.directory=this.directory),Object.keys(this.references).length>0&&(e.references=this.references),0!==this.exp&&(e.exp=this.exp),e}}function In(){return Math.floor(Date.now()/1e3)}class jn extends mn{constructor(e,t,n){super(),this.content_obj=new _n({name:e}),this.size=t,this.content=n,this.meta={}}static fromJSON(e){const t=new jn("",0,""),n={},i={},r=new Set(["did","name","author","owner","create_time","last_update_time","copyright","tags","categories","base_on","directory","references","exp"]);for(const[o,s]of Object.entries(e))"size"===o?t.size=s??0:"content"===o?t.content=s??"":r.has(o)?"base_on"===o&&"string"==typeof s?n.base_on=wn.fromString(s):n[o]=s:i[o]=s;return t.content_obj=new _n(n),t.meta=i,t}getObjType(){return Ct}toJSON(){const e={...this.content_obj.toJSON()};0!==this.size&&(e.size=this.size),this.content.length>0&&(e.content=this.content);for(const[t,n]of Object.entries(this.meta))e[t]=n;return e}}class Sn extends mn{constructor(e,t,n,i){super();const r=In();this.path=e,this.target=t,this.uptime=n??r,this.exp=i??r+94608e3}static fromJSON(e){const t=String(e.path??""),n=wn.fromString(String(e.target??"")),i=Number(e.uptime??0),r=Number(e.exp??0);return new Sn(t,n,i,r)}getObjType(){return Bt}toJSON(){return{path:this.path,uptime:this.uptime,target:this.target.toString(),exp:this.exp}}}class kn extends mn{constructor(e,t,n,i,r){super();const o=In();this.content_id=e.toString(),this.content_obj=t,this.curator=n,this.editor=[],this.meta=null,this.rank=i,this.collection=r,this.review_url=null,this.iat=o,this.exp=o+31104e3}static fromJSON(e){const t=new kn(wn.fromString(String(e.content_id??"")),e.content_obj??null,String(e.curator??""),Number(e.rank??0),Array.isArray(e.collection)?e.collection.slice():[]);return t.content_id=String(e.content_id??""),t.editor=Array.isArray(e.editor)?e.editor.slice():[],t.meta=e.meta??null,t.review_url="string"==typeof e.review_url?e.review_url:null,t.iat=Number(e.iat??0),t.exp=Number(e.exp??0),t}getObjType(){return Ht}toJSON(){const e={content_id:this.content_id,content_obj:this.content_obj,curator:this.curator,editor:this.editor,meta:this.meta,rank:this.rank,iat:this.iat,exp:this.exp};return this.collection.length>0&&(e.collection=this.collection),null!=this.review_url&&(e.review_url=this.review_url),e}}const On={fromObjId:e=>({kind:"objId",objId:e}),fromObject:(e,t)=>({kind:"object",objType:e,obj:t}),fromObjectJwt:(e,t)=>({kind:"objectJwt",objType:e,jwt:t}),getObjType(e){switch(e.kind){case"objId":return e.objId.objType;case"object":case"objectJwt":return e.objType}},getObjId(e){switch(e.kind){case"objId":return[e.objId,""];case"object":return bn(e.objType,e.obj);case"objectJwt":throw new Jt("Unsupported","JWT-encoded SimpleMapItem requires JWT decoding (not implemented in TS port)")}},toJSON(e){switch(e.kind){case"objId":return e.objId.toString();case"object":return{obj_type:e.objType,body:e.obj};case"objectJwt":return{obj_type:e.objType,jwt:e.jwt}}},fromJSON(e){if("string"==typeof e)return{kind:"objId",objId:wn.fromString(e)};if(e&&"object"==typeof e&&!Array.isArray(e)){const t=e,n=t.obj_type;if("string"!=typeof n)throw new Jt("InvalidData","SimpleMapItem must have obj_type field");if("string"==typeof t.jwt)return{kind:"objectJwt",objType:n,jwt:t.jwt};if("body"in t)return{kind:"object",objType:n,obj:t.body};throw new Jt("InvalidData","SimpleMapItem must have body or jwt field")}throw new Jt("InvalidData","SimpleMapItem must be string or object")}};class xn{constructor(){this.body=new Map}static fromJSON(e){const t=new xn;if(!e||"object"!=typeof e)throw new Jt("InvalidData","SimpleObjectMap must be an object");const n=e.body;if(null==n)return t;if("object"!=typeof n||Array.isArray(n))throw new Jt("InvalidData","SimpleObjectMap.body must be an object");for(const[i,r]of Object.entries(n))t.body.set(i,On.fromJSON(r));return t}genObjIdWithRealObj(e,t){const n={};for(const[i,r]of this.body){const[e]=On.getObjId(r);n[i]=e.toString()}return t.body=n,bn(e,t)}get size(){return this.body.size}isEmpty(){return 0===this.body.size}get(e){return this.body.get(e)}set(e,t){this.body.set(e,t)}delete(e){return this.body.delete(e)}has(e){return this.body.has(e)}keys(){return this.body.keys()}values(){return this.body.values()}entries(){return this.body.entries()}toJSON(){const e={};for(const[t,n]of this.body)e[t]=On.toJSON(n);return{body:e}}}class En extends mn{constructor(e){super(),this.content_obj=null!=e?new _n({name:e}):new _n,this.meta={},this.total_size=0,this.file_count=0,this.file_size=0,this.object_map=new xn}static fromJSON(e){const t=new En,n=new Set(["did","name","author","owner","create_time","last_update_time","copyright","tags","categories","base_on","directory","references","exp"]),i={};for(const[r,o]of Object.entries(e))if("meta"===r)t.meta=o??{};else if("total_size"===r)t.total_size=Number(o??0);else if("file_count"===r)t.file_count=Number(o??0);else if("file_size"===r)t.file_size=Number(o??0);else if("body"===r){const e=o;if(e)for(const[n,i]of Object.entries(e))t.object_map.set(n,On.fromJSON(i))}else n.has(r)&&("base_on"===r&&"string"==typeof o?i.base_on=wn.fromString(o):i[r]=o);return t.content_obj=new _n(i),t}getObjType(){return Kt}toJSON(){const e={...this.content_obj.toJSON()};return Object.keys(this.meta).length>0&&(e.meta=this.meta),e.total_size=this.total_size,e.file_count=this.file_count,e.file_size=this.file_size,e.body=this.object_map.toJSON().body,e}genObjId(){const e={...this.content_obj.toJSON()};return e.total_size=this.total_size,e.file_count=this.file_count,e.file_size=this.file_size,this.object_map.genObjIdWithRealObj(Kt,e)}get size(){return this.object_map.size}isEmpty(){return this.object_map.isEmpty()}get(e){return this.object_map.get(e)}delete(e){return this.object_map.delete(e)}has(e){return this.object_map.has(e)}keys(){return this.object_map.keys()}values(){return this.object_map.values()}entries(){return this.object_map.entries()}addFile(e,t,n){this.file_size+=n,this.file_count+=1,this.total_size+=n,this.object_map.set(e,On.fromObject(Ct,t))}addDirectory(e,t,n){if(t.objType!==Kt)throw new Jt("InvalidParam","dir_obj_id is not a directory");this.total_size+=n,this.object_map.set(e,On.fromObjId(t))}listEntries(){return Array.from(this.object_map.keys())}isFile(e){const t=this.object_map.get(e);return!!t&&("object"===t.kind&&t.objType===Ct)}isDirectory(e){const t=this.object_map.get(e);if(!t)return!1;switch(t.kind){case"objId":return t.objId.objType===Kt;case"objectJwt":return t.objType===Kt;default:return!1}}}class Nn{constructor(){this.total_size=0,this.body=[]}static fromChunkList(e){const t=new Nn;for(const n of e){const e=n.getLength();if(null==e)throw new Jt("InvalidParam","get chunk length from chunkid failed");t.total_size+=e}return t.body=e.slice(),t}static fromJson(e){let t;try{t=JSON.parse(e)}catch(n){throw new Jt("InvalidParam",`parse chunk list from json failed: ${n.message}`)}return Nn.fromJsonValue(t)}static fromJsonValue(e){if(!Array.isArray(e))throw new Jt("InvalidParam","chunk list must be a JSON array");const t=e.map((e=>{if("string"!=typeof e)throw new Jt("InvalidParam","chunk list item must be a string");return pn.fromString(e)}));return Nn.fromChunkList(t)}appendChunk(e){const t=e.getLength();if(null==t)throw new Jt("InvalidParam","get chunk length from chunkid failed");this.body.push(e),this.total_size+=t}genObjId(){const e=this.body.map((e=>e.toString())),[t,n]=bn(qt,e),i=pn.mixLengthAndHashResult(this.total_size,t.objHash);return[wn.fromRaw(qt,i),n]}}class Tn extends mn{constructor(e,t,n,i={}){super(),this.source=e,this.relation=t,this.target=n,this.body=i,this.iat=null,this.exp=null}static fromJSON(e){const t=new Set(["source","relation","target","iat","exp"]),n={};for(const[r,o]of Object.entries(e))t.has(r)||(n[r]=o);const i=new Tn(wn.fromString(String(e.source??"")),String(e.relation??""),wn.fromString(String(e.target??"")),n);return i.iat="number"==typeof e.iat?e.iat:null,i.exp="number"==typeof e.exp?e.exp:null,i}static createByLinkData(e,t){switch(t.kind){case"sameAs":return new Tn(e,Gt,t.target);case"partOf":return new Tn(e,Vt,t.target,{range:{start:t.range.start,end:t.range.end}})}}getLinkData(){switch(this.relation){case Gt:return{kind:"sameAs",target:this.target};case Vt:{const e=this.body.range;if(!e||"number"!=typeof e.start||"number"!=typeof e.end)throw new Jt("InvalidLink",`invalid range: ${JSON.stringify(this.body.range)}`);return{kind:"partOf",target:this.target,range:{start:e.start,end:e.end}}}default:throw new Jt("InvalidLink",`invalid relation: ${this.relation}`)}}getObjType(){return Rt}toJSON(){const e={source:this.source.toString(),relation:this.relation,target:this.target.toString()};for(const[t,n]of Object.entries(this.body))e[t]=n;return null!=this.iat&&(e.iat=this.iat),null!=this.exp&&(e.exp=this.exp),e}}const Dn={fromObjData(e,t){switch(e.objType){case Kt:{let e;try{e=JSON.parse(t)}catch(n){throw new Jt("InvalidParam",`parse dir object from json failed: ${n.message}`)}return{kind:"dir",obj:En.fromJSON(e),objStr:t}}case Ct:{let e;try{e=JSON.parse(t)}catch(n){throw new Jt("InvalidParam",`parse file object from json failed: ${n.message}`)}return{kind:"file",obj:jn.fromJSON(e),objStr:t}}case qt:return{kind:"chunkList",obj:Nn.fromJson(t),objStr:t};default:throw new Jt("InvalidParam",`Unknown object type: ${e.objType}`)}},getChildObjs(e){switch(e.kind){case"dir":{const t=[];for(const[,n]of e.obj.entries()){const[e,i]=On.getObjId(n);t.push({objId:e,objStr:i.length>0?i:null})}return t}case"file":return 0===e.obj.content.length?[]:[{objId:wn.fromString(e.obj.content),objStr:null}];case"chunkList":return e.obj.body.map((e=>({objId:e.toObjId(),objStr:null})))}}},An="undefined"!=typeof TextEncoder?new TextEncoder:null,Jn="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):null;function Cn(e){if(An)return An.encode(e);const t=[];for(let n=0;n<e.length;n++){let i=e.charCodeAt(n);if(i<128)t.push(i);else if(i<2048)t.push(192|i>>6,128|63&i);else if(i>=55296&&i<=56319&&n+1<e.length){const r=65536+((1023&i)<<10|1023&e.charCodeAt(++n));t.push(240|r>>18,128|r>>12&63,128|r>>6&63,128|63&r)}else t.push(224|i>>12,128|i>>6&63,128|63&i)}return new Uint8Array(t)}function Kn(e){if(Jn)return Jn.decode(e);let t="",n=0;for(;n<e.length;){const i=e[n++];if(i<128)t+=String.fromCharCode(i);else if(i<224)t+=String.fromCharCode((31&i)<<6|63&e[n++]);else if(i<240)t+=String.fromCharCode((15&i)<<12|(63&e[n++])<<6|63&e[n++]);else{const r=((7&i)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++])-65536;t+=String.fromCharCode(55296+(r>>10),56320+(1023&r))}}return t}const Bn=Object.freeze(Object.defineProperty({__proto__:null,BaseContentObject:_n,ChunkId:pn,ChunkType:fn,DEFAULT_HASH_METHOD:"sha256",DirObject:En,FileObject:jn,HashMethod:dn,InclusionProof:kn,KnownStandardObject:Dn,NamedObjectBase:mn,NdnError:Jt,OBJ_TYPE_ACTION:"cyact",OBJ_TYPE_CHUNK_LIST:Yt,OBJ_TYPE_CHUNK_LIST_FIX_SIZE:Wt,OBJ_TYPE_CHUNK_LIST_SIMPLE:qt,OBJ_TYPE_CHUNK_LIST_SIMPLE_FIX_SIZE:Zt,OBJ_TYPE_DIR:Kt,OBJ_TYPE_FILE:Ct,OBJ_TYPE_INCLUSION_PROOF:Ht,OBJ_TYPE_LIST:zt,OBJ_TYPE_LIST_SIMPLE:Ft,OBJ_TYPE_MSG:"cymsg",OBJ_TYPE_MSG_RECE:"cymsgr",OBJ_TYPE_OBJMAP:Ut,OBJ_TYPE_OBJMAP_SIMPLE:Lt,OBJ_TYPE_PACK:Pt,OBJ_TYPE_PATH:Bt,OBJ_TYPE_PKG:"pkg",OBJ_TYPE_RELATION:Rt,OBJ_TYPE_TRIE:Mt,OBJ_TYPE_TRIE_SIMPLE:$t,ObjId:wn,PathObject:Sn,RELATION_TYPE_PART_OF:Vt,RELATION_TYPE_SAME:Gt,RelationObject:Tn,SimpleChunkList:Nn,SimpleMapItem:On,SimpleObjectMap:xn,base32Decode:rn,base32Encode:nn,buildNamedObjectByJson:bn,buildObjId:yn,bytesToHex:Qt,canonicalizeJson:hn,extractObjIdByPath:function(e,t){const n=t.split("/").filter((e=>e.length>0));let i=e;for(const o of n){if(null==i)throw new Jt("InvalidParam",`objid path not found: ${t}`);if(Array.isArray(i)){const e=Number(o);if(!Number.isInteger(e)||e<0||e>=i.length)throw new Jt("InvalidParam",`objid path not found: ${t}`);i=i[e]}else{if("object"!=typeof i)throw new Jt("InvalidParam",`objid path not found: ${t}`);if(!(o in i))throw new Jt("InvalidParam",`objid path not found: ${t}`);i=i[o]}}try{return wn.fromValue(i)}catch(r){throw new Jt("InvalidData",`invalid objid at path ${t}: ${r.message}`)}},hexToBytes:en,loadNamedObj:function(e){return vn(e)},loadNamedObjAndVerify:function(e,t){const n=vn(t);if(!gn(e,n))throw new Jt("InvalidId",`verify named object failed for obj_id: ${e.toString()}`);return n},loadNamedObjectFromObjStr:vn,sha256Bytes:cn,sha256Utf8:an,toCanonicalJsonString:ln,varintDecode:sn,varintEncode:on,verifyNamedObject:gn,verifyNamedObjectFromStr:function(e,t){let n;try{n=JSON.parse(t)}catch(i){throw new Jt("InvalidId",`failed to parse obj_str: ${i.message}`)}if(!gn(e,n))throw new Jt("InvalidId",`verify named object failed: ${t}`);return n}},Symbol.toStringTag,{value:"Module"}));exports.ChunkId=pn,exports.DEFAULT_EXPIRE_TIME=_e,exports.DID=qe,exports.DID_OBJECT_SERVICE_ID="#did-object",exports.DID_OBJECT_SERVICE_TYPE=ae,exports.DirObject=En,exports.FileObject=jn,exports.NODE_IDENTITY_SCHEMA_V2=ue,exports.ObjId=wn,exports.SimpleChunkList=Nn,exports.buckyosGetUnixTimestamp=Se,exports.buildNamedObjectByJson=bn,exports.canonicalize=At,exports.commonjsGlobal=Tt,exports.createJwkByX=Me,exports.decodeJwtClaimWithoutVerify=Ue,exports.deviceDocumentToOrderedJson=bt,exports.deviceMiniDocumentToJwt=ft,exports.encodeDeviceDocument=ut,exports.encodeZoneBootDocument=ot,exports.getDefaultExportFromCjs=Dt,exports.getDidIdentifier=function(e){if("string"!=typeof e||!e.startsWith("did:"))return null;const t=e.split(":");return t.length>=3?t.slice(2).join(":"):null},exports.getDidMethod=function(e){if("string"!=typeof e||!e.startsWith("did:"))return null;const t=e.split(":");return t.length>=3?t[1]:null},exports.ht=ce,exports.isBuckyOSAgentDocument=me,exports.isBuckyOSDIDObjectCard=be,exports.isBuckyOSDeviceDocument=pe,exports.isBuckyOSDeviceMiniDocument=we,exports.isBuckyOSLocalNodeIdentityConfig=function(e){return he(e)&&e.schema===ue&&"string"==typeof e.zone_did&&"string"==typeof e.owner_did&&he(e.owner_public_key)&&"string"==typeof e.device_name&&"string"==typeof e.device_did&&"number"==typeof e.zone_iat},exports.isBuckyOSNodeIdentityConfig=function(e){return he(e)&&"string"==typeof e.zone_did&&he(e.owner_public_key)&&"string"==typeof e.owner_did&&"string"==typeof e.device_doc_jwt&&"string"==typeof e.device_mini_doc_jwt&&"number"==typeof e.zone_iat},exports.isBuckyOSOwnerDocument=fe,exports.isBuckyOSZoneBootDocument=function(e){return he(e)&&Array.isArray(e.oods)&&e.oods.every((e=>"string"==typeof e))&&"number"==typeof e.exp},exports.isBuckyOSZoneConfig=function(e){return he(e)&&"string"==typeof e.zone_document},exports.isBuckyOSZoneDocument=ye,exports.isW3CDIDDocumentBase=de,exports.namelib=Nt,exports.ndn_types=Bn,exports.newDeviceDocumentByJwk=ct,exports.newDeviceDocumentByMiniDocument=at,exports.newDeviceMiniDocument=lt,exports.newDeviceMiniDocumentByDeviceDocument=dt,exports.newOwnerDocument=et,exports.newZoneBootDocument=rt,exports.newZoneDocument=it,exports.oodDescriptionToString=Ze,exports.ownerDocumentToOrderedJson=mt,exports.parseBuckyOSDIDDocument=function(e){return fe(e)||me(e)||pe(e)||ye(e)||be(e)?e:null},exports.parseBuckyOSDeviceMiniDocument=function(e){return we(e)?e:null},exports.parseBuckyOSOwnerDocument=function(e){return fe(e)?e:null},exports.parseOODDescription=We,exports.parseW3CDIDDocumentBase=function(e){return de(e)?e:null},exports.sha256Bytes=cn,exports.signJwtEdDSA=$e,exports.verifyJwtEdDSA=Le,exports.zoneDocumentToOrderedJson=yt;
|
|
2
|
-
//# sourceMappingURL=ndn_types-859bbd48.js.map
|