@blockcerts/blockcerts-verifier 1.62.0 → 1.62.2
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/bundle-stats.html +2 -2
- package/dist/EcdsaSd2023-jnIXPui8-Ecil79Z6.js +36 -0
- package/dist/EcdsaSecp256k1Signature2019-CBV4BwnM-C2qGlq2W.js +4 -0
- package/dist/{Ed25519Signature2020-CL2yKnJW-NRYSGvkI.js → Ed25519Signature2020-MQoWd113-PNuci9U2.js} +5 -5
- package/dist/{HashlinkVerifier-MEwSZe4T-BdYYAALa.js → HashlinkVerifier-DykIKn5i-CYewU55u.js} +3 -3
- package/dist/{MerkleProof2017-CNSx436a-FBaGRIN1.js → MerkleProof2017-Cy_nkz4C-gnoFFWMW.js} +1 -1
- package/dist/{MerkleProof2017-MZJbBTpc-B7HRJzRg.js → MerkleProof2017-MZJbBTpc-CeZmtqCh.js} +3 -3
- package/dist/MerkleProof2019-DpwH-snR-ClzVR6uC.js +3 -0
- package/dist/checkCredentialSchemaConformity-DOGmtCq0-CnEpCN-s.js +1 -0
- package/dist/{checkRevocationStatusList2021-Cy-rWyh7-CVOeAbdp.js → checkRevocationStatusList2021-CNtaPjVp-XCu3zkCJ.js} +5 -5
- package/dist/{controlVerificationMethod-CXzAI0QS-b45qIaR4.js → controlVerificationMethod-BxseSDWK-Ghg2o_Hj.js} +1 -1
- package/dist/{did-key-common.esm-CJj7pea6-Er8YwHoJ.js → did-key-common.esm-C42sQiXe-DN5hgDGM.js} +3 -3
- package/dist/{did-key-ed25519.esm-hEATvNhJ-CHAq7sf1.js → did-key-ed25519.esm-CO7qImeZ-BR5JRBUU.js} +1 -1
- package/dist/did-key-secp256k1.esm-BblZ1xRe-4Ak_uTKC.js +1 -0
- package/dist/downloadPDF-XZlmMePj.js +346 -0
- package/dist/elliptic-6eMlPaPZ-CGOSt2J1.js +1 -0
- package/dist/{ensureNotRevoked-gui-UMnE-CENgoep9.js → ensureNotRevoked-gui-UMnE-DnVNmhNy.js} +1 -1
- package/dist/index-C-APorIs.js +2 -0
- package/dist/index-Dzjg2qbR-DK7tzt5T.js +22 -0
- package/dist/{jsonld-signatures-zDEkNjYR-D3vK8GYH.js → index-VOqA2-xz-CKqwdkuf.js} +14 -10
- package/dist/index-WN144sZ6-DKm58evR.js +3 -0
- package/dist/index.es-B13oYDrC.js +56 -0
- package/dist/{jsonld-Pr6hPH-i-D_C9ciG_.js → jsonld-BpvX3DRL-qZrjsUmJ.js} +3 -3
- package/dist/main.js +109 -109
- package/dist/pako.esm-DnD5dZGi-Bw1vqMku.js +2 -0
- package/dist/purify-hA3K4SAZ.js +2 -0
- package/dist/retrieveVerificationMethodPublicKey-fVSjg83n-B4VhVtVk.js +1 -0
- package/dist/webcrypto.es-DQnPRx8R-BJSH271h.js +41 -0
- package/package.json +8 -7
- package/dist/EcdsaSecp256k1Signature2019-aV3C41Ue-_mP0Wq_n.js +0 -4
- package/dist/MerkleProof2019-DnbP3r0f-Cp4GWjQh.js +0 -3
- package/dist/checkCredentialSchemaConformity-QPmIWPLG-De1kKyvF.js +0 -1
- package/dist/did-key-secp256k1.esm-CIEM56eq-EQahxyFZ.js +0 -1
- package/dist/downloadPDF-B1DL4u2a.js +0 -346
- package/dist/elliptic-DVE5q-l5-D-NH8siB.js +0 -1
- package/dist/index-CfIOMbD1.js +0 -2
- package/dist/index-DUjMpuQT-ZifknGWx.js +0 -5
- package/dist/index-DWAZG7Ja-CBt_boC3.js +0 -3
- package/dist/index.es-D8QzgW47.js +0 -56
- package/dist/pako.esm-DnD5dZGi-HambcU-w.js +0 -2
- package/dist/purify-C5H8D62I.js +0 -2
- /package/dist/{ensureNotRevoked-bD_ITwQb-DvMIgM4L.js → ensureNotRevoked-D9_PlMpD-DvMIgM4L.js} +0 -0
- /package/dist/{ensureValidIssuingKey-wRebznsK-frafTbMl.js → ensureValidIssuingKey-C7MTkDyV-frafTbMl.js} +0 -0
- /package/dist/{index-yP42zfkJ-CHN5LgUq.js → index-BZds3Ljo-CHN5LgUq.js} +0 -0
- /package/dist/{index-CcA_A5fd-Dgus2xdV.js → index-CWugL4dz-Dgus2xdV.js} +0 -0
- /package/dist/{sha256-wKiO0px2-BYFBxJ7m.js → sha256-D_qJpPFT-BYFBxJ7m.js} +0 -0
- /package/dist/{x25519-BzvT3haI-DcUk09rC.js → x25519-Dm-l65ld-DcUk09rC.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,u as t,t as n,g as o}from"./main.js";var a={},r=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:o}=this;return new e(t,new Map(n),o)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}};!function(e
|
|
1
|
+
import{a as e,u as t,t as n,g as o}from"./main.js";var a={},r=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:o}=this;return new e(t,new Map(n),o)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}};!function(e){if(!e.setImmediate){var t,o,a,r,i,s=1,l={},c=!1,d=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?t=function(e){n((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){h(e.data)},t=function(e){a.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(o=d.documentElement,t=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):t=function(e){setTimeout(h,0,e)}:(r="setImmediate$"+Math.random()+"$",i=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(r)&&h(+t.data.slice(r.length))},e.addEventListener?e.addEventListener("message",i,!1):e.attachEvent("onmessage",i),t=function(t){e.postMessage(r+t,"*")}),u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var n=new Array(arguments.length-1),o=0;o<n.length;o++)n[o]=arguments[o+1];var a={callback:e,args:n};return l[s]=a,t(s),s++},u.clearImmediate=p}function p(e){delete l[e]}function h(e){if(c)setTimeout(h,0,e);else{var t=l[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{p(e),c=!1}}}}}("undefined"==typeof self?e:self);
|
|
2
2
|
/*!
|
|
3
3
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
4
4
|
*/
|
|
@@ -13,13 +13,13 @@ const c="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",d="http://www.w3
|
|
|
13
13
|
/*!
|
|
14
14
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
15
15
|
*/
|
|
16
|
-
const b=r,w=s,j=l,I=g;var N=class{constructor({createMessageDigest:e=(
|
|
16
|
+
const b=r,w=s,j=l,I=g;var N=class{constructor({createMessageDigest:e=()=>new w("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new b("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];let o=0;for(const e of n)++o%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const a=[...t.keys()].sort(),r=[];for(const e of a){const n=t.get(e);if(n.length>1){r.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of r){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new b("_:b");e.getId(n);const o=await this.hashNDegreeQuads(n,e);t.push(o)}t.sort(S);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const i=[];for(const e of this.quads){const t=I.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));i.push(t)}return i.sort(),i.join("")}async hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o){const o={subject:null,predicate:n.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),o.object=this.modifyFirstDegreeComponent(e,n.object,"object"),o.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(I.serializeQuad(o))}t.sort();const a=this.createMessageDigest();for(const e of t)a.update(e);return n.hash=await a.digest(),n.hash}async hashRelatedBlankNode(e,t,n,o){let a;a=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const r=this.createMessageDigest();return r.update(o),"g"!==o&&r.update(this.getRelatedPredicate(t)),r.update(a),r.digest()}async hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const o=this.createMessageDigest(),a=await this.createHashToRelated(e,t),r=[...a.keys()].sort();for(const e of r){o.update(e);let n,r="";const i=new j(a.get(e));let s=0;for(;i.hasNext();){const e=i.next();++s%3==0&&await this._yield();let o=t.clone(),a="";const l=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?a+=this.canonicalIssuer.getId(t):(o.hasId(t)||l.push(t),a+=o.getId(t)),0!==r.length&&a>r){c=!0;break}if(!c){for(const e of l){const t=await this.hashNDegreeQuads(e,o);if(a+=o.getId(e),a+=`<${t.hash}>`,o=t.issuer,0!==r.length&&a>r){c=!0;break}}c||(0===r.length||a<r)&&(r=a,n=o)}}o.update(r),t=n}return{hash:await o.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;let a=0;for(const r of o)++a%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:r,component:r.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:r,component:r.graph,position:"g",id:e,issuer:t,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=await this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:a,hashToRelated:r}){if("BlankNode"!==t.termType||t.value===o)return;const i=t.value,s=await this.hashRelatedBlankNode(i,e,a,n),l=r.get(s);l?l.push(i):r.set(s,[i])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}};function S(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}
|
|
17
17
|
/*!
|
|
18
18
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
19
19
|
*/const O=s,E=N;var D=class extends E{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new O("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;let a=0;for(const r of o){let o,i;if("BlankNode"===r.subject.termType&&r.subject.value!==e)i=r.subject.value,o="p";else{if("BlankNode"!==r.object.termType||r.object.value===e)continue;i=r.object.value,o="r"}++a%100==0&&await this._yield();const s=await this.hashRelatedBlankNode(i,r,t,o),l=n.get(s);l?l.push(i):n.set(s,[i])}return n}};
|
|
20
20
|
/*!
|
|
21
21
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
22
|
-
*/const k=r,C=s,L=l,R=g;var T=class{constructor({createMessageDigest:e=(
|
|
22
|
+
*/const k=r,C=s,L=l,R=g;var T=class{constructor({createMessageDigest:e=()=>new C("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new k("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),a=[];for(const e of o){const n=t.get(e);if(n.length>1){a.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of a){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new k("_:b");e.getId(n);const o=this.hashNDegreeQuads(n,e);t.push(o)}t.sort(A);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const r=[];for(const e of this.quads){const t=R.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));r.push(t)}return r.sort(),r.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),o=n.quads;for(const n of o){const o={subject:null,predicate:n.predicate,object:null,graph:null};o.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),o.object=this.modifyFirstDegreeComponent(e,n.object,"object"),o.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(R.serializeQuad(o))}t.sort();const a=this.createMessageDigest();for(const e of t)a.update(e);return n.hash=a.digest(),n.hash}hashRelatedBlankNode(e,t,n,o){let a;a=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const r=this.createMessageDigest();return r.update(o),"g"!==o&&r.update(this.getRelatedPredicate(t)),r.update(a),r.digest()}hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const o=this.createMessageDigest(),a=this.createHashToRelated(e,t),r=[...a.keys()].sort();for(const e of r){o.update(e);let n,r="";const i=new L(a.get(e));for(;i.hasNext();){const e=i.next();let o=t.clone(),a="";const s=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?a+=this.canonicalIssuer.getId(t):(o.hasId(t)||s.push(t),a+=o.getId(t)),0!==r.length&&a>r){l=!0;break}if(!l){for(const e of s){const t=this.hashNDegreeQuads(e,o);if(a+=o.getId(e),a+=`<${t.hash}>`,o=t.issuer,0!==r.length&&a>r){l=!0;break}}l||(0===r.length||a<r)&&(r=a,n=o)}}o.update(r),t=n}return{hash:o.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const a of o)this._addRelatedBlankNodeHash({quad:a,component:a.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.graph,position:"g",id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=this.hashFirstDegreeQuads(e),o=t.get(n);o?o.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const n=t.value,o=this.blankNodeInfo.get(n);o?o.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:o,issuer:a,hashToRelated:r}){if("BlankNode"!==t.termType||t.value===o)return;const i=t.value,s=this.hashRelatedBlankNode(i,e,a,n),l=r.get(s);l?l.push(i):r.set(s,[i])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}};function A(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}
|
|
23
23
|
/*!
|
|
24
24
|
* Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
|
|
25
25
|
*/const _=s,M=T;var J=class extends M{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new _("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,o=this.blankNodeInfo.get(e).quads;for(const a of o){let o,r;if("BlankNode"===a.subject.termType&&a.subject.value!==e)r=a.subject.value,o="p";else{if("BlankNode"!==a.object.termType||a.object.value===e)continue;r=a.object.value,o="r"}const i=this.hashRelatedBlankNode(r,a,t,o),s=n.get(i);s?s.push(r):n.set(i,[r])}return n}},P=t(Object.freeze({__proto__:null,default:{}}));!function(e){const t=N,n=D,o=T,a=J;let i;try{i=P}catch(e){}function s(t){return Array.isArray(t)?t:e.NQuads.legacyDatasetToQuads(t)}e.NQuads=g,e.IdentifierIssuer=r,e._rdfCanonizeNative=function(e){return e&&(i=e),i},e.canonize=async function(e,o){const a=s(e);if(o.useNative){if(!i)throw new Error("rdf-canonize-native not available");if(o.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((e,t)=>i.canonize(a,o,((n,o)=>n?t(n):e(o)))))}if("URDNA2015"===o.algorithm)return new t(o).main(a);if("URGNA2012"===o.algorithm){if(o.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new n(o).main(a)}if(!("algorithm"in o))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+o.algorithm)},e._canonizeSync=function(e,t){const n=s(e);if(t.useNative){if(!i)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return i.canonizeSync(n,t)}if("URDNA2015"===t.algorithm)return new o(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new a(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}}(a);var B=a;const H={};var F=H;H.isArray=Array.isArray,H.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),H.isDouble=e=>H.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),H.isEmptyObject=e=>H.isObject(e)&&0===Object.keys(e).length,H.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),H.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),H.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),H.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),H.isUndefined=e=>void 0===e;const q=F,U={};var V=U;U.isSubject=e=>{if(q.isObject(e)&&!("@value"in e||"@set"in e||"@list"in e)){return Object.keys(e).length>1||!("@id"in e)}return!1},U.isSubjectReference=e=>q.isObject(e)&&1===Object.keys(e).length&&"@id"in e,U.isValue=e=>q.isObject(e)&&"@value"in e,U.isList=e=>q.isObject(e)&&"@list"in e,U.isGraph=e=>q.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,U.isSimpleGraph=e=>U.isGraph(e)&&!("@id"in e),U.isBlankNode=e=>{if(q.isObject(e)){if("@id"in e){const t=e["@id"];return!q.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1};var z=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}};const G=V,$=F,Q=B.IdentifierIssuer,X=z,W=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,K=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,Z=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,Y={accept:"application/ld+json, application/json"},ee={};var te=ee;function ne(e,t){if($.isArray(t))for(let n=0;n<t.length;++n)t[n]=ne(e,t[n]);else if(G.isList(t))t["@list"]=ne(e,t["@list"]);else if($.isObject(t)){G.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const n=Object.keys(t).sort();for(let o=0;o<n.length;++o){const a=n[o];"@id"!==a&&(t[a]=ne(e,t[a]))}}return t}ee.IdentifierIssuer=Q,ee.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,ee.REGEX_KEYWORD=/^@[a-zA-Z]+$/,ee.clone=function(e){if(e&&"object"==typeof e){let t;if($.isArray(e)){t=[];for(let n=0;n<e.length;++n)t[n]=ee.clone(e[n])}else if(e instanceof Map){t=new Map;for(const[n,o]of e)t.set(n,ee.clone(o))}else if(e instanceof Set){t=new Set;for(const n of e)t.add(ee.clone(n))}else if($.isObject(e)){t={};for(const n in e)t[n]=ee.clone(e[n])}else t=e.toString();return t}return e},ee.asArray=function(e){return Array.isArray(e)?e:[e]},ee.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+Y.accept+'" is supported.');return Object.assign({Accept:Y.accept},e)},ee.parseLinkHeader=e=>{const t={},n=e.match(W);for(let e=0;e<n.length;++e){let o=n[e].match(K);if(!o)continue;const a={target:o[1]},r=o[2];for(;o=Z.exec(r);)a[o[1]]=void 0===o[2]?o[3]:o[2];const i=a.rel||"";Array.isArray(t[i])?t[i].push(a):t.hasOwnProperty(i)?t[i]=[t[i],a]:t[i]=a}return t},ee.validateTypeValue=(e,t)=>{if(!($.isString(e)||$.isArray(e)&&e.every((e=>$.isString(e))))){if(t&&$.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&ee.asArray(e["@default"]).every((e=>$.isString(e))))return}throw new X('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},ee.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!$.isArray(n)||n.length>0}return!1},ee.hasValue=(e,t,n)=>{if(ee.hasProperty(e,t)){let o=e[t];const a=G.isList(o);if($.isArray(o)||a){a&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(ee.compareValues(n,o[e]))return!0}else if(!$.isArray(n))return ee.compareValues(n,o)}return!1},ee.addValue=(e,t,n,o)=>{if("propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1),"valueIsArray"in o||(o.valueIsArray=!1),"allowDuplicate"in o||(o.allowDuplicate=!0),"prependValue"in o||(o.prependValue=!1),o.valueIsArray)e[t]=n;else if($.isArray(n)){0===n.length&&o.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),o.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let a=0;a<n.length;++a)ee.addValue(e,t,n[a],o)}else if(e.hasOwnProperty(t)){const a=!o.allowDuplicate&&ee.hasValue(e,t,n);$.isArray(e[t])||a&&!o.propertyIsArray||(e[t]=[e[t]]),a||(o.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=o.propertyIsArray?[n]:n},ee.getValues=(e,t)=>[].concat(e[t]||[]),ee.removeProperty=(e,t)=>{delete e[t]},ee.removeValue=(e,t,n,o)=>{"propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1);const a=ee.getValues(e,t).filter((e=>!ee.compareValues(e,n)));0===a.length?ee.removeProperty(e,t):1!==a.length||o.propertyIsArray?e[t]=a:e[t]=a[0]},ee.relabelBlankNodes=(e,t)=>ne((t=t||{}).issuer||new Q("_:b"),e),ee.compareValues=(e,t)=>e===t||(!(!G.isValue(e)||!G.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!($.isObject(e)&&"@id"in e&&$.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"]),ee.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1;const oe="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ae="http://www.w3.org/2001/XMLSchema#";var re,ie,se,le,ce={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:oe,RDF_LIST:oe+"List",RDF_FIRST:oe+"first",RDF_REST:oe+"rest",RDF_NIL:oe+"nil",RDF_TYPE:oe+"type",RDF_PLAIN_LITERAL:oe+"PlainLiteral",RDF_XML_LITERAL:oe+"XMLLiteral",RDF_JSON_LITERAL:oe+"JSON",RDF_OBJECT:oe+"object",RDF_LANGSTRING:oe+"langString",XSD:ae,XSD_BOOLEAN:ae+"boolean",XSD_DOUBLE:ae+"double",XSD_INTEGER:ae+"integer",XSD_STRING:ae+"string"};function de(){return ie||(ie=1,re=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}),re}function ue(){if(le)return se;le=1;const e=F,t={};se=t,t.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},t.parse=(e,n)=>{const o={},a=t.parsers[n||"full"],r=a.regex.exec(e);let i=a.keys.length;for(;i--;)o[a.keys[i]]=void 0===r[i]?null:r[i];return("https"===o.scheme&&"443"===o.port||"http"===o.scheme&&"80"===o.port)&&(o.href=o.href.replace(":"+o.port,""),o.authority=o.authority.replace(":"+o.port,""),o.port=null),o.normalizedPath=t.removeDotSegments(o.path),o},t.prependBase=(n,o)=>{if(null===n)return o;if(t.isAbsolute(o))return o;n&&!e.isString(n)||(n=t.parse(n||""));const a=t.parse(o),r={protocol:n.protocol||""};if(null!==a.authority)r.authority=a.authority,r.path=a.path,r.query=a.query;else if(r.authority=n.authority,""===a.path)r.path=n.path,null!==a.query?r.query=a.query:r.query=n.query;else{if(0===a.path.indexOf("/"))r.path=a.path;else{let e=n.path;e=e.substr(0,e.lastIndexOf("/")+1),(e.length>0||n.authority)&&"/"!==e.substr(-1)&&(e+="/"),e+=a.path,r.path=e}r.query=a.query}""!==a.path&&(r.path=t.removeDotSegments(r.path));let i=r.protocol;return null!==r.authority&&(i+="//"+r.authority),i+=r.path,null!==r.query&&(i+="?"+r.query),null!==a.fragment&&(i+="#"+a.fragment),""===i&&(i="./"),i},t.removeBase=(n,o)=>{if(null===n)return o;n&&!e.isString(n)||(n=t.parse(n||""));let a="";if(""!==n.href?a+=(n.protocol||"")+"//"+(n.authority||""):o.indexOf("//")&&(a+="//"),0!==o.indexOf(a))return o;const r=t.parse(o.substr(a.length)),i=n.normalizedPath.split("/"),s=r.normalizedPath.split("/"),l=r.fragment||r.query?0:1;for(;i.length>0&&s.length>l&&i[0]===s[0];)i.shift(),s.shift();let c="";if(i.length>0){i.pop();for(let e=0;e<i.length;++e)c+="../"}return c+=s.join("/"),null!==r.query&&(c+="?"+r.query),null!==r.fragment&&(c+="#"+r.fragment),""===c&&(c="./"),c},t.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),o=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),o&&n.push("")):o&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const n=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return t.isAbsolute=t=>e.isString(t)&&n.test(t),t.isRelative=t=>e.isString(t),se}const{parseLinkHeader:pe,buildHeaders:he}=te,{LINK_HEADER_CONTEXT:fe}=ce,ve=z,ge=de(),{prependBase:ye}=ue(),me=/(^|(\r\n))link:/i;const xe=({secure:e,headers:t={},xhr:n}={headers:{}})=>{t=he(t);return(new ge).wrapLoader((async function o(a){if(0!==a.indexOf("http:")&&0!==a.indexOf("https:"))throw new ve('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});if(e&&0!==a.indexOf("https"))throw new ve('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:a});let r;try{r=await function(e,t,n){e=e||XMLHttpRequest;const o=new e;return new Promise(((e,a)=>{o.onload=()=>e(o),o.onerror=e=>a(e),o.open("GET",t,!0);for(const e in n)o.setRequestHeader(e,n[e]);o.send()}))}(n,a,t)}catch(e){throw new ve("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e})}if(r.status>=400)throw new ve("URL could not be dereferenced: "+r.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:r.status});let i={contextUrl:null,documentUrl:a,document:r.response},s=null;const l=r.getResponseHeader("Content-Type");let c;me.test(r.getAllResponseHeaders())&&(c=r.getResponseHeader("Link"));if(c&&"application/ld+json"!==l){const e=pe(c),t=e[fe];if(Array.isArray(t))throw new ve("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});t&&(i.contextUrl=t.target),s=e.alternate,s&&"application/ld+json"==s.type&&!(l||"").match(/^application\/(\w*\+)?json$/)&&(i=await o(ye(a,s.target)))}return i}))},be={};var we,je,Ie=be;be.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=xe,e.useDocumentLoader("xhr"))},be.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})};var Ne=Se;function Se(e){var t=this;if(t instanceof Se||(t=new Se),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,o=arguments.length;n<o;n++)t.push(arguments[n]);return t}function Oe(e,t,n){var o=t===e.head?new ke(n,null,t,e):new ke(n,t,t.next,e);return null===o.next&&(e.tail=o),null===o.prev&&(e.head=o),e.length++,o}function Ee(e,t){e.tail=new ke(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function De(e,t){e.head=new ke(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function ke(e,t,n,o){if(!(this instanceof ke))return new ke(e,t,n,o);this.list=o,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}Se.Node=ke,Se.create=Se,Se.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},Se.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},Se.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},Se.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Ee(this,arguments[e]);return this.length},Se.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)De(this,arguments[e]);return this.length},Se.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},Se.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},Se.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,o=0;null!==n;o++)e.call(t,n.value,o,this),n=n.next},Se.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,o=this.length-1;null!==n;o--)e.call(t,n.value,o,this),n=n.prev},Se.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},Se.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},Se.prototype.map=function(e,t){t=t||this;for(var n=new Se,o=this.head;null!==o;)n.push(e.call(t,o.value,this)),o=o.next;return n},Se.prototype.mapReverse=function(e,t){t=t||this;for(var n=new Se,o=this.tail;null!==o;)n.push(e.call(t,o.value,this)),o=o.prev;return n},Se.prototype.reduce=function(e,t){var n,o=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");o=this.head.next,n=this.head.value}for(var a=0;null!==o;a++)n=e(n,o.value,a),o=o.next;return n},Se.prototype.reduceReverse=function(e,t){var n,o=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");o=this.tail.prev,n=this.tail.value}for(var a=this.length-1;null!==o;a--)n=e(n,o.value,a),o=o.prev;return n},Se.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},Se.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},Se.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new Se;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=0,a=this.head;null!==a&&o<e;o++)a=a.next;for(;null!==a&&o<t;o++,a=a.next)n.push(a.value);return n},Se.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new Se;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=this.length,a=this.tail;null!==a&&o>t;o--)a=a.prev;for(;null!==a&&o>e;o--,a=a.prev)n.push(a.value);return n},Se.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var o=0,a=this.head;null!==a&&o<e;o++)a=a.next;var r=[];for(o=0;a&&o<t;o++)r.push(a.value),a=this.removeNode(a);null===a&&(a=this.tail),a!==this.head&&a!==this.tail&&(a=a.prev);for(o=0;o<n.length;o++)a=Oe(this,a,n[o]);return r},Se.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var o=n.prev;n.prev=n.next,n.next=o}return this.head=t,this.tail=e,this};try{(je||(je=1,we=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),we)(Se)}catch(e){}const Ce=Ne,Le=Symbol("max"),Re=Symbol("length"),Te=Symbol("lengthCalculator"),Ae=Symbol("allowStale"),_e=Symbol("maxAge"),Me=Symbol("dispose"),Je=Symbol("noDisposeOnSet"),Pe=Symbol("lruList"),Be=Symbol("cache"),He=Symbol("updateAgeOnGet"),Fe=()=>1;const qe=(e,t,n)=>{const o=e[Be].get(t);if(o){const t=o.value;if(Ue(e,t)){if(ze(e,o),!e[Ae])return}else n&&(e[He]&&(o.value.now=Date.now()),e[Pe].unshiftNode(o));return t.value}},Ue=(e,t)=>{if(!t||!t.maxAge&&!e[_e])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[_e]&&n>e[_e]},Ve=e=>{if(e[Re]>e[Le])for(let t=e[Pe].tail;e[Re]>e[Le]&&null!==t;){const n=t.prev;ze(e,t),t=n}},ze=(e,t)=>{if(t){const n=t.value;e[Me]&&e[Me](n.key,n.value),e[Re]-=n.length,e[Be].delete(n.key),e[Pe].removeNode(t)}};class Ge{constructor(e,t,n,o,a){this.key=e,this.value=t,this.length=n,this.now=o,this.maxAge=a||0}}const $e=(e,t,n,o)=>{let a=n.value;Ue(e,a)&&(ze(e,n),e[Ae]||(a=void 0)),a&&t.call(o,a.value,a.key,e)};var Qe=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[Le]=e.max||1/0;const t=e.length||Fe;if(this[Te]="function"!=typeof t?Fe:t,this[Ae]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[_e]=e.maxAge||0,this[Me]=e.dispose,this[Je]=e.noDisposeOnSet||!1,this[He]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[Le]=e||1/0,Ve(this)}get max(){return this[Le]}set allowStale(e){this[Ae]=!!e}get allowStale(){return this[Ae]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[_e]=e,Ve(this)}get maxAge(){return this[_e]}set lengthCalculator(e){"function"!=typeof e&&(e=Fe),e!==this[Te]&&(this[Te]=e,this[Re]=0,this[Pe].forEach((e=>{e.length=this[Te](e.value,e.key),this[Re]+=e.length}))),Ve(this)}get lengthCalculator(){return this[Te]}get length(){return this[Re]}get itemCount(){return this[Pe].length}rforEach(e,t){t=t||this;for(let n=this[Pe].tail;null!==n;){const o=n.prev;$e(this,e,n,t),n=o}}forEach(e,t){t=t||this;for(let n=this[Pe].head;null!==n;){const o=n.next;$e(this,e,n,t),n=o}}keys(){return this[Pe].toArray().map((e=>e.key))}values(){return this[Pe].toArray().map((e=>e.value))}reset(){this[Me]&&this[Pe]&&this[Pe].length&&this[Pe].forEach((e=>this[Me](e.key,e.value))),this[Be]=new Map,this[Pe]=new Ce,this[Re]=0}dump(){return this[Pe].map((e=>!Ue(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[Pe]}set(e,t,n){if((n=n||this[_e])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const o=n?Date.now():0,a=this[Te](t,e);if(this[Be].has(e)){if(a>this[Le])return ze(this,this[Be].get(e)),!1;const r=this[Be].get(e).value;return this[Me]&&(this[Je]||this[Me](e,r.value)),r.now=o,r.maxAge=n,r.value=t,this[Re]+=a-r.length,r.length=a,this.get(e),Ve(this),!0}const r=new Ge(e,t,a,o,n);return r.length>this[Le]?(this[Me]&&this[Me](e,t),!1):(this[Re]+=r.length,this[Pe].unshift(r),this[Be].set(e,this[Pe].head),Ve(this),!0)}has(e){if(!this[Be].has(e))return!1;const t=this[Be].get(e).value;return!Ue(this,t)}get(e){return qe(this,e,!0)}peek(e){return qe(this,e,!1)}pop(){const e=this[Pe].tail;return e?(ze(this,e),e.value):null}del(e){ze(this,this[Be].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const o=e[n],a=o.e||0;if(0===a)this.set(o.k,o.v);else{const e=a-t;e>0&&this.set(o.k,o.v,e)}}}prune(){this[Be].forEach(((e,t)=>qe(this,t,!1)))}};const Xe=Qe;const{isArray:We,isObject:Ke,isString:Ze}=F,{asArray:Ye}=te,{prependBase:et}=ue(),tt=z,nt=class{constructor({document:e}){this.document=e,this.cache=new Xe({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}};function ot(e){throw new tt("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function at({context:e,base:t}){if(!e)return;const n=e["@context"];if(Ze(n))e["@context"]=et(t,n);else if(We(n))for(let e=0;e<n.length;++e){const o=n[e];Ze(o)?n[e]=et(t,o):Ke(o)&&at({context:{"@context":o},base:t})}else if(Ke(n))for(const e in n)at({context:n[e],base:t})}var rt=B.NQuads;const it=z,{isArray:st}=F,{asArray:lt}=te,ct={};var dt=ct;function ut({event:e,handlers:t}){let n=!0;for(let o=0;n&&o<t.length;++o){n=!1;const a=t[o];if(st(a))n=ut({event:e,handlers:a});else if("function"==typeof a)a({event:e,next:()=>{n=!0}});else{if("object"!=typeof a)throw new it("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in a?a[e.code]({event:e,next:()=>{n=!0}}):n=!0}}return n}ct.defaultEventHandler=null,ct.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?ct.safeEventHandler:[],e.eventHandler?lt(e.eventHandler):[],ct.defaultEventHandler?ct.defaultEventHandler:[]);return 0===t.length?null:t},ct.handleEvent=({event:e,options:t})=>{ut({event:e,handlers:t.eventHandler})};const pt=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);ct.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&pt.has(e.code))throw new it("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},ct.logEventHandler=function({event:e,next:t}){console.log(`EVENT: ${e.message}`,{event:e}),t()},ct.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&console.warn(`WARNING: ${e.message}`,{event:e}),t()},ct.unhandledEventHandler=function({event:e}){throw new it("No handler for event.","jsonld.UnhandledEvent",{event:e})},ct.setDefaultEventHandler=function({eventHandler:e}={}){ct.defaultEventHandler=e?lt(e):null};const ht=te,ft=z,{isArray:vt,isObject:gt,isString:yt,isUndefined:mt}=F,{isAbsolute:xt,isRelative:bt,prependBase:wt}=ue(),{handleEvent:jt}=dt,{REGEX_BCP47:It,REGEX_KEYWORD:Nt,asArray:St,compareShortestLeast:Ot}=te,Et=new Map,Dt={};var kt=Dt;function Ct(e,t,n,o,a,r){if(null===t||!yt(t)||Dt.isKeyword(t))return t;if(t.match(Nt))return null;if(o&&o.hasOwnProperty(t)&&!0!==a.get(t)&&Dt.createTermDefinition({activeCtx:e,localCtx:o,term:t,defined:a,options:r}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(gt(n)&&"@id"in n)return n["@id"]}const i=t.indexOf(":");if(i>0){const n=t.substr(0,i),s=t.substr(i+1);if("_"===n||0===s.indexOf("//"))return t;o&&o.hasOwnProperty(n)&&Dt.createTermDefinition({activeCtx:e,localCtx:o,term:n,defined:a,options:r});const l=e.mappings.get(n);if(l&&l._prefix)return l["@id"]+s;if(xt(t))return t}if(n.vocab&&"@vocab"in e){t=e["@vocab"]+t}else if(n.base){let n,o;"@base"in e?e["@base"]?(o=wt(r.base,e["@base"]),n=wt(o,t)):(o=e["@base"],n=t):(o=r.base,n=wt(r.base,t)),t=n}return t}function Lt(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!Lt(e[n],t[n]))return!1;return!0}const o=Object.keys(e),a=Object.keys(t);if(o.length!==a.length)return!1;for(const n in e){let o=e[n],a=t[n];if("@container"===n&&Array.isArray(o)&&Array.isArray(a)&&(o=o.slice().sort(),a=a.slice().sort()),!Lt(o,a))return!1}return!0}Dt.process=async({activeCtx:e,localCtx:t,options:n,propagate:o=!0,overrideProtected:a=!1,cycles:r=new Set})=>{gt(t)&&"@context"in t&&vt(t["@context"])&&(t=t["@context"]);if(0===St(t).length)return e;const i=[],s=[({event:e,next:t})=>{i.push(e),t()}];n.eventHandler&&s.push(n.eventHandler);const l=n;n={...n,eventHandler:s};const c=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});gt(c[0].document)&&"boolean"==typeof c[0].document["@propagate"]&&(o=c[0].document["@propagate"]);let d=e;o||d.previousContext||(d=d.clone(),d.previousContext=e);for(const o of c){let{document:s}=o;if(e=d,null===s){if(!a&&0!==Object.keys(e.protected).length)throw new ft("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});d=e=Dt.getInitialContext(n).clone();continue}const c=o.getProcessed(e);if(c){if(l.eventHandler)for(const e of c.events)jt({event:e,options:l});d=e=c.context;continue}if(gt(s)&&"@context"in s&&(s=s["@context"]),!gt(s))throw new ft("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:s});d=d.clone();const u=new Map;if("@version"in s){if(1.1!==s["@version"])throw new ft("Unsupported JSON-LD version: "+s["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:s});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new ft("@version: "+s["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:s});d.processingMode="json-ld-1.1",d["@version"]=s["@version"],u.set("@version",!0)}if(d.processingMode=d.processingMode||e.processingMode,"@base"in s){let e=s["@base"];if(null===e||xt(e));else{if(!bt(e))throw new ft('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:s});e=wt(d["@base"],e)}d["@base"]=e,u.set("@base",!0)}if("@vocab"in s){const e=s["@vocab"];if(null===e)delete d["@vocab"];else{if(!yt(e))throw new ft('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:s});if(!xt(e)&&Dt.processingMode(d,1))throw new ft('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:s});{const t=Ct(d,e,{vocab:!0,base:!0},void 0,void 0,n);xt(t)||n.eventHandler&&jt({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:n}),d["@vocab"]=t}}u.set("@vocab",!0)}if("@language"in s){const e=s["@language"];if(null===e)delete d["@language"];else{if(!yt(e))throw new ft('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:s});e.match(It)||n.eventHandler&&jt({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:n}),d["@language"]=e.toLowerCase()}u.set("@language",!0)}if("@direction"in s){const t=s["@direction"];if("json-ld-1.0"===e.processingMode)throw new ft("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:s});if(null===t)delete d["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new ft('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:s});d["@direction"]=t}u.set("@direction",!0)}if("@propagate"in s){const n=s["@propagate"];if("json-ld-1.0"===e.processingMode)throw new ft("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:s});if("boolean"!=typeof n)throw new ft("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});u.set("@propagate",!0)}if("@import"in s){const o=s["@import"];if("json-ld-1.0"===e.processingMode)throw new ft("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:s});if(!yt(o))throw new ft("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const a=await n.contextResolver.resolve({activeCtx:e,context:o,documentLoader:n.documentLoader,base:n.base});if(1!==a.length)throw new ft("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const r=a[0].getProcessed(e);if(r)s=r;else{const n=a[0].document;if("@import"in n)throw new ft("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)s.hasOwnProperty(e)||(s[e]=n[e]);a[0].setProcessed(e,s)}u.set("@import",!0)}u.set("@protected",s["@protected"]||!1);for(const e in s)if(Dt.createTermDefinition({activeCtx:d,localCtx:s,term:e,defined:u,options:n,overrideProtected:a}),gt(s[e])&&"@context"in s[e]){const t=s[e]["@context"];let o=!0;if(yt(t)){const e=wt(n.base,t);r.has(e)?o=!1:r.add(e)}if(o)try{await Dt.process({activeCtx:d.clone(),localCtx:s[e]["@context"],overrideProtected:!0,options:n,cycles:r})}catch(t){throw new ft("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:s[e]["@context"],term:e})}}o.setProcessed(e,{context:d,events:i})}return d},Dt.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:o,options:a,overrideProtected:r=!1})=>{if(o.has(n)){if(o.get(n))return;throw new ft("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let i;if(o.set(n,!1),t.hasOwnProperty(n)&&(i=t[n]),"@type"===n&>(i)&&"@set"===(i["@container"]||"@set")&&Dt.processingMode(e,1.1)){const e=["@container","@id","@protected"],o=Object.keys(i);if(0===o.length||o.some((t=>!e.includes(t))))throw new ft("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(Dt.isKeyword(n))throw new ft("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(Nt))return void(a.eventHandler&&jt({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:a}));if(""===n)throw new ft("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const s=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let l=!1;if((yt(i)||null===i)&&(l=!0,i={"@id":i}),!gt(i))throw new ft("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const c={};e.mappings.set(n,c),c.reverse=!1;const d=["@container","@id","@language","@reverse","@type"];Dt.processingMode(e,1.1)&&d.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in i)if(!d.includes(e))throw new ft("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const u=n.indexOf(":");if(c._termHasColon=u>0,"@reverse"in i){if("@id"in i)throw new ft("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in i)throw new ft("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const r=i["@reverse"];if(!yt(r))throw new ft("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(r.match(Nt))return a.eventHandler&&jt({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:r}},options:a}),void(s?e.mappings.set(n,s):e.mappings.delete(n));const l=Ct(e,r,{vocab:!0,base:!1},t,o,a);if(!xt(l))throw new ft("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});c["@id"]=l,c.reverse=!0}else if("@id"in i){let r=i["@id"];if(r&&!yt(r))throw new ft("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===r)c["@id"]=null;else{if(!Dt.isKeyword(r)&&r.match(Nt))return a.eventHandler&&jt({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:r}},options:a}),void(s?e.mappings.set(n,s):e.mappings.delete(n));if(r!==n){if(r=Ct(e,r,{vocab:!0,base:!1},t,o,a),!xt(r)&&!Dt.isKeyword(r))throw new ft("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(n.match(/(?::[^:])|\//)){if(Ct(e,n,{vocab:!0,base:!1},t,new Map(o).set(n,!0),a)!==r)throw new ft("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t})}c["@id"]=r,c._prefix=l&&!c._termHasColon&&null!==r.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in c))if(c._termHasColon){const r=n.substr(0,u);if(t.hasOwnProperty(r)&&Dt.createTermDefinition({activeCtx:e,localCtx:t,term:r,defined:o,options:a}),e.mappings.has(r)){const t=n.substr(u+1);c["@id"]=e.mappings.get(r)["@id"]+t}else c["@id"]=n}else if("@type"===n)c["@id"]=n;else{if(!("@vocab"in e))throw new ft("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});c["@id"]=e["@vocab"]+n}if((!0===i["@protected"]||!0===o.get("@protected")&&!1!==i["@protected"])&&(e.protected[n]=!0,c.protected=!0),o.set(n,!0),"@type"in i){let n=i["@type"];if(!yt(n))throw new ft("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(Dt.processingMode(e,1))throw new ft(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==n&&"@vocab"!==n){if(n=Ct(e,n,{vocab:!0,base:!1},t,o,a),!xt(n))throw new ft("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new ft("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}c["@type"]=n}if("@container"in i){const n=yt(i["@container"])?[i["@container"]]:i["@container"]||[],o=["@list","@set","@index","@language"];let a=!0;const r=n.includes("@set");if(Dt.processingMode(e,1.1)){if(o.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new ft("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(n.includes("@graph")){if(n.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new ft("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else a&=n.length<=(r?2:1);if(n.includes("@type")&&(c["@type"]=c["@type"]||"@id",!["@id","@vocab"].includes(c["@type"])))throw new ft("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else a&=!vt(i["@container"]),a&=n.length<=1;if(a&=n.every((e=>o.includes(e))),a&=!(r&&n.includes("@list")),!a)throw new ft("Invalid JSON-LD syntax; @context @container value must be one of the following: "+o.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(c.reverse&&!n.every((e=>["@index","@set"].includes(e))))throw new ft("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});c["@container"]=n}if("@index"in i){if(!("@container"in i)||!c["@container"].includes("@index"))throw new ft(`Invalid JSON-LD syntax; @index without @index in @container: "${i["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!yt(i["@index"])||0===i["@index"].indexOf("@"))throw new ft(`Invalid JSON-LD syntax; @index must expand to an IRI: "${i["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});c["@index"]=i["@index"]}if("@context"in i&&(c["@context"]=i["@context"]),"@language"in i&&!("@type"in i)){let e=i["@language"];if(null!==e&&!yt(e))throw new ft("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),c["@language"]=e}if("@prefix"in i){if(n.match(/:|\//))throw new ft("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(Dt.isKeyword(c["@id"]))throw new ft("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof i["@prefix"])throw new ft("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});c._prefix=!0===i["@prefix"]}if("@direction"in i){const e=i["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new ft('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});c["@direction"]=e}if("@nest"in i){const e=i["@nest"];if(!yt(e)||"@nest"!==e&&0===e.indexOf("@"))throw new ft("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});c["@nest"]=e}
|