rdflib 2.2.22-4e175603 → 2.2.22-9e74e63f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rdflib.min.js +1 -1
- package/dist/rdflib.min.js.map +1 -1
- package/esm/convert.js +60 -0
- package/esm/index.js +2 -1
- package/esm/jsonldparser.js +3 -12
- package/esm/serialize.js +6 -15
- package/lib/convert.d.ts +2 -0
- package/lib/convert.js +71 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.js +4 -1
- package/lib/jsonldparser.js +3 -12
- package/lib/serialize.js +6 -14
- package/package.json +6 -7
- package/src/convert.js +70 -0
- package/src/index.ts +2 -0
- package/src/jsonldparser.js +4 -13
- package/src/serialize.ts +6 -9
package/dist/rdflib.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see rdflib.min.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("window")):"function"==typeof define&&define.amd?define(["window"],t):"object"==typeof exports?exports.$rdf=t(require("window")):e.$rdf=t(e.window)}(self,(e=>(()=>{var t={8333:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},7308:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={debug(e){},warn(e){},info(e){},error(e){},success(e){},msg(e){}}},6545:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(240),i=r(8333),o=r(4806),s=r(9247),a=r(2598),l=r(5904);class c extends o.Z{constructor(e){if(super((0,a._)(e)),(0,n.Z)(this,"termType",s.XM),(0,n.Z)(this,"classOrder",i.Z.NamedNode),!this.value)throw new Error("Missing IRI for NamedNode");if(!this.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(this.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.')}dir(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&t<r+2||t<0?null:new c(e.slice(0,t+1))}site(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",t+2);return new c(r<0?e.slice(0)+"/":e.slice(0,r+1))}doc(){return this.value.indexOf("#")<0?this:new c(this.value.split("#")[0])}toString(){return"<"+this.value+">"}id(){return this.value.split("#")[1]}get uri(){return this.value}set uri(e){this.value=e}static fromValue(e){return null==e||(0,l.jt)(e)?e:new c(e)}}},4806:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(240),i=r(292);class o{constructor(e){(0,n.Z)(this,"termType",void 0),(0,n.Z)(this,"classOrder",void 0),(0,n.Z)(this,"value",void 0),this.value=e}substitute(e){return i.log("@@@ node substitute"+this),this}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toCanonical()}sameTerm(e){return this.equals(e)}toCanonical(){return this.toNT()}toNT(){return this.toString()}toNQ(){return this.toNT()}toString(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}(0,n.Z)(o,"fromValue",void 0),(0,n.Z)(o,"toJS",void 0)},9247:(e,t,r)=>{"use strict";r.d(t,{D7:()=>T,Eo:()=>_,Is:()=>v,NK:()=>a,UH:()=>s,V1:()=>i,XM:()=>n,_A:()=>u,aV:()=>m,b4:()=>y,fb:()=>l,lL:()=>g,ls:()=>c,oW:()=>b,qS:()=>p,sZ:()=>f,ui:()=>d,us:()=>h,xH:()=>o,xm:()=>w,z8:()=>x});const n="NamedNode",i="BlankNode",o="Literal",s="Variable",a="DefaultGraph",l="Collection",c="Empty",u="Graph",h="text/html",d="application/ld+json",p="text/n3",f="application/n3",g="application/nquads",y="application/n-quads",m="application/n-triples",v="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",T="application/xhtml+xml"},3357:(e,t,r)=>{"use strict";r.r(t),r.d(t,{docpart:()=>s,document:()=>a,hostpart:()=>l,join:()=>c,protocol:()=>u,refTo:()=>h});var n=r(6545),i=r(292),o=o||i.log;function s(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function a(e){return new n.Z(s(e))}function l(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function c(e,t){var r,n,i,s,a,l=t.indexOf("#");if(l>0&&(t=t.slice(0,l)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(r=t.indexOf(":"),0===t.length)return e;if(r<0)return o("Invalid base: "+t+" in join with given: "+e),e;if(n=t.slice(0,+r+1||9e9),0===e.indexOf("//"))return n+e;if(t.indexOf("//",r)===r+1){if((i=t.indexOf("/",r+3))<0)return t.length-r-3>0?t+"/"+e:n+e}else if((i=t.indexOf("/",r+1))<0)return t.length-r-1>0?t+"/"+e:n+e;if(0===e.indexOf("/"))return t.slice(0,i)+e;if((s=(a=t.slice(i)).lastIndexOf("/"))<0)return n+e;for(s>=0&&s<a.length-1&&(a=a.slice(0,+s+1||9e9)),a+=e;a.match(/[^\/]*\/\.\.\//);)a=a.replace(/[^\/]*\/\.\.\//,"");return a=(a=a.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,i)+a}function u(e){const t=e.indexOf(":");return t<0?null:e.slice(0,t)}function h(e,t){var r,n,i,o,s,a,l,c,u,h,d,p,f=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=l=0,o=t.length;l<o&&t[r]===e[r];r=++l);if(e.slice(0,r).match(f)&&((n=t.indexOf("//"))<0&&(n=-2),i=t.indexOf("/",n+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[r]&&e.length===r)return t.slice(r);for(;r>0&&"/"!==t[r-1];)r--;if(r<3)return t;if(e.indexOf("//",r-2)>0||t.indexOf("//",r-2)>0)return t;if(e.indexOf(":",r)>0)return t;for(a=0,c=0,s=(h=e.slice(r)).length;c<s;c++)"/"===h[c]&&a++;if(0===a&&r<t.length&&"#"===t[r])return"./"+t.slice(r);if(0===a&&r===t.length)return"./";if(p="",a>0)for(u=1,d=a;d>=1?u<=d:u>=d;d>=1?++u:--u)p+="../";return p+t.slice(r)}},5115:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMParserFactory:()=>d,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>p,dtstamp:()=>g,dumpNode:()=>f,heavyCompare:()=>y,heavyCompareSPO:()=>m,linkRelationProperty:()=>u,log:()=>n.Z,mediaTypeClass:()=>c,output:()=>v,parseXML:()=>b,stackString:()=>_,string:()=>l,string_startswith:()=>x,uri:()=>i});var n=r(7308),i=r(3357),o=r(6545),s=r(870);e=r.hmd(e);var a=r(292);const l={template:function(e,t){for(var r=e.split("%s"),n="",i=0;i<t.length;i++)t[i]+="",n+=r[i]+t[i];return n+r.slice(t.length).join()}};function c(e){return e=e.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function u(e){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function h(e,t){e.callbacks={};for(var r=t.length-1;r>=0;r--)e.callbacks[t[r]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,r){e.callbacks[t].push(r)},e.removeCallback=function(t,r){for(var n=0;n<e.callbacks[t].length;n++)if(e.callbacks[t][n].name===r)return e.callbacks[t].splice(n,1),!0;return!1},e.insertCallback=function(t,r){e.callbacks[t].unshift(r)},e.fireCallbacks=function(t,r){var n,i=[],o=[],s=e.callbacks[t].length;let a;for(n=s-1;n>=0;n--)a=e.callbacks[t][n],a&&a.apply(e,r)&&i.push(a);for(n=i.length-1;n>=0;n--)o.push(i[n]);for(n=s;n<e.callbacks[t].length;n++)o.push(e.callbacks[t][n]);e.callbacks[t]=o}}function d(){return window.DOMParser?new s.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(e,t){var r=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){r[e]=!0}));var n=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){n[e]=!0})),f(e,t,r,n)}function f(e,t,r,n){var i,o="",s=[!1];if(void 0===e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var l=e.nodeName.toLowerCase();o+="<"+l;var c=[];for(i=e.attributes.length-1;i>=0;i--){var u=e.attributes[i];if(!(n&&n.length>0&&n[u.name]||/^\d+$/.test(u.name))){if("class"===u.name&&t&&t.replaceClassItemWith&&u.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var h=new RegExp(t.replaceClassItemWith.source,"g");u.value=u.value.replace(h,t.replaceClassItemWith.target).trim()}"class"===u.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===u.value||c.push(u.name+"='"+u.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,""")+"'")}}if(c.length>0&&(t&&t.sortAttributes&&c.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),o+=" "+c.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===l?"\n ":"",s.push("style"===l||"script"===l),i=0;i<e.childNodes.length;i++)o+=f(e.childNodes[i]);s.pop(),o+="body"===l?"</"+l+">\n":"</"+l+">"}}}else if(8===e.nodeType)o+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var d=e.nodeValue.replace(/\n+$/,"");o+=s[s.length-1]?d:d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}else a.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),a.log(e);return o}function g(){var e=new Date,t=e.getYear()+1900,r=e.getMonth()+1,n=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),s<10&&(s="0"+s),t+"-"+r+"-"+n+"T"+i+":"+o+":"+s+"Z"}function y(e,t,r,n){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=r.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(r.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")};const s=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===s?0:o(e)>o(t)?1:o(e)<o(t)?-1:s:n&&e.uri&&t.uri?(n[e.uri]||e.uri).localeCompare(n[t.uri]||t.uri):s}function m(e,t,r,n){return y(e.subject,t.subject,r,n)||y(e.predicate,t.predicate,r,n)||y(e.object,t.object,r,n)}function v(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function b(t,r){return r=r||{},e&&e.exports?(new s.DOMParser).parseFromString(t,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new s.DOMParser).parseFromString(t,"application/xml")}function w(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.why))return void e.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function x(e,t){return e.slice(0,t.length)===t}function _(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var r=e.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var o=r[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var s=o.split("@");n.push(s)}for(i=0;i<n.length;i++)t+=" "+n[i][1]+"\n "+n[i][0];return t}},2598:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?e:e.value}r.d(t,{_:()=>n})},5904:(e,t,r)=>{"use strict";r.d(t,{B2:()=>g,NA:()=>b,NX:()=>f,PY:()=>p,Pv:()=>o,Uc:()=>a,Yi:()=>i,cG:()=>u,f:()=>l,jt:()=>h,lt:()=>v,lx:()=>m,n_:()=>d,nq:()=>c,uZ:()=>s,zz:()=>y});var n=r(9247);function i(e){return"object"==typeof e&&null!==e&&"subject"in e}function o(e){return"object"==typeof e&&null!==e&&"statements"in e}function s(e){return h(e)&&e.termType===n.fb}function a(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function l(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function c(e){return h(e)&&(e.termType===n.XM||e.termType===n.V1||e.termType===n.UH)}function u(e){return h(e)&&e.termType===n.UH}function h(e){return"object"==typeof e&&null!==e&&"termType"in e}function d(e){return e.termType===n.xH}function p(e){return"object"==typeof e&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function f(e){return h(e)&&"NamedNode"===e.termType}function g(e){return h(e)&&"termType"in e&&"BlankNode"===e.termType}function y(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1)}function m(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH)}function v(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.xH)}function b(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.NK)}},6118:(e,t,r)=>{"use strict";var n=r(2530),i=r(292);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var s,a,l=r(8619).codes,c=l.ERR_AMBIGUOUS_ARGUMENT,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_INVALID_ARG_VALUE,d=l.ERR_INVALID_RETURN_VALUE,p=l.ERR_MISSING_ARGS,f=r(6979),g=r(5663).inspect,y=r(5663).types,m=y.isPromise,v=y.isRegExp,b=Object.assign?Object.assign:r(1662).assign,w=Object.is?Object.is:r(7402);function x(){var e=r(1667);s=e.isDeepEqual,a=e.isDeepStrictEqual}new Map;var _=!1,T=e.exports=O,N={};function j(e){if(e.message instanceof Error)throw e.message;throw new f(e)}function E(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new f({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function O(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];E.apply(void 0,[O,t.length].concat(t))}T.fail=function e(t,r,o,s,a){var l,c=arguments.length;if(0===c)l="Failed";else if(1===c)o=t,t=void 0;else{if(!1===_){_=!0;var u=n.emitWarning?n.emitWarning:i.warn.bind(i);u("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===c&&(s="!=")}if(o instanceof Error)throw o;var h={actual:t,expected:r,operator:void 0===s?"fail":s,stackStartFn:a||e};void 0!==o&&(h.message=o);var d=new f(h);throw l&&(d.message=l,d.generatedMessage=!0),d},T.AssertionError=f,T.ok=O,T.equal=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");t!=r&&j({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},T.notEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");t==r&&j({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},T.deepEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===s&&x(),s(t,r)||j({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},T.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===s&&x(),s(t,r)&&j({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},T.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===s&&x(),a(t,r)||j({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},T.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===s&&x(),a(t,r)&&j({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},T.strictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");w(t,r)||j({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},T.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new p("actual","expected");w(t,r)&&j({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var S=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&v(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function I(e,t,r,n,i,o){if(!(r in e)||!a(e[r],t[r])){if(!n){var s=new S(e,i),l=new S(t,i,e),c=new f({actual:s,expected:l,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=e,c.expected=t,c.operator=o.name,c}j({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}function A(e,t,r,n){if("function"!=typeof t){if(v(t))return t.test(e);if(2===arguments.length)throw new u("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new f({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new h("error",t,"may not be an empty object");return void 0===s&&x(),a.forEach((function(i){"string"==typeof e[i]&&v(t[i])&&t[i].test(e[i])||I(e,t,i,r,a,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function k(e){if("function"!=typeof e)throw new u("fn","Function",e);try{e()}catch(e){return e}return N}function R(e){return m(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!R(t=e()))throw new d("instance of Promise","promiseFn",t)}else{if(!R(e))throw new u("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return N})).catch((function(e){return e}))}))}function D(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new u("error",["Object","Error","Function","RegExp"],r);if(t===N){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";j({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(i),stackStartFn:e})}if(r&&!A(t,r,n,e))throw t}function L(e,t,r,n){if(t!==N){if("string"==typeof r&&(n=r,r=void 0),!r||A(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";j({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];E.apply(void 0,[P,t.length].concat(t))}T.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,k(t)].concat(n))},T.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return D.apply(void 0,[e,t].concat(n))}))},T.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];L.apply(void 0,[e,k(t)].concat(n))},T.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return L.apply(void 0,[e,t].concat(n))}))},T.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=g(t);var n=new f({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var s=i.split("\n");s.shift();for(var a=n.stack.split("\n"),l=0;l<s.length;l++){var c=a.indexOf(s[l]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},T.strict=b(P,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict},6979:(e,t,r)=>{"use strict";var n=r(2530);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return!t||"object"!==p(t)&&"function"!=typeof t?a(e):t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},l(e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function u(e,t,r){return u=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i},u.apply(null,arguments)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}var f=r(5663).inspect,g=r(8619).codes.ERR_INVALID_ARG_TYPE;function y(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var m="",v="",b="",w="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function T(e){return f(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var N=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==p(e)||null===e)throw new g("options","Object",e);var i=e.message,o=e.operator,l=e.stackStartFn,c=e.actual,u=e.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,d(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(m="[34m",v="[32m",w="[39m",b="[31m"):(m="",v="",w="",b="")),"object"===p(c)&&null!==c&&"object"===p(u)&&null!==u&&"stack"in c&&c instanceof Error&&"stack"in u&&u instanceof Error&&(c=_(c),u=_(u)),"deepStrictEqual"===o||"strictEqual"===o)r=s(this,d(t).call(this,function(e,t,r){var i="",o="",s=0,a="",l=!1,c=T(e),u=c.split("\n"),h=T(t).split("\n"),d=0,f="";if("strictEqual"===r&&"object"===p(e)&&"object"===p(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var g=u[0].length+h[0].length;if(g<=10){if(!("object"===p(e)&&null!==e||"object"===p(t)&&null!==t||0===e&&0===t))return"".concat(x[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&g<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][d]===h[0][d];)d++;d>2&&(f="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}for(var _=u[u.length-1],N=h[h.length-1];_===N&&(d++<2?a="\n ".concat(_).concat(a):i=_,u.pop(),h.pop(),0!==u.length&&0!==h.length);)_=u[u.length-1],N=h[h.length-1];var j=Math.max(u.length,h.length);if(0===j){var E=c.split("\n");if(E.length>30)for(E[26]="".concat(m,"...").concat(w);E.length>27;)E.pop();return"".concat(x.notIdentical,"\n\n").concat(E.join("\n"),"\n")}d>3&&(a="\n".concat(m,"...").concat(w).concat(a),l=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var O=0,S=x[r]+"\n".concat(v,"+ actual").concat(w," ").concat(b,"- expected").concat(w),I=" ".concat(m,"...").concat(w," Lines skipped");for(d=0;d<j;d++){var A=d-s;if(u.length<d+1)A>1&&d>2&&(A>4?(o+="\n".concat(m,"...").concat(w),l=!0):A>3&&(o+="\n ".concat(h[d-2]),O++),o+="\n ".concat(h[d-1]),O++),s=d,i+="\n".concat(b,"-").concat(w," ").concat(h[d]),O++;else if(h.length<d+1)A>1&&d>2&&(A>4?(o+="\n".concat(m,"...").concat(w),l=!0):A>3&&(o+="\n ".concat(u[d-2]),O++),o+="\n ".concat(u[d-1]),O++),s=d,o+="\n".concat(v,"+").concat(w," ").concat(u[d]),O++;else{var k=h[d],R=u[d],C=R!==k&&(!y(R,",")||R.slice(0,-1)!==k);C&&y(k,",")&&k.slice(0,-1)===R&&(C=!1,R+=","),C?(A>1&&d>2&&(A>4?(o+="\n".concat(m,"...").concat(w),l=!0):A>3&&(o+="\n ".concat(u[d-2]),O++),o+="\n ".concat(u[d-1]),O++),s=d,o+="\n".concat(v,"+").concat(w," ").concat(R),i+="\n".concat(b,"-").concat(w," ").concat(k),O+=2):(o+=i,i="",1!==A&&0!==d||(o+="\n ".concat(R),O++))}if(O>20&&d<j-2)return"".concat(S).concat(I,"\n").concat(o,"\n").concat(m,"...").concat(w).concat(i,"\n")+"".concat(m,"...").concat(w)}return"".concat(S).concat(l?I:"","\n").concat(o).concat(i).concat(a).concat(f)}(c,u,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var f=x[o],N=T(c).split("\n");if("notStrictEqual"===o&&"object"===p(c)&&null!==c&&(f=x.notStrictEqualObject),N.length>30)for(N[26]="".concat(m,"...").concat(w);N.length>27;)N.pop();r=1===N.length?s(this,d(t).call(this,"".concat(f," ").concat(N[0]))):s(this,d(t).call(this,"".concat(f,"\n\n").concat(N.join("\n"),"\n")))}else{var j=T(c),E="",O=x[o];"notDeepEqual"===o||"notEqual"===o?(j="".concat(x[o],"\n\n").concat(j)).length>1024&&(j="".concat(j.slice(0,1021),"...")):(E="".concat(T(u)),j.length>512&&(j="".concat(j.slice(0,509),"...")),E.length>512&&(E="".concat(E.slice(0,509),"...")),"deepEqual"===o||"equal"===o?j="".concat(O,"\n\n").concat(j,"\n\nshould equal\n\n"):E=" ".concat(o," ").concat(E)),r=s(this,d(t).call(this,"".concat(j).concat(E)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=u,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),l),r.stack,r.name="AssertionError",s(r)}var r,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:f.custom,value:function(e,t){return f(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],l&&o(r.prototype,l),t}(l(Error));e.exports=N},8619:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var s,a,l={};function c(e,t,r){r||(r=Error);var s=function(r){function s(r,o,a){var l;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),l=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(s).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,o,a))),l.code=e,l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(s,r),s}(r);l[e]=s}function u(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,a,l,c,h;if(void 0===s&&(s=r(6118)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,a.length)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(o," ").concat(u(t,"type"));else{var d=("number"!=typeof h&&(h=0),h+".".length>(c=e).length||-1===c.indexOf(".",h)?"argument":"property");l='The "'.concat(e,'" ').concat(d," ").concat(o," ").concat(u(t,"type"))}return l+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(5663));var i=a.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(6118)),s(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=l},1667:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},a=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(7402),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:r(8622);function h(e){return e.call.bind(e)}var d=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),f=h(Object.prototype.toString),g=r(5663).types,y=g.isAnyArrayBuffer,m=g.isArrayBufferView,v=g.isDate,b=g.isMap,w=g.isRegExp,x=g.isSet,_=g.isNativeError,T=g.isBoxedPrimitive,N=g.isNumberObject,j=g.isStringObject,E=g.isBooleanObject,O=g.isBigIntObject,S=g.isSymbolObject,I=g.isFloat32Array,A=g.isFloat64Array;function k(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(k).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function C(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function D(e,t,r,n){if(e===t)return 0!==e||!r||l(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&u(e)&&u(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var s,a,c,h,d=f(e);if(d!==f(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var p=R(e),g=R(t);return p.length===g.length&&P(e,t,r,n,1,p)}if("[object Object]"===d&&(!b(e)&&b(t)||!x(e)&&x(t)))return!1;if(v(e)){if(!v(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(c=e,h=t,!(o?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(m(e)){if(r||!I(e)&&!A(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var k=R(e),D=R(t);return k.length===D.length&&P(e,t,r,n,0,k)}if(x(e))return!(!x(t)||e.size!==t.size)&&P(e,t,r,n,2);if(b(e))return!(!b(t)||e.size!==t.size)&&P(e,t,r,n,3);if(y(e)){if(a=t,(s=e).byteLength!==a.byteLength||0!==C(new Uint8Array(s),new Uint8Array(a)))return!1}else if(T(e)&&!function(e,t){return N(e)?N(t)&&l(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):j(e)?j(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):E(e)?E(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):O(e)?O(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):S(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return P(e,t,r,n,0)}function L(e,t){return t.filter((function(t){return p(e,t)}))}function P(e,t,r,n,i,o){if(5===arguments.length){o=Object.keys(e);var s=Object.keys(t);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!d(t,o[a]))return!1;if(r&&5===arguments.length){var l=c(e);if(0!==l.length){var u=0;for(a=0;a<l.length;a++){var h=l[a];if(p(e,h)){if(!p(t,h))return!1;o.push(h),u++}else if(p(t,h))return!1}var f=c(t);if(l.length!==f.length&&L(t,f).length!==u)return!1}else{var g=c(t);if(0!==g.length&&0!==L(t,g).length)return!1}}if(0===o.length&&(0===i||1===i&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var y=n.val1.get(e);if(void 0!==y){var m=n.val2.get(t);if(void 0!==m)return y===m}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var v=H(e,t,r,o,n,i);return n.val1.delete(e),n.val2.delete(t),v}function M(e,t,r,n){for(var i=s(e),o=0;o<i.length;o++){var a=i[o];if(D(t,a,r,n))return e.delete(a),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(u(e))return!1}return!0}function U(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function B(e,t,r,n,i){var o=F(r);if(null!=o)return o;var s=t.get(o);return!(void 0===s&&!t.has(o)||!D(n,s,!1,i))&&!e.has(o)&&D(n,s,!1,i)}function q(e,t,r,n,i,o){for(var a=s(e),l=0;l<a.length;l++){var c=a[l];if(D(r,c,i,o)&&D(n,t.get(c),i,o))return e.delete(c),!0}return!1}function H(e,t,r,o,l,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var o=null,a=s(e),l=0;l<a.length;l++){var c=a[l];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!U(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var u=s(t),h=0;h<u.length;h++){var d=u[h];if("object"===i(d)&&null!==d){if(!M(o,d,r,n))return!1}else if(!r&&!e.has(d)&&!M(o,d,r,n))return!1}return 0===o.size}return!0}(e,t,r,l))return!1}else if(3===c){if(!function(e,t,r,o){for(var s=null,l=a(e),c=0;c<l.length;c++){var u=n(l[c],2),h=u[0],d=u[1];if("object"===i(h)&&null!==h)null===s&&(s=new Set),s.add(h);else{var p=t.get(h);if(void 0===p&&!t.has(h)||!D(d,p,r,o)){if(r)return!1;if(!B(e,t,h,d,o))return!1;null===s&&(s=new Set),s.add(h)}}}if(null!==s){for(var f=a(t),g=0;g<f.length;g++){var y=n(f[g],2),m=(h=y[0],y[1]);if("object"===i(h)&&null!==h){if(!q(s,e,h,m,r,o))return!1}else if(!(r||e.has(h)&&D(e.get(h),m,!1,o)||q(s,e,h,m,!1,o)))return!1}return 0===s.size}return!0}(e,t,r,l))return!1}else if(1===c)for(;u<e.length;u++){if(!d(e,u)){if(d(t,u))return!1;for(var h=Object.keys(e);u<h.length;u++){var p=h[u];if(!d(t,p)||!D(e[p],t[p],r,l))return!1}return h.length===Object.keys(t).length}if(!d(t,u)||!D(e[u],t[u],r,l))return!1}for(u=0;u<o.length;u++){var f=o[u];if(!D(e[f],t[f],r,l))return!1}return!0}e.exports={isDeepEqual:function(e,t){return D(e,t,!1)},isDeepStrictEqual:function(e,t){return D(e,t,!0)}}},5155:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=l(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),u=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;a<l;a+=s)o.push(c(e,a,a+s>l?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2486:(e,t,r)=>{"use strict";var n=r(292);const i=r(5155),o=r(4525),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const a=2147483647;function l(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=l(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|g(e.length),r=l(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Q(e.length)?l(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return h(e),l(e<0?0:0|g(e))}function p(e){const t=e.length<0?0:0|g(e.length),r=l(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function f(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function g(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function m(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function v(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function x(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(Q(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return X(G(t,e.length-r),e,r,n)}function T(e,t,r,n){return X(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function N(e,t,r,n){return X(J(t),e,r,n)}function j(e,t,r,n){return X(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?l(e):void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),W(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(W(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)v(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)v(this,t,t+3),v(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)v(this,t,t+7),v(this,t+1,t+6),v(this,t+2,t+5),v(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):m.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(W(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==u[e]){o=l[e],s=u[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return N(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function A(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function k(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=K((function(e){$(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=K((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=K((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=K((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=K((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const B={};function q(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function Z(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){$(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,i,o)}function $(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw $(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=H(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Q(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function K(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},7615:(e,t,r)=>{"use strict";var n=r(1801),i=r(2550),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},2550:(e,t,r)=>{"use strict";var n=r(1930),i=r(1801),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),l=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=a(n,s,arguments);if(l&&c){var r=l(t,"length");r.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var h=function(){return a(n,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h},8981:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>void 0===t[n]||"symbol"==typeof t[n]?r:r+(0===r.length?"":",")+e(n)+":"+e(t[n])),"")+"}"}},292:(e,t,r)=>{var n=r(5663),i=r(6118);function o(){return(new Date).getTime()}var s,a=Array.prototype.slice,l={};s=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){s.log.apply(s,arguments)},"info"],[function(){s.log.apply(s,arguments)},"warn"],[function(){s.warn.apply(s,arguments)},"error"],[function(e){l[e]=o()},"time"],[function(e){var t=l[e];if(!t)throw new Error("No such label: "+e);delete l[e];var r=o()-t;s.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),s.error(e.stack)},"trace"],[function(e){s.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=a.call(arguments,1);i.ok(!1,n.format.apply(null,t))}},"assert"]],u=0;u<c.length;u++){var h=c[u],d=h[0],p=h[1];s[p]||(s[p]=d)}e.exports=s},7297:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function f(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=f(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=p(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=f(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=u(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=u(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var v=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),v.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},m.call(b.prototype),m.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,r){return new Promise((function(n,o){var s=new b(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new x(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",l)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}T.polyfill=!0,e.fetch||(e.fetch=T,e.Headers=d,e.Request=b,e.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=T,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},9170:(e,t,r)=>{"use strict";var n=r(806),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,l=r(8198)(),c=a&&l,u=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?a(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},h=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)u(e,o[a],t[o[a]],r[o[a]])};h.supportsDescriptors=!!c,e.exports=h},1662:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var l=o[s],c=Object.getOwnPropertyDescriptor(i,l);void 0!==c&&c.enumerable&&(r[l]=i[l])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},4843:(e,t,r)=>{"use strict";var n=r(5443),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},a=function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},l=function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?s(e,t,o):"string"==typeof e?a(e,t,o):l(e,t,o)}},9930:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var s,a=r.call(arguments,1),l=function(){if(this instanceof s){var t=o.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),u=[],h=0;h<c;h++)u.push("$"+h);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(l),o.prototype){var d=function(){};d.prototype=o.prototype,s.prototype=new d,d.prototype=null}return s}},1930:(e,t,r)=>{"use strict";var n=r(9930);e.exports=Function.prototype.bind||n},1801:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var c=function(){throw new s},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(e){return c}}}():c,h=r(9905)(),d=Object.getPrototypeOf||function(e){return e.__proto__},p={},f="undefined"==typeof Uint8Array?n:d(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?d(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":f,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=d(i.prototype))}return g[t]=r,r},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},v=r(1930),b=r(9284),w=v.call(Function.call,Array.prototype.concat),x=v.call(Function.apply,Array.prototype.splice),_=v.call(Function.call,String.prototype.replace),T=v.call(Function.call,String.prototype.slice),N=v.call(Function.call,RegExp.prototype.exec),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,O=function(e){var t=T(e,0,1),r=T(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,j,(function(e,t,r,i){n[n.length]=r?_(i,E,"$1"):t||e})),n},S=function(e,t){var r,n=e;if(b(m,n)&&(n="%"+(r=m[n])[0]+"%"),b(g,n)){var o=g[n];if(o===p&&(o=y(n)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===N(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=O(e),n=r.length>0?r[0]:"",o=S("%"+n+"%",t),a=o.name,c=o.value,u=!1,h=o.alias;h&&(n=h[0],x(r,w([0,1],h)));for(var d=1,p=!0;d<r.length;d+=1){var f=r[d],y=T(f,0,1),m=T(f,-1);if(('"'===y||"'"===y||"`"===y||'"'===m||"'"===m||"`"===m)&&y!==m)throw new i("property names with quotes must have matching quotes");if("constructor"!==f&&p||(u=!0),b(g,a="%"+(n+="."+f)+"%"))c=g[a];else if(null!=c){if(!(f in c)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(l&&d+1>=r.length){var v=l(c,f);c=(p=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:c[f]}else p=b(c,f),c=c[f];p&&!u&&(g[a]=c)}}return c}},3828:(e,t,r)=>{"use strict";var n=r(1801)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8198:(e,t,r)=>{"use strict";var n=r(1801)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},9905:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4111:(e,t,r)=>{"use strict";var n=r(5682);e.exports=function(){return n()&&!!Symbol.toStringTag}},9284:(e,t,r)=>{"use strict";var n=r(1930);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4525:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,p=e[t+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,f=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=f,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=f,s/=256,c-=8);e[r+p-f]|=128*g}},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7092:(e,t,r)=>{"use strict";var n=r(4111)(),i=r(7615)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},5443:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var d=document.all;l.call(d)===l.call(document.all)&&(h=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},7427:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(4111)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},2100:e=>{"use strict";e.exports=function(e){return e!=e}},8622:(e,t,r)=>{"use strict";var n=r(2550),i=r(9170),o=r(2100),s=r(4358),a=r(6232),l=n(s(),Number);i(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},4358:(e,t,r)=>{"use strict";var n=r(2100);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6232:(e,t,r)=>{"use strict";var n=r(9170),i=r(4358);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2527:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=o("Object.prototype.toString"),a=r(4111)(),l=r(3828),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d=o("String.prototype.slice"),p={},f=Object.getPrototypeOf;a&&l&&f&&n(u,(function(e){var t=new c[e];if(Symbol.toStringTag in t){var r=f(t),n=l(r,Symbol.toStringTag);if(!n){var i=f(r);n=l(i,Symbol.toStringTag)}p[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!a||!(Symbol.toStringTag in e)){var t=d(s(e),8,-1);return h(u,t)>-1}return!!l&&function(e){var t=!1;return n(p,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},5777:(e,t,r)=>{"use strict";const{isArray:n,isObject:i,isString:o}=r(8285),{asArray:s}=r(4768),{prependBase:a}=r(3866),l=r(9699),c=r(1898);function u(e){throw new l("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function h({context:e,base:t}){if(!e)return;const r=e["@context"];if(o(r))e["@context"]=a(t,r);else if(n(r))for(let e=0;e<r.length;++e){const n=r[e];o(n)?r[e]=a(t,n):i(n)&&h({context:{"@context":n},base:t})}else if(i(r))for(const e in r)h({context:r[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:r,base:a,cycles:l=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=s(t);const h=[];for(const s of t){if(o(s)){let t=this._get(s);t||(t=await this._resolveRemoteContext({activeCtx:e,url:s,documentLoader:r,base:a,cycles:l})),n(t)?h.push(...t):h.push(t);continue}if(null===s){h.push(new c({document:null}));continue}i(s)||u(t);const d=JSON.stringify(s);let p=this._get(d);p||(p=new c({document:s}),this._cacheResolvedContext({key:d,resolved:p,tag:"static"})),h.push(p)}return h}_get(e){let t=this.perOpCache.get(e);if(!t){const r=this.sharedCache.get(e);r&&(t=r.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:r}){if(this.perOpCache.set(e,t),void 0!==r){let n=this.sharedCache.get(e);n||(n=new Map,this.sharedCache.set(e,n)),n.set(r,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:r,base:n,cycles:i}){t=a(n,t);const{context:o,remoteDoc:s}=await this._fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:i});h({context:o,base:n=s.documentUrl||t});const l=await this.resolve({activeCtx:e,context:o,documentLoader:r,base:n,cycles:i});return this._cacheResolvedContext({key:t,resolved:l,tag:s.tag}),l}async _fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:s}){if(s.size>10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let a,c;s.add(t);try{c=await r(t),a=c.document||null,o(a)&&(a=JSON.parse(a))}catch(e){throw new l("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!i(a))throw new l("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return a="@context"in a?{"@context":a["@context"]}:{"@context":{}},c.contextUrl&&(n(a["@context"])||(a["@context"]=[a["@context"]]),a["@context"].push(c.contextUrl)),{context:a,remoteDoc:c}}}},9699:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}}},7298:e=>{"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},7990:(e,t,r)=>{"use strict";e.exports=r(2948).NQuads},3114:e=>{"use strict";e.exports=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]}}}},1898:(e,t,r)=>{"use strict";const n=r(3666);e.exports=class{constructor({document:e}){this.document=e,this.cache=new n({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},120:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isString:s,isUndefined:a}=r(8285),{isList:l,isValue:c,isGraph:u,isSimpleGraph:h,isSubjectReference:d}=r(478),{expandIri:p,getContextValue:f,isKeyword:g,process:y,processingMode:m}=r(2182),{removeBase:v,prependBase:b}=r(3866),{REGEX_KEYWORD:w,addValue:x,asArray:_,compareShortestLeast:T}=r(4768),N={};function j(e,t,r){if("@nest"!==p(e,t,{vocab:!0},r))throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=N,N.compact=async({activeCtx:e,activeProperty:t=null,element:r,options:p={}})=>{if(i(r)){let n=[];for(let i=0;i<r.length;++i){const o=await N.compact({activeCtx:e,activeProperty:t,element:r[i],options:p});null!==o&&n.push(o)}return p.compactArrays&&1===n.length&&0===(f(e,t,"@container")||[]).length&&(n=n[0]),n}const v=f(e,t,"@context");if(a(v)||(e=await y({activeCtx:e,localCtx:v,propagate:!0,overrideProtected:!0,options:p})),o(r)){if(p.link&&"@id"in r&&p.link.hasOwnProperty(r["@id"])){const e=p.link[r["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===r)return e[t].compacted}if(c(r)||d(r)){const n=N.compactValue({activeCtx:e,activeProperty:t,value:r,options:p});return p.link&&d(r)&&(p.link.hasOwnProperty(r["@id"])||(p.link[r["@id"]]=[]),p.link[r["@id"]].push({expanded:r,compacted:n})),n}if(l(r)&&(f(e,t,"@container")||[]).includes("@list"))return N.compact({activeCtx:e,activeProperty:t,element:r["@list"],options:p});const v="@reverse"===t,b={},w=e;c(r)||d(r)||(e=e.revertToPreviousContext());const T=f(w,t,"@context");a(T)||(e=await y({activeCtx:e,localCtx:T,propagate:!0,overrideProtected:!0,options:p})),p.link&&"@id"in r&&(p.link.hasOwnProperty(r["@id"])||(p.link[r["@id"]]=[]),p.link[r["@id"]].push({expanded:r,compacted:b}));let E=r["@type"]||[];E.length>1&&(E=Array.from(E).sort());const O=e;for(const t of E){const r=N.compactIri({activeCtx:O,iri:t,relativeTo:{vocab:!0}}),n=f(w,r,"@context");a(n)||(e=await y({activeCtx:e,localCtx:n,options:p,propagate:!1}))}const S=Object.keys(r).sort();for(const a of S){const d=r[a];if("@id"!==a)if("@type"!==a)if("@reverse"!==a)if("@preserve"!==a)if("@index"!==a)if("@graph"!==a&&"@list"!==a&&"@included"!==a&&g(a)){const t=N.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,t,d)}else{if(!i(d))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===d.length){const t=N.compactIri({activeCtx:e,iri:a,value:d,relativeTo:{vocab:!0},reverse:v}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let n=b;r&&(j(e,r,p),o(b[r])||(b[r]={}),n=b[r]),x(n,t,d,{propertyIsArray:!0})}for(const t of d){const r=N.compactIri({activeCtx:e,iri:a,value:t,relativeTo:{vocab:!0},reverse:v}),n=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let d=b;n&&(j(e,n,p),o(b[n])||(b[n]={}),d=b[n]);const g=f(e,r,"@container")||[],y=u(t),m=l(t);let w;m?w=t["@list"]:y&&(w=t["@graph"]);let T=await N.compact({activeCtx:e,activeProperty:r,element:m||y?w:t,options:p});if(m){if(i(T)||(T=[T]),g.includes("@list")){x(d,r,T,{valueIsArray:!0,allowDuplicate:!0});continue}T={[N.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:T},"@index"in t&&(T[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(y)if(g.includes("@graph")&&(g.includes("@id")||g.includes("@index")&&h(t))){let n;d.hasOwnProperty(r)?n=d[r]:d[r]=n={};const i=(g.includes("@id")?t["@id"]:t["@index"])||N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});x(n,i,T,{propertyIsArray:!p.compactArrays||g.includes("@set")})}else g.includes("@graph")&&h(t)?(i(T)&&T.length>1&&(T={"@included":T}),x(d,r,T,{propertyIsArray:!p.compactArrays||g.includes("@set")})):(i(T)&&1===T.length&&p.compactArrays&&(T=T[0]),T={[N.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:T},"@id"in t&&(T[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(T[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),x(d,r,T,{propertyIsArray:!p.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let n,i;if(d.hasOwnProperty(r)?n=d[r]:d[r]=n={},g.includes("@language"))c(T)&&(T=T["@value"]),i=t["@language"];else if(g.includes("@index")){const n=f(e,r,"@index")||"@index",o=N.compactIri({activeCtx:e,iri:n,relativeTo:{vocab:!0}});if("@index"===n)i=t["@index"],delete T[o];else{let e;if([i,...e]=_(T[n]||[]),s(i))switch(e.length){case 0:delete T[n];break;case 1:T[n]=e[0];break;default:T[n]=e}else i=null}}else if(g.includes("@id")){const t=N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=T[t],delete T[t]}else if(g.includes("@type")){const n=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=_(T[n]||[]),o.length){case 0:delete T[n];break;case 1:T[n]=o[0];break;default:T[n]=o}1===Object.keys(T).length&&"@id"in t&&(T=await N.compact({activeCtx:e,activeProperty:r,element:{"@id":t["@id"]},options:p}))}i||(i=N.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),x(n,i,T,{propertyIsArray:g.includes("@set")})}else{const e=!p.compactArrays||g.includes("@set")||g.includes("@list")||i(T)&&0===T.length||"@list"===a||"@graph"===a;x(d,r,T,{propertyIsArray:e})}}}else{if((f(e,t,"@container")||[]).includes("@index"))continue;const r=N.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,d)}else{const r=await N.compact({activeCtx:e,activeProperty:t,element:d,options:p});i(r)&&0===r.length||x(b,a,r)}else{const t=await N.compact({activeCtx:e,activeProperty:"@reverse",element:d,options:p});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const n=t[r],i=(f(e,r,"@container")||[]).includes("@set")||!p.compactArrays;x(b,r,n,{propertyIsArray:i}),delete t[r]}if(Object.keys(t).length>0){const r=N.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,t)}}else{let t=_(d).map((e=>N.compactIri({activeCtx:w,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const r=N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),n=(f(e,r,"@container")||[]).includes("@set")&&m(e,1.1)||i(t)&&0===d.length;x(b,r,t,{propertyIsArray:n})}else{let t=_(d).map((t=>N.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:p.base})));1===t.length&&(t=t[0]),b[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return b}return r},N.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const h=e.getInverse();if(g(t)&&t in h&&"@none"in h[t]&&"@type"in h[t]["@none"]&&"@none"in h[t]["@none"]["@type"])return h[t]["@none"]["@type"]["@none"];if(i.vocab&&t in h){const n=e["@language"]||"@none",i=[];o(r)&&"@index"in r&&!("@graph"in r)&&i.push("@index","@index@set"),o(r)&&"@preserve"in r&&(r=r["@preserve"][0]),u(r)?("@index"in r&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in r||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||i.push("@graph@id","@graph@id@set")):o(r)&&!c(r)&&i.push("@id","@id@set","@type","@set@type");let a="@language",h="@null";if(s)a="@type",h="@reverse",i.push("@set");else if(l(r)){"@index"in r||i.push("@list");const e=r["@list"];if(0===e.length)a="@any",h="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;n<e.length;++n){const i=e[n];let o="@none",s="@none";if(c(i)?"@direction"in i?o=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?o=i["@language"].toLowerCase():"@type"in i?s=i["@type"]:o="@null":s="@id",null===t?t=o:o!==t&&c(i)&&(t="@none"),null===r?r=s:s!==r&&(r="@none"),"@none"===t&&"@none"===r)break}t=t||"@none",r=r||"@none","@none"!==r?(a="@type",h=r):h=t}}else{if(c(r))if("@language"in r&&!("@index"in r)){i.push("@language","@language@set"),h=r["@language"];const e=r["@direction"];e&&(h=`${h}_${e}`)}else"@direction"in r&&!("@index"in r)?h=`_${r["@direction"]}`:"@type"in r&&(a="@type",h=r["@type"]);else a="@type",h="@id";i.push("@set")}i.push("@none"),o(r)&&!("@index"in r)&&i.push("@index","@index@set"),c(r)&&1===Object.keys(r).length&&i.push("@language","@language@set");const d=function(e,t,r,n,i,s){null===s&&(s="@null");const a=[];if(("@id"===s||"@reverse"===s)&&o(r)&&"@id"in r){"@reverse"===s&&a.push("@reverse");const t=N.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===r["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(s);const e=a.find((e=>e.includes("_")));e&&a.push(e.replace(/^[^_]+_/,"_"))}a.push("@none");const l=e.inverse[t];for(const e of n){if(!(e in l))continue;const t=l[e][i];for(const e of a)if(e in t)return t[e]}return null}(e,t,r,i,a,h);if(null!==d)return d}if(i.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let d=null;const p=[];let f=e.fastCurieMap;const y=t.length-1;for(let e=0;e<y&&t[e]in f;++e)f=f[t[e]],""in f&&p.push(f[""][0]);for(let n=p.length-1;n>=0;--n){const i=p[n],o=i.terms;for(const n of o){const o=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(o)||null===r&&e.mappings.get(o)["@id"]===t)&&(null===d||T(o,d)<0)&&(d=o)}}if(null!==d)return d;for(const[r,i]of e.mappings)if(i&&i._prefix&&t.startsWith(r+":"))throw new n(`Absolute IRI "${t}" confused with prefix "${r}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const r=v(b(a,e["@base"]),t);return w.test(r)?`./${r}`:r}return t}return v(a,t)}return t},N.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(c(r)){const n=f(e,t,"@type"),i=f(e,t,"@language"),o=f(e,t,"@direction"),a=f(e,t,"@container")||[],l="@index"in r&&!a.includes("@index");if(!l&&"@none"!==n){if(r["@type"]===n)return r["@value"];if("@language"in r&&r["@language"]===i&&"@direction"in r&&r["@direction"]===o)return r["@value"];if("@language"in r&&r["@language"]===i)return r["@value"];if("@direction"in r&&r["@direction"]===o)return r["@value"]}const c=Object.keys(r).length,u=1===c||2===c&&"@index"in r&&!l,h="@language"in e,d=s(r["@value"]),p=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(u&&"@none"!==n&&(!h||!d||p))return r["@value"];const g={};return l&&(g[N.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?g[N.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=N.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(g[N.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(g[N.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),g[N.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],g}const i=p(e,t,{vocab:!0},n),o=f(e,t,"@type"),a=N.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===o},base:n.base});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[N.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},2445:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},2182:(e,t,r)=>{"use strict";const n=r(4768),i=r(9699),{isArray:o,isObject:s,isString:a,isUndefined:l}=r(8285),{isAbsolute:c,isRelative:u,prependBase:h}=r(3866),{handleEvent:d}=r(5746),{REGEX_BCP47:p,REGEX_KEYWORD:f,asArray:g,compareShortestLeast:y}=r(4768),m=new Map,v={};function b(e,t,r,n,i,o){if(null===t||!a(t)||v.isKeyword(t))return t;if(t.match(f))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&v.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:o}),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(s(r)&&"@id"in r)return r["@id"]}const l=t.indexOf(":");if(l>0){const r=t.substr(0,l),s=t.substr(l+1);if("_"===r||0===s.indexOf("//"))return t;n&&n.hasOwnProperty(r)&&v.createTermDefinition({activeCtx:e,localCtx:n,term:r,defined:i,options:o});const a=e.mappings.get(r);if(a&&a._prefix)return a["@id"]+s;if(c(t))return t}if(r.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(r.base){let r,n;"@base"in e?e["@base"]?(n=h(o.base,e["@base"]),r=h(n,t)):(n=e["@base"],r=t):(n=o.base,r=h(o.base,t)),t=r}return t}function w(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!w(e[r],t[r]))return!1;return!0}const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r in e){let n=e[r],i=t[r];if("@container"===r&&Array.isArray(n)&&Array.isArray(i)&&(n=n.slice().sort(),i=i.slice().sort()),!w(n,i))return!1}return!0}e.exports=v,v.process=async({activeCtx:e,localCtx:t,options:r,propagate:n=!0,overrideProtected:l=!1,cycles:f=new Set})=>{if(s(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]),0===g(t).length)return e;const y=[],m=[({event:e,next:t})=>{y.push(e),t()}];r.eventHandler&&m.push(r.eventHandler);const w=r;r={...r,eventHandler:m};const x=await r.contextResolver.resolve({activeCtx:e,context:t,documentLoader:r.documentLoader,base:r.base});s(x[0].document)&&"boolean"==typeof x[0].document["@propagate"]&&(n=x[0].document["@propagate"]);let _=e;n||_.previousContext||(_=_.clone(),_.previousContext=e);for(const n of x){let{document:o}=n;if(e=_,null===o){if(!l&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});_=e=v.getInitialContext(r).clone();continue}const g=n.getProcessed(e);if(g){if(w.eventHandler)for(const e of g.events)d({event:e,options:w});_=e=g.context;continue}if(s(o)&&"@context"in o&&(o=o["@context"]),!s(o))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:o});_=_.clone();const m=new Map;if("@version"in o){if(1.1!==o["@version"])throw new i("Unsupported JSON-LD version: "+o["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:o});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+o["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:o});_.processingMode="json-ld-1.1",_["@version"]=o["@version"],m.set("@version",!0)}if(_.processingMode=_.processingMode||e.processingMode,"@base"in o){let e=o["@base"];if(null===e||c(e));else{if(!u(e))throw new i('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:o});e=h(_["@base"],e)}_["@base"]=e,m.set("@base",!0)}if("@vocab"in o){const e=o["@vocab"];if(null===e)delete _["@vocab"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:o});if(!c(e)&&v.processingMode(_,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:o});{const t=b(_,e,{vocab:!0,base:!0},void 0,void 0,r);c(t)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:r}),_["@vocab"]=t}}m.set("@vocab",!0)}if("@language"in o){const e=o["@language"];if(null===e)delete _["@language"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:o});e.match(p)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r}),_["@language"]=e.toLowerCase()}m.set("@language",!0)}if("@direction"in o){const t=o["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:o});if(null===t)delete _["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:o});_["@direction"]=t}m.set("@direction",!0)}if("@propagate"in o){const r=o["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:o});if("boolean"!=typeof r)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});m.set("@propagate",!0)}if("@import"in o){const n=o["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:o});if(!a(n))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const s=await r.contextResolver.resolve({activeCtx:e,context:n,documentLoader:r.documentLoader,base:r.base});if(1!==s.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=s[0].getProcessed(e);if(l)o=l;else{const r=s[0].document;if("@import"in r)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in r)o.hasOwnProperty(e)||(o[e]=r[e]);s[0].setProcessed(e,o)}m.set("@import",!0)}m.set("@protected",o["@protected"]||!1);for(const e in o)if(v.createTermDefinition({activeCtx:_,localCtx:o,term:e,defined:m,options:r,overrideProtected:l}),s(o[e])&&"@context"in o[e]){const t=o[e]["@context"];let n=!0;if(a(t)){const e=h(r.base,t);f.has(e)?n=!1:f.add(e)}if(n)try{await v.process({activeCtx:_.clone(),localCtx:o[e]["@context"],overrideProtected:!0,options:r,cycles:f})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:o[e]["@context"],term:e})}}n.setProcessed(e,{context:_,events:y})}return _},v.createTermDefinition=({activeCtx:e,localCtx:t,term:r,defined:n,options:l,overrideProtected:u=!1})=>{if(n.has(r)){if(n.get(r))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}let h;if(n.set(r,!1),t.hasOwnProperty(r)&&(h=t[r]),"@type"===r&&s(h)&&"@set"===(h["@container"]||"@set")&&v.processingMode(e,1.1)){const e=["@container","@id","@protected"],n=Object.keys(h);if(0===n.length||n.some((t=>!e.includes(t))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r})}else{if(v.isKeyword(r))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(r.match(f))return void(l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:r}},options:l}));if(""===r)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const p=e.mappings.get(r);e.mappings.has(r)&&e.mappings.delete(r);let g=!1;if((a(h)||null===h)&&(g=!0,h={"@id":h}),!s(h))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const y={};e.mappings.set(r,y),y.reverse=!1;const m=["@container","@id","@language","@reverse","@type"];v.processingMode(e,1.1)&&m.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in h)if(!m.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const x=r.indexOf(":");if(y._termHasColon=x>0,"@reverse"in h){if("@id"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const o=h["@reverse"];if(!a(o))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(o.match(f))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:o}},options:l}),void(p?e.mappings.set(r,p):e.mappings.delete(r));const s=b(e,o,{vocab:!0,base:!1},t,n,l);if(!c(s))throw new i("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});y["@id"]=s,y.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!a(o))throw new i("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===o)y["@id"]=null;else{if(!v.isKeyword(o)&&o.match(f))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:o}},options:l}),void(p?e.mappings.set(r,p):e.mappings.delete(r));if(o!==r){if(o=b(e,o,{vocab:!0,base:!1},t,n,l),!c(o)&&!v.isKeyword(o))throw new i("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(r.match(/(?::[^:])|\//)&&b(e,r,{vocab:!0,base:!1},t,new Map(n).set(r,!0),l)!==o)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=o,y._prefix=g&&!y._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const i=r.substr(0,x);if(t.hasOwnProperty(i)&&v.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:n,options:l}),e.mappings.has(i)){const t=r.substr(x+1);y["@id"]=e.mappings.get(i)["@id"]+t}else y["@id"]=r}else if("@type"===r)y["@id"]=r;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});y["@id"]=e["@vocab"]+r}if((!0===h["@protected"]||!0===n.get("@protected")&&!1!==h["@protected"])&&(e.protected[r]=!0,y.protected=!0),n.set(r,!0),"@type"in h){let r=h["@type"];if(!a(r))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===r||"@none"===r){if(v.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${r}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==r&&"@vocab"!==r){if(r=b(e,r,{vocab:!0,base:!1},t,n,l),!c(r))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===r.indexOf("_:"))throw new i("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})}y["@type"]=r}if("@container"in h){const r=a(h["@container"])?[h["@container"]]:h["@container"]||[],n=["@list","@set","@index","@language"];let s=!0;const l=r.includes("@set");if(v.processingMode(e,1.1)){if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(r.includes("@graph")){if(r.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new i("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 s&=r.length<=(l?2:1);if(r.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else s&=!o(h["@container"]),s&=r.length<=1;if(s&=r.every((e=>n.includes(e))),s&=!(l&&r.includes("@list")),!s)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(y.reverse&&!r.every((e=>["@index","@set"].includes(e))))throw new i("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});y["@container"]=r}if("@index"in h){if(!("@container"in h)||!y["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!a(h["@index"])||0===h["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=h["@index"]}if("@context"in h&&(y["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let e=h["@language"];if(null!==e&&!a(e))throw new i("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()),y["@language"]=e}if("@prefix"in h){if(r.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(v.isKeyword(y["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof h["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});y._prefix=!0===h["@prefix"]}if("@direction"in h){const e=h["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});y["@direction"]=e}if("@nest"in h){const e=h["@nest"];if(!a(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("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});y["@nest"]=e}const _=y["@id"];if("@context"===_||"@preserve"===_)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(p&&p.protected&&!u&&(e.protected[r]=!0,y.protected=!0,!w(p,y)))throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r})},v.expandIri=(e,t,r,n)=>b(e,t,r,void 0,void 0,n),v.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),r=m.get(t);if(r)return r;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=(e["@language"]||"@none").toLowerCase(),a=e["@direction"],l=e.mappings,c=[...l.keys()].sort(y);for(const e of c){const o=l.get(e);if(null===o)continue;let c=o["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===o["@id"])continue;const u=g(o["@id"]);for(const l of u){let u=t[l];const h=v.isKeyword(l);if(u)h||o._termHasColon||n[l].push(e);else if(t[l]=u={},!h&&!o._termHasColon){n[l]=[e];const t={iri:l,terms:n[l]};l[0]in r?r[l[0]].push(t):r[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],s(e,u["@any"],"@none"),o.reverse)s(e,u["@type"],"@reverse");else if("@none"===o["@type"])s(e,u["@any"],"@none"),s(e,u["@language"],"@none"),s(e,u["@type"],"@none");else if("@type"in o)s(e,u["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const t=o["@language"],r=o["@direction"];s(e,u["@language"],t&&r?`${t}_${r}`.toLowerCase():t?t.toLowerCase():r?`_${r}`:"@null")}else"@language"in o?s(e,u["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?o["@direction"]?s(e,u["@language"],`_${o["@direction"]}`):s(e,u["@language"],"@none"):a?(s(e,u["@language"],`_${a}`),s(e,u["@language"],"@none"),s(e,u["@type"],"@none")):(s(e,u["@language"],i),s(e,u["@language"],"@none"),s(e,u["@type"],"@none"))}}for(const e in r)o(r,e,1);return t},clone:function(){const e={};return e.mappings=n.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=n.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"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===m.size&&m.clear(),m.set(t,i),i;function o(e,t,r){const n=e[t],i=e[t]={};let s,a;for(const e of n)s=e.iri,a=r>=s.length?"":s[r],a in i?i[a].push(e):i[a]=[e];for(const e in i)""!==e&&o(i,e,r+1)}function s(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},v.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(l(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&r in e||"@direction"===r&&r in e?e[r]:"@context"!==r?null:void 0},v.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,v.isKeyword=e=>{if(!a(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}},2872:(e,t,r)=>{"use strict";const{parseLinkHeader:n,buildHeaders:i}=r(4768),{LINK_HEADER_CONTEXT:o}=r(2445),s=r(9699),a=r(3114),{prependBase:l}=r(3866),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:r}={headers:{}})=>(t=i(t),(new a).wrapLoader((async function i(a){if(0!==a.indexOf("http:")&&0!==a.indexOf("https:"))throw new s('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 s('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 u;try{u=await function(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()}))}(r,a,t)}catch(e){throw new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e})}if(u.status>=400)throw new s("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});let h={contextUrl:null,documentUrl:a,document:u.response},d=null;const p=u.getResponseHeader("Content-Type");let f;if(c.test(u.getAllResponseHeaders())&&(f=u.getResponseHeader("Link")),f&&"application/ld+json"!==p){const e=n(f),t=e[o];if(Array.isArray(t))throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});t&&(h.contextUrl=t.target),d=e.alternate,d&&"application/ld+json"==d.type&&!(p||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(l(a,d.target)))}return h})))},5746:(e,t,r)=>{"use strict";var n=r(292);const i=r(9699),{isArray:o}=r(8285),{asArray:s}=r(4768),a={};function l({event:e,handlers:t}){let r=!0;for(let n=0;r&&n<t.length;++n){r=!1;const s=t[n];if(o(s))r=l({event:e,handlers:s});else if("function"==typeof s)s({event:e,next:()=>{r=!0}});else{if("object"!=typeof s)throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in s?s[e.code]({event:e,next:()=>{r=!0}}):r=!0}}return r}e.exports=a,a.defaultEventHandler=null,a.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?a.safeEventHandler:[],e.eventHandler?s(e.eventHandler):[],a.defaultEventHandler?a.defaultEventHandler:[]);return 0===t.length?null:t},a.handleEvent=({event:e,options:t})=>{l({event:e,handlers:t.eventHandler})};const c=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"]);a.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&c.has(e.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},a.logEventHandler=function({event:e,next:t}){n.log(`EVENT: ${e.message}`,{event:e}),t()},a.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&n.warn(`WARNING: ${e.message}`,{event:e}),t()},a.unhandledEventHandler=function({event:e}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:e})},a.setDefaultEventHandler=function({eventHandler:e}={}){a.defaultEventHandler=e?s(e):null}},570:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isEmptyObject:s,isString:a,isUndefined:l}=r(8285),{isList:c,isValue:u,isGraph:h,isSubject:d}=r(478),{expandIri:p,getContextValue:f,isKeyword:g,process:y,processingMode:m}=r(2182),{isAbsolute:v}=r(3866),{REGEX_BCP47:b,REGEX_KEYWORD:w,addValue:x,asArray:_,getValues:T,validateTypeValue:N}=r(4768),{handleEvent:j}=r(5746),E={};async function O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:h,expandedParent:w,options:T={},insideList:S,typeKey:k,typeScopedContext:R}){const C=Object.keys(h).sort(),D=[];let L;const P=h[k]&&"@json"===p(e,i(h[k])?h[k][0]:h[k],{vocab:!0},{...T,typeExpansion:!0});for(const O of C){let S,k=h[O];if("@context"===O)continue;const C=p(e,O,{vocab:!0},T);if(null===C||!v(C)&&!g(C)){T.eventHandler&&j({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:O,expandedProperty:C}},options:T});continue}if(g(C)){if("@reverse"===r)throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:k});if(C in w&&"@included"!==C&&"@type"!==C)throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!a(k)){if(!T.isFrame)throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:k});if(o(k)){if(!s(k))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:k})}else{if(!i(k))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:k});if(!k.every((e=>a(e))))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:k})}}x(w,"@id",_(k).map((t=>{if(a(t)){const r=p(e,t,{base:!0},T);return T.eventHandler&&(null===r?j(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:T}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:T}):v(r)||j({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:r}},options:T})),r}return t})),{propertyIsArray:T.isFrame});continue}if("@type"===C){o(k)&&(k=Object.fromEntries(Object.entries(k).map((([e,t])=>[p(R,e,{vocab:!0}),_(t).map((e=>p(R,e,{base:!0,vocab:!0},{...T,typeExpansion:!0})))])))),N(k,T.isFrame),x(w,"@type",_(k).map((e=>{if(a(e)){const t=p(R,e,{base:!0,vocab:!0},{...T,typeExpansion:!0});return v(t)||T.eventHandler&&j({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:T}),t}return e})),{propertyIsArray:T.isFrame});continue}if("@included"===C&&m(e,1.1)){const r=_(await E.expand({activeCtx:e,activeProperty:t,element:k,options:T}));if(!r.every((e=>d(e))))throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:k});x(w,"@included",r,{propertyIsArray:!0});continue}if("@graph"===C&&!o(k)&&!i(k))throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:k});if("@value"===C){L=k,P&&m(e,1.1)?w["@value"]=k:x(w,"@value",k,{propertyIsArray:T.isFrame});continue}if("@language"===C){if(null===k)continue;if(!a(k)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:k});k=_(k).map((e=>a(e)?e.toLowerCase():e));for(const e of k)a(e)&&!e.match(b)&&T.eventHandler&&j({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:T});x(w,"@language",k,{propertyIsArray:T.isFrame});continue}if("@direction"===C){if(!a(k)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:k});k=_(k);for(const e of k)if(a(e)&&"ltr"!==e&&"rtl"!==e)throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:k});x(w,"@direction",k,{propertyIsArray:T.isFrame});continue}if("@index"===C){if(!a(k))throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:k});x(w,"@index",k);continue}if("@reverse"===C){if(!o(k))throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:k});if(S=await E.expand({activeCtx:e,activeProperty:"@reverse",element:k,options:T}),"@reverse"in S)for(const e in S["@reverse"])x(w,e,S["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in S){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),x(t,e,[],{propertyIsArray:!0});const r=S[e];for(let i=0;i<r.length;++i){const o=r[i];if(u(o)||c(o))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:S});x(t,e,o,{propertyIsArray:!0})}}continue}if("@nest"===C){D.push(O);continue}let M=e;const F=f(e,O,"@context");l(F)||(M=await y({activeCtx:e,localCtx:F,propagate:!0,overrideProtected:!0,options:T}));const U=f(M,O,"@container")||[];if(U.includes("@language")&&o(k))S=I(M,k,f(M,O,"@direction"),T);else if(U.includes("@index")&&o(k)){const t=U.includes("@graph"),r=f(M,O,"@index")||"@index",n="@index"!==r&&p(e,r,{vocab:!0},T);S=await A({activeCtx:M,options:T,activeProperty:O,value:k,asGraph:t,indexKey:r,propertyIndex:n})}else if(U.includes("@id")&&o(k)){const e=U.includes("@graph");S=await A({activeCtx:M,options:T,activeProperty:O,value:k,asGraph:e,indexKey:"@id"})}else if(U.includes("@type")&&o(k))S=await A({activeCtx:M.revertToPreviousContext(),options:T,activeProperty:O,value:k,asGraph:!1,indexKey:"@type"});else{const n="@list"===C;if(n||"@set"===C){let e=t;n&&"@graph"===r&&(e=null),S=await E.expand({activeCtx:M,activeProperty:e,element:k,options:T,insideList:n})}else S="@json"===f(e,O,"@type")?{"@type":"@json","@value":k}:await E.expand({activeCtx:M,activeProperty:O,element:k,options:T,insideList:!1})}if(null!==S||"@value"===C)if("@list"!==C&&!c(S)&&U.includes("@list")&&(S={"@list":_(S)}),U.includes("@graph")&&!U.some((e=>"@id"===e||"@index"===e))&&(S=_(S).map((e=>({"@graph":_(e)})))),M.mappings.has(O)&&M.mappings.get(O).reverse){const e=w["@reverse"]=w["@reverse"]||{};S=_(S);for(let t=0;t<S.length;++t){const r=S[t];if(u(r)||c(r))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:S});x(e,C,r,{propertyIsArray:!0})}}else x(w,C,S,{propertyIsArray:!0})}if("@value"in w)if("@json"===w["@type"]&&m(e,1.1));else if((o(L)||i(L))&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:L});for(const s of D){const a=i(h[s])?h[s]:[h[s]];for(const i of a){if(!o(i)||Object.keys(i).some((t=>"@value"===p(e,t,{vocab:!0},T))))throw new n("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:i,expandedParent:w,options:T,insideList:S,typeScopedContext:R,typeKey:k})}}}function S({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=p(e,t,{vocab:!0},n);if("@id"===i)return p(e,r,{base:!0},n);if("@type"===i)return p(e,r,{vocab:!0,base:!0},{...n,typeExpansion:!0});const o=f(e,t,"@type");if(("@id"===o||"@graph"===i)&&a(r)){const i=p(e,r,{base:!0},n);return null===i&&r.match(w)&&n.eventHandler&&j({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:n}),{"@id":i}}if("@vocab"===o&&a(r))return{"@id":p(e,r,{vocab:!0,base:!0},n)};if(g(i))return r;const s={};if(o&&!["@id","@vocab","@none"].includes(o))s["@type"]=o;else if(a(r)){const r=f(e,t,"@language");null!==r&&(s["@language"]=r);const n=f(e,t,"@direction");null!==n&&(s["@direction"]=n)}return["boolean","number","string"].includes(typeof r)||(r=r.toString()),s["@value"]=r,s}function I(e,t,r,o){const s=[],l=Object.keys(t).sort();for(const c of l){const l=p(e,c,{vocab:!0},o);let u=t[c];i(u)||(u=[u]);for(const e of u){if(null===e)continue;if(!a(e))throw new n("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==l&&(c.match(b)||o.eventHandler&&j({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:o}),i["@language"]=c.toLowerCase()),r&&(i["@direction"]=r),s.push(i)}}return s}async function A({activeCtx:e,options:t,activeProperty:r,value:o,asGraph:s,indexKey:a,propertyIndex:c}){const d=[],g=Object.keys(o).sort(),m="@type"===a;for(let v of g){if(m){const r=f(e,v,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,propagate:!1,options:t}))}let g,b=o[v];i(b)||(b=[b]),b=await E.expand({activeCtx:e,activeProperty:r,element:b,options:t,insideList:!1,insideIndex:!0}),g=c?"@none"===v?"@none":S({activeCtx:e,activeProperty:a,value:v,options:t}):p(e,v,{vocab:!0},t),"@id"===a?v=p(e,v,{base:!0},t):m&&(v=g);for(let e of b){if(s&&!h(e)&&(e={"@graph":[e]}),"@type"===a)"@none"===g||(e["@type"]?e["@type"]=[v].concat(e["@type"]):e["@type"]=[v]);else{if(u(e)&&!["@language","@type","@index"].includes(a))throw new n(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${a}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==g&&x(e,c,g,{propertyIsArray:!0,prependValue:!0}):"@none"===g||a in e||(e[a]=v)}d.push(e)}}return d}e.exports=E,E.expand=async({activeCtx:e,activeProperty:t=null,element:r,options:c={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:d=null})=>{if(null==r)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(r)&&!o(r))return u||null!==t&&"@graph"!==p(e,t,{vocab:!0},c)?S({activeCtx:e,activeProperty:t,value:r,options:c}):(c.eventHandler&&j({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:r}},options:c}),null);if(i(r)){let n=[];const o=f(e,t,"@container")||[];u=u||o.includes("@list");for(let o=0;o<r.length;++o){let s=await E.expand({activeCtx:e,activeProperty:t,element:r[o],options:c,insideIndex:h,typeScopedContext:d});u&&i(s)&&(s={"@list":s}),null!==s&&(i(s)?n=n.concat(s):n.push(s))}return n}const g=p(e,t,{vocab:!0},c),b=f(e,t,"@context");d=d||(e.previousContext?e:null);let w=Object.keys(r).sort(),x=!h;if(x&&d&&w.length<=2&&!w.includes("@context"))for(const t of w){const r=p(d,t,{vocab:!0},c);if("@value"===r){x=!1,e=d;break}if("@id"===r&&1===w.length){x=!1;break}}x&&(e=e.revertToPreviousContext()),l(b)||(e=await y({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:c})),"@context"in r&&(e=await y({activeCtx:e,localCtx:r["@context"],options:c})),d=e;let N=null;for(const t of w)if("@type"===p(e,t,{vocab:!0},c)){N=N||t;const n=r[t],i=Array.isArray(n)?n.length>1?n.slice().sort():n:[n];for(const t of i){const r=f(d,t,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,options:c,propagate:!1}))}}let I={};await O({activeCtx:e,activeProperty:t,expandedActiveProperty:g,element:r,expandedParent:I,options:c,insideList:u,typeKey:N,typeScopedContext:d}),w=Object.keys(I);let A=w.length;if("@value"in I){if("@type"in I&&("@language"in I||"@direction"in I))throw new n('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:I});let t=A-1;if("@type"in I&&(t-=1),"@index"in I&&(t-=1),"@language"in I&&(t-=1),"@direction"in I&&(t-=1),0!==t)throw new n('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:I});const r=null===I["@value"]?[]:_(I["@value"]),i=T(I,"@type");if(m(e,1.1)&&i.includes("@json")&&1===i.length);else if(0===r.length)c.eventHandler&&j({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:I}},options:c}),I=null;else{if(!r.every((e=>a(e)||s(e)))&&"@language"in I)throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:I});if(!i.every((e=>v(e)&&!(a(e)&&0===e.indexOf("_:"))||s(e))))throw new n('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:I})}}else if("@type"in I&&!i(I["@type"]))I["@type"]=[I["@type"]];else if("@set"in I||"@list"in I){if(A>1&&(2!==A||!("@index"in I)))throw new n('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:I});"@set"in I&&(I=I["@set"],w=Object.keys(I),A=w.length)}else 1===A&&"@language"in I&&(c.eventHandler&&j({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:I}},options:c}),I=null);if(o(I)&&!c.keepFreeFloatingNodes&&!u&&(null===t||"@graph"===g)&&(0===A||"@value"in I||"@list"in I||1===A&&"@id"in I)){if(c.eventHandler){let e,t;0===A?(e="empty object",t="Dropping empty object."):"@value"in I?(e="object with only @value",t="Dropping object with only @value."):"@list"in I?(e="object with only @list",t="Dropping object with only @list."):1===A&&"@id"in I&&(e="object with only @id",t="Dropping object with only @id."),j({event:{type:["JsonLdEvent"],code:e,level:"warning",message:t,details:{value:I}},options:c})}I=null}return I}},1409:(e,t,r)=>{"use strict";const{isSubjectReference:n}=r(478),{createMergedNodeMap:i}=r(9646),o={};e.exports=o,o.flatten=e=>{const t=i(e),r=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const i=t[o[e]];n(i)||r.push(i)}return r}},1849:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(3866),l=r(9699),{createNodeMap:c,mergeNodeMapGraphs:u}=r(9646),h={};function d(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function p(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function f(e,t,r){const n="@"+r;let i=n in e?e[n][0]:t[r];if("embed"===r)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new l("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 s.asArray(e[0]["@id"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of s.asArray(e[0]["@type"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,r,a){let l=!0,c=!1;for(const u in r){let h=!1;const d=s.getValues(t,u),p=0===s.getValues(r,u).length;if("@id"===u){if(o.isEmptyObject(r["@id"][0]||{})?h=!0:r["@id"].length>=0&&(h=r["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(l=!1,p){if(d.length>0)return!1;h=!0}else if(1===r["@type"].length&&o.isEmptyObject(r["@type"][0]))h=d.length>0;else for(const e of r["@type"])h=!(!o.isObject(e)||!("@default"in e))||h||d.some((t=>t===e));if(!a.requireAll)return h}else{if(n(u))continue;{const t=s.getValues(r,u)[0];let n=!1;if(t&&(g([t]),n="@default"in t),l=!1,0===d.length&&n)continue;if(d.length>0&&p)return!1;if(void 0===t){if(d.length>0)return!1;h=!0}else if(i.isList(t)){const r=t["@list"][0];if(i.isList(d[0])){const t=d[0]["@list"];i.isValue(r)?h=t.some((e=>x(r,e))):(i.isSubject(r)||i.isSubjectReference(r))&&(h=t.some((t=>w(e,r,t,a))))}}else h=i.isValue(t)?d.some((e=>x(t,e))):i.isSubjectReference(t)?d.some((r=>w(e,t,r,a))):!!o.isObject(t)&&d.length>0}}if(!h&&a.requireAll)return!1;c=c||h}return l||c}function m(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,a=n.property,l={"@id":t};if(o.isArray(i)){for(let e=0;e<i.length;++e)if(s.compareValues(i[e],l)){i[e]=l;break}}else{const e=o.isArray(i[a]);s.removeValue(i,a,l,{propertyIsArray:e}),s.addValue(i,a,l,{propertyIsArray:e})}const c=e=>{const t=Object.keys(r);for(const n of t)n in r&&o.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],c(n))};c(t)}function v(e,t){if(o.isArray(e))return e.map((e=>v(e,t)));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=v(e["@list"],t),e;if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)"@id"===r&&t.bnodesToClear.includes(e[r])?delete e["@id"]:e[r]=v(e[r],t)}return e}function b(e,t,r){o.isObject(e)?s.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function w(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&y(e,i,t,n)}function x(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],s=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===s.length&&0===a.length&&0===l.length||!(!s.includes(r)&&!o.isEmptyObject(s[0]))&&!!(!n&&0===a.length||a.includes(n)||n&&o.isEmptyObject(a[0]))&&!!(!i&&0===l.length||l.includes(i)||i&&o.isEmptyObject(l[0]))}e.exports=h,h.frameMergedOrDefault=(e,t,r)=>{const n={options:r,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new s.IdentifierIssuer("_:b");c(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=u(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const o=[];return h.frame(n,Object.keys(n.subjects).sort(),t,o),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter((e=>1===n.bnodeMap[e].length))),r.link={},v(o,r)},h.frame=(e,t,r,a,c=null)=>{g(r),r=r[0];const u=e.options,v={embed:f(r,u,"embed"),explicit:f(r,u,"explicit"),requireAll:f(r,u,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],_=function(e,t,r,n){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,r,n)&&(i[o]=t)}return i}(e,t,r,v),T=Object.keys(_).sort();for(const g of T){const y=_[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===v.embed&&g in w){b(a,c,w[g]);continue}const T={"@id":g};if(0===g.indexOf("_:")&&s.addValue(e.bnodeMap,g,T,{propertyIsArray:!0}),w[g]=T,("@first"===v.embed||"@last"===v.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:r});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==v.embed&&!p(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=v.embed&&"@once"!=v.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===v.embed&&g in e.uniqueEmbeds[e.graph]&&m(e,g),e.uniqueEmbeds[e.graph][g]={parent:a,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,n=null;"@graph"in r?(n=r["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(n)||(n={})):(t="@merged"!==e.graph,n={}),t&&h.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[n],T,"@graph")}"@included"in r&&h.frame({...e,embedded:!1},t,r["@included"],T,"@included");for(const t of Object.keys(y).sort())if(n(t)){if(T[t]=s.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&s.addValue(e.bnodeMap,t,T,{propertyIsArray:!0})}else if(!v.explicit||t in r)for(const n of y[t]){const o=t in r?r[t]:d(v);if(i.isList(n)){const o=r[t]&&r[t][0]&&r[t][0]["@list"]?r[t][0]["@list"]:d(v),a={"@list":[]};b(T,t,a);const l=n["@list"];for(const t of l)i.isSubjectReference(t)?h.frame({...e,embedded:!0},[t["@id"]],o,a,"@list"):b(a,"@list",s.clone(t))}else i.isSubjectReference(n)?h.frame({...e,embedded:!0},[n["@id"]],o,T,t):x(o[0],n)&&b(T,t,s.clone(n))}for(const e of Object.keys(r).sort()){if("@type"===e){if(!o.isObject(r[e][0])||!("@default"in r[e][0]))continue}else if(n(e))continue;const t=r[e][0]||{};if(!f(t,u,"omitDefault")&&!(e in T)){let r="@null";"@default"in t&&(r=s.clone(t["@default"])),o.isArray(r)||(r=[r]),T[e]=[{"@preserve":r}]}}for(const t of Object.keys(r["@reverse"]||{}).sort()){const n=r["@reverse"][t];for(const r of Object.keys(e.subjects))s.getValues(e.subjects[r],t).some((e=>e["@id"]===g))&&(T["@reverse"]=T["@reverse"]||{},s.addValue(T["@reverse"],t,[],{propertyIsArray:!0}),h.frame({...e,embedded:!0},[r],n,T["@reverse"][t],c))}b(a,c,T),e.subjectStack.pop()}else b(a,c,T);else b(a,c,T)}},h.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map((e=>h.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)e[r]=h.cleanupNull(e[r],t)}return e}},1176:(e,t,r)=>{"use strict";const n=r(9699),i=r(478),o=r(8285),{REGEX_BCP47:s,addValue:a}=r(4768),{handleEvent:l}=r(5746),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:p,RDF_JSON_LITERAL:f,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:m,XSD_STRING:v}=r(2445),b={};function w(e,t,r,i){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:i}),a["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=v),c===f){c="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new n("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(c===g)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(o.isNumeric(a["@value"]))if(c===m){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else c===y&&(a["@value"]=parseFloat(a["@value"]));[g,m,y,v].includes(c)||(a["@type"]=c)}else if("i18n-datatype"===r&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:i})),a["@direction"]=t}else c!==v&&(a["@type"]=c)}return a}e.exports=b,b.fromRDF=async(e,t)=>{const r={},n={"@default":r},s={},{useRdfType:l=!1,useNativeTypes:f=!1,rdfDirection:g=null}=t;for(const i of e){const e="DefaultGraph"===i.graph.termType?"@default":i.graph.value;e in n||(n[e]={}),"@default"===e||e in r||(r[e]={"@id":e});const o=n[e],c=i.subject.value,u=i.predicate.value,h=i.object;c in o||(o[c]={"@id":c});const y=o[c],m=h.termType.endsWith("Node");if(m&&!(h.value in o)&&(o[h.value]={"@id":h.value}),u===p&&!l&&m){a(y,"@type",h.value,{propertyIsArray:!0});continue}const v=w(h,f,g,t);if(a(y,u,v,{propertyIsArray:!0}),m)if(h.value===d){const e=o[h.value];"usages"in e||(e.usages=[]),e.usages.push({node:y,property:u,value:v})}else h.value in s?s[h.value]=!1:s[h.value]={node:y,property:u,value:v}}for(const e in n){const t=n[e];if(!(d in t))continue;const r=t[d];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,a=e.value;const l=[],d=[];let p=Object.keys(r).length;for(;n===h&&o.isObject(s[r["@id"]])&&o.isArray(r[u])&&1===r[u].length&&o.isArray(r[h])&&1===r[h].length&&(3===p||4===p&&o.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===c)&&(l.push(r[u][0]),d.push(r["@id"]),e=s[r["@id"]],r=e.node,n=e.property,a=e.value,p=Object.keys(r).length,i.isBlankNode(r)););delete a["@id"],a["@list"]=l.reverse();for(const e of d)delete t[e]}delete r.usages}}const y=[],m=Object.keys(r).sort();for(const e of m){const t=r[e];if(e in n){const r=t["@graph"]=[],o=n[e],s=Object.keys(o).sort();for(const e of s){const t=o[e];i.isSubjectReference(t)||r.push(t)}}i.isSubjectReference(t)||y.push(t)}return y}},478:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.isSubject=e=>!(!n.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>n.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>n.isObject(e)&&"@value"in e,i.isList=e=>n.isObject(e)&&"@list"in e,i.isGraph=e=>n.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>{if(n.isObject(e)){if("@id"in e){const t=e["@id"];return!n.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},730:(e,t,r)=>{const n=r(2948),i=r(1402),o=r(4768),s=r(5777),a=o.IdentifierIssuer,l=r(9699),c=r(3666),u=r(7990),{expand:h}=r(570),{flatten:d}=r(1409),{fromRDF:p}=r(1176),{toRDF:f}=r(2189),{frameMergedOrDefault:g,cleanupNull:y}=r(1849),{isArray:m,isObject:v,isString:b}=r(8285),{isSubjectReference:w}=r(478),{expandIri:x,getInitialContext:_,process:T,processingMode:N}=r(2182),{compact:j,compactIri:E}=r(120),{createNodeMap:O,createMergedNodeMap:S,mergeNodeMaps:I}=r(9646),{logEventHandler:A,logWarningEventHandler:k,safeEventHandler:R,setDefaultEventHandler:C,setupEventHandler:D,strictEventHandler:L,unhandledEventHandler:P}=r(5746),M=function(e){const t={},M=new c({max:100});function F(t,{documentLoader:r=e.documentLoader,...n}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:r},n,t,{eventHandler:D({options:t})})}return e.compact=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===r)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(n=F(n,{base:b(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new a("_:b"),contextResolver:new s({sharedCache:M})})).link&&(n.skipExpansion=!0),n.compactToRelative||delete n.base,i=n.skipExpansion?t:await e.expand(t,n);const c=await e.processContext(_(n),r,n);let u=await j({activeCtx:c,element:i,options:n});n.compactArrays&&!n.graph&&m(u)?1===u.length?u=u[0]:0===u.length&&(u={}):n.graph&&v(u)&&(u=[u]),v(r)&&"@context"in r&&(r=r["@context"]),r=o.clone(r),m(r)||(r=[r]);const h=r;r=[];for(let e=0;e<h.length;++e)(!v(h[e])||Object.keys(h[e]).length>0)&&r.push(h[e]);const d=r.length>0;if(1===r.length&&(r=r[0]),m(u)){const e=E({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=u;u={},d&&(u["@context"]=r),u[e]=t}else if(v(u)&&d){const e=u;u={"@context":r};for(const t in e)u[t]=e[t]}return u},e.expand=async function(t,r){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const n={},i=[];if("expandContext"in(r=F(r,{keepFreeFloatingNodes:!1,contextResolver:new s({sharedCache:M})}))){const e=o.clone(r.expandContext);v(e)&&"@context"in e?n.expandContext=e:n.expandContext={"@context":e},i.push(n.expandContext)}let a;if(b(t)){const o=await e.get(t,r);a=o.documentUrl,n.input=o.document,o.contextUrl&&(n.remoteContext={"@context":o.contextUrl},i.push(n.remoteContext))}else n.input=o.clone(t);"base"in r||(r.base=a||"");let l=_(r);for(const e of i)l=await T({activeCtx:l,localCtx:e,options:r});let c=await h({activeCtx:l,element:n.input,options:r});return v(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),m(c)||(c=[c]),c},e.flatten=async function(t,r,n){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");r="function"==typeof r?null:r||null,n=F(n,{base:b(t)?t:"",contextResolver:new s({sharedCache:M})});const i=await e.expand(t,n),o=d(i);if(null===r)return o;n.graph=!0,n.skipExpansion=!0;const a=await e.compact(o,r,n);return a},e.frame=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(n=F(n,{base:b(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new s({sharedCache:M})}),b(r)){const t=await e.get(r,n);if(r=t.document,t.contextUrl){let e=r["@context"];e?m(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,r["@context"]=e}}const i=r&&r["@context"]||{},o=await e.processContext(_(n),i,n);n.hasOwnProperty("omitGraph")||(n.omitGraph=N(o,1.1)),n.hasOwnProperty("pruneBlankNodeIdentifiers")||(n.pruneBlankNodeIdentifiers=N(o,1.1));const a=await e.expand(t,n),l={...n};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(r,l),u=Object.keys(r).map((e=>x(o,e,{vocab:!0})));l.merged=!u.includes("@graph"),l.is11=N(o,1.1);const h=g(a,c,l);l.graph=!n.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let d=await e.compact(h,i,l);return l.link={},d=y(d,l),d},e.link=async function(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)},e.normalize=e.canonize=async function(t,r){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(r=F(r,{base:b(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new s({sharedCache:M})}))){if("application/n-quads"!==r.inputFormat&&"application/nquads"!==r.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=u.parse(t);return n.canonize(e,r)}const i={...r};delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return n.canonize(o,r)},e.fromRDF=async function(e,r){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");r=F(r,{format:b(e)?"application/n-quads":void 0});const{format:n}=r;let{rdfParser:i}=r;if(n){if(i=i||t[n],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:n})}else i=()=>e;const o=await i(e);return p(o,r)},e.toRDF=async function(t,r){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let n;n=(r=F(r,{base:b(t)?t:"",skipExpansion:!1,contextResolver:new s({sharedCache:M})})).skipExpansion?t:await e.expand(t,r);const i=f(n,r);if(r.format){if("application/n-quads"===r.format||"application/nquads"===r.format)return u.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:r.format})}return i},e.createNodeMap=async function(t,r){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");r=F(r,{base:b(t)?t:"",contextResolver:new s({sharedCache:M})});const n=await e.expand(t,r);return S(n,r)},e.merge=async function(t,r,n){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(t))throw new TypeError('Could not merge, "docs" must be an array.');r="function"==typeof r?null:r||null,n=F(n,{contextResolver:new s({sharedCache:M})});const i=await Promise.all(t.map((t=>{const r={...n};return e.expand(t,r)})));let l=!0;"mergeNodes"in n&&(l=n.mergeNodes);const c=n.issuer||new a("_:b"),u={"@default":{}};for(let e=0;e<i.length;++e){const t=o.relabelBlankNodes(i[e],{issuer:new a("_:b"+e+"-")}),r=l||0===e?u:{"@default":{}};if(O(t,r,"@default",c),r!==u)for(const e in r){const t=r[e];if(!(e in u)){u[e]=t;continue}const n=u[e];for(const e in t)e in n||(n[e]=t[e])}}const h=I(u),d=[],p=Object.keys(h).sort();for(let e=0;e<p.length;++e){const t=h[p[e]];w(t)||d.push(t)}if(null===r)return d;n.graph=!0,n.skipExpansion=!0;const f=await e.compact(d,r,n);return f},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,r){let n;n="function"==typeof r.documentLoader?r.documentLoader:e.documentLoader;const i=await n(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");b(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,r){return r=F(r,{base:"",contextResolver:new s({sharedCache:M})}),null===t?_(r):(t=o.clone(t),v(t)&&"@context"in t||(t={"@context":t}),T({activeCtx:e,localCtx:t,options:r}))},e.getContextValue=r(2182).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",u.parse),e.registerRDFParser("application/nquads",u.parse),e.url=r(3866),e.logEventHandler=A,e.logWarningEventHandler=k,e.safeEventHandler=R,e.setDefaultEventHandler=C,e.strictEventHandler=L,e.unhandledEventHandler=P,e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=r(3114),e.JsonLdProcessor=r(7298)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},F=function(){return M((function(){return F()}))};M(F),e.exports=F},9646:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(9699),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new s.IdentifierIssuer("_:b"),n={"@default":{}};return l.createNodeMap(e,n,"@default",r),l.mergeNodeMaps(n)},l.createNodeMap=(e,t,r,c,u,h)=>{if(o.isArray(e)){for(const n of e)l.createNodeMap(n,t,r,c,void 0,h);return}if(!o.isObject(e))return void(h&&h.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(h&&h.push(e))}if(h&&i.isList(e)){const n=[];return l.createNodeMap(e["@list"],t,r,c,u,n),void h.push({"@list":n})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(u)&&(u=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),h&&h.push({"@id":u});const d=t[r],p=d[u]=d[u]||{};p["@id"]=u;const f=Object.keys(e).sort();for(let o of f){if("@id"===o)continue;if("@reverse"===o){const n={"@id":u},o=e["@reverse"];for(const e in o){const a=o[e];for(const o of a){let a=o["@id"];i.isBlankNode(o)&&(a=c.getId(a)),l.createNodeMap(o,t,r,c,a),s.addValue(d[a],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){u in t||(t[u]={}),l.createNodeMap(e[o],t,u,c);continue}if("@included"===o){l.createNodeMap(e[o],t,r,c);continue}if("@type"!==o&&n(o)){if("@index"===o&&o in p&&(e[o]!==p[o]||e[o]["@id"]!==p[o]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:p});p[o]=e[o];continue}const h=e[o];if(0===o.indexOf("_:")&&(o=c.getId(o)),0!==h.length)for(let e of h)if("@type"===o&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const n=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];s.addValue(p,o,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,r,c,n)}else if(i.isValue(e))s.addValue(p,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const n=[];l.createNodeMap(e["@list"],t,r,c,u,n),e={"@list":n},s.addValue(p,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,r,c,u),s.addValue(p,o,e,{propertyIsArray:!0,allowDuplicate:!1});else s.addValue(p,o,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const i of Object.keys(e[r]).sort()){const o=e[r][i];i in t||(t[i]={"@id":i});const a=t[i];for(const e of Object.keys(o).sort())if(n(e)&&"@type"!==e)a[e]=s.clone(o[e]);else for(const t of o[e])s.addValue(a,e,s.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let o=t[n];o?"@graph"in o||(o["@graph"]=[]):t[n]=o={"@id":n,"@graph":[]};const s=o["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];i.isSubjectReference(t)||s.push(t)}}return t}},1402:(e,t,r)=>{"use strict";const n=r(2872),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=n,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},2189:(e,t,r)=>{"use strict";const{createNodeMap:n}=r(9646),{isKeyword:i}=r(2182),o=r(478),s=r(8981),a=r(8285),l=r(4768),{handleEvent:c}=r(5746),{RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:p,RDF_JSON_LITERAL:f,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:m,XSD_INTEGER:v,XSD_STRING:b}=r(2445),{isAbsolute:w}=r(3866),x={};function _(e,t,r,n,o){const s=Object.keys(t).sort();for(const a of s){const s=t[a],l=Object.keys(s).sort();for(let t of l){const l=s[t];if("@type"===t)t=p;else if(i(t))continue;for(const i of l){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!w(a)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:a}},options:o});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!w(t)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:o});continue}if("BlankNode"===l.termType&&!o.produceGeneralizedRdf){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:n.getOldIds().find((e=>n.getId(e)===t))}},options:o});continue}const u=T(i,n,e,r,o.rdfDirection,o);u&&e.push({subject:s,predicate:l,object:u,graph:r})}}}}function T(e,t,r,n,i,l){const p={};if(o.isValue(e)){p.termType="Literal",p.value=void 0,p.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;if("@json"===r)p.value=s(t),p.datatype.value=f;else if(a.isBoolean(t))p.value=t.toString(),p.datatype.value=r||y;else if(a.isDouble(t)||r===m)a.isDouble(t)||(t=parseFloat(t)),p.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),p.datatype.value=r||m;else if(a.isNumber(t))p.value=t.toFixed(0),p.datatype.value=r||v;else if("i18n-datatype"===i&&"@direction"in e){const r="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;p.datatype.value=r,p.value=t}else"@language"in e?(p.value=t,p.datatype.value=r||g,p.language=e["@language"]):(p.value=t,p.datatype.value=r||b)}else if(o.isList(e)){const o=function(e,t,r,n,i,o){const s={termType:"NamedNode",value:u},a={termType:"NamedNode",value:h},l={termType:"NamedNode",value:d},c=e.pop(),p=c?{termType:"BlankNode",value:t.getId()}:l;let f=p;for(const l of e){const e=T(l,t,r,n,i,o),c={termType:"BlankNode",value:t.getId()};r.push({subject:f,predicate:s,object:e,graph:n}),r.push({subject:f,predicate:a,object:c,graph:n}),f=c}if(c){const e=T(c,t,r,n,i,o);r.push({subject:f,predicate:s,object:e,graph:n}),r.push({subject:f,predicate:a,object:l,graph:n})}return p}(e["@list"],t,r,n,i,l);p.termType=o.termType,p.value=o.value}else{const t=a.isObject(e)?e["@id"]:e;p.termType=t.startsWith("_:")?"BlankNode":"NamedNode",p.value=t}return"NamedNode"!==p.termType||w(p.value)?p:(l.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:p.value}},options:l}),null)}e.exports=x,x.toRDF=(e,t)=>{const r=new l.IdentifierIssuer("_:b"),i={"@default":{}};n(e,i,"@default",r);const o=[],s=Object.keys(i).sort();for(const e of s){let n;if("@default"===e)n={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}n=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},n.value=e}_(o,i[e],n,r,t)}return o}},8285:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},3866:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const r={},n=i.parsers[t||"full"],o=n.regex.exec(e);let s=n.keys.length;for(;s--;)r[n.keys[s]]=void 0===o[s]?null:o[s];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=i.removeDotSegments(r.path),r},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));const r=i.parse(t),o={protocol:e.protocol||""};if(null!==r.authority)o.authority=r.authority,o.path=r.path,o.query=r.query;else if(o.authority=e.authority,""===r.path)o.path=e.path,null!==r.query?o.query=r.query:o.query=e.query;else{if(0===r.path.indexOf("/"))o.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,o.path=t}o.query=r.query}""!==r.path&&(o.path=i.removeDotSegments(o.path));let s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==r.fragment&&(s+="#"+r.fragment),""===s&&(s="./"),s},i.removeBase=(e,t)=>{if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const o=i.parse(t.substr(r.length)),s=e.normalizedPath.split("/"),a=o.normalizedPath.split("/"),l=o.fragment||o.query?0:1;for(;s.length>0&&a.length>l&&s[0]===a[0];)s.shift(),a.shift();let c="";if(s.length>0){s.pop();for(let e=0;e<s.length;++e)c+="../"}return c+=a.join("/"),null!==o.query&&(c+="?"+o.query),null!==o.fragment&&(c+="#"+o.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>n.isString(e)&&o.test(e),i.isRelative=e=>n.isString(e)},4768:(e,t,r)=>{"use strict";const n=r(478),i=r(8285),o=r(2948).IdentifierIssuer,s=r(9699),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u="application/ld+json, application/json",h={};function d(e,t){if(i.isArray(t))for(let r=0;r<t.length;++r)t[r]=d(e,t[r]);else if(n.isList(t))t["@list"]=d(e,t["@list"]);else if(i.isObject(t)){n.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const r=Object.keys(t).sort();for(let n=0;n<r.length;++n){const i=r[n];"@id"!==i&&(t[i]=d(e,t[i]))}}return t}e.exports=h,h.IdentifierIssuer=o,h.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,h.REGEX_KEYWORD=/^@[a-zA-Z]+$/,h.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=h.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,h.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(h.clone(r))}else if(i.isObject(e)){t={};for(const r in e)t[r]=h.clone(e[r])}else t=e.toString();return t}return e},h.asArray=function(e){return Array.isArray(e)?e:[e]},h.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+u+'" is supported.');return Object.assign({Accept:u},e)},h.parseLinkHeader=e=>{const t={},r=e.match(a);for(let e=0;e<r.length;++e){let n=r[e].match(l);if(!n)continue;const i={target:n[1]},o=n[2];for(;n=c.exec(o);)i[n[1]]=void 0===n[2]?n[3]:n[2];const s=i.rel||"";Array.isArray(t[s])?t[s].push(i):t.hasOwnProperty(s)?t[s]=[t[s],i]:t[s]=i}return t},h.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every((e=>i.isString(e))))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&h.asArray(e["@default"]).every((e=>i.isString(e))))return}throw new s('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})}},h.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const r=e[t];return!i.isArray(r)||r.length>0}return!1},h.hasValue=(e,t,r)=>{if(h.hasProperty(e,t)){let o=e[t];const s=n.isList(o);if(i.isArray(o)||s){s&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(h.compareValues(r,o[e]))return!0}else if(!i.isArray(r))return h.compareValues(r,o)}return!1},h.addValue=(e,t,r,n)=>{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),"prependValue"in n||(n.prependValue=!1),n.valueIsArray)e[t]=r;else if(i.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),n.prependValue&&(r=r.concat(e[t]),e[t]=[]);for(let i=0;i<r.length;++i)h.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const o=!n.allowDuplicate&&h.hasValue(e,t,r);i.isArray(e[t])||o&&!n.propertyIsArray||(e[t]=[e[t]]),o||(n.prependValue?e[t].unshift(r):e[t].push(r))}else e[t]=n.propertyIsArray?[r]:r},h.getValues=(e,t)=>[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=h.getValues(e,t).filter((e=>!h.compareValues(e,r)));0===i.length?h.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},h.relabelBlankNodes=(e,t)=>d((t=t||{}).issuer||new o("_:b"),e),h.compareValues=(e,t)=>e===t||!(!n.isValue(e)||!n.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],h.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},3666:(e,t,r)=>{"use strict";const n=r(1123),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),h=Symbol("lruList"),d=Symbol("cache"),p=Symbol("updateAgeOnGet"),f=()=>1,g=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(y(e,t)){if(v(e,n),!e[a])return}else r&&(e[p]&&(n.value.now=Date.now()),e[h].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},m=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const r=t.prev;v(e,t),t=r}},v=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[h].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;y(e,i)&&(v(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=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[i]=e.max||1/0;const t=e.length||f;if(this[s]="function"!=typeof t?f:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[p]=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[i]=e||1/0,m(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,m(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=f),e!==this[s]&&(this[s]=e,this[o]=0,this[h].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),m(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let r=this[h].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[h].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[h].toArray().map((e=>e.key))}values(){return this[h].toArray().map((e=>e.value))}reset(){this[c]&&this[h]&&this[h].length&&this[h].forEach((e=>this[c](e.key,e.value))),this[d]=new Map,this[h]=new n,this[o]=0}dump(){return this[h].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[h]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[d].has(e)){if(a>this[i])return v(this,this[d].get(e)),!1;const s=this[d].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),m(this),!0}const p=new b(e,t,a,n,r);return p.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=p.length,this[h].unshift(p),this[d].set(e,this[h].head),m(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[h].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach(((e,t)=>g(this,t,!1)))}}},8720:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},7402:(e,t,r)=>{"use strict";var n=r(9170),i=r(2550),o=r(8720),s=r(5280),a=r(9129),l=i(s(),Object);n(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},5280:(e,t,r)=>{"use strict";var n=r(8720);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9129:(e,t,r)=>{"use strict";var n=r(5280),i=r(9170);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8383:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(4418),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{h(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=s(e),a=t&&"[object String]"===o.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var f=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var g=0;g<e.length;++g)d.push(String(g));if(n&&e.length>0)for(var y=0;y<e.length;++y)d.push(String(y));else for(var m in e)f&&"prototype"===m||!i.call(e,m)||d.push(String(m));if(l)for(var v=function(e){if("undefined"==typeof window||!p)return h(e);try{return h(e)}catch(e){return!1}}(e),b=0;b<u.length;++b)v&&"constructor"===u[b]||!i.call(e,u[b])||d.push(u[b]);return d}}e.exports=n},806:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(4418),o=Object.keys,s=o?function(e){return o(e)}:r(8383),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},4418:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},2530:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],c=!1,u=-1;function h(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function f(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new p(e,t)),1!==l.length||c||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=f,n.addListener=f,n.once=f,n.off=f,n.removeListener=f,n.removeAllListeners=f,n.emit=f,n.prependListener=f,n.prependOnceListener=f,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5929:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},2948:(e,t,r)=>{e.exports=r(2874)},577:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:t,_existing:r,counter:n}=this;return new e(t,new Map(r),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},4071:(e,t,r)=>{"use strict";r(4828);const n=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!n||!n.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await n.subtle.digest(this.algorithm,e));let r="";for(let e=0;e<t.length;++e)r+=t[e].toString(16).padStart(2,"0");return r}}},6327:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",r="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",o="Literal",s="DefaultGraph",a={};a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^[ \\t]*$"),a.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class e{static parse(e){const l=[],u={},h=e.split(a.eoln);let d=0;for(const e of h){if(d++,a.empty.test(e))continue;const h=e.match(a.quad);if(null===h)throw new Error("N-Quads parse error on line "+d+".");const g={subject:null,predicate:null,object:null,graph:null};if(void 0!==h[1]?g.subject={termType:n,value:h[1]}:g.subject={termType:i,value:h[2]},g.predicate={termType:n,value:h[3]},void 0!==h[4]?g.object={termType:n,value:h[4]}:void 0!==h[5]?g.object={termType:i,value:h[5]}:(g.object={termType:o,value:void 0,datatype:{termType:n}},void 0!==h[7]?g.object.datatype.value=h[7]:void 0!==h[8]?(g.object.datatype.value=t,g.object.language=h[8]):g.object.datatype.value=r,g.object.value=h[6].replace(c,(function(e,t,r,n){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(r)return String.fromCharCode(parseInt(r,16));if(n)throw new Error("Unsupported U escape")}))),void 0!==h[9]?g.graph={termType:n,value:h[9]}:void 0!==h[10]?g.graph={termType:i,value:h[10]}:g.graph={termType:s,value:""},g.graph.value in u){let e=!0;const t=u[g.graph.value];for(const r of t)if(f=g,(p=r).subject.termType===f.subject.termType&&p.object.termType===f.object.termType&&p.subject.value===f.subject.value&&p.predicate.value===f.predicate.value&&p.object.value===f.object.value&&(p.object.termType!==o||p.object.datatype.termType===f.object.datatype.termType&&p.object.language===f.object.language&&p.object.datatype.value===f.object.datatype.value)){e=!1;break}e&&(t.push(g),l.push(g))}else u[g.graph.value]=[g],l.push(g)}var p,f;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuadComponents(e,o,s,a){let c="";return e.termType===n?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${o.value}> `,s.termType===n?c+=`<${s.value}>`:s.termType===i?c+=s.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===t?s.language&&(c+=`@${s.language}`):s.datatype.value!==r&&(c+=`^^<${s.datatype.value}>`)),a.termType===n?c+=` <${a.value}>`:a.termType===i&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const a=[],l={"blank node":i,IRI:n,literal:o};for(const c in e)e[c].forEach((e=>{const u={};for(const i in e){const s=e[i],a={termType:l[s.type],value:s.value};a.termType===o&&(a.datatype={termType:n},"datatype"in s&&(a.datatype.value=s.datatype),"language"in s?("datatype"in s||(a.datatype.value=t),a.language=s.language):"datatype"in s||(a.datatype.value=r)),u[i]=a}u.graph="@default"===c?{termType:s,value:""}:{termType:c.startsWith("_:")?i:n,value:c},a.push(u)}));return a}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},83:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,r=e.slice();let n=null,i=0;const o=e.length;for(let r=0;r<o;++r){const s=e[r],a=t.get(s);(null===n||s>n)&&(a&&r>0&&s>e[r-1]||!a&&r<o-1&&s>e[r+1])&&(n=s,i=r)}if(null===n)this.done=!0;else{const r=t.get(n)?i-1:i+1;e[i]=e[r],e[r]=n;for(const r of e)r>n&&t.set(r,!t.get(r))}return r}}},4515:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];let i=0;for(const e of r)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),l=[];for(const e of o){const r=t.get(e);if(r.length>1){l.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of l){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=await this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=await i.digest(),r.hash}async hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}async hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=await this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));let l=0;for(;a.hasNext();){const e=a.next();++l%3==0&&await this._yield();let n=t.clone(),i="";const o=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){c=!0;break}if(!c){for(const e of o){const t=await this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){c=!0;break}}c||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:await n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=await this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=await this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},2160:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];for(const e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const e of i){const r=t.get(e);if(r.length>1){o.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of o){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=i.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));for(;a.hasNext();){const e=a.next();let n=t.clone(),i="";const o=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){l=!0;break}if(!l){for(const e of o){const t=this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){l=!0;break}}l||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:r});return r}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},3663:(e,t,r)=>{"use strict";const n=r(4071),i=r(4515);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n){let n,s;if("BlankNode"===o.subject.termType&&o.subject.value!==e)s=o.subject.value,n="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;s=o.object.value,n="r"}++i%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(s,o,t,n),l=r.get(a);l?l.push(s):r.set(a,[s])}return r}}},5393:(e,t,r)=>{"use strict";const n=r(4071),i=r(2160);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n){let n,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,n="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,n="r"}const s=this.hashRelatedBlankNode(o,i,t,n),a=r.get(s);a?a.push(o):r.set(s,[o])}return r}}},2874:(e,t,r)=>{"use strict";const n=r(4515),i=r(3663),o=r(2160),s=r(5393);let a;try{a=r(7670)}catch(e){}t.NQuads=r(6327),t.IdentifierIssuer=r(577),t._rdfCanonizeNative=function(e){return e&&(a=e),a},t.canonize=async function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,n)=>a.canonize(e,r,((e,r)=>e?n(e):t(r)))))}if("URDNA2015"===r.algorithm)return new n(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)},t._canonizeSync=function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(e,r)}if("URDNA2015"===r.algorithm)return new o(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new s(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)}},4828:function(e,t,r){var n=r(2530);!function(e,t){"use strict";if(!e.setImmediate){var r,i,o,s,a,l=1,c={},u=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){n.nextTick((function(){f(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&f(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){f(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){f(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(f,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[l]=i,r(l),l++},d.clearImmediate=p}function p(e){delete c[e]}function f(e){if(u)setTimeout(f,0,e);else{var t=c[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{p(e),u=!1}}}}}("undefined"==typeof self?void 0===r.g?this:r.g:self)},9523:e=>{const t={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/"};e.exports=function(e={namedNode:e=>e}){const r={};for(const n in t){const i=t[n];r[n]=function(t=""){return e.namedNode(i+t)}}return r}},9397:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},4489:(e,t,r)=>{"use strict";var n=r(7092),i=r(7427),o=r(4010),s=r(2527);function a(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(l)var f=a(BigInt.prototype.valueOf);if(c)var g=a(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===u(e)}function v(e){return"[object Set]"===u(e)}function b(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function T(e){return"[object DataView]"===u(e)}function N(e){return"undefined"!=typeof DataView&&(T.working?T(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||N(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=N;var j="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function E(e){return"[object SharedArrayBuffer]"===u(e)}function O(e){return void 0!==j&&(void 0===E.working&&(E.working=E(new j)),E.working?E(e):e instanceof j)}function S(e){return y(e,h)}function I(e){return y(e,d)}function A(e){return y(e,p)}function k(e){return l&&y(e,f)}function R(e){return c&&y(e,g)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=S,t.isStringObject=I,t.isBooleanObject=A,t.isBigIntObject=k,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return S(e)||I(e)||A(e)||k(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},5663:(e,t,r)=>{var n=r(2530),i=r(292),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},s=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(s,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r<i;a=n[++r])v(a)||!T(a)?o+=" "+a:o+=" "+u(a);return o},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),o=!0}return e.apply(this,arguments)}};var a={},l=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),l=new RegExp("^"+c+"$","i")}function u(e,r){var n={seen:[],stylize:d};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),m(r)?n.showHidden=r:r&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),p(n,e,n.depth)}function h(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function d(e,t){return e}function p(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=p(e,i,n)),i}var o=function(e,t){if(x(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):m(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),j(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return f(r);if(0===s.length){if(E(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(N(r))return e.stylize(Date.prototype.toString.call(r),"date");if(j(r))return f(r)}var c,u="",h=!1,d=["{","}"];return y(r)&&(h=!0,d=["[","]"]),E(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(u=" "+RegExp.prototype.toString.call(r)),N(r)&&(u=" "+Date.prototype.toUTCString.call(r)),j(r)&&(u=" "+f(r)),0!==s.length||h&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=h?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)k(t,String(s))?o.push(g(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(g(e,t,r,n,i,!0))})),o}(e,r,n,a,s):s.map((function(t){return g(e,r,n,a,t,h)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,d)):d[0]+u+d[1]}function f(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(l.value)<0?(a=v(r)?p(e,l.value,null):p(e,l.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),x(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function y(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function x(e){return void 0===e}function _(e){return T(e)&&"[object RegExp]"===O(e)}function T(e){return"object"==typeof e&&null!==e}function N(e){return T(e)&&"[object Date]"===O(e)}function j(e){return T(e)&&("[object Error]"===O(e)||e instanceof Error)}function E(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(l.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);i.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(4489),t.isArray=y,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=x,t.isRegExp=_,t.types.isRegExp=_,t.isObject=T,t.isDate=N,t.types.isDate=N,t.isError=j,t.types.isNativeError=j,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(9397);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){i.log("%s - %s",A(),t.format.apply(t,arguments))},t.inherits=r(8575),t._extend=function(e,t){if(!t||!T(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=R,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(s.bind(null,null,e))}),(function(e){n.nextTick(C.bind(null,e,s))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},4010:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=r(3828),a=o("Object.prototype.toString"),l=r(4111)(),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("String.prototype.slice"),d={},p=Object.getPrototypeOf;l&&s&&p&&n(u,(function(e){if("function"==typeof c[e]){var t=new c[e];if(Symbol.toStringTag in t){var r=p(t),n=s(r,Symbol.toStringTag);if(!n){var i=p(r);n=s(i,Symbol.toStringTag)}d[e]=n.get}}}));var f=r(2527);e.exports=function(e){return!!f(e)&&(l&&Symbol.toStringTag in e?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):h(a(e),8,-1))}},7876:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},1123:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),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 r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.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++}},n.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++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.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}},n.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}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var s=[];for(n=0;o&&n<t;n++)s.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<r.length;n++)o=i(this,o,r[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(7876)(n)}catch(e){}},870:t=>{"use strict";t.exports=e},7670:()=>{},4343:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},240:(e,t,r)=>{"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{Z:()=>n})}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{BlankNode:()=>a,Collection:()=>p,ConnectedStore:()=>ir,DataFactory:()=>Ut,Empty:()=>f,Fetcher:()=>Ct,Formula:()=>$,IndexedFormula:()=>ee,Literal:()=>h,LiveStore:()=>or,N3Parser:()=>_e,NamedNode:()=>l.Z,Namespace:()=>S,NextId:()=>nr,Node:()=>z,Query:()=>J,RDFParser:()=>dt,RDFaProcessor:()=>ut,SPARQLToQuery:()=>Pt,Serializer:()=>D,Statement:()=>w,Store:()=>ee,UpdateManager:()=>Mt,UpdatesSocket:()=>Bt,UpdatesVia:()=>qt,Util:()=>I,Variable:()=>_,blankNode:()=>Xt,defaultGraph:()=>Wt,fetcher:()=>Zt,fromNT:()=>tr,graph:()=>$t,isBlankNode:()=>c.B2,isCollection:()=>c.uZ,isGraph:()=>c.NA,isLiteral:()=>c.n_,isNamedNode:()=>c.NX,isPredicate:()=>c.lx,isQuad:()=>c.PY,isRDFObject:()=>c.lt,isRDFlibObject:()=>c.Uc,isRDFlibPredicate:()=>c.nq,isRDFlibSubject:()=>c.f,isStatement:()=>c.Yi,isStore:()=>c.Pv,isSubject:()=>c.zz,isTerm:()=>c.jt,isVariable:()=>c.cG,jsonParser:()=>Dt,lit:()=>zt,literal:()=>Qt,log:()=>O.Z,namedNode:()=>Gt,parse:()=>ft,quad:()=>Yt,queryToSPARQL:()=>Lt,serialize:()=>F,sparqlUpdateParser:()=>pt,st:()=>Vt,sym:()=>Gt,term:()=>rr,termValue:()=>mt._,triple:()=>Kt,uri:()=>x,variable:()=>Jt});var e=n(240),t=n(8333),r=n(4806),o=n(9247),s=n(292);class a extends r.Z{static getId(e){if(e){if("string"!=typeof e)throw s.log("Bad blank id:",e),new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){let t=e.split("#");return t[t.length-1]}return e}return"n"+a.nextId++}constructor(r){super(a.getId(r)),(0,e.Z)(this,"termType",o.V1),(0,e.Z)(this,"classOrder",t.Z.BlankNode),(0,e.Z)(this,"isBlank",1),(0,e.Z)(this,"isVar",1)}get id(){return this.value}set id(e){this.value=e}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}copy(e){var t=new a;return e.copyTo(this,t),t}toCanonical(){return a.NTAnonymousNodePrefix+this.value}toString(){return a.NTAnonymousNodePrefix+this.id}}(0,e.Z)(a,"nextId",0),(0,e.Z)(a,"NTAnonymousNodePrefix","_:");var l=n(6545),c=n(5904);const u={boolean:new l.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new l.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new l.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new l.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new l.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new l.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new l.Z("http://www.w3.org/2001/XMLSchema#string")};class h extends r.Z{constructor(r,n,i){super(r),(0,e.Z)(this,"termType",o.xH),(0,e.Z)(this,"classOrder",t.Z.Literal),(0,e.Z)(this,"datatype",u.string),(0,e.Z)(this,"isVar",0),(0,e.Z)(this,"language",""),n?(this.language=n,this.datatype=u.langString):this.datatype=i?l.Z.fromValue(i):u.string}copy(){return new h(this.value,this.lang,this.datatype)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype))}get lang(){return this.language}set lang(e){this.language=e||""}toNT(){return h.toNT(this)}static toNT(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(u.string)||(t+="^^"+e.datatype.toCanonical()),t}toString(){return""+this.value}static fromBoolean(e){return new h(e?"1":"0",null,u.boolean)}static fromDate(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");let t=function(e){return(""+(100+e)).slice(1,3)},r=e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z";return new h(r,null,u.dateTime)}static fromNumber(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");let t;const r=e.toString();return t=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?u.integer:u.decimal:u.double,new h(r,null,t)}static fromValue(e){if((0,c.n_)(e))return e;switch(typeof e){case"object":if(e instanceof Date)return h.fromDate(e);case"boolean":return h.fromBoolean(e);case"number":return h.fromNumber(e);case"string":return new h(e)}throw new Error("Can't make literal from "+e+" of type "+typeof e)}}function d(e){return null==e||(0,c.jt)(e)?e:Array.isArray(e)?new p(e):h.fromValue(e)}class p extends r.Z{constructor(r){super((a.nextId++).toString()),(0,e.Z)(this,"termType",o.fb),(0,e.Z)(this,"classOrder",t.Z.Collection),(0,e.Z)(this,"closed",!1),(0,e.Z)(this,"compareTerm",a.prototype.compareTerm),(0,e.Z)(this,"elements",[]),(0,e.Z)(this,"isVar",0),r&&r.length>0&&r.forEach((e=>{this.elements.push(d(e))}))}get id(){return this.value}set id(e){this.value=e}append(e){return this.elements.push(e)}close(){return this.closed=!0,this.closed}shift(){return this.elements.shift()}substitute(e){const t=this.elements.map((t=>t.substitute(e)));return new p(t)}toNT(){return p.toNT(this)}static toNT(e){return a.NTAnonymousNodePrefix+e.id}toString(){return"("+this.elements.join(" ")+")"}unshift(e){return this.elements.unshift(e)}}(0,e.Z)(p,"termType",o.fb);class f extends r.Z{constructor(){super(""),(0,e.Z)(this,"termType",o.ls)}toString(){return"()"}}const g="chrome:theSession";new l.Z(g);class y extends r.Z{constructor(){super(""),(0,e.Z)(this,"value",""),(0,e.Z)(this,"termType",o.NK),(0,e.Z)(this,"uri",g)}toCanonical(){return this.value}toString(){return"DefaultGraph"}}function m(e){return!!e&&e.termType===o.NK}var v=n(292);const b=new y;class w{constructor(t,n,i,o){(0,e.Z)(this,"subject",void 0),(0,e.Z)(this,"predicate",void 0),(0,e.Z)(this,"object",void 0),(0,e.Z)(this,"graph",void 0),this.subject=r.Z.fromValue(t),this.predicate=r.Z.fromValue(n),this.object=r.Z.fromValue(i),this.graph=null==o?b:r.Z.fromValue(o)}get why(){return this.graph}set why(e){this.graph=e}equals(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}substitute(e){const t=new w(this.subject.substitute(e),this.predicate.substitute(e),this.object.substitute(e),m(this.graph)?this.graph:this.graph.substitute(e));return v.log("@@@ statement substitute:"+t),t}toCanonical(){let e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==o.NK&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}toNT(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}toNQ(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),m(this.graph)?"":this.graph.toNT()].join(" ")+" ."}toString(){return this.toNT()}}var x=n(3357);class _ extends r.Z{constructor(){let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(r),(0,e.Z)(this,"termType",o.UH),(0,e.Z)(this,"base","varid:"),(0,e.Z)(this,"classOrder",t.Z.Variable),(0,e.Z)(this,"isVar",1),(0,e.Z)(this,"uri",void 0),this.base="varid:",this.uri=x.join(r,this.base)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toString()}substitute(e){var t;return null!=(t=e[this.toNT()])?t:this}toString(){return _.toString(this)}static toString(e){return e.uri.slice(0,e.base.length)===e.base?`?${e.uri.slice(e.base.length)}`:`?${e.uri}`}}let T;!function(e){e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE"}(T||(T={}));const N=new y,j={supports:{[T.collections]:!1,[T.defaultGraphType]:!1,[T.equalsMethod]:!0,[T.identity]:!1,[T.id]:!0,[T.reversibleId]:!1,[T.variableType]:!0},blankNode:e=>new a(e),defaultGraph:()=>N,equals(e,t){return e===t||!e||!t||((0,c.PY)(e)||(0,c.PY)(t)?!(!(0,c.PY)(e)||!(0,c.PY)(t))&&this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph):!(!(0,c.jt)(e)||!(0,c.jt)(t))&&this.id(e)===this.id(t))},id(e){if(!e)return"undefined";if((0,c.PY)(e))return this.quadToNQ(e);switch(e.termType){case o.NK:return"defaultGraph";case o.UH:return _.toString(e);default:const t=this.termToNQ(e);if(t)return t;throw new Error(`Can't id term with type '${e.termType}'`)}},isQuad:e=>e instanceof w,literal(e,t){if("string"!=typeof e&&!t)return h.fromValue(e);const r="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new h(r,t):new h(r,null,this.namedNode(t)):new h(r,null,t)},namedNode:e=>new l.Z(e),quad:(e,t,r,n)=>new w(e,t,r,n||N),triple(e,t,r,n){return this.quad(e,t,r,n)},quadToNQ(e){return`${this.termToNQ(e.subject)} ${this.termToNQ(e.predicate)} ${this.termToNQ(e.object)} ${this.termToNQ(e.graph)} .`},termToNQ(e){switch(e.termType){case o.V1:return"_:"+e.value;case o.NK:return"";case o.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case o.xH:return h.toNT(e);case o._A:case o.XM:return"<"+e.value+">";case o.fb:return"("+e.elements.map((e=>this.termToNQ(e))).join(" ")+")";default:throw new Error(`Can't serialize nonstandard term type (was '${e.termType}')`)}},toNQ(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:e=>new _(e)},E=j;var O=n(7308);function S(e,t){const r=t||{namedNode:e=>new l.Z(e)};return function(t){return r.namedNode(e+(t||""))}}var I=n(5115);function A(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:E;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}A(E);var k=n(9523),R=n.n(k),C=n(292);function D(e){return new L(e)}class L{constructor(t){(0,e.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,e.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,e.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,e.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,e.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];const r=Object.keys(R()());for(const e in r){const t=R()()[r[e]](""),n=r[e];this.prefixes[t]=n,this.namespaces[n]=t}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=t,this.rdfFactory=t.rdfFactory||E,this.xsd=A(this.rdfFactory)}setBase(e){return this.base=e,this}setFlags(e){return this.flags=e||"",this}toStr(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}fromStr(e){if("{"===e[0]){var t=this.formulas[e];return t||C.log("No formula object for "+e),t}return this.store.fromNT(e)}setNamespaces(e){for(var t in e)this.setPrefix(t,e[t]);return this}setPrefix(e,t){if("default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t){for(let t in this.prefixes)this.prefixes[t]==e&&delete this.prefixes[t];this.prefixes[t]=e,this.namespaces[e]=t}}suggestPrefix(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}suggestNamespaces(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}checkIntegrity(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}makeUpPrefix(e){var t=e,r=function(t){return!!this.validPrefix.test(t)&&"ns"!==t&&!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var n=t.lastIndexOf("/");n>=0&&(t=t.slice(n+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&r(t))return t;if(r(t.slice(0,3)))return t.slice(0,3);if(r(t.slice(0,2)))return t.slice(0,2);if(r(t.slice(0,4)))return t.slice(0,4);if(r(t.slice(0,1)))return t.slice(0,1);if(r(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var o=0;;o++)if(r(t.slice(0,3)+o))return t.slice(0,3)+o}rootSubjects(e){for(var t={},r={},n={},i=0;i<e.length;i++){var o=e[i],s=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(o.subject)};[o.subject,o.predicate,o.object].map((function(e){"BlankNode"===e.termType?n[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){s(e)}))})),s(e[i].object);var a=r[this.toStr(o.subject)];a||(a=[]),a.push(o),r[this.toStr(o.subject)]=a}var l=[];for(var c in r)if(r.hasOwnProperty(c)){var u=this.fromStr(c);"BlankNode"===u.termType&&t[u]&&1===t[u].length||l.push(u)}this.incoming=t;for(var h={},d=0;d<l.length;d++)h[l[d].toNT()]=!0;return{roots:l,subjects:r,rootsHash:h,incoming:t}}toN3(e){return this.statementsToN3(e.statements)}explicitURI(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?x.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,r="",n=0;n<e.length;n++)r+=(t=e.charCodeAt(n))>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[n];return r}(e):encodeURI(e))+">"}statementsToNTriples(e){var t=e.slice();t.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,s=this.rdfFactory,a=function(e){if("Collection"!==e.termType)return i.atomicTermToN3(e);for(var t=e.elements,l=o.sym(n+"nill"),c=t.length-1;c>=0;c--){var u=s.blankNode();r+=a(u)+" "+a(o.sym(n+"first"))+" "+a(t[c])+".\n",r+=a(u)+" "+a(o.sym(n+"rest"))+" "+a(l)+".\n",l=u}return i.atomicTermToN3(l)},l=0;l<t.length;l++){var c=t[l],u="";u+=a(c.subject)+" ",u+=a(c.predicate)+" ",u+=a(c.object)+" ",this.flags.indexOf("q")>=0&&(u+=a(c.why)+" "),r+=u+=".\n"}return r}statementsToN3(e){var t=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};e.sort((function(e,n){return I.heavyCompareSPO(e,n,t,r)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var n={};this.flags.indexOf("s")<0&&(n["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(n["http://www.w3.org/2000/10/swap/log#implies"]="=>");var i=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},o=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r],i="string"==typeof n?n:o(n);if(0!==r){var s=t.slice(-1)||" ";","===i||";"===i||("."!==i||"0123456789.:".includes(s))&&(t+=" ")}t+=i}return t},s=function(e,t){var r="",n=1e5;void 0===t&&(t=-1);for(var a=0;a<e.length;a++){var l=e[a];if("string"!=typeof l){var c=s(l,t+1);if(c.length<10*(80-4*t)&&c.indexOf('"""')<0){var u=o(l);u.length<80-4*t&&(l=u,c="")}c&&(n=1e4),r+=c}if("string"==typeof l){if(1===l.length&&"\n"===r.slice(-1)&&",.;".indexOf(l)>=0){r=r.slice(0,-1),"."==l&&"0123456789.:".includes(r.charAt(r.length-1))&&(r+=" ",n+=1),r+=l+"\n",n+=1;continue}if(n<4*t+4||n+l.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+l+"\n",n+=l.length+1;else{let e=i(4*t)+l;r+=e+"\n",n=e.length,t<0&&(r+="\n",n=1e5)}}}return r},a=function(e){for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(l(o,t))}return n}.bind(this);function l(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[h(e,t)].concat([c(e,t)]).concat(["."]):u(e,t,!0).concat(["."])}var c=function(e,t){var r=[],i=null,o=t.subjects[this.toStr(e)]||[];if(void 0===o)throw new Error("Cant find statements for "+e);for(var s=[],a=0;a<o.length;a++){var l=o[a];l.predicate.uri===i?s.push(","):(i&&(r=r.concat([s]).concat([";"]),s=[]),r.push(n[l.predicate.uri]?n[l.predicate.uri]:h(l.predicate,t))),i=l.predicate.uri,s.push(u(l.object,t))}return r.concat([s])}.bind(this),u=function(e,t,r){return"BlankNode"!==e.termType||!r&&void 0!==t.rootsHash[e.toNT()]?h(e,t):t.subjects[this.toStr(e)]?["[",c(e,t),"]"]:"[]"}.bind(this);L.prototype.termToN3=h;var h=function(e,t){var r,n;switch(e.termType){case"Graph":return(n=(n=["{"]).concat(a(e.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<e.elements.length;r++)n.push([u(e.elements[r],t)]);return n.push(")"),n;default:return this.atomicTermToN3(e)}}.bind(this),d=function(){var e="";for(var t in this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),p=a(e);return d()+s(p)}atomicTermToN3(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var r=e.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return r;case"http://www.w3.org/2001/XMLSchema#decimal":return r.indexOf(".")<0&&(r+=".0"),r;case"http://www.w3.org/2001/XMLSchema#double":{const e=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!e&&(r+=".0"),e||(r+="e0"),r}case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var n=this.stringToN3(e.value);return e.language?n+="@"+e.language:e.datatype.equals(this.xsd.string)||(n+="^^"+this.atomicTermToN3(e.datatype,t)),n;case"NamedNode":return this.symbolToN3(e);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}stringToN3(e,t){t||(t="e");var r,n,i,o,s,a="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(o='"""',s=this.forbidden3):(o='"',s=this.forbidden1),r=0;r<e.length&&(s.lastIndex=0,null!=s.exec(e.slice(r)));){n=r+s.lastIndex-1,a+=e.slice(r,n);var l=e[n];'"'===l&&'"""'===o&&'"""'!==e.slice(n,n+3)?a+=l:(i='\b\f\r\t\v\n\\"'.indexOf(l))>=0?a+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?a+="\\u"+("000"+l.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=l,r=n+1}return o+a+e.slice(r)+o}symbolToN3(e){var t=e.uri,r=t.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=t.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var n=!0,i=r+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){n=!1;break}if(n){var o=t.slice(r+1),s=t.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var a=this.prefixes[s];if(a||(a=this.makeUpPrefix(s)),a)return this.namespacesUsed[s]=!0,a+":"+o}}return this.explicitURI(t)}writeStore(e){var t=this.store,r=t.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var s=t.fromNT(o);n&&s.equals(n)||e("\n"+this.atomicTermToN3(s)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,s))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){e("\n<"+r.object.value+"> log:metadata {\n");var n=t.statementsMatching(void 0,void 0,void 0,r.subject);e(this.statementsToN3(this.statementsToN3(n))),e("}.\n")}));var a=[];n&&a.push(n);var l=[];a.map((function(e){l=l.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(l))}statementsToXML(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},i=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r];t+="string"==typeof n?n:i(n)}return t},o=function(e,t){var r,s="",a=1e5;t||(t=0);for(var l=0;l<e.length;l++){var c=e[l];if("string"!=typeof c){var u=o(c,t+1);u.length<10*(80-4*t)&&u.indexOf('"""')<0&&(r=i(c)).length<80-4*t&&(c=" "+r,u=""),u&&(a=1e4),s+=u}"string"==typeof c&&(a<4*t+4?(s=s.slice(0,-1)+" "+c+"\n",a+=c.length+1):(s+=(r=n(4*t)+c)+"\n",a=r.length))}return s},s=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function a(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&";case"<":return"<";case'"':return"""}}))}var l=function(e){return a(this.base?x.refTo(this.base,e.uri):e.uri)}.bind(this),c=function(e,t){var n,i,o,s,p=[],f=t.subjects[this.toStr(e)];if(void 0===f)return h(e,t);f.sort((function(e,t){var n=e.predicate.uri,i=t.predicate.uri;if(n.substring(0,r.length)===r||i.substring(0,r.length)===r)return n.localeCompare(i);var o=n.substring(r.length),s=i.substring(r.length),a=parseInt(o,10),l=parseInt(s,10);return isNaN(a)||isNaN(l)||a!==o||l!==s?n.localeCompare(i):a-l}));for(var g=0;g<f.length;g++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=f[g]).predicate.uri||n||"NamedNode"!==o.object.termType){if((s=o.predicate).uri.substr(0,r.length)===r){var y=s.uri.substr(r.length);y===parseInt(y,10).toString()&&(s=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=d(s),o.object.termType){case"BlankNode":p=1===t.incoming[o.object].length?p.concat(["<"+i+' rdf:parseType="Resource">',c(o.object,t),"</"+i+">"]):p.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":p=p.concat(["<"+i+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":p=p.concat(["<"+i+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+i+">"]);break;case"Collection":p=p.concat(["<"+i+' rdf:parseType="Collection">',u(o.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var m=n?d(n):"rdf:Description",v="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(v=' rdf:nodeID="'+e.toNT().slice(2)+'"'):v=' rdf:about="'+l(e)+'"',["<"+m+v+">"].concat([p]).concat(["</"+m+">"])}.bind(this);function u(e,t){for(var r=[],n=0;n<e.elements.length;n++)r.push(c(e.elements[n],t));return r}var h=function(e,t){var r=[],n=t.subjects[this.toStr(e)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"BlankNode":r=t.rootsHash[o.object.toNT()]?r.concat(["<"+d(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+d(o.predicate)+">"]):r.concat(["<"+d(o.predicate)+' rdf:parseType="Resource">',h(o.object,t),"</"+d(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+d(o.predicate)+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+d(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+d(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+d(o.predicate)+' rdf:parseType="Collection">',u(o.object,t),"</"+d(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),d=function(e){var r=e.uri,n=r.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=r.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+r+">");for(var i=n+1;i<r.length;i++)if(this._notNameChars.indexOf(r[i])>=0)throw new Error('Invalid character "'+r[i]+'" cannot be in XML qname for URI: '+r);var o=r.slice(n+1),s=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return o;var a=this.prefixes[s];return a||(a=this.makeUpPrefix(s)),t[s]=!0,a+":"+o}.bind(this),p=s(e),f="<rdf:RDF";for(var g in this.defaultNamespace&&(f+=' xmlns="'+a(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(g)){var y=this.base&&this.flags.includes("z")?x.refTo(this.base,g):g;f+="\n xmlns:"+this.prefixes[g]+'="'+a(y)+'"'}return o([f+=">",p,"</rdf:RDF>"],-1)}}var P=n(730),M=n.n(P);function F(e,t,r,n,i,s){r=r||(null==e?void 0:e.value);const a=s||{};n=n||o.z8;try{var l=D(t);a.flags&&l.setFlags(a.flags);var c=t.statementsMatching(void 0,void 0,void 0,e);switch("namespaces"in t&&l.suggestNamespaces(t.namespaces),a.namespaces&&l.setNamespaces(a.namespaces),l.setBase(r),n){case o.Is:return u(null,l.statementsToXML(c));case o.qS:case o.sZ:return u(null,l.statementsToN3(c));case o.z8:case o.Eo:return l.setFlags("si"),u(null,l.statementsToN3(c));case o.aV:return l.setFlags("deinprstux"),u(null,l.statementsToNTriples(c));case o.ui:return l.setFlags("deinprstux"),function(e){try{return P.fromRDF(e,{format:"application/n-quads"}).then((e=>JSON.stringify(e)))}catch(e){throw e}}(l.statementsToNTriples(c));case o.b4:case o.lL:return l.setFlags("deinprstux q"),u(null,l.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(e){if(i)return i(e,void 0);throw e}function u(e,t){return i?void i(e,t):t}}const U=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],B="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function q(e,t,r){const n=[];return r.reduce(((t,r,i,o)=>{let s;return n.push(e.quad(t,e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(s=e.blankNode(),n.push(e.quad(t,e.namedNode(B),s))):n.push(e.quad(t,e.namedNode(B),e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),s}),t),n}function H(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;var n=e.length;for(r<0&&(r=n+r);r<n;r++)if(e[r]===t)return r;return-1}var Z=n(292);class $ extends r.Z{constructor(){var r;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};super(""),r=this,this.statements=n,this.constraints=i,this.initBindings=s,this.optional=a,(0,e.Z)(this,"termType",o._A),(0,e.Z)(this,"classOrder",t.Z.Graph),(0,e.Z)(this,"fetcher",void 0),(0,e.Z)(this,"isVar",0),(0,e.Z)(this,"ns",S),(0,e.Z)(this,"rdfFactory",void 0),this.rdfFactory=l&&l.rdfFactory||E;for(const e of U)this[e]=function(){return r.rdfFactory[e](...arguments)}}add(e,t,r,n){return 1===arguments.length&&e.forEach((e=>this.add(e.subject,e.predicate,e.object,e.graph))),this.statements.push(this.rdfFactory.quad(e,t,r,n))}addStatement(e){return this.add(e)}bnode(e){return this.rdfFactory.blankNode(e)}addAll(e){e.forEach((e=>{this.add(e.subject,e.predicate,e.object,e.graph)}))}any(e,t,r,n){const i=this.anyStatementMatching(e,t,r,n);return null==i?null:null==e?i.subject:null==t?i.predicate:null==r?i.object:null}anyValue(e,t,r,n){const i=this.any(e,t,r,n);return i?i.value:void 0}anyJS(e,t,n,i){const o=this.any(e,t,n,i);return o?r.Z.toJS(o):void 0}anyStatementMatching(e,t,r,n){let i=this.statementsMatching(e,t,r,n,!0);if(i&&0!==i.length)return i[0]}id(e){return this.rdfFactory.id(e)}statementsMatching(e,t,r,n,i){const o=this.statements.filter((i=>(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))));return i?0===o.length?[]:[o[0]]:o}bottomTypeURIs(e){let t,r,n,i,o,s,a,l;t=[];for(let c in e)if(e.hasOwnProperty(c)){for(l=e[c],a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(c)),r=!0,i=0,o=a.length;i<o;i++)if(n=a[i],s=n.uri,s in e){r=!1;break}r&&(t[c]=l)}return t}collection(){return new p}each(e,t,r,n){const i=[];let o=this.statementsMatching(e,t,r,n,!1);if(null==e)for(let e=0,t=o.length;e<t;e++)i.push(o[e].subject);else if(null==t)for(let e=0,t=o.length;e<t;e++)i.push(o[e].predicate);else if(null==r)for(let e=0,t=o.length;e<t;e++)i.push(o[e].object);else if(null==n)for(let e=0,t=o.length;e<t;e++)i.push(new l.Z(o[e].graph.value));return i}equals(e){return!!e&&this.hashString()===e.hashString()}findMembersNT(e){let t,r,n,i,o,s,a,l,c,u,h,d,p,f;d={},d[e.toNT()]=!0,i={},s=this.transitiveClosure(d,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0);for(let e in s)if(s.hasOwnProperty(e)){a=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(e));for(let e=0,t=a.length;e<t;e++)p=a[e],i[p.subject.toNT()]=p;l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(e));for(let e=0,r=l.length;e<r;e++)for(o=l[e],c=this.statementsMatching(void 0,o),n=0,t=c.length;n<t;n++)p=c[n],i[p.subject.toNT()]=p;u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(e));for(let e=0,t=u.length;e<t;e++)for(o=u[e],h=this.statementsMatching(void 0,o),f=0,r=h.length;f<r;f++)p=h[f],i[p.object.toNT()]=p}return i}findMemberURIs(e){return this.NTtoURI(this.findMembersNT(e))}findSubClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}findSuperClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypesNT(e){let t,r,n,i,o,s,a,l,c;n="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",c=[],i=this.statementsMatching(e,void 0,void 0);for(let e=0,t=i.length;e<t;e++)if(l=i[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===l.predicate.uri)c[l.object.toNT()]=l;else{o=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"));for(let e=0,t=o.length;e<t;e++)r=o[e],c[r.toNT()]=l}s=this.statementsMatching(void 0,void 0,e);for(let e=0,r=s.length;e<r;e++){l=s[e],a=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"));for(let e=0,r=a.length;e<r;e++)t=a[e],c[t.toNT()]=l}return this.transitiveClosure(c,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypeURIs(e){return this.NTtoURI(this.findTypesNT(e))}connectedStatements(e,t,r){r=r||[];let n=[e],i={},o={},s=[],a=this,l=function(e){let l=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,n.push(e))},c=a.statementsMatching(null,null,e,t).concat(a.statementsMatching(e,null,null,t));c=c.filter((function(e){if(r[e.predicate.value])return!1;let t=e.toNT();return!o[t]&&(o[t]=!0,!0)})),c.forEach((function(e){l(e.subject),l(e.object)})),s=s.concat(c)};for(;n.length;)l(n.shift());return s}formula(e){return new $}fromNT(e){let t,r,n;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(n=void 0,t=void 0,r=e.lastIndexOf('"'),r<e.length-1)if("@"===e[r+1])n=e.slice(r+2);else{if("^^"!==e.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(r+3))}return e=(e=(e=(e=e.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,n||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new _(e.slice(1))}throw new Error("Can't convert from NT: "+e)}holds(e,t,r,n){let i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if((0,c.Yi)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}return null!=this.anyStatementMatching(e,t,r,n)}holdsStatement(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}list(e,t){if(t.rdfFactory.supports.COLLECTIONS){const r=t.rdfFactory.collection();return e.forEach((function(e){r.append(e)})),r}{const r=t.rdfFactory.blankNode(),n=q(t.rdfFactory,r,e);return t.addAll(n),r}}NTtoURI(e){let t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],"<"===t[0]&&(n[t.slice(1,-1)]=r));return n}serialize(e,t,r,n){return F(r,this,e,t,void 0,n)}substitute(e){let t=this.statements.map((function(t){return t.substitute(e)}));Z.log("Formula subs statmnts:"+t);const r=new $;return r.addAll(t),Z.log("indexed-form subs formula:"+r),r}sym(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}the(e,t,r,n){let i=this.any(e,t,r,n);return null==i&&O.Z.error("No value found for the() {"+e+" "+t+" "+r+"}."),i}transitiveClosure(e,t,r){let n,i,o,s,a,l,c={};Object.assign(c,e);let u={};for(;;){if(l=function(){for(let e in c)if(c.hasOwnProperty(e))return e}(),null==l)return u;for(a=r?this.each(void 0,t,this.fromNT(l)):this.each(this.fromNT(l),t),i=0,o=a.length;i<o;i++)n=a[i],s=n.toNT(),s in u||s in c||(c[s]=c[l]);u[l]=c[l],delete c[l]}}topTypeURIs(e){let t,r,n,i,o,s,a,l;for(n in a=[],e)if(e.hasOwnProperty(n)){for(l=e[n],o=0,s=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf")),t=0,i=s.length;t<i;t++)if(r=s[t],"http://www.w3.org/2000/01/rdf-schema#Resource"!==r.uri){o++;break}o||(a[n]=l)}return a["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete a["http://www.w3.org/2000/01/rdf-schema#Resource"],a["http://www.w3.org/2002/07/owl#Thing"]&&delete a["http://www.w3.org/2002/07/owl#Thing"],a}toString(){return"{"+this.statements.join("\n")+"}"}variable(e){return new _(e)}whether(e,t,r,n){return this.statementsMatching(e,t,r,n,!1).length}}r.Z.fromValue=d;const z=r.Z,V={xsd:S("http://www.w3.org/2001/XMLSchema#")};r.Z.toJS=function(e){return(0,c.uZ)(e)?e.elements.map(r.Z.toJS):(0,c.n_)(e)?e.datatype.equals(V.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(V.xsd("dateTime"))||e.datatype.equals(V.xsd("date"))?new Date(e.value):e.datatype.equals(V.xsd("integer"))||e.datatype.equals(V.xsd("float"))||e.datatype.equals(V.xsd("decimal"))?Number(e.value):e.value:e};var G=n(292);class J{constructor(e,t){this.pat=new ee,this.vars=[],this.name=e,this.id=t}}function X(e,t,r,n){function i(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r+=" "+t+" -> "+e[t]);return r}function o(e){var t,r="Bindings: ",n=e.length;for(t=0;t<n;t++)r+=i(e[t][0])+";\n\t";return r}function s(e,t,r,n){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var o=function(e,t,r,n){var i=r[e];if(void 0===i){if(e.isVar){var o=[];return o[e]=t,[[o,null]]}i=e}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[t]&&(t=n.redirections[t]),i.equals(t)||i.uri&&i.uri===g?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?s(e,t,r):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],r,n);if(0===o.length)return o;var a,l,c,u,h,d,p,f=[],y=o.length;for(a=0;a<y;a++){for(h in p=[],l=o[a][0])l.hasOwnProperty(h)&&(p[h]=l[h]);for(h in r)r.hasOwnProperty(h)&&(p[h]=r[h]);for(u=(i=s(e.slice(1),t.slice(1),p,n)).length,c=0;c<u;c++){for(h in d=i[c][0],l)l.hasOwnProperty(h)&&(d[h]=l[h]);f.push([d,null])}}return f}function a(e,t){var r,n={};for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function l(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function c(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}l.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;O.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},l.prototype.doCallBacks=function(e,t){var r;if(e<0)return this.originalCallback(t);for(r=0;r<this.branches[e].results.length;r++)this.doCallBacks(e-1,a(t,this.branches[e].results[r]))},c.prototype.reportMatch=function(e){this.callback(e),this.success=!0},c.prototype.reportDone=function(){this.done=!0,O.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var u=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function h(e,t,r){var n,i,o,s,a,l;for(t.nvars=0,t.index=null,n=[t.subject,t.predicate,t.object,t.why],s=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],o=0;o<4;o++){let c=n[o];if(c.uri&&c.uri===g);else if(c.isVar&&void 0===r[c])t.nvars++;else{if(void 0,c=void 0===(l=r[a=n[o]])?a:l,e.redirections[e.id(c)]&&(c=e.redirections[e.id(c)]),!(i=s[o][e.id(c)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function d(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}u.prototype.reportMatch=function(e){this.results.push(e)},u.prototype.reportDone=function(){O.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),O.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var p=function(e,r,n,o,s,a,c){O.Z.debug("Match begins, Branch count now: "+c.count+" for "+c.pattern_debug);var h,d,f=r.statements;if(0===f.length){if(O.Z.debug("FOUND MATCH WITH BINDINGS:"+i(n)),0===r.optional.length)c.reportMatch(n);else{O.Z.debug("OPTIONAL: "+r.optional);var g,m=new l(t,n),v=[];for(g=0;g<r.optional.length;g++)v[g]=new u(m),v[g].pattern_debug=r.optional[g];for(g=0;g<r.optional.length;g++)v[g].count=v[g].count+1,p(e,r.optional[g],n,"",s,t,v[g])}return c.count--,void O.Z.debug("Match ends -- success , Branch count now: "+c.count+" for "+c.pattern_debug)}var b=f.length;if(s){var w=function(t,i){var l=t.uri.split("#")[0];s.nowOrWhenFetched(l,void 0,(function(i,l,u){i||G.log("Error following link to <"+t.uri+"> in query: "+l),p(e,r,n,o,s,a,c)}))};for(d=0;d<b;d++){if(h=f[d],void 0!==n[h.subject]&&n[h.subject].uri&&s&&"unrequested"===s.getState((0,x.docpart)(n[h.subject].uri)))return void w(n[h.subject]);if(void 0!==n[h.object]&&n[h.object].uri&&s&&"unrequested"===s.getState((0,x.docpart)(n[h.object].uri)))return void w(n[h.object])}}y(e,r,n,o,s,a,c)},f=function(e,t){var r,n,i=!0;for(r in e)e.hasOwnProperty(r)&&t[r]&&(n=t[r].test)&&!n(e[r])&&(i=!1);return i},y=function(e,t,r,n,a,l,c){var u,g,y,m,v,b,w,x=t.statements,_=x.length;for(u=0;u<_;u++)h(e,w=x[u],r);x.sort(d),w=x[0];var T,N=e.formula();N.optional=t.optional,N.constraints=t.constraints,N.statements=x.slice(1),O.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var j,E,S=w.index.length,I=0;for(T=0;T<S;T++)for(E=w.index[T],j=s([w.subject,w.predicate,w.object,w.why],[E.subject,E.predicate,E.object,E.why],r,e),O.Z.info(n+" From first: "+j.length+": "+o(j)),y=j.length,g=0;g<y;g++)if(v=[],b=j[g][0],f(b,t.constraints)){for(m in b)b.hasOwnProperty(m)&&(v[m]=b[m]);for(m in r)r.hasOwnProperty(m)&&(v[m]=r[m]);c.count++,I++,p(e,N,v,n+" ",a,l,c)}else O.Z.debug("Branch count CS: "+c.count);c.count--,0===I&&O.Z.debug("Match2 fails completely on "+w),O.Z.debug("Match2 ends, Branch count: "+c.count+" for "+c.pattern_debug),0===c.count&&(O.Z.debug("Branch finished."),c.reportDone())},m=this;O.Z.debug("Query on "+this.statements.length);var v=new c(t,n);v.count++,e.sync?p(m,e.pat,e.pat.initBindings,"",r,t,v):setTimeout((function(){p(m,e.pat,e.pat.initBindings,"",r,t,v)}),0)}const W="http://www.w3.org/2002/07/owl#";function Q(e,t,r,n){var i=e.any(t,r,void 0);return!!i&&(e.equate(i,n),!0)}function Y(e,t,r,n){var i=e.any(void 0,r,n);return!!i&&(e.equate(i,t),!0)}function K(e,t,r,n,i){e.typeCallback&&e.typeCallback(e,n,i);var o=e.classActions[e.id(n)],s=!1;if(o)for(var a=0;a<o.length;a++)s=s||o[a](e,t,r,n,i);return s}class ee extends ${constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(void 0,void 0,void 0,void 0,r),(0,e.Z)(this,"updater",void 0),(0,e.Z)(this,"namespaces",void 0),(0,e.Z)(this,"classActions",void 0),(0,e.Z)(this,"propertyActions",void 0),(0,e.Z)(this,"redirections",void 0),(0,e.Z)(this,"aliases",void 0),(0,e.Z)(this,"HTTPRedirects",void 0),(0,e.Z)(this,"subjectIndex",void 0),(0,e.Z)(this,"predicateIndex",void 0),(0,e.Z)(this,"objectIndex",void 0),(0,e.Z)(this,"whyIndex",void 0),(0,e.Z)(this,"index",void 0),(0,e.Z)(this,"features",void 0),(0,e.Z)(this,"_universalVariables",void 0),(0,e.Z)(this,"_existentialVariables",void 0),(0,e.Z)(this,"rdfArrayRemove",void 0),(0,e.Z)(this,"dataCallbacks",void 0),this.propertyActions={},this.classActions={},this.redirections=[],this.aliases=[],this.HTTPRedirects=[],this.subjectIndex=[],this.predicateIndex=[],this.objectIndex=[],this.whyIndex=[],this.index=[this.subjectIndex,this.predicateIndex,this.objectIndex,this.whyIndex],this.namespaces={},this.features=t||[],this.rdfArrayRemove=r.rdfArrayRemove||I.RDFArrayRemove,r.dataCallback&&(this.dataCallbacks=[r.dataCallback]),this.initPropertyActions(this.features)}static get defaultGraphURI(){return g}substitute(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new ee;return r.add(t),r}addDataCallback(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}applyPatch(e,t,r){var n,i=this,o=null;function s(s){if(e.delete){n=e.delete,o&&(n=n.substitute(o)),n=n.statements;var a=[],l=n.map((function(e){var r=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===r.length?(a.push(e),null):r[0]}));if(a.length)return r("Could not find to delete: "+a.join("\n or "));l.map((function(e){i.remove(e)}))}e.insert&&(n=e.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),s()}if(e.where){var a=new J("patch");a.pat=e.where,a.pat.statements.map((function(e){e.graph=Gt(t.value)})),a.sync=!0;var l=[];i.query(a,(function(e){l.push(e)}),i.fetcher,(function(){return 0===l.length?r("No match found to be patched:"+e.where):l.length>1?r("Patch ambiguous. No patch done."):(o=l[0],void s(r))}))}else s(r)}declareExistential(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}initPropertyActions(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[K],H(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${W}sameAs`))]=[function(e,t,r,n,i){return e.equate(t,n),!0}]),H(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${W}InverseFunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,Y)}]),H(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${W}FunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,Q)}])}addStatement(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}add(e,t,r,n){var i,o,s;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else(0,c.PY)(e)?this.add(e.subject,e.predicate,e.object,e.graph):(0,c.Pv)(e)&&this.add(e.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=z.fromValue(t);const a=z.fromValue(r);if(n=z.fromValue(n),!(0,c.f)(e))throw new Error("Subject is not a subject type");if(!(0,c.nq)(t))throw new Error(`Predicate ${t} is not a predicate type`);if(!(0,c.Uc)(a))throw new Error(`Object ${a} is not an object type`);if(!(0,c.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,n);var l=this.id(this.canon(t)),u=!1;if(o=this.propertyActions[l])for(i=0;i<o.length;i++)u=u||o[i](this,e,t,a,n);if(this.holds(e,t,a,n))return null;var h=[this.id(this.canon(e)),l,this.id(this.canon(a)),this.id(this.canon(n))];for(s=this.rdfFactory.quad(e,t,a,n),i=0;i<4;i++){var d=this.index[i],p=h[i];d[p]||(d[p]=[]),d[p].push(s)}if(this.statements.push(s),this.dataCallbacks)for(const e of this.dataCallbacks)e(s);return s}canon(e){if(!e)return e;const t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case o.V1:return new a(e.value);case o.fb:return e;case o.NK:return new y;case o.ls:case o._A:return e;case o.xH:return new h(e.value,e.language,e.datatype);case o.XM:return new l.Z(e.value);case o.UH:return new _(e.value);default:throw new Error(`Term Type not recognized for canonization: ${e.termType}`)}}check(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var r in t)t.hasOwnProperty(r)&&this.checkStatementList(t[r],e)}}checkStatementList(e,t){void 0===t&&(t=0);for(var r,n=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var o=[(r=e[i]).subject,r.predicate,r.object,r.graph],s=function(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.graph))return!0},a=0;a<4;a++){var l=this.canon(o[a]),c=this.id(l);this.index[a][c]&&s(this.index[a][c],r)}if(!s(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}close(){return this}compareTerms(e,r){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(r):t.Z[e.termType]<t.Z[r.termType]?-1:t.Z[e.termType]>t.Z[r.termType]?1:e.value<r.value?-1:e.value>r.value?1:0}copyTo(e,t,r){r||(r=[]);var n=this.statementsMatching(e);-1!==H(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,o.predicate,o.object.copy(this))}-1!==H(r,"delete")&&this.remove(o)}}equate(e,t){const r=this.canon(e),n=this.canon(t);var i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}formula(e){return new ee(e)}get length(){return this.statements.length}match(e,t,r,n){return this.statementsMatching(z.fromValue(e),z.fromValue(t),z.fromValue(r),z.fromValue(n))}mentionsURI(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}newExistential(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}newPropertyAction(e,t){var r=this.id(e);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(t);for(var n=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<n.length;o++)i=i||t(this,n[o].subject,e,n[o].object);return i}newUniversal(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}variable(e){return new _(e)}nextSymbol(e){for(var t=0;;t++){var r=e.value+"#n"+t;if(!this.mentionsURI(r))return this.sym(r)}}query(e,t,r,n){return X.call(this,e,t,r,n)}querySync(e){var t=[],r=!1;if(e.sync=!0,X.call(this,e,(function(e){t.push(e)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return t}remove(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if((0,c.Pv)(e))return this.remove(e.statements);var r=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(r[0]),this}removeDocument(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),r=0;r<t.length;r++)this.removeStatement(t[r]);return this}removeMany(e,t,r,n,i){for(var o=this.statementsMatching(e,t,r,n,!1),s=[],a=0;a<o.length;a++)s.push(o[a]);for(i&&(s=s.slice(0,i)),a=0;a<s.length;a++)this.remove(s[a])}removeMatches(e,t,r,n){return this.removeMany(e,t,r,n),this}removeStatement(e){for(var t=[e.subject,e.predicate,e.object,e.graph],r=0;r<4;r++){var n=this.canon(t[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],e)}return this.rdfArrayRemove(this.statements,e),this}removeStatements(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}replaceWith(e,t){for(var r=this.id(e),n=this.id(t),i=function(e){var t=e[r];if(t){var i=e[n];e[n]=i?t.concat(i):t,delete e[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=t,e.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(e),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=t,this.aliases[n].push(this.aliases[r][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}allAliases(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}sameThings(e,t){if(e.equals(t))return!0;var r=this.canon(e);if(!r)return!1;var n=this.canon(t);return!!n&&r.value===n.value}setPrefixForURI(e,t){if(("tab"!==e||!this.namespaces.tab)&&"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)){for(let e in this.namespaces)this.namespaces[e]==t&&delete this.namespaces[e];this.namespaces[e]=t}}statementsMatching(e,t,r,n,i){var o,s,a=[e,t,r,n],l=[],c=[],u=[],h=[];for(o=0;o<4;o++)l[o]=this.canon(z.fromValue(a[o])),l[o]?(h.push(o),c[o]=this.id(l[o])):u.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(s=this.index[o][c[o]])&&i&&s.length>1&&(s=s.slice(0,1)),s||[];var d,p,f=1e10;for(p=0;p<h.length;p++){if(o=h[p],!(s=this.index[o][c[o]]))return[];s.length<f&&(f=s.length,d=p)}for(var g=h[d],y=this.index[g][c[g]],m=h.slice(0,d).concat(h.slice(d+1)),v=[],b=["subject","predicate","object","why"],w=0;w<y.length;w++){var x=y[w];for(p=0;p<m.length;p++)if(o=m[p],!this.canon(x[b[o]]).equals(l[o])){x=null;break}if(null!=x&&(v.push(x),i))break}return v}uris(e){var t=this.canon(e),r=this.aliases[this.id(t)];if(!t.value)return[];var n=[t.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}serialize(e,t,r,n){var i;return F(r,this,e,t,void 0,n={...n||{},namespaces:null!==(i=n)&&void 0!==i&&i.namespaces?{...this.namespaces,...n.namespaces}:{...this.namespaces}})}}(0,e.Z)(ee,"handleRDFType",void 0),ee.handleRDFType=K;const te=S("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function re(e,t){function r(n,i,o){const s=e.statementsMatching(n,te("rest"),null,t);if(1!==s.length)throw new Error(`Bad list structure: no rest at ${n}`);const a=e.statementsMatching(n,te("first"),null,t);if(1!==a.length)throw new Error(`Bad list structure: rest but ${a.length} firsts at ${n}`);const l=[a[0].object].concat(i),c=o.concat(s).concat(a),u=e.statementsMatching(null,te("rest"),n,t);if(0===u.length){const r=new p(l);return e.remove(c),void function(e,t,r,n){for(const i of e.statementsMatching(r,null,null,n)){const r=new w(t,i.predicate,i.object,n);e.remove(i),e.add(r)}for(const i of e.statementsMatching(null,r,null,n))e.remove(i),e.add(new w(i.subject,t,i.object,n));for(const i of e.statementsMatching(null,null,r,n))e.remove(i),e.add(new w(i.subject,i.predicate,t,n))}(e,r,n,t)}if(1!==u.length)throw new Error(`Bad list structure: ${u.length} pres at ${n}`);const h=u[0].subject;if("BlankNode"!==h.termType)throw new Error(`Bad list element node ${h} type: ${h.termType} `);r(h,l,c)}!function(e,t){const r=te("nil");for(const n of e.statementsMatching(r,null,null,t)){e.remove(n);const r=new p;e.add(new w(r,n.predicate,n.object,t))}for(const n of e.statementsMatching(null,null,r,t))if(!n.predicate.sameTerm(te("rest"))){e.remove(n);const r=new p;e.add(new w(n.subject,n.predicate,r,t))}}(e,t),e.statementsMatching(null,te("rest"),te("nil"),t).forEach((e=>{if("BlankNode"!==e.subject.termType)throw new Error(`Bad list element node ${e.subject} type: ${e.subject.termType} `);r(e.subject,[],[])}))}var ne="http://www.w3.org/2000/10/swap/log#",ie=function(e){return e},oe=function(e){return e},se=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},ae=function(e){return e.length},le=function(e,t,r){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+typeof e;return void 0===r||null==r?e.slice(t):e.slice(t,r)},ce=Error("dummy error stop iteration"),ue=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw ce;return this.li[this.last++]},this},he=function(e,t){return e.indexOf(t)},de=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var pe=function(e,t){return x.join(t,e)},fe="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",ge="http://www.w3.org/2002/07/owl#sameAs",ye="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",me=ye+":",ve=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),be=new RegExp("^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\.[0-9]*)?)?)?Z?"),we=new RegExp('[\\\\\\r\\n\\"]',"g"),xe=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const _e=function(e,t,r,n,i,o,s,a){return new Te(e,t,r,n,i,o,s,a)};class Te{constructor(e,t,r,n,i,o,s,a){void 0===t&&(t=null),void 0===r&&(r=""),void 0===n&&(n=null),void 0===i&&(i=""),void 0===o&&(o=null),void 0===s&&(s=""),void 0===a&&(a=null),this._bindings=new se([]),this._flags=s,""!=r&&(de(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=e,i&&e.setGenPrefix(i),this._thisDoc=r,this.source=e.sym(r),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=i,this.keywords=new oe(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new se([]),this._variables=new se([]),this._parentVariables=new se([]),this._reason=a,this._reason2=null,this._baseURI=n||r||null,de(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==t?this._thisDoc?this._formula=e.formula(r+"#_formula"):this._formula=e.formula():this._formula=t,this._context=this._formula,this._parentContext=null}here(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}formula(){return this._formula}loadStream(e){return this.loadBuf(e.read())}loadBuf(e){return this.startDoc(),this.feed(e),this.endDoc()}feed(e){for(var t=e.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(t,r);if(n<0)return;if((r=this.directiveOrStatement(t,n))<0)throw Ne(this._thisDoc,this.lines,t,n,"expected directive or statement")}}directiveOrStatement(e,t){var r,n=this.skipSpace(e,t);return n<0?n:(r=this.directive(e,n))>=0||(r=this.statement(e,n))>=0?this.checkDot(e,r):r}tok(e,t,r){if("@"==t.slice(r,r+1))r+=1;else if(H(this.keywords,e)<0)return-1;var n=r+ae(e);return t.slice(r,n)==e&&ye.indexOf(t.charAt(n))>=0?n:-1}directive(e,t){if((o=this.skipSpace(e,t))<0)return o;var r=new oe([]);if((o=this.tok("bind",e,t))>0)throw Ne(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!1))<0)throw Ne(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(le(r,null,null)),t}if((o=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!0))<0)throw Ne(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var n=new ue(r);try{for(;;){var i=n.next();(H(this._variables,i)<0||H(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=ce)throw e}return t}if((o=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,o,r,this.uri_ref2))<0)throw Ne(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");n=new ue(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(e){if(e!=ce)throw e}return t}if((o=this.tok("prefix",e,t))>=0){var o,s=new oe([]);if((t=this.qname(e,o,s))<0)throw Ne(this._thisDoc,this.lines,e,o,"expected qname after @prefix");if((o=this.uri_ref2(e,t,s))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var a=s[1].uri;return this._baseURI?a=pe(this._baseURI,a):de(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),de(a.indexOf(":")>=0),this._bindings[s[0][0]]=a,this.bind(s[0][0],function(e){return encodeURI(e)}(a)),o}if((o=this.tok("base",e,t))>=0){if(s=new oe([]),(t=this.uri_ref2(e,o,s))<0)throw Ne(this._thisDoc,this.lines,e,o,"expected <uri> after @base ");if(a=s[0].uri,!this._baseURI)throw Ne(this._thisDoc,this.lines,e,o,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=pe(this._baseURI,a),de(a.indexOf(":")>=0),this._baseURI=a,t}return-1}bind(e,t){""==e||this._store.setPrefixForURI(e,t)}setKeywords(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}startDoc(){}endDoc(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&re(this._store,this.source),this._formula}makeStatement(e){e[0].add(e[2],e[1],e[3],this.source),(e[2].uri&&e[2].uri===fe||e[3].uri&&e[3].uri===fe)&&(this.hasNil=!0),this.statementCount+=1}statement(e,t){var r=new oe([]);if((t=this.object(e,t,r))<0)return t;var n=this.property_list(e,t,r[0]);if(n<0)throw Ne(this._thisDoc,this.lines,e,t,"expected propertylist");return n}subject(e,t,r){return this.item(e,t,r)}verb(e,t,r){if((i=this.skipSpace(e,t))<0)return i;var n=new oe([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,n))<0)throw Ne(this._thisDoc,this.lines,e,i,"expected property after 'has'");return r.push(new ie(["->",n[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,n))<0)throw Ne(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;if(t=i,(i=this.tok("of",e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return r.push(new ie(["<-",n[0]])),i}if((i=this.tok("a",e,t))>=0)return r.push(new ie(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return r.push(new ie(["<-",this._store.sym(ne+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(r.push(new ie(["->",this._store.sym(ne+"implies")])),t+2):(r.push(new ie(["->",this._store.sym(ge)])),t+1);if(":="==e.slice(t,t+2))return r.push(new ie(["->",ne+"becomes"])),t+2;if((i=this.prop(e,t,n))>=0)return r.push(new ie(["->",n[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw Ne(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}prop(e,t,r){return this.item(e,t,r)}item(e,t,r){return this.path(e,t,r)}blankNode(e){return this._context.bnode(e,this._reason2)}path(e,t,r){if((o=this.nodeOrLiteral(e,t,r))<0)return o;for(;"!^.".indexOf(e.slice(o,o+1))>=0;){var n=e.slice(o,o+1);if("."==n){var i=e.slice(o+1,o+2);if(!i||me.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,s=r.pop(),a=this.blankNode(this.here(o));if((o=this.node(e,o+1,r))<0)throw Ne(this._thisDoc,this.lines,e,o,"EOF found in middle of path syntax");var l=r.pop();"^"==n?this.makeStatement(new ie([this._context,l,a,s])):this.makeStatement(new ie([this._context,l,s,a])),r.push(a)}return o}anonymousNode(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}node(e,t,r,n){void 0===n&&(n=null);var i=n;if((u=this.skipSpace(e,t))<0)return u;t=u;var o=e.slice(t,t+1);if("["==o){var s=this.here(t);if((u=this.skipSpace(e,t+1))<0)throw Ne(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(u,u+1)){t=u+1;var a=new oe([]);if(!((u=this.objectList(e,t,a))>=0))throw Ne(this._thisDoc,this.lines,e,t,"objectList expected after [= ");if(i=a[0],ae(a)>1){var l=new ue(a);try{for(;;){var c=l.next();this.makeStatement(new ie([this._context,this._store.sym(ge),i,c]))}}catch(e){if(e!=ce)throw e}}if((u=this.skipSpace(e,u))<0)throw Ne(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(u,u+1))var u=u+1}if(null==i&&(i=this.blankNode(s)),(t=this.property_list(e,u,i))<0)throw Ne(this._thisDoc,this.lines,e,u,"property_list expected");if((u=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(u,u+1))throw Ne(this._thisDoc,this.lines,e,u,"']' expected");return r.push(i),u+1}if("{"==o){if("$"==e.slice(t+1,t+2)){u=(t+=1)+1;for(var h=new oe([]),d=!0;;){if((t=this.skipSpace(e,u))<0)throw Ne(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){u=t+2;break}if(d)d=!1;else{if(","!=e.slice(t,t+1))throw Ne(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var p=new oe([]);if((u=this.item(e,t,p))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");h.push(p[0])}return r.push(this._store.newSet(h,this._context)),u}u=t+1;var f=this._parentContext;this._parentContext=this._context;var g=this._anonymousNodes,y=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new se([]),this._variables=this._variables.slice();var m=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((t=this.skipSpace(e,u))<0)throw Ne(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){u=t+1;break}if((u=this.directiveOrStatement(e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=g,this._variables=this._parentVariables,this._parentVariables=y,this._context=this._parentContext,this._reason2=m,this._parentContext=f,r.push(i.close()),u}if("("==o){var v=this._store.list;for("$"==e.slice(t+1,t+2)&&(v=this._store.newSet,t+=1),u=t+1,h=new oe([]);;){if((t=this.skipSpace(e,u))<0)throw Ne(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){u=t+1;break}if(p=new oe([]),(u=this.item(e,t,p))<0)throw Ne(this._thisDoc,this.lines,e,t,"expected item in list or ')'");h.push(p[0])}return r.push(v(h,this._context)),u}if((u=this.tok("this",e,t))>=0)throw Ne(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(u=this.tok("true",e,t))>=0?(r.push(!0),u):(u=this.tok("false",e,t))>=0?(r.push(!1),u):null==i&&(u=this.uri_ref2(e,t,r))>=0?u:-1}property_list(e,t,r){for(;;){if((u=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(u,u+2)){t=u;var n=new oe([]);if((u=this.verb(e,t,n))<=0)return t;var i=new oe([]);if((t=this.objectList(e,u,i))<0)throw Ne(this._thisDoc,this.lines,e,u,"objectList expected");var o=new ue(i);try{for(;;){var s=o.next(),a=n[0],l=a[0],c=a[1];"->"==l?this.makeStatement(new ie([this._context,c,r,s])):this.makeStatement(new ie([this._context,c,s,r]))}}catch(e){if(e!=ce)throw e}if((u=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,u,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t+=1}else{t=u+2;var u,h=new oe([]);if((u=this.node(e,t,h,r))<0)throw Ne(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");t=u}}}commaSeparatedList(e,t,r,n){if((i=this.skipSpace(e,t))<0)throw Ne(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(n)var i=this.uri_ref2(e,i,r);else i=this.bareWord(e,i,r);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=n?this.uri_ref2(e,t+1,r):this.bareWord(e,t+1,r))<0)throw Ne(this._thisDoc,this.lines,e,i,"bad list content")}}objectList(e,t,r){if((t=this.object(e,t,r))<0)return-1;for(;;){var n=this.skipSpace(e,t);if(n<0)throw Ne(this._thisDoc,this.lines,e,n,"EOF found after object");if(","!=e.slice(n,n+1))return n;if((t=this.object(e,n+1,r))<0)return t}}checkDot(e,t){var r=this.skipSpace(e,t);if(r<0)return r;if("."==e.slice(r,r+1))return r+1;if("}"==e.slice(r,r+1))return r;if("]"==e.slice(r,r+1))return r;throw Ne(this._thisDoc,this.lines,e,r,"expected '.' or '}' or ']' at end of statement")}uri_ref2(e,t,r){var n=new oe([]);if((d=this.qname(e,t,n))>=0){var i=n[0],o=i[0],s=i[1];if(null==o){de(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(s)),d;throw Ne(this._thisDoc,this.lines,e,t,"Prefix "+o+" not bound.")}var l=this._store.sym(a+s);return H(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),d}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var c=new oe([]);return(d=this.variable(e,t,c))>0?(r.push(c[0]),d):-1}if("<"==e.charAt(t)){for(var u=t+=1;t<ae(e);){if(">"==e.charAt(t)){var h=e.slice(u,t);return this._baseURI?h=pe(this._baseURI,h):de(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=le(h,-1,null)&&(h+="#"),l=this._store.sym(h),H(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),t+1}t+=1}throw Ne(this._thisDoc,this.lines,e,d,"unterminated URI reference")}if(this.keywordsSet){var d;if(c=new oe([]),(d=this.bareWord(e,t,c))<0)return-1;if(H(this.keywords,c[0])>=0)throw Ne(this._thisDoc,this.lines,e,t,'Keyword "'+c[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+c[0])),d}return-1}skipSpace(e,t){for(var r=t||0;r<e.length;r++){var n=e.charAt(r);if(" \n\r\t\f\v \u2028\u2029 ".indexOf(n)<0){if("#"!==e.charAt(r))return r;for(;;r++){if(r===e.length)return-1;if("\n"===e.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(r)&&(this.lines=this.lines+1)}return-1}variable(e,t,r){if((n=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(n,n+1))return-1;var n;if(t=n+=1,"0123456789-".indexOf(e.charAt(n))>=0)throw Ne(this._thisDoc,this.lines,e,n,"Varible name can't start with '"+e.charAt(n)+"s'");for(;t<ae(e)&&me.indexOf(e.charAt(t))<0;)t+=1;if(null==this._parentContext)throw Ne(this._thisDoc,this.lines,e,n,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(n-1,t));return r.push(this._store.variable(e.slice(n,t))),t}bareWord(e,t,r){var n=this.skipSpace(e,t);if(n<0)return-1;var i=e.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(me.indexOf(i)>=0)return-1;for(t=n;t<ae(e)&&me.indexOf(e.charAt(t))<0;)t+=1;return r.push(e.slice(n,t)),t}qname(e,t,r){if((t=this.skipSpace(e,t))<0)return-1;var n=e.charAt(t);if("0123456789-+".indexOf(n)>=0)return-1;if(me.indexOf(n)<0){var i=n;for(t+=1;t<ae(e)&&(n=e.charAt(t),me.indexOf(n)<0);)i+=n,t+=1}else i="";if(t<ae(e)&&":"==e.charAt(t)){var o=i;for(t+=1,i="";t<ae(e)&&(n=e.charAt(t),me.indexOf(n)<0);)i+=n,t+=1;return r.push(new ie([o,i])),t}return i&&this.keywordsSet&&H(this.keywords,i)<0?(r.push(new ie(["",i])),t):-1}object(e,t,r){if((o=this.subject(e,t,r))>=0)return o;{if((o=this.skipSpace(e,t))<0)return-1;t=o;var n=null;let a=e.charAt(t);if('"'==a||"'"==a){n=e.slice(t,t+3==a+a)?a+a+a:a,t+=ae(n);var i=this.strconst(e,t,n),o=i[0],s=i[1];return r.push(this._store.literal(s)),o}return-1}}nodeOrLiteral(e,t,r){if((l=this.node(e,t,r))>=0)return l;if((l=this.skipSpace(e,t))<0)return-1;t=l;var n=e.charAt(t);if("-+0987654321".indexOf(n)>=0){if(be.lastIndex=0,null!=(h=be.exec(e.slice(t))))l=t+(i=h[0]).length,i.indexOf("T")>=0?r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(ve.lastIndex=0,null==(h=ve.exec(e.slice(t))))throw Ne(this._thisDoc,this.lines,e,t,"Bad number or date syntax");l=t+ve.lastIndex,(i=e.slice(t,l)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,l).indexOf(".")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return l}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var o='"""';else o='"';t+=ae(o);var s=null,a=this.strconst(e,t,o),l=a[0],c=a[1],u=null;if("@"==e.slice(l,l+1)){var h;if(xe.lastIndex=0,null==(h=xe.exec(e.slice(l+1))))throw Ne(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=xe.lastIndex+l+1,u=e.slice(l+1,t),l=t}if("^^"==e.slice(l,l+2)){var d=new oe([]);l=this.uri_ref2(e,l+2,d),s=d[0]}return r.push(this._store.literal(c,u||s)),l}return-1}strconst(e,t,r){for(var n=t,i="",o=this.lines;n<ae(e);){if(t=n+ae(r),e.slice(n,t)==r)return new ie([t,i]);if('"'!=e.charAt(n)){if(we.lastIndex=0,!we.exec(e.slice(n)))throw Ne(this._thisDoc,o,e,n,"Closing quote missing in string at ^ in "+e.slice(n-20,n)+"^"+e.slice(n,n+20));if(t=n+we.lastIndex-1,i+=e.slice(n,t),'"'!=(l=e.charAt(t)))if("\r"!=l){if("\n"==l){if('"'==r)throw Ne(this._thisDoc,o,e,t,"newline found in string literal");this.lines=this.lines+1,i+=l,n=t+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==l){if(n=t+1,!(l=e.slice(n,n+1)))throw Ne(this._thisDoc,o,e,t,"unterminated string literal (2)");var s=he('abfrtvn\\"',l);if(s>=0)i+='a\b\f\r\t\v\n\\"'.charAt(s),n+=1;else if("u"==l)n=(a=this.uEscape(e,n+1,o))[0],i+=l=a[1];else{if("U"!=l)throw Ne(this._thisDoc,this.lines,e,t,"bad escape");var a,l;n=(a=this.UEscape(e,n+1,o))[0],i+=l=a[1]}}}else n=t+1;else n=t}else i=i+'"',n=n+1}throw Ne(this._thisDoc,this.lines,e,t,"unterminated string literal")}uEscape(e,t,r){for(var n=t,i=0,o=0;i<4;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw Ne(this._thisDoc,r,e,t,"unterminated string literal(3)");var a=he("0123456789abcdef",s);if(a<0)throw Ne(this._thisDoc,r,e,t,"bad string literal hex escape");o=16*o+a,i+=1}var l=String.fromCharCode(o);return new ie([n,l])}UEscape(e,t,r){for(var n=t,i=0,o="\\U";i<8;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw Ne(this._thisDoc,r,e,t,"unterminated string literal(3)");if(he("0123456789abcdef",s)<0)throw Ne(this._thisDoc,r,e,t,"bad string literal hex escape");o+=s,i+=1}var a,l=(a="0x"+le(o,2,10)-0,String.fromCharCode(a));return new ie([n,l])}}function Ne(e,t,r,n,i){let o=t+1,s="Line "+o+" of <"+e+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',a=new SyntaxError(s,e,o);return a.lineNo=o,a.characterInFile=n,a.syntaxProblem=i,a}const je={...E,supports:{[T.collections]:!0,[T.defaultGraphType]:!1,[T.equalsMethod]:!0,[T.identity]:!1,[T.id]:!0,[T.reversibleId]:!1,[T.variableType]:!0},collection:e=>new p(e),id(e){return(0,c.uZ)(e)?`( ${e.elements.map((e=>this.id(e))).join(", ")} )`:(0,c.cG)(e)?_.toString(e):E.id(e)},termToNQ:e=>e.termType===o.fb?p.toNT(e):E.termToNQ(e)},Ee=je;function Oe(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((t=>Oe(e,t))))}(e,t["@list"]):function(e,t){const r=t["@id"]?Ie(e,t):e.rdfFactory.blankNode(),n=t["@list"].map((t=>Oe(e,t))),i=q(e.rdfFactory,r,n);return e.addAll(i),r}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?Ie(e,t):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function Se(e,t,r,n){const i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return M().flatten(JSON.parse(e),null,{base:i}).then((e=>e.reduce(((e,n)=>t=Ae(t,r,n)),t))).then(n).catch(n)}function Ie(e,t){return t["@id"].startsWith("_:")?e.rdfFactory.blankNode(t["@id"].substring(2)):e.rdfFactory.namedNode(t["@id"])}function Ae(e,t,r){const n=r["@id"]?Ie(e,r):e.rdfFactory.blankNode();for(const i of Object.keys(r)){if("@id"===i)continue;if("@graph"==i){const t=n,o=r[i];for(let r=0;r<o.length;r++)e=Ae(e,t,o[r])}const o=r[i];if(Array.isArray(o))for(let r=0;r<o.length;r++)e.addStatement(ke(e,n,i,o[r],t));else e.addStatement(ke(e,n,i,o,t))}return e}function ke(e,t,r,n,i){let o,s;return"@type"===r?(o=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s=e.rdfFactory.namedNode(n)):(o=e.rdfFactory.namedNode(r),s=Oe(e,n)),e.rdfFactory.quad(t,o,s,e.rdfFactory.namedNode(i))}const Re="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Ce="http://www.w3.org/2001/XMLSchema#",De="http://www.w3.org/2000/10/swap/",Le={xsd:{decimal:`${Ce}decimal`,boolean:`${Ce}boolean`,double:`${Ce}double`,integer:`${Ce}integer`,string:`${Ce}string`},rdf:{type:`${Re}type`,nil:`${Re}nil`,first:`${Re}first`,rest:`${Re}rest`,langString:`${Re}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${De}reify#forSome`,forAll:`${De}reify#forAll`},log:{implies:`${De}log#implies`}};var Pe=n(5929),Me=n.n(Pe),Fe=n(2486).lW;const{xsd:Ue}=Le,Be=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,qe={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},He=/[\x00-\x20<>\\"\{\}\|\^\`]/,Ze={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},$e=/$0^/;class ze{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in Ze)&&this[e]instanceof RegExp&&(this[e]=$e)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,s;for(;e=this._newline.exec(r);)this._comments&&(s=this._comment.exec(e[0]))&&i("comment",s[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(s=this._comment.exec(r))&&i("comment",s[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const a=this._line,l=r[0];let c="",u="",h="",d=null,p=0,f=!1;switch(l){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(p=1,c="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){f=!0;break}case"<":if(d=this._unescapedIri.exec(r))c="IRI",u=d[1];else if(d=this._iri.exec(r)){if(u=this._unescape(d[1]),null===u||He.test(u))return o(this);c="IRI"}else r.length>1&&"<"===r[1]?(c="<<",p=2):this._n3Mode&&r.length>1&&"="===r[1]&&(c="inverse",p=2,u=">");break;case">":r.length>1&&">"===r[1]&&(c=">>",p=2);break;case"_":((d=this._blank.exec(r))||t&&(d=this._blank.exec(`${r} `)))&&(c="blank",h="_",u=d[1]);break;case'"':if(d=this._simpleQuotedString.exec(r))u=d[1];else if(({value:u,matchLength:p}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===p||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(d=this._simpleApostropheString.exec(r))u=d[1];else if(({value:u,matchLength:p}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===p||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(d=this._variable.exec(r))&&(c="var",u=d[0]);break;case"@":"literal"===this._previousMarker&&(d=this._langcode.exec(r))?(c="langcode",u=d[1]):(d=this._keyword.exec(r))&&(c=d[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){c=".",p=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(d=this._number.exec(r)||t&&(d=this._number.exec(`${r} `)))&&(c="literal",u=d[0],h="string"==typeof d[1]?Ue.double:"string"==typeof d[2]?Ue.decimal:Ue.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(d=this._sparqlKeyword.exec(r))?c=d[0].toUpperCase():f=!0;break;case"f":case"t":(d=this._boolean.exec(r))?(c="literal",u=d[0],h=Ue.boolean):f=!0;break;case"a":(d=this._shortPredicates.exec(r))?(c="abbreviation",u="a"):f=!0;break;case"=":this._n3Mode&&r.length>1&&(c="abbreviation",">"!==r[1]?(p=1,u="="):(p=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(p=1,c=l);break;default:f=!0}if(f&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(d=this._prefix.exec(r))?((d=this._prefixed.exec(r))||t&&(d=this._prefixed.exec(`${r} `)))&&(c="prefixed",h=d[1]||"",u=this._unescape(d[2])):(c="prefix",u=d[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const g=p||d[0].length,y=i(c,u,h,a,g);this.previousToken=y,this._previousMarker=c,r=r.substr(g,r.length)}function i(t,i,o,s,a){const l=r?n-r.length:n,c={type:t,value:i,prefix:o,line:s,start:l,end:l+a};return e(null,c),c}function o(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(Be,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in qe?qe[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,o=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}Me()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Fe.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:Ve,xsd:Ge}=Le;let Je,Xe=0;const We={namedNode:function(e){return new Ye(e)},blankNode:function(e){return new et(e||"n3-"+Xe++)},variable:function(e){return new tt(e)},literal:function(e,t){if("string"==typeof t)return new Ke(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";return""===r&&("boolean"==typeof e?r=Ge.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?Ge.integer:Ge.double:(r=Ge.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===r||r===Ge.string?new Ke(`"${e}"`):new Ke(`"${e}"^^${r}`)},defaultGraph:function(){return Je},quad:nt,triple:nt};class Qe{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Qe?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Ye extends Qe{get termType(){return"NamedNode"}}class Ke extends Qe{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new Ye(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?Ge.string:Ve.langString}equals(e){return e instanceof Ke?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class et extends Qe{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class tt extends Qe{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}Je=new class extends Qe{constructor(){return super(""),Je||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class rt extends Qe{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||Je}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function nt(e,t,r,n){return new rt(e,t,r,n)}let it=0;class ot{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&at(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),s=this._n3Mode=/n3/.test(t),a=i||o;(this._supportsNamedGraphs=!(r||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),a&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new ze({lineMode:a,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){it=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,r,n,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(n+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,s=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===s.predicate?s.subject=r:s.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==n){const e=this._predicate,t=this._object;i?this._emit(t,e,n,r):this._emit(n,e,t,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=st}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,i=-1,o=0,s="/";for(;n<t;){switch(s){case":":if(i<0&&"/"===e[++n]&&"/"===e[++n])for(;(i=n+1)<t&&"/"!==e[i];)n=i;break;case"?":case"#":n=t;break;case"/":if("."===e[n+1])switch(s=e[1+ ++n],s){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(s=e[1+ ++n],void 0===s||"/"===s||"?"===s||"#"===s){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==s)return`${r}/${e.substr(n+1)}`;o=n+1}}}s=e[++n]}return r+e.substring(o)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${it++}_`,this._prefixCallback=r||st,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=st):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function st(){}function at(e,t){const r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(Le.rdf.first),e.RDF_REST=r(Le.rdf.rest),e.RDF_NIL=r(Le.rdf.nil),e.N3_FORALL=r(Le.r.forAll),e.N3_FORSOME=r(Le.r.forSome),e.ABBREVIATIONS={a:r(Le.rdf.type),"=":r(Le.owl.sameAs),">":r(Le.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}at(ot.prototype,We);var lt=n(292);if(void 0===ct)var ct={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};class ut{constructor(e,t){this.options=t||{},this.kb=e,this.target=t.target||{graph:{subjects:{},prefixes:{},terms:{}}},this.blankNodes=[],this.htmlOptions={selfClosing:"br img input area base basefont col colgroup source wbr isindex link meta param hr"},this.theOne="_:"+(new Date).getTime(),this.language=null,this.vocabulary=null,this.blankCounter=0,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}],this.inXHTMLMode=!1,this.absURIRE=/[\w\_\-]+:\S+/,this.finishedHandlers=[],this.init()}addTriple(e,t,r,n){var i,o,s,a;i=void 0===t?E.namedNode(this.options.base):this.toRDFNodeObject(t),s=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),a=E.namedNode(this.options.base),this.kb.add(i,s,o,a)}ancestorPath(e){for(var t="";e&&e.nodeType!==ct.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}copyMappings(e){var t={};for(var r in e)t[r]=e[r];return t}copyProperties(){}deriveDateTimeType(e){for(var t=0;t<ut.dateTimeTypes.length;t++){var r=ut.dateTimeTypes[t].pattern.exec(e);if(r&&r[0].length===e.length)return ut.dateTimeTypes[t].type}return null}init(){}newBlankNode(){return this.blankCounter++,"_:"+this.blankCounter}newSubjectOrigin(e,t){}parseCURIE(e,t,r){var n,i=e.indexOf(":");if(i>=0){var o=e.substring(0,i);if(""===o)return(n=t[""])?n+e.substring(i+1):null;if("_"===o)return"_:"+e.substring(i+1);if(ut.NCNAME.test(o)&&(n=t[o]))return n+e.substring(i+1)}return null}parseCURIEOrURI(e,t,r){return this.parseCURIE(e,t,r)||this.resolveAndNormalize(r,e)}parsePredicate(e,t,r,n,i,o){if(""===e)return null;var s=this.parseTermOrCURIEOrAbsURI(e,t,o?null:r,n,i);return s&&0===s.indexOf("_:")?null:s}parsePrefixMappings(e,t){for(var r=this.tokenize(e),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(t[n]=this.options.base?x.join(r[i],this.options.base):r[i],n=null)}static parseRDFaDOM(e,t,r){var n=new ut(t,{base:r});e.baseURI||(e.baseURI=r),n.process(e,{baseURI:r})}parseSafeCURIEOrCURIEOrURI(e,t,r){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,r):this.parseCURIEOrURI(e,t,r)}parseTermOrCURIEOrAbsURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;if(r){if(t&&!this.absURIRE.exec(e))return t+e;var s=r[e];if(s)return s;if(s=r[e.toLowerCase()])return s}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}parseTermOrCURIEOrURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;var s=r[e];return s||((s=r[e.toLowerCase()])?s:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}parseURI(e){return e}process(e,t){var r;t=t||{},e.nodeType===ct.DOCUMENT_NODE?(e.baseURI&&!t.baseURI&&(t.baseURI=e.baseURI),r=e.baseURI,(e=e.documentElement).baseURI||(e.baseURI=r),this.setContext(e)):e.parentNode.nodeType===ct.DOCUMENT_NODE&&this.setContext(e);var n=[],i=function(e){if(!e&&t&&t.baseURI)return t.baseURI;var r=e.indexOf("#");return r>=0&&(e=e.substring(0,r)),t&&t.baseURIMap&&(e=t.baseURIMap(e)),e};for(n.push({current:e,context:this.push(null,i(e.baseURI))});n.length>0;){var o=n.shift();if(o.parent){if(o.context.parent&&o.context.parent.listMapping===o.listMapping)continue;for(let e in o.listMapping){var s=o.listMapping[e];if(0!==s.length){var a=[];for(let e=0;e<s.length;e++)a.push(this.newBlankNode());for(let e=0;e<a.length;e++)this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",s[e]),this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:ut.objectURI,value:e+1<a.length?a[e+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(o.parent,o.subject,e,{type:ut.objectURI,value:a[0]})}else this.addTriple(o.parent,o.subject,e,{type:ut.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var l=o.current,c=o.context,u=!1,h=null,d=null,p=null,f=c.prefixes,g=!1,y=[],m=c.listMapping,v=!c.parent,b=c.language,w=c.vocabulary;r=this.parseURI(i(l.baseURI)),l.item=null;var _=l.getAttributeNode("vocab");if(_){let e=this.trim(_.value);if(e.length>0){w=e;var T=r.spec;this.addTriple(l,T,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:ut.objectURI,value:w})}else w=this.vocabulary}for(var N=0;N<l.attributes.length;N++){var j=l.attributes[N];if("x"===j.nodeName.charAt(0)&&0===j.nodeName.indexOf("xmlns:")){g||(f=this.copyMappings(f),g=!0);var E=j.nodeName.substring(6),O=ut.trim(j.value);f[E]=this.options.base?x.join(O,this.options.base):O}}var S=l.getAttributeNode("prefix");S&&(g||(f=this.copyMappings(f),g=!0),this.parsePrefixMappings(S.value,f));var I=null;for(let e=0;!I&&e<this.langAttributes.length;e++)I=l.getAttributeNodeNS(this.langAttributes[e].namespaceURI,this.langAttributes[e].localName);if(I){let e=ut.trim(I.value);b=e.length>0?e:null}var A,k,R=l.getAttributeNode("rel"),C=l.getAttributeNode("rev"),D=l.getAttributeNode("typeof"),L=l.getAttributeNode("property"),P=l.getAttributeNode("datatype"),M=this.inHTMLMode?l.getAttributeNode("datetime"):null,F=l.getAttributeNode("content"),U=l.getAttributeNode("about"),B=l.getAttributeNode("src"),q=l.getAttributeNode("resource"),H=l.getAttributeNode("href"),Z=l.getAttributeNode("inlist"),$=[];if(R){k=this.tokenize(R.value);for(let e=0;e<k.length;e++)A=this.parsePredicate(k[e],w,c.terms,f,r,this.inHTMLMode&&null!==L),A&&$.push(A)}var z=[];if(C){k=this.tokenize(C.value);for(let e=0;e<k.length;e++)A=this.parsePredicate(k[e],w,c.terms,f,r,this.inHTMLMode&&L),A&&z.push(A)}if(this.inHTMLMode&&(R||C)&&L&&(0===$.length&&(R=null),0===z.length&&(C=null)),R||C?(U&&(h=this.parseSafeCURIEOrCURIEOrURI(U.value,f,r)),D&&(p=h),h||(l.parentNode.nodeType===ct.DOCUMENT_NODE?h=i(l.baseURI):c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject)),q&&(d=this.parseSafeCURIEOrCURIEOrURI(q.value,f,r)),d||(H?d=this.resolveAndNormalize(r,encodeURI(H.value)):B?d=this.resolveAndNormalize(r,encodeURI(B.value)):!D||U||this.inXHTMLMode&&("head"===l.localName||"body"===l.localName)||(d=this.newBlankNode())),!D||U||!this.inXHTMLMode||"head"!==l.localName&&"body"!==l.localName?D&&!U&&(p=d):p=h):!L||F||P?(U&&(h=this.parseSafeCURIEOrCURIEOrURI(U.value,f,r)),!h&&q&&(h=this.parseSafeCURIEOrCURIEOrURI(q.value,f,r)),!h&&H&&(h=this.resolveAndNormalize(r,encodeURI(H.value))),!h&&B&&(h=this.resolveAndNormalize(r,encodeURI(B.value))),h||(l.parentNode.nodeType===ct.DOCUMENT_NODE?h=i(l.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName?D?h=this.newBlankNode():c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,L||(u=!0)):h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject),D&&(p=h)):(U&&(h=this.parseSafeCURIEOrCURIEOrURI(U.value,f,r),D&&(p=h)),h||l.parentNode.nodeType!==ct.DOCUMENT_NODE?!h&&c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject):(h=i(l.baseURI),D&&(p=h)),D&&!p&&(q&&(p=this.parseSafeCURIEOrCURIEOrURI(q.value,f,r)),!p&&H&&(p=this.resolveAndNormalize(r,encodeURI(H.value))),!p&&B&&(p=this.resolveAndNormalize(r,encodeURI(B.value))),p||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName||(p=h),p||(p=this.newBlankNode()),d=p)),h&&(U||q||p)){var V=h;D&&!U&&!q&&d&&(V=d),this.newSubjectOrigin(l,V)}if(p){k=this.tokenize(D.value);for(let e=0;e<k.length;e++){var G=this.parseTermOrCURIEOrAbsURI(k[e],w,c.terms,f,r);G&&this.addTriple(l,p,ut.typeURI,{type:ut.objectURI,value:G})}}if(h&&h!==c.parentObject&&(m={},v=!0),d){if(R&&Z)for(let e=0;e<$.length;e++){let t=m[$[e]];t||(t=[],m[$[e]]=t),t.push({type:ut.objectURI,value:d})}else if(R)for(let e=0;e<$.length;e++)this.addTriple(l,h,$[e],{type:ut.objectURI,value:d});if(C)for(let e=0;e<z.length;e++)this.addTriple(l,d,z[e],{type:ut.objectURI,value:h})}else{if(h&&!d&&(R||C)&&(d=this.newBlankNode()),R&&Z)for(let e=0;e<$.length;e++){let t=m[$[e]];t||(t=[],m[A]=t),y.push({predicate:$[e],list:t})}else if(R)for(let e=0;e<$.length;e++)y.push({predicate:$[e],forward:!0});if(C)for(let e=0;e<z.length;e++)y.push({predicate:z[e],forward:!1})}if(L){var J=null,X=null;P?(J=""===P.value?ut.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(P.value,w,c.terms,f,r),X=M&&!F?M.value:J===ut.XMLLiteralURI||J===ut.HTMLLiteralURI?null:F?F.value:l.textContent):F?(J=ut.PlainLiteralURI,X=F.value):M?(X=M.value,(J=ut.deriveDateTimeType(X))||(J=ut.PlainLiteralURI)):R||C||(q&&(X=this.parseSafeCURIEOrCURIEOrURI(q.value,f,r)),!X&&H?X=this.resolveAndNormalize(r,encodeURI(H.value)):!X&&B&&(X=this.resolveAndNormalize(r,encodeURI(B.value))),X&&(J=ut.objectURI)),J||(D&&!U?(J=ut.objectURI,X=p):(X=l.textContent,this.inHTMLMode&&"time"===l.localName&&(J=ut.deriveDateTimeType(X)),J||(J=ut.PlainLiteralURI))),k=this.tokenize(L.value);for(let e=0;e<k.length;e++){let t=this.parsePredicate(k[e],w,c.terms,f,r);if(t)if(Z){let e=m[t];e||(e=[],m[t]=e),e.push(J===ut.XMLLiteralURI||J===ut.HTMLLiteralURI?{type:J,value:l.childNodes}:{type:J||ut.PlainLiteralURI,value:X,language:b})}else J===ut.XMLLiteralURI||J===ut.HTMLLiteralURI?this.addTriple(l,h,t,{type:J,value:l.childNodes}):this.addTriple(l,h,t,{type:J||ut.PlainLiteralURI,value:X,language:b})}}if(h&&!u)for(let e=0;e<c.incomplete.length;e++)c.incomplete[e].list?c.incomplete[e].list.push({type:ut.objectURI,value:h}):c.incomplete[e].forward?this.addTriple(l,c.subject,c.incomplete[e].predicate,{type:ut.objectURI,value:h}):this.addTriple(l,h,c.incomplete[e].predicate,{type:ut.objectURI,value:c.subject});var W=null,Q=h;u?((W=this.push(c,c.subject)).parentObject=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,W.incomplete=c.incomplete,W.language=b,W.prefixes=f,W.vocabulary=w):((W=this.push(c,h)).parentObject=d||h||c.subject,W.prefixes=f,W.incomplete=y,d&&(Q=d,m={},v=!0),W.listMapping=m,W.language=b,W.vocabulary=w),v&&n.unshift({parent:l,context:c,subject:Q,listMapping:m});for(var Y=l.lastChild;Y;Y=Y.previousSibling)Y.nodeType===ct.ELEMENT_NODE&&n.unshift({current:Y,context:W})}}this.inHTMLMode&&this.copyProperties();for(let t=0;t<this.finishedHandlers.length;t++)this.finishedHandlers[t](e)}push(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}resolveAndNormalize(e,t){return x.join(t,e)}setContext(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(lt.log("WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode."),this.setHTMLContext()):"-//W3C//DTD XHTML+RDFa 1.1//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"===document.doctype.systemId?this.setXHTMLContext():this.setHTMLContext():this.setHTMLContext():this.setXMLContext()}setHTMLContext(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}setInitialContext(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}setXHTMLContext(){this.setInitialContext(),this.inXHTMLMode=!0,this.inHTMLMode=!1,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.target.graph.terms.alternate="http://www.w3.org/1999/xhtml/vocab#alternate",this.target.graph.terms.appendix="http://www.w3.org/1999/xhtml/vocab#appendix",this.target.graph.terms.bookmark="http://www.w3.org/1999/xhtml/vocab#bookmark",this.target.graph.terms.cite="http://www.w3.org/1999/xhtml/vocab#cite",this.target.graph.terms.chapter="http://www.w3.org/1999/xhtml/vocab#chapter",this.target.graph.terms.contents="http://www.w3.org/1999/xhtml/vocab#contents",this.target.graph.terms.copyright="http://www.w3.org/1999/xhtml/vocab#copyright",this.target.graph.terms.first="http://www.w3.org/1999/xhtml/vocab#first",this.target.graph.terms.glossary="http://www.w3.org/1999/xhtml/vocab#glossary",this.target.graph.terms.help="http://www.w3.org/1999/xhtml/vocab#help",this.target.graph.terms.icon="http://www.w3.org/1999/xhtml/vocab#icon",this.target.graph.terms.index="http://www.w3.org/1999/xhtml/vocab#index",this.target.graph.terms.last="http://www.w3.org/1999/xhtml/vocab#last",this.target.graph.terms.license="http://www.w3.org/1999/xhtml/vocab#license",this.target.graph.terms.meta="http://www.w3.org/1999/xhtml/vocab#meta",this.target.graph.terms.next="http://www.w3.org/1999/xhtml/vocab#next",this.target.graph.terms.prev="http://www.w3.org/1999/xhtml/vocab#prev",this.target.graph.terms.previous="http://www.w3.org/1999/xhtml/vocab#previous",this.target.graph.terms.section="http://www.w3.org/1999/xhtml/vocab#section",this.target.graph.terms.stylesheet="http://www.w3.org/1999/xhtml/vocab#stylesheet",this.target.graph.terms.subsection="http://www.w3.org/1999/xhtml/vocab#subsection",this.target.graph.terms.start="http://www.w3.org/1999/xhtml/vocab#start",this.target.graph.terms.top="http://www.w3.org/1999/xhtml/vocab#top",this.target.graph.terms.up="http://www.w3.org/1999/xhtml/vocab#up",this.target.graph.terms.p3pv1="http://www.w3.org/1999/xhtml/vocab#p3pv1",this.target.graph.terms.related="http://www.w3.org/1999/xhtml/vocab#related",this.target.graph.terms.role="http://www.w3.org/1999/xhtml/vocab#role",this.target.graph.terms.transformation="http://www.w3.org/1999/xhtml/vocab#transformation"}setXMLContext(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}tokenize(e){return this.trim(e).split(/\s+/)}static tokenize(e){return this.trim(e).split(/\s+/)}toRDFNodeObject(e){if(void 0!==e){if("string"==typeof e)return"_:"===e.substring(0,2)?(void 0===this.blankNodes[e.substring(2)]&&(this.blankNodes[e.substring(2)]=new a(e.substring(2))),this.blankNodes[e.substring(2)]):E.namedNode(e);switch(e.type){case ut.objectURI:return"_:"===e.value.substring(0,2)?(void 0===this.blankNodes[e.value.substring(2)]&&(this.blankNodes[e.value.substring(2)]=new a(e.value.substring(2))),this.blankNodes[e.value.substring(2)]):E.namedNode(e.value);case ut.PlainLiteralURI:return new h(e.value,e.language||"");case ut.XMLLiteralURI:case ut.HTMLLiteralURI:var t="";return Object.keys(e.value).forEach((r=>{t+=I.domToString(e.value[r],this.htmlOptions)})),new h(t,"",new l.Z(e.type));default:return new h(e.value,"",new l.Z(e.type))}}}trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}static trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}ut.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",ut.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",ut.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",ut.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",ut.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",ut.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",ut.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",ut.NCNAME=new RegExp("^"+ut.nameStartChar+ut.nameChar+"*$"),ut.dateTimeTypes=[{pattern:/-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,type:"http://www.w3.org/2001/XMLSchema#duration"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#dateTime"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#date"},{pattern:/(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#time"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,type:"http://www.w3.org/2001/XMLSchema#gYearMonth"},{pattern:/-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,type:"http://www.w3.org/2001/XMLSchema#gYear"}];const ht=ut.parseRDFaDOM;class dt{constructor(e){this.store=e,this.bnodes={},this.why=null,this.reify=!1}frameFactory(e,t,r){return{NODE:1,ARC:2,parent:t,parser:e,store:e.store,element:r,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(e,t){t=x.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var e=this.store.sym(x.join("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(dt.ns.RDF+"type"),this.store.sym(dt.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(dt.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(dt.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(dt.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e===dt.ns.RDF+"li"&&(e=dt.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.parent.datatype&&this.parent.datatype!==dt.ns.RDF+"langString"?this.node=this.store.literal(e,this.store.sym(this.parent.datatype)):this.node=this.store.literal(e,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}getAttributeNodeNS(e,t,r){var n=null;if(e.getAttributeNodeNS)n=e.getAttributeNodeNS(t,r);else for(var i,o=e.attributes,s=0;s<o.length;++s)if((i=o[s]).namespaceURI===t&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}parse(e,t,r){var n,i=e.childNodes;if(this.cleanParser(),e.nodeType===dt.nodeType.DOCUMENT){for(var o=0;o<i.length;o++)if(i[o].nodeType===dt.nodeType.ELEMENT){n=i[o];break}}else{if(e.nodeType!==dt.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+t+". Halting. ");n=e}this.why=r;var s=this.frameFactory(this);return this.base=t,s.base=t,s.lang=null,this.parseDOM(this.buildFrame(s,n)),!0}parseDOM(e){for(var t,r=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),n=!0;e.parent;){var i=e.element,o=i.attributes;if(i.nodeType===dt.nodeType.TEXT||i.nodeType===dt.nodeType.CDATA_SECTION)e.parent.nodeType===e.NODE&&(e.addArc(dt.ns.RDF+"value"),e=this.buildFrame(e)),e.addLiteral(i.nodeValue);else if(r(i)!==dt.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(r(i)),this.reify&&(t=this.getAttributeNodeNS(i,dt.ns.RDF,"ID"))&&(e.rdfid=t.nodeValue,i.removeAttributeNode(t));var s=this.getAttributeNodeNS(i,dt.ns.RDF,"parseType"),a=this.getAttributeNodeNS(i,dt.ns.RDF,"datatype");if(a&&(e.datatype=a.nodeValue,i.removeAttributeNode(a)),s){var l=s.nodeValue;"Literal"===l?(e.datatype=dt.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(i.childNodes),n=!1):"Resource"===l?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===l&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),i.removeAttributeNode(s)}if(0!==o.length){var c=this.getAttributeNodeNS(i,dt.ns.RDF,"resource"),u=this.getAttributeNodeNS(i,dt.ns.RDF,"nodeID");e=this.buildFrame(e),c?(e.addNode(c.nodeValue),i.removeAttributeNode(c)):u?(e.addBNode(u.nodeValue),i.removeAttributeNode(u)):e.addBNode();for(var h=o.length-1;h>=0;h--){var d=this.buildFrame(e);d.addArc(r(o[h])),r(o[h])===dt.ns.RDF+"type"?this.buildFrame(d).addNode(o[h].nodeValue):this.buildFrame(d).addLiteral(o[h].nodeValue)}}else 0===i.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var p=this.getAttributeNodeNS(i,dt.ns.RDF,"about");if(t=this.getAttributeNodeNS(i,dt.ns.RDF,"ID"),p&&t)throw new Error("RDFParser: "+i.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!p&&t)e.addNode("#"+t.nodeValue),i.removeAttributeNode(t);else if(null==p&&null==t){var f=this.getAttributeNodeNS(i,dt.ns.RDF,"nodeID");f?(e.addBNode(f.nodeValue),i.removeAttributeNode(f)):e.addBNode()}else e.addNode(p.nodeValue),i.removeAttributeNode(p);var g=this.getAttributeNodeNS(i,dt.ns.RDF,"type");dt.ns.RDF+"Description"!==r(i)&&(g={nodeValue:r(i)}),null!=g&&(this.store.add(e.node,this.store.sym(dt.ns.RDF+"type"),this.store.sym(x.join(g.nodeValue,e.base)),this.why),g.nodeName&&i.removeAttributeNode(g));for(var y=o.length-1;y>=0;y--)this.store.add(e.node,this.store.sym(r(o[y])),this.store.literal(o[y].nodeValue,e.lang),this.why)}for(i=e.element;e.parent;){for(var m=e;null==i;)i=(e=e.parent).element;var v=i.childNodes&&i.childNodes[e.lastChild];if(v&&n){if((v.nodeType===dt.nodeType.ELEMENT||v.nodeType===dt.nodeType.TEXT||v.nodeType===dt.nodeType.CDATA_SECTION)&&(v.nodeType!==dt.nodeType.TEXT&&v.nodeType!==dt.nodeType.CDATA_SECTION||1===i.childNodes.length)){e.lastChild++,e=this.buildFrame(m,i.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;i=e.element,n=!0}}}}cleanParser(){this.bnodes={},this.why=null}buildFrame(e,t){var r=this.frameFactory(this,e,t);if(e&&(r.base=e.base,r.lang=e.lang),!t||t.nodeType===dt.nodeType.TEXT||t.nodeType===dt.nodeType.CDATA_SECTION)return r;var n=t.attributes,i=t.getAttributeNode("xml:base");null!=i&&(r.base=i.nodeValue,t.removeAttribute("xml:base"));var o=t.getAttributeNode("xml:lang");null!=o&&(r.lang=o.nodeValue,t.removeAttribute("xml:lang"));for(var s=n.length-1;s>=0;s--)if("xml"===n[s].nodeName.substr(0,3)){if("xmlns:"===n[s].name.slice(0,6)){var a=n[s].nodeValue;this.base&&(a=x.join(a,this.base)),this.store.setPrefixForURI(n[s].name.slice(6),a)}t.removeAttributeNode(n[s])}return r}}function pt(e,t,r){var n,i,o,s=["INSERT","DELETE","WHERE"],a=S("http://www.w3.org/ns/pim/patch#"),l=_e(t,t,r,r,null,null,"",null),c={},u=function(e,t,r,n,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=t.sym(r+"#query");for(c.query=h;;){if((i=l.skipSpace(e,n))<0)return c;if(";"===e[i]){if((n=l.skipSpace(e,i+1))<0)return c;i=n}var d=!1;for(o=0;o<s.length;o++){var p=s[o];if(e.slice(i,i+p.length)===p){if((n=l.skipSpace(e,i+p.length))<0)throw u(l._thisDoc,l.lines,e,i+p.length,"found EOF, needed {...} after "+p);if(("INSERT"===p||"DELETE"===p)&&"DATA"===e.slice(n,n+4)){if((i=l.skipSpace(e,n+4))<0)throw u(l._thisDoc,l.lines,e,n+4,"needed {...} after INSERT DATA "+p);n=i}var f=[];if((i=l.node(e,n,f))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF in {...} after "+p);c[p.toLowerCase()]=f[0],t.add(h,a(p.toLowerCase()),f[0]),d=!0,n=i}}if(!d&&"@prefix"===e.slice(i,i+7)){if((n=l.directive(e,i))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF after @prefix ");n=l.checkDot(e,n),d=!0}if(!d)throw u(l._thisDoc,l.lines,e,i,"Unknown syntax at start of statememt: '"+e.slice(i).slice(0,20)+"'")}}function ft(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=n||o.z8,n=n.split(";")[0];try{if(n===o.qS||n===o.z8){var s=_e(t,t,r,r,null,null,"",null);s.loadBuf(e),c()}else if(n===o.Is){var a=new dt(t);a.parse(I.parseXML(e),r,t.sym(r)),c()}else if(n===o.D7)ht(I.parseXML(e,{contentType:o.D7}),t,r),c();else if(n===o.us)ht(I.parseXML(e,{contentType:o.us}),t,r),c();else if(n===o.oW||n===o.xm)pt(e,t,r),c();else if(n===o.ui)Se(e,t,r,c);else{if(n!==o.b4&&n!==o.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var l=new ot({factory:Ee});h(null,e)}}catch(e){u(e)}function c(){i&&i(null,t)}function u(e){if(n!==o.ui||n!==o.b4||n!==o.lL){if(!i){let t=new Error(e+" while trying to parse <"+r+"> as "+n);throw t.cause=e,t}i(e,t)}}function h(e,r){e&&i(e,t);try{l.parse(r,d)}catch(e){i(e,t)}}function d(e,r){r?t.add(r.subject,r.predicate,r.object,r.graph):i(e,t)}ft.handled={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/sparql-update":!0,"application/sparql-update-single-match":!0,"application/ld+json":!0,"application/nquads":!0,"application/n-quads":!0}}(0,e.Z)(dt,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,e.Z)(dt,"nodeType",{ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12});var gt=n(7297),yt=n.n(gt),mt=n(2598),vt=n(292);const bt={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},wt={rdf:o.Is,owl:o.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},xt=e=>({link:S("http://www.w3.org/2007/ont/link#",e),http:S("http://www.w3.org/2007/ont/http#",e),httph:S("http://www.w3.org/2007/ont/httph#",e),rdf:S("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:S("http://www.w3.org/2000/01/rdf-schema#",e),dc:S("http://purl.org/dc/elements/1.1/",e),ldp:S("http://www.w3.org/ns/ldp#",e)}),_t=xt();class Tt{constructor(t,r){(0,e.Z)(this,"response",void 0),(0,e.Z)(this,"dom",void 0),this.response=t,this.dom=r}}(0,e.Z)(Tt,"pattern",void 0);class Nt extends Tt{static toString(){return"RDFXMLHandler"}static register(e){e.mediatypes[o.Is]={q:.9}}parse(e,t,r){let n=e.store;if(this.dom||(this.dom=I.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");let i=new dt(n);try{i.parse(this.dom,r.original.value,r.original)}catch(t){return e.failFetch(r,"Syntax error parsing RDF/XML! "+t,"parse_error")}return r.noMeta||n.add(r.original,_t.rdf("type"),_t.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}Nt.pattern=new RegExp("application/rdf\\+xml");class jt extends Tt{static toString(){return"XHTMLHandler"}static register(e){e.mediatypes[o.D7]={}}parse(e,t,r){let n,i;this.dom||(this.dom=I.parseXML(t));let o=e.store,s=this.dom.getElementsByTagName("title");s.length>0&&o.add(r.resource,_t.dc("title"),o.rdfFactory.literal(s[0].textContent),r.resource);let a=this.dom.getElementsByTagName("link");for(let t=a.length-1;t>=0;t--)n=a[t].getAttribute("rel"),i=!1,n||(n=a[t].getAttribute("rev"),i=!0),n&&e.linkData(r.original,n,a[t].getAttribute("href"),r.resource,i);let l=this.dom.getElementsByTagName("script");for(let e=0;e<l.length;e++){let t=l[e].getAttribute("type");bt[t]&&(ft(l[e].textContent,o,r.original.value,t),ft(l[e].textContent,o,r.original.value,t))}if(r.noMeta||o.add(r.resource,_t.rdf("type"),_t.link("WebPage"),e.appNode),!r.noRDFa&&ht)try{ht(this.dom,o,r.original.value)}catch(t){let n="Error trying to parse "+r.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(r,n,"parse_error")}return e.doneFetch(r,this.response)}}jt.pattern=new RegExp("application/xhtml");class Et extends Tt{static toString(){return"XMLHandler"}static register(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}static isElement(e){return e.nodeType===Node.ELEMENT_NODE}parse(e,t,r){let n=I.parseXML(t);for(let i=0;i<n.childNodes.length;i++){const o=n.childNodes[i];if(Et.isElement(o)){let i=o.namespaceURI;if(i&&i===i.rdf)return e.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new Nt(this.response,n).parse(e,t,r);break}}if(n.doctype&&"html"===n.doctype.name&&n.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&n.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new jt(this.response,n).parse(e,t,r);let i=n.getElementsByTagName("html")[0];if(i){let o=i.getAttribute("xmlns");if(o&&o.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new jt(this.response,n).parse(e,t,r)}return e.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}Et.pattern=new RegExp("(text|application)/(.*)xml");class Ot extends Tt{static toString(){return"HTMLHandler"}static register(e){e.mediatypes["text/html"]={q:.9}}parse(e,t,r){let n=e.store;if(Rt(t))return e.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new jt(this.response).parse(e,t,r);if(function(e){const t=e.indexOf("<!DOCTYPE html"),r=e.indexOf(">");return!(-1===t||-1===r||t>r)&&-1!==e.substr(t,r-t).indexOf("XHTML")}(t))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new jt(this.response).parse(e,t,r);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new jt(this.response).parse(e,t,r);let i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&n.add(r.resource,_t.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,_t.rdf("type"),_t.link("WebPage"),e.appNode),e.addStatus(r.req,"non-XML HTML document, not parsed for data."),e.doneFetch(r,this.response)}}Ot.pattern=new RegExp("text/html");class St extends Tt{static toString(){return"JsonLdHandler"}static register(e){e.mediatypes["application/ld+json"]={q:.9}}parse(e,t,r,n){const i=e.store;return new Promise(((o,s)=>{try{Se(t,i,r.original.value,(()=>{o(e.doneFetch(r,n))}))}catch(t){const i="Error trying to parse "+r.resource+" as JSON-LD:\n"+t;o(e.failFetch(r,i,"parse_error",n))}}))}}St.pattern=/application\/ld\+json/;class It extends Tt{static toString(){return"TextHandler"}static register(e){e.mediatypes["text/plain"]={q:.5}}parse(e,t,r){return Rt(t)?(e.addStatus(r.req,"Warning: "+r.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Et(this.response).parse(e,t,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Et(this.response).parse(e,t,r)):(e.addStatus(r.req,"Plain text document, no known RDF semantics."),e.doneFetch(r,this.response))}}It.pattern=new RegExp("text/plain");class At extends Tt{static toString(){return"N3Handler"}static register(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}parse(e,t,r,n){let i=e.store,o=_e(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(t)}catch(t){let i="Error trying to parse "+r.resource+" as Notation3:\n"+t;return e.failFetch(r,i,"parse_error",n)}return e.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(r.original,_t.rdf("type"),_t.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}At.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");const kt={RDFXMLHandler:Nt,XHTMLHandler:jt,XMLHandler:Et,HTMLHandler:Ot,TextHandler:It,N3Handler:At,JsonLdHandler:St};function Rt(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}class Ct{constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,e.Z)(this,"store",void 0),(0,e.Z)(this,"timeout",void 0),(0,e.Z)(this,"_fetch",void 0),(0,e.Z)(this,"mediatypes",void 0),(0,e.Z)(this,"appNode",void 0),(0,e.Z)(this,"requested",void 0),(0,e.Z)(this,"timeouts",void 0),(0,e.Z)(this,"redirectedTo",void 0),(0,e.Z)(this,"fetchQueue",void 0),(0,e.Z)(this,"fetchCallbacks",void 0),(0,e.Z)(this,"nonexistent",void 0),(0,e.Z)(this,"lookedUp",void 0),(0,e.Z)(this,"handlers",void 0),(0,e.Z)(this,"ns",void 0),(0,e.Z)(this,"fireCallbacks",void 0),this.store=t||new ee,this.ns=xt(this.store.rdfFactory),this.timeout=r.timeout||3e4,this._fetch=r.fetch||void 0!==n.g&&(n.g.solidFetcher||n.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||yt(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},I.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(r.handlers||kt).map((e=>this.addHandler(kt[e])))}static crossSiteProxy(e){return Ct.crossSiteProxyTemplate?Ct.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}static offlineOverride(e){let t=e;var r;return"undefined"!=typeof window&&window.panes&&(r=window.panes.UI)&&r.preferences&&r.preferences.get("offlineModeUsingLocalhost")&&"http://"===t.slice(0,7)&&"localhost/"!==t.slice(7,17)&&(t="http://localhost/"+t.slice(7),O.Z.warn("Localhost kludge for offline use: actually getting <"+t+">")),t}static proxyIfNecessary(e){var t;if("undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){let t=e.split("/").slice(2);const r=(e,t)=>{let n=t[e.shift()];return n?"string"==typeof n?n+e.join("/"):e?r(e,n):null:null},n=r(t,$SolidTestEnvironment.localSiteMap);if(n)return n}return Ct.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?Ct.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}static unsupportedProtocol(e){let t=x.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}static setCredentials(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}load(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=Object.assign({},t),e instanceof Array)return Promise.all(e.map((e=>this.load(e,Object.assign({},t)))));const r=e;let n=(0,mt._)(r);n=n.split("#")[0],t=this.initFetchOptions(n,t);const i=this.initFetchOptions(n,t);return this.pendingFetchPromise(n,i.baseURI,i)}async pendingFetchPromise(e,t,r){let n;return!r.force&&await this.fetchQueue[t]?n=this.fetchQueue[t]:(n=Promise.race([this.setRequestTimeout(e,r),this.fetchUri(e,r)]),this.fetchQueue[t]=n,this.cleanupFetchRequest(t,void 0,this.timeout)),n.then((t=>(e in this.timeouts&&(this.timeouts[e].forEach(clearTimeout),delete this.timeouts[e]),t)))}cleanupFetchRequest(e,t,r){void 0!==t&&vt.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{this.isPending(e)||delete this.fetchQueue[e]}),r))}initFetchOptions(e,t){let r=this.store;!t.method||"GET"===t.method.toUpperCase()||(t.force=!0),t.resource=r.rdfFactory.namedNode(e),t.baseURI=t.baseURI||e,t.original=r.rdfFactory.namedNode(t.baseURI),t.req=r.bnode(),t.headers=t.headers||new gt.Headers,t.contentType&&(t.headers["content-type"]=t.contentType),t.force&&(t.cache="no-cache");let n=this.acceptString();t.headers.accept=n;let i=Ct.offlineOverride(e);t.requestedURI=i,Ct.setCredentials(i,t);let o=Ct.proxyIfNecessary(i);return i!==o&&(t.proxyUsed=!0),t.actualProxyURI=o,t}fetchUri(e,t){if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(Ct.unsupportedProtocol(e))return this.failFetch(t,"fetcher: Unsupported protocol","unsupported_protocol");let r=this.getState(e);if(t.force)delete this.nonexistent[e];else{if("fetched"===r)return Promise.resolve(this.doneFetch(t,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===r&&404===this.requested[e]){let r="Previously failed: "+this.requested[e],n={url:e,status:this.requested[e],statusText:r,responseText:r,headers:new gt.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(t,r,this.requested[e],n)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,t.noMeta||this.saveRequestMetadata(e,t);let{actualProxyURI:n}=t;return this._fetch(n,t).then((r=>this.handleResponse(r,e,t)),(r=>{let i={url:n,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new gt.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return vt.log("Fetcher: <"+n+"> Non-HTTP fetch exception: "+r),this.handleError(i,e,t)}))}nowOrWhenFetched(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,mt._)(e);"function"==typeof t?r=t:void 0===t||((0,c.NX)(t)?n.referringTerm=t:n=t),this.load(i,n).then((e=>{if(r)if(e)if(e.ok)r(!0,"OK",e);else{let t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),vt.log(t+" fetching "+i),r(!1,t,e)}else{let e="@@ nowOrWhenFetched: no response object!";vt.log(e),r(!1,e)}}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,vt.log(t),e.response&&e.response.status&&(t+=" status: "+e.response.status),r(!1,t,e.response)}))}addStatus(e,t){let r=new Date;t="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+t;let n=this.store;const i=n.the(e,this.ns.link("status"));(0,c.uZ)(i)?i.append(n.rdfFactory.literal(t)):O.Z.warn("web.js: No list to add to: "+i+","+t)}failFetch(e,t,r,n){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));let i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[x.docpart(e.original.value)]=r,this.fireCallbacks("fail",[e.original.value,t]));var o=new Error("Fetcher: "+t);return o.status=r,o.statusText=t,o.response=n,Promise.reject(o)}linkData(e,t,r,n,i){if(!r)return;let o,s=this.store,a=s.rdfFactory.namedNode(x.join(r,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(a.value===e.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===t?s.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):s.rdfFactory.namedNode(x.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?s.add(a,o,e,n):s.add(e,o,a,n)}parseLinkHeader(e,t,r){if(!e)return;const n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(let e=0;e<i.length;e++){let o=i[e].split(">"),s=o[0].substring(1),a=o[1].match(n);if(null==a)return;for(let e=0;e<a.length;e++){let n=a[e].split("=")[1].replace(/["']/g,"");this.linkData(t,n,s,r)}}}doneFetch(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}nowKnownAs(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}putBack(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,mt._)(e);let n=new l.Z(r).doc();return t.contentType=t["content-type"]||t["Content-Type"]||t.contentType||o.z8,"application/ld+json"===t.contentType?new Promise(((r,i)=>{F(n,this.store,n.uri,t.contentType,((n,o)=>{n?i(n):(t.data=o,this.webOperation("PUT",e,t).then((e=>r(e))).catch((e=>i(e))))}))})):(t.data=F(n,this.store,n.value,t.contentType),this.webOperation("PUT",r,t))}webCopy(e,t,r){return this.webOperation("GET",e).then((e=>this.webOperation("PUT",t,{data:e.responseText,contentType:r})))}delete(e,t){return this.webOperation("DELETE",e,t).then((t=>(this.requested[e]=404,this.nonexistent[e]=!0,this.unload(this.store.rdfFactory.namedNode(e)),t)))}async createIfNotExists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:o.z8,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=this;try{var i=await n.load(e)}catch(o){if(404===o.response.status){vt.log("createIfNotExists: doc does NOT exist, will create... "+e);try{i=await n.webOperation("PUT",e.value,{data:r,contentType:t})}catch(t){throw vt.log("createIfNotExists doc FAILED: "+e+": "+t),t}return delete n.requested[e.value],i}throw vt.log("createIfNotExists doc load error NOT 404: "+e+": "+o),o}return i}createContainer(e,t,r){let n={"content-type":o.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(n.slug=t);let i={headers:n};return r&&(i.body=r),this.webOperation("POST",e,i)}invalidateCache(e){const t=(0,mt._)(e),r=this;if(r.fetchQueue&&r.fetchQueue[t]&&(vt.log("Internal error - fetchQueue exists "+t),"resolved"===r.fetchQueue[t].PromiseStatus?delete r.fetchQueue[t]:(delete r.fetchQueue[t],vt.log("*** Fetcher: pending fetchQueue deleted "+t))),r.requested[t]&&"done"!==r.requested[t]&&"failed"!==r.requested[t]&&404!==r.requested[t]){let e=`Rdflib: fetcher: Destructive operation on <${r.requested[t]}> file being fetched! `+t;vt.error(e)}else delete r.requested[t],delete r.nonexistent[t]}webOperation(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,mt._)(t);r.method=e,r.body=r.data||r.body,r.force=!0;const i=this;if(r.body&&!r.contentType)throw new Error("Web operation sending data must have a defined contentType.");return r.contentType&&(r.headers=r.headers||{},r.headers["content-type"]=r.contentType),Ct.setCredentials(n,r),new Promise((function(t,o){i._fetch(n,r).then((r=>{if(r.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||i.invalidateCache(n),r.text?r.text().then((e=>{r.responseText=e,t(r)})):t(r);else{let t="Web error: "+r.status;r.statusText&&(t+=" ("+r.statusText+")"),t+=" on "+e+" of <"+n+">",r.responseText&&(t+=": "+r.responseText);let i=new Error(t);i.response=r,o(i)}}),(t=>{o(new Error("Fetch error for "+e+" of <"+n+">:"+t))}))}))}lookUpThing(e,t){let r=this.store.uris(e);return r=r.map((e=>x.docpart(e))),r.forEach((e=>{this.lookedUp[e]=!0})),this.load(r,{referringTerm:t})}getHeader(e,t){const r=this.store,n=e.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n));for(let e=0;e<i.length;e++){let n=i[e];if(void 0!==n){let e=r.any(n,this.ns.link("response"));if(void 0!==e&&r.anyValue(e,this.ns.http("status"))&&r.anyValue(e,this.ns.http("status")).startsWith("2")){let n=r.each(e,this.ns.httph(t.toLowerCase()));return n.length?n.map((e=>e.value)):[]}}}}saveRequestMetadata(e,t){let r=t.req,n=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),(0,c.NX)(i)&&n.add(n.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(t.original.value),this.appNode);const o=new Date,s="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(s+" Request for "+e),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(e),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}saveResponseMetadata(e,t){const r=this.store;let n=r.bnode();return r.add(t.req,this.ns.link("response"),n,n),r.add(n,this.ns.http("status"),r.rdfFactory.literal(e.status),n),r.add(n,this.ns.http("statusText"),r.rdfFactory.literal(e.statusText),n),e.headers.forEach(((e,i)=>{r.add(n,this.ns.httph(i),this.store.rdfFactory.literal(e),n),"content-type"===i&&r.add(t.resource,this.ns.rdf("type"),r.rdfFactory.namedNode(I.mediaTypeClass(e).value),n)})),n}objectRefresh(e){let t=this.store.uris(e);if(void 0!==t)for(let e=0;e<t.length;e++)this.refresh(this.store.rdfFactory.namedNode(x.docpart(t[e])))}refresh(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}refreshIfExpired(e,t){let r=this.getHeader(e,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}retract(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[x.docpart(e.value)],this.fireCallbacks("retract",arguments)}getState(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}isPending(e){return!0===this.requested[e]}unload(e){this.store.removeDocument(e),delete this.requested[e.value]}addHandler(e){this.handlers.push(e),e.register(this)}retryNoCredentials(e,t){vt.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+t.resource),t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];let r=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,r)}isCrossSite(e){if("undefined"==typeof document||!document.location)return!1;const t=x.hostpart,r=""+document.location;return(t(r)&&t(e)&&t(r))!==t(e)}handleError(e,t,r){if(this.isCrossSite(t)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(t,r);let e=Ct.crossSiteProxy(t);if(e&&!r.proxyUsed)return vt.log("web: Direct failed so trying proxy "+e),this.redirectToProxy(e,r)}var n;return e instanceof Error?n="Fetch error: "+e.message:(n=e.statusText,e.responseText&&(n+=` ${e.responseText}`)),this.failFetch(r,n,e.status||998,e)}addType(e,t,r,n){let i=t;if(n){var o=r.any(i,this.ns.link("requestedURI"));o&&o.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),e,this.appNode)}for(;;){const t=r.any(i,this.ns.link("requestedURI"));if(t&&t.value&&r.add(r.rdfFactory.namedNode(t.value),this.ns.rdf("type"),e,this.appNode),i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i),!i)break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var a=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!a)break;if("301"!==a&&"302"!==a)break}}handleResponse(e,t,r){const n=this.store,i=e.headers,o=r.req,s=this.saveResponseMetadata(e,r),a=this.normalizedContentType(r,i)||"";let l=i.get("content-location");if(0===e.status)return vt.log("Masked error - status 0 for "+t),this.handleError(e,t,r);if(e.status>=400)return 404===e.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((()=>{let t=r.resource+" "+e.statusText;return this.failFetch(r,t,e.status,e)}));var c=null,u=null;if(l&&(u=x.join(l,t))!==t&&(c=u),200===e.status){this.addType(this.ns.link("Document"),o,n,t),c&&this.addType(this.ns.link("Document"),o,n,c),r.clearPreviousData&&n.removeDocument(r.resource);let e=a.includes("image/")||a.includes("application/pdf");a&&e&&(this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,t),c&&this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,c))}if(l){if(!r.force&&c&&"done"===this.requested[u])return this.doneFetch(r,e);this.requested[u]=!0}this.parseLinkHeader(i.get("link"),r.original,o);let h=this.handlerForContentType(a,e);return h?e.text().then((t=>(e.responseText=t,h.parse(this,t,r,e)))):(this.addStatus(o,"Fetch over. No data handled."),this.doneFetch(r,e))}saveErrorResponse(e,t){let r=this.store;return e.text().then((e=>{e.length>10&&r.add(t,this.ns.http("content"),r.rdfFactory.literal(e),t)}))}handlerForContentType(e,t){if(!e)return null;let r=this.handlers.find((t=>e.match(t.pattern)));return r?new r(t):null}guessContentType(e){return wt[e.split(".").pop()]}normalizedContentType(e,t){if(e.forceContentType)return e.forceContentType;let r=t.get("content-type");if(!r||r.includes("application/octet-stream")){let t=this.guessContentType(e.resource.value);if(t)return t}let n=x.protocol(e.resource.value);return!r&&["file","chrome"].includes(n)?"text/xml":r}redirectToProxy(e,t){this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;const r=this.store,n=t.req;t.noMeta||(r.add(n,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(e),n),this.addStatus(n,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;let i=Object.assign({},t);return i.baseURI=t.resource.value,this.fetchUri(e,i).then((e=>(i.noMeta||r.add(n,this.ns.link("redirectedRequest"),i.req,this.appNode),e)))}setRequestTimeout(e,t){return new Promise((r=>{this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{!this.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(this.failFetch(t,`Request to ${e} timed out`,"timeout"))}),this.timeout))}))}addFetchCallback(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}acceptString(){let e="";for(let t in this.mediatypes){""!==e&&(e+=", "),e+=t;for(let r in this.mediatypes[t])e+=";"+r+"="+this.mediatypes[t][r]}return e}}(0,e.Z)(Ct,"HANDLERS",void 0),(0,e.Z)(Ct,"CONTENT_TYPE_BY_EXT",void 0),(0,e.Z)(Ct,"crossSiteProxyTemplate",void 0),Ct.HANDLERS=kt,Ct.CONTENT_TYPE_BY_EXT=wt;const Dt={parseJSON:function(e,t,r){var n,i,o,s={},a=r.sym(t);for(var l in e){0===l.indexOf("_:")?s[l]?n=s[l]:(n=r.bnode(l),s[l]=n):n=r.sym(l);var c=e[l];for(var u in c){var h=c[u];for(var d in i=r.sym(u),h){var p=h[d];if("uri"===p.type)o=r.sym(p.value),r.add(n,i,o,a);else if("BlankNode"===p.type)s[p.value]?o=s[p.value]:(o=r.bnode(p.value),s[p.value]=o),r.add(n,i,o,a);else{if("Literal"!==p.type)throw new Error("error: unexpected termtype: "+d.type);o=p.datatype?r.literal(p.value,void 0,r.sym(p.datatype)):p.lang?r.literal(p.value,p.lang):r.literal(p.value),r.add(n,i,o,a)}}}}}};function Lt(e){var t=0;function r(e){var t="",r=e.statements;for(var n in r)O.Z.debug("Found statement: "+r),t+=s()+r[n]+"\n";return t}function n(e){var t="";for(var r in e.constraints){var n=e.constraints[r];t+=s()+"FILTER ( "+n.describe(r)+" ) \n"}return t}function i(e){for(var o="",a=0;a<e.optional.length;a++)O.Z.debug("Found optional query"),o+=s()+"OPTIONAL { \n",t++,o+=r(e.optional[a]),o+=n(e.optional[a]),o+=i(e.optional[a]),t--,o+=s()+"}\n";return o}function o(e){var o=s()+"WHERE \n{ \n";return t++,o+=r(e),o+=n(e),o+=i(e),t--,o+"}"}function s(){for(var e="",r=0;r<t;r++)e+=" ";return e}return function(e){return function(e){for(var t=s()+"SELECT ",r=0;r<e.vars.length;r++)t+=e.vars[r]+" ";return t+"\n"}(e)+o(e.pat)}(e)}function Pt(e,t,r){var n=[];function i(e){if(n[e])return n[e];var t=r.variable(e);return n[e]=t,t}function o(e){return"string"==typeof e&&e.match(/[^ \n\t]/)}function s(e){return"string"==typeof e&&e.match(/^[\?\$]/)}function a(e){return"string"==typeof e?e.replace(/^</,"<").replace(/>$/,">"):e}function l(e){return"string"==typeof e&&e.match(/^<[^>]*>$/)}function c(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function u(e){return"string"==typeof e&&e.match(/:$/)}function h(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function d(e){return e.split(":")[0]}function p(e){return e.split(":")[1]}function f(e){return l(e)?e.slice(1,e.length-1):e}function g(e){var t=-1===e.indexOf("'")?null:e.indexOf("'"),n=-1===e.indexOf('"')?null:e.indexOf('"');if(!t&&!n){var i=new Array(1);return i[0]=e,i}var o,s,a=new Array(2);if(!t||n&&n<t)o='"',s=n;else{if(n&&!(t&&t<n))return O.Z.error("SQARQL QUERY OOPS!"),a;o="'",s=t}a[0]=e.slice(0,s);var l,c=e.slice(s+1).indexOf(o);return-1===c?(O.Z.error("SPARQL parsing error: no matching parentheses in literal "+e),e):(e.slice(c+s+2).match(/^\^\^/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),r.sym(f(e.slice(s+4+c,s+2+c+l)))),a=a.concat(g(e.slice(c+s+3+l)))):e.slice(c+s+2).match(/^@/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),e.slice(s+3+c,s+2+c+l),null),a=a.concat(g(e.slice(c+s+2+l)))):(a[1]=r.literal(e.slice(s+1,s+1+c)),O.Z.info("Literal found: "+a[1]),a=a.concat(g(e.slice(c+s+2)))),a)}function y(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),O.Z.info("New str into spaceDelimit: \n"+e);var t=[],r=e.split(" ");for(var n in r)o(r[n])&&(t=t.concat(r[n]));return t}function m(e,t){for(var r=0;r<t.length;r++)if("string"==typeof t[r]&&t[r].toLowerCase()===e.toLowerCase())return r;return null}function v(e,t){for(var r=[],n=0;n<t.length;n++)"string"==typeof t[n]&&t[n].toLowerCase()===e.toLowerCase()&&r.push(n);return r}function b(e,t,r){O.Z.info("Looking for a close bracket of type "+r+" in "+e);for(var n=0,i=0;i<e.length;i++)if(e[i]===t&&n++,e[i]===r&&n--,n<0)return i;return O.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(e){return this.describe=function(t){return t+" = "+e.toNT()},this.test=function(t){return e.equals(t)},this}function x(e){this.describe=function(t){return"REGEXP( '"+e+"' , "+t+" )"},this.test=function(t){var r=new RegExp(e);return!!t.value&&r.test(t.value)}}function _(e,t){3!==e.length||"Variable"!==e[0].termType||"NamedNode"!==e[2].termType&&"Literal"!==e[2].termType?6===e.length&&"string"==typeof e[0]&&"regexp"===e[0].toLowerCase()&&"("===e[1]&&")"===e[5]&&","===e[3]&&"Variable"===e[4].termType&&"Literal"===e[2].termType&&(O.Z.debug("Constraint added: "+e),t.constraints[e[4]]=new x(e[2].value)):"="===e[1]||">"===e[1]||"<"===e[1]?(O.Z.debug("Constraint added: "+e),t.constraints[e[0]]=new w(e[2])):O.Z.warn("I don't know how to handle the constraint: "+e)}function T(e,t){O.Z.debug("Optional query: "+e+" not yet implemented.");var n=r.formula();N(e,n),t.optional.push(n)}function N(e,t){var n,o,u=function(e){for(var t=[],n=0;n<e.length;n++)"string"==typeof e[n]?(e[n]=a(e[n]),s(e[n])?t[n]=i(e[n].slice(1)):c(e[n])?(O.Z.info(e[n]+" was identified as a bnode."),t[n]=r.bnode()):l(e[n])?(O.Z.info(e[n]+" was identified as a symbol."),t[n]=r.sym(f(e[n]))):h(e[n])?(O.Z.info(e[n]+" was identified as a prefixed symbol"),S[d(e[n])]?t[n]=r.sym(e[n]=S[d(e[n])]+p(e[n])):(O.Z.error("SPARQL error: "+e[n]+" with prefix "+d(e[n])+" does not have a correct prefix entry."),t[n]=e[n])):t[n]=e[n]):t[n]=e[n];return t}(e);for(O.Z.debug("WHERE: "+u);m("OPTIONAL",u);)o=m("OPTIONAL",u),O.Z.debug("OPT: "+o+" "+u[o]+" in "+u),"{"!==u[o+1]&&O.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(u.slice(o+2),"{","}"))?O.Z.error("No matching bracket in word "+o):(T(u.slice(o+2,o+2+n),t),o=m("OPTIONAL",u),n=b(u.slice(o+2),"{","}"),u.splice(o,n+3));for(O.Z.debug("WHERE after optionals: "+u);m("FILTER",u);){var g=m("FILTER",u);"("!==u[g+1]&&O.Z.warn("Bad filter opening bracket in word "+g),-1===(n=b(u.slice(g+2),"(",")"))?O.Z.error("No matching bracket in word "+g):(_(u.slice(g+2,g+2+n),t),g=m("FILTER",u),n=b(u.slice(g+2),"(",")"),u.splice(g,n+3))}O.Z.debug("WHERE after filters and optionals: "+u),function(e,t){var r=new Array(1);r[0]=-1;for(var n=r.concat(v(".",e)),i=[],o=0;o<n.length-1;o++)i[o]=e.slice(n[o]+1,n[o+1]);for(o in i){O.Z.info("s+p+o "+o+" = "+i[o]);var s=i[o][0];i[o].splice(0,1);var a=r.concat(v(";",i[o]));a.push(i[o].length);for(var l=[],c=0;c<a.length-1;c++)l[c]=i[o].slice(a[c]+1,a[c+1]);for(o in l){O.Z.info("p+o "+o+" = "+i[o]);var u=l[o][0];l[o].splice(0,1);var h=r.concat(v(",",l[o]));h.push(l[o].length);var d=[];for(c=0;c<h.length-1;c++)d[c]=l[o].slice(h[c]+1,h[c+1]);for(o in d){var p=d[o][0];O.Z.info("Subj="+s+" Pred="+u+" Obj="+p),t.add(s,u,p)}}}}(u,t)}O.Z.info("SPARQL input: \n"+e);var j=new J,E=function(e){var t=g(e),r=[];for(var n in t)r="string"==typeof t[n]?r.concat(y(t[n])):r.concat(t[n]);return r=function(e){for(var t=e,r=0;r<t.length;r++)if("a"===t[r]&&(t[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===t[r]&&"of"===t[r+2]){t.splice(r,1),t.splice(r+1,1);var n=t[r-1];t[r-1]=t[r+1],t[r+1]=n}return t}(r),O.Z.info("SPARQL Tokens: "+r),r}(e),S=function(e){var t=v("PREFIX",e),r=[];for(var n in t){var i=e[t[n]+1],o=e[t[n]+2];if(u(i))if(l(o)){O.Z.info("Prefix found: "+i+" -> "+o);var s=d(i),a=f(o);r[s]=a}else O.Z.error("Invalid SPARQL symbol: "+o);else O.Z.error("Invalid SPARQL prefix: "+i)}return r}(E);S.rdf||(S.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),S.rdfs||(S.rdfs="http://www.w3.org/2000/01/rdf-schema#");var I=m("SELECT",E),A=m("WHERE",E);if(I<0||A<0||I>A)return O.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var r in O.Z.info("SPARQL vars: "+e),e)if(s(e[r])){O.Z.info("Added "+e[r]+" to query variables from SPARQL");var n=i(e[r].slice(1));t.vars.push(n),n.label=e[r].slice(1)}else O.Z.warn("Incorrect SPARQL variable in SELECT: "+e[r])}(E.slice(I+1,A),j),N(E.slice(A+2,E.length-1),j.pat),t)return j;for(var k in j.pat.statements){var R=j.pat.statements[k];"NamedNode"===R.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(R.subject,"sparql:"+R.subject),"NamedNode"===R.object.termType&&r.fetcher&&r.fetcher.lookUpThing(R.object,"sparql:"+R.object)}return j}class Mt{constructor(t){if((0,e.Z)(this,"store",void 0),(0,e.Z)(this,"ifps",void 0),(0,e.Z)(this,"fps",void 0),(0,e.Z)(this,"patchControl",void 0),(0,e.Z)(this,"ns",void 0),(t=t||new ee).updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new Ct(t)),this.store=t,t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=S("http://www.w3.org/2007/ont/link#"),this.ns.http=S("http://www.w3.org/2007/ont/http#"),this.ns.httph=S("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=S("http://www.w3.org/ns/ldp#"),this.ns.rdf=S("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=S("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=S("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=S("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}patchControlFor(e){return this.patchControl[e.value]||(this.patchControl[e.value]=[]),this.patchControl[e.value]}isHttpUri(e){return"http"===e.slice(0,4)}editable(e,t){if(!e)return!1;if(t||(t=this.store),e=(0,mt._)(e),!this.isHttpUri(e)&&t.holds(this.store.rdfFactory.namedNode(e),this.store.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.store.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var r,n,i=!1,o=t.each(void 0,this.ns.link("requestedURI"),(0,x.docpart)(e)),s=0;s<o.length;s++)if(void 0!==(r=o[s])){var a=t.any(r,this.ns.link("response"));if(void 0!==r){var l=t.anyValue(a,this.ns.httph("wac-allow"));if(l)for(var c of l.split(",")){var u=c.split("=");if(u[0].includes("user")&&!u[1].includes("write")&&!u[1].includes("append"))return!1}var h=t.each(a,this.ns.httph("accept-patch"));if(h.length)for(let e=0;e<h.length;e++){if((n=h[e].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(n.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var d=t.each(a,this.ns.httph("ms-author-via"));if(d.length)for(let e=0;e<d.length;e++){if((n=d[e].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(n.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(e))return!!l&&"LOCALFILE";var p=t.each(a,this.ns.http("status"));if(p.length)for(let e=0;e<p.length;e++)200!==p[e]&&404!==p[e]||(i=!0)}}if(0===o.length);else if(i)return!1}anonymize(e){return"_:"===e.toNT().substr(0,2)&&this.mentioned(e)?"?"+e.toNT().substr(2):e.toNT()}anonymizeNT(e){return this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" ."}nTriples(e){return`${e.subject.toNT()} ${e.predicate.toNT()} ${e.object.toNT()} .`}statementBnodes(e){return[e.subject,e.predicate,e.object].filter((function(e){return(0,c.B2)(e)}))}statementArrayBnodes(e){var t=[];for(let r=0;r<e.length;r++)t=t.concat(this.statementBnodes(e[r]));t.sort();var r=[];for(let e=0;e<t.length;e++)0!==e&&t[e].equals(t[e-1])||r.push(t[e]);return r}cacheIfps(){this.ifps={};var e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty"));for(let t=0;t<e.length;t++)this.ifps[e[t].value]=!0;this.fps={},e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(let t=0;t<e.length;t++)this.fps[e[t].value]=!0}bnodeContext2(e,t,r){var n,i,o=this.store.statementsMatching(void 0,void 0,e,t);for(let e=0;e<o.length;e++)if(this.fps[o[e].predicate.value]){if(!(n=o[e].subject).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}o=this.store.statementsMatching(e,void 0,void 0,t);for(let e=0;e<o.length;e++)if(this.ifps[o[e].predicate.value]){if(!(n=o[e].object).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}return null}bnodeContext1(e,t){for(var r=0;r<3;r++){var n=this.bnodeContext2(e,t,r);if(null!==n)return n}return this.store.connectedStatements(e,t)}mentioned(e){return 0!==this.store.statementsMatching(e,null,null,null).length||0!==this.store.statementsMatching(null,e).length||0!==this.store.statementsMatching(null,null,e).length}bnodeContext(e,t){var r=[];if(e.length){this.cacheIfps();for(let i=0;i<e.length;i++){var n=e[i];this.mentioned(n)&&(r=r.concat(this.bnodeContext1(n,t)))}}return r}statementContext(e){var t=this.statementBnodes(e);return this.bnodeContext(t,e.graph)}contextWhere(e){var t=this;return e&&0!==e.length?"WHERE { "+e.map((function(e){return t.anonymizeNT(e)})).join("\n")+" }\n":""}fire(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((()=>{if(!e)throw new Error("No URI given for remote editing operation: "+t);return n.noMeta=!0,n.contentType="application/sparql-update",n.body=t,this.store.fetcher.webOperation("PATCH",e,n)})).then((n=>{if(!n.ok){let r="UpdateManager: update failed for <"+e+"> status="+n.status+", "+n.statusText+"\n for query: "+t;throw new Error(r)}r(e,n.ok,n.responseText,n)})).catch((t=>{r(e,!1,t.message,t)}))}update_statement(e){if(!e||e.graph){var t=this,r=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.graph]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(r),set_object:function(e,r){var n=this.where;n+="DELETE DATA { "+this.statementNT+" } ;\n",n+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].value,n,r)}}}}insert_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}delete_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}requestDownstreamAction(e,t){var r=this.patchControlFor(e);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+t)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=t;else t(e)}clearUpstreamCount(e){this.patchControlFor(e).upstreamCount=0}getUpdatesVia(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}addDownstreamChangeListener(e,t){var r=this.patchControlFor(e);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(t),this.setRefreshHandler(e,(e=>{this.reloadAndSync(e)}))}reloadAndSync(e){var t=this.patchControlFor(e),r=this;if(t.reloading)t.outOfDate=!0;else{t.reloading=!0;var n=1e3,i=function(){r.reload(r.store,e,(function(e,r,o){if(e){if(t.downstreamChangeListeners)for(let e=0;e<t.downstreamChangeListeners.length;e++)t.downstreamChangeListeners[e]();t.reloading=!1,t.outOfDate&&(t.outOfDate=!1,i())}else t.reloading=!1,0===o.status&&(t.reloading=!0,setTimeout(i,n*=2))}))};i()}}setRefreshHandler(e,t){let r=this.getUpdatesVia(e);var n=t,i=this,o=this,s=1500,a=0;if(!r)return!1;r=(0,x.join)(r,e.value);const l=r.replace(/^http:/,"ws:").replace(/^https:/,"wss:");var c=function(){var t;if("undefined"!=typeof WebSocket)t=new WebSocket(l);else{if("undefined"==typeof window||!window.WebSocket)return;t=window.WebSocket(l)}t.onopen=function(){s=1500,this.send("sub "+e.value),a&&o.requestDownstreamAction(e,n)};var r=i.patchControlFor(e);r.upstreamCount=0,t.onerror=function(e){},t.onclose=function(e){s*=2,a+=1,setTimeout((function(){c()}),s)},t.onmessage=function(t){if(t.data&&"pub"===t.data.slice(0,3)){if("upstreamCount"in r&&(r.upstreamCount-=1,r.upstreamCount>=0))return;r.upstreamCount=0,i.requestDownstreamAction(e,n)}}};return c(),!0}updateMany(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e.concat(t).map((e=>e.why)),n=this,i=[];r.forEach((e=>{i.find((t=>t.equals(e)))||i.push(e)}));const o=i.map((r=>n.update(e.filter((e=>e.why.equals(r))),t.filter((e=>e.why.equals(r))))));return o.length,Promise.all(o)}update(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var o=this;return new Promise((function(r,s){o.update(e,t,(function(e,t,n){t?r():s(new Error(n))}),n,i)}))}try{var s=this.store,a=e?(0,c.Pv)(e)?e.statements:e instanceof Array?e:[e]:[],l=t?(0,c.Pv)(t)?t.statements:t instanceof Array?t:[t]:[];if(!(a instanceof Array))throw new Error("Type Error "+typeof a+": "+a);if(!(l instanceof Array))throw new Error("Type Error "+typeof l+": "+l);if(0===a.length&&0===l.length)return r(null,!0);var u=a.length?a[0].graph:l[0].graph;if(!u){let e="Error patching: statement does not specify which document to patch:"+a[0]+", "+l[0];throw new Error(e)}var h=this.patchControlFor(u),d=Date.now(),p=["subject","predicate","object","why"],f={delete:a,insert:l};["insert","delete"].map((function(e){f[e].map((function(e){if(!u.equals(e.graph))throw new Error("update: destination "+u+" inconsistent with delete quad "+e.graph);p.map((function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")}))}))}));var g=this.editable(u.value,s);if(!1===g)throw new Error("Update: Can't make changes in uneditable "+u);if(void 0===g){if(n)throw new Error("Update: Loaded "+u+"but stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(u).then((n=>{this.update(e,t,r,!0,i)}),(n=>{if(404!==n.response.status)throw new Error(`Update: Can't get updatability status ${u} before patching: ${n}`);this.update(e,t,r,!0,i)}))}if(g.indexOf("SPARQL")>=0){var y=[];a.length&&(y=this.statementArrayBnodes(a)),l.length&&(y=y.concat(this.statementArrayBnodes(l)));var m=this.bnodeContext(y,u),v=this.contextWhere(m),b="";if(v.length){if(a.length){b+="DELETE { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" }\n"}if(l.length){b+="INSERT { ";for(let e=0;e<l.length;e++)b+=this.anonymizeNT(l[e])+"\n";b+=" }\n"}b+=v}else{if(a.length){b+="DELETE DATA { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" } \n"}if(l.length){a.length&&(b+=" ; "),b+="INSERT DATA { ";for(let e=0;e<l.length;e++)b+=this.nTriples(l[e])+"\n";b+=" }\n"}}h.pendingUpstream=h.pendingUpstream?h.pendingUpstream+1:1,"upstreamCount"in h&&(h.upstreamCount+=1),this.fire(u.value,b,((e,t,n,i)=>{if(i.elapsedTimeMs=Date.now()-d,t){try{s.remove(a)}catch(e){t=!1,n="Remote Ok BUT error deleting "+a.length+" from store!!! "+e}for(let e=0;e<l.length;e++)s.add(l[e].subject,l[e].predicate,l[e].object,u)}if(r(e,t,n,i),h.pendingUpstream-=1,0===h.pendingUpstream&&h.downstreamAction){var o=h.downstreamAction;delete h.downstreamAction,o(u)}}),i)}else if(g.indexOf("DAV")>=0)this.updateDav(u,a,l,r,i);else{if(!(g.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+g+"' for "+u);try{this.updateLocalFile(u,a,l,r,i)}catch(e){r(u.value,!1,"Exception trying to write back file <"+u.value+">\n")}}}catch(e){r(void 0,!1,"Exception in update: "+e+"\n"+I.stackString(e))}}updateDav(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store;var s=o.any(e,this.ns.link("request"));if(!s)throw new Error("No record of our HTTP GET request for document: "+e);var a=o.any(s,this.ns.link("response"));if(!a)return null;var l=o.the(a,this.ns.httph("content-type")).value;let c=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)I.RDFArrayRemove(c,t[e]);for(let e=0;e<r.length;e++)c.push(r[e]);const u=this.serialize(e.value,c,l);var h,d=o.the(a,this.ns.httph("content-location"));return d&&(h=(0,x.join)(d.value,h)),i.contentType=l,i.noMeta=!0,i.body=u,o.fetcher.webOperation("PUT",h,i).then((i=>{if(!i.ok)throw new Error(i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,i.ok,i.responseText,i)})).catch((t=>{n(e.value,!1,t.message,t)}))}updateLocalFile(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=this.store;let s=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)I.RDFArrayRemove(s,t[e]);for(let e=0;e<r.length;e++)s.push(r[e]);var a=e.value.lastIndexOf(".");if(a<1)throw new Error("Rewriting file: No filename extension: "+e.value);var l=e.value.slice(a+1);let c=Ct.CONTENT_TYPE_BY_EXT[l];if(!c)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(e.value,s,c),i.contentType=c,o.fetcher.webOperation("PUT",e.value,i).then((i=>{if(!i.ok)return n(e.value,!1,i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,!0,"")}))}serialize(e,t,r){const n=this.store;let i;if("string"==typeof t)return t;var o=D(n);switch(o.suggestNamespaces(n.namespaces),o.setBase(e),r){case"text/xml":case"application/rdf+xml":i=o.statementsToXML(t);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":i=o.statementsToN3(t);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return i}put(e,t,r,n){const i=this.store;let o;return Promise.resolve().then((()=>(o=this.serialize(e.value,t,r),i.fetcher.webOperation("PUT",e.value,{contentType:r,body:o})))).then((r=>{if(!r.ok)return n(e.value,r.ok,r.error,r);delete i.fetcher.nonexistent[e.value],delete i.fetcher.requested[e.value],"string"!=typeof t&&t.map((e=>{i.addStatement(e)})),n(e.value,r.ok,"",r)})).catch((t=>{n(e.value,!1,t.message)}))}reload(e,t,r){var n=Date.now();e.fetcher.nowOrWhenFetched(t.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(e,i,o){if(e)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var s=Date.now()-n;t.reloadTimeTotal||(t.reloadTimeTotal=0),t.reloadTimeCount||(t.reloadTimeCount=0),t.reloadTimeTotal+=s,t.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}const Ft={...Ee,fetcher:(e,t)=>new Ct(e,t),graph(){return new ee(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)||{rdfFactory:Ee})},lit(e,t,r){return this.literal(""+e,t||r)},st(e,t,r,n){return this.quad(e,t,r,n)}},Ut=Ft;class Bt{constructor(e,t){this.parent=e,this.via=t,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(t),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(e){this.onError(e)}}_decode(e){var t,r,n,i,o,s,a;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=e.split("&")).length;r<n;r++)t=i[r],o.push(t.split("="));return o}())t=o[r],a=(s=[decodeURIComponent(t[0]),decodeURIComponent(t[1])])[1],null==i[n=s[0]]&&(i[n]=[]),i[n].push(a);return i}_send(e,t,r){var n,i;return i=[e,t,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}_subscribe(e){return this._send("sub",e,""),this.subscribed[e]=!0,this.subscribed[e]}onClose(e){var t;for(t in this.connected=!1,this.subscribed)this.pending[t]=!0;return this.subscribed={},this.subscribed}onError(e){throw new Error("onError"+e)}onMessage(e){var t,r;return"ping"===(r=e.data.split(" "))[0]?"function"==typeof(t=this.socket).send?t.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}onOpen(e){var t,r;for(r in this.connected=!0,t=[],this.pending)delete this.pending[r],t.push(this._subscribe(r));return t}subscribe(e){return this.connected?this._subscribe(e):(this.pending[e]=!0,this.pending[e])}}class qt{constructor(e){this.fetcher=e,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}onHeaders(e){var t,r,n;return null==e.headers||"undefined"==typeof WebSocket||null===WebSocket||(t=e.headers.etag,n=e.headers["updates-via"],r=e.uri,t&&n&&(this.graph[r]={etag:t,via:n},this.register(n,r))),!0}onUpdate(e,t){return this.fetcher.refresh(Ut.namedNode(e))}register(e,t){return null==this.via[e]&&(this.via[e]=new Bt(this,e)),this.via[e].subscribe(t)}}const Ht={};for(const e in Ut)"function"==typeof Ut[e]&&(Ht[e]=Ut[e].bind(Ut));const{fetcher:Zt,graph:$t,lit:zt,st:Vt,namedNode:Gt,variable:Jt,blankNode:Xt,defaultGraph:Wt,literal:Qt,quad:Yt,triple:Kt}=Ht,er=new $,tr=e=>er.fromNT(e),rr=z.fromValue,nr=a.nextId;class ir extends ee{constructor(t){super(t),(0,e.Z)(this,"fetcher",void 0),this.fetcher=new Ct(this,{})}}class or extends ir{constructor(t){super(t),(0,e.Z)(this,"updater",void 0),this.updater=new Mt(this)}}})(),i})()));
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("window")):"function"==typeof define&&define.amd?define(["window"],t):"object"==typeof exports?exports.$rdf=t(require("window")):e.$rdf=t(e.window)}(self,(e=>(()=>{var t={8333:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},7308:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={debug(e){},warn(e){},info(e){},error(e){},success(e){},msg(e){}}},6545:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(240),i=r(8333),o=r(4806),s=r(9247),a=r(2598),l=r(5904);class c extends o.Z{constructor(e){if(super((0,a._)(e)),(0,n.Z)(this,"termType",s.XM),(0,n.Z)(this,"classOrder",i.Z.NamedNode),!this.value)throw new Error("Missing IRI for NamedNode");if(!this.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(this.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.')}dir(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&t<r+2||t<0?null:new c(e.slice(0,t+1))}site(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",t+2);return new c(r<0?e.slice(0)+"/":e.slice(0,r+1))}doc(){return this.value.indexOf("#")<0?this:new c(this.value.split("#")[0])}toString(){return"<"+this.value+">"}id(){return this.value.split("#")[1]}get uri(){return this.value}set uri(e){this.value=e}static fromValue(e){return null==e||(0,l.jt)(e)?e:new c(e)}}},4806:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(240),i=r(292);class o{constructor(e){(0,n.Z)(this,"termType",void 0),(0,n.Z)(this,"classOrder",void 0),(0,n.Z)(this,"value",void 0),this.value=e}substitute(e){return i.log("@@@ node substitute"+this),this}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toCanonical()}sameTerm(e){return this.equals(e)}toCanonical(){return this.toNT()}toNT(){return this.toString()}toNQ(){return this.toNT()}toString(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}(0,n.Z)(o,"fromValue",void 0),(0,n.Z)(o,"toJS",void 0)},9247:(e,t,r)=>{"use strict";r.d(t,{D7:()=>T,Eo:()=>_,Is:()=>m,NK:()=>a,UH:()=>s,V1:()=>i,XM:()=>n,_A:()=>u,aV:()=>v,b4:()=>y,fb:()=>l,lL:()=>g,ls:()=>c,oW:()=>b,qS:()=>f,sZ:()=>p,ui:()=>d,us:()=>h,xH:()=>o,xm:()=>w,z8:()=>x});const n="NamedNode",i="BlankNode",o="Literal",s="Variable",a="DefaultGraph",l="Collection",c="Empty",u="Graph",h="text/html",d="application/ld+json",f="text/n3",p="application/n3",g="application/nquads",y="application/n-quads",v="application/n-triples",m="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",T="application/xhtml+xml"},3357:(e,t,r)=>{"use strict";r.r(t),r.d(t,{docpart:()=>s,document:()=>a,hostpart:()=>l,join:()=>c,protocol:()=>u,refTo:()=>h});var n=r(6545),i=r(292),o=o||i.log;function s(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function a(e){return new n.Z(s(e))}function l(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function c(e,t){var r,n,i,s,a,l=t.indexOf("#");if(l>0&&(t=t.slice(0,l)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(r=t.indexOf(":"),0===t.length)return e;if(r<0)return o("Invalid base: "+t+" in join with given: "+e),e;if(n=t.slice(0,+r+1||9e9),0===e.indexOf("//"))return n+e;if(t.indexOf("//",r)===r+1){if((i=t.indexOf("/",r+3))<0)return t.length-r-3>0?t+"/"+e:n+e}else if((i=t.indexOf("/",r+1))<0)return t.length-r-1>0?t+"/"+e:n+e;if(0===e.indexOf("/"))return t.slice(0,i)+e;if((s=(a=t.slice(i)).lastIndexOf("/"))<0)return n+e;for(s>=0&&s<a.length-1&&(a=a.slice(0,+s+1||9e9)),a+=e;a.match(/[^\/]*\/\.\.\//);)a=a.replace(/[^\/]*\/\.\.\//,"");return a=(a=a.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,i)+a}function u(e){const t=e.indexOf(":");return t<0?null:e.slice(0,t)}function h(e,t){var r,n,i,o,s,a,l,c,u,h,d,f,p=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=l=0,o=t.length;l<o&&t[r]===e[r];r=++l);if(e.slice(0,r).match(p)&&((n=t.indexOf("//"))<0&&(n=-2),i=t.indexOf("/",n+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[r]&&e.length===r)return t.slice(r);for(;r>0&&"/"!==t[r-1];)r--;if(r<3)return t;if(e.indexOf("//",r-2)>0||t.indexOf("//",r-2)>0)return t;if(e.indexOf(":",r)>0)return t;for(a=0,c=0,s=(h=e.slice(r)).length;c<s;c++)"/"===h[c]&&a++;if(0===a&&r<t.length&&"#"===t[r])return"./"+t.slice(r);if(0===a&&r===t.length)return"./";if(f="",a>0)for(u=1,d=a;d>=1?u<=d:u>=d;d>=1?++u:--u)f+="../";return f+t.slice(r)}},5115:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMParserFactory:()=>d,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>f,dtstamp:()=>g,dumpNode:()=>p,heavyCompare:()=>y,heavyCompareSPO:()=>v,linkRelationProperty:()=>u,log:()=>n.Z,mediaTypeClass:()=>c,output:()=>m,parseXML:()=>b,stackString:()=>_,string:()=>l,string_startswith:()=>x,uri:()=>i});var n=r(7308),i=r(3357),o=r(6545),s=r(870);e=r.hmd(e);var a=r(292);const l={template:function(e,t){for(var r=e.split("%s"),n="",i=0;i<t.length;i++)t[i]+="",n+=r[i]+t[i];return n+r.slice(t.length).join()}};function c(e){return e=e.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function u(e){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function h(e,t){e.callbacks={};for(var r=t.length-1;r>=0;r--)e.callbacks[t[r]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,r){e.callbacks[t].push(r)},e.removeCallback=function(t,r){for(var n=0;n<e.callbacks[t].length;n++)if(e.callbacks[t][n].name===r)return e.callbacks[t].splice(n,1),!0;return!1},e.insertCallback=function(t,r){e.callbacks[t].unshift(r)},e.fireCallbacks=function(t,r){var n,i=[],o=[],s=e.callbacks[t].length;let a;for(n=s-1;n>=0;n--)a=e.callbacks[t][n],a&&a.apply(e,r)&&i.push(a);for(n=i.length-1;n>=0;n--)o.push(i[n]);for(n=s;n<e.callbacks[t].length;n++)o.push(e.callbacks[t][n]);e.callbacks[t]=o}}function d(){return window.DOMParser?new s.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function f(e,t){var r=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){r[e]=!0}));var n=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){n[e]=!0})),p(e,t,r,n)}function p(e,t,r,n){var i,o="",s=[!1];if(void 0===e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var l=e.nodeName.toLowerCase();o+="<"+l;var c=[];for(i=e.attributes.length-1;i>=0;i--){var u=e.attributes[i];if(!(n&&n.length>0&&n[u.name]||/^\d+$/.test(u.name))){if("class"===u.name&&t&&t.replaceClassItemWith&&u.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var h=new RegExp(t.replaceClassItemWith.source,"g");u.value=u.value.replace(h,t.replaceClassItemWith.target).trim()}"class"===u.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===u.value||c.push(u.name+"='"+u.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,""")+"'")}}if(c.length>0&&(t&&t.sortAttributes&&c.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),o+=" "+c.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===l?"\n ":"",s.push("style"===l||"script"===l),i=0;i<e.childNodes.length;i++)o+=p(e.childNodes[i]);s.pop(),o+="body"===l?"</"+l+">\n":"</"+l+">"}}}else if(8===e.nodeType)o+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var d=e.nodeValue.replace(/\n+$/,"");o+=s[s.length-1]?d:d.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}else a.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),a.log(e);return o}function g(){var e=new Date,t=e.getYear()+1900,r=e.getMonth()+1,n=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),s<10&&(s="0"+s),t+"-"+r+"-"+n+"T"+i+":"+o+":"+s+"Z"}function y(e,t,r,n){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=r.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(r.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")};const s=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===s?0:o(e)>o(t)?1:o(e)<o(t)?-1:s:n&&e.uri&&t.uri?(n[e.uri]||e.uri).localeCompare(n[t.uri]||t.uri):s}function v(e,t,r,n){return y(e.subject,t.subject,r,n)||y(e.predicate,t.predicate,r,n)||y(e.object,t.object,r,n)}function m(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function b(t,r){return r=r||{},e&&e.exports?(new s.DOMParser).parseFromString(t,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new s.DOMParser).parseFromString(t,"application/xml")}function w(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.why))return void e.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function x(e,t){return e.slice(0,t.length)===t}function _(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var r=e.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var o=r[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var s=o.split("@");n.push(s)}for(i=0;i<n.length;i++)t+=" "+n[i][1]+"\n "+n[i][0];return t}},2598:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?e:e.value}r.d(t,{_:()=>n})},5904:(e,t,r)=>{"use strict";r.d(t,{B2:()=>g,NA:()=>b,NX:()=>p,PY:()=>f,Pv:()=>o,Uc:()=>a,Yi:()=>i,cG:()=>u,f:()=>l,jt:()=>h,lt:()=>m,lx:()=>v,n_:()=>d,nq:()=>c,uZ:()=>s,zz:()=>y});var n=r(9247);function i(e){return"object"==typeof e&&null!==e&&"subject"in e}function o(e){return"object"==typeof e&&null!==e&&"statements"in e}function s(e){return h(e)&&e.termType===n.fb}function a(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function l(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function c(e){return h(e)&&(e.termType===n.XM||e.termType===n.V1||e.termType===n.UH)}function u(e){return h(e)&&e.termType===n.UH}function h(e){return"object"==typeof e&&null!==e&&"termType"in e}function d(e){return e.termType===n.xH}function f(e){return"object"==typeof e&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function p(e){return h(e)&&"NamedNode"===e.termType}function g(e){return h(e)&&"termType"in e&&"BlankNode"===e.termType}function y(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1)}function v(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH)}function m(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.xH)}function b(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.NK)}},6118:(e,t,r)=>{"use strict";var n=r(2530),i=r(292);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var s,a,l=r(8619).codes,c=l.ERR_AMBIGUOUS_ARGUMENT,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_INVALID_ARG_VALUE,d=l.ERR_INVALID_RETURN_VALUE,f=l.ERR_MISSING_ARGS,p=r(6979),g=r(5663).inspect,y=r(5663).types,v=y.isPromise,m=y.isRegExp,b=Object.assign?Object.assign:r(1662).assign,w=Object.is?Object.is:r(7402);function x(){var e=r(1667);s=e.isDeepEqual,a=e.isDeepStrictEqual}new Map;var _=!1,T=e.exports=O,j={};function E(e){if(e.message instanceof Error)throw e.message;throw new p(e)}function N(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new p({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function O(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];N.apply(void 0,[O,t.length].concat(t))}T.fail=function e(t,r,o,s,a){var l,c=arguments.length;if(0===c)l="Failed";else if(1===c)o=t,t=void 0;else{if(!1===_){_=!0;var u=n.emitWarning?n.emitWarning:i.warn.bind(i);u("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===c&&(s="!=")}if(o instanceof Error)throw o;var h={actual:t,expected:r,operator:void 0===s?"fail":s,stackStartFn:a||e};void 0!==o&&(h.message=o);var d=new p(h);throw l&&(d.message=l,d.generatedMessage=!0),d},T.AssertionError=p,T.ok=O,T.equal=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");t!=r&&E({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},T.notEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");t==r&&E({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},T.deepEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),s(t,r)||E({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},T.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),s(t,r)&&E({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},T.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),a(t,r)||E({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},T.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),a(t,r)&&E({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},T.strictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");w(t,r)||E({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},T.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");w(t,r)&&E({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var S=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&m(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function I(e,t,r,n,i,o){if(!(r in e)||!a(e[r],t[r])){if(!n){var s=new S(e,i),l=new S(t,i,e),c=new p({actual:s,expected:l,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=e,c.expected=t,c.operator=o.name,c}E({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}function k(e,t,r,n){if("function"!=typeof t){if(m(t))return t.test(e);if(2===arguments.length)throw new u("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new p({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new h("error",t,"may not be an empty object");return void 0===s&&x(),a.forEach((function(i){"string"==typeof e[i]&&m(t[i])&&t[i].test(e[i])||I(e,t,i,r,a,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function A(e){if("function"!=typeof e)throw new u("fn","Function",e);try{e()}catch(e){return e}return j}function R(e){return v(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!R(t=e()))throw new d("instance of Promise","promiseFn",t)}else{if(!R(e))throw new u("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return j})).catch((function(e){return e}))}))}function D(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new u("error",["Object","Error","Function","RegExp"],r);if(t===j){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";E({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(i),stackStartFn:e})}if(r&&!k(t,r,n,e))throw t}function L(e,t,r,n){if(t!==j){if("string"==typeof r&&(n=r,r=void 0),!r||k(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";E({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];N.apply(void 0,[P,t.length].concat(t))}T.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,A(t)].concat(n))},T.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return D.apply(void 0,[e,t].concat(n))}))},T.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];L.apply(void 0,[e,A(t)].concat(n))},T.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return L.apply(void 0,[e,t].concat(n))}))},T.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=g(t);var n=new p({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var s=i.split("\n");s.shift();for(var a=n.stack.split("\n"),l=0;l<s.length;l++){var c=a.indexOf(s[l]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},T.strict=b(P,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict},6979:(e,t,r)=>{"use strict";var n=r(2530);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?a(e):t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},l(e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function u(e,t,r){return u=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i},u.apply(null,arguments)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var p=r(5663).inspect,g=r(8619).codes.ERR_INVALID_ARG_TYPE;function y(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var v="",m="",b="",w="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function T(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var j=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==f(e)||null===e)throw new g("options","Object",e);var i=e.message,o=e.operator,l=e.stackStartFn,c=e.actual,u=e.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,d(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(v="[34m",m="[32m",w="[39m",b="[31m"):(v="",m="",w="",b="")),"object"===f(c)&&null!==c&&"object"===f(u)&&null!==u&&"stack"in c&&c instanceof Error&&"stack"in u&&u instanceof Error&&(c=_(c),u=_(u)),"deepStrictEqual"===o||"strictEqual"===o)r=s(this,d(t).call(this,function(e,t,r){var i="",o="",s=0,a="",l=!1,c=T(e),u=c.split("\n"),h=T(t).split("\n"),d=0,p="";if("strictEqual"===r&&"object"===f(e)&&"object"===f(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var g=u[0].length+h[0].length;if(g<=10){if(!("object"===f(e)&&null!==e||"object"===f(t)&&null!==t||0===e&&0===t))return"".concat(x[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&g<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][d]===h[0][d];)d++;d>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}for(var _=u[u.length-1],j=h[h.length-1];_===j&&(d++<2?a="\n ".concat(_).concat(a):i=_,u.pop(),h.pop(),0!==u.length&&0!==h.length);)_=u[u.length-1],j=h[h.length-1];var E=Math.max(u.length,h.length);if(0===E){var N=c.split("\n");if(N.length>30)for(N[26]="".concat(v,"...").concat(w);N.length>27;)N.pop();return"".concat(x.notIdentical,"\n\n").concat(N.join("\n"),"\n")}d>3&&(a="\n".concat(v,"...").concat(w).concat(a),l=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var O=0,S=x[r]+"\n".concat(m,"+ actual").concat(w," ").concat(b,"- expected").concat(w),I=" ".concat(v,"...").concat(w," Lines skipped");for(d=0;d<E;d++){var k=d-s;if(u.length<d+1)k>1&&d>2&&(k>4?(o+="\n".concat(v,"...").concat(w),l=!0):k>3&&(o+="\n ".concat(h[d-2]),O++),o+="\n ".concat(h[d-1]),O++),s=d,i+="\n".concat(b,"-").concat(w," ").concat(h[d]),O++;else if(h.length<d+1)k>1&&d>2&&(k>4?(o+="\n".concat(v,"...").concat(w),l=!0):k>3&&(o+="\n ".concat(u[d-2]),O++),o+="\n ".concat(u[d-1]),O++),s=d,o+="\n".concat(m,"+").concat(w," ").concat(u[d]),O++;else{var A=h[d],R=u[d],C=R!==A&&(!y(R,",")||R.slice(0,-1)!==A);C&&y(A,",")&&A.slice(0,-1)===R&&(C=!1,R+=","),C?(k>1&&d>2&&(k>4?(o+="\n".concat(v,"...").concat(w),l=!0):k>3&&(o+="\n ".concat(u[d-2]),O++),o+="\n ".concat(u[d-1]),O++),s=d,o+="\n".concat(m,"+").concat(w," ").concat(R),i+="\n".concat(b,"-").concat(w," ").concat(A),O+=2):(o+=i,i="",1!==k&&0!==d||(o+="\n ".concat(R),O++))}if(O>20&&d<E-2)return"".concat(S).concat(I,"\n").concat(o,"\n").concat(v,"...").concat(w).concat(i,"\n")+"".concat(v,"...").concat(w)}return"".concat(S).concat(l?I:"","\n").concat(o).concat(i).concat(a).concat(p)}(c,u,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var p=x[o],j=T(c).split("\n");if("notStrictEqual"===o&&"object"===f(c)&&null!==c&&(p=x.notStrictEqualObject),j.length>30)for(j[26]="".concat(v,"...").concat(w);j.length>27;)j.pop();r=1===j.length?s(this,d(t).call(this,"".concat(p," ").concat(j[0]))):s(this,d(t).call(this,"".concat(p,"\n\n").concat(j.join("\n"),"\n")))}else{var E=T(c),N="",O=x[o];"notDeepEqual"===o||"notEqual"===o?(E="".concat(x[o],"\n\n").concat(E)).length>1024&&(E="".concat(E.slice(0,1021),"...")):(N="".concat(T(u)),E.length>512&&(E="".concat(E.slice(0,509),"...")),N.length>512&&(N="".concat(N.slice(0,509),"...")),"deepEqual"===o||"equal"===o?E="".concat(O,"\n\n").concat(E,"\n\nshould equal\n\n"):N=" ".concat(o," ").concat(N)),r=s(this,d(t).call(this,"".concat(E).concat(N)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=u,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),l),r.stack,r.name="AssertionError",s(r)}var r,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],l&&o(r.prototype,l),t}(l(Error));e.exports=j},8619:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var s,a,l={};function c(e,t,r){r||(r=Error);var s=function(r){function s(r,o,a){var l;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),l=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(s).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,o,a))),l.code=e,l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(s,r),s}(r);l[e]=s}function u(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,a,l,c,h;if(void 0===s&&(s=r(6118)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,a.length)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(o," ").concat(u(t,"type"));else{var d=("number"!=typeof h&&(h=0),h+".".length>(c=e).length||-1===c.indexOf(".",h)?"argument":"property");l='The "'.concat(e,'" ').concat(d," ").concat(o," ").concat(u(t,"type"))}return l+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(5663));var i=a.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(6118)),s(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=l},1667:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},a=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(7402),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:r(8622);function h(e){return e.call.bind(e)}var d=h(Object.prototype.hasOwnProperty),f=h(Object.prototype.propertyIsEnumerable),p=h(Object.prototype.toString),g=r(5663).types,y=g.isAnyArrayBuffer,v=g.isArrayBufferView,m=g.isDate,b=g.isMap,w=g.isRegExp,x=g.isSet,_=g.isNativeError,T=g.isBoxedPrimitive,j=g.isNumberObject,E=g.isStringObject,N=g.isBooleanObject,O=g.isBigIntObject,S=g.isSymbolObject,I=g.isFloat32Array,k=g.isFloat64Array;function A(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(A).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function C(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function D(e,t,r,n){if(e===t)return 0!==e||!r||l(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&u(e)&&u(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var s,a,c,h,d=p(e);if(d!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var f=R(e),g=R(t);return f.length===g.length&&P(e,t,r,n,1,f)}if("[object Object]"===d&&(!b(e)&&b(t)||!x(e)&&x(t)))return!1;if(m(e)){if(!m(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(c=e,h=t,!(o?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(r||!I(e)&&!k(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var A=R(e),D=R(t);return A.length===D.length&&P(e,t,r,n,0,A)}if(x(e))return!(!x(t)||e.size!==t.size)&&P(e,t,r,n,2);if(b(e))return!(!b(t)||e.size!==t.size)&&P(e,t,r,n,3);if(y(e)){if(a=t,(s=e).byteLength!==a.byteLength||0!==C(new Uint8Array(s),new Uint8Array(a)))return!1}else if(T(e)&&!function(e,t){return j(e)?j(t)&&l(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):E(e)?E(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):N(e)?N(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):O(e)?O(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):S(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return P(e,t,r,n,0)}function L(e,t){return t.filter((function(t){return f(e,t)}))}function P(e,t,r,n,i,o){if(5===arguments.length){o=Object.keys(e);var s=Object.keys(t);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!d(t,o[a]))return!1;if(r&&5===arguments.length){var l=c(e);if(0!==l.length){var u=0;for(a=0;a<l.length;a++){var h=l[a];if(f(e,h)){if(!f(t,h))return!1;o.push(h),u++}else if(f(t,h))return!1}var p=c(t);if(l.length!==p.length&&L(t,p).length!==u)return!1}else{var g=c(t);if(0!==g.length&&0!==L(t,g).length)return!1}}if(0===o.length&&(0===i||1===i&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var y=n.val1.get(e);if(void 0!==y){var v=n.val2.get(t);if(void 0!==v)return y===v}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var m=H(e,t,r,o,n,i);return n.val1.delete(e),n.val2.delete(t),m}function M(e,t,r,n){for(var i=s(e),o=0;o<i.length;o++){var a=i[o];if(D(t,a,r,n))return e.delete(a),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(u(e))return!1}return!0}function U(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function B(e,t,r,n,i){var o=F(r);if(null!=o)return o;var s=t.get(o);return!(void 0===s&&!t.has(o)||!D(n,s,!1,i))&&!e.has(o)&&D(n,s,!1,i)}function q(e,t,r,n,i,o){for(var a=s(e),l=0;l<a.length;l++){var c=a[l];if(D(r,c,i,o)&&D(n,t.get(c),i,o))return e.delete(c),!0}return!1}function H(e,t,r,o,l,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var o=null,a=s(e),l=0;l<a.length;l++){var c=a[l];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!U(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var u=s(t),h=0;h<u.length;h++){var d=u[h];if("object"===i(d)&&null!==d){if(!M(o,d,r,n))return!1}else if(!r&&!e.has(d)&&!M(o,d,r,n))return!1}return 0===o.size}return!0}(e,t,r,l))return!1}else if(3===c){if(!function(e,t,r,o){for(var s=null,l=a(e),c=0;c<l.length;c++){var u=n(l[c],2),h=u[0],d=u[1];if("object"===i(h)&&null!==h)null===s&&(s=new Set),s.add(h);else{var f=t.get(h);if(void 0===f&&!t.has(h)||!D(d,f,r,o)){if(r)return!1;if(!B(e,t,h,d,o))return!1;null===s&&(s=new Set),s.add(h)}}}if(null!==s){for(var p=a(t),g=0;g<p.length;g++){var y=n(p[g],2),v=(h=y[0],y[1]);if("object"===i(h)&&null!==h){if(!q(s,e,h,v,r,o))return!1}else if(!(r||e.has(h)&&D(e.get(h),v,!1,o)||q(s,e,h,v,!1,o)))return!1}return 0===s.size}return!0}(e,t,r,l))return!1}else if(1===c)for(;u<e.length;u++){if(!d(e,u)){if(d(t,u))return!1;for(var h=Object.keys(e);u<h.length;u++){var f=h[u];if(!d(t,f)||!D(e[f],t[f],r,l))return!1}return h.length===Object.keys(t).length}if(!d(t,u)||!D(e[u],t[u],r,l))return!1}for(u=0;u<o.length;u++){var p=o[u];if(!D(e[p],t[p],r,l))return!1}return!0}e.exports={isDeepEqual:function(e,t){return D(e,t,!1)},isDeepStrictEqual:function(e,t){return D(e,t,!0)}}},5155:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=l(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),u=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;a<l;a+=s)o.push(c(e,a,a+s>l?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2486:(e,t,r)=>{"use strict";var n=r(292);const i=r(5155),o=r(4525),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const a=2147483647;function l(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=l(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|g(e.length),r=l(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||W(e.length)?l(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return h(e),l(e<0?0:0|g(e))}function f(e){const t=e.length<0?0:0|g(e.length),r=l(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function g(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return N(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),W(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function x(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(W(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return X(G(t,e.length-r),e,r,n)}function T(e,t,r,n){return X(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function j(e,t,r,n){return X(J(t),e,r,n)}function E(e,t,r,n){return X(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function N(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?l(e):void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):v.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==u[e]){o=l[e],s=u[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return j(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function A(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=K((function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=K((function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=K((function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=K((function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||z(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=K((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=K((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=K((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=K((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const B={};function q(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function $(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){Z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||z(t,e.length-(r+1))}(n,i,o)}function Z(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function z(e,t,r){if(Math.floor(e)!==e)throw Z(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=H(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function W(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function K(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},7615:(e,t,r)=>{"use strict";var n=r(1801),i=r(2550),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},2550:(e,t,r)=>{"use strict";var n=r(1930),i=r(1801),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),l=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=a(n,s,arguments);if(l&&c){var r=l(t,"length");r.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var h=function(){return a(n,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h},8981:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>void 0===t[n]||"symbol"==typeof t[n]?r:r+(0===r.length?"":",")+e(n)+":"+e(t[n])),"")+"}"}},292:(e,t,r)=>{var n=r(5663),i=r(6118);function o(){return(new Date).getTime()}var s,a=Array.prototype.slice,l={};s=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){s.log.apply(s,arguments)},"info"],[function(){s.log.apply(s,arguments)},"warn"],[function(){s.warn.apply(s,arguments)},"error"],[function(e){l[e]=o()},"time"],[function(e){var t=l[e];if(!t)throw new Error("No such label: "+e);delete l[e];var r=o()-t;s.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),s.error(e.stack)},"trace"],[function(e){s.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=a.call(arguments,1);i.ok(!1,n.format.apply(null,t))}},"assert"]],u=0;u<c.length;u++){var h=c[u],d=h[0],f=h[1];s[f]||(s[f]=d)}e.exports=s},7297:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=f(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=p(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=u(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=u(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,r){return new Promise((function(n,o){var s=new b(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new x(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",l)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}T.polyfill=!0,e.fetch||(e.fetch=T,e.Headers=d,e.Request=b,e.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=T,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},9170:(e,t,r)=>{"use strict";var n=r(806),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,l=r(8198)(),c=a&&l,u=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?a(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},h=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)u(e,o[a],t[o[a]],r[o[a]])};h.supportsDescriptors=!!c,e.exports=h},1662:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var l=o[s],c=Object.getOwnPropertyDescriptor(i,l);void 0!==c&&c.enumerable&&(r[l]=i[l])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},4843:(e,t,r)=>{"use strict";var n=r(5443),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},a=function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},l=function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?s(e,t,o):"string"==typeof e?a(e,t,o):l(e,t,o)}},9930:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var s,a=r.call(arguments,1),l=function(){if(this instanceof s){var t=o.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),u=[],h=0;h<c;h++)u.push("$"+h);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(l),o.prototype){var d=function(){};d.prototype=o.prototype,s.prototype=new d,d.prototype=null}return s}},1930:(e,t,r)=>{"use strict";var n=r(9930);e.exports=Function.prototype.bind||n},1801:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var c=function(){throw new s},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(e){return c}}}():c,h=r(9905)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?d(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=d(i.prototype))}return g[t]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=r(1930),b=r(9284),w=m.call(Function.call,Array.prototype.concat),x=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),T=m.call(Function.call,String.prototype.slice),j=m.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,O=function(e){var t=T(e,0,1),r=T(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,E,(function(e,t,r,i){n[n.length]=r?_(i,N,"$1"):t||e})),n},S=function(e,t){var r,n=e;if(b(v,n)&&(n="%"+(r=v[n])[0]+"%"),b(g,n)){var o=g[n];if(o===f&&(o=y(n)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=O(e),n=r.length>0?r[0]:"",o=S("%"+n+"%",t),a=o.name,c=o.value,u=!1,h=o.alias;h&&(n=h[0],x(r,w([0,1],h)));for(var d=1,f=!0;d<r.length;d+=1){var p=r[d],y=T(p,0,1),v=T(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===v||"'"===v||"`"===v)&&y!==v)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&f||(u=!0),b(g,a="%"+(n+="."+p)+"%"))c=g[a];else if(null!=c){if(!(p in c)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(l&&d+1>=r.length){var m=l(c,p);c=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[p]}else f=b(c,p),c=c[p];f&&!u&&(g[a]=c)}}return c}},3828:(e,t,r)=>{"use strict";var n=r(1801)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8198:(e,t,r)=>{"use strict";var n=r(1801)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},9905:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4111:(e,t,r)=>{"use strict";var n=r(5682);e.exports=function(){return n()&&!!Symbol.toStringTag}},9284:(e,t,r)=>{"use strict";var n=r(1930);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4525:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*g}},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7092:(e,t,r)=>{"use strict";var n=r(4111)(),i=r(7615)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},5443:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var d=document.all;l.call(d)===l.call(document.all)&&(h=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},7427:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(4111)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},2100:e=>{"use strict";e.exports=function(e){return e!=e}},8622:(e,t,r)=>{"use strict";var n=r(2550),i=r(9170),o=r(2100),s=r(4358),a=r(6232),l=n(s(),Number);i(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},4358:(e,t,r)=>{"use strict";var n=r(2100);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6232:(e,t,r)=>{"use strict";var n=r(9170),i=r(4358);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2527:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=o("Object.prototype.toString"),a=r(4111)(),l=r(3828),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d=o("String.prototype.slice"),f={},p=Object.getPrototypeOf;a&&l&&p&&n(u,(function(e){var t=new c[e];if(Symbol.toStringTag in t){var r=p(t),n=l(r,Symbol.toStringTag);if(!n){var i=p(r);n=l(i,Symbol.toStringTag)}f[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!a||!(Symbol.toStringTag in e)){var t=d(s(e),8,-1);return h(u,t)>-1}return!!l&&function(e){var t=!1;return n(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},5777:(e,t,r)=>{"use strict";const{isArray:n,isObject:i,isString:o}=r(8285),{asArray:s}=r(4768),{prependBase:a}=r(3866),l=r(9699),c=r(1898);function u(e){throw new l("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function h({context:e,base:t}){if(!e)return;const r=e["@context"];if(o(r))e["@context"]=a(t,r);else if(n(r))for(let e=0;e<r.length;++e){const n=r[e];o(n)?r[e]=a(t,n):i(n)&&h({context:{"@context":n},base:t})}else if(i(r))for(const e in r)h({context:r[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:r,base:a,cycles:l=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=s(t);const h=[];for(const s of t){if(o(s)){let t=this._get(s);t||(t=await this._resolveRemoteContext({activeCtx:e,url:s,documentLoader:r,base:a,cycles:l})),n(t)?h.push(...t):h.push(t);continue}if(null===s){h.push(new c({document:null}));continue}i(s)||u(t);const d=JSON.stringify(s);let f=this._get(d);f||(f=new c({document:s}),this._cacheResolvedContext({key:d,resolved:f,tag:"static"})),h.push(f)}return h}_get(e){let t=this.perOpCache.get(e);if(!t){const r=this.sharedCache.get(e);r&&(t=r.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:r}){if(this.perOpCache.set(e,t),void 0!==r){let n=this.sharedCache.get(e);n||(n=new Map,this.sharedCache.set(e,n)),n.set(r,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:r,base:n,cycles:i}){t=a(n,t);const{context:o,remoteDoc:s}=await this._fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:i});h({context:o,base:n=s.documentUrl||t});const l=await this.resolve({activeCtx:e,context:o,documentLoader:r,base:n,cycles:i});return this._cacheResolvedContext({key:t,resolved:l,tag:s.tag}),l}async _fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:s}){if(s.size>10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let a,c;s.add(t);try{c=await r(t),a=c.document||null,o(a)&&(a=JSON.parse(a))}catch(e){throw new l("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!i(a))throw new l("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return a="@context"in a?{"@context":a["@context"]}:{"@context":{}},c.contextUrl&&(n(a["@context"])||(a["@context"]=[a["@context"]]),a["@context"].push(c.contextUrl)),{context:a,remoteDoc:c}}}},9699:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}}},7298:e=>{"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},7990:(e,t,r)=>{"use strict";e.exports=r(2948).NQuads},3114:e=>{"use strict";e.exports=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]}}}},1898:(e,t,r)=>{"use strict";const n=r(3666);e.exports=class{constructor({document:e}){this.document=e,this.cache=new n({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},120:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isString:s,isUndefined:a}=r(8285),{isList:l,isValue:c,isGraph:u,isSimpleGraph:h,isSubjectReference:d}=r(478),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:v}=r(2182),{removeBase:m,prependBase:b}=r(3866),{REGEX_KEYWORD:w,addValue:x,asArray:_,compareShortestLeast:T}=r(4768),j={};function E(e,t,r){if("@nest"!==f(e,t,{vocab:!0},r))throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=j,j.compact=async({activeCtx:e,activeProperty:t=null,element:r,options:f={}})=>{if(i(r)){let n=[];for(let i=0;i<r.length;++i){const o=await j.compact({activeCtx:e,activeProperty:t,element:r[i],options:f});null!==o&&n.push(o)}return f.compactArrays&&1===n.length&&0===(p(e,t,"@container")||[]).length&&(n=n[0]),n}const m=p(e,t,"@context");if(a(m)||(e=await y({activeCtx:e,localCtx:m,propagate:!0,overrideProtected:!0,options:f})),o(r)){if(f.link&&"@id"in r&&f.link.hasOwnProperty(r["@id"])){const e=f.link[r["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===r)return e[t].compacted}if(c(r)||d(r)){const n=j.compactValue({activeCtx:e,activeProperty:t,value:r,options:f});return f.link&&d(r)&&(f.link.hasOwnProperty(r["@id"])||(f.link[r["@id"]]=[]),f.link[r["@id"]].push({expanded:r,compacted:n})),n}if(l(r)&&(p(e,t,"@container")||[]).includes("@list"))return j.compact({activeCtx:e,activeProperty:t,element:r["@list"],options:f});const m="@reverse"===t,b={},w=e;c(r)||d(r)||(e=e.revertToPreviousContext());const T=p(w,t,"@context");a(T)||(e=await y({activeCtx:e,localCtx:T,propagate:!0,overrideProtected:!0,options:f})),f.link&&"@id"in r&&(f.link.hasOwnProperty(r["@id"])||(f.link[r["@id"]]=[]),f.link[r["@id"]].push({expanded:r,compacted:b}));let N=r["@type"]||[];N.length>1&&(N=Array.from(N).sort());const O=e;for(const t of N){const r=j.compactIri({activeCtx:O,iri:t,relativeTo:{vocab:!0}}),n=p(w,r,"@context");a(n)||(e=await y({activeCtx:e,localCtx:n,options:f,propagate:!1}))}const S=Object.keys(r).sort();for(const a of S){const d=r[a];if("@id"!==a)if("@type"!==a)if("@reverse"!==a)if("@preserve"!==a)if("@index"!==a)if("@graph"!==a&&"@list"!==a&&"@included"!==a&&g(a)){const t=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,t,d)}else{if(!i(d))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===d.length){const t=j.compactIri({activeCtx:e,iri:a,value:d,relativeTo:{vocab:!0},reverse:m}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let n=b;r&&(E(e,r,f),o(b[r])||(b[r]={}),n=b[r]),x(n,t,d,{propertyIsArray:!0})}for(const t of d){const r=j.compactIri({activeCtx:e,iri:a,value:t,relativeTo:{vocab:!0},reverse:m}),n=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let d=b;n&&(E(e,n,f),o(b[n])||(b[n]={}),d=b[n]);const g=p(e,r,"@container")||[],y=u(t),v=l(t);let w;v?w=t["@list"]:y&&(w=t["@graph"]);let T=await j.compact({activeCtx:e,activeProperty:r,element:v||y?w:t,options:f});if(v){if(i(T)||(T=[T]),g.includes("@list")){x(d,r,T,{valueIsArray:!0,allowDuplicate:!0});continue}T={[j.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:T},"@index"in t&&(T[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(y)if(g.includes("@graph")&&(g.includes("@id")||g.includes("@index")&&h(t))){let n;d.hasOwnProperty(r)?n=d[r]:d[r]=n={};const i=(g.includes("@id")?t["@id"]:t["@index"])||j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});x(n,i,T,{propertyIsArray:!f.compactArrays||g.includes("@set")})}else g.includes("@graph")&&h(t)?(i(T)&&T.length>1&&(T={"@included":T}),x(d,r,T,{propertyIsArray:!f.compactArrays||g.includes("@set")})):(i(T)&&1===T.length&&f.compactArrays&&(T=T[0]),T={[j.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:T},"@id"in t&&(T[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(T[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),x(d,r,T,{propertyIsArray:!f.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let n,i;if(d.hasOwnProperty(r)?n=d[r]:d[r]=n={},g.includes("@language"))c(T)&&(T=T["@value"]),i=t["@language"];else if(g.includes("@index")){const n=p(e,r,"@index")||"@index",o=j.compactIri({activeCtx:e,iri:n,relativeTo:{vocab:!0}});if("@index"===n)i=t["@index"],delete T[o];else{let e;if([i,...e]=_(T[n]||[]),s(i))switch(e.length){case 0:delete T[n];break;case 1:T[n]=e[0];break;default:T[n]=e}else i=null}}else if(g.includes("@id")){const t=j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=T[t],delete T[t]}else if(g.includes("@type")){const n=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=_(T[n]||[]),o.length){case 0:delete T[n];break;case 1:T[n]=o[0];break;default:T[n]=o}1===Object.keys(T).length&&"@id"in t&&(T=await j.compact({activeCtx:e,activeProperty:r,element:{"@id":t["@id"]},options:f}))}i||(i=j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),x(n,i,T,{propertyIsArray:g.includes("@set")})}else{const e=!f.compactArrays||g.includes("@set")||g.includes("@list")||i(T)&&0===T.length||"@list"===a||"@graph"===a;x(d,r,T,{propertyIsArray:e})}}}else{if((p(e,t,"@container")||[]).includes("@index"))continue;const r=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,d)}else{const r=await j.compact({activeCtx:e,activeProperty:t,element:d,options:f});i(r)&&0===r.length||x(b,a,r)}else{const t=await j.compact({activeCtx:e,activeProperty:"@reverse",element:d,options:f});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const n=t[r],i=(p(e,r,"@container")||[]).includes("@set")||!f.compactArrays;x(b,r,n,{propertyIsArray:i}),delete t[r]}if(Object.keys(t).length>0){const r=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,t)}}else{let t=_(d).map((e=>j.compactIri({activeCtx:w,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const r=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),n=(p(e,r,"@container")||[]).includes("@set")&&v(e,1.1)||i(t)&&0===d.length;x(b,r,t,{propertyIsArray:n})}else{let t=_(d).map((t=>j.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:f.base})));1===t.length&&(t=t[0]),b[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return b}return r},j.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const h=e.getInverse();if(g(t)&&t in h&&"@none"in h[t]&&"@type"in h[t]["@none"]&&"@none"in h[t]["@none"]["@type"])return h[t]["@none"]["@type"]["@none"];if(i.vocab&&t in h){const n=e["@language"]||"@none",i=[];o(r)&&"@index"in r&&!("@graph"in r)&&i.push("@index","@index@set"),o(r)&&"@preserve"in r&&(r=r["@preserve"][0]),u(r)?("@index"in r&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in r||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||i.push("@graph@id","@graph@id@set")):o(r)&&!c(r)&&i.push("@id","@id@set","@type","@set@type");let a="@language",h="@null";if(s)a="@type",h="@reverse",i.push("@set");else if(l(r)){"@index"in r||i.push("@list");const e=r["@list"];if(0===e.length)a="@any",h="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;n<e.length;++n){const i=e[n];let o="@none",s="@none";if(c(i)?"@direction"in i?o=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?o=i["@language"].toLowerCase():"@type"in i?s=i["@type"]:o="@null":s="@id",null===t?t=o:o!==t&&c(i)&&(t="@none"),null===r?r=s:s!==r&&(r="@none"),"@none"===t&&"@none"===r)break}t=t||"@none",r=r||"@none","@none"!==r?(a="@type",h=r):h=t}}else{if(c(r))if("@language"in r&&!("@index"in r)){i.push("@language","@language@set"),h=r["@language"];const e=r["@direction"];e&&(h=`${h}_${e}`)}else"@direction"in r&&!("@index"in r)?h=`_${r["@direction"]}`:"@type"in r&&(a="@type",h=r["@type"]);else a="@type",h="@id";i.push("@set")}i.push("@none"),o(r)&&!("@index"in r)&&i.push("@index","@index@set"),c(r)&&1===Object.keys(r).length&&i.push("@language","@language@set");const d=function(e,t,r,n,i,s){null===s&&(s="@null");const a=[];if(("@id"===s||"@reverse"===s)&&o(r)&&"@id"in r){"@reverse"===s&&a.push("@reverse");const t=j.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===r["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(s);const e=a.find((e=>e.includes("_")));e&&a.push(e.replace(/^[^_]+_/,"_"))}a.push("@none");const l=e.inverse[t];for(const e of n){if(!(e in l))continue;const t=l[e][i];for(const e of a)if(e in t)return t[e]}return null}(e,t,r,i,a,h);if(null!==d)return d}if(i.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let d=null;const f=[];let p=e.fastCurieMap;const y=t.length-1;for(let e=0;e<y&&t[e]in p;++e)p=p[t[e]],""in p&&f.push(p[""][0]);for(let n=f.length-1;n>=0;--n){const i=f[n],o=i.terms;for(const n of o){const o=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(o)||null===r&&e.mappings.get(o)["@id"]===t)&&(null===d||T(o,d)<0)&&(d=o)}}if(null!==d)return d;for(const[r,i]of e.mappings)if(i&&i._prefix&&t.startsWith(r+":"))throw new n(`Absolute IRI "${t}" confused with prefix "${r}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const r=m(b(a,e["@base"]),t);return w.test(r)?`./${r}`:r}return t}return m(a,t)}return t},j.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(c(r)){const n=p(e,t,"@type"),i=p(e,t,"@language"),o=p(e,t,"@direction"),a=p(e,t,"@container")||[],l="@index"in r&&!a.includes("@index");if(!l&&"@none"!==n){if(r["@type"]===n)return r["@value"];if("@language"in r&&r["@language"]===i&&"@direction"in r&&r["@direction"]===o)return r["@value"];if("@language"in r&&r["@language"]===i)return r["@value"];if("@direction"in r&&r["@direction"]===o)return r["@value"]}const c=Object.keys(r).length,u=1===c||2===c&&"@index"in r&&!l,h="@language"in e,d=s(r["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(u&&"@none"!==n&&(!h||!d||f))return r["@value"];const g={};return l&&(g[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?g[j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=j.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(g[j.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(g[j.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),g[j.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],g}const i=f(e,t,{vocab:!0},n),o=p(e,t,"@type"),a=j.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===o},base:n.base});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},2445:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},2182:(e,t,r)=>{"use strict";const n=r(4768),i=r(9699),{isArray:o,isObject:s,isString:a,isUndefined:l}=r(8285),{isAbsolute:c,isRelative:u,prependBase:h}=r(3866),{handleEvent:d}=r(5746),{REGEX_BCP47:f,REGEX_KEYWORD:p,asArray:g,compareShortestLeast:y}=r(4768),v=new Map,m={};function b(e,t,r,n,i,o){if(null===t||!a(t)||m.isKeyword(t))return t;if(t.match(p))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&m.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:o}),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(s(r)&&"@id"in r)return r["@id"]}const l=t.indexOf(":");if(l>0){const r=t.substr(0,l),s=t.substr(l+1);if("_"===r||0===s.indexOf("//"))return t;n&&n.hasOwnProperty(r)&&m.createTermDefinition({activeCtx:e,localCtx:n,term:r,defined:i,options:o});const a=e.mappings.get(r);if(a&&a._prefix)return a["@id"]+s;if(c(t))return t}if(r.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(r.base){let r,n;"@base"in e?e["@base"]?(n=h(o.base,e["@base"]),r=h(n,t)):(n=e["@base"],r=t):(n=o.base,r=h(o.base,t)),t=r}return t}function w(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!w(e[r],t[r]))return!1;return!0}const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r in e){let n=e[r],i=t[r];if("@container"===r&&Array.isArray(n)&&Array.isArray(i)&&(n=n.slice().sort(),i=i.slice().sort()),!w(n,i))return!1}return!0}e.exports=m,m.process=async({activeCtx:e,localCtx:t,options:r,propagate:n=!0,overrideProtected:l=!1,cycles:p=new Set})=>{if(s(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]),0===g(t).length)return e;const y=[],v=[({event:e,next:t})=>{y.push(e),t()}];r.eventHandler&&v.push(r.eventHandler);const w=r;r={...r,eventHandler:v};const x=await r.contextResolver.resolve({activeCtx:e,context:t,documentLoader:r.documentLoader,base:r.base});s(x[0].document)&&"boolean"==typeof x[0].document["@propagate"]&&(n=x[0].document["@propagate"]);let _=e;n||_.previousContext||(_=_.clone(),_.previousContext=e);for(const n of x){let{document:o}=n;if(e=_,null===o){if(!l&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});_=e=m.getInitialContext(r).clone();continue}const g=n.getProcessed(e);if(g){if(w.eventHandler)for(const e of g.events)d({event:e,options:w});_=e=g.context;continue}if(s(o)&&"@context"in o&&(o=o["@context"]),!s(o))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:o});_=_.clone();const v=new Map;if("@version"in o){if(1.1!==o["@version"])throw new i("Unsupported JSON-LD version: "+o["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:o});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+o["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:o});_.processingMode="json-ld-1.1",_["@version"]=o["@version"],v.set("@version",!0)}if(_.processingMode=_.processingMode||e.processingMode,"@base"in o){let e=o["@base"];if(null===e||c(e));else{if(!u(e))throw new i('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:o});e=h(_["@base"],e)}_["@base"]=e,v.set("@base",!0)}if("@vocab"in o){const e=o["@vocab"];if(null===e)delete _["@vocab"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:o});if(!c(e)&&m.processingMode(_,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:o});{const t=b(_,e,{vocab:!0,base:!0},void 0,void 0,r);c(t)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:r}),_["@vocab"]=t}}v.set("@vocab",!0)}if("@language"in o){const e=o["@language"];if(null===e)delete _["@language"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:o});e.match(f)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r}),_["@language"]=e.toLowerCase()}v.set("@language",!0)}if("@direction"in o){const t=o["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:o});if(null===t)delete _["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:o});_["@direction"]=t}v.set("@direction",!0)}if("@propagate"in o){const r=o["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:o});if("boolean"!=typeof r)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});v.set("@propagate",!0)}if("@import"in o){const n=o["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:o});if(!a(n))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const s=await r.contextResolver.resolve({activeCtx:e,context:n,documentLoader:r.documentLoader,base:r.base});if(1!==s.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=s[0].getProcessed(e);if(l)o=l;else{const r=s[0].document;if("@import"in r)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in r)o.hasOwnProperty(e)||(o[e]=r[e]);s[0].setProcessed(e,o)}v.set("@import",!0)}v.set("@protected",o["@protected"]||!1);for(const e in o)if(m.createTermDefinition({activeCtx:_,localCtx:o,term:e,defined:v,options:r,overrideProtected:l}),s(o[e])&&"@context"in o[e]){const t=o[e]["@context"];let n=!0;if(a(t)){const e=h(r.base,t);p.has(e)?n=!1:p.add(e)}if(n)try{await m.process({activeCtx:_.clone(),localCtx:o[e]["@context"],overrideProtected:!0,options:r,cycles:p})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:o[e]["@context"],term:e})}}n.setProcessed(e,{context:_,events:y})}return _},m.createTermDefinition=({activeCtx:e,localCtx:t,term:r,defined:n,options:l,overrideProtected:u=!1})=>{if(n.has(r)){if(n.get(r))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}let h;if(n.set(r,!1),t.hasOwnProperty(r)&&(h=t[r]),"@type"===r&&s(h)&&"@set"===(h["@container"]||"@set")&&m.processingMode(e,1.1)){const e=["@container","@id","@protected"],n=Object.keys(h);if(0===n.length||n.some((t=>!e.includes(t))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r})}else{if(m.isKeyword(r))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(r.match(p))return void(l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:r}},options:l}));if(""===r)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const f=e.mappings.get(r);e.mappings.has(r)&&e.mappings.delete(r);let g=!1;if((a(h)||null===h)&&(g=!0,h={"@id":h}),!s(h))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const y={};e.mappings.set(r,y),y.reverse=!1;const v=["@container","@id","@language","@reverse","@type"];m.processingMode(e,1.1)&&v.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in h)if(!v.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const x=r.indexOf(":");if(y._termHasColon=x>0,"@reverse"in h){if("@id"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const o=h["@reverse"];if(!a(o))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(o.match(p))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:o}},options:l}),void(f?e.mappings.set(r,f):e.mappings.delete(r));const s=b(e,o,{vocab:!0,base:!1},t,n,l);if(!c(s))throw new i("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});y["@id"]=s,y.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!a(o))throw new i("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===o)y["@id"]=null;else{if(!m.isKeyword(o)&&o.match(p))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:o}},options:l}),void(f?e.mappings.set(r,f):e.mappings.delete(r));if(o!==r){if(o=b(e,o,{vocab:!0,base:!1},t,n,l),!c(o)&&!m.isKeyword(o))throw new i("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(r.match(/(?::[^:])|\//)&&b(e,r,{vocab:!0,base:!1},t,new Map(n).set(r,!0),l)!==o)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=o,y._prefix=g&&!y._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const i=r.substr(0,x);if(t.hasOwnProperty(i)&&m.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:n,options:l}),e.mappings.has(i)){const t=r.substr(x+1);y["@id"]=e.mappings.get(i)["@id"]+t}else y["@id"]=r}else if("@type"===r)y["@id"]=r;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});y["@id"]=e["@vocab"]+r}if((!0===h["@protected"]||!0===n.get("@protected")&&!1!==h["@protected"])&&(e.protected[r]=!0,y.protected=!0),n.set(r,!0),"@type"in h){let r=h["@type"];if(!a(r))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===r||"@none"===r){if(m.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${r}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==r&&"@vocab"!==r){if(r=b(e,r,{vocab:!0,base:!1},t,n,l),!c(r))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===r.indexOf("_:"))throw new i("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})}y["@type"]=r}if("@container"in h){const r=a(h["@container"])?[h["@container"]]:h["@container"]||[],n=["@list","@set","@index","@language"];let s=!0;const l=r.includes("@set");if(m.processingMode(e,1.1)){if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(r.includes("@graph")){if(r.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new i("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 s&=r.length<=(l?2:1);if(r.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else s&=!o(h["@container"]),s&=r.length<=1;if(s&=r.every((e=>n.includes(e))),s&=!(l&&r.includes("@list")),!s)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(y.reverse&&!r.every((e=>["@index","@set"].includes(e))))throw new i("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});y["@container"]=r}if("@index"in h){if(!("@container"in h)||!y["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!a(h["@index"])||0===h["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=h["@index"]}if("@context"in h&&(y["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let e=h["@language"];if(null!==e&&!a(e))throw new i("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()),y["@language"]=e}if("@prefix"in h){if(r.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(m.isKeyword(y["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof h["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});y._prefix=!0===h["@prefix"]}if("@direction"in h){const e=h["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});y["@direction"]=e}if("@nest"in h){const e=h["@nest"];if(!a(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("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});y["@nest"]=e}const _=y["@id"];if("@context"===_||"@preserve"===_)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(f&&f.protected&&!u&&(e.protected[r]=!0,y.protected=!0,!w(f,y)))throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r})},m.expandIri=(e,t,r,n)=>b(e,t,r,void 0,void 0,n),m.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),r=v.get(t);if(r)return r;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=(e["@language"]||"@none").toLowerCase(),a=e["@direction"],l=e.mappings,c=[...l.keys()].sort(y);for(const e of c){const o=l.get(e);if(null===o)continue;let c=o["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===o["@id"])continue;const u=g(o["@id"]);for(const l of u){let u=t[l];const h=m.isKeyword(l);if(u)h||o._termHasColon||n[l].push(e);else if(t[l]=u={},!h&&!o._termHasColon){n[l]=[e];const t={iri:l,terms:n[l]};l[0]in r?r[l[0]].push(t):r[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],s(e,u["@any"],"@none"),o.reverse)s(e,u["@type"],"@reverse");else if("@none"===o["@type"])s(e,u["@any"],"@none"),s(e,u["@language"],"@none"),s(e,u["@type"],"@none");else if("@type"in o)s(e,u["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const t=o["@language"],r=o["@direction"];s(e,u["@language"],t&&r?`${t}_${r}`.toLowerCase():t?t.toLowerCase():r?`_${r}`:"@null")}else"@language"in o?s(e,u["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?o["@direction"]?s(e,u["@language"],`_${o["@direction"]}`):s(e,u["@language"],"@none"):a?(s(e,u["@language"],`_${a}`),s(e,u["@language"],"@none"),s(e,u["@type"],"@none")):(s(e,u["@language"],i),s(e,u["@language"],"@none"),s(e,u["@type"],"@none"))}}for(const e in r)o(r,e,1);return t},clone:function(){const e={};return e.mappings=n.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=n.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"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===v.size&&v.clear(),v.set(t,i),i;function o(e,t,r){const n=e[t],i=e[t]={};let s,a;for(const e of n)s=e.iri,a=r>=s.length?"":s[r],a in i?i[a].push(e):i[a]=[e];for(const e in i)""!==e&&o(i,e,r+1)}function s(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},m.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(l(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&r in e||"@direction"===r&&r in e?e[r]:"@context"!==r?null:void 0},m.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,m.isKeyword=e=>{if(!a(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}},2872:(e,t,r)=>{"use strict";const{parseLinkHeader:n,buildHeaders:i}=r(4768),{LINK_HEADER_CONTEXT:o}=r(2445),s=r(9699),a=r(3114),{prependBase:l}=r(3866),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:r}={headers:{}})=>(t=i(t),(new a).wrapLoader((async function i(a){if(0!==a.indexOf("http:")&&0!==a.indexOf("https:"))throw new s('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 s('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 u;try{u=await function(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()}))}(r,a,t)}catch(e){throw new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e})}if(u.status>=400)throw new s("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});let h={contextUrl:null,documentUrl:a,document:u.response},d=null;const f=u.getResponseHeader("Content-Type");let p;if(c.test(u.getAllResponseHeaders())&&(p=u.getResponseHeader("Link")),p&&"application/ld+json"!==f){const e=n(p),t=e[o];if(Array.isArray(t))throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});t&&(h.contextUrl=t.target),d=e.alternate,d&&"application/ld+json"==d.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(l(a,d.target)))}return h})))},5746:(e,t,r)=>{"use strict";var n=r(292);const i=r(9699),{isArray:o}=r(8285),{asArray:s}=r(4768),a={};function l({event:e,handlers:t}){let r=!0;for(let n=0;r&&n<t.length;++n){r=!1;const s=t[n];if(o(s))r=l({event:e,handlers:s});else if("function"==typeof s)s({event:e,next:()=>{r=!0}});else{if("object"!=typeof s)throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in s?s[e.code]({event:e,next:()=>{r=!0}}):r=!0}}return r}e.exports=a,a.defaultEventHandler=null,a.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?a.safeEventHandler:[],e.eventHandler?s(e.eventHandler):[],a.defaultEventHandler?a.defaultEventHandler:[]);return 0===t.length?null:t},a.handleEvent=({event:e,options:t})=>{l({event:e,handlers:t.eventHandler})};const c=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"]);a.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&c.has(e.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},a.logEventHandler=function({event:e,next:t}){n.log(`EVENT: ${e.message}`,{event:e}),t()},a.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&n.warn(`WARNING: ${e.message}`,{event:e}),t()},a.unhandledEventHandler=function({event:e}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:e})},a.setDefaultEventHandler=function({eventHandler:e}={}){a.defaultEventHandler=e?s(e):null}},570:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isEmptyObject:s,isString:a,isUndefined:l}=r(8285),{isList:c,isValue:u,isGraph:h,isSubject:d}=r(478),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:v}=r(2182),{isAbsolute:m}=r(3866),{REGEX_BCP47:b,REGEX_KEYWORD:w,addValue:x,asArray:_,getValues:T,validateTypeValue:j}=r(4768),{handleEvent:E}=r(5746),N={};async function O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:h,expandedParent:w,options:T={},insideList:S,typeKey:A,typeScopedContext:R}){const C=Object.keys(h).sort(),D=[];let L;const P=h[A]&&"@json"===f(e,i(h[A])?h[A][0]:h[A],{vocab:!0},{...T,typeExpansion:!0});for(const O of C){let S,A=h[O];if("@context"===O)continue;const C=f(e,O,{vocab:!0},T);if(null===C||!m(C)&&!g(C)){T.eventHandler&&E({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:O,expandedProperty:C}},options:T});continue}if(g(C)){if("@reverse"===r)throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:A});if(C in w&&"@included"!==C&&"@type"!==C)throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!a(A)){if(!T.isFrame)throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:A});if(o(A)){if(!s(A))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:A})}else{if(!i(A))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:A});if(!A.every((e=>a(e))))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:A})}}x(w,"@id",_(A).map((t=>{if(a(t)){const r=f(e,t,{base:!0},T);return T.eventHandler&&(null===r?E(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:T}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:T}):m(r)||E({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:r}},options:T})),r}return t})),{propertyIsArray:T.isFrame});continue}if("@type"===C){o(A)&&(A=Object.fromEntries(Object.entries(A).map((([e,t])=>[f(R,e,{vocab:!0}),_(t).map((e=>f(R,e,{base:!0,vocab:!0},{...T,typeExpansion:!0})))])))),j(A,T.isFrame),x(w,"@type",_(A).map((e=>{if(a(e)){const t=f(R,e,{base:!0,vocab:!0},{...T,typeExpansion:!0});return m(t)||T.eventHandler&&E({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:T}),t}return e})),{propertyIsArray:T.isFrame});continue}if("@included"===C&&v(e,1.1)){const r=_(await N.expand({activeCtx:e,activeProperty:t,element:A,options:T}));if(!r.every((e=>d(e))))throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:A});x(w,"@included",r,{propertyIsArray:!0});continue}if("@graph"===C&&!o(A)&&!i(A))throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:A});if("@value"===C){L=A,P&&v(e,1.1)?w["@value"]=A:x(w,"@value",A,{propertyIsArray:T.isFrame});continue}if("@language"===C){if(null===A)continue;if(!a(A)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:A});A=_(A).map((e=>a(e)?e.toLowerCase():e));for(const e of A)a(e)&&!e.match(b)&&T.eventHandler&&E({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:T});x(w,"@language",A,{propertyIsArray:T.isFrame});continue}if("@direction"===C){if(!a(A)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:A});A=_(A);for(const e of A)if(a(e)&&"ltr"!==e&&"rtl"!==e)throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:A});x(w,"@direction",A,{propertyIsArray:T.isFrame});continue}if("@index"===C){if(!a(A))throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:A});x(w,"@index",A);continue}if("@reverse"===C){if(!o(A))throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:A});if(S=await N.expand({activeCtx:e,activeProperty:"@reverse",element:A,options:T}),"@reverse"in S)for(const e in S["@reverse"])x(w,e,S["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in S){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),x(t,e,[],{propertyIsArray:!0});const r=S[e];for(let i=0;i<r.length;++i){const o=r[i];if(u(o)||c(o))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:S});x(t,e,o,{propertyIsArray:!0})}}continue}if("@nest"===C){D.push(O);continue}let M=e;const F=p(e,O,"@context");l(F)||(M=await y({activeCtx:e,localCtx:F,propagate:!0,overrideProtected:!0,options:T}));const U=p(M,O,"@container")||[];if(U.includes("@language")&&o(A))S=I(M,A,p(M,O,"@direction"),T);else if(U.includes("@index")&&o(A)){const t=U.includes("@graph"),r=p(M,O,"@index")||"@index",n="@index"!==r&&f(e,r,{vocab:!0},T);S=await k({activeCtx:M,options:T,activeProperty:O,value:A,asGraph:t,indexKey:r,propertyIndex:n})}else if(U.includes("@id")&&o(A)){const e=U.includes("@graph");S=await k({activeCtx:M,options:T,activeProperty:O,value:A,asGraph:e,indexKey:"@id"})}else if(U.includes("@type")&&o(A))S=await k({activeCtx:M.revertToPreviousContext(),options:T,activeProperty:O,value:A,asGraph:!1,indexKey:"@type"});else{const n="@list"===C;if(n||"@set"===C){let e=t;n&&"@graph"===r&&(e=null),S=await N.expand({activeCtx:M,activeProperty:e,element:A,options:T,insideList:n})}else S="@json"===p(e,O,"@type")?{"@type":"@json","@value":A}:await N.expand({activeCtx:M,activeProperty:O,element:A,options:T,insideList:!1})}if(null!==S||"@value"===C)if("@list"!==C&&!c(S)&&U.includes("@list")&&(S={"@list":_(S)}),U.includes("@graph")&&!U.some((e=>"@id"===e||"@index"===e))&&(S=_(S).map((e=>({"@graph":_(e)})))),M.mappings.has(O)&&M.mappings.get(O).reverse){const e=w["@reverse"]=w["@reverse"]||{};S=_(S);for(let t=0;t<S.length;++t){const r=S[t];if(u(r)||c(r))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:S});x(e,C,r,{propertyIsArray:!0})}}else x(w,C,S,{propertyIsArray:!0})}if("@value"in w)if("@json"===w["@type"]&&v(e,1.1));else if((o(L)||i(L))&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:L});for(const s of D){const a=i(h[s])?h[s]:[h[s]];for(const i of a){if(!o(i)||Object.keys(i).some((t=>"@value"===f(e,t,{vocab:!0},T))))throw new n("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:i,expandedParent:w,options:T,insideList:S,typeScopedContext:R,typeKey:A})}}}function S({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=f(e,t,{vocab:!0},n);if("@id"===i)return f(e,r,{base:!0},n);if("@type"===i)return f(e,r,{vocab:!0,base:!0},{...n,typeExpansion:!0});const o=p(e,t,"@type");if(("@id"===o||"@graph"===i)&&a(r)){const i=f(e,r,{base:!0},n);return null===i&&r.match(w)&&n.eventHandler&&E({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:n}),{"@id":i}}if("@vocab"===o&&a(r))return{"@id":f(e,r,{vocab:!0,base:!0},n)};if(g(i))return r;const s={};if(o&&!["@id","@vocab","@none"].includes(o))s["@type"]=o;else if(a(r)){const r=p(e,t,"@language");null!==r&&(s["@language"]=r);const n=p(e,t,"@direction");null!==n&&(s["@direction"]=n)}return["boolean","number","string"].includes(typeof r)||(r=r.toString()),s["@value"]=r,s}function I(e,t,r,o){const s=[],l=Object.keys(t).sort();for(const c of l){const l=f(e,c,{vocab:!0},o);let u=t[c];i(u)||(u=[u]);for(const e of u){if(null===e)continue;if(!a(e))throw new n("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==l&&(c.match(b)||o.eventHandler&&E({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:o}),i["@language"]=c.toLowerCase()),r&&(i["@direction"]=r),s.push(i)}}return s}async function k({activeCtx:e,options:t,activeProperty:r,value:o,asGraph:s,indexKey:a,propertyIndex:c}){const d=[],g=Object.keys(o).sort(),v="@type"===a;for(let m of g){if(v){const r=p(e,m,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,propagate:!1,options:t}))}let g,b=o[m];i(b)||(b=[b]),b=await N.expand({activeCtx:e,activeProperty:r,element:b,options:t,insideList:!1,insideIndex:!0}),g=c?"@none"===m?"@none":S({activeCtx:e,activeProperty:a,value:m,options:t}):f(e,m,{vocab:!0},t),"@id"===a?m=f(e,m,{base:!0},t):v&&(m=g);for(let e of b){if(s&&!h(e)&&(e={"@graph":[e]}),"@type"===a)"@none"===g||(e["@type"]?e["@type"]=[m].concat(e["@type"]):e["@type"]=[m]);else{if(u(e)&&!["@language","@type","@index"].includes(a))throw new n(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${a}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==g&&x(e,c,g,{propertyIsArray:!0,prependValue:!0}):"@none"===g||a in e||(e[a]=m)}d.push(e)}}return d}e.exports=N,N.expand=async({activeCtx:e,activeProperty:t=null,element:r,options:c={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:d=null})=>{if(null==r)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(r)&&!o(r))return u||null!==t&&"@graph"!==f(e,t,{vocab:!0},c)?S({activeCtx:e,activeProperty:t,value:r,options:c}):(c.eventHandler&&E({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:r}},options:c}),null);if(i(r)){let n=[];const o=p(e,t,"@container")||[];u=u||o.includes("@list");for(let o=0;o<r.length;++o){let s=await N.expand({activeCtx:e,activeProperty:t,element:r[o],options:c,insideIndex:h,typeScopedContext:d});u&&i(s)&&(s={"@list":s}),null!==s&&(i(s)?n=n.concat(s):n.push(s))}return n}const g=f(e,t,{vocab:!0},c),b=p(e,t,"@context");d=d||(e.previousContext?e:null);let w=Object.keys(r).sort(),x=!h;if(x&&d&&w.length<=2&&!w.includes("@context"))for(const t of w){const r=f(d,t,{vocab:!0},c);if("@value"===r){x=!1,e=d;break}if("@id"===r&&1===w.length){x=!1;break}}x&&(e=e.revertToPreviousContext()),l(b)||(e=await y({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:c})),"@context"in r&&(e=await y({activeCtx:e,localCtx:r["@context"],options:c})),d=e;let j=null;for(const t of w)if("@type"===f(e,t,{vocab:!0},c)){j=j||t;const n=r[t],i=Array.isArray(n)?n.length>1?n.slice().sort():n:[n];for(const t of i){const r=p(d,t,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,options:c,propagate:!1}))}}let I={};await O({activeCtx:e,activeProperty:t,expandedActiveProperty:g,element:r,expandedParent:I,options:c,insideList:u,typeKey:j,typeScopedContext:d}),w=Object.keys(I);let k=w.length;if("@value"in I){if("@type"in I&&("@language"in I||"@direction"in I))throw new n('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:I});let t=k-1;if("@type"in I&&(t-=1),"@index"in I&&(t-=1),"@language"in I&&(t-=1),"@direction"in I&&(t-=1),0!==t)throw new n('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:I});const r=null===I["@value"]?[]:_(I["@value"]),i=T(I,"@type");if(v(e,1.1)&&i.includes("@json")&&1===i.length);else if(0===r.length)c.eventHandler&&E({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:I}},options:c}),I=null;else{if(!r.every((e=>a(e)||s(e)))&&"@language"in I)throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:I});if(!i.every((e=>m(e)&&!(a(e)&&0===e.indexOf("_:"))||s(e))))throw new n('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:I})}}else if("@type"in I&&!i(I["@type"]))I["@type"]=[I["@type"]];else if("@set"in I||"@list"in I){if(k>1&&(2!==k||!("@index"in I)))throw new n('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:I});"@set"in I&&(I=I["@set"],w=Object.keys(I),k=w.length)}else 1===k&&"@language"in I&&(c.eventHandler&&E({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:I}},options:c}),I=null);if(o(I)&&!c.keepFreeFloatingNodes&&!u&&(null===t||"@graph"===g)&&(0===k||"@value"in I||"@list"in I||1===k&&"@id"in I)){if(c.eventHandler){let e,t;0===k?(e="empty object",t="Dropping empty object."):"@value"in I?(e="object with only @value",t="Dropping object with only @value."):"@list"in I?(e="object with only @list",t="Dropping object with only @list."):1===k&&"@id"in I&&(e="object with only @id",t="Dropping object with only @id."),E({event:{type:["JsonLdEvent"],code:e,level:"warning",message:t,details:{value:I}},options:c})}I=null}return I}},1409:(e,t,r)=>{"use strict";const{isSubjectReference:n}=r(478),{createMergedNodeMap:i}=r(9646),o={};e.exports=o,o.flatten=e=>{const t=i(e),r=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const i=t[o[e]];n(i)||r.push(i)}return r}},1849:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(3866),l=r(9699),{createNodeMap:c,mergeNodeMapGraphs:u}=r(9646),h={};function d(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function f(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,r){const n="@"+r;let i=n in e?e[n][0]:t[r];if("embed"===r)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new l("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 s.asArray(e[0]["@id"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of s.asArray(e[0]["@type"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,r,a){let l=!0,c=!1;for(const u in r){let h=!1;const d=s.getValues(t,u),f=0===s.getValues(r,u).length;if("@id"===u){if(o.isEmptyObject(r["@id"][0]||{})?h=!0:r["@id"].length>=0&&(h=r["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(l=!1,f){if(d.length>0)return!1;h=!0}else if(1===r["@type"].length&&o.isEmptyObject(r["@type"][0]))h=d.length>0;else for(const e of r["@type"])h=!(!o.isObject(e)||!("@default"in e))||h||d.some((t=>t===e));if(!a.requireAll)return h}else{if(n(u))continue;{const t=s.getValues(r,u)[0];let n=!1;if(t&&(g([t]),n="@default"in t),l=!1,0===d.length&&n)continue;if(d.length>0&&f)return!1;if(void 0===t){if(d.length>0)return!1;h=!0}else if(i.isList(t)){const r=t["@list"][0];if(i.isList(d[0])){const t=d[0]["@list"];i.isValue(r)?h=t.some((e=>x(r,e))):(i.isSubject(r)||i.isSubjectReference(r))&&(h=t.some((t=>w(e,r,t,a))))}}else h=i.isValue(t)?d.some((e=>x(t,e))):i.isSubjectReference(t)?d.some((r=>w(e,t,r,a))):!!o.isObject(t)&&d.length>0}}if(!h&&a.requireAll)return!1;c=c||h}return l||c}function v(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,a=n.property,l={"@id":t};if(o.isArray(i)){for(let e=0;e<i.length;++e)if(s.compareValues(i[e],l)){i[e]=l;break}}else{const e=o.isArray(i[a]);s.removeValue(i,a,l,{propertyIsArray:e}),s.addValue(i,a,l,{propertyIsArray:e})}const c=e=>{const t=Object.keys(r);for(const n of t)n in r&&o.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],c(n))};c(t)}function m(e,t){if(o.isArray(e))return e.map((e=>m(e,t)));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)"@id"===r&&t.bnodesToClear.includes(e[r])?delete e["@id"]:e[r]=m(e[r],t)}return e}function b(e,t,r){o.isObject(e)?s.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function w(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&y(e,i,t,n)}function x(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],s=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===s.length&&0===a.length&&0===l.length||!(!s.includes(r)&&!o.isEmptyObject(s[0]))&&!!(!n&&0===a.length||a.includes(n)||n&&o.isEmptyObject(a[0]))&&!!(!i&&0===l.length||l.includes(i)||i&&o.isEmptyObject(l[0]))}e.exports=h,h.frameMergedOrDefault=(e,t,r)=>{const n={options:r,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new s.IdentifierIssuer("_:b");c(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=u(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const o=[];return h.frame(n,Object.keys(n.subjects).sort(),t,o),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter((e=>1===n.bnodeMap[e].length))),r.link={},m(o,r)},h.frame=(e,t,r,a,c=null)=>{g(r),r=r[0];const u=e.options,m={embed:p(r,u,"embed"),explicit:p(r,u,"explicit"),requireAll:p(r,u,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],_=function(e,t,r,n){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,r,n)&&(i[o]=t)}return i}(e,t,r,m),T=Object.keys(_).sort();for(const g of T){const y=_[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&g in w){b(a,c,w[g]);continue}const T={"@id":g};if(0===g.indexOf("_:")&&s.addValue(e.bnodeMap,g,T,{propertyIsArray:!0}),w[g]=T,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:r});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==m.embed&&!f(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===m.embed&&g in e.uniqueEmbeds[e.graph]&&v(e,g),e.uniqueEmbeds[e.graph][g]={parent:a,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,n=null;"@graph"in r?(n=r["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(n)||(n={})):(t="@merged"!==e.graph,n={}),t&&h.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[n],T,"@graph")}"@included"in r&&h.frame({...e,embedded:!1},t,r["@included"],T,"@included");for(const t of Object.keys(y).sort())if(n(t)){if(T[t]=s.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&s.addValue(e.bnodeMap,t,T,{propertyIsArray:!0})}else if(!m.explicit||t in r)for(const n of y[t]){const o=t in r?r[t]:d(m);if(i.isList(n)){const o=r[t]&&r[t][0]&&r[t][0]["@list"]?r[t][0]["@list"]:d(m),a={"@list":[]};b(T,t,a);const l=n["@list"];for(const t of l)i.isSubjectReference(t)?h.frame({...e,embedded:!0},[t["@id"]],o,a,"@list"):b(a,"@list",s.clone(t))}else i.isSubjectReference(n)?h.frame({...e,embedded:!0},[n["@id"]],o,T,t):x(o[0],n)&&b(T,t,s.clone(n))}for(const e of Object.keys(r).sort()){if("@type"===e){if(!o.isObject(r[e][0])||!("@default"in r[e][0]))continue}else if(n(e))continue;const t=r[e][0]||{};if(!p(t,u,"omitDefault")&&!(e in T)){let r="@null";"@default"in t&&(r=s.clone(t["@default"])),o.isArray(r)||(r=[r]),T[e]=[{"@preserve":r}]}}for(const t of Object.keys(r["@reverse"]||{}).sort()){const n=r["@reverse"][t];for(const r of Object.keys(e.subjects))s.getValues(e.subjects[r],t).some((e=>e["@id"]===g))&&(T["@reverse"]=T["@reverse"]||{},s.addValue(T["@reverse"],t,[],{propertyIsArray:!0}),h.frame({...e,embedded:!0},[r],n,T["@reverse"][t],c))}b(a,c,T),e.subjectStack.pop()}else b(a,c,T);else b(a,c,T)}},h.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map((e=>h.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)e[r]=h.cleanupNull(e[r],t)}return e}},1176:(e,t,r)=>{"use strict";const n=r(9699),i=r(478),o=r(8285),{REGEX_BCP47:s,addValue:a}=r(4768),{handleEvent:l}=r(5746),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:v,XSD_STRING:m}=r(2445),b={};function w(e,t,r,i){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:i}),a["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=m),c===p){c="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new n("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(c===g)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(o.isNumeric(a["@value"]))if(c===v){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else c===y&&(a["@value"]=parseFloat(a["@value"]));[g,v,y,m].includes(c)||(a["@type"]=c)}else if("i18n-datatype"===r&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:i})),a["@direction"]=t}else c!==m&&(a["@type"]=c)}return a}e.exports=b,b.fromRDF=async(e,t)=>{const r={},n={"@default":r},s={},{useRdfType:l=!1,useNativeTypes:p=!1,rdfDirection:g=null}=t;for(const i of e){const e="DefaultGraph"===i.graph.termType?"@default":i.graph.value;e in n||(n[e]={}),"@default"===e||e in r||(r[e]={"@id":e});const o=n[e],c=i.subject.value,u=i.predicate.value,h=i.object;c in o||(o[c]={"@id":c});const y=o[c],v=h.termType.endsWith("Node");if(v&&!(h.value in o)&&(o[h.value]={"@id":h.value}),u===f&&!l&&v){a(y,"@type",h.value,{propertyIsArray:!0});continue}const m=w(h,p,g,t);if(a(y,u,m,{propertyIsArray:!0}),v)if(h.value===d){const e=o[h.value];"usages"in e||(e.usages=[]),e.usages.push({node:y,property:u,value:m})}else h.value in s?s[h.value]=!1:s[h.value]={node:y,property:u,value:m}}for(const e in n){const t=n[e];if(!(d in t))continue;const r=t[d];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,a=e.value;const l=[],d=[];let f=Object.keys(r).length;for(;n===h&&o.isObject(s[r["@id"]])&&o.isArray(r[u])&&1===r[u].length&&o.isArray(r[h])&&1===r[h].length&&(3===f||4===f&&o.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===c)&&(l.push(r[u][0]),d.push(r["@id"]),e=s[r["@id"]],r=e.node,n=e.property,a=e.value,f=Object.keys(r).length,i.isBlankNode(r)););delete a["@id"],a["@list"]=l.reverse();for(const e of d)delete t[e]}delete r.usages}}const y=[],v=Object.keys(r).sort();for(const e of v){const t=r[e];if(e in n){const r=t["@graph"]=[],o=n[e],s=Object.keys(o).sort();for(const e of s){const t=o[e];i.isSubjectReference(t)||r.push(t)}}i.isSubjectReference(t)||y.push(t)}return y}},478:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.isSubject=e=>!(!n.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>n.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>n.isObject(e)&&"@value"in e,i.isList=e=>n.isObject(e)&&"@list"in e,i.isGraph=e=>n.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>{if(n.isObject(e)){if("@id"in e){const t=e["@id"];return!n.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},730:(e,t,r)=>{const n=r(2948),i=r(1402),o=r(4768),s=r(5777),a=o.IdentifierIssuer,l=r(9699),c=r(3666),u=r(7990),{expand:h}=r(570),{flatten:d}=r(1409),{fromRDF:f}=r(1176),{toRDF:p}=r(2189),{frameMergedOrDefault:g,cleanupNull:y}=r(1849),{isArray:v,isObject:m,isString:b}=r(8285),{isSubjectReference:w}=r(478),{expandIri:x,getInitialContext:_,process:T,processingMode:j}=r(2182),{compact:E,compactIri:N}=r(120),{createNodeMap:O,createMergedNodeMap:S,mergeNodeMaps:I}=r(9646),{logEventHandler:k,logWarningEventHandler:A,safeEventHandler:R,setDefaultEventHandler:C,setupEventHandler:D,strictEventHandler:L,unhandledEventHandler:P}=r(5746),M=function(e){const t={},M=new c({max:100});function F(t,{documentLoader:r=e.documentLoader,...n}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:r},n,t,{eventHandler:D({options:t})})}return e.compact=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===r)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(n=F(n,{base:b(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new a("_:b"),contextResolver:new s({sharedCache:M})})).link&&(n.skipExpansion=!0),n.compactToRelative||delete n.base,i=n.skipExpansion?t:await e.expand(t,n);const c=await e.processContext(_(n),r,n);let u=await E({activeCtx:c,element:i,options:n});n.compactArrays&&!n.graph&&v(u)?1===u.length?u=u[0]:0===u.length&&(u={}):n.graph&&m(u)&&(u=[u]),m(r)&&"@context"in r&&(r=r["@context"]),r=o.clone(r),v(r)||(r=[r]);const h=r;r=[];for(let e=0;e<h.length;++e)(!m(h[e])||Object.keys(h[e]).length>0)&&r.push(h[e]);const d=r.length>0;if(1===r.length&&(r=r[0]),v(u)){const e=N({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=u;u={},d&&(u["@context"]=r),u[e]=t}else if(m(u)&&d){const e=u;u={"@context":r};for(const t in e)u[t]=e[t]}return u},e.expand=async function(t,r){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const n={},i=[];if("expandContext"in(r=F(r,{keepFreeFloatingNodes:!1,contextResolver:new s({sharedCache:M})}))){const e=o.clone(r.expandContext);m(e)&&"@context"in e?n.expandContext=e:n.expandContext={"@context":e},i.push(n.expandContext)}let a;if(b(t)){const o=await e.get(t,r);a=o.documentUrl,n.input=o.document,o.contextUrl&&(n.remoteContext={"@context":o.contextUrl},i.push(n.remoteContext))}else n.input=o.clone(t);"base"in r||(r.base=a||"");let l=_(r);for(const e of i)l=await T({activeCtx:l,localCtx:e,options:r});let c=await h({activeCtx:l,element:n.input,options:r});return m(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),v(c)||(c=[c]),c},e.flatten=async function(t,r,n){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");r="function"==typeof r?null:r||null,n=F(n,{base:b(t)?t:"",contextResolver:new s({sharedCache:M})});const i=await e.expand(t,n),o=d(i);if(null===r)return o;n.graph=!0,n.skipExpansion=!0;const a=await e.compact(o,r,n);return a},e.frame=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(n=F(n,{base:b(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new s({sharedCache:M})}),b(r)){const t=await e.get(r,n);if(r=t.document,t.contextUrl){let e=r["@context"];e?v(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,r["@context"]=e}}const i=r&&r["@context"]||{},o=await e.processContext(_(n),i,n);n.hasOwnProperty("omitGraph")||(n.omitGraph=j(o,1.1)),n.hasOwnProperty("pruneBlankNodeIdentifiers")||(n.pruneBlankNodeIdentifiers=j(o,1.1));const a=await e.expand(t,n),l={...n};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(r,l),u=Object.keys(r).map((e=>x(o,e,{vocab:!0})));l.merged=!u.includes("@graph"),l.is11=j(o,1.1);const h=g(a,c,l);l.graph=!n.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let d=await e.compact(h,i,l);return l.link={},d=y(d,l),d},e.link=async function(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)},e.normalize=e.canonize=async function(t,r){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(r=F(r,{base:b(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new s({sharedCache:M})}))){if("application/n-quads"!==r.inputFormat&&"application/nquads"!==r.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=u.parse(t);return n.canonize(e,r)}const i={...r};delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return n.canonize(o,r)},e.fromRDF=async function(e,r){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");r=F(r,{format:b(e)?"application/n-quads":void 0});const{format:n}=r;let{rdfParser:i}=r;if(n){if(i=i||t[n],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:n})}else i=()=>e;const o=await i(e);return f(o,r)},e.toRDF=async function(t,r){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let n;n=(r=F(r,{base:b(t)?t:"",skipExpansion:!1,contextResolver:new s({sharedCache:M})})).skipExpansion?t:await e.expand(t,r);const i=p(n,r);if(r.format){if("application/n-quads"===r.format||"application/nquads"===r.format)return u.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:r.format})}return i},e.createNodeMap=async function(t,r){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");r=F(r,{base:b(t)?t:"",contextResolver:new s({sharedCache:M})});const n=await e.expand(t,r);return S(n,r)},e.merge=async function(t,r,n){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!v(t))throw new TypeError('Could not merge, "docs" must be an array.');r="function"==typeof r?null:r||null,n=F(n,{contextResolver:new s({sharedCache:M})});const i=await Promise.all(t.map((t=>{const r={...n};return e.expand(t,r)})));let l=!0;"mergeNodes"in n&&(l=n.mergeNodes);const c=n.issuer||new a("_:b"),u={"@default":{}};for(let e=0;e<i.length;++e){const t=o.relabelBlankNodes(i[e],{issuer:new a("_:b"+e+"-")}),r=l||0===e?u:{"@default":{}};if(O(t,r,"@default",c),r!==u)for(const e in r){const t=r[e];if(!(e in u)){u[e]=t;continue}const n=u[e];for(const e in t)e in n||(n[e]=t[e])}}const h=I(u),d=[],f=Object.keys(h).sort();for(let e=0;e<f.length;++e){const t=h[f[e]];w(t)||d.push(t)}if(null===r)return d;n.graph=!0,n.skipExpansion=!0;const p=await e.compact(d,r,n);return p},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,r){let n;n="function"==typeof r.documentLoader?r.documentLoader:e.documentLoader;const i=await n(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");b(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,r){return r=F(r,{base:"",contextResolver:new s({sharedCache:M})}),null===t?_(r):(t=o.clone(t),m(t)&&"@context"in t||(t={"@context":t}),T({activeCtx:e,localCtx:t,options:r}))},e.getContextValue=r(2182).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",u.parse),e.registerRDFParser("application/nquads",u.parse),e.url=r(3866),e.logEventHandler=k,e.logWarningEventHandler=A,e.safeEventHandler=R,e.setDefaultEventHandler=C,e.strictEventHandler=L,e.unhandledEventHandler=P,e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=r(3114),e.JsonLdProcessor=r(7298)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},F=function(){return M((function(){return F()}))};M(F),e.exports=F},9646:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(9699),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new s.IdentifierIssuer("_:b"),n={"@default":{}};return l.createNodeMap(e,n,"@default",r),l.mergeNodeMaps(n)},l.createNodeMap=(e,t,r,c,u,h)=>{if(o.isArray(e)){for(const n of e)l.createNodeMap(n,t,r,c,void 0,h);return}if(!o.isObject(e))return void(h&&h.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(h&&h.push(e))}if(h&&i.isList(e)){const n=[];return l.createNodeMap(e["@list"],t,r,c,u,n),void h.push({"@list":n})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(u)&&(u=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),h&&h.push({"@id":u});const d=t[r],f=d[u]=d[u]||{};f["@id"]=u;const p=Object.keys(e).sort();for(let o of p){if("@id"===o)continue;if("@reverse"===o){const n={"@id":u},o=e["@reverse"];for(const e in o){const a=o[e];for(const o of a){let a=o["@id"];i.isBlankNode(o)&&(a=c.getId(a)),l.createNodeMap(o,t,r,c,a),s.addValue(d[a],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){u in t||(t[u]={}),l.createNodeMap(e[o],t,u,c);continue}if("@included"===o){l.createNodeMap(e[o],t,r,c);continue}if("@type"!==o&&n(o)){if("@index"===o&&o in f&&(e[o]!==f[o]||e[o]["@id"]!==f[o]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[o]=e[o];continue}const h=e[o];if(0===o.indexOf("_:")&&(o=c.getId(o)),0!==h.length)for(let e of h)if("@type"===o&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const n=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];s.addValue(f,o,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,r,c,n)}else if(i.isValue(e))s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const n=[];l.createNodeMap(e["@list"],t,r,c,u,n),e={"@list":n},s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,r,c,u),s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else s.addValue(f,o,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const i of Object.keys(e[r]).sort()){const o=e[r][i];i in t||(t[i]={"@id":i});const a=t[i];for(const e of Object.keys(o).sort())if(n(e)&&"@type"!==e)a[e]=s.clone(o[e]);else for(const t of o[e])s.addValue(a,e,s.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let o=t[n];o?"@graph"in o||(o["@graph"]=[]):t[n]=o={"@id":n,"@graph":[]};const s=o["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];i.isSubjectReference(t)||s.push(t)}}return t}},1402:(e,t,r)=>{"use strict";const n=r(2872),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=n,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},2189:(e,t,r)=>{"use strict";const{createNodeMap:n}=r(9646),{isKeyword:i}=r(2182),o=r(478),s=r(8981),a=r(8285),l=r(4768),{handleEvent:c}=r(5746),{RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:p,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:v,XSD_INTEGER:m,XSD_STRING:b}=r(2445),{isAbsolute:w}=r(3866),x={};function _(e,t,r,n,o){const s=Object.keys(t).sort();for(const a of s){const s=t[a],l=Object.keys(s).sort();for(let t of l){const l=s[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of l){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!w(a)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:a}},options:o});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!w(t)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:o});continue}if("BlankNode"===l.termType&&!o.produceGeneralizedRdf){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:n.getOldIds().find((e=>n.getId(e)===t))}},options:o});continue}const u=T(i,n,e,r,o.rdfDirection,o);u&&e.push({subject:s,predicate:l,object:u,graph:r})}}}}function T(e,t,r,n,i,l){const f={};if(o.isValue(e)){f.termType="Literal",f.value=void 0,f.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;if("@json"===r)f.value=s(t),f.datatype.value=p;else if(a.isBoolean(t))f.value=t.toString(),f.datatype.value=r||y;else if(a.isDouble(t)||r===v)a.isDouble(t)||(t=parseFloat(t)),f.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),f.datatype.value=r||v;else if(a.isNumber(t))f.value=t.toFixed(0),f.datatype.value=r||m;else if("i18n-datatype"===i&&"@direction"in e){const r="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;f.datatype.value=r,f.value=t}else"@language"in e?(f.value=t,f.datatype.value=r||g,f.language=e["@language"]):(f.value=t,f.datatype.value=r||b)}else if(o.isList(e)){const o=function(e,t,r,n,i,o){const s={termType:"NamedNode",value:u},a={termType:"NamedNode",value:h},l={termType:"NamedNode",value:d},c=e.pop(),f=c?{termType:"BlankNode",value:t.getId()}:l;let p=f;for(const l of e){const e=T(l,t,r,n,i,o),c={termType:"BlankNode",value:t.getId()};r.push({subject:p,predicate:s,object:e,graph:n}),r.push({subject:p,predicate:a,object:c,graph:n}),p=c}if(c){const e=T(c,t,r,n,i,o);r.push({subject:p,predicate:s,object:e,graph:n}),r.push({subject:p,predicate:a,object:l,graph:n})}return f}(e["@list"],t,r,n,i,l);f.termType=o.termType,f.value=o.value}else{const t=a.isObject(e)?e["@id"]:e;f.termType=t.startsWith("_:")?"BlankNode":"NamedNode",f.value=t}return"NamedNode"!==f.termType||w(f.value)?f:(l.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:f.value}},options:l}),null)}e.exports=x,x.toRDF=(e,t)=>{const r=new l.IdentifierIssuer("_:b"),i={"@default":{}};n(e,i,"@default",r);const o=[],s=Object.keys(i).sort();for(const e of s){let n;if("@default"===e)n={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}n=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},n.value=e}_(o,i[e],n,r,t)}return o}},8285:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},3866:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.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:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const r={},n=i.parsers[t||"full"],o=n.regex.exec(e);let s=n.keys.length;for(;s--;)r[n.keys[s]]=void 0===o[s]?null:o[s];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=i.removeDotSegments(r.path),r},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));const r=i.parse(t),o={protocol:e.protocol||""};if(null!==r.authority)o.authority=r.authority,o.path=r.path,o.query=r.query;else if(o.authority=e.authority,""===r.path)o.path=e.path,null!==r.query?o.query=r.query:o.query=e.query;else{if(0===r.path.indexOf("/"))o.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,o.path=t}o.query=r.query}""!==r.path&&(o.path=i.removeDotSegments(o.path));let s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==r.fragment&&(s+="#"+r.fragment),""===s&&(s="./"),s},i.removeBase=(e,t)=>{if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const o=i.parse(t.substr(r.length)),s=e.normalizedPath.split("/"),a=o.normalizedPath.split("/"),l=o.fragment||o.query?0:1;for(;s.length>0&&a.length>l&&s[0]===a[0];)s.shift(),a.shift();let c="";if(s.length>0){s.pop();for(let e=0;e<s.length;++e)c+="../"}return c+=a.join("/"),null!==o.query&&(c+="?"+o.query),null!==o.fragment&&(c+="#"+o.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>n.isString(e)&&o.test(e),i.isRelative=e=>n.isString(e)},4768:(e,t,r)=>{"use strict";const n=r(478),i=r(8285),o=r(2948).IdentifierIssuer,s=r(9699),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u="application/ld+json, application/json",h={};function d(e,t){if(i.isArray(t))for(let r=0;r<t.length;++r)t[r]=d(e,t[r]);else if(n.isList(t))t["@list"]=d(e,t["@list"]);else if(i.isObject(t)){n.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const r=Object.keys(t).sort();for(let n=0;n<r.length;++n){const i=r[n];"@id"!==i&&(t[i]=d(e,t[i]))}}return t}e.exports=h,h.IdentifierIssuer=o,h.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,h.REGEX_KEYWORD=/^@[a-zA-Z]+$/,h.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=h.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,h.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(h.clone(r))}else if(i.isObject(e)){t={};for(const r in e)t[r]=h.clone(e[r])}else t=e.toString();return t}return e},h.asArray=function(e){return Array.isArray(e)?e:[e]},h.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+u+'" is supported.');return Object.assign({Accept:u},e)},h.parseLinkHeader=e=>{const t={},r=e.match(a);for(let e=0;e<r.length;++e){let n=r[e].match(l);if(!n)continue;const i={target:n[1]},o=n[2];for(;n=c.exec(o);)i[n[1]]=void 0===n[2]?n[3]:n[2];const s=i.rel||"";Array.isArray(t[s])?t[s].push(i):t.hasOwnProperty(s)?t[s]=[t[s],i]:t[s]=i}return t},h.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every((e=>i.isString(e))))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&h.asArray(e["@default"]).every((e=>i.isString(e))))return}throw new s('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})}},h.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const r=e[t];return!i.isArray(r)||r.length>0}return!1},h.hasValue=(e,t,r)=>{if(h.hasProperty(e,t)){let o=e[t];const s=n.isList(o);if(i.isArray(o)||s){s&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(h.compareValues(r,o[e]))return!0}else if(!i.isArray(r))return h.compareValues(r,o)}return!1},h.addValue=(e,t,r,n)=>{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),"prependValue"in n||(n.prependValue=!1),n.valueIsArray)e[t]=r;else if(i.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),n.prependValue&&(r=r.concat(e[t]),e[t]=[]);for(let i=0;i<r.length;++i)h.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const o=!n.allowDuplicate&&h.hasValue(e,t,r);i.isArray(e[t])||o&&!n.propertyIsArray||(e[t]=[e[t]]),o||(n.prependValue?e[t].unshift(r):e[t].push(r))}else e[t]=n.propertyIsArray?[r]:r},h.getValues=(e,t)=>[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=h.getValues(e,t).filter((e=>!h.compareValues(e,r)));0===i.length?h.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},h.relabelBlankNodes=(e,t)=>d((t=t||{}).issuer||new o("_:b"),e),h.compareValues=(e,t)=>e===t||!(!n.isValue(e)||!n.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],h.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},3666:(e,t,r)=>{"use strict";const n=r(1123),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),h=Symbol("lruList"),d=Symbol("cache"),f=Symbol("updateAgeOnGet"),p=()=>1,g=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(y(e,t)){if(m(e,n),!e[a])return}else r&&(e[f]&&(n.value.now=Date.now()),e[h].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},v=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const r=t.prev;m(e,t),t=r}},m=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[h].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;y(e,i)&&(m(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=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[i]=e.max||1/0;const t=e.length||p;if(this[s]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[f]=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[i]=e||1/0,v(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,v(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[o]=0,this[h].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),v(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let r=this[h].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[h].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[h].toArray().map((e=>e.key))}values(){return this[h].toArray().map((e=>e.value))}reset(){this[c]&&this[h]&&this[h].length&&this[h].forEach((e=>this[c](e.key,e.value))),this[d]=new Map,this[h]=new n,this[o]=0}dump(){return this[h].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[h]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[d].has(e)){if(a>this[i])return m(this,this[d].get(e)),!1;const s=this[d].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),v(this),!0}const f=new b(e,t,a,n,r);return f.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=f.length,this[h].unshift(f),this[d].set(e,this[h].head),v(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[h].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach(((e,t)=>g(this,t,!1)))}}},8720:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},7402:(e,t,r)=>{"use strict";var n=r(9170),i=r(2550),o=r(8720),s=r(5280),a=r(9129),l=i(s(),Object);n(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},5280:(e,t,r)=>{"use strict";var n=r(8720);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9129:(e,t,r)=>{"use strict";var n=r(5280),i=r(9170);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8383:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(4418),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{h(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=s(e),a=t&&"[object String]"===o.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var g=0;g<e.length;++g)d.push(String(g));if(n&&e.length>0)for(var y=0;y<e.length;++y)d.push(String(y));else for(var v in e)p&&"prototype"===v||!i.call(e,v)||d.push(String(v));if(l)for(var m=function(e){if("undefined"==typeof window||!f)return h(e);try{return h(e)}catch(e){return!1}}(e),b=0;b<u.length;++b)m&&"constructor"===u[b]||!i.call(e,u[b])||d.push(u[b]);return d}}e.exports=n},806:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(4418),o=Object.keys,s=o?function(e){return o(e)}:r(8383),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},4418:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},2530:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],c=!1,u=-1;function h(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||c||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5929:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},2948:(e,t,r)=>{e.exports=r(2874)},577:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:t,_existing:r,counter:n}=this;return new e(t,new Map(r),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},4071:(e,t,r)=>{"use strict";r(4828);const n=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!n||!n.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await n.subtle.digest(this.algorithm,e));let r="";for(let e=0;e<t.length;++e)r+=t[e].toString(16).padStart(2,"0");return r}}},6327:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",r="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",o="Literal",s="DefaultGraph",a={};a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^[ \\t]*$"),a.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class e{static parse(e){const l=[],u={},h=e.split(a.eoln);let d=0;for(const e of h){if(d++,a.empty.test(e))continue;const h=e.match(a.quad);if(null===h)throw new Error("N-Quads parse error on line "+d+".");const g={subject:null,predicate:null,object:null,graph:null};if(void 0!==h[1]?g.subject={termType:n,value:h[1]}:g.subject={termType:i,value:h[2]},g.predicate={termType:n,value:h[3]},void 0!==h[4]?g.object={termType:n,value:h[4]}:void 0!==h[5]?g.object={termType:i,value:h[5]}:(g.object={termType:o,value:void 0,datatype:{termType:n}},void 0!==h[7]?g.object.datatype.value=h[7]:void 0!==h[8]?(g.object.datatype.value=t,g.object.language=h[8]):g.object.datatype.value=r,g.object.value=h[6].replace(c,(function(e,t,r,n){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(r)return String.fromCharCode(parseInt(r,16));if(n)throw new Error("Unsupported U escape")}))),void 0!==h[9]?g.graph={termType:n,value:h[9]}:void 0!==h[10]?g.graph={termType:i,value:h[10]}:g.graph={termType:s,value:""},g.graph.value in u){let e=!0;const t=u[g.graph.value];for(const r of t)if(p=g,(f=r).subject.termType===p.subject.termType&&f.object.termType===p.object.termType&&f.subject.value===p.subject.value&&f.predicate.value===p.predicate.value&&f.object.value===p.object.value&&(f.object.termType!==o||f.object.datatype.termType===p.object.datatype.termType&&f.object.language===p.object.language&&f.object.datatype.value===p.object.datatype.value)){e=!1;break}e&&(t.push(g),l.push(g))}else u[g.graph.value]=[g],l.push(g)}var f,p;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuadComponents(e,o,s,a){let c="";return e.termType===n?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${o.value}> `,s.termType===n?c+=`<${s.value}>`:s.termType===i?c+=s.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===t?s.language&&(c+=`@${s.language}`):s.datatype.value!==r&&(c+=`^^<${s.datatype.value}>`)),a.termType===n?c+=` <${a.value}>`:a.termType===i&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const a=[],l={"blank node":i,IRI:n,literal:o};for(const c in e)e[c].forEach((e=>{const u={};for(const i in e){const s=e[i],a={termType:l[s.type],value:s.value};a.termType===o&&(a.datatype={termType:n},"datatype"in s&&(a.datatype.value=s.datatype),"language"in s?("datatype"in s||(a.datatype.value=t),a.language=s.language):"datatype"in s||(a.datatype.value=r)),u[i]=a}u.graph="@default"===c?{termType:s,value:""}:{termType:c.startsWith("_:")?i:n,value:c},a.push(u)}));return a}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},83:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,r=e.slice();let n=null,i=0;const o=e.length;for(let r=0;r<o;++r){const s=e[r],a=t.get(s);(null===n||s>n)&&(a&&r>0&&s>e[r-1]||!a&&r<o-1&&s>e[r+1])&&(n=s,i=r)}if(null===n)this.done=!0;else{const r=t.get(n)?i-1:i+1;e[i]=e[r],e[r]=n;for(const r of e)r>n&&t.set(r,!t.get(r))}return r}}},4515:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];let i=0;for(const e of r)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),l=[];for(const e of o){const r=t.get(e);if(r.length>1){l.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of l){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=await this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=await i.digest(),r.hash}async hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}async hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=await this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));let l=0;for(;a.hasNext();){const e=a.next();++l%3==0&&await this._yield();let n=t.clone(),i="";const o=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){c=!0;break}if(!c){for(const e of o){const t=await this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){c=!0;break}}c||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:await n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=await this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=await this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},2160:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];for(const e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const e of i){const r=t.get(e);if(r.length>1){o.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of o){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=i.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));for(;a.hasNext();){const e=a.next();let n=t.clone(),i="";const o=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){l=!0;break}if(!l){for(const e of o){const t=this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){l=!0;break}}l||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:r});return r}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},3663:(e,t,r)=>{"use strict";const n=r(4071),i=r(4515);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n){let n,s;if("BlankNode"===o.subject.termType&&o.subject.value!==e)s=o.subject.value,n="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;s=o.object.value,n="r"}++i%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(s,o,t,n),l=r.get(a);l?l.push(s):r.set(a,[s])}return r}}},5393:(e,t,r)=>{"use strict";const n=r(4071),i=r(2160);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n){let n,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,n="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,n="r"}const s=this.hashRelatedBlankNode(o,i,t,n),a=r.get(s);a?a.push(o):r.set(s,[o])}return r}}},2874:(e,t,r)=>{"use strict";const n=r(4515),i=r(3663),o=r(2160),s=r(5393);let a;try{a=r(7670)}catch(e){}t.NQuads=r(6327),t.IdentifierIssuer=r(577),t._rdfCanonizeNative=function(e){return e&&(a=e),a},t.canonize=async function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,n)=>a.canonize(e,r,((e,r)=>e?n(e):t(r)))))}if("URDNA2015"===r.algorithm)return new n(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)},t._canonizeSync=function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(e,r)}if("URDNA2015"===r.algorithm)return new o(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new s(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)}},4828:function(e,t,r){var n=r(2530);!function(e,t){"use strict";if(!e.setImmediate){var r,i,o,s,a,l=1,c={},u=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){n.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[l]=i,r(l),l++},d.clearImmediate=f}function f(e){delete c[e]}function p(e){if(u)setTimeout(p,0,e);else{var t=c[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{f(e),u=!1}}}}}("undefined"==typeof self?void 0===r.g?this:r.g:self)},9523:e=>{const t={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/"};e.exports=function(e={namedNode:e=>e}){const r={};for(const n in t){const i=t[n];r[n]=function(t=""){return e.namedNode(i+t)}}return r}},9397:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},4489:(e,t,r)=>{"use strict";var n=r(7092),i=r(7427),o=r(4010),s=r(2527);function a(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),f=a(Boolean.prototype.valueOf);if(l)var p=a(BigInt.prototype.valueOf);if(c)var g=a(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function v(e){return"[object Map]"===u(e)}function m(e){return"[object Set]"===u(e)}function b(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function T(e){return"[object DataView]"===u(e)}function j(e){return"undefined"!=typeof DataView&&(T.working?T(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||j(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},v.working="undefined"!=typeof Map&&v(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(v.working?v(e):e instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(m.working?m(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=j;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function N(e){return"[object SharedArrayBuffer]"===u(e)}function O(e){return void 0!==E&&(void 0===N.working&&(N.working=N(new E)),N.working?N(e):e instanceof E)}function S(e){return y(e,h)}function I(e){return y(e,d)}function k(e){return y(e,f)}function A(e){return l&&y(e,p)}function R(e){return c&&y(e,g)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=S,t.isStringObject=I,t.isBooleanObject=k,t.isBigIntObject=A,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return S(e)||I(e)||k(e)||A(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},5663:(e,t,r)=>{var n=r(2530),i=r(292),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},s=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(s,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r<i;a=n[++r])m(a)||!T(a)?o+=" "+a:o+=" "+u(a);return o},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),o=!0}return e.apply(this,arguments)}};var a={},l=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),l=new RegExp("^"+c+"$","i")}function u(e,r){var n={seen:[],stylize:d};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),v(r)?n.showHidden=r:r&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),f(n,e,n.depth)}function h(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function d(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&N(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=f(e,i,n)),i}var o=function(e,t){if(x(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),E(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(N(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(j(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return p(r)}var c,u="",h=!1,d=["{","}"];return y(r)&&(h=!0,d=["[","]"]),N(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(u=" "+RegExp.prototype.toString.call(r)),j(r)&&(u=" "+Date.prototype.toUTCString.call(r)),E(r)&&(u=" "+p(r)),0!==s.length||h&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=h?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)A(t,String(s))?o.push(g(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(g(e,t,r,n,i,!0))})),o}(e,r,n,a,s):s.map((function(t){return g(e,r,n,a,t,h)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,d)):d[0]+u+d[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),A(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(l.value)<0?(a=m(r)?f(e,l.value,null):f(e,l.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),x(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function y(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function m(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function x(e){return void 0===e}function _(e){return T(e)&&"[object RegExp]"===O(e)}function T(e){return"object"==typeof e&&null!==e}function j(e){return T(e)&&"[object Date]"===O(e)}function E(e){return T(e)&&("[object Error]"===O(e)||e instanceof Error)}function N(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(l.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);i.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(4489),t.isArray=y,t.isBoolean=v,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=x,t.isRegExp=_,t.types.isRegExp=_,t.isObject=T,t.isDate=j,t.types.isDate=j,t.isError=E,t.types.isNativeError=E,t.isFunction=N,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(9397);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){i.log("%s - %s",k(),t.format.apply(t,arguments))},t.inherits=r(8575),t._extend=function(e,t){if(!t||!T(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=R,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(s.bind(null,null,e))}),(function(e){n.nextTick(C.bind(null,e,s))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},4010:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=r(3828),a=o("Object.prototype.toString"),l=r(4111)(),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("String.prototype.slice"),d={},f=Object.getPrototypeOf;l&&s&&f&&n(u,(function(e){if("function"==typeof c[e]){var t=new c[e];if(Symbol.toStringTag in t){var r=f(t),n=s(r,Symbol.toStringTag);if(!n){var i=f(r);n=s(i,Symbol.toStringTag)}d[e]=n.get}}}));var p=r(2527);e.exports=function(e){return!!p(e)&&(l&&Symbol.toStringTag in e?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):h(a(e),8,-1))}},7876:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},1123:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),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 r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.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++}},n.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++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.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}},n.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}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var s=[];for(n=0;o&&n<t;n++)s.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<r.length;n++)o=i(this,o,r[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(7876)(n)}catch(e){}},870:t=>{"use strict";t.exports=e},7670:()=>{},4343:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},240:(e,t,r)=>{"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{Z:()=>n})}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{BlankNode:()=>l,Collection:()=>p,ConnectedStore:()=>ai,DataFactory:()=>Hn,Empty:()=>Xt,Fetcher:()=>Pn,Formula:()=>Tr,IndexedFormula:()=>Cr,Literal:()=>d,LiveStore:()=>li,N3Parser:()=>tn,NamedNode:()=>c.Z,Namespace:()=>cr,NextId:()=>si,Node:()=>jr,Query:()=>Or,RDFParser:()=>gn,RDFaProcessor:()=>fn,SPARQLToQuery:()=>Un,Serializer:()=>gr,Statement:()=>tr,Store:()=>Cr,UpdateManager:()=>Bn,UpdatesSocket:()=>$n,UpdatesVia:()=>Zn,Util:()=>ur,Variable:()=>nr,blankNode:()=>Yn,convert:()=>e,defaultGraph:()=>Kn,fetcher:()=>Vn,fromNT:()=>ii,graph:()=>Gn,isBlankNode:()=>u.B2,isCollection:()=>u.uZ,isGraph:()=>u.NA,isLiteral:()=>u.n_,isNamedNode:()=>u.NX,isPredicate:()=>u.lx,isQuad:()=>u.PY,isRDFObject:()=>u.lt,isRDFlibObject:()=>u.Uc,isRDFlibPredicate:()=>u.nq,isRDFlibSubject:()=>u.f,isStatement:()=>u.Yi,isStore:()=>u.Pv,isSubject:()=>u.zz,isTerm:()=>u.jt,isVariable:()=>u.cG,jsonParser:()=>Mn,lit:()=>Jn,literal:()=>ei,log:()=>lr.Z,namedNode:()=>Qn,parse:()=>vn,quad:()=>ti,queryToSPARQL:()=>Fn,serialize:()=>vr,sparqlUpdateParser:()=>yn,st:()=>Xn,sym:()=>Qn,term:()=>oi,termValue:()=>wn._,triple:()=>ri,uri:()=>rr,variable:()=>Wn});var e={};n.r(e),n.d(e,{convertToJson:()=>Gt,convertToNQuads:()=>Jt});var t=n(240),r=n(8333),o=n(4806),s=n(9247),a=n(292);class l extends o.Z{static getId(e){if(e){if("string"!=typeof e)throw a.log("Bad blank id:",e),new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){let t=e.split("#");return t[t.length-1]}return e}return"n"+l.nextId++}constructor(e){super(l.getId(e)),(0,t.Z)(this,"termType",s.V1),(0,t.Z)(this,"classOrder",r.Z.BlankNode),(0,t.Z)(this,"isBlank",1),(0,t.Z)(this,"isVar",1)}get id(){return this.value}set id(e){this.value=e}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}copy(e){var t=new l;return e.copyTo(this,t),t}toCanonical(){return l.NTAnonymousNodePrefix+this.value}toString(){return l.NTAnonymousNodePrefix+this.id}}(0,t.Z)(l,"nextId",0),(0,t.Z)(l,"NTAnonymousNodePrefix","_:");var c=n(6545),u=n(5904);const h={boolean:new c.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new c.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new c.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new c.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new c.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new c.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new c.Z("http://www.w3.org/2001/XMLSchema#string")};class d extends o.Z{constructor(e,n,i){super(e),(0,t.Z)(this,"termType",s.xH),(0,t.Z)(this,"classOrder",r.Z.Literal),(0,t.Z)(this,"datatype",h.string),(0,t.Z)(this,"isVar",0),(0,t.Z)(this,"language",""),n?(this.language=n,this.datatype=h.langString):this.datatype=i?c.Z.fromValue(i):h.string}copy(){return new d(this.value,this.lang,this.datatype)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype))}get lang(){return this.language}set lang(e){this.language=e||""}toNT(){return d.toNT(this)}static toNT(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(h.string)||(t+="^^"+e.datatype.toCanonical()),t}toString(){return""+this.value}static fromBoolean(e){return new d(e?"1":"0",null,h.boolean)}static fromDate(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");let t=function(e){return(""+(100+e)).slice(1,3)},r=e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z";return new d(r,null,h.dateTime)}static fromNumber(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");let t;const r=e.toString();return t=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?h.integer:h.decimal:h.double,new d(r,null,t)}static fromValue(e){if((0,u.n_)(e))return e;switch(typeof e){case"object":if(e instanceof Date)return d.fromDate(e);case"boolean":return d.fromBoolean(e);case"number":return d.fromNumber(e);case"string":return new d(e)}throw new Error("Can't make literal from "+e+" of type "+typeof e)}}function f(e){return null==e||(0,u.jt)(e)?e:Array.isArray(e)?new p(e):d.fromValue(e)}class p extends o.Z{constructor(e){super((l.nextId++).toString()),(0,t.Z)(this,"termType",s.fb),(0,t.Z)(this,"classOrder",r.Z.Collection),(0,t.Z)(this,"closed",!1),(0,t.Z)(this,"compareTerm",l.prototype.compareTerm),(0,t.Z)(this,"elements",[]),(0,t.Z)(this,"isVar",0),e&&e.length>0&&e.forEach((e=>{this.elements.push(f(e))}))}get id(){return this.value}set id(e){this.value=e}append(e){return this.elements.push(e)}close(){return this.closed=!0,this.closed}shift(){return this.elements.shift()}substitute(e){const t=this.elements.map((t=>t.substitute(e)));return new p(t)}toNT(){return p.toNT(this)}static toNT(e){return l.NTAnonymousNodePrefix+e.id}toString(){return"("+this.elements.join(" ")+")"}unshift(e){return this.elements.unshift(e)}}(0,t.Z)(p,"termType",s.fb);var g=n(2530),y=n(292);function v(e){return function(...t){var r=t.pop();return e.call(this,t,r)}}var m="function"==typeof queueMicrotask&&queueMicrotask,b="function"==typeof setImmediate&&setImmediate,w="object"==typeof g&&"function"==typeof g.nextTick;function x(e){setTimeout(e,0)}function _(e){return(t,...r)=>e((()=>t(...r)))}var T=_(m?queueMicrotask:b?setImmediate:w?g.nextTick:x);function j(e){return O(e)?function(...t){const r=t.pop();return E(e.apply(this,t),r)}:v((function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}if(n&&"function"==typeof n.then)return E(n,r);r(null,n)}))}function E(e,t){return e.then((e=>{N(t,null,e)}),(e=>{N(t,e&&e.message?e:new Error(e))}))}function N(e,t,r){try{e(t,r)}catch(e){T((e=>{throw e}),e)}}function O(e){return"AsyncFunction"===e[Symbol.toStringTag]}function S(e){if("function"!=typeof e)throw new Error("expected a function");return O(e)?j(e):e}function I(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[t-1]?e.apply(this,r):new Promise(((n,i)=>{r[t-1]=(e,...t)=>{if(e)return i(e);n(t.length>1?t:t[0])},e.apply(this,r)}))}}function k(e){return function(t,...r){return I((function(n){var i=this;return e(t,((e,t)=>{S(e).apply(i,r.concat(t))}),n)}))}}function A(e,t,r,n){t=t||[];var i=[],o=0,s=S(r);return e(t,((e,t,r)=>{var n=o++;s(e,((e,t)=>{i[n]=t,r(e)}))}),(e=>{n(e,i)}))}function R(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}const C={};function D(e){function t(...t){if(null!==e){var r=e;e=null,r.apply(this,t)}}return Object.assign(t,e),t}function L(e){return function(...t){if(null===e)throw new Error("Callback was already called.");var r=e;e=null,r.apply(this,t)}}function P(e,t,r,n){let i=!1,o=!1,s=!1,a=0,l=0;function c(){a>=t||s||i||(s=!0,e.next().then((({value:e,done:t})=>{if(!o&&!i){if(s=!1,t)return i=!0,void(a<=0&&n(null));a++,r(e,l,u),l++,c()}})).catch(h))}function u(e,t){if(a-=1,!o)return e?h(e):!1===e?(i=!0,void(o=!0)):t===C||i&&a<=0?(i=!0,n(null)):void c()}function h(e){o||(s=!1,i=!0,n(e))}c()}var M=e=>(t,r,n)=>{if(n=D(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return n(null);if("AsyncGenerator"===t[Symbol.toStringTag])return P(t,e,r,n);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return P(t[Symbol.asyncIterator](),e,r,n);var i=function(e){if(R(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t,r,n,i,o=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return o?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(o):(r=(t=e)?Object.keys(t):[],n=-1,i=r.length,function e(){var o=r[++n];return"__proto__"===o?e():n<i?{value:t[o],key:o}:null})}(t),o=!1,s=!1,a=0,l=!1;function c(e,t){if(!s)if(a-=1,e)o=!0,n(e);else if(!1===e)o=!0,s=!0;else{if(t===C||o&&a<=0)return o=!0,n(null);l||u()}}function u(){for(l=!0;a<e&&!o;){var t=i();if(null===t)return o=!0,void(a<=0&&n(null));a+=1,r(t.value,t.key,L(c))}l=!1}u()},F=I((function(e,t,r,n){return M(t)(e,S(r),n)}),4);function U(e,t,r){r=D(r);var n=0,i=0,{length:o}=e,s=!1;function a(e,t){!1===e&&(s=!0),!0!==s&&(e?r(e):++i!==o&&t!==C||r(null))}for(0===o&&r(null);n<o;n++)t(e[n],n,L(a))}function B(e,t,r){return F(e,1/0,t,r)}var q=I((function(e,t,r){return(R(e)?U:B)(e,S(t),r)}),3),H=I((function(e,t,r){return A(q,e,t,r)}),3),$=k(H),Z=I((function(e,t,r){return F(e,1,t,r)}),3),z=I((function(e,t,r){return A(Z,e,t,r)}),3),V=k(z);const G=Symbol("promiseCallback");function J(){let e,t;function r(r,...n){if(r)return t(r);e(n.length>1?n:n[0])}return r[G]=new Promise(((r,n)=>{e=r,t=n})),r}function X(e,t,r){"number"!=typeof t&&(r=t,t=null),r=D(r||J());var n=Object.keys(e).length;if(!n)return r(null);t||(t=n);var i={},o=0,s=!1,a=!1,l=Object.create(null),c=[],u=[],h={};function d(e,t){c.push((()=>function(e,t){if(!a){var n=L(((t,...n)=>{if(o--,!1!==t)if(n.length<2&&([n]=n),t){var c={};if(Object.keys(i).forEach((e=>{c[e]=i[e]})),c[e]=n,a=!0,l=Object.create(null),s)return;r(t,c)}else i[e]=n,(l[e]||[]).forEach((e=>e())),f();else s=!0}));o++;var c=S(t[t.length-1]);t.length>1?c(i,n):c(n)}}(e,t)))}function f(){if(!s){if(0===c.length&&0===o)return r(null,i);for(;c.length&&o<t;)c.shift()()}}function p(t){var r=[];return Object.keys(e).forEach((n=>{const i=e[n];Array.isArray(i)&&i.indexOf(t)>=0&&r.push(n)})),r}return Object.keys(e).forEach((t=>{var r=e[t];if(!Array.isArray(r))return d(t,[r]),void u.push(t);var n=r.slice(0,r.length-1),i=n.length;if(0===i)return d(t,r),void u.push(t);h[t]=i,n.forEach((o=>{if(!e[o])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+o+"` in "+n.join(", "));var s,a;(a=l[s=o])||(a=l[s]=[]),a.push((()=>{0==--i&&d(t,r)}))}))})),function(){for(var e=0;u.length;)e++,p(u.pop()).forEach((e=>{0==--h[e]&&u.push(e)}));if(e!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),f(),r[G]}var Q=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,W=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,Y=/,/,K=/(=.+)?(\s*)$/;class ee{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):te(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):te(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:r}=t;e(t)&&this.removeLink(t),t=r}return this}}function te(e,t){e.length=1,e.head=e.tail=t}function re(e,t,r){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var n=S(e),i=0,o=[];const s={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function a(e,t){return e?t?void(s[e]=s[e].filter((e=>e!==t))):s[e]=[]:Object.keys(s).forEach((e=>s[e]=[]))}function l(e,...t){s[e].forEach((e=>e(...t)))}var c=!1;function u(e,t,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var i,o;function s(e,...t){return e?r?o(e):i():t.length<=1?i(t[0]):void i(t)}g.started=!0;var a=g._createTaskItem(e,r?s:n||s);if(t?g._tasks.unshift(a):g._tasks.push(a),c||(c=!0,T((()=>{c=!1,g.process()}))),r||!n)return new Promise(((e,t)=>{i=e,o=t}))}function h(e){return function(t,...r){i-=1;for(var n=0,s=e.length;n<s;n++){var a=e[n],c=o.indexOf(a);0===c?o.shift():c>0&&o.splice(c,1),a.callback(t,...r),null!=t&&l("error",t,a.data)}i<=g.concurrency-g.buffer&&l("unsaturated"),g.idle()&&l("drain"),g.process()}}function d(e){return!(0!==e.length||!g.idle()||(T((()=>l("drain"))),0))}const f=e=>t=>{if(!t)return new Promise(((t,r)=>{!function(e,n){const i=(...n)=>{a(e,i),((e,n)=>{if(e)return r(e);t(n)})(...n)};s[e].push(i)}(e)}));a(e),function(e,t){s[e].push(t)}(e,t)};var p=!1,g={_tasks:new ee,_createTaskItem:(e,t)=>({data:e,callback:t}),*[Symbol.iterator](){yield*g._tasks[Symbol.iterator]()},concurrency:t,payload:r,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>u(e,!1,!1,t)))}return u(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>u(e,!1,!0,t)))}return u(e,!1,!0,t)},kill(){a(),g._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>u(e,!0,!1,t)))}return u(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>u(e,!0,!0,t)))}return u(e,!0,!0,t)},remove(e){g._tasks.remove(e)},process(){if(!p){for(p=!0;!g.paused&&i<g.concurrency&&g._tasks.length;){var e=[],t=[],r=g._tasks.length;g.payload&&(r=Math.min(r,g.payload));for(var s=0;s<r;s++){var a=g._tasks.shift();e.push(a),o.push(a),t.push(a.data)}i+=1,0===g._tasks.length&&l("empty"),i===g.concurrency&&l("saturated");var c=L(h(e));n(t,c)}p=!1}},length:()=>g._tasks.length,running:()=>i,workersList:()=>o,idle:()=>g._tasks.length+i===0,pause(){g.paused=!0},resume(){!1!==g.paused&&(g.paused=!1,T(g.process))}};return Object.defineProperties(g,{saturated:{writable:!1,value:f("saturated")},unsaturated:{writable:!1,value:f("unsaturated")},empty:{writable:!1,value:f("empty")},drain:{writable:!1,value:f("drain")},error:{writable:!1,value:f("error")}}),g}var ne=I((function(e,t,r,n){n=D(n);var i=S(r);return Z(e,((e,r,n)=>{i(t,e,((e,r)=>{t=r,n(e)}))}),(e=>n(e,t)))}),4);function ie(...e){var t=e.map(S);return function(...e){var r=this,n=e[e.length-1];return"function"==typeof n?e.pop():n=J(),ne(t,e,((e,t,n)=>{t.apply(r,e.concat(((e,...t)=>{n(e,t)})))}),((e,t)=>n(e,...t))),n[G]}}var oe=I((function(e,t,r,n){return A(M(t),e,r,n)}),4),se=I((function(e,t,r,n){var i=S(r);return oe(e,t,((e,t)=>{i(e,((e,...r)=>e?t(e):t(e,r)))}),((e,t)=>{for(var r=[],i=0;i<t.length;i++)t[i]&&(r=r.concat(...t[i]));return n(e,r)}))}),4),ae=I((function(e,t,r){return se(e,1/0,t,r)}),3),le=I((function(e,t,r){return se(e,1,t,r)}),3);function ce(e,t){return(r,n,i,o)=>{var s,a=!1;const l=S(i);r(n,((r,n,i)=>{l(r,((n,o)=>n||!1===n?i(n):e(o)&&!s?(a=!0,s=t(!0,r),i(null,C)):void i()))}),(e=>{if(e)return o(e);o(null,a?s:t(!1))}))}}var ue=I((function(e,t,r){return ce((e=>e),((e,t)=>t))(q,e,t,r)}),3),he=I((function(e,t,r,n){return ce((e=>e),((e,t)=>t))(M(t),e,r,n)}),4),de=I((function(e,t,r){return ce((e=>e),((e,t)=>t))(M(1),e,t,r)}),3);function fe(e){return(t,...r)=>S(t)(...r,((t,...r)=>{"object"==typeof y&&(t?y.error&&y.error(t):y[e]&&r.forEach((t=>y[e](t))))}))}var pe=fe("dir"),ge=I((function(e,t,r){r=L(r);var n,i=S(e),o=S(t);function s(e,...t){if(e)return r(e);!1!==e&&(n=t,o(...t,a))}function a(e,t){return e?r(e):!1!==e?t?void i(s):r(null,...n):void 0}return a(null,!0)}),3);function ye(e){return(t,r,n)=>e(t,n)}var ve=I((function(e,t,r){return q(e,ye(S(t)),r)}),3),me=I((function(e,t,r,n){return M(t)(e,ye(S(r)),n)}),4),be=I((function(e,t,r){return me(e,1,t,r)}),3);function we(e){return O(e)?e:function(...t){var r=t.pop(),n=!0;t.push(((...e)=>{n?T((()=>r(...e))):r(...e)})),e.apply(this,t),n=!1}}var xe=I((function(e,t,r){return ce((e=>!e),(e=>!e))(q,e,t,r)}),3),_e=I((function(e,t,r,n){return ce((e=>!e),(e=>!e))(M(t),e,r,n)}),4),Te=I((function(e,t,r){return ce((e=>!e),(e=>!e))(Z,e,t,r)}),3);function je(e,t,r,n){var i=new Array(t.length);e(t,((e,t,n)=>{r(e,((e,r)=>{i[t]=!!r,n(e)}))}),(e=>{if(e)return n(e);for(var r=[],o=0;o<t.length;o++)i[o]&&r.push(t[o]);n(null,r)}))}function Ee(e,t,r,n){var i=[];e(t,((e,t,n)=>{r(e,((r,o)=>{if(r)return n(r);o&&i.push({index:t,value:e}),n(r)}))}),(e=>{if(e)return n(e);n(null,i.sort(((e,t)=>e.index-t.index)).map((e=>e.value)))}))}function Ne(e,t,r,n){return(R(t)?je:Ee)(e,t,S(r),n)}var Oe=I((function(e,t,r){return Ne(q,e,t,r)}),3),Se=I((function(e,t,r,n){return Ne(M(t),e,r,n)}),4),Ie=I((function(e,t,r){return Ne(Z,e,t,r)}),3),ke=I((function(e,t){var r=L(t),n=S(we(e));return function e(t){if(t)return r(t);!1!==t&&n(e)}()}),2),Ae=I((function(e,t,r,n){var i=S(r);return oe(e,t,((e,t)=>{i(e,((r,n)=>r?t(r):t(r,{key:n,val:e})))}),((e,t)=>{for(var r={},{hasOwnProperty:i}=Object.prototype,o=0;o<t.length;o++)if(t[o]){var{key:s}=t[o],{val:a}=t[o];i.call(r,s)?r[s].push(a):r[s]=[a]}return n(e,r)}))}),4),Re=fe("log"),Ce=I((function(e,t,r,n){n=D(n);var i={},o=S(r);return M(t)(e,((e,t,r)=>{o(e,t,((e,n)=>{if(e)return r(e);i[t]=n,r(e)}))}),(e=>n(e,i)))}),4),De=_(w?g.nextTick:b?setImmediate:x),Le=I(((e,t,r)=>{var n=R(t)?[]:{};e(t,((e,t,r)=>{S(e)(((e,...i)=>{i.length<2&&([i]=i),n[t]=i,r(e)}))}),(e=>r(e,n)))}),3);function Pe(e,t){var r=S(e);return re(((e,t)=>{r(e[0],t)}),t,1)}class Me{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&Ue(this.heap[e],this.heap[t=Fe(e)]);){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}percDown(e){let t;for(;(t=1+(e<<1))<this.heap.length&&(t+1<this.heap.length&&Ue(this.heap[t+1],this.heap[t])&&(t+=1),!Ue(this.heap[e],this.heap[t]));){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}push(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}unshift(e){return this.heap.push(e)}shift(){let[e]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}toArray(){return[...this]}*[Symbol.iterator](){for(let e=0;e<this.heap.length;e++)yield this.heap[e].data}remove(e){let t=0;for(let r=0;r<this.heap.length;r++)e(this.heap[r])||(this.heap[t]=this.heap[r],t++);this.heap.splice(t);for(let e=Fe(this.heap.length-1);e>=0;e--)this.percDown(e);return this}}function Fe(e){return(e+1>>1)-1}function Ue(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}var Be=I((function(e,t){if(t=D(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var r=0,n=e.length;r<n;r++)S(e[r])(t)}),2);function qe(e,t,r,n){var i=[...e].reverse();return ne(i,t,r,n)}function He(e){var t=S(e);return v((function(e,r){return e.push(((e,...t)=>{let n={};if(e&&(n.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),n.value=i}r(null,n)})),t.apply(this,e)}))}function $e(e,t,r,n){const i=S(r);return Ne(e,t,((e,t)=>{i(e,((e,r)=>{t(e,!r)}))}),n)}var Ze=I((function(e,t,r){return $e(q,e,t,r)}),3),ze=I((function(e,t,r,n){return $e(M(t),e,r,n)}),4),Ve=I((function(e,t,r){return $e(Z,e,t,r)}),3);function Ge(e){return function(){return e}}function Je(e,t,r){var n={times:5,intervalFunc:Ge(0)};if(arguments.length<3&&"function"==typeof e?(r=t||J(),t=e):(Xe(n,e),r=r||J()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=S(t),o=1;function s(){i(((e,...t)=>{!1!==e&&(e&&o++<n.times&&("function"!=typeof n.errorFilter||n.errorFilter(e))?setTimeout(s,n.intervalFunc(o-1)):r(e,...t))}))}return s(),r[G]}function Xe(e,t){if("object"==typeof t)e.times=+t.times||5,e.intervalFunc="function"==typeof t.interval?t.interval:Ge(+t.interval||0),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||5}}var Qe=I((function(e,t,r){return ce(Boolean,(e=>e))(q,e,t,r)}),3),We=I((function(e,t,r,n){return ce(Boolean,(e=>e))(M(t),e,r,n)}),4),Ye=I((function(e,t,r){return ce(Boolean,(e=>e))(Z,e,t,r)}),3),Ke=I((function(e,t,r){var n=S(t);return H(e,((e,t)=>{n(e,((r,n)=>{if(r)return t(r);t(r,{value:e,criteria:n})}))}),((e,t)=>{if(e)return r(e);r(null,t.sort(i).map((e=>e.value)))}));function i(e,t){var r=e.criteria,n=t.criteria;return r<n?-1:r>n?1:0}}),3);function et(e,t,r,n){var i=S(r);return oe(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,n)}var tt=I((function(e,t){var r,n=null;return be(e,((e,t)=>{S(e)(((e,...i)=>{if(!1===e)return t(e);i.length<2?[r]=i:r=i,n=e,t(e?null:{})}))}),(()=>t(n,r)))})),rt=I((function(e,t,r){r=L(r);var n=S(t),i=S(e),o=[];function s(e,...t){if(e)return r(e);o=t,!1!==e&&i(a)}function a(e,t){return e?r(e):!1!==e?t?void n(s):r(null,...o):void 0}return i(a)}),3),nt=I((function(e,t){if(t=D(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(t){S(e[r++])(...t,L(i))}function i(i,...o){if(!1!==i)return i||r===e.length?t(i,...o):void n(o)}n([])}));const it={apply:function(e,...t){return(...r)=>e(...t,...r)},applyEach:$,applyEachSeries:V,asyncify:j,auto:X,autoInject:function(e,t){var r={};return Object.keys(e).forEach((t=>{var n,i=e[t],o=O(i),s=!o&&1===i.length||o&&0===i.length;if(Array.isArray(i))n=[...i],i=n.pop(),r[t]=n.concat(n.length>0?a:i);else if(s)r[t]=i;else{if(n=function(e){const t=function(e){let t="",r=0,n=e.indexOf("*/");for(;r<e.length;)if("/"===e[r]&&"/"===e[r+1]){let t=e.indexOf("\n",r);r=-1===t?e.length:t}else if(-1!==n&&"/"===e[r]&&"*"===e[r+1]){let i=e.indexOf("*/",r);-1!==i?(r=i+2,n=e.indexOf("*/",r)):(t+=e[r],r++)}else t+=e[r],r++;return t}(e.toString());let r=t.match(Q);if(r||(r=t.match(W)),!r)throw new Error("could not parse args in autoInject\nSource:\n"+t);let[,n]=r;return n.replace(/\s/g,"").split(Y).map((e=>e.replace(K,"").trim()))}(i),0===i.length&&!o&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");o||n.pop(),r[t]=n.concat(a)}function a(e,t){var r=n.map((t=>e[t]));r.push(t),S(i)(...r)}})),X(r,t)},cargo:function(e,t){return re(e,1,t)},cargoQueue:function(e,t,r){return re(e,t,r)},compose:function(...e){return ie(...e.reverse())},concat:ae,concatLimit:se,concatSeries:le,constant:function(...e){return function(...t){return t.pop()(null,...e)}},detect:ue,detectLimit:he,detectSeries:de,dir:pe,doUntil:function(e,t,r){const n=S(t);return ge(e,((...e)=>{const t=e.pop();n(...e,((e,r)=>t(e,!r)))}),r)},doWhilst:ge,each:ve,eachLimit:me,eachOf:q,eachOfLimit:F,eachOfSeries:Z,eachSeries:be,ensureAsync:we,every:xe,everyLimit:_e,everySeries:Te,filter:Oe,filterLimit:Se,filterSeries:Ie,forever:ke,groupBy:function(e,t,r){return Ae(e,1/0,t,r)},groupByLimit:Ae,groupBySeries:function(e,t,r){return Ae(e,1,t,r)},log:Re,map:H,mapLimit:oe,mapSeries:z,mapValues:function(e,t,r){return Ce(e,1/0,t,r)},mapValuesLimit:Ce,mapValuesSeries:function(e,t,r){return Ce(e,1,t,r)},memoize:function(e,t=(e=>e)){var r=Object.create(null),n=Object.create(null),i=S(e),o=v(((e,o)=>{var s=t(...e);s in r?T((()=>o(null,...r[s]))):s in n?n[s].push(o):(n[s]=[o],i(...e,((e,...t)=>{e||(r[s]=t);var i=n[s];delete n[s];for(var o=0,a=i.length;o<a;o++)i[o](e,...t)})))}));return o.memo=r,o.unmemoized=e,o},nextTick:De,parallel:function(e,t){return Le(q,e,t)},parallelLimit:function(e,t,r){return Le(M(t),e,r)},priorityQueue:function(e,t){var r=Pe(e,t),{push:n,pushAsync:i}=r;function o(e,t){return Array.isArray(e)?e.map((e=>({data:e,priority:t}))):{data:e,priority:t}}return r._tasks=new Me,r._createTaskItem=({data:e,priority:t},r)=>({data:e,priority:t,callback:r}),r.push=function(e,t=0,r){return n(o(e,t),r)},r.pushAsync=function(e,t=0,r){return i(o(e,t),r)},delete r.unshift,delete r.unshiftAsync,r},queue:Pe,race:Be,reduce:ne,reduceRight:qe,reflect:He,reflectAll:function(e){var t;return Array.isArray(e)?t=e.map(He):(t={},Object.keys(e).forEach((r=>{t[r]=He.call(this,e[r])}))),t},reject:Ze,rejectLimit:ze,rejectSeries:Ve,retry:Je,retryable:function(e,t){t||(t=e,e=null);let r=e&&e.arity||t.length;O(t)&&(r+=1);var n=S(t);return v(((t,i)=>{function o(e){n(...t,e)}return(t.length<r-1||null==i)&&(t.push(i),i=J()),e?Je(e,o,i):Je(o,i),i[G]}))},seq:ie,series:function(e,t){return Le(Z,e,t)},setImmediate:T,some:Qe,someLimit:We,someSeries:Ye,sortBy:Ke,timeout:function(e,t,r){var n=S(e);return v(((i,o)=>{var s,a=!1;i.push(((...e)=>{a||(o(...e),clearTimeout(s))})),s=setTimeout((function(){var t=e.name||"anonymous",n=new Error('Callback function "'+t+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),a=!0,o(n)}),t),n(...i)}))},times:function(e,t,r){return et(e,1/0,t,r)},timesLimit:et,timesSeries:function(e,t,r){return et(e,1,t,r)},transform:function(e,t,r,n){arguments.length<=3&&"function"==typeof t&&(n=r,r=t,t=Array.isArray(e)?[]:{}),n=D(n||J());var i=S(r);return q(e,((e,r,n)=>{i(t,e,r,n)}),(e=>n(e,t))),n[G]},tryEach:tt,unmemoize:function(e){return(...t)=>(e.unmemoized||e)(...t)},until:function(e,t,r){const n=S(e);return rt((e=>n(((t,r)=>e(t,!r)))),t,r)},waterfall:nt,whilst:rt,all:xe,allLimit:_e,allSeries:Te,any:Qe,anyLimit:We,anySeries:Ye,find:ue,findLimit:he,findSeries:de,flatMap:ae,flatMapLimit:se,flatMapSeries:le,forEach:ve,forEachSeries:be,forEachLimit:me,forEachOf:q,forEachOfSeries:Z,forEachOfLimit:F,inject:ne,foldl:ne,foldr:qe,select:Oe,selectLimit:Se,selectSeries:Ie,wrapSync:j,during:rt,doDuring:ge};var ot=n(730),st=n.n(ot);const at="http://www.w3.org/1999/02/22-rdf-syntax-ns#",lt="http://www.w3.org/2001/XMLSchema#",ct="http://www.w3.org/2000/10/swap/",ut={xsd:{decimal:`${lt}decimal`,boolean:`${lt}boolean`,double:`${lt}double`,integer:`${lt}integer`,string:`${lt}string`},rdf:{type:`${at}type`,nil:`${at}nil`,first:`${at}first`,rest:`${at}rest`,langString:`${at}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${ct}reify#forSome`,forAll:`${ct}reify#forAll`},log:{implies:`${ct}log#implies`}};var ht=n(5929),dt=n.n(ht),ft=n(2486).lW;const{xsd:pt}=ut,gt=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,yt={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},vt=/[\x00-\x20<>\\"\{\}\|\^\`]/,mt={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},bt=/$0^/;class wt{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in mt)&&this[e]instanceof RegExp&&(this[e]=bt)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,s;for(;e=this._newline.exec(r);)this._comments&&(s=this._comment.exec(e[0]))&&i("comment",s[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(s=this._comment.exec(r))&&i("comment",s[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const a=this._line,l=r[0];let c="",u="",h="",d=null,f=0,p=!1;switch(l){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(f=1,c="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){p=!0;break}case"<":if(d=this._unescapedIri.exec(r))c="IRI",u=d[1];else if(d=this._iri.exec(r)){if(u=this._unescape(d[1]),null===u||vt.test(u))return o(this);c="IRI"}else r.length>1&&"<"===r[1]?(c="<<",f=2):this._n3Mode&&r.length>1&&"="===r[1]&&(c="inverse",f=2,u=">");break;case">":r.length>1&&">"===r[1]&&(c=">>",f=2);break;case"_":((d=this._blank.exec(r))||t&&(d=this._blank.exec(`${r} `)))&&(c="blank",h="_",u=d[1]);break;case'"':if(d=this._simpleQuotedString.exec(r))u=d[1];else if(({value:u,matchLength:f}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===f||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(d=this._simpleApostropheString.exec(r))u=d[1];else if(({value:u,matchLength:f}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===f||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(d=this._variable.exec(r))&&(c="var",u=d[0]);break;case"@":"literal"===this._previousMarker&&(d=this._langcode.exec(r))?(c="langcode",u=d[1]):(d=this._keyword.exec(r))&&(c=d[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){c=".",f=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(d=this._number.exec(r)||t&&(d=this._number.exec(`${r} `)))&&(c="literal",u=d[0],h="string"==typeof d[1]?pt.double:"string"==typeof d[2]?pt.decimal:pt.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(d=this._sparqlKeyword.exec(r))?c=d[0].toUpperCase():p=!0;break;case"f":case"t":(d=this._boolean.exec(r))?(c="literal",u=d[0],h=pt.boolean):p=!0;break;case"a":(d=this._shortPredicates.exec(r))?(c="abbreviation",u="a"):p=!0;break;case"=":this._n3Mode&&r.length>1&&(c="abbreviation",">"!==r[1]?(f=1,u="="):(f=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(f=1,c=l);break;default:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(d=this._prefix.exec(r))?((d=this._prefixed.exec(r))||t&&(d=this._prefixed.exec(`${r} `)))&&(c="prefixed",h=d[1]||"",u=this._unescape(d[2])):(c="prefix",u=d[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const g=f||d[0].length,y=i(c,u,h,a,g);this.previousToken=y,this._previousMarker=c,r=r.substr(g,r.length)}function i(t,i,o,s,a){const l=r?n-r.length:n,c={type:t,value:i,prefix:o,line:s,start:l,end:l+a};return e(null,c),c}function o(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(gt,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in yt?yt[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,o=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}dt()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=ft.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:xt,xsd:_t}=ut;let Tt,jt=0;const Et={namedNode:function(e){return new Ot(e)},blankNode:function(e){return new It(e||"n3-"+jt++)},variable:function(e){return new kt(e)},literal:function(e,t){if("string"==typeof t)return new St(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";return""===r&&("boolean"==typeof e?r=_t.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?_t.integer:_t.double:(r=_t.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===r||r===_t.string?new St(`"${e}"`):new St(`"${e}"^^${r}`)},defaultGraph:function(){return Tt},quad:Rt,triple:Rt};class Nt{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Nt?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Ot extends Nt{get termType(){return"NamedNode"}}class St extends Nt{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new Ot(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?_t.string:xt.langString}equals(e){return e instanceof St?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class It extends Nt{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class kt extends Nt{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}Tt=new class extends Nt{constructor(){return super(""),Tt||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class At extends Nt{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||Tt}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function Rt(e,t,r,n){return new At(e,t,r,n)}let Ct=0;class Dt{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Pt(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),s=this._n3Mode=/n3/.test(t),a=i||o;(this._supportsNamedGraphs=!(r||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),a&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new wt({lineMode:a,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Ct=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,r,n,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(n+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,s=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===s.predicate?s.subject=r:s.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==n){const e=this._predicate,t=this._object;i?this._emit(t,e,n,r):this._emit(n,e,t,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=Lt}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,i=-1,o=0,s="/";for(;n<t;){switch(s){case":":if(i<0&&"/"===e[++n]&&"/"===e[++n])for(;(i=n+1)<t&&"/"!==e[i];)n=i;break;case"?":case"#":n=t;break;case"/":if("."===e[n+1])switch(s=e[1+ ++n],s){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(s=e[1+ ++n],void 0===s||"/"===s||"?"===s||"#"===s){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==s)return`${r}/${e.substr(n+1)}`;o=n+1}}}s=e[++n]}return r+e.substring(o)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Ct++}_`,this._prefixCallback=r||Lt,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=Lt):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function Lt(){}function Pt(e,t){const r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(ut.rdf.first),e.RDF_REST=r(ut.rdf.rest),e.RDF_NIL=r(ut.rdf.nil),e.N3_FORALL=r(ut.r.forAll),e.N3_FORSOME=r(ut.r.forSome),e.ABBREVIATIONS={a:r(ut.rdf.type),"=":r(ut.owl.sameAs),">":r(ut.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}Pt(Dt.prototype,Et);const Mt=Et.defaultGraph(),{rdf:Ft,xsd:Ut}=ut,Bt=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,qt=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Ht={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class $t extends Nt{equals(){return!1}}class Zt{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,r,n){e+=t,n&&n()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Mt,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${Vt(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return Mt.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,i){try{n.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(Mt.equals(n)?"":`${this._encodeIriOrBlank(n)} {\n`)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,r,n,i){delete this._prefixMatch,this._write(this.quadToString(e,t,r,n),i)}quadToString(e,t,r,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${n&&n.value?` ${this._encodeIriOrBlank(n)} .\n`:" .\n"}`}quadsToString(e){return e.map((e=>this.quadToString(e.subject,e.predicate,e.object,e.graph))).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),Bt.test(t)&&(t=t.replace(qt,zt));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(Bt.test(t)&&(t=t.replace(qt,zt)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Ut.string)return`"${t}"`}else switch(e.datatype.value){case Ut.string:return`"${t}"`;case Ut.boolean:if("true"===t||"false"===t)return t;break;case Ut.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Ut.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Ut.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===Ft.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:r,graph:n}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${function(e){return!!e&&"DefaultGraph"===e.termType}(n)?"":` ${this._encodeIriOrBlank(n)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,n,i){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof n?this._writeQuad(e,t,r,Mt,n):this._writeQuad(e,t,r,n||Mt,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,r){const n={};n[e]=t,this.addPrefixes(n,r)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let r=!1;for(let t in e){let n=e[t];"string"!=typeof n&&(n=n.value),r=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[n]=t+=":",this._write(`@prefix ${t} <${n}>.\n`)}if(r){let e="",t="";for(const r in this._prefixIRIs)e+=e?`|${r}`:r,t+=(t?"|":"")+this._prefixIRIs[r];e=Vt(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(r?"\n":"",t)}blank(e,t){let r,n,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),n=i.length){case 0:return new $t("[]");case 1:if(r=i[0],!(r.object instanceof $t))return new $t(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t="[";for(let o=0;o<n;o++)r=i[o],r.predicate.equals(e)?t+=`, ${this._encodeObject(r.object)}`:(t+=`${(o?";\n ":"\n ")+this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)}`,e=r.predicate);return new $t(`${t}\n]`)}}list(e){const t=e&&e.length||0,r=new Array(t);for(let n=0;n<t;n++)r[n]=this._encodeObject(e[n]);return new $t(`(${r.join(" ")})`)}end(e){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let t=e&&((r,n)=>{t=null,e(r,n)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function zt(e){let t=Ht[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function Vt(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function Gt(e,t){var r,n=new Dt,i=new Zt({format:"N-Quads"});it.waterfall([function(t){n.parse(e,(function(e,r,n){e?t(e):null!==r?i.addQuad(r):i.end(t)}))},function(e,t){try{st().fromRDF(e,{format:"application/nquads"}).then((e=>{t(null,e)}))}catch(e){t(e)}},function(e,n){r=JSON.stringify(e),t(null,r)}],(function(e,n){t(e,r)}))}function Jt(e,t){var r,n=new Dt,i=new Zt({format:"N-Quads"});it.waterfall([function(t){n.parse(e,(function(e,r,n){e?t(e):null!==quad?i.addQuad(quad):i.end(t)}))},function(e,n){t(null,r=e)}],(function(e,n){t(e,r)}))}class Xt extends o.Z{constructor(){super(""),(0,t.Z)(this,"termType",s.ls)}toString(){return"()"}}const Qt="chrome:theSession";new c.Z(Qt);class Wt extends o.Z{constructor(){super(""),(0,t.Z)(this,"value",""),(0,t.Z)(this,"termType",s.NK),(0,t.Z)(this,"uri",Qt)}toCanonical(){return this.value}toString(){return"DefaultGraph"}}function Yt(e){return!!e&&e.termType===s.NK}var Kt=n(292);const er=new Wt;class tr{constructor(e,r,n,i){(0,t.Z)(this,"subject",void 0),(0,t.Z)(this,"predicate",void 0),(0,t.Z)(this,"object",void 0),(0,t.Z)(this,"graph",void 0),this.subject=o.Z.fromValue(e),this.predicate=o.Z.fromValue(r),this.object=o.Z.fromValue(n),this.graph=null==i?er:o.Z.fromValue(i)}get why(){return this.graph}set why(e){this.graph=e}equals(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}substitute(e){const t=new tr(this.subject.substitute(e),this.predicate.substitute(e),this.object.substitute(e),Yt(this.graph)?this.graph:this.graph.substitute(e));return Kt.log("@@@ statement substitute:"+t),t}toCanonical(){let e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==s.NK&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}toNT(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}toNQ(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),Yt(this.graph)?"":this.graph.toNT()].join(" ")+" ."}toString(){return this.toNT()}}var rr=n(3357);class nr extends o.Z{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(e),(0,t.Z)(this,"termType",s.UH),(0,t.Z)(this,"base","varid:"),(0,t.Z)(this,"classOrder",r.Z.Variable),(0,t.Z)(this,"isVar",1),(0,t.Z)(this,"uri",void 0),this.base="varid:",this.uri=rr.join(e,this.base)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toString()}substitute(e){var t;return null!=(t=e[this.toNT()])?t:this}toString(){return nr.toString(this)}static toString(e){return e.uri.slice(0,e.base.length)===e.base?`?${e.uri.slice(e.base.length)}`:`?${e.uri}`}}let ir;!function(e){e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE"}(ir||(ir={}));const or=new Wt,sr={supports:{[ir.collections]:!1,[ir.defaultGraphType]:!1,[ir.equalsMethod]:!0,[ir.identity]:!1,[ir.id]:!0,[ir.reversibleId]:!1,[ir.variableType]:!0},blankNode:e=>new l(e),defaultGraph:()=>or,equals(e,t){return e===t||!e||!t||((0,u.PY)(e)||(0,u.PY)(t)?!(!(0,u.PY)(e)||!(0,u.PY)(t))&&this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph):!(!(0,u.jt)(e)||!(0,u.jt)(t))&&this.id(e)===this.id(t))},id(e){if(!e)return"undefined";if((0,u.PY)(e))return this.quadToNQ(e);switch(e.termType){case s.NK:return"defaultGraph";case s.UH:return nr.toString(e);default:const t=this.termToNQ(e);if(t)return t;throw new Error(`Can't id term with type '${e.termType}'`)}},isQuad:e=>e instanceof tr,literal(e,t){if("string"!=typeof e&&!t)return d.fromValue(e);const r="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new d(r,t):new d(r,null,this.namedNode(t)):new d(r,null,t)},namedNode:e=>new c.Z(e),quad:(e,t,r,n)=>new tr(e,t,r,n||or),triple(e,t,r,n){return this.quad(e,t,r,n)},quadToNQ(e){return`${this.termToNQ(e.subject)} ${this.termToNQ(e.predicate)} ${this.termToNQ(e.object)} ${this.termToNQ(e.graph)} .`},termToNQ(e){switch(e.termType){case s.V1:return"_:"+e.value;case s.NK:return"";case s.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case s.xH:return d.toNT(e);case s._A:case s.XM:return"<"+e.value+">";case s.fb:return"("+e.elements.map((e=>this.termToNQ(e))).join(" ")+")";default:throw new Error(`Can't serialize nonstandard term type (was '${e.termType}')`)}},toNQ(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:e=>new nr(e)},ar=sr;var lr=n(7308);function cr(e,t){const r=t||{namedNode:e=>new c.Z(e)};return function(t){return r.namedNode(e+(t||""))}}var ur=n(5115);function hr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ar;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}hr(ar);var dr=n(9523),fr=n.n(dr),pr=n(292);function gr(e){return new yr(e)}class yr{constructor(e){(0,t.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,t.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,t.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,t.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,t.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];const r=Object.keys(fr()());for(const e in r){const t=fr()()[r[e]](""),n=r[e];this.prefixes[t]=n,this.namespaces[n]=t}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=e,this.rdfFactory=e.rdfFactory||ar,this.xsd=hr(this.rdfFactory)}setBase(e){return this.base=e,this}setFlags(e){return this.flags=e||"",this}toStr(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}fromStr(e){if("{"===e[0]){var t=this.formulas[e];return t||pr.log("No formula object for "+e),t}return this.store.fromNT(e)}setNamespaces(e){for(var t in e)this.setPrefix(t,e[t]);return this}setPrefix(e,t){if("default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t){for(let t in this.prefixes)this.prefixes[t]==e&&delete this.prefixes[t];this.prefixes[t]=e,this.namespaces[e]=t}}suggestPrefix(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}suggestNamespaces(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}checkIntegrity(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}makeUpPrefix(e){var t=e,r=function(t){return!!this.validPrefix.test(t)&&"ns"!==t&&!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var n=t.lastIndexOf("/");n>=0&&(t=t.slice(n+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&r(t))return t;if(r(t.slice(0,3)))return t.slice(0,3);if(r(t.slice(0,2)))return t.slice(0,2);if(r(t.slice(0,4)))return t.slice(0,4);if(r(t.slice(0,1)))return t.slice(0,1);if(r(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var o=0;;o++)if(r(t.slice(0,3)+o))return t.slice(0,3)+o}rootSubjects(e){for(var t={},r={},n={},i=0;i<e.length;i++){var o=e[i],s=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(o.subject)};[o.subject,o.predicate,o.object].map((function(e){"BlankNode"===e.termType?n[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){s(e)}))})),s(e[i].object);var a=r[this.toStr(o.subject)];a||(a=[]),a.push(o),r[this.toStr(o.subject)]=a}var l=[];for(var c in r)if(r.hasOwnProperty(c)){var u=this.fromStr(c);"BlankNode"===u.termType&&t[u]&&1===t[u].length||l.push(u)}this.incoming=t;for(var h={},d=0;d<l.length;d++)h[l[d].toNT()]=!0;return{roots:l,subjects:r,rootsHash:h,incoming:t}}toN3(e){return this.statementsToN3(e.statements)}explicitURI(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?rr.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,r="",n=0;n<e.length;n++)r+=(t=e.charCodeAt(n))>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[n];return r}(e):encodeURI(e))+">"}statementsToNTriples(e){var t=e.slice();t.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,s=this.rdfFactory,a=function(e){if("Collection"!==e.termType)return i.atomicTermToN3(e);for(var t=e.elements,l=o.sym(n+"nill"),c=t.length-1;c>=0;c--){var u=s.blankNode();r+=a(u)+" "+a(o.sym(n+"first"))+" "+a(t[c])+".\n",r+=a(u)+" "+a(o.sym(n+"rest"))+" "+a(l)+".\n",l=u}return i.atomicTermToN3(l)},l=0;l<t.length;l++){var c=t[l],u="";u+=a(c.subject)+" ",u+=a(c.predicate)+" ",u+=a(c.object)+" ",this.flags.indexOf("q")>=0&&(u+=a(c.why)+" "),r+=u+=".\n"}return r}statementsToN3(e){var t=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};e.sort((function(e,n){return ur.heavyCompareSPO(e,n,t,r)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var n={};this.flags.indexOf("s")<0&&(n["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(n["http://www.w3.org/2000/10/swap/log#implies"]="=>");var i=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},o=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r],i="string"==typeof n?n:o(n);if(0!==r){var s=t.slice(-1)||" ";","===i||";"===i||("."!==i||"0123456789.:".includes(s))&&(t+=" ")}t+=i}return t},s=function(e,t){var r="",n=1e5;void 0===t&&(t=-1);for(var a=0;a<e.length;a++){var l=e[a];if("string"!=typeof l){var c=s(l,t+1);if(c.length<10*(80-4*t)&&c.indexOf('"""')<0){var u=o(l);u.length<80-4*t&&(l=u,c="")}c&&(n=1e4),r+=c}if("string"==typeof l){if(1===l.length&&"\n"===r.slice(-1)&&",.;".indexOf(l)>=0){r=r.slice(0,-1),"."==l&&"0123456789.:".includes(r.charAt(r.length-1))&&(r+=" ",n+=1),r+=l+"\n",n+=1;continue}if(n<4*t+4||n+l.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+l+"\n",n+=l.length+1;else{let e=i(4*t)+l;r+=e+"\n",n=e.length,t<0&&(r+="\n",n=1e5)}}}return r},a=function(e){for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(l(o,t))}return n}.bind(this);function l(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[h(e,t)].concat([c(e,t)]).concat(["."]):u(e,t,!0).concat(["."])}var c=function(e,t){var r=[],i=null,o=t.subjects[this.toStr(e)]||[];if(void 0===o)throw new Error("Cant find statements for "+e);for(var s=[],a=0;a<o.length;a++){var l=o[a];l.predicate.uri===i?s.push(","):(i&&(r=r.concat([s]).concat([";"]),s=[]),r.push(n[l.predicate.uri]?n[l.predicate.uri]:h(l.predicate,t))),i=l.predicate.uri,s.push(u(l.object,t))}return r.concat([s])}.bind(this),u=function(e,t,r){return"BlankNode"!==e.termType||!r&&void 0!==t.rootsHash[e.toNT()]?h(e,t):t.subjects[this.toStr(e)]?["[",c(e,t),"]"]:"[]"}.bind(this);yr.prototype.termToN3=h;var h=function(e,t){var r,n;switch(e.termType){case"Graph":return(n=(n=["{"]).concat(a(e.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<e.elements.length;r++)n.push([u(e.elements[r],t)]);return n.push(")"),n;default:return this.atomicTermToN3(e)}}.bind(this),d=function(){var e="";for(var t in this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),f=a(e);return d()+s(f)}atomicTermToN3(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var r=e.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return r;case"http://www.w3.org/2001/XMLSchema#decimal":return r.indexOf(".")<0&&(r+=".0"),r;case"http://www.w3.org/2001/XMLSchema#double":{const e=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!e&&(r+=".0"),e||(r+="e0"),r}case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var n=this.stringToN3(e.value);return e.language?n+="@"+e.language:e.datatype.equals(this.xsd.string)||(n+="^^"+this.atomicTermToN3(e.datatype,t)),n;case"NamedNode":return this.symbolToN3(e);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}stringToN3(e,t){t||(t="e");var r,n,i,o,s,a="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(o='"""',s=this.forbidden3):(o='"',s=this.forbidden1),r=0;r<e.length&&(s.lastIndex=0,null!=s.exec(e.slice(r)));){n=r+s.lastIndex-1,a+=e.slice(r,n);var l=e[n];'"'===l&&'"""'===o&&'"""'!==e.slice(n,n+3)?a+=l:(i='\b\f\r\t\v\n\\"'.indexOf(l))>=0?a+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?a+="\\u"+("000"+l.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=l,r=n+1}return o+a+e.slice(r)+o}symbolToN3(e){var t=e.uri,r=t.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=t.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var n=!0,i=r+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){n=!1;break}if(n){var o=t.slice(r+1),s=t.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var a=this.prefixes[s];if(a||(a=this.makeUpPrefix(s)),a)return this.namespacesUsed[s]=!0,a+":"+o}}return this.explicitURI(t)}writeStore(e){var t=this.store,r=t.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var s=t.fromNT(o);n&&s.equals(n)||e("\n"+this.atomicTermToN3(s)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,s))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){e("\n<"+r.object.value+"> log:metadata {\n");var n=t.statementsMatching(void 0,void 0,void 0,r.subject);e(this.statementsToN3(this.statementsToN3(n))),e("}.\n")}));var a=[];n&&a.push(n);var l=[];a.map((function(e){l=l.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(l))}statementsToXML(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},i=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r];t+="string"==typeof n?n:i(n)}return t},o=function(e,t){var r,s="",a=1e5;t||(t=0);for(var l=0;l<e.length;l++){var c=e[l];if("string"!=typeof c){var u=o(c,t+1);u.length<10*(80-4*t)&&u.indexOf('"""')<0&&(r=i(c)).length<80-4*t&&(c=" "+r,u=""),u&&(a=1e4),s+=u}"string"==typeof c&&(a<4*t+4?(s=s.slice(0,-1)+" "+c+"\n",a+=c.length+1):(s+=(r=n(4*t)+c)+"\n",a=r.length))}return s},s=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function a(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&";case"<":return"<";case'"':return"""}}))}var l=function(e){return a(this.base?rr.refTo(this.base,e.uri):e.uri)}.bind(this),c=function(e,t){var n,i,o,s,f=[],p=t.subjects[this.toStr(e)];if(void 0===p)return h(e,t);p.sort((function(e,t){var n=e.predicate.uri,i=t.predicate.uri;if(n.substring(0,r.length)===r||i.substring(0,r.length)===r)return n.localeCompare(i);var o=n.substring(r.length),s=i.substring(r.length),a=parseInt(o,10),l=parseInt(s,10);return isNaN(a)||isNaN(l)||a!==o||l!==s?n.localeCompare(i):a-l}));for(var g=0;g<p.length;g++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=p[g]).predicate.uri||n||"NamedNode"!==o.object.termType){if((s=o.predicate).uri.substr(0,r.length)===r){var y=s.uri.substr(r.length);y===parseInt(y,10).toString()&&(s=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=d(s),o.object.termType){case"BlankNode":f=1===t.incoming[o.object].length?f.concat(["<"+i+' rdf:parseType="Resource">',c(o.object,t),"</"+i+">"]):f.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":f=f.concat(["<"+i+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":f=f.concat(["<"+i+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+i+">"]);break;case"Collection":f=f.concat(["<"+i+' rdf:parseType="Collection">',u(o.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var v=n?d(n):"rdf:Description",m="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(m=' rdf:nodeID="'+e.toNT().slice(2)+'"'):m=' rdf:about="'+l(e)+'"',["<"+v+m+">"].concat([f]).concat(["</"+v+">"])}.bind(this);function u(e,t){for(var r=[],n=0;n<e.elements.length;n++)r.push(c(e.elements[n],t));return r}var h=function(e,t){var r=[],n=t.subjects[this.toStr(e)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"BlankNode":r=t.rootsHash[o.object.toNT()]?r.concat(["<"+d(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+d(o.predicate)+">"]):r.concat(["<"+d(o.predicate)+' rdf:parseType="Resource">',h(o.object,t),"</"+d(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+d(o.predicate)+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+d(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+d(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+d(o.predicate)+' rdf:parseType="Collection">',u(o.object,t),"</"+d(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),d=function(e){var r=e.uri,n=r.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=r.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+r+">");for(var i=n+1;i<r.length;i++)if(this._notNameChars.indexOf(r[i])>=0)throw new Error('Invalid character "'+r[i]+'" cannot be in XML qname for URI: '+r);var o=r.slice(n+1),s=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return o;var a=this.prefixes[s];return a||(a=this.makeUpPrefix(s)),t[s]=!0,a+":"+o}.bind(this),f=s(e),p="<rdf:RDF";for(var g in this.defaultNamespace&&(p+=' xmlns="'+a(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(g)){var y=this.base&&this.flags.includes("z")?rr.refTo(this.base,g):g;p+="\n xmlns:"+this.prefixes[g]+'="'+a(y)+'"'}return o([p+=">",f,"</rdf:RDF>"],-1)}}function vr(e,t,r,n,i,o){r=r||(null==e?void 0:e.value);const a=o||{};n=n||s.z8;try{var l=gr(t);a.flags&&l.setFlags(a.flags);var c=t.statementsMatching(void 0,void 0,void 0,e);switch("namespaces"in t&&l.suggestNamespaces(t.namespaces),a.namespaces&&l.setNamespaces(a.namespaces),l.setBase(r),n){case s.Is:return u(null,l.statementsToXML(c));case s.qS:case s.sZ:return u(null,l.statementsToN3(c));case s.z8:case s.Eo:return l.setFlags("si"),u(null,l.statementsToN3(c));case s.aV:return l.setFlags("deinprstux"),u(null,l.statementsToNTriples(c));case s.ui:l.setFlags("deinprstux"),Gt(l.statementsToNTriples(c),i);break;case s.b4:case s.lL:return l.setFlags("deinprstux q"),u(null,l.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(e){if(i)return i(e,void 0);throw e}function u(e,t){return i?void i(e,t):t}}const mr=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],br="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function wr(e,t,r){const n=[];return r.reduce(((t,r,i,o)=>{let s;return n.push(e.quad(t,e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(s=e.blankNode(),n.push(e.quad(t,e.namedNode(br),s))):n.push(e.quad(t,e.namedNode(br),e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),s}),t),n}function xr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;var n=e.length;for(r<0&&(r=n+r);r<n;r++)if(e[r]===t)return r;return-1}var _r=n(292);class Tr extends o.Z{constructor(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};super(""),e=this,this.statements=n,this.constraints=i,this.initBindings=o,this.optional=a,(0,t.Z)(this,"termType",s._A),(0,t.Z)(this,"classOrder",r.Z.Graph),(0,t.Z)(this,"fetcher",void 0),(0,t.Z)(this,"isVar",0),(0,t.Z)(this,"ns",cr),(0,t.Z)(this,"rdfFactory",void 0),this.rdfFactory=l&&l.rdfFactory||ar;for(const t of mr)this[t]=function(){return e.rdfFactory[t](...arguments)}}add(e,t,r,n){return 1===arguments.length&&e.forEach((e=>this.add(e.subject,e.predicate,e.object,e.graph))),this.statements.push(this.rdfFactory.quad(e,t,r,n))}addStatement(e){return this.add(e)}bnode(e){return this.rdfFactory.blankNode(e)}addAll(e){e.forEach((e=>{this.add(e.subject,e.predicate,e.object,e.graph)}))}any(e,t,r,n){const i=this.anyStatementMatching(e,t,r,n);return null==i?null:null==e?i.subject:null==t?i.predicate:null==r?i.object:null}anyValue(e,t,r,n){const i=this.any(e,t,r,n);return i?i.value:void 0}anyJS(e,t,r,n){const i=this.any(e,t,r,n);return i?o.Z.toJS(i):void 0}anyStatementMatching(e,t,r,n){let i=this.statementsMatching(e,t,r,n,!0);if(i&&0!==i.length)return i[0]}id(e){return this.rdfFactory.id(e)}statementsMatching(e,t,r,n,i){const o=this.statements.filter((i=>(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))));return i?0===o.length?[]:[o[0]]:o}bottomTypeURIs(e){let t,r,n,i,o,s,a,l;t=[];for(let c in e)if(e.hasOwnProperty(c)){for(l=e[c],a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(c)),r=!0,i=0,o=a.length;i<o;i++)if(n=a[i],s=n.uri,s in e){r=!1;break}r&&(t[c]=l)}return t}collection(){return new p}each(e,t,r,n){const i=[];let o=this.statementsMatching(e,t,r,n,!1);if(null==e)for(let e=0,t=o.length;e<t;e++)i.push(o[e].subject);else if(null==t)for(let e=0,t=o.length;e<t;e++)i.push(o[e].predicate);else if(null==r)for(let e=0,t=o.length;e<t;e++)i.push(o[e].object);else if(null==n)for(let e=0,t=o.length;e<t;e++)i.push(new c.Z(o[e].graph.value));return i}equals(e){return!!e&&this.hashString()===e.hashString()}findMembersNT(e){let t,r,n,i,o,s,a,l,c,u,h,d,f,p;d={},d[e.toNT()]=!0,i={},s=this.transitiveClosure(d,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0);for(let e in s)if(s.hasOwnProperty(e)){a=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(e));for(let e=0,t=a.length;e<t;e++)f=a[e],i[f.subject.toNT()]=f;l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(e));for(let e=0,r=l.length;e<r;e++)for(o=l[e],c=this.statementsMatching(void 0,o),n=0,t=c.length;n<t;n++)f=c[n],i[f.subject.toNT()]=f;u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(e));for(let e=0,t=u.length;e<t;e++)for(o=u[e],h=this.statementsMatching(void 0,o),p=0,r=h.length;p<r;p++)f=h[p],i[f.object.toNT()]=f}return i}findMemberURIs(e){return this.NTtoURI(this.findMembersNT(e))}findSubClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}findSuperClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypesNT(e){let t,r,n,i,o,s,a,l,c;n="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",c=[],i=this.statementsMatching(e,void 0,void 0);for(let e=0,t=i.length;e<t;e++)if(l=i[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===l.predicate.uri)c[l.object.toNT()]=l;else{o=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"));for(let e=0,t=o.length;e<t;e++)r=o[e],c[r.toNT()]=l}s=this.statementsMatching(void 0,void 0,e);for(let e=0,r=s.length;e<r;e++){l=s[e],a=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"));for(let e=0,r=a.length;e<r;e++)t=a[e],c[t.toNT()]=l}return this.transitiveClosure(c,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypeURIs(e){return this.NTtoURI(this.findTypesNT(e))}connectedStatements(e,t,r){r=r||[];let n=[e],i={},o={},s=[],a=this,l=function(e){let l=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,n.push(e))},c=a.statementsMatching(null,null,e,t).concat(a.statementsMatching(e,null,null,t));c=c.filter((function(e){if(r[e.predicate.value])return!1;let t=e.toNT();return!o[t]&&(o[t]=!0,!0)})),c.forEach((function(e){l(e.subject),l(e.object)})),s=s.concat(c)};for(;n.length;)l(n.shift());return s}formula(e){return new Tr}fromNT(e){let t,r,n;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(n=void 0,t=void 0,r=e.lastIndexOf('"'),r<e.length-1)if("@"===e[r+1])n=e.slice(r+2);else{if("^^"!==e.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(r+3))}return e=(e=(e=(e=e.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,n||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new nr(e.slice(1))}throw new Error("Can't convert from NT: "+e)}holds(e,t,r,n){let i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if((0,u.Yi)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}return null!=this.anyStatementMatching(e,t,r,n)}holdsStatement(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}list(e,t){if(t.rdfFactory.supports.COLLECTIONS){const r=t.rdfFactory.collection();return e.forEach((function(e){r.append(e)})),r}{const r=t.rdfFactory.blankNode(),n=wr(t.rdfFactory,r,e);return t.addAll(n),r}}NTtoURI(e){let t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],"<"===t[0]&&(n[t.slice(1,-1)]=r));return n}serialize(e,t,r,n){return vr(r,this,e,t,void 0,n)}substitute(e){let t=this.statements.map((function(t){return t.substitute(e)}));_r.log("Formula subs statmnts:"+t);const r=new Tr;return r.addAll(t),_r.log("indexed-form subs formula:"+r),r}sym(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}the(e,t,r,n){let i=this.any(e,t,r,n);return null==i&&lr.Z.error("No value found for the() {"+e+" "+t+" "+r+"}."),i}transitiveClosure(e,t,r){let n,i,o,s,a,l,c={};Object.assign(c,e);let u={};for(;;){if(l=function(){for(let e in c)if(c.hasOwnProperty(e))return e}(),null==l)return u;for(a=r?this.each(void 0,t,this.fromNT(l)):this.each(this.fromNT(l),t),i=0,o=a.length;i<o;i++)n=a[i],s=n.toNT(),s in u||s in c||(c[s]=c[l]);u[l]=c[l],delete c[l]}}topTypeURIs(e){let t,r,n,i,o,s,a,l;for(n in a=[],e)if(e.hasOwnProperty(n)){for(l=e[n],o=0,s=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf")),t=0,i=s.length;t<i;t++)if(r=s[t],"http://www.w3.org/2000/01/rdf-schema#Resource"!==r.uri){o++;break}o||(a[n]=l)}return a["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete a["http://www.w3.org/2000/01/rdf-schema#Resource"],a["http://www.w3.org/2002/07/owl#Thing"]&&delete a["http://www.w3.org/2002/07/owl#Thing"],a}toString(){return"{"+this.statements.join("\n")+"}"}variable(e){return new nr(e)}whether(e,t,r,n){return this.statementsMatching(e,t,r,n,!1).length}}o.Z.fromValue=f;const jr=o.Z,Er={xsd:cr("http://www.w3.org/2001/XMLSchema#")};o.Z.toJS=function(e){return(0,u.uZ)(e)?e.elements.map(o.Z.toJS):(0,u.n_)(e)?e.datatype.equals(Er.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(Er.xsd("dateTime"))||e.datatype.equals(Er.xsd("date"))?new Date(e.value):e.datatype.equals(Er.xsd("integer"))||e.datatype.equals(Er.xsd("float"))||e.datatype.equals(Er.xsd("decimal"))?Number(e.value):e.value:e};var Nr=n(292);class Or{constructor(e,t){this.pat=new Cr,this.vars=[],this.name=e,this.id=t}}function Sr(e,t,r,n){function i(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r+=" "+t+" -> "+e[t]);return r}function o(e){var t,r="Bindings: ",n=e.length;for(t=0;t<n;t++)r+=i(e[t][0])+";\n\t";return r}function s(e,t,r,n){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var o=function(e,t,r,n){var i=r[e];if(void 0===i){if(e.isVar){var o=[];return o[e]=t,[[o,null]]}i=e}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[t]&&(t=n.redirections[t]),i.equals(t)||i.uri&&i.uri===Qt?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?s(e,t,r):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],r,n);if(0===o.length)return o;var a,l,c,u,h,d,f,p=[],g=o.length;for(a=0;a<g;a++){for(h in f=[],l=o[a][0])l.hasOwnProperty(h)&&(f[h]=l[h]);for(h in r)r.hasOwnProperty(h)&&(f[h]=r[h]);for(u=(i=s(e.slice(1),t.slice(1),f,n)).length,c=0;c<u;c++){for(h in d=i[c][0],l)l.hasOwnProperty(h)&&(d[h]=l[h]);p.push([d,null])}}return p}function a(e,t){var r,n={};for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function l(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function c(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}l.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;lr.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},l.prototype.doCallBacks=function(e,t){var r;if(e<0)return this.originalCallback(t);for(r=0;r<this.branches[e].results.length;r++)this.doCallBacks(e-1,a(t,this.branches[e].results[r]))},c.prototype.reportMatch=function(e){this.callback(e),this.success=!0},c.prototype.reportDone=function(){this.done=!0,lr.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var u=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function h(e,t,r){var n,i,o,s,a,l;for(t.nvars=0,t.index=null,n=[t.subject,t.predicate,t.object,t.why],s=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],o=0;o<4;o++){let c=n[o];if(c.uri&&c.uri===Qt);else if(c.isVar&&void 0===r[c])t.nvars++;else{if(void 0,c=void 0===(l=r[a=n[o]])?a:l,e.redirections[e.id(c)]&&(c=e.redirections[e.id(c)]),!(i=s[o][e.id(c)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function d(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}u.prototype.reportMatch=function(e){this.results.push(e)},u.prototype.reportDone=function(){lr.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),lr.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var f=function(e,r,n,o,s,a,c){lr.Z.debug("Match begins, Branch count now: "+c.count+" for "+c.pattern_debug);var h,d,p=r.statements;if(0===p.length){if(lr.Z.debug("FOUND MATCH WITH BINDINGS:"+i(n)),0===r.optional.length)c.reportMatch(n);else{lr.Z.debug("OPTIONAL: "+r.optional);var y,v=new l(t,n),m=[];for(y=0;y<r.optional.length;y++)m[y]=new u(v),m[y].pattern_debug=r.optional[y];for(y=0;y<r.optional.length;y++)m[y].count=m[y].count+1,f(e,r.optional[y],n,"",s,t,m[y])}return c.count--,void lr.Z.debug("Match ends -- success , Branch count now: "+c.count+" for "+c.pattern_debug)}var b=p.length;if(s){var w=function(t,i){var l=t.uri.split("#")[0];s.nowOrWhenFetched(l,void 0,(function(i,l,u){i||Nr.log("Error following link to <"+t.uri+"> in query: "+l),f(e,r,n,o,s,a,c)}))};for(d=0;d<b;d++){if(h=p[d],void 0!==n[h.subject]&&n[h.subject].uri&&s&&"unrequested"===s.getState((0,rr.docpart)(n[h.subject].uri)))return void w(n[h.subject]);if(void 0!==n[h.object]&&n[h.object].uri&&s&&"unrequested"===s.getState((0,rr.docpart)(n[h.object].uri)))return void w(n[h.object])}}g(e,r,n,o,s,a,c)},p=function(e,t){var r,n,i=!0;for(r in e)e.hasOwnProperty(r)&&t[r]&&(n=t[r].test)&&!n(e[r])&&(i=!1);return i},g=function(e,t,r,n,a,l,c){var u,g,y,v,m,b,w,x=t.statements,_=x.length;for(u=0;u<_;u++)h(e,w=x[u],r);x.sort(d),w=x[0];var T,j=e.formula();j.optional=t.optional,j.constraints=t.constraints,j.statements=x.slice(1),lr.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var E,N,O=w.index.length,S=0;for(T=0;T<O;T++)for(N=w.index[T],E=s([w.subject,w.predicate,w.object,w.why],[N.subject,N.predicate,N.object,N.why],r,e),lr.Z.info(n+" From first: "+E.length+": "+o(E)),y=E.length,g=0;g<y;g++)if(m=[],b=E[g][0],p(b,t.constraints)){for(v in b)b.hasOwnProperty(v)&&(m[v]=b[v]);for(v in r)r.hasOwnProperty(v)&&(m[v]=r[v]);c.count++,S++,f(e,j,m,n+" ",a,l,c)}else lr.Z.debug("Branch count CS: "+c.count);c.count--,0===S&&lr.Z.debug("Match2 fails completely on "+w),lr.Z.debug("Match2 ends, Branch count: "+c.count+" for "+c.pattern_debug),0===c.count&&(lr.Z.debug("Branch finished."),c.reportDone())},y=this;lr.Z.debug("Query on "+this.statements.length);var v=new c(t,n);v.count++,e.sync?f(y,e.pat,e.pat.initBindings,"",r,t,v):setTimeout((function(){f(y,e.pat,e.pat.initBindings,"",r,t,v)}),0)}const Ir="http://www.w3.org/2002/07/owl#";function kr(e,t,r,n){var i=e.any(t,r,void 0);return!!i&&(e.equate(i,n),!0)}function Ar(e,t,r,n){var i=e.any(void 0,r,n);return!!i&&(e.equate(i,t),!0)}function Rr(e,t,r,n,i){e.typeCallback&&e.typeCallback(e,n,i);var o=e.classActions[e.id(n)],s=!1;if(o)for(var a=0;a<o.length;a++)s=s||o[a](e,t,r,n,i);return s}class Cr extends Tr{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(void 0,void 0,void 0,void 0,r),(0,t.Z)(this,"updater",void 0),(0,t.Z)(this,"namespaces",void 0),(0,t.Z)(this,"classActions",void 0),(0,t.Z)(this,"propertyActions",void 0),(0,t.Z)(this,"redirections",void 0),(0,t.Z)(this,"aliases",void 0),(0,t.Z)(this,"HTTPRedirects",void 0),(0,t.Z)(this,"subjectIndex",void 0),(0,t.Z)(this,"predicateIndex",void 0),(0,t.Z)(this,"objectIndex",void 0),(0,t.Z)(this,"whyIndex",void 0),(0,t.Z)(this,"index",void 0),(0,t.Z)(this,"features",void 0),(0,t.Z)(this,"_universalVariables",void 0),(0,t.Z)(this,"_existentialVariables",void 0),(0,t.Z)(this,"rdfArrayRemove",void 0),(0,t.Z)(this,"dataCallbacks",void 0),this.propertyActions={},this.classActions={},this.redirections=[],this.aliases=[],this.HTTPRedirects=[],this.subjectIndex=[],this.predicateIndex=[],this.objectIndex=[],this.whyIndex=[],this.index=[this.subjectIndex,this.predicateIndex,this.objectIndex,this.whyIndex],this.namespaces={},this.features=e||[],this.rdfArrayRemove=r.rdfArrayRemove||ur.RDFArrayRemove,r.dataCallback&&(this.dataCallbacks=[r.dataCallback]),this.initPropertyActions(this.features)}static get defaultGraphURI(){return Qt}substitute(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new Cr;return r.add(t),r}addDataCallback(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}applyPatch(e,t,r){var n,i=this,o=null;function s(s){if(e.delete){n=e.delete,o&&(n=n.substitute(o)),n=n.statements;var a=[],l=n.map((function(e){var r=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===r.length?(a.push(e),null):r[0]}));if(a.length)return r("Could not find to delete: "+a.join("\n or "));l.map((function(e){i.remove(e)}))}e.insert&&(n=e.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),s()}if(e.where){var a=new Or("patch");a.pat=e.where,a.pat.statements.map((function(e){e.graph=Qn(t.value)})),a.sync=!0;var l=[];i.query(a,(function(e){l.push(e)}),i.fetcher,(function(){return 0===l.length?r("No match found to be patched:"+e.where):l.length>1?r("Patch ambiguous. No patch done."):(o=l[0],void s(r))}))}else s(r)}declareExistential(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}initPropertyActions(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[Rr],xr(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${Ir}sameAs`))]=[function(e,t,r,n,i){return e.equate(t,n),!0}]),xr(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${Ir}InverseFunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,Ar)}]),xr(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${Ir}FunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,kr)}])}addStatement(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}add(e,t,r,n){var i,o,s;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else(0,u.PY)(e)?this.add(e.subject,e.predicate,e.object,e.graph):(0,u.Pv)(e)&&this.add(e.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=jr.fromValue(t);const a=jr.fromValue(r);if(n=jr.fromValue(n),!(0,u.f)(e))throw new Error("Subject is not a subject type");if(!(0,u.nq)(t))throw new Error(`Predicate ${t} is not a predicate type`);if(!(0,u.Uc)(a))throw new Error(`Object ${a} is not an object type`);if(!(0,u.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,n);var l=this.id(this.canon(t)),c=!1;if(o=this.propertyActions[l])for(i=0;i<o.length;i++)c=c||o[i](this,e,t,a,n);if(this.holds(e,t,a,n))return null;var h=[this.id(this.canon(e)),l,this.id(this.canon(a)),this.id(this.canon(n))];for(s=this.rdfFactory.quad(e,t,a,n),i=0;i<4;i++){var d=this.index[i],f=h[i];d[f]||(d[f]=[]),d[f].push(s)}if(this.statements.push(s),this.dataCallbacks)for(const e of this.dataCallbacks)e(s);return s}canon(e){if(!e)return e;const t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case s.V1:return new l(e.value);case s.fb:return e;case s.NK:return new Wt;case s.ls:case s._A:return e;case s.xH:return new d(e.value,e.language,e.datatype);case s.XM:return new c.Z(e.value);case s.UH:return new nr(e.value);default:throw new Error(`Term Type not recognized for canonization: ${e.termType}`)}}check(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var r in t)t.hasOwnProperty(r)&&this.checkStatementList(t[r],e)}}checkStatementList(e,t){void 0===t&&(t=0);for(var r,n=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var o=[(r=e[i]).subject,r.predicate,r.object,r.graph],s=function(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.graph))return!0},a=0;a<4;a++){var l=this.canon(o[a]),c=this.id(l);this.index[a][c]&&s(this.index[a][c],r)}if(!s(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}close(){return this}compareTerms(e,t){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(t):r.Z[e.termType]<r.Z[t.termType]?-1:r.Z[e.termType]>r.Z[t.termType]?1:e.value<t.value?-1:e.value>t.value?1:0}copyTo(e,t,r){r||(r=[]);var n=this.statementsMatching(e);-1!==xr(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,o.predicate,o.object.copy(this))}-1!==xr(r,"delete")&&this.remove(o)}}equate(e,t){const r=this.canon(e),n=this.canon(t);var i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}formula(e){return new Cr(e)}get length(){return this.statements.length}match(e,t,r,n){return this.statementsMatching(jr.fromValue(e),jr.fromValue(t),jr.fromValue(r),jr.fromValue(n))}mentionsURI(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}newExistential(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}newPropertyAction(e,t){var r=this.id(e);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(t);for(var n=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<n.length;o++)i=i||t(this,n[o].subject,e,n[o].object);return i}newUniversal(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}variable(e){return new nr(e)}nextSymbol(e){for(var t=0;;t++){var r=e.value+"#n"+t;if(!this.mentionsURI(r))return this.sym(r)}}query(e,t,r,n){return Sr.call(this,e,t,r,n)}querySync(e){var t=[],r=!1;if(e.sync=!0,Sr.call(this,e,(function(e){t.push(e)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return t}remove(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if((0,u.Pv)(e))return this.remove(e.statements);var r=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(r[0]),this}removeDocument(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),r=0;r<t.length;r++)this.removeStatement(t[r]);return this}removeMany(e,t,r,n,i){for(var o=this.statementsMatching(e,t,r,n,!1),s=[],a=0;a<o.length;a++)s.push(o[a]);for(i&&(s=s.slice(0,i)),a=0;a<s.length;a++)this.remove(s[a])}removeMatches(e,t,r,n){return this.removeMany(e,t,r,n),this}removeStatement(e){for(var t=[e.subject,e.predicate,e.object,e.graph],r=0;r<4;r++){var n=this.canon(t[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],e)}return this.rdfArrayRemove(this.statements,e),this}removeStatements(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}replaceWith(e,t){for(var r=this.id(e),n=this.id(t),i=function(e){var t=e[r];if(t){var i=e[n];e[n]=i?t.concat(i):t,delete e[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=t,e.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(e),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=t,this.aliases[n].push(this.aliases[r][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}allAliases(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}sameThings(e,t){if(e.equals(t))return!0;var r=this.canon(e);if(!r)return!1;var n=this.canon(t);return!!n&&r.value===n.value}setPrefixForURI(e,t){if(("tab"!==e||!this.namespaces.tab)&&"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)){for(let e in this.namespaces)this.namespaces[e]==t&&delete this.namespaces[e];this.namespaces[e]=t}}statementsMatching(e,t,r,n,i){var o,s,a=[e,t,r,n],l=[],c=[],u=[],h=[];for(o=0;o<4;o++)l[o]=this.canon(jr.fromValue(a[o])),l[o]?(h.push(o),c[o]=this.id(l[o])):u.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(s=this.index[o][c[o]])&&i&&s.length>1&&(s=s.slice(0,1)),s||[];var d,f,p=1e10;for(f=0;f<h.length;f++){if(o=h[f],!(s=this.index[o][c[o]]))return[];s.length<p&&(p=s.length,d=f)}for(var g=h[d],y=this.index[g][c[g]],v=h.slice(0,d).concat(h.slice(d+1)),m=[],b=["subject","predicate","object","why"],w=0;w<y.length;w++){var x=y[w];for(f=0;f<v.length;f++)if(o=v[f],!this.canon(x[b[o]]).equals(l[o])){x=null;break}if(null!=x&&(m.push(x),i))break}return m}uris(e){var t=this.canon(e),r=this.aliases[this.id(t)];if(!t.value)return[];var n=[t.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}serialize(e,t,r,n){var i;return vr(r,this,e,t,void 0,n={...n||{},namespaces:null!==(i=n)&&void 0!==i&&i.namespaces?{...this.namespaces,...n.namespaces}:{...this.namespaces}})}}(0,t.Z)(Cr,"handleRDFType",void 0),Cr.handleRDFType=Rr;const Dr=cr("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function Lr(e,t){function r(n,i,o){const s=e.statementsMatching(n,Dr("rest"),null,t);if(1!==s.length)throw new Error(`Bad list structure: no rest at ${n}`);const a=e.statementsMatching(n,Dr("first"),null,t);if(1!==a.length)throw new Error(`Bad list structure: rest but ${a.length} firsts at ${n}`);const l=[a[0].object].concat(i),c=o.concat(s).concat(a),u=e.statementsMatching(null,Dr("rest"),n,t);if(0===u.length){const r=new p(l);return e.remove(c),void function(e,t,r,n){for(const i of e.statementsMatching(r,null,null,n)){const r=new tr(t,i.predicate,i.object,n);e.remove(i),e.add(r)}for(const i of e.statementsMatching(null,r,null,n))e.remove(i),e.add(new tr(i.subject,t,i.object,n));for(const i of e.statementsMatching(null,null,r,n))e.remove(i),e.add(new tr(i.subject,i.predicate,t,n))}(e,r,n,t)}if(1!==u.length)throw new Error(`Bad list structure: ${u.length} pres at ${n}`);const h=u[0].subject;if("BlankNode"!==h.termType)throw new Error(`Bad list element node ${h} type: ${h.termType} `);r(h,l,c)}!function(e,t){const r=Dr("nil");for(const n of e.statementsMatching(r,null,null,t)){e.remove(n);const r=new p;e.add(new tr(r,n.predicate,n.object,t))}for(const n of e.statementsMatching(null,null,r,t))if(!n.predicate.sameTerm(Dr("rest"))){e.remove(n);const r=new p;e.add(new tr(n.subject,n.predicate,r,t))}}(e,t),e.statementsMatching(null,Dr("rest"),Dr("nil"),t).forEach((e=>{if("BlankNode"!==e.subject.termType)throw new Error(`Bad list element node ${e.subject} type: ${e.subject.termType} `);r(e.subject,[],[])}))}var Pr="http://www.w3.org/2000/10/swap/log#",Mr=function(e){return e},Fr=function(e){return e},Ur=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},Br=function(e){return e.length},qr=function(e,t,r){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+typeof e;return void 0===r||null==r?e.slice(t):e.slice(t,r)},Hr=Error("dummy error stop iteration"),$r=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw Hr;return this.li[this.last++]},this},Zr=function(e,t){return e.indexOf(t)},zr=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var Vr=function(e,t){return rr.join(t,e)},Gr="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",Jr="http://www.w3.org/2002/07/owl#sameAs",Xr="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",Qr=Xr+":",Wr=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),Yr=new RegExp("^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\.[0-9]*)?)?)?Z?"),Kr=new RegExp('[\\\\\\r\\n\\"]',"g"),en=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const tn=function(e,t,r,n,i,o,s,a){return new rn(e,t,r,n,i,o,s,a)};class rn{constructor(e,t,r,n,i,o,s,a){void 0===t&&(t=null),void 0===r&&(r=""),void 0===n&&(n=null),void 0===i&&(i=""),void 0===o&&(o=null),void 0===s&&(s=""),void 0===a&&(a=null),this._bindings=new Ur([]),this._flags=s,""!=r&&(zr(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=e,i&&e.setGenPrefix(i),this._thisDoc=r,this.source=e.sym(r),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=i,this.keywords=new Fr(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new Ur([]),this._variables=new Ur([]),this._parentVariables=new Ur([]),this._reason=a,this._reason2=null,this._baseURI=n||r||null,zr(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==t?this._thisDoc?this._formula=e.formula(r+"#_formula"):this._formula=e.formula():this._formula=t,this._context=this._formula,this._parentContext=null}here(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}formula(){return this._formula}loadStream(e){return this.loadBuf(e.read())}loadBuf(e){return this.startDoc(),this.feed(e),this.endDoc()}feed(e){for(var t=e.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(t,r);if(n<0)return;if((r=this.directiveOrStatement(t,n))<0)throw nn(this._thisDoc,this.lines,t,n,"expected directive or statement")}}directiveOrStatement(e,t){var r,n=this.skipSpace(e,t);return n<0?n:(r=this.directive(e,n))>=0||(r=this.statement(e,n))>=0?this.checkDot(e,r):r}tok(e,t,r){if("@"==t.slice(r,r+1))r+=1;else if(xr(this.keywords,e)<0)return-1;var n=r+Br(e);return t.slice(r,n)==e&&Xr.indexOf(t.charAt(n))>=0?n:-1}directive(e,t){if((o=this.skipSpace(e,t))<0)return o;var r=new Fr([]);if((o=this.tok("bind",e,t))>0)throw nn(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!1))<0)throw nn(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(qr(r,null,null)),t}if((o=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!0))<0)throw nn(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var n=new $r(r);try{for(;;){var i=n.next();(xr(this._variables,i)<0||xr(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=Hr)throw e}return t}if((o=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,o,r,this.uri_ref2))<0)throw nn(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");n=new $r(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(e){if(e!=Hr)throw e}return t}if((o=this.tok("prefix",e,t))>=0){var o,s=new Fr([]);if((t=this.qname(e,o,s))<0)throw nn(this._thisDoc,this.lines,e,o,"expected qname after @prefix");if((o=this.uri_ref2(e,t,s))<0)throw nn(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var a=s[1].uri;return this._baseURI?a=Vr(this._baseURI,a):zr(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),zr(a.indexOf(":")>=0),this._bindings[s[0][0]]=a,this.bind(s[0][0],function(e){return encodeURI(e)}(a)),o}if((o=this.tok("base",e,t))>=0){if(s=new Fr([]),(t=this.uri_ref2(e,o,s))<0)throw nn(this._thisDoc,this.lines,e,o,"expected <uri> after @base ");if(a=s[0].uri,!this._baseURI)throw nn(this._thisDoc,this.lines,e,o,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=Vr(this._baseURI,a),zr(a.indexOf(":")>=0),this._baseURI=a,t}return-1}bind(e,t){""==e||this._store.setPrefixForURI(e,t)}setKeywords(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}startDoc(){}endDoc(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&Lr(this._store,this.source),this._formula}makeStatement(e){e[0].add(e[2],e[1],e[3],this.source),(e[2].uri&&e[2].uri===Gr||e[3].uri&&e[3].uri===Gr)&&(this.hasNil=!0),this.statementCount+=1}statement(e,t){var r=new Fr([]);if((t=this.object(e,t,r))<0)return t;var n=this.property_list(e,t,r[0]);if(n<0)throw nn(this._thisDoc,this.lines,e,t,"expected propertylist");return n}subject(e,t,r){return this.item(e,t,r)}verb(e,t,r){if((i=this.skipSpace(e,t))<0)return i;var n=new Fr([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,n))<0)throw nn(this._thisDoc,this.lines,e,i,"expected property after 'has'");return r.push(new Mr(["->",n[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,n))<0)throw nn(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw nn(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;if(t=i,(i=this.tok("of",e,t))<0)throw nn(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return r.push(new Mr(["<-",n[0]])),i}if((i=this.tok("a",e,t))>=0)return r.push(new Mr(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return r.push(new Mr(["<-",this._store.sym(Pr+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(r.push(new Mr(["->",this._store.sym(Pr+"implies")])),t+2):(r.push(new Mr(["->",this._store.sym(Jr)])),t+1);if(":="==e.slice(t,t+2))return r.push(new Mr(["->",Pr+"becomes"])),t+2;if((i=this.prop(e,t,n))>=0)return r.push(new Mr(["->",n[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw nn(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}prop(e,t,r){return this.item(e,t,r)}item(e,t,r){return this.path(e,t,r)}blankNode(e){return this._context.bnode(e,this._reason2)}path(e,t,r){if((o=this.nodeOrLiteral(e,t,r))<0)return o;for(;"!^.".indexOf(e.slice(o,o+1))>=0;){var n=e.slice(o,o+1);if("."==n){var i=e.slice(o+1,o+2);if(!i||Qr.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,s=r.pop(),a=this.blankNode(this.here(o));if((o=this.node(e,o+1,r))<0)throw nn(this._thisDoc,this.lines,e,o,"EOF found in middle of path syntax");var l=r.pop();"^"==n?this.makeStatement(new Mr([this._context,l,a,s])):this.makeStatement(new Mr([this._context,l,s,a])),r.push(a)}return o}anonymousNode(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}node(e,t,r,n){void 0===n&&(n=null);var i=n;if((u=this.skipSpace(e,t))<0)return u;t=u;var o=e.slice(t,t+1);if("["==o){var s=this.here(t);if((u=this.skipSpace(e,t+1))<0)throw nn(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(u,u+1)){t=u+1;var a=new Fr([]);if(!((u=this.objectList(e,t,a))>=0))throw nn(this._thisDoc,this.lines,e,t,"objectList expected after [= ");if(i=a[0],Br(a)>1){var l=new $r(a);try{for(;;){var c=l.next();this.makeStatement(new Mr([this._context,this._store.sym(Jr),i,c]))}}catch(e){if(e!=Hr)throw e}}if((u=this.skipSpace(e,u))<0)throw nn(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(u,u+1))var u=u+1}if(null==i&&(i=this.blankNode(s)),(t=this.property_list(e,u,i))<0)throw nn(this._thisDoc,this.lines,e,u,"property_list expected");if((u=this.skipSpace(e,t))<0)throw nn(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(u,u+1))throw nn(this._thisDoc,this.lines,e,u,"']' expected");return r.push(i),u+1}if("{"==o){if("$"==e.slice(t+1,t+2)){u=(t+=1)+1;for(var h=new Fr([]),d=!0;;){if((t=this.skipSpace(e,u))<0)throw nn(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){u=t+2;break}if(d)d=!1;else{if(","!=e.slice(t,t+1))throw nn(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var f=new Fr([]);if((u=this.item(e,t,f))<0)throw nn(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");h.push(f[0])}return r.push(this._store.newSet(h,this._context)),u}u=t+1;var p=this._parentContext;this._parentContext=this._context;var g=this._anonymousNodes,y=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new Ur([]),this._variables=this._variables.slice();var v=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((t=this.skipSpace(e,u))<0)throw nn(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){u=t+1;break}if((u=this.directiveOrStatement(e,t))<0)throw nn(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=g,this._variables=this._parentVariables,this._parentVariables=y,this._context=this._parentContext,this._reason2=v,this._parentContext=p,r.push(i.close()),u}if("("==o){var m=this._store.list;for("$"==e.slice(t+1,t+2)&&(m=this._store.newSet,t+=1),u=t+1,h=new Fr([]);;){if((t=this.skipSpace(e,u))<0)throw nn(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){u=t+1;break}if(f=new Fr([]),(u=this.item(e,t,f))<0)throw nn(this._thisDoc,this.lines,e,t,"expected item in list or ')'");h.push(f[0])}return r.push(m(h,this._context)),u}if((u=this.tok("this",e,t))>=0)throw nn(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(u=this.tok("true",e,t))>=0?(r.push(!0),u):(u=this.tok("false",e,t))>=0?(r.push(!1),u):null==i&&(u=this.uri_ref2(e,t,r))>=0?u:-1}property_list(e,t,r){for(;;){if((u=this.skipSpace(e,t))<0)throw nn(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(u,u+2)){t=u;var n=new Fr([]);if((u=this.verb(e,t,n))<=0)return t;var i=new Fr([]);if((t=this.objectList(e,u,i))<0)throw nn(this._thisDoc,this.lines,e,u,"objectList expected");var o=new $r(i);try{for(;;){var s=o.next(),a=n[0],l=a[0],c=a[1];"->"==l?this.makeStatement(new Mr([this._context,c,r,s])):this.makeStatement(new Mr([this._context,c,s,r]))}}catch(e){if(e!=Hr)throw e}if((u=this.skipSpace(e,t))<0)throw nn(this._thisDoc,this.lines,e,u,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t+=1}else{t=u+2;var u,h=new Fr([]);if((u=this.node(e,t,h,r))<0)throw nn(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");t=u}}}commaSeparatedList(e,t,r,n){if((i=this.skipSpace(e,t))<0)throw nn(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(n)var i=this.uri_ref2(e,i,r);else i=this.bareWord(e,i,r);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=n?this.uri_ref2(e,t+1,r):this.bareWord(e,t+1,r))<0)throw nn(this._thisDoc,this.lines,e,i,"bad list content")}}objectList(e,t,r){if((t=this.object(e,t,r))<0)return-1;for(;;){var n=this.skipSpace(e,t);if(n<0)throw nn(this._thisDoc,this.lines,e,n,"EOF found after object");if(","!=e.slice(n,n+1))return n;if((t=this.object(e,n+1,r))<0)return t}}checkDot(e,t){var r=this.skipSpace(e,t);if(r<0)return r;if("."==e.slice(r,r+1))return r+1;if("}"==e.slice(r,r+1))return r;if("]"==e.slice(r,r+1))return r;throw nn(this._thisDoc,this.lines,e,r,"expected '.' or '}' or ']' at end of statement")}uri_ref2(e,t,r){var n=new Fr([]);if((d=this.qname(e,t,n))>=0){var i=n[0],o=i[0],s=i[1];if(null==o){zr(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(s)),d;throw nn(this._thisDoc,this.lines,e,t,"Prefix "+o+" not bound.")}var l=this._store.sym(a+s);return xr(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),d}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var c=new Fr([]);return(d=this.variable(e,t,c))>0?(r.push(c[0]),d):-1}if("<"==e.charAt(t)){for(var u=t+=1;t<Br(e);){if(">"==e.charAt(t)){var h=e.slice(u,t);return this._baseURI?h=Vr(this._baseURI,h):zr(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=qr(h,-1,null)&&(h+="#"),l=this._store.sym(h),xr(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),t+1}t+=1}throw nn(this._thisDoc,this.lines,e,d,"unterminated URI reference")}if(this.keywordsSet){var d;if(c=new Fr([]),(d=this.bareWord(e,t,c))<0)return-1;if(xr(this.keywords,c[0])>=0)throw nn(this._thisDoc,this.lines,e,t,'Keyword "'+c[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+c[0])),d}return-1}skipSpace(e,t){for(var r=t||0;r<e.length;r++){var n=e.charAt(r);if(" \n\r\t\f\v \u2028\u2029 ".indexOf(n)<0){if("#"!==e.charAt(r))return r;for(;;r++){if(r===e.length)return-1;if("\n"===e.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(r)&&(this.lines=this.lines+1)}return-1}variable(e,t,r){if((n=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(n,n+1))return-1;var n;if(t=n+=1,"0123456789-".indexOf(e.charAt(n))>=0)throw nn(this._thisDoc,this.lines,e,n,"Varible name can't start with '"+e.charAt(n)+"s'");for(;t<Br(e)&&Qr.indexOf(e.charAt(t))<0;)t+=1;if(null==this._parentContext)throw nn(this._thisDoc,this.lines,e,n,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(n-1,t));return r.push(this._store.variable(e.slice(n,t))),t}bareWord(e,t,r){var n=this.skipSpace(e,t);if(n<0)return-1;var i=e.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(Qr.indexOf(i)>=0)return-1;for(t=n;t<Br(e)&&Qr.indexOf(e.charAt(t))<0;)t+=1;return r.push(e.slice(n,t)),t}qname(e,t,r){if((t=this.skipSpace(e,t))<0)return-1;var n=e.charAt(t);if("0123456789-+".indexOf(n)>=0)return-1;if(Qr.indexOf(n)<0){var i=n;for(t+=1;t<Br(e)&&(n=e.charAt(t),Qr.indexOf(n)<0);)i+=n,t+=1}else i="";if(t<Br(e)&&":"==e.charAt(t)){var o=i;for(t+=1,i="";t<Br(e)&&(n=e.charAt(t),Qr.indexOf(n)<0);)i+=n,t+=1;return r.push(new Mr([o,i])),t}return i&&this.keywordsSet&&xr(this.keywords,i)<0?(r.push(new Mr(["",i])),t):-1}object(e,t,r){if((o=this.subject(e,t,r))>=0)return o;{if((o=this.skipSpace(e,t))<0)return-1;t=o;var n=null;let a=e.charAt(t);if('"'==a||"'"==a){n=e.slice(t,t+3==a+a)?a+a+a:a,t+=Br(n);var i=this.strconst(e,t,n),o=i[0],s=i[1];return r.push(this._store.literal(s)),o}return-1}}nodeOrLiteral(e,t,r){if((l=this.node(e,t,r))>=0)return l;if((l=this.skipSpace(e,t))<0)return-1;t=l;var n=e.charAt(t);if("-+0987654321".indexOf(n)>=0){if(Yr.lastIndex=0,null!=(h=Yr.exec(e.slice(t))))l=t+(i=h[0]).length,i.indexOf("T")>=0?r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(Wr.lastIndex=0,null==(h=Wr.exec(e.slice(t))))throw nn(this._thisDoc,this.lines,e,t,"Bad number or date syntax");l=t+Wr.lastIndex,(i=e.slice(t,l)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,l).indexOf(".")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return l}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var o='"""';else o='"';t+=Br(o);var s=null,a=this.strconst(e,t,o),l=a[0],c=a[1],u=null;if("@"==e.slice(l,l+1)){var h;if(en.lastIndex=0,null==(h=en.exec(e.slice(l+1))))throw nn(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=en.lastIndex+l+1,u=e.slice(l+1,t),l=t}if("^^"==e.slice(l,l+2)){var d=new Fr([]);l=this.uri_ref2(e,l+2,d),s=d[0]}return r.push(this._store.literal(c,u||s)),l}return-1}strconst(e,t,r){for(var n=t,i="",o=this.lines;n<Br(e);){if(t=n+Br(r),e.slice(n,t)==r)return new Mr([t,i]);if('"'!=e.charAt(n)){if(Kr.lastIndex=0,!Kr.exec(e.slice(n)))throw nn(this._thisDoc,o,e,n,"Closing quote missing in string at ^ in "+e.slice(n-20,n)+"^"+e.slice(n,n+20));if(t=n+Kr.lastIndex-1,i+=e.slice(n,t),'"'!=(l=e.charAt(t)))if("\r"!=l){if("\n"==l){if('"'==r)throw nn(this._thisDoc,o,e,t,"newline found in string literal");this.lines=this.lines+1,i+=l,n=t+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==l){if(n=t+1,!(l=e.slice(n,n+1)))throw nn(this._thisDoc,o,e,t,"unterminated string literal (2)");var s=Zr('abfrtvn\\"',l);if(s>=0)i+='a\b\f\r\t\v\n\\"'.charAt(s),n+=1;else if("u"==l)n=(a=this.uEscape(e,n+1,o))[0],i+=l=a[1];else{if("U"!=l)throw nn(this._thisDoc,this.lines,e,t,"bad escape");var a,l;n=(a=this.UEscape(e,n+1,o))[0],i+=l=a[1]}}}else n=t+1;else n=t}else i=i+'"',n=n+1}throw nn(this._thisDoc,this.lines,e,t,"unterminated string literal")}uEscape(e,t,r){for(var n=t,i=0,o=0;i<4;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw nn(this._thisDoc,r,e,t,"unterminated string literal(3)");var a=Zr("0123456789abcdef",s);if(a<0)throw nn(this._thisDoc,r,e,t,"bad string literal hex escape");o=16*o+a,i+=1}var l=String.fromCharCode(o);return new Mr([n,l])}UEscape(e,t,r){for(var n=t,i=0,o="\\U";i<8;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw nn(this._thisDoc,r,e,t,"unterminated string literal(3)");if(Zr("0123456789abcdef",s)<0)throw nn(this._thisDoc,r,e,t,"bad string literal hex escape");o+=s,i+=1}var a,l=(a="0x"+qr(o,2,10)-0,String.fromCharCode(a));return new Mr([n,l])}}function nn(e,t,r,n,i){let o=t+1,s="Line "+o+" of <"+e+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',a=new SyntaxError(s,e,o);return a.lineNo=o,a.characterInFile=n,a.syntaxProblem=i,a}const on={...ar,supports:{[ir.collections]:!0,[ir.defaultGraphType]:!1,[ir.equalsMethod]:!0,[ir.identity]:!1,[ir.id]:!0,[ir.reversibleId]:!1,[ir.variableType]:!0},collection:e=>new p(e),id(e){return(0,u.uZ)(e)?`( ${e.elements.map((e=>this.id(e))).join(", ")} )`:(0,u.cG)(e)?nr.toString(e):ar.id(e)},termToNQ:e=>e.termType===s.fb?p.toNT(e):ar.termToNQ(e)},sn=on;function an(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((t=>an(e,t))))}(e,t["@list"]):function(e,t){const r=t["@id"]?e.rdfFactory.namedNode(t["@id"]):e.rdfFactory.blankNode(),n=t["@list"].map((t=>an(e,t))),i=wr(e.rdfFactory,r,n);return e.addAll(i),r}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?e.rdfFactory.namedNode(t["@id"]):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function ln(e,t,r,n){const i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return st().flatten(JSON.parse(e),null,{base:i}).then((e=>e.reduce(((e,n)=>t=cn(t,r,n)),t))).then(n).catch(n)}function cn(e,t,r){const n=r["@id"]?e.rdfFactory.namedNode(r["@id"]):e.rdfFactory.blankNode();for(const i of Object.keys(r)){if("@id"===i)continue;if("@graph"==i){const t=n,o=r[i];for(let r=0;r<o.length;r++)e=cn(e,t,o[r])}const o=r[i];if(Array.isArray(o))for(let r=0;r<o.length;r++)e.addStatement(un(e,n,i,o[r],t));else e.addStatement(un(e,n,i,o,t))}return e}function un(e,t,r,n,i){let o,s;return"@type"===r?(o=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s=e.rdfFactory.namedNode(n)):(o=e.rdfFactory.namedNode(r),s=an(e,n)),e.rdfFactory.quad(t,o,s,e.rdfFactory.namedNode(i))}var hn=n(292);if(void 0===dn)var dn={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};class fn{constructor(e,t){this.options=t||{},this.kb=e,this.target=t.target||{graph:{subjects:{},prefixes:{},terms:{}}},this.blankNodes=[],this.htmlOptions={selfClosing:"br img input area base basefont col colgroup source wbr isindex link meta param hr"},this.theOne="_:"+(new Date).getTime(),this.language=null,this.vocabulary=null,this.blankCounter=0,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}],this.inXHTMLMode=!1,this.absURIRE=/[\w\_\-]+:\S+/,this.finishedHandlers=[],this.init()}addTriple(e,t,r,n){var i,o,s,a;i=void 0===t?ar.namedNode(this.options.base):this.toRDFNodeObject(t),s=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),a=ar.namedNode(this.options.base),this.kb.add(i,s,o,a)}ancestorPath(e){for(var t="";e&&e.nodeType!==dn.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}copyMappings(e){var t={};for(var r in e)t[r]=e[r];return t}copyProperties(){}deriveDateTimeType(e){for(var t=0;t<fn.dateTimeTypes.length;t++){var r=fn.dateTimeTypes[t].pattern.exec(e);if(r&&r[0].length===e.length)return fn.dateTimeTypes[t].type}return null}init(){}newBlankNode(){return this.blankCounter++,"_:"+this.blankCounter}newSubjectOrigin(e,t){}parseCURIE(e,t,r){var n,i=e.indexOf(":");if(i>=0){var o=e.substring(0,i);if(""===o)return(n=t[""])?n+e.substring(i+1):null;if("_"===o)return"_:"+e.substring(i+1);if(fn.NCNAME.test(o)&&(n=t[o]))return n+e.substring(i+1)}return null}parseCURIEOrURI(e,t,r){return this.parseCURIE(e,t,r)||this.resolveAndNormalize(r,e)}parsePredicate(e,t,r,n,i,o){if(""===e)return null;var s=this.parseTermOrCURIEOrAbsURI(e,t,o?null:r,n,i);return s&&0===s.indexOf("_:")?null:s}parsePrefixMappings(e,t){for(var r=this.tokenize(e),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(t[n]=this.options.base?rr.join(r[i],this.options.base):r[i],n=null)}static parseRDFaDOM(e,t,r){var n=new fn(t,{base:r});e.baseURI||(e.baseURI=r),n.process(e,{baseURI:r})}parseSafeCURIEOrCURIEOrURI(e,t,r){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,r):this.parseCURIEOrURI(e,t,r)}parseTermOrCURIEOrAbsURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;if(r){if(t&&!this.absURIRE.exec(e))return t+e;var s=r[e];if(s)return s;if(s=r[e.toLowerCase()])return s}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}parseTermOrCURIEOrURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;var s=r[e];return s||((s=r[e.toLowerCase()])?s:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}parseURI(e){return e}process(e,t){var r;t=t||{},e.nodeType===dn.DOCUMENT_NODE?(e.baseURI&&!t.baseURI&&(t.baseURI=e.baseURI),r=e.baseURI,(e=e.documentElement).baseURI||(e.baseURI=r),this.setContext(e)):e.parentNode.nodeType===dn.DOCUMENT_NODE&&this.setContext(e);var n=[],i=function(e){if(!e&&t&&t.baseURI)return t.baseURI;var r=e.indexOf("#");return r>=0&&(e=e.substring(0,r)),t&&t.baseURIMap&&(e=t.baseURIMap(e)),e};for(n.push({current:e,context:this.push(null,i(e.baseURI))});n.length>0;){var o=n.shift();if(o.parent){if(o.context.parent&&o.context.parent.listMapping===o.listMapping)continue;for(let e in o.listMapping){var s=o.listMapping[e];if(0!==s.length){var a=[];for(let e=0;e<s.length;e++)a.push(this.newBlankNode());for(let e=0;e<a.length;e++)this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",s[e]),this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:fn.objectURI,value:e+1<a.length?a[e+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(o.parent,o.subject,e,{type:fn.objectURI,value:a[0]})}else this.addTriple(o.parent,o.subject,e,{type:fn.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var l=o.current,c=o.context,u=!1,h=null,d=null,f=null,p=c.prefixes,g=!1,y=[],v=c.listMapping,m=!c.parent,b=c.language,w=c.vocabulary;r=this.parseURI(i(l.baseURI)),l.item=null;var x=l.getAttributeNode("vocab");if(x){let e=this.trim(x.value);if(e.length>0){w=e;var _=r.spec;this.addTriple(l,_,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:fn.objectURI,value:w})}else w=this.vocabulary}for(var T=0;T<l.attributes.length;T++){var j=l.attributes[T];if("x"===j.nodeName.charAt(0)&&0===j.nodeName.indexOf("xmlns:")){g||(p=this.copyMappings(p),g=!0);var E=j.nodeName.substring(6),N=fn.trim(j.value);p[E]=this.options.base?rr.join(N,this.options.base):N}}var O=l.getAttributeNode("prefix");O&&(g||(p=this.copyMappings(p),g=!0),this.parsePrefixMappings(O.value,p));var S=null;for(let e=0;!S&&e<this.langAttributes.length;e++)S=l.getAttributeNodeNS(this.langAttributes[e].namespaceURI,this.langAttributes[e].localName);if(S){let e=fn.trim(S.value);b=e.length>0?e:null}var I,k,A=l.getAttributeNode("rel"),R=l.getAttributeNode("rev"),C=l.getAttributeNode("typeof"),D=l.getAttributeNode("property"),L=l.getAttributeNode("datatype"),P=this.inHTMLMode?l.getAttributeNode("datetime"):null,M=l.getAttributeNode("content"),F=l.getAttributeNode("about"),U=l.getAttributeNode("src"),B=l.getAttributeNode("resource"),q=l.getAttributeNode("href"),H=l.getAttributeNode("inlist"),$=[];if(A){k=this.tokenize(A.value);for(let e=0;e<k.length;e++)I=this.parsePredicate(k[e],w,c.terms,p,r,this.inHTMLMode&&null!==D),I&&$.push(I)}var Z=[];if(R){k=this.tokenize(R.value);for(let e=0;e<k.length;e++)I=this.parsePredicate(k[e],w,c.terms,p,r,this.inHTMLMode&&D),I&&Z.push(I)}if(this.inHTMLMode&&(A||R)&&D&&(0===$.length&&(A=null),0===Z.length&&(R=null)),A||R?(F&&(h=this.parseSafeCURIEOrCURIEOrURI(F.value,p,r)),C&&(f=h),h||(l.parentNode.nodeType===dn.DOCUMENT_NODE?h=i(l.baseURI):c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject)),B&&(d=this.parseSafeCURIEOrCURIEOrURI(B.value,p,r)),d||(q?d=this.resolveAndNormalize(r,encodeURI(q.value)):U?d=this.resolveAndNormalize(r,encodeURI(U.value)):!C||F||this.inXHTMLMode&&("head"===l.localName||"body"===l.localName)||(d=this.newBlankNode())),!C||F||!this.inXHTMLMode||"head"!==l.localName&&"body"!==l.localName?C&&!F&&(f=d):f=h):!D||M||L?(F&&(h=this.parseSafeCURIEOrCURIEOrURI(F.value,p,r)),!h&&B&&(h=this.parseSafeCURIEOrCURIEOrURI(B.value,p,r)),!h&&q&&(h=this.resolveAndNormalize(r,encodeURI(q.value))),!h&&U&&(h=this.resolveAndNormalize(r,encodeURI(U.value))),h||(l.parentNode.nodeType===dn.DOCUMENT_NODE?h=i(l.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName?C?h=this.newBlankNode():c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,D||(u=!0)):h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject),C&&(f=h)):(F&&(h=this.parseSafeCURIEOrCURIEOrURI(F.value,p,r),C&&(f=h)),h||l.parentNode.nodeType!==dn.DOCUMENT_NODE?!h&&c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject):(h=i(l.baseURI),C&&(f=h)),C&&!f&&(B&&(f=this.parseSafeCURIEOrCURIEOrURI(B.value,p,r)),!f&&q&&(f=this.resolveAndNormalize(r,encodeURI(q.value))),!f&&U&&(f=this.resolveAndNormalize(r,encodeURI(U.value))),f||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName||(f=h),f||(f=this.newBlankNode()),d=f)),h&&(F||B||f)){var z=h;C&&!F&&!B&&d&&(z=d),this.newSubjectOrigin(l,z)}if(f){k=this.tokenize(C.value);for(let e=0;e<k.length;e++){var V=this.parseTermOrCURIEOrAbsURI(k[e],w,c.terms,p,r);V&&this.addTriple(l,f,fn.typeURI,{type:fn.objectURI,value:V})}}if(h&&h!==c.parentObject&&(v={},m=!0),d){if(A&&H)for(let e=0;e<$.length;e++){let t=v[$[e]];t||(t=[],v[$[e]]=t),t.push({type:fn.objectURI,value:d})}else if(A)for(let e=0;e<$.length;e++)this.addTriple(l,h,$[e],{type:fn.objectURI,value:d});if(R)for(let e=0;e<Z.length;e++)this.addTriple(l,d,Z[e],{type:fn.objectURI,value:h})}else{if(h&&!d&&(A||R)&&(d=this.newBlankNode()),A&&H)for(let e=0;e<$.length;e++){let t=v[$[e]];t||(t=[],v[I]=t),y.push({predicate:$[e],list:t})}else if(A)for(let e=0;e<$.length;e++)y.push({predicate:$[e],forward:!0});if(R)for(let e=0;e<Z.length;e++)y.push({predicate:Z[e],forward:!1})}if(D){var G=null,J=null;L?(G=""===L.value?fn.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(L.value,w,c.terms,p,r),J=P&&!M?P.value:G===fn.XMLLiteralURI||G===fn.HTMLLiteralURI?null:M?M.value:l.textContent):M?(G=fn.PlainLiteralURI,J=M.value):P?(J=P.value,(G=fn.deriveDateTimeType(J))||(G=fn.PlainLiteralURI)):A||R||(B&&(J=this.parseSafeCURIEOrCURIEOrURI(B.value,p,r)),!J&&q?J=this.resolveAndNormalize(r,encodeURI(q.value)):!J&&U&&(J=this.resolveAndNormalize(r,encodeURI(U.value))),J&&(G=fn.objectURI)),G||(C&&!F?(G=fn.objectURI,J=f):(J=l.textContent,this.inHTMLMode&&"time"===l.localName&&(G=fn.deriveDateTimeType(J)),G||(G=fn.PlainLiteralURI))),k=this.tokenize(D.value);for(let e=0;e<k.length;e++){let t=this.parsePredicate(k[e],w,c.terms,p,r);if(t)if(H){let e=v[t];e||(e=[],v[t]=e),e.push(G===fn.XMLLiteralURI||G===fn.HTMLLiteralURI?{type:G,value:l.childNodes}:{type:G||fn.PlainLiteralURI,value:J,language:b})}else G===fn.XMLLiteralURI||G===fn.HTMLLiteralURI?this.addTriple(l,h,t,{type:G,value:l.childNodes}):this.addTriple(l,h,t,{type:G||fn.PlainLiteralURI,value:J,language:b})}}if(h&&!u)for(let e=0;e<c.incomplete.length;e++)c.incomplete[e].list?c.incomplete[e].list.push({type:fn.objectURI,value:h}):c.incomplete[e].forward?this.addTriple(l,c.subject,c.incomplete[e].predicate,{type:fn.objectURI,value:h}):this.addTriple(l,h,c.incomplete[e].predicate,{type:fn.objectURI,value:c.subject});var X=null,Q=h;u?((X=this.push(c,c.subject)).parentObject=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,X.incomplete=c.incomplete,X.language=b,X.prefixes=p,X.vocabulary=w):((X=this.push(c,h)).parentObject=d||h||c.subject,X.prefixes=p,X.incomplete=y,d&&(Q=d,v={},m=!0),X.listMapping=v,X.language=b,X.vocabulary=w),m&&n.unshift({parent:l,context:c,subject:Q,listMapping:v});for(var W=l.lastChild;W;W=W.previousSibling)W.nodeType===dn.ELEMENT_NODE&&n.unshift({current:W,context:X})}}this.inHTMLMode&&this.copyProperties();for(let t=0;t<this.finishedHandlers.length;t++)this.finishedHandlers[t](e)}push(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}resolveAndNormalize(e,t){return rr.join(t,e)}setContext(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(hn.log("WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode."),this.setHTMLContext()):"-//W3C//DTD XHTML+RDFa 1.1//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"===document.doctype.systemId?this.setXHTMLContext():this.setHTMLContext():this.setHTMLContext():this.setXMLContext()}setHTMLContext(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}setInitialContext(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}setXHTMLContext(){this.setInitialContext(),this.inXHTMLMode=!0,this.inHTMLMode=!1,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.target.graph.terms.alternate="http://www.w3.org/1999/xhtml/vocab#alternate",this.target.graph.terms.appendix="http://www.w3.org/1999/xhtml/vocab#appendix",this.target.graph.terms.bookmark="http://www.w3.org/1999/xhtml/vocab#bookmark",this.target.graph.terms.cite="http://www.w3.org/1999/xhtml/vocab#cite",this.target.graph.terms.chapter="http://www.w3.org/1999/xhtml/vocab#chapter",this.target.graph.terms.contents="http://www.w3.org/1999/xhtml/vocab#contents",this.target.graph.terms.copyright="http://www.w3.org/1999/xhtml/vocab#copyright",this.target.graph.terms.first="http://www.w3.org/1999/xhtml/vocab#first",this.target.graph.terms.glossary="http://www.w3.org/1999/xhtml/vocab#glossary",this.target.graph.terms.help="http://www.w3.org/1999/xhtml/vocab#help",this.target.graph.terms.icon="http://www.w3.org/1999/xhtml/vocab#icon",this.target.graph.terms.index="http://www.w3.org/1999/xhtml/vocab#index",this.target.graph.terms.last="http://www.w3.org/1999/xhtml/vocab#last",this.target.graph.terms.license="http://www.w3.org/1999/xhtml/vocab#license",this.target.graph.terms.meta="http://www.w3.org/1999/xhtml/vocab#meta",this.target.graph.terms.next="http://www.w3.org/1999/xhtml/vocab#next",this.target.graph.terms.prev="http://www.w3.org/1999/xhtml/vocab#prev",this.target.graph.terms.previous="http://www.w3.org/1999/xhtml/vocab#previous",this.target.graph.terms.section="http://www.w3.org/1999/xhtml/vocab#section",this.target.graph.terms.stylesheet="http://www.w3.org/1999/xhtml/vocab#stylesheet",this.target.graph.terms.subsection="http://www.w3.org/1999/xhtml/vocab#subsection",this.target.graph.terms.start="http://www.w3.org/1999/xhtml/vocab#start",this.target.graph.terms.top="http://www.w3.org/1999/xhtml/vocab#top",this.target.graph.terms.up="http://www.w3.org/1999/xhtml/vocab#up",this.target.graph.terms.p3pv1="http://www.w3.org/1999/xhtml/vocab#p3pv1",this.target.graph.terms.related="http://www.w3.org/1999/xhtml/vocab#related",this.target.graph.terms.role="http://www.w3.org/1999/xhtml/vocab#role",this.target.graph.terms.transformation="http://www.w3.org/1999/xhtml/vocab#transformation"}setXMLContext(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}tokenize(e){return this.trim(e).split(/\s+/)}static tokenize(e){return this.trim(e).split(/\s+/)}toRDFNodeObject(e){if(void 0!==e){if("string"==typeof e)return"_:"===e.substring(0,2)?(void 0===this.blankNodes[e.substring(2)]&&(this.blankNodes[e.substring(2)]=new l(e.substring(2))),this.blankNodes[e.substring(2)]):ar.namedNode(e);switch(e.type){case fn.objectURI:return"_:"===e.value.substring(0,2)?(void 0===this.blankNodes[e.value.substring(2)]&&(this.blankNodes[e.value.substring(2)]=new l(e.value.substring(2))),this.blankNodes[e.value.substring(2)]):ar.namedNode(e.value);case fn.PlainLiteralURI:return new d(e.value,e.language||"");case fn.XMLLiteralURI:case fn.HTMLLiteralURI:var t="";return Object.keys(e.value).forEach((r=>{t+=ur.domToString(e.value[r],this.htmlOptions)})),new d(t,"",new c.Z(e.type));default:return new d(e.value,"",new c.Z(e.type))}}}trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}static trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}fn.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",fn.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",fn.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",fn.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",fn.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",fn.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",fn.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",fn.NCNAME=new RegExp("^"+fn.nameStartChar+fn.nameChar+"*$"),fn.dateTimeTypes=[{pattern:/-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,type:"http://www.w3.org/2001/XMLSchema#duration"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#dateTime"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#date"},{pattern:/(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#time"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,type:"http://www.w3.org/2001/XMLSchema#gYearMonth"},{pattern:/-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,type:"http://www.w3.org/2001/XMLSchema#gYear"}];const pn=fn.parseRDFaDOM;class gn{constructor(e){this.store=e,this.bnodes={},this.why=null,this.reify=!1}frameFactory(e,t,r){return{NODE:1,ARC:2,parent:t,parser:e,store:e.store,element:r,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(e,t){t=rr.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var e=this.store.sym(rr.join("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(gn.ns.RDF+"type"),this.store.sym(gn.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(gn.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(gn.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(gn.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e===gn.ns.RDF+"li"&&(e=gn.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.parent.datatype&&this.parent.datatype!==gn.ns.RDF+"langString"?this.node=this.store.literal(e,this.store.sym(this.parent.datatype)):this.node=this.store.literal(e,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}getAttributeNodeNS(e,t,r){var n=null;if(e.getAttributeNodeNS)n=e.getAttributeNodeNS(t,r);else for(var i,o=e.attributes,s=0;s<o.length;++s)if((i=o[s]).namespaceURI===t&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}parse(e,t,r){var n,i=e.childNodes;if(this.cleanParser(),e.nodeType===gn.nodeType.DOCUMENT){for(var o=0;o<i.length;o++)if(i[o].nodeType===gn.nodeType.ELEMENT){n=i[o];break}}else{if(e.nodeType!==gn.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+t+". Halting. ");n=e}this.why=r;var s=this.frameFactory(this);return this.base=t,s.base=t,s.lang=null,this.parseDOM(this.buildFrame(s,n)),!0}parseDOM(e){for(var t,r=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),n=!0;e.parent;){var i=e.element,o=i.attributes;if(i.nodeType===gn.nodeType.TEXT||i.nodeType===gn.nodeType.CDATA_SECTION)e.parent.nodeType===e.NODE&&(e.addArc(gn.ns.RDF+"value"),e=this.buildFrame(e)),e.addLiteral(i.nodeValue);else if(r(i)!==gn.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(r(i)),this.reify&&(t=this.getAttributeNodeNS(i,gn.ns.RDF,"ID"))&&(e.rdfid=t.nodeValue,i.removeAttributeNode(t));var s=this.getAttributeNodeNS(i,gn.ns.RDF,"parseType"),a=this.getAttributeNodeNS(i,gn.ns.RDF,"datatype");if(a&&(e.datatype=a.nodeValue,i.removeAttributeNode(a)),s){var l=s.nodeValue;"Literal"===l?(e.datatype=gn.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(i.childNodes),n=!1):"Resource"===l?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===l&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),i.removeAttributeNode(s)}if(0!==o.length){var c=this.getAttributeNodeNS(i,gn.ns.RDF,"resource"),u=this.getAttributeNodeNS(i,gn.ns.RDF,"nodeID");e=this.buildFrame(e),c?(e.addNode(c.nodeValue),i.removeAttributeNode(c)):u?(e.addBNode(u.nodeValue),i.removeAttributeNode(u)):e.addBNode();for(var h=o.length-1;h>=0;h--){var d=this.buildFrame(e);d.addArc(r(o[h])),r(o[h])===gn.ns.RDF+"type"?this.buildFrame(d).addNode(o[h].nodeValue):this.buildFrame(d).addLiteral(o[h].nodeValue)}}else 0===i.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var f=this.getAttributeNodeNS(i,gn.ns.RDF,"about");if(t=this.getAttributeNodeNS(i,gn.ns.RDF,"ID"),f&&t)throw new Error("RDFParser: "+i.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!f&&t)e.addNode("#"+t.nodeValue),i.removeAttributeNode(t);else if(null==f&&null==t){var p=this.getAttributeNodeNS(i,gn.ns.RDF,"nodeID");p?(e.addBNode(p.nodeValue),i.removeAttributeNode(p)):e.addBNode()}else e.addNode(f.nodeValue),i.removeAttributeNode(f);var g=this.getAttributeNodeNS(i,gn.ns.RDF,"type");gn.ns.RDF+"Description"!==r(i)&&(g={nodeValue:r(i)}),null!=g&&(this.store.add(e.node,this.store.sym(gn.ns.RDF+"type"),this.store.sym(rr.join(g.nodeValue,e.base)),this.why),g.nodeName&&i.removeAttributeNode(g));for(var y=o.length-1;y>=0;y--)this.store.add(e.node,this.store.sym(r(o[y])),this.store.literal(o[y].nodeValue,e.lang),this.why)}for(i=e.element;e.parent;){for(var v=e;null==i;)i=(e=e.parent).element;var m=i.childNodes&&i.childNodes[e.lastChild];if(m&&n){if((m.nodeType===gn.nodeType.ELEMENT||m.nodeType===gn.nodeType.TEXT||m.nodeType===gn.nodeType.CDATA_SECTION)&&(m.nodeType!==gn.nodeType.TEXT&&m.nodeType!==gn.nodeType.CDATA_SECTION||1===i.childNodes.length)){e.lastChild++,e=this.buildFrame(v,i.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;i=e.element,n=!0}}}}cleanParser(){this.bnodes={},this.why=null}buildFrame(e,t){var r=this.frameFactory(this,e,t);if(e&&(r.base=e.base,r.lang=e.lang),!t||t.nodeType===gn.nodeType.TEXT||t.nodeType===gn.nodeType.CDATA_SECTION)return r;var n=t.attributes,i=t.getAttributeNode("xml:base");null!=i&&(r.base=i.nodeValue,t.removeAttribute("xml:base"));var o=t.getAttributeNode("xml:lang");null!=o&&(r.lang=o.nodeValue,t.removeAttribute("xml:lang"));for(var s=n.length-1;s>=0;s--)if("xml"===n[s].nodeName.substr(0,3)){if("xmlns:"===n[s].name.slice(0,6)){var a=n[s].nodeValue;this.base&&(a=rr.join(a,this.base)),this.store.setPrefixForURI(n[s].name.slice(6),a)}t.removeAttributeNode(n[s])}return r}}function yn(e,t,r){var n,i,o,s=["INSERT","DELETE","WHERE"],a=cr("http://www.w3.org/ns/pim/patch#"),l=tn(t,t,r,r,null,null,"",null),c={},u=function(e,t,r,n,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=t.sym(r+"#query");for(c.query=h;;){if((i=l.skipSpace(e,n))<0)return c;if(";"===e[i]){if((n=l.skipSpace(e,i+1))<0)return c;i=n}var d=!1;for(o=0;o<s.length;o++){var f=s[o];if(e.slice(i,i+f.length)===f){if((n=l.skipSpace(e,i+f.length))<0)throw u(l._thisDoc,l.lines,e,i+f.length,"found EOF, needed {...} after "+f);if(("INSERT"===f||"DELETE"===f)&&"DATA"===e.slice(n,n+4)){if((i=l.skipSpace(e,n+4))<0)throw u(l._thisDoc,l.lines,e,n+4,"needed {...} after INSERT DATA "+f);n=i}var p=[];if((i=l.node(e,n,p))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF in {...} after "+f);c[f.toLowerCase()]=p[0],t.add(h,a(f.toLowerCase()),p[0]),d=!0,n=i}}if(!d&&"@prefix"===e.slice(i,i+7)){if((n=l.directive(e,i))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF after @prefix ");n=l.checkDot(e,n),d=!0}if(!d)throw u(l._thisDoc,l.lines,e,i,"Unknown syntax at start of statememt: '"+e.slice(i).slice(0,20)+"'")}}function vn(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=n||s.z8,n=n.split(";")[0];try{if(n===s.qS||n===s.z8){var o=tn(t,t,r,r,null,null,"",null);o.loadBuf(e),c()}else if(n===s.Is){var a=new gn(t);a.parse(ur.parseXML(e),r,t.sym(r)),c()}else if(n===s.D7)pn(ur.parseXML(e,{contentType:s.D7}),t,r),c();else if(n===s.us)pn(ur.parseXML(e,{contentType:s.us}),t,r),c();else if(n===s.oW||n===s.xm)yn(e,t,r),c();else if(n===s.ui)ln(e,t,r,c);else{if(n!==s.b4&&n!==s.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var l=new Dt({factory:sn});h(null,e)}}catch(e){u(e)}function c(){i&&i(null,t)}function u(e){if(n!==s.ui||n!==s.b4||n!==s.lL){if(!i){let t=new Error(e+" while trying to parse <"+r+"> as "+n);throw t.cause=e,t}i(e,t)}}function h(e,r){e&&i(e,t);try{l.parse(r,d)}catch(e){i(e,t)}}function d(e,r){r?t.add(r.subject,r.predicate,r.object,r.graph):i(e,t)}vn.handled={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/sparql-update":!0,"application/sparql-update-single-match":!0,"application/ld+json":!0,"application/nquads":!0,"application/n-quads":!0}}(0,t.Z)(gn,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,t.Z)(gn,"nodeType",{ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12});var mn=n(7297),bn=n.n(mn),wn=n(2598),xn=n(292);const _n={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},Tn={rdf:s.Is,owl:s.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},jn=e=>({link:cr("http://www.w3.org/2007/ont/link#",e),http:cr("http://www.w3.org/2007/ont/http#",e),httph:cr("http://www.w3.org/2007/ont/httph#",e),rdf:cr("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:cr("http://www.w3.org/2000/01/rdf-schema#",e),dc:cr("http://purl.org/dc/elements/1.1/",e),ldp:cr("http://www.w3.org/ns/ldp#",e)}),En=jn();class Nn{constructor(e,r){(0,t.Z)(this,"response",void 0),(0,t.Z)(this,"dom",void 0),this.response=e,this.dom=r}}(0,t.Z)(Nn,"pattern",void 0);class On extends Nn{static toString(){return"RDFXMLHandler"}static register(e){e.mediatypes[s.Is]={q:.9}}parse(e,t,r){let n=e.store;if(this.dom||(this.dom=ur.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");let i=new gn(n);try{i.parse(this.dom,r.original.value,r.original)}catch(t){return e.failFetch(r,"Syntax error parsing RDF/XML! "+t,"parse_error")}return r.noMeta||n.add(r.original,En.rdf("type"),En.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}On.pattern=new RegExp("application/rdf\\+xml");class Sn extends Nn{static toString(){return"XHTMLHandler"}static register(e){e.mediatypes[s.D7]={}}parse(e,t,r){let n,i;this.dom||(this.dom=ur.parseXML(t));let o=e.store,s=this.dom.getElementsByTagName("title");s.length>0&&o.add(r.resource,En.dc("title"),o.rdfFactory.literal(s[0].textContent),r.resource);let a=this.dom.getElementsByTagName("link");for(let t=a.length-1;t>=0;t--)n=a[t].getAttribute("rel"),i=!1,n||(n=a[t].getAttribute("rev"),i=!0),n&&e.linkData(r.original,n,a[t].getAttribute("href"),r.resource,i);let l=this.dom.getElementsByTagName("script");for(let e=0;e<l.length;e++){let t=l[e].getAttribute("type");_n[t]&&(vn(l[e].textContent,o,r.original.value,t),vn(l[e].textContent,o,r.original.value,t))}if(r.noMeta||o.add(r.resource,En.rdf("type"),En.link("WebPage"),e.appNode),!r.noRDFa&&pn)try{pn(this.dom,o,r.original.value)}catch(t){let n="Error trying to parse "+r.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(r,n,"parse_error")}return e.doneFetch(r,this.response)}}Sn.pattern=new RegExp("application/xhtml");class In extends Nn{static toString(){return"XMLHandler"}static register(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}static isElement(e){return e.nodeType===Node.ELEMENT_NODE}parse(e,t,r){let n=ur.parseXML(t);for(let i=0;i<n.childNodes.length;i++){const o=n.childNodes[i];if(In.isElement(o)){let i=o.namespaceURI;if(i&&i===i.rdf)return e.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new On(this.response,n).parse(e,t,r);break}}if(n.doctype&&"html"===n.doctype.name&&n.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&n.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Sn(this.response,n).parse(e,t,r);let i=n.getElementsByTagName("html")[0];if(i){let o=i.getAttribute("xmlns");if(o&&o.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Sn(this.response,n).parse(e,t,r)}return e.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}In.pattern=new RegExp("(text|application)/(.*)xml");class kn extends Nn{static toString(){return"HTMLHandler"}static register(e){e.mediatypes["text/html"]={q:.9}}parse(e,t,r){let n=e.store;if(Ln(t))return e.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Sn(this.response).parse(e,t,r);if(function(e){const t=e.indexOf("<!DOCTYPE html"),r=e.indexOf(">");return!(-1===t||-1===r||t>r)&&-1!==e.substr(t,r-t).indexOf("XHTML")}(t))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Sn(this.response).parse(e,t,r);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Sn(this.response).parse(e,t,r);let i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&n.add(r.resource,En.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,En.rdf("type"),En.link("WebPage"),e.appNode),e.addStatus(r.req,"non-XML HTML document, not parsed for data."),e.doneFetch(r,this.response)}}kn.pattern=new RegExp("text/html");class An extends Nn{static toString(){return"JsonLdHandler"}static register(e){e.mediatypes["application/ld+json"]={q:.9}}parse(e,t,r,n){const i=e.store;return new Promise(((o,s)=>{try{ln(t,i,r.original.value,(()=>{o(e.doneFetch(r,n))}))}catch(t){const i="Error trying to parse "+r.resource+" as JSON-LD:\n"+t;o(e.failFetch(r,i,"parse_error",n))}}))}}An.pattern=/application\/ld\+json/;class Rn extends Nn{static toString(){return"TextHandler"}static register(e){e.mediatypes["text/plain"]={q:.5}}parse(e,t,r){return Ln(t)?(e.addStatus(r.req,"Warning: "+r.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new In(this.response).parse(e,t,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new In(this.response).parse(e,t,r)):(e.addStatus(r.req,"Plain text document, no known RDF semantics."),e.doneFetch(r,this.response))}}Rn.pattern=new RegExp("text/plain");class Cn extends Nn{static toString(){return"N3Handler"}static register(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}parse(e,t,r,n){let i=e.store,o=tn(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(t)}catch(t){let i="Error trying to parse "+r.resource+" as Notation3:\n"+t;return e.failFetch(r,i,"parse_error",n)}return e.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(r.original,En.rdf("type"),En.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}Cn.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");const Dn={RDFXMLHandler:On,XHTMLHandler:Sn,XMLHandler:In,HTMLHandler:kn,TextHandler:Rn,N3Handler:Cn,JsonLdHandler:An};function Ln(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}class Pn{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,t.Z)(this,"store",void 0),(0,t.Z)(this,"timeout",void 0),(0,t.Z)(this,"_fetch",void 0),(0,t.Z)(this,"mediatypes",void 0),(0,t.Z)(this,"appNode",void 0),(0,t.Z)(this,"requested",void 0),(0,t.Z)(this,"timeouts",void 0),(0,t.Z)(this,"redirectedTo",void 0),(0,t.Z)(this,"fetchQueue",void 0),(0,t.Z)(this,"fetchCallbacks",void 0),(0,t.Z)(this,"nonexistent",void 0),(0,t.Z)(this,"lookedUp",void 0),(0,t.Z)(this,"handlers",void 0),(0,t.Z)(this,"ns",void 0),(0,t.Z)(this,"fireCallbacks",void 0),this.store=e||new Cr,this.ns=jn(this.store.rdfFactory),this.timeout=r.timeout||3e4,this._fetch=r.fetch||void 0!==n.g&&(n.g.solidFetcher||n.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||bn(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},ur.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(r.handlers||Dn).map((e=>this.addHandler(Dn[e])))}static crossSiteProxy(e){return Pn.crossSiteProxyTemplate?Pn.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}static offlineOverride(e){let t=e;var r;return"undefined"!=typeof window&&window.panes&&(r=window.panes.UI)&&r.preferences&&r.preferences.get("offlineModeUsingLocalhost")&&"http://"===t.slice(0,7)&&"localhost/"!==t.slice(7,17)&&(t="http://localhost/"+t.slice(7),lr.Z.warn("Localhost kludge for offline use: actually getting <"+t+">")),t}static proxyIfNecessary(e){var t;if("undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){let t=e.split("/").slice(2);const r=(e,t)=>{let n=t[e.shift()];return n?"string"==typeof n?n+e.join("/"):e?r(e,n):null:null},n=r(t,$SolidTestEnvironment.localSiteMap);if(n)return n}return Pn.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?Pn.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}static unsupportedProtocol(e){let t=rr.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}static setCredentials(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}load(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=Object.assign({},t),e instanceof Array)return Promise.all(e.map((e=>this.load(e,Object.assign({},t)))));const r=e;let n=(0,wn._)(r);n=n.split("#")[0],t=this.initFetchOptions(n,t);const i=this.initFetchOptions(n,t);return this.pendingFetchPromise(n,i.baseURI,i)}async pendingFetchPromise(e,t,r){let n;return!r.force&&await this.fetchQueue[t]?n=this.fetchQueue[t]:(n=Promise.race([this.setRequestTimeout(e,r),this.fetchUri(e,r)]),this.fetchQueue[t]=n,this.cleanupFetchRequest(t,void 0,this.timeout)),n.then((t=>(e in this.timeouts&&(this.timeouts[e].forEach(clearTimeout),delete this.timeouts[e]),t)))}cleanupFetchRequest(e,t,r){void 0!==t&&xn.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{this.isPending(e)||delete this.fetchQueue[e]}),r))}initFetchOptions(e,t){let r=this.store;!t.method||"GET"===t.method.toUpperCase()||(t.force=!0),t.resource=r.rdfFactory.namedNode(e),t.baseURI=t.baseURI||e,t.original=r.rdfFactory.namedNode(t.baseURI),t.req=r.bnode(),t.headers=t.headers||new mn.Headers,t.contentType&&(t.headers["content-type"]=t.contentType),t.force&&(t.cache="no-cache");let n=this.acceptString();t.headers.accept=n;let i=Pn.offlineOverride(e);t.requestedURI=i,Pn.setCredentials(i,t);let o=Pn.proxyIfNecessary(i);return i!==o&&(t.proxyUsed=!0),t.actualProxyURI=o,t}fetchUri(e,t){if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(Pn.unsupportedProtocol(e))return this.failFetch(t,"fetcher: Unsupported protocol","unsupported_protocol");let r=this.getState(e);if(t.force)delete this.nonexistent[e];else{if("fetched"===r)return Promise.resolve(this.doneFetch(t,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===r&&404===this.requested[e]){let r="Previously failed: "+this.requested[e],n={url:e,status:this.requested[e],statusText:r,responseText:r,headers:new mn.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(t,r,this.requested[e],n)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,t.noMeta||this.saveRequestMetadata(e,t);let{actualProxyURI:n}=t;return this._fetch(n,t).then((r=>this.handleResponse(r,e,t)),(r=>{let i={url:n,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new mn.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return xn.log("Fetcher: <"+n+"> Non-HTTP fetch exception: "+r),this.handleError(i,e,t)}))}nowOrWhenFetched(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,wn._)(e);"function"==typeof t?r=t:void 0===t||((0,u.NX)(t)?n.referringTerm=t:n=t),this.load(i,n).then((e=>{if(r)if(e)if(e.ok)r(!0,"OK",e);else{let t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),xn.log(t+" fetching "+i),r(!1,t,e)}else{let e="@@ nowOrWhenFetched: no response object!";xn.log(e),r(!1,e)}}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,xn.log(t),e.response&&e.response.status&&(t+=" status: "+e.response.status),r(!1,t,e.response)}))}addStatus(e,t){let r=new Date;t="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+t;let n=this.store;const i=n.the(e,this.ns.link("status"));(0,u.uZ)(i)?i.append(n.rdfFactory.literal(t)):lr.Z.warn("web.js: No list to add to: "+i+","+t)}failFetch(e,t,r,n){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));let i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[rr.docpart(e.original.value)]=r,this.fireCallbacks("fail",[e.original.value,t]));var o=new Error("Fetcher: "+t);return o.status=r,o.statusText=t,o.response=n,Promise.reject(o)}linkData(e,t,r,n,i){if(!r)return;let o,s=this.store,a=s.rdfFactory.namedNode(rr.join(r,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(a.value===e.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===t?s.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):s.rdfFactory.namedNode(rr.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?s.add(a,o,e,n):s.add(e,o,a,n)}parseLinkHeader(e,t,r){if(!e)return;const n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(let e=0;e<i.length;e++){let o=i[e].split(">"),s=o[0].substring(1),a=o[1].match(n);if(null==a)return;for(let e=0;e<a.length;e++){let n=a[e].split("=")[1].replace(/["']/g,"");this.linkData(t,n,s,r)}}}doneFetch(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}nowKnownAs(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}putBack(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,wn._)(e);let n=new c.Z(r).doc();return t.contentType=t["content-type"]||t["Content-Type"]||t.contentType||s.z8,"application/ld+json"===t.contentType?new Promise(((r,i)=>{vr(n,this.store,n.uri,t.contentType,((n,o)=>{n?i(n):(t.data=o,this.webOperation("PUT",e,t).then((e=>r(e))).catch((e=>i(e))))}))})):(t.data=vr(n,this.store,n.value,t.contentType),this.webOperation("PUT",r,t))}webCopy(e,t,r){return this.webOperation("GET",e).then((e=>this.webOperation("PUT",t,{data:e.responseText,contentType:r})))}delete(e,t){return this.webOperation("DELETE",e,t).then((t=>(this.requested[e]=404,this.nonexistent[e]=!0,this.unload(this.store.rdfFactory.namedNode(e)),t)))}async createIfNotExists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.z8,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=this;try{var i=await n.load(e)}catch(o){if(404===o.response.status){xn.log("createIfNotExists: doc does NOT exist, will create... "+e);try{i=await n.webOperation("PUT",e.value,{data:r,contentType:t})}catch(t){throw xn.log("createIfNotExists doc FAILED: "+e+": "+t),t}return delete n.requested[e.value],i}throw xn.log("createIfNotExists doc load error NOT 404: "+e+": "+o),o}return i}createContainer(e,t,r){let n={"content-type":s.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(n.slug=t);let i={headers:n};return r&&(i.body=r),this.webOperation("POST",e,i)}invalidateCache(e){const t=(0,wn._)(e),r=this;if(r.fetchQueue&&r.fetchQueue[t]&&(xn.log("Internal error - fetchQueue exists "+t),"resolved"===r.fetchQueue[t].PromiseStatus?delete r.fetchQueue[t]:(delete r.fetchQueue[t],xn.log("*** Fetcher: pending fetchQueue deleted "+t))),r.requested[t]&&"done"!==r.requested[t]&&"failed"!==r.requested[t]&&404!==r.requested[t]){let e=`Rdflib: fetcher: Destructive operation on <${r.requested[t]}> file being fetched! `+t;xn.error(e)}else delete r.requested[t],delete r.nonexistent[t]}webOperation(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,wn._)(t);r.method=e,r.body=r.data||r.body,r.force=!0;const i=this;if(r.body&&!r.contentType)throw new Error("Web operation sending data must have a defined contentType.");return r.contentType&&(r.headers=r.headers||{},r.headers["content-type"]=r.contentType),Pn.setCredentials(n,r),new Promise((function(t,o){i._fetch(n,r).then((r=>{if(r.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||i.invalidateCache(n),r.text?r.text().then((e=>{r.responseText=e,t(r)})):t(r);else{let t="Web error: "+r.status;r.statusText&&(t+=" ("+r.statusText+")"),t+=" on "+e+" of <"+n+">",r.responseText&&(t+=": "+r.responseText);let i=new Error(t);i.response=r,o(i)}}),(t=>{o(new Error("Fetch error for "+e+" of <"+n+">:"+t))}))}))}lookUpThing(e,t){let r=this.store.uris(e);return r=r.map((e=>rr.docpart(e))),r.forEach((e=>{this.lookedUp[e]=!0})),this.load(r,{referringTerm:t})}getHeader(e,t){const r=this.store,n=e.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n));for(let e=0;e<i.length;e++){let n=i[e];if(void 0!==n){let e=r.any(n,this.ns.link("response"));if(void 0!==e&&r.anyValue(e,this.ns.http("status"))&&r.anyValue(e,this.ns.http("status")).startsWith("2")){let n=r.each(e,this.ns.httph(t.toLowerCase()));return n.length?n.map((e=>e.value)):[]}}}}saveRequestMetadata(e,t){let r=t.req,n=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),(0,u.NX)(i)&&n.add(n.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(t.original.value),this.appNode);const o=new Date,s="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(s+" Request for "+e),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(e),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}saveResponseMetadata(e,t){const r=this.store;let n=r.bnode();return r.add(t.req,this.ns.link("response"),n,n),r.add(n,this.ns.http("status"),r.rdfFactory.literal(e.status),n),r.add(n,this.ns.http("statusText"),r.rdfFactory.literal(e.statusText),n),e.headers.forEach(((e,i)=>{r.add(n,this.ns.httph(i),this.store.rdfFactory.literal(e),n),"content-type"===i&&r.add(t.resource,this.ns.rdf("type"),r.rdfFactory.namedNode(ur.mediaTypeClass(e).value),n)})),n}objectRefresh(e){let t=this.store.uris(e);if(void 0!==t)for(let e=0;e<t.length;e++)this.refresh(this.store.rdfFactory.namedNode(rr.docpart(t[e])))}refresh(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}refreshIfExpired(e,t){let r=this.getHeader(e,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}retract(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[rr.docpart(e.value)],this.fireCallbacks("retract",arguments)}getState(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}isPending(e){return!0===this.requested[e]}unload(e){this.store.removeDocument(e),delete this.requested[e.value]}addHandler(e){this.handlers.push(e),e.register(this)}retryNoCredentials(e,t){xn.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+t.resource),t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];let r=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,r)}isCrossSite(e){if("undefined"==typeof document||!document.location)return!1;const t=rr.hostpart,r=""+document.location;return(t(r)&&t(e)&&t(r))!==t(e)}handleError(e,t,r){if(this.isCrossSite(t)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(t,r);let e=Pn.crossSiteProxy(t);if(e&&!r.proxyUsed)return xn.log("web: Direct failed so trying proxy "+e),this.redirectToProxy(e,r)}var n;return e instanceof Error?n="Fetch error: "+e.message:(n=e.statusText,e.responseText&&(n+=` ${e.responseText}`)),this.failFetch(r,n,e.status||998,e)}addType(e,t,r,n){let i=t;if(n){var o=r.any(i,this.ns.link("requestedURI"));o&&o.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),e,this.appNode)}for(;;){const t=r.any(i,this.ns.link("requestedURI"));if(t&&t.value&&r.add(r.rdfFactory.namedNode(t.value),this.ns.rdf("type"),e,this.appNode),i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i),!i)break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var a=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!a)break;if("301"!==a&&"302"!==a)break}}handleResponse(e,t,r){const n=this.store,i=e.headers,o=r.req,s=this.saveResponseMetadata(e,r),a=this.normalizedContentType(r,i)||"";let l=i.get("content-location");if(0===e.status)return xn.log("Masked error - status 0 for "+t),this.handleError(e,t,r);if(e.status>=400)return 404===e.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((()=>{let t=r.resource+" "+e.statusText;return this.failFetch(r,t,e.status,e)}));var c=null,u=null;if(l&&(u=rr.join(l,t))!==t&&(c=u),200===e.status){this.addType(this.ns.link("Document"),o,n,t),c&&this.addType(this.ns.link("Document"),o,n,c),r.clearPreviousData&&n.removeDocument(r.resource);let e=a.includes("image/")||a.includes("application/pdf");a&&e&&(this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,t),c&&this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,c))}if(l){if(!r.force&&c&&"done"===this.requested[u])return this.doneFetch(r,e);this.requested[u]=!0}this.parseLinkHeader(i.get("link"),r.original,o);let h=this.handlerForContentType(a,e);return h?e.text().then((t=>(e.responseText=t,h.parse(this,t,r,e)))):(this.addStatus(o,"Fetch over. No data handled."),this.doneFetch(r,e))}saveErrorResponse(e,t){let r=this.store;return e.text().then((e=>{e.length>10&&r.add(t,this.ns.http("content"),r.rdfFactory.literal(e),t)}))}handlerForContentType(e,t){if(!e)return null;let r=this.handlers.find((t=>e.match(t.pattern)));return r?new r(t):null}guessContentType(e){return Tn[e.split(".").pop()]}normalizedContentType(e,t){if(e.forceContentType)return e.forceContentType;let r=t.get("content-type");if(!r||r.includes("application/octet-stream")){let t=this.guessContentType(e.resource.value);if(t)return t}let n=rr.protocol(e.resource.value);return!r&&["file","chrome"].includes(n)?"text/xml":r}redirectToProxy(e,t){this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;const r=this.store,n=t.req;t.noMeta||(r.add(n,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(e),n),this.addStatus(n,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;let i=Object.assign({},t);return i.baseURI=t.resource.value,this.fetchUri(e,i).then((e=>(i.noMeta||r.add(n,this.ns.link("redirectedRequest"),i.req,this.appNode),e)))}setRequestTimeout(e,t){return new Promise((r=>{this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{!this.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(this.failFetch(t,`Request to ${e} timed out`,"timeout"))}),this.timeout))}))}addFetchCallback(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}acceptString(){let e="";for(let t in this.mediatypes){""!==e&&(e+=", "),e+=t;for(let r in this.mediatypes[t])e+=";"+r+"="+this.mediatypes[t][r]}return e}}(0,t.Z)(Pn,"HANDLERS",void 0),(0,t.Z)(Pn,"CONTENT_TYPE_BY_EXT",void 0),(0,t.Z)(Pn,"crossSiteProxyTemplate",void 0),Pn.HANDLERS=Dn,Pn.CONTENT_TYPE_BY_EXT=Tn;const Mn={parseJSON:function(e,t,r){var n,i,o,s={},a=r.sym(t);for(var l in e){0===l.indexOf("_:")?s[l]?n=s[l]:(n=r.bnode(l),s[l]=n):n=r.sym(l);var c=e[l];for(var u in c){var h=c[u];for(var d in i=r.sym(u),h){var f=h[d];if("uri"===f.type)o=r.sym(f.value),r.add(n,i,o,a);else if("BlankNode"===f.type)s[f.value]?o=s[f.value]:(o=r.bnode(f.value),s[f.value]=o),r.add(n,i,o,a);else{if("Literal"!==f.type)throw new Error("error: unexpected termtype: "+d.type);o=f.datatype?r.literal(f.value,void 0,r.sym(f.datatype)):f.lang?r.literal(f.value,f.lang):r.literal(f.value),r.add(n,i,o,a)}}}}}};function Fn(e){var t=0;function r(e){var t="",r=e.statements;for(var n in r)lr.Z.debug("Found statement: "+r),t+=s()+r[n]+"\n";return t}function n(e){var t="";for(var r in e.constraints){var n=e.constraints[r];t+=s()+"FILTER ( "+n.describe(r)+" ) \n"}return t}function i(e){for(var o="",a=0;a<e.optional.length;a++)lr.Z.debug("Found optional query"),o+=s()+"OPTIONAL { \n",t++,o+=r(e.optional[a]),o+=n(e.optional[a]),o+=i(e.optional[a]),t--,o+=s()+"}\n";return o}function o(e){var o=s()+"WHERE \n{ \n";return t++,o+=r(e),o+=n(e),o+=i(e),t--,o+"}"}function s(){for(var e="",r=0;r<t;r++)e+=" ";return e}return function(e){return function(e){for(var t=s()+"SELECT ",r=0;r<e.vars.length;r++)t+=e.vars[r]+" ";return t+"\n"}(e)+o(e.pat)}(e)}function Un(e,t,r){var n=[];function i(e){if(n[e])return n[e];var t=r.variable(e);return n[e]=t,t}function o(e){return"string"==typeof e&&e.match(/[^ \n\t]/)}function s(e){return"string"==typeof e&&e.match(/^[\?\$]/)}function a(e){return"string"==typeof e?e.replace(/^</,"<").replace(/>$/,">"):e}function l(e){return"string"==typeof e&&e.match(/^<[^>]*>$/)}function c(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function u(e){return"string"==typeof e&&e.match(/:$/)}function h(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function d(e){return e.split(":")[0]}function f(e){return e.split(":")[1]}function p(e){return l(e)?e.slice(1,e.length-1):e}function g(e){var t=-1===e.indexOf("'")?null:e.indexOf("'"),n=-1===e.indexOf('"')?null:e.indexOf('"');if(!t&&!n){var i=new Array(1);return i[0]=e,i}var o,s,a=new Array(2);if(!t||n&&n<t)o='"',s=n;else{if(n&&!(t&&t<n))return lr.Z.error("SQARQL QUERY OOPS!"),a;o="'",s=t}a[0]=e.slice(0,s);var l,c=e.slice(s+1).indexOf(o);return-1===c?(lr.Z.error("SPARQL parsing error: no matching parentheses in literal "+e),e):(e.slice(c+s+2).match(/^\^\^/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),r.sym(p(e.slice(s+4+c,s+2+c+l)))),a=a.concat(g(e.slice(c+s+3+l)))):e.slice(c+s+2).match(/^@/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),e.slice(s+3+c,s+2+c+l),null),a=a.concat(g(e.slice(c+s+2+l)))):(a[1]=r.literal(e.slice(s+1,s+1+c)),lr.Z.info("Literal found: "+a[1]),a=a.concat(g(e.slice(c+s+2)))),a)}function y(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),lr.Z.info("New str into spaceDelimit: \n"+e);var t=[],r=e.split(" ");for(var n in r)o(r[n])&&(t=t.concat(r[n]));return t}function v(e,t){for(var r=0;r<t.length;r++)if("string"==typeof t[r]&&t[r].toLowerCase()===e.toLowerCase())return r;return null}function m(e,t){for(var r=[],n=0;n<t.length;n++)"string"==typeof t[n]&&t[n].toLowerCase()===e.toLowerCase()&&r.push(n);return r}function b(e,t,r){lr.Z.info("Looking for a close bracket of type "+r+" in "+e);for(var n=0,i=0;i<e.length;i++)if(e[i]===t&&n++,e[i]===r&&n--,n<0)return i;return lr.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(e){return this.describe=function(t){return t+" = "+e.toNT()},this.test=function(t){return e.equals(t)},this}function x(e){this.describe=function(t){return"REGEXP( '"+e+"' , "+t+" )"},this.test=function(t){var r=new RegExp(e);return!!t.value&&r.test(t.value)}}function _(e,t){3!==e.length||"Variable"!==e[0].termType||"NamedNode"!==e[2].termType&&"Literal"!==e[2].termType?6===e.length&&"string"==typeof e[0]&&"regexp"===e[0].toLowerCase()&&"("===e[1]&&")"===e[5]&&","===e[3]&&"Variable"===e[4].termType&&"Literal"===e[2].termType&&(lr.Z.debug("Constraint added: "+e),t.constraints[e[4]]=new x(e[2].value)):"="===e[1]||">"===e[1]||"<"===e[1]?(lr.Z.debug("Constraint added: "+e),t.constraints[e[0]]=new w(e[2])):lr.Z.warn("I don't know how to handle the constraint: "+e)}function T(e,t){lr.Z.debug("Optional query: "+e+" not yet implemented.");var n=r.formula();j(e,n),t.optional.push(n)}function j(e,t){var n,o,u=function(e){for(var t=[],n=0;n<e.length;n++)"string"==typeof e[n]?(e[n]=a(e[n]),s(e[n])?t[n]=i(e[n].slice(1)):c(e[n])?(lr.Z.info(e[n]+" was identified as a bnode."),t[n]=r.bnode()):l(e[n])?(lr.Z.info(e[n]+" was identified as a symbol."),t[n]=r.sym(p(e[n]))):h(e[n])?(lr.Z.info(e[n]+" was identified as a prefixed symbol"),O[d(e[n])]?t[n]=r.sym(e[n]=O[d(e[n])]+f(e[n])):(lr.Z.error("SPARQL error: "+e[n]+" with prefix "+d(e[n])+" does not have a correct prefix entry."),t[n]=e[n])):t[n]=e[n]):t[n]=e[n];return t}(e);for(lr.Z.debug("WHERE: "+u);v("OPTIONAL",u);)o=v("OPTIONAL",u),lr.Z.debug("OPT: "+o+" "+u[o]+" in "+u),"{"!==u[o+1]&&lr.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(u.slice(o+2),"{","}"))?lr.Z.error("No matching bracket in word "+o):(T(u.slice(o+2,o+2+n),t),o=v("OPTIONAL",u),n=b(u.slice(o+2),"{","}"),u.splice(o,n+3));for(lr.Z.debug("WHERE after optionals: "+u);v("FILTER",u);){var g=v("FILTER",u);"("!==u[g+1]&&lr.Z.warn("Bad filter opening bracket in word "+g),-1===(n=b(u.slice(g+2),"(",")"))?lr.Z.error("No matching bracket in word "+g):(_(u.slice(g+2,g+2+n),t),g=v("FILTER",u),n=b(u.slice(g+2),"(",")"),u.splice(g,n+3))}lr.Z.debug("WHERE after filters and optionals: "+u),function(e,t){var r=new Array(1);r[0]=-1;for(var n=r.concat(m(".",e)),i=[],o=0;o<n.length-1;o++)i[o]=e.slice(n[o]+1,n[o+1]);for(o in i){lr.Z.info("s+p+o "+o+" = "+i[o]);var s=i[o][0];i[o].splice(0,1);var a=r.concat(m(";",i[o]));a.push(i[o].length);for(var l=[],c=0;c<a.length-1;c++)l[c]=i[o].slice(a[c]+1,a[c+1]);for(o in l){lr.Z.info("p+o "+o+" = "+i[o]);var u=l[o][0];l[o].splice(0,1);var h=r.concat(m(",",l[o]));h.push(l[o].length);var d=[];for(c=0;c<h.length-1;c++)d[c]=l[o].slice(h[c]+1,h[c+1]);for(o in d){var f=d[o][0];lr.Z.info("Subj="+s+" Pred="+u+" Obj="+f),t.add(s,u,f)}}}}(u,t)}lr.Z.info("SPARQL input: \n"+e);var E=new Or,N=function(e){var t=g(e),r=[];for(var n in t)r="string"==typeof t[n]?r.concat(y(t[n])):r.concat(t[n]);return r=function(e){for(var t=e,r=0;r<t.length;r++)if("a"===t[r]&&(t[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===t[r]&&"of"===t[r+2]){t.splice(r,1),t.splice(r+1,1);var n=t[r-1];t[r-1]=t[r+1],t[r+1]=n}return t}(r),lr.Z.info("SPARQL Tokens: "+r),r}(e),O=function(e){var t=m("PREFIX",e),r=[];for(var n in t){var i=e[t[n]+1],o=e[t[n]+2];if(u(i))if(l(o)){lr.Z.info("Prefix found: "+i+" -> "+o);var s=d(i),a=p(o);r[s]=a}else lr.Z.error("Invalid SPARQL symbol: "+o);else lr.Z.error("Invalid SPARQL prefix: "+i)}return r}(N);O.rdf||(O.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),O.rdfs||(O.rdfs="http://www.w3.org/2000/01/rdf-schema#");var S=v("SELECT",N),I=v("WHERE",N);if(S<0||I<0||S>I)return lr.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var r in lr.Z.info("SPARQL vars: "+e),e)if(s(e[r])){lr.Z.info("Added "+e[r]+" to query variables from SPARQL");var n=i(e[r].slice(1));t.vars.push(n),n.label=e[r].slice(1)}else lr.Z.warn("Incorrect SPARQL variable in SELECT: "+e[r])}(N.slice(S+1,I),E),j(N.slice(I+2,N.length-1),E.pat),t)return E;for(var k in E.pat.statements){var A=E.pat.statements[k];"NamedNode"===A.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(A.subject,"sparql:"+A.subject),"NamedNode"===A.object.termType&&r.fetcher&&r.fetcher.lookUpThing(A.object,"sparql:"+A.object)}return E}class Bn{constructor(e){if((0,t.Z)(this,"store",void 0),(0,t.Z)(this,"ifps",void 0),(0,t.Z)(this,"fps",void 0),(0,t.Z)(this,"patchControl",void 0),(0,t.Z)(this,"ns",void 0),(e=e||new Cr).updater)throw new Error("You can't have two UpdateManagers for the same store");e.fetcher||(e.fetcher=new Pn(e)),this.store=e,e.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=cr("http://www.w3.org/2007/ont/link#"),this.ns.http=cr("http://www.w3.org/2007/ont/http#"),this.ns.httph=cr("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=cr("http://www.w3.org/ns/ldp#"),this.ns.rdf=cr("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=cr("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=cr("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=cr("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}patchControlFor(e){return this.patchControl[e.value]||(this.patchControl[e.value]=[]),this.patchControl[e.value]}isHttpUri(e){return"http"===e.slice(0,4)}editable(e,t){if(!e)return!1;if(t||(t=this.store),e=(0,wn._)(e),!this.isHttpUri(e)&&t.holds(this.store.rdfFactory.namedNode(e),this.store.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.store.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var r,n,i=!1,o=t.each(void 0,this.ns.link("requestedURI"),(0,rr.docpart)(e)),s=0;s<o.length;s++)if(void 0!==(r=o[s])){var a=t.any(r,this.ns.link("response"));if(void 0!==r){var l=t.anyValue(a,this.ns.httph("wac-allow"));if(l)for(var c of l.split(",")){var u=c.split("=");if(u[0].includes("user")&&!u[1].includes("write")&&!u[1].includes("append"))return!1}var h=t.each(a,this.ns.httph("accept-patch"));if(h.length)for(let e=0;e<h.length;e++){if((n=h[e].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(n.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var d=t.each(a,this.ns.httph("ms-author-via"));if(d.length)for(let e=0;e<d.length;e++){if((n=d[e].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(n.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(e))return!!l&&"LOCALFILE";var f=t.each(a,this.ns.http("status"));if(f.length)for(let e=0;e<f.length;e++)200!==f[e]&&404!==f[e]||(i=!0)}}if(0===o.length);else if(i)return!1}anonymize(e){return"_:"===e.toNT().substr(0,2)&&this.mentioned(e)?"?"+e.toNT().substr(2):e.toNT()}anonymizeNT(e){return this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" ."}nTriples(e){return`${e.subject.toNT()} ${e.predicate.toNT()} ${e.object.toNT()} .`}statementBnodes(e){return[e.subject,e.predicate,e.object].filter((function(e){return(0,u.B2)(e)}))}statementArrayBnodes(e){var t=[];for(let r=0;r<e.length;r++)t=t.concat(this.statementBnodes(e[r]));t.sort();var r=[];for(let e=0;e<t.length;e++)0!==e&&t[e].equals(t[e-1])||r.push(t[e]);return r}cacheIfps(){this.ifps={};var e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty"));for(let t=0;t<e.length;t++)this.ifps[e[t].value]=!0;this.fps={},e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(let t=0;t<e.length;t++)this.fps[e[t].value]=!0}bnodeContext2(e,t,r){var n,i,o=this.store.statementsMatching(void 0,void 0,e,t);for(let e=0;e<o.length;e++)if(this.fps[o[e].predicate.value]){if(!(n=o[e].subject).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}o=this.store.statementsMatching(e,void 0,void 0,t);for(let e=0;e<o.length;e++)if(this.ifps[o[e].predicate.value]){if(!(n=o[e].object).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}return null}bnodeContext1(e,t){for(var r=0;r<3;r++){var n=this.bnodeContext2(e,t,r);if(null!==n)return n}return this.store.connectedStatements(e,t)}mentioned(e){return 0!==this.store.statementsMatching(e,null,null,null).length||0!==this.store.statementsMatching(null,e).length||0!==this.store.statementsMatching(null,null,e).length}bnodeContext(e,t){var r=[];if(e.length){this.cacheIfps();for(let i=0;i<e.length;i++){var n=e[i];this.mentioned(n)&&(r=r.concat(this.bnodeContext1(n,t)))}}return r}statementContext(e){var t=this.statementBnodes(e);return this.bnodeContext(t,e.graph)}contextWhere(e){var t=this;return e&&0!==e.length?"WHERE { "+e.map((function(e){return t.anonymizeNT(e)})).join("\n")+" }\n":""}fire(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((()=>{if(!e)throw new Error("No URI given for remote editing operation: "+t);return n.noMeta=!0,n.contentType="application/sparql-update",n.body=t,this.store.fetcher.webOperation("PATCH",e,n)})).then((n=>{if(!n.ok){let r="UpdateManager: update failed for <"+e+"> status="+n.status+", "+n.statusText+"\n for query: "+t;throw new Error(r)}r(e,n.ok,n.responseText,n)})).catch((t=>{r(e,!1,t.message,t)}))}update_statement(e){if(!e||e.graph){var t=this,r=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.graph]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(r),set_object:function(e,r){var n=this.where;n+="DELETE DATA { "+this.statementNT+" } ;\n",n+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].value,n,r)}}}}insert_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}delete_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}requestDownstreamAction(e,t){var r=this.patchControlFor(e);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+t)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=t;else t(e)}clearUpstreamCount(e){this.patchControlFor(e).upstreamCount=0}getUpdatesVia(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}addDownstreamChangeListener(e,t){var r=this.patchControlFor(e);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(t),this.setRefreshHandler(e,(e=>{this.reloadAndSync(e)}))}reloadAndSync(e){var t=this.patchControlFor(e),r=this;if(t.reloading)t.outOfDate=!0;else{t.reloading=!0;var n=1e3,i=function(){r.reload(r.store,e,(function(e,r,o){if(e){if(t.downstreamChangeListeners)for(let e=0;e<t.downstreamChangeListeners.length;e++)t.downstreamChangeListeners[e]();t.reloading=!1,t.outOfDate&&(t.outOfDate=!1,i())}else t.reloading=!1,0===o.status&&(t.reloading=!0,setTimeout(i,n*=2))}))};i()}}setRefreshHandler(e,t){let r=this.getUpdatesVia(e);var n=t,i=this,o=this,s=1500,a=0;if(!r)return!1;r=(0,rr.join)(r,e.value);const l=r.replace(/^http:/,"ws:").replace(/^https:/,"wss:");var c=function(){var t;if("undefined"!=typeof WebSocket)t=new WebSocket(l);else{if("undefined"==typeof window||!window.WebSocket)return;t=window.WebSocket(l)}t.onopen=function(){s=1500,this.send("sub "+e.value),a&&o.requestDownstreamAction(e,n)};var r=i.patchControlFor(e);r.upstreamCount=0,t.onerror=function(e){},t.onclose=function(e){s*=2,a+=1,setTimeout((function(){c()}),s)},t.onmessage=function(t){if(t.data&&"pub"===t.data.slice(0,3)){if("upstreamCount"in r&&(r.upstreamCount-=1,r.upstreamCount>=0))return;r.upstreamCount=0,i.requestDownstreamAction(e,n)}}};return c(),!0}updateMany(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e.concat(t).map((e=>e.why)),n=this,i=[];r.forEach((e=>{i.find((t=>t.equals(e)))||i.push(e)}));const o=i.map((r=>n.update(e.filter((e=>e.why.equals(r))),t.filter((e=>e.why.equals(r))))));return o.length,Promise.all(o)}update(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var o=this;return new Promise((function(r,s){o.update(e,t,(function(e,t,n){t?r():s(new Error(n))}),n,i)}))}try{var s=this.store,a=e?(0,u.Pv)(e)?e.statements:e instanceof Array?e:[e]:[],l=t?(0,u.Pv)(t)?t.statements:t instanceof Array?t:[t]:[];if(!(a instanceof Array))throw new Error("Type Error "+typeof a+": "+a);if(!(l instanceof Array))throw new Error("Type Error "+typeof l+": "+l);if(0===a.length&&0===l.length)return r(null,!0);var c=a.length?a[0].graph:l[0].graph;if(!c){let e="Error patching: statement does not specify which document to patch:"+a[0]+", "+l[0];throw new Error(e)}var h=this.patchControlFor(c),d=Date.now(),f=["subject","predicate","object","why"],p={delete:a,insert:l};["insert","delete"].map((function(e){p[e].map((function(e){if(!c.equals(e.graph))throw new Error("update: destination "+c+" inconsistent with delete quad "+e.graph);f.map((function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")}))}))}));var g=this.editable(c.value,s);if(!1===g)throw new Error("Update: Can't make changes in uneditable "+c);if(void 0===g){if(n)throw new Error("Update: Loaded "+c+"but stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(c).then((n=>{this.update(e,t,r,!0,i)}),(n=>{if(404!==n.response.status)throw new Error(`Update: Can't get updatability status ${c} before patching: ${n}`);this.update(e,t,r,!0,i)}))}if(g.indexOf("SPARQL")>=0){var y=[];a.length&&(y=this.statementArrayBnodes(a)),l.length&&(y=y.concat(this.statementArrayBnodes(l)));var v=this.bnodeContext(y,c),m=this.contextWhere(v),b="";if(m.length){if(a.length){b+="DELETE { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" }\n"}if(l.length){b+="INSERT { ";for(let e=0;e<l.length;e++)b+=this.anonymizeNT(l[e])+"\n";b+=" }\n"}b+=m}else{if(a.length){b+="DELETE DATA { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" } \n"}if(l.length){a.length&&(b+=" ; "),b+="INSERT DATA { ";for(let e=0;e<l.length;e++)b+=this.nTriples(l[e])+"\n";b+=" }\n"}}h.pendingUpstream=h.pendingUpstream?h.pendingUpstream+1:1,"upstreamCount"in h&&(h.upstreamCount+=1),this.fire(c.value,b,((e,t,n,i)=>{if(i.elapsedTimeMs=Date.now()-d,t){try{s.remove(a)}catch(e){t=!1,n="Remote Ok BUT error deleting "+a.length+" from store!!! "+e}for(let e=0;e<l.length;e++)s.add(l[e].subject,l[e].predicate,l[e].object,c)}if(r(e,t,n,i),h.pendingUpstream-=1,0===h.pendingUpstream&&h.downstreamAction){var o=h.downstreamAction;delete h.downstreamAction,o(c)}}),i)}else if(g.indexOf("DAV")>=0)this.updateDav(c,a,l,r,i);else{if(!(g.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+g+"' for "+c);try{this.updateLocalFile(c,a,l,r,i)}catch(e){r(c.value,!1,"Exception trying to write back file <"+c.value+">\n")}}}catch(e){r(void 0,!1,"Exception in update: "+e+"\n"+ur.stackString(e))}}updateDav(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store;var s=o.any(e,this.ns.link("request"));if(!s)throw new Error("No record of our HTTP GET request for document: "+e);var a=o.any(s,this.ns.link("response"));if(!a)return null;var l=o.the(a,this.ns.httph("content-type")).value;let c=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)ur.RDFArrayRemove(c,t[e]);for(let e=0;e<r.length;e++)c.push(r[e]);const u=this.serialize(e.value,c,l);var h,d=o.the(a,this.ns.httph("content-location"));return d&&(h=(0,rr.join)(d.value,h)),i.contentType=l,i.noMeta=!0,i.body=u,o.fetcher.webOperation("PUT",h,i).then((i=>{if(!i.ok)throw new Error(i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,i.ok,i.responseText,i)})).catch((t=>{n(e.value,!1,t.message,t)}))}updateLocalFile(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=this.store;let s=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)ur.RDFArrayRemove(s,t[e]);for(let e=0;e<r.length;e++)s.push(r[e]);var a=e.value.lastIndexOf(".");if(a<1)throw new Error("Rewriting file: No filename extension: "+e.value);var l=e.value.slice(a+1);let c=Pn.CONTENT_TYPE_BY_EXT[l];if(!c)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(e.value,s,c),i.contentType=c,o.fetcher.webOperation("PUT",e.value,i).then((i=>{if(!i.ok)return n(e.value,!1,i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,!0,"")}))}serialize(e,t,r){const n=this.store;let i;if("string"==typeof t)return t;var o=gr(n);switch(o.suggestNamespaces(n.namespaces),o.setBase(e),r){case"text/xml":case"application/rdf+xml":i=o.statementsToXML(t);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":i=o.statementsToN3(t);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return i}put(e,t,r,n){const i=this.store;let o;return Promise.resolve().then((()=>(o=this.serialize(e.value,t,r),i.fetcher.webOperation("PUT",e.value,{contentType:r,body:o})))).then((r=>{if(!r.ok)return n(e.value,r.ok,r.error,r);delete i.fetcher.nonexistent[e.value],delete i.fetcher.requested[e.value],"string"!=typeof t&&t.map((e=>{i.addStatement(e)})),n(e.value,r.ok,"",r)})).catch((t=>{n(e.value,!1,t.message)}))}reload(e,t,r){var n=Date.now();e.fetcher.nowOrWhenFetched(t.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(e,i,o){if(e)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var s=Date.now()-n;t.reloadTimeTotal||(t.reloadTimeTotal=0),t.reloadTimeCount||(t.reloadTimeCount=0),t.reloadTimeTotal+=s,t.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}const qn={...sn,fetcher:(e,t)=>new Pn(e,t),graph(){return new Cr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)||{rdfFactory:sn})},lit(e,t,r){return this.literal(""+e,t||r)},st(e,t,r,n){return this.quad(e,t,r,n)}},Hn=qn;class $n{constructor(e,t){this.parent=e,this.via=t,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(t),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(e){this.onError(e)}}_decode(e){var t,r,n,i,o,s,a;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=e.split("&")).length;r<n;r++)t=i[r],o.push(t.split("="));return o}())t=o[r],a=(s=[decodeURIComponent(t[0]),decodeURIComponent(t[1])])[1],null==i[n=s[0]]&&(i[n]=[]),i[n].push(a);return i}_send(e,t,r){var n,i;return i=[e,t,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}_subscribe(e){return this._send("sub",e,""),this.subscribed[e]=!0,this.subscribed[e]}onClose(e){var t;for(t in this.connected=!1,this.subscribed)this.pending[t]=!0;return this.subscribed={},this.subscribed}onError(e){throw new Error("onError"+e)}onMessage(e){var t,r;return"ping"===(r=e.data.split(" "))[0]?"function"==typeof(t=this.socket).send?t.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}onOpen(e){var t,r;for(r in this.connected=!0,t=[],this.pending)delete this.pending[r],t.push(this._subscribe(r));return t}subscribe(e){return this.connected?this._subscribe(e):(this.pending[e]=!0,this.pending[e])}}class Zn{constructor(e){this.fetcher=e,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}onHeaders(e){var t,r,n;return null==e.headers||"undefined"==typeof WebSocket||null===WebSocket||(t=e.headers.etag,n=e.headers["updates-via"],r=e.uri,t&&n&&(this.graph[r]={etag:t,via:n},this.register(n,r))),!0}onUpdate(e,t){return this.fetcher.refresh(Hn.namedNode(e))}register(e,t){return null==this.via[e]&&(this.via[e]=new $n(this,e)),this.via[e].subscribe(t)}}const zn={};for(const e in Hn)"function"==typeof Hn[e]&&(zn[e]=Hn[e].bind(Hn));const{fetcher:Vn,graph:Gn,lit:Jn,st:Xn,namedNode:Qn,variable:Wn,blankNode:Yn,defaultGraph:Kn,literal:ei,quad:ti,triple:ri}=zn,ni=new Tr,ii=e=>ni.fromNT(e),oi=jr.fromValue,si=l.nextId;class ai extends Cr{constructor(e){super(e),(0,t.Z)(this,"fetcher",void 0),this.fetcher=new Pn(this,{})}}class li extends ai{constructor(e){super(e),(0,t.Z)(this,"updater",void 0),this.updater=new Bn(this)}}})(),i})()));
|
|
3
3
|
//# sourceMappingURL=rdflib.min.js.map
|