rdflib 2.2.34 → 2.2.35
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/515.rdflib.min.js +3 -0
- package/dist/515.rdflib.min.js.map +1 -0
- package/dist/789.rdflib.min.js +1 -0
- package/dist/rdflib.min.js +1 -1
- package/dist/rdflib.min.js.map +1 -1
- package/esm/blank-node.js +10 -13
- package/esm/collection.js +12 -15
- package/esm/default-graph.js +9 -12
- package/esm/empty.js +7 -10
- package/esm/factories/canonical-data-factory.js +1 -2
- package/esm/factories/extended-term-factory.js +3 -4
- package/esm/factories/rdflib-data-factory.js +2 -2
- package/esm/fetcher.js +34 -53
- package/esm/formula.js +12 -15
- package/esm/index.js +12 -15
- package/esm/lists.js +3 -0
- package/esm/literal.js +11 -14
- package/esm/n3parser.js +1 -6
- package/esm/named-node.js +8 -11
- package/esm/node-internal.js +1 -2
- package/esm/node.js +0 -1
- package/esm/patch-parser.js +0 -1
- package/esm/query.js +0 -14
- package/esm/rdfaparser.js +1 -6
- package/esm/rdfxmlparser.js +3 -4
- package/esm/serialize.js +0 -1
- package/esm/serializer.js +1 -14
- package/esm/sparql-to-query.js +0 -2
- package/esm/statement.js +1 -2
- package/esm/store.js +25 -32
- package/esm/types.js +5 -0
- package/esm/update-manager.js +3 -8
- package/esm/updates-via.js +2 -4
- package/esm/utils-js.js +0 -1
- package/esm/utils.js +1 -0
- package/esm/variable.js +11 -14
- package/lib/blank-node.js +11 -15
- package/lib/class-order.js +1 -2
- package/lib/collection.js +13 -17
- package/lib/default-graph.js +10 -14
- package/lib/empty.js +9 -13
- package/lib/factories/canonical-data-factory.js +2 -4
- package/lib/factories/extended-term-factory.js +4 -6
- package/lib/factories/factory-types.js +2 -3
- package/lib/factories/rdflib-data-factory.js +3 -4
- package/lib/fetcher.js +60 -80
- package/lib/formula.js +14 -18
- package/lib/index.js +30 -49
- package/lib/jsonldparser.js +2 -2
- package/lib/jsonparser.js +2 -3
- package/lib/lists.js +1 -1
- package/lib/literal.js +13 -17
- package/lib/log.js +1 -2
- package/lib/n3parser.js +5 -12
- package/lib/named-node.js +10 -14
- package/lib/node-internal.js +2 -4
- package/lib/node.js +1 -3
- package/lib/parse.js +2 -2
- package/lib/patch-parser.js +0 -1
- package/lib/query.js +1 -16
- package/lib/rdfaparser.js +5 -12
- package/lib/rdfxmlparser.js +6 -8
- package/lib/serialize.js +0 -1
- package/lib/serializer.js +4 -18
- package/lib/sparql-to-query.js +0 -2
- package/lib/statement.js +5 -7
- package/lib/store.js +42 -49
- package/lib/types.js +22 -43
- package/lib/update-manager.js +12 -18
- package/lib/updates-via.js +5 -9
- package/lib/utils/default-graph-uri.js +2 -4
- package/lib/utils-js.js +6 -7
- package/lib/utils.js +1 -2
- package/lib/variable.js +15 -19
- package/lib/xsd-internal.js +2 -3
- package/lib/xsd.js +1 -2
- package/package.json +31 -31
- package/src/rdfxmlparser.js +2 -1
- package/dist/670.rdflib.min.js +0 -1
- package/dist/730.rdflib.min.js +0 -3
- package/dist/730.rdflib.min.js.map +0 -1
- /package/dist/{730.rdflib.min.js.LICENSE.txt → 515.rdflib.min.js.LICENSE.txt} +0 -0
package/dist/rdflib.min.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see rdflib.min.js.LICENSE.txt */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("window")):"function"==typeof define&&define.amd?define(["window"],e):"object"==typeof exports?exports.$rdf=e(require("window")):t.$rdf=e(t.window)}(self,(t=>(()=>{var e,r,n,i,o={8333:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},7308:(t,e,r)=>{"use strict";r.d(e,{Z:()=>n});const n={debug:function(t){},warn:function(t){},info:function(t){},error:function(t){},success:function(t){},msg:function(t){}}},6545:(t,e,r)=>{"use strict";r.d(e,{Z:()=>y});var n=r(7061),i=r(9900),o=r(4771),a=r(4768),s=r(4593),u=r(886),c=r(240),l=r(8333),h=r(4806),f=r(9247),p=r(2598),d=r(5904);var y=function(t){(0,a.Z)(y,t);var e,r,h=(e=y,r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,n=(0,u.Z)(e);if(r){var i=(0,u.Z)(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return(0,s.Z)(this,t)});function y(t){var e;if((0,n.Z)(this,y),e=h.call(this,(0,p._)(t)),(0,c.Z)((0,o.Z)(e),"termType",f.XM),(0,c.Z)((0,o.Z)(e),"classOrder",l.Z.NamedNode),!e.value)throw new Error("Missing IRI for NamedNode");if(!e.value.includes(":"))throw new Error('NamedNode IRI "'+t+'" must be absolute.');if(e.value.includes(" "))throw new Error('Error: NamedNode IRI "'+t+'" must not contain unencoded spaces.');return e}return(0,i.Z)(y,[{key:"dir",value:function(){var t=this.value.split("#")[0],e=t.slice(0,-1).lastIndexOf("/"),r=t.indexOf("//");return r>=0&&e<r+2||e<0?null:new y(t.slice(0,e+1))}},{key:"site",value:function(){var t=this.value.split("#")[0],e=t.indexOf("//");if(e<0)throw new Error("This URI does not have a web site part (origin)");var r=t.indexOf("/",e+2);return new y(r<0?t.slice(0)+"/":t.slice(0,r+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new y(this.value.split("#")[0])}},{key:"toString",value:function(){return"<"+this.value+">"}},{key:"id",value:function(){return this.value.split("#")[1]}},{key:"uri",get:function(){return this.value},set:function(t){this.value=t}}],[{key:"fromValue",value:function(t){return null==t||(0,d.jt)(t)?t:new y(t)}}]),y}(h.Z)},4806:(t,e,r)=>{"use strict";r.d(e,{Z:()=>a});var n=r(7061),i=r(9900),o=r(240),a=function(){function t(e){(0,n.Z)(this,t),(0,o.Z)(this,"termType",void 0),(0,o.Z)(this,"classOrder",void 0),(0,o.Z)(this,"value",void 0),this.value=e}return(0,i.Z)(t,[{key:"substitute",value:function(t){return this}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.value<t.value?-1:this.value>t.value?1:0}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(t){return this.equals(t)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toNQ",value:function(){return this.toNT()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}]),t}();(0,o.Z)(a,"fromValue",void 0),(0,o.Z)(a,"toJS",void 0)},9247:(t,e,r)=>{"use strict";r.d(e,{D7:()=>T,Eo:()=>_,Is:()=>m,NK:()=>s,UH:()=>a,V1:()=>i,XM:()=>n,_A:()=>l,aV:()=>g,b4:()=>v,fb:()=>u,lL:()=>y,ls:()=>c,oW:()=>b,qS:()=>p,sZ:()=>d,ui:()=>f,us:()=>h,xH:()=>o,xm:()=>w,z8:()=>x});var n="NamedNode",i="BlankNode",o="Literal",a="Variable",s="DefaultGraph",u="Collection",c="Empty",l="Graph",h="text/html",f="application/ld+json",p="text/n3",d="application/n3",y="application/nquads",v="application/n-quads",g="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:(t,e,r)=>{"use strict";r.r(e),r.d(e,{docpart:()=>a,document:()=>s,hostpart:()=>u,join:()=>c,protocol:()=>l,refTo:()=>h});var n=r(6545),i=r(292),o=o||i.log;function a(t){var e;return(e=t.indexOf("#"))<0?t:t.slice(0,e)}function s(t){return new n.Z(a(t))}function u(t){var e=/[^\/]*\/\/([^\/]*)\//.exec(t);return e?e[1]:""}function c(t,e){var r,n,i,a,s,u=e.indexOf("#");if(u>0&&(e=e.slice(0,u)),0===t.length)return e;if(0===t.indexOf("#"))return e+t;if(t.indexOf(":")>=0)return t;if(r=e.indexOf(":"),0===e.length)return t;if(r<0)return o("Invalid base: "+e+" in join with given: "+t),t;if(n=e.slice(0,+r+1||9e9),0===t.indexOf("//"))return n+t;if(e.indexOf("//",r)===r+1){if((i=e.indexOf("/",r+3))<0)return e.length-r-3>0?e+"/"+t:n+t}else if((i=e.indexOf("/",r+1))<0)return e.length-r-1>0?e+"/"+t:n+t;if(0===t.indexOf("/"))return e.slice(0,i)+t;if((a=(s=e.slice(i)).lastIndexOf("/"))<0)return n+t;for(a>=0&&a<s.length-1&&(s=s.slice(0,+a+1||9e9)),s+=t;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),e.slice(0,i)+s}function l(t){var e=t.indexOf(":");return e<0?null:t.slice(0,e)}function h(t,e){var r,n,i,o,a,s,u,c,l,h,f,p,d=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!t)return e;if(t===e)return"";for(r=u=0,o=e.length;u<o&&e[r]===t[r];r=++u);if(t.slice(0,r).match(d)&&((n=e.indexOf("//"))<0&&(n=-2),i=e.indexOf("/",n+2),"/"!==e[i+1]&&"/"!==t[i+1]&&e.slice(0,i)===t.slice(0,i)))return e.slice(i);if("#"===e[r]&&t.length===r)return e.slice(r);for(;r>0&&"/"!==e[r-1];)r--;if(r<3)return e;if(t.indexOf("//",r-2)>0||e.indexOf("//",r-2)>0)return e;if(t.indexOf(":",r)>0)return e;for(s=0,c=0,a=(h=t.slice(r)).length;c<a;c++)"/"===h[c]&&s++;if(0===s&&r<e.length&&"#"===e[r])return"./"+e.slice(r);if(0===s&&r===e.length)return"./";if(p="",s>0)for(l=1,f=s;f>=1?l<=f:l>=f;f>=1?++l:--l)p+="../";return p+e.slice(r)}},5115:(t,e,r)=>{"use strict";r.r(e),r.d(e,{DOMParserFactory:()=>f,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>p,dtstamp:()=>y,dumpNode:()=>d,heavyCompare:()=>v,heavyCompareSPO:()=>g,linkRelationProperty:()=>l,log:()=>n.Z,mediaTypeClass:()=>c,output:()=>m,parseXML:()=>b,stackString:()=>_,string:()=>u,string_startswith:()=>x,uri:()=>i});var n=r(7308),i=r(3357),o=r(6545),a=r(870);t=r.hmd(t);var s=r(292),u={template:function(t,e){for(var r=t.split("%s"),n="",i=0;i<e.length;i++)e[i]+="",n+=r[i]+e[i];return n+r.slice(e.length).join()}};function c(t){return t=t.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+t+"#Resource")}function l(t){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+t.trim())}function h(t,e){t.callbacks={};for(var r=e.length-1;r>=0;r--)t.callbacks[e[r]]=[];t.addHook=function(e){t.callbacks[e]||(t.callbacks[e]=[])},t.addCallback=function(e,r){t.callbacks[e].push(r)},t.removeCallback=function(e,r){for(var n=0;n<t.callbacks[e].length;n++)if(t.callbacks[e][n].name===r)return t.callbacks[e].splice(n,1),!0;return!1},t.insertCallback=function(e,r){t.callbacks[e].unshift(r)},t.fireCallbacks=function(e,r){var n,i,o=[],a=[],s=t.callbacks[e].length;for(n=s-1;n>=0;n--)(i=t.callbacks[e][n])&&i.apply(t,r)&&o.push(i);for(n=o.length-1;n>=0;n--)a.push(o[n]);for(n=s;n<t.callbacks[e].length;n++)a.push(t.callbacks[e][n]);t.callbacks[e]=a}}function f(){return window.DOMParser?new a.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(t,e){var r=[];(e=e||{})&&e.selfClosing&&e.selfClosing.split(" ").forEach((function(t){r[t]=!0}));var n=[];return e&&e.skipAttributes&&e.skipAttributes.split(" ").forEach((function(t){n[t]=!0})),d(t,e,r,n)}function d(t,e,r,n){var i,o="",a=[!1];if(void 0===t.nodeType)return o;if(1===t.nodeType){if(t.hasAttribute("class")&&e&&e.classWithChildText&&t.matches(e.classWithChildText.class))o+=t.querySelector(e.classWithChildText.element).textContent;else if(!(e&&e.skipNodeWithClass&&t.matches("."+e.skipNodeWithClass))){var u=t.nodeName.toLowerCase();o+="<"+u;var c=[];for(i=t.attributes.length-1;i>=0;i--){var l=t.attributes[i];if(!(n&&n.length>0&&n[l.name]||/^\d+$/.test(l.name))){if("class"===l.name&&e&&e.replaceClassItemWith&&l.value.split(" ").indexOf(e.replaceClassItemWith.source)>-1){var h=new RegExp(e.replaceClassItemWith.source,"g");l.value=l.value.replace(h,e.replaceClassItemWith.target).trim()}"class"===l.name&&e&&e.skipClassWithValue&&e.skipClassWithValue===l.value||c.push(l.name+"='"+l.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,""")+"'")}}if(c.length>0&&(e&&e.sortAttributes&&c.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),o+=" "+c.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===u?"\n ":"",a.push("style"===u||"script"===u),i=0;i<t.childNodes.length;i++)o+=d(t.childNodes[i]);a.pop(),o+="body"===u?"</"+u+">\n":"</"+u+">"}}}else if(8===t.nodeType)o+="\x3c!--"+t.nodeValue+"--\x3e";else if(3===t.nodeType||4===t.nodeType){var f=t.nodeValue.replace(/\n+$/,"");o+=a[a.length-1]?f:f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}else s.log("Warning; Cannot handle serialising nodes of type: "+t.nodeType),s.log(t);return o}function y(){var t=new Date,e=t.getYear()+1900,r=t.getMonth()+1,n=t.getDate(),i=t.getUTCHours(),o=t.getUTCMinutes(),a=t.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),a<10&&(a="0"+a),e+"-"+r+"-"+n+"T"+i+":"+o+":"+a+"Z"}function v(t,e,r,n){var i=function(t){return"BlankNode"===t.termType?null:t},o=function(t){var e=r.statementsMatching(t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})).concat(r.statementsMatching(void 0,void 0,t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})));return e.sort(),e.join("\n")},a=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(t,e):t.compareTerm(e);return"BlankNode"===t.termType&&"BlankNode"===e.termType?0===a?0:o(t)>o(e)?1:o(t)<o(e)?-1:a:n&&t.uri&&e.uri?(n[t.uri]||t.uri).localeCompare(n[e.uri]||e.uri):a}function g(t,e,r,n){return v(t.subject,e.subject,r,n)||v(t.predicate,e.predicate,r,n)||v(t.object,e.object,r,n)}function m(t){var e=document.createElement("div");e.textContent=t,document.body.appendChild(e)}function b(e,r){return r=r||{},t&&t.exports?(new a.DOMParser).parseFromString(e,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new a.DOMParser).parseFromString(e,"application/xml")}function w(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.why))return void t.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+e+" "+e.why)}function x(t,e){return t.slice(0,e.length)===e}function _(t){var e=t+"\n";if(!t.stack)return e+"No stack available.\n";for(var r=t.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 a=o.split("@");n.push(a)}for(i=0;i<n.length;i++)e+=" "+n[i][1]+"\n "+n[i][0];return e}},2598:(t,e,r)=>{"use strict";function n(t){return"string"==typeof t?t:t.value}r.d(e,{_:()=>n})},5904:(t,e,r)=>{"use strict";r.d(e,{B2:()=>v,NA:()=>w,NX:()=>y,PY:()=>d,Pv:()=>a,Uc:()=>u,Yi:()=>o,cG:()=>h,f:()=>c,jt:()=>f,lt:()=>b,lx:()=>m,n_:()=>p,nq:()=>l,uZ:()=>s,zz:()=>g});var n=r(7209),i=r(9247);function o(t){return"object"===(0,n.Z)(t)&&null!==t&&"subject"in t}function a(t){return"object"===(0,n.Z)(t)&&null!==t&&"statements"in t}function s(t){return f(t)&&t.termType===i.fb}function u(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1||t.termType===i.fb||t.termType===i.xH||t.termType===i._A)}function c(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1||t.termType===i.fb||t.termType===i.xH||t.termType===i._A)}function l(t){return f(t)&&(t.termType===i.XM||t.termType===i.V1||t.termType===i.UH)}function h(t){return f(t)&&t.termType===i.UH}function f(t){return"object"===(0,n.Z)(t)&&null!==t&&"termType"in t}function p(t){return t.termType===i.xH}function d(t){return"object"===(0,n.Z)(t)&&null!==t&&"subject"in t&&"predicate"in t&&"object"in t}function y(t){return f(t)&&"NamedNode"===t.termType}function v(t){return f(t)&&"termType"in t&&"BlankNode"===t.termType}function g(t){return f(t)&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1)}function m(t){return f(t)&&(t.termType===i.XM||t.termType===i.UH)}function b(t){return f(t)&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1||t.termType===i.xH)}function w(t){return f(t)&&(t.termType===i.XM||t.termType===i.UH||t.termType===i.V1||t.termType===i.NK)}},5619:function(t,e,r){var n,i;void 0===(i="function"==typeof(n=function(){"use strict";function t(e,r,n,i){this.message=e,this.expected=r,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),t.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e,r="";for(e=0;e<t.parts.length;e++)r+=t.parts[e]instanceof Array?o(t.parts[e][0])+"-"+o(t.parts[e][1]):o(t.parts[e]);return"["+(t.inverted?"^":"")+r+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}return"Expected "+function(t){var e,n,i,o=new Array(t.length);for(e=0;e<t.length;e++)o[e]=(i=t[e],r[i.type](i));if(o.sort(),o.length>0){for(e=1,n=1;e<o.length;e++)o[e-1]!==o[e]&&(o[n]=o[e],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."},{SyntaxError:t,parse:function(e,n){n=void 0!==n?n:{};var i,o={},a={turtleDoc:Vr},s=Vr,u=function(t){var e=Tn.toJSON();return e["@graph"]=[],t.filter((t=>Array.isArray(t))).forEach((t=>{t.forEach((t=>{e["@graph"].push(t)}))})),1===e["@graph"].length&&(Object.assign(e,e["@graph"][0]),delete e["@graph"]),e},c=".",l=qr(".",!1),h=function(t){return t},f="#",p=qr("#",!1),d=/^[^\n]/,y=Hr(["\n"],!0,!1),v="\n",g=qr("\n",!1),m=function(t){return t.join("")},b="@prefix",w=qr("@prefix",!1),x=function(t,e){return Tn.addPrefix(""===t?"0":t,e),{}},_="@base",T=qr("@base",!1),k=function(t){return Tn.addBase(t),{}},A=/^[Bb]/,O=Hr(["B","b"],!1,!1),E=/^[Aa]/,j=Hr(["A","a"],!1,!1),N=/^[Ss]/,S=Hr(["S","s"],!1,!1),R=/^[Ee]/,I=Hr(["E","e"],!1,!1),C=/^[Pp]/,P=Hr(["P","p"],!1,!1),F=/^[Rr]/,U=Hr(["R","r"],!1,!1),L=/^[Ff]/,D=Hr(["F","f"],!1,!1),M=/^[Ii]/,Z=Hr(["I","i"],!1,!1),B=/^[Xx]/,q=Hr(["X","x"],!1,!1),H=function(t,e){var r={};return"string"==typeof t&&"[]"!==t?r["@id"]=t:"object"==typeof t&&Object.assign(r,t),e&&Object.assign(r,e),[r]},$=function(t,e){var r={};return t&&Object.assign(r,t),e&&Object.assign(r,e),[r]},z=";",X=qr(";",!1),V=function(t,e,r,n){var i={};return i[r]=n,i},G=function(t,e,r){return r},W=function(t,e,r){var n={};return r.unshift(function(t,e){var r={};return r[t]=e,r}(t,e)),r.forEach((t=>{t&&Object.keys(t).forEach((e=>{t[e].forEach((t=>{"@type"===e&&void 0!==t["@id"]&&(t=t["@id"]),void 0===n[e]?n[e]=t:Array.isArray(n[e])?n[e].push(t):n[e]=[n[e],t]}))}))})),n},Q=",",Y=qr(",",!1),J=function(t,e){return e},K=function(t,e){return e.unshift(t),e},tt="a",et=qr("a",!1),rt=function(){return"@type"},nt=function(t){return kn(t,!0)},it=function(t){return kn(t,!1)},ot=function(t){return"[]"===t?{}:{"@id":t}},at=function(t){return{"@id":t}},st="[",ut=qr("[",!1),ct="]",lt=qr("]",!1),ht="(",ft=qr("(",!1),pt=")",dt=qr(")",!1),yt=function(t){return{"@list":t}},vt=function(t,e){return{"@value":t,"@language":e}},gt="^^",mt=qr("^^",!1),bt=function(t,e){if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"true"===t)return!0;if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"false"===t)return!1;if("http://www.w3.org/2001/XMLSchema#integer"===e)return parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===e)return parseFloat(t);const r=Tn.resolve(e,!0);if(r){const n=e.split(":")[0];if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"true"===t)return Tn.decrement(n),!0;if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"false"===t)return Tn.decrement(n),!1;if("http://www.w3.org/2001/XMLSchema#integer"===r)return Tn.decrement(n),parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===r)return Tn.decrement(n),parseFloat(t)}return{"@value":t,"@type":e}},wt="true",xt=qr("true",!1),_t=function(){return!0},Tt="false",kt=qr("false",!1),At=function(){return!1},Ot=function(t){return t+":"},Et="<",jt=qr("<",!1),Nt=/^[^\0- <>"{}|\^`\\]/,St=Hr([["\0"," "],"<",">",'"',"{","}","|","^","`","\\"],!0,!1),Rt=">",It=qr(">",!1),Ct=function(t){const e=t.map((t=>65536<=t.codePointAt(0)&&t.codePointAt(0)<=983039?"a":1===t.length?t:6===t.length?String.fromCharCode("0x"+t.substring(2)):10===t.length?String.fromCodePoint("0x"+t.substring(2)):t)).join("");if(e.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)){var r=t.join("");try{return Tn.resolve(r)}catch(t){Br("Invalid IRIREF "+r)}}else Br("Invalid IRIREF "+t.join("")+" / "+e)},Pt=":",Ft=qr(":",!1),Ut=function(t){return t=t||"0",!1===Tn.hasPrefix(t)&&Br("undefined prefix "+t),t},Lt=function(t){return t||""},Dt=function(t,e){return Tn.increment(t),Tn.resolve(t+":"+e)},Mt="_:",Zt=qr("_:",!1),Bt=/^[0-9]/,qt=Hr([["0","9"]],!1,!1),Ht="@",$t=qr("@",!1),zt=/^[a-zA-Z]/,Xt=Hr([["a","z"],["A","Z"]],!1,!1),Vt="-",Gt=qr("-",!1),Wt=/^[a-zA-Z0-9]/,Qt=Hr([["a","z"],["A","Z"],["0","9"]],!1,!1),Yt=function(t,e){return"-"+e.join("")},Jt=function(t,e){return t.join("")+e.join("")},Kt=/^[+\-]/,te=Hr(["+","-"],!1,!1),ee=function(t){return t.match(/^[0+][0-9]+$/)?{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#integer"}:parseInt(t)},re=function(t){return{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#decimal"}},ne=function(t){return{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#double"}},ie=/^[eE]/,oe=Hr(["e","E"],!1,!1),ae='"',se=qr('"',!1),ue=/^[^"\\\n\r]/,ce=Hr(['"',"\\","\n","\r"],!0,!1),le="'",he=qr("'",!1),fe=/^[^'\\\n\r]/,pe=Hr(["'","\\","\n","\r"],!0,!1),de="'''",ye=qr("'''",!1),ve=/^[^'\\]/,ge=Hr(["'","\\"],!0,!1),me="''",be=qr("''",!1),we=function(t,e){return"''"+e.join("")},xe=function(t,e){return"'"+e.join("")},_e=function(t,e){return t.join("")+e.join("")},Te='"""',ke=qr('"""',!1),Ae=/^[^"\\]/,Oe=Hr(['"',"\\"],!0,!1),Ee='""',je=qr('""',!1),Ne=function(t,e){return'""'+e.join("")},Se=function(t,e){return'"'+e.join("")},Re="\\U",Ie=qr("\\U",!1),Ce=function(t){return String.fromCodePoint(parseInt(t.join(""),16))},Pe="\\u",Fe=qr("\\u",!1),Ue=function(t){return String.fromCharCode(parseInt(t.join(""),16))},Le="\\t",De=qr("\\t",!1),Me=function(){return"\t"},Ze="\\b",Be=qr("\\b",!1),qe=function(){return"\b"},He="\\n",$e=qr("\\n",!1),ze=function(){return"\n"},Xe="\\r",Ve=qr("\\r",!1),Ge=function(){return"\r"},We="\\f",Qe=qr("\\f",!1),Ye=function(){return"\f"},Je='\\"',Ke=qr('\\"',!1),tr=function(){return'"'},er="\\'",rr=qr("\\'",!1),nr=function(){return"'"},ir="\\\\",or=qr("\\\\",!1),ar=function(){return"\\"},sr=/^[ \t\r\n]/,ur=Hr([" ","\t","\r","\n"],!1,!1),cr=function(){return"[]"},lr=/^[\uD800-\uDBFF]/,hr=Hr([["\ud800","\udbff"]],!1,!1),fr=/^[\uDC00-\uDFFF]/,pr=Hr([["\udc00","\udfff"]],!1,!1),dr=function(t,e){return t+e},yr=/^[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]/,vr=Hr([["A","Z"],["a","z"],["À","Ö"],["Ø","ö"],["ø","˿"],["Ͱ","ͽ"],["Ϳ",""],["",""],["⁰",""],["Ⰰ",""],["、",""],["豈","﷏"],["ﷰ","�"]],!1,!1),gr="_",mr=qr("_",!1),br="·",wr=qr("·",!1),xr=/^[\u0300-\u036F]/,_r=Hr([["̀","ͯ"]],!1,!1),Tr=/^[\u203F-\u2040]/,kr=Hr([["‿","⁀"]],!1,!1),Ar=function(t,e,r,n){return r.join("")+n.join("")},Or=function(t,e,r){return t+e.join("")+r.join("")},Er="%",jr=qr("%",!1),Nr=/^[0-9A-Fa-f]/,Sr=Hr([["0","9"],["A","F"],["a","f"]],!1,!1),Rr="\\",Ir=qr("\\",!1),Cr=/^[_~.!$&'()*+,;=\/?#@%\-]/,Pr=Hr(["_","~",".","!","$","&","'","(",")","*","+",",",";","=","/","?","#","@","%","-"],!1,!1),Fr=0,Ur=0,Lr=[{line:1,column:1}],Dr=0,Mr=[],Zr=0;if("startRule"in n){if(!(n.startRule in a))throw new Error("Can't start parsing from rule \""+n.startRule+'".');s=a[n.startRule]}function Br(e,r){throw function(e,r){return new t(e,null,null,r)}(e,r=void 0!==r?r:zr(Ur,Fr))}function qr(t,e){return{type:"literal",text:t,ignoreCase:e}}function Hr(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function $r(t){var r,n=Lr[t];if(n)return n;for(r=t-1;!Lr[r];)r--;for(n={line:(n=Lr[r]).line,column:n.column};r<t;)10===e.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Lr[t]=n,n}function zr(t,e){var r=$r(t),n=$r(e);return{start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Xr(t){Fr<Dr||(Fr>Dr&&(Dr=Fr,Mr=[]),Mr.push(t))}function Vr(){var t,e,r,n;for(t=Fr,e=[],r=Gr();r!==o;)e.push(r),r=Gr();if(e!==o){for(r=[],n=Wr();n!==o;)r.push(n),n=Wr();r!==o?(Ur=t,t=e=u(e)):(Fr=t,t=o)}else Fr=t,t=o;return t}function Gr(){var t,r,n,i;if((t=function(){var t;return(t=function(){var t,r,n,i,a,s,u,h,f;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o)if(e.substr(Fr,7)===b?(n=b,Fr+=7):(n=o,0===Zr&&Xr(w)),n!==o){for(i=[],a=Wr();a!==o;)i.push(a),a=Wr();if(i!==o)if((a=un())!==o){for(s=[],u=Wr();u!==o;)s.push(u),u=Wr();if(s!==o)if((u=an())!==o){for(h=[],f=Wr();f!==o;)h.push(f),f=Wr();h!==o?(46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Zr&&Xr(l)),f!==o?(Ur=t,t=r=x(a,u)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;return t}())===o&&(t=function(){var t,r,n,i,a,s,u;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o)if(e.substr(Fr,5)===_?(n=_,Fr+=5):(n=o,0===Zr&&Xr(T)),n!==o){for(i=[],a=Wr();a!==o;)i.push(a),a=Wr();if(i!==o)if((a=an())!==o){for(s=[],u=Wr();u!==o;)s.push(u),u=Wr();s!==o?(46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Zr&&Xr(l)),u!==o?(Ur=t,t=r=k(a)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;return t}())===o&&(t=function(){var t,r,n,i,a,s,u,c,l,h,f,p;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o)if(C.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Zr&&Xr(P)),n!==o)if(F.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(U)),i!==o)if(R.test(e.charAt(Fr))?(a=e.charAt(Fr),Fr++):(a=o,0===Zr&&Xr(I)),a!==o)if(L.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Zr&&Xr(D)),s!==o)if(M.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Zr&&Xr(Z)),u!==o)if(B.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(q)),c!==o){for(l=[],h=Wr();h!==o;)l.push(h),h=Wr();if(l!==o)if((h=un())!==o){for(f=[],p=Wr();p!==o;)f.push(p),p=Wr();f!==o&&(p=an())!==o?(Ur=t,t=r=x(h,p)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;return t}())===o&&(t=function(){var t,r,n,i,a,s,u,c;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o)if(A.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Zr&&Xr(O)),n!==o)if(E.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(j)),i!==o)if(N.test(e.charAt(Fr))?(a=e.charAt(Fr),Fr++):(a=o,0===Zr&&Xr(S)),a!==o)if(R.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Zr&&Xr(I)),s!==o){for(u=[],c=Wr();c!==o;)u.push(c),c=Wr();u!==o&&(c=an())!==o?(Ur=t,t=r=k(c)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;return t}()),t}())===o)if(t=Fr,(r=function(){var t,e,r;return t=Fr,(e=function(){var t,e;return t=Fr,(e=en())!==o&&(Ur=t,e=nt(e)),(t=e)===o&&(t=on())===o&&(t=nn()),t}())!==o&&(r=Qr())!==o?(Ur=t,t=e=H(e,r)):(Fr=t,t=o),t===o&&(t=Fr,(e=tn())!==o?((r=Qr())===o&&(r=null),r!==o?(Ur=t,t=e=$(e,r)):(Fr=t,t=o)):(Fr=t,t=o)),t}())!==o){for(n=[],i=Wr();i!==o;)n.push(i),i=Wr();n!==o?(46===e.charCodeAt(Fr)?(i=c,Fr++):(i=o,0===Zr&&Xr(l)),i!==o?(Ur=t,t=r=h(r)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}function Wr(){var t;return(t=function(){var t;return sr.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Zr&&Xr(ur)),t}())===o&&(t=function(){var t,r,n,i;if(t=Fr,35===e.charCodeAt(Fr)?(r=f,Fr++):(r=o,0===Zr&&Xr(p)),r!==o){for(n=[],d.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(y));i!==o;)n.push(i),d.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(y));n!==o?(10===e.charCodeAt(Fr)?(i=v,Fr++):(i=o,0===Zr&&Xr(g)),i!==o?(Ur=t,t=r=m(n)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}()),t}function Qr(){var t,r,n,i,a,s,u,c,l,h;if(t=Fr,(r=Jr())!==o)if((n=Yr())!==o){for(i=[],a=Fr,s=[],u=Wr();u!==o;)s.push(u),u=Wr();for(s!==o?(59===e.charCodeAt(Fr)?(u=z,Fr++):(u=o,0===Zr&&Xr(X)),u!==o?(c=Fr,(l=Jr())!==o&&(h=Yr())!==o?(Ur=c,c=l=V(r,n,l,h)):(Fr=c,c=o),c===o&&(c=null),c!==o?(Ur=a,a=s=G(r,n,c)):(Fr=a,a=o)):(Fr=a,a=o)):(Fr=a,a=o);a!==o;){for(i.push(a),a=Fr,s=[],u=Wr();u!==o;)s.push(u),u=Wr();s!==o?(59===e.charCodeAt(Fr)?(u=z,Fr++):(u=o,0===Zr&&Xr(X)),u!==o?(c=Fr,(l=Jr())!==o&&(h=Yr())!==o?(Ur=c,c=l=V(r,n,l,h)):(Fr=c,c=o),c===o&&(c=null),c!==o?(Ur=a,a=s=G(r,n,c)):(Fr=a,a=o)):(Fr=a,a=o)):(Fr=a,a=o)}i!==o?(Ur=t,t=r=W(r,n,i)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o;return t}function Yr(){var t,r,n,i,a,s,u;if(t=Fr,(r=Kr())!==o){for(n=[],i=Fr,a=[],s=Wr();s!==o;)a.push(s),s=Wr();for(a!==o?(44===e.charCodeAt(Fr)?(s=Q,Fr++):(s=o,0===Zr&&Xr(Y)),s!==o&&(u=Kr())!==o?(Ur=i,i=a=J(r,u)):(Fr=i,i=o)):(Fr=i,i=o);i!==o;){for(n.push(i),i=Fr,a=[],s=Wr();s!==o;)a.push(s),s=Wr();a!==o?(44===e.charCodeAt(Fr)?(s=Q,Fr++):(s=o,0===Zr&&Xr(Y)),s!==o&&(u=Kr())!==o?(Ur=i,i=a=J(r,u)):(Fr=i,i=o)):(Fr=i,i=o)}n!==o?(Ur=t,t=r=K(r,n)):(Fr=t,t=o)}else Fr=t,t=o;return t}function Jr(){var t,r,n;if(t=Fr,(r=function(){var t,e,r;for(t=Fr,e=[],r=Wr();r!==o;)e.push(r),r=Wr();return e!==o&&(r=nn())!==o?(Ur=t,t=e=h(r)):(Fr=t,t=o),t}())!==o&&(Ur=t,r=h(r)),(t=r)===o){for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();r!==o?(97===e.charCodeAt(Fr)?(n=tt,Fr++):(n=o,0===Zr&&Xr(et)),n!==o?(Ur=t,t=r=rt()):(Fr=t,t=o)):(Fr=t,t=o)}return t}function Kr(){var t,r;return(t=function(){var t;return(t=function(){var t,r,n,i,a,s,u;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o)if((n=rn())!==o){for(i=[],a=Wr();a!==o;)i.push(a),a=Wr();i!==o&&(a=function(){var t,r,n,i,a,s,u,c;if(t=Fr,64===e.charCodeAt(Fr)?(r=Ht,Fr++):(r=o,0===Zr&&Xr($t)),r!==o){if(n=[],zt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(Xt)),i!==o)for(;i!==o;)n.push(i),zt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(Xt));else n=o;if(n!==o){if(i=[],a=Fr,45===e.charCodeAt(Fr)?(s=Vt,Fr++):(s=o,0===Zr&&Xr(Gt)),s!==o){if(u=[],Wt.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Qt)),c!==o)for(;c!==o;)u.push(c),Wt.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Qt));else u=o;u!==o?(Ur=a,a=s=Yt(n,u)):(Fr=a,a=o)}else Fr=a,a=o;for(;a!==o;)if(i.push(a),a=Fr,45===e.charCodeAt(Fr)?(s=Vt,Fr++):(s=o,0===Zr&&Xr(Gt)),s!==o){if(u=[],Wt.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Qt)),c!==o)for(;c!==o;)u.push(c),Wt.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Qt));else u=o;u!==o?(Ur=a,a=s=Yt(n,u)):(Fr=a,a=o)}else Fr=a,a=o;i!==o?(Ur=t,t=r=Jt(n,i)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;return t}())!==o?(Ur=t,t=r=vt(n,a)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o;if(t===o){for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o)if((n=rn())!==o){for(i=[],a=Wr();a!==o;)i.push(a),a=Wr();if(i!==o)if(e.substr(Fr,2)===gt?(a=gt,Fr+=2):(a=o,0===Zr&&Xr(mt)),a!==o){for(s=[],u=Wr();u!==o;)s.push(u),u=Wr();s!==o&&(u=nn())!==o?(Ur=t,t=r=bt(n,u)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;if(t===o){for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();r!==o&&(n=rn())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)}}return t}())===o&&(t=function(){var t,r,n;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();return r!==o?((n=function(){var t,r,n,i,a,s,u,h,f;if(t=Fr,r=Fr,n=Fr,Kt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(te)),i===o&&(i=null),i!==o){if(a=Fr,s=[],Bt.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Zr&&Xr(qt)),u!==o)for(;u!==o;)s.push(u),Bt.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Zr&&Xr(qt));else s=o;if(s!==o)if(46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Zr&&Xr(l)),u!==o){for(h=[],Bt.test(e.charAt(Fr))?(f=e.charAt(Fr),Fr++):(f=o,0===Zr&&Xr(qt));f!==o;)h.push(f),Bt.test(e.charAt(Fr))?(f=e.charAt(Fr),Fr++):(f=o,0===Zr&&Xr(qt));h!==o&&(f=cn())!==o?a=s=[s,u,h,f]:(Fr=a,a=o)}else Fr=a,a=o;else Fr=a,a=o;if(a===o){if(a=Fr,46===e.charCodeAt(Fr)?(s=c,Fr++):(s=o,0===Zr&&Xr(l)),s!==o){if(u=[],Bt.test(e.charAt(Fr))?(h=e.charAt(Fr),Fr++):(h=o,0===Zr&&Xr(qt)),h!==o)for(;h!==o;)u.push(h),Bt.test(e.charAt(Fr))?(h=e.charAt(Fr),Fr++):(h=o,0===Zr&&Xr(qt));else u=o;u!==o&&(h=cn())!==o?a=s=[s,u,h]:(Fr=a,a=o)}else Fr=a,a=o;if(a===o){if(a=Fr,s=[],Bt.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Zr&&Xr(qt)),u!==o)for(;u!==o;)s.push(u),Bt.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Zr&&Xr(qt));else s=o;s!==o&&(u=cn())!==o?a=s=[s,u]:(Fr=a,a=o)}}a!==o?n=i=[i,a]:(Fr=n,n=o)}else Fr=n,n=o;return(r=n!==o?e.substring(r,Fr):n)!==o&&(Ur=t,r=ne(r)),r}())===o&&(n=function(){var t,r,n,i,a,s,u,h;if(t=Fr,r=Fr,n=Fr,Kt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(te)),i===o&&(i=null),i!==o){for(a=[],Bt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Zr&&Xr(qt));s!==o;)a.push(s),Bt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Zr&&Xr(qt));if(a!==o)if(46===e.charCodeAt(Fr)?(s=c,Fr++):(s=o,0===Zr&&Xr(l)),s!==o){if(u=[],Bt.test(e.charAt(Fr))?(h=e.charAt(Fr),Fr++):(h=o,0===Zr&&Xr(qt)),h!==o)for(;h!==o;)u.push(h),Bt.test(e.charAt(Fr))?(h=e.charAt(Fr),Fr++):(h=o,0===Zr&&Xr(qt));else u=o;u!==o?n=i=[i,a,s,u]:(Fr=n,n=o)}else Fr=n,n=o;else Fr=n,n=o}else Fr=n,n=o;return(r=n!==o?e.substring(r,Fr):n)!==o&&(Ur=t,r=re(r)),r}())===o&&(n=function(){var t,r,n,i,a,s;if(t=Fr,r=Fr,n=Fr,Kt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(te)),i===o&&(i=null),i!==o){if(a=[],Bt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Zr&&Xr(qt)),s!==o)for(;s!==o;)a.push(s),Bt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Zr&&Xr(qt));else a=o;a!==o?n=i=[i,a]:(Fr=n,n=o)}else Fr=n,n=o;return(r=n!==o?e.substring(r,Fr):n)!==o&&(Ur=t,r=ee(r)),r}()),n!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)):(Fr=t,t=o),t}())===o&&(t=function(){var t,r,n;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o?(e.substr(Fr,4)===wt?(n=wt,Fr+=4):(n=o,0===Zr&&Xr(xt)),n!==o?(Ur=t,t=r=_t()):(Fr=t,t=o)):(Fr=t,t=o),t===o){for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();r!==o?(e.substr(Fr,5)===Tt?(n=Tt,Fr+=5):(n=o,0===Zr&&Xr(kt)),n!==o?(Ur=t,t=r=At()):(Fr=t,t=o)):(Fr=t,t=o)}return t}()),t}())===o&&(t=Fr,(r=en())!==o&&(Ur=t,r=it(r)),(t=r)===o&&(t=Fr,(r=on())!==o&&(Ur=t,r=ot(r)),(t=r)===o&&(t=Fr,(r=tn())!==o&&(Ur=t,r=h(r)),(t=r)===o&&(t=Fr,(r=nn())!==o&&(Ur=t,r=at(r)),t=r)))),t}function tn(){var t,r,n,i,a,s;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o)if(91===e.charCodeAt(Fr)?(n=st,Fr++):(n=o,0===Zr&&Xr(ut)),n!==o)if((i=Qr())!==o){for(a=[],s=Wr();s!==o;)a.push(s),s=Wr();a!==o?(93===e.charCodeAt(Fr)?(s=ct,Fr++):(s=o,0===Zr&&Xr(lt)),s!==o?(Ur=t,t=r=h(i)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;return t}function en(){var t,r,n,i,a,s;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o)if(40===e.charCodeAt(Fr)?(n=ht,Fr++):(n=o,0===Zr&&Xr(ft)),n!==o){for(i=[],a=Kr();a!==o;)i.push(a),a=Kr();if(i!==o){for(a=[],s=Wr();s!==o;)a.push(s),s=Wr();a!==o?(41===e.charCodeAt(Fr)?(s=pt,Fr++):(s=o,0===Zr&&Xr(dt)),s!==o?(Ur=t,t=r=yt(i)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;return t}function rn(){var t,r,n;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();return r!==o?((n=function(){var t,r,n,i,a,s,u,c;if(t=Fr,e.substr(Fr,3)===de?(r=de,Fr+=3):(r=o,0===Zr&&Xr(ye)),r!==o){for(n=[],ve.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(ge)),i===o&&(i=hn())===o&&(i=ln());i!==o;)n.push(i),ve.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(ge)),i===o&&(i=hn())===o&&(i=ln());if(n!==o){if(i=[],a=Fr,e.substr(Fr,2)===me?(s=me,Fr+=2):(s=o,0===Zr&&Xr(be)),s!==o){if(u=[],ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(ge)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(ge)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=we(n,u)):(Fr=a,a=o)}else Fr=a,a=o;if(a===o)if(a=Fr,39===e.charCodeAt(Fr)?(s=le,Fr++):(s=o,0===Zr&&Xr(he)),s!==o){if(u=[],ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(ge)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(ge)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=xe(n,u)):(Fr=a,a=o)}else Fr=a,a=o;for(;a!==o;){if(i.push(a),a=Fr,e.substr(Fr,2)===me?(s=me,Fr+=2):(s=o,0===Zr&&Xr(be)),s!==o){if(u=[],ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(ge)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(ge)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=we(n,u)):(Fr=a,a=o)}else Fr=a,a=o;if(a===o)if(a=Fr,39===e.charCodeAt(Fr)?(s=le,Fr++):(s=o,0===Zr&&Xr(he)),s!==o){if(u=[],ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(ge)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(ge)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=xe(n,u)):(Fr=a,a=o)}else Fr=a,a=o}i!==o?(e.substr(Fr,3)===de?(a=de,Fr+=3):(a=o,0===Zr&&Xr(ye)),a!==o?(Ur=t,t=r=_e(n,i)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;return t}())===o&&(n=function(){var t,r,n,i,a,s,u,c;if(t=Fr,e.substr(Fr,3)===Te?(r=Te,Fr+=3):(r=o,0===Zr&&Xr(ke)),r!==o){for(n=[],Ae.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(Oe)),i===o&&(i=hn())===o&&(i=ln());i!==o;)n.push(i),Ae.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(Oe)),i===o&&(i=hn())===o&&(i=ln());if(n!==o){if(i=[],a=Fr,e.substr(Fr,2)===Ee?(s=Ee,Fr+=2):(s=o,0===Zr&&Xr(je)),s!==o){if(u=[],Ae.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Oe)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),Ae.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Oe)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Ne(n,u)):(Fr=a,a=o)}else Fr=a,a=o;if(a===o)if(a=Fr,34===e.charCodeAt(Fr)?(s=ae,Fr++):(s=o,0===Zr&&Xr(se)),s!==o){if(u=[],Ae.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Oe)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),Ae.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Oe)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Se(n,u)):(Fr=a,a=o)}else Fr=a,a=o;for(;a!==o;){if(i.push(a),a=Fr,e.substr(Fr,2)===Ee?(s=Ee,Fr+=2):(s=o,0===Zr&&Xr(je)),s!==o){if(u=[],Ae.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Oe)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),Ae.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Oe)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Ne(n,u)):(Fr=a,a=o)}else Fr=a,a=o;if(a===o)if(a=Fr,34===e.charCodeAt(Fr)?(s=ae,Fr++):(s=o,0===Zr&&Xr(se)),s!==o){if(u=[],Ae.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Oe)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),Ae.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Zr&&Xr(Oe)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Se(n,u)):(Fr=a,a=o)}else Fr=a,a=o}i!==o?(e.substr(Fr,3)===Te?(a=Te,Fr+=3):(a=o,0===Zr&&Xr(ke)),a!==o?(Ur=t,t=r=_e(n,i)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;return t}())===o&&(n=function(){var t,r,n,i;if(t=Fr,39===e.charCodeAt(Fr)?(r=le,Fr++):(r=o,0===Zr&&Xr(he)),r!==o){for(n=[],fe.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(pe)),i===o&&(i=hn())===o&&(i=ln());i!==o;)n.push(i),fe.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(pe)),i===o&&(i=hn())===o&&(i=ln());n!==o?(39===e.charCodeAt(Fr)?(i=le,Fr++):(i=o,0===Zr&&Xr(he)),i!==o?(Ur=t,t=r=m(n)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}())===o&&(n=function(){var t,r,n,i;if(t=Fr,34===e.charCodeAt(Fr)?(r=ae,Fr++):(r=o,0===Zr&&Xr(se)),r!==o){for(n=[],ue.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(ce)),i===o&&(i=hn())===o&&(i=ln());i!==o;)n.push(i),ue.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(ce)),i===o&&(i=hn())===o&&(i=ln());n!==o?(34===e.charCodeAt(Fr)?(i=ae,Fr++):(i=o,0===Zr&&Xr(se)),i!==o?(Ur=t,t=r=m(n)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}()),n!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)):(Fr=t,t=o),t}function nn(){var t,r,n;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o&&(n=an())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o),t===o){for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();r!==o&&(n=function(){var t,r;return(t=function(){var t,r,n;return t=Fr,(r=sn())!==o&&(n=function(){var t,r,n,i,a,s,u,h;if(t=Fr,(r=pn())===o&&(58===e.charCodeAt(Fr)?(r=Pt,Fr++):(r=o,0===Zr&&Xr(Ft)),r===o&&(Bt.test(e.charAt(Fr))?(r=e.charAt(Fr),Fr++):(r=o,0===Zr&&Xr(qt)),r===o&&(r=vn()))),r!==o){for(n=[],(i=dn())===o&&(58===e.charCodeAt(Fr)?(i=Pt,Fr++):(i=o,0===Zr&&Xr(Ft)),i===o&&(i=vn()));i!==o;)n.push(i),(i=dn())===o&&(58===e.charCodeAt(Fr)?(i=Pt,Fr++):(i=o,0===Zr&&Xr(Ft)),i===o&&(i=vn()));if(n!==o){if(i=[],a=Fr,s=[],46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Zr&&Xr(l)),u!==o)for(;u!==o;)s.push(u),46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Zr&&Xr(l));else s=o;if(s!==o){if(u=[],(h=dn())===o&&(58===e.charCodeAt(Fr)?(h=Pt,Fr++):(h=o,0===Zr&&Xr(Ft)),h===o&&(h=vn())),h!==o)for(;h!==o;)u.push(h),(h=dn())===o&&(58===e.charCodeAt(Fr)?(h=Pt,Fr++):(h=o,0===Zr&&Xr(Ft)),h===o&&(h=vn()));else u=o;u!==o?(Ur=a,a=s=Ar(r,n,s,u)):(Fr=a,a=o)}else Fr=a,a=o;for(;a!==o;){if(i.push(a),a=Fr,s=[],46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Zr&&Xr(l)),u!==o)for(;u!==o;)s.push(u),46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Zr&&Xr(l));else s=o;if(s!==o){if(u=[],(h=dn())===o&&(58===e.charCodeAt(Fr)?(h=Pt,Fr++):(h=o,0===Zr&&Xr(Ft)),h===o&&(h=vn())),h!==o)for(;h!==o;)u.push(h),(h=dn())===o&&(58===e.charCodeAt(Fr)?(h=Pt,Fr++):(h=o,0===Zr&&Xr(Ft)),h===o&&(h=vn()));else u=o;u!==o?(Ur=a,a=s=Ar(r,n,s,u)):(Fr=a,a=o)}else Fr=a,a=o}i!==o?(Ur=t,t=r=Or(r,n,i)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;return t}())!==o?(Ur=t,t=r=Dt(r,n)):(Fr=t,t=o),t}())===o&&(t=Fr,(r=sn())!==o&&(Ur=t,r=Ot(r)),t=r),t}())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)}return t}function on(){var t,r,n;for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();if(r!==o&&(n=function(){var t,r,n,i,a,s,u,h,f,p;if(t=Fr,r=Fr,e.substr(Fr,2)===Mt?(n=Mt,Fr+=2):(n=o,0===Zr&&Xr(Zt)),n!==o)if((i=pn())===o&&(Bt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(qt))),i!==o){for(a=[],s=dn();s!==o;)a.push(s),s=dn();if(a!==o){if(s=[],u=Fr,h=[],46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Zr&&Xr(l)),f!==o)for(;f!==o;)h.push(f),46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Zr&&Xr(l));else h=o;if(h!==o){if(f=[],(p=dn())!==o)for(;p!==o;)f.push(p),p=dn();else f=o;f!==o?u=h=[h,f]:(Fr=u,u=o)}else Fr=u,u=o;for(;u!==o;){if(s.push(u),u=Fr,h=[],46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Zr&&Xr(l)),f!==o)for(;f!==o;)h.push(f),46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Zr&&Xr(l));else h=o;if(h!==o){if(f=[],(p=dn())!==o)for(;p!==o;)f.push(p),p=dn();else f=o;f!==o?u=h=[h,f]:(Fr=u,u=o)}else Fr=u,u=o}s!==o?r=n=[n,i,a,s]:(Fr=r,r=o)}else Fr=r,r=o}else Fr=r,r=o;else Fr=r,r=o;return r!==o?e.substring(t,Fr):r}())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o),t===o){for(t=Fr,r=[],n=Wr();n!==o;)r.push(n),n=Wr();r!==o&&(n=function(){var t,r,n,i;if(t=Fr,91===e.charCodeAt(Fr)?(r=st,Fr++):(r=o,0===Zr&&Xr(ut)),r!==o){for(n=[],i=Wr();i!==o;)n.push(i),i=Wr();n!==o?(93===e.charCodeAt(Fr)?(i=ct,Fr++):(i=o,0===Zr&&Xr(lt)),i!==o?(Ur=t,t=r=cr()):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)}return t}function an(){var t,r,n,i;if(t=Fr,60===e.charCodeAt(Fr)?(r=Et,Fr++):(r=o,0===Zr&&Xr(jt)),r!==o){for(n=[],Nt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(St)),i===o&&(i=ln());i!==o;)n.push(i),Nt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(St)),i===o&&(i=ln());n!==o?(62===e.charCodeAt(Fr)?(i=Rt,Fr++):(i=o,0===Zr&&Xr(It)),i!==o?(Ur=t,t=r=Ct(n)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}function sn(){var t,r,n;return t=Fr,(r=yn())===o&&(r=null),r!==o?(58===e.charCodeAt(Fr)?(n=Pt,Fr++):(n=o,0===Zr&&Xr(Ft)),n!==o?(Ur=t,t=r=Ut(r)):(Fr=t,t=o)):(Fr=t,t=o),t}function un(){var t,r,n;return t=Fr,(r=yn())===o&&(r=null),r!==o?(58===e.charCodeAt(Fr)?(n=Pt,Fr++):(n=o,0===Zr&&Xr(Ft)),n!==o?(Ur=t,t=r=Lt(r)):(Fr=t,t=o)):(Fr=t,t=o),t}function cn(){var t,r,n,i,a,s;if(t=Fr,r=Fr,ie.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Zr&&Xr(oe)),n!==o)if(Kt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Zr&&Xr(te)),i===o&&(i=null),i!==o){if(a=[],Bt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Zr&&Xr(qt)),s!==o)for(;s!==o;)a.push(s),Bt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Zr&&Xr(qt));else a=o;a!==o?r=n=[n,i,a]:(Fr=r,r=o)}else Fr=r,r=o;else Fr=r,r=o;return r!==o?e.substring(t,Fr):r}function ln(){var t,r,n,i,a,s,u,c,l,h,f;return t=Fr,e.substr(Fr,2)===Re?(r=Re,Fr+=2):(r=o,0===Zr&&Xr(Ie)),r!==o?(n=Fr,(i=gn())!==o&&(a=gn())!==o&&(s=gn())!==o&&(u=gn())!==o&&(c=gn())!==o&&(l=gn())!==o&&(h=gn())!==o&&(f=gn())!==o?n=i=[i,a,s,u,c,l,h,f]:(Fr=n,n=o),n!==o?(Ur=t,t=r=Ce(n)):(Fr=t,t=o)):(Fr=t,t=o),t===o&&(t=Fr,e.substr(Fr,2)===Pe?(r=Pe,Fr+=2):(r=o,0===Zr&&Xr(Fe)),r!==o?(n=Fr,(i=gn())!==o&&(a=gn())!==o&&(s=gn())!==o&&(u=gn())!==o?n=i=[i,a,s,u]:(Fr=n,n=o),n!==o?(Ur=t,t=r=Ue(n)):(Fr=t,t=o)):(Fr=t,t=o)),t}function hn(){var t,r;return t=Fr,e.substr(Fr,2)===Le?(r=Le,Fr+=2):(r=o,0===Zr&&Xr(De)),r!==o&&(Ur=t,r=Me()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===Ze?(r=Ze,Fr+=2):(r=o,0===Zr&&Xr(Be)),r!==o&&(Ur=t,r=qe()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===He?(r=He,Fr+=2):(r=o,0===Zr&&Xr($e)),r!==o&&(Ur=t,r=ze()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===Xe?(r=Xe,Fr+=2):(r=o,0===Zr&&Xr(Ve)),r!==o&&(Ur=t,r=Ge()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===We?(r=We,Fr+=2):(r=o,0===Zr&&Xr(Qe)),r!==o&&(Ur=t,r=Ye()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===Je?(r=Je,Fr+=2):(r=o,0===Zr&&Xr(Ke)),r!==o&&(Ur=t,r=tr()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===er?(r=er,Fr+=2):(r=o,0===Zr&&Xr(rr)),r!==o&&(Ur=t,r=nr()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===ir?(r=ir,Fr+=2):(r=o,0===Zr&&Xr(or)),r!==o&&(Ur=t,r=ar()),t=r))))))),t}function fn(){var t,r,n;return t=Fr,lr.test(e.charAt(Fr))?(r=e.charAt(Fr),Fr++):(r=o,0===Zr&&Xr(hr)),r!==o?(fr.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Zr&&Xr(pr)),n!==o?(Ur=t,t=r=dr(r,n)):(Fr=t,t=o)):(Fr=t,t=o),t===o&&(yr.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Zr&&Xr(vr))),t}function pn(){var t;return(t=fn())===o&&(95===e.charCodeAt(Fr)?(t=gr,Fr++):(t=o,0===Zr&&Xr(mr))),t}function dn(){var t;return(t=pn())===o&&(45===e.charCodeAt(Fr)?(t=Vt,Fr++):(t=o,0===Zr&&Xr(Gt)),t===o&&(Bt.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Zr&&Xr(qt)),t===o&&(183===e.charCodeAt(Fr)?(t=br,Fr++):(t=o,0===Zr&&Xr(wr)),t===o&&(xr.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Zr&&Xr(_r)),t===o&&(Tr.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Zr&&Xr(kr))))))),t}function yn(){var t,r,n,i,a,s,u,h,f;if(t=Fr,r=Fr,(n=fn())!==o){for(i=[],a=dn();a!==o;)i.push(a),a=dn();if(i!==o){if(a=[],s=Fr,u=[],46===e.charCodeAt(Fr)?(h=c,Fr++):(h=o,0===Zr&&Xr(l)),h!==o)for(;h!==o;)u.push(h),46===e.charCodeAt(Fr)?(h=c,Fr++):(h=o,0===Zr&&Xr(l));else u=o;if(u!==o){if(h=[],(f=dn())!==o)for(;f!==o;)h.push(f),f=dn();else h=o;h!==o?s=u=[u,h]:(Fr=s,s=o)}else Fr=s,s=o;for(;s!==o;){if(a.push(s),s=Fr,u=[],46===e.charCodeAt(Fr)?(h=c,Fr++):(h=o,0===Zr&&Xr(l)),h!==o)for(;h!==o;)u.push(h),46===e.charCodeAt(Fr)?(h=c,Fr++):(h=o,0===Zr&&Xr(l));else u=o;if(u!==o){if(h=[],(f=dn())!==o)for(;f!==o;)h.push(f),f=dn();else h=o;h!==o?s=u=[u,h]:(Fr=s,s=o)}else Fr=s,s=o}a!==o?r=n=[n,i,a]:(Fr=r,r=o)}else Fr=r,r=o}else Fr=r,r=o;return r!==o?e.substring(t,Fr):r}function vn(){var t;return(t=function(){var t,r,n,i,a;return t=Fr,r=Fr,37===e.charCodeAt(Fr)?(n=Er,Fr++):(n=o,0===Zr&&Xr(jr)),n!==o&&(i=gn())!==o&&(a=gn())!==o?r=n=[n,i,a]:(Fr=r,r=o),r!==o?e.substring(t,Fr):r}())===o&&(t=function(){var t,r,n;return t=Fr,92===e.charCodeAt(Fr)?(r=Rr,Fr++):(r=o,0===Zr&&Xr(Ir)),r!==o?(Cr.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Zr&&Xr(Pr)),n!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)):(Fr=t,t=o),t}()),t}function gn(){var t;return Nr.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Zr&&Xr(Sr)),t}var mn,bn,wn,xn=new Function("try {return this===window;}catch(e){ return false;}")()?window.URL:r(4044).URL,_n=function(t){return t.match(/^[a-z](.*?):(.+?)/g)},Tn={base:[],data:{},addBase:function(t){if(0===Tn.base.length)return void Tn.base.push(t);const e=Tn.base[Tn.base.length-1];e!==t&&Tn.base.push(new xn(t,e).toString())},addPrefix:function(t,e){const r=Tn.data[t];void 0===r?Tn.data[t]=[{uri:e,count:0}]:r[r.length-1].uri!==e&&r.push({uri:e,count:0})},hasPrefix:function(t){return void 0!==this.data[t]},resolve:function(t,e){const r=Object.keys(Tn.data).find((e=>0===t.indexOf(e+":")));if(void 0!==r){const n=Tn.data[r];if(1===n.length&&!0!==e&&_n(n[0].uri))return t;const i=n[n.length-1].uri;return t.replace(r+":",i)}var i=0===Tn.base.length?n.baseIRI:Tn.base[Tn.base.length-1];return!i||t.match(/^(http:|https:|urn:|file:)/)?t:0===t.indexOf("//")&&i?i.split("//")[0]+t:new xn(t,i).toString()},increment:function(t){const e=Tn.data[t];void 0!==e&&e[e.length-1].count++},decrement:function(t){const e=Tn.data[t];void 0!==e&&e[e.length-1].count--},toJSON:function(){const t={};return Tn.base.length>0&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"]["@base"]=Tn.base[0]),Object.keys(Tn.data).forEach((e=>{const r=Tn.data[e][0];"http://www.w3.org/2001/XMLSchema#"===r.uri&&r.count<1||_n(r.uri)&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"][e]=r.uri)})),t}};function kn(t,e){if(void 0===t["@list"])return t;if(!e&&!t["@list"].find((t=>void 0!==t["@list"])))return t;if(0===t["@list"].length)return{"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};var r={},n=null;return t["@list"].forEach((t=>{null===n?n=r:(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={},n=n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#first"]=kn(t,!0),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"}})),r}if((i=s())!==o&&Fr===e.length)return i;throw i!==o&&Fr<e.length&&Xr({type:"end"}),mn=Mr,bn=Dr<e.length?e.charAt(Dr):null,wn=Dr<e.length?zr(Dr,Dr+1):zr(Dr,Dr),new t(t.buildMessage(mn,bn),mn,bn,wn)}}})?n.apply(e,[]):n)||(t.exports=i)},6118:(t,e,r)=>{"use strict";var n=r(2530),i=r(292);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var a,s,u=r(8619).codes,c=u.ERR_AMBIGUOUS_ARGUMENT,l=u.ERR_INVALID_ARG_TYPE,h=u.ERR_INVALID_ARG_VALUE,f=u.ERR_INVALID_RETURN_VALUE,p=u.ERR_MISSING_ARGS,d=r(6979),y=r(5663).inspect,v=r(5663).types,g=v.isPromise,m=v.isRegExp,b=Object.assign?Object.assign:r(1662).assign,w=Object.is?Object.is:r(7402);function x(){var t=r(1667);a=t.isDeepEqual,s=t.isDeepStrictEqual}new Map;var _=!1,T=t.exports=E,k={};function A(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function O(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw o.generatedMessage=i,o}}function E(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];O.apply(void 0,[E,e.length].concat(e))}T.fail=function t(e,r,o,a,s){var u,c=arguments.length;if(0===c?u="Failed":1===c?(o=e,e=void 0):(!1===_&&(_=!0,(n.emitWarning?n.emitWarning:i.warn.bind(i))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===c&&(a="!=")),o instanceof Error)throw o;var l={actual:e,expected:r,operator:void 0===a?"fail":a,stackStartFn:s||t};void 0!==o&&(l.message=o);var h=new d(l);throw u&&(h.message=u,h.generatedMessage=!0),h},T.AssertionError=d,T.ok=E,T.equal=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e!=r&&A({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},T.notEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e==r&&A({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},T.deepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),a(e,r)||A({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},T.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),a(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},T.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),s(e,r)||A({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},T.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&x(),s(e,r)&&A({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},T.strictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");w(e,r)||A({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},T.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");w(e,r)&&A({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var j=function t(e,r,n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&m(e[t])&&e[t].test(n[t])?i[t]=n[t]:i[t]=e[t])}))};function N(t,e,r,n){if("function"!=typeof e){if(m(e))return e.test(t);if(2===arguments.length)throw new l("expected",["Function","RegExp"],e);if("object"!==o(t)||null===t){var i=new d({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var u=Object.keys(e);if(e instanceof Error)u.push("name","message");else if(0===u.length)throw new h("error",e,"may not be an empty object");return void 0===a&&x(),u.forEach((function(i){"string"==typeof t[i]&&m(e[i])&&e[i].test(t[i])||function(t,e,r,n,i,o){if(!(r in t)||!s(t[r],e[r])){if(!n){var a=new j(t,i),u=new j(e,i,t),c=new d({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=t,c.expected=e,c.operator=o.name,c}A({actual:t,expected:e,message:n,operator:o.name,stackStartFn:o})}}(t,e,i,r,u,n)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function S(t){if("function"!=typeof t)throw new l("fn","Function",t);try{t()}catch(t){return t}return k}function R(t){return g(t)||null!==t&&"object"===o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function I(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!R(e=t()))throw new f("instance of Promise","promiseFn",e)}else{if(!R(t))throw new l("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return k})).catch((function(t){return t}))}))}function C(t,e,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===o(e)&&null!==e){if(e.message===r)throw new c("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new c("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(e===k){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var a="rejects"===t.name?"rejection":"exception";A({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:t})}if(r&&!N(e,r,n,t))throw e}function P(t,e,r,n){if(e!==k){if("string"==typeof r&&(n=r,r=void 0),!r||N(e,r)){var i=n?": ".concat(n):".",o="doesNotReject"===t.name?"rejection":"exception";A({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function F(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];O.apply(void 0,[F,e.length].concat(e))}T.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];C.apply(void 0,[t,S(e)].concat(n))},T.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(e).then((function(e){return C.apply(void 0,[t,e].concat(n))}))},T.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];P.apply(void 0,[t,S(e)].concat(n))},T.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(e).then((function(e){return P.apply(void 0,[t,e].concat(n))}))},T.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===o(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=y(e);var n=new d({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),i=e.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var s=n.stack.split("\n"),u=0;u<a.length;u++){var c=s.indexOf(a[u]);if(-1!==c){s=s.slice(0,c);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},T.strict=b(F,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict},6979:(t,e,r)=>{"use strict";var n=r(2530);function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?s(t):e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return c(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,t)},u(t)}function c(t,e,r){return c=function(){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(t){return!1}}()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&l(i,r.prototype),i},c.apply(null,arguments)}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}var p=r(5663).inspect,d=r(8619).codes.ERR_INVALID_ARG_TYPE;function y(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var v="",g="",m="",b="",w={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 x(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function _(t){return p(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var T=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==f(t)||null===t)throw new d("options","Object",t);var i=t.message,o=t.operator,u=t.stackStartFn,c=t.actual,l=t.expected,p=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=a(this,h(e).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(v="[34m",g="[32m",b="[39m",m="[31m"):(v="",g="",b="",m="")),"object"===f(c)&&null!==c&&"object"===f(l)&&null!==l&&"stack"in c&&c instanceof Error&&"stack"in l&&l instanceof Error&&(c=x(c),l=x(l)),"deepStrictEqual"===o||"strictEqual"===o)r=a(this,h(e).call(this,function(t,e,r){var i="",o="",a=0,s="",u=!1,c=_(t),l=c.split("\n"),h=_(e).split("\n"),p=0,d="";if("strictEqual"===r&&"object"===f(t)&&"object"===f(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var x=l[0].length+h[0].length;if(x<=10){if(!("object"===f(t)&&null!==t||"object"===f(e)&&null!==e||0===t&&0===e))return"".concat(w[r],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&x<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][p]===h[0][p];)p++;p>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",p),"^"),p=0)}}for(var T=l[l.length-1],k=h[h.length-1];T===k&&(p++<2?s="\n ".concat(T).concat(s):i=T,l.pop(),h.pop(),0!==l.length&&0!==h.length);)T=l[l.length-1],k=h[h.length-1];var A=Math.max(l.length,h.length);if(0===A){var O=c.split("\n");if(O.length>30)for(O[26]="".concat(v,"...").concat(b);O.length>27;)O.pop();return"".concat(w.notIdentical,"\n\n").concat(O.join("\n"),"\n")}p>3&&(s="\n".concat(v,"...").concat(b).concat(s),u=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var E=0,j=w[r]+"\n".concat(g,"+ actual").concat(b," ").concat(m,"- expected").concat(b),N=" ".concat(v,"...").concat(b," Lines skipped");for(p=0;p<A;p++){var S=p-a;if(l.length<p+1)S>1&&p>2&&(S>4?(o+="\n".concat(v,"...").concat(b),u=!0):S>3&&(o+="\n ".concat(h[p-2]),E++),o+="\n ".concat(h[p-1]),E++),a=p,i+="\n".concat(m,"-").concat(b," ").concat(h[p]),E++;else if(h.length<p+1)S>1&&p>2&&(S>4?(o+="\n".concat(v,"...").concat(b),u=!0):S>3&&(o+="\n ".concat(l[p-2]),E++),o+="\n ".concat(l[p-1]),E++),a=p,o+="\n".concat(g,"+").concat(b," ").concat(l[p]),E++;else{var R=h[p],I=l[p],C=I!==R&&(!y(I,",")||I.slice(0,-1)!==R);C&&y(R,",")&&R.slice(0,-1)===I&&(C=!1,I+=","),C?(S>1&&p>2&&(S>4?(o+="\n".concat(v,"...").concat(b),u=!0):S>3&&(o+="\n ".concat(l[p-2]),E++),o+="\n ".concat(l[p-1]),E++),a=p,o+="\n".concat(g,"+").concat(b," ").concat(I),i+="\n".concat(m,"-").concat(b," ").concat(R),E+=2):(o+=i,i="",1!==S&&0!==p||(o+="\n ".concat(I),E++))}if(E>20&&p<A-2)return"".concat(j).concat(N,"\n").concat(o,"\n").concat(v,"...").concat(b).concat(i,"\n")+"".concat(v,"...").concat(b)}return"".concat(j).concat(u?N:"","\n").concat(o).concat(i).concat(s).concat(d)}(c,l,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var T=w[o],k=_(c).split("\n");if("notStrictEqual"===o&&"object"===f(c)&&null!==c&&(T=w.notStrictEqualObject),k.length>30)for(k[26]="".concat(v,"...").concat(b);k.length>27;)k.pop();r=1===k.length?a(this,h(e).call(this,"".concat(T," ").concat(k[0]))):a(this,h(e).call(this,"".concat(T,"\n\n").concat(k.join("\n"),"\n")))}else{var A=_(c),O="",E=w[o];"notDeepEqual"===o||"notEqual"===o?(A="".concat(w[o],"\n\n").concat(A)).length>1024&&(A="".concat(A.slice(0,1021),"...")):(O="".concat(_(l)),A.length>512&&(A="".concat(A.slice(0,509),"...")),O.length>512&&(O="".concat(O.slice(0,509),"...")),"deepEqual"===o||"equal"===o?A="".concat(E,"\n\n").concat(A,"\n\nshould equal\n\n"):O=" ".concat(o," ").concat(O)),r=a(this,h(e).call(this,"".concat(A).concat(O)))}return Error.stackTraceLimit=p,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=l,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(s(r),u),r.stack,r.name="AssertionError",a(r)}var r,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(e,t),r=e,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(t,e){return p(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){i(t,e,r[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}],u&&o(r.prototype,u),e}(u(Error));t.exports=T},8619:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}var a,s,u={};function c(t,e,r){r||(r=Error);var a=function(r){function a(r,o,s){var u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),u=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,i(a).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,o,s))),u.code=t,u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}(a,r),a}(r);u[t]=a}function l(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(t,e,i){var o,s,u,c,h;if(void 0===a&&(a=r(6118)),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(s="not ",e.substr(0,s.length)===s)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))u="The ".concat(t," ").concat(o," ").concat(l(e,"type"));else{var f=("number"!=typeof h&&(h=0),h+".".length>(c=t).length||-1===c.indexOf(".",h)?"argument":"property");u='The "'.concat(t,'" ').concat(f," ").concat(o," ").concat(l(e,"type"))}return u+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(5663));var i=s.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===a&&(a=r(6118)),a(e.length>0,"At least one arg needs to be specified");var i="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,o-1).join(", "),i+=", and ".concat(e[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=u},1667:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=void 0!==/a/g.flags,a=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},s=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(7402),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(8622);function h(t){return t.call.bind(t)}var f=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),d=h(Object.prototype.toString),y=r(5663).types,v=y.isAnyArrayBuffer,g=y.isArrayBufferView,m=y.isDate,b=y.isMap,w=y.isRegExp,x=y.isSet,_=y.isNativeError,T=y.isBoxedPrimitive,k=y.isNumberObject,A=y.isStringObject,O=y.isBooleanObject,E=y.isBigIntObject,j=y.isSymbolObject,N=y.isFloat32Array,S=y.isFloat64Array;function R(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function I(t){return Object.keys(t).filter(R).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function C(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}var P=0,F=1,U=2,L=3;function D(t,e,r,n){if(t===e)return 0!==t||!r||u(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&l(t)&&l(e);if("object"!==i(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var a,s,c,h,f=d(t);if(f!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var p=I(t),y=I(e);return p.length===y.length&&Z(t,e,r,n,F,p)}if("[object Object]"===f&&(!b(t)&&b(e)||!x(t)&&x(e)))return!1;if(m(t)){if(!m(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(c=t,h=e,!(o?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(_(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(g(t)){if(r||!N(t)&&!S(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===C(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var R=I(t),D=I(e);return R.length===D.length&&Z(t,e,r,n,P,R)}if(x(t))return!(!x(e)||t.size!==e.size)&&Z(t,e,r,n,U);if(b(t))return!(!b(e)||t.size!==e.size)&&Z(t,e,r,n,L);if(v(t)){if(s=e,(a=t).byteLength!==s.byteLength||0!==C(new Uint8Array(a),new Uint8Array(s)))return!1}else if(T(t)&&!function(t,e){return k(t)?k(e)&&u(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):A(t)?A(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):O(t)?O(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):E(t)?E(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):j(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return Z(t,e,r,n,P)}function M(t,e){return e.filter((function(e){return p(t,e)}))}function Z(t,e,r,o,u,l){if(5===arguments.length){l=Object.keys(t);var h=Object.keys(e);if(l.length!==h.length)return!1}for(var d=0;d<l.length;d++)if(!f(e,l[d]))return!1;if(r&&5===arguments.length){var y=c(t);if(0!==y.length){var v=0;for(d=0;d<y.length;d++){var g=y[d];if(p(t,g)){if(!p(e,g))return!1;l.push(g),v++}else if(p(e,g))return!1}var m=c(e);if(y.length!==m.length&&M(e,m).length!==v)return!1}else{var b=c(e);if(0!==b.length&&0!==M(e,b).length)return!1}}if(0===l.length&&(u===P||u===F&&0===t.length||0===t.size))return!0;if(void 0===o)o={val1:new Map,val2:new Map,position:0};else{var w=o.val1.get(t);if(void 0!==w){var x=o.val2.get(e);if(void 0!==x)return w===x}o.position++}o.val1.set(t,o.position),o.val2.set(e,o.position);var _=function(t,e,r,o,u,c){var l=0;if(c===U){if(!function(t,e,r,n){for(var o=null,s=a(t),u=0;u<s.length;u++){var c=s[u];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!e.has(c)){if(r)return!1;if(!H(t,e,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var l=a(e),h=0;h<l.length;h++){var f=l[h];if("object"===i(f)&&null!==f){if(!B(o,f,r,n))return!1}else if(!r&&!t.has(f)&&!B(o,f,r,n))return!1}return 0===o.size}return!0}(t,e,r,u))return!1}else if(c===L){if(!function(t,e,r,o){for(var a=null,u=s(t),c=0;c<u.length;c++){var l=n(u[c],2),h=l[0],f=l[1];if("object"===i(h)&&null!==h)null===a&&(a=new Set),a.add(h);else{var p=e.get(h);if(void 0===p&&!e.has(h)||!D(f,p,r,o)){if(r)return!1;if(!$(t,e,h,f,o))return!1;null===a&&(a=new Set),a.add(h)}}}if(null!==a){for(var d=s(e),y=0;y<d.length;y++){var v=n(d[y],2),g=(h=v[0],v[1]);if("object"===i(h)&&null!==h){if(!z(a,t,h,g,r,o))return!1}else if(!(r||t.has(h)&&D(t.get(h),g,!1,o)||z(a,t,h,g,!1,o)))return!1}return 0===a.size}return!0}(t,e,r,u))return!1}else if(c===F)for(;l<t.length;l++){if(!f(t,l)){if(f(e,l))return!1;for(var h=Object.keys(t);l<h.length;l++){var p=h[l];if(!f(e,p)||!D(t[p],e[p],r,u))return!1}return h.length===Object.keys(e).length}if(!f(e,l)||!D(t[l],e[l],r,u))return!1}for(l=0;l<o.length;l++){var d=o[l];if(!D(t[d],e[d],r,u))return!1}return!0}(t,e,r,l,o,u);return o.val1.delete(t),o.val2.delete(e),_}function B(t,e,r,n){for(var i=a(t),o=0;o<i.length;o++){var s=i[o];if(D(e,s,r,n))return t.delete(s),!0}return!1}function q(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(l(t))return!1}return!0}function H(t,e,r){var n=q(r);return null!=n?n:e.has(n)&&!t.has(n)}function $(t,e,r,n,i){var o=q(r);if(null!=o)return o;var a=e.get(o);return!(void 0===a&&!e.has(o)||!D(n,a,!1,i))&&!t.has(o)&&D(n,a,!1,i)}function z(t,e,r,n,i,o){for(var s=a(t),u=0;u<s.length;u++){var c=s[u];if(D(r,c,i,o)&&D(n,e.get(c),i,o))return t.delete(c),!0}return!1}t.exports={isDeepEqual:function(t,e){return D(t,e,!1)},isDeepStrictEqual:function(t,e){return D(t,e,!0)}}},5155:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),a=o[0],s=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,s)),l=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;return 2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e),1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,u=n-i;s<u;s+=a)o.push(c(t,s,s+a>u?u:s+a));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function u(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2486:(t,e,r)=>{"use strict";var n=r(292);const i=r(5155),o=r(4525),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.lW=c,e.h2=50;const s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|v(t,e);let n=u(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Q(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Q(t,ArrayBuffer)||t&&Q(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(t,SharedArrayBuffer)||t&&Q(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|y(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||Y(t.length)?u(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),u(t<0?0:0|y(t))}function p(t){const e=t.length<0?0:0|y(t.length),r=u(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,c.prototype),n}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function v(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Q(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(i)return n?-1:V(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return E(this,e,r);case"ascii":return N(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){let o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let n=-1;for(o=r;o<s;o++)if(c(t,o)===c(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(t,o+n)!==c(e,n)){r=!1;break}if(r)return o}return-1}function x(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(e.substr(2*a,2),16);if(Y(n))return a;t[r+a]=n}return a}function _(t,e,r,n){return W(V(e,t.length-r),t,r,n)}function T(t,e,r,n){return W(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function k(t,e,r,n){return W(G(e),t,r,n)}function A(t,e,r,n){return W(function(t,e){let r,n,i;const o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function E(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(t){const e=t.length;if(e<=j)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=j));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){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(t,e,r){return l(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)}(t,e,r)},c.allocUnsafe=function(t){return f(t)},c.allocUnsafeSlow=function(t){return f(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).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(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=c.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(Q(e,Uint8Array))i+e.length>n.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=v,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?E(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.h2;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const s=Math.min(o,a),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t<s;++t)if(u[t]!==l[t]){o=u[t],a=l[t];break}return o<a?-1:a<o?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>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,t,e,r);case"utf8":case"utf-8":return _(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,e,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 j=4096;function N(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function S(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function R(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=J[t[n]];return i}function I(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function U(t,e,r,n,i){H(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,8),o.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=K((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=K((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=K((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=K((function(t){$(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=K((function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=K((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=0,o=1,a=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o>>0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=K((function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=K((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,n),a=o.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%a]}return this};const Z={};function B(t,e,r){Z[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function q(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function H(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===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}`:`>= ${e}${n} and <= ${r}${n}`,new Z.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){$(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function $(t,e){if("number"!=typeof t)throw new Z.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw $(t,r),new Z.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new Z.ERR_BUFFER_OUT_OF_BOUNDS;throw new Z.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}B("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),B("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),B("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=q(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const X=/[^+/0-9A-Za-z-_]/g;function V(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=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((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(X,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function W(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Q(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function K(t){return"undefined"==typeof BigInt?tt:t}function tt(){throw new Error("BigInt not supported")}},7615:(t,e,r)=>{"use strict";var n=r(1801),i=r(2550),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},2550:(t,e,r)=>{"use strict";var n=r(1930),i=r(1801),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(n,a,arguments);return u&&c&&u(e,"length").configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var h=function(){return s(n,o,arguments)};c?c(t.exports,"apply",{value:h}):t.exports.apply=h},292:(t,e,r)=>{var n=r(5663),i=r(6118);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,u={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){u[t]=o()},"time"],[function(t){var e=u[t];if(!e)throw new Error("No such label: "+t);delete u[t];var r=o()-e;a.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=s.call(arguments,1);i.ok(!1,n.format.apply(null,e))}},"assert"]],l=0;l<c.length;l++){var h=c[l],f=h[0],p=h[1];a[p]||(a[p]=f)}t.exports=a},7297:function(t,e){var r="undefined"!=typeof self?self:this,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(r.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(t){return t&&n.indexOf(Object.prototype.toString.call(t))>-1};function o(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function a(t){return"string"!=typeof t&&(t=String(t)),t}function s(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return r.iterable&&(e[Symbol.iterator]=function(){return e}),e}function u(t){this.map={},t instanceof u?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function c(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function l(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function h(t){var e=new FileReader,r=l(e);return e.readAsArrayBuffer(t),r}function f(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function p(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:r.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:r.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():r.arrayBuffer&&r.blob&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=f(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):r.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||i(t))?this._bodyArrayBuffer=f(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},r.blob&&(this.blob=function(){var t=c(this);if(t)return t;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?c(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var t,e,r,n=c(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=l(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},r.formData&&(this.formData=function(){return this.text().then(v)}),this.json=function(){return this.text().then(JSON.parse)},this}u.prototype.append=function(t,e){t=o(t),e=a(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},u.prototype.delete=function(t){delete this.map[o(t)]},u.prototype.get=function(t){return t=o(t),this.has(t)?this.map[t]:null},u.prototype.has=function(t){return this.map.hasOwnProperty(o(t))},u.prototype.set=function(t,e){this.map[o(t)]=a(e)},u.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},u.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),s(t)},u.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),s(t)},u.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),s(t)},r.iterable&&(u.prototype[Symbol.iterator]=u.prototype.entries);var d=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(t,e){var r,n,i=(e=e||{}).body;if(t instanceof y){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new u(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new u(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),d.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.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 v(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function g(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new u(e.headers),this.url=e.url||"",this._initBody(t)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},p.call(y.prototype),p.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new u(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:0,statusText:""});return t.type="error",t};var m=[301,302,303,307,308];g.redirect=function(t,e){if(-1===m.indexOf(e))throw new RangeError("Invalid status code");return new g(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function b(t,n){return new Promise((function(i,o){var a=new y(t,n);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new u,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var n="response"in s?s.response:s.responseText;i(new g(n,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&r.blob&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",c)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}b.polyfill=!0,t.fetch||(t.fetch=b,t.Headers=u,t.Request=y,t.Response=g),e.Headers=u,e.Request=y,e.Response=g,e.fetch=b,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e},9170:(t,e,r)=>{"use strict";var n=r(806),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=r(8198)(),c=s&&u,l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?s(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},h=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s<o.length;s+=1)l(t,o[s],e[o[s]],r[o[s]])};h.supportsDescriptors=!!c,t.exports=h},1662:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var u=o[a],c=Object.getOwnPropertyDescriptor(i,u);void 0!==c&&c.enumerable&&(r[u]=i[u])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},4843:(t,e,r)=>{"use strict";var n=r(5443),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n<i;n++)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,a):"string"==typeof t?function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,a):function(t,e,r){for(var n in t)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,a)}},9930:t=>{"use strict";var e=Array.prototype.slice,r=Object.prototype.toString;t.exports=function(t){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,o=e.call(arguments,1),a=Math.max(0,n.length-o.length),s=[],u=0;u<a;u++)s.push("$"+u);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var r=n.apply(this,o.concat(e.call(arguments)));return Object(r)===r?r:this}return n.apply(t,o.concat(e.call(arguments)))})),n.prototype){var c=function(){};c.prototype=n.prototype,i.prototype=new c,c.prototype=null}return i}},1930:(t,e,r)=>{"use strict";var n=r(9930);t.exports=Function.prototype.bind||n},1801:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new a},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,h=r(9905)(),f=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:f(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?f([][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,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%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?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?f((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?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?f(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":d,"%TypeError%":a,"%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};try{null.error}catch(t){var v=f(f(t));y["%Error.prototype%"]=v}var g=function t(e){var r;if("%AsyncFunction%"===e)r=s("async function () {}");else if("%GeneratorFunction%"===e)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=s("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=f(i.prototype))}return y[e]=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"]},b=r(1930),w=r(9284),x=b.call(Function.call,Array.prototype.concat),_=b.call(Function.apply,Array.prototype.splice),T=b.call(Function.call,String.prototype.replace),k=b.call(Function.call,String.prototype.slice),A=b.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,j=function(t,e){var r,n=t;if(w(m,n)&&(n="%"+(r=m[n])[0]+"%"),w(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===A(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=k(t,0,1),r=k(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return T(t,O,(function(t,e,r,i){n[n.length]=r?T(i,E,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=j("%"+n+"%",e),s=o.name,c=o.value,l=!1,h=o.alias;h&&(n=h[0],_(r,x([0,1],h)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],v=k(d,0,1),g=k(d,-1);if(('"'===v||"'"===v||"`"===v||'"'===g||"'"===g||"`"===g)&&v!==g)throw new i("property names with quotes must have matching quotes");if("constructor"!==d&&p||(l=!0),w(y,s="%"+(n+="."+d)+"%"))c=y[s];else if(null!=c){if(!(d in c)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&f+1>=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=w(c,d),c=c[d];p&&!l&&(y[s]=c)}}return c}},3828:(t,e,r)=>{"use strict";var n=r(1801)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},8198:(t,e,r)=>{"use strict";var n=r(1801)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},9905:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4111:(t,e,r)=>{"use strict";var n=r(5682);t.exports=function(){return n()&&!!Symbol.toStringTag}},9284:(t,e,r)=>{"use strict";var n=r(1930);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4525:(t,e)=>{e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+p]=255&a,p+=d,a/=256,c-=8);t[r+p-d]|=128*y}},8575:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},7092:(t,e,r)=>{"use strict";var n=r(4111)(),i=r(7615)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},a=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},5443:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;u.call(f)===u.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},7427:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(4111)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(o.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},2100:t=>{"use strict";t.exports=function(t){return t!=t}},8622:(t,e,r)=>{"use strict";var n=r(2550),i=r(9170),o=r(2100),a=r(4358),s=r(6232),u=n(a(),Number);i(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},4358:(t,e,r)=>{"use strict";var n=r(2100);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6232:(t,e,r)=>{"use strict";var n=r(9170),i=r(4358);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},2527:(t,e,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),a=o("Object.prototype.toString"),s=r(4111)(),u=r(3828),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),h=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},f=o("String.prototype.slice"),p={},d=Object.getPrototypeOf;s&&u&&d&&n(l,(function(t){var e=new c[t];if(Symbol.toStringTag in e){var r=d(e),n=u(r,Symbol.toStringTag);if(!n){var i=d(r);n=u(i,Symbol.toStringTag)}p[t]=n.get}})),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s||!(Symbol.toStringTag in t)){var e=f(a(t),8,-1);return h(l,e)>-1}return!!u&&function(t){var e=!1;return n(p,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},8720:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},7402:(t,e,r)=>{"use strict";var n=r(9170),i=r(2550),o=r(8720),a=r(5280),s=r(9129),u=i(a(),Object);n(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},5280:(t,e,r)=>{"use strict";var n=r(8720);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},9129:(t,e,r)=>{"use strict";var n=r(5280),i=r(9170);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8383:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(4418),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$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 t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=a(t),s=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=c&&r;if(s&&t.length>0&&!i.call(t,0))for(var y=0;y<t.length;++y)f.push(String(y));if(n&&t.length>0)for(var v=0;v<t.length;++v)f.push(String(v));else for(var g in t)d&&"prototype"===g||!i.call(t,g)||f.push(String(g));if(u)for(var m=function(t){if("undefined"==typeof window||!p)return h(t);try{return h(t)}catch(t){return!1}}(t),b=0;b<l.length;++b)m&&"constructor"===l[b]||!i.call(t,l[b])||f.push(l[b]);return f}}t.exports=n},806:(t,e,r)=>{"use strict";var n=Array.prototype.slice,i=r(4418),o=Object.keys,a=o?function(t){return o(t)}:r(8383),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?s(n.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},4418:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},2530:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var s,u=[],c=!1,l=-1;function h(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&f())}function f(){if(!c){var t=a(h);c=!0;for(var e=u.length;e;){for(s=u,u=[];++l<e;)s&&s[l].run();l=-1,e=u.length}s=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||c||a(f)},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=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},6063:t=>{"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(r);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var u=t.length;s>0&&u>s&&(u=s);for(var c=0;c<u;++c){var l,h,f,p,d=t[c].replace(a,"%20"),y=d.indexOf(n);y>=0?(l=d.substr(0,y),h=d.substr(y+1)):(l=d,h=""),f=decodeURIComponent(l),p=decodeURIComponent(h),e(o,f)?Array.isArray(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o}},1957:t=>{"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,r,n,i){return r=r||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var o=encodeURIComponent(e(i))+n;return Array.isArray(t[i])?t[i].map((function(t){return o+encodeURIComponent(e(t))})).join(r):o+encodeURIComponent(e(t[i]))})).join(r):i?encodeURIComponent(e(i))+n+encodeURIComponent(e(t)):""}},5582:(t,e,r)=>{"use strict";e.decode=e.parse=r(6063),e.encode=e.stringify=r(1957)},5929:(t,e,r)=>{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},9523:t=>{const e={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/",skos:"http://www.w3.org/2004/02/skos/core#",bookmark:"http://www.w3.org/2002/01/bookmark#",vann:"http://purl.org/vocab/vann/"};t.exports=function(t={namedNode:t=>t}){const r={};for(const n in e){const i=e[n];r[n]=function(e=""){return t.namedNode(i+e)}}return r}},8928:function(t,e,r){var n;t=r.nmd(t),function(i){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var a,s=2147483647,u=36,c=26,l=38,h=700,f=/^xn--/,p=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=u-1,g=Math.floor,m=String.fromCharCode;function b(t){throw RangeError(y[t])}function w(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function x(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+w((t=t.replace(d,".")).split("."),e).join(".")}function _(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function T(t){return w(t,(function(t){var e="";return t>65535&&(e+=m((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+m(t)})).join("")}function k(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function A(t,e,r){var n=0;for(t=r?g(t/h):t>>1,t+=g(t/e);t>v*c>>1;n+=u)t=g(t/v);return g(n+(v+1)*t/(t+l))}function O(t){var e,r,n,i,o,a,l,h,f,p,d,y=[],v=t.length,m=0,w=128,x=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&b("not-basic"),y.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<v;){for(o=m,a=1,l=u;i>=v&&b("invalid-input"),((h=(d=t.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||h>g((s-m)/a))&&b("overflow"),m+=h*a,!(h<(f=l<=x?1:l>=x+c?c:l-x));l+=u)a>g(s/(p=u-f))&&b("overflow"),a*=p;x=A(m-o,e=y.length+1,0==o),g(m/e)>s-w&&b("overflow"),w+=g(m/e),m%=e,y.splice(m++,0,w)}return T(y)}function E(t){var e,r,n,i,o,a,l,h,f,p,d,y,v,w,x,T=[];for(y=(t=_(t)).length,e=128,r=0,o=72,a=0;a<y;++a)(d=t[a])<128&&T.push(m(d));for(n=i=T.length,i&&T.push("-");n<y;){for(l=s,a=0;a<y;++a)(d=t[a])>=e&&d<l&&(l=d);for(l-e>g((s-r)/(v=n+1))&&b("overflow"),r+=(l-e)*v,e=l,a=0;a<y;++a)if((d=t[a])<e&&++r>s&&b("overflow"),d==e){for(h=r,f=u;!(h<(p=f<=o?1:f>=o+c?c:f-o));f+=u)x=h-p,w=u-p,T.push(m(k(p+x%w,0))),h=g(x/w);T.push(m(k(h,0))),o=A(r,v,n==i),r=0,++n}++r,++e}return T.join("")}a={version:"1.3.2",ucs2:{decode:_,encode:T},decode:O,encode:E,toASCII:function(t){return x(t,(function(t){return p.test(t)?"xn--"+E(t):t}))},toUnicode:function(t){return x(t,(function(t){return f.test(t)?O(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},4044:(t,e,r)=>{"use strict";var n=r(8928),i=r(944);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),h=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(5582);o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",c=t.split(s);c[0]=c[0].replace(/\\/g,"/");var b=t=c.join(s);if(b=b.trim(),!r&&1===t.split("#").length){var w=u.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var x=a.exec(b);if(x){var _=(x=x[0]).toLowerCase();this.protocol=_,b=b.substr(x.length)}if(r||x||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var T="//"===b.substr(0,2);!T||x&&v[x]||(b=b.substr(2),this.slashes=!0)}if(!v[x]&&(T||x&&!g[x])){for(var k,A,O=-1,E=0;E<f.length;E++)-1!==(j=b.indexOf(f[E]))&&(-1===O||j<O)&&(O=j);for(-1!==(A=-1===O?b.lastIndexOf("@"):b.lastIndexOf("@",O))&&(k=b.slice(0,A),b=b.slice(A+1),this.auth=decodeURIComponent(k)),O=-1,E=0;E<h.length;E++){var j;-1!==(j=b.indexOf(h[E]))&&(-1===O||j<O)&&(O=j)}-1===O&&(O=b.length),this.host=b.slice(0,O),b=b.slice(O),this.parseHost(),this.hostname=this.hostname||"";var N="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(var S=this.hostname.split(/\./),R=(E=0,S.length);E<R;E++){var I=S[E];if(I&&!I.match(p)){for(var C="",P=0,F=I.length;P<F;P++)I.charCodeAt(P)>127?C+="x":C+=I[P];if(!C.match(p)){var U=S.slice(0,E),L=S.slice(E+1),D=I.match(d);D&&(U.push(D[1]),L.unshift(D[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=n.toASCII(this.hostname));var M=this.port?":"+this.port:"",Z=this.hostname||"";this.host=Z+M,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!y[_])for(E=0,R=l.length;E<R;E++){var B=l[E];if(-1!==b.indexOf(B)){var q=encodeURIComponent(B);q===B&&(q=escape(B)),b=b.split(B).join(q)}}var H=b.indexOf("#");-1!==H&&(this.hash=b.substr(H),b=b.slice(0,H));var $=b.indexOf("?");if(-1!==$?(this.search=b.substr($),this.query=b.substr($+1),e&&(this.query=m.parse(this.query)),b=b.slice(0,$)):e&&(this.search="",this.query={}),b&&(this.pathname=b),g[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){M=this.pathname||"";var z=this.search||"";this.path=M+z}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(function(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var u=Object.keys(t),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(r[l]=t[l])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!g[t.protocol]){for(var h=Object.keys(t),f=0;f<h.length;f++){var p=h[f];r[p]=t[p]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||v[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var y=r.pathname||"",m=r.search||"";r.path=y+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),w=t.host||t.pathname&&"/"===t.pathname.charAt(0),x=w||b||r.host&&t.pathname,_=x,T=r.pathname&&r.pathname.split("/")||[],k=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(k&&(r.hostname="",r.port=null,r.host&&(""===T[0]?T[0]=r.host:T.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),x=x&&(""===d[0]||""===T[0])),w)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,T=d;else if(d.length)T||(T=[]),T.pop(),T=T.concat(d),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search))return k&&(r.hostname=r.host=T.shift(),(N=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=N.shift(),r.host=r.hostname=N.shift())),r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!T.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=T.slice(-1)[0],O=(r.host||t.host||T.length>1)&&("."===A||".."===A)||""===A,E=0,j=T.length;j>=0;j--)"."===(A=T[j])?T.splice(j,1):".."===A?(T.splice(j,1),E++):E&&(T.splice(j,1),E--);if(!x&&!_)for(;E--;E)T.unshift("..");!x||""===T[0]||T[0]&&"/"===T[0].charAt(0)||T.unshift(""),O&&"/"!==T.join("/").substr(-1)&&T.push("");var N,S=""===T[0]||T[0]&&"/"===T[0].charAt(0);return k&&(r.hostname=r.host=S?"":T.length?T.shift():"",(N=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=N.shift(),r.host=r.hostname=N.shift())),(x=x||r.host&&T.length)&&!S&&T.unshift(""),T.length?r.pathname=T.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},944:t=>{"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},9397:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},4489:(t,e,r)=>{"use strict";var n=r(7092),i=r(7427),o=r(4010),a=r(2527);function s(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(u)var d=s(BigInt.prototype.valueOf);if(c)var y=s(Symbol.prototype.valueOf);function v(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function g(t){return"[object Map]"===l(t)}function m(t){return"[object Set]"===l(t)}function b(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function x(t){return"[object ArrayBuffer]"===l(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(x.working?x(t):t instanceof ArrayBuffer)}function T(t){return"[object DataView]"===l(t)}function k(t){return"undefined"!=typeof DataView&&(T.working?T(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||k(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},g.working="undefined"!=typeof Map&&g(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(g.working?g(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(b.working?b(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),e.isArrayBuffer=_,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=k;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===l(t)}function E(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function j(t){return v(t,h)}function N(t){return v(t,f)}function S(t){return v(t,p)}function R(t){return u&&v(t,d)}function I(t){return c&&v(t,y)}e.isSharedArrayBuffer=E,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=j,e.isStringObject=N,e.isBooleanObject=S,e.isBigIntObject=R,e.isSymbolObject=I,e.isBoxedPrimitive=function(t){return j(t)||N(t)||S(t)||R(t)||I(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||E(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},5663:(t,e,r)=>{var n=r(2530),i=r(292),o=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},a=/%[sdj%]/g;e.format=function(t){if(!w(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(l(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(t).replace(a,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r<i;s=n[++r])m(s)||!T(s)?o+=" "+s:o+=" "+l(s);return o},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,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 t.apply(this,arguments)}};var s={},u=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+c+"$","i")}function l(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._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,t,n.depth)}function h(t,e){var r=l.styles[e];return r?"["+l.colors[r][0]+"m"+t+"["+l.colors[r][1]+"m":t}function f(t,e){return t}function p(t,r,n){if(t.customInspect&&r&&O(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return w(i)||(i=p(t,i,n)),i}var o=function(t,e){if(x(e))return t.stylize("undefined","undefined");if(w(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),A(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(O(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(_(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return t.stylize(Date.prototype.toString.call(r),"date");if(A(r))return d(r)}var c,l="",h=!1,f=["{","}"];return v(r)&&(h=!0,f=["[","]"]),O(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(l=" "+RegExp.prototype.toString.call(r)),k(r)&&(l=" "+Date.prototype.toUTCString.call(r)),A(r)&&(l=" "+d(r)),0!==a.length||h&&0!=r.length?n<0?_(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=h?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a<s;++a)S(e,String(a))?o.push(y(t,e,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(y(t,e,r,n,i,!0))})),o}(t,r,n,s,a):a.map((function(e){return y(t,r,n,s,e,h)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,l,f)):f[0]+l+f[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function y(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),S(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(r)?p(t,u.value,null):p(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function v(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function w(t){return"string"==typeof t}function x(t){return void 0===t}function _(t){return T(t)&&"[object RegExp]"===E(t)}function T(t){return"object"==typeof t&&null!==t}function k(t){return T(t)&&"[object Date]"===E(t)}function A(t){return T(t)&&("[object Error]"===E(t)||t instanceof Error)}function O(t){return"function"==typeof t}function E(t){return Object.prototype.toString.call(t)}function j(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(u.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);i.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=l,l.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]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(4489),e.isArray=v,e.isBoolean=g,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=w,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=x,e.isRegExp=_,e.types.isRegExp=_,e.isObject=T,e.isDate=k,e.types.isDate=k,e.isError=A,e.types.isNativeError=A,e.isFunction=O,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(9397);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;i.log("%s - %s",(r=[j((t=new Date).getHours()),j(t.getMinutes()),j(t.getSeconds())].join(":"),[t.getDate(),N[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(8575),e._extend=function(t,e){if(!e||!T(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(R&&t[R]){var e;if("function"!=typeof(e=t[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),R&&Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,o(t))},e.promisify.custom=R,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,e).then((function(t){n.nextTick(a.bind(null,null,t))}),(function(t){n.nextTick(I.bind(null,t,a))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,o(t)),e}},4010:(t,e,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),a=r(3828),s=o("Object.prototype.toString"),u=r(4111)(),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),h=o("String.prototype.slice"),f={},p=Object.getPrototypeOf;u&&a&&p&&n(l,(function(t){if("function"==typeof c[t]){var e=new c[t];if(Symbol.toStringTag in e){var r=p(e),n=a(r,Symbol.toStringTag);if(!n){var i=p(r);n=a(i,Symbol.toStringTag)}f[t]=n.get}}}));var d=r(2527);t.exports=function(t){return!!d(t)&&(u&&Symbol.toStringTag in t?function(t){var e=!1;return n(f,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):h(s(t),8,-1))}},870:e=>{"use strict";e.exports=t},3333:(t,e,r)=>{var n=r(2125).default;function i(){"use strict";t.exports=i=function(){return e},t.exports.__esModule=!0,t.exports.default=t.exports;var e={},r=Object.prototype,o=r.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},s="function"==typeof Symbol?Symbol:{},u=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(t){h=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var i=e&&e.prototype instanceof y?e:y,o=Object.create(i.prototype),s=new j(n||[]);return a(o,"_invoke",{value:k(t,r,s)}),o}function p(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=f;var d={};function y(){}function v(){}function g(){}var m={};h(m,u,(function(){return this}));var b=Object.getPrototypeOf,w=b&&b(b(N([])));w&&w!==r&&o.call(w,u)&&(m=w);var x=g.prototype=y.prototype=Object.create(m);function _(t){["next","throw","return"].forEach((function(e){h(t,e,(function(t){return this._invoke(e,t)}))}))}function T(t,e){function r(i,a,s,u){var c=p(t[i],t,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==n(h)&&o.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}})}function k(t,e,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return{value:void 0,done:!0}}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=A(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=p(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function A(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,A(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),d;var i=p(n,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function N(t){if(t){var e=t[u];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(o.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return n.next=n}}return{next:S}}function S(){return{value:void 0,done:!0}}return v.prototype=g,a(x,"constructor",{value:g,configurable:!0}),a(g,"constructor",{value:v,configurable:!0}),v.displayName=h(g,l,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,g):(t.__proto__=g,h(t,l,"GeneratorFunction")),t.prototype=Object.create(x),t},e.awrap=function(t){return{__await:t}},_(T.prototype),h(T.prototype,c,(function(){return this})),e.AsyncIterator=T,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new T(f(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},_(x),h(x,l,"Generator"),h(x,u,(function(){return this})),h(x,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},e.values=N,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:N(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},e}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},2125:t=>{function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},8047:(t,e,r)=>{var n=r(3333)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},4343:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof i[n[e]]&&(t[t.length]=n[e]);return t}},4771:(t,e,r)=>{"use strict";function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}r.d(e,{Z:()=>n})},7061:(t,e,r)=>{"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,{Z:()=>n})},9900:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(8965);function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(0,n.Z)(i.key),i)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}},240:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(8965);function i(t,e,r){return(e=(0,n.Z)(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},886:(t,e,r)=>{"use strict";function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}r.d(e,{Z:()=>n})},4768:(t,e,r)=>{"use strict";function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)}r.d(e,{Z:()=>i})},4593:(t,e,r)=>{"use strict";r.d(e,{Z:()=>o});var n=r(7209),i=r(4771);function o(t,e){if(e&&("object"===(0,n.Z)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(t)}},8965:(t,e,r)=>{"use strict";r.d(e,{Z:()=>i});var n=r(7209);function i(t){var e=function(t,e){if("object"!==(0,n.Z)(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!==(0,n.Z)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"===(0,n.Z)(e)?e:String(e)}},7209:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}r.d(e,{Z:()=>n})}},a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var r=a[t]={id:t,loaded:!1,exports:{}};return o[t].call(r.exports,r,r.exports,s),r.loaded=!0,r.exports}s.m=o,s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},r=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,s.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var i=Object.create(null);s.r(i);var o={};e=e||[null,r({}),r([]),r(r)];for(var a=2&n&&t;"object"==typeof a&&!~e.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>t[e]));return o.default=()=>t,s.d(i,o),i},s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce(((e,r)=>(s.f[r](t,e),e)),[])),s.u=t=>t+".rdflib.min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n={},i="$rdf:",s.l=(t,e,r,o)=>{if(n[t])n[t].push(e);else{var a,u;if(void 0!==r)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l];if(h.getAttribute("src")==t||h.getAttribute("data-webpack")==i+r){a=h;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",i+r),a.src=t),n[t]=[e];var f=(e,r)=>{a.onerror=a.onload=null,clearTimeout(p);var i=n[t];if(delete n[t],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((t=>t(r))),e)return e(r)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),u&&document.head.appendChild(a)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;s.g.importScripts&&(t=s.g.location+"");var e=s.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");r.length&&(t=r[r.length-1].src)}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=t})(),(()=>{var t={179:0};s.f.j=(e,r)=>{var n=s.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,i)=>n=t[e]=[r,i]));r.push(n[2]=i);var o=s.p+s.u(e),a=new Error;s.l(o,(r=>{if(s.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,n[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[o,a,u]=r,c=0;if(o.some((e=>0!==t[e]))){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);u&&u(s)}for(e&&e(r);c<o.length;c++)i=o[c],s.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=self.webpackChunk$rdf=self.webpackChunk$rdf||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var u={};return(()=>{"use strict";s.r(u),s.d(u,{BlankNode:()=>f,Collection:()=>b,ConnectedStore:()=>Nr,DataFactory:()=>ur,Empty:()=>w,Fetcher:()=>Je,Formula:()=>K,IndexedFormula:()=>ft,Literal:()=>g,LiveStore:()=>Sr,N3Parser:()=>Ut,NamedNode:()=>d.Z,Namespace:()=>D,NextId:()=>jr,Node:()=>tt,Query:()=>nt,RDFParser:()=>Ne,RDFaProcessor:()=>Ee,SPARQLToQuery:()=>er,Serializer:()=>z,Statement:()=>N,Store:()=>ft,UpdateManager:()=>ir,UpdatesSocket:()=>cr,UpdatesVia:()=>lr,Util:()=>M,Variable:()=>I,blankNode:()=>wr,defaultGraph:()=>xr,fetcher:()=>dr,fromNT:()=>Or,graph:()=>yr,isBlankNode:()=>y.B2,isCollection:()=>y.uZ,isGraph:()=>y.NA,isLiteral:()=>y.n_,isNamedNode:()=>y.NX,isPredicate:()=>y.lx,isQuad:()=>y.PY,isRDFObject:()=>y.lt,isRDFlibObject:()=>y.Uc,isRDFlibPredicate:()=>y.nq,isRDFlibSubject:()=>y.f,isStatement:()=>y.Yi,isStore:()=>y.Pv,isSubject:()=>y.zz,isTerm:()=>y.jt,isVariable:()=>y.cG,jsonParser:()=>Ke,lit:()=>vr,literal:()=>_r,log:()=>L.Z,namedNode:()=>mr,parse:()=>Re,quad:()=>Tr,queryToSPARQL:()=>tr,serialize:()=>V,sparqlUpdateParser:()=>Se,st:()=>gr,sym:()=>mr,term:()=>Er,termValue:()=>Pe._,triple:()=>kr,uri:()=>S,variable:()=>br});var t=s(9900),e=s(7061),r=s(4771),n=s(4768),i=s(4593),o=s(886),a=s(240),c=s(8333),l=s(4806),h=s(9247);var f=function(s){(0,n.Z)(p,s);var u,l,f=(u=p,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function p(t){var n;return(0,e.Z)(this,p),n=f.call(this,p.getId(t)),(0,a.Z)((0,r.Z)(n),"termType",h.V1),(0,a.Z)((0,r.Z)(n),"classOrder",c.Z.BlankNode),(0,a.Z)((0,r.Z)(n),"isBlank",1),(0,a.Z)((0,r.Z)(n),"isVar",1),n}return(0,t.Z)(p,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.id<t.id?-1:this.id>t.id?1:0}},{key:"copy",value:function(t){var e=new p;return t.copyTo(this,e),e}},{key:"toCanonical",value:function(){return p.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return p.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(t){if(t){if("string"!=typeof t)throw new Error("Bad id argument to new blank node: "+t);if(t.includes("#")){var e=t.split("#");return e[e.length-1]}return t}return"n"+p.nextId++}}]),p}(l.Z);(0,a.Z)(f,"nextId",0),(0,a.Z)(f,"NTAnonymousNodePrefix","_:");var p=s(7209),d=s(6545),y=s(5904);const v={boolean:new d.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new d.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new d.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new d.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new d.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new d.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new d.Z("http://www.w3.org/2001/XMLSchema#string")};var g=function(s){(0,n.Z)(g,s);var u,l,f=(u=g,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function g(t,n,i){var o;return(0,e.Z)(this,g),o=f.call(this,t),(0,a.Z)((0,r.Z)(o),"termType",h.xH),(0,a.Z)((0,r.Z)(o),"classOrder",c.Z.Literal),(0,a.Z)((0,r.Z)(o),"datatype",v.string),(0,a.Z)((0,r.Z)(o),"isVar",0),(0,a.Z)((0,r.Z)(o),"language",""),n?(o.language=n,o.datatype=v.langString):o.datatype=i?d.Z.fromValue(i):v.string,o}return(0,t.Z)(g,[{key:"copy",value:function(){return new g(this.value,this.lang,this.datatype)}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&(!this.datatype&&!t.datatype||this.datatype&&this.datatype.equals(t.datatype))}},{key:"lang",get:function(){return this.language},set:function(t){this.language=t||""}},{key:"toNT",value:function(){return g.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(t){if("number"==typeof t.value)return""+t.value;if("string"!=typeof t.value)throw new Error("Value of RDF literal is not string or number: "+t.value);var e=t.value;return e='"'+(e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',t.language?e+="@"+t.language:t.datatype.equals(v.string)||(e+="^^"+t.datatype.toCanonical()),e}},{key:"fromBoolean",value:function(t){return new g(t?"1":"0",null,v.boolean)}},{key:"fromDate",value:function(t){if(!(t instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var e=function(t){return(""+(100+t)).slice(1,3)};return new g(t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z",null,v.dateTime)}},{key:"fromNumber",value:function(t){if("number"!=typeof t)throw new TypeError("Invalid argument to Literal.fromNumber()");var e,r=t.toString();return e=r.indexOf("e")<0&&Math.abs(t)<=Number.MAX_SAFE_INTEGER?Number.isInteger(t)?v.integer:v.decimal:v.double,new g(r,null,e)}},{key:"fromValue",value:function(t){if((0,y.n_)(t))return t;switch((0,p.Z)(t)){case"object":if(t instanceof Date)return g.fromDate(t);case"boolean":return g.fromBoolean(t);case"number":return g.fromNumber(t);case"string":return new g(t)}throw new Error("Can't make literal from "+t+" of type "+(0,p.Z)(t))}}]),g}(l.Z);function m(t){return null==t||(0,y.jt)(t)?t:Array.isArray(t)?new b(t):g.fromValue(t)}var b=function(s){(0,n.Z)(d,s);var u,l,p=(u=d,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function d(t){var n;return(0,e.Z)(this,d),n=p.call(this,(f.nextId++).toString()),(0,a.Z)((0,r.Z)(n),"termType",h.fb),(0,a.Z)((0,r.Z)(n),"classOrder",c.Z.Collection),(0,a.Z)((0,r.Z)(n),"closed",!1),(0,a.Z)((0,r.Z)(n),"compareTerm",f.prototype.compareTerm),(0,a.Z)((0,r.Z)(n),"elements",[]),(0,a.Z)((0,r.Z)(n),"isVar",0),t&&t.length>0&&t.forEach((function(t){n.elements.push(m(t))})),n}return(0,t.Z)(d,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"append",value:function(t){return this.elements.push(t)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(t){return new d(this.elements.map((function(e){return e.substitute(t)})))}},{key:"toNT",value:function(){return d.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(t){return this.elements.unshift(t)}}],[{key:"toNT",value:function(t){return f.NTAnonymousNodePrefix+t.id}}]),d}(l.Z);(0,a.Z)(b,"termType",h.fb);var w=function(s){(0,n.Z)(f,s);var u,c,l=(u=f,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(c){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function f(){var t;return(0,e.Z)(this,f),t=l.call(this,""),(0,a.Z)((0,r.Z)(t),"termType",h.ls),t}return(0,t.Z)(f,[{key:"toString",value:function(){return"()"}}]),f}(l.Z);function x(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function _(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){x(o,n,i,a,s,"next",t)}function s(t){x(o,n,i,a,s,"throw",t)}a(void 0)}))}}var T=s(8047),k=s.n(T),A="chrome:theSession";new d.Z(A);var O=function(s){(0,n.Z)(f,s);var u,c,l=(u=f,c=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(c){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function f(){var t;return(0,e.Z)(this,f),t=l.call(this,""),(0,a.Z)((0,r.Z)(t),"value",""),(0,a.Z)((0,r.Z)(t),"termType",h.NK),(0,a.Z)((0,r.Z)(t),"uri",A),t}return(0,t.Z)(f,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),f}(l.Z);function E(t){return!!t&&t.termType===h.NK}var j=new O,N=function(){function r(t,n,i,o){(0,e.Z)(this,r),(0,a.Z)(this,"subject",void 0),(0,a.Z)(this,"predicate",void 0),(0,a.Z)(this,"object",void 0),(0,a.Z)(this,"graph",void 0),this.subject=l.Z.fromValue(t),this.predicate=l.Z.fromValue(n),this.object=l.Z.fromValue(i),this.graph=null==o?j:l.Z.fromValue(o)}return(0,t.Z)(r,[{key:"why",get:function(){return this.graph},set:function(t){this.graph=t}},{key:"equals",value:function(t){return t.subject.equals(this.subject)&&t.predicate.equals(this.predicate)&&t.object.equals(this.object)&&t.graph.equals(this.graph)}},{key:"substitute",value:function(t){return new r(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),E(this.graph)?this.graph:this.graph.substitute(t))}},{key:"toCanonical",value:function(){var t=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==h.NK&&t.push(this.graph.toCanonical()),t.join(" ")+" ."}},{key:"toNT",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}},{key:"toNQ",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),E(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),r}(),S=s(3357);var R,I=function(s){(0,n.Z)(p,s);var u,l,f=(u=p,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function p(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,e.Z)(this,p),t=f.call(this,n),(0,a.Z)((0,r.Z)(t),"termType",h.UH),(0,a.Z)((0,r.Z)(t),"base","varid:"),(0,a.Z)((0,r.Z)(t),"classOrder",c.Z.Variable),(0,a.Z)((0,r.Z)(t),"isVar",1),(0,a.Z)((0,r.Z)(t),"uri",void 0),t.base="varid:",t.uri=S.join(n,t.base),t}return(0,t.Z)(p,[{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(t){var e;return null!=(e=t[this.toNT()])?e:this}},{key:"toString",value:function(){return p.toString(this)}}],[{key:"toString",value:function(t){return t.uri.slice(0,t.base.length)===t.base?"?".concat(t.uri.slice(t.base.length)):"?".concat(t.uri)}}]),p}(l.Z),C=function(t){return t.collections="COLLECTIONS",t.defaultGraphType="DEFAULT_GRAPH_TYPE",t.equalsMethod="EQUALS_METHOD",t.id="ID",t.identity="IDENTITY",t.reversibleId="REVERSIBLE_ID",t.variableType="VARIABLE_TYPE",t}({}),P=new O,F={supports:(R={},(0,a.Z)(R,C.collections,!1),(0,a.Z)(R,C.defaultGraphType,!1),(0,a.Z)(R,C.equalsMethod,!0),(0,a.Z)(R,C.identity,!1),(0,a.Z)(R,C.id,!0),(0,a.Z)(R,C.reversibleId,!1),(0,a.Z)(R,C.variableType,!0),R),blankNode:function(t){return new f(t)},defaultGraph:function(){return P},equals:function(t,e){return t===e||!t||!e||((0,y.PY)(t)||(0,y.PY)(e)?!(!(0,y.PY)(t)||!(0,y.PY)(e))&&this.equals(t.subject,e.subject)&&this.equals(t.predicate,e.predicate)&&this.equals(t.object,e.object)&&this.equals(t.graph,e.graph):!(!(0,y.jt)(t)||!(0,y.jt)(e))&&this.id(t)===this.id(e))},id:function(t){if(!t)return"undefined";if((0,y.PY)(t))return this.quadToNQ(t);switch(t.termType){case h.NK:return"defaultGraph";case h.UH:return I.toString(t);default:var e=this.termToNQ(t);if(e)return e;throw new Error("Can't id term with type '".concat(t.termType,"'"))}},isQuad:function(t){return t instanceof N},literal:function(t,e){if("string"!=typeof t&&!e)return g.fromValue(t);var r="string"==typeof t?t:""+t;return"string"==typeof e?-1===e.indexOf(":")?new g(r,e):new g(r,null,this.namedNode(e)):new g(r,null,e)},namedNode:function(t){return new d.Z(t)},quad:function(t,e,r,n){return new N(t,e,r,n||P)},triple:function(t,e,r,n){return this.quad(t,e,r,n)},quadToNQ:function(t){return"".concat(this.termToNQ(t.subject)," ").concat(this.termToNQ(t.predicate)," ").concat(this.termToNQ(t.object)," ").concat(this.termToNQ(t.graph)," .")},termToNQ:function(t){var e=this;switch(t.termType){case h.V1:return"_:"+t.value;case h.NK:return"";case h.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case h.xH:return g.toNT(t);case h._A:case h.XM:return"<"+t.value+">";case h.fb:return"("+t.elements.map((function(t){return e.termToNQ(t)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(t.termType,"')"))}},toNQ:function(t){return this.isQuad(t)?this.quadToNQ(t):this.termToNQ(t)},variable:function(t){return new I(t)}};const U=F;var L=s(7308);function D(t,e){var r=e||{namedNode:function(t){return new d.Z(t)}};return function(e){return r.namedNode(t+(e||""))}}var M=s(5115);function Z(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:U;return{boolean:t.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:t.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:t.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:t.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:t.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:t.namedNode("http://www.w3.org/2001/XMLSchema#string")}}Z(U);var B=s(9523),q=s.n(B),H=s(5619),$=s(292);function z(t){return new X(t)}var X=function(){function r(t){(0,e.Z)(this,r),(0,a.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,a.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,a.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,a.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,a.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var n=Object.keys(q()());for(var i in n){var o=q()()[n[i]](""),s=n[i];this.prefixes[o]=s,this.namespaces[s]=o}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||U,this.xsd=Z(this.rdfFactory)}return(0,t.Z)(r,[{key:"setBase",value:function(t){return this.base=t,this}},{key:"setFlags",value:function(t){return this.flags=t||"",this}},{key:"toStr",value:function(t){var e=t.toNT();return"Graph"===t.termType&&(this.formulas[e]=t),e}},{key:"fromStr",value:function(t){if("{"===t[0]){var e=this.formulas[t];return e||$.log("No formula object for "+t),e}return this.store.fromNT(t)}},{key:"setNamespaces",value:function(t){for(var e in t)this.setPrefix(e,t[e]);return this}},{key:"setPrefix",value:function(t,e){if("default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e){for(var r in this.prefixes)this.prefixes[r]==t&&delete this.prefixes[r];this.prefixes[e]=t,this.namespaces[t]=e}}},{key:"suggestPrefix",value:function(t,e){"default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e&&(t in this.namespaces||e in this.prefixes||(this.prefixes[e]=t,this.namespaces[t]=e))}},{key:"suggestNamespaces",value:function(t){for(var e in t)this.suggestPrefix(e,t[e]);return this}},{key:"checkIntegrity",value:function(){var t,e;for(t in this.namespaces)if(this.prefixes[this.namespaces[t]]!==t)throw new Error("Serializer integity error 1: "+t+", "+this.namespaces[t]+", "+this.prefixes[this.namespaces[t]]+"!");for(e in this.prefixes)if(this.namespaces[this.prefixes[e]]!==e)throw new Error("Serializer integity error 2: "+e+", "+this.prefixs[e]+", "+this.namespaces[this.prefixes[e]]+"!")}},{key:"makeUpPrefix",value:function(t){var e=t,r=function(e){return!!this.validPrefix.test(e)&&"ns"!==e&&!(e in this.namespaces)&&(this.prefixes[t]=e,this.namespaces[e]=t,e)}.bind(this);"#/".indexOf(e[e.length-1])>=0&&(e=e.slice(0,-1));var n=e.lastIndexOf("/");n>=0&&(e=e.slice(n+1));for(var i=0;i<e.length&&this.prefixchars.indexOf(e[i]);)i++;if((e=e.slice(0,i)).length<6&&r(e))return e;if(r(e.slice(0,3)))return e.slice(0,3);if(r(e.slice(0,2)))return e.slice(0,2);if(r(e.slice(0,4)))return e.slice(0,4);if(r(e.slice(0,1)))return e.slice(0,1);if(r(e.slice(0,5)))return e.slice(0,5);this.validPrefix.test(e)||(e="n");for(var o=0;;o++)if(r(e.slice(0,3)+o))return e.slice(0,3)+o}},{key:"rootSubjects",value:function(t){for(var e={},r={},n={},i=0;i<t.length;i++){var o=t[i],a=function(t){e.hasOwnProperty(t)||(e[t]=[]),e[t].push(o.subject)};[o.subject,o.predicate,o.object].map((function(t){"BlankNode"===t.termType?n[t.toNT()]=!0:"Collection"===t.termType&&t.elements.forEach((function(t){a(t)}))})),a(t[i].object);var s=r[this.toStr(o.subject)];s||(s=[]),s.push(o),r[this.toStr(o.subject)]=s}var u=[];for(var c in r)if(r.hasOwnProperty(c)){var l=this.fromStr(c);"BlankNode"===l.termType&&e[l]&&1===e[l].length||u.push(l)}this.incoming=e;for(var h={},f=0;f<u.length;f++)h[u[f].toNT()]=!0;return{roots:u,subjects:r,rootsHash:h,incoming:e}}},{key:"toN3",value:function(t){return this.statementsToN3(t.statements)}},{key:"explicitURI",value:function(t){var e;return this.flags.indexOf("r")<0&&this.base?t=S.refTo(this.base,t):this.flags.indexOf("u")>=0?t=function(t){for(var e,r="",n=0;n<t.length;n++)r+=(e=t.charCodeAt(n))>65535?"\\U"+("00000000"+e.toString(16)).slice(-8):e>126?"\\u"+("0000"+e.toString(16)).slice(-4):t[n];return r}(t):(e=decodeURI(t),t=encodeURI(e)),"<"+t+">"}},{key:"statementsToNTriples",value:function(t){var e=t.slice();e.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,a=this.rdfFactory,s=function t(e){if("Collection"!==e.termType)return i.atomicTermToN3(e);for(var s=e.elements,u=o.sym(n+"nill"),c=s.length-1;c>=0;c--){var l=a.blankNode();r+=t(l)+" "+t(o.sym(n+"first"))+" "+t(s[c])+".\n",r+=t(l)+" "+t(o.sym(n+"rest"))+" "+t(u)+".\n",u=l}return i.atomicTermToN3(u)},u=0;u<e.length;u++){var c=e[u],l="";l+=s(c.subject)+" ",l+=s(c.predicate)+" ",l+=s(c.object)+" ",this.flags.indexOf("q")>=0&&(l+=s(c.why)+" "),r+=l+=".\n"}return r}},{key:"statementsToN3",value:function(t){var e=this.store,n={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(t,r){return M.heavyCompareSPO(t,r,e,n)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(t){for(var e="",r=0;r<t;r++)e+=" ";return e},a=function t(e){for(var r="",n=0;n<e.length;n++){var i=e[n],o="string"==typeof i?i:t(i);if(0!==n){var a=r.slice(-1)||" ";","===o||";"===o||("."!==o||"0123456789.:".includes(a))&&(r+=" ")}r+=o}return r},s=function(t){for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(u(o,e))}return n}.bind(this);function u(t,e){return"BlankNode"!==t.termType||e.incoming[t]?[h(t,e)].concat([c(t,e)]).concat(["."]):l(t,e,!0).concat(["."])}var c=function(t,e){var r=[],n=null,o=e.subjects[this.toStr(t)]||[];if(void 0===o)throw new Error("Cant find statements for "+t);for(var a=[],s=0;s<o.length;s++){var u=o[s];u.predicate.uri===n?a.push(","):(n&&(r=r.concat([a]).concat([";"]),a=[]),r.push(i[u.predicate.uri]?i[u.predicate.uri]:h(u.predicate,e))),n=u.predicate.uri,a.push(l(u.object,e))}return r.concat([a])}.bind(this),l=function(t,e,r){return"BlankNode"!==t.termType||!r&&void 0!==e.rootsHash[t.toNT()]?h(t,e):e.subjects[this.toStr(t)]?["[",c(t,e),"]"]:"[]"}.bind(this);r.prototype.termToN3=h;var h=function(t,e){var r,n;switch(t.termType){case"Graph":return(n=(n=["{"]).concat(s(t.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<t.elements.length;r++)n.push([l(t.elements[r],e)]);return n.push(")"),n;default:return this.atomicTermToN3(t)}}.bind(this),f=function(){var t="";for(var e in this.flags.indexOf("d")<0&&this.defaultNamespace&&(t+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(e)&&this.namespacesUsed[e]&&(t+="@prefix "+this.prefixes[e]+": "+this.explicitURI(e)+".\n");return t+"\n"}.bind(this),p=s(t);return f()+function t(e,r){var n="",i=1e5;void 0===r&&(r=-1);for(var s=0;s<e.length;s++){var u=e[s];if("string"!=typeof u){var c=t(u,r+1);if(c.length<10*(80-4*r)&&c.indexOf('"""')<0){var l=a(u);l.length<80-4*r&&(u=l,c="")}c&&(i=1e4),n+=c}if("string"==typeof u){if(1===u.length&&"\n"===n.slice(-1)&&",.;".indexOf(u)>=0){n=n.slice(0,-1),"."==u&&"0123456789.:".includes(n.charAt(n.length-1))&&(n+=" ",i+=1),n+=u+"\n",i+=1;continue}if(i<4*r+4||i+u.length+1<80&&";.".indexOf(n[n.length-2])<0)n=n.slice(0,-1)+" "+u+"\n",i+=u.length+1;else{var h=o(4*r)+u;n+=h+"\n",i=h.length,r<0&&(n+="\n",i=1e5)}}}return n}(p)}},{key:"atomicTermToN3",value:function(t,e){switch(t.termType){case"BlankNode":case"Variable":return t.toNT();case"Literal":var r=t.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(t.datatype&&this.flags.indexOf("x")<0)switch(t.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":var n=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!n&&(r+=".0"),n||(r+="e0"),r;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===t.value?"true":"false"}var i=this.stringToN3(t.value);return t.language?i+="@"+t.language:t.datatype.equals(this.xsd.string)||(i+="^^"+this.atomicTermToN3(t.datatype,e)),i;case"NamedNode":return this.symbolToN3(t);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+t+" of termType: "+t.termType)}}},{key:"stringToN3",value:function(t,e){e||(e="e");var r,n,i,o,a,s="";for(t.length>20&&'"'!==t.slice(-1)&&e.indexOf("n")<0&&(t.indexOf("\n")>0||t.indexOf('"')>0)?(o='"""',a=this.forbidden3):(o='"',a=this.forbidden1),r=0;r<t.length&&(a.lastIndex=0,null!=a.exec(t.slice(r)));){n=r+a.lastIndex-1,s+=t.slice(r,n);var u=t[n];'"'===u&&'"""'===o&&'"""'!==t.slice(n,n+3)?s+=u:(i='\b\f\r\t\v\n\\"'.indexOf(u))>=0?s+="\\"+'bfrtvn\\"'[i]:e.indexOf("e")>=0?s+="\\u"+("000"+u.charCodeAt(0).toString(16).toLowerCase()).slice(-4):s+=u,r=n+1}return o+s+t.slice(r)+o}},{key:"symbolToN3",value:function(t){var e=t.uri,r=e.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=e.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===e.indexOf("http")||0===e.indexOf("ws")||0===e.indexOf("file"))){for(var n=!0,i=r+1;i<e.length;i++)if(this._notNameChars.indexOf(e[i])>=0){n=!1;break}if(n){var o=e.slice(r+1),a=e.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var s=this.prefixes[a];if(s||(s=this.makeUpPrefix(a)),s)return this.namespacesUsed[a]=!0,s+":"+o}}return this.explicitURI(e)}},{key:"writeStore",value:function(t){var e=this.store,r=e.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var a=e.fromNT(o);n&&a.equals(n)||t("\n"+this.atomicTermToN3(a)+" "+this.atomicTermToN3(e.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(e.statementsMatching(void 0,void 0,void 0,a))+" }.\n")}e.statementsMatching(void 0,e.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){t("\n<"+r.object.value+"> log:metadata {\n");var n=e.statementsMatching(void 0,void 0,void 0,r.subject);t(this.statementsToN3(this.statementsToN3(n))),t("}.\n")}));var s=[];n&&s.push(n);var u=[];s.map((function(t){u=u.concat(e.statementsMatching(void 0,void 0,void 0,t))})),t(this.statementsToN3(u))}},{key:"statementsToXML",value:function(t){var e=[];e["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(t){for(var e="",r=0;r<t;r++)e+=" ";return e},i=function t(e){for(var r="",n=0;n<e.length;n++){var i=e[n];r+="string"==typeof i?i:t(i)}return r},o=function(t){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(u(o,e))}return n}.bind(this);function a(t){return void 0===t?"@@@undefined@@@@":t.replace(/[&<"]/g,(function(t){switch(t[0]){case"&":return"&";case"<":return"<";case'"':return"""}}))}var s=function(t){return a(this.base?S.refTo(this.base,t.uri):t.uri)}.bind(this),u=function(t,e){var n,i,o,f,p=[],d=e.subjects[this.toStr(t)];if(void 0===d)return l(t,e);d.sort((function(t,e){var n=t.predicate.uri,i=e.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),a=i.substring(r.length),s=parseInt(o,10),u=parseInt(a,10);return isNaN(s)||isNaN(u)||s!==o||u!==a?n.localeCompare(i):s-u}));for(var y=0;y<d.length;y++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=d[y]).predicate.uri||n||"NamedNode"!==o.object.termType){if((f=o.predicate).uri.substr(0,r.length)===r){var v=f.uri.substr(r.length);v===parseInt(v,10).toString()&&(f=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=h(f),o.object.termType){case"BlankNode":p=1===e.incoming[o.object].length?p.concat(["<"+i+' rdf:parseType="Resource">',u(o.object,e),"</"+i+">"]):p.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":p=p.concat(["<"+i+' rdf:resource="'+s(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">',c(o.object,e),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var g=n?h(n):"rdf:Description",m="";return"BlankNode"===t.termType?e.incoming[t]&&1===e.incoming[t].length||(m=' rdf:nodeID="'+t.toNT().slice(2)+'"'):m=' rdf:about="'+s(t)+'"',["<"+g+m+">"].concat([p]).concat(["</"+g+">"])}.bind(this);function c(t,e){for(var r=[],n=0;n<t.elements.length;n++)r.push(u(t.elements[n],e));return r}var l=function(t,e){var r=[],n=e.subjects[this.toStr(t)];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=e.rootsHash[o.object.toNT()]?r.concat(["<"+h(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+h(o.predicate)+">"]):r.concat(["<"+h(o.predicate)+' rdf:parseType="Resource">',l(o.object,e),"</"+h(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+h(o.predicate)+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+h(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)+"</"+h(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+h(o.predicate)+' rdf:parseType="Collection">',c(o.object,e),"</"+h(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),h=function(t){var r=t.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),a=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return o;var s=this.prefixes[a];return s||(s=this.makeUpPrefix(a)),e[a]=!0,s+":"+o}.bind(this),f=o(t),p="<rdf:RDF";for(var d in this.defaultNamespace&&(p+=' xmlns="'+a(this.defaultNamespace)+'"'),e)if(e.hasOwnProperty(d)){var y=this.base&&this.flags.includes("z")?S.refTo(this.base,d):d;p+="\n xmlns:"+this.prefixes[d]+'="'+a(y)+'"'}return function t(e,r){var o,a="",s=1e5;r||(r=0);for(var u=0;u<e.length;u++){var c=e[u];if("string"!=typeof c){var l=t(c,r+1);l.length<10*(80-4*r)&&l.indexOf('"""')<0&&(o=i(c)).length<80-4*r&&(c=" "+o,l=""),l&&(s=1e4),a+=l}"string"==typeof c&&(s<4*r+4?(a=a.slice(0,-1)+" "+c+"\n",s+=c.length+1):(a+=(o=n(4*r)+c)+"\n",s=o.length))}return a}([p+=">",f,"</rdf:RDF>"],-1)}},{key:"statementsToJsonld",value:function(t){var e=this.statementsToN3(t),r=H.parse(e);return JSON.stringify(r,null,2)}}]),r}();function V(t,e,r,n,i,o){r=r||(null==t?void 0:t.value);var a=o||{};n=n||h.z8;try{var s=z(e);a.flags&&s.setFlags(a.flags);var u=e.statementsMatching(void 0,void 0,void 0,t);switch("namespaces"in e&&s.suggestNamespaces(e.namespaces),a.namespaces&&s.setNamespaces(a.namespaces),s.setBase(r),n){case h.Is:return c(null,s.statementsToXML(u));case h.qS:case h.sZ:return c(null,s.statementsToN3(u));case h.z8:case h.Eo:return s.setFlags("si"),c(null,s.statementsToN3(u));case h.aV:return s.setFlags("deinprstux"),c(null,s.statementsToNTriples(u));case h.ui:return s.setFlags("si dr"),c(null,s.statementsToJsonld(u));case h.b4:case h.lL:return s.setFlags("deinprstux q"),c(null,s.statementsToNTriples(u));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(t){if(i)return i(t,void 0);throw t}function c(t,e){return i?void i(t,e):e}}var G=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],W={first:"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",rest:"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",nil:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};function Q(t,e,r){var n=[];return r.reduce((function(e,r,i,o){var a;return n.push(t.quad(e,t.namedNode(W.first),o[i])),i<o.length-1?(a=t.blankNode(),n.push(t.quad(e,t.namedNode(W.rest),a))):n.push(t.quad(e,t.namedNode(W.rest),t.namedNode(W.nil))),a}),e),n}function Y(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.length;for(r<0&&(r=n+r);r<n;r++)if(t[r]===e)return r;return-1}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var K=function(s){(0,n.Z)(v,s);var u,f,p=(u=v,f=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(f){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function v(){var t,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]:[],s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],u=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,e.Z)(this,v),(t=p.call(this,"")).statements=n,t.constraints=i,t.initBindings=o,t.optional=s,(0,a.Z)((0,r.Z)(t),"termType",h._A),(0,a.Z)((0,r.Z)(t),"classOrder",c.Z.Graph),(0,a.Z)((0,r.Z)(t),"fetcher",void 0),(0,a.Z)((0,r.Z)(t),"isVar",0),(0,a.Z)((0,r.Z)(t),"ns",D),(0,a.Z)((0,r.Z)(t),"rdfFactory",void 0),t.rdfFactory=u&&u.rdfFactory||U;var l,f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return J(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?J(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(G);try{var d=function(){var e=l.value;t[e]=function(){var r;return(r=t.rdfFactory)[e].apply(r,arguments)}};for(f.s();!(l=f.n()).done;)d()}catch(t){f.e(t)}finally{f.f()}return t}return(0,t.Z)(v,[{key:"add",value:function(t,e,r,n){var i=this;return 1===arguments.length&&t.forEach((function(t){return i.add(t.subject,t.predicate,t.object,t.graph)})),this.statements.push(this.rdfFactory.quad(t,e,r,n))}},{key:"addStatement",value:function(t){return this.add(t)}},{key:"bnode",value:function(t){return this.rdfFactory.blankNode(t)}},{key:"addAll",value:function(t){var e=this;t.forEach((function(t){e.add(t.subject,t.predicate,t.object,t.graph)}))}},{key:"any",value:function(t,e,r,n){var i=this.anyStatementMatching(t,e,r,n);return null==i?null:null==t?i.subject:null==e?i.predicate:null==r?i.object:null}},{key:"anyValue",value:function(t,e,r,n){var i=this.any(t,e,r,n);return i?i.value:void 0}},{key:"anyJS",value:function(t,e,r,n){var i=this.any(t,e,r,n);return i?l.Z.toJS(i):void 0}},{key:"anyStatementMatching",value:function(t,e,r,n){var i=this.statementsMatching(t,e,r,n,!0);if(i&&0!==i.length)return i[0]}},{key:"id",value:function(t){return this.rdfFactory.id(t)}},{key:"statementsMatching",value:function(t,e,r,n,i){var o=this.statements.filter((function(i){return(!t||t.equals(i.subject))&&(!e||e.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))}));return i?0===o.length?[]:[o[0]]:o}},{key:"bottomTypeURIs",value:function(t){var e,r,n,i,o,a;for(var s in e=[],t)if(t.hasOwnProperty(s)){for(a=t[s],r=!0,n=0,i=(o=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(s))).length;n<i;n++)if(o[n].uri in t){r=!1;break}r&&(e[s]=a)}return e}},{key:"collection",value:function(){return new b}},{key:"each",value:function(t,e,r,n){var i=[],o=this.statementsMatching(t,e,r,n,!1);if(null==t)for(var a=0,s=o.length;a<s;a++)i.push(o[a].subject);else if(null==e)for(var u=0,c=o.length;u<c;u++)i.push(o[u].predicate);else if(null==r)for(var l=0,h=o.length;l<h;l++)i.push(o[l].object);else if(null==n)for(var f=0,p=o.length;f<p;f++)i.push(new d.Z(o[f].graph.value));return i}},{key:"equals",value:function(t){return!!t&&this.hashString()===t.hashString()}},{key:"findMembersNT",value:function(t){var e,r,n,i,o,a,s,u,c,l,h,f,p,d;for(var y in(f={})[t.toNT()]=!0,i={},a=this.transitiveClosure(f,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(a.hasOwnProperty(y)){for(var v=0,g=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(y))).length;v<g;v++)i[(p=s[v]).subject.toNT()]=p;for(var m=0,b=(u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(y))).length;m<b;m++)for(o=u[m],n=0,e=(c=this.statementsMatching(void 0,o)).length;n<e;n++)i[(p=c[n]).subject.toNT()]=p;for(var w=0,x=(l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(y))).length;w<x;w++)for(o=l[w],d=0,r=(h=this.statementsMatching(void 0,o)).length;d<r;d++)i[(p=h[d]).object.toNT()]=p}return i}},{key:"findMemberURIs",value:function(t){return this.NTtoURI(this.findMembersNT(t))}},{key:"findSubClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(t){var e,r,n,i,o,a;a=[];for(var s=0,u=(e=this.statementsMatching(t,void 0,void 0)).length;s<u;s++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(o=e[s]).predicate.uri)a[o.object.toNT()]=o;else for(var c=0,l=(r=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;c<l;c++)a[r[c].toNT()]=o;for(var h=0,f=(n=this.statementsMatching(void 0,void 0,t)).length;h<f;h++){o=n[h];for(var p=0,d=(i=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;p<d;p++)a[i[p].toNT()]=o}return this.transitiveClosure(a,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(t){return this.NTtoURI(this.findTypesNT(t))}},{key:"connectedStatements",value:function(t,e,r){r=r||[];for(var n=[t],i={},o={},a=[],s=this,u=function(t){var u=function(t){"BlankNode"!==t.termType||i[t.value]||(i[t.value]=!0,n.push(t))},c=s.statementsMatching(null,null,t,e).concat(s.statementsMatching(t,null,null,e));c=c.filter((function(t){if(r[t.predicate.value])return!1;var e=t.toNT();return!o[e]&&(o[e]=!0,!0)})),c.forEach((function(t){u(t.subject),u(t.object)})),a=a.concat(c)};n.length;)u(n.shift());return a}},{key:"formula",value:function(t){return new v}},{key:"fromNT",value:function(t){var e,r,n;switch(t[0]){case"<":return this.sym(t.slice(1,-1));case'"':if(n=void 0,e=void 0,(r=t.lastIndexOf('"'))<t.length-1)if("@"===t[r+1])n=t.slice(r+2);else{if("^^"!==t.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+t);e=this.fromNT(t.slice(r+3))}return t=(t=(t=(t=t.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(t,n||e);case"_":return this.rdfFactory.blankNode(t.slice(2));case"?":return new I(t.slice(1))}throw new Error("Can't convert from NT: "+t)}},{key:"holds",value:function(t,e,r,n){var i;if(1===arguments.length){if(!t)return!0;if(t instanceof Array){for(i=0;i<t.length;i++)if(!this.holds(t[i]))return!1;return!0}if((0,y.Yi)(t))return this.holds(t.subject,t.predicate,t.object,t.graph);if(t.statements)return this.holds(t.statements)}return null!=this.anyStatementMatching(t,e,r,n)}},{key:"holdsStatement",value:function(t){return this.holds(t.subject,t.predicate,t.object,t.graph)}},{key:"list",value:function(t,e){if(e.rdfFactory.supports.COLLECTIONS){var r=e.rdfFactory.collection();return t.forEach((function(t){r.append(t)})),r}var n=e.rdfFactory.blankNode(),i=Q(e.rdfFactory,n,t);return e.addAll(i),n}},{key:"NTtoURI",value:function(t){var e,r,n={};for(e in t)t.hasOwnProperty(e)&&(r=t[e],"<"===e[0]&&(n[e.slice(1,-1)]=r));return n}},{key:"serialize",value:function(t,e,r,n){return V(r,this,t,e,void 0,n)}},{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)})),r=new v;return r.addAll(e),r}},{key:"sym",value:function(t,e){if(e)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(t)}},{key:"the",value:function(t,e,r,n){var i=this.any(t,e,r,n);return null==i&&L.Z.error("No value found for the() {"+t+" "+e+" "+r+"}."),i}},{key:"transitiveClosure",value:function(t,e,r){var n,i,o,a,s,u={};Object.assign(u,t);for(var c={};;){if(null==(s=function(){for(var t in u)if(u.hasOwnProperty(t))return t}()))return c;for(n=0,i=(a=r?this.each(void 0,e,this.fromNT(s)):this.each(this.fromNT(s),e)).length;n<i;n++)(o=a[n].toNT())in c||o in u||(u[o]=u[s]);c[s]=u[s],delete u[s]}}},{key:"topTypeURIs",value:function(t){var e,r,n,i,o,a,s;for(r in a=[],t)if(t.hasOwnProperty(r)){for(s=t[r],i=0,e=0,n=(o=this.each(this.rdfFactory.namedNode(r),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;e<n;e++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==o[e].uri){i++;break}i||(a[r]=s)}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}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(t){return new I(t)}},{key:"whether",value:function(t,e,r,n){return this.statementsMatching(t,e,r,n,!1).length}}]),v}(l.Z);l.Z.fromValue=m;const tt=l.Z;var et={xsd:D("http://www.w3.org/2001/XMLSchema#")};l.Z.toJS=function(t){return(0,y.uZ)(t)?t.elements.map(l.Z.toJS):(0,y.n_)(t)?t.datatype.equals(et.xsd("boolean"))?"1"===t.value||"true"===t.value:t.datatype.equals(et.xsd("dateTime"))||t.datatype.equals(et.xsd("date"))?new Date(t.value):t.datatype.equals(et.xsd("integer"))||t.datatype.equals(et.xsd("float"))||t.datatype.equals(et.xsd("decimal"))?Number(t.value):t.value:t};var rt=s(292),nt=(0,t.Z)((function t(r,n){(0,e.Z)(this,t),this.pat=new ft,this.vars=[],this.name=r,this.id=n}));function it(t,e,r,n){function i(t){var e,r="";for(e in t)t.hasOwnProperty(e)&&(r+=" "+e+" -> "+t[e]);return r}function o(t){var e,r="Bindings: ",n=t.length;for(e=0;e<n;e++)r+=i(t[e][0])+";\n\t";return r}function a(t,e,r,n){var i;if(t.length!==e.length)return[];if(!t.length)return[[[],null]];var o=function(t,e,r,n){var i=r[t];if(void 0===i){if(t.isVar){var o=[];return o[t]=e,[[o,null]]}i=t}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[e]&&(e=n.redirections[e]),i.equals(e)||i.uri&&i.uri===A?[[[],null]]:[];if(t instanceof Array)return e instanceof Array?a(t,e,r):[];throw new Error("query.js: oops - code not written yet")}(t[0],e[0],r,n);if(0===o.length)return o;var s,u,c,l,h,f,p,d=[],y=o.length;for(s=0;s<y;s++){for(h in p=[],u=o[s][0])u.hasOwnProperty(h)&&(p[h]=u[h]);for(h in r)r.hasOwnProperty(h)&&(p[h]=r[h]);for(l=(i=a(t.slice(1),e.slice(1),p,n)).length,c=0;c<l;c++){for(h in f=i[c][0],u)u.hasOwnProperty(h)&&(f[h]=u[h]);d.push([f,null])}}return d}function s(t,e){var r,n={};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}function u(t,e){return this.trunkBindings=e,this.originalCallback=t,this.branches=[],this}function c(t,e){return this.count=0,this.success=!1,this.done=!1,this.callback=t,this.onDone=e,this}u.prototype.checkAllDone=function(){var t;for(t=0;t<this.branches.length;t++)if(!this.branches[t].done)return;L.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},u.prototype.doCallBacks=function(t,e){var r;if(t<0)return this.originalCallback(e);for(r=0;r<this.branches[t].results.length;r++)this.doCallBacks(t-1,s(e,this.branches[t].results[r]))},c.prototype.reportMatch=function(t){this.callback(t),this.success=!0},c.prototype.reportDone=function(){this.done=!0,L.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(t){return this.count=0,this.done=!1,this.results=[],this.junction=t,t.branches.push(this),this};function h(t,e,r){var n,i,o,a,s,u;for(e.nvars=0,e.index=null,n=[e.subject,e.predicate,e.object,e.why],a=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],o=0;o<4;o++){var c=n[o];if(c.uri&&c.uri===A);else if(c.isVar&&void 0===r[c])e.nvars++;else{if(void 0,c=void 0===(u=r[s=n[o]])?s:u,t.redirections[t.id(c)]&&(c=t.redirections[t.id(c)]),!(i=a[o][t.id(c)]))return e.index=[],!1;(null===e.index||e.index.length>i.length)&&(e.index=i)}}return null===e.index&&(e.index=t.statements),!0}function f(t,e){return t.nvars!==e.nvars?t.nvars-e.nvars:t.index.length-e.index.length}l.prototype.reportMatch=function(t){this.results.push(t)},l.prototype.reportDone=function(){L.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),L.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var p=function t(r,n,o,a,s,c,h){L.Z.debug("Match begins, Branch count now: "+h.count+" for "+h.pattern_debug);var f,p,d=n.statements;if(0===d.length){if(L.Z.debug("FOUND MATCH WITH BINDINGS:"+i(o)),0===n.optional.length)h.reportMatch(o);else{L.Z.debug("OPTIONAL: "+n.optional);var v,g=new u(e,o),m=[];for(v=0;v<n.optional.length;v++)m[v]=new l(g),m[v].pattern_debug=n.optional[v];for(v=0;v<n.optional.length;v++)m[v].count=m[v].count+1,t(r,n.optional[v],o,"",s,e,m[v])}return h.count--,void L.Z.debug("Match ends -- success , Branch count now: "+h.count+" for "+h.pattern_debug)}var b=d.length;if(s){var w=function(e,i){var u=e.uri.split("#")[0];s.nowOrWhenFetched(u,void 0,(function(i,u,l){i||rt.log("Error following link to <"+e.uri+"> in query: "+u),t(r,n,o,a,s,c,h)}))};for(p=0;p<b;p++){if(f=d[p],void 0!==o[f.subject]&&o[f.subject].uri&&s&&"unrequested"===s.getState((0,S.docpart)(o[f.subject].uri)))return void w(o[f.subject]);if(void 0!==o[f.object]&&o[f.object].uri&&s&&"unrequested"===s.getState((0,S.docpart)(o[f.object].uri)))return void w(o[f.object])}}y(r,n,o,a,s,c,h)},d=function(t,e){var r,n,i=!0;for(r in t)t.hasOwnProperty(r)&&e[r]&&(n=e[r].test)&&!n(t[r])&&(i=!1);return i},y=function(t,e,r,n,s,u,c){var l,y,v,g,m,b,w,x=e.statements,_=x.length;for(l=0;l<_;l++)h(t,w=x[l],r);x.sort(f),w=x[0];var T,k=t.formula();k.optional=e.optional,k.constraints=e.constraints,k.statements=x.slice(1),L.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var A,O,E=w.index.length,j=0;for(T=0;T<E;T++)for(O=w.index[T],A=a([w.subject,w.predicate,w.object,w.why],[O.subject,O.predicate,O.object,O.why],r,t),L.Z.info(n+" From first: "+A.length+": "+o(A)),v=A.length,y=0;y<v;y++)if(m=[],b=A[y][0],d(b,e.constraints)){for(g in b)b.hasOwnProperty(g)&&(m[g]=b[g]);for(g in r)r.hasOwnProperty(g)&&(m[g]=r[g]);c.count++,j++,p(t,k,m,n+" ",s,u,c)}else L.Z.debug("Branch count CS: "+c.count);c.count--,0===j&&L.Z.debug("Match2 fails completely on "+w),L.Z.debug("Match2 ends, Branch count: "+c.count+" for "+c.pattern_debug),0===c.count&&(L.Z.debug("Branch finished."),c.reportDone())},v=this;L.Z.debug("Query on "+this.statements.length);var g=new c(e,n);g.count++,t.sync?p(v,t.pat,t.pat.initBindings,"",r,e,g):setTimeout((function(){p(v,t.pat,t.pat.initBindings,"",r,e,g)}),0)}function ot(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function at(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(r),!0).forEach((function(e){(0,a.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function st(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ut="http://www.w3.org/2002/07/owl#";function ct(t,e,r,n){var i=t.any(e,r,void 0);return!!i&&(t.equate(i,n),!0)}function lt(t,e,r,n){var i=t.any(void 0,r,n);return!!i&&(t.equate(i,e),!0)}function ht(t,e,r,n,i){t.typeCallback&&t.typeCallback(t,n,i);var o=t.classActions[t.id(n)],a=!1;if(o)for(var s=0;s<o.length;s++)a=a||o[s](t,e,r,n,i);return a}var ft=function(s){(0,n.Z)(v,s);var u,l,p=(u=v,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=(0,o.Z)(u);if(l){var r=(0,o.Z)(this).constructor;t=Reflect.construct(e,arguments,r)}else t=e.apply(this,arguments);return(0,i.Z)(this,t)});function v(t){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,e.Z)(this,v),n=p.call(this,void 0,void 0,void 0,void 0,i),(0,a.Z)((0,r.Z)(n),"updater",void 0),(0,a.Z)((0,r.Z)(n),"namespaces",void 0),(0,a.Z)((0,r.Z)(n),"classActions",void 0),(0,a.Z)((0,r.Z)(n),"propertyActions",void 0),(0,a.Z)((0,r.Z)(n),"redirections",void 0),(0,a.Z)((0,r.Z)(n),"aliases",void 0),(0,a.Z)((0,r.Z)(n),"HTTPRedirects",void 0),(0,a.Z)((0,r.Z)(n),"subjectIndex",void 0),(0,a.Z)((0,r.Z)(n),"predicateIndex",void 0),(0,a.Z)((0,r.Z)(n),"objectIndex",void 0),(0,a.Z)((0,r.Z)(n),"whyIndex",void 0),(0,a.Z)((0,r.Z)(n),"index",void 0),(0,a.Z)((0,r.Z)(n),"features",void 0),(0,a.Z)((0,r.Z)(n),"_universalVariables",void 0),(0,a.Z)((0,r.Z)(n),"_existentialVariables",void 0),(0,a.Z)((0,r.Z)(n),"rdfArrayRemove",void 0),(0,a.Z)((0,r.Z)(n),"dataCallbacks",void 0),n.propertyActions={},n.classActions={},n.redirections=[],n.aliases=[],n.HTTPRedirects=[],n.subjectIndex=[],n.predicateIndex=[],n.objectIndex=[],n.whyIndex=[],n.index=[n.subjectIndex,n.predicateIndex,n.objectIndex,n.whyIndex],n.namespaces={},n.features=t||[],n.rdfArrayRemove=i.rdfArrayRemove||M.RDFArrayRemove,i.dataCallback&&(n.dataCallbacks=[i.dataCallback]),n.initPropertyActions(n.features),n}return(0,t.Z)(v,[{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)})),r=new v;return r.add(e),r}},{key:"addDataCallback",value:function(t){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(t)}},{key:"applyPatch",value:function(t,e,r){var n,i=this,o=null;function a(a){if(t.delete){n=t.delete,o&&(n=n.substitute(o)),n=n.statements;var s=[],u=n.map((function(t){var r=i.statementsMatching(t.subject,t.predicate,t.object,e);return 0===r.length?(s.push(t),null):r[0]}));if(s.length)return r("Could not find to delete: "+s.join("\n or "));u.map((function(t){i.remove(t)}))}t.insert&&(n=t.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(t){t.graph=e,i.add(t.subject,t.predicate,t.object,t.graph)}))),a()}if(t.where){var s=new nt("patch");s.pat=t.where,s.pat.statements.map((function(t){t.graph=mr(e.value)})),s.sync=!0;var u=[];i.query(s,(function(t){u.push(t)}),i.fetcher,(function(){return 0===u.length?r("No match found to be patched:"+t.where):u.length>1?r("Patch ambiguous. No patch done."):(o=u[0],void a(r))}))}else a(r)}},{key:"declareExistential",value:function(t){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(t),t}},{key:"initPropertyActions",value:function(t){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[ht],Y(t,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(ut,"sameAs")))]=[function(t,e,r,n,i){return t.equate(e,n),!0}]),Y(t,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(ut,"InverseFunctionalProperty")))]=[function(t,e,r,n,i){return t.newPropertyAction(e,lt)}]),Y(t,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(ut,"FunctionalProperty")))]=[function(t,e,r,n,i){return t.newPropertyAction(e,ct)}])}},{key:"addStatement",value:function(t){return this.add(t.subject,t.predicate,t.object,t.graph),this.statements.length}},{key:"add",value:function(t,e,r,n){var i,o,a;if(1===arguments.length){if(t instanceof Array)for(i=0;i<t.length;i++)this.add(t[i]);else(0,y.PY)(t)?this.add(t.subject,t.predicate,t.object,t.graph):(0,y.Pv)(t)&&this.add(t.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof t&&(t=this.rdfFactory.namedNode(t)),e=tt.fromValue(e);var s=tt.fromValue(r);if(n=tt.fromValue(n),!(0,y.f)(t))throw new Error("Subject is not a subject type");if(!(0,y.nq)(e))throw new Error("Predicate ".concat(e," is not a predicate type"));if(!(0,y.Uc)(s))throw new Error("Object ".concat(s," is not an object type"));if(!(0,y.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,e,n);var u=this.id(this.canon(e)),c=!1;if(o=this.propertyActions[u])for(i=0;i<o.length;i++)c=c||o[i](this,t,e,s,n);if(this.holds(t,e,s,n))return null;var l=[this.id(this.canon(t)),u,this.id(this.canon(s)),this.id(this.canon(n))];for(a=this.rdfFactory.quad(t,e,s,n),i=0;i<4;i++){var h=this.index[i],f=l[i];h[f]||(h[f]=[]),h[f].push(a)}if(this.statements.push(a),this.dataCallbacks){var p,d=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return st(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?st(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(this.dataCallbacks);try{for(d.s();!(p=d.n()).done;)(0,p.value)(a)}catch(t){d.e(t)}finally{d.f()}}return a}},{key:"canon",value:function(t){if(!t)return t;var e=this.redirections[this.id(t)];if(e)return e;switch(t.termType){case h.V1:return new f(t.value);case h.fb:return t;case h.NK:return new O;case h.ls:case h._A:return t;case h.xH:return new g(t.value,t.language,t.datatype);case h.XM:return new d.Z(t.value);case h.UH:return new I(t.value);default:throw new Error("Term Type not recognized for canonization: ".concat(t.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var t=0;t<4;t++){var e=this.index[t];for(var r in e)e.hasOwnProperty(r)&&this.checkStatementList(e[r],t)}}},{key:"checkStatementList",value:function(t,e){void 0===e&&(e=0);for(var r,n=" found in "+["subject","predicate","object","why"][e]+" index.",i=0;i<t.length;i++){for(var o=[(r=t[i]).subject,r.predicate,r.object,r.graph],a=function(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.graph))return!0},s=0;s<4;s++){var u=this.canon(o[s]),c=this.id(u);this.index[s][c]&&a(this.index[s][c],r)}if(!a(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}},{key:"close",value:function(){return this}},{key:"compareTerms",value:function(t,e){return Object.prototype.hasOwnProperty.call(t,"compareTerm")?t.compareTerm(e):c.Z[t.termType]<c.Z[e.termType]?-1:c.Z[t.termType]>c.Z[e.termType]?1:t.value<e.value?-1:t.value>e.value?1:0}},{key:"copyTo",value:function(t,e,r){r||(r=[]);var n=this.statementsMatching(t);-1!==Y(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,t));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(e,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(e,o.predicate,o.object.copy(this))}-1!==Y(r,"delete")&&this.remove(o)}}},{key:"equate",value:function(t,e){var r=this.canon(t),n=this.canon(e),i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}},{key:"formula",value:function(t){return new v(t)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(t,e,r,n){return this.statementsMatching(tt.fromValue(t),tt.fromValue(e),tt.fromValue(r),tt.fromValue(n))}},{key:"mentionsURI",value:function(t){var e="<"+t+">";return!!this.subjectIndex[e]||!!this.objectIndex[e]||!!this.predicateIndex[e]}},{key:"newExistential",value:function(t){if(!t)return this.bnode();var e=this.sym(t);return this.declareExistential(e)}},{key:"newPropertyAction",value:function(t,e){var r=this.id(t);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(e);for(var n=this.statementsMatching(void 0,t,void 0),i=!1,o=0;o<n.length;o++)i=i||e(this,n[o].subject,t,n[o].object);return i}},{key:"newUniversal",value:function(t){var e=this.sym(t);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(e),e}},{key:"variable",value:function(t){return new I(t)}},{key:"nextSymbol",value:function(t){for(var e=0;;e++){var r=t.value+"#n"+e;if(!this.mentionsURI(r))return this.sym(r)}}},{key:"query",value:function(t,e,r,n){return it.call(this,t,e,r,n)}},{key:"querySync",value:function(t){var e=[],r=!1;if(t.sync=!0,it.call(this,t,(function(t){e.push(t)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return e}},{key:"remove",value:function(t){if(t instanceof Array){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}if((0,y.Pv)(t))return this.remove(t.statements);var r=this.statementsMatching(t.subject,t.predicate,t.object,t.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+t);return this.removeStatement(r[0]),this}},{key:"removeDocument",value:function(t){this.removeMetadata(t);for(var e=this.statementsMatching(void 0,void 0,void 0,t).slice(),r=0;r<e.length;r++)this.removeStatement(e[r]);return this.removeMatches(t,null,null),this}},{key:"removeMetadata",value:function(t){for(var e=this.sym("chrome://TheCurrentSession"),r="http://www.w3.org/2007/ont/link#",n=this.statementsMatching(void 0,this.sym("".concat(r,"requestedURI")),this.rdfFactory.literal(t.value),e).map((function(t){return t.subject})),i=0;i<n.length;i++){var o=n[i];if(null!=o){var a=void 0,s=this.any(o,this.sym("".concat(r,"status")),null,e);if(null!=s){a=this.statementsMatching(s,this.sym("".concat(r,"status")),null,e).slice();for(var u=0;u<a.length;u++)this.removeStatement(a[u])}var c=this.any(o,this.sym("".concat(r,"response")),null,e);if(null!=c)for(a=this.statementsMatching(c,null,null,e).slice(),u=0;u<a.length;u++)this.removeStatement(a[u]);for(a=this.statementsMatching(o,null,null,e).slice(),u=0;u<a.length;u++)this.removeStatement(a[u])}}return this.removeMatches(this.sym(t.value),null,null,e),this}},{key:"removeMany",value:function(t,e,r,n,i){for(var o=this.statementsMatching(t,e,r,n,!1),a=[],s=0;s<o.length;s++)a.push(o[s]);for(i&&(a=a.slice(0,i)),s=0;s<a.length;s++)this.remove(a[s])}},{key:"removeMatches",value:function(t,e,r,n){return this.removeMany(t,e,r,n),this}},{key:"removeStatement",value:function(t){for(var e=[t.subject,t.predicate,t.object,t.graph],r=0;r<4;r++){var n=this.canon(e[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],t)}return this.rdfArrayRemove(this.statements,t),this}},{key:"removeStatements",value:function(t){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}},{key:"replaceWith",value:function(t,e){for(var r=this.id(t),n=this.id(e),i=function(t){var e=t[r];if(e){var i=t[n];t[n]=i?e.concat(i):e,delete t[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=e,t.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(t),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=e,this.aliases[n].push(this.aliases[r][o]);this.add(e,this.sym("http://www.w3.org/2007/ont/link#uri"),t),this.fetcher&&this.fetcher.nowKnownAs(t,e)}return i(this.classActions),i(this.propertyActions),!0}},{key:"allAliases",value:function(t){var e=this.aliases[this.id(this.canon(t))]||[];return e.push(this.canon(t)),e}},{key:"sameThings",value:function(t,e){if(t.equals(e))return!0;var r=this.canon(t);if(!r)return!1;var n=this.canon(e);return!!n&&r.value===n.value}},{key:"setPrefixForURI",value:function(t,e){if(("tab"!==t||!this.namespaces.tab)&&"ns"!==t.slice(0,2)&&"default"!==t.slice(0,7)){for(var r in this.namespaces)this.namespaces[r]==e&&delete this.namespaces[r];this.namespaces[t]=e}}},{key:"statementsMatching",value:function(t,e,r,n,i){var o,a,s=[t,e,r,n],u=[],c=[],l=[],h=[];for(o=0;o<4;o++)u[o]=this.canon(tt.fromValue(s[o])),u[o]?(h.push(o),c[o]=this.id(u[o])):l.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(a=this.index[o][c[o]])&&i&&a.length>1&&(a=a.slice(0,1)),a||[];var f,p,d=1e10;for(p=0;p<h.length;p++){if(o=h[p],!(a=this.index[o][c[o]]))return[];a.length<d&&(d=a.length,f=p)}for(var y=h[f],v=this.index[y][c[y]],g=h.slice(0,f).concat(h.slice(f+1)),m=[],b=["subject","predicate","object","why"],w=0;w<v.length;w++){var x=v[w];for(p=0;p<g.length;p++)if(o=g[p],!this.canon(x[b[o]]).equals(u[o])){x=null;break}if(null!=x&&(m.push(x),i))break}return m}},{key:"uris",value:function(t){var e=this.canon(t),r=this.aliases[this.id(e)];if(!e.value)return[];var n=[e.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}},{key:"serialize",value:function(t,e,r,n){var i,o=null!==(i=n)&&void 0!==i&&i.namespaces?at(at({},this.namespaces),n.namespaces):at({},this.namespaces);return V(r,this,t,e,void 0,n=at(at({},n||{}),{},{namespaces:o}))}}],[{key:"defaultGraphURI",get:function(){return A}}]),v}(K);function pt(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return dt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?dt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function dt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}(0,a.Z)(ft,"handleRDFType",void 0),ft.handleRDFType=ht;var yt=D("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function vt(t,e){function r(n,i,o){var a=t.statementsMatching(n,yt("rest"),null,e);if(1!==a.length)throw new Error("Bad list structure: no rest at ".concat(n));var s=t.statementsMatching(n,yt("first"),null,e);if(1!==s.length)throw new Error("Bad list structure: rest but ".concat(s.length," firsts at ").concat(n));var u=[s[0].object].concat(i),c=o.concat(a).concat(s),l=t.statementsMatching(null,yt("rest"),n,e);if(0===l.length){var h=new b(u);return t.remove(c),void function(t,e,r,n){var i,o=pt(t.statementsMatching(r,null,null,n));try{for(o.s();!(i=o.n()).done;){var a=i.value,s=new N(e,a.predicate,a.object,n);t.remove(a),t.add(s)}}catch(t){o.e(t)}finally{o.f()}var u,c=pt(t.statementsMatching(null,r,null,n));try{for(c.s();!(u=c.n()).done;){var l=u.value;t.remove(l),t.add(new N(l.subject,e,l.object,n))}}catch(t){c.e(t)}finally{c.f()}var h,f=pt(t.statementsMatching(null,null,r,n));try{for(f.s();!(h=f.n()).done;){var p=h.value;t.remove(p),t.add(new N(p.subject,p.predicate,e,n))}}catch(t){f.e(t)}finally{f.f()}}(t,h,n,e)}if(1!==l.length)throw new Error("Bad list structure: ".concat(l.length," pres at ").concat(n));var f=l[0].subject;if("BlankNode"!==f.termType)throw new Error("Bad list element node ".concat(f," type: ").concat(f.termType," "));r(f,u,c)}!function(t,e){var r,n=yt("nil"),i=pt(t.statementsMatching(n,null,null,e));try{for(i.s();!(r=i.n()).done;){var o=r.value;t.remove(o);var a=new b;t.add(new N(a,o.predicate,o.object,e))}}catch(t){i.e(t)}finally{i.f()}var s,u=pt(t.statementsMatching(null,null,n,e));try{for(u.s();!(s=u.n()).done;){var c=s.value;if(!c.predicate.sameTerm(yt("rest"))){t.remove(c);var l=new b;t.add(new N(c.subject,c.predicate,l,e))}}}catch(t){u.e(t)}finally{u.f()}}(t,e),t.statementsMatching(null,yt("rest"),yt("nil"),e).forEach((function(t){if("BlankNode"!==t.subject.termType)throw new Error("Bad list element node ".concat(t.subject," type: ").concat(t.subject.termType," "));r(t.subject,[],[])}))}var gt="http://www.w3.org/2000/10/swap/log#",mt=function(t){return t},bt=function(t){return t},wt=function(t){if(t.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},xt=function(t){return t.length},_t=function(t,e,r){if(void 0===t.slice)throw"@@ mising.js: No .slice function for "+t+" of type "+(0,p.Z)(t);return void 0===r||null==r?t.slice(e):t.slice(e,r)},Tt=Error("dummy error stop iteration"),kt=function(t){return this.last=0,this.li=t,this.next=function(){if(this.last==this.li.length)throw Tt;return this.li[this.last++]},this},At=function(t,e){return t.indexOf(e)},Ot=function(t,e){if(!t){if(e)throw"python Assertion failed: "+e;throw"(python) Assertion failed."}};String.prototype.encode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return function(t){t=t.replace(/\r\n/g,"\n");for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}(this)},String.prototype.decode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return this};var Et=function(t,e){return S.join(e,t)},jt="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",Nt="http://www.w3.org/2002/07/owl#sameAs",St="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",Rt=St+":",It=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),Ct=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?"),Pt=new RegExp('[\\\\\\r\\n\\"]',"g"),Ft=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const Ut=function(t,e,r,n,i,o,a,s){return new Dt(t,e,r,n,i,o,a,s)};var Lt,Dt=function(){function r(t,n,i,o,a,s,u,c){(0,e.Z)(this,r),void 0===n&&(n=null),void 0===i&&(i=""),void 0===o&&(o=null),void 0===a&&(a=""),void 0===s&&(s=null),void 0===u&&(u=""),void 0===c&&(c=null),this._bindings=new wt([]),this._flags=u,""!=i&&(Ot(i.indexOf(":")>=0,"Document URI not absolute: "+i),this._bindings[""]=i+"#"),this._store=t,a&&t.setGenPrefix(a),this._thisDoc=i,this.source=t.sym(i),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=a,this.keywords=new bt(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new wt([]),this._variables=new wt([]),this._parentVariables=new wt([]),this._reason=c,this._reason2=null,this._baseURI=o||i||null,Ot(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==n?this._thisDoc?this._formula=t.formula(i+"#_formula"):this._formula=t.formula():this._formula=n,this._context=this._formula,this._parentContext=null}return(0,t.Z)(r,[{key:"here",value:function(t){return this._genPrefix+"_L"+this.lines+"C"+(t-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(t){return this.loadBuf(t.read())}},{key:"loadBuf",value:function(t){return this.startDoc(),this.feed(t),this.endDoc()}},{key:"feed",value:function(t){for(var e=t.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(e,r);if(n<0)return;if((r=this.directiveOrStatement(e,n))<0)throw Mt(this._thisDoc,this.lines,e,n,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(t,e){var r,n=this.skipSpace(t,e);return n<0?n:(r=this.directive(t,n))>=0||(r=this.statement(t,n))>=0?this.checkDot(t,r):r}},{key:"tok",value:function(t,e,r){if("@"==e.slice(r,r+1))r+=1;else if(Y(this.keywords,t)<0)return-1;var n=r+xt(t);return e.slice(r,n)==t&&St.indexOf(e.charAt(n))>=0?n:-1}},{key:"directive",value:function(t,e){if((o=this.skipSpace(t,e))<0)return o;var r=new bt([]);if((o=this.tok("bind",t,e))>0)throw Mt(this._thisDoc,this.lines,t,e,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",t,e))>0){if((e=this.commaSeparatedList(t,o,r,!1))<0)throw Mt(this._thisDoc,this.lines,t,e,"'@keywords' needs comma separated list of words");return this.setKeywords(_t(r,null,null)),e}if((o=this.tok("forAll",t,e))>0){if((e=this.commaSeparatedList(t,o,r,!0))<0)throw Mt(this._thisDoc,this.lines,t,e,"Bad variable list after @forAll");var n=new kt(r);try{for(;;){var i=n.next();(Y(this._variables,i)<0||Y(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(t){if(t!=Tt)throw t}return e}if((o=this.tok("forSome",t,e))>0){if((e=this.commaSeparatedList(t,o,r,this.uri_ref2))<0)throw Mt(this._thisDoc,this.lines,t,e,"Bad variable list after @forSome");n=new kt(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(t){if(t!=Tt)throw t}return e}if((o=this.tok("prefix",t,e))>=0){var o,a=new bt([]);if((e=this.qname(t,o,a))<0)throw Mt(this._thisDoc,this.lines,t,o,"expected qname after @prefix");if((o=this.uri_ref2(t,e,a))<0)throw Mt(this._thisDoc,this.lines,t,e,"expected <uriref> after @prefix _qname_");var s=a[1].uri;return this._baseURI?s=Et(this._baseURI,s):Ot(s.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),Ot(s.indexOf(":")>=0),this._bindings[a[0][0]]=s,this.bind(a[0][0],function(t){return encodeURI(t)}(s)),o}if((o=this.tok("base",t,e))>=0){if(a=new bt([]),(e=this.uri_ref2(t,o,a))<0)throw Mt(this._thisDoc,this.lines,t,o,"expected <uri> after @base ");if(s=a[0].uri,!this._baseURI)throw Mt(this._thisDoc,this.lines,t,o,"With no previous base URI, cannot use relative URI in @base <"+s+">");return s=Et(this._baseURI,s),Ot(s.indexOf(":")>=0),this._baseURI=s,e}return-1}},{key:"bind",value:function(t,e){""==t||this._store.setPrefixForURI(t,e)}},{key:"setKeywords",value:function(t){null==t?this.keywordsSet=0:(this.keywords=t,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&vt(this._store,this.source),this._formula}},{key:"makeStatement",value:function(t){t[0].add(t[2],t[1],t[3],this.source),(t[2].uri&&t[2].uri===jt||t[3].uri&&t[3].uri===jt)&&(this.hasNil=!0),this.statementCount+=1}},{key:"statement",value:function(t,e){var r=new bt([]);if((e=this.object(t,e,r))<0)return e;var n=this.property_list(t,e,r[0]);if(n<0)throw Mt(this._thisDoc,this.lines,t,e,"expected propertylist");return n}},{key:"subject",value:function(t,e,r){return this.item(t,e,r)}},{key:"verb",value:function(t,e,r){if((i=this.skipSpace(t,e))<0)return i;var n=new bt([]);if((i=this.tok("has",t,e))>=0){if((e=this.prop(t,i,n))<0)throw Mt(this._thisDoc,this.lines,t,i,"expected property after 'has'");return r.push(new mt(["->",n[0]])),e}if((i=this.tok("is",t,e))>=0){if((e=this.prop(t,i,n))<0)throw Mt(this._thisDoc,this.lines,t,i,"expected <property> after 'is'");if((i=this.skipSpace(t,e))<0)throw Mt(this._thisDoc,this.lines,t,e,"End of file found, expected property after 'is'");var i;if(e=i,(i=this.tok("of",t,e))<0)throw Mt(this._thisDoc,this.lines,t,e,"expected 'of' after 'is' <prop>");return r.push(new mt(["<-",n[0]])),i}if((i=this.tok("a",t,e))>=0)return r.push(new mt(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==t.slice(e,e+2))return r.push(new mt(["<-",this._store.sym(gt+"implies")])),e+2;if("="==t.slice(e,e+1))return">"==t.slice(e+1,e+2)?(r.push(new mt(["->",this._store.sym(gt+"implies")])),e+2):(r.push(new mt(["->",this._store.sym(Nt)])),e+1);if(":="==t.slice(e,e+2))return r.push(new mt(["->",gt+"becomes"])),e+2;if((i=this.prop(t,e,n))>=0)return r.push(new mt(["->",n[0]])),i;if(">-"==t.slice(e,e+2)||"<-"==t.slice(e,e+2))throw Mt(this._thisDoc,this.lines,t,i,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(t,e,r){return this.item(t,e,r)}},{key:"item",value:function(t,e,r){return this.path(t,e,r)}},{key:"blankNode",value:function(t){return this._context.bnode(t,this._reason2)}},{key:"path",value:function(t,e,r){if((o=this.nodeOrLiteral(t,e,r))<0)return o;for(;"!^.".indexOf(t.slice(o,o+1))>=0;){var n=t.slice(o,o+1);if("."==n){var i=t.slice(o+1,o+2);if(!i||Rt.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,a=r.pop(),s=this.blankNode(this.here(o));if((o=this.node(t,o+1,r))<0)throw Mt(this._thisDoc,this.lines,t,o,"EOF found in middle of path syntax");var u=r.pop();"^"==n?this.makeStatement(new mt([this._context,u,s,a])):this.makeStatement(new mt([this._context,u,a,s])),r.push(s)}return o}},{key:"anonymousNode",value:function(t){if(e=this._anonymousNodes[t])return e;var e=this._store.bnode(t);return this._anonymousNodes[t]=e,e}},{key:"node",value:function(t,e,r,n){void 0===n&&(n=null);var i=n;if((l=this.skipSpace(t,e))<0)return l;e=l;var o=t.slice(e,e+1);if("["==o){var a=this.here(e);if((l=this.skipSpace(t,e+1))<0)throw Mt(this._thisDoc,this.lines,t,e,"EOF after '['");if("="==t.slice(l,l+1)){e=l+1;var s=new bt([]);if(!((l=this.objectList(t,e,s))>=0))throw Mt(this._thisDoc,this.lines,t,e,"objectList expected after [= ");if(i=s[0],xt(s)>1){var u=new kt(s);try{for(;;){var c=u.next();this.makeStatement(new mt([this._context,this._store.sym(Nt),i,c]))}}catch(t){if(t!=Tt)throw t}}if((l=this.skipSpace(t,l))<0)throw Mt(this._thisDoc,this.lines,t,e,"EOF when objectList expected after [ = ");if(";"==t.slice(l,l+1))var l=l+1}if(null==i&&(i=this.blankNode(a)),(e=this.property_list(t,l,i))<0)throw Mt(this._thisDoc,this.lines,t,l,"property_list expected");if((l=this.skipSpace(t,e))<0)throw Mt(this._thisDoc,this.lines,t,e,"EOF when ']' expected after [ <propertyList>");if("]"!=t.slice(l,l+1))throw Mt(this._thisDoc,this.lines,t,l,"']' expected");return r.push(i),l+1}if("{"==o){if("$"==t.slice(e+1,e+2)){l=(e+=1)+1;for(var h=new bt([]),f=!0;;){if((e=this.skipSpace(t,l))<0)throw Mt(this._thisDoc,this.lines,t,e,"needed '$}', found end.");if("$}"==t.slice(e,e+2)){l=e+2;break}if(f)f=!1;else{if(","!=t.slice(e,e+1))throw Mt(this._thisDoc,this.lines,t,e,"expected: ','");e+=1}var p=new bt([]);if((l=this.item(t,e,p))<0)throw Mt(this._thisDoc,this.lines,t,e,"expected item in set or '$}'");h.push(p[0])}return r.push(this._store.newSet(h,this._context)),l}l=e+1;var d=this._parentContext;this._parentContext=this._context;var y=this._anonymousNodes,v=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new wt([]),this._variables=this._variables.slice();var g=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((e=this.skipSpace(t,l))<0)throw Mt(this._thisDoc,this.lines,t,e,"needed '}', found end.");if("}"==t.slice(e,e+1)){l=e+1;break}if((l=this.directiveOrStatement(t,e))<0)throw Mt(this._thisDoc,this.lines,t,e,"expected statement or '}'")}return this._anonymousNodes=y,this._variables=this._parentVariables,this._parentVariables=v,this._context=this._parentContext,this._reason2=g,this._parentContext=d,r.push(i.close()),l}if("("==o){var m=this._store.list;for("$"==t.slice(e+1,e+2)&&(m=this._store.newSet,e+=1),l=e+1,h=new bt([]);;){if((e=this.skipSpace(t,l))<0)throw Mt(this._thisDoc,this.lines,t,e,"needed ')', found end.");if(")"==t.slice(e,e+1)){l=e+1;break}if(p=new bt([]),(l=this.item(t,e,p))<0)throw Mt(this._thisDoc,this.lines,t,e,"expected item in list or ')'");h.push(p[0])}return r.push(m(h,this._context)),l}if((l=this.tok("this",t,e))>=0)throw Mt(this._thisDoc,this.lines,t,e,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",t,e))>=0?(r.push(!0),l):(l=this.tok("false",t,e))>=0?(r.push(!1),l):null==i&&(l=this.uri_ref2(t,e,r))>=0?l:-1}},{key:"property_list",value:function(t,e,r){for(;;){if((l=this.skipSpace(t,e))<0)throw Mt(this._thisDoc,this.lines,t,e,"EOF found when expected verb in property list");if(":-"!=t.slice(l,l+2)){e=l;var n=new bt([]);if((l=this.verb(t,e,n))<=0)return e;var i=new bt([]);if((e=this.objectList(t,l,i))<0)throw Mt(this._thisDoc,this.lines,t,l,"objectList expected");var o=new kt(i);try{for(;;){var a=o.next(),s=n[0],u=s[0],c=s[1];"->"==u?this.makeStatement(new mt([this._context,c,r,a])):this.makeStatement(new mt([this._context,c,a,r]))}}catch(t){if(t!=Tt)throw t}if((l=this.skipSpace(t,e))<0)throw Mt(this._thisDoc,this.lines,t,l,"EOF found in list of objects");if(";"!=t.slice(e,e+1))return e;e+=1}else{e=l+2;var l,h=new bt([]);if((l=this.node(t,e,h,r))<0)throw Mt(this._thisDoc,this.lines,t,e,"bad {} or () or [] node after :- ");e=l}}}},{key:"commaSeparatedList",value:function(t,e,r,n){if((i=this.skipSpace(t,e))<0)throw Mt(this._thisDoc,this.lines,t,i,"EOF found expecting comma sep list");if("."==t.charAt(i))return e;if(n)var i=this.uri_ref2(t,i,r);else i=this.bareWord(t,i,r);if(i<0)return-1;for(;;){if((e=this.skipSpace(t,i))<0)return e;var o=t.slice(e,e+1);if(","!=o)return"."!=o?-1:e;if((i=n?this.uri_ref2(t,e+1,r):this.bareWord(t,e+1,r))<0)throw Mt(this._thisDoc,this.lines,t,i,"bad list content")}}},{key:"objectList",value:function(t,e,r){if((e=this.object(t,e,r))<0)return-1;for(;;){var n=this.skipSpace(t,e);if(n<0)throw Mt(this._thisDoc,this.lines,t,n,"EOF found after object");if(","!=t.slice(n,n+1))return n;if((e=this.object(t,n+1,r))<0)return e}}},{key:"checkDot",value:function(t,e){var r=this.skipSpace(t,e);if(r<0)return r;if("."==t.slice(r,r+1))return r+1;if("}"==t.slice(r,r+1))return r;if("]"==t.slice(r,r+1))return r;throw Mt(this._thisDoc,this.lines,t,r,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(t,e,r){var n=new bt([]);if((f=this.qname(t,e,n))>=0){var i=n[0],o=i[0],a=i[1];if(null==o){Ot(0,"not used?");var s=this._baseURI+"#"}else if(!(s=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(a)),f;throw Mt(this._thisDoc,this.lines,t,e,"Prefix "+o+" not bound.")}var u=this._store.sym(s+a);return Y(this._variables,u)>=0?r.push(this._variables[u]):r.push(u),f}if((e=this.skipSpace(t,e))<0)return-1;if("?"==t.charAt(e)){var c=new bt([]);return(f=this.variable(t,e,c))>0?(r.push(c[0]),f):-1}if("<"==t.charAt(e)){for(var l=e+=1;e<xt(t);){if(">"==t.charAt(e)){var h=t.slice(l,e);return this._baseURI?h=Et(this._baseURI,h):Ot(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==t.slice(e-1,e)&&"#"!=_t(h,-1,null)&&(h+="#"),u=this._store.sym(h),Y(this._variables,u)>=0?r.push(this._variables[u]):r.push(u),e+1}e+=1}throw Mt(this._thisDoc,this.lines,t,f,"unterminated URI reference")}if(this.keywordsSet){var f;if(c=new bt([]),(f=this.bareWord(t,e,c))<0)return-1;if(Y(this.keywords,c[0])>=0)throw Mt(this._thisDoc,this.lines,t,e,'Keyword "'+c[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+c[0])),f}return-1}},{key:"skipSpace",value:function(t,e){for(var r=e||0;r<t.length;r++){var n=t.charAt(r);if(" \n\r\t\f\v \u2028\u2029 ".indexOf(n)<0){if("#"!==t.charAt(r))return r;for(;;r++){if(r===t.length)return-1;if("\n"===t.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===t.charAt(r)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(t,e,r){if((n=this.skipSpace(t,e))<0)return-1;if("?"!=t.slice(n,n+1))return-1;var n;if(e=n+=1,"0123456789-".indexOf(t.charAt(n))>=0)throw Mt(this._thisDoc,this.lines,t,n,"Varible name can't start with '"+t.charAt(n)+"s'");for(;e<xt(t)&&Rt.indexOf(t.charAt(e))<0;)e+=1;if(null==this._parentContext)throw Mt(this._thisDoc,this.lines,t,n,"Can't use ?xxx syntax for variable in outermost level: "+t.slice(n-1,e));return r.push(this._store.variable(t.slice(n,e))),e}},{key:"bareWord",value:function(t,e,r){var n=this.skipSpace(t,e);if(n<0)return-1;var i=t.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(Rt.indexOf(i)>=0)return-1;for(e=n;e<xt(t)&&Rt.indexOf(t.charAt(e))<0;)e+=1;return r.push(t.slice(n,e)),e}},{key:"qname",value:function(t,e,r){if((e=this.skipSpace(t,e))<0)return-1;var n=t.charAt(e);if("0123456789-+".indexOf(n)>=0)return-1;if(Rt.indexOf(n)<0){var i=n;for(e+=1;e<xt(t)&&(n=t.charAt(e),Rt.indexOf(n)<0);)i+=n,e+=1}else i="";if(e<xt(t)&&":"==t.charAt(e)){var o=i;for(e+=1,i="";e<xt(t)&&(n=t.charAt(e),Rt.indexOf(n)<0);)i+=n,e+=1;return r.push(new mt([o,i])),e}return i&&this.keywordsSet&&Y(this.keywords,i)<0?(r.push(new mt(["",i])),e):-1}},{key:"object",value:function(t,e,r){if((a=this.subject(t,e,r))>=0)return a;if((a=this.skipSpace(t,e))<0)return-1;e=a;var n=null,i=t.charAt(e);if('"'==i||"'"==i){n=t.slice(e,e+3==i+i)?i+i+i:i,e+=xt(n);var o=this.strconst(t,e,n),a=o[0],s=o[1];return r.push(this._store.literal(s)),a}return-1}},{key:"nodeOrLiteral",value:function(t,e,r){if((u=this.node(t,e,r))>=0)return u;if((u=this.skipSpace(t,e))<0)return-1;e=u;var n=t.charAt(e);if("-+0987654321".indexOf(n)>=0){if(Ct.lastIndex=0,null!=(h=Ct.exec(t.slice(e))))u=e+(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(It.lastIndex=0,null==(h=It.exec(t.slice(e))))throw Mt(this._thisDoc,this.lines,t,e,"Bad number or date syntax");u=e+It.lastIndex,(i=t.slice(e,u)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):t.slice(e,u).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 u}if('"'==t.charAt(e)){if('"""'==t.slice(e,e+3))var o='"""';else o='"';e+=xt(o);var a=null,s=this.strconst(t,e,o),u=s[0],c=s[1],l=null;if("@"==t.slice(u,u+1)){var h;if(Ft.lastIndex=0,null==(h=Ft.exec(t.slice(u+1))))throw Mt(this._thisDoc,startline,t,e,"Bad language code syntax on string literal, after @");e=Ft.lastIndex+u+1,l=t.slice(u+1,e),u=e}if("^^"==t.slice(u,u+2)){var f=new bt([]);u=this.uri_ref2(t,u+2,f),a=f[0]}return r.push(this._store.literal(c,l||a)),u}return-1}},{key:"strconst",value:function(t,e,r){for(var n=e,i="",o=this.lines;n<xt(t);){if(e=n+xt(r),t.slice(n,e)==r)return new mt([e,i]);if('"'!=t.charAt(n)){if(Pt.lastIndex=0,!Pt.exec(t.slice(n)))throw Mt(this._thisDoc,o,t,n,"Closing quote missing in string at ^ in "+t.slice(n-20,n)+"^"+t.slice(n,n+20));if(e=n+Pt.lastIndex-1,i+=t.slice(n,e),'"'!=(u=t.charAt(e)))if("\r"!=u){if("\n"==u){if('"'==r)throw Mt(this._thisDoc,o,t,e,"newline found in string literal");this.lines=this.lines+1,i+=u,n=e+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==u){if(n=e+1,!(u=t.slice(n,n+1)))throw Mt(this._thisDoc,o,t,e,"unterminated string literal (2)");var a=At('abfrtvn\\"',u);if(a>=0)i+='a\b\f\r\t\v\n\\"'.charAt(a),n+=1;else if("u"==u)n=(s=this.uEscape(t,n+1,o))[0],i+=u=s[1];else{if("U"!=u)throw Mt(this._thisDoc,this.lines,t,e,"bad escape");var s,u;n=(s=this.UEscape(t,n+1,o))[0],i+=u=s[1]}}}else n=e+1;else n=e}else i=i+'"',n=n+1}throw Mt(this._thisDoc,this.lines,t,e,"unterminated string literal")}},{key:"uEscape",value:function(t,e,r){for(var n=e,i=0,o=0;i<4;){var a=t.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw Mt(this._thisDoc,r,t,e,"unterminated string literal(3)");var s=At("0123456789abcdef",a);if(s<0)throw Mt(this._thisDoc,r,t,e,"bad string literal hex escape");o=16*o+s,i+=1}var u=String.fromCharCode(o);return new mt([n,u])}},{key:"UEscape",value:function(t,e,r){for(var n=e,i=0,o="\\U";i<8;){var a=t.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw Mt(this._thisDoc,r,t,e,"unterminated string literal(3)");if(At("0123456789abcdef",a)<0)throw Mt(this._thisDoc,r,t,e,"bad string literal hex escape");o+=a,i+=1}var s,u=(s="0x"+_t(o,2,10)-0,String.fromCharCode(s));return new mt([n,u])}}]),r}();function Mt(t,e,r,n,i){var o=e+1,a="Line "+o+" of <"+t+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',s=new SyntaxError(a,t,o);return s.lineNo=o,s.characterInFile=n,s.syntaxProblem=i,s}function Zt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function Bt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Zt(Object(r),!0).forEach((function(e){(0,a.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var qt=Bt(Bt({},U),{},{supports:(Lt={},(0,a.Z)(Lt,C.collections,!0),(0,a.Z)(Lt,C.defaultGraphType,!1),(0,a.Z)(Lt,C.equalsMethod,!0),(0,a.Z)(Lt,C.identity,!1),(0,a.Z)(Lt,C.id,!0),(0,a.Z)(Lt,C.reversibleId,!1),(0,a.Z)(Lt,C.variableType,!0),Lt),collection:function(t){return new b(t)},id:function(t){var e=this;return(0,y.uZ)(t)?"( ".concat(t.elements.map((function(t){return e.id(t)})).join(", ")," )"):(0,y.cG)(t)?I.toString(t):U.id(t)},termToNQ:function(t){return t.termType===h.fb?b.toNT(t):U.termToNQ(t)}});const Ht=qt;function $t(t,e){return"string"==typeof e?t.rdfFactory.literal(e):Object.prototype.hasOwnProperty.call(e,"@list")?!0===t.rdfFactory.supports.COLLECTIONS?function(t,e){if(!Array.isArray(e))throw new TypeError("Object must be an array");return t.rdfFactory.collection(e.map((function(e){return $t(t,e)})))}(t,e["@list"]):function(t,e){var r=e["@id"]?Xt(t,e):t.rdfFactory.blankNode(),n=e["@list"].map((function(e){return $t(t,e)})),i=Q(t.rdfFactory,r,n);return t.addAll(i),r}(t,e):Object.prototype.hasOwnProperty.call(e,"@id")?Xt(t,e):Object.prototype.hasOwnProperty.call(e,"@language")?t.rdfFactory.literal(e["@value"],e["@language"]):Object.prototype.hasOwnProperty.call(e,"@type")?t.rdfFactory.literal(e["@value"],t.rdfFactory.namedNode(e["@type"])):Object.prototype.hasOwnProperty.call(e,"@value")?t.rdfFactory.literal(e["@value"]):t.rdfFactory.literal(e)}function zt(t,e,r,n){var i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return Promise.all([s.e(730),s.e(670)]).then(s.t.bind(s,730,23)).then((function(e){return e.flatten(JSON.parse(t),null,{base:i})})).then((function(t){return t.reduce((function(t,n){return e=Vt(e,r,n)}),e)})).then(n).catch(n)}function Xt(t,e){return e["@id"].startsWith("_:")?t.rdfFactory.blankNode(e["@id"].substring(2)):t.rdfFactory.namedNode(e["@id"])}function Vt(t,e,r){for(var n=r["@id"]?Xt(t,r):t.rdfFactory.blankNode(),i=0,o=Object.keys(r);i<o.length;i++){var a=o[i];if("@id"!==a){if("@graph"==a)for(var s=n,u=r[a],c=0;c<u.length;c++)t=Vt(t,s,u[c]);var l=r[a];if(Array.isArray(l))for(var h=0;h<l.length;h++)t.addStatement(Gt(t,n,a,l[h],e));else t.addStatement(Gt(t,n,a,l,e))}}return t}function Gt(t,e,r,n,i){var o,a;return"@type"===r?(o=t.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),a=t.rdfFactory.namedNode(n)):(o=t.rdfFactory.namedNode(r),a=$t(t,n)),t.rdfFactory.quad(e,o,a,t.rdfFactory.namedNode(i))}const Wt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Qt="http://www.w3.org/2001/XMLSchema#",Yt="http://www.w3.org/2000/10/swap/",Jt={xsd:{decimal:`${Qt}decimal`,boolean:`${Qt}boolean`,double:`${Qt}double`,integer:`${Qt}integer`,string:`${Qt}string`},rdf:{type:`${Wt}type`,nil:`${Wt}nil`,first:`${Wt}first`,rest:`${Wt}rest`,langString:`${Wt}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Yt}reify#forSome`,forAll:`${Yt}reify#forAll`},log:{implies:`${Yt}log#implies`}};var Kt=s(5929),te=s.n(Kt),ee=s(2486).lW;const{xsd:re}=Jt,ne=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,ie={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},oe=/[\x00-\x20<>\\"\{\}\|\^\`]/,ae={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},se=/$0^/;class ue{constructor(t){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]*)?$/,t=t||{},this._lineMode=!!t.lineMode){this._n3Mode=!1;for(const t in this)!(t in ae)&&this[t]instanceof RegExp&&(this[t]=se)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let r=this._input,n=r.length;for(;;){let t,a;for(;t=this._newline.exec(r);)this._comments&&(a=this._comment.exec(t[0]))&&i("comment",a[1],"",this._line,t[0].length),r=r.substr(t[0].length,r.length),n=r.length,this._line++;if(!t&&(t=this._whitespace.exec(r))&&(r=r.substr(t[0].length,r.length)),this._endOfFile.test(r))return e&&(this._comments&&(a=this._comment.exec(r))&&i("comment",a[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const s=this._line,u=r[0];let c="",l="",h="",f=null,p=0,d=!1;switch(u){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(p=1,c="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){d=!0;break}case"<":if(f=this._unescapedIri.exec(r))c="IRI",l=f[1];else if(f=this._iri.exec(r)){if(l=this._unescape(f[1]),null===l||oe.test(l))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,l=">");break;case">":r.length>1&&">"===r[1]&&(c=">>",p=2);break;case"_":((f=this._blank.exec(r))||e&&(f=this._blank.exec(`${r} `)))&&(c="blank",h="_",l=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===p||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===p||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(r))&&(c="var",l=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(r))?(c="langcode",l=f[1]):(f=this._keyword.exec(r))&&(c=f[0]);break;case".":if(1===r.length?e: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"-":(f=this._number.exec(r)||e&&(f=this._number.exec(`${r} `)))&&(c="literal",l=f[0],h="string"==typeof f[1]?re.double:"string"==typeof f[2]?re.decimal:re.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(r))?c=f[0].toUpperCase():d=!0;break;case"f":case"t":(f=this._boolean.exec(r))?(c="literal",l=f[0],h=re.boolean):d=!0;break;case"a":(f=this._shortPredicates.exec(r))?(c="abbreviation",l="a"):d=!0;break;case"=":this._n3Mode&&r.length>1&&(c="abbreviation",">"!==r[1]?(p=1,l="="):(p=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(p=1,c=u);break;default:d=!0}if(d&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(r))?((f=this._prefixed.exec(r))||e&&(f=this._prefixed.exec(`${r} `)))&&(c="prefixed",h=f[1]||"",l=this._unescape(f[2])):(c="prefix",l=f[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return e||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const y=p||f[0].length,v=i(c,l,h,s,y);this.previousToken=v,this._previousMarker=c,r=r.substr(y,r.length)}function i(e,i,o,a,s){const u=r?n-r.length:n,c={type:e,value:i,prefix:o,line:a,start:u,end:u+s};return t(null,c),c}function o(e){t(e._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(t){let e=!1;const r=t.replace(ne,((t,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let t=Number.parseInt(n,16);return t<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return i in ie?ie[i]:(e=!0,"")}));return e?null:r}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],r=e.length;let n=Math.max(this._literalClosingPos,r);for(;(n=t.indexOf(e,n))>0;){let e=0;for(;"\\"===t[n-e-1];)e++;if(e%2==0){const e=t.substring(r,n),i=e.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(e),matchLength:o}}n++}this._literalClosingPos=t.length-r+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,e){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof e){const t=[];let e;if(this._tokenizeToEnd(((r,n)=>r?e=r:t.push(n)),!0),e)throw e;return t}te()((()=>this._tokenizeToEnd(e,!0)))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",(t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=ee.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(e,!1)))})),t.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(e,!0)})),t.on("error",e)}}const{rdf:ce,xsd:le}=Jt;let he,fe=0;const pe={namedNode:function(t){return new ye(t)},blankNode:function(t){return new ge(t||"n3-"+fe++)},variable:function(t){return new me(t)},literal:function(t,e){if("string"==typeof e)return new ve(`"${t}"@${e.toLowerCase()}`);let r=e?e.value:"";return""===r&&("boolean"==typeof t?r=le.boolean:"number"==typeof t&&(Number.isFinite(t)?r=Number.isInteger(t)?le.integer:le.double:(r=le.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),""===r||r===le.string?new ve(`"${t}"`):new ve(`"${t}"^^${r}`)},defaultGraph:function(){return he},quad:we,triple:we};class de{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof de?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class ye extends de{get termType(){return"NamedNode"}}class ve extends de{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e<t.length&&"@"===t[e++]?t.substr(e).toLowerCase():""}get datatype(){return new ye(this.datatypeString)}get datatypeString(){const t=this.id,e=t.lastIndexOf('"')+1,r=e<t.length?t[e]:"";return"^"===r?t.substr(e+2):"@"!==r?le.string:ce.langString}equals(t){return t instanceof ve?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class ge extends de{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class me extends de{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}he=new class extends de{constructor(){return super(""),he||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}};class be extends de{constructor(t,e,r,n){super(""),this._subject=t,this._predicate=e,this._object=r,this._graph=n||he}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(t){return!!t&&this._subject.equals(t.subject)&&this._predicate.equals(t.predicate)&&this._object.equals(t.object)&&this._graph.equals(t.graph)}}function we(t,e,r,n){return new be(t,e,r,n)}let xe=0;class _e{constructor(t){this._contextStack=[],this._graph=null,t=t||{},this._setBase(t.baseIRI),t.factory&&ke(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(e),n=/trig/.test(e),i=/triple/.test(e),o=/quad/.test(e),a=this._n3Mode=/n3/.test(e),s=i||o;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||a),this._supportsRDFStar=""===e||/star|\*$/.test(e),s&&(this._resolveRelativeIRI=t=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new ue({lineMode:s,n3:a}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){xe=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,r,n,i){const o=this._n3Mode;this._contextStack.push({type:t,subject:r,predicate:n,object:i,graph:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(t,e){const r=this._contextStack.pop();if(!r||r.type!==t)return this._error(`Unexpected ${e.type}`,e);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(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let r;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);r=this._namedNode(e);break;case"type":case"prefixed":const n=this._prefixes[t.prefix];if(void 0===n)return this._error(`Undefined prefix "${t.prefix}:"`,t);r=this._namedNode(n+t.value);break;case"blank":r=this._blankNode(this._prefixes[t.prefix]+t.value);break;case"var":r=this._variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(t){switch(this._predicate=null,t.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",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._literal(t.value,this._namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);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",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._literal(t.value,this._namedNode(t.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",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext("blank",t),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=e=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",t),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===t.prefix.length?(this._literalValue=t.value,n=this._readListItemDataTypeOrLang):(e=this._literal(t.value,this._namedNode(t.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",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===a.predicate?a.subject=r:a.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,e,this._graph)}return n}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const r=this._readEntity(t);if(void 0===r)return;e=this._literal(this._literalValue,r),t=null;break;case"langcode":e=this._literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const r=this._completeLiteral(t);if(r)return this._object=r.literal,e&&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(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",t),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==n){const t=this._predicate,e=this._object;i?this._emit(e,t,n,r):this._emit(n,t,e,r)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}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,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,r=e.length&&e[e.length-1];if(r&&"item"===r.type){const e=this._subject;this._restoreContext("item",t),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=n):(e=this._object,this._object=n),this._emit(e,r,n,this._graph),this._readPath}_readBackwardPath(t){const e=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(n=this._subject,this._subject=e):(n=this._object,this._object=e),this._emit(e,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",t),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,r,n){this._callback(null,this._quad(t,e,r,n||this.DEFAULTGRAPH))}_error(t,e){const r=new Error(`${t} on line ${e.line}.`);r.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=Te}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let r="",n=-1,i=-1,o=0,a="/";for(;n<e;){switch(a){case":":if(i<0&&"/"===t[++n]&&"/"===t[++n])for(;(i=n+1)<e&&"/"!==t[i];)n=i;break;case"?":case"#":n=e;break;case"/":if("."===t[n+1])switch(a=t[1+ ++n],a){case"/":r+=t.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+t.substring(o,n)+t.substr(n+1);case".":if(a=t[1+ ++n],void 0===a||"/"===a||"?"===a||"#"===a){if(r+=t.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==a)return`${r}/${t.substr(n+1)}`;o=n+1}}}a=t[++n]}return r+t.substring(o)}parse(t,e,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${xe++}_`,this._prefixCallback=r||Te,this._inversePredicate=!1,this._quantified=Object.create(null),!e){const e=[];let r;if(this._callback=(t,n)=>{t?r=t:n&&e.push(n)},this._lexer.tokenize(t).every((t=>this._readCallback=this._readCallback(t))),r)throw r;return e}this._callback=e,this._lexer.tokenize(t,((t,e)=>{null!==t?(this._callback(t),this._callback=Te):this._readCallback&&(this._readCallback=this._readCallback(e))}))}}function Te(){}function ke(t,e){const r=e.namedNode;t._namedNode=r,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=r(Jt.rdf.first),t.RDF_REST=r(Jt.rdf.rest),t.RDF_NIL=r(Jt.rdf.nil),t.N3_FORALL=r(Jt.r.forAll),t.N3_FORSOME=r(Jt.r.forSome),t.ABBREVIATIONS={a:r(Jt.rdf.type),"=":r(Jt.owl.sameAs),">":r(Jt.log.implies)},t.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}ke(_e.prototype,pe);var Ae=s(292);if(void 0===Oe)var Oe={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};var Ee=function(){function r(t,n){(0,e.Z)(this,r),this.options=n||{},this.kb=t,this.target=n.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()}return(0,t.Z)(r,[{key:"addTriple",value:function(t,e,r,n){var i,o,a,s;i=void 0===e?U.namedNode(this.options.base):this.toRDFNodeObject(e),a=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),s=U.namedNode(this.options.base),this.kb.add(i,a,o,s)}},{key:"ancestorPath",value:function(t){for(var e="";t&&t.nodeType!==Oe.DOCUMENT_NODE;)e="/"+t.localName+e,t=t.parentNode;return e}},{key:"copyMappings",value:function(t){var e={};for(var r in t)e[r]=t[r];return e}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(t){for(var e=0;e<r.dateTimeTypes.length;e++){var n=r.dateTimeTypes[e].pattern.exec(t);if(n&&n[0].length===t.length)return r.dateTimeTypes[e].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(t,e){}},{key:"parseCURIE",value:function(t,e,n){var i,o=t.indexOf(":");if(o>=0){var a=t.substring(0,o);if(""===a)return(i=e[""])?i+t.substring(o+1):null;if("_"===a)return"_:"+t.substring(o+1);if(r.NCNAME.test(a)&&(i=e[a]))return i+t.substring(o+1)}return null}},{key:"parseCURIEOrURI",value:function(t,e,r){return this.parseCURIE(t,e,r)||this.resolveAndNormalize(r,t)}},{key:"parsePredicate",value:function(t,e,r,n,i,o){if(""===t)return null;var a=this.parseTermOrCURIEOrAbsURI(t,e,o?null:r,n,i);return a&&0===a.indexOf("_:")?null:a}},{key:"parsePrefixMappings",value:function(t,e){for(var r=this.tokenize(t),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(e[n]=this.options.base?S.join(r[i],this.options.base):r[i],n=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(t,e,r){return"["===(t=this.trim(t)).charAt(0)&&"]"===t.charAt(t.length-1)?0===(t=(t=t.substring(1,t.length-1)).trim(t)).length?null:"_:"===t?this.theOne:this.parseCURIE(t,e,r):this.parseCURIEOrURI(t,e,r)}},{key:"parseTermOrCURIEOrAbsURI",value:function(t,e,r,n,i){t=this.trim(t);var o=this.parseCURIE(t,n,i);if(o)return o;if(r){if(e&&!this.absURIRE.exec(t))return e+t;var a=r[t];if(a)return a;if(a=r[t.toLowerCase()])return a}return this.absURIRE.exec(t)?this.resolveAndNormalize(i,t):null}},{key:"parseTermOrCURIEOrURI",value:function(t,e,r,n,i){t=this.trim(t);var o=this.parseCURIE(t,n,i);if(o)return o;var a=r[t];return a||((a=r[t.toLowerCase()])?a:e&&!this.absURIRE.exec(t)?e+t:this.resolveAndNormalize(i,t))}},{key:"parseURI",value:function(t){return t}},{key:"process",value:function(t,e){var n;e=e||{},t.nodeType===Oe.DOCUMENT_NODE?(t.baseURI&&!e.baseURI&&(e.baseURI=t.baseURI),n=t.baseURI,(t=t.documentElement).baseURI||(t.baseURI=n),this.setContext(t)):t.parentNode.nodeType===Oe.DOCUMENT_NODE&&this.setContext(t);var i=[],o=function(t){if(!t&&e&&e.baseURI)return e.baseURI;var r=t.indexOf("#");return r>=0&&(t=t.substring(0,r)),e&&e.baseURIMap&&(t=e.baseURIMap(t)),t};for(i.push({current:t,context:this.push(null,o(t.baseURI))});i.length>0;){var a=i.shift();if(a.parent){if(a.context.parent&&a.context.parent.listMapping===a.listMapping)continue;for(var s in a.listMapping){var u=a.listMapping[s];if(0!==u.length){for(var c=[],l=0;l<u.length;l++)c.push(this.newBlankNode());for(var h=0;h<c.length;h++)this.addTriple(a.parent,c[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",u[h]),this.addTriple(a.parent,c[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:r.objectURI,value:h+1<c.length?c[h+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(a.parent,a.subject,s,{type:r.objectURI,value:c[0]})}else this.addTriple(a.parent,a.subject,s,{type:r.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var f=a.current,p=a.context,d=!1,y=null,v=null,g=null,m=p.prefixes,b=!1,w=[],x=p.listMapping,_=!p.parent,T=p.language,k=p.vocabulary;n=this.parseURI(o(f.baseURI)),f.item=null;var A=f.getAttributeNode("vocab");if(A){var O=this.trim(A.value);if(O.length>0){k=O;var E=n.spec;this.addTriple(f,E,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:r.objectURI,value:k})}else k=this.vocabulary}for(var j=0;j<f.attributes.length;j++){var N=f.attributes[j];if("x"===N.nodeName.charAt(0)&&0===N.nodeName.indexOf("xmlns:")){b||(m=this.copyMappings(m),b=!0);var R=N.nodeName.substring(6),I=r.trim(N.value);m[R]=this.options.base?S.join(I,this.options.base):I}}var C=f.getAttributeNode("prefix");C&&(b||(m=this.copyMappings(m),b=!0),this.parsePrefixMappings(C.value,m));for(var P=null,F=0;!P&&F<this.langAttributes.length;F++)P=f.getAttributeNodeNS(this.langAttributes[F].namespaceURI,this.langAttributes[F].localName);if(P){var U=r.trim(P.value);T=U.length>0?U:null}var L,D,M=f.getAttributeNode("rel"),Z=f.getAttributeNode("rev"),B=f.getAttributeNode("typeof"),q=f.getAttributeNode("property"),H=f.getAttributeNode("datatype"),$=this.inHTMLMode?f.getAttributeNode("datetime"):null,z=f.getAttributeNode("content"),X=f.getAttributeNode("about"),V=f.getAttributeNode("src"),G=f.getAttributeNode("resource"),W=f.getAttributeNode("href"),Q=f.getAttributeNode("inlist"),Y=[];if(M){D=this.tokenize(M.value);for(var J=0;J<D.length;J++)(L=this.parsePredicate(D[J],k,p.terms,m,n,this.inHTMLMode&&null!==q))&&Y.push(L)}var K=[];if(Z){D=this.tokenize(Z.value);for(var tt=0;tt<D.length;tt++)(L=this.parsePredicate(D[tt],k,p.terms,m,n,this.inHTMLMode&&q))&&K.push(L)}if(this.inHTMLMode&&(M||Z)&&q&&(0===Y.length&&(M=null),0===K.length&&(Z=null)),M||Z?(X&&(y=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n)),B&&(g=y),y||(f.parentNode.nodeType===Oe.DOCUMENT_NODE?y=o(f.baseURI):p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject)),G&&(v=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),v||(W?v=this.resolveAndNormalize(n,encodeURI(W.value)):V?v=this.resolveAndNormalize(n,encodeURI(V.value)):!B||X||this.inXHTMLMode&&("head"===f.localName||"body"===f.localName)||(v=this.newBlankNode())),!B||X||!this.inXHTMLMode||"head"!==f.localName&&"body"!==f.localName?B&&!X&&(g=v):g=y):!q||z||H?(X&&(y=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n)),!y&&G&&(y=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!y&&W&&(y=this.resolveAndNormalize(n,encodeURI(W.value))),!y&&V&&(y=this.resolveAndNormalize(n,encodeURI(V.value))),y||(f.parentNode.nodeType===Oe.DOCUMENT_NODE?y=o(f.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName?B?y=this.newBlankNode():p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject,q||(d=!0)):y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject),B&&(g=y)):(X&&(y=this.parseSafeCURIEOrCURIEOrURI(X.value,m,n),B&&(g=y)),y||f.parentNode.nodeType!==Oe.DOCUMENT_NODE?!y&&p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject):(y=o(f.baseURI),B&&(g=y)),B&&!g&&(G&&(g=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!g&&W&&(g=this.resolveAndNormalize(n,encodeURI(W.value))),!g&&V&&(g=this.resolveAndNormalize(n,encodeURI(V.value))),g||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName||(g=y),g||(g=this.newBlankNode()),v=g)),y&&(X||G||g)){var et=y;B&&!X&&!G&&v&&(et=v),this.newSubjectOrigin(f,et)}if(g){D=this.tokenize(B.value);for(var rt=0;rt<D.length;rt++){var nt=this.parseTermOrCURIEOrAbsURI(D[rt],k,p.terms,m,n);nt&&this.addTriple(f,g,r.typeURI,{type:r.objectURI,value:nt})}}if(y&&y!==p.parentObject&&(x={},_=!0),v){if(M&&Q)for(var it=0;it<Y.length;it++){var ot=x[Y[it]];ot||(ot=[],x[Y[it]]=ot),ot.push({type:r.objectURI,value:v})}else if(M)for(var at=0;at<Y.length;at++)this.addTriple(f,y,Y[at],{type:r.objectURI,value:v});if(Z)for(var st=0;st<K.length;st++)this.addTriple(f,v,K[st],{type:r.objectURI,value:y})}else{if(y&&!v&&(M||Z)&&(v=this.newBlankNode()),M&&Q)for(var ut=0;ut<Y.length;ut++){var ct=x[Y[ut]];ct||(ct=[],x[L]=ct),w.push({predicate:Y[ut],list:ct})}else if(M)for(var lt=0;lt<Y.length;lt++)w.push({predicate:Y[lt],forward:!0});if(Z)for(var ht=0;ht<K.length;ht++)w.push({predicate:K[ht],forward:!1})}if(q){var ft=null,pt=null;H?(ft=""===H.value?r.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(H.value,k,p.terms,m,n),pt=$&&!z?$.value:ft===r.XMLLiteralURI||ft===r.HTMLLiteralURI?null:z?z.value:f.textContent):z?(ft=r.PlainLiteralURI,pt=z.value):$?(pt=$.value,(ft=r.deriveDateTimeType(pt))||(ft=r.PlainLiteralURI)):M||Z||(G&&(pt=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!pt&&W?pt=this.resolveAndNormalize(n,encodeURI(W.value)):!pt&&V&&(pt=this.resolveAndNormalize(n,encodeURI(V.value))),pt&&(ft=r.objectURI)),ft||(B&&!X?(ft=r.objectURI,pt=g):(pt=f.textContent,this.inHTMLMode&&"time"===f.localName&&(ft=r.deriveDateTimeType(pt)),ft||(ft=r.PlainLiteralURI))),D=this.tokenize(q.value);for(var dt=0;dt<D.length;dt++){var yt=this.parsePredicate(D[dt],k,p.terms,m,n);if(yt)if(Q){var vt=x[yt];vt||(vt=[],x[yt]=vt),vt.push(ft===r.XMLLiteralURI||ft===r.HTMLLiteralURI?{type:ft,value:f.childNodes}:{type:ft||r.PlainLiteralURI,value:pt,language:T})}else ft===r.XMLLiteralURI||ft===r.HTMLLiteralURI?this.addTriple(f,y,yt,{type:ft,value:f.childNodes}):this.addTriple(f,y,yt,{type:ft||r.PlainLiteralURI,value:pt,language:T})}}if(y&&!d)for(var gt=0;gt<p.incomplete.length;gt++)p.incomplete[gt].list?p.incomplete[gt].list.push({type:r.objectURI,value:y}):p.incomplete[gt].forward?this.addTriple(f,p.subject,p.incomplete[gt].predicate,{type:r.objectURI,value:y}):this.addTriple(f,y,p.incomplete[gt].predicate,{type:r.objectURI,value:p.subject});var mt=null,bt=y;d?((mt=this.push(p,p.subject)).parentObject=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject,mt.incomplete=p.incomplete,mt.language=T,mt.prefixes=m,mt.vocabulary=k):((mt=this.push(p,y)).parentObject=v||y||p.subject,mt.prefixes=m,mt.incomplete=w,v&&(bt=v,x={},_=!0),mt.listMapping=x,mt.language=T,mt.vocabulary=k),_&&i.unshift({parent:f,context:p,subject:bt,listMapping:x});for(var wt=f.lastChild;wt;wt=wt.previousSibling)wt.nodeType===Oe.ELEMENT_NODE&&i.unshift({current:wt,context:mt})}}this.inHTMLMode&&this.copyProperties();for(var xt=0;xt<this.finishedHandlers.length;xt++)this.finishedHandlers[xt](t)}},{key:"push",value:function(t,e){return{parent:t,subject:e||(t?t.subject:null),parentObject:null,incomplete:[],listMapping:t?t.listMapping:{},language:t?t.language:this.language,prefixes:t?t.prefixes:this.target.graph.prefixes,terms:t?t.terms:this.target.graph.terms,vocabulary:t?t.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(t,e){return S.join(e,t)}},{key:"setContext",value:function(t){"html"===t.localName&&"XHTML+RDFa 1.1"===t.getAttribute("version")?this.setXHTMLContext():"html"===t.localName||"http://www.w3.org/1999/xhtml"===t.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?(Ae.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()}},{key:"setHTMLContext",value:function(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}},{key:"setInitialContext",value:function(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}},{key:"setXHTMLContext",value:function(){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"}},{key:"setXMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}},{key:"tokenize",value:function(t){return this.trim(t).split(/\s+/)}},{key:"toRDFNodeObject",value:function(t){var e=this;if(void 0!==t){if("string"==typeof t)return"_:"===t.substring(0,2)?(void 0===this.blankNodes[t.substring(2)]&&(this.blankNodes[t.substring(2)]=new f(t.substring(2))),this.blankNodes[t.substring(2)]):U.namedNode(t);switch(t.type){case r.objectURI:return"_:"===t.value.substring(0,2)?(void 0===this.blankNodes[t.value.substring(2)]&&(this.blankNodes[t.value.substring(2)]=new f(t.value.substring(2))),this.blankNodes[t.value.substring(2)]):U.namedNode(t.value);case r.PlainLiteralURI:return new g(t.value,t.language||"");case r.XMLLiteralURI:case r.HTMLLiteralURI:var n="";return Object.keys(t.value).forEach((function(r){n+=M.domToString(t.value[r],e.htmlOptions)})),new g(n,"",new d.Z(t.type));default:return new g(t.value,"",new d.Z(t.type))}}}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(t,e,n){var i=new r(e,{base:n});t.baseURI||(t.baseURI=n),i.process(t,{baseURI:n})}},{key:"tokenize",value:function(t){return this.trim(t).split(/\s+/)}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}]),r}();Ee.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",Ee.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",Ee.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",Ee.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",Ee.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Ee.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",Ee.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",Ee.NCNAME=new RegExp("^"+Ee.nameStartChar+Ee.nameChar+"*$"),Ee.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"}];var je=Ee.parseRDFaDOM,Ne=function(){function r(t){(0,e.Z)(this,r),this.store=t,this.bnodes={},this.why=null,this.reify=!1}return(0,t.Z)(r,[{key:"frameFactory",value:function(t,e,n){return{NODE:1,ARC:2,parent:e,parser:t,store:t.store,element:n,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(t,e){e=S.join(e,this.base),this.node=this.store.sym(e),this.nodeType=t},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 t=this.store.sym(S.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(r.ns.RDF+"type"),this.store.sym(r.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(r.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(r.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(r.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(t){this.addSymbol(this.NODE,t),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(t){null!=t?null!=this.parser.bnodes[t]?this.node=this.parser.bnodes[t]:this.node=this.parser.bnodes[t]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(t){t===r.ns.RDF+"li"&&(t=r.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==r.ns.RDF+"langString"?this.node=this.store.literal(t,this.store.sym(this.parent.datatype)):this.node=this.store.literal(t,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}},{key:"getAttributeNodeNS",value:function(t,e,r){var n=null;if(t.getAttributeNodeNS)n=t.getAttributeNodeNS(e,r);else for(var i,o=t.attributes,a=0;a<o.length;++a)if((i=o[a]).namespaceURI===e&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}},{key:"parse",value:function(t,e,n){var i,o=t.childNodes;if(this.cleanParser(),t.nodeType===r.nodeType.DOCUMENT){for(var a=0;a<o.length;a++)if(o[a].nodeType===r.nodeType.ELEMENT){i=o[a];break}}else{if(t.nodeType!==r.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+e+". Halting. ");i=t}this.why=n;var s=this.frameFactory(this);return this.base=e,s.base=e,s.lang=null,this.parseDOM(this.buildFrame(s,i)),!0}},{key:"parseDOM",value:function(t){for(var e,n=function(t){var e="";if(null==t.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+t.localName+" in "+this.base);return t.namespaceURI&&(e+=t.namespaceURI),t.localName?e+=t.localName:t.nodeName&&(t.nodeName.indexOf(":")>=0?e+=t.nodeName.split(":")[1]:e+=t.nodeName),e}.bind(this),i=!0;t.parent;){var o=t.element,a=o.attributes;if(o.nodeType===r.nodeType.TEXT||o.nodeType===r.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(r.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(o.nodeValue);else if(n(o)!==r.ns.RDF+"RDF")if(t.parent&&t.parent.collection&&(t.addCollectionArc(),(t=this.buildFrame(t,t.element)).parent.element=null),t.parent&&t.parent.nodeType&&t.parent.nodeType!==t.ARC){t.addArc(n(o)),this.reify&&(e=this.getAttributeNodeNS(o,r.ns.RDF,"ID"))&&(t.rdfid=e.nodeValue,o.removeAttributeNode(e));var s=this.getAttributeNodeNS(o,r.ns.RDF,"parseType"),u=this.getAttributeNodeNS(o,r.ns.RDF,"datatype");if(u&&(t.datatype=u.nodeValue,o.removeAttributeNode(u)),s){var c=s.nodeValue;"Literal"===c?(t.datatype=r.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(o.childNodes),i=!1):"Resource"===c?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===c&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),o.removeAttributeNode(s)}if(0!==a.length){var l=this.getAttributeNodeNS(o,r.ns.RDF,"resource"),h=this.getAttributeNodeNS(o,r.ns.RDF,"nodeID");t=this.buildFrame(t),l?(t.addNode(l.nodeValue),o.removeAttributeNode(l)):h?(t.addBNode(h.nodeValue),o.removeAttributeNode(h)):t.addBNode();for(var f=a.length-1;f>=0;f--){var p=this.buildFrame(t);p.addArc(n(a[f])),n(a[f])===r.ns.RDF+"type"?this.buildFrame(p).addNode(a[f].nodeValue):this.buildFrame(p).addLiteral(a[f].nodeValue)}}else 0===o.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var d=this.getAttributeNodeNS(o,r.ns.RDF,"about");if(e=this.getAttributeNodeNS(o,r.ns.RDF,"ID"),d&&e)throw new Error("RDFParser: "+o.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!d&&e)t.addNode("#"+e.nodeValue),o.removeAttributeNode(e);else if(null==d&&null==e){var y=this.getAttributeNodeNS(o,r.ns.RDF,"nodeID");y?(t.addBNode(y.nodeValue),o.removeAttributeNode(y)):t.addBNode()}else t.addNode(d.nodeValue),o.removeAttributeNode(d);var v=this.getAttributeNodeNS(o,r.ns.RDF,"type");r.ns.RDF+"Description"!==n(o)&&(v={nodeValue:n(o)}),null!=v&&(this.store.add(t.node,this.store.sym(r.ns.RDF+"type"),this.store.sym(S.join(v.nodeValue,t.base)),this.why),v.nodeName&&o.removeAttributeNode(v));for(var g=a.length-1;g>=0;g--)this.store.add(t.node,this.store.sym(n(a[g])),this.store.literal(a[g].nodeValue,t.lang),this.why)}for(o=t.element;t.parent;){for(var m=t;null==o;)o=(t=t.parent).element;var b=o.childNodes&&o.childNodes[t.lastChild];if(b&&i){if((b.nodeType===r.nodeType.ELEMENT||b.nodeType===r.nodeType.TEXT||b.nodeType===r.nodeType.CDATA_SECTION)&&(b.nodeType!==r.nodeType.TEXT&&b.nodeType!==r.nodeType.CDATA_SECTION||1===o.childNodes.length)){t.lastChild++,t=this.buildFrame(m,o.childNodes[t.lastChild-1]);break}t.lastChild++}else{if(t.terminateFrame(),!(t=t.parent))break;o=t.element,i=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(t,e){var n=this.frameFactory(this,t,e);if(t&&(n.base=t.base,n.lang=t.lang),!e||e.nodeType===r.nodeType.TEXT||e.nodeType===r.nodeType.CDATA_SECTION)return n;var i=e.attributes,o=e.getAttributeNode("xml:base");null!=o&&(n.base=o.nodeValue,e.removeAttribute("xml:base"));var a=e.getAttributeNode("xml:lang");null!=a&&(n.lang=a.nodeValue,e.removeAttribute("xml:lang"));for(var s=i.length-1;s>=0;s--)if("xml"===i[s].nodeName.substr(0,3)){if("xmlns:"===i[s].name.slice(0,6)){var u=i[s].nodeValue;this.base&&(u=S.join(u,this.base)),this.store.setPrefixForURI(i[s].name.slice(6),u)}e.removeAttributeNode(i[s])}return n}}]),r}();function Se(t,e,r){var n,i,o,a=["INSERT","DELETE","WHERE"],s=D("http://www.w3.org/ns/pim/patch#"),u=Ut(e,e,r,r,null,null,"",null),c={},l=function(t,e,r,n,i){return"Line "+(e+1)+" of <"+t+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=e.sym(r+"#query");for(c.query=h;;){if((i=u.skipSpace(t,n))<0)return c;if(";"===t[i]){if((n=u.skipSpace(t,i+1))<0)return c;i=n}var f=!1;for(o=0;o<a.length;o++){var p=a[o];if(t.slice(i,i+p.length)===p){if((n=u.skipSpace(t,i+p.length))<0)throw l(u._thisDoc,u.lines,t,i+p.length,"found EOF, needed {...} after "+p);if(("INSERT"===p||"DELETE"===p)&&"DATA"===t.slice(n,n+4)){if((i=u.skipSpace(t,n+4))<0)throw l(u._thisDoc,u.lines,t,n+4,"needed {...} after INSERT DATA "+p);n=i}var d=[];if((i=u.node(t,n,d))<0)throw l(u._thisDoc,u.lines,t,n,"bad syntax or EOF in {...} after "+p);c[p.toLowerCase()]=d[0],e.add(h,s(p.toLowerCase()),d[0]),f=!0,n=i}}if(!f&&"@prefix"===t.slice(i,i+7)){if((n=u.directive(t,i))<0)throw l(u._thisDoc,u.lines,t,n,"bad syntax or EOF after @prefix ");n=u.checkDot(t,n),f=!0}if(!f)throw l(u._thisDoc,u.lines,t,i,"Unknown syntax at start of statememt: '"+t.slice(i).slice(0,20)+"'")}}function Re(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=(n=n||h.z8).split(";")[0];try{if(n===h.qS||n===h.z8)Ut(e,e,r,r,null,null,"",null).loadBuf(t),a();else if(n===h.Is)new Ne(e).parse(M.parseXML(t),r,e.sym(r)),a();else if(n===h.D7)je(M.parseXML(t,{contentType:h.D7}),e,r),a();else if(n===h.us)je(M.parseXML(t,{contentType:h.us}),e,r),a();else if(n===h.oW||n===h.xm)Se(t,e,r),a();else if(n===h.ui)zt(t,e,r,a);else{if(n!==h.b4&&n!==h.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var o=new _e({factory:Ht});!function(t,r){try{o.parse(r,s)}catch(t){i(t,e)}}(null,t)}}catch(t){!function(t){if(n!==h.ui||n!==h.b4||n!==h.lL){if(!i){var o=new Error(t+" while trying to parse <"+r+"> as "+n);throw o.cause=t,o}i(t,e)}}(t)}function a(){i&&i(null,e)}function s(t,r){r?e.add(r.subject,r.predicate,r.object,r.graph):i(t,e)}Re.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,a.Z)(Ne,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,a.Z)(Ne,"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 Ie=s(7297),Ce=s.n(Ie),Pe=s(2598),Fe=s(292);function Ue(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Le(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,o.Z)(t);if(e){var a=(0,o.Z)(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return(0,i.Z)(this,r)}}var De={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},Me={rdf:h.Is,owl:h.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},Ze=function(t){return{link:D("http://www.w3.org/2007/ont/link#",t),http:D("http://www.w3.org/2007/ont/http#",t),httph:D("http://www.w3.org/2007/ont/httph#",t),rdf:D("http://www.w3.org/1999/02/22-rdf-syntax-ns#",t),rdfs:D("http://www.w3.org/2000/01/rdf-schema#",t),dc:D("http://purl.org/dc/elements/1.1/",t),ldp:D("http://www.w3.org/ns/ldp#",t)}},Be=Ze(),qe=(0,t.Z)((function t(r,n){(0,e.Z)(this,t),(0,a.Z)(this,"response",void 0),(0,a.Z)(this,"dom",void 0),this.response=r,this.dom=n}));(0,a.Z)(qe,"pattern",void 0);var He=function(r){(0,n.Z)(o,r);var i=Le(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){var n=t.store;if(this.dom||(this.dom=M.parseXML(e)),"parsererror"===this.dom.documentElement.nodeName)return t.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");var i=new Ne(n);try{i.parse(this.dom,r.original.value,r.original)}catch(e){return t.failFetch(r,"Syntax error parsing RDF/XML! "+e,"parse_error")}return r.noMeta||n.add(r.original,Be.rdf("type"),Be.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(t){t.mediatypes[h.Is]={q:.9}}}]),o}(qe);He.pattern=new RegExp("application/rdf\\+xml");var $e=function(r){(0,n.Z)(o,r);var i=Le(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){var n,i;this.dom||(this.dom=M.parseXML(e));var o=t.store,a=this.dom.getElementsByTagName("title");a.length>0&&o.add(r.resource,Be.dc("title"),o.rdfFactory.literal(a[0].textContent),r.resource);for(var s=this.dom.getElementsByTagName("link"),u=s.length-1;u>=0;u--)i=!1,(n=s[u].getAttribute("rel"))||(n=s[u].getAttribute("rev"),i=!0),n&&t.linkData(r.original,n,s[u].getAttribute("href"),r.resource,i);for(var c=this.dom.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l].getAttribute("type");De[h]&&(Re(c[l].textContent,o,r.original.value,h),Re(c[l].textContent,o,r.original.value,h))}if(r.noMeta||o.add(r.resource,Be.rdf("type"),Be.link("WebPage"),t.appNode),!r.noRDFa&&je)try{je(this.dom,o,r.original.value)}catch(e){var f="Error trying to parse "+r.resource+" as RDFa:\n"+e+":\n"+e.stack;return t.failFetch(r,f,"parse_error")}return t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(t){t.mediatypes[h.D7]={}}}]),o}(qe);$e.pattern=new RegExp("application/xhtml");var ze=function(r){(0,n.Z)(o,r);var i=Le(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){for(var n=M.parseXML(e),i=0;i<n.childNodes.length;i++){var a=n.childNodes[i];if(o.isElement(a)){var s=a.namespaceURI;if(s&&s===s.rdf)return t.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new He(this.response,n).parse(t,e,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 t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new $e(this.response,n).parse(t,e,r);var u=n.getElementsByTagName("html")[0];if(u){var c=u.getAttribute("xmlns");if(c&&c.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return t.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new $e(this.response,n).parse(t,e,r)}return t.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+e.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/xml"]={q:.5},t.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(t){return t.nodeType===Node.ELEMENT_NODE}}]),o}(qe);ze.pattern=new RegExp("(text|application)/(.*)xml");var Xe=function(r){(0,n.Z)(o,r);var i=Le(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){var n=t.store;if(Ye(e))return t.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new $e(this.response).parse(t,e,r);if(function(t){var e=t.indexOf("<!DOCTYPE html"),r=t.indexOf(">");return!(-1===e||-1===r||e>r)&&-1!==t.substr(e,r-e).indexOf("XHTML")}(e))return t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new $e(this.response).parse(t,e,r);if(function(t){return!!t.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(e))return t.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new $e(this.response).parse(t,e,r);var i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(e);return i&&n.add(r.resource,Be.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,Be.rdf("type"),Be.link("WebPage"),t.appNode),t.addStatus(r.req,"non-XML HTML document, not parsed for data."),t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/html"]={q:.9}}}]),o}(qe);Xe.pattern=new RegExp("text/html");var Ve=function(r){(0,n.Z)(o,r);var i=Le(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r,n){var i=t.store;return new Promise((function(o,a){try{zt(e,i,r.original.value,(function(){o(t.doneFetch(r,n))}))}catch(e){var s="Error trying to parse "+r.resource+" as JSON-LD:\n"+e;o(t.failFetch(r,s,"parse_error",n))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(t){t.mediatypes["application/ld+json"]={q:.9}}}]),o}(qe);Ve.pattern=/application\/ld\+json/;var Ge=function(r){(0,n.Z)(o,r);var i=Le(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r){return Ye(e)?(t.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 ze(this.response).parse(t,e,r)):e.slice(0,500).match(/xmlns:/)?(t.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new ze(this.response).parse(t,e,r)):(t.addStatus(r.req,"Plain text document, no known RDF semantics."),t.doneFetch(r,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(t){t.mediatypes["text/plain"]={q:.5}}}]),o}(qe);Ge.pattern=new RegExp("text/plain");var We=function(r){(0,n.Z)(o,r);var i=Le(o);function o(){return(0,e.Z)(this,o),i.apply(this,arguments)}return(0,t.Z)(o,[{key:"parse",value:function(t,e,r,n){var i=t.store,o=Ut(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(e)}catch(e){var a="Error trying to parse "+r.resource+" as Notation3:\n"+e;return t.failFetch(r,a,"parse_error",n)}return t.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),t.store.add(r.original,Be.rdf("type"),Be.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(t){t.mediatypes["text/n3"]={q:"1.0"},t.mediatypes["text/turtle"]={q:1}}}]),o}(qe);We.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var Qe={RDFXMLHandler:He,XHTMLHandler:$e,XMLHandler:ze,HTMLHandler:Xe,TextHandler:Ge,N3Handler:We,JsonLdHandler:Ve};function Ye(t){return!!t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var Je=function(){function r(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,e.Z)(this,r),(0,a.Z)(this,"store",void 0),(0,a.Z)(this,"timeout",void 0),(0,a.Z)(this,"_fetch",void 0),(0,a.Z)(this,"mediatypes",void 0),(0,a.Z)(this,"appNode",void 0),(0,a.Z)(this,"requested",void 0),(0,a.Z)(this,"timeouts",void 0),(0,a.Z)(this,"redirectedTo",void 0),(0,a.Z)(this,"fetchQueue",void 0),(0,a.Z)(this,"fetchCallbacks",void 0),(0,a.Z)(this,"nonexistent",void 0),(0,a.Z)(this,"lookedUp",void 0),(0,a.Z)(this,"handlers",void 0),(0,a.Z)(this,"ns",void 0),(0,a.Z)(this,"fireCallbacks",void 0),this.store=t||new ft,this.ns=Ze(this.store.rdfFactory),this.timeout=i.timeout||3e4,this._fetch=i.fetch||void 0!==s.g&&(s.g.solidFetcher||s.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||Ce(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.sym("chrome://TheCurrentSession"),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}},M.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(i.handlers||Qe).map((function(t){return n.addHandler(Qe[t])}))}var n,i;return(0,t.Z)(r,[{key:"load",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},r),t instanceof Array)return Promise.all(t.map((function(t){return e.load(t,Object.assign({},r))})));var n=t,i=(0,Pe._)(n);i=i.split("#")[0],r=this.initFetchOptions(i,r);var o,a=this.appNode,s=this.store,u=s.statementsMatching(void 0,this.ns.link("requestedURI"),s.sym(i),a).map((function(t){return t.subject})),c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Ue(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ue(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(u);try{for(c.s();!(o=c.n()).done;){var l=o.value,h=s.any(l,this.ns.link("response"),null,a);if(null!=h){var f=s.statementsMatching(h,this.ns.link("outOfDate"),!0,a);s.remove(f),r.force=!0,r.clearPreviousData=!0}}}catch(t){c.e(t)}finally{c.f()}var p=this.initFetchOptions(i,r);return this.pendingFetchPromise(i,p.baseURI,p)}},{key:"pendingFetchPromise",value:(i=_(k().mark((function t(e,r,n){var i,o=this;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=!n.force,!t.t0){t.next=5;break}return t.next=4,this.fetchQueue[r];case 4:t.t0=t.sent;case 5:if(!t.t0){t.next=9;break}i=this.fetchQueue[r],t.next=12;break;case 9:i=Promise.race([this.setRequestTimeout(e,n),this.fetchUri(e,n)]),this.fetchQueue[r]=i,this.cleanupFetchRequest(r,void 0,this.timeout);case 12:return t.abrupt("return",i.then((function(t){return e in o.timeouts&&(o.timeouts[e].forEach(clearTimeout),delete o.timeouts[e]),t})));case 13:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return i.apply(this,arguments)})},{key:"cleanupFetchRequest",value:function(t,e,r){var n=this;void 0!==e&&Fe.warn("_options is deprecated"),this.timeouts[t]=(this.timeouts[t]||[]).concat(setTimeout((function(){n.isPending(t)||delete n.fetchQueue[t]}),r))}},{key:"initFetchOptions",value:function(t,e){var n=this.store;!e.method||"GET"===e.method.toUpperCase()||(e.force=!0),e.resource=n.rdfFactory.namedNode(t),e.baseURI=e.baseURI||t,e.original=n.rdfFactory.namedNode(e.baseURI),e.req=n.bnode(),e.headers=e.headers||new Ie.Headers,e.contentType&&(e.headers["content-type"]=e.contentType),e.force&&(e.cache="no-cache");var i=this.acceptString();e.headers.accept=i;var o=r.offlineOverride(t);e.requestedURI=o,r.setCredentials(o,e);var a=r.proxyIfNecessary(o);return o!==a&&(e.proxyUsed=!0),e.actualProxyURI=a,e}},{key:"fetchUri",value:function(t,e){var n=this;if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(r.unsupportedProtocol(t))return this.failFetch(e,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(t);if(e.force)delete this.nonexistent[t];else{if("fetched"===i)return Promise.resolve(this.doneFetch(e,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[t]){var o="Previously failed: "+this.requested[t],a={url:t,status:this.requested[t],statusText:o,responseText:o,headers:new Ie.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(e,o,this.requested[t],a)}}this.fireCallbacks("request",[t]),this.requested[t]=!0,e.noMeta||this.saveRequestMetadata(t,e);var s=e.actualProxyURI;return this._fetch(s,e).then((function(r){return n.handleResponse(r,t,e)}),(function(r){var i={url:s,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new Ie.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return n.handleError(i,t,e)}))}},{key:"nowOrWhenFetched",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,Pe._)(t);"function"==typeof e?r=e:void 0===e||((0,y.NX)(e)?n.referringTerm=e:n=e),this.load(i,n).then((function(t){if(r)if(t)if(t.ok)r(!0,"OK",t);else{var e="HTTP error: Status "+t.status+" ("+t.statusText+")";t.responseText&&(e+=" "+t.responseText),r(!1,e,t)}else r(!1,"@@ nowOrWhenFetched: no response object!")}),(function(t){var e=t.message||t.statusText;e="Failed to load <"+i+"> "+e,t.response&&t.response.status&&(e+=" status: "+t.response.status),r(!1,e,t.response)}))}},{key:"addStatus",value:function(t,e){var r=new Date;e="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+e;var n=this.store,i=n.the(t,this.ns.link("status"));(0,y.uZ)(i)?i.append(n.rdfFactory.literal(e)):L.Z.warn("web.js: No list to add to: "+i+","+e)}},{key:"failFetch",value:function(t,e,r,n){this.addStatus(t.req,e),t.noMeta||this.store.add(t.original,this.ns.link("error"),this.store.rdfFactory.literal(e));var i=(t.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(t.resource.equals(t.original),this.requested[S.docpart(t.original.value)]=r,this.fireCallbacks("fail",[t.original.value,e]));var o=new Error("Fetcher: "+e);return o.status=r,o.statusText=e,o.response=n,Promise.reject(o)}},{key:"linkData",value:function(t,e,r,n,i){if(r){var o,a=this.store,s=a.rdfFactory.namedNode(S.join(r,t.value));if("alternate"===e||"seeAlso"===e||"meta"===e||"describedby"===e){if(s.value===t.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===e?a.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):a.rdfFactory.namedNode(S.join(encodeURIComponent(e),"http://www.iana.org/assignments/link-relations/"));i?a.add(s,o,t,n):a.add(t,o,s,n)}}},{key:"parseLinkHeader",value:function(t,e,r){if(t){var n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=t.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(var o=0;o<i.length;o++){var a=i[o].split(">"),s=a[0].substring(1),u=a[1].match(n);if(null==u)return;for(var c=0;c<u.length;c++){var l=u[c].split("=")[1].replace(/["']/g,"");this.linkData(e,l,s,r)}}}}},{key:"doneFetch",value:function(t,e){return this.addStatus(t.req,"Done."),this.requested[t.original.value]="done",this.fireCallbacks("done",[t.original.value]),e.req=t.req,e}},{key:"nowKnownAs",value:function(t,e){this.lookedUp[t.value]?this.lookedUp[e.value]||this.lookUpThing(e,t):this.lookedUp[e.value]&&(this.lookedUp[t.value]||this.lookUpThing(t,e))}},{key:"putBack",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,Pe._)(t),i=new d.Z(n).doc();return r.contentType=r["content-type"]||r["Content-Type"]||r.contentType||h.z8,"application/ld+json"===r.contentType?new Promise((function(n,o){V(i,e.store,i.uri,r.contentType,(function(i,a){i?o(i):(r.data=a,e.webOperation("PUT",t,r).then((function(t){return n(t)})).catch((function(t){return o(t)})))}))})):(r.data=V(i,this.store,i.value,r.contentType),this.webOperation("PUT",n,r))}},{key:"webCopy",value:function(t,e,r){var n=this;return this.webOperation("GET",t).then((function(t){return n.webOperation("PUT",e,{data:t.responseText,contentType:r})}))}},{key:"delete",value:function(t,e){var r=this;return this.webOperation("DELETE",t,e).then((function(e){return r.requested[t]=404,r.nonexistent[t]=!0,r.unload(r.store.rdfFactory.namedNode(t)),e}))}},{key:"createIfNotExists",value:(n=_(k().mark((function t(e){var r,n,i,o,a=arguments;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:h.z8,n=a.length>2&&void 0!==a[2]?a[2]:"",i=this,t.prev=3,t.next=6,i.load(e);case 6:o=t.sent,t.next=26;break;case 9:if(t.prev=9,t.t0=t.catch(3),404!==t.t0.response.status){t.next=25;break}return t.prev=12,t.next=15,i.webOperation("PUT",e.value,{data:n,contentType:r});case 15:o=t.sent,t.next=21;break;case 18:throw t.prev=18,t.t1=t.catch(12),t.t1;case 21:return delete i.requested[e.value],t.abrupt("return",o);case 25:throw t.t0;case 26:return t.abrupt("return",o);case 27:case"end":return t.stop()}}),t,this,[[3,9],[12,18]])}))),function(t){return n.apply(this,arguments)})},{key:"createContainer",value:function(t,e,r){var n={"content-type":h.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};e&&(n.slug=e);var i={headers:n};return r&&(i.body=r),this.webOperation("POST",t,i)}},{key:"invalidateCache",value:function(t){var e=(0,Pe._)(t),r=this;if(r.fetchQueue&&r.fetchQueue[e]&&(r.fetchQueue[e].PromiseStatus,delete r.fetchQueue[e]),r.requested[e]&&"done"!==r.requested[e]&&"failed"!==r.requested[e]&&404!==r.requested[e]){var n="Rdflib: fetcher: Destructive operation on <".concat(r.requested[e],"> file being fetched! ")+e;Fe.error(n)}else delete r.requested[e],delete r.nonexistent[e]}},{key:"webOperation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,Pe._)(e);n.method=t,n.body=n.data||n.body,n.force=!0;var o=this;if(n.body&&!n.contentType)throw new Error("Web operation sending data must have a defined contentType.");return n.contentType&&(n.headers=n.headers||{},n.headers["content-type"]=n.contentType),r.setCredentials(i,n),new Promise((function(e,r){o._fetch(i,n).then((function(n){if(n.ok)"PUT"!==t&&"PATCH"!==t&&"POST"!==t&&"DELETE"!==t||o.invalidateCache(i),n.text?n.text().then((function(t){n.responseText=t,e(n)})):e(n);else{var a="Web error: "+n.status;n.statusText&&(a+=" ("+n.statusText+")"),a+=" on "+t+" of <"+i+">",n.responseText&&(a+=": "+n.responseText);var s=new Error(a);s.response=n,r(s)}}),(function(e){r(new Error("Fetch error for "+t+" of <"+i+">:"+e))}))}))}},{key:"lookUpThing",value:function(t,e){var r=this,n=this.store.uris(t);return(n=n.map((function(t){return S.docpart(t)}))).forEach((function(t){r.lookedUp[t]=!0})),this.load(n,{referringTerm:e})}},{key:"getHeader",value:function(t,e){for(var r=this.store,n=t.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n)),o=0;o<i.length;o++){var a=i[o];if(void 0!==a){var s=r.any(a,this.ns.link("response"));if(void 0!==s&&r.anyValue(s,this.ns.http("status"))&&r.anyValue(s,this.ns.http("status")).startsWith("2")){var u=r.each(s,this.ns.httph(e.toLowerCase()));return u.length?u.map((function(t){return t.value})):[]}}}}},{key:"saveRequestMetadata",value:function(t,e){var r=e.req,n=this.store,i=e.referringTerm;this.addStatus(e.req,"Accept: "+e.headers.accept),(0,y.NX)(i)&&n.add(n.rdfFactory.namedNode(t),this.ns.link("requestedBy"),i,this.appNode),e.original&&e.original.value!==t&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(e.original.value),this.appNode);var o=new Date,a="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(a+" Request for "+t),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(t),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(t,e){var r=this,n=this.store,i=n.bnode();return n.add(e.req,this.ns.link("response"),i,this.appNode),n.add(i,this.ns.http("status"),n.rdfFactory.literal(t.status),this.appNode),n.add(i,this.ns.http("statusText"),n.rdfFactory.literal(t.statusText),this.appNode),t.headers.forEach((function(t,o){n.add(i,r.ns.httph(o),r.store.rdfFactory.literal(t),r.appNode),"content-type"===o&&n.add(e.resource,r.ns.rdf("type"),n.rdfFactory.namedNode(M.mediaTypeClass(t).value),r.appNode)})),i}},{key:"objectRefresh",value:function(t){var e=this.store.uris(t);if(void 0!==e)for(var r=0;r<e.length;r++)this.refresh(this.store.rdfFactory.namedNode(S.docpart(e[r])))}},{key:"refresh",value:function(t,e){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(t,{force:!0,clearPreviousData:!0},e)}},{key:"refreshIfExpired",value:function(t,e){var r=this.getHeader(t,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(t,e):e(!0,"Not expired",{})}},{key:"retract",value:function(t){this.store.removeMany(void 0,void 0,void 0,t),t.value&&delete this.requested[S.docpart(t.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(t){return void 0===this.requested[t]?"unrequested":!0===this.requested[t]?"requested":"done"===this.requested[t]?"fetched":"redirected"===this.requested[t]?this.getState(this.redirectedTo[t]):"failed"}},{key:"isPending",value:function(t){return!0===this.requested[t]}},{key:"unload",value:function(t){this.store.removeDocument(t),delete this.requested[t.value]}},{key:"addHandler",value:function(t){this.handlers.push(t),t.register(this)}},{key:"retryNoCredentials",value:function(t,e){e.retriedWithNoCredentials=!0,delete this.requested[t],delete this.fetchQueue[t];var r=Object.assign({},e,{credentials:"omit"});return this.addStatus(e.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(t,r)}},{key:"isCrossSite",value:function(t){if("undefined"==typeof document||!document.location)return!1;var e=S.hostpart,r=""+document.location;return(e(r)&&e(t)&&e(r))!==e(t)}},{key:"handleError",value:function(t,e,n){if(this.isCrossSite(e)){if(n.credentials&&"include"===n.credentials&&!n.retriedWithNoCredentials)return this.retryNoCredentials(e,n);var i=r.crossSiteProxy(e);if(i&&!n.proxyUsed)return this.redirectToProxy(i,n)}var o;return t instanceof Error?o="Fetch error: "+t.message:(o=t.statusText,t.responseText&&(o+=" ".concat(t.responseText))),this.failFetch(n,o,t.status||998,t)}},{key:"addType",value:function(t,e,r,n){var i=e;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"),t,this.appNode)}for(;;){var a=r.any(i,this.ns.link("requestedURI"));if(a&&a.value&&r.add(r.rdfFactory.namedNode(a.value),this.ns.rdf("type"),t,this.appNode),!(i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i)))break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var u=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!u)break;if("301"!==u&&"302"!==u)break}}},{key:"handleResponse",value:function(t,e,r){var n=this,i=this.store,o=t.headers,a=r.req,s=this.saveResponseMetadata(t,r),u=this.normalizedContentType(r,o)||"",c=o.get("content-location");if(0===t.status)return this.handleError(t,e,r);if(t.status>=400)return 404===t.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[e]=!0),this.saveErrorResponse(t,s).then((function(){var e=r.resource+" "+t.statusText;return n.failFetch(r,e,t.status,t)}));var l=null,h=null;if(c&&(h=S.join(c,e))!==e&&(l=h),200===t.status){if(this.addType(this.ns.link("Document"),a,i,e),l&&this.addType(this.ns.link("Document"),a,i,l),r.clearPreviousData)for(var f=i.statementsMatching(void 0,void 0,void 0,r.resource).slice(),p=0;p<f.length;p++)i.removeStatement(f[p]);var d=u.includes("image/")||u.includes("application/pdf");u&&d&&(this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,e),l&&this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,l))}if(c){if(!r.force&&l&&"done"===this.requested[h])return this.doneFetch(r,t);this.requested[h]=!0}this.parseLinkHeader(o.get("link"),r.original,a);var y=this.handlerForContentType(u,t);return y?t.text().then((function(e){return t.responseText=e,y.parse(n,e,r,t)})):(this.addStatus(a,"Fetch over. No data handled."),this.doneFetch(r,t))}},{key:"saveErrorResponse",value:function(t,e){var r=this,n=this.store;return t.text().then((function(t){t.length>10&&n.add(e,r.ns.http("content"),n.rdfFactory.literal(t),e)}))}},{key:"handlerForContentType",value:function(t,e){if(!t)return null;var r=this.handlers.find((function(e){return t.match(e.pattern)}));return r?new r(e):null}},{key:"guessContentType",value:function(t){return Me[t.split(".").pop()]}},{key:"normalizedContentType",value:function(t,e){if(t.forceContentType)return t.forceContentType;var r=e.get("content-type");if(!r||r.includes("application/octet-stream")){var n=this.guessContentType(t.resource.value);if(n)return n}var i=S.protocol(t.resource.value);return!r&&["file","chrome"].includes(i)?"text/xml":r}},{key:"redirectToProxy",value:function(t,e){var r=this;this.addStatus(e.req,"BLOCKED -> Cross-site Proxy to <"+t+">"),e.proxyUsed=!0;var n=this.store,i=e.req;e.noMeta||(n.add(i,this.ns.link("redirectedTo"),n.rdfFactory.namedNode(t),i),this.addStatus(i,"redirected to new request")),this.requested[e.resource.value]="redirected",this.redirectedTo[e.resource.value]=t;var o=Object.assign({},e);return o.baseURI=e.resource.value,this.fetchUri(t,o).then((function(t){return o.noMeta||n.add(i,r.ns.link("redirectedRequest"),o.req,r.appNode),t}))}},{key:"setRequestTimeout",value:function(t,e){var r=this;return new Promise((function(n){r.timeouts[t]=(r.timeouts[t]||[]).concat(setTimeout((function(){!r.isPending(t)||e.retriedWithNoCredentials||e.proxyUsed||n(r.failFetch(e,"Request to ".concat(t," timed out"),"timeout"))}),r.timeout))}))}},{key:"addFetchCallback",value:function(t,e){this.fetchCallbacks[t]?this.fetchCallbacks[t].push(e):this.fetchCallbacks[t]=[e]}},{key:"acceptString",value:function(){var t="";for(var e in this.mediatypes)for(var r in""!==t&&(t+=", "),t+=e,this.mediatypes[e])t+=";"+r+"="+this.mediatypes[e][r];return t}}],[{key:"crossSiteProxy",value:function(t){return r.crossSiteProxyTemplate?r.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}},{key:"offlineOverride",value:function(t){var e,r=t;return"undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.preferences&&e.preferences.get("offlineModeUsingLocalhost")&&"http://"===r.slice(0,7)&&"localhost/"!==r.slice(7,17)&&(r="http://localhost/"+r.slice(7),L.Z.warn("Localhost kludge for offline use: actually getting <"+r+">")),r}},{key:"proxyIfNecessary",value:function(t){var e;if("undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var n=function t(e,r){var n=r[e.shift()];return n?"string"==typeof n?n+e.join("/"):e?t(e,n):null:null}(t.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(n)return n}return r.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?r.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}},{key:"unsupportedProtocol",value:function(t){var e=S.protocol(t);return"tel"===e||"mailto"===e||"urn"===e}},{key:"setCredentials",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===e.credentials&&(void 0!==e.withCredentials?e.credentials=e.withCredentials?"include":"omit":e.credentials="include")}}]),r}();(0,a.Z)(Je,"HANDLERS",void 0),(0,a.Z)(Je,"CONTENT_TYPE_BY_EXT",void 0),(0,a.Z)(Je,"crossSiteProxyTemplate",void 0),Je.HANDLERS=Qe,Je.CONTENT_TYPE_BY_EXT=Me;const Ke={parseJSON:function(t,e,r){var n,i,o,a={},s=r.sym(e);for(var u in t){0===u.indexOf("_:")?a[u]?n=a[u]:(n=r.bnode(u),a[u]=n):n=r.sym(u);var c=t[u];for(var l in c){var h=c[l];for(var f in i=r.sym(l),h){var p=h[f];if("uri"===p.type)o=r.sym(p.value),r.add(n,i,o,s);else if("BlankNode"===p.type)a[p.value]?o=a[p.value]:(o=r.bnode(p.value),a[p.value]=o),r.add(n,i,o,s);else{if("Literal"!==p.type)throw new Error("error: unexpected termtype: "+f.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,s)}}}}}};function tr(t){var e=0;function r(t){var e="",r=t.statements;for(var n in r)L.Z.debug("Found statement: "+r),e+=a()+r[n]+"\n";return e}function n(t){var e="";for(var r in t.constraints){var n=t.constraints[r];e+=a()+"FILTER ( "+n.describe(r)+" ) \n"}return e}function i(t){for(var o="",s=0;s<t.optional.length;s++)L.Z.debug("Found optional query"),o+=a()+"OPTIONAL { \n",e++,o+=r(t.optional[s]),o+=n(t.optional[s]),o+=i(t.optional[s]),e--,o+=a()+"}\n";return o}function o(t){var o=a()+"WHERE \n{ \n";return e++,o+=r(t),o+=n(t),o+=i(t),e--,o+"}"}function a(){for(var t="",r=0;r<e;r++)t+=" ";return t}return function(t){return function(t){for(var e=a()+"SELECT ",r=0;r<t.vars.length;r++)e+=t.vars[r]+" ";return e+"\n"}(t)+o(t.pat)}(t)}function er(t,e,r){var n=[];function i(t){if(n[t])return n[t];var e=r.variable(t);return n[t]=e,e}function o(t){return"string"==typeof t&&t.match(/[^ \n\t]/)}function a(t){return"string"==typeof t&&t.match(/^[\?\$]/)}function s(t){return"string"==typeof t?t.replace(/^</,"<").replace(/>$/,">"):t}function u(t){return"string"==typeof t&&t.match(/^<[^>]*>$/)}function c(t){return"string"==typeof t&&(t.match(/^_:/)||t.match(/^$/))}function l(t){return"string"==typeof t&&t.match(/:$/)}function h(t){return"string"==typeof t&&t.match(/^:|^[^_][^:]*:/)}function f(t){return t.split(":")[0]}function p(t){return t.split(":")[1]}function d(t){return u(t)?t.slice(1,t.length-1):t}function y(t){var e=-1===t.indexOf("'")?null:t.indexOf("'"),n=-1===t.indexOf('"')?null:t.indexOf('"');if(!e&&!n){var i=new Array(1);return i[0]=t,i}var o,a,s=new Array(2);if(!e||n&&n<e)o='"',a=n;else{if(n&&!(e&&e<n))return L.Z.error("SQARQL QUERY OOPS!"),s;o="'",a=e}s[0]=t.slice(0,a);var u,c=t.slice(a+1).indexOf(o);return-1===c?(L.Z.error("SPARQL parsing error: no matching parentheses in literal "+t),t):(t.slice(c+a+2).match(/^\^\^/)?(u=t.slice(c+a+2).indexOf(" "),s[1]=r.literal(t.slice(a+1,a+1+c),r.sym(d(t.slice(a+4+c,a+2+c+u)))),s=s.concat(y(t.slice(c+a+3+u)))):t.slice(c+a+2).match(/^@/)?(u=t.slice(c+a+2).indexOf(" "),s[1]=r.literal(t.slice(a+1,a+1+c),t.slice(a+3+c,a+2+c+u),null),s=s.concat(y(t.slice(c+a+2+u)))):(s[1]=r.literal(t.slice(a+1,a+1+c)),L.Z.info("Literal found: "+s[1]),s=s.concat(y(t.slice(c+a+2)))),s)}function v(t){t=t.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),L.Z.info("New str into spaceDelimit: \n"+t);var e=[],r=t.split(" ");for(var n in r)o(r[n])&&(e=e.concat(r[n]));return e}function g(t,e){for(var r=0;r<e.length;r++)if("string"==typeof e[r]&&e[r].toLowerCase()===t.toLowerCase())return r;return null}function m(t,e){for(var r=[],n=0;n<e.length;n++)"string"==typeof e[n]&&e[n].toLowerCase()===t.toLowerCase()&&r.push(n);return r}function b(t,e,r){L.Z.info("Looking for a close bracket of type "+r+" in "+t);for(var n=0,i=0;i<t.length;i++)if(t[i]===e&&n++,t[i]===r&&n--,n<0)return i;return L.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(t){return this.describe=function(e){return e+" = "+t.toNT()},this.test=function(e){return t.equals(e)},this}function x(t){this.describe=function(e){return"REGEXP( '"+t+"' , "+e+" )"},this.test=function(e){var r=new RegExp(t);return!!e.value&&r.test(e.value)}}function _(t,e){3!==t.length||"Variable"!==t[0].termType||"NamedNode"!==t[2].termType&&"Literal"!==t[2].termType?6===t.length&&"string"==typeof t[0]&&"regexp"===t[0].toLowerCase()&&"("===t[1]&&")"===t[5]&&","===t[3]&&"Variable"===t[4].termType&&"Literal"===t[2].termType&&(L.Z.debug("Constraint added: "+t),e.constraints[t[4]]=new x(t[2].value)):"="===t[1]||">"===t[1]||"<"===t[1]?(L.Z.debug("Constraint added: "+t),e.constraints[t[0]]=new w(t[2])):L.Z.warn("I don't know how to handle the constraint: "+t)}function T(t,e){L.Z.debug("Optional query: "+t+" not yet implemented.");var n=r.formula();k(t,n),e.optional.push(n)}function k(t,e){var n,o,l=function(t){for(var e=[],n=0;n<t.length;n++)"string"==typeof t[n]?(t[n]=s(t[n]),a(t[n])?e[n]=i(t[n].slice(1)):c(t[n])?(L.Z.info(t[n]+" was identified as a bnode."),e[n]=r.bnode()):u(t[n])?(L.Z.info(t[n]+" was identified as a symbol."),e[n]=r.sym(d(t[n]))):h(t[n])?(L.Z.info(t[n]+" was identified as a prefixed symbol"),E[f(t[n])]?e[n]=r.sym(t[n]=E[f(t[n])]+p(t[n])):(L.Z.error("SPARQL error: "+t[n]+" with prefix "+f(t[n])+" does not have a correct prefix entry."),e[n]=t[n])):e[n]=t[n]):e[n]=t[n];return e}(t);for(L.Z.debug("WHERE: "+l);g("OPTIONAL",l);)o=g("OPTIONAL",l),L.Z.debug("OPT: "+o+" "+l[o]+" in "+l),"{"!==l[o+1]&&L.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(l.slice(o+2),"{","}"))?L.Z.error("No matching bracket in word "+o):(T(l.slice(o+2,o+2+n),e),o=g("OPTIONAL",l),n=b(l.slice(o+2),"{","}"),l.splice(o,n+3));for(L.Z.debug("WHERE after optionals: "+l);g("FILTER",l);){var y=g("FILTER",l);"("!==l[y+1]&&L.Z.warn("Bad filter opening bracket in word "+y),-1===(n=b(l.slice(y+2),"(",")"))?L.Z.error("No matching bracket in word "+y):(_(l.slice(y+2,y+2+n),e),y=g("FILTER",l),n=b(l.slice(y+2),"(",")"),l.splice(y,n+3))}L.Z.debug("WHERE after filters and optionals: "+l),function(t,e){var r=new Array(1);r[0]=-1;for(var n=r.concat(m(".",t)),i=[],o=0;o<n.length-1;o++)i[o]=t.slice(n[o]+1,n[o+1]);for(o in i){L.Z.info("s+p+o "+o+" = "+i[o]);var a=i[o][0];i[o].splice(0,1);var s=r.concat(m(";",i[o]));s.push(i[o].length);for(var u=[],c=0;c<s.length-1;c++)u[c]=i[o].slice(s[c]+1,s[c+1]);for(o in u){L.Z.info("p+o "+o+" = "+i[o]);var l=u[o][0];u[o].splice(0,1);var h=r.concat(m(",",u[o]));h.push(u[o].length);var f=[];for(c=0;c<h.length-1;c++)f[c]=u[o].slice(h[c]+1,h[c+1]);for(o in f){var p=f[o][0];L.Z.info("Subj="+a+" Pred="+l+" Obj="+p),e.add(a,l,p)}}}}(l,e)}L.Z.info("SPARQL input: \n"+t);var A=new nt,O=function(t){var e=y(t),r=[];for(var n in e)r="string"==typeof e[n]?r.concat(v(e[n])):r.concat(e[n]);return r=function(t){for(var e=t,r=0;r<e.length;r++)if("a"===e[r]&&(e[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===e[r]&&"of"===e[r+2]){e.splice(r,1),e.splice(r+1,1);var n=e[r-1];e[r-1]=e[r+1],e[r+1]=n}return e}(r),L.Z.info("SPARQL Tokens: "+r),r}(t),E=function(t){var e=m("PREFIX",t),r=[];for(var n in e){var i=t[e[n]+1],o=t[e[n]+2];if(l(i))if(u(o)){L.Z.info("Prefix found: "+i+" -> "+o);var a=f(i),s=d(o);r[a]=s}else L.Z.error("Invalid SPARQL symbol: "+o);else L.Z.error("Invalid SPARQL prefix: "+i)}return r}(O);E.rdf||(E.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),E.rdfs||(E.rdfs="http://www.w3.org/2000/01/rdf-schema#");var j=g("SELECT",O),N=g("WHERE",O);if(j<0||N<0||j>N)return L.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(t,e){for(var r in L.Z.info("SPARQL vars: "+t),t)if(a(t[r])){L.Z.info("Added "+t[r]+" to query variables from SPARQL");var n=i(t[r].slice(1));e.vars.push(n),n.label=t[r].slice(1)}else L.Z.warn("Incorrect SPARQL variable in SELECT: "+t[r])}(O.slice(j+1,N),A),k(O.slice(N+2,O.length-1),A.pat),e)return A;for(var S in A.pat.statements){var R=A.pat.statements[S];"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 A}function rr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return nr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?nr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function nr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var ir=function(){function r(t){if((0,e.Z)(this,r),(0,a.Z)(this,"store",void 0),(0,a.Z)(this,"ifps",void 0),(0,a.Z)(this,"fps",void 0),(0,a.Z)(this,"patchControl",void 0),(0,a.Z)(this,"ns",void 0),(t=t||new ft).updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new Je(t)),this.store=t,t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=D("http://www.w3.org/2007/ont/link#"),this.ns.http=D("http://www.w3.org/2007/ont/http#"),this.ns.httph=D("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=D("http://www.w3.org/ns/ldp#"),this.ns.rdf=D("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=D("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=D("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=D("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}var n;return(0,t.Z)(r,[{key:"patchControlFor",value:function(t){return this.patchControl[t.value]||(this.patchControl[t.value]=[]),this.patchControl[t.value]}},{key:"isHttpUri",value:function(t){return"http"===t.slice(0,4)}},{key:"flagAuthorizationMetadata",value:function(t){var e;t||(t=this.store);var r,n=null===(e=t.fetcher)||void 0===e?void 0:e.appNode,i=t.statementsMatching(void 0,this.ns.link("requestedURI"),void 0,n).map((function(t){return t.subject})),o=rr(i);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=t.any(a,this.ns.link("response"),null,n);null!=s&&t.add(s,this.ns.link("outOfDate"),!0,n)}}catch(t){o.e(t)}finally{o.f()}}},{key:"checkEditable",value:(n=_(k().mark((function t(e,r){var n,i,o;return k().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",!1);case 2:if(r||(r=this.store),void 0===(i=this.editable(e,r))){t.next=6;break}return t.abrupt("return",i);case 6:return t.next=8,null===(n=r.fetcher)||void 0===n?void 0:n.load(e);case 8:return o=this.editable(e,r),t.abrupt("return",o);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return n.apply(this,arguments)})},{key:"editable",value:function(t,e){var r,n;if(!t)return!1;if(e||(e=this.store),t=(0,Pe._)(t),!this.isHttpUri(t)&&e.holds(e.rdfFactory.namedNode(t),e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),e.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var i,o=!1,a=null===(r=e.fetcher)||void 0===r?void 0:r.appNode,s=e.each(void 0,this.ns.link("requestedURI"),(0,S.docpart)(t),a),u=0;u<s.length;u++)if(void 0!==(n=s[u])){var c=e.any(n,this.ns.link("response"),null,a);if(void 0!==c){if(e.anyJS(c,this.ns.link("outOfDate"),null,a))continue;var l=e.anyValue(c,this.ns.httph("wac-allow"));if(l){var h,f=rr(l.split(","));try{for(f.s();!(h=f.n()).done;){var p=h.value.split("=");if(p[0].includes("user")&&!p[1].includes("write")&&!p[1].includes("append"))return!1}}catch(t){f.e(t)}finally{f.f()}}var d=e.each(c,this.ns.httph("accept-patch"));if(d.length)for(var y=0;y<d.length;y++){if((i=d[y].value.trim()).indexOf("text/n3")>=0)return"N3PATCH";if(i.indexOf("application/sparql-update")>=0)return"SPARQL";if(i.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var v=e.each(c,this.ns.httph("ms-author-via"));if(v.length)for(var g=0;g<v.length;g++){if((i=v[g].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(i.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(t))return!!l&&"LOCALFILE";var m=e.each(c,this.ns.http("status"));if(m.length)for(var b=0;b<m.length;b++)200!==m[b]&&404!==m[b]||(o=!0)}}if(0===s.length);else if(o)return!1}},{key:"anonymize",value:function(t){return"_:"===t.toNT().substr(0,2)&&this.mentioned(t)?"?"+t.toNT().substr(2):t.toNT()}},{key:"anonymizeNT",value:function(t){return this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" ."}},{key:"nTriples",value:function(t){return"".concat(t.subject.toNT()," ").concat(t.predicate.toNT()," ").concat(t.object.toNT()," .")}},{key:"statementBnodes",value:function(t){return[t.subject,t.predicate,t.object].filter((function(t){return(0,y.B2)(t)}))}},{key:"statementArrayBnodes",value:function(t){for(var e=[],r=0;r<t.length;r++)e=e.concat(this.statementBnodes(t[r]));e.sort();for(var n=[],i=0;i<e.length;i++)0!==i&&e[i].equals(e[i-1])||n.push(e[i]);return n}},{key:"cacheIfps",value:function(){this.ifps={};for(var t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty")),e=0;e<t.length;e++)this.ifps[t[e].value]=!0;this.fps={},t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(var r=0;r<t.length;r++)this.fps[t[r].value]=!0}},{key:"bnodeContext2",value:function(t,e,r){for(var n,i,o=this.store.statementsMatching(void 0,void 0,t,e),a=0;a<o.length;a++)if(this.fps[o[a].predicate.value]){if(!(n=o[a].subject).isBlank)return[o[a]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([o[a]])}o=this.store.statementsMatching(t,void 0,void 0,e);for(var s=0;s<o.length;s++)if(this.ifps[o[s].predicate.value]){if(!(n=o[s].object).isBlank)return[o[s]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([o[s]])}return null}},{key:"bnodeContext1",value:function(t,e){for(var r=0;r<3;r++){var n=this.bnodeContext2(t,e,r);if(null!==n)return n}return this.store.connectedStatements(t,e)}},{key:"mentioned",value:function(t){return 0!==this.store.statementsMatching(t,null,null,null).length||0!==this.store.statementsMatching(null,t).length||0!==this.store.statementsMatching(null,null,t).length}},{key:"bnodeContext",value:function(t,e){var r=[];if(t.length){this.cacheIfps();for(var n=0;n<t.length;n++){var i=t[n];this.mentioned(i)&&(r=r.concat(this.bnodeContext1(i,e)))}}return r}},{key:"statementContext",value:function(t){var e=this.statementBnodes(t);return this.bnodeContext(e,t.graph)}},{key:"contextWhere",value:function(t){var e=this;return t&&0!==t.length?"WHERE { "+t.map((function(t){return e.anonymizeNT(t)})).join("\n")+" }\n":""}},{key:"fire",value:function(t,e,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((function(){if(!t)throw new Error("No URI given for remote editing operation: "+e);return i.noMeta=!0,i.contentType=i.contentType||"application/sparql-update",i.body=e,n.store.fetcher.webOperation("PATCH",t,i)})).then((function(n){if(!n.ok){var i="UpdateManager: update failed for <"+t+"> status="+n.status+", "+n.statusText+"\n for query: "+e;throw new Error(i)}r(t,n.ok,n.responseText,n)})).catch((function(e){r(t,!1,e.message,e)}))}},{key:"update_statement",value:function(t){if(!t||t.graph){var e=this,r=this.statementContext(t);return{statement:t?[t.subject,t.predicate,t.object,t.graph]:void 0,statementNT:t?this.anonymizeNT(t):void 0,where:e.contextWhere(r),set_object:function(t,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(t)+" . }\n",e.fire(this.statement[3].value,n,r)}}}}},{key:"insert_statement",value:function(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){for(var i="",o=0;o<t.length;o++)i+=t[o]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}},{key:"delete_statement",value:function(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){for(var i="",o=0;o<t.length;o++)i+=t[o]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}},{key:"requestDownstreamAction",value:function(t,e){var r=this.patchControlFor(t);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+e)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=e;else e(t)}},{key:"clearUpstreamCount",value:function(t){this.patchControlFor(t).upstreamCount=0}},{key:"getUpdatesVia",value:function(t){var e=this.store.fetcher.getHeader(t,"updates-via");return e&&e.length?e[0].trim():null}},{key:"addDownstreamChangeListener",value:function(t,e){var r=this,n=this.patchControlFor(t);n.downstreamChangeListeners||(n.downstreamChangeListeners=[]),n.downstreamChangeListeners.push(e),this.setRefreshHandler(t,(function(t){r.reloadAndSync(t)}))}},{key:"reloadAndSync",value:function(t){var e=this.patchControlFor(t),r=this;if(e.reloading)e.outOfDate=!0;else{e.reloading=!0;var n=1e3;!function i(){r.reload(r.store,t,(function(t,r,o){if(t){if(e.downstreamChangeListeners)for(var a=0;a<e.downstreamChangeListeners.length;a++)e.downstreamChangeListeners[a]();e.reloading=!1,e.outOfDate&&(e.outOfDate=!1,i())}else e.reloading=!1,o&&0===o.status&&(e.reloading=!0,setTimeout(i,n*=2))}))}()}}},{key:"setRefreshHandler",value:function(t,e){var r=this.getUpdatesVia(t),n=e,i=this,o=this,a=1500,s=0;if(!r)return!1;var u=(r=(0,S.join)(r,t.value)).replace(/^http:/,"ws:").replace(/^https:/,"wss:");return function e(){var r;if("undefined"!=typeof WebSocket)r=new WebSocket(u);else{if("undefined"==typeof window||!window.WebSocket)return;r=window.WebSocket(u)}r.onopen=function(){a=1500,this.send("sub "+t.value),s&&o.requestDownstreamAction(t,n)};var c=i.patchControlFor(t);c.upstreamCount=0,r.onerror=function(t){},r.onclose=function(t){a*=2,s+=1,setTimeout((function(){e()}),a)},r.onmessage=function(e){if(e.data&&"pub"===e.data.slice(0,3)){if("upstreamCount"in c&&(c.upstreamCount-=1,c.upstreamCount>=0))return;c.upstreamCount=0,i.requestDownstreamAction(t,n)}}}(),!0}},{key:"updateMany",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=t.concat(e).map((function(t){return t.why})),n=this,i=[];r.forEach((function(t){i.find((function(e){return e.equals(t)}))||i.push(t)}));var o=i.map((function(r){return n.update(t.filter((function(t){return t.why.equals(r)})),e.filter((function(t){return t.why.equals(r)})))}));return o.length,Promise.all(o)}},{key:"constructSparqlUpdateQuery",value:function(t,e,r){var n=this.contextWhere(r),i="";if(n.length){if(t.length){i+="DELETE { ";for(var o=0;o<t.length;o++)i+=this.anonymizeNT(t[o])+"\n";i+=" }\n"}if(e.length){i+="INSERT { ";for(var a=0;a<e.length;a++)i+=this.anonymizeNT(e[a])+"\n";i+=" }\n"}i+=n}else{if(t.length){i+="DELETE DATA { ";for(var s=0;s<t.length;s++)i+=this.anonymizeNT(t[s])+"\n";i+=" } \n"}if(e.length){t.length&&(i+=" ; "),i+="INSERT DATA { ";for(var u=0;u<e.length;u++)i+=this.nTriples(e[u])+"\n";i+=" }\n"}}return i}},{key:"constructN3PatchQuery",value:function(t,e,r){var n=this,i="\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ex: <http://www.example.org/terms#>.\n\n_:patch\n";return r&&r.length>0&&(i+="\n solid:where {\n ".concat(r.map((function(t){return n.anonymizeNT(t)})).join("\n "),"\n };")),t.length>0&&(i+="\n solid:deletes {\n ".concat(t.map((function(t){return n.anonymizeNT(t)})).join("\n "),"\n };")),e.length>0&&(i+="\n solid:inserts {\n ".concat(e.map((function(t){return n.anonymizeNT(t)})).join("\n "),"\n };")),i+" a solid:InsertDeletePatch .\n"}},{key:"update",value:function(t,e,r,n){var i=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var a=this;return new Promise((function(r,i){a.update(t,e,(function(t,e,n){e?r():i(new Error(n))}),n,o)}))}try{var s=this.store,u=t?(0,y.Pv)(t)?t.statements:t instanceof Array?t:[t]:[],c=e?(0,y.Pv)(e)?e.statements:e instanceof Array?e:[e]:[];if(!(u instanceof Array))throw new Error("Type Error "+(0,p.Z)(u)+": "+u);if(!(c instanceof Array))throw new Error("Type Error "+(0,p.Z)(c)+": "+c);if(0===u.length&&0===c.length)return r(null,!0);var l=u.length?u[0].graph:c[0].graph;if(!l){var h="Error patching: statement does not specify which document to patch:"+u[0]+", "+c[0];throw new Error(h)}if("NamedNode"!==l.termType){var f="Error patching: document not a NamedNode:"+u[0]+", "+c[0];throw new Error(f)}var d=this.patchControlFor(l),v=Date.now(),g=["subject","predicate","object","why"],m={delete:u,insert:c};["insert","delete"].map((function(t){m[t].map((function(t){if(!l.equals(t.graph))throw new Error("update: destination "+l+" inconsistent with delete quad "+t.graph);g.map((function(e){if(void 0===t[e])throw new Error("update: undefined "+e+" of statement.")}))}))}));var b=this.editable(l.value,s);if(!1===b)throw new Error("Update: Can't make changes in uneditable "+l);if(void 0===b){if(n)throw new Error("Update: Loaded "+l+"but still can't figure out what editing protocol it supports.");return void this.store.fetcher.load(l).then((function(n){i.update(t,e,r,!0,o)}),(function(n){if(404!==n.response.status)throw new Error("Update: Can't get updatability status ".concat(l," before patching: ").concat(n));i.update(t,e,r,!0,o)}))}if(b.indexOf("SPARQL")>=0||b.indexOf("N3PATCH")>=0){var w=b.indexOf("SPARQL")>=0,x=[];u.length&&(x=this.statementArrayBnodes(u)),c.length&&(x=x.concat(this.statementArrayBnodes(c)));var _=this.bnodeContext(x,l),T=w?this.constructSparqlUpdateQuery(u,c,_):this.constructN3PatchQuery(u,c,_);o.contentType=w?"application/sparql-update":"text/n3",d.pendingUpstream=d.pendingUpstream?d.pendingUpstream+1:1,"upstreamCount"in d&&(d.upstreamCount+=1),this.fire(l.value,T,(function(t,e,n,i){if(i.elapsedTimeMs=Date.now()-v,e){try{s.remove(u)}catch(t){e=!1,n="Remote Ok BUT error deleting "+u.length+" from store!!! "+t}for(var o=0;o<c.length;o++)s.add(c[o].subject,c[o].predicate,c[o].object,l)}if(r(t,e,n,i),d.pendingUpstream-=1,0===d.pendingUpstream&&d.downstreamAction){var a=d.downstreamAction;delete d.downstreamAction,a(l)}}),o)}else if(b.indexOf("DAV")>=0)this.updateDav(l,u,c,r,o);else{if(!(b.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+b+"' for "+l);try{this.updateLocalFile(l,u,c,r,o)}catch(t){r(l.value,!1,"Exception trying to write back file <"+l.value+">\n")}}}catch(t){r(void 0,!1,"Exception in update: "+t+"\n"+M.stackString(t))}}},{key:"updateDav",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.any(t,this.ns.link("request"));if(!a)throw new Error("No record of our HTTP GET request for document: "+t);var s=o.any(a,this.ns.link("response"));if(!s)return null;for(var u=o.the(s,this.ns.httph("content-type")).value,c=o.statementsMatching(void 0,void 0,void 0,t).slice(),l=0;l<e.length;l++)M.RDFArrayRemove(c,e[l]);for(var h=0;h<r.length;h++)c.push(r[h]);var f,p=this.serialize(t.value,c,u),d=o.the(s,this.ns.httph("content-location"));return d&&(f=(0,S.join)(d.value,f)),i.contentType=u,i.noMeta=!0,i.body=p,o.fetcher.webOperation("PUT",f,i).then((function(i){if(!i.ok)throw new Error(i.error);for(var a=0;a<e.length;a++)o.remove(e[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,t);n(t.value,i.ok,i.responseText,i)})).catch((function(e){n(t.value,!1,e.message,e)}))}},{key:"updateLocalFile",value:function(t,e,r,n){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.statementsMatching(void 0,void 0,void 0,t).slice(),s=0;s<e.length;s++)M.RDFArrayRemove(a,e[s]);for(var u=0;u<r.length;u++)a.push(r[u]);var c=t.value.lastIndexOf(".");if(c<1)throw new Error("Rewriting file: No filename extension: "+t.value);var l=t.value.slice(c+1),h=Je.CONTENT_TYPE_BY_EXT[l];if(!h)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(t.value,a,h),i.contentType=h,o.fetcher.webOperation("PUT",t.value,i).then((function(i){if(!i.ok)return n(t.value,!1,i.error);for(var a=0;a<e.length;a++)o.remove(e[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,t);n(t.value,!0,"")}))}},{key:"serialize",value:function(t,e,r){var n,i=this.store;if("string"==typeof e)return e;var o=z(i);switch(o.suggestNamespaces(i.namespaces),o.setBase(t),r){case"text/xml":case"application/rdf+xml":n=o.statementsToXML(e);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":n=o.statementsToN3(e);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return n}},{key:"put",value:function(t,e,r,n){var i,o=this,a=this.store;return Promise.resolve().then((function(){return i=o.serialize(t.value,e,r),a.fetcher.webOperation("PUT",t.value,{contentType:r,body:i})})).then((function(r){if(!r.ok)return n(t.value,r.ok,r.error,r);delete a.fetcher.nonexistent[t.value],delete a.fetcher.requested[t.value],"string"!=typeof e&&e.map((function(t){a.addStatement(t)})),n(t.value,r.ok,"",r)})).catch((function(e){n(t.value,!1,e.message)}))}},{key:"reload",value:function(t,e,r){var n=Date.now();t.fetcher.nowOrWhenFetched(e.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(t,i,o){if(t)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var a=Date.now()-n;e.reloadTimeTotal||(e.reloadTimeTotal=0),e.reloadTimeCount||(e.reloadTimeCount=0),e.reloadTimeTotal+=a,e.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}]),r}();function or(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function ar(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?or(Object(r),!0).forEach((function(e){(0,a.Z)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):or(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var sr=ar(ar({},Ht),{},{fetcher:function(t,e){return new Je(t,e)},graph:function(){return new ft(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)||{rdfFactory:Ht})},lit:function(t,e,r){return this.literal(""+t,e||r)},st:function(t,e,r,n){return this.quad(t,e,r,n)}});const ur=sr;var cr=function(){function r(t,n){(0,e.Z)(this,r),this.parent=t,this.via=n,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(n),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(t){this.onError(t)}}return(0,t.Z)(r,[{key:"_decode",value:function(t){var e,r,n,i,o,a,s;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=t.split("&")).length;r<n;r++)e=i[r],o.push(e.split("="));return o}())e=o[r],s=(a=[decodeURIComponent(e[0]),decodeURIComponent(e[1])])[1],null==i[n=a[0]]&&(i[n]=[]),i[n].push(s);return i}},{key:"_send",value:function(t,e,r){var n,i;return i=[t,e,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}},{key:"_subscribe",value:function(t){return this._send("sub",t,""),this.subscribed[t]=!0,this.subscribed[t]}},{key:"onClose",value:function(t){var e;for(e in this.connected=!1,this.subscribed)this.pending[e]=!0;return this.subscribed={},this.subscribed}},{key:"onError",value:function(t){throw new Error("onError"+t)}},{key:"onMessage",value:function(t){var e,r;return"ping"===(r=t.data.split(" "))[0]?"function"==typeof(e=this.socket).send?e.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}},{key:"onOpen",value:function(t){var e,r;for(r in this.connected=!0,e=[],this.pending)delete this.pending[r],e.push(this._subscribe(r));return e}},{key:"subscribe",value:function(t){return this.connected?this._subscribe(t):(this.pending[t]=!0,this.pending[t])}}]),r}(),lr=function(){function r(t){(0,e.Z)(this,r),this.fetcher=t,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}return(0,t.Z)(r,[{key:"onHeaders",value:function(t){var e,r,n;return null==t.headers||"undefined"==typeof WebSocket||null===WebSocket||(e=t.headers.etag,n=t.headers["updates-via"],r=t.uri,e&&n&&(this.graph[r]={etag:e,via:n},this.register(n,r))),!0}},{key:"onUpdate",value:function(t,e){return this.fetcher.refresh(ur.namedNode(t))}},{key:"register",value:function(t,e){return null==this.via[t]&&(this.via[t]=new cr(this,t)),this.via[t].subscribe(e)}}]),r}();function hr(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,n=(0,o.Z)(t);if(e){var a=(0,o.Z)(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return(0,i.Z)(this,r)}}var fr={};for(var pr in ur)"function"==typeof ur[pr]&&(fr[pr]=ur[pr].bind(ur));var dr=fr.fetcher,yr=fr.graph,vr=fr.lit,gr=fr.st,mr=fr.namedNode,br=fr.variable,wr=fr.blankNode,xr=fr.defaultGraph,_r=fr.literal,Tr=fr.quad,kr=fr.triple,Ar=new K,Or=function(t){return Ar.fromNT(t)},Er=tt.fromValue,jr=f.nextId,Nr=function(i){(0,n.Z)(s,i);var o=hr(s);function s(t){var n;return(0,e.Z)(this,s),n=o.call(this,t),(0,a.Z)((0,r.Z)(n),"fetcher",void 0),n.fetcher=new Je((0,r.Z)(n),{}),n}return(0,t.Z)(s)}(ft),Sr=function(i){(0,n.Z)(s,i);var o=hr(s);function s(t){var n;return(0,e.Z)(this,s),n=o.call(this,t),(0,a.Z)((0,r.Z)(n),"updater",void 0),n.updater=new ir((0,r.Z)(n)),n}return(0,t.Z)(s)}(Nr)})(),u})()));
|
|
2
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("window")):"function"==typeof define&&define.amd?define(["window"],e):"object"==typeof exports?exports.$rdf=e(require("window")):t.$rdf=e(t.window)}(self,(t=>(()=>{var e,r,n,i,o={9390:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},3787:(t,e,r)=>{"use strict";r.d(e,{A:()=>n});const n={debug:function(t){},warn:function(t){},info:function(t){},error:function(t){},success:function(t){},msg:function(t){}}},3627:(t,e,r)=>{"use strict";r.d(e,{A:()=>v});var n=r(9121),i=r(2937),o=r(365),a=r(8782),s=r(9604),u=r(8175),c=r(9390),l=r(1605),h=r(6866),f=r(362),p=r(546);function d(t,e,r){return e=(0,a.A)(e),(0,o.A)(t,y()?Reflect.construct(e,r||[],(0,a.A)(t).constructor):e.apply(t,r))}function y(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(y=function(){return!!t})()}var v=function(t){function e(t){var r;if((0,n.A)(this,e),r=d(this,e,[(0,f.E)(t)]),(0,u.A)(r,"termType",h.Kk),(0,u.A)(r,"classOrder",c.A.NamedNode),!r.value)throw new Error("Missing IRI for NamedNode");if(!r.value.includes(":"))throw new Error('NamedNode IRI "'+t+'" must be absolute.');if(r.value.includes(" "))throw new Error('Error: NamedNode IRI "'+t+'" must not contain unencoded spaces.');return r}return(0,s.A)(e,t),(0,i.A)(e,[{key:"dir",value:function(){var t=this.value.split("#")[0],r=t.slice(0,-1).lastIndexOf("/"),n=t.indexOf("//");return n>=0&&r<n+2||r<0?null:new e(t.slice(0,r+1))}},{key:"site",value:function(){var t=this.value.split("#")[0],r=t.indexOf("//");if(r<0)throw new Error("This URI does not have a web site part (origin)");var n=t.indexOf("/",r+2);return new e(n<0?t.slice(0)+"/":t.slice(0,n+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new e(this.value.split("#")[0])}},{key:"toString",value:function(){return"<"+this.value+">"}},{key:"id",value:function(){return this.value.split("#")[1]}},{key:"uri",get:function(){return this.value},set:function(t){this.value=t}}],[{key:"fromValue",value:function(t){return null==t||(0,p.D0)(t)?t:new e(t)}}])}(l.A)},1605:(t,e,r)=>{"use strict";r.d(e,{A:()=>a});var n=r(9121),i=r(2937),o=r(8175),a=function(){return(0,i.A)((function t(e){(0,n.A)(this,t),(0,o.A)(this,"termType",void 0),(0,o.A)(this,"classOrder",void 0),(0,o.A)(this,"value",void 0),this.value=e}),[{key:"substitute",value:function(t){return this}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.value<t.value?-1:this.value>t.value?1:0}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(t){return this.equals(t)}},{key:"toCanonical",value:function(){return this.toNT()}},{key:"toNT",value:function(){return this.toString()}},{key:"toNQ",value:function(){return this.toNT()}},{key:"toString",value:function(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}])}();(0,o.A)(a,"fromValue",void 0),(0,o.A)(a,"toJS",void 0)},6866:(t,e,r)=>{"use strict";r.d(e,{$Q:()=>i,BR:()=>y,Fn:()=>w,H:()=>_,JG:()=>m,K9:()=>b,Kk:()=>n,MG:()=>d,P2:()=>a,QW:()=>o,S:()=>c,_0:()=>v,bD:()=>l,bM:()=>g,hu:()=>x,i2:()=>f,ic:()=>s,lc:()=>h,ny:()=>p,r0:()=>u,sT:()=>A});var n="NamedNode",i="BlankNode",o="Literal",a="Variable",s="DefaultGraph",u="Collection",c="Empty",l="Graph",h="text/html",f="application/ld+json",p="text/n3",d="application/n3",y="application/nquads",v="application/n-quads",g="application/n-triples",m="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",A="text/turtle",x="application/x-turtle",_="application/xhtml+xml"},4221:(t,e,r)=>{"use strict";r.r(e),r.d(e,{docpart:()=>a,document:()=>s,hostpart:()=>u,join:()=>c,protocol:()=>l,refTo:()=>h});var n=r(3627),i=r(6357),o=o||i.log;function a(t){var e;return(e=t.indexOf("#"))<0?t:t.slice(0,e)}function s(t){return new n.A(a(t))}function u(t){var e=/[^\/]*\/\/([^\/]*)\//.exec(t);return e?e[1]:""}function c(t,e){var r,n,i,a,s,u=e.indexOf("#");if(u>0&&(e=e.slice(0,u)),0===t.length)return e;if(0===t.indexOf("#"))return e+t;if(t.indexOf(":")>=0)return t;if(r=e.indexOf(":"),0===e.length)return t;if(r<0)return o("Invalid base: "+e+" in join with given: "+t),t;if(n=e.slice(0,+r+1||9e9),0===t.indexOf("//"))return n+t;if(e.indexOf("//",r)===r+1){if((i=e.indexOf("/",r+3))<0)return e.length-r-3>0?e+"/"+t:n+t}else if((i=e.indexOf("/",r+1))<0)return e.length-r-1>0?e+"/"+t:n+t;if(0===t.indexOf("/"))return e.slice(0,i)+t;if((a=(s=e.slice(i)).lastIndexOf("/"))<0)return n+t;for(a>=0&&a<s.length-1&&(s=s.slice(0,+a+1||9e9)),s+=t;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),e.slice(0,i)+s}function l(t){var e=t.indexOf(":");return e<0?null:t.slice(0,e)}function h(t,e){var r,n,i,o,a,s,u,c,l,h,f,p,d=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!t)return e;if(t===e)return"";for(r=u=0,o=e.length;u<o&&e[r]===t[r];r=++u);if(t.slice(0,r).match(d)&&((n=e.indexOf("//"))<0&&(n=-2),i=e.indexOf("/",n+2),"/"!==e[i+1]&&"/"!==t[i+1]&&e.slice(0,i)===t.slice(0,i)))return e.slice(i);if("#"===e[r]&&t.length===r)return e.slice(r);for(;r>0&&"/"!==e[r-1];)r--;if(r<3)return e;if(t.indexOf("//",r-2)>0||e.indexOf("//",r-2)>0)return e;if(t.indexOf(":",r)>0)return e;for(s=0,c=0,a=(h=t.slice(r)).length;c<a;c++)"/"===h[c]&&s++;if(0===s&&r<e.length&&"#"===e[r])return"./"+e.slice(r);if(0===s&&r===e.length)return"./";if(p="",s>0)for(l=1,f=s;f>=1?l<=f:l>=f;f>=1?++l:--l)p+="../";return p+e.slice(r)}},7114:(t,e,r)=>{"use strict";r.r(e),r.d(e,{DOMParserFactory:()=>f,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>p,dtstamp:()=>y,dumpNode:()=>d,heavyCompare:()=>v,heavyCompareSPO:()=>g,linkRelationProperty:()=>l,log:()=>n.A,mediaTypeClass:()=>c,output:()=>m,parseXML:()=>b,stackString:()=>x,string:()=>u,string_startswith:()=>A,uri:()=>i});var n=r(3787),i=r(4221),o=r(3627),a=r(8392);t=r.hmd(t);var s=r(6357),u={template:function(t,e){for(var r=t.split("%s"),n="",i=0;i<e.length;i++)e[i]+="",n+=r[i]+e[i];return n+r.slice(e.length).join()}};function c(t){return t=t.split(";")[0].trim(),new o.A("http://www.w3.org/ns/iana/media-types/"+t+"#Resource")}function l(t){return new o.A("http://www.w3.org/ns/iana/link-relations/relation#"+t.trim())}function h(t,e){t.callbacks={};for(var r=e.length-1;r>=0;r--)t.callbacks[e[r]]=[];t.addHook=function(e){t.callbacks[e]||(t.callbacks[e]=[])},t.addCallback=function(e,r){t.callbacks[e].push(r)},t.removeCallback=function(e,r){for(var n=0;n<t.callbacks[e].length;n++)if(t.callbacks[e][n].name===r)return t.callbacks[e].splice(n,1),!0;return!1},t.insertCallback=function(e,r){t.callbacks[e].unshift(r)},t.fireCallbacks=function(e,r){var n,i,o=[],a=[],s=t.callbacks[e].length;for(n=s-1;n>=0;n--)(i=t.callbacks[e][n])&&i.apply(t,r)&&o.push(i);for(n=o.length-1;n>=0;n--)a.push(o[n]);for(n=s;n<t.callbacks[e].length;n++)a.push(t.callbacks[e][n]);t.callbacks[e]=a}}function f(){return window.DOMParser?new a.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function p(t,e){var r=[];(e=e||{})&&e.selfClosing&&e.selfClosing.split(" ").forEach((function(t){r[t]=!0}));var n=[];return e&&e.skipAttributes&&e.skipAttributes.split(" ").forEach((function(t){n[t]=!0})),d(t,e,r,n)}function d(t,e,r,n){var i,o="",a=[!1];if(void 0===t.nodeType)return o;if(1===t.nodeType){if(t.hasAttribute("class")&&e&&e.classWithChildText&&t.matches(e.classWithChildText.class))o+=t.querySelector(e.classWithChildText.element).textContent;else if(!(e&&e.skipNodeWithClass&&t.matches("."+e.skipNodeWithClass))){var u=t.nodeName.toLowerCase();o+="<"+u;var c=[];for(i=t.attributes.length-1;i>=0;i--){var l=t.attributes[i];if(!(n&&n.length>0&&n[l.name]||/^\d+$/.test(l.name))){if("class"===l.name&&e&&e.replaceClassItemWith&&l.value.split(" ").indexOf(e.replaceClassItemWith.source)>-1){var h=new RegExp(e.replaceClassItemWith.source,"g");l.value=l.value.replace(h,e.replaceClassItemWith.target).trim()}"class"===l.name&&e&&e.skipClassWithValue&&e.skipClassWithValue===l.value||c.push(l.name+"='"+l.value.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,""")+"'")}}if(c.length>0&&(e&&e.sortAttributes&&c.sort((function(t,e){return t.toLowerCase().localeCompare(e.toLowerCase())})),o+=" "+c.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===u?"\n ":"",a.push("style"===u||"script"===u),i=0;i<t.childNodes.length;i++)o+=d(t.childNodes[i]);a.pop(),o+="body"===u?"</"+u+">\n":"</"+u+">"}}}else if(8===t.nodeType)o+="\x3c!--"+t.nodeValue+"--\x3e";else if(3===t.nodeType||4===t.nodeType){var f=t.nodeValue.replace(/\n+$/,"");o+=a[a.length-1]?f:f.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}else s.log("Warning; Cannot handle serialising nodes of type: "+t.nodeType),s.log(t);return o}function y(){var t=new Date,e=t.getYear()+1900,r=t.getMonth()+1,n=t.getDate(),i=t.getUTCHours(),o=t.getUTCMinutes(),a=t.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),a<10&&(a="0"+a),e+"-"+r+"-"+n+"T"+i+":"+o+":"+a+"Z"}function v(t,e,r,n){var i=function(t){return"BlankNode"===t.termType?null:t},o=function(t){var e=r.statementsMatching(t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})).concat(r.statementsMatching(void 0,void 0,t).map((function(t){return i(t.subject)+" "+i(t.predicate)+" "+i(t.object)})));return e.sort(),e.join("\n")},a=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(t,e):t.compareTerm(e);return"BlankNode"===t.termType&&"BlankNode"===e.termType?0===a?0:o(t)>o(e)?1:o(t)<o(e)?-1:a:n&&t.uri&&e.uri?(n[t.uri]||t.uri).localeCompare(n[e.uri]||e.uri):a}function g(t,e,r,n){return v(t.subject,e.subject,r,n)||v(t.predicate,e.predicate,r,n)||v(t.object,e.object,r,n)}function m(t){var e=document.createElement("div");e.textContent=t,document.body.appendChild(e)}function b(e,r){return r=r||{},t&&t.exports?(new a.DOMParser).parseFromString(e,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new a.DOMParser).parseFromString(e,"application/xml")}function w(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.why))return void t.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+e+" "+e.why)}function A(t,e){return t.slice(0,e.length)===e}function x(t){var e=t+"\n";if(!t.stack)return e+"No stack available.\n";for(var r=t.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 a=o.split("@");n.push(a)}for(i=0;i<n.length;i++)e+=" "+n[i][1]+"\n "+n[i][0];return e}},362:(t,e,r)=>{"use strict";function n(t){return"string"==typeof t?t:t.value}r.d(e,{E:()=>n})},546:(t,e,r)=>{"use strict";r.d(e,{CZ:()=>c,D0:()=>f,DJ:()=>u,DZ:()=>h,GE:()=>b,P3:()=>s,RN:()=>w,SH:()=>o,Y2:()=>y,YC:()=>m,aF:()=>d,c$:()=>p,fY:()=>l,hr:()=>g,jt:()=>v,ok:()=>a});var n=r(4360),i=r(6866);function o(t){return"object"===(0,n.A)(t)&&null!==t&&"subject"in t}function a(t){return"object"===(0,n.A)(t)&&null!==t&&"statements"in t}function s(t){return f(t)&&t.termType===i.r0}function u(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===i.Kk||t.termType===i.P2||t.termType===i.$Q||t.termType===i.r0||t.termType===i.QW||t.termType===i.bD)}function c(t){return t&&Object.prototype.hasOwnProperty.call(t,"termType")&&(t.termType===i.Kk||t.termType===i.P2||t.termType===i.$Q||t.termType===i.r0||t.termType===i.QW||t.termType===i.bD)}function l(t){return f(t)&&(t.termType===i.Kk||t.termType===i.$Q||t.termType===i.P2)}function h(t){return f(t)&&t.termType===i.P2}function f(t){return"object"===(0,n.A)(t)&&null!==t&&"termType"in t}function p(t){return t.termType===i.QW}function d(t){return"object"===(0,n.A)(t)&&null!==t&&"subject"in t&&"predicate"in t&&"object"in t}function y(t){return f(t)&&"NamedNode"===t.termType}function v(t){return f(t)&&"termType"in t&&"BlankNode"===t.termType}function g(t){return f(t)&&(t.termType===i.Kk||t.termType===i.P2||t.termType===i.$Q)}function m(t){return f(t)&&(t.termType===i.Kk||t.termType===i.P2)}function b(t){return f(t)&&(t.termType===i.Kk||t.termType===i.P2||t.termType===i.$Q||t.termType===i.QW)}function w(t){return f(t)&&(t.termType===i.Kk||t.termType===i.P2||t.termType===i.$Q||t.termType===i.ic)}},2312:function(t,e,r){var n,i;void 0===(i="function"==typeof(n=function(){"use strict";function t(e,r,n,i){this.message=e,this.expected=r,this.found=n,this.location=i,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),t.buildMessage=function(t,e){var r={literal:function(t){return'"'+i(t.text)+'"'},class:function(t){var e,r="";for(e=0;e<t.parts.length;e++)r+=t.parts[e]instanceof Array?o(t.parts[e][0])+"-"+o(t.parts[e][1]):o(t.parts[e]);return"["+(t.inverted?"^":"")+r+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function i(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}return"Expected "+function(t){var e,n,i,o=new Array(t.length);for(e=0;e<t.length;e++)o[e]=(i=t[e],r[i.type](i));if(o.sort(),o.length>0){for(e=1,n=1;e<o.length;e++)o[e-1]!==o[e]&&(o[n]=o[e],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(t)+" but "+function(t){return t?'"'+i(t)+'"':"end of input"}(e)+" found."},{SyntaxError:t,parse:function(e,n){n=void 0!==n?n:{};var i,o={},a={turtleDoc:Vr},s=Vr,u=function(t){var e=_n.toJSON();return e["@graph"]=[],t.filter((t=>Array.isArray(t))).forEach((t=>{t.forEach((t=>{e["@graph"].push(t)}))})),1===e["@graph"].length&&(Object.assign(e,e["@graph"][0]),delete e["@graph"]),e},c=".",l=Hr(".",!1),h=function(t){return t},f="#",p=Hr("#",!1),d=/^[^\n]/,y=$r(["\n"],!0,!1),v="\n",g=Hr("\n",!1),m=function(t){return t.join("")},b="@prefix",w=Hr("@prefix",!1),A=function(t,e){return _n.addPrefix(""===t?"0":t,e),{}},x="@base",_=Hr("@base",!1),k=function(t){return _n.addBase(t),{}},T=/^[Bb]/,E=$r(["B","b"],!1,!1),O=/^[Aa]/,j=$r(["A","a"],!1,!1),N=/^[Ss]/,S=$r(["S","s"],!1,!1),R=/^[Ee]/,I=$r(["E","e"],!1,!1),C=/^[Pp]/,P=$r(["P","p"],!1,!1),F=/^[Rr]/,U=$r(["R","r"],!1,!1),D=/^[Ff]/,L=$r(["F","f"],!1,!1),M=/^[Ii]/,B=$r(["I","i"],!1,!1),q=/^[Xx]/,H=$r(["X","x"],!1,!1),$=function(t,e){var r={};return"string"==typeof t&&"[]"!==t?r["@id"]=t:"object"==typeof t&&Object.assign(r,t),e&&Object.assign(r,e),[r]},z=function(t,e){var r={};return t&&Object.assign(r,t),e&&Object.assign(r,e),[r]},X=";",G=Hr(";",!1),V=function(t,e,r,n){var i={};return i[r]=n,i},W=function(t,e,r){return r},Q=function(t,e,r){var n={};return r.unshift(function(t,e){var r={};return r[t]=e,r}(t,e)),r.forEach((t=>{t&&Object.keys(t).forEach((e=>{t[e].forEach((t=>{"@type"===e&&void 0!==t["@id"]&&(t=t["@id"]),void 0===n[e]?n[e]=t:Array.isArray(n[e])?n[e].push(t):n[e]=[n[e],t]}))}))})),n},Y=",",J=Hr(",",!1),Z=function(t,e){return e},K=function(t,e){return e.unshift(t),e},tt="a",et=Hr("a",!1),rt=function(){return"@type"},nt=function(t){return kn(t,!0)},it=function(t){return kn(t,!1)},ot=function(t){return"[]"===t?{}:{"@id":t}},at=function(t){return{"@id":t}},st="[",ut=Hr("[",!1),ct="]",lt=Hr("]",!1),ht="(",ft=Hr("(",!1),pt=")",dt=Hr(")",!1),yt=function(t){return{"@list":t}},vt=function(t,e){return{"@value":t,"@language":e}},gt="^^",mt=Hr("^^",!1),bt=function(t,e){if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"true"===t)return!0;if("http://www.w3.org/2001/XMLSchema#boolean"===e&&"false"===t)return!1;if("http://www.w3.org/2001/XMLSchema#integer"===e)return parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===e)return parseFloat(t);const r=_n.resolve(e,!0);if(r){const n=e.split(":")[0];if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"true"===t)return _n.decrement(n),!0;if("http://www.w3.org/2001/XMLSchema#boolean"===r&&"false"===t)return _n.decrement(n),!1;if("http://www.w3.org/2001/XMLSchema#integer"===r)return _n.decrement(n),parseInt(t);if("http://www.w3.org/2001/XMLSchema#double"===r)return _n.decrement(n),parseFloat(t)}return{"@value":t,"@type":e}},wt="true",At=Hr("true",!1),xt=function(){return!0},_t="false",kt=Hr("false",!1),Tt=function(){return!1},Et=function(t){return t+":"},Ot="<",jt=Hr("<",!1),Nt=/^[^\0- <>"{}|\^`\\]/,St=$r([["\0"," "],"<",">",'"',"{","}","|","^","`","\\"],!0,!1),Rt=">",It=Hr(">",!1),Ct=function(t){const e=t.map((t=>65536<=t.codePointAt(0)&&t.codePointAt(0)<=983039?"a":1===t.length?t:6===t.length?String.fromCharCode("0x"+t.substring(2)):10===t.length?String.fromCodePoint("0x"+t.substring(2)):t)).join("");if(e.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)){var r=t.join("");try{return _n.resolve(r)}catch(t){qr("Invalid IRIREF "+r)}}else qr("Invalid IRIREF "+t.join("")+" / "+e)},Pt=":",Ft=Hr(":",!1),Ut=function(t){return t=t||"0",!1===_n.hasPrefix(t)&&qr("undefined prefix "+t),t},Dt=function(t){return t||""},Lt=function(t,e){return _n.increment(t),_n.resolve(t+":"+e)},Mt="_:",Bt=Hr("_:",!1),qt=/^[0-9]/,Ht=$r([["0","9"]],!1,!1),$t="@",zt=Hr("@",!1),Xt=/^[a-zA-Z]/,Gt=$r([["a","z"],["A","Z"]],!1,!1),Vt="-",Wt=Hr("-",!1),Qt=/^[a-zA-Z0-9]/,Yt=$r([["a","z"],["A","Z"],["0","9"]],!1,!1),Jt=function(t,e){return"-"+e.join("")},Zt=function(t,e){return t.join("")+e.join("")},Kt=/^[+\-]/,te=$r(["+","-"],!1,!1),ee=function(t){return t.match(/^[0+][0-9]+$/)?{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#integer"}:parseInt(t)},re=function(t){return{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#decimal"}},ne=function(t){return{"@value":t,"@type":"http://www.w3.org/2001/XMLSchema#double"}},ie=/^[eE]/,oe=$r(["e","E"],!1,!1),ae='"',se=Hr('"',!1),ue=/^[^"\\\n\r]/,ce=$r(['"',"\\","\n","\r"],!0,!1),le="'",he=Hr("'",!1),fe=/^[^'\\\n\r]/,pe=$r(["'","\\","\n","\r"],!0,!1),de="'''",ye=Hr("'''",!1),ve=/^[^'\\]/,ge=$r(["'","\\"],!0,!1),me="''",be=Hr("''",!1),we=function(t,e){return"''"+e.join("")},Ae=function(t,e){return"'"+e.join("")},xe=function(t,e){return t.join("")+e.join("")},_e='"""',ke=Hr('"""',!1),Te=/^[^"\\]/,Ee=$r(['"',"\\"],!0,!1),Oe='""',je=Hr('""',!1),Ne=function(t,e){return'""'+e.join("")},Se=function(t,e){return'"'+e.join("")},Re="\\U",Ie=Hr("\\U",!1),Ce=function(t){return String.fromCodePoint(parseInt(t.join(""),16))},Pe="\\u",Fe=Hr("\\u",!1),Ue=function(t){return String.fromCharCode(parseInt(t.join(""),16))},De="\\t",Le=Hr("\\t",!1),Me=function(){return"\t"},Be="\\b",qe=Hr("\\b",!1),He=function(){return"\b"},$e="\\n",ze=Hr("\\n",!1),Xe=function(){return"\n"},Ge="\\r",Ve=Hr("\\r",!1),We=function(){return"\r"},Qe="\\f",Ye=Hr("\\f",!1),Je=function(){return"\f"},Ze='\\"',Ke=Hr('\\"',!1),tr=function(){return'"'},er="\\'",rr=Hr("\\'",!1),nr=function(){return"'"},ir="\\\\",or=Hr("\\\\",!1),ar=function(){return"\\"},sr=/^[ \t\r\n]/,ur=$r([" ","\t","\r","\n"],!1,!1),cr=function(){return"[]"},lr=/^[\uD800-\uDBFF]/,hr=$r([["\ud800","\udbff"]],!1,!1),fr=/^[\uDC00-\uDFFF]/,pr=$r([["\udc00","\udfff"]],!1,!1),dr=function(t,e){return t+e},yr=/^[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]/,vr=$r([["A","Z"],["a","z"],["À","Ö"],["Ø","ö"],["ø","˿"],["Ͱ","ͽ"],["Ϳ",""],["",""],["⁰",""],["Ⰰ",""],["、",""],["豈","﷏"],["ﷰ","�"]],!1,!1),gr="_",mr=Hr("_",!1),br="·",wr=Hr("·",!1),Ar=/^[\u0300-\u036F]/,xr=$r([["̀","ͯ"]],!1,!1),_r=/^[\u203F-\u2040]/,kr=$r([["‿","⁀"]],!1,!1),Tr=function(t,e,r,n){return r.join("")+n.join("")},Er=function(t,e,r){return t+e.join("")+r.join("")},Or="%",jr=Hr("%",!1),Nr=/^[0-9A-Fa-f]/,Sr=$r([["0","9"],["A","F"],["a","f"]],!1,!1),Rr="\\",Ir=Hr("\\",!1),Cr=/^[_~.!$&'()*+,;=\/?#@%\-]/,Pr=$r(["_","~",".","!","$","&","'","(",")","*","+",",",";","=","/","?","#","@","%","-"],!1,!1),Fr=0,Ur=0,Dr=[{line:1,column:1}],Lr=0,Mr=[],Br=0;if("startRule"in n){if(!(n.startRule in a))throw new Error("Can't start parsing from rule \""+n.startRule+'".');s=a[n.startRule]}function qr(e,r){throw function(e,r){return new t(e,null,null,r)}(e,r=void 0!==r?r:Xr(Ur,Fr))}function Hr(t,e){return{type:"literal",text:t,ignoreCase:e}}function $r(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function zr(t){var r,n=Dr[t];if(n)return n;for(r=t-1;!Dr[r];)r--;for(n={line:(n=Dr[r]).line,column:n.column};r<t;)10===e.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return Dr[t]=n,n}function Xr(t,e){var r=zr(t),n=zr(e);return{start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function Gr(t){Fr<Lr||(Fr>Lr&&(Lr=Fr,Mr=[]),Mr.push(t))}function Vr(){var t,e,r,n;for(t=Fr,e=[],r=Wr();r!==o;)e.push(r),r=Wr();if(e!==o){for(r=[],n=Qr();n!==o;)r.push(n),n=Qr();r!==o?(Ur=t,t=e=u(e)):(Fr=t,t=o)}else Fr=t,t=o;return t}function Wr(){var t,r,n,i;if((t=function(){var t;return(t=function(){var t,r,n,i,a,s,u,h,f;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o)if(e.substr(Fr,7)===b?(n=b,Fr+=7):(n=o,0===Br&&Gr(w)),n!==o){for(i=[],a=Qr();a!==o;)i.push(a),a=Qr();if(i!==o)if((a=un())!==o){for(s=[],u=Qr();u!==o;)s.push(u),u=Qr();if(s!==o)if((u=an())!==o){for(h=[],f=Qr();f!==o;)h.push(f),f=Qr();h!==o?(46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Br&&Gr(l)),f!==o?(Ur=t,t=r=A(a,u)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;return t}())===o&&(t=function(){var t,r,n,i,a,s,u;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o)if(e.substr(Fr,5)===x?(n=x,Fr+=5):(n=o,0===Br&&Gr(_)),n!==o){for(i=[],a=Qr();a!==o;)i.push(a),a=Qr();if(i!==o)if((a=an())!==o){for(s=[],u=Qr();u!==o;)s.push(u),u=Qr();s!==o?(46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Br&&Gr(l)),u!==o?(Ur=t,t=r=k(a)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;return t}())===o&&(t=function(){var t,r,n,i,a,s,u,c,l,h,f,p;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o)if(C.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Br&&Gr(P)),n!==o)if(F.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(U)),i!==o)if(R.test(e.charAt(Fr))?(a=e.charAt(Fr),Fr++):(a=o,0===Br&&Gr(I)),a!==o)if(D.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Br&&Gr(L)),s!==o)if(M.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Br&&Gr(B)),u!==o)if(q.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(H)),c!==o){for(l=[],h=Qr();h!==o;)l.push(h),h=Qr();if(l!==o)if((h=un())!==o){for(f=[],p=Qr();p!==o;)f.push(p),p=Qr();f!==o&&(p=an())!==o?(Ur=t,t=r=A(h,p)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;return t}())===o&&(t=function(){var t,r,n,i,a,s,u,c;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o)if(T.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Br&&Gr(E)),n!==o)if(O.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(j)),i!==o)if(N.test(e.charAt(Fr))?(a=e.charAt(Fr),Fr++):(a=o,0===Br&&Gr(S)),a!==o)if(R.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Br&&Gr(I)),s!==o){for(u=[],c=Qr();c!==o;)u.push(c),c=Qr();u!==o&&(c=an())!==o?(Ur=t,t=r=k(c)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;return t}()),t}())===o)if(t=Fr,(r=function(){var t,e,r;return t=Fr,(e=function(){var t,e;return t=Fr,(e=en())!==o&&(Ur=t,e=nt(e)),(t=e)===o&&(t=on())===o&&(t=nn()),t}())!==o&&(r=Yr())!==o?(Ur=t,t=e=$(e,r)):(Fr=t,t=o),t===o&&(t=Fr,(e=tn())!==o?((r=Yr())===o&&(r=null),r!==o?(Ur=t,t=e=z(e,r)):(Fr=t,t=o)):(Fr=t,t=o)),t}())!==o){for(n=[],i=Qr();i!==o;)n.push(i),i=Qr();n!==o?(46===e.charCodeAt(Fr)?(i=c,Fr++):(i=o,0===Br&&Gr(l)),i!==o?(Ur=t,t=r=h(r)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}function Qr(){var t;return(t=function(){var t;return sr.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Br&&Gr(ur)),t}())===o&&(t=function(){var t,r,n,i;if(t=Fr,35===e.charCodeAt(Fr)?(r=f,Fr++):(r=o,0===Br&&Gr(p)),r!==o){for(n=[],d.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(y));i!==o;)n.push(i),d.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(y));n!==o?(10===e.charCodeAt(Fr)?(i=v,Fr++):(i=o,0===Br&&Gr(g)),i!==o?(Ur=t,t=r=m(n)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}()),t}function Yr(){var t,r,n,i,a,s,u,c,l,h;if(t=Fr,(r=Zr())!==o)if((n=Jr())!==o){for(i=[],a=Fr,s=[],u=Qr();u!==o;)s.push(u),u=Qr();for(s!==o?(59===e.charCodeAt(Fr)?(u=X,Fr++):(u=o,0===Br&&Gr(G)),u!==o?(c=Fr,(l=Zr())!==o&&(h=Jr())!==o?(Ur=c,c=l=V(r,n,l,h)):(Fr=c,c=o),c===o&&(c=null),c!==o?(Ur=a,a=s=W(r,n,c)):(Fr=a,a=o)):(Fr=a,a=o)):(Fr=a,a=o);a!==o;){for(i.push(a),a=Fr,s=[],u=Qr();u!==o;)s.push(u),u=Qr();s!==o?(59===e.charCodeAt(Fr)?(u=X,Fr++):(u=o,0===Br&&Gr(G)),u!==o?(c=Fr,(l=Zr())!==o&&(h=Jr())!==o?(Ur=c,c=l=V(r,n,l,h)):(Fr=c,c=o),c===o&&(c=null),c!==o?(Ur=a,a=s=W(r,n,c)):(Fr=a,a=o)):(Fr=a,a=o)):(Fr=a,a=o)}i!==o?(Ur=t,t=r=Q(r,n,i)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o;return t}function Jr(){var t,r,n,i,a,s,u;if(t=Fr,(r=Kr())!==o){for(n=[],i=Fr,a=[],s=Qr();s!==o;)a.push(s),s=Qr();for(a!==o?(44===e.charCodeAt(Fr)?(s=Y,Fr++):(s=o,0===Br&&Gr(J)),s!==o&&(u=Kr())!==o?(Ur=i,i=a=Z(r,u)):(Fr=i,i=o)):(Fr=i,i=o);i!==o;){for(n.push(i),i=Fr,a=[],s=Qr();s!==o;)a.push(s),s=Qr();a!==o?(44===e.charCodeAt(Fr)?(s=Y,Fr++):(s=o,0===Br&&Gr(J)),s!==o&&(u=Kr())!==o?(Ur=i,i=a=Z(r,u)):(Fr=i,i=o)):(Fr=i,i=o)}n!==o?(Ur=t,t=r=K(r,n)):(Fr=t,t=o)}else Fr=t,t=o;return t}function Zr(){var t,r,n;if(t=Fr,(r=function(){var t,e,r;for(t=Fr,e=[],r=Qr();r!==o;)e.push(r),r=Qr();return e!==o&&(r=nn())!==o?(Ur=t,t=e=h(r)):(Fr=t,t=o),t}())!==o&&(Ur=t,r=h(r)),(t=r)===o){for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();r!==o?(97===e.charCodeAt(Fr)?(n=tt,Fr++):(n=o,0===Br&&Gr(et)),n!==o?(Ur=t,t=r=rt()):(Fr=t,t=o)):(Fr=t,t=o)}return t}function Kr(){var t,r;return(t=function(){var t;return(t=function(){var t,r,n,i,a,s,u;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o)if((n=rn())!==o){for(i=[],a=Qr();a!==o;)i.push(a),a=Qr();i!==o&&(a=function(){var t,r,n,i,a,s,u,c;if(t=Fr,64===e.charCodeAt(Fr)?(r=$t,Fr++):(r=o,0===Br&&Gr(zt)),r!==o){if(n=[],Xt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(Gt)),i!==o)for(;i!==o;)n.push(i),Xt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(Gt));else n=o;if(n!==o){if(i=[],a=Fr,45===e.charCodeAt(Fr)?(s=Vt,Fr++):(s=o,0===Br&&Gr(Wt)),s!==o){if(u=[],Qt.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Yt)),c!==o)for(;c!==o;)u.push(c),Qt.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Yt));else u=o;u!==o?(Ur=a,a=s=Jt(n,u)):(Fr=a,a=o)}else Fr=a,a=o;for(;a!==o;)if(i.push(a),a=Fr,45===e.charCodeAt(Fr)?(s=Vt,Fr++):(s=o,0===Br&&Gr(Wt)),s!==o){if(u=[],Qt.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Yt)),c!==o)for(;c!==o;)u.push(c),Qt.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Yt));else u=o;u!==o?(Ur=a,a=s=Jt(n,u)):(Fr=a,a=o)}else Fr=a,a=o;i!==o?(Ur=t,t=r=Zt(n,i)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;return t}())!==o?(Ur=t,t=r=vt(n,a)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o;if(t===o){for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o)if((n=rn())!==o){for(i=[],a=Qr();a!==o;)i.push(a),a=Qr();if(i!==o)if(e.substr(Fr,2)===gt?(a=gt,Fr+=2):(a=o,0===Br&&Gr(mt)),a!==o){for(s=[],u=Qr();u!==o;)s.push(u),u=Qr();s!==o&&(u=nn())!==o?(Ur=t,t=r=bt(n,u)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;if(t===o){for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();r!==o&&(n=rn())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)}}return t}())===o&&(t=function(){var t,r,n;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();return r!==o?((n=function(){var t,r,n,i,a,s,u,h,f;if(t=Fr,r=Fr,n=Fr,Kt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(te)),i===o&&(i=null),i!==o){if(a=Fr,s=[],qt.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Br&&Gr(Ht)),u!==o)for(;u!==o;)s.push(u),qt.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Br&&Gr(Ht));else s=o;if(s!==o)if(46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Br&&Gr(l)),u!==o){for(h=[],qt.test(e.charAt(Fr))?(f=e.charAt(Fr),Fr++):(f=o,0===Br&&Gr(Ht));f!==o;)h.push(f),qt.test(e.charAt(Fr))?(f=e.charAt(Fr),Fr++):(f=o,0===Br&&Gr(Ht));h!==o&&(f=cn())!==o?a=s=[s,u,h,f]:(Fr=a,a=o)}else Fr=a,a=o;else Fr=a,a=o;if(a===o){if(a=Fr,46===e.charCodeAt(Fr)?(s=c,Fr++):(s=o,0===Br&&Gr(l)),s!==o){if(u=[],qt.test(e.charAt(Fr))?(h=e.charAt(Fr),Fr++):(h=o,0===Br&&Gr(Ht)),h!==o)for(;h!==o;)u.push(h),qt.test(e.charAt(Fr))?(h=e.charAt(Fr),Fr++):(h=o,0===Br&&Gr(Ht));else u=o;u!==o&&(h=cn())!==o?a=s=[s,u,h]:(Fr=a,a=o)}else Fr=a,a=o;if(a===o){if(a=Fr,s=[],qt.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Br&&Gr(Ht)),u!==o)for(;u!==o;)s.push(u),qt.test(e.charAt(Fr))?(u=e.charAt(Fr),Fr++):(u=o,0===Br&&Gr(Ht));else s=o;s!==o&&(u=cn())!==o?a=s=[s,u]:(Fr=a,a=o)}}a!==o?n=i=[i,a]:(Fr=n,n=o)}else Fr=n,n=o;return(r=n!==o?e.substring(r,Fr):n)!==o&&(Ur=t,r=ne(r)),r}())===o&&(n=function(){var t,r,n,i,a,s,u,h;if(t=Fr,r=Fr,n=Fr,Kt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(te)),i===o&&(i=null),i!==o){for(a=[],qt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Br&&Gr(Ht));s!==o;)a.push(s),qt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Br&&Gr(Ht));if(a!==o)if(46===e.charCodeAt(Fr)?(s=c,Fr++):(s=o,0===Br&&Gr(l)),s!==o){if(u=[],qt.test(e.charAt(Fr))?(h=e.charAt(Fr),Fr++):(h=o,0===Br&&Gr(Ht)),h!==o)for(;h!==o;)u.push(h),qt.test(e.charAt(Fr))?(h=e.charAt(Fr),Fr++):(h=o,0===Br&&Gr(Ht));else u=o;u!==o?n=i=[i,a,s,u]:(Fr=n,n=o)}else Fr=n,n=o;else Fr=n,n=o}else Fr=n,n=o;return(r=n!==o?e.substring(r,Fr):n)!==o&&(Ur=t,r=re(r)),r}())===o&&(n=function(){var t,r,n,i,a,s;if(t=Fr,r=Fr,n=Fr,Kt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(te)),i===o&&(i=null),i!==o){if(a=[],qt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Br&&Gr(Ht)),s!==o)for(;s!==o;)a.push(s),qt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Br&&Gr(Ht));else a=o;a!==o?n=i=[i,a]:(Fr=n,n=o)}else Fr=n,n=o;return(r=n!==o?e.substring(r,Fr):n)!==o&&(Ur=t,r=ee(r)),r}()),n!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)):(Fr=t,t=o),t}())===o&&(t=function(){var t,r,n;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o?(e.substr(Fr,4)===wt?(n=wt,Fr+=4):(n=o,0===Br&&Gr(At)),n!==o?(Ur=t,t=r=xt()):(Fr=t,t=o)):(Fr=t,t=o),t===o){for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();r!==o?(e.substr(Fr,5)===_t?(n=_t,Fr+=5):(n=o,0===Br&&Gr(kt)),n!==o?(Ur=t,t=r=Tt()):(Fr=t,t=o)):(Fr=t,t=o)}return t}()),t}())===o&&(t=Fr,(r=en())!==o&&(Ur=t,r=it(r)),(t=r)===o&&(t=Fr,(r=on())!==o&&(Ur=t,r=ot(r)),(t=r)===o&&(t=Fr,(r=tn())!==o&&(Ur=t,r=h(r)),(t=r)===o&&(t=Fr,(r=nn())!==o&&(Ur=t,r=at(r)),t=r)))),t}function tn(){var t,r,n,i,a,s;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o)if(91===e.charCodeAt(Fr)?(n=st,Fr++):(n=o,0===Br&&Gr(ut)),n!==o)if((i=Yr())!==o){for(a=[],s=Qr();s!==o;)a.push(s),s=Qr();a!==o?(93===e.charCodeAt(Fr)?(s=ct,Fr++):(s=o,0===Br&&Gr(lt)),s!==o?(Ur=t,t=r=h(i)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;else Fr=t,t=o;else Fr=t,t=o;return t}function en(){var t,r,n,i,a,s;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o)if(40===e.charCodeAt(Fr)?(n=ht,Fr++):(n=o,0===Br&&Gr(ft)),n!==o){for(i=[],a=Kr();a!==o;)i.push(a),a=Kr();if(i!==o){for(a=[],s=Qr();s!==o;)a.push(s),s=Qr();a!==o?(41===e.charCodeAt(Fr)?(s=pt,Fr++):(s=o,0===Br&&Gr(dt)),s!==o?(Ur=t,t=r=yt(i)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;else Fr=t,t=o;return t}function rn(){var t,r,n;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();return r!==o?((n=function(){var t,r,n,i,a,s,u,c;if(t=Fr,e.substr(Fr,3)===de?(r=de,Fr+=3):(r=o,0===Br&&Gr(ye)),r!==o){for(n=[],ve.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(ge)),i===o&&(i=hn())===o&&(i=ln());i!==o;)n.push(i),ve.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(ge)),i===o&&(i=hn())===o&&(i=ln());if(n!==o){if(i=[],a=Fr,e.substr(Fr,2)===me?(s=me,Fr+=2):(s=o,0===Br&&Gr(be)),s!==o){if(u=[],ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(ge)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(ge)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=we(n,u)):(Fr=a,a=o)}else Fr=a,a=o;if(a===o)if(a=Fr,39===e.charCodeAt(Fr)?(s=le,Fr++):(s=o,0===Br&&Gr(he)),s!==o){if(u=[],ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(ge)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(ge)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Ae(n,u)):(Fr=a,a=o)}else Fr=a,a=o;for(;a!==o;){if(i.push(a),a=Fr,e.substr(Fr,2)===me?(s=me,Fr+=2):(s=o,0===Br&&Gr(be)),s!==o){if(u=[],ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(ge)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(ge)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=we(n,u)):(Fr=a,a=o)}else Fr=a,a=o;if(a===o)if(a=Fr,39===e.charCodeAt(Fr)?(s=le,Fr++):(s=o,0===Br&&Gr(he)),s!==o){if(u=[],ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(ge)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),ve.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(ge)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Ae(n,u)):(Fr=a,a=o)}else Fr=a,a=o}i!==o?(e.substr(Fr,3)===de?(a=de,Fr+=3):(a=o,0===Br&&Gr(ye)),a!==o?(Ur=t,t=r=xe(n,i)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;return t}())===o&&(n=function(){var t,r,n,i,a,s,u,c;if(t=Fr,e.substr(Fr,3)===_e?(r=_e,Fr+=3):(r=o,0===Br&&Gr(ke)),r!==o){for(n=[],Te.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(Ee)),i===o&&(i=hn())===o&&(i=ln());i!==o;)n.push(i),Te.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(Ee)),i===o&&(i=hn())===o&&(i=ln());if(n!==o){if(i=[],a=Fr,e.substr(Fr,2)===Oe?(s=Oe,Fr+=2):(s=o,0===Br&&Gr(je)),s!==o){if(u=[],Te.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Ee)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),Te.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Ee)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Ne(n,u)):(Fr=a,a=o)}else Fr=a,a=o;if(a===o)if(a=Fr,34===e.charCodeAt(Fr)?(s=ae,Fr++):(s=o,0===Br&&Gr(se)),s!==o){if(u=[],Te.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Ee)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),Te.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Ee)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Se(n,u)):(Fr=a,a=o)}else Fr=a,a=o;for(;a!==o;){if(i.push(a),a=Fr,e.substr(Fr,2)===Oe?(s=Oe,Fr+=2):(s=o,0===Br&&Gr(je)),s!==o){if(u=[],Te.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Ee)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),Te.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Ee)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Ne(n,u)):(Fr=a,a=o)}else Fr=a,a=o;if(a===o)if(a=Fr,34===e.charCodeAt(Fr)?(s=ae,Fr++):(s=o,0===Br&&Gr(se)),s!==o){if(u=[],Te.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Ee)),c===o&&(c=hn())===o&&(c=ln()),c!==o)for(;c!==o;)u.push(c),Te.test(e.charAt(Fr))?(c=e.charAt(Fr),Fr++):(c=o,0===Br&&Gr(Ee)),c===o&&(c=hn())===o&&(c=ln());else u=o;u!==o?(Ur=a,a=s=Se(n,u)):(Fr=a,a=o)}else Fr=a,a=o}i!==o?(e.substr(Fr,3)===_e?(a=_e,Fr+=3):(a=o,0===Br&&Gr(ke)),a!==o?(Ur=t,t=r=xe(n,i)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;return t}())===o&&(n=function(){var t,r,n,i;if(t=Fr,39===e.charCodeAt(Fr)?(r=le,Fr++):(r=o,0===Br&&Gr(he)),r!==o){for(n=[],fe.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(pe)),i===o&&(i=hn())===o&&(i=ln());i!==o;)n.push(i),fe.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(pe)),i===o&&(i=hn())===o&&(i=ln());n!==o?(39===e.charCodeAt(Fr)?(i=le,Fr++):(i=o,0===Br&&Gr(he)),i!==o?(Ur=t,t=r=m(n)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}())===o&&(n=function(){var t,r,n,i;if(t=Fr,34===e.charCodeAt(Fr)?(r=ae,Fr++):(r=o,0===Br&&Gr(se)),r!==o){for(n=[],ue.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(ce)),i===o&&(i=hn())===o&&(i=ln());i!==o;)n.push(i),ue.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(ce)),i===o&&(i=hn())===o&&(i=ln());n!==o?(34===e.charCodeAt(Fr)?(i=ae,Fr++):(i=o,0===Br&&Gr(se)),i!==o?(Ur=t,t=r=m(n)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}()),n!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)):(Fr=t,t=o),t}function nn(){var t,r,n;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o&&(n=an())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o),t===o){for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();r!==o&&(n=function(){var t,r;return(t=function(){var t,r,n;return t=Fr,(r=sn())!==o&&(n=function(){var t,r,n,i,a,s,u,h;if(t=Fr,(r=pn())===o&&(58===e.charCodeAt(Fr)?(r=Pt,Fr++):(r=o,0===Br&&Gr(Ft)),r===o&&(qt.test(e.charAt(Fr))?(r=e.charAt(Fr),Fr++):(r=o,0===Br&&Gr(Ht)),r===o&&(r=vn()))),r!==o){for(n=[],(i=dn())===o&&(58===e.charCodeAt(Fr)?(i=Pt,Fr++):(i=o,0===Br&&Gr(Ft)),i===o&&(i=vn()));i!==o;)n.push(i),(i=dn())===o&&(58===e.charCodeAt(Fr)?(i=Pt,Fr++):(i=o,0===Br&&Gr(Ft)),i===o&&(i=vn()));if(n!==o){if(i=[],a=Fr,s=[],46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Br&&Gr(l)),u!==o)for(;u!==o;)s.push(u),46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Br&&Gr(l));else s=o;if(s!==o){if(u=[],(h=dn())===o&&(58===e.charCodeAt(Fr)?(h=Pt,Fr++):(h=o,0===Br&&Gr(Ft)),h===o&&(h=vn())),h!==o)for(;h!==o;)u.push(h),(h=dn())===o&&(58===e.charCodeAt(Fr)?(h=Pt,Fr++):(h=o,0===Br&&Gr(Ft)),h===o&&(h=vn()));else u=o;u!==o?(Ur=a,a=s=Tr(r,n,s,u)):(Fr=a,a=o)}else Fr=a,a=o;for(;a!==o;){if(i.push(a),a=Fr,s=[],46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Br&&Gr(l)),u!==o)for(;u!==o;)s.push(u),46===e.charCodeAt(Fr)?(u=c,Fr++):(u=o,0===Br&&Gr(l));else s=o;if(s!==o){if(u=[],(h=dn())===o&&(58===e.charCodeAt(Fr)?(h=Pt,Fr++):(h=o,0===Br&&Gr(Ft)),h===o&&(h=vn())),h!==o)for(;h!==o;)u.push(h),(h=dn())===o&&(58===e.charCodeAt(Fr)?(h=Pt,Fr++):(h=o,0===Br&&Gr(Ft)),h===o&&(h=vn()));else u=o;u!==o?(Ur=a,a=s=Tr(r,n,s,u)):(Fr=a,a=o)}else Fr=a,a=o}i!==o?(Ur=t,t=r=Er(r,n,i)):(Fr=t,t=o)}else Fr=t,t=o}else Fr=t,t=o;return t}())!==o?(Ur=t,t=r=Lt(r,n)):(Fr=t,t=o),t}())===o&&(t=Fr,(r=sn())!==o&&(Ur=t,r=Et(r)),t=r),t}())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)}return t}function on(){var t,r,n;for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();if(r!==o&&(n=function(){var t,r,n,i,a,s,u,h,f,p;if(t=Fr,r=Fr,e.substr(Fr,2)===Mt?(n=Mt,Fr+=2):(n=o,0===Br&&Gr(Bt)),n!==o)if((i=pn())===o&&(qt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(Ht))),i!==o){for(a=[],s=dn();s!==o;)a.push(s),s=dn();if(a!==o){if(s=[],u=Fr,h=[],46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Br&&Gr(l)),f!==o)for(;f!==o;)h.push(f),46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Br&&Gr(l));else h=o;if(h!==o){if(f=[],(p=dn())!==o)for(;p!==o;)f.push(p),p=dn();else f=o;f!==o?u=h=[h,f]:(Fr=u,u=o)}else Fr=u,u=o;for(;u!==o;){if(s.push(u),u=Fr,h=[],46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Br&&Gr(l)),f!==o)for(;f!==o;)h.push(f),46===e.charCodeAt(Fr)?(f=c,Fr++):(f=o,0===Br&&Gr(l));else h=o;if(h!==o){if(f=[],(p=dn())!==o)for(;p!==o;)f.push(p),p=dn();else f=o;f!==o?u=h=[h,f]:(Fr=u,u=o)}else Fr=u,u=o}s!==o?r=n=[n,i,a,s]:(Fr=r,r=o)}else Fr=r,r=o}else Fr=r,r=o;else Fr=r,r=o;return r!==o?e.substring(t,Fr):r}())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o),t===o){for(t=Fr,r=[],n=Qr();n!==o;)r.push(n),n=Qr();r!==o&&(n=function(){var t,r,n,i;if(t=Fr,91===e.charCodeAt(Fr)?(r=st,Fr++):(r=o,0===Br&&Gr(ut)),r!==o){for(n=[],i=Qr();i!==o;)n.push(i),i=Qr();n!==o?(93===e.charCodeAt(Fr)?(i=ct,Fr++):(i=o,0===Br&&Gr(lt)),i!==o?(Ur=t,t=r=cr()):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}())!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)}return t}function an(){var t,r,n,i;if(t=Fr,60===e.charCodeAt(Fr)?(r=Ot,Fr++):(r=o,0===Br&&Gr(jt)),r!==o){for(n=[],Nt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(St)),i===o&&(i=ln());i!==o;)n.push(i),Nt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(St)),i===o&&(i=ln());n!==o?(62===e.charCodeAt(Fr)?(i=Rt,Fr++):(i=o,0===Br&&Gr(It)),i!==o?(Ur=t,t=r=Ct(n)):(Fr=t,t=o)):(Fr=t,t=o)}else Fr=t,t=o;return t}function sn(){var t,r,n;return t=Fr,(r=yn())===o&&(r=null),r!==o?(58===e.charCodeAt(Fr)?(n=Pt,Fr++):(n=o,0===Br&&Gr(Ft)),n!==o?(Ur=t,t=r=Ut(r)):(Fr=t,t=o)):(Fr=t,t=o),t}function un(){var t,r,n;return t=Fr,(r=yn())===o&&(r=null),r!==o?(58===e.charCodeAt(Fr)?(n=Pt,Fr++):(n=o,0===Br&&Gr(Ft)),n!==o?(Ur=t,t=r=Dt(r)):(Fr=t,t=o)):(Fr=t,t=o),t}function cn(){var t,r,n,i,a,s;if(t=Fr,r=Fr,ie.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Br&&Gr(oe)),n!==o)if(Kt.test(e.charAt(Fr))?(i=e.charAt(Fr),Fr++):(i=o,0===Br&&Gr(te)),i===o&&(i=null),i!==o){if(a=[],qt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Br&&Gr(Ht)),s!==o)for(;s!==o;)a.push(s),qt.test(e.charAt(Fr))?(s=e.charAt(Fr),Fr++):(s=o,0===Br&&Gr(Ht));else a=o;a!==o?r=n=[n,i,a]:(Fr=r,r=o)}else Fr=r,r=o;else Fr=r,r=o;return r!==o?e.substring(t,Fr):r}function ln(){var t,r,n,i,a,s,u,c,l,h,f;return t=Fr,e.substr(Fr,2)===Re?(r=Re,Fr+=2):(r=o,0===Br&&Gr(Ie)),r!==o?(n=Fr,(i=gn())!==o&&(a=gn())!==o&&(s=gn())!==o&&(u=gn())!==o&&(c=gn())!==o&&(l=gn())!==o&&(h=gn())!==o&&(f=gn())!==o?n=i=[i,a,s,u,c,l,h,f]:(Fr=n,n=o),n!==o?(Ur=t,t=r=Ce(n)):(Fr=t,t=o)):(Fr=t,t=o),t===o&&(t=Fr,e.substr(Fr,2)===Pe?(r=Pe,Fr+=2):(r=o,0===Br&&Gr(Fe)),r!==o?(n=Fr,(i=gn())!==o&&(a=gn())!==o&&(s=gn())!==o&&(u=gn())!==o?n=i=[i,a,s,u]:(Fr=n,n=o),n!==o?(Ur=t,t=r=Ue(n)):(Fr=t,t=o)):(Fr=t,t=o)),t}function hn(){var t,r;return t=Fr,e.substr(Fr,2)===De?(r=De,Fr+=2):(r=o,0===Br&&Gr(Le)),r!==o&&(Ur=t,r=Me()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===Be?(r=Be,Fr+=2):(r=o,0===Br&&Gr(qe)),r!==o&&(Ur=t,r=He()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===$e?(r=$e,Fr+=2):(r=o,0===Br&&Gr(ze)),r!==o&&(Ur=t,r=Xe()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===Ge?(r=Ge,Fr+=2):(r=o,0===Br&&Gr(Ve)),r!==o&&(Ur=t,r=We()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===Qe?(r=Qe,Fr+=2):(r=o,0===Br&&Gr(Ye)),r!==o&&(Ur=t,r=Je()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===Ze?(r=Ze,Fr+=2):(r=o,0===Br&&Gr(Ke)),r!==o&&(Ur=t,r=tr()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===er?(r=er,Fr+=2):(r=o,0===Br&&Gr(rr)),r!==o&&(Ur=t,r=nr()),(t=r)===o&&(t=Fr,e.substr(Fr,2)===ir?(r=ir,Fr+=2):(r=o,0===Br&&Gr(or)),r!==o&&(Ur=t,r=ar()),t=r))))))),t}function fn(){var t,r,n;return t=Fr,lr.test(e.charAt(Fr))?(r=e.charAt(Fr),Fr++):(r=o,0===Br&&Gr(hr)),r!==o?(fr.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Br&&Gr(pr)),n!==o?(Ur=t,t=r=dr(r,n)):(Fr=t,t=o)):(Fr=t,t=o),t===o&&(yr.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Br&&Gr(vr))),t}function pn(){var t;return(t=fn())===o&&(95===e.charCodeAt(Fr)?(t=gr,Fr++):(t=o,0===Br&&Gr(mr))),t}function dn(){var t;return(t=pn())===o&&(45===e.charCodeAt(Fr)?(t=Vt,Fr++):(t=o,0===Br&&Gr(Wt)),t===o&&(qt.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Br&&Gr(Ht)),t===o&&(183===e.charCodeAt(Fr)?(t=br,Fr++):(t=o,0===Br&&Gr(wr)),t===o&&(Ar.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Br&&Gr(xr)),t===o&&(_r.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Br&&Gr(kr))))))),t}function yn(){var t,r,n,i,a,s,u,h,f;if(t=Fr,r=Fr,(n=fn())!==o){for(i=[],a=dn();a!==o;)i.push(a),a=dn();if(i!==o){if(a=[],s=Fr,u=[],46===e.charCodeAt(Fr)?(h=c,Fr++):(h=o,0===Br&&Gr(l)),h!==o)for(;h!==o;)u.push(h),46===e.charCodeAt(Fr)?(h=c,Fr++):(h=o,0===Br&&Gr(l));else u=o;if(u!==o){if(h=[],(f=dn())!==o)for(;f!==o;)h.push(f),f=dn();else h=o;h!==o?s=u=[u,h]:(Fr=s,s=o)}else Fr=s,s=o;for(;s!==o;){if(a.push(s),s=Fr,u=[],46===e.charCodeAt(Fr)?(h=c,Fr++):(h=o,0===Br&&Gr(l)),h!==o)for(;h!==o;)u.push(h),46===e.charCodeAt(Fr)?(h=c,Fr++):(h=o,0===Br&&Gr(l));else u=o;if(u!==o){if(h=[],(f=dn())!==o)for(;f!==o;)h.push(f),f=dn();else h=o;h!==o?s=u=[u,h]:(Fr=s,s=o)}else Fr=s,s=o}a!==o?r=n=[n,i,a]:(Fr=r,r=o)}else Fr=r,r=o}else Fr=r,r=o;return r!==o?e.substring(t,Fr):r}function vn(){var t;return(t=function(){var t,r,n,i,a;return t=Fr,r=Fr,37===e.charCodeAt(Fr)?(n=Or,Fr++):(n=o,0===Br&&Gr(jr)),n!==o&&(i=gn())!==o&&(a=gn())!==o?r=n=[n,i,a]:(Fr=r,r=o),r!==o?e.substring(t,Fr):r}())===o&&(t=function(){var t,r,n;return t=Fr,92===e.charCodeAt(Fr)?(r=Rr,Fr++):(r=o,0===Br&&Gr(Ir)),r!==o?(Cr.test(e.charAt(Fr))?(n=e.charAt(Fr),Fr++):(n=o,0===Br&&Gr(Pr)),n!==o?(Ur=t,t=r=h(n)):(Fr=t,t=o)):(Fr=t,t=o),t}()),t}function gn(){var t;return Nr.test(e.charAt(Fr))?(t=e.charAt(Fr),Fr++):(t=o,0===Br&&Gr(Sr)),t}var mn,bn,wn,An=new Function("try {return this===window;}catch(e){ return false;}")()?window.URL:r(9533).URL,xn=function(t){return t.match(/^[a-z](.*?):(.+?)/g)},_n={base:[],data:{},addBase:function(t){if(0===_n.base.length)return void _n.base.push(t);const e=_n.base[_n.base.length-1];e!==t&&_n.base.push(new An(t,e).toString())},addPrefix:function(t,e){const r=_n.data[t];void 0===r?_n.data[t]=[{uri:e,count:0}]:r[r.length-1].uri!==e&&r.push({uri:e,count:0})},hasPrefix:function(t){return void 0!==this.data[t]},resolve:function(t,e){const r=Object.keys(_n.data).find((e=>0===t.indexOf(e+":")));if(void 0!==r){const n=_n.data[r];if(1===n.length&&!0!==e&&xn(n[0].uri))return t;const i=n[n.length-1].uri;return t.replace(r+":",i)}var i=0===_n.base.length?n.baseIRI:_n.base[_n.base.length-1];return!i||t.match(/^(http:|https:|urn:|file:)/)?t:0===t.indexOf("//")&&i?i.split("//")[0]+t:new An(t,i).toString()},increment:function(t){const e=_n.data[t];void 0!==e&&e[e.length-1].count++},decrement:function(t){const e=_n.data[t];void 0!==e&&e[e.length-1].count--},toJSON:function(){const t={};return _n.base.length>0&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"]["@base"]=_n.base[0]),Object.keys(_n.data).forEach((e=>{const r=_n.data[e][0];"http://www.w3.org/2001/XMLSchema#"===r.uri&&r.count<1||xn(r.uri)&&(void 0===t["@context"]&&(t["@context"]={}),t["@context"][e]=r.uri)})),t}};function kn(t,e){if(void 0===t["@list"])return t;if(!e&&!t["@list"].find((t=>void 0!==t["@list"])))return t;if(0===t["@list"].length)return{"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};var r={},n=null;return t["@list"].forEach((t=>{null===n?n=r:(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={},n=n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#first"]=kn(t,!0),n["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"]={"@id":"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"}})),r}if((i=s())!==o&&Fr===e.length)return i;throw i!==o&&Fr<e.length&&Gr({type:"end"}),mn=Mr,bn=Lr<e.length?e.charAt(Lr):null,wn=Lr<e.length?Xr(Lr,Lr+1):Xr(Lr,Lr),new t(t.buildMessage(mn,bn),mn,bn,wn)}}})?n.apply(e,[]):n)||(t.exports=i)},182:(t,e,r)=>{"use strict";var n=r(9964),i=r(6357);function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var a,s,u=r(5403).codes,c=u.ERR_AMBIGUOUS_ARGUMENT,l=u.ERR_INVALID_ARG_TYPE,h=u.ERR_INVALID_ARG_VALUE,f=u.ERR_INVALID_RETURN_VALUE,p=u.ERR_MISSING_ARGS,d=r(5416),y=r(7187).inspect,v=r(7187).types,g=v.isPromise,m=v.isRegExp,b=Object.assign?Object.assign:r(6713).assign,w=Object.is?Object.is:r(8527);function A(){var t=r(6781);a=t.isDeepEqual,s=t.isDeepStrictEqual}new Map;var x=!1,_=t.exports=O,k={};function T(t){if(t.message instanceof Error)throw t.message;throw new d(t)}function E(t,e,r,n){if(!r){var i=!1;if(0===e)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new d({actual:r,expected:!0,message:n,operator:"==",stackStartFn:t});throw o.generatedMessage=i,o}}function O(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];E.apply(void 0,[O,e.length].concat(e))}_.fail=function t(e,r,o,a,s){var u,c=arguments.length;if(0===c?u="Failed":1===c?(o=e,e=void 0):(!1===x&&(x=!0,(n.emitWarning?n.emitWarning:i.warn.bind(i))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===c&&(a="!=")),o instanceof Error)throw o;var l={actual:e,expected:r,operator:void 0===a?"fail":a,stackStartFn:s||t};void 0!==o&&(l.message=o);var h=new d(l);throw u&&(h.message=u,h.generatedMessage=!0),h},_.AssertionError=d,_.ok=O,_.equal=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e!=r&&T({actual:e,expected:r,message:n,operator:"==",stackStartFn:t})},_.notEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");e==r&&T({actual:e,expected:r,message:n,operator:"!=",stackStartFn:t})},_.deepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&A(),a(e,r)||T({actual:e,expected:r,message:n,operator:"deepEqual",stackStartFn:t})},_.notDeepEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&A(),a(e,r)&&T({actual:e,expected:r,message:n,operator:"notDeepEqual",stackStartFn:t})},_.deepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&A(),s(e,r)||T({actual:e,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:t})},_.notDeepStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");void 0===a&&A(),s(e,r)&&T({actual:e,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:t})},_.strictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");w(e,r)||T({actual:e,expected:r,message:n,operator:"strictEqual",stackStartFn:t})},_.notStrictEqual=function t(e,r,n){if(arguments.length<2)throw new p("actual","expected");w(e,r)&&T({actual:e,expected:r,message:n,operator:"notStrictEqual",stackStartFn:t})};var j=function t(e,r,n){var i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r.forEach((function(t){t in e&&(void 0!==n&&"string"==typeof n[t]&&m(e[t])&&e[t].test(n[t])?i[t]=n[t]:i[t]=e[t])}))};function N(t,e,r,n){if("function"!=typeof e){if(m(e))return e.test(t);if(2===arguments.length)throw new l("expected",["Function","RegExp"],e);if("object"!==o(t)||null===t){var i=new d({actual:t,expected:e,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var u=Object.keys(e);if(e instanceof Error)u.push("name","message");else if(0===u.length)throw new h("error",e,"may not be an empty object");return void 0===a&&A(),u.forEach((function(i){"string"==typeof t[i]&&m(e[i])&&e[i].test(t[i])||function(t,e,r,n,i,o){if(!(r in t)||!s(t[r],e[r])){if(!n){var a=new j(t,i),u=new j(e,i,t),c=new d({actual:a,expected:u,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=t,c.expected=e,c.operator=o.name,c}T({actual:t,expected:e,message:n,operator:o.name,stackStartFn:o})}}(t,e,i,r,u,n)})),!0}return void 0!==e.prototype&&t instanceof e||!Error.isPrototypeOf(e)&&!0===e.call({},t)}function S(t){if("function"!=typeof t)throw new l("fn","Function",t);try{t()}catch(t){return t}return k}function R(t){return g(t)||null!==t&&"object"===o(t)&&"function"==typeof t.then&&"function"==typeof t.catch}function I(t){return Promise.resolve().then((function(){var e;if("function"==typeof t){if(!R(e=t()))throw new f("instance of Promise","promiseFn",e)}else{if(!R(t))throw new l("promiseFn",["Function","Promise"],t);e=t}return Promise.resolve().then((function(){return e})).then((function(){return k})).catch((function(t){return t}))}))}function C(t,e,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===o(e)&&null!==e){if(e.message===r)throw new c("error/message",'The error message "'.concat(e.message,'" is identical to the message.'))}else if(e===r)throw new c("error/message",'The error "'.concat(e,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(e===k){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var a="rejects"===t.name?"rejection":"exception";T({actual:void 0,expected:r,operator:t.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:t})}if(r&&!N(e,r,n,t))throw e}function P(t,e,r,n){if(e!==k){if("string"==typeof r&&(n=r,r=void 0),!r||N(e,r)){var i=n?": ".concat(n):".",o="doesNotReject"===t.name?"rejection":"exception";T({actual:e,expected:r,operator:t.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(e&&e.message,'"'),stackStartFn:t})}throw e}}function F(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];E.apply(void 0,[F,e.length].concat(e))}_.throws=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];C.apply(void 0,[t,S(e)].concat(n))},_.rejects=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(e).then((function(e){return C.apply(void 0,[t,e].concat(n))}))},_.doesNotThrow=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];P.apply(void 0,[t,S(e)].concat(n))},_.doesNotReject=function t(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return I(e).then((function(e){return P.apply(void 0,[t,e].concat(n))}))},_.ifError=function t(e){if(null!=e){var r="ifError got unwanted exception: ";"object"===o(e)&&"string"==typeof e.message?0===e.message.length&&e.constructor?r+=e.constructor.name:r+=e.message:r+=y(e);var n=new d({actual:e,expected:null,operator:"ifError",message:r,stackStartFn:t}),i=e.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var s=n.stack.split("\n"),u=0;u<a.length;u++){var c=s.indexOf(a[u]);if(-1!==c){s=s.slice(0,c);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},_.strict=b(F,_,{equal:_.strictEqual,deepEqual:_.deepStrictEqual,notEqual:_.notStrictEqual,notDeepEqual:_.notDeepStrictEqual}),_.strict.strict=_.strict},5416:(t,e,r)=>{"use strict";var n=r(9964);function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e){return!e||"object"!==f(e)&&"function"!=typeof e?s(t):e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function u(t){var e="function"==typeof Map?new Map:void 0;return u=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,n)}function n(){return c(t,arguments,h(this).constructor)}return n.prototype=Object.create(t.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),l(n,t)},u(t)}function c(t,e,r){return c=function(){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(t){return!1}}()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var i=new(Function.bind.apply(t,n));return r&&l(i,r.prototype),i},c.apply(null,arguments)}function l(t,e){return l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},l(t,e)}function h(t){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},h(t)}function f(t){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},f(t)}var p=r(7187).inspect,d=r(5403).codes.ERR_INVALID_ARG_TYPE;function y(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}var v="",g="",m="",b="",w={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 A(t){var e=Object.keys(t),r=Object.create(Object.getPrototypeOf(t));return e.forEach((function(e){r[e]=t[e]})),Object.defineProperty(r,"message",{value:t.message}),r}function x(t){return p(t,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var _=function(t){function e(t){var r;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),"object"!==f(t)||null===t)throw new d("options","Object",t);var i=t.message,o=t.operator,u=t.stackStartFn,c=t.actual,l=t.expected,p=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=a(this,h(e).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(v="[34m",g="[32m",b="[39m",m="[31m"):(v="",g="",b="",m="")),"object"===f(c)&&null!==c&&"object"===f(l)&&null!==l&&"stack"in c&&c instanceof Error&&"stack"in l&&l instanceof Error&&(c=A(c),l=A(l)),"deepStrictEqual"===o||"strictEqual"===o)r=a(this,h(e).call(this,function(t,e,r){var i="",o="",a=0,s="",u=!1,c=x(t),l=c.split("\n"),h=x(e).split("\n"),p=0,d="";if("strictEqual"===r&&"object"===f(t)&&"object"===f(e)&&null!==t&&null!==e&&(r="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var A=l[0].length+h[0].length;if(A<=10){if(!("object"===f(t)&&null!==t||"object"===f(e)&&null!==e||0===t&&0===e))return"".concat(w[r],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&A<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][p]===h[0][p];)p++;p>2&&(d="\n ".concat(function(t,e){if(e=Math.floor(e),0==t.length||0==e)return"";var r=t.length*e;for(e=Math.floor(Math.log(e)/Math.log(2));e;)t+=t,e--;return t+t.substring(0,r-t.length)}(" ",p),"^"),p=0)}}for(var _=l[l.length-1],k=h[h.length-1];_===k&&(p++<2?s="\n ".concat(_).concat(s):i=_,l.pop(),h.pop(),0!==l.length&&0!==h.length);)_=l[l.length-1],k=h[h.length-1];var T=Math.max(l.length,h.length);if(0===T){var E=c.split("\n");if(E.length>30)for(E[26]="".concat(v,"...").concat(b);E.length>27;)E.pop();return"".concat(w.notIdentical,"\n\n").concat(E.join("\n"),"\n")}p>3&&(s="\n".concat(v,"...").concat(b).concat(s),u=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var O=0,j=w[r]+"\n".concat(g,"+ actual").concat(b," ").concat(m,"- expected").concat(b),N=" ".concat(v,"...").concat(b," Lines skipped");for(p=0;p<T;p++){var S=p-a;if(l.length<p+1)S>1&&p>2&&(S>4?(o+="\n".concat(v,"...").concat(b),u=!0):S>3&&(o+="\n ".concat(h[p-2]),O++),o+="\n ".concat(h[p-1]),O++),a=p,i+="\n".concat(m,"-").concat(b," ").concat(h[p]),O++;else if(h.length<p+1)S>1&&p>2&&(S>4?(o+="\n".concat(v,"...").concat(b),u=!0):S>3&&(o+="\n ".concat(l[p-2]),O++),o+="\n ".concat(l[p-1]),O++),a=p,o+="\n".concat(g,"+").concat(b," ").concat(l[p]),O++;else{var R=h[p],I=l[p],C=I!==R&&(!y(I,",")||I.slice(0,-1)!==R);C&&y(R,",")&&R.slice(0,-1)===I&&(C=!1,I+=","),C?(S>1&&p>2&&(S>4?(o+="\n".concat(v,"...").concat(b),u=!0):S>3&&(o+="\n ".concat(l[p-2]),O++),o+="\n ".concat(l[p-1]),O++),a=p,o+="\n".concat(g,"+").concat(b," ").concat(I),i+="\n".concat(m,"-").concat(b," ").concat(R),O+=2):(o+=i,i="",1!==S&&0!==p||(o+="\n ".concat(I),O++))}if(O>20&&p<T-2)return"".concat(j).concat(N,"\n").concat(o,"\n").concat(v,"...").concat(b).concat(i,"\n")+"".concat(v,"...").concat(b)}return"".concat(j).concat(u?N:"","\n").concat(o).concat(i).concat(s).concat(d)}(c,l,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var _=w[o],k=x(c).split("\n");if("notStrictEqual"===o&&"object"===f(c)&&null!==c&&(_=w.notStrictEqualObject),k.length>30)for(k[26]="".concat(v,"...").concat(b);k.length>27;)k.pop();r=1===k.length?a(this,h(e).call(this,"".concat(_," ").concat(k[0]))):a(this,h(e).call(this,"".concat(_,"\n\n").concat(k.join("\n"),"\n")))}else{var T=x(c),E="",O=w[o];"notDeepEqual"===o||"notEqual"===o?(T="".concat(w[o],"\n\n").concat(T)).length>1024&&(T="".concat(T.slice(0,1021),"...")):(E="".concat(x(l)),T.length>512&&(T="".concat(T.slice(0,509),"...")),E.length>512&&(E="".concat(E.slice(0,509),"...")),"deepEqual"===o||"equal"===o?T="".concat(O,"\n\n").concat(T,"\n\nshould equal\n\n"):E=" ".concat(o," ").concat(E)),r=a(this,h(e).call(this,"".concat(T).concat(E)))}return Error.stackTraceLimit=p,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=l,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(s(r),u),r.stack,r.name="AssertionError",a(r)}var r,u;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(e,t),r=e,u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(t,e){return p(this,function(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable})))),n.forEach((function(e){i(t,e,r[e])}))}return t}({},e,{customInspect:!1,depth:0}))}}],u&&o(r.prototype,u),e}(u(Error));t.exports=_},5403:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},i(t)}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}var a,s,u={};function c(t,e,r){r||(r=Error);var a=function(r){function a(r,o,s){var u;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,a),u=function(t,e){return!e||"object"!==n(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}(this,i(a).call(this,function(t,r,n){return"string"==typeof e?e:e(t,r,n)}(r,o,s))),u.code=t,u}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&o(t,e)}(a,r),a}(r);u[t]=a}function l(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(t,e,i){var o,s,u,c,h;if(void 0===a&&(a=r(182)),a("string"==typeof t,"'name' must be a string"),"string"==typeof e&&(s="not ",e.substr(0,4)===s)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-9,r)===e}(t," argument"))u="The ".concat(t," ").concat(o," ").concat(l(e,"type"));else{var f=("number"!=typeof h&&(h=0),h+1>(c=t).length||-1===c.indexOf(".",h)?"argument":"property");u='The "'.concat(t,'" ').concat(f," ").concat(o," ").concat(l(e,"type"))}return u+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(7187));var i=s.inspect(e);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(t,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(t,e,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(t,' to be returned from the "').concat(e,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];void 0===a&&(a=r(182)),a(e.length>0,"At least one arg needs to be specified");var i="The ",o=e.length;switch(e=e.map((function(t){return'"'.concat(t,'"')})),o){case 1:i+="".concat(e[0]," argument");break;case 2:i+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:i+=e.slice(0,o-1).join(", "),i+=", and ".concat(e[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),t.exports.codes=u},6781:(t,e,r)=>{"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!e||r.length!==e);n=!0);}catch(t){i=!0,o=t}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}var o=void 0!==/a/g.flags,a=function(t){var e=[];return t.forEach((function(t){return e.push(t)})),e},s=function(t){var e=[];return t.forEach((function(t,r){return e.push([r,t])})),e},u=Object.is?Object.is:r(8527),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(7051);function h(t){return t.call.bind(t)}var f=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),d=h(Object.prototype.toString),y=r(7187).types,v=y.isAnyArrayBuffer,g=y.isArrayBufferView,m=y.isDate,b=y.isMap,w=y.isRegExp,A=y.isSet,x=y.isNativeError,_=y.isBoxedPrimitive,k=y.isNumberObject,T=y.isStringObject,E=y.isBooleanObject,O=y.isBigIntObject,j=y.isSymbolObject,N=y.isFloat32Array,S=y.isFloat64Array;function R(t){if(0===t.length||t.length>10)return!0;for(var e=0;e<t.length;e++){var r=t.charCodeAt(e);if(r<48||r>57)return!0}return 10===t.length&&t>=Math.pow(2,32)}function I(t){return Object.keys(t).filter(R).concat(c(t).filter(Object.prototype.propertyIsEnumerable.bind(t)))}function C(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0}var P=0,F=1,U=2,D=3;function L(t,e,r,n){if(t===e)return 0!==t||!r||u(t,e);if(r){if("object"!==i(t))return"number"==typeof t&&l(t)&&l(e);if("object"!==i(e)||null===t||null===e)return!1;if(Object.getPrototypeOf(t)!==Object.getPrototypeOf(e))return!1}else{if(null===t||"object"!==i(t))return(null===e||"object"!==i(e))&&t==e;if(null===e||"object"!==i(e))return!1}var a,s,c,h,f=d(t);if(f!==d(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;var p=I(t),y=I(e);return p.length===y.length&&B(t,e,r,n,F,p)}if("[object Object]"===f&&(!b(t)&&b(e)||!A(t)&&A(e)))return!1;if(m(t)){if(!m(e)||Date.prototype.getTime.call(t)!==Date.prototype.getTime.call(e))return!1}else if(w(t)){if(!w(e)||(c=t,h=e,!(o?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(x(t)||t instanceof Error){if(t.message!==e.message||t.name!==e.name)return!1}else{if(g(t)){if(r||!N(t)&&!S(t)){if(!function(t,e){return t.byteLength===e.byteLength&&0===C(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}(t,e))return!1}else if(!function(t,e){if(t.byteLength!==e.byteLength)return!1;for(var r=0;r<t.byteLength;r++)if(t[r]!==e[r])return!1;return!0}(t,e))return!1;var R=I(t),L=I(e);return R.length===L.length&&B(t,e,r,n,P,R)}if(A(t))return!(!A(e)||t.size!==e.size)&&B(t,e,r,n,U);if(b(t))return!(!b(e)||t.size!==e.size)&&B(t,e,r,n,D);if(v(t)){if(s=e,(a=t).byteLength!==s.byteLength||0!==C(new Uint8Array(a),new Uint8Array(s)))return!1}else if(_(t)&&!function(t,e){return k(t)?k(e)&&u(Number.prototype.valueOf.call(t),Number.prototype.valueOf.call(e)):T(t)?T(e)&&String.prototype.valueOf.call(t)===String.prototype.valueOf.call(e):E(t)?E(e)&&Boolean.prototype.valueOf.call(t)===Boolean.prototype.valueOf.call(e):O(t)?O(e)&&BigInt.prototype.valueOf.call(t)===BigInt.prototype.valueOf.call(e):j(e)&&Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(e)}(t,e))return!1}return B(t,e,r,n,P)}function M(t,e){return e.filter((function(e){return p(t,e)}))}function B(t,e,r,o,u,l){if(5===arguments.length){l=Object.keys(t);var h=Object.keys(e);if(l.length!==h.length)return!1}for(var d=0;d<l.length;d++)if(!f(e,l[d]))return!1;if(r&&5===arguments.length){var y=c(t);if(0!==y.length){var v=0;for(d=0;d<y.length;d++){var g=y[d];if(p(t,g)){if(!p(e,g))return!1;l.push(g),v++}else if(p(e,g))return!1}var m=c(e);if(y.length!==m.length&&M(e,m).length!==v)return!1}else{var b=c(e);if(0!==b.length&&0!==M(e,b).length)return!1}}if(0===l.length&&(u===P||u===F&&0===t.length||0===t.size))return!0;if(void 0===o)o={val1:new Map,val2:new Map,position:0};else{var w=o.val1.get(t);if(void 0!==w){var A=o.val2.get(e);if(void 0!==A)return w===A}o.position++}o.val1.set(t,o.position),o.val2.set(e,o.position);var x=function(t,e,r,o,u,c){var l=0;if(c===U){if(!function(t,e,r,n){for(var o=null,s=a(t),u=0;u<s.length;u++){var c=s[u];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!e.has(c)){if(r)return!1;if(!$(t,e,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var l=a(e),h=0;h<l.length;h++){var f=l[h];if("object"===i(f)&&null!==f){if(!q(o,f,r,n))return!1}else if(!r&&!t.has(f)&&!q(o,f,r,n))return!1}return 0===o.size}return!0}(t,e,r,u))return!1}else if(c===D){if(!function(t,e,r,o){for(var a=null,u=s(t),c=0;c<u.length;c++){var l=n(u[c],2),h=l[0],f=l[1];if("object"===i(h)&&null!==h)null===a&&(a=new Set),a.add(h);else{var p=e.get(h);if(void 0===p&&!e.has(h)||!L(f,p,r,o)){if(r)return!1;if(!z(t,e,h,f,o))return!1;null===a&&(a=new Set),a.add(h)}}}if(null!==a){for(var d=s(e),y=0;y<d.length;y++){var v=n(d[y],2),g=(h=v[0],v[1]);if("object"===i(h)&&null!==h){if(!X(a,t,h,g,r,o))return!1}else if(!(r||t.has(h)&&L(t.get(h),g,!1,o)||X(a,t,h,g,!1,o)))return!1}return 0===a.size}return!0}(t,e,r,u))return!1}else if(c===F)for(;l<t.length;l++){if(!f(t,l)){if(f(e,l))return!1;for(var h=Object.keys(t);l<h.length;l++){var p=h[l];if(!f(e,p)||!L(t[p],e[p],r,u))return!1}return h.length===Object.keys(e).length}if(!f(e,l)||!L(t[l],e[l],r,u))return!1}for(l=0;l<o.length;l++){var d=o[l];if(!L(t[d],e[d],r,u))return!1}return!0}(t,e,r,l,o,u);return o.val1.delete(t),o.val2.delete(e),x}function q(t,e,r,n){for(var i=a(t),o=0;o<i.length;o++){var s=i[o];if(L(e,s,r,n))return t.delete(s),!0}return!1}function H(t){switch(i(t)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":t=+t;case"number":if(l(t))return!1}return!0}function $(t,e,r){var n=H(r);return null!=n?n:e.has(n)&&!t.has(n)}function z(t,e,r,n,i){var o=H(r);if(null!=o)return o;var a=e.get(o);return!(void 0===a&&!e.has(o)||!L(n,a,!1,i))&&!t.has(o)&&L(n,a,!1,i)}function X(t,e,r,n,i,o){for(var s=a(t),u=0;u<s.length;u++){var c=s[u];if(L(r,c,i,o)&&L(n,e.get(c),i,o))return t.delete(c),!0}return!1}t.exports={isDeepEqual:function(t,e){return L(t,e,!1)},isDeepStrictEqual:function(t,e){return L(t,e,!0)}}},2504:(t,e)=>{"use strict";e.byteLength=function(t){var e=s(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=s(t),a=o[0],u=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),l=0,h=u>0?a-4:a;for(r=0;r<h;r+=4)e=n[t.charCodeAt(r)]<<18|n[t.charCodeAt(r+1)]<<12|n[t.charCodeAt(r+2)]<<6|n[t.charCodeAt(r+3)],c[l++]=e>>16&255,c[l++]=e>>8&255,c[l++]=255&e;return 2===u&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e),1===u&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],a=16383,s=0,c=n-i;s<c;s+=a)o.push(u(t,s,s+a>c?c:s+a));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function s(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var i,o,a=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),a.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2313:(t,e,r)=>{"use strict";var n=r(6357);const i=r(2504),o=r(9029),a="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.hp=c,e.IS=50;const s=2147483647;function u(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return f(t)}return l(t,e,r)}function l(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|v(t,e);let n=u(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return d(e.buffer,e.byteOffset,e.byteLength)}return p(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return d(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|y(t.length),r=u(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||J(t.length)?u(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function h(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t){return h(t),u(t<0?0:0|y(t))}function p(t){const e=t.length<0?0:0|y(t.length),r=u(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,c.prototype),n}function y(t){if(t>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function v(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return V(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return W(t).length;default:if(i)return n?-1:V(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return R(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return N(this,e,r);case"latin1":case"binary":return S(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){let o,a=1,s=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){let n=-1;for(o=r;o<s;o++)if(c(t,o)===c(e,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===u)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){let r=!0;for(let n=0;n<u;n++)if(c(t,o+n)!==c(e,n)){r=!1;break}if(r)return o}return-1}function A(t,e,r,n){r=Number(r)||0;const i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=e.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(e.substr(2*a,2),16);if(J(n))return a;t[r+a]=n}return a}function x(t,e,r,n){return Q(V(e,t.length-r),t,r,n)}function _(t,e,r,n){return Q(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function k(t,e,r,n){return Q(W(e),t,r,n)}function T(t,e,r,n){return Q(function(t,e){let r,n,i;const o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i<r;){const e=t[i];let o=null,a=e>239?4:e>223?3:e>191?2:1;if(i+a<=r){let r,n,s,u;switch(a){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],s=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&s,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,a=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=a}return function(t){const e=t.length;if(e<=j)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=j));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){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(t,e,r){return l(t,e,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(t,e,r){return function(t,e,r){return h(t),t<=0?u(t):void 0!==e?"string"==typeof r?u(t).fill(e,r):u(t).fill(e):u(t)}(t,e,r)},c.allocUnsafe=function(t){return f(t)},c.allocUnsafeSlow=function(t){return f(t)},c.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==c.prototype},c.compare=function(t,e){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),Y(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).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(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=c.allocUnsafe(e);let i=0;for(r=0;r<t.length;++r){let e=t[r];if(Y(e,Uint8Array))i+e.length>n.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=v,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)m(this,e,e+1);return this},c.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)m(this,e,e+3),m(this,e+1,e+2);return this},c.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)m(this,e,e+7),m(this,e+1,e+6),m(this,e+2,e+5),m(this,e+3,e+4);return this},c.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?O(this,0,t):g.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){let t="";const r=e.IS;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},a&&(c.prototype[a]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const s=Math.min(o,a),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t<s;++t)if(u[t]!==l[t]){o=u[t],a=l[t];break}return o<a?-1:a<o?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return A(this,t,e,r);case"utf8":case"utf-8":return x(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,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 j=4096;function N(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function S(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function R(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=e;n<r;++n)i+=Z[t[n]];return i}function I(t,e,r){const n=t.slice(e,r);let i="";for(let t=0;t<n.length-1;t+=2)i+=String.fromCharCode(n[t]+256*n[t+1]);return i}function C(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function P(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,a>>=8,t[r++]=a,r}function U(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a>>=8,t[r+2]=a,a>>=8,t[r+1]=a,a>>=8,t[r]=a,r+8}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function M(t,e,r,n,i){return e=+e,r>>>=0,i||D(t,0,r,8),o.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o<e&&(i*=256);)n+=this[t+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)})),c.prototype.readBigInt64BE=K((function(t){z(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||X(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)})),c.prototype.readFloatLE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),o.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),o.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||P(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=K((function(t,e=0){return F(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=K((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=0,o=1,a=0;for(this[e]=255&t;++i<r&&(o*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/o|0)-a&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);P(this,t,e,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/o|0)-a&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||P(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=K((function(t,e=0){return F(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=K((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return M(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return M(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<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),t.length-e<n-r&&(n=t.length-e+r);const i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=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===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{const o=c.isBuffer(t)?t:c.from(t,n),a=o.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=o[i%a]}return this};const B={};function q(t,e,r){B[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function H(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t<e){const n="bigint"==typeof e?"n":"";let i;throw i=o>3?0===e||e===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}`:`>= ${e}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){z(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||X(e,t.length-(r+1))}(n,i,o)}function z(t,e){if("number"!=typeof t)throw new B.ERR_INVALID_ARG_TYPE(e,"number",t)}function X(t,e,r){if(Math.floor(t)!==t)throw z(t,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" 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 ${e}. Received ${i}`,n}),RangeError);const G=/[^+/0-9A-Za-z-_]/g;function V(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=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((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function W(t){return i.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Q(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function J(t){return t!=t}const Z=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function K(t){return"undefined"==typeof BigInt?tt:t}function tt(){throw new Error("BigInt not supported")}},7913:(t,e,r)=>{"use strict";var n=r(8651),i=r(6601),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},6601:(t,e,r)=>{"use strict";var n=r(5049),i=r(8651),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=s(n,a,arguments);return u&&c&&u(e,"length").configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))}),e};var h=function(){return s(n,o,arguments)};c?c(t.exports,"apply",{value:h}):t.exports.apply=h},6357:(t,e,r)=>{var n=r(7187),i=r(182);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,u={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(t){u[t]=o()},"time"],[function(t){var e=u[t];if(!e)throw new Error("No such label: "+t);delete u[t];var r=o()-e;a.log(t+": "+r+"ms")},"timeEnd"],[function(){var t=new Error;t.name="Trace",t.message=n.format.apply(null,arguments),a.error(t.stack)},"trace"],[function(t){a.log(n.inspect(t)+"\n")},"dir"],[function(t){if(!t){var e=s.call(arguments,1);i.ok(!1,n.format.apply(null,e))}},"assert"]],l=0;l<c.length;l++){var h=c[l],f=h[0],p=h[1];a[p]||(a[p]=f)}t.exports=a},1147:function(t,e){var r="undefined"!=typeof self?self:this,n=function(){function t(){this.fetch=!1,this.DOMException=r.DOMException}return t.prototype=r,new t}();!function(t){!function(e){var r="URLSearchParams"in t,n="Symbol"in t&&"iterator"in Symbol,i="FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),o="FormData"in t,a="ArrayBuffer"in t;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(t){return t&&s.indexOf(Object.prototype.toString.call(t))>-1};function c(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function l(t){return"string"!=typeof t&&(t=String(t)),t}function h(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return n&&(e[Symbol.iterator]=function(){return e}),e}function f(t){this.map={},t instanceof f?t.forEach((function(t,e){this.append(e,t)}),this):Array.isArray(t)?t.forEach((function(t){this.append(t[0],t[1])}),this):t&&Object.getOwnPropertyNames(t).forEach((function(e){this.append(e,t[e])}),this)}function p(t){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}function d(t){return new Promise((function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}}))}function y(t){var e=new FileReader,r=d(e);return e.readAsArrayBuffer(t),r}function v(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(t){var e;this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:i&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:o&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:r&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():a&&i&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=v(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(t)||u(t))?this._bodyArrayBuffer=v(t):this._bodyText=t=Object.prototype.toString.call(t):this._bodyText="",this.headers.get("content-type")||("string"==typeof t?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(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var t=p(this);if(t)return t;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(y)}),this.text=function(){var t,e,r,n=p(this);if(n)return n;if(this._bodyBlob)return t=this._bodyBlob,r=d(e=new FileReader),e.readAsText(t),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[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}f.prototype.append=function(t,e){t=c(t),e=l(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},f.prototype.delete=function(t){delete this.map[c(t)]},f.prototype.get=function(t){return t=c(t),this.has(t)?this.map[t]:null},f.prototype.has=function(t){return this.map.hasOwnProperty(c(t))},f.prototype.set=function(t,e){this.map[c(t)]=l(e)},f.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},f.prototype.keys=function(){var t=[];return this.forEach((function(e,r){t.push(r)})),h(t)},f.prototype.values=function(){var t=[];return this.forEach((function(e){t.push(e)})),h(t)},f.prototype.entries=function(){var t=[];return this.forEach((function(e,r){t.push([r,e])})),h(t)},n&&(f.prototype[Symbol.iterator]=f.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(t,e){var r,n,i=(e=e||{}).body;if(t instanceof b){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new f(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new f(e.headers)),this.method=(n=(r=e.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=e.mode||this.mode||null,this.signal=e.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(t){var e=new FormData;return t.trim().split("&").forEach((function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(i))}})),e}function A(t,e){e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in e?e.statusText:"OK",this.headers=new f(e.headers),this.url=e.url||"",this._initBody(t)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(A.prototype),A.prototype.clone=function(){return new A(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},A.error=function(){var t=new A(null,{status:0,statusText:""});return t.type="error",t};var x=[301,302,303,307,308];A.redirect=function(t,e){if(-1===x.indexOf(e))throw new RangeError("Invalid status code");return new A(null,{status:e,headers:{location:t}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function _(t,r){return new Promise((function(n,o){var a=new b(t,r);if(a.signal&&a.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function u(){s.abort()}s.onload=function(){var t,e,r={status:s.status,statusText:s.statusText,headers:(t=s.getAllResponseHeaders()||"",e=new f,t.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(t){var r=t.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();e.append(n,i)}})),e)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new A(i,r))},s.onerror=function(){o(new TypeError("Network request failed"))},s.ontimeout=function(){o(new TypeError("Network request failed"))},s.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},s.open(a.method,a.url,!0),"include"===a.credentials?s.withCredentials=!0:"omit"===a.credentials&&(s.withCredentials=!1),"responseType"in s&&i&&(s.responseType="blob"),a.headers.forEach((function(t,e){s.setRequestHeader(e,t)})),a.signal&&(a.signal.addEventListener("abort",u),s.onreadystatechange=function(){4===s.readyState&&a.signal.removeEventListener("abort",u)}),s.send(void 0===a._bodyInit?null:a._bodyInit)}))}_.polyfill=!0,t.fetch||(t.fetch=_,t.Headers=f,t.Request=b,t.Response=A),e.Headers=f,e.Request=b,e.Response=A,e.fetch=_,Object.defineProperty(e,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(e=i.fetch).default=i.fetch,e.fetch=i.fetch,e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response,t.exports=e},7802:(t,e,r)=>{"use strict";var n=r(5643),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,u=r(8890)(),c=s&&u,l=function(t,e,r,n){var i;(!(e in t)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?s(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},h=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=a.call(o,Object.getOwnPropertySymbols(e)));for(var s=0;s<o.length;s+=1)l(t,o[s],e[o[s]],r[o[s]])};h.supportsDescriptors=!!c,t.exports=h},6713:t=>{"use strict";function e(t,e){if(null==t)throw new TypeError("Cannot convert first argument to object");for(var r=Object(t),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var u=o[a],c=Object.getOwnPropertyDescriptor(i,u);void 0!==c&&c.enumerable&&(r[u]=i[u])}}return r}t.exports={assign:e,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:e})}}},8404:(t,e,r)=>{"use strict";var n=r(3746),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var a;arguments.length>=3&&(a=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n<i;n++)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,a):"string"==typeof t?function(t,e,r){for(var n=0,i=t.length;n<i;n++)null==r?e(t.charAt(n),n,t):e.call(r,t.charAt(n),n,t)}(t,e,a):function(t,e,r){for(var n in t)o.call(t,n)&&(null==r?e(t[n],n,t):e.call(r,t[n],n,t))}(t,e,a)}},2719:t=>{"use strict";var e=Array.prototype.slice,r=Object.prototype.toString;t.exports=function(t){var n=this;if("function"!=typeof n||"[object Function]"!==r.call(n))throw new TypeError("Function.prototype.bind called on incompatible "+n);for(var i,o=e.call(arguments,1),a=Math.max(0,n.length-o.length),s=[],u=0;u<a;u++)s.push("$"+u);if(i=Function("binder","return function ("+s.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var r=n.apply(this,o.concat(e.call(arguments)));return Object(r)===r?r:this}return n.apply(t,o.concat(e.call(arguments)))})),n.prototype){var c=function(){};c.prototype=n.prototype,i.prototype=new c,c.prototype=null}return i}},5049:(t,e,r)=>{"use strict";var n=r(2719);t.exports=Function.prototype.bind||n},8651:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new a},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,h=r(3257)(),f=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:f(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?f([][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,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%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?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?f((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?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?f(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":d,"%TypeError%":a,"%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};try{null.error}catch(t){var v=f(f(t));y["%Error.prototype%"]=v}var g=function t(e){var r;if("%AsyncFunction%"===e)r=s("async function () {}");else if("%GeneratorFunction%"===e)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=s("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=f(i.prototype))}return y[e]=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"]},b=r(5049),w=r(8032),A=b.call(Function.call,Array.prototype.concat),x=b.call(Function.apply,Array.prototype.splice),_=b.call(Function.call,String.prototype.replace),k=b.call(Function.call,String.prototype.slice),T=b.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,O=/\\(\\)?/g,j=function(t,e){var r,n=t;if(w(m,n)&&(n="%"+(r=m[n])[0]+"%"),w(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new a("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new a('"allowMissing" argument must be a boolean');if(null===T(/^%?[^%]*%?$/,t))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=k(t,0,1),r=k(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,E,(function(t,e,r,i){n[n.length]=r?_(i,O,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",o=j("%"+n+"%",e),s=o.name,c=o.value,l=!1,h=o.alias;h&&(n=h[0],x(r,A([0,1],h)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],v=k(d,0,1),g=k(d,-1);if(('"'===v||"'"===v||"`"===v||'"'===g||"'"===g||"`"===g)&&v!==g)throw new i("property names with quotes must have matching quotes");if("constructor"!==d&&p||(l=!0),w(y,s="%"+(n+="."+d)+"%"))c=y[s];else if(null!=c){if(!(d in c)){if(!e)throw new a("base intrinsic for "+t+" exists, but the property is not available.");return}if(u&&f+1>=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=w(c,d),c=c[d];p&&!l&&(y[s]=c)}}return c}},8109:(t,e,r)=>{"use strict";var n=r(8651)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},8890:(t,e,r)=>{"use strict";var n=r(8651)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(t){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},3257:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(2843);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},2843:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},6626:(t,e,r)=>{"use strict";var n=r(2843);t.exports=function(){return n()&&!!Symbol.toStringTag}},8032:(t,e,r)=>{"use strict";var n=r(5049);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},9029:(t,e)=>{e.read=function(t,e,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+h],h+=f,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,n),o-=c}return(p?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(a++,u/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(e*u-1)*Math.pow(2,i),a+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[r+p]=255&a,p+=d,a/=256,c-=8);t[r+p-d]|=128*y}},9784:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},7906:(t,e,r)=>{"use strict";var n=r(6626)(),i=r(7913)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},a=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,t.exports=s?o:a},3746:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,a=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},s=function(t){try{return!a(t)&&(n.call(t),!0)}catch(t){return!1}},u=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;u.call(f)===u.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=u.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!a(t)&&s(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(c)return s(t);if(a(t))return!1;var e=u.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&s(t)}},4610:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(6626)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(a.test(o.call(t)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},2621:t=>{"use strict";t.exports=function(t){return t!=t}},7051:(t,e,r)=>{"use strict";var n=r(6601),i=r(7802),o=r(2621),a=r(1320),s=r(5074),u=n(a(),Number);i(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},1320:(t,e,r)=>{"use strict";var n=r(2621);t.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},5074:(t,e,r)=>{"use strict";var n=r(7802),i=r(1320);t.exports=function(){var t=i();return n(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t}},6094:(t,e,r)=>{"use strict";var n=r(8404),i=r(821),o=r(7913),a=o("Object.prototype.toString"),s=r(6626)(),u=r(8109),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),h=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r<t.length;r+=1)if(t[r]===e)return r;return-1},f=o("String.prototype.slice"),p={},d=Object.getPrototypeOf;s&&u&&d&&n(l,(function(t){var e=new c[t];if(Symbol.toStringTag in e){var r=d(e),n=u(r,Symbol.toStringTag);if(!n){var i=d(r);n=u(i,Symbol.toStringTag)}p[t]=n.get}})),t.exports=function(t){if(!t||"object"!=typeof t)return!1;if(!s||!(Symbol.toStringTag in t)){var e=f(a(t),8,-1);return h(l,e)>-1}return!!u&&function(t){var e=!1;return n(p,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},3249:t=>{"use strict";var e=function(t){return t!=t};t.exports=function(t,r){return 0===t&&0===r?1/t==1/r:t===r||!(!e(t)||!e(r))}},8527:(t,e,r)=>{"use strict";var n=r(7802),i=r(6601),o=r(3249),a=r(9636),s=r(3534),u=i(a(),Object);n(u,{getPolyfill:a,implementation:o,shim:s}),t.exports=u},9636:(t,e,r)=>{"use strict";var n=r(3249);t.exports=function(){return"function"==typeof Object.is?Object.is:n}},3534:(t,e,r)=>{"use strict";var n=r(9636),i=r(7802);t.exports=function(){var t=n();return i(Object,{is:t},{is:function(){return Object.is!==t}}),t}},8461:(t,e,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(6515),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$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 t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=a(t),s=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=c&&r;if(s&&t.length>0&&!i.call(t,0))for(var y=0;y<t.length;++y)f.push(String(y));if(n&&t.length>0)for(var v=0;v<t.length;++v)f.push(String(v));else for(var g in t)d&&"prototype"===g||!i.call(t,g)||f.push(String(g));if(u)for(var m=function(t){if("undefined"==typeof window||!p)return h(t);try{return h(t)}catch(t){return!1}}(t),b=0;b<l.length;++b)m&&"constructor"===l[b]||!i.call(t,l[b])||f.push(l[b]);return f}}t.exports=n},5643:(t,e,r)=>{"use strict";var n=Array.prototype.slice,i=r(6515),o=Object.keys,a=o?function(t){return o(t)}:r(8461),s=Object.keys;a.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?s(n.call(t)):s(t)})}else Object.keys=a;return Object.keys||a},t.exports=a},6515:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},9964:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var s,u=[],c=!1,l=-1;function h(){c&&s&&(c=!1,s.length?u=s.concat(u):l=-1,u.length&&f())}function f(){if(!c){var t=a(h);c=!0;for(var e=u.length;e;){for(s=u,u=[];++l<e;)s&&s[l].run();l=-1,e=u.length}s=null,c=!1,function(t){if(r===clearTimeout)return clearTimeout(t);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(t);try{return r(t)}catch(e){try{return r.call(null,t)}catch(e){return r.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function d(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new p(t,e)),1!==u.length||c||a(f)},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=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},4016:t=>{"use strict";function e(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,r,n,i){r=r||"&",n=n||"=";var o={};if("string"!=typeof t||0===t.length)return o;var a=/\+/g;t=t.split(r);var s=1e3;i&&"number"==typeof i.maxKeys&&(s=i.maxKeys);var u=t.length;s>0&&u>s&&(u=s);for(var c=0;c<u;++c){var l,h,f,p,d=t[c].replace(a,"%20"),y=d.indexOf(n);y>=0?(l=d.substr(0,y),h=d.substr(y+1)):(l=d,h=""),f=decodeURIComponent(l),p=decodeURIComponent(h),e(o,f)?Array.isArray(o[f])?o[f].push(p):o[f]=[o[f],p]:o[f]=p}return o}},3016:t=>{"use strict";var e=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,r,n,i){return r=r||"&",n=n||"=",null===t&&(t=void 0),"object"==typeof t?Object.keys(t).map((function(i){var o=encodeURIComponent(e(i))+n;return Array.isArray(t[i])?t[i].map((function(t){return o+encodeURIComponent(e(t))})).join(r):o+encodeURIComponent(e(t[i]))})).join(r):i?encodeURIComponent(e(i))+n+encodeURIComponent(e(t)):""}},4756:(t,e,r)=>{"use strict";e.decode=e.parse=r(4016),e.encode=e.stringify=r(3016)},5582:(t,e,r)=>{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},8540:t=>{const e={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/",skos:"http://www.w3.org/2004/02/skos/core#",bookmark:"http://www.w3.org/2002/01/bookmark#",vann:"http://purl.org/vocab/vann/"};t.exports=function(t={namedNode:t=>t}){const r={};for(const n in e){const i=e[n];r[n]=function(e=""){return t.namedNode(i+e)}}return r}},9292:function(t,e,r){var n;t=r.nmd(t),function(i){e&&e.nodeType,t&&t.nodeType;var o="object"==typeof r.g&&r.g;o.global!==o&&o.window!==o&&o.self;var a,s=2147483647,u=36,c=26,l=38,h=700,f=/^xn--/,p=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},v=u-1,g=Math.floor,m=String.fromCharCode;function b(t){throw RangeError(y[t])}function w(t,e){for(var r=t.length,n=[];r--;)n[r]=e(t[r]);return n}function A(t,e){var r=t.split("@"),n="";return r.length>1&&(n=r[0]+"@",t=r[1]),n+w((t=t.replace(d,".")).split("."),e).join(".")}function x(t){for(var e,r,n=[],i=0,o=t.length;i<o;)(e=t.charCodeAt(i++))>=55296&&e<=56319&&i<o?56320==(64512&(r=t.charCodeAt(i++)))?n.push(((1023&e)<<10)+(1023&r)+65536):(n.push(e),i--):n.push(e);return n}function _(t){return w(t,(function(t){var e="";return t>65535&&(e+=m((t-=65536)>>>10&1023|55296),t=56320|1023&t),e+m(t)})).join("")}function k(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function T(t,e,r){var n=0;for(t=r?g(t/h):t>>1,t+=g(t/e);t>v*c>>1;n+=u)t=g(t/v);return g(n+(v+1)*t/(t+l))}function E(t){var e,r,n,i,o,a,l,h,f,p,d,y=[],v=t.length,m=0,w=128,A=72;for((r=t.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)t.charCodeAt(n)>=128&&b("not-basic"),y.push(t.charCodeAt(n));for(i=r>0?r+1:0;i<v;){for(o=m,a=1,l=u;i>=v&&b("invalid-input"),((h=(d=t.charCodeAt(i++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:u)>=u||h>g((s-m)/a))&&b("overflow"),m+=h*a,!(h<(f=l<=A?1:l>=A+c?c:l-A));l+=u)a>g(s/(p=u-f))&&b("overflow"),a*=p;A=T(m-o,e=y.length+1,0==o),g(m/e)>s-w&&b("overflow"),w+=g(m/e),m%=e,y.splice(m++,0,w)}return _(y)}function O(t){var e,r,n,i,o,a,l,h,f,p,d,y,v,w,A,_=[];for(y=(t=x(t)).length,e=128,r=0,o=72,a=0;a<y;++a)(d=t[a])<128&&_.push(m(d));for(n=i=_.length,i&&_.push("-");n<y;){for(l=s,a=0;a<y;++a)(d=t[a])>=e&&d<l&&(l=d);for(l-e>g((s-r)/(v=n+1))&&b("overflow"),r+=(l-e)*v,e=l,a=0;a<y;++a)if((d=t[a])<e&&++r>s&&b("overflow"),d==e){for(h=r,f=u;!(h<(p=f<=o?1:f>=o+c?c:f-o));f+=u)A=h-p,w=u-p,_.push(m(k(p+A%w,0))),h=g(A/w);_.push(m(k(h,0))),o=T(r,v,n==i),r=0,++n}++r,++e}return _.join("")}a={version:"1.3.2",ucs2:{decode:x,encode:_},decode:E,encode:O,toASCII:function(t){return A(t,(function(t){return p.test(t)?"xn--"+O(t):t}))},toUnicode:function(t){return A(t,(function(t){return f.test(t)?E(t.slice(4).toLowerCase()):t}))}},void 0===(n=function(){return a}.call(e,r,e,t))||(t.exports=n)}()},9533:(t,e,r)=>{"use strict";var n=r(9292),i=r(8278);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),h=["%","/","?",";","#"].concat(l),f=["/","?","#"],p=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=r(4756);o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o<t.indexOf("#")?"?":"#",c=t.split(s);c[0]=c[0].replace(/\\/g,"/");var b=t=c.join(s);if(b=b.trim(),!r&&1===t.split("#").length){var w=u.exec(b);if(w)return this.path=b,this.href=b,this.pathname=w[1],w[2]?(this.search=w[2],this.query=e?m.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var A=a.exec(b);if(A){var x=(A=A[0]).toLowerCase();this.protocol=x,b=b.substr(A.length)}if(r||A||b.match(/^\/\/[^@\/]+@[^@\/]+/)){var _="//"===b.substr(0,2);!_||A&&v[A]||(b=b.substr(2),this.slashes=!0)}if(!v[A]&&(_||A&&!g[A])){for(var k,T,E=-1,O=0;O<f.length;O++)-1!==(j=b.indexOf(f[O]))&&(-1===E||j<E)&&(E=j);for(-1!==(T=-1===E?b.lastIndexOf("@"):b.lastIndexOf("@",E))&&(k=b.slice(0,T),b=b.slice(T+1),this.auth=decodeURIComponent(k)),E=-1,O=0;O<h.length;O++){var j;-1!==(j=b.indexOf(h[O]))&&(-1===E||j<E)&&(E=j)}-1===E&&(E=b.length),this.host=b.slice(0,E),b=b.slice(E),this.parseHost(),this.hostname=this.hostname||"";var N="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!N)for(var S=this.hostname.split(/\./),R=(O=0,S.length);O<R;O++){var I=S[O];if(I&&!I.match(p)){for(var C="",P=0,F=I.length;P<F;P++)I.charCodeAt(P)>127?C+="x":C+=I[P];if(!C.match(p)){var U=S.slice(0,O),D=S.slice(O+1),L=I.match(d);L&&(U.push(L[1]),D.unshift(L[2])),D.length&&(b="/"+D.join(".")+b),this.hostname=U.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),N||(this.hostname=n.toASCII(this.hostname));var M=this.port?":"+this.port:"",B=this.hostname||"";this.host=B+M,this.href+=this.host,N&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!y[x])for(O=0,R=l.length;O<R;O++){var q=l[O];if(-1!==b.indexOf(q)){var H=encodeURIComponent(q);H===q&&(H=escape(q)),b=b.split(q).join(H)}}var $=b.indexOf("#");-1!==$&&(this.hash=b.substr($),b=b.slice(0,$));var z=b.indexOf("?");if(-1!==z?(this.search=b.substr(z),this.query=b.substr(z+1),e&&(this.query=m.parse(this.query)),b=b.slice(0,z)):e&&(this.search="",this.query={}),b&&(this.pathname=b),g[x]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){M=this.pathname||"";var X=this.search||"";this.path=M+X}return this.href=this.format(),this},o.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=t+this.host:this.hostname&&(o=t+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=m.stringify(this.query));var s=this.search||a&&"?"+a||"";return e&&":"!==e.substr(-1)&&(e+=":"),this.slashes||(!e||g[e])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),e+o+(r=r.replace(/[?#]/g,(function(t){return encodeURIComponent(t)})))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(t){return this.resolveObject(function(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}(t,!1,!0)).format()},o.prototype.resolveObject=function(t){if(i.isString(t)){var e=new o;e.parse(t,!1,!0),t=e}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=t.hash,""===t.href)return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var u=Object.keys(t),c=0;c<u.length;c++){var l=u[c];"protocol"!==l&&(r[l]=t[l])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!g[t.protocol]){for(var h=Object.keys(t),f=0;f<h.length;f++){var p=h[f];r[p]=t[p]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||v[t.protocol])r.pathname=t.pathname;else{for(var d=(t.pathname||"").split("/");d.length&&!(t.host=d.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var y=r.pathname||"",m=r.search||"";r.path=y+m}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),w=t.host||t.pathname&&"/"===t.pathname.charAt(0),A=w||b||r.host&&t.pathname,x=A,_=r.pathname&&r.pathname.split("/")||[],k=(d=t.pathname&&t.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(k&&(r.hostname="",r.port=null,r.host&&(""===_[0]?_[0]=r.host:_.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===d[0]?d[0]=t.host:d.unshift(t.host)),t.host=null),A=A&&(""===d[0]||""===_[0])),w)r.host=t.host||""===t.host?t.host:r.host,r.hostname=t.hostname||""===t.hostname?t.hostname:r.hostname,r.search=t.search,r.query=t.query,_=d;else if(d.length)_||(_=[]),_.pop(),_=_.concat(d),r.search=t.search,r.query=t.query;else if(!i.isNullOrUndefined(t.search))return k&&(r.hostname=r.host=_.shift(),(N=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=N.shift(),r.host=r.hostname=N.shift())),r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!_.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var T=_.slice(-1)[0],E=(r.host||t.host||_.length>1)&&("."===T||".."===T)||""===T,O=0,j=_.length;j>=0;j--)"."===(T=_[j])?_.splice(j,1):".."===T?(_.splice(j,1),O++):O&&(_.splice(j,1),O--);if(!A&&!x)for(;O--;O)_.unshift("..");!A||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),E&&"/"!==_.join("/").substr(-1)&&_.push("");var N,S=""===_[0]||_[0]&&"/"===_[0].charAt(0);return k&&(r.hostname=r.host=S?"":_.length?_.shift():"",(N=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=N.shift(),r.host=r.hostname=N.shift())),(A=A||r.host&&_.length)&&!S&&_.unshift(""),_.length?r.pathname=_.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},8278:t=>{"use strict";t.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},1201:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},9490:(t,e,r)=>{"use strict";var n=r(7906),i=r(4610),o=r(3381),a=r(6094);function s(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(u)var d=s(BigInt.prototype.valueOf);if(c)var y=s(Symbol.prototype.valueOf);function v(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function g(t){return"[object Map]"===l(t)}function m(t){return"[object Set]"===l(t)}function b(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function A(t){return"[object ArrayBuffer]"===l(t)}function x(t){return"undefined"!=typeof ArrayBuffer&&(A.working?A(t):t instanceof ArrayBuffer)}function _(t){return"[object DataView]"===l(t)}function k(t){return"undefined"!=typeof DataView&&(_.working?_(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=a,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):a(t)||k(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},g.working="undefined"!=typeof Map&&g(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(g.working?g(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(b.working?b(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},A.working="undefined"!=typeof ArrayBuffer&&A(new ArrayBuffer),e.isArrayBuffer=x,_.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&_(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=k;var T="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function E(t){return"[object SharedArrayBuffer]"===l(t)}function O(t){return void 0!==T&&(void 0===E.working&&(E.working=E(new T)),E.working?E(t):t instanceof T)}function j(t){return v(t,h)}function N(t){return v(t,f)}function S(t){return v(t,p)}function R(t){return u&&v(t,d)}function I(t){return c&&v(t,y)}e.isSharedArrayBuffer=O,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=j,e.isStringObject=N,e.isBooleanObject=S,e.isBigIntObject=R,e.isSymbolObject=I,e.isBoxedPrimitive=function(t){return j(t)||N(t)||S(t)||R(t)||I(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(x(t)||O(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},7187:(t,e,r)=>{var n=r(9964),i=r(6357),o=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n<e.length;n++)r[e[n]]=Object.getOwnPropertyDescriptor(t,e[n]);return r},a=/%[sdj%]/g;e.format=function(t){if(!w(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(l(arguments[r]));return e.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(t).replace(a,(function(t){if("%%"===t)return"%";if(r>=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),s=n[r];r<i;s=n[++r])m(s)||!_(s)?o+=" "+s:o+=" "+l(s);return o},e.deprecate=function(t,r){if(void 0!==n&&!0===n.noDeprecation)return t;if(void 0===n)return function(){return e.deprecate(t,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 t.apply(this,arguments)}};var s={},u=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),u=new RegExp("^"+c+"$","i")}function l(t,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),A(n.showHidden)&&(n.showHidden=!1),A(n.depth)&&(n.depth=2),A(n.colors)&&(n.colors=!1),A(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),p(n,t,n.depth)}function h(t,e){var r=l.styles[e];return r?"["+l.colors[r][0]+"m"+t+"["+l.colors[r][1]+"m":t}function f(t,e){return t}function p(t,r,n){if(t.customInspect&&r&&E(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return w(i)||(i=p(t,i,n)),i}var o=function(t,e){if(A(e))return t.stylize("undefined","undefined");if(w(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),T(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(E(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(x(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(k(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return d(r)}var c,l="",h=!1,f=["{","}"];return v(r)&&(h=!0,f=["[","]"]),E(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),x(r)&&(l=" "+RegExp.prototype.toString.call(r)),k(r)&&(l=" "+Date.prototype.toUTCString.call(r)),T(r)&&(l=" "+d(r)),0!==a.length||h&&0!=r.length?n<0?x(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=h?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a<s;++a)S(e,String(a))?o.push(y(t,e,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(y(t,e,r,n,i,!0))})),o}(t,r,n,s,a):a.map((function(e){return y(t,r,n,s,e,h)})),t.seen.pop(),function(t,e,r){return t.reduce((function(t,e){return e.indexOf("\n"),t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,l,f)):f[0]+l+f[1]}function d(t){return"["+Error.prototype.toString.call(t)+"]"}function y(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),S(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(r)?p(t,u.value,null):p(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(t){return" "+t})).join("\n").slice(2):"\n"+s.split("\n").map((function(t){return" "+t})).join("\n")):s=t.stylize("[Circular]","special")),A(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function v(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function b(t){return"number"==typeof t}function w(t){return"string"==typeof t}function A(t){return void 0===t}function x(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function k(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function E(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function j(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(u.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);i.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=l,l.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]},l.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(9490),e.isArray=v,e.isBoolean=g,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=b,e.isString=w,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=A,e.isRegExp=x,e.types.isRegExp=x,e.isObject=_,e.isDate=k,e.types.isDate=k,e.isError=T,e.types.isNativeError=T,e.isFunction=E,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(1201);var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){var t,r;i.log("%s - %s",(r=[j((t=new Date).getHours()),j(t.getMinutes()),j(t.getSeconds())].join(":"),[t.getDate(),N[t.getMonth()],r].join(" ")),e.format.apply(e,arguments))},e.inherits=r(9784),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function I(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(R&&t[R]){var e;if("function"!=typeof(e=t[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(t,n){t?r(t):e(n)}));try{t.apply(this,i)}catch(t){r(t)}return n}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),R&&Object.defineProperty(e,R,{value:e,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(e,o(t))},e.promisify.custom=R,e.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function e(){for(var e=[],r=0;r<arguments.length;r++)e.push(arguments[r]);var i=e.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,e).then((function(t){n.nextTick(a.bind(null,null,t))}),(function(t){n.nextTick(I.bind(null,t,a))}))}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,o(t)),e}},3381:(t,e,r)=>{"use strict";var n=r(8404),i=r(821),o=r(7913),a=r(8109),s=o("Object.prototype.toString"),u=r(6626)(),c="undefined"==typeof globalThis?r.g:globalThis,l=i(),h=o("String.prototype.slice"),f={},p=Object.getPrototypeOf;u&&a&&p&&n(l,(function(t){if("function"==typeof c[t]){var e=new c[t];if(Symbol.toStringTag in e){var r=p(e),n=a(r,Symbol.toStringTag);if(!n){var i=p(r);n=a(i,Symbol.toStringTag)}f[t]=n.get}}}));var d=r(6094);t.exports=function(t){return!!d(t)&&(u&&Symbol.toStringTag in t?function(t){var e=!1;return n(f,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):h(s(t),8,-1))}},8392:e=>{"use strict";e.exports=t},8541:(t,e,r)=>{var n=r(2990).default;function i(){"use strict";t.exports=i=function(){return r},t.exports.__esModule=!0,t.exports.default=t.exports;var e,r={},o=Object.prototype,a=o.hasOwnProperty,s=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",l=u.asyncIterator||"@@asyncIterator",h=u.toStringTag||"@@toStringTag";function f(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var i=e&&e.prototype instanceof w?e:w,o=Object.create(i.prototype),a=new C(n||[]);return s(o,"_invoke",{value:N(t,r,a)}),o}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}r.wrap=p;var y="suspendedStart",v="suspendedYield",g="executing",m="completed",b={};function w(){}function A(){}function x(){}var _={};f(_,c,(function(){return this}));var k=Object.getPrototypeOf,T=k&&k(k(P([])));T&&T!==o&&a.call(T,c)&&(_=T);var E=x.prototype=w.prototype=Object.create(_);function O(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function j(t,e){function r(i,o,s,u){var c=d(t[i],t,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==n(h)&&a.call(h,"__await")?e.resolve(h.__await).then((function(t){r("next",t,s,u)}),(function(t){r("throw",t,s,u)})):e.resolve(h).then((function(t){l.value=t,s(l)}),(function(t){return r("throw",t,s,u)}))}u(c.arg)}var i;s(this,"_invoke",{value:function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}})}function N(t,r,n){var i=y;return function(o,a){if(i===g)throw Error("Generator is already running");if(i===m){if("throw"===o)throw a;return{value:e,done:!0}}for(n.method=o,n.arg=a;;){var s=n.delegate;if(s){var u=S(s,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=g;var c=d(t,r,n);if("normal"===c.type){if(i=n.done?m:v,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=m,n.method="throw",n.arg=c.arg)}}}function S(t,r){var n=r.method,i=t.iterator[n];if(i===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,S(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=d(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var a=o.arg;return a?a.done?(r[t.resultName]=a.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,b):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function I(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function P(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var i=-1,o=function r(){for(;++i<t.length;)if(a.call(t,i))return r.value=t[i],r.done=!1,r;return r.value=e,r.done=!0,r};return o.next=o}}throw new TypeError(n(t)+" is not iterable")}return A.prototype=x,s(E,"constructor",{value:x,configurable:!0}),s(x,"constructor",{value:A,configurable:!0}),A.displayName=f(x,h,"GeneratorFunction"),r.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===A||"GeneratorFunction"===(e.displayName||e.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,h,"GeneratorFunction")),t.prototype=Object.create(E),t},r.awrap=function(t){return{__await:t}},O(j.prototype),f(j.prototype,l,(function(){return this})),r.AsyncIterator=j,r.async=function(t,e,n,i,o){void 0===o&&(o=Promise);var a=new j(p(t,e,n,i),o);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},O(E),f(E,h,"Generator"),f(E,c,(function(){return this})),f(E,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=P,C.prototype={constructor:C,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(I),!t)for(var r in this)"t"===r.charAt(0)&&a.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function n(n,i){return s.type="throw",s.arg=t,r.next=n,i&&(r.method="next",r.arg=e),!!i}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=a.call(o,"catchLoc"),c=a.call(o,"finallyLoc");if(u&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=t,o.arg=e,i?(this.method="next",this.next=i.finallyLoc,b):this.complete(o)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),b},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),I(r),b}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var i=n.arg;I(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:P(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),b}},r}t.exports=i,t.exports.__esModule=!0,t.exports.default=t.exports},2990:t=>{function e(r){return t.exports=e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports},232:(t,e,r)=>{var n=r(8541)();t.exports=n;try{regeneratorRuntime=n}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},821:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e<n.length;e++)"function"==typeof i[n[e]]&&(t[t.length]=n[e]);return t}},9121:(t,e,r)=>{"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}r.d(e,{A:()=>n})},2937:(t,e,r)=>{"use strict";r.d(e,{A:()=>o});var n=r(9812);function i(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,(0,n.A)(i.key),i)}}function o(t,e,r){return e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}},8175:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(9812);function i(t,e,r){return(e=(0,n.A)(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}},8782:(t,e,r)=>{"use strict";function n(t){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}r.d(e,{A:()=>n})},9604:(t,e,r)=>{"use strict";function n(t,e){return n=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},n(t,e)}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&n(t,e)}r.d(e,{A:()=>i})},365:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(4360);function i(t,e){if(e&&("object"===(0,n.A)(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}},9812:(t,e,r)=>{"use strict";r.d(e,{A:()=>i});var n=r(4360);function i(t){var e=function(t,e){if("object"!=(0,n.A)(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,"string");if("object"!=(0,n.A)(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==(0,n.A)(e)?e:e+""}},4360:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}r.d(e,{A:()=>n})}},a={};function s(t){var e=a[t];if(void 0!==e)return e.exports;var r=a[t]={id:t,loaded:!1,exports:{}};return o[t].call(r.exports,r,r.exports,s),r.loaded=!0,r.exports}s.m=o,s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},r=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,s.t=function(t,n){if(1&n&&(t=this(t)),8&n)return t;if("object"==typeof t&&t){if(4&n&&t.__esModule)return t;if(16&n&&"function"==typeof t.then)return t}var i=Object.create(null);s.r(i);var o={};e=e||[null,r({}),r([]),r(r)];for(var a=2&n&&t;"object"==typeof a&&!~e.indexOf(a);a=r(a))Object.getOwnPropertyNames(a).forEach((e=>o[e]=()=>t[e]));return o.default=()=>t,s.d(i,o),i},s.d=(t,e)=>{for(var r in e)s.o(e,r)&&!s.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce(((e,r)=>(s.f[r](t,e),e)),[])),s.u=t=>t+".rdflib.min.js",s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.hmd=t=>((t=Object.create(t)).children||(t.children=[]),Object.defineProperty(t,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+t.id)}}),t),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n={},i="$rdf:",s.l=(t,e,r,o)=>{if(n[t])n[t].push(e);else{var a,u;if(void 0!==r)for(var c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l];if(h.getAttribute("src")==t||h.getAttribute("data-webpack")==i+r){a=h;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",i+r),a.src=t),n[t]=[e];var f=(e,r)=>{a.onerror=a.onload=null,clearTimeout(p);var i=n[t];if(delete n[t],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((t=>t(r))),e)return e(r)},p=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),u&&document.head.appendChild(a)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),(()=>{var t;s.g.importScripts&&(t=s.g.location+"");var e=s.g.document;if(!t&&e&&(e.currentScript&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=t})(),(()=>{var t={792:0};s.f.j=(e,r)=>{var n=s.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(((r,i)=>n=t[e]=[r,i]));r.push(n[2]=i);var o=s.p+s.u(e),a=new Error;s.l(o,(r=>{if(s.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,n[1](a)}}),"chunk-"+e,e)}};var e=(e,r)=>{var n,i,[o,a,u]=r,c=0;if(o.some((e=>0!==t[e]))){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);u&&u(s)}for(e&&e(r);c<o.length;c++)i=o[c],s.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=self.webpackChunk$rdf=self.webpackChunk$rdf||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))})();var u={};return(()=>{"use strict";s.r(u),s.d(u,{BlankNode:()=>p,Collection:()=>k,ConnectedStore:()=>zr,DataFactory:()=>xr,Empty:()=>O,Fetcher:()=>fr,Formula:()=>ht,IndexedFormula:()=>Et,Literal:()=>w,LiveStore:()=>Xr,N3Parser:()=>Yt,NamedNode:()=>y.A,Namespace:()=>W,NextId:()=>$r,Node:()=>ft,Query:()=>yt,RDFParser:()=>He,RDFaProcessor:()=>Be,SPARQLToQuery:()=>yr,Serializer:()=>et,Statement:()=>L,Store:()=>Et,UpdateManager:()=>mr,UpdatesSocket:()=>_r,UpdatesVia:()=>kr,Util:()=>Q,Variable:()=>H,blankNode:()=>Fr,defaultGraph:()=>Ur,fetcher:()=>Nr,fromNT:()=>qr,graph:()=>Sr,isBlankNode:()=>v.jt,isCollection:()=>v.P3,isGraph:()=>v.RN,isLiteral:()=>v.c$,isNamedNode:()=>v.Y2,isPredicate:()=>v.YC,isQuad:()=>v.aF,isRDFObject:()=>v.GE,isRDFlibObject:()=>v.DJ,isRDFlibPredicate:()=>v.fY,isRDFlibSubject:()=>v.CZ,isStatement:()=>v.SH,isStore:()=>v.ok,isSubject:()=>v.hr,isTerm:()=>v.D0,isVariable:()=>v.DZ,jsonParser:()=>pr,lit:()=>Rr,literal:()=>Dr,log:()=>V.A,namedNode:()=>Cr,parse:()=>ze,quad:()=>Lr,queryToSPARQL:()=>dr,serialize:()=>nt,sparqlUpdateParser:()=>$e,st:()=>Ir,sym:()=>Cr,term:()=>Hr,termValue:()=>Ve.E,triple:()=>Mr,uri:()=>M,variable:()=>Pr});var t=s(2937),e=s(9121),r=s(365),n=s(8782),i=s(9604),o=s(8175),a=s(9390),c=s(1605),l=s(6866);function h(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,f()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function f(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(f=function(){return!!t})()}var p=function(r){function n(t){var r;return(0,e.A)(this,n),r=h(this,n,[n.getId(t)]),(0,o.A)(r,"termType",l.$Q),(0,o.A)(r,"classOrder",a.A.BlankNode),(0,o.A)(r,"isBlank",1),(0,o.A)(r,"isVar",1),r}return(0,i.A)(n,r),(0,t.A)(n,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"compareTerm",value:function(t){return this.classOrder<t.classOrder?-1:this.classOrder>t.classOrder?1:this.id<t.id?-1:this.id>t.id?1:0}},{key:"copy",value:function(t){var e=new n;return t.copyTo(this,e),e}},{key:"toCanonical",value:function(){return n.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return n.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(t){if(t){if("string"!=typeof t)throw new Error("Bad id argument to new blank node: "+t);if(t.includes("#")){var e=t.split("#");return e[e.length-1]}return t}return"n"+n.nextId++}}])}(c.A);(0,o.A)(p,"nextId",0),(0,o.A)(p,"NTAnonymousNodePrefix","_:");var d=s(4360),y=s(3627),v=s(546);const g={boolean:new y.A("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new y.A("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new y.A("http://www.w3.org/2001/XMLSchema#decimal"),double:new y.A("http://www.w3.org/2001/XMLSchema#double"),integer:new y.A("http://www.w3.org/2001/XMLSchema#integer"),langString:new y.A("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new y.A("http://www.w3.org/2001/XMLSchema#string")};function m(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,b()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function b(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(b=function(){return!!t})()}var w=function(r){function n(t,r,i){var s;return(0,e.A)(this,n),s=m(this,n,[t]),(0,o.A)(s,"termType",l.QW),(0,o.A)(s,"classOrder",a.A.Literal),(0,o.A)(s,"datatype",g.string),(0,o.A)(s,"isVar",0),(0,o.A)(s,"language",""),r?(s.language=r,s.datatype=g.langString):s.datatype=i?y.A.fromValue(i):g.string,s}return(0,i.A)(n,r),(0,t.A)(n,[{key:"copy",value:function(){return new n(this.value,this.lang,this.datatype)}},{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&(!this.datatype&&!t.datatype||this.datatype&&this.datatype.equals(t.datatype))}},{key:"lang",get:function(){return this.language},set:function(t){this.language=t||""}},{key:"toNT",value:function(){return n.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(t){if("number"==typeof t.value)return""+t.value;if("string"!=typeof t.value)throw new Error("Value of RDF literal is not string or number: "+t.value);var e=t.value;return e='"'+(e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',t.language?e+="@"+t.language:t.datatype.equals(g.string)||(e+="^^"+t.datatype.toCanonical()),e}},{key:"fromBoolean",value:function(t){return new n(t?"1":"0",null,g.boolean)}},{key:"fromDate",value:function(t){if(!(t instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var e=function(t){return(""+(100+t)).slice(1,3)};return new n(t.getUTCFullYear()+"-"+e(t.getUTCMonth()+1)+"-"+e(t.getUTCDate())+"T"+e(t.getUTCHours())+":"+e(t.getUTCMinutes())+":"+e(t.getUTCSeconds())+"Z",null,g.dateTime)}},{key:"fromNumber",value:function(t){if("number"!=typeof t)throw new TypeError("Invalid argument to Literal.fromNumber()");var e,r=t.toString();return e=r.indexOf("e")<0&&Math.abs(t)<=Number.MAX_SAFE_INTEGER?Number.isInteger(t)?g.integer:g.decimal:g.double,new n(r,null,e)}},{key:"fromValue",value:function(t){if((0,v.c$)(t))return t;switch((0,d.A)(t)){case"object":if(t instanceof Date)return n.fromDate(t);case"boolean":return n.fromBoolean(t);case"number":return n.fromNumber(t);case"string":return new n(t)}throw new Error("Can't make literal from "+t+" of type "+(0,d.A)(t))}}])}(c.A);function A(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,x()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function x(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(x=function(){return!!t})()}function _(t){return null==t||(0,v.D0)(t)?t:Array.isArray(t)?new k(t):w.fromValue(t)}var k=function(r){function n(t){var r;return(0,e.A)(this,n),r=A(this,n,[(p.nextId++).toString()]),(0,o.A)(r,"termType",l.r0),(0,o.A)(r,"classOrder",a.A.Collection),(0,o.A)(r,"closed",!1),(0,o.A)(r,"compareTerm",p.prototype.compareTerm),(0,o.A)(r,"elements",[]),(0,o.A)(r,"isVar",0),t&&t.length>0&&t.forEach((function(t){r.elements.push(_(t))})),r}return(0,i.A)(n,r),(0,t.A)(n,[{key:"id",get:function(){return this.value},set:function(t){this.value=t}},{key:"append",value:function(t){return this.elements.push(t)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(t){return new n(this.elements.map((function(e){return e.substitute(t)})))}},{key:"toNT",value:function(){return n.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(t){return this.elements.unshift(t)}}],[{key:"toNT",value:function(t){return p.NTAnonymousNodePrefix+t.id}}])}(c.A);function T(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,E()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function E(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(E=function(){return!!t})()}(0,o.A)(k,"termType",l.r0);var O=function(r){function n(){var t;return(0,e.A)(this,n),t=T(this,n,[""]),(0,o.A)(t,"termType",l.S),t}return(0,i.A)(n,r),(0,t.A)(n,[{key:"toString",value:function(){return"()"}}])}(c.A);function j(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function N(t){return function(){var e=this,r=arguments;return new Promise((function(n,i){var o=t.apply(e,r);function a(t){j(o,n,i,a,s,"next",t)}function s(t){j(o,n,i,a,s,"throw",t)}a(void 0)}))}}var S=s(232),R=s.n(S),I="chrome:theSession";function C(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,P()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function P(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(P=function(){return!!t})()}new y.A(I);var F=function(r){function n(){var t;return(0,e.A)(this,n),t=C(this,n,[""]),(0,o.A)(t,"value",""),(0,o.A)(t,"termType",l.ic),(0,o.A)(t,"uri",I),t}return(0,i.A)(n,r),(0,t.A)(n,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}])}(c.A);function U(t){return!!t&&t.termType===l.ic}var D=new F,L=function(){function r(t,n,i,a){(0,e.A)(this,r),(0,o.A)(this,"subject",void 0),(0,o.A)(this,"predicate",void 0),(0,o.A)(this,"object",void 0),(0,o.A)(this,"graph",void 0),this.subject=c.A.fromValue(t),this.predicate=c.A.fromValue(n),this.object=c.A.fromValue(i),this.graph=null==a?D:c.A.fromValue(a)}return(0,t.A)(r,[{key:"why",get:function(){return this.graph},set:function(t){this.graph=t}},{key:"equals",value:function(t){return t.subject.equals(this.subject)&&t.predicate.equals(this.predicate)&&t.object.equals(this.object)&&t.graph.equals(this.graph)}},{key:"substitute",value:function(t){return new r(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),U(this.graph)?this.graph:this.graph.substitute(t))}},{key:"toCanonical",value:function(){var t=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==l.ic&&t.push(this.graph.toCanonical()),t.join(" ")+" ."}},{key:"toNT",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}},{key:"toNQ",value:function(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),U(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}])}(),M=s(4221);function B(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,q()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function q(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(q=function(){return!!t})()}var H=function(r){function n(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,e.A)(this,n),t=B(this,n,[r]),(0,o.A)(t,"termType",l.P2),(0,o.A)(t,"base","varid:"),(0,o.A)(t,"classOrder",a.A.Variable),(0,o.A)(t,"isVar",1),(0,o.A)(t,"uri",void 0),t.base="varid:",t.uri=M.join(r,t.base),t}return(0,i.A)(n,r),(0,t.A)(n,[{key:"equals",value:function(t){return!!t&&this.termType===t.termType&&this.value===t.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(t){var e;return null!=(e=t[this.toNT()])?e:this}},{key:"toString",value:function(){return n.toString(this)}}],[{key:"toString",value:function(t){return t.uri.slice(0,t.base.length)===t.base?"?".concat(t.uri.slice(t.base.length)):"?".concat(t.uri)}}])}(c.A),$=function(t){return t.collections="COLLECTIONS",t.defaultGraphType="DEFAULT_GRAPH_TYPE",t.equalsMethod="EQUALS_METHOD",t.id="ID",t.identity="IDENTITY",t.reversibleId="REVERSIBLE_ID",t.variableType="VARIABLE_TYPE",t}({}),z=new F,X={supports:(0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)({},$.collections,!1),$.defaultGraphType,!1),$.equalsMethod,!0),$.identity,!1),$.id,!0),$.reversibleId,!1),$.variableType,!0),blankNode:function(t){return new p(t)},defaultGraph:function(){return z},equals:function(t,e){return t===e||!t||!e||((0,v.aF)(t)||(0,v.aF)(e)?!(!(0,v.aF)(t)||!(0,v.aF)(e))&&this.equals(t.subject,e.subject)&&this.equals(t.predicate,e.predicate)&&this.equals(t.object,e.object)&&this.equals(t.graph,e.graph):!(!(0,v.D0)(t)||!(0,v.D0)(e))&&this.id(t)===this.id(e))},id:function(t){if(!t)return"undefined";if((0,v.aF)(t))return this.quadToNQ(t);switch(t.termType){case l.ic:return"defaultGraph";case l.P2:return H.toString(t);default:var e=this.termToNQ(t);if(e)return e;throw new Error("Can't id term with type '".concat(t.termType,"'"))}},isQuad:function(t){return t instanceof L},literal:function(t,e){if("string"!=typeof t&&!e)return w.fromValue(t);var r="string"==typeof t?t:""+t;return"string"==typeof e?-1===e.indexOf(":")?new w(r,e):new w(r,null,this.namedNode(e)):new w(r,null,e)},namedNode:function(t){return new y.A(t)},quad:function(t,e,r,n){return new L(t,e,r,n||z)},triple:function(t,e,r,n){return this.quad(t,e,r,n)},quadToNQ:function(t){return"".concat(this.termToNQ(t.subject)," ").concat(this.termToNQ(t.predicate)," ").concat(this.termToNQ(t.object)," ").concat(this.termToNQ(t.graph)," .")},termToNQ:function(t){var e=this;switch(t.termType){case l.$Q:return"_:"+t.value;case l.ic:return"";case l.S:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case l.QW:return w.toNT(t);case l.bD:case l.Kk:return"<"+t.value+">";case l.r0:return"("+t.elements.map((function(t){return e.termToNQ(t)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(t.termType,"')"))}},toNQ:function(t){return this.isQuad(t)?this.quadToNQ(t):this.termToNQ(t)},variable:function(t){return new H(t)}};const G=X;var V=s(3787);function W(t,e){var r=e||{namedNode:function(t){return new y.A(t)}};return function(e){return r.namedNode(t+(e||""))}}var Q=s(7114);function Y(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G;return{boolean:t.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:t.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:t.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:t.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:t.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:t.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:t.namedNode("http://www.w3.org/2001/XMLSchema#string")}}Y(G);var J=s(8540),Z=s.n(J),K=s(2312),tt=s(6357);function et(t){return new rt(t)}var rt=function(){function r(t){(0,e.A)(this,r),(0,o.A)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,o.A)(this,"_notNameChars",this._notQNameChars+":"),(0,o.A)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,o.A)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,o.A)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];var n=Object.keys(Z()());for(var i in n){var a=Z()()[n[i]](""),s=n[i];this.prefixes[a]=s,this.namespaces[s]=a}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||G,this.xsd=Y(this.rdfFactory)}return(0,t.A)(r,[{key:"setBase",value:function(t){return this.base=t,this}},{key:"setFlags",value:function(t){return this.flags=t||"",this}},{key:"toStr",value:function(t){var e=t.toNT();return"Graph"===t.termType&&(this.formulas[e]=t),e}},{key:"fromStr",value:function(t){if("{"===t[0]){var e=this.formulas[t];return e||tt.log("No formula object for "+t),e}return this.store.fromNT(t)}},{key:"setNamespaces",value:function(t){for(var e in t)this.setPrefix(e,t[e]);return this}},{key:"setPrefix",value:function(t,e){if("default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e){for(var r in this.prefixes)this.prefixes[r]==t&&delete this.prefixes[r];this.prefixes[e]=t,this.namespaces[t]=e}}},{key:"suggestPrefix",value:function(t,e){"default"!==t.slice(0,7)&&"ns"!==t.slice(0,2)&&t&&e&&(t in this.namespaces||e in this.prefixes||(this.prefixes[e]=t,this.namespaces[t]=e))}},{key:"suggestNamespaces",value:function(t){for(var e in t)this.suggestPrefix(e,t[e]);return this}},{key:"checkIntegrity",value:function(){var t,e;for(t in this.namespaces)if(this.prefixes[this.namespaces[t]]!==t)throw new Error("Serializer integity error 1: "+t+", "+this.namespaces[t]+", "+this.prefixes[this.namespaces[t]]+"!");for(e in this.prefixes)if(this.namespaces[this.prefixes[e]]!==e)throw new Error("Serializer integity error 2: "+e+", "+this.prefixs[e]+", "+this.namespaces[this.prefixes[e]]+"!")}},{key:"makeUpPrefix",value:function(t){var e=t,r=function(e){return!!this.validPrefix.test(e)&&"ns"!==e&&!(e in this.namespaces)&&(this.prefixes[t]=e,this.namespaces[e]=t,e)}.bind(this);"#/".indexOf(e[e.length-1])>=0&&(e=e.slice(0,-1));var n=e.lastIndexOf("/");n>=0&&(e=e.slice(n+1));for(var i=0;i<e.length&&this.prefixchars.indexOf(e[i]);)i++;if((e=e.slice(0,i)).length<6&&r(e))return e;if(r(e.slice(0,3)))return e.slice(0,3);if(r(e.slice(0,2)))return e.slice(0,2);if(r(e.slice(0,4)))return e.slice(0,4);if(r(e.slice(0,1)))return e.slice(0,1);if(r(e.slice(0,5)))return e.slice(0,5);this.validPrefix.test(e)||(e="n");for(var o=0;;o++)if(r(e.slice(0,3)+o))return e.slice(0,3)+o}},{key:"rootSubjects",value:function(t){for(var e={},r={},n={},i=0;i<t.length;i++){var o=t[i],a=function(t){e.hasOwnProperty(t)||(e[t]=[]),e[t].push(o.subject)};[o.subject,o.predicate,o.object].map((function(t){"BlankNode"===t.termType?n[t.toNT()]=!0:"Collection"===t.termType&&t.elements.forEach((function(t){a(t)}))})),a(t[i].object);var s=r[this.toStr(o.subject)];s||(s=[]),s.push(o),r[this.toStr(o.subject)]=s}var u=[];for(var c in r)if(r.hasOwnProperty(c)){var l=this.fromStr(c);"BlankNode"===l.termType&&e[l]&&1===e[l].length||u.push(l)}this.incoming=e;for(var h={},f=0;f<u.length;f++)h[u[f].toNT()]=!0;return{roots:u,subjects:r,rootsHash:h,incoming:e}}},{key:"toN3",value:function(t){return this.statementsToN3(t.statements)}},{key:"explicitURI",value:function(t){var e;return this.flags.indexOf("r")<0&&this.base?t=M.refTo(this.base,t):this.flags.indexOf("u")>=0?t=function(t){for(var e,r="",n=0;n<t.length;n++)r+=(e=t.charCodeAt(n))>65535?"\\U"+("00000000"+e.toString(16)).slice(-8):e>126?"\\u"+("0000"+e.toString(16)).slice(-4):t[n];return r}(t):(e=decodeURI(t),t=encodeURI(e)),"<"+t+">"}},{key:"statementsToNTriples",value:function(t){var e=t.slice();e.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,a=this.rdfFactory,s=function t(e){if("Collection"!==e.termType)return i.atomicTermToN3(e);for(var s=e.elements,u=o.sym(n+"nill"),c=s.length-1;c>=0;c--){var l=a.blankNode();r+=t(l)+" "+t(o.sym(n+"first"))+" "+t(s[c])+".\n",r+=t(l)+" "+t(o.sym(n+"rest"))+" "+t(u)+".\n",u=l}return i.atomicTermToN3(u)},u=0;u<e.length;u++){var c=e[u],l="";l+=s(c.subject)+" ",l+=s(c.predicate)+" ",l+=s(c.object)+" ",this.flags.indexOf("q")>=0&&(l+=s(c.why)+" "),r+=l+=".\n"}return r}},{key:"statementsToN3",value:function(t){var e=this.store,n={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(t,r){return Q.heavyCompareSPO(t,r,e,n)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var i={};this.flags.indexOf("s")<0&&(i["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(i["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(i["http://www.w3.org/2000/10/swap/log#implies"]="=>");var o=function(t){for(var e="",r=0;r<t;r++)e+=" ";return e},a=function t(e){for(var r="",n=0;n<e.length;n++){var i=e[n],o="string"==typeof i?i:t(i);if(0!==n){var a=r.slice(-1)||" ";","===o||";"===o||("."!==o||"0123456789.:".includes(a))&&(r+=" ")}r+=o}return r},s=function(t){for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(u(o,e))}return n}.bind(this);function u(t,e){return"BlankNode"!==t.termType||e.incoming[t]?[h(t,e)].concat([c(t,e)]).concat(["."]):l(t,e,!0).concat(["."])}var c=function(t,e){var r=[],n=null,o=e.subjects[this.toStr(t)]||[];if(void 0===o)throw new Error("Cant find statements for "+t);for(var a=[],s=0;s<o.length;s++){var u=o[s];u.predicate.uri===n?a.push(","):(n&&(r=r.concat([a]).concat([";"]),a=[]),r.push(i[u.predicate.uri]?i[u.predicate.uri]:h(u.predicate,e))),n=u.predicate.uri,a.push(l(u.object,e))}return r.concat([a])}.bind(this),l=function(t,e,r){return"BlankNode"!==t.termType||!r&&void 0!==e.rootsHash[t.toNT()]?h(t,e):e.subjects[this.toStr(t)]?["[",c(t,e),"]"]:"[]"}.bind(this);r.prototype.termToN3=h;var h=function(t,e){var r,n;switch(t.termType){case"Graph":return(n=(n=["{"]).concat(s(t.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<t.elements.length;r++)n.push([l(t.elements[r],e)]);return n.push(")"),n;default:return this.atomicTermToN3(t)}}.bind(this),f=function(){var t="";for(var e in this.flags.indexOf("d")<0&&this.defaultNamespace&&(t+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(e)&&this.namespacesUsed[e]&&(t+="@prefix "+this.prefixes[e]+": "+this.explicitURI(e)+".\n");return t+"\n"}.bind(this),p=s(t);return f()+function t(e,r){var n="",i=1e5;void 0===r&&(r=-1);for(var s=0;s<e.length;s++){var u=e[s];if("string"!=typeof u){var c=t(u,r+1);if(c.length<10*(80-4*r)&&c.indexOf('"""')<0){var l=a(u);l.length<80-4*r&&(u=l,c="")}c&&(i=1e4),n+=c}if("string"==typeof u){if(1===u.length&&"\n"===n.slice(-1)&&",.;".indexOf(u)>=0){n=n.slice(0,-1),"."==u&&"0123456789.:".includes(n.charAt(n.length-1))&&(n+=" ",i+=1),n+=u+"\n",i+=1;continue}if(i<4*r+4||i+u.length+1<80&&";.".indexOf(n[n.length-2])<0)n=n.slice(0,-1)+" "+u+"\n",i+=u.length+1;else{var h=o(4*r)+u;n+=h+"\n",i=h.length,r<0&&(n+="\n",i=1e5)}}}return n}(p)}},{key:"atomicTermToN3",value:function(t,e){switch(t.termType){case"BlankNode":case"Variable":return t.toNT();case"Literal":var r=t.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(t.datatype&&this.flags.indexOf("x")<0)switch(t.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":var n=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!n&&(r+=".0"),n||(r+="e0"),r;case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===t.value?"true":"false"}var i=this.stringToN3(t.value);return t.language?i+="@"+t.language:t.datatype.equals(this.xsd.string)||(i+="^^"+this.atomicTermToN3(t.datatype,e)),i;case"NamedNode":return this.symbolToN3(t);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+t+" of termType: "+t.termType)}}},{key:"stringToN3",value:function(t,e){e||(e="e");var r,n,i,o,a,s="";for(t.length>20&&'"'!==t.slice(-1)&&e.indexOf("n")<0&&(t.indexOf("\n")>0||t.indexOf('"')>0)?(o='"""',a=this.forbidden3):(o='"',a=this.forbidden1),r=0;r<t.length&&(a.lastIndex=0,null!=a.exec(t.slice(r)));){n=r+a.lastIndex-1,s+=t.slice(r,n);var u=t[n];'"'===u&&'"""'===o&&'"""'!==t.slice(n,n+3)?s+=u:(i='\b\f\r\t\v\n\\"'.indexOf(u))>=0?s+="\\"+'bfrtvn\\"'[i]:e.indexOf("e")>=0?s+="\\u"+("000"+u.charCodeAt(0).toString(16).toLowerCase()).slice(-4):s+=u,r=n+1}return o+s+t.slice(r)+o}},{key:"symbolToN3",value:function(t){var e=t.uri,r=e.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=e.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===e.indexOf("http")||0===e.indexOf("ws")||0===e.indexOf("file"))){for(var n=!0,i=r+1;i<e.length;i++)if(this._notNameChars.indexOf(e[i])>=0){n=!1;break}if(n){var o=e.slice(r+1),a=e.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var s=this.prefixes[a];if(s||(s=this.makeUpPrefix(a)),s)return this.namespacesUsed[a]=!0,s+":"+o}}return this.explicitURI(e)}},{key:"writeStore",value:function(t){var e=this.store,r=e.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var a=e.fromNT(o);n&&a.equals(n)||t("\n"+this.atomicTermToN3(a)+" "+this.atomicTermToN3(e.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(e.statementsMatching(void 0,void 0,void 0,a))+" }.\n")}e.statementsMatching(void 0,e.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){t("\n<"+r.object.value+"> log:metadata {\n");var n=e.statementsMatching(void 0,void 0,void 0,r.subject);t(this.statementsToN3(this.statementsToN3(n))),t("}.\n")}));var s=[];n&&s.push(n);var u=[];s.map((function(t){u=u.concat(e.statementsMatching(void 0,void 0,void 0,t))})),t(this.statementsToN3(u))}},{key:"statementsToXML",value:function(t){var e=[];e["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(t){for(var e="",r=0;r<t;r++)e+=" ";return e},i=function t(e){for(var r="",n=0;n<e.length;n++){var i=e[n];r+="string"==typeof i?i:t(i)}return r},o=function(t){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var e=this.rootSubjects(t),r=e.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(u(o,e))}return n}.bind(this);function a(t){return void 0===t?"@@@undefined@@@@":t.replace(/[&<"]/g,(function(t){switch(t[0]){case"&":return"&";case"<":return"<";case'"':return"""}}))}var s=function(t){return a(this.base?M.refTo(this.base,t.uri):t.uri)}.bind(this),u=function(t,e){var n,i,o,f,p=[],d=e.subjects[this.toStr(t)];if(void 0===d)return l(t,e);d.sort((function(t,e){var n=t.predicate.uri,i=e.predicate.uri;if(n.substring(0,44)===r||i.substring(0,44)===r)return n.localeCompare(i);var o=n.substring(44),a=i.substring(44),s=parseInt(o,10),u=parseInt(a,10);return isNaN(s)||isNaN(u)||s!==o||u!==a?n.localeCompare(i):s-u}));for(var y=0;y<d.length;y++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=d[y]).predicate.uri||n||"NamedNode"!==o.object.termType){if((f=o.predicate).uri.substr(0,44)===r){var v=f.uri.substr(44);v===parseInt(v,10).toString()&&(f=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=h(f),o.object.termType){case"BlankNode":p=1===e.incoming[o.object].length?p.concat(["<"+i+' rdf:parseType="Resource">',u(o.object,e),"</"+i+">"]):p.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":p=p.concat(["<"+i+' rdf:resource="'+s(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">',c(o.object,e),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var g=n?h(n):"rdf:Description",m="";return"BlankNode"===t.termType?e.incoming[t]&&1===e.incoming[t].length||(m=' rdf:nodeID="'+t.toNT().slice(2)+'"'):m=' rdf:about="'+s(t)+'"',["<"+g+m+">"].concat([p]).concat(["</"+g+">"])}.bind(this);function c(t,e){for(var r=[],n=0;n<t.elements.length;n++)r.push(u(t.elements[n],e));return r}var l=function(t,e){var r=[],n=e.subjects[this.toStr(t)];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=e.rootsHash[o.object.toNT()]?r.concat(["<"+h(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+h(o.predicate)+">"]):r.concat(["<"+h(o.predicate)+' rdf:parseType="Resource">',l(o.object,e),"</"+h(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+h(o.predicate)+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+h(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)+"</"+h(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+h(o.predicate)+' rdf:parseType="Collection">',c(o.object,e),"</"+h(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),h=function(t){var r=t.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),a=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===a&&this.flags.indexOf("d")<0)return o;var s=this.prefixes[a];return s||(s=this.makeUpPrefix(a)),e[a]=!0,s+":"+o}.bind(this),f=o(t),p="<rdf:RDF";for(var d in this.defaultNamespace&&(p+=' xmlns="'+a(this.defaultNamespace)+'"'),e)if(e.hasOwnProperty(d)){var y=this.base&&this.flags.includes("z")?M.refTo(this.base,d):d;p+="\n xmlns:"+this.prefixes[d]+'="'+a(y)+'"'}return function t(e,r){var o,a="",s=1e5;r||(r=0);for(var u=0;u<e.length;u++){var c=e[u];if("string"!=typeof c){var l=t(c,r+1);l.length<10*(80-4*r)&&l.indexOf('"""')<0&&(o=i(c)).length<80-4*r&&(c=" "+o,l=""),l&&(s=1e4),a+=l}"string"==typeof c&&(s<4*r+4?(a=a.slice(0,-1)+" "+c+"\n",s+=c.length+1):(a+=(o=n(4*r)+c)+"\n",s=o.length))}return a}([p+=">",f,"</rdf:RDF>"],-1)}},{key:"statementsToJsonld",value:function(t){var e=this.statementsToN3(t),r=K.parse(e);return JSON.stringify(r,null,2)}}])}();function nt(t,e,r,n,i,o){r=r||(null==t?void 0:t.value);var a=o||{};n=n||l.sT;try{var s=et(e);a.flags&&s.setFlags(a.flags);var u=e.statementsMatching(void 0,void 0,void 0,t);switch("namespaces"in e&&s.suggestNamespaces(e.namespaces),a.namespaces&&s.setNamespaces(a.namespaces),s.setBase(r),n){case l.JG:return c(null,s.statementsToXML(u));case l.ny:case l.MG:return c(null,s.statementsToN3(u));case l.sT:case l.hu:return s.setFlags("si"),c(null,s.statementsToN3(u));case l.bM:return s.setFlags("deinprstux"),c(null,s.statementsToNTriples(u));case l.i2:return s.setFlags("si dr"),c(null,s.statementsToJsonld(u));case l._0:case l.BR:return s.setFlags("deinprstux q"),c(null,s.statementsToNTriples(u));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(t){if(i)return i(t,void 0);throw t}function c(t,e){return i?void i(t,e):e}}var it=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],ot={first:"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",rest:"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",nil:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"};function at(t,e,r){var n=[];return r.reduce((function(e,r,i,o){var a;return n.push(t.quad(e,t.namedNode(ot.first),o[i])),i<o.length-1?(a=t.blankNode(),n.push(t.quad(e,t.namedNode(ot.rest),a))):n.push(t.quad(e,t.namedNode(ot.rest),t.namedNode(ot.nil))),a}),e),n}function st(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=t.length;for(r<0&&(r=n+r);r<n;r++)if(t[r]===e)return r;return-1}function ut(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ct(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,lt()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function lt(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(lt=function(){return!!t})()}var ht=function(r){function n(){var t,r=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]:[],u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],c=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,e.A)(this,n),(t=ct(this,n,[""])).statements=r,t.constraints=i,t.initBindings=s,t.optional=u,(0,o.A)(t,"termType",l.bD),(0,o.A)(t,"classOrder",a.A.Graph),(0,o.A)(t,"fetcher",void 0),(0,o.A)(t,"isVar",0),(0,o.A)(t,"ns",W),(0,o.A)(t,"rdfFactory",void 0),t.rdfFactory=c&&c.rdfFactory||G;var h,f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return ut(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ut(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(it);try{var p=function(){var e=h.value;t[e]=function(){var r;return(r=t.rdfFactory)[e].apply(r,arguments)}};for(f.s();!(h=f.n()).done;)p()}catch(t){f.e(t)}finally{f.f()}return t}return(0,i.A)(n,r),(0,t.A)(n,[{key:"add",value:function(t,e,r,n){var i=this;return 1===arguments.length&&t.forEach((function(t){return i.add(t.subject,t.predicate,t.object,t.graph)})),this.statements.push(this.rdfFactory.quad(t,e,r,n))}},{key:"addStatement",value:function(t){return this.add(t)}},{key:"bnode",value:function(t){return this.rdfFactory.blankNode(t)}},{key:"addAll",value:function(t){var e=this;t.forEach((function(t){e.add(t.subject,t.predicate,t.object,t.graph)}))}},{key:"any",value:function(t,e,r,n){var i=this.anyStatementMatching(t,e,r,n);return null==i?null:null==t?i.subject:null==e?i.predicate:null==r?i.object:null}},{key:"anyValue",value:function(t,e,r,n){var i=this.any(t,e,r,n);return i?i.value:void 0}},{key:"anyJS",value:function(t,e,r,n){var i=this.any(t,e,r,n);return i?c.A.toJS(i):void 0}},{key:"anyStatementMatching",value:function(t,e,r,n){var i=this.statementsMatching(t,e,r,n,!0);if(i&&0!==i.length)return i[0]}},{key:"id",value:function(t){return this.rdfFactory.id(t)}},{key:"statementsMatching",value:function(t,e,r,n,i){var o=this.statements.filter((function(i){return(!t||t.equals(i.subject))&&(!e||e.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))}));return i?0===o.length?[]:[o[0]]:o}},{key:"bottomTypeURIs",value:function(t){var e,r,n,i,o,a;for(var s in e=[],t)if(t.hasOwnProperty(s)){for(a=t[s],r=!0,n=0,i=(o=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(s))).length;n<i;n++)if(o[n].uri in t){r=!1;break}r&&(e[s]=a)}return e}},{key:"collection",value:function(){return new k}},{key:"each",value:function(t,e,r,n){var i=[],o=this.statementsMatching(t,e,r,n,!1);if(null==t)for(var a=0,s=o.length;a<s;a++)i.push(o[a].subject);else if(null==e)for(var u=0,c=o.length;u<c;u++)i.push(o[u].predicate);else if(null==r)for(var l=0,h=o.length;l<h;l++)i.push(o[l].object);else if(null==n)for(var f=0,p=o.length;f<p;f++)i.push(new y.A(o[f].graph.value));return i}},{key:"equals",value:function(t){return!!t&&this.hashString()===t.hashString()}},{key:"findMembersNT",value:function(t){var e,r,n,i,o,a,s,u,c,l,h,f,p,d;for(var y in(f={})[t.toNT()]=!0,i={},a=this.transitiveClosure(f,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0))if(a.hasOwnProperty(y)){for(var v=0,g=(s=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(y))).length;v<g;v++)i[(p=s[v]).subject.toNT()]=p;for(var m=0,b=(u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(y))).length;m<b;m++)for(o=u[m],n=0,e=(c=this.statementsMatching(void 0,o)).length;n<e;n++)i[(p=c[n]).subject.toNT()]=p;for(var w=0,A=(l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(y))).length;w<A;w++)for(o=l[w],d=0,r=(h=this.statementsMatching(void 0,o)).length;d<r;d++)i[(p=h[d]).object.toNT()]=p}return i}},{key:"findMemberURIs",value:function(t){return this.NTtoURI(this.findMembersNT(t))}},{key:"findSubClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(t){var e={};return e[t.toNT()]=!0,this.transitiveClosure(e,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(t){var e,r,n,i,o,a;a=[];for(var s=0,u=(e=this.statementsMatching(t,void 0,void 0)).length;s<u;s++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(o=e[s]).predicate.uri)a[o.object.toNT()]=o;else for(var c=0,l=(r=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;c<l;c++)a[r[c].toNT()]=o;for(var h=0,f=(n=this.statementsMatching(void 0,void 0,t)).length;h<f;h++){o=n[h];for(var p=0,d=(i=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;p<d;p++)a[i[p].toNT()]=o}return this.transitiveClosure(a,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(t){return this.NTtoURI(this.findTypesNT(t))}},{key:"connectedStatements",value:function(t,e,r){r=r||[];for(var n=[t],i={},o={},a=[],s=this,u=function(t){var u=function(t){"BlankNode"!==t.termType||i[t.value]||(i[t.value]=!0,n.push(t))},c=s.statementsMatching(null,null,t,e).concat(s.statementsMatching(t,null,null,e));c=c.filter((function(t){if(r[t.predicate.value])return!1;var e=t.toNT();return!o[e]&&(o[e]=!0,!0)})),c.forEach((function(t){u(t.subject),u(t.object)})),a=a.concat(c)};n.length;)u(n.shift());return a}},{key:"formula",value:function(t){return new n}},{key:"fromNT",value:function(t){var e,r,n;switch(t[0]){case"<":return this.sym(t.slice(1,-1));case'"':if(n=void 0,e=void 0,(r=t.lastIndexOf('"'))<t.length-1)if("@"===t[r+1])n=t.slice(r+2);else{if("^^"!==t.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+t);e=this.fromNT(t.slice(r+3))}return t=(t=(t=(t=t.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(t,n||e);case"_":return this.rdfFactory.blankNode(t.slice(2));case"?":return new H(t.slice(1))}throw new Error("Can't convert from NT: "+t)}},{key:"holds",value:function(t,e,r,n){var i;if(1===arguments.length){if(!t)return!0;if(t instanceof Array){for(i=0;i<t.length;i++)if(!this.holds(t[i]))return!1;return!0}if((0,v.SH)(t))return this.holds(t.subject,t.predicate,t.object,t.graph);if(t.statements)return this.holds(t.statements)}return null!=this.anyStatementMatching(t,e,r,n)}},{key:"holdsStatement",value:function(t){return this.holds(t.subject,t.predicate,t.object,t.graph)}},{key:"list",value:function(t,e){if(e.rdfFactory.supports.COLLECTIONS){var r=e.rdfFactory.collection();return t.forEach((function(t){r.append(t)})),r}var n=e.rdfFactory.blankNode(),i=at(e.rdfFactory,n,t);return e.addAll(i),n}},{key:"NTtoURI",value:function(t){var e,r,n={};for(e in t)t.hasOwnProperty(e)&&(r=t[e],"<"===e[0]&&(n[e.slice(1,-1)]=r));return n}},{key:"serialize",value:function(t,e,r,n){return nt(r,this,t,e,void 0,n)}},{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)})),r=new n;return r.addAll(e),r}},{key:"sym",value:function(t,e){if(e)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(t)}},{key:"the",value:function(t,e,r,n){var i=this.any(t,e,r,n);return null==i&&V.A.error("No value found for the() {"+t+" "+e+" "+r+"}."),i}},{key:"transitiveClosure",value:function(t,e,r){var n,i,o,a,s,u={};Object.assign(u,t);for(var c={};;){if(null==(s=function(){for(var t in u)if(u.hasOwnProperty(t))return t}()))return c;for(n=0,i=(a=r?this.each(void 0,e,this.fromNT(s)):this.each(this.fromNT(s),e)).length;n<i;n++)(o=a[n].toNT())in c||o in u||(u[o]=u[s]);c[s]=u[s],delete u[s]}}},{key:"topTypeURIs",value:function(t){var e,r,n,i,o,a,s;for(r in a=[],t)if(t.hasOwnProperty(r)){for(s=t[r],i=0,e=0,n=(o=this.each(this.rdfFactory.namedNode(r),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;e<n;e++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==o[e].uri){i++;break}i||(a[r]=s)}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}},{key:"toString",value:function(){return"{"+this.statements.join("\n")+"}"}},{key:"variable",value:function(t){return new H(t)}},{key:"whether",value:function(t,e,r,n){return this.statementsMatching(t,e,r,n,!1).length}}])}(c.A);c.A.fromValue=_;const ft=c.A;var pt={xsd:W("http://www.w3.org/2001/XMLSchema#")};c.A.toJS=function(t){return(0,v.P3)(t)?t.elements.map(c.A.toJS):(0,v.c$)(t)?t.datatype.equals(pt.xsd("boolean"))?"1"===t.value||"true"===t.value:t.datatype.equals(pt.xsd("dateTime"))||t.datatype.equals(pt.xsd("date"))?new Date(t.value):t.datatype.equals(pt.xsd("integer"))||t.datatype.equals(pt.xsd("float"))||t.datatype.equals(pt.xsd("decimal"))?Number(t.value):t.value:t};var dt=s(6357),yt=(0,t.A)((function t(r,n){(0,e.A)(this,t),this.pat=new Et,this.vars=[],this.name=r,this.id=n}));function vt(t,e,r,n){function i(t){var e,r="";for(e in t)t.hasOwnProperty(e)&&(r+=" "+e+" -> "+t[e]);return r}function o(t){var e,r="Bindings: ",n=t.length;for(e=0;e<n;e++)r+=i(t[e][0])+";\n\t";return r}function a(t,e,r,n){var i;if(t.length!==e.length)return[];if(!t.length)return[[[],null]];var o=function(t,e,r,n){var i=r[t];if(void 0===i){if(t.isVar){var o=[];return o[t]=e,[[o,null]]}i=t}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[e]&&(e=n.redirections[e]),i.equals(e)||i.uri&&i.uri===I?[[[],null]]:[];if(t instanceof Array)return e instanceof Array?a(t,e,r):[];throw new Error("query.js: oops - code not written yet")}(t[0],e[0],r,n);if(0===o.length)return o;var s,u,c,l,h,f,p,d=[],y=o.length;for(s=0;s<y;s++){for(h in p=[],u=o[s][0])u.hasOwnProperty(h)&&(p[h]=u[h]);for(h in r)r.hasOwnProperty(h)&&(p[h]=r[h]);for(l=(i=a(t.slice(1),e.slice(1),p,n)).length,c=0;c<l;c++){for(h in f=i[c][0],u)u.hasOwnProperty(h)&&(f[h]=u[h]);d.push([f,null])}}return d}function s(t,e){var r,n={};for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);return n}function u(t,e){return this.trunkBindings=e,this.originalCallback=t,this.branches=[],this}function c(t,e){return this.count=0,this.success=!1,this.done=!1,this.callback=t,this.onDone=e,this}u.prototype.checkAllDone=function(){var t;for(t=0;t<this.branches.length;t++)if(!this.branches[t].done)return;V.A.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},u.prototype.doCallBacks=function(t,e){var r;if(t<0)return this.originalCallback(e);for(r=0;r<this.branches[t].results.length;r++)this.doCallBacks(t-1,s(e,this.branches[t].results[r]))},c.prototype.reportMatch=function(t){this.callback(t),this.success=!0},c.prototype.reportDone=function(){this.done=!0,V.A.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(t){return this.count=0,this.done=!1,this.results=[],this.junction=t,t.branches.push(this),this};function h(t,e,r){var n,i,o,a,s,u;for(e.nvars=0,e.index=null,n=[e.subject,e.predicate,e.object,e.why],a=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],o=0;o<4;o++){var c=n[o];if(c.uri&&c.uri===I);else if(c.isVar&&void 0===r[c])e.nvars++;else{if(void 0,c=void 0===(u=r[s=n[o]])?s:u,t.redirections[t.id(c)]&&(c=t.redirections[t.id(c)]),!(i=a[o][t.id(c)]))return e.index=[],!1;(null===e.index||e.index.length>i.length)&&(e.index=i)}}return null===e.index&&(e.index=t.statements),!0}function f(t,e){return t.nvars!==e.nvars?t.nvars-e.nvars:t.index.length-e.index.length}l.prototype.reportMatch=function(t){this.results.push(t)},l.prototype.reportDone=function(){V.A.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),V.A.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var p=function t(r,n,o,a,s,c,h){V.A.debug("Match begins, Branch count now: "+h.count+" for "+h.pattern_debug);var f,p,d=n.statements;if(0===d.length){if(V.A.debug("FOUND MATCH WITH BINDINGS:"+i(o)),0===n.optional.length)h.reportMatch(o);else{V.A.debug("OPTIONAL: "+n.optional);var v,g=new u(e,o),m=[];for(v=0;v<n.optional.length;v++)m[v]=new l(g),m[v].pattern_debug=n.optional[v];for(v=0;v<n.optional.length;v++)m[v].count=m[v].count+1,t(r,n.optional[v],o,"",s,e,m[v])}return h.count--,void V.A.debug("Match ends -- success , Branch count now: "+h.count+" for "+h.pattern_debug)}var b=d.length;if(s){var w=function(e,i){var u=e.uri.split("#")[0];s.nowOrWhenFetched(u,void 0,(function(i,u,l){i||dt.log("Error following link to <"+e.uri+"> in query: "+u),t(r,n,o,a,s,c,h)}))};for(p=0;p<b;p++){if(f=d[p],void 0!==o[f.subject]&&o[f.subject].uri&&s&&"unrequested"===s.getState((0,M.docpart)(o[f.subject].uri)))return void w(o[f.subject]);if(void 0!==o[f.object]&&o[f.object].uri&&s&&"unrequested"===s.getState((0,M.docpart)(o[f.object].uri)))return void w(o[f.object])}}y(r,n,o,a,s,c,h)},d=function(t,e){var r,n,i=!0;for(r in t)t.hasOwnProperty(r)&&e[r]&&(n=e[r].test)&&!n(t[r])&&(i=!1);return i},y=function(t,e,r,n,s,u,c){var l,y,v,g,m,b,w,A=e.statements,x=A.length;for(l=0;l<x;l++)h(t,w=A[l],r);A.sort(f),w=A[0];var _,k=t.formula();k.optional=e.optional,k.constraints=e.constraints,k.statements=A.slice(1),V.A.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var T,E,O=w.index.length,j=0;for(_=0;_<O;_++)for(E=w.index[_],T=a([w.subject,w.predicate,w.object,w.why],[E.subject,E.predicate,E.object,E.why],r,t),V.A.info(n+" From first: "+T.length+": "+o(T)),v=T.length,y=0;y<v;y++)if(m=[],b=T[y][0],d(b,e.constraints)){for(g in b)b.hasOwnProperty(g)&&(m[g]=b[g]);for(g in r)r.hasOwnProperty(g)&&(m[g]=r[g]);c.count++,j++,p(t,k,m,n+" ",s,u,c)}else V.A.debug("Branch count CS: "+c.count);c.count--,0===j&&V.A.debug("Match2 fails completely on "+w),V.A.debug("Match2 ends, Branch count: "+c.count+" for "+c.pattern_debug),0===c.count&&(V.A.debug("Branch finished."),c.reportDone())},v=this;V.A.debug("Query on "+this.statements.length);var g=new c(e,n);g.count++,t.sync?p(v,t.pat,t.pat.initBindings,"",r,e,g):setTimeout((function(){p(v,t.pat,t.pat.initBindings,"",r,e,g)}),0)}function gt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function mt(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?gt(Object(r),!0).forEach((function(e){(0,o.A)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function bt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wt(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,At()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function At(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(At=function(){return!!t})()}var xt="http://www.w3.org/2002/07/owl#";function _t(t,e,r,n){var i=t.any(e,r,void 0);return!!i&&(t.equate(i,n),!0)}function kt(t,e,r,n){var i=t.any(void 0,r,n);return!!i&&(t.equate(i,e),!0)}function Tt(t,e,r,n,i){t.typeCallback&&t.typeCallback(t,n,i);var o=t.classActions[t.id(n)],a=!1;if(o)for(var s=0;s<o.length;s++)a=a||o[s](t,e,r,n,i);return a}var Et=function(r){function n(t){var r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,e.A)(this,n),r=wt(this,n,[void 0,void 0,void 0,void 0,i]),(0,o.A)(r,"updater",void 0),(0,o.A)(r,"namespaces",void 0),(0,o.A)(r,"classActions",void 0),(0,o.A)(r,"propertyActions",void 0),(0,o.A)(r,"redirections",void 0),(0,o.A)(r,"aliases",void 0),(0,o.A)(r,"HTTPRedirects",void 0),(0,o.A)(r,"subjectIndex",void 0),(0,o.A)(r,"predicateIndex",void 0),(0,o.A)(r,"objectIndex",void 0),(0,o.A)(r,"whyIndex",void 0),(0,o.A)(r,"index",void 0),(0,o.A)(r,"features",void 0),(0,o.A)(r,"_universalVariables",void 0),(0,o.A)(r,"_existentialVariables",void 0),(0,o.A)(r,"rdfArrayRemove",void 0),(0,o.A)(r,"dataCallbacks",void 0),r.propertyActions={},r.classActions={},r.redirections=[],r.aliases=[],r.HTTPRedirects=[],r.subjectIndex=[],r.predicateIndex=[],r.objectIndex=[],r.whyIndex=[],r.index=[r.subjectIndex,r.predicateIndex,r.objectIndex,r.whyIndex],r.namespaces={},r.features=t||[],r.rdfArrayRemove=i.rdfArrayRemove||Q.RDFArrayRemove,i.dataCallback&&(r.dataCallbacks=[i.dataCallback]),r.initPropertyActions(r.features),r}return(0,i.A)(n,r),(0,t.A)(n,[{key:"substitute",value:function(t){var e=this.statements.map((function(e){return e.substitute(t)})),r=new n;return r.add(e),r}},{key:"addDataCallback",value:function(t){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(t)}},{key:"applyPatch",value:function(t,e,r){var n,i=this,o=null;function a(a){if(t.delete){n=t.delete,o&&(n=n.substitute(o)),n=n.statements;var s=[],u=n.map((function(t){var r=i.statementsMatching(t.subject,t.predicate,t.object,e);return 0===r.length?(s.push(t),null):r[0]}));if(s.length)return r("Could not find to delete: "+s.join("\n or "));u.map((function(t){i.remove(t)}))}t.insert&&(n=t.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(t){t.graph=e,i.add(t.subject,t.predicate,t.object,t.graph)}))),a()}if(t.where){var s=new yt("patch");s.pat=t.where,s.pat.statements.map((function(t){t.graph=Cr(e.value)})),s.sync=!0;var u=[];i.query(s,(function(t){u.push(t)}),i.fetcher,(function(){return 0===u.length?r("No match found to be patched:"+t.where):u.length>1?r("Patch ambiguous. No patch done."):(o=u[0],void a(r))}))}else a(r)}},{key:"declareExistential",value:function(t){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(t),t}},{key:"initPropertyActions",value:function(t){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[Tt],st(t,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(xt,"sameAs")))]=[function(t,e,r,n,i){return t.equate(e,n),!0}]),st(t,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(xt,"InverseFunctionalProperty")))]=[function(t,e,r,n,i){return t.newPropertyAction(e,kt)}]),st(t,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(xt,"FunctionalProperty")))]=[function(t,e,r,n,i){return t.newPropertyAction(e,_t)}])}},{key:"addStatement",value:function(t){return this.add(t.subject,t.predicate,t.object,t.graph),this.statements.length}},{key:"add",value:function(t,e,r,n){var i,o,a;if(1===arguments.length){if(t instanceof Array)for(i=0;i<t.length;i++)this.add(t[i]);else(0,v.aF)(t)?this.add(t.subject,t.predicate,t.object,t.graph):(0,v.ok)(t)&&this.add(t.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof t&&(t=this.rdfFactory.namedNode(t)),e=ft.fromValue(e);var s=ft.fromValue(r);if(n=ft.fromValue(n),!(0,v.CZ)(t))throw new Error("Subject is not a subject type");if(!(0,v.fY)(e))throw new Error("Predicate ".concat(e," is not a predicate type"));if(!(0,v.DJ)(s))throw new Error("Object ".concat(s," is not an object type"));if(!(0,v.RN)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,e,n);var u=this.id(this.canon(e)),c=!1;if(o=this.propertyActions[u])for(i=0;i<o.length;i++)c=c||o[i](this,t,e,s,n);if(this.holds(t,e,s,n))return null;var l=[this.id(this.canon(t)),u,this.id(this.canon(s)),this.id(this.canon(n))];for(a=this.rdfFactory.quad(t,e,s,n),i=0;i<4;i++){var h=this.index[i],f=l[i];h[f]||(h[f]=[]),h[f].push(a)}if(this.statements.push(a),this.dataCallbacks){var p,d=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return bt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(this.dataCallbacks);try{for(d.s();!(p=d.n()).done;)(0,p.value)(a)}catch(t){d.e(t)}finally{d.f()}}return a}},{key:"canon",value:function(t){if(!t)return t;var e=this.redirections[this.id(t)];if(e)return e;switch(t.termType){case l.$Q:return new p(t.value);case l.r0:return t;case l.ic:return new F;case l.S:case l.bD:return t;case l.QW:return new w(t.value,t.language,t.datatype);case l.Kk:return new y.A(t.value);case l.P2:return new H(t.value);default:throw new Error("Term Type not recognized for canonization: ".concat(t.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var t=0;t<4;t++){var e=this.index[t];for(var r in e)e.hasOwnProperty(r)&&this.checkStatementList(e[r],t)}}},{key:"checkStatementList",value:function(t,e){void 0===e&&(e=0);for(var r,n=" found in "+["subject","predicate","object","why"][e]+" index.",i=0;i<t.length;i++){for(var o=[(r=t[i]).subject,r.predicate,r.object,r.graph],a=function(t,e){for(var r=0;r<t.length;r++)if(t[r].subject.equals(e.subject)&&t[r].predicate.equals(e.predicate)&&t[r].object.equals(e.object)&&t[r].why.equals(e.graph))return!0},s=0;s<4;s++){var u=this.canon(o[s]),c=this.id(u);this.index[s][c]&&a(this.index[s][c],r)}if(!a(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}},{key:"close",value:function(){return this}},{key:"compareTerms",value:function(t,e){return Object.prototype.hasOwnProperty.call(t,"compareTerm")?t.compareTerm(e):a.A[t.termType]<a.A[e.termType]?-1:a.A[t.termType]>a.A[e.termType]?1:t.value<e.value?-1:t.value>e.value?1:0}},{key:"copyTo",value:function(t,e,r){r||(r=[]);var n=this.statementsMatching(t);-1!==st(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,t));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(e,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(e,o.predicate,o.object.copy(this))}-1!==st(r,"delete")&&this.remove(o)}}},{key:"equate",value:function(t,e){var r=this.canon(t),n=this.canon(e),i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}},{key:"formula",value:function(t){return new n(t)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(t,e,r,n){return this.statementsMatching(ft.fromValue(t),ft.fromValue(e),ft.fromValue(r),ft.fromValue(n))}},{key:"mentionsURI",value:function(t){var e="<"+t+">";return!!this.subjectIndex[e]||!!this.objectIndex[e]||!!this.predicateIndex[e]}},{key:"newExistential",value:function(t){if(!t)return this.bnode();var e=this.sym(t);return this.declareExistential(e)}},{key:"newPropertyAction",value:function(t,e){var r=this.id(t);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(e);for(var n=this.statementsMatching(void 0,t,void 0),i=!1,o=0;o<n.length;o++)i=i||e(this,n[o].subject,t,n[o].object);return i}},{key:"newUniversal",value:function(t){var e=this.sym(t);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(e),e}},{key:"variable",value:function(t){return new H(t)}},{key:"nextSymbol",value:function(t){for(var e=0;;e++){var r=t.value+"#n"+e;if(!this.mentionsURI(r))return this.sym(r)}}},{key:"query",value:function(t,e,r,n){return vt.call(this,t,e,r,n)}},{key:"querySync",value:function(t){var e=[],r=!1;if(t.sync=!0,vt.call(this,t,(function(t){e.push(t)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return e}},{key:"remove",value:function(t){if(t instanceof Array){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}if((0,v.ok)(t))return this.remove(t.statements);var r=this.statementsMatching(t.subject,t.predicate,t.object,t.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+t);return this.removeStatement(r[0]),this}},{key:"removeDocument",value:function(t){this.removeMetadata(t);for(var e=this.statementsMatching(void 0,void 0,void 0,t).slice(),r=0;r<e.length;r++)this.removeStatement(e[r]);return this.removeMatches(t,null,null),this}},{key:"removeMetadata",value:function(t){for(var e=this.sym("chrome://TheCurrentSession"),r="http://www.w3.org/2007/ont/link#",n=this.statementsMatching(void 0,this.sym("".concat(r,"requestedURI")),this.rdfFactory.literal(t.value),e).map((function(t){return t.subject})),i=0;i<n.length;i++){var o=n[i];if(null!=o){var a=void 0,s=this.any(o,this.sym("".concat(r,"status")),null,e);if(null!=s){a=this.statementsMatching(s,this.sym("".concat(r,"status")),null,e).slice();for(var u=0;u<a.length;u++)this.removeStatement(a[u])}var c=this.any(o,this.sym("".concat(r,"response")),null,e);if(null!=c)for(a=this.statementsMatching(c,null,null,e).slice(),u=0;u<a.length;u++)this.removeStatement(a[u]);for(a=this.statementsMatching(o,null,null,e).slice(),u=0;u<a.length;u++)this.removeStatement(a[u])}}return this.removeMatches(this.sym(t.value),null,null,e),this}},{key:"removeMany",value:function(t,e,r,n,i){for(var o=this.statementsMatching(t,e,r,n,!1),a=[],s=0;s<o.length;s++)a.push(o[s]);for(i&&(a=a.slice(0,i)),s=0;s<a.length;s++)this.remove(a[s])}},{key:"removeMatches",value:function(t,e,r,n){return this.removeMany(t,e,r,n),this}},{key:"removeStatement",value:function(t){for(var e=[t.subject,t.predicate,t.object,t.graph],r=0;r<4;r++){var n=this.canon(e[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],t)}return this.rdfArrayRemove(this.statements,t),this}},{key:"removeStatements",value:function(t){for(var e=0;e<t.length;e++)this.remove(t[e]);return this}},{key:"replaceWith",value:function(t,e){for(var r=this.id(t),n=this.id(e),i=function(t){var e=t[r];if(e){var i=t[n];t[n]=i?e.concat(i):e,delete t[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=e,t.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(t),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=e,this.aliases[n].push(this.aliases[r][o]);this.add(e,this.sym("http://www.w3.org/2007/ont/link#uri"),t),this.fetcher&&this.fetcher.nowKnownAs(t,e)}return i(this.classActions),i(this.propertyActions),!0}},{key:"allAliases",value:function(t){var e=this.aliases[this.id(this.canon(t))]||[];return e.push(this.canon(t)),e}},{key:"sameThings",value:function(t,e){if(t.equals(e))return!0;var r=this.canon(t);if(!r)return!1;var n=this.canon(e);return!!n&&r.value===n.value}},{key:"setPrefixForURI",value:function(t,e){if(("tab"!==t||!this.namespaces.tab)&&"ns"!==t.slice(0,2)&&"default"!==t.slice(0,7)){for(var r in this.namespaces)this.namespaces[r]==e&&delete this.namespaces[r];this.namespaces[t]=e}}},{key:"statementsMatching",value:function(t,e,r,n,i){var o,a,s=[t,e,r,n],u=[],c=[],l=[],h=[];for(o=0;o<4;o++)u[o]=this.canon(ft.fromValue(s[o])),u[o]?(h.push(o),c[o]=this.id(u[o])):l.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(a=this.index[o][c[o]])&&i&&a.length>1&&(a=a.slice(0,1)),a||[];var f,p,d=1e10;for(p=0;p<h.length;p++){if(o=h[p],!(a=this.index[o][c[o]]))return[];a.length<d&&(d=a.length,f=p)}for(var y=h[f],v=this.index[y][c[y]],g=h.slice(0,f).concat(h.slice(f+1)),m=[],b=["subject","predicate","object","why"],w=0;w<v.length;w++){var A=v[w];for(p=0;p<g.length;p++)if(o=g[p],!this.canon(A[b[o]]).equals(u[o])){A=null;break}if(null!=A&&(m.push(A),i))break}return m}},{key:"uris",value:function(t){var e=this.canon(t),r=this.aliases[this.id(e)];if(!e.value)return[];var n=[e.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}},{key:"serialize",value:function(t,e,r,n){var i,o=null!==(i=n)&&void 0!==i&&i.namespaces?mt(mt({},this.namespaces),n.namespaces):mt({},this.namespaces);return nt(r,this,t,e,void 0,n=mt(mt({},n||{}),{},{namespaces:o}))}}],[{key:"defaultGraphURI",get:function(){return I}}])}(ht);function Ot(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return jt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?jt(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function jt(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}(0,o.A)(Et,"handleRDFType",void 0),Et.handleRDFType=Tt;var Nt=W("http://www.w3.org/1999/02/22-rdf-syntax-ns#");function St(t,e){function r(n,i,o){var a=t.statementsMatching(n,Nt("rest"),null,e);if(1!==a.length)throw new Error("Bad list structure: no rest at ".concat(n));var s=t.statementsMatching(n,Nt("first"),null,e);if(1!==s.length)throw new Error("Bad list structure: rest but ".concat(s.length," firsts at ").concat(n));var u=[s[0].object].concat(i),c=o.concat(a).concat(s),l=t.statementsMatching(null,Nt("rest"),n,e);if(0===l.length){var h=new k(u);return t.remove(c),void function(t,e,r,n){var i,o=Ot(t.statementsMatching(r,null,null,n));try{for(o.s();!(i=o.n()).done;){var a=i.value,s=new L(e,a.predicate,a.object,n);t.remove(a),t.add(s)}}catch(t){o.e(t)}finally{o.f()}var u,c=Ot(t.statementsMatching(null,r,null,n));try{for(c.s();!(u=c.n()).done;){var l=u.value;t.remove(l),t.add(new L(l.subject,e,l.object,n))}}catch(t){c.e(t)}finally{c.f()}var h,f=Ot(t.statementsMatching(null,null,r,n));try{for(f.s();!(h=f.n()).done;){var p=h.value;t.remove(p),t.add(new L(p.subject,p.predicate,e,n))}}catch(t){f.e(t)}finally{f.f()}}(t,h,n,e)}if(1!==l.length)throw new Error("Bad list structure: ".concat(l.length," pres at ").concat(n));var f=l[0].subject;if("BlankNode"!==f.termType)throw new Error("Bad list element node ".concat(f," type: ").concat(f.termType," "));r(f,u,c)}!function(t,e){var r,n=Nt("nil"),i=Ot(t.statementsMatching(n,null,null,e));try{for(i.s();!(r=i.n()).done;){var o=r.value;t.remove(o);var a=new k;t.add(new L(a,o.predicate,o.object,e))}}catch(t){i.e(t)}finally{i.f()}var s,u=Ot(t.statementsMatching(null,null,n,e));try{for(u.s();!(s=u.n()).done;){var c=s.value;if(!c.predicate.sameTerm(Nt("rest"))){t.remove(c);var l=new k;t.add(new L(c.subject,c.predicate,l,e))}}}catch(t){u.e(t)}finally{u.f()}}(t,e),t.statementsMatching(null,Nt("rest"),Nt("nil"),e).forEach((function(t){if("BlankNode"!==t.subject.termType)throw new Error("Bad list element node ".concat(t.subject," type: ").concat(t.subject.termType," "));r(t.subject,[],[])}))}var Rt="http://www.w3.org/2000/10/swap/log#",It=function(t){return t},Ct=function(t){return t},Pt=function(t){if(t.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},Ft=function(t){return t.length},Ut=function(t,e,r){if(void 0===t.slice)throw"@@ mising.js: No .slice function for "+t+" of type "+(0,d.A)(t);return void 0===r||null==r?t.slice(e):t.slice(e,r)},Dt=Error("dummy error stop iteration"),Lt=function(t){return this.last=0,this.li=t,this.next=function(){if(this.last==this.li.length)throw Dt;return this.li[this.last++]},this},Mt=function(t,e){return t.indexOf(e)},Bt=function(t,e){if(!t){if(e)throw"python Assertion failed: "+e;throw"(python) Assertion failed."}};String.prototype.encode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return function(t){t=t.replace(/\r\n/g,"\n");for(var e="",r=0;r<t.length;r++){var n=t.charCodeAt(r);n<128?e+=String.fromCharCode(n):n>127&&n<2048?(e+=String.fromCharCode(n>>6|192),e+=String.fromCharCode(63&n|128)):(e+=String.fromCharCode(n>>12|224),e+=String.fromCharCode(n>>6&63|128),e+=String.fromCharCode(63&n|128))}return e}(this)},String.prototype.decode=function(t){if("utf-8"!=t)throw"UTF8_converter: can only do utf-8";return this};var qt=function(t,e){return M.join(e,t)},Ht="http://www.w3.org/1999/02/22-rdf-syntax-ns#nil",$t="http://www.w3.org/2002/07/owl#sameAs",zt="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",Xt=zt+":",Gt=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),Vt=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?"),Wt=new RegExp('[\\\\\\r\\n\\"]',"g"),Qt=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const Yt=function(t,e,r,n,i,o,a,s){return new Jt(t,e,r,n,i,o,a,s)};var Jt=function(){return(0,t.A)((function t(r,n,i,o,a,s,u,c){(0,e.A)(this,t),void 0===n&&(n=null),void 0===i&&(i=""),void 0===o&&(o=null),void 0===a&&(a=""),void 0===s&&(s=null),void 0===u&&(u=""),void 0===c&&(c=null),this._bindings=new Pt([]),this._flags=u,""!=i&&(Bt(i.indexOf(":")>=0,"Document URI not absolute: "+i),this._bindings[""]=i+"#"),this._store=r,a&&r.setGenPrefix(a),this._thisDoc=i,this.source=r.sym(i),this.lines=0,this.statementCount=0,this.hasNil=!1,this.startOfLine=0,this.previousLine=0,this._genPrefix=a,this.keywords=new Ct(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new Pt([]),this._variables=new Pt([]),this._parentVariables=new Pt([]),this._reason=c,this._reason2=null,this._baseURI=o||i||null,Bt(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==n?this._thisDoc?this._formula=r.formula(i+"#_formula"):this._formula=r.formula():this._formula=n,this._context=this._formula,this._parentContext=null}),[{key:"here",value:function(t){return this._genPrefix+"_L"+this.lines+"C"+(t-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(t){return this.loadBuf(t.read())}},{key:"loadBuf",value:function(t){return this.startDoc(),this.feed(t),this.endDoc()}},{key:"feed",value:function(t){for(var e=t.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(e,r);if(n<0)return;if((r=this.directiveOrStatement(e,n))<0)throw Zt(this._thisDoc,this.lines,e,n,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(t,e){var r,n=this.skipSpace(t,e);return n<0?n:(r=this.directive(t,n))>=0||(r=this.statement(t,n))>=0?this.checkDot(t,r):r}},{key:"tok",value:function(t,e,r){if("@"==e.slice(r,r+1))r+=1;else if(st(this.keywords,t)<0)return-1;var n=r+Ft(t);return e.slice(r,n)==t&&zt.indexOf(e.charAt(n))>=0?n:-1}},{key:"directive",value:function(t,e){if((o=this.skipSpace(t,e))<0)return o;var r=new Ct([]);if((o=this.tok("bind",t,e))>0)throw Zt(this._thisDoc,this.lines,t,e,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",t,e))>0){if((e=this.commaSeparatedList(t,o,r,!1))<0)throw Zt(this._thisDoc,this.lines,t,e,"'@keywords' needs comma separated list of words");return this.setKeywords(Ut(r,null,null)),e}if((o=this.tok("forAll",t,e))>0){if((e=this.commaSeparatedList(t,o,r,!0))<0)throw Zt(this._thisDoc,this.lines,t,e,"Bad variable list after @forAll");var n=new Lt(r);try{for(;;){var i=n.next();(st(this._variables,i)<0||st(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(t){if(t!=Dt)throw t}return e}if((o=this.tok("forSome",t,e))>0){if((e=this.commaSeparatedList(t,o,r,this.uri_ref2))<0)throw Zt(this._thisDoc,this.lines,t,e,"Bad variable list after @forSome");n=new Lt(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(t){if(t!=Dt)throw t}return e}if((o=this.tok("prefix",t,e))>=0){var o,a=new Ct([]);if((e=this.qname(t,o,a))<0)throw Zt(this._thisDoc,this.lines,t,o,"expected qname after @prefix");if((o=this.uri_ref2(t,e,a))<0)throw Zt(this._thisDoc,this.lines,t,e,"expected <uriref> after @prefix _qname_");var s=a[1].uri;return this._baseURI?s=qt(this._baseURI,s):Bt(s.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),Bt(s.indexOf(":")>=0),this._bindings[a[0][0]]=s,this.bind(a[0][0],function(t){return encodeURI(t)}(s)),o}if((o=this.tok("base",t,e))>=0){if(a=new Ct([]),(e=this.uri_ref2(t,o,a))<0)throw Zt(this._thisDoc,this.lines,t,o,"expected <uri> after @base ");if(s=a[0].uri,!this._baseURI)throw Zt(this._thisDoc,this.lines,t,o,"With no previous base URI, cannot use relative URI in @base <"+s+">");return s=qt(this._baseURI,s),Bt(s.indexOf(":")>=0),this._baseURI=s,e}return-1}},{key:"bind",value:function(t,e){""==t||this._store.setPrefixForURI(t,e)}},{key:"setKeywords",value:function(t){null==t?this.keywordsSet=0:(this.keywords=t,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this.hasNil&&this._store.rdfFactory.supports.COLLECTIONS&&St(this._store,this.source),this._formula}},{key:"makeStatement",value:function(t){t[0].add(t[2],t[1],t[3],this.source),(t[2].uri&&t[2].uri===Ht||t[3].uri&&t[3].uri===Ht)&&(this.hasNil=!0),this.statementCount+=1}},{key:"statement",value:function(t,e){var r=new Ct([]);if((e=this.object(t,e,r))<0)return e;var n=this.property_list(t,e,r[0]);if(n<0)throw Zt(this._thisDoc,this.lines,t,e,"expected propertylist");return n}},{key:"subject",value:function(t,e,r){return this.item(t,e,r)}},{key:"verb",value:function(t,e,r){if((i=this.skipSpace(t,e))<0)return i;var n=new Ct([]);if((i=this.tok("has",t,e))>=0){if((e=this.prop(t,i,n))<0)throw Zt(this._thisDoc,this.lines,t,i,"expected property after 'has'");return r.push(new It(["->",n[0]])),e}if((i=this.tok("is",t,e))>=0){if((e=this.prop(t,i,n))<0)throw Zt(this._thisDoc,this.lines,t,i,"expected <property> after 'is'");if((i=this.skipSpace(t,e))<0)throw Zt(this._thisDoc,this.lines,t,e,"End of file found, expected property after 'is'");var i;if(e=i,(i=this.tok("of",t,e))<0)throw Zt(this._thisDoc,this.lines,t,e,"expected 'of' after 'is' <prop>");return r.push(new It(["<-",n[0]])),i}if((i=this.tok("a",t,e))>=0)return r.push(new It(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==t.slice(e,e+2))return r.push(new It(["<-",this._store.sym(Rt+"implies")])),e+2;if("="==t.slice(e,e+1))return">"==t.slice(e+1,e+2)?(r.push(new It(["->",this._store.sym(Rt+"implies")])),e+2):(r.push(new It(["->",this._store.sym($t)])),e+1);if(":="==t.slice(e,e+2))return r.push(new It(["->",Rt+"becomes"])),e+2;if((i=this.prop(t,e,n))>=0)return r.push(new It(["->",n[0]])),i;if(">-"==t.slice(e,e+2)||"<-"==t.slice(e,e+2))throw Zt(this._thisDoc,this.lines,t,i,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(t,e,r){return this.item(t,e,r)}},{key:"item",value:function(t,e,r){return this.path(t,e,r)}},{key:"blankNode",value:function(t){return this._context.bnode(t,this._reason2)}},{key:"path",value:function(t,e,r){if((o=this.nodeOrLiteral(t,e,r))<0)return o;for(;"!^.".indexOf(t.slice(o,o+1))>=0;){var n=t.slice(o,o+1);if("."==n){var i=t.slice(o+1,o+2);if(!i||Xt.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,a=r.pop(),s=this.blankNode(this.here(o));if((o=this.node(t,o+1,r))<0)throw Zt(this._thisDoc,this.lines,t,o,"EOF found in middle of path syntax");var u=r.pop();"^"==n?this.makeStatement(new It([this._context,u,s,a])):this.makeStatement(new It([this._context,u,a,s])),r.push(s)}return o}},{key:"anonymousNode",value:function(t){if(e=this._anonymousNodes[t])return e;var e=this._store.bnode(t);return this._anonymousNodes[t]=e,e}},{key:"node",value:function(t,e,r,n){void 0===n&&(n=null);var i=n;if((l=this.skipSpace(t,e))<0)return l;e=l;var o=t.slice(e,e+1);if("["==o){var a=this.here(e);if((l=this.skipSpace(t,e+1))<0)throw Zt(this._thisDoc,this.lines,t,e,"EOF after '['");if("="==t.slice(l,l+1)){e=l+1;var s=new Ct([]);if(!((l=this.objectList(t,e,s))>=0))throw Zt(this._thisDoc,this.lines,t,e,"objectList expected after [= ");if(i=s[0],Ft(s)>1){var u=new Lt(s);try{for(;;){var c=u.next();this.makeStatement(new It([this._context,this._store.sym($t),i,c]))}}catch(t){if(t!=Dt)throw t}}if((l=this.skipSpace(t,l))<0)throw Zt(this._thisDoc,this.lines,t,e,"EOF when objectList expected after [ = ");if(";"==t.slice(l,l+1))var l=l+1}if(null==i&&(i=this.blankNode(a)),(e=this.property_list(t,l,i))<0)throw Zt(this._thisDoc,this.lines,t,l,"property_list expected");if((l=this.skipSpace(t,e))<0)throw Zt(this._thisDoc,this.lines,t,e,"EOF when ']' expected after [ <propertyList>");if("]"!=t.slice(l,l+1))throw Zt(this._thisDoc,this.lines,t,l,"']' expected");return r.push(i),l+1}if("{"==o){if("$"==t.slice(e+1,e+2)){l=(e+=1)+1;for(var h=new Ct([]),f=!0;;){if((e=this.skipSpace(t,l))<0)throw Zt(this._thisDoc,this.lines,t,e,"needed '$}', found end.");if("$}"==t.slice(e,e+2)){l=e+2;break}if(f)f=!1;else{if(","!=t.slice(e,e+1))throw Zt(this._thisDoc,this.lines,t,e,"expected: ','");e+=1}var p=new Ct([]);if((l=this.item(t,e,p))<0)throw Zt(this._thisDoc,this.lines,t,e,"expected item in set or '$}'");h.push(p[0])}return r.push(this._store.newSet(h,this._context)),l}l=e+1;var d=this._parentContext;this._parentContext=this._context;var y=this._anonymousNodes,v=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new Pt([]),this._variables=this._variables.slice();var g=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((e=this.skipSpace(t,l))<0)throw Zt(this._thisDoc,this.lines,t,e,"needed '}', found end.");if("}"==t.slice(e,e+1)){l=e+1;break}if((l=this.directiveOrStatement(t,e))<0)throw Zt(this._thisDoc,this.lines,t,e,"expected statement or '}'")}return this._anonymousNodes=y,this._variables=this._parentVariables,this._parentVariables=v,this._context=this._parentContext,this._reason2=g,this._parentContext=d,r.push(i.close()),l}if("("==o){var m=this._store.list;for("$"==t.slice(e+1,e+2)&&(m=this._store.newSet,e+=1),l=e+1,h=new Ct([]);;){if((e=this.skipSpace(t,l))<0)throw Zt(this._thisDoc,this.lines,t,e,"needed ')', found end.");if(")"==t.slice(e,e+1)){l=e+1;break}if(p=new Ct([]),(l=this.item(t,e,p))<0)throw Zt(this._thisDoc,this.lines,t,e,"expected item in list or ')'");h.push(p[0])}return r.push(m(h,this._context)),l}if((l=this.tok("this",t,e))>=0)throw Zt(this._thisDoc,this.lines,t,e,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",t,e))>=0?(r.push(!0),l):(l=this.tok("false",t,e))>=0?(r.push(!1),l):null==i&&(l=this.uri_ref2(t,e,r))>=0?l:-1}},{key:"property_list",value:function(t,e,r){for(;;){if((l=this.skipSpace(t,e))<0)throw Zt(this._thisDoc,this.lines,t,e,"EOF found when expected verb in property list");if(":-"!=t.slice(l,l+2)){e=l;var n=new Ct([]);if((l=this.verb(t,e,n))<=0)return e;var i=new Ct([]);if((e=this.objectList(t,l,i))<0)throw Zt(this._thisDoc,this.lines,t,l,"objectList expected");var o=new Lt(i);try{for(;;){var a=o.next(),s=n[0],u=s[0],c=s[1];"->"==u?this.makeStatement(new It([this._context,c,r,a])):this.makeStatement(new It([this._context,c,a,r]))}}catch(t){if(t!=Dt)throw t}if((l=this.skipSpace(t,e))<0)throw Zt(this._thisDoc,this.lines,t,l,"EOF found in list of objects");if(";"!=t.slice(e,e+1))return e;e+=1}else{e=l+2;var l,h=new Ct([]);if((l=this.node(t,e,h,r))<0)throw Zt(this._thisDoc,this.lines,t,e,"bad {} or () or [] node after :- ");e=l}}}},{key:"commaSeparatedList",value:function(t,e,r,n){if((i=this.skipSpace(t,e))<0)throw Zt(this._thisDoc,this.lines,t,i,"EOF found expecting comma sep list");if("."==t.charAt(i))return e;if(n)var i=this.uri_ref2(t,i,r);else i=this.bareWord(t,i,r);if(i<0)return-1;for(;;){if((e=this.skipSpace(t,i))<0)return e;var o=t.slice(e,e+1);if(","!=o)return"."!=o?-1:e;if((i=n?this.uri_ref2(t,e+1,r):this.bareWord(t,e+1,r))<0)throw Zt(this._thisDoc,this.lines,t,i,"bad list content")}}},{key:"objectList",value:function(t,e,r){if((e=this.object(t,e,r))<0)return-1;for(;;){var n=this.skipSpace(t,e);if(n<0)throw Zt(this._thisDoc,this.lines,t,n,"EOF found after object");if(","!=t.slice(n,n+1))return n;if((e=this.object(t,n+1,r))<0)return e}}},{key:"checkDot",value:function(t,e){var r=this.skipSpace(t,e);if(r<0)return r;if("."==t.slice(r,r+1))return r+1;if("}"==t.slice(r,r+1))return r;if("]"==t.slice(r,r+1))return r;throw Zt(this._thisDoc,this.lines,t,r,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(t,e,r){var n=new Ct([]);if((f=this.qname(t,e,n))>=0){var i=n[0],o=i[0],a=i[1];if(null==o){Bt(0,"not used?");var s=this._baseURI+"#"}else if(!(s=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(a)),f;throw Zt(this._thisDoc,this.lines,t,e,"Prefix "+o+" not bound.")}var u=this._store.sym(s+a);return st(this._variables,u)>=0?r.push(this._variables[u]):r.push(u),f}if((e=this.skipSpace(t,e))<0)return-1;if("?"==t.charAt(e)){var c=new Ct([]);return(f=this.variable(t,e,c))>0?(r.push(c[0]),f):-1}if("<"==t.charAt(e)){for(var l=e+=1;e<Ft(t);){if(">"==t.charAt(e)){var h=t.slice(l,e);return this._baseURI?h=qt(this._baseURI,h):Bt(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==t.slice(e-1,e)&&"#"!=Ut(h,-1,null)&&(h+="#"),u=this._store.sym(h),st(this._variables,u)>=0?r.push(this._variables[u]):r.push(u),e+1}e+=1}throw Zt(this._thisDoc,this.lines,t,f,"unterminated URI reference")}if(this.keywordsSet){var f;if(c=new Ct([]),(f=this.bareWord(t,e,c))<0)return-1;if(st(this.keywords,c[0])>=0)throw Zt(this._thisDoc,this.lines,t,e,'Keyword "'+c[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+c[0])),f}return-1}},{key:"skipSpace",value:function(t,e){for(var r=e||0;r<t.length;r++){var n=t.charAt(r);if(" \n\r\t\f\v \u2028\u2029 ".indexOf(n)<0){if("#"!==t.charAt(r))return r;for(;;r++){if(r===t.length)return-1;if("\n"===t.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===t.charAt(r)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(t,e,r){if((n=this.skipSpace(t,e))<0)return-1;if("?"!=t.slice(n,n+1))return-1;var n;if(e=n+=1,"0123456789-".indexOf(t.charAt(n))>=0)throw Zt(this._thisDoc,this.lines,t,n,"Varible name can't start with '"+t.charAt(n)+"s'");for(;e<Ft(t)&&Xt.indexOf(t.charAt(e))<0;)e+=1;if(null==this._parentContext)throw Zt(this._thisDoc,this.lines,t,n,"Can't use ?xxx syntax for variable in outermost level: "+t.slice(n-1,e));return r.push(this._store.variable(t.slice(n,e))),e}},{key:"bareWord",value:function(t,e,r){var n=this.skipSpace(t,e);if(n<0)return-1;var i=t.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(Xt.indexOf(i)>=0)return-1;for(e=n;e<Ft(t)&&Xt.indexOf(t.charAt(e))<0;)e+=1;return r.push(t.slice(n,e)),e}},{key:"qname",value:function(t,e,r){if((e=this.skipSpace(t,e))<0)return-1;var n=t.charAt(e);if("0123456789-+".indexOf(n)>=0)return-1;if(Xt.indexOf(n)<0){var i=n;for(e+=1;e<Ft(t)&&(n=t.charAt(e),Xt.indexOf(n)<0);)i+=n,e+=1}else i="";if(e<Ft(t)&&":"==t.charAt(e)){var o=i;for(e+=1,i="";e<Ft(t)&&(n=t.charAt(e),Xt.indexOf(n)<0);)i+=n,e+=1;return r.push(new It([o,i])),e}return i&&this.keywordsSet&&st(this.keywords,i)<0?(r.push(new It(["",i])),e):-1}},{key:"object",value:function(t,e,r){if((a=this.subject(t,e,r))>=0)return a;if((a=this.skipSpace(t,e))<0)return-1;e=a;var n=null,i=t.charAt(e);if('"'==i||"'"==i){n=t.slice(e,e+3==i+i)?i+i+i:i,e+=Ft(n);var o=this.strconst(t,e,n),a=o[0],s=o[1];return r.push(this._store.literal(s)),a}return-1}},{key:"nodeOrLiteral",value:function(t,e,r){if((u=this.node(t,e,r))>=0)return u;if((u=this.skipSpace(t,e))<0)return-1;e=u;var n=t.charAt(e);if("-+0987654321".indexOf(n)>=0){if(Vt.lastIndex=0,null!=(h=Vt.exec(t.slice(e))))u=e+(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(Gt.lastIndex=0,null==(h=Gt.exec(t.slice(e))))throw Zt(this._thisDoc,this.lines,t,e,"Bad number or date syntax");u=e+Gt.lastIndex,(i=t.slice(e,u)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):t.slice(e,u).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 u}if('"'==t.charAt(e)){if('"""'==t.slice(e,e+3))var o='"""';else o='"';e+=Ft(o);var a=null,s=this.strconst(t,e,o),u=s[0],c=s[1],l=null;if("@"==t.slice(u,u+1)){var h;if(Qt.lastIndex=0,null==(h=Qt.exec(t.slice(u+1))))throw Zt(this._thisDoc,startline,t,e,"Bad language code syntax on string literal, after @");e=Qt.lastIndex+u+1,l=t.slice(u+1,e),u=e}if("^^"==t.slice(u,u+2)){var f=new Ct([]);u=this.uri_ref2(t,u+2,f),a=f[0]}return r.push(this._store.literal(c,l||a)),u}return-1}},{key:"strconst",value:function(t,e,r){for(var n=e,i="",o=this.lines;n<Ft(t);){if(e=n+Ft(r),t.slice(n,e)==r)return new It([e,i]);if('"'!=t.charAt(n)){if(Wt.lastIndex=0,!Wt.exec(t.slice(n)))throw Zt(this._thisDoc,o,t,n,"Closing quote missing in string at ^ in "+t.slice(n-20,n)+"^"+t.slice(n,n+20));if(e=n+Wt.lastIndex-1,i+=t.slice(n,e),'"'!=(u=t.charAt(e)))if("\r"!=u){if("\n"==u){if('"'==r)throw Zt(this._thisDoc,o,t,e,"newline found in string literal");this.lines=this.lines+1,i+=u,n=e+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==u){if(n=e+1,!(u=t.slice(n,n+1)))throw Zt(this._thisDoc,o,t,e,"unterminated string literal (2)");var a=Mt('abfrtvn\\"',u);if(a>=0)i+='a\b\f\r\t\v\n\\"'.charAt(a),n+=1;else if("u"==u)n=(s=this.uEscape(t,n+1,o))[0],i+=u=s[1];else{if("U"!=u)throw Zt(this._thisDoc,this.lines,t,e,"bad escape");var s,u;n=(s=this.UEscape(t,n+1,o))[0],i+=u=s[1]}}}else n=e+1;else n=e}else i=i+'"',n=n+1}throw Zt(this._thisDoc,this.lines,t,e,"unterminated string literal")}},{key:"uEscape",value:function(t,e,r){for(var n=e,i=0,o=0;i<4;){var a=t.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw Zt(this._thisDoc,r,t,e,"unterminated string literal(3)");var s=Mt("0123456789abcdef",a);if(s<0)throw Zt(this._thisDoc,r,t,e,"bad string literal hex escape");o=16*o+s,i+=1}var u=String.fromCharCode(o);return new It([n,u])}},{key:"UEscape",value:function(t,e,r){for(var n=e,i=0,o="\\U";i<8;){var a=t.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw Zt(this._thisDoc,r,t,e,"unterminated string literal(3)");if(Mt("0123456789abcdef",a)<0)throw Zt(this._thisDoc,r,t,e,"bad string literal hex escape");o+=a,i+=1}var s,u=(s="0x"+Ut(o,2,10)-0,String.fromCharCode(s));return new It([n,u])}}])}();function Zt(t,e,r,n,i){var o=e+1,a="Line "+o+" of <"+t+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',s=new SyntaxError(a,t,o);return s.lineNo=o,s.characterInFile=n,s.syntaxProblem=i,s}function Kt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function te(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?Kt(Object(r),!0).forEach((function(e){(0,o.A)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Kt(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var ee=te(te({},G),{},{supports:(0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)((0,o.A)({},$.collections,!0),$.defaultGraphType,!1),$.equalsMethod,!0),$.identity,!1),$.id,!0),$.reversibleId,!1),$.variableType,!0),collection:function(t){return new k(t)},id:function(t){var e=this;return(0,v.P3)(t)?"( ".concat(t.elements.map((function(t){return e.id(t)})).join(", ")," )"):(0,v.DZ)(t)?H.toString(t):G.id(t)},termToNQ:function(t){return t.termType===l.r0?k.toNT(t):G.termToNQ(t)}});const re=ee;function ne(t,e){return"string"==typeof e?t.rdfFactory.literal(e):Object.prototype.hasOwnProperty.call(e,"@list")?!0===t.rdfFactory.supports.COLLECTIONS?function(t,e){if(!Array.isArray(e))throw new TypeError("Object must be an array");return t.rdfFactory.collection(e.map((function(e){return ne(t,e)})))}(t,e["@list"]):function(t,e){var r=e["@id"]?oe(t,e):t.rdfFactory.blankNode(),n=e["@list"].map((function(e){return ne(t,e)})),i=at(t.rdfFactory,r,n);return t.addAll(i),r}(t,e):Object.prototype.hasOwnProperty.call(e,"@id")?oe(t,e):Object.prototype.hasOwnProperty.call(e,"@language")?t.rdfFactory.literal(e["@value"],e["@language"]):Object.prototype.hasOwnProperty.call(e,"@type")?t.rdfFactory.literal(e["@value"],t.rdfFactory.namedNode(e["@type"])):Object.prototype.hasOwnProperty.call(e,"@value")?t.rdfFactory.literal(e["@value"]):t.rdfFactory.literal(e)}function ie(t,e,r,n){var i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return Promise.all([s.e(515),s.e(789)]).then(s.t.bind(s,8515,23)).then((function(e){return e.flatten(JSON.parse(t),null,{base:i})})).then((function(t){return t.reduce((function(t,n){return e=ae(e,r,n)}),e)})).then(n).catch(n)}function oe(t,e){return e["@id"].startsWith("_:")?t.rdfFactory.blankNode(e["@id"].substring(2)):t.rdfFactory.namedNode(e["@id"])}function ae(t,e,r){for(var n=r["@id"]?oe(t,r):t.rdfFactory.blankNode(),i=0,o=Object.keys(r);i<o.length;i++){var a=o[i];if("@id"!==a){if("@graph"==a)for(var s=n,u=r[a],c=0;c<u.length;c++)t=ae(t,s,u[c]);var l=r[a];if(Array.isArray(l))for(var h=0;h<l.length;h++)t.addStatement(se(t,n,a,l[h],e));else t.addStatement(se(t,n,a,l,e))}}return t}function se(t,e,r,n,i){var o,a;return"@type"===r?(o=t.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),a=t.rdfFactory.namedNode(n)):(o=t.rdfFactory.namedNode(r),a=ne(t,n)),t.rdfFactory.quad(e,o,a,t.rdfFactory.namedNode(i))}var ue=s(5582),ce=s.n(ue);const le="http://www.w3.org/1999/02/22-rdf-syntax-ns#",he="http://www.w3.org/2001/XMLSchema#",fe="http://www.w3.org/2000/10/swap/",pe={xsd:{decimal:`${he}decimal`,boolean:`${he}boolean`,double:`${he}double`,integer:`${he}integer`,string:`${he}string`},rdf:{type:`${le}type`,nil:`${le}nil`,first:`${le}first`,rest:`${le}rest`,langString:`${le}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${fe}reify#forSome`,forAll:`${fe}reify#forAll`},log:{implies:`${fe}log#implies`}};var de=s(2313).hp;const{xsd:ye}=pe,ve=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,ge={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},me=/[\x00-\x20<>\\"\{\}\|\^\`]/,be={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},we=/$0^/;class Ae{constructor(t){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]*)?$/,t=t||{},this._lineMode=!!t.lineMode){this._n3Mode=!1;for(const t in this)!(t in be)&&this[t]instanceof RegExp&&(this[t]=we)}else this._n3Mode=!1!==t.n3;this._comments=!!t.comments,this._literalClosingPos=0}_tokenizeToEnd(t,e){let r=this._input,n=r.length;for(;;){let t,a;for(;t=this._newline.exec(r);)this._comments&&(a=this._comment.exec(t[0]))&&i("comment",a[1],"",this._line,t[0].length),r=r.substr(t[0].length,r.length),n=r.length,this._line++;if(!t&&(t=this._whitespace.exec(r))&&(r=r.substr(t[0].length,r.length)),this._endOfFile.test(r))return e&&(this._comments&&(a=this._comment.exec(r))&&i("comment",a[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const s=this._line,u=r[0];let c="",l="",h="",f=null,p=0,d=!1;switch(u){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(p=1,c="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){d=!0;break}case"<":if(f=this._unescapedIri.exec(r))c="IRI",l=f[1];else if(f=this._iri.exec(r)){if(l=this._unescape(f[1]),null===l||me.test(l))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,l=">");break;case">":r.length>1&&">"===r[1]&&(c=">>",p=2);break;case"_":((f=this._blank.exec(r))||e&&(f=this._blank.exec(`${r} `)))&&(c="blank",h="_",l=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===p||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(r))l=f[1];else if(({value:l,matchLength:p}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===p||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(r))&&(c="var",l=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(r))?(c="langcode",l=f[1]):(f=this._keyword.exec(r))&&(c=f[0]);break;case".":if(1===r.length?e: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"-":(f=this._number.exec(r)||e&&(f=this._number.exec(`${r} `)))&&(c="literal",l=f[0],h="string"==typeof f[1]?ye.double:"string"==typeof f[2]?ye.decimal:ye.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(r))?c=f[0].toUpperCase():d=!0;break;case"f":case"t":(f=this._boolean.exec(r))?(c="literal",l=f[0],h=ye.boolean):d=!0;break;case"a":(f=this._shortPredicates.exec(r))?(c="abbreviation",l="a"):d=!0;break;case"=":this._n3Mode&&r.length>1&&(c="abbreviation",">"!==r[1]?(p=1,l="="):(p=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(p=1,c=u);break;case"{":!this._lineMode&&r.length>=2&&("|"===r[1]?(c="{|",p=2):(c=u,p=1));break;case"|":r.length>=2&&"}"===r[1]&&(c="|}",p=2);break;default:d=!0}if(d&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(r))?((f=this._prefixed.exec(r))||e&&(f=this._prefixed.exec(`${r} `)))&&(c="prefixed",h=f[1]||"",l=this._unescape(f[2])):(c="prefix",l=f[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return e||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const y=p||f[0].length,v=i(c,l,h,s,y);this.previousToken=v,this._previousMarker=c,r=r.substr(y,r.length)}function i(e,i,o,a,s){const u=r?n-r.length:n,c={type:e,value:i,prefix:o,line:a,start:u,end:u+s};return t(null,c),c}function o(e){t(e._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(t){let e=!1;const r=t.replace(ve,((t,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let t=Number.parseInt(n,16);return t<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((t-=65536)>>10),56320+(1023&t))}return i in ge?ge[i]:(e=!0,"")}));return e?null:r}_parseLiteral(t){if(t.length>=3){const e=t.match(/^(?:"""|"|'''|'|)/)[0],r=e.length;let n=Math.max(this._literalClosingPos,r);for(;(n=t.indexOf(e,n))>0;){let e=0;for(;"\\"===t[n-e-1];)e++;if(e%2==0){const e=t.substring(r,n),i=e.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(e),matchLength:o}}n++}this._literalClosingPos=t.length-r+1}return{value:"",matchLength:0}}_syntaxError(t){this._input=null;const e=new Error(`Unexpected "${t}" on line ${this._line}.`);return e.context={token:void 0,line:this._line,previousToken:this.previousToken},e}_readStartingBom(t){return t.startsWith("\ufeff")?t.substr(1):t}tokenize(t,e){if(this._line=1,"string"==typeof t){if(this._input=this._readStartingBom(t),"function"!=typeof e){const t=[];let e;if(this._tokenizeToEnd(((r,n)=>r?e=r:t.push(n)),!0),e)throw e;return t}ce()((()=>this._tokenizeToEnd(e,!0)))}else this._pendingBuffer=null,"function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",(t=>{null!==this._input&&0!==t.length&&(this._pendingBuffer&&(t=de.concat([this._pendingBuffer,t]),this._pendingBuffer=null),128&t[t.length-1]?this._pendingBuffer=t:(void 0===this._input?this._input=this._readStartingBom("string"==typeof t?t:t.toString()):this._input+=t,this._tokenizeToEnd(e,!1)))})),t.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(e,!0)})),t.on("error",e)}}const{rdf:xe,xsd:_e}=pe;let ke,Te=0;const Ee={namedNode:function(t){return new je(t)},blankNode:function(t){return new Se(t||"n3-"+Te++)},variable:function(t){return new Re(t)},literal:function(t,e){if("string"==typeof e)return new Ne(`"${t}"@${e.toLowerCase()}`);let r=e?e.value:"";return""===r&&("boolean"==typeof t?r=_e.boolean:"number"==typeof t&&(Number.isFinite(t)?r=Number.isInteger(t)?_e.integer:_e.double:(r=_e.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")))),""===r||r===_e.string?new Ne(`"${t}"`):new Ne(`"${t}"^^${r}`)},defaultGraph:function(){return ke},quad:Ce,triple:Ce};class Oe{constructor(t){this.id=t}get value(){return this.id}equals(t){return t instanceof Oe?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class je extends Oe{get termType(){return"NamedNode"}}class Ne extends Oe{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const t=this.id;let e=t.lastIndexOf('"')+1;return e<t.length&&"@"===t[e++]?t.substr(e).toLowerCase():""}get datatype(){return new je(this.datatypeString)}get datatypeString(){const t=this.id,e=t.lastIndexOf('"')+1,r=e<t.length?t[e]:"";return"^"===r?t.substr(e+2):"@"!==r?_e.string:xe.langString}equals(t){return t instanceof Ne?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class Se extends Oe{constructor(t){super(`_:${t}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Re extends Oe{constructor(t){super(`?${t}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}ke=new class extends Oe{constructor(){return super(""),ke||this}get termType(){return"DefaultGraph"}equals(t){return this===t||!!t&&this.termType===t.termType}};class Ie extends Oe{constructor(t,e,r,n){super(""),this._subject=t,this._predicate=e,this._object=r,this._graph=n||ke}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(t){return!!t&&this._subject.equals(t.subject)&&this._predicate.equals(t.predicate)&&this._object.equals(t.object)&&this._graph.equals(t.graph)}}function Ce(t,e,r,n){return new Ie(t,e,r,n)}let Pe=0;class Fe{constructor(t){this._contextStack=[],this._graph=null,t=t||{},this._setBase(t.baseIRI),t.factory&&De(this,t.factory);const e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(e),n=/trig/.test(e),i=/triple/.test(e),o=/quad/.test(e),a=this._n3Mode=/n3/.test(e),s=i||o;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||a),this._supportsRDFStar=""===e||/star|\*$/.test(e),s&&(this._resolveRelativeIRI=t=>null),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":t.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=t.lexer||new Ae({lineMode:s,n3:a}),this._explicitQuantifiers=!!t.explicitQuantifiers}static _resetBlankNodePrefix(){Pe=0}_setBase(t){if(t){const e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base="",this._basePath=""}_saveContext(t,e,r,n,i){const o=this._n3Mode;this._contextStack.push({type:t,subject:r,predicate:n,object:i,graph:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(t,e){const r=this._contextStack.pop();if(!r||r.type!==t)return this._error(`Unexpected ${e.type}`,e);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(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(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(t)}}_readEntity(t,e){let r;switch(t.type){case"IRI":case"typeIRI":const e=this._resolveIRI(t.value);if(null===e)return this._error("Invalid IRI",t);r=this._namedNode(e);break;case"type":case"prefixed":const n=this._prefixes[t.prefix];if(void 0===n)return this._error(`Undefined prefix "${t.prefix}:"`,t);r=this._namedNode(n+t.value);break;case"blank":r=this._blankNode(this._prefixes[t.prefix]+t.value);break;case"var":r=this._variable(t.value.substr(1));break;default:return this._error(`Expected entity but got ${t.type}`,t)}return!e&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(t){switch(this._predicate=null,t.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",t);case"}":return this._readPunctuation(t);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',t);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',t);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",t);if(0===t.prefix.length)return this._literalValue=t.value,this._completeSubjectLiteral;this._subject=this._literal(t.value,this._namedNode(t.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(t){const e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[t.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${e}`,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",t);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",t);default:if(void 0===(this._predicate=this._readEntity(t)))return}return this._readObject}_readObject(t){switch(t.type){case"literal":if(0===t.prefix.length)return this._literalValue=t.value,this._readDataTypeOrLang;this._object=this._literal(t.value,this._namedNode(t.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",t);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",t);default:if(void 0===(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)}_readGraph(t){return"{"!==t.type?this._error(`Expected graph but got ${t.type}`,t):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))}_readBlankNodeTail(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const e=null===this._predicate;return this._restoreContext("blank",t),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:e?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(t){switch(t.type){case".":case"}":return this._subject=null,this._readPunctuation(t);default:return this._readPredicate(t)}}_readListItem(t){let e=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(t.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=e=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",t),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===t.prefix.length?(this._literalValue=t.value,n=this._readListItemDataTypeOrLang):(e=this._literal(t.value,this._namedNode(t.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",t);default:if(void 0===(e=this._readEntity(t)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===a.predicate?a.subject=r:a.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,e,this._graph)}return n}_readDataTypeOrLang(t){return this._completeObjectLiteral(t,!1)}_readListItemDataTypeOrLang(t){return this._completeObjectLiteral(t,!0)}_completeLiteral(t){let e=this._literal(this._literalValue);switch(t.type){case"type":case"typeIRI":const r=this._readEntity(t);if(void 0===r)return;e=this._literal(this._literalValue,r),t=null;break;case"langcode":e=this._literal(this._literalValue,t.value),t=null}return{token:t,literal:e}}_completeSubjectLiteral(t){return this._subject=this._completeLiteral(t).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(t,e){const r=this._completeLiteral(t);if(r)return this._object=r.literal,e&&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(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",t),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(t){let e,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF* syntax",t);const o=this._predicate,a=this._object;this._subject=this._quad(n,o,a,this.DEFAULTGRAPH),e=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",t);this._subject=null,e=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}if(null!==n){const t=this._predicate,e=this._object;i?this._emit(e,t,n,r):this._emit(n,t,e,r)}return e}_readBlankNodePunctuation(t){let e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,t)}return this._emit(this._subject,this._predicate,this._object,this._graph),e}_readQuadPunctuation(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext}_readPrefix(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)}_readPrefixIRI(t){if("IRI"!==t.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,t);const e=this._readEntity(t);return this._prefixes[this._prefix]=e.value,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation}_readBaseIRI(t){const e="IRI"===t.type&&this._resolveIRI(t.value);return e?(this._setBase(e),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",t)}_readNamedGraphLabel(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}}_readNamedGraphBlankLabel(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext}_readQuantifierList(t){let e;switch(t.type){case"IRI":case"prefixed":if(void 0!==(e=this._readEntity(t,!0)))break;default:return this._error(`Unexpected ${t.type}`,t)}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,e,this.QUANTIFIERS_GRAPH)):this._quantified[e.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(t){return","===t.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(t))}_getPathReader(t){return this._afterPath=t,this._readPath}_readPath(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const e=this._contextStack,r=e.length&&e[e.length-1];if(r&&"item"===r.type){const e=this._subject;this._restoreContext("item",t),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(t)}}_readForwardPath(t){let e,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(e=this._subject,this._subject=n):(e=this._object,this._object=n),this._emit(e,r,n,this._graph),this._readPath}_readBackwardPath(t){const e=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(t)))return null===this._predicate?(n=this._subject,this._subject=e):(n=this._object,this._object=e),this._emit(e,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(t){return">>"!==t.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(t))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,t):this._readRDFStarTail(t)}_readRDFStarTail(t){if(">>"!==t.type)return this._error(`Expected >> but got ${t.type}`,t);const e=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",t),null===this._subject?(this._subject=e,this._readPredicate):(this._object=e,this._getContextEndReader())}_getContextEndReader(){const t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(t,e,r,n){this._callback(null,this._quad(t,e,r,n||this.DEFAULTGRAPH))}_error(t,e){const r=new Error(`${t} on line ${e.line}.`);r.context={token:e,line:e.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=Ue}_resolveIRI(t){return/^[a-z][a-z0-9+.-]*:/i.test(t)?t:this._resolveRelativeIRI(t)}_resolveRelativeIRI(t){if(!t.length)return this._base;switch(t[0]){case"#":return this._base+t;case"?":return this._base.replace(/(?:\?.*)?$/,t);case"/":return("/"===t[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(t);default:return/^[^/:]*:/.test(t)?null:this._removeDotSegments(this._basePath+t)}}_removeDotSegments(t){if(!/(^|\/)\.\.?($|[/#?])/.test(t))return t;const e=t.length;let r="",n=-1,i=-1,o=0,a="/";for(;n<e;){switch(a){case":":if(i<0&&"/"===t[++n]&&"/"===t[++n])for(;(i=n+1)<e&&"/"!==t[i];)n=i;break;case"?":case"#":n=e;break;case"/":if("."===t[n+1])switch(a=t[1+ ++n],a){case"/":r+=t.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+t.substring(o,n)+t.substr(n+1);case".":if(a=t[1+ ++n],void 0===a||"/"===a||"?"===a||"#"===a){if(r+=t.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==a)return`${r}/${t.substr(n+1)}`;o=n+1}}}a=t[++n]}return r+t.substring(o)}parse(t,e,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Pe++}_`,this._prefixCallback=r||Ue,this._inversePredicate=!1,this._quantified=Object.create(null),!e){const e=[];let r;if(this._callback=(t,n)=>{t?r=t:n&&e.push(n)},this._lexer.tokenize(t).every((t=>this._readCallback=this._readCallback(t))),r)throw r;return e}this._callback=e,this._lexer.tokenize(t,((t,e)=>{null!==t?(this._callback(t),this._callback=Ue):this._readCallback&&(this._readCallback=this._readCallback(e))}))}}function Ue(){}function De(t,e){const r=e.namedNode;t._namedNode=r,t._blankNode=e.blankNode,t._literal=e.literal,t._variable=e.variable,t._quad=e.quad,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=r(pe.rdf.first),t.RDF_REST=r(pe.rdf.rest),t.RDF_NIL=r(pe.rdf.nil),t.N3_FORALL=r(pe.r.forAll),t.N3_FORSOME=r(pe.r.forSome),t.ABBREVIATIONS={a:r(pe.rdf.type),"=":r(pe.owl.sameAs),">":r(pe.log.implies)},t.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}De(Fe.prototype,Ee);var Le=s(6357);if(void 0===Me)var Me={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};var Be=function(){function r(t,n){(0,e.A)(this,r),this.options=n||{},this.kb=t,this.target=n.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()}return(0,t.A)(r,[{key:"addTriple",value:function(t,e,r,n){var i,o,a,s;i=void 0===e?G.namedNode(this.options.base):this.toRDFNodeObject(e),a=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),s=G.namedNode(this.options.base),this.kb.add(i,a,o,s)}},{key:"ancestorPath",value:function(t){for(var e="";t&&t.nodeType!==Me.DOCUMENT_NODE;)e="/"+t.localName+e,t=t.parentNode;return e}},{key:"copyMappings",value:function(t){var e={};for(var r in t)e[r]=t[r];return e}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(t){for(var e=0;e<r.dateTimeTypes.length;e++){var n=r.dateTimeTypes[e].pattern.exec(t);if(n&&n[0].length===t.length)return r.dateTimeTypes[e].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(t,e){}},{key:"parseCURIE",value:function(t,e,n){var i,o=t.indexOf(":");if(o>=0){var a=t.substring(0,o);if(""===a)return(i=e[""])?i+t.substring(o+1):null;if("_"===a)return"_:"+t.substring(o+1);if(r.NCNAME.test(a)&&(i=e[a]))return i+t.substring(o+1)}return null}},{key:"parseCURIEOrURI",value:function(t,e,r){return this.parseCURIE(t,e,r)||this.resolveAndNormalize(r,t)}},{key:"parsePredicate",value:function(t,e,r,n,i,o){if(""===t)return null;var a=this.parseTermOrCURIEOrAbsURI(t,e,o?null:r,n,i);return a&&0===a.indexOf("_:")?null:a}},{key:"parsePrefixMappings",value:function(t,e){for(var r=this.tokenize(t),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(e[n]=this.options.base?M.join(r[i],this.options.base):r[i],n=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(t,e,r){return"["===(t=this.trim(t)).charAt(0)&&"]"===t.charAt(t.length-1)?0===(t=(t=t.substring(1,t.length-1)).trim(t)).length?null:"_:"===t?this.theOne:this.parseCURIE(t,e,r):this.parseCURIEOrURI(t,e,r)}},{key:"parseTermOrCURIEOrAbsURI",value:function(t,e,r,n,i){t=this.trim(t);var o=this.parseCURIE(t,n,i);if(o)return o;if(r){if(e&&!this.absURIRE.exec(t))return e+t;var a=r[t];if(a)return a;if(a=r[t.toLowerCase()])return a}return this.absURIRE.exec(t)?this.resolveAndNormalize(i,t):null}},{key:"parseTermOrCURIEOrURI",value:function(t,e,r,n,i){t=this.trim(t);var o=this.parseCURIE(t,n,i);if(o)return o;var a=r[t];return a||((a=r[t.toLowerCase()])?a:e&&!this.absURIRE.exec(t)?e+t:this.resolveAndNormalize(i,t))}},{key:"parseURI",value:function(t){return t}},{key:"process",value:function(t,e){var n;e=e||{},t.nodeType===Me.DOCUMENT_NODE?(t.baseURI&&!e.baseURI&&(e.baseURI=t.baseURI),n=t.baseURI,(t=t.documentElement).baseURI||(t.baseURI=n),this.setContext(t)):t.parentNode.nodeType===Me.DOCUMENT_NODE&&this.setContext(t);var i=[],o=function(t){if(!t&&e&&e.baseURI)return e.baseURI;var r=t.indexOf("#");return r>=0&&(t=t.substring(0,r)),e&&e.baseURIMap&&(t=e.baseURIMap(t)),t};for(i.push({current:t,context:this.push(null,o(t.baseURI))});i.length>0;){var a=i.shift();if(a.parent){if(a.context.parent&&a.context.parent.listMapping===a.listMapping)continue;for(var s in a.listMapping){var u=a.listMapping[s];if(0!==u.length){for(var c=[],l=0;l<u.length;l++)c.push(this.newBlankNode());for(var h=0;h<c.length;h++)this.addTriple(a.parent,c[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",u[h]),this.addTriple(a.parent,c[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:r.objectURI,value:h+1<c.length?c[h+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(a.parent,a.subject,s,{type:r.objectURI,value:c[0]})}else this.addTriple(a.parent,a.subject,s,{type:r.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var f=a.current,p=a.context,d=!1,y=null,v=null,g=null,m=p.prefixes,b=!1,w=[],A=p.listMapping,x=!p.parent,_=p.language,k=p.vocabulary;n=this.parseURI(o(f.baseURI)),f.item=null;var T=f.getAttributeNode("vocab");if(T){var E=this.trim(T.value);if(E.length>0){k=E;var O=n.spec;this.addTriple(f,O,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:r.objectURI,value:k})}else k=this.vocabulary}for(var j=0;j<f.attributes.length;j++){var N=f.attributes[j];if("x"===N.nodeName.charAt(0)&&0===N.nodeName.indexOf("xmlns:")){b||(m=this.copyMappings(m),b=!0);var S=N.nodeName.substring(6),R=r.trim(N.value);m[S]=this.options.base?M.join(R,this.options.base):R}}var I=f.getAttributeNode("prefix");I&&(b||(m=this.copyMappings(m),b=!0),this.parsePrefixMappings(I.value,m));for(var C=null,P=0;!C&&P<this.langAttributes.length;P++)C=f.getAttributeNodeNS(this.langAttributes[P].namespaceURI,this.langAttributes[P].localName);if(C){var F=r.trim(C.value);_=F.length>0?F:null}var U,D,L=f.getAttributeNode("rel"),B=f.getAttributeNode("rev"),q=f.getAttributeNode("typeof"),H=f.getAttributeNode("property"),$=f.getAttributeNode("datatype"),z=this.inHTMLMode?f.getAttributeNode("datetime"):null,X=f.getAttributeNode("content"),G=f.getAttributeNode("about"),V=f.getAttributeNode("src"),W=f.getAttributeNode("resource"),Q=f.getAttributeNode("href"),Y=f.getAttributeNode("inlist"),J=[];if(L){D=this.tokenize(L.value);for(var Z=0;Z<D.length;Z++)(U=this.parsePredicate(D[Z],k,p.terms,m,n,this.inHTMLMode&&null!==H))&&J.push(U)}var K=[];if(B){D=this.tokenize(B.value);for(var tt=0;tt<D.length;tt++)(U=this.parsePredicate(D[tt],k,p.terms,m,n,this.inHTMLMode&&H))&&K.push(U)}if(this.inHTMLMode&&(L||B)&&H&&(0===J.length&&(L=null),0===K.length&&(B=null)),L||B?(G&&(y=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),q&&(g=y),y||(f.parentNode.nodeType===Me.DOCUMENT_NODE?y=o(f.baseURI):p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject)),W&&(v=this.parseSafeCURIEOrCURIEOrURI(W.value,m,n)),v||(Q?v=this.resolveAndNormalize(n,encodeURI(Q.value)):V?v=this.resolveAndNormalize(n,encodeURI(V.value)):!q||G||this.inXHTMLMode&&("head"===f.localName||"body"===f.localName)||(v=this.newBlankNode())),!q||G||!this.inXHTMLMode||"head"!==f.localName&&"body"!==f.localName?q&&!G&&(g=v):g=y):!H||X||$?(G&&(y=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!y&&W&&(y=this.parseSafeCURIEOrCURIEOrURI(W.value,m,n)),!y&&Q&&(y=this.resolveAndNormalize(n,encodeURI(Q.value))),!y&&V&&(y=this.resolveAndNormalize(n,encodeURI(V.value))),y||(f.parentNode.nodeType===Me.DOCUMENT_NODE?y=o(f.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName?q?y=this.newBlankNode():p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject,H||(d=!0)):y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject),q&&(g=y)):(G&&(y=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n),q&&(g=y)),y||f.parentNode.nodeType!==Me.DOCUMENT_NODE?!y&&p.parentObject&&(y=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject):(y=o(f.baseURI),q&&(g=y)),q&&!g&&(W&&(g=this.parseSafeCURIEOrCURIEOrURI(W.value,m,n)),!g&&Q&&(g=this.resolveAndNormalize(n,encodeURI(Q.value))),!g&&V&&(g=this.resolveAndNormalize(n,encodeURI(V.value))),g||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName||(g=y),g||(g=this.newBlankNode()),v=g)),y&&(G||W||g)){var et=y;q&&!G&&!W&&v&&(et=v),this.newSubjectOrigin(f,et)}if(g){D=this.tokenize(q.value);for(var rt=0;rt<D.length;rt++){var nt=this.parseTermOrCURIEOrAbsURI(D[rt],k,p.terms,m,n);nt&&this.addTriple(f,g,r.typeURI,{type:r.objectURI,value:nt})}}if(y&&y!==p.parentObject&&(A={},x=!0),v){if(L&&Y)for(var it=0;it<J.length;it++){var ot=A[J[it]];ot||(ot=[],A[J[it]]=ot),ot.push({type:r.objectURI,value:v})}else if(L)for(var at=0;at<J.length;at++)this.addTriple(f,y,J[at],{type:r.objectURI,value:v});if(B)for(var st=0;st<K.length;st++)this.addTriple(f,v,K[st],{type:r.objectURI,value:y})}else{if(y&&!v&&(L||B)&&(v=this.newBlankNode()),L&&Y)for(var ut=0;ut<J.length;ut++){var ct=A[J[ut]];ct||(ct=[],A[U]=ct),w.push({predicate:J[ut],list:ct})}else if(L)for(var lt=0;lt<J.length;lt++)w.push({predicate:J[lt],forward:!0});if(B)for(var ht=0;ht<K.length;ht++)w.push({predicate:K[ht],forward:!1})}if(H){var ft=null,pt=null;$?(ft=""===$.value?r.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI($.value,k,p.terms,m,n),pt=z&&!X?z.value:ft===r.XMLLiteralURI||ft===r.HTMLLiteralURI?null:X?X.value:f.textContent):X?(ft=r.PlainLiteralURI,pt=X.value):z?(pt=z.value,(ft=r.deriveDateTimeType(pt))||(ft=r.PlainLiteralURI)):L||B||(W&&(pt=this.parseSafeCURIEOrCURIEOrURI(W.value,m,n)),!pt&&Q?pt=this.resolveAndNormalize(n,encodeURI(Q.value)):!pt&&V&&(pt=this.resolveAndNormalize(n,encodeURI(V.value))),pt&&(ft=r.objectURI)),ft||(q&&!G?(ft=r.objectURI,pt=g):(pt=f.textContent,this.inHTMLMode&&"time"===f.localName&&(ft=r.deriveDateTimeType(pt)),ft||(ft=r.PlainLiteralURI))),D=this.tokenize(H.value);for(var dt=0;dt<D.length;dt++){var yt=this.parsePredicate(D[dt],k,p.terms,m,n);if(yt)if(Y){var vt=A[yt];vt||(vt=[],A[yt]=vt),vt.push(ft===r.XMLLiteralURI||ft===r.HTMLLiteralURI?{type:ft,value:f.childNodes}:{type:ft||r.PlainLiteralURI,value:pt,language:_})}else ft===r.XMLLiteralURI||ft===r.HTMLLiteralURI?this.addTriple(f,y,yt,{type:ft,value:f.childNodes}):this.addTriple(f,y,yt,{type:ft||r.PlainLiteralURI,value:pt,language:_})}}if(y&&!d)for(var gt=0;gt<p.incomplete.length;gt++)p.incomplete[gt].list?p.incomplete[gt].list.push({type:r.objectURI,value:y}):p.incomplete[gt].forward?this.addTriple(f,p.subject,p.incomplete[gt].predicate,{type:r.objectURI,value:y}):this.addTriple(f,y,p.incomplete[gt].predicate,{type:r.objectURI,value:p.subject});var mt=null,bt=y;d?((mt=this.push(p,p.subject)).parentObject=o(f.parentNode.baseURI)===p.parentObject?o(f.baseURI):p.parentObject,mt.incomplete=p.incomplete,mt.language=_,mt.prefixes=m,mt.vocabulary=k):((mt=this.push(p,y)).parentObject=v||y||p.subject,mt.prefixes=m,mt.incomplete=w,v&&(bt=v,A={},x=!0),mt.listMapping=A,mt.language=_,mt.vocabulary=k),x&&i.unshift({parent:f,context:p,subject:bt,listMapping:A});for(var wt=f.lastChild;wt;wt=wt.previousSibling)wt.nodeType===Me.ELEMENT_NODE&&i.unshift({current:wt,context:mt})}}this.inHTMLMode&&this.copyProperties();for(var At=0;At<this.finishedHandlers.length;At++)this.finishedHandlers[At](t)}},{key:"push",value:function(t,e){return{parent:t,subject:e||(t?t.subject:null),parentObject:null,incomplete:[],listMapping:t?t.listMapping:{},language:t?t.language:this.language,prefixes:t?t.prefixes:this.target.graph.prefixes,terms:t?t.terms:this.target.graph.terms,vocabulary:t?t.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(t,e){return M.join(e,t)}},{key:"setContext",value:function(t){"html"===t.localName&&"XHTML+RDFa 1.1"===t.getAttribute("version")?this.setXHTMLContext():"html"===t.localName||"http://www.w3.org/1999/xhtml"===t.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?(Le.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()}},{key:"setHTMLContext",value:function(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}},{key:"setInitialContext",value:function(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}},{key:"setXHTMLContext",value:function(){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"}},{key:"setXMLContext",value:function(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}},{key:"tokenize",value:function(t){return this.trim(t).split(/\s+/)}},{key:"toRDFNodeObject",value:function(t){var e=this;if(void 0!==t){if("string"==typeof t)return"_:"===t.substring(0,2)?(void 0===this.blankNodes[t.substring(2)]&&(this.blankNodes[t.substring(2)]=new p(t.substring(2))),this.blankNodes[t.substring(2)]):G.namedNode(t);switch(t.type){case r.objectURI:return"_:"===t.value.substring(0,2)?(void 0===this.blankNodes[t.value.substring(2)]&&(this.blankNodes[t.value.substring(2)]=new p(t.value.substring(2))),this.blankNodes[t.value.substring(2)]):G.namedNode(t.value);case r.PlainLiteralURI:return new w(t.value,t.language||"");case r.XMLLiteralURI:case r.HTMLLiteralURI:var n="";return Object.keys(t.value).forEach((function(r){n+=Q.domToString(t.value[r],e.htmlOptions)})),new w(n,"",new y.A(t.type));default:return new w(t.value,"",new y.A(t.type))}}}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(t,e,n){var i=new r(e,{base:n});t.baseURI||(t.baseURI=n),i.process(t,{baseURI:n})}},{key:"tokenize",value:function(t){return this.trim(t).split(/\s+/)}},{key:"trim",value:function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}])}();Be.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",Be.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",Be.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",Be.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",Be.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",Be.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",Be.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",Be.NCNAME=new RegExp("^"+Be.nameStartChar+Be.nameChar+"*$"),Be.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"}];var qe=Be.parseRDFaDOM,He=function(){function r(t){(0,e.A)(this,r),this.store=t,this.bnodes={},this.why=null,this.reify=!1}return(0,t.A)(r,[{key:"frameFactory",value:function(t,e,n){return{NODE:1,ARC:2,parent:e,parser:t,store:t.store,element:n,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(t,e){e=M.join(e,this.base),this.node=this.store.sym(e),this.nodeType=t},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 t=this.store.sym(M.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(r.ns.RDF+"type"),this.store.sym(r.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(r.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(r.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(r.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(t){this.addSymbol(this.NODE,t),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(t){null!=t?null!=this.parser.bnodes[t]?this.node=this.parser.bnodes[t]:this.node=this.parser.bnodes[t]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(t){t===r.ns.RDF+"li"&&(t=r.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==r.ns.RDF+"langString"?this.node=this.store.literal(t,this.store.sym(this.parent.datatype)):this.node=this.store.literal(t,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}},{key:"getAttributeNodeNS",value:function(t,e,r){var n=null;if(t.getAttributeNodeNS)n=t.getAttributeNodeNS(e,r);else for(var i,o=t.attributes,a=0;a<o.length;++a)if((i=o[a]).namespaceURI===e&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}},{key:"parse",value:function(t,e,n){var i,o=t.childNodes;if(this.cleanParser(),t.nodeType===r.nodeType.DOCUMENT){for(var a=0;a<o.length;a++)if(o[a].nodeType===r.nodeType.ELEMENT){i=o[a];break}}else{if(t.nodeType!==r.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+e+". Halting. ");i=t}this.why=n;var s=this.frameFactory(this);return this.base=e,s.base=e,s.lang=null,this.parseDOM(this.buildFrame(s,i)),!0}},{key:"parseDOM",value:function(t){for(var e,n=function(t){var e="";if(null==t.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+t.localName+" in "+this.base);return t.namespaceURI&&(e+=t.namespaceURI),t.localName?e+=t.localName:t.nodeName&&(t.nodeName.indexOf(":")>=0?e+=t.nodeName.split(":")[1]:e+=t.nodeName),e}.bind(this),i=!0;t.parent;){var o=t.element,a=o.attributes;if(o.nodeType===r.nodeType.TEXT||o.nodeType===r.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(r.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(o.nodeValue);else if(n(o)!==r.ns.RDF+"RDF")if(t.parent&&t.parent.collection&&(t.addCollectionArc(),(t=this.buildFrame(t,t.element)).parent.element=null),t.parent&&t.parent.nodeType&&t.parent.nodeType!==t.ARC){t.addArc(n(o)),this.reify&&(e=this.getAttributeNodeNS(o,r.ns.RDF,"ID"))&&(t.rdfid=e.nodeValue,o.removeAttributeNode(e));var s=this.getAttributeNodeNS(o,r.ns.RDF,"parseType"),u=this.getAttributeNodeNS(o,r.ns.RDF,"datatype");if(u&&(t.datatype=u.nodeValue,o.removeAttributeNode(u)),s){var c=s.nodeValue;"Literal"===c?(t.datatype=r.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(o.innerHTML||o.childNodes),i=!1):"Resource"===c?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===c&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),o.removeAttributeNode(s)}if(0!==a.length){var l=this.getAttributeNodeNS(o,r.ns.RDF,"resource"),h=this.getAttributeNodeNS(o,r.ns.RDF,"nodeID");t=this.buildFrame(t),l?(t.addNode(l.nodeValue),o.removeAttributeNode(l)):h?(t.addBNode(h.nodeValue),o.removeAttributeNode(h)):t.addBNode();for(var f=a.length-1;f>=0;f--){var p=this.buildFrame(t);p.addArc(n(a[f])),n(a[f])===r.ns.RDF+"type"?this.buildFrame(p).addNode(a[f].nodeValue):this.buildFrame(p).addLiteral(a[f].nodeValue)}}else 0===o.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var d=this.getAttributeNodeNS(o,r.ns.RDF,"about");if(e=this.getAttributeNodeNS(o,r.ns.RDF,"ID"),d&&e)throw new Error("RDFParser: "+o.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!d&&e)t.addNode("#"+e.nodeValue),o.removeAttributeNode(e);else if(null==d&&null==e){var y=this.getAttributeNodeNS(o,r.ns.RDF,"nodeID");y?(t.addBNode(y.nodeValue),o.removeAttributeNode(y)):t.addBNode()}else t.addNode(d.nodeValue),o.removeAttributeNode(d);var v=this.getAttributeNodeNS(o,r.ns.RDF,"type");r.ns.RDF+"Description"!==n(o)&&(v={nodeValue:n(o)}),null!=v&&(this.store.add(t.node,this.store.sym(r.ns.RDF+"type"),this.store.sym(M.join(v.nodeValue,t.base)),this.why),v.nodeName&&o.removeAttributeNode(v));for(var g=a.length-1;g>=0;g--)this.store.add(t.node,this.store.sym(n(a[g])),this.store.literal(a[g].nodeValue,t.lang),this.why)}for(o=t.element;t.parent;){for(var m=t;null==o;)o=(t=t.parent).element;var b=o.childNodes&&o.childNodes[t.lastChild];if(b&&i){if((b.nodeType===r.nodeType.ELEMENT||b.nodeType===r.nodeType.TEXT||b.nodeType===r.nodeType.CDATA_SECTION)&&(b.nodeType!==r.nodeType.TEXT&&b.nodeType!==r.nodeType.CDATA_SECTION||1===o.childNodes.length)){t.lastChild++,t=this.buildFrame(m,o.childNodes[t.lastChild-1]);break}t.lastChild++}else{if(t.terminateFrame(),!(t=t.parent))break;o=t.element,i=!0}}}}},{key:"cleanParser",value:function(){this.bnodes={},this.why=null}},{key:"buildFrame",value:function(t,e){var n=this.frameFactory(this,t,e);if(t&&(n.base=t.base,n.lang=t.lang),!e||e.nodeType===r.nodeType.TEXT||e.nodeType===r.nodeType.CDATA_SECTION)return n;var i=e.attributes,o=e.getAttributeNode("xml:base");null!=o&&(n.base=o.nodeValue,e.removeAttribute("xml:base"));var a=e.getAttributeNode("xml:lang");null!=a&&(n.lang=a.nodeValue,e.removeAttribute("xml:lang"));for(var s=i.length-1;s>=0;s--)if("xml"===i[s].nodeName.substr(0,3)){if("xmlns:"===i[s].name.slice(0,6)){var u=i[s].nodeValue;this.base&&(u=M.join(u,this.base)),this.store.setPrefixForURI(i[s].name.slice(6),u)}e.removeAttributeNode(i[s])}return n}}])}();function $e(t,e,r){var n,i,o,a=["INSERT","DELETE","WHERE"],s=W("http://www.w3.org/ns/pim/patch#"),u=Yt(e,e,r,r,null,null,"",null),c={},l=function(t,e,r,n,i){return"Line "+(e+1)+" of <"+t+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=e.sym(r+"#query");for(c.query=h;;){if((i=u.skipSpace(t,n))<0)return c;if(";"===t[i]){if((n=u.skipSpace(t,i+1))<0)return c;i=n}var f=!1;for(o=0;o<a.length;o++){var p=a[o];if(t.slice(i,i+p.length)===p){if((n=u.skipSpace(t,i+p.length))<0)throw l(u._thisDoc,u.lines,t,i+p.length,"found EOF, needed {...} after "+p);if(("INSERT"===p||"DELETE"===p)&&"DATA"===t.slice(n,n+4)){if((i=u.skipSpace(t,n+4))<0)throw l(u._thisDoc,u.lines,t,n+4,"needed {...} after INSERT DATA "+p);n=i}var d=[];if((i=u.node(t,n,d))<0)throw l(u._thisDoc,u.lines,t,n,"bad syntax or EOF in {...} after "+p);c[p.toLowerCase()]=d[0],e.add(h,s(p.toLowerCase()),d[0]),f=!0,n=i}}if(!f&&"@prefix"===t.slice(i,i+7)){if((n=u.directive(t,i))<0)throw l(u._thisDoc,u.lines,t,n,"bad syntax or EOF after @prefix ");n=u.checkDot(t,n),f=!0}if(!f)throw l(u._thisDoc,u.lines,t,i,"Unknown syntax at start of statememt: '"+t.slice(i).slice(0,20)+"'")}}function ze(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=(n=n||l.sT).split(";")[0];try{if(n===l.ny||n===l.sT)Yt(e,e,r,r,null,null,"",null).loadBuf(t),a();else if(n===l.JG)new He(e).parse(Q.parseXML(t),r,e.sym(r)),a();else if(n===l.H)qe(Q.parseXML(t,{contentType:l.H}),e,r),a();else if(n===l.lc)qe(Q.parseXML(t,{contentType:l.lc}),e,r),a();else if(n===l.K9||n===l.Fn)$e(t,e,r),a();else if(n===l.i2)ie(t,e,r,a);else{if(n!==l._0&&n!==l.BR)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var o=new Fe({factory:re});!function(t,r){try{o.parse(r,s)}catch(t){i(t,e)}}(null,t)}}catch(t){!function(t){if(n!==l.i2||n!==l._0||n!==l.BR){if(!i){var o=new Error(t+" while trying to parse <"+r+"> as "+n);throw o.cause=t,o}i(t,e)}}(t)}function a(){i&&i(null,e)}function s(t,r){r?e.add(r.subject,r.predicate,r.object,r.graph):i(t,e)}ze.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,o.A)(He,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,o.A)(He,"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 Xe=s(1147),Ge=s.n(Xe),Ve=s(362),We=s(6357);function Qe(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ye(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,Je()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function Je(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Je=function(){return!!t})()}var Ze={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},Ke={rdf:l.JG,owl:l.JG,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},tr=function(t){return{link:W("http://www.w3.org/2007/ont/link#",t),http:W("http://www.w3.org/2007/ont/http#",t),httph:W("http://www.w3.org/2007/ont/httph#",t),rdf:W("http://www.w3.org/1999/02/22-rdf-syntax-ns#",t),rdfs:W("http://www.w3.org/2000/01/rdf-schema#",t),dc:W("http://purl.org/dc/elements/1.1/",t),ldp:W("http://www.w3.org/ns/ldp#",t)}},er=tr(),rr=(0,t.A)((function t(r,n){(0,e.A)(this,t),(0,o.A)(this,"response",void 0),(0,o.A)(this,"dom",void 0),this.response=r,this.dom=n}));(0,o.A)(rr,"pattern",void 0);var nr=function(r){function n(){return(0,e.A)(this,n),Ye(this,n,arguments)}return(0,i.A)(n,r),(0,t.A)(n,[{key:"parse",value:function(t,e,r){var n=t.store;if(this.dom||(this.dom=Q.parseXML(e)),"parsererror"===this.dom.documentElement.nodeName)return t.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");var i=new He(n);try{i.parse(this.dom,r.original.value,r.original)}catch(e){return t.failFetch(r,"Syntax error parsing RDF/XML! "+e,"parse_error")}return r.noMeta||n.add(r.original,er.rdf("type"),er.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(t){t.mediatypes[l.JG]={q:.9}}}])}(rr);nr.pattern=new RegExp("application/rdf\\+xml");var ir=function(r){function n(){return(0,e.A)(this,n),Ye(this,n,arguments)}return(0,i.A)(n,r),(0,t.A)(n,[{key:"parse",value:function(t,e,r){var n,i;this.dom||(this.dom=Q.parseXML(e));var o=t.store,a=this.dom.getElementsByTagName("title");a.length>0&&o.add(r.resource,er.dc("title"),o.rdfFactory.literal(a[0].textContent),r.resource);for(var s=this.dom.getElementsByTagName("link"),u=s.length-1;u>=0;u--)i=!1,(n=s[u].getAttribute("rel"))||(n=s[u].getAttribute("rev"),i=!0),n&&t.linkData(r.original,n,s[u].getAttribute("href"),r.resource,i);for(var c=this.dom.getElementsByTagName("script"),l=0;l<c.length;l++){var h=c[l].getAttribute("type");Ze[h]&&(ze(c[l].textContent,o,r.original.value,h),ze(c[l].textContent,o,r.original.value,h))}if(r.noMeta||o.add(r.resource,er.rdf("type"),er.link("WebPage"),t.appNode),!r.noRDFa&&qe)try{qe(this.dom,o,r.original.value)}catch(e){var f="Error trying to parse "+r.resource+" as RDFa:\n"+e+":\n"+e.stack;return t.failFetch(r,f,"parse_error")}return t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(t){t.mediatypes[l.H]={}}}])}(rr);ir.pattern=new RegExp("application/xhtml");var or=function(r){function n(){return(0,e.A)(this,n),Ye(this,n,arguments)}return(0,i.A)(n,r),(0,t.A)(n,[{key:"parse",value:function(t,e,r){for(var i=Q.parseXML(e),o=0;o<i.childNodes.length;o++){var a=i.childNodes[o];if(n.isElement(a)){var s=a.namespaceURI;if(s&&s===s.rdf)return t.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new nr(this.response,i).parse(t,e,r);break}}if(i.doctype&&"html"===i.doctype.name&&i.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&i.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new ir(this.response,i).parse(t,e,r);var u=i.getElementsByTagName("html")[0];if(u){var c=u.getAttribute("xmlns");if(c&&c.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return t.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new ir(this.response,i).parse(t,e,r)}return t.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+e.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/xml"]={q:.5},t.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(t){return t.nodeType===Node.ELEMENT_NODE}}])}(rr);or.pattern=new RegExp("(text|application)/(.*)xml");var ar=function(r){function n(){return(0,e.A)(this,n),Ye(this,n,arguments)}return(0,i.A)(n,r),(0,t.A)(n,[{key:"parse",value:function(t,e,r){var n=t.store;if(hr(e))return t.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new ir(this.response).parse(t,e,r);if(function(t){var e=t.indexOf("<!DOCTYPE html"),r=t.indexOf(">");return!(-1===e||-1===r||e>r)&&-1!==t.substr(e,r-e).indexOf("XHTML")}(e))return t.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new ir(this.response).parse(t,e,r);if(function(t){return!!t.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(e))return t.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new ir(this.response).parse(t,e,r);var i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(e);return i&&n.add(r.resource,er.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,er.rdf("type"),er.link("WebPage"),t.appNode),t.addStatus(r.req,"non-XML HTML document, not parsed for data."),t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(t){t.mediatypes["text/html"]={q:.9}}}])}(rr);ar.pattern=new RegExp("text/html");var sr=function(r){function n(){return(0,e.A)(this,n),Ye(this,n,arguments)}return(0,i.A)(n,r),(0,t.A)(n,[{key:"parse",value:function(t,e,r,n){var i=t.store;return new Promise((function(o,a){try{ie(e,i,r.original.value,(function(){o(t.doneFetch(r,n))}))}catch(e){var s="Error trying to parse "+r.resource+" as JSON-LD:\n"+e;o(t.failFetch(r,s,"parse_error",n))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(t){t.mediatypes["application/ld+json"]={q:.9}}}])}(rr);sr.pattern=/application\/ld\+json/;var ur=function(r){function n(){return(0,e.A)(this,n),Ye(this,n,arguments)}return(0,i.A)(n,r),(0,t.A)(n,[{key:"parse",value:function(t,e,r){return hr(e)?(t.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 or(this.response).parse(t,e,r)):e.slice(0,500).match(/xmlns:/)?(t.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new or(this.response).parse(t,e,r)):(t.addStatus(r.req,"Plain text document, no known RDF semantics."),t.doneFetch(r,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(t){t.mediatypes["text/plain"]={q:.5}}}])}(rr);ur.pattern=new RegExp("text/plain");var cr=function(r){function n(){return(0,e.A)(this,n),Ye(this,n,arguments)}return(0,i.A)(n,r),(0,t.A)(n,[{key:"parse",value:function(t,e,r,n){var i=t.store,o=Yt(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(e)}catch(e){var a="Error trying to parse "+r.resource+" as Notation3:\n"+e;return t.failFetch(r,a,"parse_error",n)}return t.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),t.store.add(r.original,er.rdf("type"),er.link("RDFDocument"),t.appNode),t.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(t){t.mediatypes["text/n3"]={q:"1.0"},t.mediatypes["text/turtle"]={q:1}}}])}(rr);cr.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var lr={RDFXMLHandler:nr,XHTMLHandler:ir,XMLHandler:or,HTMLHandler:ar,TextHandler:ur,N3Handler:cr,JsonLdHandler:sr};function hr(t){return!!t.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var fr=function(){function r(t){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,e.A)(this,r),(0,o.A)(this,"store",void 0),(0,o.A)(this,"timeout",void 0),(0,o.A)(this,"_fetch",void 0),(0,o.A)(this,"mediatypes",void 0),(0,o.A)(this,"appNode",void 0),(0,o.A)(this,"requested",void 0),(0,o.A)(this,"timeouts",void 0),(0,o.A)(this,"redirectedTo",void 0),(0,o.A)(this,"fetchQueue",void 0),(0,o.A)(this,"fetchCallbacks",void 0),(0,o.A)(this,"nonexistent",void 0),(0,o.A)(this,"lookedUp",void 0),(0,o.A)(this,"handlers",void 0),(0,o.A)(this,"ns",void 0),(0,o.A)(this,"fireCallbacks",void 0),this.store=t||new Et,this.ns=tr(this.store.rdfFactory),this.timeout=i.timeout||3e4,this._fetch=i.fetch||void 0!==s.g&&(s.g.solidFetcher||s.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||Ge(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.sym("chrome://TheCurrentSession"),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}},Q.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(i.handlers||lr).map((function(t){return n.addHandler(lr[t])}))}return(0,t.A)(r,[{key:"load",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},r),t instanceof Array)return Promise.all(t.map((function(t){return e.load(t,Object.assign({},r))})));var n=t,i=(0,Ve.E)(n);i=i.split("#")[0],r=this.initFetchOptions(i,r);var o,a=this.appNode,s=this.store,u=s.statementsMatching(void 0,this.ns.link("requestedURI"),s.sym(i),a).map((function(t){return t.subject})),c=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return Qe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Qe(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(u);try{for(c.s();!(o=c.n()).done;){var l=o.value,h=s.any(l,this.ns.link("response"),null,a);if(null!=h){var f=s.statementsMatching(h,this.ns.link("outOfDate"),!0,a);s.remove(f),r.force=!0,r.clearPreviousData=!0}}}catch(t){c.e(t)}finally{c.f()}var p=this.initFetchOptions(i,r);return this.pendingFetchPromise(i,p.baseURI,p)}},{key:"pendingFetchPromise",value:(i=N(R().mark((function t(e,r,n){var i,o=this;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(t.t0=!n.force,!t.t0){t.next=5;break}return t.next=4,this.fetchQueue[r];case 4:t.t0=t.sent;case 5:if(!t.t0){t.next=9;break}i=this.fetchQueue[r],t.next=12;break;case 9:i=Promise.race([this.setRequestTimeout(e,n),this.fetchUri(e,n)]),this.fetchQueue[r]=i,this.cleanupFetchRequest(r,void 0,this.timeout);case 12:return t.abrupt("return",i.then((function(t){return e in o.timeouts&&(o.timeouts[e].forEach(clearTimeout),delete o.timeouts[e]),t})));case 13:case"end":return t.stop()}}),t,this)}))),function(t,e,r){return i.apply(this,arguments)})},{key:"cleanupFetchRequest",value:function(t,e,r){var n=this;void 0!==e&&We.warn("_options is deprecated"),this.timeouts[t]=(this.timeouts[t]||[]).concat(setTimeout((function(){n.isPending(t)||delete n.fetchQueue[t]}),r))}},{key:"initFetchOptions",value:function(t,e){var n=this.store;!e.method||"GET"===e.method.toUpperCase()||(e.force=!0),e.resource=n.rdfFactory.namedNode(t),e.baseURI=e.baseURI||t,e.original=n.rdfFactory.namedNode(e.baseURI),e.req=n.bnode(),e.headers=e.headers||new Xe.Headers,e.contentType&&(e.headers["content-type"]=e.contentType),e.force&&(e.cache="no-cache");var i=this.acceptString();e.headers.accept=i;var o=r.offlineOverride(t);e.requestedURI=o,r.setCredentials(o,e);var a=r.proxyIfNecessary(o);return o!==a&&(e.proxyUsed=!0),e.actualProxyURI=a,e}},{key:"fetchUri",value:function(t,e){var n=this;if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(r.unsupportedProtocol(t))return this.failFetch(e,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(t);if(e.force)delete this.nonexistent[t];else{if("fetched"===i)return Promise.resolve(this.doneFetch(e,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===i&&404===this.requested[t]){var o="Previously failed: "+this.requested[t],a={url:t,status:this.requested[t],statusText:o,responseText:o,headers:new Xe.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(e,o,this.requested[t],a)}}this.fireCallbacks("request",[t]),this.requested[t]=!0,e.noMeta||this.saveRequestMetadata(t,e);var s=e.actualProxyURI;return this._fetch(s,e).then((function(r){return n.handleResponse(r,t,e)}),(function(r){var i={url:s,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new Xe.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return n.handleError(i,t,e)}))}},{key:"nowOrWhenFetched",value:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,Ve.E)(t);"function"==typeof e?r=e:void 0===e||((0,v.Y2)(e)?n.referringTerm=e:n=e),this.load(i,n).then((function(t){if(r)if(t)if(t.ok)r(!0,"OK",t);else{var e="HTTP error: Status "+t.status+" ("+t.statusText+")";t.responseText&&(e+=" "+t.responseText),r(!1,e,t)}else r(!1,"@@ nowOrWhenFetched: no response object!")}),(function(t){var e=t.message||t.statusText;e="Failed to load <"+i+"> "+e,t.response&&t.response.status&&(e+=" status: "+t.response.status),r(!1,e,t.response)}))}},{key:"addStatus",value:function(t,e){var r=new Date;e="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+e;var n=this.store,i=n.the(t,this.ns.link("status"));(0,v.P3)(i)?i.append(n.rdfFactory.literal(e)):V.A.warn("web.js: No list to add to: "+i+","+e)}},{key:"failFetch",value:function(t,e,r,n){this.addStatus(t.req,e),t.noMeta||this.store.add(t.original,this.ns.link("error"),this.store.rdfFactory.literal(e));var i=(t.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(t.resource.equals(t.original),this.requested[M.docpart(t.original.value)]=r,this.fireCallbacks("fail",[t.original.value,e]));var o=new Error("Fetcher: "+e);return o.status=r,o.statusText=e,o.response=n,Promise.reject(o)}},{key:"linkData",value:function(t,e,r,n,i){if(r){var o,a=this.store,s=a.rdfFactory.namedNode(M.join(r,t.value));if("alternate"===e||"seeAlso"===e||"meta"===e||"describedby"===e){if(s.value===t.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===e?a.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):a.rdfFactory.namedNode(M.join(encodeURIComponent(e),"http://www.iana.org/assignments/link-relations/"));i?a.add(s,o,t,n):a.add(t,o,s,n)}}},{key:"parseLinkHeader",value:function(t,e,r){if(t){var n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=t.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(var o=0;o<i.length;o++){var a=i[o].split(">"),s=a[0].substring(1),u=a[1].match(n);if(null==u)return;for(var c=0;c<u.length;c++){var l=u[c].split("=")[1].replace(/["']/g,"");this.linkData(e,l,s,r)}}}}},{key:"doneFetch",value:function(t,e){return this.addStatus(t.req,"Done."),this.requested[t.original.value]="done",this.fireCallbacks("done",[t.original.value]),e.req=t.req,e}},{key:"nowKnownAs",value:function(t,e){this.lookedUp[t.value]?this.lookedUp[e.value]||this.lookUpThing(e,t):this.lookedUp[e.value]&&(this.lookedUp[t.value]||this.lookUpThing(t,e))}},{key:"putBack",value:function(t){var e=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,Ve.E)(t),i=new y.A(n).doc();return r.contentType=r["content-type"]||r["Content-Type"]||r.contentType||l.sT,"application/ld+json"===r.contentType?new Promise((function(n,o){nt(i,e.store,i.uri,r.contentType,(function(i,a){i?o(i):(r.data=a,e.webOperation("PUT",t,r).then((function(t){return n(t)})).catch((function(t){return o(t)})))}))})):(r.data=nt(i,this.store,i.value,r.contentType),this.webOperation("PUT",n,r))}},{key:"webCopy",value:function(t,e,r){var n=this;return this.webOperation("GET",t).then((function(t){return n.webOperation("PUT",e,{data:t.responseText,contentType:r})}))}},{key:"delete",value:function(t,e){var r=this;return this.webOperation("DELETE",t,e).then((function(e){return r.requested[t]=404,r.nonexistent[t]=!0,r.unload(r.store.rdfFactory.namedNode(t)),e}))}},{key:"createIfNotExists",value:(n=N(R().mark((function t(e){var r,n,i,o,a=arguments;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:l.sT,n=a.length>2&&void 0!==a[2]?a[2]:"",i=this,t.prev=3,t.next=6,i.load(e);case 6:o=t.sent,t.next=26;break;case 9:if(t.prev=9,t.t0=t.catch(3),404!==t.t0.response.status){t.next=25;break}return t.prev=12,t.next=15,i.webOperation("PUT",e.value,{data:n,contentType:r});case 15:o=t.sent,t.next=21;break;case 18:throw t.prev=18,t.t1=t.catch(12),t.t1;case 21:return delete i.requested[e.value],t.abrupt("return",o);case 25:throw t.t0;case 26:return t.abrupt("return",o);case 27:case"end":return t.stop()}}),t,this,[[3,9],[12,18]])}))),function(t){return n.apply(this,arguments)})},{key:"createContainer",value:function(t,e,r){var n={"content-type":l.sT,link:this.ns.ldp("BasicContainer")+'; rel="type"'};e&&(n.slug=e);var i={headers:n};return r&&(i.body=r),this.webOperation("POST",t,i)}},{key:"invalidateCache",value:function(t){var e=(0,Ve.E)(t),r=this;if(r.fetchQueue&&r.fetchQueue[e]&&(r.fetchQueue[e].PromiseStatus,delete r.fetchQueue[e]),r.requested[e]&&"done"!==r.requested[e]&&"failed"!==r.requested[e]&&404!==r.requested[e]){var n="Rdflib: fetcher: Destructive operation on <".concat(r.requested[e],"> file being fetched! ")+e;We.error(n)}else delete r.requested[e],delete r.nonexistent[e]}},{key:"webOperation",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,Ve.E)(e);n.method=t,n.body=n.data||n.body,n.force=!0;var o=this;if(n.body&&!n.contentType)throw new Error("Web operation sending data must have a defined contentType.");return n.contentType&&(n.headers=n.headers||{},n.headers["content-type"]=n.contentType),r.setCredentials(i,n),new Promise((function(e,r){o._fetch(i,n).then((function(n){if(n.ok)"PUT"!==t&&"PATCH"!==t&&"POST"!==t&&"DELETE"!==t||o.invalidateCache(i),n.text?n.text().then((function(t){n.responseText=t,e(n)})):e(n);else{var a="Web error: "+n.status;n.statusText&&(a+=" ("+n.statusText+")"),a+=" on "+t+" of <"+i+">",n.responseText&&(a+=": "+n.responseText);var s=new Error(a);s.response=n,r(s)}}),(function(e){r(new Error("Fetch error for "+t+" of <"+i+">:"+e))}))}))}},{key:"lookUpThing",value:function(t,e){var r=this,n=this.store.uris(t);return(n=n.map((function(t){return M.docpart(t)}))).forEach((function(t){r.lookedUp[t]=!0})),this.load(n,{referringTerm:e})}},{key:"getHeader",value:function(t,e){for(var r=this.store,n=t.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n)),o=0;o<i.length;o++){var a=i[o];if(void 0!==a){var s=r.any(a,this.ns.link("response"));if(void 0!==s&&r.anyValue(s,this.ns.http("status"))&&r.anyValue(s,this.ns.http("status")).startsWith("2")){var u=r.each(s,this.ns.httph(e.toLowerCase()));return u.length?u.map((function(t){return t.value})):[]}}}}},{key:"saveRequestMetadata",value:function(t,e){var r=e.req,n=this.store,i=e.referringTerm;this.addStatus(e.req,"Accept: "+e.headers.accept),(0,v.Y2)(i)&&n.add(n.rdfFactory.namedNode(t),this.ns.link("requestedBy"),i,this.appNode),e.original&&e.original.value!==t&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(e.original.value),this.appNode);var o=new Date,a="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(a+" Request for "+t),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(t),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(t,e){var r=this,n=this.store,i=n.bnode();return n.add(e.req,this.ns.link("response"),i,this.appNode),n.add(i,this.ns.http("status"),n.rdfFactory.literal(t.status),this.appNode),n.add(i,this.ns.http("statusText"),n.rdfFactory.literal(t.statusText),this.appNode),t.headers.forEach((function(t,o){n.add(i,r.ns.httph(o),r.store.rdfFactory.literal(t),r.appNode),"content-type"===o&&n.add(e.resource,r.ns.rdf("type"),n.rdfFactory.namedNode(Q.mediaTypeClass(t).value),r.appNode)})),i}},{key:"objectRefresh",value:function(t){var e=this.store.uris(t);if(void 0!==e)for(var r=0;r<e.length;r++)this.refresh(this.store.rdfFactory.namedNode(M.docpart(e[r])))}},{key:"refresh",value:function(t,e){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(t,{force:!0,clearPreviousData:!0},e)}},{key:"refreshIfExpired",value:function(t,e){var r=this.getHeader(t,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(t,e):e(!0,"Not expired",{})}},{key:"retract",value:function(t){this.store.removeMany(void 0,void 0,void 0,t),t.value&&delete this.requested[M.docpart(t.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(t){return void 0===this.requested[t]?"unrequested":!0===this.requested[t]?"requested":"done"===this.requested[t]?"fetched":"redirected"===this.requested[t]?this.getState(this.redirectedTo[t]):"failed"}},{key:"isPending",value:function(t){return!0===this.requested[t]}},{key:"unload",value:function(t){this.store.removeDocument(t),delete this.requested[t.value]}},{key:"addHandler",value:function(t){this.handlers.push(t),t.register(this)}},{key:"retryNoCredentials",value:function(t,e){e.retriedWithNoCredentials=!0,delete this.requested[t],delete this.fetchQueue[t];var r=Object.assign({},e,{credentials:"omit"});return this.addStatus(e.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(t,r)}},{key:"isCrossSite",value:function(t){if("undefined"==typeof document||!document.location)return!1;var e=M.hostpart,r=""+document.location;return(e(r)&&e(t)&&e(r))!==e(t)}},{key:"handleError",value:function(t,e,n){if(this.isCrossSite(e)){if(n.credentials&&"include"===n.credentials&&!n.retriedWithNoCredentials)return this.retryNoCredentials(e,n);var i=r.crossSiteProxy(e);if(i&&!n.proxyUsed)return this.redirectToProxy(i,n)}var o;return t instanceof Error?o="Fetch error: "+t.message:(o=t.statusText,t.responseText&&(o+=" ".concat(t.responseText))),this.failFetch(n,o,t.status||998,t)}},{key:"addType",value:function(t,e,r,n){var i=e;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"),t,this.appNode)}for(;;){var a=r.any(i,this.ns.link("requestedURI"));if(a&&a.value&&r.add(r.rdfFactory.namedNode(a.value),this.ns.rdf("type"),t,this.appNode),!(i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i)))break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var u=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!u)break;if("301"!==u&&"302"!==u)break}}},{key:"handleResponse",value:function(t,e,r){var n=this,i=this.store,o=t.headers,a=r.req,s=this.saveResponseMetadata(t,r),u=this.normalizedContentType(r,o)||"",c=o.get("content-location");if(0===t.status)return this.handleError(t,e,r);if(t.status>=400)return 404===t.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[e]=!0),this.saveErrorResponse(t,s).then((function(){var e=r.resource+" "+t.statusText;return n.failFetch(r,e,t.status,t)}));var l=null,h=null;if(c&&(h=M.join(c,e))!==e&&(l=h),200===t.status){if(this.addType(this.ns.link("Document"),a,i,e),l&&this.addType(this.ns.link("Document"),a,i,l),r.clearPreviousData)for(var f=i.statementsMatching(void 0,void 0,void 0,r.resource).slice(),p=0;p<f.length;p++)i.removeStatement(f[p]);var d=u.includes("image/")||u.includes("application/pdf");u&&d&&(this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,e),l&&this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,l))}if(c){if(!r.force&&l&&"done"===this.requested[h])return this.doneFetch(r,t);this.requested[h]=!0}this.parseLinkHeader(o.get("link"),r.original,a);var y=this.handlerForContentType(u,t);return y?t.text().then((function(e){return t.responseText=e,y.parse(n,e,r,t)})):(this.addStatus(a,"Fetch over. No data handled."),this.doneFetch(r,t))}},{key:"saveErrorResponse",value:function(t,e){var r=this,n=this.store;return t.text().then((function(t){t.length>10&&n.add(e,r.ns.http("content"),n.rdfFactory.literal(t),e)}))}},{key:"handlerForContentType",value:function(t,e){if(!t)return null;var r=this.handlers.find((function(e){return t.match(e.pattern)}));return r?new r(e):null}},{key:"guessContentType",value:function(t){return Ke[t.split(".").pop()]}},{key:"normalizedContentType",value:function(t,e){if(t.forceContentType)return t.forceContentType;var r=e.get("content-type");if(!r||r.includes("application/octet-stream")){var n=this.guessContentType(t.resource.value);if(n)return n}var i=M.protocol(t.resource.value);return!r&&["file","chrome"].includes(i)?"text/xml":r}},{key:"redirectToProxy",value:function(t,e){var r=this;this.addStatus(e.req,"BLOCKED -> Cross-site Proxy to <"+t+">"),e.proxyUsed=!0;var n=this.store,i=e.req;e.noMeta||(n.add(i,this.ns.link("redirectedTo"),n.rdfFactory.namedNode(t),i),this.addStatus(i,"redirected to new request")),this.requested[e.resource.value]="redirected",this.redirectedTo[e.resource.value]=t;var o=Object.assign({},e);return o.baseURI=e.resource.value,this.fetchUri(t,o).then((function(t){return o.noMeta||n.add(i,r.ns.link("redirectedRequest"),o.req,r.appNode),t}))}},{key:"setRequestTimeout",value:function(t,e){var r=this;return new Promise((function(n){r.timeouts[t]=(r.timeouts[t]||[]).concat(setTimeout((function(){!r.isPending(t)||e.retriedWithNoCredentials||e.proxyUsed||n(r.failFetch(e,"Request to ".concat(t," timed out"),"timeout"))}),r.timeout))}))}},{key:"addFetchCallback",value:function(t,e){this.fetchCallbacks[t]?this.fetchCallbacks[t].push(e):this.fetchCallbacks[t]=[e]}},{key:"acceptString",value:function(){var t="";for(var e in this.mediatypes)for(var r in""!==t&&(t+=", "),t+=e,this.mediatypes[e])t+=";"+r+"="+this.mediatypes[e][r];return t}}],[{key:"crossSiteProxy",value:function(t){return r.crossSiteProxyTemplate?r.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}},{key:"offlineOverride",value:function(t){var e,r=t;return"undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.preferences&&e.preferences.get("offlineModeUsingLocalhost")&&"http://"===r.slice(0,7)&&"localhost/"!==r.slice(7,17)&&(r="http://localhost/"+r.slice(7),V.A.warn("Localhost kludge for offline use: actually getting <"+r+">")),r}},{key:"proxyIfNecessary",value:function(t){var e;if("undefined"!=typeof window&&window.panes&&(e=window.panes.UI)&&e.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var n=function t(e,r){var n=r[e.shift()];return n?"string"==typeof n?n+e.join("/"):e?t(e,n):null:null}(t.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(n)return n}return r.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?r.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}},{key:"unsupportedProtocol",value:function(t){var e=M.protocol(t);return"tel"===e||"mailto"===e||"urn"===e}},{key:"setCredentials",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===e.credentials&&(void 0!==e.withCredentials?e.credentials=e.withCredentials?"include":"omit":e.credentials="include")}}]);var n,i}();(0,o.A)(fr,"HANDLERS",void 0),(0,o.A)(fr,"CONTENT_TYPE_BY_EXT",void 0),(0,o.A)(fr,"crossSiteProxyTemplate",void 0),fr.HANDLERS=lr,fr.CONTENT_TYPE_BY_EXT=Ke;const pr={parseJSON:function(t,e,r){var n,i,o,a={},s=r.sym(e);for(var u in t){0===u.indexOf("_:")?a[u]?n=a[u]:(n=r.bnode(u),a[u]=n):n=r.sym(u);var c=t[u];for(var l in c){var h=c[l];for(var f in i=r.sym(l),h){var p=h[f];if("uri"===p.type)o=r.sym(p.value),r.add(n,i,o,s);else if("BlankNode"===p.type)a[p.value]?o=a[p.value]:(o=r.bnode(p.value),a[p.value]=o),r.add(n,i,o,s);else{if("Literal"!==p.type)throw new Error("error: unexpected termtype: "+f.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,s)}}}}}};function dr(t){var e=0;function r(t){var e="",r=t.statements;for(var n in r)V.A.debug("Found statement: "+r),e+=a()+r[n]+"\n";return e}function n(t){var e="";for(var r in t.constraints){var n=t.constraints[r];e+=a()+"FILTER ( "+n.describe(r)+" ) \n"}return e}function i(t){for(var o="",s=0;s<t.optional.length;s++)V.A.debug("Found optional query"),o+=a()+"OPTIONAL { \n",e++,o+=r(t.optional[s]),o+=n(t.optional[s]),o+=i(t.optional[s]),e--,o+=a()+"}\n";return o}function o(t){var o=a()+"WHERE \n{ \n";return e++,o+=r(t),o+=n(t),o+=i(t),e--,o+"}"}function a(){for(var t="",r=0;r<e;r++)t+=" ";return t}return function(t){return function(t){for(var e=a()+"SELECT ",r=0;r<t.vars.length;r++)e+=t.vars[r]+" ";return e+"\n"}(t)+o(t.pat)}(t)}function yr(t,e,r){var n=[];function i(t){if(n[t])return n[t];var e=r.variable(t);return n[t]=e,e}function o(t){return"string"==typeof t&&t.match(/[^ \n\t]/)}function a(t){return"string"==typeof t&&t.match(/^[\?\$]/)}function s(t){return"string"==typeof t?t.replace(/^</,"<").replace(/>$/,">"):t}function u(t){return"string"==typeof t&&t.match(/^<[^>]*>$/)}function c(t){return"string"==typeof t&&(t.match(/^_:/)||t.match(/^$/))}function l(t){return"string"==typeof t&&t.match(/:$/)}function h(t){return"string"==typeof t&&t.match(/^:|^[^_][^:]*:/)}function f(t){return t.split(":")[0]}function p(t){return t.split(":")[1]}function d(t){return u(t)?t.slice(1,t.length-1):t}function y(t){var e=-1===t.indexOf("'")?null:t.indexOf("'"),n=-1===t.indexOf('"')?null:t.indexOf('"');if(!e&&!n){var i=new Array(1);return i[0]=t,i}var o,a,s=new Array(2);if(!e||n&&n<e)o='"',a=n;else{if(n&&!(e&&e<n))return V.A.error("SQARQL QUERY OOPS!"),s;o="'",a=e}s[0]=t.slice(0,a);var u,c=t.slice(a+1).indexOf(o);return-1===c?(V.A.error("SPARQL parsing error: no matching parentheses in literal "+t),t):(t.slice(c+a+2).match(/^\^\^/)?(u=t.slice(c+a+2).indexOf(" "),s[1]=r.literal(t.slice(a+1,a+1+c),r.sym(d(t.slice(a+4+c,a+2+c+u)))),s=s.concat(y(t.slice(c+a+3+u)))):t.slice(c+a+2).match(/^@/)?(u=t.slice(c+a+2).indexOf(" "),s[1]=r.literal(t.slice(a+1,a+1+c),t.slice(a+3+c,a+2+c+u),null),s=s.concat(y(t.slice(c+a+2+u)))):(s[1]=r.literal(t.slice(a+1,a+1+c)),V.A.info("Literal found: "+s[1]),s=s.concat(y(t.slice(c+a+2)))),s)}function v(t){t=t.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),V.A.info("New str into spaceDelimit: \n"+t);var e=[],r=t.split(" ");for(var n in r)o(r[n])&&(e=e.concat(r[n]));return e}function g(t,e){for(var r=0;r<e.length;r++)if("string"==typeof e[r]&&e[r].toLowerCase()===t.toLowerCase())return r;return null}function m(t,e){for(var r=[],n=0;n<e.length;n++)"string"==typeof e[n]&&e[n].toLowerCase()===t.toLowerCase()&&r.push(n);return r}function b(t,e,r){V.A.info("Looking for a close bracket of type "+r+" in "+t);for(var n=0,i=0;i<t.length;i++)if(t[i]===e&&n++,t[i]===r&&n--,n<0)return i;return V.A.error("Statement had no close parenthesis in SPARQL query"),0}function w(t){return this.describe=function(e){return e+" = "+t.toNT()},this.test=function(e){return t.equals(e)},this}function A(t){this.describe=function(e){return"REGEXP( '"+t+"' , "+e+" )"},this.test=function(e){var r=new RegExp(t);return!!e.value&&r.test(e.value)}}function x(t,e){3!==t.length||"Variable"!==t[0].termType||"NamedNode"!==t[2].termType&&"Literal"!==t[2].termType?6===t.length&&"string"==typeof t[0]&&"regexp"===t[0].toLowerCase()&&"("===t[1]&&")"===t[5]&&","===t[3]&&"Variable"===t[4].termType&&"Literal"===t[2].termType&&(V.A.debug("Constraint added: "+t),e.constraints[t[4]]=new A(t[2].value)):"="===t[1]||">"===t[1]||"<"===t[1]?(V.A.debug("Constraint added: "+t),e.constraints[t[0]]=new w(t[2])):V.A.warn("I don't know how to handle the constraint: "+t)}function _(t,e){V.A.debug("Optional query: "+t+" not yet implemented.");var n=r.formula();k(t,n),e.optional.push(n)}function k(t,e){var n,o,l=function(t){for(var e=[],n=0;n<t.length;n++)"string"==typeof t[n]?(t[n]=s(t[n]),a(t[n])?e[n]=i(t[n].slice(1)):c(t[n])?(V.A.info(t[n]+" was identified as a bnode."),e[n]=r.bnode()):u(t[n])?(V.A.info(t[n]+" was identified as a symbol."),e[n]=r.sym(d(t[n]))):h(t[n])?(V.A.info(t[n]+" was identified as a prefixed symbol"),O[f(t[n])]?e[n]=r.sym(t[n]=O[f(t[n])]+p(t[n])):(V.A.error("SPARQL error: "+t[n]+" with prefix "+f(t[n])+" does not have a correct prefix entry."),e[n]=t[n])):e[n]=t[n]):e[n]=t[n];return e}(t);for(V.A.debug("WHERE: "+l);g("OPTIONAL",l);)o=g("OPTIONAL",l),V.A.debug("OPT: "+o+" "+l[o]+" in "+l),"{"!==l[o+1]&&V.A.warn("Bad optional opening bracket in word "+o),-1===(n=b(l.slice(o+2),"{","}"))?V.A.error("No matching bracket in word "+o):(_(l.slice(o+2,o+2+n),e),o=g("OPTIONAL",l),n=b(l.slice(o+2),"{","}"),l.splice(o,n+3));for(V.A.debug("WHERE after optionals: "+l);g("FILTER",l);){var y=g("FILTER",l);"("!==l[y+1]&&V.A.warn("Bad filter opening bracket in word "+y),-1===(n=b(l.slice(y+2),"(",")"))?V.A.error("No matching bracket in word "+y):(x(l.slice(y+2,y+2+n),e),y=g("FILTER",l),n=b(l.slice(y+2),"(",")"),l.splice(y,n+3))}V.A.debug("WHERE after filters and optionals: "+l),function(t,e){var r=new Array(1);r[0]=-1;for(var n=r.concat(m(".",t)),i=[],o=0;o<n.length-1;o++)i[o]=t.slice(n[o]+1,n[o+1]);for(o in i){V.A.info("s+p+o "+o+" = "+i[o]);var a=i[o][0];i[o].splice(0,1);var s=r.concat(m(";",i[o]));s.push(i[o].length);for(var u=[],c=0;c<s.length-1;c++)u[c]=i[o].slice(s[c]+1,s[c+1]);for(o in u){V.A.info("p+o "+o+" = "+i[o]);var l=u[o][0];u[o].splice(0,1);var h=r.concat(m(",",u[o]));h.push(u[o].length);var f=[];for(c=0;c<h.length-1;c++)f[c]=u[o].slice(h[c]+1,h[c+1]);for(o in f){var p=f[o][0];V.A.info("Subj="+a+" Pred="+l+" Obj="+p),e.add(a,l,p)}}}}(l,e)}V.A.info("SPARQL input: \n"+t);var T=new yt,E=function(t){var e=y(t),r=[];for(var n in e)r="string"==typeof e[n]?r.concat(v(e[n])):r.concat(e[n]);return r=function(t){for(var e=t,r=0;r<e.length;r++)if("a"===e[r]&&(e[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===e[r]&&"of"===e[r+2]){e.splice(r,1),e.splice(r+1,1);var n=e[r-1];e[r-1]=e[r+1],e[r+1]=n}return e}(r),V.A.info("SPARQL Tokens: "+r),r}(t),O=function(t){var e=m("PREFIX",t),r=[];for(var n in e){var i=t[e[n]+1],o=t[e[n]+2];if(l(i))if(u(o)){V.A.info("Prefix found: "+i+" -> "+o);var a=f(i),s=d(o);r[a]=s}else V.A.error("Invalid SPARQL symbol: "+o);else V.A.error("Invalid SPARQL prefix: "+i)}return r}(E);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 j=g("SELECT",E),N=g("WHERE",E);if(j<0||N<0||j>N)return V.A.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(t,e){for(var r in V.A.info("SPARQL vars: "+t),t)if(a(t[r])){V.A.info("Added "+t[r]+" to query variables from SPARQL");var n=i(t[r].slice(1));e.vars.push(n),n.label=t[r].slice(1)}else V.A.warn("Incorrect SPARQL variable in SELECT: "+t[r])}(E.slice(j+1,N),T),k(E.slice(N+2,E.length-1),T.pat),e)return T;for(var S in T.pat.statements){var R=T.pat.statements[S];"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 T}function vr(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return gr(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?gr(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){s=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function gr(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var mr=function(){return(0,t.A)((function t(r){if((0,e.A)(this,t),(0,o.A)(this,"store",void 0),(0,o.A)(this,"ifps",void 0),(0,o.A)(this,"fps",void 0),(0,o.A)(this,"patchControl",void 0),(0,o.A)(this,"ns",void 0),(r=r||new Et).updater)throw new Error("You can't have two UpdateManagers for the same store");r.fetcher||(r.fetcher=new fr(r)),this.store=r,r.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=W("http://www.w3.org/2007/ont/link#"),this.ns.http=W("http://www.w3.org/2007/ont/http#"),this.ns.httph=W("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=W("http://www.w3.org/ns/ldp#"),this.ns.rdf=W("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=W("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=W("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=W("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}),[{key:"patchControlFor",value:function(t){return this.patchControl[t.value]||(this.patchControl[t.value]=[]),this.patchControl[t.value]}},{key:"isHttpUri",value:function(t){return"http"===t.slice(0,4)}},{key:"flagAuthorizationMetadata",value:function(t){var e;t||(t=this.store);var r,n=null===(e=t.fetcher)||void 0===e?void 0:e.appNode,i=t.statementsMatching(void 0,this.ns.link("requestedURI"),void 0,n).map((function(t){return t.subject})),o=vr(i);try{for(o.s();!(r=o.n()).done;){var a=r.value,s=t.any(a,this.ns.link("response"),null,n);null!=s&&t.add(s,this.ns.link("outOfDate"),!0,n)}}catch(t){o.e(t)}finally{o.f()}}},{key:"checkEditable",value:(r=N(R().mark((function t(e,r){var n,i,o;return R().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",!1);case 2:if(r||(r=this.store),void 0===(i=this.editable(e,r))){t.next=6;break}return t.abrupt("return",i);case 6:return t.next=8,null===(n=r.fetcher)||void 0===n?void 0:n.load(e);case 8:return o=this.editable(e,r),t.abrupt("return",o);case 10:case"end":return t.stop()}}),t,this)}))),function(t,e){return r.apply(this,arguments)})},{key:"editable",value:function(t,e){var r,n;if(!t)return!1;if(e||(e=this.store),t=(0,Ve.E)(t),!this.isHttpUri(t)&&e.holds(e.rdfFactory.namedNode(t),e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),e.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var i,o=!1,a=null===(r=e.fetcher)||void 0===r?void 0:r.appNode,s=e.each(void 0,this.ns.link("requestedURI"),(0,M.docpart)(t),a),u=0;u<s.length;u++)if(void 0!==(n=s[u])){var c=e.any(n,this.ns.link("response"),null,a);if(void 0!==c){if(e.anyJS(c,this.ns.link("outOfDate"),null,a))continue;var l=e.anyValue(c,this.ns.httph("wac-allow"));if(l){var h,f=vr(l.split(","));try{for(f.s();!(h=f.n()).done;){var p=h.value.split("=");if(p[0].includes("user")&&!p[1].includes("write")&&!p[1].includes("append"))return!1}}catch(t){f.e(t)}finally{f.f()}}var d=e.each(c,this.ns.httph("accept-patch"));if(d.length)for(var y=0;y<d.length;y++){if((i=d[y].value.trim()).indexOf("text/n3")>=0)return"N3PATCH";if(i.indexOf("application/sparql-update")>=0)return"SPARQL";if(i.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var v=e.each(c,this.ns.httph("ms-author-via"));if(v.length)for(var g=0;g<v.length;g++){if((i=v[g].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(i.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(t))return!!l&&"LOCALFILE";var m=e.each(c,this.ns.http("status"));if(m.length)for(var b=0;b<m.length;b++)200!==m[b]&&404!==m[b]||(o=!0)}}if(0===s.length);else if(o)return!1}},{key:"anonymize",value:function(t){return"_:"===t.toNT().substr(0,2)&&this.mentioned(t)?"?"+t.toNT().substr(2):t.toNT()}},{key:"anonymizeNT",value:function(t){return this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" ."}},{key:"nTriples",value:function(t){return"".concat(t.subject.toNT()," ").concat(t.predicate.toNT()," ").concat(t.object.toNT()," .")}},{key:"statementBnodes",value:function(t){return[t.subject,t.predicate,t.object].filter((function(t){return(0,v.jt)(t)}))}},{key:"statementArrayBnodes",value:function(t){for(var e=[],r=0;r<t.length;r++)e=e.concat(this.statementBnodes(t[r]));e.sort();for(var n=[],i=0;i<e.length;i++)0!==i&&e[i].equals(e[i-1])||n.push(e[i]);return n}},{key:"cacheIfps",value:function(){this.ifps={};for(var t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty")),e=0;e<t.length;e++)this.ifps[t[e].value]=!0;this.fps={},t=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(var r=0;r<t.length;r++)this.fps[t[r].value]=!0}},{key:"bnodeContext2",value:function(t,e,r){for(var n,i,o=this.store.statementsMatching(void 0,void 0,t,e),a=0;a<o.length;a++)if(this.fps[o[a].predicate.value]){if(!(n=o[a].subject).isBlank)return[o[a]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([o[a]])}o=this.store.statementsMatching(t,void 0,void 0,e);for(var s=0;s<o.length;s++)if(this.ifps[o[s].predicate.value]){if(!(n=o[s].object).isBlank)return[o[s]];if(r&&(i=this.bnodeContext2(n,e,r-1)))return i.concat([o[s]])}return null}},{key:"bnodeContext1",value:function(t,e){for(var r=0;r<3;r++){var n=this.bnodeContext2(t,e,r);if(null!==n)return n}return this.store.connectedStatements(t,e)}},{key:"mentioned",value:function(t){return 0!==this.store.statementsMatching(t,null,null,null).length||0!==this.store.statementsMatching(null,t).length||0!==this.store.statementsMatching(null,null,t).length}},{key:"bnodeContext",value:function(t,e){var r=[];if(t.length){this.cacheIfps();for(var n=0;n<t.length;n++){var i=t[n];this.mentioned(i)&&(r=r.concat(this.bnodeContext1(i,e)))}}return r}},{key:"statementContext",value:function(t){var e=this.statementBnodes(t);return this.bnodeContext(e,t.graph)}},{key:"contextWhere",value:function(t){var e=this;return t&&0!==t.length?"WHERE { "+t.map((function(t){return e.anonymizeNT(t)})).join("\n")+" }\n":""}},{key:"fire",value:function(t,e,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((function(){if(!t)throw new Error("No URI given for remote editing operation: "+e);return i.noMeta=!0,i.contentType=i.contentType||"application/sparql-update",i.body=e,n.store.fetcher.webOperation("PATCH",t,i)})).then((function(n){if(!n.ok){var i="UpdateManager: update failed for <"+t+"> status="+n.status+", "+n.statusText+"\n for query: "+e;throw new Error(i)}r(t,n.ok,n.responseText,n)})).catch((function(e){r(t,!1,e.message,e)}))}},{key:"update_statement",value:function(t){if(!t||t.graph){var e=this,r=this.statementContext(t);return{statement:t?[t.subject,t.predicate,t.object,t.graph]:void 0,statementNT:t?this.anonymizeNT(t):void 0,where:e.contextWhere(r),set_object:function(t,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(t)+" . }\n",e.fire(this.statement[3].value,n,r)}}}}},{key:"insert_statement",value:function(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){for(var i="",o=0;o<t.length;o++)i+=t[o]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}},{key:"delete_statement",value:function(t,e){var r=t instanceof Array?t[0]:t,n=this.contextWhere(this.statementContext(r));if(t instanceof Array){for(var i="",o=0;o<t.length;o++)i+=t[o]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(t.subject)+" "+this.anonymize(t.predicate)+" "+this.anonymize(t.object)+" . }\n";this.fire(r.graph.value,n,e)}},{key:"requestDownstreamAction",value:function(t,e){var r=this.patchControlFor(t);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+e)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=e;else e(t)}},{key:"clearUpstreamCount",value:function(t){this.patchControlFor(t).upstreamCount=0}},{key:"getUpdatesVia",value:function(t){var e=this.store.fetcher.getHeader(t,"updates-via");return e&&e.length?e[0].trim():null}},{key:"addDownstreamChangeListener",value:function(t,e){var r=this,n=this.patchControlFor(t);n.downstreamChangeListeners||(n.downstreamChangeListeners=[]),n.downstreamChangeListeners.push(e),this.setRefreshHandler(t,(function(t){r.reloadAndSync(t)}))}},{key:"reloadAndSync",value:function(t){var e=this.patchControlFor(t),r=this;if(e.reloading)e.outOfDate=!0;else{e.reloading=!0;var n=1e3;!function i(){r.reload(r.store,t,(function(t,r,o){if(t){if(e.downstreamChangeListeners)for(var a=0;a<e.downstreamChangeListeners.length;a++)e.downstreamChangeListeners[a]();e.reloading=!1,e.outOfDate&&(e.outOfDate=!1,i())}else e.reloading=!1,o&&0===o.status&&(e.reloading=!0,setTimeout(i,n*=2))}))}()}}},{key:"setRefreshHandler",value:function(t,e){var r=this.getUpdatesVia(t),n=e,i=this,o=this,a=1500,s=0;if(!r)return!1;var u=(r=(0,M.join)(r,t.value)).replace(/^http:/,"ws:").replace(/^https:/,"wss:");return function e(){var r;if("undefined"!=typeof WebSocket)r=new WebSocket(u);else{if("undefined"==typeof window||!window.WebSocket)return;r=window.WebSocket(u)}r.onopen=function(){a=1500,this.send("sub "+t.value),s&&o.requestDownstreamAction(t,n)};var c=i.patchControlFor(t);c.upstreamCount=0,r.onerror=function(t){},r.onclose=function(t){a*=2,s+=1,setTimeout((function(){e()}),a)},r.onmessage=function(e){if(e.data&&"pub"===e.data.slice(0,3)){if("upstreamCount"in c&&(c.upstreamCount-=1,c.upstreamCount>=0))return;c.upstreamCount=0,i.requestDownstreamAction(t,n)}}}(),!0}},{key:"updateMany",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=t.concat(e).map((function(t){return t.why})),n=this,i=[];r.forEach((function(t){i.find((function(e){return e.equals(t)}))||i.push(t)}));var o=i.map((function(r){return n.update(t.filter((function(t){return t.why.equals(r)})),e.filter((function(t){return t.why.equals(r)})))}));return o.length,Promise.all(o)}},{key:"constructSparqlUpdateQuery",value:function(t,e,r){var n=this.contextWhere(r),i="";if(n.length){if(t.length){i+="DELETE { ";for(var o=0;o<t.length;o++)i+=this.anonymizeNT(t[o])+"\n";i+=" }\n"}if(e.length){i+="INSERT { ";for(var a=0;a<e.length;a++)i+=this.anonymizeNT(e[a])+"\n";i+=" }\n"}i+=n}else{if(t.length){i+="DELETE DATA { ";for(var s=0;s<t.length;s++)i+=this.anonymizeNT(t[s])+"\n";i+=" } \n"}if(e.length){t.length&&(i+=" ; "),i+="INSERT DATA { ";for(var u=0;u<e.length;u++)i+=this.nTriples(e[u])+"\n";i+=" }\n"}}return i}},{key:"constructN3PatchQuery",value:function(t,e,r){var n=this,i="\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ex: <http://www.example.org/terms#>.\n\n_:patch\n";return r&&r.length>0&&(i+="\n solid:where {\n ".concat(r.map((function(t){return n.anonymizeNT(t)})).join("\n "),"\n };")),t.length>0&&(i+="\n solid:deletes {\n ".concat(t.map((function(t){return n.anonymizeNT(t)})).join("\n "),"\n };")),e.length>0&&(i+="\n solid:inserts {\n ".concat(e.map((function(t){return n.anonymizeNT(t)})).join("\n "),"\n };")),i+" a solid:InsertDeletePatch .\n"}},{key:"update",value:function(t,e,r,n){var i=this,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var a=this;return new Promise((function(r,i){a.update(t,e,(function(t,e,n){e?r():i(new Error(n))}),n,o)}))}try{var s=this.store,u=t?(0,v.ok)(t)?t.statements:t instanceof Array?t:[t]:[],c=e?(0,v.ok)(e)?e.statements:e instanceof Array?e:[e]:[];if(!(u instanceof Array))throw new Error("Type Error "+(0,d.A)(u)+": "+u);if(!(c instanceof Array))throw new Error("Type Error "+(0,d.A)(c)+": "+c);if(0===u.length&&0===c.length)return r(null,!0);var l=u.length?u[0].graph:c[0].graph;if(!l){var h="Error patching: statement does not specify which document to patch:"+u[0]+", "+c[0];throw new Error(h)}if("NamedNode"!==l.termType){var f="Error patching: document not a NamedNode:"+u[0]+", "+c[0];throw new Error(f)}var p=this.patchControlFor(l),y=Date.now(),g=["subject","predicate","object","why"],m={delete:u,insert:c};["insert","delete"].map((function(t){m[t].map((function(t){if(!l.equals(t.graph))throw new Error("update: destination "+l+" inconsistent with delete quad "+t.graph);g.map((function(e){if(void 0===t[e])throw new Error("update: undefined "+e+" of statement.")}))}))}));var b=this.editable(l.value,s);if(!1===b)throw new Error("Update: Can't make changes in uneditable "+l);if(void 0===b){if(n)throw new Error("Update: Loaded "+l+"but still can't figure out what editing protocol it supports.");return void this.store.fetcher.load(l).then((function(n){i.update(t,e,r,!0,o)}),(function(n){if(404!==n.response.status)throw new Error("Update: Can't get updatability status ".concat(l," before patching: ").concat(n));i.update(t,e,r,!0,o)}))}if(b.indexOf("SPARQL")>=0||b.indexOf("N3PATCH")>=0){var w=b.indexOf("SPARQL")>=0,A=[];u.length&&(A=this.statementArrayBnodes(u)),c.length&&(A=A.concat(this.statementArrayBnodes(c)));var x=this.bnodeContext(A,l),_=w?this.constructSparqlUpdateQuery(u,c,x):this.constructN3PatchQuery(u,c,x);o.contentType=w?"application/sparql-update":"text/n3",p.pendingUpstream=p.pendingUpstream?p.pendingUpstream+1:1,"upstreamCount"in p&&(p.upstreamCount+=1),this.fire(l.value,_,(function(t,e,n,i){if(i.elapsedTimeMs=Date.now()-y,e){try{s.remove(u)}catch(t){e=!1,n="Remote Ok BUT error deleting "+u.length+" from store!!! "+t}for(var o=0;o<c.length;o++)s.add(c[o].subject,c[o].predicate,c[o].object,l)}if(r(t,e,n,i),p.pendingUpstream-=1,0===p.pendingUpstream&&p.downstreamAction){var a=p.downstreamAction;delete p.downstreamAction,a(l)}}),o)}else if(b.indexOf("DAV")>=0)this.updateDav(l,u,c,r,o);else{if(!(b.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+b+"' for "+l);try{this.updateLocalFile(l,u,c,r,o)}catch(t){r(l.value,!1,"Exception trying to write back file <"+l.value+">\n")}}}catch(t){r(void 0,!1,"Exception in update: "+t+"\n"+Q.stackString(t))}}},{key:"updateDav",value:function(t,e,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.any(t,this.ns.link("request"));if(!a)throw new Error("No record of our HTTP GET request for document: "+t);var s=o.any(a,this.ns.link("response"));if(!s)return null;for(var u=o.the(s,this.ns.httph("content-type")).value,c=o.statementsMatching(void 0,void 0,void 0,t).slice(),l=0;l<e.length;l++)Q.RDFArrayRemove(c,e[l]);for(var h=0;h<r.length;h++)c.push(r[h]);var f,p=this.serialize(t.value,c,u),d=o.the(s,this.ns.httph("content-location"));return d&&(f=(0,M.join)(d.value,f)),i.contentType=u,i.noMeta=!0,i.body=p,o.fetcher.webOperation("PUT",f,i).then((function(i){if(!i.ok)throw new Error(i.error);for(var a=0;a<e.length;a++)o.remove(e[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,t);n(t.value,i.ok,i.responseText,i)})).catch((function(e){n(t.value,!1,e.message,e)}))}},{key:"updateLocalFile",value:function(t,e,r,n){for(var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.statementsMatching(void 0,void 0,void 0,t).slice(),s=0;s<e.length;s++)Q.RDFArrayRemove(a,e[s]);for(var u=0;u<r.length;u++)a.push(r[u]);var c=t.value.lastIndexOf(".");if(c<1)throw new Error("Rewriting file: No filename extension: "+t.value);var l=t.value.slice(c+1),h=fr.CONTENT_TYPE_BY_EXT[l];if(!h)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(t.value,a,h),i.contentType=h,o.fetcher.webOperation("PUT",t.value,i).then((function(i){if(!i.ok)return n(t.value,!1,i.error);for(var a=0;a<e.length;a++)o.remove(e[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,t);n(t.value,!0,"")}))}},{key:"serialize",value:function(t,e,r){var n,i=this.store;if("string"==typeof e)return e;var o=et(i);switch(o.suggestNamespaces(i.namespaces),o.setBase(t),r){case"text/xml":case"application/rdf+xml":n=o.statementsToXML(e);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":n=o.statementsToN3(e);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return n}},{key:"put",value:function(t,e,r,n){var i,o=this,a=this.store;return Promise.resolve().then((function(){return i=o.serialize(t.value,e,r),a.fetcher.webOperation("PUT",t.value,{contentType:r,body:i})})).then((function(r){if(!r.ok)return n(t.value,r.ok,r.error,r);delete a.fetcher.nonexistent[t.value],delete a.fetcher.requested[t.value],"string"!=typeof e&&e.map((function(t){a.addStatement(t)})),n(t.value,r.ok,"",r)})).catch((function(e){n(t.value,!1,e.message)}))}},{key:"reload",value:function(t,e,r){var n=Date.now();t.fetcher.nowOrWhenFetched(e.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(t,i,o){if(t)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var a=Date.now()-n;e.reloadTimeTotal||(e.reloadTimeTotal=0),e.reloadTimeCount||(e.reloadTimeCount=0),e.reloadTimeTotal+=a,e.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}]);var r}();function br(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function wr(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?br(Object(r),!0).forEach((function(e){(0,o.A)(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):br(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}var Ar=wr(wr({},re),{},{fetcher:function(t,e){return new fr(t,e)},graph:function(){return new Et(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)||{rdfFactory:re})},lit:function(t,e,r){return this.literal(""+t,e||r)},st:function(t,e,r,n){return this.quad(t,e,r,n)}});const xr=Ar;var _r=function(){return(0,t.A)((function t(r,n){(0,e.A)(this,t),this.parent=r,this.via=n,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(n),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(t){this.onError(t)}}),[{key:"_decode",value:function(t){var e,r,n,i,o,a,s;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=t.split("&")).length;r<n;r++)e=i[r],o.push(e.split("="));return o}())e=o[r],s=(a=[decodeURIComponent(e[0]),decodeURIComponent(e[1])])[1],null==i[n=a[0]]&&(i[n]=[]),i[n].push(s);return i}},{key:"_send",value:function(t,e,r){var n,i;return i=[t,e,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}},{key:"_subscribe",value:function(t){return this._send("sub",t,""),this.subscribed[t]=!0,this.subscribed[t]}},{key:"onClose",value:function(t){var e;for(e in this.connected=!1,this.subscribed)this.pending[e]=!0;return this.subscribed={},this.subscribed}},{key:"onError",value:function(t){throw new Error("onError"+t)}},{key:"onMessage",value:function(t){var e,r;return"ping"===(r=t.data.split(" "))[0]?"function"==typeof(e=this.socket).send?e.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}},{key:"onOpen",value:function(t){var e,r;for(r in this.connected=!0,e=[],this.pending)delete this.pending[r],e.push(this._subscribe(r));return e}},{key:"subscribe",value:function(t){return this.connected?this._subscribe(t):(this.pending[t]=!0,this.pending[t])}}])}(),kr=function(){return(0,t.A)((function t(r){(0,e.A)(this,t),this.fetcher=r,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}),[{key:"onHeaders",value:function(t){var e,r,n;return null==t.headers||"undefined"==typeof WebSocket||null===WebSocket||(e=t.headers.etag,n=t.headers["updates-via"],r=t.uri,e&&n&&(this.graph[r]={etag:e,via:n},this.register(n,r))),!0}},{key:"onUpdate",value:function(t,e){return this.fetcher.refresh(xr.namedNode(t))}},{key:"register",value:function(t,e){return null==this.via[t]&&(this.via[t]=new _r(this,t)),this.via[t].subscribe(e)}}])}();function Tr(t,e,i){return e=(0,n.A)(e),(0,r.A)(t,Er()?Reflect.construct(e,i||[],(0,n.A)(t).constructor):e.apply(t,i))}function Er(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(Er=function(){return!!t})()}var Or={};for(var jr in xr)"function"==typeof xr[jr]&&(Or[jr]=xr[jr].bind(xr));var Nr=Or.fetcher,Sr=Or.graph,Rr=Or.lit,Ir=Or.st,Cr=Or.namedNode,Pr=Or.variable,Fr=Or.blankNode,Ur=Or.defaultGraph,Dr=Or.literal,Lr=Or.quad,Mr=Or.triple,Br=new ht,qr=function(t){return Br.fromNT(t)},Hr=ft.fromValue,$r=p.nextId,zr=function(r){function n(t){var r;return(0,e.A)(this,n),r=Tr(this,n,[t]),(0,o.A)(r,"fetcher",void 0),r.fetcher=new fr(r,{}),r}return(0,i.A)(n,r),(0,t.A)(n)}(Et),Xr=function(r){function n(t){var r;return(0,e.A)(this,n),r=Tr(this,n,[t]),(0,o.A)(r,"updater",void 0),r.updater=new mr(r),r}return(0,i.A)(n,r),(0,t.A)(n)}(zr)})(),u})()));
|
|
3
3
|
//# sourceMappingURL=rdflib.min.js.map
|