@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.
Files changed (47) hide show
  1. package/bundle-stats.html +2 -2
  2. package/dist/EcdsaSd2023-jnIXPui8-Ecil79Z6.js +36 -0
  3. package/dist/EcdsaSecp256k1Signature2019-CBV4BwnM-C2qGlq2W.js +4 -0
  4. package/dist/{Ed25519Signature2020-CL2yKnJW-NRYSGvkI.js → Ed25519Signature2020-MQoWd113-PNuci9U2.js} +5 -5
  5. package/dist/{HashlinkVerifier-MEwSZe4T-BdYYAALa.js → HashlinkVerifier-DykIKn5i-CYewU55u.js} +3 -3
  6. package/dist/{MerkleProof2017-CNSx436a-FBaGRIN1.js → MerkleProof2017-Cy_nkz4C-gnoFFWMW.js} +1 -1
  7. package/dist/{MerkleProof2017-MZJbBTpc-B7HRJzRg.js → MerkleProof2017-MZJbBTpc-CeZmtqCh.js} +3 -3
  8. package/dist/MerkleProof2019-DpwH-snR-ClzVR6uC.js +3 -0
  9. package/dist/checkCredentialSchemaConformity-DOGmtCq0-CnEpCN-s.js +1 -0
  10. package/dist/{checkRevocationStatusList2021-Cy-rWyh7-CVOeAbdp.js → checkRevocationStatusList2021-CNtaPjVp-XCu3zkCJ.js} +5 -5
  11. package/dist/{controlVerificationMethod-CXzAI0QS-b45qIaR4.js → controlVerificationMethod-BxseSDWK-Ghg2o_Hj.js} +1 -1
  12. package/dist/{did-key-common.esm-CJj7pea6-Er8YwHoJ.js → did-key-common.esm-C42sQiXe-DN5hgDGM.js} +3 -3
  13. package/dist/{did-key-ed25519.esm-hEATvNhJ-CHAq7sf1.js → did-key-ed25519.esm-CO7qImeZ-BR5JRBUU.js} +1 -1
  14. package/dist/did-key-secp256k1.esm-BblZ1xRe-4Ak_uTKC.js +1 -0
  15. package/dist/downloadPDF-XZlmMePj.js +346 -0
  16. package/dist/elliptic-6eMlPaPZ-CGOSt2J1.js +1 -0
  17. package/dist/{ensureNotRevoked-gui-UMnE-CENgoep9.js → ensureNotRevoked-gui-UMnE-DnVNmhNy.js} +1 -1
  18. package/dist/index-C-APorIs.js +2 -0
  19. package/dist/index-Dzjg2qbR-DK7tzt5T.js +22 -0
  20. package/dist/{jsonld-signatures-zDEkNjYR-D3vK8GYH.js → index-VOqA2-xz-CKqwdkuf.js} +14 -10
  21. package/dist/index-WN144sZ6-DKm58evR.js +3 -0
  22. package/dist/index.es-B13oYDrC.js +56 -0
  23. package/dist/{jsonld-Pr6hPH-i-D_C9ciG_.js → jsonld-BpvX3DRL-qZrjsUmJ.js} +3 -3
  24. package/dist/main.js +109 -109
  25. package/dist/pako.esm-DnD5dZGi-Bw1vqMku.js +2 -0
  26. package/dist/purify-hA3K4SAZ.js +2 -0
  27. package/dist/retrieveVerificationMethodPublicKey-fVSjg83n-B4VhVtVk.js +1 -0
  28. package/dist/webcrypto.es-DQnPRx8R-BJSH271h.js +41 -0
  29. package/package.json +8 -7
  30. package/dist/EcdsaSecp256k1Signature2019-aV3C41Ue-_mP0Wq_n.js +0 -4
  31. package/dist/MerkleProof2019-DnbP3r0f-Cp4GWjQh.js +0 -3
  32. package/dist/checkCredentialSchemaConformity-QPmIWPLG-De1kKyvF.js +0 -1
  33. package/dist/did-key-secp256k1.esm-CIEM56eq-EQahxyFZ.js +0 -1
  34. package/dist/downloadPDF-B1DL4u2a.js +0 -346
  35. package/dist/elliptic-DVE5q-l5-D-NH8siB.js +0 -1
  36. package/dist/index-CfIOMbD1.js +0 -2
  37. package/dist/index-DUjMpuQT-ZifknGWx.js +0 -5
  38. package/dist/index-DWAZG7Ja-CBt_boC3.js +0 -3
  39. package/dist/index.es-D8QzgW47.js +0 -56
  40. package/dist/pako.esm-DnD5dZGi-HambcU-w.js +0 -2
  41. package/dist/purify-C5H8D62I.js +0 -2
  42. /package/dist/{ensureNotRevoked-bD_ITwQb-DvMIgM4L.js → ensureNotRevoked-D9_PlMpD-DvMIgM4L.js} +0 -0
  43. /package/dist/{ensureValidIssuingKey-wRebznsK-frafTbMl.js → ensureValidIssuingKey-C7MTkDyV-frafTbMl.js} +0 -0
  44. /package/dist/{index-yP42zfkJ-CHN5LgUq.js → index-BZds3Ljo-CHN5LgUq.js} +0 -0
  45. /package/dist/{index-CcA_A5fd-Dgus2xdV.js → index-CWugL4dz-Dgus2xdV.js} +0 -0
  46. /package/dist/{sha256-wKiO0px2-BYFBxJ7m.js → sha256-D_qJpPFT-BYFBxJ7m.js} +0 -0
  47. /package/dist/{x25519-BzvT3haI-DcUk09rC.js → x25519-Dm-l65ld-DcUk09rC.js} +0 -0
@@ -1 +1 @@
1
- import{d as e,r as t,b as i,V as s,e as r,f as o,h as a}from"./main.js";import"./pako.esm-DnD5dZGi-HambcU-w.js";import{j as n}from"./jsonld-Pr6hPH-i-D_C9ciG_.js";import{s as c}from"./sha256-wKiO0px2-BYFBxJ7m.js";import{e as h}from"./ensureValidIssuingKey-wRebznsK-frafTbMl.js";import"./index-CcA_A5fd-Dgus2xdV.js";import{S as u}from"./Suite-B7Vy9AuU-D1ucdMDB.js";function p(e){e=e.trim();const t=[];for(let i=0;i<e.length;i+=2)t.push(parseInt(e.substring(i,i+2),16));return t}function f(e){const t=o(e);return"proof"in t?function(e){const t=o(e);if(!Array.isArray(e.proof))return delete t.proof,t;const i=e.proof.find((e=>"ChainedProof2021"!==e.type));return t.proof=i,t}(t):("signature"in t&&delete t.signature,t)}async function l(e){e["@context"].find((e=>i(e)&&"@vocab"in e))||e["@context"].push({"@vocab":"http://fallback.org/"});const t=f(e),o={algorithm:"URDNA2015",format:"application/nquads",documentLoader:function(e){return e in a?{contextUrl:null,document:a[e],documentUrl:e}:n.documentLoader(e)}};let h;try{h=await n.normalize(t,o)}catch(e){throw console.error(e),new s("computeLocalHash",r("errors","failedJsonLdNormalization"))}const u=function(e){const t=e.split("\n"),i=/<http:\/\/fallback\.org\/(.*)>/,s=t.map((e=>i.exec(e))).filter((e=>null!=e));if(s.length>0){const e=s.map((e=>e[1])).sort();return Array.from(new Set(e))}return null}(h);if(u)throw new s("computeLocalHash",`${r("errors","foundUnmappedFields")}: ${u.join(", ")}`);return c(function(e){const t=[];for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);s<128?t.push(s):s<2048?t.push(192|s>>6,128|63&s):s<55296||s>=57344?t.push(224|s>>12,128|s>>6&63,128|63&s):(i++,s=65536+((1023&s)<<10|1023&e.charCodeAt(i)),t.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s))}return t}(h))}var d;!function(e){e.getTransactionId="getTransactionId",e.computeLocalHash="computeLocalHash",e.fetchRemoteHash="fetchRemoteHash",e.parseIssuerKeys="parseIssuerKeys",e.compareHashes="compareHashes",e.checkMerkleRoot="checkMerkleRoot",e.checkReceipt="checkReceipt",e.checkAuthenticity="checkAuthenticity"}(d||(d={}));class y extends u{verificationProcess=[d.getTransactionId,d.computeLocalHash,d.fetchRemoteHash,d.compareHashes,d.checkMerkleRoot,d.checkReceipt,d.parseIssuerKeys,d.checkAuthenticity];transactionId;localHash;documentToVerify;txData;chain;explorerAPIs;receipt;issuerPublicKeyList;issuer;proof;type="MerkleProof2017";constructor(t){super(t),t.executeStep&&(this.executeStep=t.executeStep),this.documentToVerify=t.document,this.explorerAPIs=t.explorerAPIs,this.issuer=t.issuer,this.proof=t.proof,this.validateProofType(),this.receipt=this.documentToVerify.signature,this.chain=e.certificates.getChain("",this.receipt),this.transactionId=e.certificates.getTransactionId(this.receipt),this.adaptVerificationProcessToChain()}async init(){}async verifyProof(){for(const e of this.verificationProcess){if(!this[e])return void console.error("verification logic for",e,"not implemented");await this[e]()}}async verifyIdentity(){}getProofVerificationSteps(t){return this.verificationProcess.map((i=>e.verifier.convertToVerificationSubsteps(t,i)))}getIdentityVerificationSteps(){return[]}getIssuerPublicKey(){return e.chains.isMockChain(this.chain)?"This mock chain does not support issuing addresses":this.txData?this.txData.issuingAddress:void console.error("Trying to access issuing address when txData not available yet. Did you run the `verify` method yet?")}getIssuerName(){return this.issuer.name}getIssuerProfileDomain(){const e=new URL(this.getIssuerProfileUrl());return e?.hostname}getIssuerProfileUrl(){return this.issuer.id}getSigningDate(){return this.documentToVerify.issuedOn}getChain(){return this.chain}getReceipt(){return this.receipt}getTransactionIdString(){return e.certificates.getTransactionId(this.getReceipt())}getTransactionLink(){return e.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).transactionLink}getRawTransactionLink(){return e.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).rawTransactionLink}validateProofType(){if(this.proof.type[0]!==this.type)throw new Error(`Incompatible proof type passed. Expected: ${this.type}, Got: ${this.proof.type[0]}`)}adaptVerificationProcessToChain(){e.chains.isMockChain(this.chain)&&(t(this.verificationProcess,d.getTransactionId),t(this.verificationProcess,d.fetchRemoteHash),t(this.verificationProcess,d.parseIssuerKeys),t(this.verificationProcess,d.checkMerkleRoot),t(this.verificationProcess,d.checkAuthenticity))}async executeStep(e,t,i){throw new Error("doAction method needs to be overwritten by injecting from CVJS")}async getTransactionId(){await this.executeStep(d.getTransactionId,(()=>function(e){if("string"==typeof e&&e.length>0)return e;throw new s("getTransactionId",r("errors","isTransactionIdValid"))}(this.transactionId)),this.type)}async computeLocalHash(){this.localHash=await this.executeStep(d.computeLocalHash,(async()=>await l(this.documentToVerify)),this.type)}async fetchRemoteHash(){this.txData=await this.executeStep(d.fetchRemoteHash,(async()=>await e.verifier.lookForTx({transactionId:this.transactionId,chain:this.chain.code,explorerAPIs:this.explorerAPIs})),this.type)}async compareHashes(){await this.executeStep(d.compareHashes,(()=>function(e,t){if(e!==t)throw new s("compareHashes",r("errors","ensureHashesEqual"));return!0}(this.localHash,this.receipt.targetHash)),this.type)}async checkMerkleRoot(){await this.executeStep(d.checkMerkleRoot,(()=>function(e,t){if(e!==t)throw new s("checkMerkleRoot",r("errors","ensureMerkleRootEqual"));return!0}(this.receipt.merkleRoot,this.txData.remoteHash)),this.type)}async checkReceipt(){await this.executeStep(d.checkReceipt,(()=>{!function(e){let t=e.targetHash;const i=e.merkleRoot;try{const i=e.proof??e.path;if(i)for(const e in i){const r=i[e];let o;if(void 0!==r.left)o=p(`${r.left}${t}`),t=c(o);else{if(void 0===r.right)throw new s("checkReceipt","Trigger catch error.");o=p(`${t}${r.right}`),t=c(o)}}}catch(e){throw new s("checkReceipt",r("errors","ensureValidReceipt"))}if(t!==i)throw new s("checkReceipt",r("errors","invalidMerkleReceipt"))}(this.receipt)}),this.type)}async parseIssuerKeys(){this.issuerPublicKeyList=await this.executeStep(d.parseIssuerKeys,(()=>e.verifier.parseIssuerKeys(this.issuer)),this.type)}async checkAuthenticity(){await this.executeStep(d.checkAuthenticity,(()=>{h(this.issuerPublicKeyList,this.txData.issuingAddress,this.txData.time)}),this.type)}}export{y as default};
1
+ import{d as e,r as t,b as i,V as s,e as r,f as o,h as a}from"./main.js";import"./pako.esm-DnD5dZGi-Bw1vqMku.js";import{j as n}from"./jsonld-BpvX3DRL-qZrjsUmJ.js";import{s as c}from"./sha256-D_qJpPFT-BYFBxJ7m.js";import{e as h}from"./ensureValidIssuingKey-C7MTkDyV-frafTbMl.js";import"./index-CWugL4dz-Dgus2xdV.js";import{S as u}from"./Suite-B7Vy9AuU-D1ucdMDB.js";function p(e){e=e.trim();const t=[];for(let i=0;i<e.length;i+=2)t.push(parseInt(e.substring(i,i+2),16));return t}function f(e){const t=o(e);return"proof"in t?function(e){const t=o(e);if(!Array.isArray(e.proof))return delete t.proof,t;const i=e.proof.find((e=>"ChainedProof2021"!==e.type));return t.proof=i,t}(t):("signature"in t&&delete t.signature,t)}async function l(e){e["@context"].find((e=>i(e)&&"@vocab"in e))||e["@context"].push({"@vocab":"http://fallback.org/"});const t=f(e),o={algorithm:"URDNA2015",format:"application/nquads",documentLoader:function(e){return e in a?{contextUrl:null,document:a[e],documentUrl:e}:n.documentLoader(e)}};let h;try{h=await n.normalize(t,o)}catch(e){throw console.error(e),new s("computeLocalHash",r("errors","failedJsonLdNormalization"))}const u=function(e){const t=e.split("\n"),i=/<http:\/\/fallback\.org\/(.*)>/,s=t.map((e=>i.exec(e))).filter((e=>null!=e));if(s.length>0){const e=s.map((e=>e[1])).sort();return Array.from(new Set(e))}return null}(h);if(u)throw new s("computeLocalHash",`${r("errors","foundUnmappedFields")}: ${u.join(", ")}`);return c(function(e){const t=[];for(let i=0;i<e.length;i++){let s=e.charCodeAt(i);s<128?t.push(s):s<2048?t.push(192|s>>6,128|63&s):s<55296||s>=57344?t.push(224|s>>12,128|s>>6&63,128|63&s):(i++,s=65536+((1023&s)<<10|1023&e.charCodeAt(i)),t.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s))}return t}(h))}var d;!function(e){e.getTransactionId="getTransactionId",e.computeLocalHash="computeLocalHash",e.fetchRemoteHash="fetchRemoteHash",e.parseIssuerKeys="parseIssuerKeys",e.compareHashes="compareHashes",e.checkMerkleRoot="checkMerkleRoot",e.checkReceipt="checkReceipt",e.checkAuthenticity="checkAuthenticity"}(d||(d={}));class y extends u{verificationProcess=[d.getTransactionId,d.computeLocalHash,d.fetchRemoteHash,d.compareHashes,d.checkMerkleRoot,d.checkReceipt,d.parseIssuerKeys,d.checkAuthenticity];transactionId;localHash;documentToVerify;txData;chain;explorerAPIs;receipt;issuerPublicKeyList;issuer;proof;type="MerkleProof2017";constructor(t){super(t),t.executeStep&&(this.executeStep=t.executeStep),this.documentToVerify=t.document,this.explorerAPIs=t.explorerAPIs,this.issuer=t.issuer,this.proof=t.proof,this.validateProofType(),this.receipt=this.documentToVerify.signature,this.chain=e.certificates.getChain("",this.receipt),this.transactionId=e.certificates.getTransactionId(this.receipt),this.adaptVerificationProcessToChain()}async init(){}async verifyProof(){for(const e of this.verificationProcess){if(!this[e])return void console.error("verification logic for",e,"not implemented");await this[e]()}}async verifyIdentity(){}getProofVerificationSteps(t){return this.verificationProcess.map((i=>e.verifier.convertToVerificationSubsteps(t,i)))}getIdentityVerificationSteps(){return[]}getIssuerPublicKey(){return e.chains.isMockChain(this.chain)?"This mock chain does not support issuing addresses":this.txData?this.txData.issuingAddress:void console.error("Trying to access issuing address when txData not available yet. Did you run the `verify` method yet?")}getIssuerName(){return this.issuer.name}getIssuerProfileDomain(){const e=new URL(this.getIssuerProfileUrl());return e?.hostname}getIssuerProfileUrl(){return this.issuer.id}getSigningDate(){return this.documentToVerify.issuedOn}getChain(){return this.chain}getReceipt(){return this.receipt}getTransactionIdString(){return e.certificates.getTransactionId(this.getReceipt())}getTransactionLink(){return e.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).transactionLink}getRawTransactionLink(){return e.certificates.getTransactionLink(this.getTransactionIdString(),this.getChain()).rawTransactionLink}validateProofType(){if(this.proof.type[0]!==this.type)throw new Error(`Incompatible proof type passed. Expected: ${this.type}, Got: ${this.proof.type[0]}`)}adaptVerificationProcessToChain(){e.chains.isMockChain(this.chain)&&(t(this.verificationProcess,d.getTransactionId),t(this.verificationProcess,d.fetchRemoteHash),t(this.verificationProcess,d.parseIssuerKeys),t(this.verificationProcess,d.checkMerkleRoot),t(this.verificationProcess,d.checkAuthenticity))}async executeStep(e,t,i){throw new Error("doAction method needs to be overwritten by injecting from CVJS")}async getTransactionId(){await this.executeStep(d.getTransactionId,(()=>function(e){if("string"==typeof e&&e.length>0)return e;throw new s("getTransactionId",r("errors","isTransactionIdValid"))}(this.transactionId)),this.type)}async computeLocalHash(){this.localHash=await this.executeStep(d.computeLocalHash,(async()=>await l(this.documentToVerify)),this.type)}async fetchRemoteHash(){this.txData=await this.executeStep(d.fetchRemoteHash,(async()=>await e.verifier.lookForTx({transactionId:this.transactionId,chain:this.chain.code,explorerAPIs:this.explorerAPIs})),this.type)}async compareHashes(){await this.executeStep(d.compareHashes,(()=>function(e,t){if(e!==t)throw new s("compareHashes",r("errors","ensureHashesEqual"));return!0}(this.localHash,this.receipt.targetHash)),this.type)}async checkMerkleRoot(){await this.executeStep(d.checkMerkleRoot,(()=>function(e,t){if(e!==t)throw new s("checkMerkleRoot",r("errors","ensureMerkleRootEqual"));return!0}(this.receipt.merkleRoot,this.txData.remoteHash)),this.type)}async checkReceipt(){await this.executeStep(d.checkReceipt,(()=>{!function(e){let t=e.targetHash;const i=e.merkleRoot;try{const i=e.proof??e.path;if(i)for(const e in i){const r=i[e];let o;if(void 0!==r.left)o=p(`${r.left}${t}`),t=c(o);else{if(void 0===r.right)throw new s("checkReceipt","Trigger catch error.");o=p(`${t}${r.right}`),t=c(o)}}}catch(e){throw new s("checkReceipt",r("errors","ensureValidReceipt"))}if(t!==i)throw new s("checkReceipt",r("errors","invalidMerkleReceipt"))}(this.receipt)}),this.type)}async parseIssuerKeys(){this.issuerPublicKeyList=await this.executeStep(d.parseIssuerKeys,(()=>e.verifier.parseIssuerKeys(this.issuer)),this.type)}async checkAuthenticity(){await this.executeStep(d.checkAuthenticity,(()=>{h(this.issuerPublicKeyList,this.txData.issuingAddress,this.txData.time)}),this.type)}}export{y as default};
@@ -1,4 +1,4 @@
1
- import{c as e,d as t,r as n,g as o,i as r,V as i,a,b as s,n as l,e as c,p as d}from"./index-CfIOMbD1.js";var u={},p=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,t){if(!e.setImmediate){var n,o,r,i,a,s=1,c={},d=!1,u=e.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(e);p=p&&p.setTimeout?p:e,"[object process]"==={}.toString.call(e.process)?n=function(e){l((function(){f(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?((r=new MessageChannel).port1.onmessage=function(e){f(e.data)},n=function(e){r.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(o=u.documentElement,n=function(e){var t=u.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,o.removeChild(t),t=null},o.appendChild(t)}):n=function(e){setTimeout(f,0,e)}:(i="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&f(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),n=function(t){e.postMessage(i+t,"*")}),p.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),o=0;o<t.length;o++)t[o]=arguments[o+1];var r={callback:e,args:t};return c[s]=r,n(s),s++},p.clearImmediate=h}function h(e){delete c[e]}function f(e){if(d)setTimeout(f,0,e);else{var n=c[e];if(n){d=!0;try{!function(e){var n=e.callback,o=e.args;switch(o.length){case 0:n();break;case 1:n(o[0]);break;case 2:n(o[0],o[1]);break;case 3:n(o[0],o[1],o[2]);break;default:n.apply(t,o)}}(n)}finally{h(e),d=!1}}}}}("undefined"==typeof self?e:self);
1
+ import{c as e,d as t,r as n,g as o,i as r,V as i,a,b as s,n as l,e as c,p as d}from"./index-C-APorIs.js";var u={},p=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,n,o,r,i,a=1,s={},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){l((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?((o=new MessageChannel).port1.onmessage=function(e){h(e.data)},t=function(e){o.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(n=d.documentElement,t=function(e){var t=d.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.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 r={callback:e,args:n};return s[a]=r,t(a),a++},u.clearImmediate=p}function p(e){delete s[e]}function h(e){if(c)setTimeout(h,0,e);else{var t=s[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 g="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",y="http://www.w3
13
13
  /*!
14
14
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
15
15
  */
16
- const E=p,O=f,D=v,C=j;var L=class{constructor({createMessageDigest:e=(()=>new O("sha256")),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new E("_: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 r=[...t.keys()].sort(),i=[];for(const e of r){const n=t.get(e);if(n.length>1){i.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of i){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new E("_:b");e.getId(n);const o=await this.hashNDegreeQuads(n,e);t.push(o)}t.sort(T);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const a=[];for(const e of this.quads){const t=C.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));a.push(t)}return a.sort(),a.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(C.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=await r.digest(),n.hash}async hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const i=this.createMessageDigest();return i.update(o),"g"!==o&&i.update(this.getRelatedPredicate(t)),i.update(r),i.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(),r=await this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const a=new D(r.get(e));let s=0;for(;a.hasNext();){const e=a.next();++s%3==0&&await this._yield();let o=t.clone(),r="";const l=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||l.push(t),r+=o.getId(t)),0!==i.length&&r>i){c=!0;break}if(!c){for(const e of l){const t=await this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){c=!0;break}}c||(0===i.length||r<i)&&(i=r,n=o)}}o.update(i),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 r=0;for(const i of o)++r%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.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:r,hashToRelated:i}){if("BlankNode"!==t.termType||t.value===o)return;const a=t.value,s=await this.hashRelatedBlankNode(a,e,r,n),l=i.get(s);l?l.push(a):i.set(s,[a])}_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 T(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}
16
+ const E=p,O=f,D=v,C=j;var L=class{constructor({createMessageDigest:e=()=>new O("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new E("_: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 r=[...t.keys()].sort(),i=[];for(const e of r){const n=t.get(e);if(n.length>1){i.push(n);continue}const o=n[0];this.canonicalIssuer.getId(o)}for(const e of i){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new E("_:b");e.getId(n);const o=await this.hashNDegreeQuads(n,e);t.push(o)}t.sort(T);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const a=[];for(const e of this.quads){const t=C.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));a.push(t)}return a.sort(),a.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(C.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=await r.digest(),n.hash}async hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const i=this.createMessageDigest();return i.update(o),"g"!==o&&i.update(this.getRelatedPredicate(t)),i.update(r),i.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(),r=await this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const a=new D(r.get(e));let s=0;for(;a.hasNext();){const e=a.next();++s%3==0&&await this._yield();let o=t.clone(),r="";const l=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||l.push(t),r+=o.getId(t)),0!==i.length&&r>i){c=!0;break}if(!c){for(const e of l){const t=await this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){c=!0;break}}c||(0===i.length||r<i)&&(i=r,n=o)}}o.update(i),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 r=0;for(const i of o)++r%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.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:r,hashToRelated:i}){if("BlankNode"!==t.termType||t.value===o)return;const a=t.value,s=await this.hashRelatedBlankNode(a,e,r,n),l=i.get(s);l?l.push(a):i.set(s,[a])}_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 T(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 R=f,A=L;var _=class extends A{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new R("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 r=0;for(const i of o){let o,a;if("BlankNode"===i.subject.termType&&i.subject.value!==e)a=i.subject.value,o="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;a=i.object.value,o="r"}++r%100==0&&await this._yield();const s=await this.hashRelatedBlankNode(a,i,t,o),l=n.get(s);l?l.push(a):n.set(s,[a])}return n}};
20
20
  /*!
21
21
  * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
22
- */const P=p,M=f,J=v,H=j;var B=class{constructor({createMessageDigest:e=(()=>new M("sha256")),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new P("_: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(),r=[];for(const e of o){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 P("_:b");e.getId(n);const o=this.hashNDegreeQuads(n,e);t.push(o)}t.sort(F);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=H.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));i.push(t)}return i.sort(),i.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(H.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=r.digest(),n.hash}hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const i=this.createMessageDigest();return i.update(o),"g"!==o&&i.update(this.getRelatedPredicate(t)),i.update(r),i.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(),r=this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const a=new J(r.get(e));for(;a.hasNext();){const e=a.next();let o=t.clone(),r="";const s=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||s.push(t),r+=o.getId(t)),0!==i.length&&r>i){l=!0;break}if(!l){for(const e of s){const t=this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){l=!0;break}}l||(0===i.length||r<i)&&(i=r,n=o)}}o.update(i),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 r of o)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}_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:r,hashToRelated:i}){if("BlankNode"!==t.termType||t.value===o)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,r,n),l=i.get(s);l?l.push(a):i.set(s,[a])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}};function F(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}
22
+ */const P=p,M=f,J=v,H=j;var B=class{constructor({createMessageDigest:e=()=>new M("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new P("_: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(),r=[];for(const e of o){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 P("_:b");e.getId(n);const o=this.hashNDegreeQuads(n,e);t.push(o)}t.sort(F);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=H.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));i.push(t)}return i.sort(),i.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(H.serializeQuad(o))}t.sort();const r=this.createMessageDigest();for(const e of t)r.update(e);return n.hash=r.digest(),n.hash}hashRelatedBlankNode(e,t,n,o){let r;r=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const i=this.createMessageDigest();return i.update(o),"g"!==o&&i.update(this.getRelatedPredicate(t)),i.update(r),i.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(),r=this.createHashToRelated(e,t),i=[...r.keys()].sort();for(const e of i){o.update(e);let n,i="";const a=new J(r.get(e));for(;a.hasNext();){const e=a.next();let o=t.clone(),r="";const s=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?r+=this.canonicalIssuer.getId(t):(o.hasId(t)||s.push(t),r+=o.getId(t)),0!==i.length&&r>i){l=!0;break}if(!l){for(const e of s){const t=this.hashNDegreeQuads(e,o);if(r+=o.getId(e),r+=`<${t.hash}>`,o=t.issuer,0!==i.length&&r>i){l=!0;break}}l||(0===i.length||r<i)&&(i=r,n=o)}}o.update(i),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 r of o)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}_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:r,hashToRelated:i}){if("BlankNode"!==t.termType||t.value===o)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,r,n),l=i.get(s);l?l.push(a):i.set(s,[a])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}};function F(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 U=f,q=B;var V=class extends q{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new U("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 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"}const a=this.hashRelatedBlankNode(i,r,t,o),s=n.get(a);s?s.push(i):n.set(a,[i])}return n}},$=o(Object.freeze({__proto__:null,default:{}}));!function(e){const t=L,n=_,o=B,r=V;let i;try{i=$}catch(e){}function a(t){return Array.isArray(t)?t:e.NQuads.legacyDatasetToQuads(t)}e.NQuads=j,e.IdentifierIssuer=p,e._rdfCanonizeNative=function(e){return e&&(i=e),i},e.canonize=async function(e,o){const r=a(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(r,o,((n,o)=>n?t(n):e(o)))))}if("URDNA2015"===o.algorithm)return new t(o).main(r);if("URGNA2012"===o.algorithm){if(o.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new n(o).main(r)}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=a(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 r(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)}}(u);var G=u;const z={};var K=z;z.isArray=Array.isArray,z.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),z.isDouble=e=>z.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),z.isEmptyObject=e=>z.isObject(e)&&0===Object.keys(e).length,z.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),z.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),z.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),z.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),z.isUndefined=e=>void 0===e;const Q=K,X={};var W=X;X.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},X.isSubjectReference=e=>Q.isObject(e)&&1===Object.keys(e).length&&"@id"in e,X.isValue=e=>Q.isObject(e)&&"@value"in e,X.isList=e=>Q.isObject(e)&&"@list"in e,X.isGraph=e=>Q.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,X.isSimpleGraph=e=>X.isGraph(e)&&!("@id"in e),X.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 Y=W,ee=K,te=G.IdentifierIssuer,ne=Z,oe=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,re=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,ie=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,ae={accept:"application/ld+json, application/json"},se={};var le=se;function ce(e,t){if(ee.isArray(t))for(let n=0;n<t.length;++n)t[n]=ce(e,t[n]);else if(Y.isList(t))t["@list"]=ce(e,t["@list"]);else if(ee.isObject(t)){Y.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const n=Object.keys(t).sort();for(let o=0;o<n.length;++o){const r=n[o];"@id"!==r&&(t[r]=ce(e,t[r]))}}return t}se.IdentifierIssuer=te,se.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,se.REGEX_KEYWORD=/^@[a-zA-Z]+$/,se.clone=function(e){if(e&&"object"==typeof e){let t;if(ee.isArray(e)){t=[];for(let n=0;n<e.length;++n)t[n]=se.clone(e[n])}else if(e instanceof Map){t=new Map;for(const[n,o]of e)t.set(n,se.clone(o))}else if(e instanceof Set){t=new Set;for(const n of e)t.add(se.clone(n))}else if(ee.isObject(e)){t={};for(const n in e)t[n]=se.clone(e[n])}else t=e.toString();return t}return e},se.asArray=function(e){return Array.isArray(e)?e:[e]},se.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+ae.accept+'" is supported.');return Object.assign({Accept:ae.accept},e)},se.parseLinkHeader=e=>{const t={},n=e.match(oe);for(let e=0;e<n.length;++e){let o=n[e].match(re);if(!o)continue;const r={target:o[1]},i=o[2];for(;o=ie.exec(i);)r[o[1]]=void 0===o[2]?o[3]:o[2];const a=r.rel||"";Array.isArray(t[a])?t[a].push(r):t.hasOwnProperty(a)?t[a]=[t[a],r]:t[a]=r}return t},se.validateTypeValue=(e,t)=>{if(!(ee.isString(e)||ee.isArray(e)&&e.every((e=>ee.isString(e))))){if(t&&ee.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&se.asArray(e["@default"]).every((e=>ee.isString(e))))return}throw new ne('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})}},se.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!ee.isArray(n)||n.length>0}return!1},se.hasValue=(e,t,n)=>{if(se.hasProperty(e,t)){let o=e[t];const r=Y.isList(o);if(ee.isArray(o)||r){r&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(se.compareValues(n,o[e]))return!0}else if(!ee.isArray(n))return se.compareValues(n,o)}return!1},se.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(ee.isArray(n)){0===n.length&&o.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),o.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let r=0;r<n.length;++r)se.addValue(e,t,n[r],o)}else if(e.hasOwnProperty(t)){const r=!o.allowDuplicate&&se.hasValue(e,t,n);ee.isArray(e[t])||r&&!o.propertyIsArray||(e[t]=[e[t]]),r||(o.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=o.propertyIsArray?[n]:n},se.getValues=(e,t)=>[].concat(e[t]||[]),se.removeProperty=(e,t)=>{delete e[t]},se.removeValue=(e,t,n,o)=>{"propertyIsArray"in(o=o||{})||(o.propertyIsArray=!1);const r=se.getValues(e,t).filter((e=>!se.compareValues(e,n)));0===r.length?se.removeProperty(e,t):1!==r.length||o.propertyIsArray?e[t]=r:e[t]=r[0]},se.relabelBlankNodes=(e,t)=>ce((t=t||{}).issuer||new te("_:b"),e),se.compareValues=(e,t)=>e===t||(!(!Y.isValue(e)||!Y.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(ee.isObject(e)&&"@id"in e&&ee.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"]),se.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1;const de="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ue="http://www.w3.org/2001/XMLSchema#";var pe,he,fe,ve,ge={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:de,RDF_LIST:de+"List",RDF_FIRST:de+"first",RDF_REST:de+"rest",RDF_NIL:de+"nil",RDF_TYPE:de+"type",RDF_PLAIN_LITERAL:de+"PlainLiteral",RDF_XML_LITERAL:de+"XMLLiteral",RDF_JSON_LITERAL:de+"JSON",RDF_OBJECT:de+"object",RDF_LANGSTRING:de+"langString",XSD:ue,XSD_BOOLEAN:ue+"boolean",XSD_DOUBLE:ue+"double",XSD_INTEGER:ue+"integer",XSD_STRING:ue+"string"};function ye(){return he||(he=1,pe=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]}}}),pe}function me(){if(ve)return fe;ve=1;const e=K,t={};fe=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={},r=t.parsers[n||"full"],i=r.regex.exec(e);let a=r.keys.length;for(;a--;)o[r.keys[a]]=void 0===i[a]?null:i[a];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 r=t.parse(o),i={protocol:n.protocol||""};if(null!==r.authority)i.authority=r.authority,i.path=r.path,i.query=r.query;else if(i.authority=n.authority,""===r.path)i.path=n.path,null!==r.query?i.query=r.query:i.query=n.query;else{if(0===r.path.indexOf("/"))i.path=r.path;else{let e=n.path;e=e.substr(0,e.lastIndexOf("/")+1),(e.length>0||n.authority)&&"/"!==e.substr(-1)&&(e+="/"),e+=r.path,i.path=e}i.query=r.query}""!==r.path&&(i.path=t.removeDotSegments(i.path));let a=i.protocol;return null!==i.authority&&(a+="//"+i.authority),a+=i.path,null!==i.query&&(a+="?"+i.query),null!==r.fragment&&(a+="#"+r.fragment),""===a&&(a="./"),a},t.removeBase=(n,o)=>{if(null===n)return o;n&&!e.isString(n)||(n=t.parse(n||""));let r="";if(""!==n.href?r+=(n.protocol||"")+"//"+(n.authority||""):o.indexOf("//")&&(r+="//"),0!==o.indexOf(r))return o;const i=t.parse(o.substr(r.length)),a=n.normalizedPath.split("/"),s=i.normalizedPath.split("/"),l=i.fragment||i.query?0:1;for(;a.length>0&&s.length>l&&a[0]===s[0];)a.shift(),s.shift();let c="";if(a.length>0){a.pop();for(let e=0;e<a.length;++e)c+="../"}return c+=s.join("/"),null!==i.query&&(c+="?"+i.query),null!==i.fragment&&(c+="#"+i.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),fe}const{parseLinkHeader:xe,buildHeaders:be}=le,{LINK_HEADER_CONTEXT:we}=ge,Ie=Z,je=ye(),{prependBase:Se}=me(),ke=/(^|(\r\n))link:/i;const Ne=({secure:e,headers:t={},xhr:n}={headers:{}})=>{t=be(t);return(new je).wrapLoader((async function o(r){if(0!==r.indexOf("http:")&&0!==r.indexOf("https:"))throw new Ie('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:r});if(e&&0!==r.indexOf("https"))throw new Ie('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:r});let i;try{i=await function(e,t,n){e=e||XMLHttpRequest;const o=new e;return new Promise(((e,r)=>{o.onload=()=>e(o),o.onerror=e=>r(e),o.open("GET",t,!0);for(const e in n)o.setRequestHeader(e,n[e]);o.send()}))}(n,r,t)}catch(e){throw new Ie("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:r,cause:e})}if(i.status>=400)throw new Ie("URL could not be dereferenced: "+i.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:r,httpStatusCode:i.status});let a={contextUrl:null,documentUrl:r,document:i.response},s=null;const l=i.getResponseHeader("Content-Type");let c;ke.test(i.getAllResponseHeaders())&&(c=i.getResponseHeader("Link"));if(c&&"application/ld+json"!==l){const e=xe(c),t=e[we];if(Array.isArray(t))throw new Ie("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:r});t&&(a.contextUrl=t.target),s=e.alternate,s&&"application/ld+json"==s.type&&!(l||"").match(/^application\/(\w*\+)?json$/)&&(a=await o(Se(r,s.target)))}return a}))},Ee={};var Oe,De,Ce=Ee;Ee.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=Ne,e.useDocumentLoader("xhr"))},Ee.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})};var Le=Te;function Te(e){var t=this;if(t instanceof Te||(t=new Te),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 Re(e,t,n){var o=t===e.head?new Pe(n,null,t,e):new Pe(n,t,t.next,e);return null===o.next&&(e.tail=o),null===o.prev&&(e.head=o),e.length++,o}function Ae(e,t){e.tail=new Pe(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function _e(e,t){e.head=new Pe(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function Pe(e,t,n,o){if(!(this instanceof Pe))return new Pe(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}Te.Node=Pe,Te.create=Te,Te.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},Te.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++}},Te.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++}},Te.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)Ae(this,arguments[e]);return this.length},Te.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)_e(this,arguments[e]);return this.length},Te.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}},Te.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}},Te.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},Te.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},Te.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},Te.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},Te.prototype.map=function(e,t){t=t||this;for(var n=new Te,o=this.head;null!==o;)n.push(e.call(t,o.value,this)),o=o.next;return n},Te.prototype.mapReverse=function(e,t){t=t||this;for(var n=new Te,o=this.tail;null!==o;)n.push(e.call(t,o.value,this)),o=o.prev;return n},Te.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 r=0;null!==o;r++)n=e(n,o.value,r),o=o.next;return n},Te.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 r=this.length-1;null!==o;r--)n=e(n,o.value,r),o=o.prev;return n},Te.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},Te.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},Te.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new Te;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=0,r=this.head;null!==r&&o<e;o++)r=r.next;for(;null!==r&&o<t;o++,r=r.next)n.push(r.value);return n},Te.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new Te;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var o=this.length,r=this.tail;null!==r&&o>t;o--)r=r.prev;for(;null!==r&&o>e;o--,r=r.prev)n.push(r.value);return n},Te.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var o=0,r=this.head;null!==r&&o<e;o++)r=r.next;var i=[];for(o=0;r&&o<t;o++)i.push(r.value),r=this.removeNode(r);null===r&&(r=this.tail),r!==this.head&&r!==this.tail&&(r=r.prev);for(o=0;o<n.length;o++)r=Re(this,r,n[o]);return i},Te.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{(De||(De=1,Oe=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Oe)(Te)}catch(e){}const Me=Le,Je=Symbol("max"),He=Symbol("length"),Be=Symbol("lengthCalculator"),Fe=Symbol("allowStale"),Ue=Symbol("maxAge"),qe=Symbol("dispose"),Ve=Symbol("noDisposeOnSet"),$e=Symbol("lruList"),Ge=Symbol("cache"),ze=Symbol("updateAgeOnGet"),Ke=()=>1;const Qe=(e,t,n)=>{const o=e[Ge].get(t);if(o){const t=o.value;if(Xe(e,t)){if(Ze(e,o),!e[Fe])return}else n&&(e[ze]&&(o.value.now=Date.now()),e[$e].unshiftNode(o));return t.value}},Xe=(e,t)=>{if(!t||!t.maxAge&&!e[Ue])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[Ue]&&n>e[Ue]},We=e=>{if(e[He]>e[Je])for(let t=e[$e].tail;e[He]>e[Je]&&null!==t;){const n=t.prev;Ze(e,t),t=n}},Ze=(e,t)=>{if(t){const n=t.value;e[qe]&&e[qe](n.key,n.value),e[He]-=n.length,e[Ge].delete(n.key),e[$e].removeNode(t)}};class Ye{constructor(e,t,n,o,r){this.key=e,this.value=t,this.length=n,this.now=o,this.maxAge=r||0}}const et=(e,t,n,o)=>{let r=n.value;Xe(e,r)&&(Ze(e,n),e[Fe]||(r=void 0)),r&&t.call(o,r.value,r.key,e)};var tt=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[Je]=e.max||1/0;const t=e.length||Ke;if(this[Be]="function"!=typeof t?Ke:t,this[Fe]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[Ue]=e.maxAge||0,this[qe]=e.dispose,this[Ve]=e.noDisposeOnSet||!1,this[ze]=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[Je]=e||1/0,We(this)}get max(){return this[Je]}set allowStale(e){this[Fe]=!!e}get allowStale(){return this[Fe]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[Ue]=e,We(this)}get maxAge(){return this[Ue]}set lengthCalculator(e){"function"!=typeof e&&(e=Ke),e!==this[Be]&&(this[Be]=e,this[He]=0,this[$e].forEach((e=>{e.length=this[Be](e.value,e.key),this[He]+=e.length}))),We(this)}get lengthCalculator(){return this[Be]}get length(){return this[He]}get itemCount(){return this[$e].length}rforEach(e,t){t=t||this;for(let n=this[$e].tail;null!==n;){const o=n.prev;et(this,e,n,t),n=o}}forEach(e,t){t=t||this;for(let n=this[$e].head;null!==n;){const o=n.next;et(this,e,n,t),n=o}}keys(){return this[$e].toArray().map((e=>e.key))}values(){return this[$e].toArray().map((e=>e.value))}reset(){this[qe]&&this[$e]&&this[$e].length&&this[$e].forEach((e=>this[qe](e.key,e.value))),this[Ge]=new Map,this[$e]=new Me,this[He]=0}dump(){return this[$e].map((e=>!Xe(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[$e]}set(e,t,n){if((n=n||this[Ue])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const o=n?Date.now():0,r=this[Be](t,e);if(this[Ge].has(e)){if(r>this[Je])return Ze(this,this[Ge].get(e)),!1;const i=this[Ge].get(e).value;return this[qe]&&(this[Ve]||this[qe](e,i.value)),i.now=o,i.maxAge=n,i.value=t,this[He]+=r-i.length,i.length=r,this.get(e),We(this),!0}const i=new Ye(e,t,r,o,n);return i.length>this[Je]?(this[qe]&&this[qe](e,t),!1):(this[He]+=i.length,this[$e].unshift(i),this[Ge].set(e,this[$e].head),We(this),!0)}has(e){if(!this[Ge].has(e))return!1;const t=this[Ge].get(e).value;return!Xe(this,t)}get(e){return Qe(this,e,!0)}peek(e){return Qe(this,e,!1)}pop(){const e=this[$e].tail;return e?(Ze(this,e),e.value):null}del(e){Ze(this,this[Ge].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const o=e[n],r=o.e||0;if(0===r)this.set(o.k,o.v);else{const e=r-t;e>0&&this.set(o.k,o.v,e)}}}prune(){this[Ge].forEach(((e,t)=>Qe(this,t,!1)))}};const nt=tt;const{isArray:ot,isObject:rt,isString:it}=K,{asArray:at}=le,{prependBase:st}=me(),lt=Z,ct=class{constructor({document:e}){this.document=e,this.cache=new nt({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}};function dt(e){throw new lt("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function ut({context:e,base:t}){if(!e)return;const n=e["@context"];if(it(n))e["@context"]=st(t,n);else if(ot(n))for(let e=0;e<n.length;++e){const o=n[e];it(o)?n[e]=st(t,o):rt(o)&&ut({context:{"@context":o},base:t})}else if(rt(n))for(const e in n)ut({context:n[e],base:t})}var pt=G.NQuads;const ht=Z,{isArray:ft}=K,{asArray:vt}=le,gt={};var yt=gt;function mt({event:e,handlers:t}){let n=!0;for(let o=0;n&&o<t.length;++o){n=!1;const r=t[o];if(ft(r))n=mt({event:e,handlers:r});else if("function"==typeof r)r({event:e,next:()=>{n=!0}});else{if("object"!=typeof r)throw new ht("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in r?r[e.code]({event:e,next:()=>{n=!0}}):n=!0}}return n}gt.defaultEventHandler=null,gt.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?gt.safeEventHandler:[],e.eventHandler?vt(e.eventHandler):[],gt.defaultEventHandler?gt.defaultEventHandler:[]);return 0===t.length?null:t},gt.handleEvent=({event:e,options:t})=>{mt({event:e,handlers:t.eventHandler})};const xt=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"]);gt.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&xt.has(e.code))throw new ht("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},gt.logEventHandler=function({event:e,next:t}){console.log(`EVENT: ${e.message}`,{event:e}),t()},gt.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&console.warn(`WARNING: ${e.message}`,{event:e}),t()},gt.unhandledEventHandler=function({event:e}){throw new ht("No handler for event.","jsonld.UnhandledEvent",{event:e})},gt.setDefaultEventHandler=function({eventHandler:e}={}){gt.defaultEventHandler=e?vt(e):null};const bt=le,wt=Z,{isArray:It,isObject:jt,isString:St,isUndefined:kt}=K,{isAbsolute:Nt,isRelative:Et,prependBase:Ot}=me(),{handleEvent:Dt}=yt,{REGEX_BCP47:Ct,REGEX_KEYWORD:Lt,asArray:Tt,compareShortestLeast:Rt}=le,At=new Map,_t={};var Pt=_t;function Mt(e,t,n,o,r,i){if(null===t||!St(t)||_t.isKeyword(t))return t;if(t.match(Lt))return null;if(o&&o.hasOwnProperty(t)&&!0!==r.get(t)&&_t.createTermDefinition({activeCtx:e,localCtx:o,term:t,defined:r,options:i}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(jt(n)&&"@id"in n)return n["@id"]}const a=t.indexOf(":");if(a>0){const n=t.substr(0,a),s=t.substr(a+1);if("_"===n||0===s.indexOf("//"))return t;o&&o.hasOwnProperty(n)&&_t.createTermDefinition({activeCtx:e,localCtx:o,term:n,defined:r,options:i});const l=e.mappings.get(n);if(l&&l._prefix)return l["@id"]+s;if(Nt(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=Ot(i.base,e["@base"]),n=Ot(o,t)):(o=e["@base"],n=t):(o=i.base,n=Ot(i.base,t)),t=n}return t}function Jt(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(!Jt(e[n],t[n]))return!1;return!0}const o=Object.keys(e),r=Object.keys(t);if(o.length!==r.length)return!1;for(const n in e){let o=e[n],r=t[n];if("@container"===n&&Array.isArray(o)&&Array.isArray(r)&&(o=o.slice().sort(),r=r.slice().sort()),!Jt(o,r))return!1}return!0}_t.process=async({activeCtx:e,localCtx:t,options:n,propagate:o=!0,overrideProtected:r=!1,cycles:i=new Set})=>{jt(t)&&"@context"in t&&It(t["@context"])&&(t=t["@context"]);if(0===Tt(t).length)return e;const a=[],s=[({event:e,next:t})=>{a.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});jt(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(!r&&0!==Object.keys(e.protected).length)throw new wt("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});d=e=_t.getInitialContext(n).clone();continue}const c=o.getProcessed(e);if(c){if(l.eventHandler)for(const e of c.events)Dt({event:e,options:l});d=e=c.context;continue}if(jt(s)&&"@context"in s&&(s=s["@context"]),!jt(s))throw new wt("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 wt("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 wt("@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||Nt(e));else{if(!Et(e))throw new wt('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=Ot(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(!St(e))throw new wt('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(!Nt(e)&&_t.processingMode(d,1))throw new wt('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=Mt(d,e,{vocab:!0,base:!0},void 0,void 0,n);Nt(t)||n.eventHandler&&Dt({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(!St(e))throw new wt('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(Ct)||n.eventHandler&&Dt({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 wt("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 wt('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 wt("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:s});if("boolean"!=typeof n)throw new wt("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 wt("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:s});if(!St(o))throw new wt("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const r=await n.contextResolver.resolve({activeCtx:e,context:o,documentLoader:n.documentLoader,base:n.base});if(1!==r.length)throw new wt("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const i=r[0].getProcessed(e);if(i)s=i;else{const n=r[0].document;if("@import"in n)throw new wt("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]);r[0].setProcessed(e,s)}u.set("@import",!0)}u.set("@protected",s["@protected"]||!1);for(const e in s)if(_t.createTermDefinition({activeCtx:d,localCtx:s,term:e,defined:u,options:n,overrideProtected:r}),jt(s[e])&&"@context"in s[e]){const t=s[e]["@context"];let o=!0;if(St(t)){const e=Ot(n.base,t);i.has(e)?o=!1:i.add(e)}if(o)try{await _t.process({activeCtx:d.clone(),localCtx:s[e]["@context"],overrideProtected:!0,options:n,cycles:i})}catch(t){throw new wt("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:a})}return d},_t.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:o,options:r,overrideProtected:i=!1})=>{if(o.has(n)){if(o.get(n))return;throw new wt("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let a;if(o.set(n,!1),t.hasOwnProperty(n)&&(a=t[n]),"@type"===n&&jt(a)&&"@set"===(a["@container"]||"@set")&&_t.processingMode(e,1.1)){const e=["@container","@id","@protected"],o=Object.keys(a);if(0===o.length||o.some((t=>!e.includes(t))))throw new wt("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(_t.isKeyword(n))throw new wt("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(Lt))return void(r.eventHandler&&Dt({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:r}));if(""===n)throw new wt("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((St(a)||null===a)&&(l=!0,a={"@id":a}),!jt(a))throw new wt("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"];_t.processingMode(e,1.1)&&d.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in a)if(!d.includes(e))throw new wt("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 a){if("@id"in a)throw new wt("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in a)throw new wt("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const i=a["@reverse"];if(!St(i))throw new wt("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(i.match(Lt))return r.eventHandler&&Dt({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:i}},options:r}),void(s?e.mappings.set(n,s):e.mappings.delete(n));const l=Mt(e,i,{vocab:!0,base:!1},t,o,r);if(!Nt(l))throw new wt("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 a){let i=a["@id"];if(i&&!St(i))throw new wt("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===i)c["@id"]=null;else{if(!_t.isKeyword(i)&&i.match(Lt))return r.eventHandler&&Dt({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:i}},options:r}),void(s?e.mappings.set(n,s):e.mappings.delete(n));if(i!==n){if(i=Mt(e,i,{vocab:!0,base:!1},t,o,r),!Nt(i)&&!_t.isKeyword(i))throw new wt("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(Mt(e,n,{vocab:!0,base:!1},t,new Map(o).set(n,!0),r)!==i)throw new wt("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t})}c["@id"]=i,c._prefix=l&&!c._termHasColon&&null!==i.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in c))if(c._termHasColon){const i=n.substr(0,u);if(t.hasOwnProperty(i)&&_t.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:o,options:r}),e.mappings.has(i)){const t=n.substr(u+1);c["@id"]=e.mappings.get(i)["@id"]+t}else c["@id"]=n}else if("@type"===n)c["@id"]=n;else{if(!("@vocab"in e))throw new wt("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===a["@protected"]||!0===o.get("@protected")&&!1!==a["@protected"])&&(e.protected[n]=!0,c.protected=!0),o.set(n,!0),"@type"in a){let n=a["@type"];if(!St(n))throw new wt("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(_t.processingMode(e,1))throw new wt(`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=Mt(e,n,{vocab:!0,base:!1},t,o,r),!Nt(n))throw new wt("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 wt("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 a){const n=St(a["@container"])?[a["@container"]]:a["@container"]||[],o=["@list","@set","@index","@language"];let r=!0;const i=n.includes("@set");if(_t.processingMode(e,1.1)){if(o.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new wt("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 wt("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 r&=n.length<=(i?2:1);if(n.includes("@type")&&(c["@type"]=c["@type"]||"@id",!["@id","@vocab"].includes(c["@type"])))throw new wt("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else r&=!It(a["@container"]),r&=n.length<=1;if(r&=n.every((e=>o.includes(e))),r&=!(i&&n.includes("@list")),!r)throw new wt("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 wt("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 a){if(!("@container"in a)||!c["@container"].includes("@index"))throw new wt(`Invalid JSON-LD syntax; @index without @index in @container: "${a["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!St(a["@index"])||0===a["@index"].indexOf("@"))throw new wt(`Invalid JSON-LD syntax; @index must expand to an IRI: "${a["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});c["@index"]=a["@index"]}if("@context"in a&&(c["@context"]=a["@context"]),"@language"in a&&!("@type"in a)){let e=a["@language"];if(null!==e&&!St(e))throw new wt("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 a){if(n.match(/:|\//))throw new wt("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(_t.isKeyword(c["@id"]))throw new wt("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof a["@prefix"])throw new wt("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});c._prefix=!0===a["@prefix"]}if("@direction"in a){const e=a["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new wt('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 a){const e=a["@nest"];if(!St(e)||"@nest"!==e&&0===e.indexOf("@"))throw new wt("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}