@blockcerts/blockcerts-verifier 1.58.0 → 1.59.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/bundle-stats.html +24 -20
  2. package/dist/EcdsaSecp256k1Signature2019-XwuS-fWx-n_8xXj1H.js +4 -0
  3. package/dist/Ed25519Signature2020-IJ4ybcbU-ii2PjWjh.js +52 -0
  4. package/dist/{HashlinkVerifier-40818bdd-tYZmELFg.js → HashlinkVerifier-wyKYZ83G-aKb9h_9G.js} +1 -1
  5. package/dist/{MerkleProof2017-ac8d147b-6wk-NtfB.js → MerkleProof2017-Ub6_JUVj-Z6jluDo2.js} +1 -1
  6. package/dist/MerkleProof2019-QUwyEIHd-9hBGmPq_.js +3 -0
  7. package/dist/base64url-qi3FT6uz-yv4mTXpu.js +4 -0
  8. package/dist/checkRevocationStatusList2021-d1qO1xnj-AIMXIqnZ.js +13 -0
  9. package/dist/controlVerificationMethod-6GJtYmqY-VwQyuM5o.js +1 -0
  10. package/dist/{did-key-common.esm-2e9ab4e3-X4avzjKx.js → did-key-common.esm-Fyh_U6fK-6hhnSYH5.js} +3 -3
  11. package/dist/{did-key-ed25519.esm-54d2cbca-E7NBXv8_.js → did-key-ed25519.esm-1lIlZtof-q2UR_X9G.js} +1 -1
  12. package/dist/did-key-secp256k1.esm-hA8kGTM0-5bW-jZai.js +1 -0
  13. package/dist/{downloadPDF-5Pw6AlBs.js → downloadPDF-6pZYEy3P.js} +8 -8
  14. package/dist/index-CZOUZnn4-Lnb5-WZi.js +5 -0
  15. package/dist/{index-6d4132ca-BtAgIaHS.js → index-MC635rre-r3wKwiyR.js} +2 -2
  16. package/dist/index.es-NoR6QQLP.js +56 -0
  17. package/dist/{jsonld-6909fb49-vaWL2Y4h.js → jsonld-CXlzLf4P-Wh4x173W.js} +1 -1
  18. package/dist/{jsonld-signatures-8ecbbaa2-MztjIc1c.js → jsonld-signatures-ooFWZVS--VI8BZQOv.js} +6 -6
  19. package/dist/main.js +110 -110
  20. package/dist/{purify-xGHUwWlQ.js → purify-05qYXQpp.js} +1 -1
  21. package/dist/tslib.es6-M1zqH4el-x9kNW1T_.js +1 -0
  22. package/dist/x25519-NtRELWAG-TIgip27e.js +1 -0
  23. package/package.json +4 -4
  24. package/dist/EcdsaSecp256k1Signature2019-01e33e56-_kD7OEMM.js +0 -4
  25. package/dist/Ed25519Signature2020-722d8d24-52XGswpx.js +0 -74
  26. package/dist/MerkleProof2019-6596bc5f-AOhD0MU2.js +0 -3
  27. package/dist/checkRevocationStatusList2021-904b13ff-HXtw_2Lc.js +0 -17
  28. package/dist/controlVerificationMethod-80d0e7f0-8ug9g49U.js +0 -1
  29. package/dist/did-key-secp256k1.esm-8a01b23c-iRA0puBs.js +0 -1
  30. package/dist/index-85f56501-xkysxAxC.js +0 -4
  31. package/dist/index-a93e1e88-w6XCMY1g.js +0 -1
  32. package/dist/index.es-YP2tdnLj.js +0 -56
  33. package/dist/tslib.es6-28b6776b-qWIKDnpX.js +0 -1
  34. package/dist/x25519-08f432f1-4TKeGPT6.js +0 -1
  35. /package/dist/{Suite-e65d26ad-e2QgHGhx.js → Suite-Bhitn5l3-e2QgHGhx.js} +0 -0
  36. /package/dist/{_commonjs-dynamic-modules-1e49c0dd-fkA6S-_a.js → _commonjs-dynamic-modules-F7P8sER7-fkA6S-_a.js} +0 -0
  37. /package/dist/{elliptic-a9d84078-BGmaMzNc.js → elliptic-il_lPAr--BGmaMzNc.js} +0 -0
  38. /package/dist/{ensureNotRevoked-2dc26afb-U5ByLE-t.js → ensureNotRevoked-2QGGtBqy-U5ByLE-t.js} +0 -0
  39. /package/dist/{ensureValidIssuingKey-b950fb8b-oM__XftS.js → ensureValidIssuingKey-zZEv5-cH-oM__XftS.js} +0 -0
  40. /package/dist/{index-0469d008-LwXIiw03.js → index-xsnp_Fid-LwXIiw03.js} +0 -0
  41. /package/dist/{pako.esm-7a9981ef-RAILONW0.js → pako.esm-jjCKMBM4-RAILONW0.js} +0 -0
  42. /package/dist/{sha256-71400caa-o9J6pXuo.js → sha256-wKeS8_4l-o9J6pXuo.js} +0 -0
@@ -24,7 +24,7 @@ const b=r,w=s,j=l,I=g;var N=class{constructor({createMessageDigest:e=(()=>new w(
24
24
  * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
25
25
  */const _=s,M=A;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=A,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"),Ae=Symbol("lengthCalculator"),Te=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[Te])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[Te]||(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[Ae]="function"!=typeof t?Fe:t,this[Te]=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[Te]=!!e}get allowStale(){return this[Te]}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[Ae]&&(this[Ae]=e,this[Re]=0,this[Pe].forEach((e=>{e.length=this[Ae](e.value,e.key),this[Re]+=e.length}))),Ve(this)}get lengthCalculator(){return this[Ae]}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[Ae](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&&gt(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}
26
26
  // disallow aliasing @context and @preserve
27
- const p=c["@id"];if("@context"===p||"@preserve"===p)throw new ft("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(s&&s.protected&&!r&&(e.protected[n]=!0,c.protected=!0,!Lt(s,c)))throw new ft("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n})},Dt.expandIri=(e,t,n,o)=>Ct(e,t,n,void 0,void 0,o),Dt.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=Et.get(t);if(n)return n;const o={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},o={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],l=e.mappings,c=[...l.keys()].sort(Ot);for(const e of c){const a=l.get(e);if(null===a)continue;let c=a["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===a["@id"])continue;const d=St(a["@id"]);for(const l of d){let d=t[l];const u=Dt.isKeyword(l);if(d)u||a._termHasColon||o[l].push(e);else if(t[l]=d={},!u&&!a._termHasColon){o[l]=[e];const t={iri:l,terms:o[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(d[c]||(d[c]={"@language":{},"@type":{},"@any":{}}),d=d[c],r(e,d["@any"],"@none"),a.reverse)r(e,d["@type"],"@reverse");else if("@none"===a["@type"])r(e,d["@any"],"@none"),r(e,d["@language"],"@none"),r(e,d["@type"],"@none");else if("@type"in a)r(e,d["@type"],a["@type"]);else if("@language"in a&&"@direction"in a){const t=a["@language"],n=a["@direction"];r(e,d["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in a?r(e,d["@language"],(a["@language"]||"@null").toLowerCase()):"@direction"in a?a["@direction"]?r(e,d["@language"],`_${a["@direction"]}`):r(e,d["@language"],"@none"):s?(r(e,d["@language"],`_${s}`),r(e,d["@language"],"@none"),r(e,d["@type"],"@none")):(r(e,d["@language"],i),r(e,d["@language"],"@none"),r(e,d["@type"],"@none"))}}for(const e in n)a(n,e,1);return t},clone:function(){const e={};e.mappings=ht.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=ht.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone());e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]);"@language"in this&&(e["@language"]=this["@language"]);"@vocab"in this&&(e["@vocab"]=this["@vocab"]);return e},revertToPreviousContext:function(){if(!this.previousContext)return this;return this.previousContext.clone()},protected:{}};return 1e4===Et.size&&Et.clear(),Et.set(t,o),o;function a(e,t,n){const o=e[t],r=e[t]={};let i,s;for(const e of o)i=e.iri,s=n>=i.length?"":i[n],s in r?r[s].push(e):r[s]=[e];for(const e in r)""!==e&&a(r,e,n+1)}function r(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},Dt.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const o=e.mappings.get(t);if(mt(n))return o;if(o.hasOwnProperty(n))return o[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},Dt.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,Dt.isKeyword=e=>{if(!yt(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1};const Rt=z,{isArray:At,isObject:Tt,isEmptyObject:_t,isString:Mt,isUndefined:Jt}=F,{isList:Pt,isValue:Bt,isGraph:Ht,isSubject:Ft}=V,{expandIri:qt,getContextValue:Ut,isKeyword:Vt,process:zt,processingMode:Gt}=kt,{isAbsolute:$t}=ue(),{REGEX_BCP47:Qt,REGEX_KEYWORD:Xt,addValue:Wt,asArray:Kt,getValues:Zt,validateTypeValue:Yt}=te,{handleEvent:en}=dt,tn={};var nn=tn;function on({value:e,count:t,options:n}){if(0===t||"@value"in e||"@list"in e||1===t&&"@id"in e){if(n.eventHandler){let o,a;0===t?(o="empty object",a="Dropping empty object."):"@value"in e?(o="object with only @value",a="Dropping object with only @value."):"@list"in e?(o="object with only @list",a="Dropping object with only @list."):1===t&&"@id"in e&&(o="object with only @id",a="Dropping object with only @id."),en({event:{type:["JsonLdEvent"],code:o,level:"warning",message:a,details:{value:e}},options:n})}return null}return e}async function an({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:o,expandedParent:a,options:r={},insideList:i,typeKey:s,typeScopedContext:l}){const c=Object.keys(o).sort(),d=[];let u;const p=o[s]&&"@json"===qt(e,At(o[s])?o[s][0]:o[s],{vocab:!0},{...r,typeExpansion:!0});for(const i of c){let s,c=o[i];if("@context"===i)continue;const h=qt(e,i,{vocab:!0},r);if(null===h||!$t(h)&&!Vt(h)){r.eventHandler&&en({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:i,expandedProperty:h}},options:r});continue}if(Vt(h)){if("@reverse"===n)throw new Rt("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:c});if(h in a&&"@included"!==h&&"@type"!==h)throw new Rt("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:h})}if("@id"===h){if(!Mt(c)){if(!r.isFrame)throw new Rt('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:c});if(Tt(c)){if(!_t(c))throw new Rt('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:c})}else{if(!At(c))throw new Rt('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:c});if(!c.every((e=>Mt(e))))throw new Rt('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:c})}}Wt(a,"@id",Kt(c).map((t=>{if(Mt(t)){const n=qt(e,t,{base:!0},r);return r.eventHandler&&(null===n?en(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:r}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:r}):$t(n)||en({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:n}},options:r})),n}return t})),{propertyIsArray:r.isFrame});continue}if("@type"===h){Tt(c)&&(c=Object.fromEntries(Object.entries(c).map((([e,t])=>[qt(l,e,{vocab:!0}),Kt(t).map((e=>qt(l,e,{base:!0,vocab:!0},{...r,typeExpansion:!0})))])))),Yt(c,r.isFrame),Wt(a,"@type",Kt(c).map((e=>{if(Mt(e)){const t=qt(l,e,{base:!0,vocab:!0},{...r,typeExpansion:!0});return"@json"===t||$t(t)||r.eventHandler&&en({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:r}),t}return e})),{propertyIsArray:!!r.isFrame});continue}if("@included"===h&&Gt(e,1.1)){const n=Kt(await tn.expand({activeCtx:e,activeProperty:t,element:c,options:r}));if(!n.every((e=>Ft(e))))throw new Rt("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:c});Wt(a,"@included",n,{propertyIsArray:!0});continue}if("@graph"===h&&!Tt(c)&&!At(c))throw new Rt('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:c});if("@value"===h){u=c,p&&Gt(e,1.1)?a["@value"]=c:Wt(a,"@value",c,{propertyIsArray:r.isFrame});continue}if("@language"===h){if(null===c)continue;if(!Mt(c)&&!r.isFrame)throw new Rt('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:c});c=Kt(c).map((e=>Mt(e)?e.toLowerCase():e));for(const e of c)Mt(e)&&!e.match(Qt)&&r.eventHandler&&en({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r});Wt(a,"@language",c,{propertyIsArray:r.isFrame});continue}if("@direction"===h){if(!Mt(c)&&!r.isFrame)throw new Rt('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:c});c=Kt(c);for(const e of c)if(Mt(e)&&"ltr"!==e&&"rtl"!==e)throw new Rt('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:c});Wt(a,"@direction",c,{propertyIsArray:r.isFrame});continue}if("@index"===h){if(!Mt(c))throw new Rt('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:c});Wt(a,"@index",c);continue}if("@reverse"===h){if(!Tt(c))throw new Rt('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:c});if(s=await tn.expand({activeCtx:e,activeProperty:"@reverse",element:c,options:r}),"@reverse"in s)for(const e in s["@reverse"])Wt(a,e,s["@reverse"][e],{propertyIsArray:!0});let t=a["@reverse"]||null;for(const e in s){if("@reverse"===e)continue;null===t&&(t=a["@reverse"]={}),Wt(t,e,[],{propertyIsArray:!0});const n=s[e];for(let o=0;o<n.length;++o){const a=n[o];if(Bt(a)||Pt(a))throw new Rt('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:s});Wt(t,e,a,{propertyIsArray:!0})}}continue}if("@nest"===h){d.push(i);continue}let f=e;const v=Ut(e,i,"@context");Jt(v)||(f=await zt({activeCtx:e,localCtx:v,propagate:!0,overrideProtected:!0,options:r}));const g=Ut(f,i,"@container")||[];if(g.includes("@language")&&Tt(c)){s=sn(f,c,Ut(f,i,"@direction"),r)}else if(g.includes("@index")&&Tt(c)){const t=g.includes("@graph"),n=Ut(f,i,"@index")||"@index",o="@index"!==n&&qt(e,n,{vocab:!0},r);s=await ln({activeCtx:f,options:r,activeProperty:i,value:c,asGraph:t,indexKey:n,propertyIndex:o})}else if(g.includes("@id")&&Tt(c)){const e=g.includes("@graph");s=await ln({activeCtx:f,options:r,activeProperty:i,value:c,asGraph:e,indexKey:"@id"})}else if(g.includes("@type")&&Tt(c))s=await ln({activeCtx:f.revertToPreviousContext(),options:r,activeProperty:i,value:c,asGraph:!1,indexKey:"@type"});else{const o="@list"===h;if(o||"@set"===h){let e=t;o&&"@graph"===n&&(e=null),s=await tn.expand({activeCtx:f,activeProperty:e,element:c,options:r,insideList:o})}else s="@json"===Ut(e,i,"@type")?{"@type":"@json","@value":c}:await tn.expand({activeCtx:f,activeProperty:i,element:c,options:r,insideList:!1})}if(null!==s||"@value"===h){if("@list"!==h&&!Pt(s)&&g.includes("@list")&&(s={"@list":Kt(s)}),g.includes("@graph")&&!g.some((e=>"@id"===e||"@index"===e))){if(s=Kt(s),r.isFrame||(s=s.filter((e=>null!==on({value:e,count:Object.keys(e).length,options:r})))),0===s.length)continue;s=s.map((e=>({"@graph":Kt(e)})))}if(f.mappings.has(i)&&f.mappings.get(i).reverse){const e=a["@reverse"]=a["@reverse"]||{};s=Kt(s);for(let t=0;t<s.length;++t){const n=s[t];if(Bt(n)||Pt(n))throw new Rt('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:s});Wt(e,h,n,{propertyIsArray:!0})}}else Wt(a,h,s,{propertyIsArray:!0})}}if("@value"in a)if("@json"===a["@type"]&&Gt(e,1.1));else if((Tt(u)||At(u))&&!r.isFrame)throw new Rt('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:u});for(const c of d){const d=At(o[c])?o[c]:[o[c]];for(const o of d){if(!Tt(o)||Object.keys(o).some((t=>"@value"===qt(e,t,{vocab:!0},r))))throw new Rt("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:o});await an({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:o,expandedParent:a,options:r,insideList:i,typeScopedContext:l,typeKey:s})}}}function rn({activeCtx:e,activeProperty:t,value:n,options:o}){if(null==n)return null;const a=qt(e,t,{vocab:!0},o);if("@id"===a)return qt(e,n,{base:!0},o);if("@type"===a)return qt(e,n,{vocab:!0,base:!0},{...o,typeExpansion:!0});const r=Ut(e,t,"@type");if(("@id"===r||"@graph"===a)&&Mt(n)){const a=qt(e,n,{base:!0},o);return null===a&&n.match(Xt)&&o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:o}),{"@id":a}}if("@vocab"===r&&Mt(n))return{"@id":qt(e,n,{vocab:!0,base:!0},o)};if(Vt(a))return n;const i={};if(r&&!["@id","@vocab","@none"].includes(r))i["@type"]=r;else if(Mt(n)){const n=Ut(e,t,"@language");null!==n&&(i["@language"]=n);const o=Ut(e,t,"@direction");null!==o&&(i["@direction"]=o)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),i["@value"]=n,i}function sn(e,t,n,o){const a=[],r=Object.keys(t).sort();for(const i of r){const r=qt(e,i,{vocab:!0},o);let s=t[i];At(s)||(s=[s]);for(const e of s){if(null===e)continue;if(!Mt(e))throw new Rt("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const s={"@value":e};"@none"!==r&&(i.match(Qt)||o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:i}},options:o}),s["@language"]=i.toLowerCase()),n&&(s["@direction"]=n),a.push(s)}}return a}async function ln({activeCtx:e,options:t,activeProperty:n,value:o,asGraph:a,indexKey:r,propertyIndex:i}){const s=[],l=Object.keys(o).sort(),c="@type"===r;for(let d of l){if(c){const n=Ut(e,d,"@context");Jt(n)||(e=await zt({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let l,u=o[d];At(u)||(u=[u]),u=await tn.expand({activeCtx:e,activeProperty:n,element:u,options:t,insideList:!1,insideIndex:!0}),l=i?"@none"===d?"@none":rn({activeCtx:e,activeProperty:r,value:d,options:t}):qt(e,d,{vocab:!0},t),"@id"===r?d=qt(e,d,{base:!0},t):c&&(d=l);for(let e of u){if(a&&!Ht(e)&&(e={"@graph":[e]}),"@type"===r)"@none"===l||(e["@type"]?e["@type"]=[d].concat(e["@type"]):e["@type"]=[d]);else{if(Bt(e)&&!["@language","@type","@index"].includes(r))throw new Rt(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${r}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});i?"@none"!==l&&Wt(e,i,l,{propertyIsArray:!0,prependValue:!0}):"@none"===l||r in e||(e[r]=d)}s.push(e)}}return s}tn.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:o={},insideList:a=!1,insideIndex:r=!1,typeScopedContext:i=null})=>{if(null==n)return null;if("@default"===t&&(o=Object.assign({},o,{isFrame:!1})),!At(n)&&!Tt(n))return a||null!==t&&"@graph"!==qt(e,t,{vocab:!0},o)?rn({activeCtx:e,activeProperty:t,value:n,options:o}):(o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:n}},options:o}),null);if(At(n)){let s=[];const l=Ut(e,t,"@container")||[];a=a||l.includes("@list");for(let l=0;l<n.length;++l){let c=await tn.expand({activeCtx:e,activeProperty:t,element:n[l],options:o,insideIndex:r,typeScopedContext:i});a&&At(c)&&(c={"@list":c}),null!==c&&(At(c)?s=s.concat(c):s.push(c))}return s}const s=qt(e,t,{vocab:!0},o),l=Ut(e,t,"@context");i=i||(e.previousContext?e:null);let c=Object.keys(n).sort(),d=!r;if(d&&i&&c.length<=2&&!c.includes("@context"))for(const t of c){const n=qt(i,t,{vocab:!0},o);if("@value"===n){d=!1,e=i;break}if("@id"===n&&1===c.length){d=!1;break}}d&&(e=e.revertToPreviousContext()),Jt(l)||(e=await zt({activeCtx:e,localCtx:l,propagate:!0,overrideProtected:!0,options:o})),"@context"in n&&(e=await zt({activeCtx:e,localCtx:n["@context"],options:o})),i=e;let u=null;for(const t of c){if("@type"===qt(e,t,{vocab:!0},o)){u=u||t;const a=n[t],r=Array.isArray(a)?a.length>1?a.slice().sort():a:[a];for(const t of r){const n=Ut(i,t,"@context");Jt(n)||(e=await zt({activeCtx:e,localCtx:n,options:o,propagate:!1}))}}}let p={};await an({activeCtx:e,activeProperty:t,expandedActiveProperty:s,element:n,expandedParent:p,options:o,insideList:a,typeKey:u,typeScopedContext:i}),c=Object.keys(p);let h=c.length;if("@value"in p){if("@type"in p&&("@language"in p||"@direction"in p))throw new Rt('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:p});let t=h-1;if("@type"in p&&(t-=1),"@index"in p&&(t-=1),"@language"in p&&(t-=1),"@direction"in p&&(t-=1),0!==t)throw new Rt('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:p});const n=null===p["@value"]?[]:Kt(p["@value"]),a=Zt(p,"@type");if(Gt(e,1.1)&&a.includes("@json")&&1===a.length);else if(0===n.length)o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:p}},options:o}),p=null;else{if(!n.every((e=>Mt(e)||_t(e)))&&"@language"in p)throw new Rt("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:p});if(!a.every((e=>$t(e)&&!(Mt(e)&&0===e.indexOf("_:"))||_t(e))))throw new Rt('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:p})}}else if("@type"in p&&!At(p["@type"]))p["@type"]=[p["@type"]];else if("@set"in p||"@list"in p){if(h>1&&(2!==h||!("@index"in p)))throw new Rt('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:p});"@set"in p&&(p=p["@set"],c=Object.keys(p),h=c.length)}else 1===h&&"@language"in p&&(o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:p}},options:o}),p=null);return!Tt(p)||o.keepFreeFloatingNodes||a||null!==t&&"@graph"!==s&&!(Ut(e,t,"@container")||[]).includes("@graph")||(p=on({value:p,count:h,options:o})),p};const{isKeyword:cn}=kt,dn=V,un=F,pn=te,hn=z,fn={};var vn=fn;fn.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new pn.IdentifierIssuer("_:b"),o={"@default":{}};return fn.createNodeMap(e,o,"@default",n),fn.mergeNodeMaps(o)},fn.createNodeMap=(e,t,n,o,a,r)=>{if(un.isArray(e)){for(const a of e)fn.createNodeMap(a,t,n,o,void 0,r);return}if(!un.isObject(e))return void(r&&r.push(e));if(dn.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=o.getId(t))}return void(r&&r.push(e))}if(r&&dn.isList(e)){const i=[];return fn.createNodeMap(e["@list"],t,n,o,a,i),void r.push({"@list":i})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&o.getId(e)}un.isUndefined(a)&&(a=dn.isBlankNode(e)?o.getId(e["@id"]):e["@id"]),r&&r.push({"@id":a});const i=t[n],s=i[a]=i[a]||{};s["@id"]=a;const l=Object.keys(e).sort();for(let r of l){if("@id"===r)continue;if("@reverse"===r){const r={"@id":a},s=e["@reverse"];for(const e in s){const a=s[e];for(const s of a){let a=s["@id"];dn.isBlankNode(s)&&(a=o.getId(a)),fn.createNodeMap(s,t,n,o,a),pn.addValue(i[a],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===r){a in t||(t[a]={}),fn.createNodeMap(e[r],t,a,o);continue}if("@included"===r){fn.createNodeMap(e[r],t,n,o);continue}if("@type"!==r&&cn(r)){if("@index"===r&&r in s&&(e[r]!==s[r]||e[r]["@id"]!==s[r]["@id"]))throw new hn("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:s});s[r]=e[r];continue}const l=e[r];if(0===r.indexOf("_:")&&(r=o.getId(r)),0!==l.length)for(let e of l)if("@type"===r&&(e=0===e.indexOf("_:")?o.getId(e):e),dn.isSubject(e)||dn.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const a=dn.isBlankNode(e)?o.getId(e["@id"]):e["@id"];pn.addValue(s,r,{"@id":a},{propertyIsArray:!0,allowDuplicate:!1}),fn.createNodeMap(e,t,n,o,a)}else if(dn.isValue(e))pn.addValue(s,r,e,{propertyIsArray:!0,allowDuplicate:!1});else if(dn.isList(e)){const i=[];fn.createNodeMap(e["@list"],t,n,o,a,i),e={"@list":i},pn.addValue(s,r,e,{propertyIsArray:!0,allowDuplicate:!1})}else fn.createNodeMap(e,t,n,o,a),pn.addValue(s,r,e,{propertyIsArray:!0,allowDuplicate:!1});else pn.addValue(s,r,[],{propertyIsArray:!0})}},fn.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const o of Object.keys(e[n]).sort()){const a=e[n][o];o in t||(t[o]={"@id":o});const r=t[o];for(const e of Object.keys(a).sort())if(cn(e)&&"@type"!==e)r[e]=pn.clone(a[e]);else for(const t of a[e])pn.addValue(r,e,pn.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},fn.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const o of n){if("@default"===o)continue;const n=e[o];let a=t[o];a?"@graph"in a||(a["@graph"]=[]):t[o]=a={"@id":o,"@graph":[]};const r=a["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];dn.isSubjectReference(t)||r.push(t)}}return t};const{isSubjectReference:gn}=V,{createMergedNodeMap:yn}=vn,mn={};var xn=mn;mn.flatten=e=>{const t=yn(e),n=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const a=t[o[e]];gn(a)||n.push(a)}return n};const bn=z,wn=V,jn=F,{REGEX_BCP47:In,addValue:Nn}=te,{handleEvent:Sn}=dt,{RDF_LIST:On,RDF_FIRST:En,RDF_REST:Dn,RDF_NIL:kn,RDF_TYPE:Cn,RDF_JSON_LITERAL:Ln,XSD_BOOLEAN:Rn,XSD_DOUBLE:An,XSD_INTEGER:Tn,XSD_STRING:_n}=ce,Mn={};var Jn=Mn;function Pn(e,t,n,o){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(In)||o.eventHandler&&Sn({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:o}),a["@language"]=e.language;else{let r=e.datatype.value;if(r||(r=_n),r===Ln){r="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new bn("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(r===Rn)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(jn.isNumeric(a["@value"]))if(r===Tn){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else r===An&&(a["@value"]=parseFloat(a["@value"]));[Rn,Tn,An,_n].includes(r)||(a["@type"]=r)}else if("i18n-datatype"===n&&r.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=r.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(In)||o.eventHandler&&Sn({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:o})),a["@direction"]=t}else r!==_n&&(a["@type"]=r)}return a}Mn.fromRDF=async(e,t)=>{const{useRdfType:n=!1,useNativeTypes:o=!1,rdfDirection:a=null}=t,r={},i={"@default":r},s={};if(a){if("compound-literal"===a)throw new bn("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:a});if("i18n-datatype"!==a)throw new bn("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:a})}for(const l of e){const e="DefaultGraph"===l.graph.termType?"@default":l.graph.value;e in i||(i[e]={}),"@default"===e||e in r||(r[e]={"@id":e});const c=i[e],d=l.subject.value,u=l.predicate.value,p=l.object;d in c||(c[d]={"@id":d});const h=c[d],f=p.termType.endsWith("Node");if(f&&!(p.value in c)&&(c[p.value]={"@id":p.value}),u===Cn&&!n&&f){Nn(h,"@type",p.value,{propertyIsArray:!0});continue}const v=Pn(p,o,a,t);if(Nn(h,u,v,{propertyIsArray:!0}),f)if(p.value===kn){const e=c[p.value];"usages"in e||(e.usages=[]),e.usages.push({node:h,property:u,value:v})}else p.value in s?s[p.value]=!1:s[p.value]={node:h,property:u,value:v}}for(const e in i){const t=i[e];if(!(kn in t))continue;const n=t[kn];if(n.usages){for(let e of n.usages){let n=e.node,o=e.property,a=e.value;const r=[],i=[];let l=Object.keys(n).length;for(;o===Dn&&jn.isObject(s[n["@id"]])&&jn.isArray(n[En])&&1===n[En].length&&jn.isArray(n[Dn])&&1===n[Dn].length&&(3===l||4===l&&jn.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===On)&&(r.push(n[En][0]),i.push(n["@id"]),e=s[n["@id"]],n=e.node,o=e.property,a=e.value,l=Object.keys(n).length,wn.isBlankNode(n)););delete a["@id"],a["@list"]=r.reverse();for(const e of i)delete t[e]}delete n.usages}}const l=[],c=Object.keys(r).sort();for(const e of c){const t=r[e];if(e in i){const n=t["@graph"]=[],o=i[e],a=Object.keys(o).sort();for(const e of a){const t=o[e];wn.isSubjectReference(t)||n.push(t)}}wn.isSubjectReference(t)||l.push(t)}return l};const{createNodeMap:Bn}=vn,{isKeyword:Hn}=kt,Fn=V,qn=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,n,o)=>t+(0===o?"":",")+e(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(t).sort().reduce(((n,o,a)=>{if(void 0===t[o]||"symbol"==typeof t[o])return n;return n+(0===n.length?"":",")+e(o)+":"+e(t[o])}),"")+"}"},Un=z,Vn=F,zn=te,{handleEvent:Gn}=dt,{RDF_FIRST:$n,RDF_REST:Qn,RDF_NIL:Xn,RDF_TYPE:Wn,RDF_JSON_LITERAL:Kn,RDF_LANGSTRING:Zn,XSD_BOOLEAN:Yn,XSD_DOUBLE:eo,XSD_INTEGER:to,XSD_STRING:no}=ce,{isAbsolute:oo}=ue(),ao={};var ro=ao;function io(e,t,n,o,a){const r=Object.keys(t).sort();for(const i of r){const r=t[i],s=Object.keys(r).sort();for(let t of s){const s=r[t];if("@type"===t)t=Wn;else if(Hn(t))continue;for(const r of s){const s={termType:i.startsWith("_:")?"BlankNode":"NamedNode",value:i};if(!oo(i)){a.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:i}},options:a});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!oo(t)){a.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:a});continue}if("BlankNode"===l.termType&&!a.produceGeneralizedRdf){a.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:o.getOldIds().find((e=>o.getId(e)===t))}},options:a});continue}const c=so(r,o,e,n,a.rdfDirection,a);c&&e.push({subject:s,predicate:l,object:c,graph:n})}}}}function so(e,t,n,o,a,r){const i={};if(Fn.isValue(e)){i.termType="Literal",i.value=void 0,i.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)i.value=qn(t),i.datatype.value=Kn;else if(Vn.isBoolean(t))i.value=t.toString(),i.datatype.value=n||Yn;else if(Vn.isDouble(t)||n===eo)Vn.isDouble(t)||(t=parseFloat(t)),i.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),i.datatype.value=n||eo;else if(Vn.isNumber(t))i.value=t.toFixed(0),i.datatype.value=n||to;else if("@direction"in e&&"i18n-datatype"===a){const n=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;i.datatype.value=n,i.value=t}else{if("@direction"in e&&"compound-literal"===a)throw new Un("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:a});if("@direction"in e&&a)throw new Un("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:a});"@language"in e?("@direction"in e&&!a&&r.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:i.value}},options:r}),i.value=t,i.datatype.value=n||Zn,i.language=e["@language"]):("@direction"in e&&!a&&r.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:i.value}},options:r}),i.value=t,i.datatype.value=n||no)}}else if(Fn.isList(e)){const s=function(e,t,n,o,a,r){const i={termType:"NamedNode",value:$n},s={termType:"NamedNode",value:Qn},l={termType:"NamedNode",value:Xn},c=e.pop(),d=c?{termType:"BlankNode",value:t.getId()}:l;let u=d;for(const l of e){const e=so(l,t,n,o,a,r),c={termType:"BlankNode",value:t.getId()};n.push({subject:u,predicate:i,object:e,graph:o}),n.push({subject:u,predicate:s,object:c,graph:o}),u=c}if(c){const e=so(c,t,n,o,a,r);n.push({subject:u,predicate:i,object:e,graph:o}),n.push({subject:u,predicate:s,object:l,graph:o})}return d}(e["@list"],t,n,o,a,r);i.termType=s.termType,i.value=s.value}else{const t=Vn.isObject(e)?e["@id"]:e;i.termType=t.startsWith("_:")?"BlankNode":"NamedNode",i.value=t}return"NamedNode"!==i.termType||oo(i.value)?i:(r.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:i.value}},options:r}),null)}ao.toRDF=(e,t)=>{const n=new zn.IdentifierIssuer("_:b"),o={"@default":{}};Bn(e,o,"@default",n);const a=[],r=Object.keys(o).sort();for(const e of r){let r;if("@default"===e)r={termType:"DefaultGraph",value:""};else{if(!oo(e)){t.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}r=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},r.value=e}io(a,o[e],r,n,t)}return a};const{isKeyword:lo}=kt,co=V,uo=F,po=te,ho=ue(),fo=z,{createNodeMap:vo,mergeNodeMapGraphs:go}=vn,yo={};var mo=yo;function xo(e){const t={};for(const n in e)void 0!==e[n]&&(t["@"+n]=[e[n]]);return[t]}function bo(e,t,n){for(let o=n.length-1;o>=0;--o){const a=n[o];if(a.graph===t&&a.subject["@id"]===e["@id"])return!0}return!1}function wo(e,t,n){const o="@"+n;let a=o in e?e[o][0]:t[n];if("embed"===n)if(!0===a)a="@once";else if(!1===a)a="@never";else if("@always"!==a&&"@never"!==a&&"@link"!==a&&"@first"!==a&&"@last"!==a&&"@once"!==a)throw new fo("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return a}function jo(e){if(!uo.isArray(e)||1!==e.length||!uo.isObject(e[0]))throw new fo("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of po.asArray(e[0]["@id"]))if(!uo.isObject(t)&&!ho.isAbsolute(t)||uo.isString(t)&&0===t.indexOf("_:"))throw new fo("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of po.asArray(e[0]["@type"]))if(!uo.isObject(t)&&!ho.isAbsolute(t)&&"@json"!==t||uo.isString(t)&&0===t.indexOf("_:"))throw new fo("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function Io(e,t,n,o){let a=!0,r=!1;for(const i in n){let s=!1;const l=po.getValues(t,i),c=0===po.getValues(n,i).length;if("@id"===i){if(uo.isEmptyObject(n["@id"][0]||{})?s=!0:n["@id"].length>=0&&(s=n["@id"].includes(l[0])),!o.requireAll)return s}else if("@type"===i){if(a=!1,c){if(l.length>0)return!1;s=!0}else if(1===n["@type"].length&&uo.isEmptyObject(n["@type"][0]))s=l.length>0;else for(const e of n["@type"])s=!(!uo.isObject(e)||!("@default"in e))||(s||l.some((t=>t===e)));if(!o.requireAll)return s}else{if(lo(i))continue;{const t=po.getValues(n,i)[0];let r=!1;if(t&&(jo([t]),r="@default"in t),a=!1,0===l.length&&r)continue;if(l.length>0&&c)return!1;if(void 0===t){if(l.length>0)return!1;s=!0}else if(co.isList(t)){const n=t["@list"][0];if(co.isList(l[0])){const t=l[0]["@list"];co.isValue(n)?s=t.some((e=>Do(n,e))):(co.isSubject(n)||co.isSubjectReference(n))&&(s=t.some((t=>Eo(e,n,t,o))))}}else s=co.isValue(t)?l.some((e=>Do(t,e))):co.isSubjectReference(t)?l.some((n=>Eo(e,t,n,o))):!!uo.isObject(t)&&l.length>0}}if(!s&&o.requireAll)return!1;r=r||s}return a||r}function No(e,t){const n=e.uniqueEmbeds[e.graph],o=n[t],a=o.parent,r=o.property,i={"@id":t};if(uo.isArray(a)){for(let e=0;e<a.length;++e)if(po.compareValues(a[e],i)){a[e]=i;break}}else{const e=uo.isArray(a[r]);po.removeValue(a,r,i,{propertyIsArray:e}),po.addValue(a,r,i,{propertyIsArray:e})}const s=e=>{const t=Object.keys(n);for(const o of t)o in n&&uo.isObject(n[o].parent)&&n[o].parent["@id"]===e&&(delete n[o],s(o))};s(t)}
27
+ const p=c["@id"];if("@context"===p||"@preserve"===p)throw new ft("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(s&&s.protected&&!r&&(e.protected[n]=!0,c.protected=!0,!Lt(s,c)))throw new ft("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n})},Dt.expandIri=(e,t,n,o)=>Ct(e,t,n,void 0,void 0,o),Dt.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=Et.get(t);if(n)return n;const o={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},o={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],l=e.mappings,c=[...l.keys()].sort(Ot);for(const e of c){const a=l.get(e);if(null===a)continue;let c=a["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===a["@id"])continue;const d=St(a["@id"]);for(const l of d){let d=t[l];const u=Dt.isKeyword(l);if(d)u||a._termHasColon||o[l].push(e);else if(t[l]=d={},!u&&!a._termHasColon){o[l]=[e];const t={iri:l,terms:o[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(d[c]||(d[c]={"@language":{},"@type":{},"@any":{}}),d=d[c],r(e,d["@any"],"@none"),a.reverse)r(e,d["@type"],"@reverse");else if("@none"===a["@type"])r(e,d["@any"],"@none"),r(e,d["@language"],"@none"),r(e,d["@type"],"@none");else if("@type"in a)r(e,d["@type"],a["@type"]);else if("@language"in a&&"@direction"in a){const t=a["@language"],n=a["@direction"];r(e,d["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in a?r(e,d["@language"],(a["@language"]||"@null").toLowerCase()):"@direction"in a?a["@direction"]?r(e,d["@language"],`_${a["@direction"]}`):r(e,d["@language"],"@none"):s?(r(e,d["@language"],`_${s}`),r(e,d["@language"],"@none"),r(e,d["@type"],"@none")):(r(e,d["@language"],i),r(e,d["@language"],"@none"),r(e,d["@type"],"@none"))}}for(const e in n)a(n,e,1);return t},clone:function(){const e={};e.mappings=ht.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=ht.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone());e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]);"@language"in this&&(e["@language"]=this["@language"]);"@vocab"in this&&(e["@vocab"]=this["@vocab"]);return e},revertToPreviousContext:function(){if(!this.previousContext)return this;return this.previousContext.clone()},protected:{}};return 1e4===Et.size&&Et.clear(),Et.set(t,o),o;function a(e,t,n){const o=e[t],r=e[t]={};let i,s;for(const e of o)i=e.iri,s=n>=i.length?"":i[n],s in r?r[s].push(e):r[s]=[e];for(const e in r)""!==e&&a(r,e,n+1)}function r(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},Dt.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const o=e.mappings.get(t);if(mt(n))return o;if(o.hasOwnProperty(n))return o[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},Dt.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,Dt.isKeyword=e=>{if(!yt(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1};const Rt=z,{isArray:At,isObject:Tt,isEmptyObject:_t,isString:Mt,isUndefined:Jt}=F,{isList:Pt,isValue:Bt,isGraph:Ht,isSubject:Ft}=V,{expandIri:qt,getContextValue:Ut,isKeyword:Vt,process:zt,processingMode:Gt}=kt,{isAbsolute:$t}=ue(),{REGEX_BCP47:Qt,REGEX_KEYWORD:Xt,addValue:Wt,asArray:Kt,getValues:Zt,validateTypeValue:Yt}=te,{handleEvent:en}=dt,tn={};var nn=tn;function on({value:e,count:t,options:n}){if(0===t||"@value"in e||"@list"in e||1===t&&"@id"in e){if(n.eventHandler){let o,a;0===t?(o="empty object",a="Dropping empty object."):"@value"in e?(o="object with only @value",a="Dropping object with only @value."):"@list"in e?(o="object with only @list",a="Dropping object with only @list."):1===t&&"@id"in e&&(o="object with only @id",a="Dropping object with only @id."),en({event:{type:["JsonLdEvent"],code:o,level:"warning",message:a,details:{value:e}},options:n})}return null}return e}async function an({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:o,expandedParent:a,options:r={},insideList:i,typeKey:s,typeScopedContext:l}){const c=Object.keys(o).sort(),d=[];let u;const p=o[s]&&"@json"===qt(e,At(o[s])?o[s][0]:o[s],{vocab:!0},{...r,typeExpansion:!0});for(const i of c){let s,c=o[i];if("@context"===i)continue;const h=qt(e,i,{vocab:!0},r);if(null===h||!$t(h)&&!Vt(h)){r.eventHandler&&en({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:i,expandedProperty:h}},options:r});continue}if(Vt(h)){if("@reverse"===n)throw new Rt("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:c});if(h in a&&"@included"!==h&&"@type"!==h)throw new Rt("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:h})}if("@id"===h){if(!Mt(c)){if(!r.isFrame)throw new Rt('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:c});if(Tt(c)){if(!_t(c))throw new Rt('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:c})}else{if(!At(c))throw new Rt('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:c});if(!c.every((e=>Mt(e))))throw new Rt('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:c})}}Wt(a,"@id",Kt(c).map((t=>{if(Mt(t)){const n=qt(e,t,{base:!0},r);return r.eventHandler&&(null===n?en(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:r}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:r}):$t(n)||en({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:n}},options:r})),n}return t})),{propertyIsArray:r.isFrame});continue}if("@type"===h){Tt(c)&&(c=Object.fromEntries(Object.entries(c).map((([e,t])=>[qt(l,e,{vocab:!0}),Kt(t).map((e=>qt(l,e,{base:!0,vocab:!0},{...r,typeExpansion:!0})))])))),Yt(c,r.isFrame),Wt(a,"@type",Kt(c).map((e=>{if(Mt(e)){const t=qt(l,e,{base:!0,vocab:!0},{...r,typeExpansion:!0});return"@json"===t||$t(t)||r.eventHandler&&en({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:r}),t}return e})),{propertyIsArray:!!r.isFrame});continue}if("@included"===h&&Gt(e,1.1)){const n=Kt(await tn.expand({activeCtx:e,activeProperty:t,element:c,options:r}));if(!n.every((e=>Ft(e))))throw new Rt("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:c});Wt(a,"@included",n,{propertyIsArray:!0});continue}if("@graph"===h&&!Tt(c)&&!At(c))throw new Rt('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:c});if("@value"===h){u=c,p&&Gt(e,1.1)?a["@value"]=c:Wt(a,"@value",c,{propertyIsArray:r.isFrame});continue}if("@language"===h){if(null===c)continue;if(!Mt(c)&&!r.isFrame)throw new Rt('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:c});c=Kt(c).map((e=>Mt(e)?e.toLowerCase():e));for(const e of c)Mt(e)&&!e.match(Qt)&&r.eventHandler&&en({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r});Wt(a,"@language",c,{propertyIsArray:r.isFrame});continue}if("@direction"===h){if(!Mt(c)&&!r.isFrame)throw new Rt('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:c});c=Kt(c);for(const e of c)if(Mt(e)&&"ltr"!==e&&"rtl"!==e)throw new Rt('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:c});Wt(a,"@direction",c,{propertyIsArray:r.isFrame});continue}if("@index"===h){if(!Mt(c))throw new Rt('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:c});Wt(a,"@index",c);continue}if("@reverse"===h){if(!Tt(c))throw new Rt('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:c});if(s=await tn.expand({activeCtx:e,activeProperty:"@reverse",element:c,options:r}),"@reverse"in s)for(const e in s["@reverse"])Wt(a,e,s["@reverse"][e],{propertyIsArray:!0});let t=a["@reverse"]||null;for(const e in s){if("@reverse"===e)continue;null===t&&(t=a["@reverse"]={}),Wt(t,e,[],{propertyIsArray:!0});const n=s[e];for(let o=0;o<n.length;++o){const a=n[o];if(Bt(a)||Pt(a))throw new Rt('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:s});Wt(t,e,a,{propertyIsArray:!0})}}continue}if("@nest"===h){d.push(i);continue}let f=e;const v=Ut(e,i,"@context");Jt(v)||(f=await zt({activeCtx:e,localCtx:v,propagate:!0,overrideProtected:!0,options:r}));const g=Ut(e,i,"@container")||[];if(g.includes("@language")&&Tt(c)){s=sn(f,c,Ut(f,i,"@direction"),r)}else if(g.includes("@index")&&Tt(c)){const t=g.includes("@graph"),n=Ut(f,i,"@index")||"@index",o="@index"!==n&&qt(e,n,{vocab:!0},r);s=await ln({activeCtx:f,options:r,activeProperty:i,value:c,asGraph:t,indexKey:n,propertyIndex:o})}else if(g.includes("@id")&&Tt(c)){const e=g.includes("@graph");s=await ln({activeCtx:f,options:r,activeProperty:i,value:c,asGraph:e,indexKey:"@id"})}else if(g.includes("@type")&&Tt(c))s=await ln({activeCtx:f.revertToPreviousContext(),options:r,activeProperty:i,value:c,asGraph:!1,indexKey:"@type"});else{const o="@list"===h;if(o||"@set"===h){let e=t;o&&"@graph"===n&&(e=null),s=await tn.expand({activeCtx:f,activeProperty:e,element:c,options:r,insideList:o})}else s="@json"===Ut(e,i,"@type")?{"@type":"@json","@value":c}:await tn.expand({activeCtx:f,activeProperty:i,element:c,options:r,insideList:!1})}if(null!==s||"@value"===h){if("@list"!==h&&!Pt(s)&&g.includes("@list")&&(s={"@list":Kt(s)}),g.includes("@graph")&&!g.some((e=>"@id"===e||"@index"===e))){if(s=Kt(s),r.isFrame||(s=s.filter((e=>null!==on({value:e,count:Object.keys(e).length,options:r})))),0===s.length)continue;s=s.map((e=>({"@graph":Kt(e)})))}if(f.mappings.has(i)&&f.mappings.get(i).reverse){const e=a["@reverse"]=a["@reverse"]||{};s=Kt(s);for(let t=0;t<s.length;++t){const n=s[t];if(Bt(n)||Pt(n))throw new Rt('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:s});Wt(e,h,n,{propertyIsArray:!0})}}else Wt(a,h,s,{propertyIsArray:!0})}}if("@value"in a)if("@json"===a["@type"]&&Gt(e,1.1));else if((Tt(u)||At(u))&&!r.isFrame)throw new Rt('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:u});for(const c of d){const d=At(o[c])?o[c]:[o[c]];for(const o of d){if(!Tt(o)||Object.keys(o).some((t=>"@value"===qt(e,t,{vocab:!0},r))))throw new Rt("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:o});await an({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:o,expandedParent:a,options:r,insideList:i,typeScopedContext:l,typeKey:s})}}}function rn({activeCtx:e,activeProperty:t,value:n,options:o}){if(null==n)return null;const a=qt(e,t,{vocab:!0},o);if("@id"===a)return qt(e,n,{base:!0},o);if("@type"===a)return qt(e,n,{vocab:!0,base:!0},{...o,typeExpansion:!0});const r=Ut(e,t,"@type");if(("@id"===r||"@graph"===a)&&Mt(n)){const a=qt(e,n,{base:!0},o);return null===a&&n.match(Xt)&&o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:o}),{"@id":a}}if("@vocab"===r&&Mt(n))return{"@id":qt(e,n,{vocab:!0,base:!0},o)};if(Vt(a))return n;const i={};if(r&&!["@id","@vocab","@none"].includes(r))i["@type"]=r;else if(Mt(n)){const n=Ut(e,t,"@language");null!==n&&(i["@language"]=n);const o=Ut(e,t,"@direction");null!==o&&(i["@direction"]=o)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),i["@value"]=n,i}function sn(e,t,n,o){const a=[],r=Object.keys(t).sort();for(const i of r){const r=qt(e,i,{vocab:!0},o);let s=t[i];At(s)||(s=[s]);for(const e of s){if(null===e)continue;if(!Mt(e))throw new Rt("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const s={"@value":e};"@none"!==r&&(i.match(Qt)||o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:i}},options:o}),s["@language"]=i.toLowerCase()),n&&(s["@direction"]=n),a.push(s)}}return a}async function ln({activeCtx:e,options:t,activeProperty:n,value:o,asGraph:a,indexKey:r,propertyIndex:i}){const s=[],l=Object.keys(o).sort(),c="@type"===r;for(let d of l){if(c){const n=Ut(e,d,"@context");Jt(n)||(e=await zt({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let l,u=o[d];At(u)||(u=[u]),u=await tn.expand({activeCtx:e,activeProperty:n,element:u,options:t,insideList:!1,insideIndex:!0}),l=i?"@none"===d?"@none":rn({activeCtx:e,activeProperty:r,value:d,options:t}):qt(e,d,{vocab:!0},t),"@id"===r?d=qt(e,d,{base:!0},t):c&&(d=l);for(let e of u){if(a&&!Ht(e)&&(e={"@graph":[e]}),"@type"===r)"@none"===l||(e["@type"]?e["@type"]=[d].concat(e["@type"]):e["@type"]=[d]);else{if(Bt(e)&&!["@language","@type","@index"].includes(r))throw new Rt(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${r}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});i?"@none"!==l&&Wt(e,i,l,{propertyIsArray:!0,prependValue:!0}):"@none"===l||r in e||(e[r]=d)}s.push(e)}}return s}tn.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:o={},insideList:a=!1,insideIndex:r=!1,typeScopedContext:i=null})=>{if(null==n)return null;if("@default"===t&&(o=Object.assign({},o,{isFrame:!1})),!At(n)&&!Tt(n))return a||null!==t&&"@graph"!==qt(e,t,{vocab:!0},o)?rn({activeCtx:e,activeProperty:t,value:n,options:o}):(o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:n}},options:o}),null);if(At(n)){let s=[];const l=Ut(e,t,"@container")||[];a=a||l.includes("@list");for(let l=0;l<n.length;++l){let c=await tn.expand({activeCtx:e,activeProperty:t,element:n[l],options:o,insideIndex:r,typeScopedContext:i});a&&At(c)&&(c={"@list":c}),null!==c&&(At(c)?s=s.concat(c):s.push(c))}return s}const s=qt(e,t,{vocab:!0},o),l=Ut(e,t,"@context");i=i||(e.previousContext?e:null);let c=Object.keys(n).sort(),d=!r;if(d&&i&&c.length<=2&&!c.includes("@context"))for(const t of c){const n=qt(i,t,{vocab:!0},o);if("@value"===n){d=!1,e=i;break}if("@id"===n&&1===c.length){d=!1;break}}d&&(e=e.revertToPreviousContext()),Jt(l)||(e=await zt({activeCtx:e,localCtx:l,propagate:!0,overrideProtected:!0,options:o})),"@context"in n&&(e=await zt({activeCtx:e,localCtx:n["@context"],options:o})),i=e;let u=null;for(const t of c){if("@type"===qt(e,t,{vocab:!0},o)){u=u||t;const a=n[t],r=Array.isArray(a)?a.length>1?a.slice().sort():a:[a];for(const t of r){const n=Ut(i,t,"@context");Jt(n)||(e=await zt({activeCtx:e,localCtx:n,options:o,propagate:!1}))}}}let p={};await an({activeCtx:e,activeProperty:t,expandedActiveProperty:s,element:n,expandedParent:p,options:o,insideList:a,typeKey:u,typeScopedContext:i}),c=Object.keys(p);let h=c.length;if("@value"in p){if("@type"in p&&("@language"in p||"@direction"in p))throw new Rt('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:p});let t=h-1;if("@type"in p&&(t-=1),"@index"in p&&(t-=1),"@language"in p&&(t-=1),"@direction"in p&&(t-=1),0!==t)throw new Rt('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:p});const n=null===p["@value"]?[]:Kt(p["@value"]),a=Zt(p,"@type");if(Gt(e,1.1)&&a.includes("@json")&&1===a.length);else if(0===n.length)o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:p}},options:o}),p=null;else{if(!n.every((e=>Mt(e)||_t(e)))&&"@language"in p)throw new Rt("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:p});if(!a.every((e=>$t(e)&&!(Mt(e)&&0===e.indexOf("_:"))||_t(e))))throw new Rt('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:p})}}else if("@type"in p&&!At(p["@type"]))p["@type"]=[p["@type"]];else if("@set"in p||"@list"in p){if(h>1&&(2!==h||!("@index"in p)))throw new Rt('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:p});"@set"in p&&(p=p["@set"],c=Object.keys(p),h=c.length)}else 1===h&&"@language"in p&&(o.eventHandler&&en({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:p}},options:o}),p=null);return!Tt(p)||o.keepFreeFloatingNodes||a||null!==t&&"@graph"!==s&&!(Ut(e,t,"@container")||[]).includes("@graph")||(p=on({value:p,count:h,options:o})),p};const{isKeyword:cn}=kt,dn=V,un=F,pn=te,hn=z,fn={};var vn=fn;fn.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new pn.IdentifierIssuer("_:b"),o={"@default":{}};return fn.createNodeMap(e,o,"@default",n),fn.mergeNodeMaps(o)},fn.createNodeMap=(e,t,n,o,a,r)=>{if(un.isArray(e)){for(const a of e)fn.createNodeMap(a,t,n,o,void 0,r);return}if(!un.isObject(e))return void(r&&r.push(e));if(dn.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=o.getId(t))}return void(r&&r.push(e))}if(r&&dn.isList(e)){const i=[];return fn.createNodeMap(e["@list"],t,n,o,a,i),void r.push({"@list":i})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&o.getId(e)}un.isUndefined(a)&&(a=dn.isBlankNode(e)?o.getId(e["@id"]):e["@id"]),r&&r.push({"@id":a});const i=t[n],s=i[a]=i[a]||{};s["@id"]=a;const l=Object.keys(e).sort();for(let r of l){if("@id"===r)continue;if("@reverse"===r){const r={"@id":a},s=e["@reverse"];for(const e in s){const a=s[e];for(const s of a){let a=s["@id"];dn.isBlankNode(s)&&(a=o.getId(a)),fn.createNodeMap(s,t,n,o,a),pn.addValue(i[a],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===r){a in t||(t[a]={}),fn.createNodeMap(e[r],t,a,o);continue}if("@included"===r){fn.createNodeMap(e[r],t,n,o);continue}if("@type"!==r&&cn(r)){if("@index"===r&&r in s&&(e[r]!==s[r]||e[r]["@id"]!==s[r]["@id"]))throw new hn("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:s});s[r]=e[r];continue}const l=e[r];if(0===r.indexOf("_:")&&(r=o.getId(r)),0!==l.length)for(let e of l)if("@type"===r&&(e=0===e.indexOf("_:")?o.getId(e):e),dn.isSubject(e)||dn.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const a=dn.isBlankNode(e)?o.getId(e["@id"]):e["@id"];pn.addValue(s,r,{"@id":a},{propertyIsArray:!0,allowDuplicate:!1}),fn.createNodeMap(e,t,n,o,a)}else if(dn.isValue(e))pn.addValue(s,r,e,{propertyIsArray:!0,allowDuplicate:!1});else if(dn.isList(e)){const i=[];fn.createNodeMap(e["@list"],t,n,o,a,i),e={"@list":i},pn.addValue(s,r,e,{propertyIsArray:!0,allowDuplicate:!1})}else fn.createNodeMap(e,t,n,o,a),pn.addValue(s,r,e,{propertyIsArray:!0,allowDuplicate:!1});else pn.addValue(s,r,[],{propertyIsArray:!0})}},fn.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const o of Object.keys(e[n]).sort()){const a=e[n][o];o in t||(t[o]={"@id":o});const r=t[o];for(const e of Object.keys(a).sort())if(cn(e)&&"@type"!==e)r[e]=pn.clone(a[e]);else for(const t of a[e])pn.addValue(r,e,pn.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},fn.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const o of n){if("@default"===o)continue;const n=e[o];let a=t[o];a?"@graph"in a||(a["@graph"]=[]):t[o]=a={"@id":o,"@graph":[]};const r=a["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];dn.isSubjectReference(t)||r.push(t)}}return t};const{isSubjectReference:gn}=V,{createMergedNodeMap:yn}=vn,mn={};var xn=mn;mn.flatten=e=>{const t=yn(e),n=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const a=t[o[e]];gn(a)||n.push(a)}return n};const bn=z,wn=V,jn=F,{REGEX_BCP47:In,addValue:Nn}=te,{handleEvent:Sn}=dt,{RDF_LIST:On,RDF_FIRST:En,RDF_REST:Dn,RDF_NIL:kn,RDF_TYPE:Cn,RDF_JSON_LITERAL:Ln,XSD_BOOLEAN:Rn,XSD_DOUBLE:An,XSD_INTEGER:Tn,XSD_STRING:_n}=ce,Mn={};var Jn=Mn;function Pn(e,t,n,o){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(In)||o.eventHandler&&Sn({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:o}),a["@language"]=e.language;else{let r=e.datatype.value;if(r||(r=_n),r===Ln){r="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new bn("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(r===Rn)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(jn.isNumeric(a["@value"]))if(r===Tn){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else r===An&&(a["@value"]=parseFloat(a["@value"]));[Rn,Tn,An,_n].includes(r)||(a["@type"]=r)}else if("i18n-datatype"===n&&r.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=r.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(In)||o.eventHandler&&Sn({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:o})),a["@direction"]=t}else r!==_n&&(a["@type"]=r)}return a}Mn.fromRDF=async(e,t)=>{const{useRdfType:n=!1,useNativeTypes:o=!1,rdfDirection:a=null}=t,r={},i={"@default":r},s={};if(a){if("compound-literal"===a)throw new bn("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:a});if("i18n-datatype"!==a)throw new bn("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:a})}for(const l of e){const e="DefaultGraph"===l.graph.termType?"@default":l.graph.value;e in i||(i[e]={}),"@default"===e||e in r||(r[e]={"@id":e});const c=i[e],d=l.subject.value,u=l.predicate.value,p=l.object;d in c||(c[d]={"@id":d});const h=c[d],f=p.termType.endsWith("Node");if(f&&!(p.value in c)&&(c[p.value]={"@id":p.value}),u===Cn&&!n&&f){Nn(h,"@type",p.value,{propertyIsArray:!0});continue}const v=Pn(p,o,a,t);if(Nn(h,u,v,{propertyIsArray:!0}),f)if(p.value===kn){const e=c[p.value];"usages"in e||(e.usages=[]),e.usages.push({node:h,property:u,value:v})}else p.value in s?s[p.value]=!1:s[p.value]={node:h,property:u,value:v}}for(const e in i){const t=i[e];if(!(kn in t))continue;const n=t[kn];if(n.usages){for(let e of n.usages){let n=e.node,o=e.property,a=e.value;const r=[],i=[];let l=Object.keys(n).length;for(;o===Dn&&jn.isObject(s[n["@id"]])&&jn.isArray(n[En])&&1===n[En].length&&jn.isArray(n[Dn])&&1===n[Dn].length&&(3===l||4===l&&jn.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===On)&&(r.push(n[En][0]),i.push(n["@id"]),e=s[n["@id"]],n=e.node,o=e.property,a=e.value,l=Object.keys(n).length,wn.isBlankNode(n)););delete a["@id"],a["@list"]=r.reverse();for(const e of i)delete t[e]}delete n.usages}}const l=[],c=Object.keys(r).sort();for(const e of c){const t=r[e];if(e in i){const n=t["@graph"]=[],o=i[e],a=Object.keys(o).sort();for(const e of a){const t=o[e];wn.isSubjectReference(t)||n.push(t)}}wn.isSubjectReference(t)||l.push(t)}return l};const{createNodeMap:Bn}=vn,{isKeyword:Hn}=kt,Fn=V,qn=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,n,o)=>t+(0===o?"":",")+e(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(t).sort().reduce(((n,o,a)=>{if(void 0===t[o]||"symbol"==typeof t[o])return n;return n+(0===n.length?"":",")+e(o)+":"+e(t[o])}),"")+"}"},Un=z,Vn=F,zn=te,{handleEvent:Gn}=dt,{RDF_FIRST:$n,RDF_REST:Qn,RDF_NIL:Xn,RDF_TYPE:Wn,RDF_JSON_LITERAL:Kn,RDF_LANGSTRING:Zn,XSD_BOOLEAN:Yn,XSD_DOUBLE:eo,XSD_INTEGER:to,XSD_STRING:no}=ce,{isAbsolute:oo}=ue(),ao={};var ro=ao;function io(e,t,n,o,a){const r=Object.keys(t).sort();for(const i of r){const r=t[i],s=Object.keys(r).sort();for(let t of s){const s=r[t];if("@type"===t)t=Wn;else if(Hn(t))continue;for(const r of s){const s={termType:i.startsWith("_:")?"BlankNode":"NamedNode",value:i};if(!oo(i)){a.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:i}},options:a});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!oo(t)){a.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:a});continue}if("BlankNode"===l.termType&&!a.produceGeneralizedRdf){a.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:o.getOldIds().find((e=>o.getId(e)===t))}},options:a});continue}const c=so(r,o,e,n,a.rdfDirection,a);c&&e.push({subject:s,predicate:l,object:c,graph:n})}}}}function so(e,t,n,o,a,r){const i={};if(Fn.isValue(e)){i.termType="Literal",i.value=void 0,i.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)i.value=qn(t),i.datatype.value=Kn;else if(Vn.isBoolean(t))i.value=t.toString(),i.datatype.value=n||Yn;else if(Vn.isDouble(t)||n===eo)Vn.isDouble(t)||(t=parseFloat(t)),i.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),i.datatype.value=n||eo;else if(Vn.isNumber(t))i.value=t.toFixed(0),i.datatype.value=n||to;else if("@direction"in e&&"i18n-datatype"===a){const n=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;i.datatype.value=n,i.value=t}else{if("@direction"in e&&"compound-literal"===a)throw new Un("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:a});if("@direction"in e&&a)throw new Un("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:a});"@language"in e?("@direction"in e&&!a&&r.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:i.value}},options:r}),i.value=t,i.datatype.value=n||Zn,i.language=e["@language"]):("@direction"in e&&!a&&r.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:i.value}},options:r}),i.value=t,i.datatype.value=n||no)}}else if(Fn.isList(e)){const s=function(e,t,n,o,a,r){const i={termType:"NamedNode",value:$n},s={termType:"NamedNode",value:Qn},l={termType:"NamedNode",value:Xn},c=e.pop(),d=c?{termType:"BlankNode",value:t.getId()}:l;let u=d;for(const l of e){const e=so(l,t,n,o,a,r),c={termType:"BlankNode",value:t.getId()};n.push({subject:u,predicate:i,object:e,graph:o}),n.push({subject:u,predicate:s,object:c,graph:o}),u=c}if(c){const e=so(c,t,n,o,a,r);n.push({subject:u,predicate:i,object:e,graph:o}),n.push({subject:u,predicate:s,object:l,graph:o})}return d}(e["@list"],t,n,o,a,r);i.termType=s.termType,i.value=s.value}else{const t=Vn.isObject(e)?e["@id"]:e;i.termType=t.startsWith("_:")?"BlankNode":"NamedNode",i.value=t}return"NamedNode"!==i.termType||oo(i.value)?i:(r.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:i.value}},options:r}),null)}ao.toRDF=(e,t)=>{const n=new zn.IdentifierIssuer("_:b"),o={"@default":{}};Bn(e,o,"@default",n);const a=[],r=Object.keys(o).sort();for(const e of r){let r;if("@default"===e)r={termType:"DefaultGraph",value:""};else{if(!oo(e)){t.eventHandler&&Gn({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}r=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},r.value=e}io(a,o[e],r,n,t)}return a};const{isKeyword:lo}=kt,co=V,uo=F,po=te,ho=ue(),fo=z,{createNodeMap:vo,mergeNodeMapGraphs:go}=vn,yo={};var mo=yo;function xo(e){const t={};for(const n in e)void 0!==e[n]&&(t["@"+n]=[e[n]]);return[t]}function bo(e,t,n){for(let o=n.length-1;o>=0;--o){const a=n[o];if(a.graph===t&&a.subject["@id"]===e["@id"])return!0}return!1}function wo(e,t,n){const o="@"+n;let a=o in e?e[o][0]:t[n];if("embed"===n)if(!0===a)a="@once";else if(!1===a)a="@never";else if("@always"!==a&&"@never"!==a&&"@link"!==a&&"@first"!==a&&"@last"!==a&&"@once"!==a)throw new fo("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return a}function jo(e){if(!uo.isArray(e)||1!==e.length||!uo.isObject(e[0]))throw new fo("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of po.asArray(e[0]["@id"]))if(!uo.isObject(t)&&!ho.isAbsolute(t)||uo.isString(t)&&0===t.indexOf("_:"))throw new fo("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of po.asArray(e[0]["@type"]))if(!uo.isObject(t)&&!ho.isAbsolute(t)&&"@json"!==t||uo.isString(t)&&0===t.indexOf("_:"))throw new fo("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function Io(e,t,n,o){let a=!0,r=!1;for(const i in n){let s=!1;const l=po.getValues(t,i),c=0===po.getValues(n,i).length;if("@id"===i){if(uo.isEmptyObject(n["@id"][0]||{})?s=!0:n["@id"].length>=0&&(s=n["@id"].includes(l[0])),!o.requireAll)return s}else if("@type"===i){if(a=!1,c){if(l.length>0)return!1;s=!0}else if(1===n["@type"].length&&uo.isEmptyObject(n["@type"][0]))s=l.length>0;else for(const e of n["@type"])s=!(!uo.isObject(e)||!("@default"in e))||(s||l.some((t=>t===e)));if(!o.requireAll)return s}else{if(lo(i))continue;{const t=po.getValues(n,i)[0];let r=!1;if(t&&(jo([t]),r="@default"in t),a=!1,0===l.length&&r)continue;if(l.length>0&&c)return!1;if(void 0===t){if(l.length>0)return!1;s=!0}else if(co.isList(t)){const n=t["@list"][0];if(co.isList(l[0])){const t=l[0]["@list"];co.isValue(n)?s=t.some((e=>Do(n,e))):(co.isSubject(n)||co.isSubjectReference(n))&&(s=t.some((t=>Eo(e,n,t,o))))}}else s=co.isValue(t)?l.some((e=>Do(t,e))):co.isSubjectReference(t)?l.some((n=>Eo(e,t,n,o))):!!uo.isObject(t)&&l.length>0}}if(!s&&o.requireAll)return!1;r=r||s}return a||r}function No(e,t){const n=e.uniqueEmbeds[e.graph],o=n[t],a=o.parent,r=o.property,i={"@id":t};if(uo.isArray(a)){for(let e=0;e<a.length;++e)if(po.compareValues(a[e],i)){a[e]=i;break}}else{const e=uo.isArray(a[r]);po.removeValue(a,r,i,{propertyIsArray:e}),po.addValue(a,r,i,{propertyIsArray:e})}const s=e=>{const t=Object.keys(n);for(const o of t)o in n&&uo.isObject(n[o].parent)&&n[o].parent["@id"]===e&&(delete n[o],s(o))};s(t)}
28
28
  /**
29
29
  * Removes the @preserve keywords from expanded result of framing.
30
30
  *
@@ -1,4 +1,4 @@
1
- import{d as e,D as t,c as r,i as o}from"./main.js";import{a as n}from"./jsonld-6909fb49-vaWL2Y4h.js";var i,a,s=(function(e,t){!function(e,t){for(var r in t)e[r]=t[r]}(t,function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){
1
+ import{d as e,D as t,c as r,i as o}from"./main.js";import{a as n}from"./jsonld-CXlzLf4P-Wh4x173W.js";var i,a,s=(function(e,t){!function(e,t){for(var r in t)e[r]=t[r]}(t,function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){
2
2
  /*!
3
3
  * Copyright (c) 2021 Digital Bazaar, Inc. All rights reserved.
4
4
  */
@@ -25,20 +25,20 @@ const{constants:y}=m;var w={SECURITY_CONTEXT_URL:y.SECURITY_CONTEXT_V2_URL,SECUR
25
25
  /*!
26
26
  * Copyright (c) 2018-2021 Digital Bazaar, Inc. All rights reserved.
27
27
  */
28
- const T=new Map([[v.SECURITY_CONTEXT_V1_URL,g.get(v.SECURITY_CONTEXT_V1_URL)],[v.SECURITY_CONTEXT_V2_URL,g.get(v.SECURITY_CONTEXT_V2_URL)]]),E={};var x=E;E.extendContextLoader=e=>async t=>{const r=T.get(t);return void 0!==r?{contextUrl:null,documentUrl:t,document:r,tag:"static"}:e(t)},E.strictDocumentLoader=E.extendContextLoader((e=>{throw new Error(`${e} not found.`)}));class b extends Error{constructor(e){super(b._prepareSuperMessage(e)),Object.defineProperty(this,"name",{value:"NonError",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,b)}static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch(t){return String(e)}}}const S=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],L=Symbol(".toJSON called"),_=({from:e,seen:t,to_:n,forceEnumerable:i,maxDepth:a,depth:s})=>{const c=n||(Array.isArray(e)?[]:{});if(t.push(e),s>=a)return c;if("function"==typeof e.toJSON&&!0!==e[L])return(e=>{e[L]=!0;const t=e.toJSON();return delete e[L],t})(e);for(const[n,p]of Object.entries(e))"function"==typeof r&&o(p)?c[n]="[object Buffer]":"function"!=typeof p&&(p&&"object"==typeof p?t.includes(e[n])?c[n]="[Circular]":(s++,c[n]=_({from:e[n],seen:t.slice(),forceEnumerable:i,maxDepth:a,depth:s})):c[n]=p);for(const{property:t,enumerable:r}of S)"string"==typeof e[t]&&Object.defineProperty(c,t,{value:e[t],enumerable:!!i||r,configurable:!0,writable:!0});return c};var M={serializeError:(e,t={})=>{const{maxDepth:r=Number.POSITIVE_INFINITY}=t;return"object"==typeof e&&null!==e?_({from:e,seen:[],forceEnumerable:!0,maxDepth:r,depth:0}):"function"==typeof e?`[Function: ${e.name||"anonymous"}]`:e},deserializeError:(e,t={})=>{const{maxDepth:r=Number.POSITIVE_INFINITY}=t;if(e instanceof Error)return e;if("object"==typeof e&&null!==e&&!Array.isArray(e)){const t=new Error;return _({from:e,seen:[],to_:t,maxDepth:r,depth:0}),t}return new b(e)}};
28
+ const T=new Map([[v.SECURITY_CONTEXT_V1_URL,g.get(v.SECURITY_CONTEXT_V1_URL)],[v.SECURITY_CONTEXT_V2_URL,g.get(v.SECURITY_CONTEXT_V2_URL)]]),E={};var x=E;E.extendContextLoader=e=>async t=>{const r=T.get(t);return void 0!==r?{contextUrl:null,documentUrl:t,document:r,tag:"static"}:e(t)},E.strictDocumentLoader=E.extendContextLoader((e=>{throw new Error(`${e} not found.`)}));class b extends Error{constructor(e){super(b._prepareSuperMessage(e)),Object.defineProperty(this,"name",{value:"NonError",configurable:!0,writable:!0}),Error.captureStackTrace&&Error.captureStackTrace(this,b)}static _prepareSuperMessage(e){try{return JSON.stringify(e)}catch{return String(e)}}}const S=[{property:"name",enumerable:!1},{property:"message",enumerable:!1},{property:"stack",enumerable:!1},{property:"code",enumerable:!0}],L=Symbol(".toJSON called"),_=({from:e,seen:t,to_:n,forceEnumerable:i,maxDepth:a,depth:s})=>{const c=n||(Array.isArray(e)?[]:{});if(t.push(e),s>=a)return c;if("function"==typeof e.toJSON&&!0!==e[L])return(e=>{e[L]=!0;const t=e.toJSON();return delete e[L],t})(e);for(const[n,p]of Object.entries(e))"function"==typeof r&&o(p)?c[n]="[object Buffer]":"function"!=typeof p&&(p&&"object"==typeof p?t.includes(e[n])?c[n]="[Circular]":(s++,c[n]=_({from:e[n],seen:t.slice(),forceEnumerable:i,maxDepth:a,depth:s})):c[n]=p);for(const{property:t,enumerable:r}of S)"string"==typeof e[t]&&Object.defineProperty(c,t,{value:e[t],enumerable:!!i||r,configurable:!0,writable:!0});return c};var C={serializeError:(e,t={})=>{const{maxDepth:r=Number.POSITIVE_INFINITY}=t;return"object"==typeof e&&null!==e?_({from:e,seen:[],forceEnumerable:!0,maxDepth:r,depth:0}):"function"==typeof e?`[Function: ${e.name||"anonymous"}]`:e},deserializeError:(e,t={})=>{const{maxDepth:r=Number.POSITIVE_INFINITY}=t;if(e instanceof Error)return e;if("object"==typeof e&&null!==e&&!Array.isArray(e)){const t=new Error;return _({from:e,seen:[],to_:t,maxDepth:r,depth:0}),t}return new b(e)}};
29
29
  /*!
30
30
  * Copyright (c) 2018-2022 Digital Bazaar, Inc. All rights reserved.
31
- */const C=w,O=n,{extendContextLoader:R,strictDocumentLoader:U}=x,{serializeError:D}=M;function K({document:e}){let t;t=O.getValues(e,"proof");const r=e["@context"]||C.SECURITY_CONTEXT_URL;return t=t.map((e=>({"@context":r,...e}))),t}function N(e){Object.defineProperty(e,"toJSON",{value:function(){return D(this)},configurable:!0,writable:!0})}var P=class extends Error{constructor(e){super("Verification error(s)."),this.name="VerificationError",this.errors=[].concat(e)}},A=class{constructor({type:e}={}){if("string"!=typeof e)throw new TypeError('A LinkedDataProof must have a "type".');this.type=e}async createProof({}){throw new Error('"createProof" must be implemented in a derived class.')}async derive({}){throw new Error('"deriveProof" must be implemented in a derived class.')}async verifyProof({}){throw new Error('"verifyProof" must be implemented in a derived class.')}async matchProof({proof:e}){return e.type===this.type}};
31
+ */const M=w,O=n,{extendContextLoader:R,strictDocumentLoader:U}=x,{serializeError:D}=C;function K({document:e}){let t;t=O.getValues(e,"proof");const r=e["@context"]||M.SECURITY_CONTEXT_URL;return t=t.map((e=>({"@context":r,...e}))),t}function P(e){Object.defineProperty(e,"toJSON",{value:function(){return D(this)},configurable:!0,writable:!0})}var N=class extends Error{constructor(e){super("Verification error(s)."),this.name="VerificationError",this.errors=[].concat(e)}},A=class{constructor({type:e}={}){if("string"!=typeof e)throw new TypeError('A LinkedDataProof must have a "type".');this.type=e}async createProof({}){throw new Error('"createProof" must be implemented in a derived class.')}async derive({}){throw new Error('"deriveProof" must be implemented in a derived class.')}async verifyProof({}){throw new Error('"verifyProof" must be implemented in a derived class.')}async matchProof({proof:e}){return e.type===this.type}};
32
32
  /*!
33
33
  * Copyright (c) 2018-2023 Digital Bazaar, Inc. All rights reserved.
34
34
  */const V={};var I=V;V.w3cDate=e=>{null==e?e=new Date:"number"!=typeof e&&"string"!=typeof e||(e=new Date(e));const t=e.toISOString();return t.substr(0,t.length-5)+"Z"},V.concat=(e,t)=>{const r=new Uint8Array(e.length+t.length);return r.set(e,0),r.set(t,e.length),r};const j=self&&(self.crypto||self.msCrypto);var k={async sha256digest({string:e}){const t=(new TextEncoder).encode(e);return new Uint8Array(await j.subtle.digest("SHA-256",t))}};
35
35
  /*!
36
36
  * Copyright (c) 2017-2023 Digital Bazaar, Inc. All rights reserved.
37
- */const X=w,Y=n,z=I,{sha256digest:q}=k,$=A;
37
+ */const X=w,z=n,Y=I,{sha256digest:q}=k,$=A;
38
38
  /*!
39
39
  * Copyright (c) 2018 Digital Bazaar, Inc. All rights reserved.
40
40
  */
41
- const W={};var B=W;W.suites={LinkedDataProof:A,LinkedDataSignature:class extends ${constructor({type:e,proof:t,LDKeyClass:r,date:o,key:n,signer:i,verifier:a,useNativeCanonize:s,canonizeOptions:c,contextUrl:p}={}){super({type:e}),this.LDKeyClass=r,this.contextUrl=p,this.proof=t;const d=function({key:e,signer:t,verifier:r}){const o={};if(e){if(o.key=e,o.verificationMethod=e.id,"function"==typeof e.signer&&(o.signer=e.signer()),"function"==typeof e.verifier&&(o.verifier=e.verifier()),!o.signer&&!o.verifier)throw new TypeError('The "key" parameter must contain a "signer" or "verifier" method.')}else o.verificationMethod=t&&t.id||r&&r.id,o.signer=t,o.verifier=r;if(o.signer&&"function"!=typeof o.signer.sign)throw new TypeError("A signer API has not been specified.");if(o.verifier&&"function"!=typeof o.verifier.verify)throw new TypeError("A verifier API has not been specified.");return o}({key:n,signer:i,verifier:a});if(this.verificationMethod=d.verificationMethod,this.key=d.key,this.signer=d.signer,this.verifier=d.verifier,this.canonizeOptions=c,o&&(this.date=new Date(o),isNaN(this.date)))throw TypeError(`"date" "${o}" is not a valid date.`);this.useNativeCanonize=s,this._hashCache=null}async createProof({document:e,purpose:t,proofSet:r,documentLoader:o,expansionMap:n}){if(n)throw new Error('"expansionMap" not supported.');let i;i=this.proof?{...this.proof}:{},i.type=this.type;let a=this.date;void 0===i.created&&void 0===a&&(a=new Date),a&&"string"!=typeof a&&(a=z.w3cDate(a)),a&&(i.created=a),i.verificationMethod=this.verificationMethod,i=await this.updateProof({document:e,proof:i,proofSet:r,purpose:t,documentLoader:o}),i=await t.update(i,{document:e,suite:this,documentLoader:o});const s=await this.createVerifyData({document:e,proof:i,proofSet:r,documentLoader:o});return i=await this.sign({verifyData:s,document:e,proof:i,documentLoader:o}),i}async updateProof({proof:e,expansionMap:t}){if(t)throw new Error('"expansionMap" not supported.');return e}async verifyProof({proof:e,document:t,proofSet:r,documentLoader:o,expansionMap:n}){if(n)throw new Error('"expansionMap" not supported.');try{const i=await this.createVerifyData({document:t,proof:e,proofSet:r,documentLoader:o,expansionMap:n}),a=await this.getVerificationMethod({proof:e,document:t,documentLoader:o,expansionMap:n});if(!await this.verifySignature({verifyData:i,verificationMethod:a,document:t,proof:e,documentLoader:o,expansionMap:n}))throw new Error("Invalid signature.");return{verified:!0,verificationMethod:a}}catch(e){return{verified:!1,error:e}}}async canonize(e,{documentLoader:t,expansionMap:r,skipExpansion:o}){if(r)throw new Error('"expansionMap" not supported.');return Y.canonize(e,{algorithm:"URDNA2015",base:null,format:"application/n-quads",documentLoader:t,safe:!0,skipExpansion:o,useNative:this.useNativeCanonize,...this.canonizeOptions})}async canonizeProof(e,{document:t,documentLoader:r,expansionMap:o}){if(o)throw new Error('"expansionMap" not supported.');return delete(e={"@context":t["@context"]||X.SECURITY_CONTEXT_URL,...e}).jws,delete e.signatureValue,delete e.proofValue,this.canonize(e,{documentLoader:r,expansionMap:o,skipExpansion:!1,...this.canonizeOptions})}async createVerifyData({document:e,proof:t,documentLoader:r,expansionMap:o}){if(o)throw new Error('"expansionMap" not supported.');let n;const{_hashCache:i}=this;i&&i.document===e?n=i.hash:this._hashCache={document:e,hash:n=this.canonize(e,{documentLoader:r,expansionMap:o}).then((e=>q({string:e})))};const[a,s]=await Promise.all([this.canonizeProof(t,{document:e,documentLoader:r,expansionMap:o}).then((e=>q({string:e}))),n]);return z.concat(a,s)}async derive(){throw new Error("Must be implemented by a derived class.")}async getVerificationMethod({proof:e,documentLoader:t}){let{verificationMethod:r}=e;if("object"==typeof r&&(r=r.id),!r)throw new Error('No "verificationMethod" found in proof.');const o=await Y.frame(r,{"@context":X.SECURITY_CONTEXT_URL,"@embed":"@always",id:r},{documentLoader:t,compactToRelative:!1,safe:!0});if(!o)throw new Error(`Verification method ${r} not found.`);if(void 0!==o.revoked)throw new Error("The verification method has been revoked.");return o}async sign(){throw new Error("Must be implemented by a derived class.")}async verifySignature(){throw new Error("Must be implemented by a derived class.")}ensureSuiteContext({document:e,addSuiteContext:t}){const{contextUrl:r}=this;if(function({document:e,contextUrl:t}){const r=e["@context"];return r===t||Array.isArray(r)&&r.includes(t)}({document:e,contextUrl:r}))return;if(!t)throw new TypeError(`The document to be signed must contain this suite's @context, "${r}".`);const o=e["@context"]||[];e["@context"]=Array.isArray(o)?[...o,r]:[o,r]}}};
41
+ const W={};var B=W;W.suites={LinkedDataProof:A,LinkedDataSignature:class extends ${constructor({type:e,proof:t,LDKeyClass:r,date:o,key:n,signer:i,verifier:a,useNativeCanonize:s,canonizeOptions:c,contextUrl:p}={}){super({type:e}),this.LDKeyClass=r,this.contextUrl=p,this.proof=t;const d=function({key:e,signer:t,verifier:r}){const o={};if(e){if(o.key=e,o.verificationMethod=e.id,"function"==typeof e.signer&&(o.signer=e.signer()),"function"==typeof e.verifier&&(o.verifier=e.verifier()),!o.signer&&!o.verifier)throw new TypeError('The "key" parameter must contain a "signer" or "verifier" method.')}else o.verificationMethod=t&&t.id||r&&r.id,o.signer=t,o.verifier=r;if(o.signer&&"function"!=typeof o.signer.sign)throw new TypeError("A signer API has not been specified.");if(o.verifier&&"function"!=typeof o.verifier.verify)throw new TypeError("A verifier API has not been specified.");return o}({key:n,signer:i,verifier:a});if(this.verificationMethod=d.verificationMethod,this.key=d.key,this.signer=d.signer,this.verifier=d.verifier,this.canonizeOptions=c,o&&(this.date=new Date(o),isNaN(this.date)))throw TypeError(`"date" "${o}" is not a valid date.`);this.useNativeCanonize=s,this._hashCache=null}async createProof({document:e,purpose:t,proofSet:r,documentLoader:o,expansionMap:n}){if(n)throw new Error('"expansionMap" not supported.');let i;i=this.proof?{...this.proof}:{},i.type=this.type;let a=this.date;void 0===i.created&&void 0===a&&(a=new Date),a&&"string"!=typeof a&&(a=Y.w3cDate(a)),a&&(i.created=a),i.verificationMethod=this.verificationMethod,i=await this.updateProof({document:e,proof:i,proofSet:r,purpose:t,documentLoader:o}),i=await t.update(i,{document:e,suite:this,documentLoader:o});const s=await this.createVerifyData({document:e,proof:i,proofSet:r,documentLoader:o});return i=await this.sign({verifyData:s,document:e,proof:i,documentLoader:o}),i}async updateProof({proof:e,expansionMap:t}){if(t)throw new Error('"expansionMap" not supported.');return e}async verifyProof({proof:e,document:t,proofSet:r,documentLoader:o,expansionMap:n}){if(n)throw new Error('"expansionMap" not supported.');try{const i=await this.createVerifyData({document:t,proof:e,proofSet:r,documentLoader:o,expansionMap:n}),a=await this.getVerificationMethod({proof:e,document:t,documentLoader:o,expansionMap:n});if(!await this.verifySignature({verifyData:i,verificationMethod:a,document:t,proof:e,documentLoader:o,expansionMap:n}))throw new Error("Invalid signature.");return{verified:!0,verificationMethod:a}}catch(e){return{verified:!1,error:e}}}async canonize(e,{documentLoader:t,expansionMap:r,skipExpansion:o}){if(r)throw new Error('"expansionMap" not supported.');return z.canonize(e,{algorithm:"URDNA2015",base:null,format:"application/n-quads",documentLoader:t,safe:!0,skipExpansion:o,useNative:this.useNativeCanonize,...this.canonizeOptions})}async canonizeProof(e,{document:t,documentLoader:r,expansionMap:o}){if(o)throw new Error('"expansionMap" not supported.');return delete(e={"@context":t["@context"]||X.SECURITY_CONTEXT_URL,...e}).jws,delete e.signatureValue,delete e.proofValue,this.canonize(e,{documentLoader:r,expansionMap:o,skipExpansion:!1,...this.canonizeOptions})}async createVerifyData({document:e,proof:t,documentLoader:r,expansionMap:o}){if(o)throw new Error('"expansionMap" not supported.');let n;const{_hashCache:i}=this;i&&i.document===e?n=i.hash:this._hashCache={document:e,hash:n=this.canonize(e,{documentLoader:r,expansionMap:o}).then((e=>q({string:e})))};const[a,s]=await Promise.all([this.canonizeProof(t,{document:e,documentLoader:r,expansionMap:o}).then((e=>q({string:e}))),n]);return Y.concat(a,s)}async derive(){throw new Error("Must be implemented by a derived class.")}async getVerificationMethod({proof:e,documentLoader:t}){let{verificationMethod:r}=e;if("object"==typeof r&&(r=r.id),!r)throw new Error('No "verificationMethod" found in proof.');const o=await z.frame(r,{"@context":X.SECURITY_CONTEXT_URL,"@embed":"@always",id:r},{documentLoader:t,compactToRelative:!1,safe:!0});if(!o)throw new Error(`Verification method ${r} not found.`);if(void 0!==o.revoked)throw new Error("The verification method has been revoked.");return o}async sign(){throw new Error("Must be implemented by a derived class.")}async verifySignature(){throw new Error("Must be implemented by a derived class.")}ensureSuiteContext({document:e,addSuiteContext:t}){const{contextUrl:r}=this;if(function({document:e,contextUrl:t}){const r=e["@context"];return r===t||Array.isArray(r)&&r.includes(t)}({document:e,contextUrl:r}))return;if(!t)throw new TypeError(`The document to be signed must contain this suite's @context, "${r}".`);const o=e["@context"]||[];e["@context"]=Array.isArray(o)?[...o,r]:[o,r]}}};
42
42
  /*!
43
43
  * Copyright (c) 2018 Digital Bazaar, Inc. All rights reserved.
44
44
  */
@@ -63,4 +63,4 @@ const oe={};var ne=oe;oe.purposes={AssertionProofPurpose:class extends te{constr
63
63
  const ie={};var ae=ie;const se=w;Object.assign(ie,se);const ce=class{async add(e,{suite:t,purpose:r,documentLoader:o}={}){if(!t)throw new TypeError('"options.suite" is required.');if(!r)throw new TypeError('"options.purpose" is required.');o=o?R(o):U;const n={...e};delete n.proof;const i=K({document:e}),a=await t.createProof({document:n,purpose:r,proofSet:i,documentLoader:o});return O.addValue(e,"proof",a),e}async derive(e,{suite:t,purpose:r,documentLoader:o}={}){if(!t)throw new TypeError('"options.suite" is required.');if(!r)throw new TypeError('"options.purpose" is required.');o=o?R(o):U;const n={...e};delete n.proof;const i=K({document:e});return await t.derive({document:n,purpose:r,proofSet:i,documentLoader:o})}async verify(e,{suite:t,purpose:r,documentLoader:o}={}){if(!t)throw new TypeError('"options.suite" is required.');if(!r)throw new TypeError('"options.purpose" is required.');const n=Array.isArray(t)?t:[t];if(0===n.length)throw new TypeError("At least one suite is required.");o=o?R(o):U;try{const t=K({document:e={...e}});if(0===t.length)throw new Error("No matching proofs found in the given document.");delete e.proof;const i=await async function({document:e,suites:t,proofSet:r,purpose:o,documentLoader:n}){const i=Array.isArray(o)?o:[o],a=new Map,s=new Map,c=new Map;if(await Promise.all(i.map((o=>async function({purposeToProofs:e,proofToSuite:t,purpose:r,proofSet:o,suites:n,suiteMatchQueue:i,document:a,documentLoader:s}){for(const c of o){if(!await r.match(c,{document:a,documentLoader:s}))continue;let o=!1;for(const e of n){let r=i.get(e);r||i.set(e,r=new Map);let n=r.get(c);if(n||(n=e.matchProof({proof:c,document:a,documentLoader:s}),r.set(c,n)),await n){o=!0,t.set(c,e);break}}if(o){const t=e.get(r);t?t.push(c):e.set(r,[c])}}}
64
64
  /*!
65
65
  * Copyright (c) 2020 Digital Bazaar, Inc. All rights reserved.
66
- */({purposeToProofs:a,proofToSuite:s,purpose:o,proofSet:r,suites:t,suiteMatchQueue:c,document:e,documentLoader:n})))),a.size<i.length)return[];const p=new Map;return await Promise.all([...s.entries()].map((async([t,o])=>{let i;try{let a;const s={validate:async(e,{verificationMethod:t})=>(a=t,{valid:!0})},{verified:c,verificationMethod:p,error:d}=await o.verifyProof({proof:t,document:e,purpose:s,proofSet:r,documentLoader:n});a||(a=p),i={proof:t,verified:c,verificationMethod:a,error:d}}catch(e){i={proof:t,verified:!1,error:e}}i.error&&N(i.error),p.set(t,i)}))),await Promise.all([...a.entries()].map((async([t,r])=>{for(const o of r){const r=p.get(o);if(!r.verified)continue;const{verificationMethod:i}=r,a=s.get(o);let c;try{c=await t.validate(o,{document:e,suite:a,verificationMethod:i,documentLoader:n})}catch(e){c={valid:!1,error:e}}r.purposeResult?Array.isArray(r.purposeResult)?r.purposeResult.push(c):r.purposeResult=[r.purposeResult,c]:r.purposeResult=c,c.valid||(N(c.error),r.error||(r.verified=!1,r.error=c.error))}}))),[...p.values()]}({document:e,suites:n,proofSet:t,purpose:r,documentLoader:o});if(0===i.length){const e=new Error("Did not verify any proofs; insufficient proofs matched the acceptable suite(s) and required purpose(s).");throw e.name="NotFoundError",e}const a=i.some((e=>e.verified));if(!a){const e=[].concat(...i.filter((e=>e.error)).map((e=>e.error))),t={verified:a,results:i};return e.length>0&&(t.error=e),t}return{verified:a,results:i}}catch(e){return N(e),{verified:!1,error:e}}}},pe=P;ie.derive=async function(e,{suite:t,purpose:r,documentLoader:o,addSuiteContext:n=!0}={}){if("object"!=typeof e)throw new TypeError('The "document" parameter must be an object.');t.ensureSuiteContext({document:e,addSuiteContext:n});try{return await(new ce).derive(e,{suite:t,purpose:r,documentLoader:o})}catch(e){if(!o&&"jsonld.InvalidUrl"===e.name){const{details:{url:t}}=e,r=new Error(`A URL "${t}" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "derive".`);throw r.cause=e,r}throw e}},ie.sign=async function(e,{suite:t,purpose:r,documentLoader:o,expansionMap:n,addSuiteContext:i=!0}={}){if(n)throw new Error('"expansionMap" not supported.');if("object"!=typeof e)throw new TypeError('The "document" parameter must be an object.');t.ensureSuiteContext({document:e,addSuiteContext:i});try{return await(new ce).add(e,{suite:t,purpose:r,documentLoader:o})}catch(e){if(!o&&"jsonld.InvalidUrl"===e.name){const{details:{url:t}}=e,r=new Error(`A URL "${t}" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "sign".`);throw r.cause=e,r}throw e}},ie.verify=async function(e,{suite:t,purpose:r,documentLoader:o,expansionMap:n}={}){if(n)throw new Error('"expansionMap" not supported.');if("object"!=typeof e)throw new TypeError('The "document" parameter must be an object.');const i=await(new ce).verify(e,{suite:t,purpose:r,documentLoader:o}),{error:a}=i;if(a)if(o||"jsonld.InvalidUrl"!==a.name)i.error=new pe(a);else{const{details:{url:e}}=a,t=new Error(`A URL "${e}" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "verify".`);i.error=new pe(t)}return i},ie.suites=B.suites,ie.purposes=ne.purposes,Object.assign(ie,x);var de=e(ae);export{de as j};
66
+ */({purposeToProofs:a,proofToSuite:s,purpose:o,proofSet:r,suites:t,suiteMatchQueue:c,document:e,documentLoader:n})))),a.size<i.length)return[];const p=new Map;return await Promise.all([...s.entries()].map((async([t,o])=>{let i;try{let a;const s={validate:async(e,{verificationMethod:t})=>(a=t,{valid:!0})},{verified:c,verificationMethod:p,error:d}=await o.verifyProof({proof:t,document:e,purpose:s,proofSet:r,documentLoader:n});a||(a=p),i={proof:t,verified:c,verificationMethod:a,error:d}}catch(e){i={proof:t,verified:!1,error:e}}i.error&&P(i.error),p.set(t,i)}))),await Promise.all([...a.entries()].map((async([t,r])=>{for(const o of r){const r=p.get(o);if(!r.verified)continue;const{verificationMethod:i}=r,a=s.get(o);let c;try{c=await t.validate(o,{document:e,suite:a,verificationMethod:i,documentLoader:n})}catch(e){c={valid:!1,error:e}}r.purposeResult?Array.isArray(r.purposeResult)?r.purposeResult.push(c):r.purposeResult=[r.purposeResult,c]:r.purposeResult=c,c.valid||(P(c.error),r.error||(r.verified=!1,r.error=c.error))}}))),[...p.values()]}({document:e,suites:n,proofSet:t,purpose:r,documentLoader:o});if(0===i.length){const e=new Error("Did not verify any proofs; insufficient proofs matched the acceptable suite(s) and required purpose(s).");throw e.name="NotFoundError",e}const a=i.some((e=>e.verified));if(!a){const e=[].concat(...i.filter((e=>e.error)).map((e=>e.error))),t={verified:a,results:i};return e.length>0&&(t.error=e),t}return{verified:a,results:i}}catch(e){return P(e),{verified:!1,error:e}}}},pe=N;ie.derive=async function(e,{suite:t,purpose:r,documentLoader:o,addSuiteContext:n=!0}={}){if("object"!=typeof e)throw new TypeError('The "document" parameter must be an object.');t.ensureSuiteContext({document:e,addSuiteContext:n});try{return await(new ce).derive(e,{suite:t,purpose:r,documentLoader:o})}catch(e){if(!o&&"jsonld.InvalidUrl"===e.name){const{details:{url:t}}=e,r=new Error(`A URL "${t}" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "derive".`);throw r.cause=e,r}throw e}},ie.sign=async function(e,{suite:t,purpose:r,documentLoader:o,expansionMap:n,addSuiteContext:i=!0}={}){if(n)throw new Error('"expansionMap" not supported.');if("object"!=typeof e)throw new TypeError('The "document" parameter must be an object.');t.ensureSuiteContext({document:e,addSuiteContext:i});try{return await(new ce).add(e,{suite:t,purpose:r,documentLoader:o})}catch(e){if(!o&&"jsonld.InvalidUrl"===e.name){const{details:{url:t}}=e,r=new Error(`A URL "${t}" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "sign".`);throw r.cause=e,r}throw e}},ie.verify=async function(e,{suite:t,purpose:r,documentLoader:o,expansionMap:n}={}){if(n)throw new Error('"expansionMap" not supported.');if("object"!=typeof e)throw new TypeError('The "document" parameter must be an object.');const i=await(new ce).verify(e,{suite:t,purpose:r,documentLoader:o}),{error:a}=i;if(a)if(o||"jsonld.InvalidUrl"!==a.name)i.error=new pe(a);else{const{details:{url:e}}=a,t=new Error(`A URL "${e}" could not be fetched; you need to pass "documentLoader" or resolve the URL before calling "verify".`);i.error=new pe(t)}return i},ie.suites=B.suites,ie.purposes=ne.purposes,Object.assign(ie,x);var de=e(ae);export{de as j};