rdflib 2.2.21-d55d15fa → 2.2.21-e3e59ee9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/rdflib.min.js +1 -1
  2. package/dist/rdflib.min.js.LICENSE.txt +9 -1
  3. package/dist/rdflib.min.js.map +1 -1
  4. package/esm/blank-node.js +61 -114
  5. package/esm/class-order.js +1 -1
  6. package/esm/collection.js +70 -128
  7. package/esm/convert.js +1 -2
  8. package/esm/default-graph.js +14 -48
  9. package/esm/empty.js +8 -39
  10. package/esm/factories/canonical-data-factory.js +33 -65
  11. package/esm/factories/extended-term-factory.js +18 -25
  12. package/esm/factories/factory-types.js +3 -2
  13. package/esm/factories/rdflib-data-factory.js +9 -19
  14. package/esm/fetcher.js +1341 -1854
  15. package/esm/formula.js +639 -846
  16. package/esm/index.js +40 -76
  17. package/esm/jsonldparser.js +24 -49
  18. package/esm/jsonparser.js +1 -8
  19. package/esm/lists.js +47 -110
  20. package/esm/literal.js +120 -189
  21. package/esm/log.js +7 -7
  22. package/esm/n3parser.js +1015 -1412
  23. package/esm/named-node.js +70 -119
  24. package/esm/namespace.js +2 -5
  25. package/esm/node-internal.js +73 -110
  26. package/esm/node.js +2 -7
  27. package/esm/parse.js +12 -19
  28. package/esm/patch-parser.js +10 -30
  29. package/esm/query-to-sparql.js +0 -18
  30. package/esm/query.js +63 -147
  31. package/esm/rdfaparser.js +794 -997
  32. package/esm/rdfxmlparser.js +347 -461
  33. package/esm/serialize.js +10 -28
  34. package/esm/serializer.js +820 -1049
  35. package/esm/sparql-to-query.js +44 -134
  36. package/esm/statement.js +54 -85
  37. package/esm/store.js +829 -1103
  38. package/esm/types.js +22 -21
  39. package/esm/update-manager.js +862 -1094
  40. package/esm/updates-via.js +104 -161
  41. package/esm/uri.js +9 -53
  42. package/esm/utils/default-graph-uri.js +3 -2
  43. package/esm/utils/termValue.js +0 -1
  44. package/esm/utils/terms.js +19 -21
  45. package/esm/utils-js.js +20 -61
  46. package/esm/utils.js +10 -21
  47. package/esm/variable.js +32 -78
  48. package/esm/xsd.js +2 -2
  49. package/lib/blank-node.js +60 -113
  50. package/lib/class-order.js +1 -2
  51. package/lib/collection.js +69 -131
  52. package/lib/convert.js +3 -9
  53. package/lib/default-graph.js +13 -52
  54. package/lib/empty.js +8 -43
  55. package/lib/factories/canonical-data-factory.js +35 -79
  56. package/lib/factories/extended-term-factory.js +18 -32
  57. package/lib/factories/factory-types.d.ts +6 -6
  58. package/lib/factories/factory-types.js +1 -4
  59. package/lib/factories/rdflib-data-factory.js +9 -23
  60. package/lib/fetcher.d.ts +6 -6
  61. package/lib/fetcher.js +1370 -1843
  62. package/lib/formula.js +640 -855
  63. package/lib/index.js +66 -152
  64. package/lib/jsonldparser.js +23 -53
  65. package/lib/jsonparser.js +1 -10
  66. package/lib/lists.js +55 -112
  67. package/lib/literal.js +120 -195
  68. package/lib/log.d.ts +0 -6
  69. package/lib/log.js +7 -8
  70. package/lib/n3parser.js +1030 -1436
  71. package/lib/named-node.js +69 -126
  72. package/lib/namespace.js +2 -7
  73. package/lib/node-internal.js +74 -107
  74. package/lib/node.js +2 -12
  75. package/lib/parse.d.ts +1 -1
  76. package/lib/parse.js +12 -32
  77. package/lib/patch-parser.js +11 -34
  78. package/lib/query-to-sparql.js +0 -23
  79. package/lib/query.js +62 -167
  80. package/lib/rdfaparser.js +796 -1009
  81. package/lib/rdfxmlparser.js +349 -466
  82. package/lib/serialize.js +12 -38
  83. package/lib/serializer.js +823 -1064
  84. package/lib/sparql-to-query.js +42 -167
  85. package/lib/statement.js +55 -91
  86. package/lib/store.d.ts +1 -1
  87. package/lib/store.js +849 -1112
  88. package/lib/tf-types.d.ts +4 -4
  89. package/lib/types.d.ts +8 -8
  90. package/lib/types.js +23 -23
  91. package/lib/update-manager.d.ts +2 -2
  92. package/lib/update-manager.js +870 -1103
  93. package/lib/updates-via.js +105 -164
  94. package/lib/uri.js +8 -61
  95. package/lib/utils/default-graph-uri.js +3 -5
  96. package/lib/utils/termValue.js +0 -2
  97. package/lib/utils/terms.js +19 -40
  98. package/lib/utils-js.js +23 -88
  99. package/lib/utils.js +10 -27
  100. package/lib/variable.js +34 -85
  101. package/lib/xsd-internal.js +0 -3
  102. package/lib/xsd.js +2 -6
  103. package/package.json +37 -36
  104. package/src/fetcher.ts +2 -2
  105. package/src/update-manager.ts +18 -7
  106. package/changes.txt +0 -59
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see rdflib.min.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("window")):"function"==typeof define&&define.amd?define(["window"],t):"object"==typeof exports?exports.$rdf=t(require("window")):e.$rdf=t(e.window)}(self,(function(e){return(()=>{var t={8333:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},7308:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={debug:function(e){},warn:function(e){},info:function(e){},error:function(e){},success:function(e){},msg:function(e){}}},6545:(e,t,r)=>{"use strict";r.d(t,{Z:()=>y});var n=r(7061),i=r(9900),o=r(4771),a=r(4768),s=r(4593),c=r(886),u=r(240),l=r(8333),h=r(4806),f=r(9247),d=r(2598),p=r(5904);var y=function(e){(0,a.Z)(y,e);var t,r,h=(t=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(e){return!1}}(),function(){var e,n=(0,c.Z)(t);if(r){var i=(0,c.Z)(this).constructor;e=Reflect.construct(n,arguments,i)}else e=n.apply(this,arguments);return(0,s.Z)(this,e)});function y(e){var t;if((0,n.Z)(this,y),t=h.call(this,(0,d._)(e)),(0,u.Z)((0,o.Z)(t),"termType",f.XM),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.NamedNode),!t.value)throw new Error("Missing IRI for NamedNode");if(!t.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(t.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.');return t}return(0,i.Z)(y,[{key:"dir",value:function(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&t<r+2||t<0?null:new y(e.slice(0,t+1))}},{key:"site",value:function(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",t+2);return new y(r<0?e.slice(0)+"/":e.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(e){this.value=e}}],[{key:"fromValue",value:function(e){return null==e||(0,p.jt)(e)?e:new y(e)}}]),y}(h.Z)},4806:(e,t,r)=>{"use strict";r.d(t,{Z:()=>s});var n=r(7061),i=r(9900),o=r(240),a=r(292),s=function(){function e(t){(0,n.Z)(this,e),(0,o.Z)(this,"termType",void 0),(0,o.Z)(this,"classOrder",void 0),(0,o.Z)(this,"value",void 0),this.value=t}return(0,i.Z)(e,[{key:"substitute",value:function(e){return a.log("@@@ node substitute"+this),this}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toCanonical()}},{key:"sameTerm",value:function(e){return this.equals(e)}},{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")}}]),e}();(0,o.Z)(s,"fromValue",void 0),(0,o.Z)(s,"toJS",void 0)},9247:(e,t,r)=>{"use strict";r.d(t,{D7:()=>k,Eo:()=>_,Is:()=>m,NK:()=>s,UH:()=>a,V1:()=>i,XM:()=>n,_A:()=>l,aV:()=>g,b4:()=>v,fb:()=>c,lL:()=>y,ls:()=>u,oW:()=>b,qS:()=>d,sZ:()=>p,ui:()=>f,us:()=>h,xH:()=>o,xm:()=>w,z8:()=>x});var n="NamedNode",i="BlankNode",o="Literal",a="Variable",s="DefaultGraph",c="Collection",u="Empty",l="Graph",h="text/html",f="application/ld+json",d="text/n3",p="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",k="application/xhtml+xml"},3357:(e,t,r)=>{"use strict";r.r(t),r.d(t,{docpart:()=>a,document:()=>s,hostpart:()=>c,join:()=>u,protocol:()=>l,refTo:()=>h});var n=r(6545),i=r(292),o=o||i.log;function a(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function s(e){return new n.Z(a(e))}function c(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function u(e,t){var r,n,i,a,s,c=t.indexOf("#");if(c>0&&(t=t.slice(0,c)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(r=t.indexOf(":"),0===t.length)return e;if(r<0)return o("Invalid base: "+t+" in join with given: "+e),e;if(n=t.slice(0,+r+1||9e9),0===e.indexOf("//"))return n+e;if(t.indexOf("//",r)===r+1){if((i=t.indexOf("/",r+3))<0)return t.length-r-3>0?t+"/"+e:n+e}else if((i=t.indexOf("/",r+1))<0)return t.length-r-1>0?t+"/"+e:n+e;if(0===e.indexOf("/"))return t.slice(0,i)+e;if((a=(s=t.slice(i)).lastIndexOf("/"))<0)return n+e;for(a>=0&&a<s.length-1&&(s=s.slice(0,+a+1||9e9)),s+=e;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,i)+s}function l(e){var t=e.indexOf(":");return t<0?null:e.slice(0,t)}function h(e,t){var r,n,i,o,a,s,c,u,l,h,f,d,p=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=c=0,o=t.length;c<o&&t[r]===e[r];r=++c);if(e.slice(0,r).match(p)&&((n=t.indexOf("//"))<0&&(n=-2),i=t.indexOf("/",n+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[r]&&e.length===r)return t.slice(r);for(;r>0&&"/"!==t[r-1];)r--;if(r<3)return t;if(e.indexOf("//",r-2)>0||t.indexOf("//",r-2)>0)return t;if(e.indexOf(":",r)>0)return t;for(s=0,u=0,a=(h=e.slice(r)).length;u<a;u++)"/"===h[u]&&s++;if(0===s&&r<t.length&&"#"===t[r])return"./"+t.slice(r);if(0===s&&r===t.length)return"./";if(d="",s>0)for(l=1,f=s;f>=1?l<=f:l>=f;f>=1?++l:--l)d+="../";return d+t.slice(r)}},5115:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMParserFactory:()=>f,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>d,dtstamp:()=>y,dumpNode:()=>p,heavyCompare:()=>v,heavyCompareSPO:()=>g,linkRelationProperty:()=>l,log:()=>n.Z,mediaTypeClass:()=>u,output:()=>m,parseXML:()=>b,stackString:()=>_,string:()=>c,string_startswith:()=>x,uri:()=>i});var n=r(7308),i=r(3357),o=r(6545),a=r(870);e=r.hmd(e);var s=r(292),c={template:function(e,t){for(var r=e.split("%s"),n="",i=0;i<t.length;i++)t[i]+="",n+=r[i]+t[i];return n+r.slice(t.length).join()}};function u(e){return e=e.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function l(e){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function h(e,t){e.callbacks={};for(var r=t.length-1;r>=0;r--)e.callbacks[t[r]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,r){e.callbacks[t].push(r)},e.removeCallback=function(t,r){for(var n=0;n<e.callbacks[t].length;n++)if(e.callbacks[t][n].name===r)return e.callbacks[t].splice(n,1),!0;return!1},e.insertCallback=function(t,r){e.callbacks[t].unshift(r)},e.fireCallbacks=function(t,r){var n,i,o=[],a=[],s=e.callbacks[t].length;for(n=s-1;n>=0;n--)(i=e.callbacks[t][n])&&i.apply(e,r)&&o.push(i);for(n=o.length-1;n>=0;n--)a.push(o[n]);for(n=s;n<e.callbacks[t].length;n++)a.push(e.callbacks[t][n]);e.callbacks[t]=a}}function f(){return window.DOMParser?new a.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function d(e,t){var r=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){r[e]=!0}));var n=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){n[e]=!0})),p(e,t,r,n)}function p(e,t,r,n){var i,o="",a=[!1];if(void 0===e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var c=e.nodeName.toLowerCase();o+="<"+c;var u=[];for(i=e.attributes.length-1;i>=0;i--){var l=e.attributes[i];if(!(n&&n.length>0&&n[l.name]||/^\d+$/.test(l.name))){if("class"===l.name&&t&&t.replaceClassItemWith&&l.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var h=new RegExp(t.replaceClassItemWith.source,"g");l.value=l.value.replace(h,t.replaceClassItemWith.target).trim()}"class"===l.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===l.value||u.push(l.name+"='"+l.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(u.length>0&&(t&&t.sortAttributes&&u.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),o+=" "+u.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===c?"\n ":"",a.push("style"===c||"script"===c),i=0;i<e.childNodes.length;i++)o+=p(e.childNodes[i]);a.pop(),o+="body"===c?"</"+c+">\n":"</"+c+">"}}}else if(8===e.nodeType)o+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var f=e.nodeValue.replace(/\n+$/,"");o+=a[a.length-1]?f:f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else s.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),s.log(e);return o}function y(){var e=new Date,t=e.getYear()+1900,r=e.getMonth()+1,n=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),a=e.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),t+"-"+r+"-"+n+"T"+i+":"+o+":"+a+"Z"}function v(e,t,r,n){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=r.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(r.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")},a=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===a?0:o(e)>o(t)?1:o(e)<o(t)?-1:a:n&&e.uri&&t.uri?(n[e.uri]||e.uri).localeCompare(n[t.uri]||t.uri):a}function g(e,t,r,n){return v(e.subject,t.subject,r,n)||v(e.predicate,t.predicate,r,n)||v(e.object,t.object,r,n)}function m(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function b(t,r){return r=r||{},e&&e.exports?(new a.DOMParser).parseFromString(t,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new a.DOMParser).parseFromString(t,"application/xml")}function w(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.why))return void e.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function x(e,t){return e.slice(0,t.length)===t}function _(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var r=e.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var o=r[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var a=o.split("@");n.push(a)}for(i=0;i<n.length;i++)t+=" "+n[i][1]+"\n "+n[i][0];return t}},2598:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?e:e.value}r.d(t,{_:()=>n})},5904:(e,t,r)=>{"use strict";r.d(t,{B2:()=>v,NA:()=>w,NX:()=>y,PY:()=>p,Pv:()=>a,Uc:()=>c,Yi:()=>o,cG:()=>h,f:()=>u,jt:()=>f,lt:()=>b,lx:()=>m,n_:()=>d,nq:()=>l,uZ:()=>s,zz:()=>g});var n=r(7209),i=r(9247);function o(e){return"object"===(0,n.Z)(e)&&null!==e&&"subject"in e}function a(e){return"object"===(0,n.Z)(e)&&null!==e&&"statements"in e}function s(e){return f(e)&&e.termType===i.fb}function c(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.fb||e.termType===i.xH||e.termType===i._A)}function u(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.fb||e.termType===i.xH||e.termType===i._A)}function l(e){return f(e)&&(e.termType===i.XM||e.termType===i.V1||e.termType===i.UH)}function h(e){return f(e)&&e.termType===i.UH}function f(e){return"object"===(0,n.Z)(e)&&null!==e&&"termType"in e}function d(e){return e.termType===i.xH}function p(e){return"object"===(0,n.Z)(e)&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function y(e){return f(e)&&"NamedNode"===e.termType}function v(e){return f(e)&&"termType"in e&&"BlankNode"===e.termType}function g(e){return f(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1)}function m(e){return f(e)&&(e.termType===i.XM||e.termType===i.UH)}function b(e){return f(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.xH)}function w(e){return f(e)&&(e.termType===i.XM||e.termType===i.UH||e.termType===i.V1||e.termType===i.NK)}},107:(e,t,r)=>{e.exports=r(2390)},6118:(e,t,r)=>{"use strict";var n=r(2530),i=r(292);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var a,s,c=r(8619).codes,u=c.ERR_AMBIGUOUS_ARGUMENT,l=c.ERR_INVALID_ARG_TYPE,h=c.ERR_INVALID_ARG_VALUE,f=c.ERR_INVALID_RETURN_VALUE,d=c.ERR_MISSING_ARGS,p=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 e=r(1667);a=e.isDeepEqual,s=e.isDeepStrictEqual}new Map;var _=!1,k=e.exports=N,j={};function T(e){if(e.message instanceof Error)throw e.message;throw new p(e)}function O(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new p({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function N(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];O.apply(void 0,[N,t.length].concat(t))}k.fail=function e(t,r,o,a,s){var c,u=arguments.length;if(0===u)c="Failed";else if(1===u)o=t,t=void 0;else{if(!1===_){_=!0;var l=n.emitWarning?n.emitWarning:i.warn.bind(i);l("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===u&&(a="!=")}if(o instanceof Error)throw o;var h={actual:t,expected:r,operator:void 0===a?"fail":a,stackStartFn:s||e};void 0!==o&&(h.message=o);var f=new p(h);throw c&&(f.message=c,f.generatedMessage=!0),f},k.AssertionError=p,k.ok=N,k.equal=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t!=r&&T({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},k.notEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");t==r&&T({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},k.deepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===a&&x(),a(t,r)||T({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},k.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===a&&x(),a(t,r)&&T({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},k.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===a&&x(),s(t,r)||T({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},k.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");void 0===a&&x(),s(t,r)&&T({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},k.strictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");w(t,r)||T({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},k.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new d("actual","expected");w(t,r)&&T({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var S=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&m(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function E(e,t,r,n,i,o){if(!(r in e)||!s(e[r],t[r])){if(!n){var a=new S(e,i),c=new S(t,i,e),u=new p({actual:a,expected:c,operator:"deepStrictEqual",stackStartFn:o});throw u.actual=e,u.expected=t,u.operator=o.name,u}T({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}function I(e,t,r,n){if("function"!=typeof t){if(m(t))return t.test(e);if(2===arguments.length)throw new l("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new p({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var s=Object.keys(t);if(t instanceof Error)s.push("name","message");else if(0===s.length)throw new h("error",t,"may not be an empty object");return void 0===a&&x(),s.forEach((function(i){"string"==typeof e[i]&&m(t[i])&&t[i].test(e[i])||E(e,t,i,r,s,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function A(e){if("function"!=typeof e)throw new l("fn","Function",e);try{e()}catch(e){return e}return j}function R(e){return g(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!R(t=e()))throw new f("instance of Promise","promiseFn",t)}else{if(!R(e))throw new l("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return j})).catch((function(e){return e}))}))}function L(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new l("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new u("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new u("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new l("error",["Object","Error","Function","RegExp"],r);if(t===j){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var a="rejects"===e.name?"rejection":"exception";T({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(a).concat(i),stackStartFn:e})}if(r&&!I(t,r,n,e))throw t}function D(e,t,r,n){if(t!==j){if("string"==typeof r&&(n=r,r=void 0),!r||I(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";T({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];O.apply(void 0,[P,t.length].concat(t))}k.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];L.apply(void 0,[e,A(t)].concat(n))},k.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return L.apply(void 0,[e,t].concat(n))}))},k.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,A(t)].concat(n))},k.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return D.apply(void 0,[e,t].concat(n))}))},k.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=y(t);var n=new p({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var a=i.split("\n");a.shift();for(var s=n.stack.split("\n"),c=0;c<a.length;c++){var u=s.indexOf(a[c]);if(-1!==u){s=s.slice(0,u);break}}n.stack="".concat(s.join("\n"),"\n").concat(a.join("\n"))}throw n}},k.strict=b(P,k,{equal:k.strictEqual,deepEqual:k.deepStrictEqual,notEqual:k.notStrictEqual,notDeepEqual:k.notDeepStrictEqual}),k.strict.strict=k.strict},6979:(e,t,r)=>{"use strict";var n=r(2530);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?s(e):t}function s(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e){var t="function"==typeof Map?new Map:void 0;return c=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return l(e,arguments,f(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},c(e)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function l(e,t,r){return l=u()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i},l.apply(null,arguments)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}var p=r(5663).inspect,y=r(8619).codes.ERR_INVALID_ARG_TYPE;function v(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var g="",m="",b="",w="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function k(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var j=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==d(e)||null===e)throw new y("options","Object",e);var i=e.message,o=e.operator,c=e.stackStartFn,u=e.actual,l=e.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=a(this,f(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(g="",m="",w="",b=""):(g="",m="",w="",b="")),"object"===d(u)&&null!==u&&"object"===d(l)&&null!==l&&"stack"in u&&u instanceof Error&&"stack"in l&&l instanceof Error&&(u=_(u),l=_(l)),"deepStrictEqual"===o||"strictEqual"===o)r=a(this,f(t).call(this,function(e,t,r){var i="",o="",a=0,s="",c=!1,u=k(e),l=u.split("\n"),h=k(t).split("\n"),f=0,p="";if("strictEqual"===r&&"object"===d(e)&&"object"===d(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===l.length&&1===h.length&&l[0]!==h[0]){var y=l[0].length+h[0].length;if(y<=10){if(!("object"===d(e)&&null!==e||"object"===d(t)&&null!==t||0===e&&0===t))return"".concat(x[r],"\n\n")+"".concat(l[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&y<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;l[0][f]===h[0][f];)f++;f>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",f),"^"),f=0)}}for(var _=l[l.length-1],j=h[h.length-1];_===j&&(f++<2?s="\n ".concat(_).concat(s):i=_,l.pop(),h.pop(),0!==l.length&&0!==h.length);)_=l[l.length-1],j=h[h.length-1];var T=Math.max(l.length,h.length);if(0===T){var O=u.split("\n");if(O.length>30)for(O[26]="".concat(g,"...").concat(w);O.length>27;)O.pop();return"".concat(x.notIdentical,"\n\n").concat(O.join("\n"),"\n")}f>3&&(s="\n".concat(g,"...").concat(w).concat(s),c=!0),""!==i&&(s="\n ".concat(i).concat(s),i="");var N=0,S=x[r]+"\n".concat(m,"+ actual").concat(w," ").concat(b,"- expected").concat(w),E=" ".concat(g,"...").concat(w," Lines skipped");for(f=0;f<T;f++){var I=f-a;if(l.length<f+1)I>1&&f>2&&(I>4?(o+="\n".concat(g,"...").concat(w),c=!0):I>3&&(o+="\n ".concat(h[f-2]),N++),o+="\n ".concat(h[f-1]),N++),a=f,i+="\n".concat(b,"-").concat(w," ").concat(h[f]),N++;else if(h.length<f+1)I>1&&f>2&&(I>4?(o+="\n".concat(g,"...").concat(w),c=!0):I>3&&(o+="\n ".concat(l[f-2]),N++),o+="\n ".concat(l[f-1]),N++),a=f,o+="\n".concat(m,"+").concat(w," ").concat(l[f]),N++;else{var A=h[f],R=l[f],C=R!==A&&(!v(R,",")||R.slice(0,-1)!==A);C&&v(A,",")&&A.slice(0,-1)===R&&(C=!1,R+=","),C?(I>1&&f>2&&(I>4?(o+="\n".concat(g,"...").concat(w),c=!0):I>3&&(o+="\n ".concat(l[f-2]),N++),o+="\n ".concat(l[f-1]),N++),a=f,o+="\n".concat(m,"+").concat(w," ").concat(R),i+="\n".concat(b,"-").concat(w," ").concat(A),N+=2):(o+=i,i="",1!==I&&0!==f||(o+="\n ".concat(R),N++))}if(N>20&&f<T-2)return"".concat(S).concat(E,"\n").concat(o,"\n").concat(g,"...").concat(w).concat(i,"\n")+"".concat(g,"...").concat(w)}return"".concat(S).concat(c?E:"","\n").concat(o).concat(i).concat(s).concat(p)}(u,l,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var p=x[o],j=k(u).split("\n");if("notStrictEqual"===o&&"object"===d(u)&&null!==u&&(p=x.notStrictEqualObject),j.length>30)for(j[26]="".concat(g,"...").concat(w);j.length>27;)j.pop();r=1===j.length?a(this,f(t).call(this,"".concat(p," ").concat(j[0]))):a(this,f(t).call(this,"".concat(p,"\n\n").concat(j.join("\n"),"\n")))}else{var T=k(u),O="",N=x[o];"notDeepEqual"===o||"notEqual"===o?(T="".concat(x[o],"\n\n").concat(T)).length>1024&&(T="".concat(T.slice(0,1021),"...")):(O="".concat(k(l)),T.length>512&&(T="".concat(T.slice(0,509),"...")),O.length>512&&(O="".concat(O.slice(0,509),"...")),"deepEqual"===o||"equal"===o?T="".concat(N,"\n\n").concat(T,"\n\nshould equal\n\n"):O=" ".concat(o," ").concat(O)),r=a(this,f(t).call(this,"".concat(T).concat(O)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(s(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=u,r.expected=l,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(s(r),c),r.stack,r.name="AssertionError",a(r)}var r,c;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),r=t,c=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],c&&o(r.prototype,c),t}(c(Error));e.exports=j},8619:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var a,s,c={};function u(e,t,r){r||(r=Error);var a=function(r){function a(r,o,s){var c;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),c=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(a).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,o,s))),c.code=e,c}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(a,r),a}(r);c[e]=a}function l(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}u("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),u("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,s,c,u,h;if(void 0===a&&(a=r(6118)),a("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(s="not ",t.substr(0,s.length)===s)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))c="The ".concat(e," ").concat(o," ").concat(l(t,"type"));else{var f=("number"!=typeof h&&(h=0),h+".".length>(u=e).length||-1===u.indexOf(".",h)?"argument":"property");c='The "'.concat(e,'" ').concat(f," ").concat(o," ").concat(l(t,"type"))}return c+". Received type ".concat(n(i))}),TypeError),u("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===s&&(s=r(5663));var i=s.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),u("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),u("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===a&&(a=r(6118)),a(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=c},1667:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(r.push(a.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},s=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},c=Object.is?Object.is:r(7402),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:r(8622);function h(e){return e.call.bind(e)}var f=h(Object.prototype.hasOwnProperty),d=h(Object.prototype.propertyIsEnumerable),p=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,k=y.isBoxedPrimitive,j=y.isNumberObject,T=y.isStringObject,O=y.isBooleanObject,N=y.isBigIntObject,S=y.isSymbolObject,E=y.isFloat32Array,I=y.isFloat64Array;function A(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(A).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function C(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function L(e,t,r,n){if(e===t)return 0!==e||!r||c(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&l(e)&&l(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var a,s,u,h,f=p(e);if(f!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var d=R(e),y=R(t);return d.length===y.length&&P(e,t,r,n,1,d)}if("[object Object]"===f&&(!b(e)&&b(t)||!x(e)&&x(t)))return!1;if(m(e)){if(!m(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(u=e,h=t,!(o?u.source===h.source&&u.flags===h.flags:RegExp.prototype.toString.call(u)===RegExp.prototype.toString.call(h))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(g(e)){if(r||!E(e)&&!I(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var A=R(e),L=R(t);return A.length===L.length&&P(e,t,r,n,0,A)}if(x(e))return!(!x(t)||e.size!==t.size)&&P(e,t,r,n,2);if(b(e))return!(!b(t)||e.size!==t.size)&&P(e,t,r,n,3);if(v(e)){if(s=t,(a=e).byteLength!==s.byteLength||0!==C(new Uint8Array(a),new Uint8Array(s)))return!1}else if(k(e)&&!function(e,t){return j(e)?j(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):T(e)?T(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):O(e)?O(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):N(e)?N(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):S(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return P(e,t,r,n,0)}function D(e,t){return t.filter((function(t){return d(e,t)}))}function P(e,t,r,n,i,o){if(5===arguments.length){o=Object.keys(e);var a=Object.keys(t);if(o.length!==a.length)return!1}for(var s=0;s<o.length;s++)if(!f(t,o[s]))return!1;if(r&&5===arguments.length){var c=u(e);if(0!==c.length){var l=0;for(s=0;s<c.length;s++){var h=c[s];if(d(e,h)){if(!d(t,h))return!1;o.push(h),l++}else if(d(t,h))return!1}var p=u(t);if(c.length!==p.length&&D(t,p).length!==l)return!1}else{var y=u(t);if(0!==y.length&&0!==D(t,y).length)return!1}}if(0===o.length&&(0===i||1===i&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var v=n.val1.get(e);if(void 0!==v){var g=n.val2.get(t);if(void 0!==g)return v===g}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var m=q(e,t,r,o,n,i);return n.val1.delete(e),n.val2.delete(t),m}function M(e,t,r,n){for(var i=a(e),o=0;o<i.length;o++){var s=i[o];if(L(t,s,r,n))return e.delete(s),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(l(e))return!1}return!0}function U(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function B(e,t,r,n,i){var o=F(r);if(null!=o)return o;var a=t.get(o);return!(void 0===a&&!t.has(o)||!L(n,a,!1,i))&&!e.has(o)&&L(n,a,!1,i)}function Z(e,t,r,n,i,o){for(var s=a(e),c=0;c<s.length;c++){var u=s[c];if(L(r,u,i,o)&&L(n,t.get(u),i,o))return e.delete(u),!0}return!1}function q(e,t,r,o,c,u){var l=0;if(2===u){if(!function(e,t,r,n){for(var o=null,s=a(e),c=0;c<s.length;c++){var u=s[c];if("object"===i(u)&&null!==u)null===o&&(o=new Set),o.add(u);else if(!t.has(u)){if(r)return!1;if(!U(e,t,u))return!1;null===o&&(o=new Set),o.add(u)}}if(null!==o){for(var l=a(t),h=0;h<l.length;h++){var f=l[h];if("object"===i(f)&&null!==f){if(!M(o,f,r,n))return!1}else if(!r&&!e.has(f)&&!M(o,f,r,n))return!1}return 0===o.size}return!0}(e,t,r,c))return!1}else if(3===u){if(!function(e,t,r,o){for(var a=null,c=s(e),u=0;u<c.length;u++){var l=n(c[u],2),h=l[0],f=l[1];if("object"===i(h)&&null!==h)null===a&&(a=new Set),a.add(h);else{var d=t.get(h);if(void 0===d&&!t.has(h)||!L(f,d,r,o)){if(r)return!1;if(!B(e,t,h,f,o))return!1;null===a&&(a=new Set),a.add(h)}}}if(null!==a){for(var p=s(t),y=0;y<p.length;y++){var v=n(p[y],2),g=(h=v[0],v[1]);if("object"===i(h)&&null!==h){if(!Z(a,e,h,g,r,o))return!1}else if(!(r||e.has(h)&&L(e.get(h),g,!1,o)||Z(a,e,h,g,!1,o)))return!1}return 0===a.size}return!0}(e,t,r,c))return!1}else if(1===u)for(;l<e.length;l++){if(!f(e,l)){if(f(t,l))return!1;for(var h=Object.keys(e);l<h.length;l++){var d=h[l];if(!f(t,d)||!L(e[d],t[d],r,c))return!1}return h.length===Object.keys(t).length}if(!f(t,l)||!L(e[l],t[l],r,c))return!1}for(l=0;l<o.length;l++){var p=o[l];if(!L(e[p],t[p],r,c))return!1}return!0}e.exports={isDeepEqual:function(e,t){return L(e,t,!1)},isDeepStrictEqual:function(e,t){return L(e,t,!0)}}},5155:(e,t)=>{"use strict";t.byteLength=function(e){var t=c(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=c(e),a=o[0],s=o[1],u=new i(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,h=s>0?a-4:a;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[l++]=t>>16&255,u[l++]=t>>8&255,u[l++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[l++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[l++]=t>>8&255,u[l++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],a=16383,s=0,c=n-i;s<c;s+=a)o.push(u(e,s,s+a>c?c:s+a));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,s=o.length;a<s;++a)r[a]=o[a],n[o.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,a=[],s=t;s<n;s+=3)i=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[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:(e,t,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;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function c(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|v(e,t);let n=c(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|y(e.length),r=c(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||W(e.length)?c(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return h(e),c(e<0?0:0|y(e))}function d(e){const t=e.length<0?0:0|y(e.length),r=c(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,u.prototype),n}function y(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function v(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,r);case"utf8":case"utf-8":return N(this,t,r);case"ascii":return E(this,t,r);case"latin1":case"binary":return I(this,t,r);case"base64":return O(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),W(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let o,a=1,s=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,c/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){let n=-1;for(o=r;o<s;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*a}else-1!==n&&(o-=o-n),n=-1}else for(r+c>s&&(r=s-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function x(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let a;for(n>o/2&&(n=o/2),a=0;a<n;++a){const n=parseInt(t.substr(2*a,2),16);if(W(n))return a;e[r+a]=n}return a}function _(e,t,r,n){return J(G(t,e.length-r),e,r,n)}function k(e,t,r,n){return J(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function j(e,t,r,n){return J(X(t),e,r,n)}function T(e,t,r,n){return J(function(e,t){let r,n,i;const o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)r=e.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function O(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function N(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,a=t>239?4:t>223?3:t>191?2:1;if(i+a<=r){let r,n,s,c;switch(a){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],s=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&s)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&s,c>65535&&c<1114112&&(o=c))}}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(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),u.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(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?c(e):void 0!==t?"string"==typeof r?c(e).fill(t,r):c(e).fill(t):c(e)}(e,t,r)},u.allocUnsafe=function(e){return f(e)},u.allocUnsafeSlow=function(e){return f(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(Q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=u.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=v,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?N(this,0,e):g.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},a&&(u.prototype[a]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(Q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const s=Math.min(o,a),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<s;++e)if(c[e]!==l[e]){o=c[e],a=l[e];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return k(this,e,t,r);case"base64":return j(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function E(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function A(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function L(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function D(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function P(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=K((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),u.prototype.readBigUInt64BE=K((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=K((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),u.prototype.readBigInt64BE=K((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||L(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=K((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=K((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=0,o=1,a=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);L(this,e,t,r,n-1,-n)}let i=r-1,o=1,a=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/o>>0)-a&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||L(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=K((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=K((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=u.isBuffer(e)?e:u.from(e,n),a=o.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%a]}return this};const B={};function Z(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function q(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function $(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function H(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}Z("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),Z("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),Z("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=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 ${t}. Received ${i}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let a=0;a<n;++a){if(r=e.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function W(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function K(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},7615:(e,t,r)=>{"use strict";var n=r(1801),i=r(2550),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},2550:(e,t,r)=>{"use strict";var n=r(1930),i=r(1801),o=i("%Function.prototype.apply%"),a=i("%Function.prototype.call%"),s=i("%Reflect.apply%",!0)||n.call(a,o),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=s(n,a,arguments);if(c&&u){var r=c(t,"length");r.configurable&&u(t,"length",{value:1+l(0,e.length-(arguments.length-1))})}return t};var h=function(){return s(n,o,arguments)};u?u(e.exports,"apply",{value:h}):e.exports.apply=h},8981:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>void 0===t[n]||"symbol"==typeof t[n]?r:r+(0===r.length?"":",")+e(n)+":"+e(t[n])),"")+"}"}},292:(e,t,r)=>{var n=r(5663),i=r(6118);function o(){return(new Date).getTime()}var a,s=Array.prototype.slice,c={};a=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var u=[[function(){},"log"],[function(){a.log.apply(a,arguments)},"info"],[function(){a.log.apply(a,arguments)},"warn"],[function(){a.warn.apply(a,arguments)},"error"],[function(e){c[e]=o()},"time"],[function(e){var t=c[e];if(!t)throw new Error("No such label: "+e);delete c[e];var r=o()-t;a.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),a.error(e.stack)},"trace"],[function(e){a.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=s.call(arguments,1);i.ok(!1,n.format.apply(null,t))}},"assert"]],l=0;l<u.length;l++){var h=u[l],f=h[0],d=h[1];a[d]||(a[d]=f)}e.exports=a},7297:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,a="ArrayBuffer"in e;if(a)var s=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&s.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function f(e){this.map={},e instanceof f?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function d(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function y(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():a&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):a&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=d(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?d(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(y)}),this.text=function(){var e,t,r,n=d(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=p(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}f.prototype.append=function(e,t){e=u(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},f.prototype.delete=function(e){delete this.map[u(e)]},f.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},f.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},f.prototype.set=function(e,t){this.map[u(e)]=l(t)},f.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},f.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},f.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},f.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},n&&(f.prototype[Symbol.iterator]=f.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new f(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new f(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new f(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},g.call(b.prototype),g.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new f(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function k(e,r){return new Promise((function(n,o){var a=new b(e,r);if(a.signal&&a.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new f,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;n(new x(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 t.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(e,t){s.setRequestHeader(t,e)})),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)}))}k.polyfill=!0,e.fetch||(e.fetch=k,e.Headers=f,e.Request=b,e.Response=x),t.Headers=f,t.Request=b,t.Response=x,t.fetch=k,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},9170:(e,t,r)=>{"use strict";var n=r(806),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,a=Array.prototype.concat,s=Object.defineProperty,c=s&&function(){var e={};try{for(var t in s(e,"x",{enumerable:!1,value:e}),e)return!1;return e.x===e}catch(e){return!1}}(),u=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?s(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},l=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=a.call(o,Object.getOwnPropertySymbols(t)));for(var s=0;s<o.length;s+=1)u(e,o[s],t[o[s]],r[o[s]])};l.supportsDescriptors=!!c,e.exports=l},1662:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var c=o[a],u=Object.getOwnPropertyDescriptor(i,c);void 0!==u&&u.enumerable&&(r[c]=i[c])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},4175:e=>{var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var a=0;a<o;a++)n.call(i,e[a],a,e);else for(var s in e)t.call(e,s)&&n.call(i,e[s],s,e)}},9930:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var a,s=r.call(arguments,1),c=function(){if(this instanceof a){var t=o.apply(this,s.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,s.concat(r.call(arguments)))},u=Math.max(0,o.length-s.length),l=[],h=0;h<u;h++)l.push("$"+h);if(a=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(c),o.prototype){var f=function(){};f.prototype=o.prototype,a.prototype=new f,f.prototype=null}return a}},1930:(e,t,r)=>{"use strict";var n=r(9930);e.exports=Function.prototype.bind||n},1801:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,a=TypeError,s=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var u=function(){throw new a},l=c?function(){try{return u}catch(e){try{return c(arguments,"callee").get}catch(e){return u}}}():u,h=r(9905)(),f=Object.getPrototypeOf||function(e){return e.__proto__},d={},p="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%":d,"%AsyncGenerator%":d,"%AsyncGeneratorFunction%":d,"%AsyncIteratorPrototype%":d,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":d,"%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%":p,"%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},v=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=f(i.prototype))}return y[t]=r,r},g={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=r(1930),b=r(9284),w=m.call(Function.call,Array.prototype.concat),x=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),k=m.call(Function.call,String.prototype.slice),j=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,O=function(e){var t=k(e,0,1),r=k(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,j,(function(e,t,r,i){n[n.length]=r?_(i,T,"$1"):t||e})),n},N=function(e,t){var r,n=e;if(b(g,n)&&(n="%"+(r=g[n])[0]+"%"),b(y,n)){var o=y[n];if(o===d&&(o=v(n)),void 0===o&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');var r=O(e),n=r.length>0?r[0]:"",o=N("%"+n+"%",t),s=o.name,u=o.value,l=!1,h=o.alias;h&&(n=h[0],x(r,w([0,1],h)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],v=k(p,0,1),g=k(p,-1);if(('"'===v||"'"===v||"`"===v||'"'===g||"'"===g||"`"===g)&&v!==g)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&d||(l=!0),b(y,s="%"+(n+="."+p)+"%"))u=y[s];else if(null!=u){if(!(p in u)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&f+1>=r.length){var m=c(u,p);u=(d=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[p]}else d=b(u,p),u=u[p];d&&!l&&(y[s]=u)}}return u}},9905:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4111:(e,t,r)=>{"use strict";var n=r(5682);e.exports=function(){return n()&&!!Symbol.toStringTag}},9284:(e,t,r)=>{"use strict";var n=r(1930);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4525:(e,t)=>{t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,c=(1<<s)-1,u=c>>1,l=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-l)-1,d>>=-l,l+=s;l>0;o=256*o+e[t+h],h+=f,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+e[t+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=u}return(d?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,c,u=8*o-i-1,l=(1<<u)-1,h=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-a))<1&&(a--,c*=2),(t+=a+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(a++,c/=2),a+h>=l?(s=0,a=l):a+h>=1?(s=(t*c-1)*Math.pow(2,i),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<<i|s,u+=i;u>0;e[r+d]=255&a,d+=p,a/=256,u-=8);e[r+d-p]|=128*y}},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7092:(e,t,r)=>{"use strict";var n=r(4111)(),i=r(7615)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},a=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},s=function(){return o(arguments)}();o.isLegacyArguments=a,e.exports=s?o:a},7427:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(4111)(),c=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(o.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===i.call(e);if(!c)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&c(t)}return c(e)===n}},2100:e=>{"use strict";e.exports=function(e){return e!=e}},8622:(e,t,r)=>{"use strict";var n=r(2550),i=r(9170),o=r(2100),a=r(4358),s=r(6232),c=n(a(),Number);i(c,{getPolyfill:a,implementation:o,shim:s}),e.exports=c},4358:(e,t,r)=>{"use strict";var n=r(2100);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6232:(e,t,r)=>{"use strict";var n=r(9170),i=r(4358);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2527:(e,t,r)=>{"use strict";var n=r(4175),i=r(4343),o=r(7615),a=o("Object.prototype.toString"),s=r(4111)(),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),l=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},h=o("String.prototype.slice"),f={},d=r(7065),p=Object.getPrototypeOf;s&&d&&p&&n(u,(function(e){var t=new c[e];if(Symbol.toStringTag in t){var r=p(t),n=d(r,Symbol.toStringTag);if(!n){var i=p(r);n=d(i,Symbol.toStringTag)}f[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!s||!(Symbol.toStringTag in e)){var t=h(a(e),8,-1);return l(u,t)>-1}return!!d&&function(e){var t=!1;return n(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},5777:(e,t,r)=>{"use strict";const{isArray:n,isObject:i,isString:o}=r(8285),{asArray:a}=r(2621),{prependBase:s}=r(3866),c=r(9699),u=r(1898);function l(e){throw new c("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function h({context:e,base:t}){if(!e)return;const r=e["@context"];if(o(r))e["@context"]=s(t,r);else if(n(r))for(let e=0;e<r.length;++e){const n=r[e];o(n)?r[e]=s(t,n):i(n)&&h({context:{"@context":n},base:t})}else if(i(r))for(const e in r)h({context:r[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:r,base:s,cycles:c=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=a(t);const h=[];for(const a of t){if(o(a)){let t=this._get(a);t||(t=await this._resolveRemoteContext({activeCtx:e,url:a,documentLoader:r,base:s,cycles:c})),n(t)?h.push(...t):h.push(t);continue}if(null===a){h.push(new u({document:null}));continue}i(a)||l(t);const f=JSON.stringify(a);let d=this._get(f);d||(d=new u({document:a}),this._cacheResolvedContext({key:f,resolved:d,tag:"static"})),h.push(d)}return h}_get(e){let t=this.perOpCache.get(e);if(!t){const r=this.sharedCache.get(e);r&&(t=r.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:r}){if(this.perOpCache.set(e,t),void 0!==r){let n=this.sharedCache.get(e);n||(n=new Map,this.sharedCache.set(e,n)),n.set(r,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:r,base:n,cycles:i}){t=s(n,t);const{context:o,remoteDoc:a}=await this._fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:i});h({context:o,base:n=a.documentUrl||t});const c=await this.resolve({activeCtx:e,context:o,documentLoader:r,base:n,cycles:i});return this._cacheResolvedContext({key:t,resolved:c,tag:a.tag}),c}async _fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:a}){if(a.size>10)throw new c("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(a.has(t))throw new c("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let s,u;a.add(t);try{u=await r(t),s=u.document||null,o(s)&&(s=JSON.parse(s))}catch(e){throw new c("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!i(s))throw new c("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return s="@context"in s?{"@context":s["@context"]}:{"@context":{}},u.contextUrl&&(n(s["@context"])||(s["@context"]=[s["@context"]]),s["@context"].push(u.contextUrl)),{context:s,remoteDoc:u}}}},9699:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}}},7298:e=>{"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},7990:(e,t,r)=>{"use strict";e.exports=r(2948).NQuads},3114:e=>{"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},1898:(e,t,r)=>{"use strict";const n=r(3666);e.exports=class{constructor({document:e}){this.document=e,this.cache=new n({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},120:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isString:a,isUndefined:s}=r(8285),{isList:c,isValue:u,isGraph:l,isSimpleGraph:h,isSubjectReference:f}=r(478),{expandIri:d,getContextValue:p,isKeyword:y,process:v,processingMode:g}=r(2182),{removeBase:m,prependBase:b}=r(3866),{addValue:w,asArray:x,compareShortestLeast:_}=r(2621),k={};function j(e,t,r){if("@nest"!==d(e,t,{vocab:!0},r))throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=k,k.compact=async({activeCtx:e,activeProperty:t=null,element:r,options:d={},compactionMap:m=(()=>{})})=>{if(i(r)){let n=[];for(let i=0;i<r.length;++i){let o=await k.compact({activeCtx:e,activeProperty:t,element:r[i],options:d,compactionMap:m});null===o&&(o=await m({unmappedValue:r[i],activeCtx:e,activeProperty:t,parent:r,index:i,options:d}),void 0===o)||n.push(o)}return d.compactArrays&&1===n.length&&0===(p(e,t,"@container")||[]).length&&(n=n[0]),n}const b=p(e,t,"@context");if(s(b)||(e=await v({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:d})),o(r)){if(d.link&&"@id"in r&&d.link.hasOwnProperty(r["@id"])){const e=d.link[r["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===r)return e[t].compacted}if(u(r)||f(r)){const n=k.compactValue({activeCtx:e,activeProperty:t,value:r,options:d});return d.link&&f(r)&&(d.link.hasOwnProperty(r["@id"])||(d.link[r["@id"]]=[]),d.link[r["@id"]].push({expanded:r,compacted:n})),n}if(c(r)&&(p(e,t,"@container")||[]).includes("@list"))return k.compact({activeCtx:e,activeProperty:t,element:r["@list"],options:d,compactionMap:m});const b="@reverse"===t,_={},T=e;u(r)||f(r)||(e=e.revertToPreviousContext());const O=p(T,t,"@context");s(O)||(e=await v({activeCtx:e,localCtx:O,propagate:!0,overrideProtected:!0,options:d})),d.link&&"@id"in r&&(d.link.hasOwnProperty(r["@id"])||(d.link[r["@id"]]=[]),d.link[r["@id"]].push({expanded:r,compacted:_}));let N=r["@type"]||[];N.length>1&&(N=Array.from(N).sort());const S=e;for(const t of N){const r=k.compactIri({activeCtx:S,iri:t,relativeTo:{vocab:!0}}),n=p(T,r,"@context");s(n)||(e=await v({activeCtx:e,localCtx:n,options:d,propagate:!1}))}const E=Object.keys(r).sort();for(const s of E){const f=r[s];if("@id"!==s)if("@type"!==s)if("@reverse"!==s)if("@preserve"!==s)if("@index"!==s)if("@graph"!==s&&"@list"!==s&&"@included"!==s&&y(s)){const t=k.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(_,t,f)}else{if(!i(f))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===f.length){const t=k.compactIri({activeCtx:e,iri:s,value:f,relativeTo:{vocab:!0},reverse:b}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let n=_;r&&(j(e,r,d),o(_[r])||(_[r]={}),n=_[r]),w(n,t,f,{propertyIsArray:!0})}for(const t of f){const r=k.compactIri({activeCtx:e,iri:s,value:t,relativeTo:{vocab:!0},reverse:b}),n=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let f=_;n&&(j(e,n,d),o(_[n])||(_[n]={}),f=_[n]);const y=p(e,r,"@container")||[],v=l(t),g=c(t);let T;g?T=t["@list"]:v&&(T=t["@graph"]);let O=await k.compact({activeCtx:e,activeProperty:r,element:g||v?T:t,options:d,compactionMap:m});if(g){if(i(O)||(O=[O]),y.includes("@list")){w(f,r,O,{valueIsArray:!0,allowDuplicate:!0});continue}O={[k.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:O},"@index"in t&&(O[k.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(v)if(y.includes("@graph")&&(y.includes("@id")||y.includes("@index")&&h(t))){let n;f.hasOwnProperty(r)?n=f[r]:f[r]=n={};const i=(y.includes("@id")?t["@id"]:t["@index"])||k.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});w(n,i,O,{propertyIsArray:!d.compactArrays||y.includes("@set")})}else y.includes("@graph")&&h(t)?(i(O)&&O.length>1&&(O={"@included":O}),w(f,r,O,{propertyIsArray:!d.compactArrays||y.includes("@set")})):(i(O)&&1===O.length&&d.compactArrays&&(O=O[0]),O={[k.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:O},"@id"in t&&(O[k.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(O[k.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),w(f,r,O,{propertyIsArray:!d.compactArrays||y.includes("@set")}));else if(y.includes("@language")||y.includes("@index")||y.includes("@id")||y.includes("@type")){let n,i;if(f.hasOwnProperty(r)?n=f[r]:f[r]=n={},y.includes("@language"))u(O)&&(O=O["@value"]),i=t["@language"];else if(y.includes("@index")){const n=p(e,r,"@index")||"@index",o=k.compactIri({activeCtx:e,iri:n,relativeTo:{vocab:!0}});if("@index"===n)i=t["@index"],delete O[o];else{let e;if([i,...e]=x(O[n]||[]),a(i))switch(e.length){case 0:delete O[n];break;case 1:O[n]=e[0];break;default:O[n]=e}else i=null}}else if(y.includes("@id")){const t=k.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=O[t],delete O[t]}else if(y.includes("@type")){const n=k.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=x(O[n]||[]),o.length){case 0:delete O[n];break;case 1:O[n]=o[0];break;default:O[n]=o}1===Object.keys(O).length&&"@id"in t&&(O=await k.compact({activeCtx:e,activeProperty:r,element:{"@id":t["@id"]},options:d,compactionMap:m}))}i||(i=k.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),w(n,i,O,{propertyIsArray:y.includes("@set")})}else{const e=!d.compactArrays||y.includes("@set")||y.includes("@list")||i(O)&&0===O.length||"@list"===s||"@graph"===s;w(f,r,O,{propertyIsArray:e})}}}else{if((p(e,t,"@container")||[]).includes("@index"))continue;const r=k.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(_,r,f)}else{const r=await k.compact({activeCtx:e,activeProperty:t,element:f,options:d,compactionMap:m});i(r)&&0===r.length||w(_,s,r)}else{const t=await k.compact({activeCtx:e,activeProperty:"@reverse",element:f,options:d,compactionMap:m});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const n=t[r],i=(p(e,r,"@container")||[]).includes("@set")||!d.compactArrays;w(_,r,n,{propertyIsArray:i}),delete t[r]}if(Object.keys(t).length>0){const r=k.compactIri({activeCtx:e,iri:s,relativeTo:{vocab:!0}});w(_,r,t)}}else{let t=x(f).map((e=>k.compactIri({activeCtx:T,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const r=k.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),n=(p(e,r,"@container")||[]).includes("@set")&&g(e,1.1)||i(t)&&0===f.length;w(_,r,t,{propertyIsArray:n})}else{let t=x(f).map((t=>k.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:d.base})));1===t.length&&(t=t[0]),_[k.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return _}return r},k.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:i={vocab:!1},reverse:a=!1,base:s=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const h=e.getInverse();if(y(t)&&t in h&&"@none"in h[t]&&"@type"in h[t]["@none"]&&"@none"in h[t]["@none"]["@type"])return h[t]["@none"]["@type"]["@none"];if(i.vocab&&t in h){const n=e["@language"]||"@none",i=[];o(r)&&"@index"in r&&!("@graph"in r)&&i.push("@index","@index@set"),o(r)&&"@preserve"in r&&(r=r["@preserve"][0]),l(r)?("@index"in r&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in r||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||i.push("@graph@id","@graph@id@set")):o(r)&&!u(r)&&i.push("@id","@id@set","@type","@set@type");let s="@language",h="@null";if(a)s="@type",h="@reverse",i.push("@set");else if(c(r)){"@index"in r||i.push("@list");const e=r["@list"];if(0===e.length)s="@any",h="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;n<e.length;++n){const i=e[n];let o="@none",a="@none";if(u(i)?"@direction"in i?o=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?o=i["@language"].toLowerCase():"@type"in i?a=i["@type"]:o="@null":a="@id",null===t?t=o:o!==t&&u(i)&&(t="@none"),null===r?r=a:a!==r&&(r="@none"),"@none"===t&&"@none"===r)break}t=t||"@none",r=r||"@none","@none"!==r?(s="@type",h=r):h=t}}else{if(u(r))if("@language"in r&&!("@index"in r)){i.push("@language","@language@set"),h=r["@language"];const e=r["@direction"];e&&(h=`${h}_${e}`)}else"@direction"in r&&!("@index"in r)?h=`_${r["@direction"]}`:"@type"in r&&(s="@type",h=r["@type"]);else s="@type",h="@id";i.push("@set")}i.push("@none"),o(r)&&!("@index"in r)&&i.push("@index","@index@set"),u(r)&&1===Object.keys(r).length&&i.push("@language","@language@set");const f=function(e,t,r,n,i,a){null===a&&(a="@null");const s=[];if(("@id"===a||"@reverse"===a)&&o(r)&&"@id"in r){"@reverse"===a&&s.push("@reverse");const t=k.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===r["@id"]?s.push.apply(s,["@vocab","@id"]):s.push.apply(s,["@id","@vocab"])}else{s.push(a);const e=s.find((e=>e.includes("_")));e&&s.push(e.replace(/^[^_]+_/,"_"))}s.push("@none");const c=e.inverse[t];for(const e of n){if(!(e in c))continue;const t=c[e][i];for(const e of s)if(e in t)return t[e]}return null}(e,t,r,i,s,h);if(null!==f)return f}if(i.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let f=null;const d=[];let p=e.fastCurieMap;const v=t.length-1;for(let e=0;e<v&&t[e]in p;++e)p=p[t[e]],""in p&&d.push(p[""][0]);for(let n=d.length-1;n>=0;--n){const i=d[n],o=i.terms;for(const n of o){const o=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(o)||null===r&&e.mappings.get(o)["@id"]===t)&&(null===f||_(o,f)<0)&&(f=o)}}if(null!==f)return f;for(const[r,i]of e.mappings)if(i&&i._prefix&&t.startsWith(r+":"))throw new n(`Absolute IRI "${t}" confused with prefix "${r}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});return i.vocab?t:"@base"in e?e["@base"]?m(b(s,e["@base"]),t):t:m(s,t)},k.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(u(r)){const n=p(e,t,"@type"),i=p(e,t,"@language"),o=p(e,t,"@direction"),s=p(e,t,"@container")||[],c="@index"in r&&!s.includes("@index");if(!c&&"@none"!==n){if(r["@type"]===n)return r["@value"];if("@language"in r&&r["@language"]===i&&"@direction"in r&&r["@direction"]===o)return r["@value"];if("@language"in r&&r["@language"]===i)return r["@value"];if("@direction"in r&&r["@direction"]===o)return r["@value"]}const u=Object.keys(r).length,l=1===u||2===u&&"@index"in r&&!c,h="@language"in e,f=a(r["@value"]),d=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(l&&"@none"!==n&&(!h||!f||d))return r["@value"];const y={};return c&&(y[k.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?y[k.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=k.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(y[k.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(y[k.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),y[k.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],y}const i=d(e,t,{vocab:!0},n),o=p(e,t,"@type"),s=k.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===o},base:n.base});return"@id"===o||"@vocab"===o||"@graph"===i?s:{[k.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:s}}},2445:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},2182:(e,t,r)=>{"use strict";var n=r(292);const i=r(2621),o=r(9699),{isArray:a,isObject:s,isString:c,isUndefined:u}=r(8285),{isAbsolute:l,isRelative:h,prependBase:f}=r(3866),{asArray:d,compareShortestLeast:p}=r(2621),y=new Map,v=/^@[a-zA-Z]+$/,g={};function m(e,t,r,n,i,o){if(null===t||!c(t)||g.isKeyword(t))return t;if(t.match(v))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&g.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:o}),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(s(r)&&"@id"in r)return r["@id"]}const a=t.indexOf(":");if(a>0){const r=t.substr(0,a),s=t.substr(a+1);if("_"===r||0===s.indexOf("//"))return t;n&&n.hasOwnProperty(r)&&g.createTermDefinition({activeCtx:e,localCtx:n,term:r,defined:i,options:o});const c=e.mappings.get(r);if(c&&c._prefix)return c["@id"]+s;if(l(t))return t}if(r.vocab&&"@vocab"in e)return e["@vocab"]+t;if(r.base&&"@base"in e){if(e["@base"])return f(f(o.base,e["@base"]),t)}else if(r.base)return f(o.base,t);return t}function b(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!b(e[r],t[r]))return!1;return!0}const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r in e){let n=e[r],i=t[r];if("@container"===r&&Array.isArray(n)&&Array.isArray(i)&&(n=n.slice().sort(),i=i.slice().sort()),!b(n,i))return!1}return!0}e.exports=g,g.process=async({activeCtx:e,localCtx:t,options:r,propagate:u=!0,overrideProtected:p=!1,cycles:y=new Set})=>{if(s(t)&&"@context"in t&&a(t["@context"])&&(t=t["@context"]),0===d(t).length)return e;const v=await r.contextResolver.resolve({activeCtx:e,context:t,documentLoader:r.documentLoader,base:r.base});s(v[0].document)&&"boolean"==typeof v[0].document["@propagate"]&&(u=v[0].document["@propagate"]);let b=e;u||b.previousContext||(b=b.clone(),b.previousContext=e);for(const a of v){let{document:u}=a;if(e=b,null===u){if(!p&&0!==Object.keys(e.protected).length){const s=r&&r.protectedMode||"error";if("error"===s)throw new o("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===s){n.warn("WARNING: invalid context nullification");const t=a.getProcessed(e);if(t){b=e=t;continue}const o=e;b=e=g.getInitialContext(r).clone();for(const[t,r]of Object.entries(o.protected))r&&(e.mappings[t]=i.clone(o.mappings[t]));e.protected=i.clone(o.protected),a.setProcessed(o,b);continue}throw new o("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,protectedMode:s})}b=e=g.getInitialContext(r).clone();continue}const d=a.getProcessed(e);if(d){b=e=d;continue}if(s(u)&&"@context"in u&&(u=u["@context"]),!s(u))throw new o("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:u});b=b.clone();const v=new Map;if("@version"in u){if(1.1!==u["@version"])throw new o("Unsupported JSON-LD version: "+u["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:u});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new o("@version: "+u["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:u});b.processingMode="json-ld-1.1",b["@version"]=u["@version"],v.set("@version",!0)}if(b.processingMode=b.processingMode||e.processingMode,"@base"in u){let e=u["@base"];if(null===e||l(e));else{if(!h(e))throw new o('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:u});e=f(b["@base"],e)}b["@base"]=e,v.set("@base",!0)}if("@vocab"in u){const e=u["@vocab"];if(null===e)delete b["@vocab"];else{if(!c(e))throw new o('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});if(!l(e)&&g.processingMode(b,1))throw new o('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:u});b["@vocab"]=m(b,e,{vocab:!0,base:!0},void 0,void 0,r)}v.set("@vocab",!0)}if("@language"in u){const e=u["@language"];if(null===e)delete b["@language"];else{if(!c(e))throw new o('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:u});b["@language"]=e.toLowerCase()}v.set("@language",!0)}if("@direction"in u){const t=u["@direction"];if("json-ld-1.0"===e.processingMode)throw new o("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:u});if(null===t)delete b["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new o('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:u});b["@direction"]=t}v.set("@direction",!0)}if("@propagate"in u){const r=u["@propagate"];if("json-ld-1.0"===e.processingMode)throw new o("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if("boolean"!=typeof r)throw new o("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});v.set("@propagate",!0)}if("@import"in u){const n=u["@import"];if("json-ld-1.0"===e.processingMode)throw new o("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:u});if(!c(n))throw new o("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const i=await r.contextResolver.resolve({activeCtx:e,context:n,documentLoader:r.documentLoader,base:r.base});if(1!==i.length)throw new o("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const a=i[0].getProcessed(e);if(a)u=a;else{const r=i[0].document;if("@import"in r)throw new o("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in r)u.hasOwnProperty(e)||(u[e]=r[e]);i[0].setProcessed(e,u)}v.set("@import",!0)}v.set("@protected",u["@protected"]||!1);for(const e in u)if(g.createTermDefinition({activeCtx:b,localCtx:u,term:e,defined:v,options:r,overrideProtected:p}),s(u[e])&&"@context"in u[e]){const t=u[e]["@context"];let n=!0;if(c(t)){const e=f(r.base,t);y.has(e)?n=!1:y.add(e)}if(n)try{await g.process({activeCtx:b.clone(),localCtx:u[e]["@context"],overrideProtected:!0,options:r,cycles:y})}catch(t){throw new o("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:u[e]["@context"],term:e})}}a.setProcessed(e,b)}return b},g.createTermDefinition=({activeCtx:e,localCtx:t,term:r,defined:i,options:u,overrideProtected:h=!1})=>{if(i.has(r)){if(i.get(r))return;throw new o("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}let f;if(i.set(r,!1),t.hasOwnProperty(r)&&(f=t[r]),"@type"===r&&s(f)&&"@set"===(f["@container"]||"@set")&&g.processingMode(e,1.1)){const e=["@container","@id","@protected"],n=Object.keys(f);if(0===n.length||n.some((t=>!e.includes(t))))throw new o("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r})}else{if(g.isKeyword(r))throw new o("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(r.match(v))return void n.warn('WARNING: terms beginning with "@" are reserved for future use and ignored',{term:r});if(""===r)throw new o("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const d=e.mappings.get(r);e.mappings.has(r)&&e.mappings.delete(r);let p=!1;if((c(f)||null===f)&&(p=!0,f={"@id":f}),!s(f))throw new o("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const y={};e.mappings.set(r,y),y.reverse=!1;const w=["@container","@id","@language","@reverse","@type"];g.processingMode(e,1.1)&&w.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in f)if(!w.includes(e))throw new o("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const x=r.indexOf(":");if(y._termHasColon=x>0,"@reverse"in f){if("@id"in f)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in f)throw new o("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const a=f["@reverse"];if(!c(a))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(!g.isKeyword(a)&&a.match(v))return n.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{reverse:a}),void(d?e.mappings.set(r,d):e.mappings.delete(r));const s=m(e,a,{vocab:!0,base:!1},t,i,u);if(!l(s))throw new o("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=s,y.reverse=!0}else if("@id"in f){let a=f["@id"];if(a&&!c(a))throw new o("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===a)y["@id"]=null;else{if(!g.isKeyword(a)&&a.match(v))return n.warn('WARNING: values beginning with "@" are reserved for future use and ignored',{id:a}),void(d?e.mappings.set(r,d):e.mappings.delete(r));if(a!==r){if(a=m(e,a,{vocab:!0,base:!1},t,i,u),!l(a)&&!g.isKeyword(a))throw new o("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(r.match(/(?::[^:])|\//)&&m(e,r,{vocab:!0,base:!1},t,new Map(i).set(r,!0),u)!==a)throw new o("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=a,y._prefix=p&&!y._termHasColon&&a.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const n=r.substr(0,x);if(t.hasOwnProperty(n)&&g.createTermDefinition({activeCtx:e,localCtx:t,term:n,defined:i,options:u}),e.mappings.has(n)){const t=r.substr(x+1);y["@id"]=e.mappings.get(n)["@id"]+t}else y["@id"]=r}else if("@type"===r)y["@id"]=r;else{if(!("@vocab"in e))throw new o("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});y["@id"]=e["@vocab"]+r}if((!0===f["@protected"]||!0===i.get("@protected")&&!1!==f["@protected"])&&(e.protected[r]=!0,y.protected=!0),i.set(r,!0),"@type"in f){let r=f["@type"];if(!c(r))throw new o("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===r||"@none"===r){if(g.processingMode(e,1))throw new o(`Invalid JSON-LD syntax; an @context @type value must not be "${r}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==r&&"@vocab"!==r){if(r=m(e,r,{vocab:!0,base:!1},t,i,u),!l(r))throw new o("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===r.indexOf("_:"))throw new o("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}y["@type"]=r}if("@container"in f){const r=c(f["@container"])?[f["@container"]]:f["@container"]||[],n=["@list","@set","@index","@language"];let i=!0;const s=r.includes("@set");if(g.processingMode(e,1.1)){if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.length)throw new o("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(r.includes("@graph")){if(r.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new o("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else i&=r.length<=(s?2:1);if(r.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new o("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else i&=!a(f["@container"]),i&=r.length<=1;if(i&=r.every((e=>n.includes(e))),i&=!(s&&r.includes("@list")),!i)throw new o("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(y.reverse&&!r.every((e=>["@index","@set"].includes(e))))throw new o("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});y["@container"]=r}if("@index"in f){if(!("@container"in f)||!y["@container"].includes("@index"))throw new o(`Invalid JSON-LD syntax; @index without @index in @container: "${f["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!c(f["@index"])||0===f["@index"].indexOf("@"))throw new o(`Invalid JSON-LD syntax; @index must expand to an IRI: "${f["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=f["@index"]}if("@context"in f&&(y["@context"]=f["@context"]),"@language"in f&&!("@type"in f)){let e=f["@language"];if(null!==e&&!c(e))throw new o("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),y["@language"]=e}if("@prefix"in f){if(r.match(/:|\//))throw new o("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(g.isKeyword(y["@id"]))throw new o("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof f["@prefix"])throw new o("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});y._prefix=!0===f["@prefix"]}if("@direction"in f){const e=f["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new o('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});y["@direction"]=e}if("@nest"in f){const e=f["@nest"];if(!c(e)||"@nest"!==e&&0===e.indexOf("@"))throw new o("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});y["@nest"]=e}const _=y["@id"];if("@context"===_||"@preserve"===_)throw new o("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(d&&d.protected&&!h&&(e.protected[r]=!0,y.protected=!0,!b(d,y))){const e=u&&u.protectedMode||"error";if("error"===e)throw new o(`Invalid JSON-LD syntax; tried to redefine "${r}" which is a protected term.`,"jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r});if("warn"===e)return void n.warn("WARNING: protected term redefinition",{term:r});throw new o("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:r,protectedMode:e})}},g.expandIri=(e,t,r,n)=>m(e,t,r,void 0,void 0,n),g.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),r=y.get(t);if(r)return r;const n={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=(e["@language"]||"@none").toLowerCase(),s=e["@direction"],c=e.mappings,u=[...c.keys()].sort(p);for(const e of u){const o=c.get(e);if(null===o)continue;let u=o["@container"]||"@none";if(u=[].concat(u).sort().join(""),null===o["@id"])continue;const l=d(o["@id"]);for(const c of l){let l=t[c];const h=g.isKeyword(c);if(l)h||o._termHasColon||n[c].push(e);else if(t[c]=l={},!h&&!o._termHasColon){n[c]=[e];const t={iri:c,terms:n[c]};c[0]in r?r[c[0]].push(t):r[c[0]]=[t]}if(l[u]||(l[u]={"@language":{},"@type":{},"@any":{}}),l=l[u],a(e,l["@any"],"@none"),o.reverse)a(e,l["@type"],"@reverse");else if("@none"===o["@type"])a(e,l["@any"],"@none"),a(e,l["@language"],"@none"),a(e,l["@type"],"@none");else if("@type"in o)a(e,l["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const t=o["@language"],r=o["@direction"];a(e,l["@language"],t&&r?`${t}_${r}`.toLowerCase():t?t.toLowerCase():r?`_${r}`:"@null")}else"@language"in o?a(e,l["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?o["@direction"]?a(e,l["@language"],`_${o["@direction"]}`):a(e,l["@language"],"@none"):s?(a(e,l["@language"],`_${s}`),a(e,l["@language"],"@none"),a(e,l["@type"],"@none")):(a(e,l["@language"],i),a(e,l["@language"],"@none"),a(e,l["@type"],"@none"))}}for(const e in r)o(r,e,1);return t},clone:function(){const e={};return e.mappings=i.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=i.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===y.size&&y.clear(),y.set(t,n),n;function o(e,t,r){const n=e[t],i=e[t]={};let a,s;for(const e of n)a=e.iri,s=r>=a.length?"":a[r],s in i?i[s].push(e):i[s]=[e];for(const e in i)""!==e&&o(i,e,r+1)}function a(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},g.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(u(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&r in e||"@direction"===r&&r in e?e[r]:"@context"!==r?null:void 0},g.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,g.isKeyword=e=>{if(!c(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},2872:(e,t,r)=>{"use strict";const{parseLinkHeader:n,buildHeaders:i}=r(2621),{LINK_HEADER_CONTEXT:o}=r(2445),a=r(9699),s=r(3114),{prependBase:c}=r(3866),u=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:r}={headers:{}})=>(t=i(t),(new s).wrapLoader((async function i(s){if(0!==s.indexOf("http:")&&0!==s.indexOf("https:"))throw new a('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:s});if(e&&0!==s.indexOf("https"))throw new a('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:s});let l;try{l=await function(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()}))}(r,s,t)}catch(e){throw new a("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:s,cause:e})}if(l.status>=400)throw new a("URL could not be dereferenced: "+l.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:s,httpStatusCode:l.status});let h={contextUrl:null,documentUrl:s,document:l.response},f=null;const d=l.getResponseHeader("Content-Type");let p;if(u.test(l.getAllResponseHeaders())&&(p=l.getResponseHeader("Link")),p&&"application/ld+json"!==d){const e=n(p),t=e[o];if(Array.isArray(t))throw new a("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:s});t&&(h.contextUrl=t.target),f=e.alternate,f&&"application/ld+json"==f.type&&!(d||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(c(s,f.target)))}return h})))},570:(e,t,r)=>{"use strict";var n=r(292);const i=r(9699),{isArray:o,isObject:a,isEmptyObject:s,isString:c,isUndefined:u}=r(8285),{isList:l,isValue:h,isGraph:f,isSubject:d}=r(478),{expandIri:p,getContextValue:y,isKeyword:v,process:g,processingMode:m}=r(2182),{isAbsolute:b}=r(3866),{addValue:w,asArray:x,getValues:_,validateTypeValue:k}=r(2621),j={};e.exports=j;const T=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/;async function O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:f,expandedParent:_,options:N={},insideList:I,typeKey:A,typeScopedContext:R,expansionMap:C}){const L=Object.keys(f).sort(),D=[];let P;const M=f[A]&&"@json"===p(e,o(f[A])?f[A][0]:f[A],{vocab:!0},N);for(const O of L){let A,L=f[O];if("@context"===O)continue;let F=p(e,O,{vocab:!0},N);if((null===F||!b(F)&&!v(F))&&(F=C({unmappedProperty:O,activeCtx:e,activeProperty:t,parent:f,options:N,insideList:I,value:L,expandedParent:_}),void 0===F))continue;if(v(F)){if("@reverse"===r)throw new i("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:L});if(F in _&&"@included"!==F&&"@type"!==F)throw new i("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:F})}if("@id"===F){if(!c(L)){if(!N.isFrame)throw new i('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(a(L)){if(!s(L))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}else{if(!o(L))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(!L.every((e=>c(e))))throw new i('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}}w(_,"@id",x(L).map((t=>c(t)?p(e,t,{base:!0},N):t)),{propertyIsArray:N.isFrame});continue}if("@type"===F){a(L)&&(L=Object.fromEntries(Object.entries(L).map((([e,t])=>[p(R,e,{vocab:!0}),x(t).map((e=>p(R,e,{base:!0,vocab:!0})))])))),k(L,N.isFrame),w(_,"@type",x(L).map((e=>c(e)?p(R,e,{base:!0,vocab:!0},N):e)),{propertyIsArray:N.isFrame});continue}if("@included"===F&&m(e,1.1)){const r=x(await j.expand({activeCtx:e,activeProperty:t,element:L,options:N,expansionMap:C}));if(!r.every((e=>d(e))))throw new i("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:L});w(_,"@included",r,{propertyIsArray:!0});continue}if("@graph"===F&&!a(L)&&!o(L))throw new i('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:L});if("@value"===F){P=L,M&&m(e,1.1)?_["@value"]=L:w(_,"@value",L,{propertyIsArray:N.isFrame});continue}if("@language"===F){if(null===L)continue;if(!c(L)&&!N.isFrame)throw new i('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:L});L=x(L).map((e=>c(e)?e.toLowerCase():e));for(const e of L)c(e)&&!e.match(T)&&n.warn(`@language must be valid BCP47: ${e}`);w(_,"@language",L,{propertyIsArray:N.isFrame});continue}if("@direction"===F){if(!c(L)&&!N.isFrame)throw new i('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:L});L=x(L);for(const e of L)if(c(e)&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:L});w(_,"@direction",L,{propertyIsArray:N.isFrame});continue}if("@index"===F){if(!c(L))throw new i('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:L});w(_,"@index",L);continue}if("@reverse"===F){if(!a(L))throw new i('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:L});if(A=await j.expand({activeCtx:e,activeProperty:"@reverse",element:L,options:N,expansionMap:C}),"@reverse"in A)for(const e in A["@reverse"])w(_,e,A["@reverse"][e],{propertyIsArray:!0});let t=_["@reverse"]||null;for(const e in A){if("@reverse"===e)continue;null===t&&(t=_["@reverse"]={}),w(t,e,[],{propertyIsArray:!0});const r=A[e];for(let n=0;n<r.length;++n){const o=r[n];if(h(o)||l(o))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:A});w(t,e,o,{propertyIsArray:!0})}}continue}if("@nest"===F){D.push(O);continue}let U=e;const B=y(e,O,"@context");u(B)||(U=await g({activeCtx:e,localCtx:B,propagate:!0,overrideProtected:!0,options:N}));const Z=y(U,O,"@container")||[];if(Z.includes("@language")&&a(L))A=S(U,L,y(U,O,"@direction"),N);else if(Z.includes("@index")&&a(L)){const t=Z.includes("@graph"),r=y(U,O,"@index")||"@index",n="@index"!==r&&p(e,r,{vocab:!0},N);A=await E({activeCtx:U,options:N,activeProperty:O,value:L,expansionMap:C,asGraph:t,indexKey:r,propertyIndex:n})}else if(Z.includes("@id")&&a(L)){const e=Z.includes("@graph");A=await E({activeCtx:U,options:N,activeProperty:O,value:L,expansionMap:C,asGraph:e,indexKey:"@id"})}else if(Z.includes("@type")&&a(L))A=await E({activeCtx:U.revertToPreviousContext(),options:N,activeProperty:O,value:L,expansionMap:C,asGraph:!1,indexKey:"@type"});else{const n="@list"===F;if(n||"@set"===F){let e=t;n&&"@graph"===r&&(e=null),A=await j.expand({activeCtx:U,activeProperty:e,element:L,options:N,insideList:n,expansionMap:C})}else A="@json"===y(e,O,"@type")?{"@type":"@json","@value":L}:await j.expand({activeCtx:U,activeProperty:O,element:L,options:N,insideList:!1,expansionMap:C})}if(null!==A||"@value"===F||(A=C({unmappedValue:L,expandedProperty:F,activeCtx:U,activeProperty:t,parent:f,options:N,insideList:I,key:O,expandedParent:_}),void 0!==A))if("@list"!==F&&!l(A)&&Z.includes("@list")&&(A={"@list":x(A)}),Z.includes("@graph")&&!Z.some((e=>"@id"===e||"@index"===e))&&(A=x(A).map((e=>({"@graph":x(e)})))),U.mappings.has(O)&&U.mappings.get(O).reverse){const e=_["@reverse"]=_["@reverse"]||{};A=x(A);for(let t=0;t<A.length;++t){const r=A[t];if(h(r)||l(r))throw new i('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:A});w(e,F,r,{propertyIsArray:!0})}}else w(_,F,A,{propertyIsArray:!0})}if("@value"in _)if("@json"===_["@type"]&&m(e,1.1));else if((a(P)||o(P))&&!N.isFrame)throw new i('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:P});for(const n of D){const s=o(f[n])?f[n]:[f[n]];for(const n of s){if(!a(n)||Object.keys(n).some((t=>"@value"===p(e,t,{vocab:!0},N))))throw new i("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:n});await O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:n,expandedParent:_,options:N,insideList:I,typeScopedContext:R,typeKey:A,expansionMap:C})}}}function N({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=p(e,t,{vocab:!0},n);if("@id"===i)return p(e,r,{base:!0},n);if("@type"===i)return p(e,r,{vocab:!0,base:!0},n);const o=y(e,t,"@type");if(("@id"===o||"@graph"===i)&&c(r))return{"@id":p(e,r,{base:!0},n)};if("@vocab"===o&&c(r))return{"@id":p(e,r,{vocab:!0,base:!0},n)};if(v(i))return r;const a={};if(o&&!["@id","@vocab","@none"].includes(o))a["@type"]=o;else if(c(r)){const r=y(e,t,"@language");null!==r&&(a["@language"]=r);const n=y(e,t,"@direction");null!==n&&(a["@direction"]=n)}return["boolean","number","string"].includes(typeof r)||(r=r.toString()),a["@value"]=r,a}function S(e,t,r,n){const a=[],s=Object.keys(t).sort();for(const u of s){const s=p(e,u,{vocab:!0},n);let l=t[u];o(l)||(l=[l]);for(const e of l){if(null===e)continue;if(!c(e))throw new i("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const n={"@value":e};"@none"!==s&&(n["@language"]=u.toLowerCase()),r&&(n["@direction"]=r),a.push(n)}}return a}async function E({activeCtx:e,options:t,activeProperty:r,value:n,expansionMap:a,asGraph:s,indexKey:c,propertyIndex:l}){const d=[],v=Object.keys(n).sort(),m="@type"===c;for(let b of v){if(m){const r=y(e,b,"@context");u(r)||(e=await g({activeCtx:e,localCtx:r,propagate:!1,options:t}))}let v,x=n[b];o(x)||(x=[x]),x=await j.expand({activeCtx:e,activeProperty:r,element:x,options:t,insideList:!1,insideIndex:!0,expansionMap:a}),v=l?"@none"===b?"@none":N({activeCtx:e,activeProperty:c,value:b,options:t}):p(e,b,{vocab:!0},t),"@id"===c?b=p(e,b,{base:!0},t):m&&(b=v);for(let e of x){if(s&&!f(e)&&(e={"@graph":[e]}),"@type"===c)"@none"===v||(e["@type"]?e["@type"]=[b].concat(e["@type"]):e["@type"]=[b]);else{if(h(e)&&!["@language","@type","@index"].includes(c))throw new i(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${c}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});l?"@none"!==v&&w(e,l,v,{propertyIsArray:!0,prependValue:!0}):"@none"===v||c in e||(e[c]=b)}d.push(e)}}return d}j.expand=async({activeCtx:e,activeProperty:t=null,element:r,options:n={},insideList:l=!1,insideIndex:h=!1,typeScopedContext:f=null,expansionMap:d=(()=>{})})=>{if(null==r)return null;if("@default"===t&&(n=Object.assign({},n,{isFrame:!1})),!o(r)&&!a(r)){if(!l&&(null===t||"@graph"===p(e,t,{vocab:!0},n))){const i=await d({unmappedValue:r,activeCtx:e,activeProperty:t,options:n,insideList:l});return void 0===i?null:i}return N({activeCtx:e,activeProperty:t,value:r,options:n})}if(o(r)){let i=[];const a=y(e,t,"@container")||[];l=l||a.includes("@list");for(let a=0;a<r.length;++a){let s=await j.expand({activeCtx:e,activeProperty:t,element:r[a],options:n,expansionMap:d,insideIndex:h,typeScopedContext:f});l&&o(s)&&(s={"@list":s}),null===s&&(s=await d({unmappedValue:r[a],activeCtx:e,activeProperty:t,parent:r,index:a,options:n,expandedParent:i,insideList:l}),void 0===s)||(o(s)?i=i.concat(s):i.push(s))}return i}const v=p(e,t,{vocab:!0},n),w=y(e,t,"@context");f=f||(e.previousContext?e:null);let k=Object.keys(r).sort(),T=!h;if(T&&f&&k.length<=2&&!k.includes("@context"))for(const t of k){const r=p(f,t,{vocab:!0},n);if("@value"===r){T=!1,e=f;break}if("@id"===r&&1===k.length){T=!1;break}}T&&(e=e.revertToPreviousContext()),u(w)||(e=await g({activeCtx:e,localCtx:w,propagate:!0,overrideProtected:!0,options:n})),"@context"in r&&(e=await g({activeCtx:e,localCtx:r["@context"],options:n})),f=e;let S=null;for(const t of k)if("@type"===p(e,t,{vocab:!0},n)){S=S||t;const i=r[t],o=Array.isArray(i)?i.length>1?i.slice().sort():i:[i];for(const t of o){const r=y(f,t,"@context");u(r)||(e=await g({activeCtx:e,localCtx:r,options:n,propagate:!1}))}}let E={};await O({activeCtx:e,activeProperty:t,expandedActiveProperty:v,element:r,expandedParent:E,options:n,insideList:l,typeKey:S,typeScopedContext:f,expansionMap:d}),k=Object.keys(E);let I=k.length;if("@value"in E){if("@type"in E&&("@language"in E||"@direction"in E))throw new i('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:E});let o=I-1;if("@type"in E&&(o-=1),"@index"in E&&(o-=1),"@language"in E&&(o-=1),"@direction"in E&&(o-=1),0!==o)throw new i('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:E});const a=null===E["@value"]?[]:x(E["@value"]),u=_(E,"@type");if(m(e,1.1)&&u.includes("@json")&&1===u.length);else if(0===a.length){const i=await d({unmappedValue:E,activeCtx:e,activeProperty:t,element:r,options:n,insideList:l});E=void 0!==i?i:null}else{if(!a.every((e=>c(e)||s(e)))&&"@language"in E)throw new i("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:E});if(!u.every((e=>b(e)&&!(c(e)&&0===e.indexOf("_:"))||s(e))))throw new i('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:E})}}else if("@type"in E&&!o(E["@type"]))E["@type"]=[E["@type"]];else if("@set"in E||"@list"in E){if(I>1&&(2!==I||!("@index"in E)))throw new i('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:E});"@set"in E&&(E=E["@set"],k=Object.keys(E),I=k.length)}else if(1===I&&"@language"in E){const i=await d(E,{unmappedValue:E,activeCtx:e,activeProperty:t,element:r,options:n,insideList:l});E=void 0!==i?i:null}if(a(E)&&!n.keepFreeFloatingNodes&&!l&&(null===t||"@graph"===v)&&(0===I||"@value"in E||"@list"in E||1===I&&"@id"in E)){const i=await d({unmappedValue:E,activeCtx:e,activeProperty:t,element:r,options:n,insideList:l});E=void 0!==i?i:null}return E}},1409:(e,t,r)=>{"use strict";const{isSubjectReference:n}=r(478),{createMergedNodeMap:i}=r(9646),o={};e.exports=o,o.flatten=e=>{const t=i(e),r=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const i=t[o[e]];n(i)||r.push(i)}return r}},1849:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),a=r(2621),s=r(3866),c=r(9699),{createNodeMap:u,mergeNodeMapGraphs:l}=r(9646),h={};function f(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function d(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,r){const n="@"+r;let i=n in e?e[n][0]:t[r];if("embed"===r)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function y(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new c("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of a.asArray(e[0]["@id"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of a.asArray(e[0]["@type"]))if(!o.isObject(t)&&!s.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new c("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function v(e,t,r,s){let c=!0,u=!1;for(const l in r){let h=!1;const f=a.getValues(t,l),d=0===a.getValues(r,l).length;if("@id"===l){if(o.isEmptyObject(r["@id"][0]||{})?h=!0:r["@id"].length>=0&&(h=r["@id"].includes(f[0])),!s.requireAll)return h}else if("@type"===l){if(c=!1,d){if(f.length>0)return!1;h=!0}else if(1===r["@type"].length&&o.isEmptyObject(r["@type"][0]))h=f.length>0;else for(const e of r["@type"])h=!(!o.isObject(e)||!("@default"in e))||h||f.some((t=>t===e));if(!s.requireAll)return h}else{if(n(l))continue;{const t=a.getValues(r,l)[0];let n=!1;if(t&&(y([t]),n="@default"in t),c=!1,0===f.length&&n)continue;if(f.length>0&&d)return!1;if(void 0===t){if(f.length>0)return!1;h=!0}else if(i.isList(t)){const r=t["@list"][0];if(i.isList(f[0])){const t=f[0]["@list"];i.isValue(r)?h=t.some((e=>x(r,e))):(i.isSubject(r)||i.isSubjectReference(r))&&(h=t.some((t=>w(e,r,t,s))))}}else h=i.isValue(t)?f.some((e=>x(t,e))):i.isSubjectReference(t)?f.some((r=>w(e,t,r,s))):!!o.isObject(t)&&f.length>0}}if(!h&&s.requireAll)return!1;u=u||h}return c||u}function g(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,s=n.property,c={"@id":t};if(o.isArray(i)){for(let e=0;e<i.length;++e)if(a.compareValues(i[e],c)){i[e]=c;break}}else{const e=o.isArray(i[s]);a.removeValue(i,s,c,{propertyIsArray:e}),a.addValue(i,s,c,{propertyIsArray:e})}const u=e=>{const t=Object.keys(r);for(const n of t)n in r&&o.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],u(n))};u(t)}function m(e,t){if(o.isArray(e))return e.map((e=>m(e,t)));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)"@id"===r&&t.bnodesToClear.includes(e[r])?delete e["@id"]:e[r]=m(e[r],t)}return e}function b(e,t,r){o.isObject(e)?a.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function w(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&v(e,i,t,n)}function x(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],a=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],s=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],c=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===a.length&&0===s.length&&0===c.length||!(!a.includes(r)&&!o.isEmptyObject(a[0]))&&!!(!n&&0===s.length||s.includes(n)||n&&o.isEmptyObject(s[0]))&&!!(!i&&0===c.length||c.includes(i)||i&&o.isEmptyObject(c[0]))}e.exports=h,h.frameMergedOrDefault=(e,t,r)=>{const n={options:r,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new a.IdentifierIssuer("_:b");u(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=l(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const o=[];return h.frame(n,Object.keys(n.subjects).sort(),t,o),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter((e=>1===n.bnodeMap[e].length))),r.link={},m(o,r)},h.frame=(e,t,r,s,u=null)=>{y(r),r=r[0];const l=e.options,m={embed:p(r,l,"embed"),explicit:p(r,l,"explicit"),requireAll:p(r,l,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],_=function(e,t,r,n){const i={};for(const o of t){const t=e.graphMap[e.graph][o];v(e,t,r,n)&&(i[o]=t)}return i}(e,t,r,m),k=Object.keys(_).sort();for(const y of k){const v=_[y];if(null===u?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&y in w){b(s,u,w[y]);continue}const k={"@id":y};if(0===y.indexOf("_:")&&a.addValue(e.bnodeMap,y,k,{propertyIsArray:!0}),w[y]=k,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new c("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:r});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(y))if(!e.embedded||"@never"!==m.embed&&!d(v,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(y)){if("@last"===m.embed&&y in e.uniqueEmbeds[e.graph]&&g(e,y),e.uniqueEmbeds[e.graph][y]={parent:s,property:u},e.subjectStack.push({subject:v,graph:e.graph}),y in e.graphMap){let t=!1,n=null;"@graph"in r?(n=r["@graph"][0],t=!("@merged"===y||"@default"===y),o.isObject(n)||(n={})):(t="@merged"!==e.graph,n={}),t&&h.frame({...e,graph:y,embedded:!1},Object.keys(e.graphMap[y]).sort(),[n],k,"@graph")}"@included"in r&&h.frame({...e,embedded:!1},t,r["@included"],k,"@included");for(const t of Object.keys(v).sort())if(n(t)){if(k[t]=a.clone(v[t]),"@type"===t)for(const t of v["@type"])0===t.indexOf("_:")&&a.addValue(e.bnodeMap,t,k,{propertyIsArray:!0})}else if(!m.explicit||t in r)for(const n of v[t]){const o=t in r?r[t]:f(m);if(i.isList(n)){const o=r[t]&&r[t][0]&&r[t][0]["@list"]?r[t][0]["@list"]:f(m),s={"@list":[]};b(k,t,s);const c=n["@list"];for(const t of c)i.isSubjectReference(t)?h.frame({...e,embedded:!0},[t["@id"]],o,s,"@list"):b(s,"@list",a.clone(t))}else i.isSubjectReference(n)?h.frame({...e,embedded:!0},[n["@id"]],o,k,t):x(o[0],n)&&b(k,t,a.clone(n))}for(const e of Object.keys(r).sort()){if("@type"===e){if(!o.isObject(r[e][0])||!("@default"in r[e][0]))continue}else if(n(e))continue;const t=r[e][0]||{};if(!p(t,l,"omitDefault")&&!(e in k)){let r="@null";"@default"in t&&(r=a.clone(t["@default"])),o.isArray(r)||(r=[r]),k[e]=[{"@preserve":r}]}}for(const t of Object.keys(r["@reverse"]||{}).sort()){const n=r["@reverse"][t];for(const r of Object.keys(e.subjects))a.getValues(e.subjects[r],t).some((e=>e["@id"]===y))&&(k["@reverse"]=k["@reverse"]||{},a.addValue(k["@reverse"],t,[],{propertyIsArray:!0}),h.frame({...e,embedded:!0},[r],n,k["@reverse"][t],u))}b(s,u,k),e.subjectStack.pop()}else b(s,u,k);else b(s,u,k)}},h.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map((e=>h.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)e[r]=h.cleanupNull(e[r],t)}return e}},1176:(e,t,r)=>{"use strict";var n=r(292);const i=r(9699),o=r(478),a=r(8285),s=r(2621),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:l,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:d,XSD_BOOLEAN:p,XSD_DOUBLE:y,XSD_INTEGER:v,XSD_STRING:g}=r(2445),m=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,b={};function w(e,t,r){if(e.termType.endsWith("Node"))return{"@id":e.value};const o={"@value":e.value};if(e.language)o["@language"]=e.language;else{let s=e.datatype.value;if(s||(s=g),s===d){s="@json";try{o["@value"]=JSON.parse(o["@value"])}catch(e){throw new i("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:o["@value"],cause:e})}}if(t){if(s===p)"true"===o["@value"]?o["@value"]=!0:"false"===o["@value"]&&(o["@value"]=!1);else if(a.isNumeric(o["@value"]))if(s===v){const e=parseInt(o["@value"],10);e.toFixed(0)===o["@value"]&&(o["@value"]=e)}else s===y&&(o["@value"]=parseFloat(o["@value"]));[p,v,y,g].includes(s)||(o["@type"]=s)}else if("i18n-datatype"===r&&s.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=s.split(/[#_]/);e.length>0&&(o["@language"]=e,e.match(m)||n.warn(`@language must be valid BCP47: ${e}`)),o["@direction"]=t}else s!==g&&(o["@type"]=s)}return o}e.exports=b,b.fromRDF=async(e,{useRdfType:t=!1,useNativeTypes:r=!1,rdfDirection:n=null})=>{const i={},d={"@default":i},p={};for(const o of e){const e="DefaultGraph"===o.graph.termType?"@default":o.graph.value;e in d||(d[e]={}),"@default"===e||e in i||(i[e]={"@id":e});const a=d[e],c=o.subject.value,u=o.predicate.value,l=o.object;c in a||(a[c]={"@id":c});const y=a[c],v=l.termType.endsWith("Node");if(v&&!(l.value in a)&&(a[l.value]={"@id":l.value}),u===f&&!t&&v){s.addValue(y,"@type",l.value,{propertyIsArray:!0});continue}const g=w(l,r,n);if(s.addValue(y,u,g,{propertyIsArray:!0}),v)if(l.value===h){const e=a[l.value];"usages"in e||(e.usages=[]),e.usages.push({node:y,property:u,value:g})}else l.value in p?p[l.value]=!1:p[l.value]={node:y,property:u,value:g}}for(const e in d){const t=d[e];if(!(h in t))continue;const r=t[h];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,i=e.value;const s=[],h=[];let f=Object.keys(r).length;for(;n===l&&a.isObject(p[r["@id"]])&&a.isArray(r[u])&&1===r[u].length&&a.isArray(r[l])&&1===r[l].length&&(3===f||4===f&&a.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===c)&&(s.push(r[u][0]),h.push(r["@id"]),e=p[r["@id"]],r=e.node,n=e.property,i=e.value,f=Object.keys(r).length,o.isBlankNode(r)););delete i["@id"],i["@list"]=s.reverse();for(const e of h)delete t[e]}delete r.usages}}const y=[],v=Object.keys(i).sort();for(const e of v){const t=i[e];if(e in d){const r=t["@graph"]=[],n=d[e],i=Object.keys(n).sort();for(const e of i){const t=n[e];o.isSubjectReference(t)||r.push(t)}}o.isSubjectReference(t)||y.push(t)}return y}},478:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.isSubject=e=>!(!n.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>n.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>n.isObject(e)&&"@value"in e,i.isList=e=>n.isObject(e)&&"@list"in e,i.isGraph=e=>n.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>!!n.isObject(e)&&("@id"in e?0===e["@id"].indexOf("_:"):0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e))},730:(e,t,r)=>{const n=r(2948),i=r(1402),o=r(2621),a=r(5777),s=o.IdentifierIssuer,c=r(9699),u=r(3666),l=r(7990),{expand:h}=r(570),{flatten:f}=r(1409),{fromRDF:d}=r(1176),{toRDF:p}=r(2189),{frameMergedOrDefault:y,cleanupNull:v}=r(1849),{isArray:g,isObject:m,isString:b}=r(8285),{isSubjectReference:w}=r(478),{expandIri:x,getInitialContext:_,process:k,processingMode:j}=r(2182),{compact:T,compactIri:O}=r(120),{createNodeMap:N,createMergedNodeMap:S,mergeNodeMaps:E}=r(9646),I=function(e){const t={},I=new u({max:100});function A(t,{documentLoader:r=e.documentLoader,...n}){return Object.assign({},{documentLoader:r},n,t)}return e.compact=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===r)throw new c("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(n=A(n,{base:b(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new s("_:b"),contextResolver:new a({sharedCache:I})})).link&&(n.skipExpansion=!0),n.compactToRelative||delete n.base,i=n.skipExpansion?t:await e.expand(t,n);const u=await e.processContext(_(n),r,n);let l=await T({activeCtx:u,element:i,options:n,compactionMap:n.compactionMap});n.compactArrays&&!n.graph&&g(l)?1===l.length?l=l[0]:0===l.length&&(l={}):n.graph&&m(l)&&(l=[l]),m(r)&&"@context"in r&&(r=r["@context"]),r=o.clone(r),g(r)||(r=[r]);const h=r;r=[];for(let e=0;e<h.length;++e)(!m(h[e])||Object.keys(h[e]).length>0)&&r.push(h[e]);const f=r.length>0;if(1===r.length&&(r=r[0]),g(l)){const e=O({activeCtx:u,iri:"@graph",relativeTo:{vocab:!0}}),t=l;l={},f&&(l["@context"]=r),l[e]=t}else if(m(l)&&f){const e=l;l={"@context":r};for(const t in e)l[t]=e[t]}return l},e.expand=async function(t,r){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");!1===(r=A(r,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:I})})).expansionMap&&(r.expansionMap=void 0);const n={},i=[];if("expandContext"in r){const e=o.clone(r.expandContext);m(e)&&"@context"in e?n.expandContext=e:n.expandContext={"@context":e},i.push(n.expandContext)}let s;if(b(t)){const o=await e.get(t,r);s=o.documentUrl,n.input=o.document,o.contextUrl&&(n.remoteContext={"@context":o.contextUrl},i.push(n.remoteContext))}else n.input=o.clone(t);"base"in r||(r.base=s||"");let c=_(r);for(const e of i)c=await k({activeCtx:c,localCtx:e,options:r});let u=await h({activeCtx:c,element:n.input,options:r,expansionMap:r.expansionMap});return m(u)&&"@graph"in u&&1===Object.keys(u).length?u=u["@graph"]:null===u&&(u=[]),g(u)||(u=[u]),u},e.flatten=async function(t,r,n){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");r="function"==typeof r?null:r||null,n=A(n,{base:b(t)?t:"",contextResolver:new a({sharedCache:I})});const i=await e.expand(t,n),o=f(i);if(null===r)return o;n.graph=!0,n.skipExpansion=!0;const s=await e.compact(o,r,n);return s},e.frame=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(n=A(n,{base:b(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:I})}),b(r)){const t=await e.get(r,n);if(r=t.document,t.contextUrl){let e=r["@context"];e?g(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,r["@context"]=e}}const i=r&&r["@context"]||{},o=await e.processContext(_(n),i,n);n.hasOwnProperty("omitGraph")||(n.omitGraph=j(o,1.1)),n.hasOwnProperty("pruneBlankNodeIdentifiers")||(n.pruneBlankNodeIdentifiers=j(o,1.1));const s=await e.expand(t,n),c={...n};c.isFrame=!0,c.keepFreeFloatingNodes=!0;const u=await e.expand(r,c),l=Object.keys(r).map((e=>x(o,e,{vocab:!0})));c.merged=!l.includes("@graph"),c.is11=j(o,1.1);const h=y(s,u,c);c.graph=!n.omitGraph,c.skipExpansion=!0,c.link={},c.framing=!0;let f=await e.compact(h,i,c);return c.link={},f=v(f,c),f},e.link=async function(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)},e.normalize=e.canonize=async function(t,r){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(r=A(r,{base:b(t)?t:"",algorithm:"URDNA2015",skipExpansion:!1,contextResolver:new a({sharedCache:I})}))){if("application/n-quads"!==r.inputFormat&&"application/nquads"!==r.inputFormat)throw new c("Unknown canonicalization input format.","jsonld.CanonizeError");const e=l.parse(t);return n.canonize(e,r)}const i={...r};delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return n.canonize(o,r)},e.fromRDF=async function(e,r){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");r=A(r,{format:b(e)?"application/n-quads":void 0});const{format:n}=r;let{rdfParser:i}=r;if(n){if(i=i||t[n],!i)throw new c("Unknown input format.","jsonld.UnknownFormat",{format:n})}else i=()=>e;const o=await i(e);return d(o,r)},e.toRDF=async function(t,r){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let n;n=(r=A(r,{base:b(t)?t:"",skipExpansion:!1,contextResolver:new a({sharedCache:I})})).skipExpansion?t:await e.expand(t,r);const i=p(n,r);if(r.format){if("application/n-quads"===r.format||"application/nquads"===r.format)return l.serialize(i);throw new c("Unknown output format.","jsonld.UnknownFormat",{format:r.format})}return i},e.createNodeMap=async function(t,r){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");r=A(r,{base:b(t)?t:"",contextResolver:new a({sharedCache:I})});const n=await e.expand(t,r);return S(n,r)},e.merge=async function(t,r,n){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!g(t))throw new TypeError('Could not merge, "docs" must be an array.');r="function"==typeof r?null:r||null,n=A(n,{contextResolver:new a({sharedCache:I})});const i=await Promise.all(t.map((t=>{const r={...n};return e.expand(t,r)})));let c=!0;"mergeNodes"in n&&(c=n.mergeNodes);const u=n.issuer||new s("_:b"),l={"@default":{}};for(let e=0;e<i.length;++e){const t=o.relabelBlankNodes(i[e],{issuer:new s("_:b"+e+"-")}),r=c||0===e?l:{"@default":{}};if(N(t,r,"@default",u),r!==l)for(const e in r){const t=r[e];if(!(e in l)){l[e]=t;continue}const n=l[e];for(const e in t)e in n||(n[e]=t[e])}}const h=E(l),f=[],d=Object.keys(h).sort();for(let e=0;e<d.length;++e){const t=h[d[e]];w(t)||f.push(t)}if(null===r)return f;n.graph=!0,n.skipExpansion=!0;const p=await e.compact(f,r,n);return p},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new c("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,r){let n;n="function"==typeof r.documentLoader?r.documentLoader:e.documentLoader;const i=await n(t);try{if(!i.document)throw new c("No remote document found at the given URL.","jsonld.NullRemoteDocument");b(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new c("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,r){return r=A(r,{base:"",contextResolver:new a({sharedCache:I})}),null===t?_(r):(t=o.clone(t),m(t)&&"@context"in t||(t={"@context":t}),k({activeCtx:e,localCtx:t,options:r}))},e.getContextValue=r(2182).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new c('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",l.parse),e.registerRDFParser("application/nquads",l.parse),e.url=r(3866),e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=r(3114),e.JsonLdProcessor=r(7298)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},A=function(){return I((function(){return A()}))};I(A),e.exports=A},9646:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),a=r(2621),s=r(9699),c={};e.exports=c,c.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new a.IdentifierIssuer("_:b"),n={"@default":{}};return c.createNodeMap(e,n,"@default",r),c.mergeNodeMaps(n)},c.createNodeMap=(e,t,r,u,l,h)=>{if(o.isArray(e)){for(const n of e)c.createNodeMap(n,t,r,u,void 0,h);return}if(!o.isObject(e))return void(h&&h.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=u.getId(t))}return void(h&&h.push(e))}if(h&&i.isList(e)){const n=[];return c.createNodeMap(e["@list"],t,r,u,l,n),void h.push({"@list":n})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&u.getId(e)}o.isUndefined(l)&&(l=i.isBlankNode(e)?u.getId(e["@id"]):e["@id"]),h&&h.push({"@id":l});const f=t[r],d=f[l]=f[l]||{};d["@id"]=l;const p=Object.keys(e).sort();for(let o of p){if("@id"===o)continue;if("@reverse"===o){const n={"@id":l},o=e["@reverse"];for(const e in o){const s=o[e];for(const o of s){let s=o["@id"];i.isBlankNode(o)&&(s=u.getId(s)),c.createNodeMap(o,t,r,u,s),a.addValue(f[s],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){l in t||(t[l]={}),c.createNodeMap(e[o],t,l,u);continue}if("@included"===o){c.createNodeMap(e[o],t,r,u);continue}if("@type"!==o&&n(o)){if("@index"===o&&o in d&&(e[o]!==d[o]||e[o]["@id"]!==d[o]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:d});d[o]=e[o];continue}const h=e[o];if(0===o.indexOf("_:")&&(o=u.getId(o)),0!==h.length)for(let e of h)if("@type"===o&&(e=0===e.indexOf("_:")?u.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const n=i.isBlankNode(e)?u.getId(e["@id"]):e["@id"];a.addValue(d,o,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),c.createNodeMap(e,t,r,u,n)}else if(i.isValue(e))a.addValue(d,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const n=[];c.createNodeMap(e["@list"],t,r,u,l,n),e={"@list":n},a.addValue(d,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else c.createNodeMap(e,t,r,u,l),a.addValue(d,o,e,{propertyIsArray:!0,allowDuplicate:!1});else a.addValue(d,o,[],{propertyIsArray:!0})}},c.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const i of Object.keys(e[r]).sort()){const o=e[r][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(o).sort())if(n(e)&&"@type"!==e)s[e]=a.clone(o[e]);else for(const t of o[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},c.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let o=t[n];o?"@graph"in o||(o["@graph"]=[]):t[n]=o={"@id":n,"@graph":[]};const a=o["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];i.isSubjectReference(t)||a.push(t)}}return t}},1402:(e,t,r)=>{"use strict";const n=r(2872),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=n,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},2189:(e,t,r)=>{"use strict";const{createNodeMap:n}=r(9646),{isKeyword:i}=r(2182),o=r(478),a=r(8981),s=r(8285),c=r(2621),{RDF_FIRST:u,RDF_REST:l,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:d,RDF_LANGSTRING:p,XSD_BOOLEAN:y,XSD_DOUBLE:v,XSD_INTEGER:g,XSD_STRING:m}=r(2445),{isAbsolute:b}=r(3866),w={};function x(e,t,r,n,o){const a=Object.keys(t).sort();for(const s of a){const a=t[s],c=Object.keys(a).sort();for(let t of c){const c=a[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of c){const a={termType:s.startsWith("_:")?"BlankNode":"NamedNode",value:s};if(!b(s))continue;const c={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!b(t))continue;if("BlankNode"===c.termType&&!o.produceGeneralizedRdf)continue;const u=_(i,n,e,r,o.rdfDirection);u&&e.push({subject:a,predicate:c,object:u,graph:r})}}}}function _(e,t,r,n,i){const c={};if(o.isValue(e)){c.termType="Literal",c.value=void 0,c.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;if("@json"===r)c.value=a(t),c.datatype.value=d;else if(s.isBoolean(t))c.value=t.toString(),c.datatype.value=r||y;else if(s.isDouble(t)||r===v)s.isDouble(t)||(t=parseFloat(t)),c.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),c.datatype.value=r||v;else if(s.isNumber(t))c.value=t.toFixed(0),c.datatype.value=r||g;else if("i18n-datatype"===i&&"@direction"in e){const r="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;c.datatype.value=r,c.value=t}else"@language"in e?(c.value=t,c.datatype.value=r||p,c.language=e["@language"]):(c.value=t,c.datatype.value=r||m)}else if(o.isList(e)){const o=function(e,t,r,n,i){const o={termType:"NamedNode",value:u},a={termType:"NamedNode",value:l},s={termType:"NamedNode",value:h},c=e.pop(),f=c?{termType:"BlankNode",value:t.getId()}:s;let d=f;for(const s of e){const e=_(s,t,r,n,i),c={termType:"BlankNode",value:t.getId()};r.push({subject:d,predicate:o,object:e,graph:n}),r.push({subject:d,predicate:a,object:c,graph:n}),d=c}if(c){const e=_(c,t,r,n,i);r.push({subject:d,predicate:o,object:e,graph:n}),r.push({subject:d,predicate:a,object:s,graph:n})}return f}(e["@list"],t,r,n,i);c.termType=o.termType,c.value=o.value}else{const t=s.isObject(e)?e["@id"]:e;c.termType=t.startsWith("_:")?"BlankNode":"NamedNode",c.value=t}return"NamedNode"!==c.termType||b(c.value)?c:null}e.exports=w,w.toRDF=(e,t)=>{const r=new c.IdentifierIssuer("_:b"),i={"@default":{}};n(e,i,"@default",r);const o=[],a=Object.keys(i).sort();for(const e of a){let n;if("@default"===e)n={termType:"DefaultGraph",value:""};else{if(!b(e))continue;n=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},n.value=e}x(o,i[e],n,r,t)}return o}},8285:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},3866:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const r={},n=i.parsers[t||"full"],o=n.regex.exec(e);let a=n.keys.length;for(;a--;)r[n.keys[a]]=void 0===o[a]?null:o[a];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=i.removeDotSegments(r.path),r},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));const r=i.parse(t),o={protocol:e.protocol||""};if(null!==r.authority)o.authority=r.authority,o.path=r.path,o.query=r.query;else if(o.authority=e.authority,""===r.path)o.path=e.path,null!==r.query?o.query=r.query:o.query=e.query;else{if(0===r.path.indexOf("/"))o.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,o.path=t}o.query=r.query}""!==r.path&&(o.path=i.removeDotSegments(o.path));let a=o.protocol;return null!==o.authority&&(a+="//"+o.authority),a+=o.path,null!==o.query&&(a+="?"+o.query),null!==r.fragment&&(a+="#"+r.fragment),""===a&&(a="./"),a},i.removeBase=(e,t)=>{if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const o=i.parse(t.substr(r.length)),a=e.normalizedPath.split("/"),s=o.normalizedPath.split("/"),c=o.fragment||o.query?0:1;for(;a.length>0&&s.length>c&&a[0]===s[0];)a.shift(),s.shift();let u="";if(a.length>0){a.pop();for(let e=0;e<a.length;++e)u+="../"}return u+=s.join("/"),null!==o.query&&(u+="?"+o.query),null!==o.fragment&&(u+="#"+o.fragment),""===u&&(u="./"),u},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>n.isString(e)&&o.test(e),i.isRelative=e=>n.isString(e)},2621:(e,t,r)=>{"use strict";const n=r(478),i=r(8285),o=r(2948).IdentifierIssuer,a=r(9699),s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l="application/ld+json, application/json",h={};function f(e,t){if(i.isArray(t))for(let r=0;r<t.length;++r)t[r]=f(e,t[r]);else if(n.isList(t))t["@list"]=f(e,t["@list"]);else if(i.isObject(t)){n.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const r=Object.keys(t).sort();for(let n=0;n<r.length;++n){const i=r[n];"@id"!==i&&(t[i]=f(e,t[i]))}}return t}e.exports=h,h.IdentifierIssuer=o,h.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=h.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,h.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(h.clone(r))}else if(i.isObject(e)){t={};for(const r in e)t[r]=h.clone(e[r])}else t=e.toString();return t}return e},h.asArray=function(e){return Array.isArray(e)?e:[e]},h.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+l+'" is supported.');return Object.assign({Accept:l},e)},h.parseLinkHeader=e=>{const t={},r=e.match(s);for(let e=0;e<r.length;++e){let n=r[e].match(c);if(!n)continue;const i={target:n[1]},o=n[2];for(;n=u.exec(o);)i[n[1]]=void 0===n[2]?n[3]:n[2];const a=i.rel||"";Array.isArray(t[a])?t[a].push(i):t.hasOwnProperty(a)?t[a]=[t[a],i]:t[a]=i}return t},h.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every((e=>i.isString(e))))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&h.asArray(e["@default"]).every((e=>i.isString(e))))return}throw new a('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},h.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const r=e[t];return!i.isArray(r)||r.length>0}return!1},h.hasValue=(e,t,r)=>{if(h.hasProperty(e,t)){let o=e[t];const a=n.isList(o);if(i.isArray(o)||a){a&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(h.compareValues(r,o[e]))return!0}else if(!i.isArray(r))return h.compareValues(r,o)}return!1},h.addValue=(e,t,r,n)=>{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),"prependValue"in n||(n.prependValue=!1),n.valueIsArray)e[t]=r;else if(i.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),n.prependValue&&(r=r.concat(e[t]),e[t]=[]);for(let i=0;i<r.length;++i)h.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const o=!n.allowDuplicate&&h.hasValue(e,t,r);i.isArray(e[t])||o&&!n.propertyIsArray||(e[t]=[e[t]]),o||(n.prependValue?e[t].unshift(r):e[t].push(r))}else e[t]=n.propertyIsArray?[r]:r},h.getValues=(e,t)=>[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=h.getValues(e,t).filter((e=>!h.compareValues(e,r)));0===i.length?h.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},h.relabelBlankNodes=(e,t)=>f((t=t||{}).issuer||new o("_:b"),e),h.compareValues=(e,t)=>e===t||!(!n.isValue(e)||!n.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],h.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},3666:(e,t,r)=>{"use strict";const n=r(1123),i=Symbol("max"),o=Symbol("length"),a=Symbol("lengthCalculator"),s=Symbol("allowStale"),c=Symbol("maxAge"),u=Symbol("dispose"),l=Symbol("noDisposeOnSet"),h=Symbol("lruList"),f=Symbol("cache"),d=Symbol("updateAgeOnGet"),p=()=>1,y=(e,t,r)=>{const n=e[f].get(t);if(n){const t=n.value;if(v(e,t)){if(m(e,n),!e[s])return}else r&&(e[d]&&(n.value.now=Date.now()),e[h].unshiftNode(n));return t.value}},v=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},g=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const r=t.prev;m(e,t),t=r}},m=(e,t)=>{if(t){const r=t.value;e[u]&&e[u](r.key,r.value),e[o]-=r.length,e[f].delete(r.key),e[h].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;v(e,i)&&(m(e,r),e[s]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[a]="function"!=typeof t?p:t,this[s]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[u]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[d]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,g(this)}get max(){return this[i]}set allowStale(e){this[s]=!!e}get allowStale(){return this[s]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,g(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[a]&&(this[a]=e,this[o]=0,this[h].forEach((e=>{e.length=this[a](e.value,e.key),this[o]+=e.length}))),g(this)}get lengthCalculator(){return this[a]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let r=this[h].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[h].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[h].toArray().map((e=>e.key))}values(){return this[h].toArray().map((e=>e.value))}reset(){this[u]&&this[h]&&this[h].length&&this[h].forEach((e=>this[u](e.key,e.value))),this[f]=new Map,this[h]=new n,this[o]=0}dump(){return this[h].map((e=>!v(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[h]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,s=this[a](t,e);if(this[f].has(e)){if(s>this[i])return m(this,this[f].get(e)),!1;const a=this[f].get(e).value;return this[u]&&(this[l]||this[u](e,a.value)),a.now=n,a.maxAge=r,a.value=t,this[o]+=s-a.length,a.length=s,this.get(e),g(this),!0}const d=new b(e,t,s,n,r);return d.length>this[i]?(this[u]&&this[u](e,t),!1):(this[o]+=d.length,this[h].unshift(d),this[f].set(e,this[h].head),g(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!v(this,t)}get(e){return y(this,e,!0)}peek(e){return y(this,e,!1)}pop(){const e=this[h].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[f].forEach(((e,t)=>y(this,t,!1)))}}},8720:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},7402:(e,t,r)=>{"use strict";var n=r(9170),i=r(2550),o=r(8720),a=r(5280),s=r(9129),c=i(a(),Object);n(c,{getPolyfill:a,implementation:o,shim:s}),e.exports=c},5280:(e,t,r)=>{"use strict";var n=r(8720);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9129:(e,t,r)=>{"use strict";var n=r(5280),i=r(9170);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8383:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,a=r(4418),s=Object.prototype.propertyIsEnumerable,c=!s.call({toString:null},"toString"),u=s.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(e){var t=e.constructor;return t&&t.prototype===e},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},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!f["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{h(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=a(e),s=t&&"[object String]"===o.call(e),f=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=u&&r;if(s&&e.length>0&&!i.call(e,0))for(var y=0;y<e.length;++y)f.push(String(y));if(n&&e.length>0)for(var v=0;v<e.length;++v)f.push(String(v));else for(var g in e)p&&"prototype"===g||!i.call(e,g)||f.push(String(g));if(c)for(var m=function(e){if("undefined"==typeof window||!d)return h(e);try{return h(e)}catch(e){return!1}}(e),b=0;b<l.length;++b)m&&"constructor"===l[b]||!i.call(e,l[b])||f.push(l[b]);return f}}e.exports=n},806:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(4418),o=Object.keys,a=o?function(e){return o(e)}:r(8383),s=Object.keys;a.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?s(n.call(e)):s(e)})}else Object.keys=a;return Object.keys||a},e.exports=a},4418:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},2530:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var s,c=[],u=!1,l=-1;function h(){u&&s&&(u=!1,s.length?c=s.concat(c):l=-1,c.length&&f())}function f(){if(!u){var e=a(h);u=!0;for(var t=c.length;t;){for(s=c,c=[];++l<t;)s&&s[l].run();l=-1,t=c.length}s=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new d(e,t)),1!==c.length||u||a(f)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5929:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},2948:(e,t,r)=>{e.exports=r(2874)},577:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:t,_existing:r,counter:n}=this;return new e(t,new Map(r),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},4071:(e,t,r)=>{"use strict";r(4828);const n=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!n||!n.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupport algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await n.subtle.digest(this.algorithm,e));let r="";for(let e=0;e<t.length;++e)r+=t[e].toString(16).padStart(2,"0");return r}}},6327:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",r="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",o="Literal",a="DefaultGraph",s={};s.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,s.empty=new RegExp("^[ \\t]*$"),s.quad=new RegExp('^[ \\t]*(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]*\\.))[ \\t]*$'),e.exports=class e{static parse(e){const c=[],l={},h=e.split(s.eoln);let f=0;for(const e of h){if(f++,s.empty.test(e))continue;const h=e.match(s.quad);if(null===h)throw new Error("N-Quads parse error on line "+f+".");const y={subject:null,predicate:null,object:null,graph:null};if(void 0!==h[1]?y.subject={termType:n,value:h[1]}:y.subject={termType:i,value:h[2]},y.predicate={termType:n,value:h[3]},void 0!==h[4]?y.object={termType:n,value:h[4]}:void 0!==h[5]?y.object={termType:i,value:h[5]}:(y.object={termType:o,value:void 0,datatype:{termType:n}},void 0!==h[7]?y.object.datatype.value=h[7]:void 0!==h[8]?(y.object.datatype.value=t,y.object.language=h[8]):y.object.datatype.value=r,y.object.value=h[6].replace(u,(function(e,t,r,n){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(r)return String.fromCharCode(parseInt(r,16));if(n)throw new Error("Unsupported U escape")}))),void 0!==h[9]?y.graph={termType:n,value:h[9]}:void 0!==h[10]?y.graph={termType:i,value:h[10]}:y.graph={termType:a,value:""},y.graph.value in l){let e=!0;const t=l[y.graph.value];for(const r of t)if(p=y,(d=r).subject.termType===p.subject.termType&&d.object.termType===p.object.termType&&d.subject.value===p.subject.value&&d.predicate.value===p.predicate.value&&d.object.value===p.object.value&&(d.object.termType!==o||d.object.datatype.termType===p.object.datatype.termType&&d.object.language===p.object.language&&d.object.datatype.value===p.object.datatype.value)){e=!1;break}e&&(t.push(y),c.push(y))}else l[y.graph.value]=[y],c.push(y)}var d,p;return c}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuad(e){const o=e.subject,a=e.predicate,s=e.object,u=e.graph;let l="";return o.termType===n?l+=`<${o.value}>`:l+=`${o.value}`,l+=` <${a.value}> `,s.termType===n?l+=`<${s.value}>`:s.termType===i?l+=s.value:(l+=`"${function(e){return e.replace(c,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===t?s.language&&(l+=`@${s.language}`):s.datatype.value!==r&&(l+=`^^<${s.datatype.value}>`)),u.termType===n?l+=` <${u.value}>`:u.termType===i&&(l+=` ${u.value}`),l+=" .\n",l}static legacyDatasetToQuads(e){const s=[],c={"blank node":i,IRI:n,literal:o};for(const u in e)e[u].forEach((e=>{const l={};for(const i in e){const a=e[i],s={termType:c[a.type],value:a.value};s.termType===o&&(s.datatype={termType:n},"datatype"in a&&(s.datatype.value=a.datatype),"language"in a?("datatype"in a||(s.datatype.value=t),s.language=a.language):"datatype"in a||(s.datatype.value=r)),l[i]=s}l.graph="@default"===u?{termType:a,value:""}:{termType:u.startsWith("_:")?i:n,value:u},s.push(l)}));return s}};const c=/["\\\n\r]/g,u=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},83:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,r=e.slice();let n=null,i=0;const o=e.length;for(let r=0;r<o;++r){const a=e[r],s=t.get(a);(null===n||a>n)&&(s&&r>0&&a>e[r-1]||!s&&r<o-1&&a>e[r+1])&&(n=a,i=r)}if(null===n)this.done=!0;else{const r=t.get(n)?i-1:i+1;e[i]=e[r],e[r]=n;for(const r of e)r>n&&t.set(r,!t.get(r))}return r}}},4515:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),a=r(6327);function s(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}async main(e){this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];let i=0;for(const e of r)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),c=[];for(const e of o){const r=t.get(e);if(r.length>1){c.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of c){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=await this.hashNDegreeQuads(r,e);t.push(i)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const u=[];for(const e of this.quads){const t={...e};t.subject=this._useCanonicalId({component:t.subject}),t.object=this._useCanonicalId({component:t.object}),t.graph=this._useCanonicalId({component:t.graph}),u.push(a.serializeQuad(t))}return u.sort(),u.join("")}async hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(a.serializeQuad(n))}t.sort();const o=new i(this.hashAlgorithm);for(const e of t)o.update(e);return r.hash=await o.digest(),r.hash}async hashRelatedBlankNode(e,t,r,n){let o;o=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const a=new i(this.hashAlgorithm);return a.update(n),"g"!==n&&a.update(this.getRelatedPredicate(t)),a.update(o),a.digest()}async hashNDegreeQuads(e,t){const r=new i(this.hashAlgorithm),n=await this.createHashToRelated(e,t),a=[...n.keys()].sort();for(const e of a){r.update(e);let i,a="";const s=new o(n.get(e));let c=0;for(;s.hasNext();){const e=s.next();++c%3==0&&await this._yield();let r=t.clone(),n="";const o=[];let u=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?n+=this.canonicalIssuer.getId(t):(r.hasId(t)||o.push(t),n+=r.getId(t)),0!==a.length&&n>a){u=!0;break}if(!u){for(const e of o){const t=await this.hashNDegreeQuads(e,r);if(n+=r.getId(e),n+=`<${t.hash}>`,r=t.issuer,0!==a.length&&n>a){u=!0;break}}u||(0===a.length||n<a)&&(a=n,i=r)}}r.update(a),t=i}return{hash:await r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=await this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const a=t.value,s=await this.hashRelatedBlankNode(a,e,i,r),c=o.get(s);c?c.push(a):o.set(s,[a])}_useCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},2160:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),a=r(6327);function s(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor(){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.hashAlgorithm="sha256",this.quads=null}main(e){this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];for(const e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const e of i){const r=t.get(e);if(r.length>1){o.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of o){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=this.hashNDegreeQuads(r,e);t.push(i)}t.sort(s);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t={...e};t.subject=this._useCanonicalId({component:t.subject}),t.object=this._useCanonicalId({component:t.object}),t.graph=this._useCanonicalId({component:t.graph}),c.push(a.serializeQuad(t))}return c.sort(),c.join("")}hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(a.serializeQuad(n))}t.sort();const o=new i(this.hashAlgorithm);for(const e of t)o.update(e);return r.hash=o.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){let o;o=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const a=new i(this.hashAlgorithm);return a.update(n),"g"!==n&&a.update(this.getRelatedPredicate(t)),a.update(o),a.digest()}hashNDegreeQuads(e,t){const r=new i(this.hashAlgorithm),n=this.createHashToRelated(e,t),a=[...n.keys()].sort();for(const e of a){r.update(e);let i,a="";const s=new o(n.get(e));for(;s.hasNext();){const e=s.next();let r=t.clone(),n="";const o=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?n+=this.canonicalIssuer.getId(t):(r.hasId(t)||o.push(t),n+=r.getId(t)),0!==a.length&&n>a){c=!0;break}if(!c){for(const e of o){const t=this.hashNDegreeQuads(e,r);if(n+=r.getId(e),n+=`<${t.hash}>`,r=t.issuer,0!==a.length&&n>a){c=!0;break}}c||(0===a.length||n<a)&&(a=n,i=r)}}r.update(a),t=i}return{hash:r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:r});return r}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const a=t.value,s=this.hashRelatedBlankNode(a,e,i,r),c=o.get(s);c?c.push(a):o.set(s,[a])}_useCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},3663:(e,t,r)=>{"use strict";const n=r(4515);e.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n){let n,a;if("BlankNode"===o.subject.termType&&o.subject.value!==e)a=o.subject.value,n="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;a=o.object.value,n="r"}++i%100==0&&await this._yield();const s=await this.hashRelatedBlankNode(a,o,t,n),c=r.get(s);c?c.push(a):r.set(s,[a])}return r}}},5393:(e,t,r)=>{"use strict";const n=r(2160);e.exports=class extends n{constructor(){super(),this.name="URGNA2012",this.hashAlgorithm="sha1"}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n){let n,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,n="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,n="r"}const a=this.hashRelatedBlankNode(o,i,t,n),s=r.get(a);s?s.push(o):r.set(a,[o])}return r}}},2874:(e,t,r)=>{"use strict";const n=r(4515),i=r(3663),o=r(2160),a=r(5393);let s;try{s=r(7670)}catch(e){}const c={};e.exports=c,c.NQuads=r(6327),c.IdentifierIssuer=r(577),c._rdfCanonizeNative=function(e){return e&&(s=e),s},c.canonize=async function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(!s)throw new Error("rdf-canonize-native not available");return new Promise(((r,n)=>s.canonize(e,t,((e,t)=>e?n(e):r(t)))))}if("URDNA2015"===t.algorithm)return new n(t).main(e);if("URGNA2012"===t.algorithm)return new i(t).main(e);if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)},c._canonizeSync=function(e,t){if(Array.isArray(e)||(e=c.NQuads.legacyDatasetToQuads(e)),t.useNative){if(s)return s.canonizeSync(e,t);throw new Error("rdf-canonize-native not available")}if("URDNA2015"===t.algorithm)return new o(t).main(e);if("URGNA2012"===t.algorithm)return new a(t).main(e);if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},2390:e=>{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function u(e,t,r,n){var i=t&&t.prototype instanceof v?t:v,o=Object.create(i.prototype),a=new S(n||[]);return o._invoke=function(e,t,r){var n=h;return function(i,o){if(n===d)throw new Error("Generator is already running");if(n===p){if("throw"===i)throw o;return I()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=T(a,r);if(s){if(s===y)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===h)throw n=p,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var c=l(e,t,r);if("normal"===c.type){if(n=r.done?p:f,c.arg===y)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n=p,r.method="throw",r.arg=c.arg)}}}(e,r,a),o}function l(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",f="suspendedYield",d="executing",p="completed",y={};function v(){}function g(){}function m(){}var b={};c(b,o,(function(){return this}));var w=Object.getPrototypeOf,x=w&&w(w(E([])));x&&x!==r&&n.call(x,o)&&(b=x);var _=m.prototype=v.prototype=Object.create(b);function k(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function j(e,t){function r(i,o,a,s){var c=l(e[i],e,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(h).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function T(e,r){var n=e.iterator[r.method];if(n===t){if(r.delegate=null,"throw"===r.method){if(e.iterator.return&&(r.method="return",r.arg=t,T(e,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var i=l(n,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,y;var o=i.arg;return o?o.done?(r[e.resultName]=o.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function N(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function E(e){if(e){var r=e[o];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,a=function r(){for(;++i<e.length;)if(n.call(e,i))return r.value=e[i],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}return{next:I}}function I(){return{value:t,done:!0}}return g.prototype=m,c(_,"constructor",m),c(m,"constructor",g),g.displayName=c(m,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,s,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},k(j.prototype),c(j.prototype,a,(function(){return this})),e.AsyncIterator=j,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new j(u(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(_),c(_,s,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=E,S.prototype={constructor:S,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(N),!e)for(var r in this)"t"===r.charAt(0)&&n.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function i(n,i){return s.type="throw",s.arg=e,r.next=n,i&&(r.method="next",r.arg=t),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return i("end");if(a.tryLoc<=this.prev){var c=n.call(a,"catchLoc"),u=n.call(a,"finallyLoc");if(c&&u){if(this.prev<a.catchLoc)return i(a.catchLoc,!0);if(this.prev<a.finallyLoc)return i(a.finallyLoc)}else if(c){if(this.prev<a.catchLoc)return i(a.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return i(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),N(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;N(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:E(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),y}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},4828:function(e,t,r){var n=r(2530);!function(e,t){"use strict";if(!e.setImmediate){var r,i,o,a,s,c=1,u={},l=!1,h=e.document,f=Object.getPrototypeOf&&Object.getPrototypeOf(e);f=f&&f.setTimeout?f:e,"[object process]"==={}.toString.call(e.process)?r=function(e){n.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)},f.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return u[c]=i,r(c),c++},f.clearImmediate=d}function d(e){delete u[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=u[e];if(t){l=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===r.g?this:r.g:self)},9523:e=>{const t={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/"};e.exports=function(e={namedNode:e=>e}){const r={};for(const n in t){const i=t[n];r[n]=function(t=""){return e.namedNode(i+t)}}return r}},9397:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},4489:(e,t,r)=>{"use strict";var n=r(7092),i=r(7427),o=r(4010),a=r(2527);function s(e){return e.call.bind(e)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=s(Object.prototype.toString),h=s(Number.prototype.valueOf),f=s(String.prototype.valueOf),d=s(Boolean.prototype.valueOf);if(c)var p=s(BigInt.prototype.valueOf);if(u)var y=s(Symbol.prototype.valueOf);function v(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function g(e){return"[object Map]"===l(e)}function m(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function w(e){return"[object WeakSet]"===l(e)}function x(e){return"[object ArrayBuffer]"===l(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function k(e){return"[object DataView]"===l(e)}function j(e){return"undefined"!=typeof DataView&&(k.working?k(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||j(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},g.working="undefined"!=typeof Map&&g(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(g.working?g(e):e instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(m.working?m(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,k.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&k(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=j;var T="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(e){return"[object SharedArrayBuffer]"===l(e)}function N(e){return void 0!==T&&(void 0===O.working&&(O.working=O(new T)),O.working?O(e):e instanceof T)}function S(e){return v(e,h)}function E(e){return v(e,f)}function I(e){return v(e,d)}function A(e){return c&&v(e,p)}function R(e){return u&&v(e,y)}t.isSharedArrayBuffer=N,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},t.isGeneratorObject=function(e){return"[object Generator]"===l(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},t.isNumberObject=S,t.isStringObject=E,t.isBooleanObject=I,t.isBigIntObject=A,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return S(e)||E(e)||I(e)||A(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||N(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},5663:(e,t,r)=>{var n=r(2530),i=r(292),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},a=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(l(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(a,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<i;s=n[++r])m(s)||!k(s)?o+=" "+s:o+=" "+l(s);return o},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),o=!0}return e.apply(this,arguments)}};var s={},c=/^$/;if(n.env.NODE_DEBUG){var u=n.env.NODE_DEBUG;u=u.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),c=new RegExp("^"+u+"$","i")}function l(e,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&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),d(n,e,n.depth)}function h(e,t){var r=l.styles[t];return r?"["+l.colors[r][0]+"m"+e+"["+l.colors[r][1]+"m":e}function f(e,t){return e}function d(e,r,n){if(e.customInspect&&r&&O(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=d(e,i,n)),i}var o=function(e,t){if(x(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),T(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(r);if(0===a.length){if(O(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(j(r))return e.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var u,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)),j(r)&&(l=" "+Date.prototype.toUTCString.call(r)),T(r)&&(l=" "+p(r)),0!==a.length||h&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=h?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)A(t,String(a))?o.push(y(e,t,r,n,String(a),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(y(e,t,r,n,i,!0))})),o}(e,r,n,s,a):a.map((function(t){return y(e,r,n,s,t,h)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(u,l,f)):f[0]+l+f[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function y(e,t,r,n,i,o){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),A(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=m(r)?d(e,c.value,null):d(e,c.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.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.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function v(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function x(e){return void 0===e}function _(e){return k(e)&&"[object RegExp]"===N(e)}function k(e){return"object"==typeof e&&null!==e}function j(e){return k(e)&&"[object Date]"===N(e)}function T(e){return k(e)&&("[object Error]"===N(e)||e instanceof Error)}function O(e){return"function"==typeof e}function N(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(c.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);i.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.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"},t.types=r(4489),t.isArray=v,t.isBoolean=g,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=x,t.isRegExp=_,t.types.isRegExp=_,t.isObject=k,t.isDate=j,t.types.isDate=j,t.isError=T,t.types.isNativeError=T,t.isFunction=O,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(9397);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),E[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){i.log("%s - %s",I(),t.format.apply(t,arguments))},t.inherits=r(8575),t._extend=function(e,t){if(!t||!k(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=R,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(C.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},4010:(e,t,r)=>{"use strict";var n=r(4175),i=r(4343),o=r(7615),a=o("Object.prototype.toString"),s=r(4111)(),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),l=o("String.prototype.slice"),h={},f=r(7065),d=Object.getPrototypeOf;s&&f&&d&&n(u,(function(e){if("function"==typeof c[e]){var t=new c[e];if(Symbol.toStringTag in t){var r=d(t),n=f(r,Symbol.toStringTag);if(!n){var i=d(r);n=f(i,Symbol.toStringTag)}h[e]=n.get}}}));var p=r(2527);e.exports=function(e){return!!p(e)&&(s&&Symbol.toStringTag in e?function(e){var t=!1;return n(h,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):l(a(e),8,-1))}},7876:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},1123:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new s(r,null,t,e):new s(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new s(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function a(e,t){e.head=new s(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function s(e,t,r,n){if(!(this instanceof s))return new s(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=s,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var a=[];for(n=0;o&&n<t;n++)a.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<r.length;n++)o=i(this,o,r[n]);return a},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(7876)(n)}catch(e){}},870:t=>{"use strict";t.exports=e},7670:()=>{},4343:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},7065:(e,t,r)=>{"use strict";var n=r(1801)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},4771:(e,t,r)=>{"use strict";function n(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}r.d(t,{Z:()=>n})},7061:(e,t,r)=>{"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,{Z:()=>n})},9900:(e,t,r)=>{"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}r.d(t,{Z:()=>i})},240:(e,t,r)=>{"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{Z:()=>n})},886:(e,t,r)=>{"use strict";function n(e){return n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},n(e)}r.d(t,{Z:()=>n})},4768:(e,t,r)=>{"use strict";function n(e,t){return n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},n(e,t)}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)}r.d(t,{Z:()=>i})},4593:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(7209),i=r(4771);function o(e,t){if(t&&("object"===(0,n.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return(0,i.Z)(e)}},7209:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{Z:()=>n})}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{BlankNode:()=>p,Collection:()=>x,ConnectedStore:()=>Ri,DataFactory:()=>hi,Empty:()=>nr,Fetcher:()=>ti,Formula:()=>Mr,IndexedFormula:()=>Wr,Literal:()=>b,LiveStore:()=>Ci,N3Parser:()=>gn,NamedNode:()=>v.Z,Namespace:()=>xr,NextId:()=>Ai,Node:()=>Fr,Query:()=>Zr,RDFParser:()=>Cn,RDFaProcessor:()=>An,SPARQLToQuery:()=>ii,Serializer:()=>Nr,Statement:()=>fr,Store:()=>Wr,UpdateManager:()=>si,UpdatesSocket:()=>fi,UpdatesVia:()=>di,Util:()=>_r,Variable:()=>vr,blankNode:()=>ki,convert:()=>e,defaultGraph:()=>ji,fetcher:()=>gi,fromNT:()=>Ei,graph:()=>mi,isBlankNode:()=>g.B2,isCollection:()=>g.uZ,isGraph:()=>g.NA,isLiteral:()=>g.n_,isNamedNode:()=>g.NX,isPredicate:()=>g.lx,isQuad:()=>g.PY,isRDFObject:()=>g.lt,isRDFlibObject:()=>g.Uc,isRDFlibPredicate:()=>g.nq,isRDFlibSubject:()=>g.f,isStatement:()=>g.Yi,isStore:()=>g.Pv,isSubject:()=>g.zz,isTerm:()=>g.jt,isVariable:()=>g.cG,jsonParser:()=>ri,lit:()=>bi,literal:()=>Ti,log:()=>wr.Z,namedNode:()=>xi,parse:()=>Dn,quad:()=>Oi,queryToSPARQL:()=>ni,serialize:()=>Er,sparqlUpdateParser:()=>Ln,st:()=>wi,sym:()=>xi,term:()=>Ii,termValue:()=>Fn._,triple:()=>Ni,uri:()=>dr,variable:()=>_i});var e={};n.r(e),n.d(e,{convertToJson:()=>tr,convertToNQuads:()=>rr});var t=n(9900),r=n(7061),o=n(4771),a=n(4768),s=n(4593),c=n(886),u=n(240),l=n(8333),h=n(4806),f=n(9247),d=n(292);var p=function(e){(0,a.Z)(p,e);var n,i,h=(n=p,i=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(e){return!1}}(),function(){var e,t=(0,c.Z)(n);if(i){var r=(0,c.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,s.Z)(this,e)});function p(e){var t;return(0,r.Z)(this,p),t=h.call(this,p.getId(e)),(0,u.Z)((0,o.Z)(t),"termType",f.V1),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.BlankNode),(0,u.Z)((0,o.Z)(t),"isBlank",1),(0,u.Z)((0,o.Z)(t),"isVar",1),t}return(0,t.Z)(p,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"compareTerm",value:function(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}},{key:"copy",value:function(e){var t=new p;return e.copyTo(this,t),t}},{key:"toCanonical",value:function(){return p.NTAnonymousNodePrefix+this.value}},{key:"toString",value:function(){return p.NTAnonymousNodePrefix+this.id}}],[{key:"getId",value:function(e){if(e){if("string"!=typeof e)throw d.log("Bad blank id:",e),new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){var t=e.split("#");return t[t.length-1]}return e}return"n"+p.nextId++}}]),p}(h.Z);(0,u.Z)(p,"nextId",0),(0,u.Z)(p,"NTAnonymousNodePrefix","_:");var y=n(7209),v=n(6545),g=n(5904);const m={boolean:new v.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new v.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new v.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new v.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new v.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new v.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new v.Z("http://www.w3.org/2001/XMLSchema#string")};var b=function(e){(0,a.Z)(d,e);var n,i,h=(n=d,i=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(e){return!1}}(),function(){var e,t=(0,c.Z)(n);if(i){var r=(0,c.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,s.Z)(this,e)});function d(e,t,n){var i;return(0,r.Z)(this,d),i=h.call(this,e),(0,u.Z)((0,o.Z)(i),"termType",f.xH),(0,u.Z)((0,o.Z)(i),"classOrder",l.Z.Literal),(0,u.Z)((0,o.Z)(i),"datatype",m.string),(0,u.Z)((0,o.Z)(i),"isVar",0),(0,u.Z)((0,o.Z)(i),"language",""),t?(i.language=t,i.datatype=m.langString):i.datatype=n?v.Z.fromValue(n):m.string,i}return(0,t.Z)(d,[{key:"copy",value:function(){return new d(this.value,this.lang,this.datatype)}},{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype))}},{key:"lang",get:function(){return this.language},set:function(e){this.language=e||""}},{key:"toNT",value:function(){return d.toNT(this)}},{key:"toString",value:function(){return""+this.value}}],[{key:"toNT",value:function(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(m.string)||(t+="^^"+e.datatype.toCanonical()),t}},{key:"fromBoolean",value:function(e){return new d(e?"1":"0",null,m.boolean)}},{key:"fromDate",value:function(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");var t=function(e){return(""+(100+e)).slice(1,3)};return new d(e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z",null,m.dateTime)}},{key:"fromNumber",value:function(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");var t,r=e.toString();return t=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?m.integer:m.decimal:m.double,new d(r,null,t)}},{key:"fromValue",value:function(e){if((0,g.n_)(e))return e;switch((0,y.Z)(e)){case"object":if(e instanceof Date)return d.fromDate(e);case"boolean":return d.fromBoolean(e);case"number":return d.fromNumber(e);case"string":return new d(e)}throw new Error("Can't make literal from "+e+" of type "+(0,y.Z)(e))}}]),d}(h.Z);function w(e){return null==e||(0,g.jt)(e)?e:Array.isArray(e)?new x(e):b.fromValue(e)}var x=function(e){(0,a.Z)(d,e);var n,i,h=(n=d,i=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(e){return!1}}(),function(){var e,t=(0,c.Z)(n);if(i){var r=(0,c.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,s.Z)(this,e)});function d(e){var t;return(0,r.Z)(this,d),t=h.call(this,(p.nextId++).toString()),(0,u.Z)((0,o.Z)(t),"termType",f.fb),(0,u.Z)((0,o.Z)(t),"classOrder",l.Z.Collection),(0,u.Z)((0,o.Z)(t),"closed",!1),(0,u.Z)((0,o.Z)(t),"compareTerm",p.prototype.compareTerm),(0,u.Z)((0,o.Z)(t),"elements",[]),(0,u.Z)((0,o.Z)(t),"isVar",0),e&&e.length>0&&e.forEach((function(e){t.elements.push(w(e))})),t}return(0,t.Z)(d,[{key:"id",get:function(){return this.value},set:function(e){this.value=e}},{key:"append",value:function(e){return this.elements.push(e)}},{key:"close",value:function(){return this.closed=!0,this.closed}},{key:"shift",value:function(){return this.elements.shift()}},{key:"substitute",value:function(e){return new d(this.elements.map((function(t){return t.substitute(e)})))}},{key:"toNT",value:function(){return d.toNT(this)}},{key:"toString",value:function(){return"("+this.elements.join(" ")+")"}},{key:"unshift",value:function(e){return this.elements.unshift(e)}}],[{key:"toNT",value:function(e){return p.NTAnonymousNodePrefix+e.id}}]),d}(h.Z);(0,u.Z)(x,"termType",f.fb);var _=n(2530),k=n(292);function j(e){return function(...t){var r=t.pop();return e.call(this,t,r)}}var T="function"==typeof queueMicrotask&&queueMicrotask,O="function"==typeof setImmediate&&setImmediate,N="object"==typeof _&&"function"==typeof _.nextTick;function S(e){setTimeout(e,0)}function E(e){return(t,...r)=>e((()=>t(...r)))}var I=E(T?queueMicrotask:O?setImmediate:N?_.nextTick:S);function A(e){return L(e)?function(...t){const r=t.pop();return R(e.apply(this,t),r)}:j((function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}if(n&&"function"==typeof n.then)return R(n,r);r(null,n)}))}function R(e,t){return e.then((e=>{C(t,null,e)}),(e=>{C(t,e&&e.message?e:new Error(e))}))}function C(e,t,r){try{e(t,r)}catch(e){I((e=>{throw e}),e)}}function L(e){return"AsyncFunction"===e[Symbol.toStringTag]}function D(e){if("function"!=typeof e)throw new Error("expected a function");return L(e)?A(e):e}function P(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[t-1]?e.apply(this,r):new Promise(((n,i)=>{r[t-1]=(e,...t)=>{if(e)return i(e);n(t.length>1?t:t[0])},e.apply(this,r)}))}}function M(e){return function(t,...r){return P((function(n){var i=this;return e(t,((e,t)=>{D(e).apply(i,r.concat(t))}),n)}))}}function F(e,t,r,n){t=t||[];var i=[],o=0,a=D(r);return e(t,((e,t,r)=>{var n=o++;a(e,((e,t)=>{i[n]=t,r(e)}))}),(e=>{n(e,i)}))}function U(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}const B={};function Z(e){function t(...t){if(null!==e){var r=e;e=null,r.apply(this,t)}}return Object.assign(t,e),t}function q(e){return function(...t){if(null===e)throw new Error("Callback was already called.");var r=e;e=null,r.apply(this,t)}}function $(e,t,r,n){let i=!1,o=!1,a=!1,s=0,c=0;function u(){s>=t||a||i||(a=!0,e.next().then((({value:e,done:t})=>{if(!o&&!i){if(a=!1,t)return i=!0,void(s<=0&&n(null));s++,r(e,c,l),c++,u()}})).catch(h))}function l(e,t){if(s-=1,!o)return e?h(e):!1===e?(i=!0,void(o=!0)):t===B||i&&s<=0?(i=!0,n(null)):void u()}function h(e){o||(a=!1,i=!0,n(e))}u()}var H=e=>(t,r,n)=>{if(n=Z(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return n(null);if("AsyncGenerator"===t[Symbol.toStringTag])return $(t,e,r,n);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return $(t[Symbol.asyncIterator](),e,r,n);var i=function(e){if(U(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t,r,n,i,o=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return o?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(o):(r=(t=e)?Object.keys(t):[],n=-1,i=r.length,function e(){var o=r[++n];return"__proto__"===o?e():n<i?{value:t[o],key:o}:null})}(t),o=!1,a=!1,s=0,c=!1;function u(e,t){if(!a)if(s-=1,e)o=!0,n(e);else if(!1===e)o=!0,a=!0;else{if(t===B||o&&s<=0)return o=!0,n(null);c||l()}}function l(){for(c=!0;s<e&&!o;){var t=i();if(null===t)return o=!0,void(s<=0&&n(null));s+=1,r(t.value,t.key,q(u))}c=!1}l()},V=P((function(e,t,r,n){return H(t)(e,D(r),n)}),4);function z(e,t,r){r=Z(r);var n=0,i=0,{length:o}=e,a=!1;function s(e,t){!1===e&&(a=!0),!0!==a&&(e?r(e):++i!==o&&t!==B||r(null))}for(0===o&&r(null);n<o;n++)t(e[n],n,q(s))}function G(e,t,r){return V(e,1/0,t,r)}var X=P((function(e,t,r){return(U(e)?z:G)(e,D(t),r)}),3),J=P((function(e,t,r){return F(X,e,t,r)}),3),Q=M(J),W=P((function(e,t,r){return V(e,1,t,r)}),3),Y=P((function(e,t,r){return F(W,e,t,r)}),3),K=M(Y);const ee=Symbol("promiseCallback");function te(){let e,t;function r(r,...n){if(r)return t(r);e(n.length>1?n:n[0])}return r[ee]=new Promise(((r,n)=>{e=r,t=n})),r}function re(e,t,r){"number"!=typeof t&&(r=t,t=null),r=Z(r||te());var n=Object.keys(e).length;if(!n)return r(null);t||(t=n);var i={},o=0,a=!1,s=!1,c=Object.create(null),u=[],l=[],h={};function f(e,t){u.push((()=>function(e,t){if(!s){var n=q(((t,...n)=>{if(o--,!1!==t)if(n.length<2&&([n]=n),t){var u={};if(Object.keys(i).forEach((e=>{u[e]=i[e]})),u[e]=n,s=!0,c=Object.create(null),a)return;r(t,u)}else i[e]=n,(c[e]||[]).forEach((e=>e())),d();else a=!0}));o++;var u=D(t[t.length-1]);t.length>1?u(i,n):u(n)}}(e,t)))}function d(){if(!a){if(0===u.length&&0===o)return r(null,i);for(;u.length&&o<t;)u.shift()()}}function p(t){var r=[];return Object.keys(e).forEach((n=>{const i=e[n];Array.isArray(i)&&i.indexOf(t)>=0&&r.push(n)})),r}return Object.keys(e).forEach((t=>{var r=e[t];if(!Array.isArray(r))return f(t,[r]),void l.push(t);var n=r.slice(0,r.length-1),i=n.length;if(0===i)return f(t,r),void l.push(t);h[t]=i,n.forEach((o=>{if(!e[o])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+o+"` in "+n.join(", "));var a,s;(s=c[a=o])||(s=c[a]=[]),s.push((()=>{0==--i&&f(t,r)}))}))})),function(){for(var e=0;l.length;)e++,p(l.pop()).forEach((e=>{0==--h[e]&&l.push(e)}));if(e!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),d(),r[ee]}var ne=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,ie=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,oe=/,/,ae=/(=.+)?(\s*)$/;class se{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):ce(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):ce(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:r}=t;e(t)&&this.removeLink(t),t=r}return this}}function ce(e,t){e.length=1,e.head=e.tail=t}function ue(e,t,r){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var n=D(e),i=0,o=[];const a={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function s(e,t){return e?t?void(a[e]=a[e].filter((e=>e!==t))):a[e]=[]:Object.keys(a).forEach((e=>a[e]=[]))}function c(e,...t){a[e].forEach((e=>e(...t)))}var u=!1;function l(e,t,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var i,o;function a(e,...t){return e?r?o(e):i():t.length<=1?i(t[0]):void i(t)}y.started=!0;var s={data:e,callback:r?a:n||a};if(t?y._tasks.unshift(s):y._tasks.push(s),u||(u=!0,I((()=>{u=!1,y.process()}))),r||!n)return new Promise(((e,t)=>{i=e,o=t}))}function h(e){return function(t,...r){i-=1;for(var n=0,a=e.length;n<a;n++){var s=e[n],u=o.indexOf(s);0===u?o.shift():u>0&&o.splice(u,1),s.callback(t,...r),null!=t&&c("error",t,s.data)}i<=y.concurrency-y.buffer&&c("unsaturated"),y.idle()&&c("drain"),y.process()}}function f(e){return!(0!==e.length||!y.idle()||(I((()=>c("drain"))),0))}const d=e=>t=>{if(!t)return new Promise(((t,r)=>{!function(e,n){const i=(...n)=>{s(e,i),((e,n)=>{if(e)return r(e);t(n)})(...n)};a[e].push(i)}(e)}));s(e),function(e,t){a[e].push(t)}(e,t)};var p=!1,y={_tasks:new se,*[Symbol.iterator](){yield*y._tasks[Symbol.iterator]()},concurrency:t,payload:r,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(f(e))return;return e.map((e=>l(e,!1,!1,t)))}return l(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map((e=>l(e,!1,!0,t)))}return l(e,!1,!0,t)},kill(){s(),y._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(f(e))return;return e.map((e=>l(e,!0,!1,t)))}return l(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(f(e))return;return e.map((e=>l(e,!0,!0,t)))}return l(e,!0,!0,t)},remove(e){y._tasks.remove(e)},process(){if(!p){for(p=!0;!y.paused&&i<y.concurrency&&y._tasks.length;){var e=[],t=[],r=y._tasks.length;y.payload&&(r=Math.min(r,y.payload));for(var a=0;a<r;a++){var s=y._tasks.shift();e.push(s),o.push(s),t.push(s.data)}i+=1,0===y._tasks.length&&c("empty"),i===y.concurrency&&c("saturated");var u=q(h(e));n(t,u)}p=!1}},length:()=>y._tasks.length,running:()=>i,workersList:()=>o,idle:()=>y._tasks.length+i===0,pause(){y.paused=!0},resume(){!1!==y.paused&&(y.paused=!1,I(y.process))}};return Object.defineProperties(y,{saturated:{writable:!1,value:d("saturated")},unsaturated:{writable:!1,value:d("unsaturated")},empty:{writable:!1,value:d("empty")},drain:{writable:!1,value:d("drain")},error:{writable:!1,value:d("error")}}),y}var le=P((function(e,t,r,n){n=Z(n);var i=D(r);return W(e,((e,r,n)=>{i(t,e,((e,r)=>{t=r,n(e)}))}),(e=>n(e,t)))}),4);function he(...e){var t=e.map(D);return function(...e){var r=this,n=e[e.length-1];return"function"==typeof n?e.pop():n=te(),le(t,e,((e,t,n)=>{t.apply(r,e.concat(((e,...t)=>{n(e,t)})))}),((e,t)=>n(e,...t))),n[ee]}}var fe=P((function(e,t,r,n){return F(H(t),e,r,n)}),4),de=P((function(e,t,r,n){var i=D(r);return fe(e,t,((e,t)=>{i(e,((e,...r)=>e?t(e):t(e,r)))}),((e,t)=>{for(var r=[],i=0;i<t.length;i++)t[i]&&(r=r.concat(...t[i]));return n(e,r)}))}),4),pe=P((function(e,t,r){return de(e,1/0,t,r)}),3),ye=P((function(e,t,r){return de(e,1,t,r)}),3);function ve(e,t){return(r,n,i,o)=>{var a,s=!1;const c=D(i);r(n,((r,n,i)=>{c(r,((n,o)=>n||!1===n?i(n):e(o)&&!a?(s=!0,a=t(!0,r),i(null,B)):void i()))}),(e=>{if(e)return o(e);o(null,s?a:t(!1))}))}}var ge=P((function(e,t,r){return ve((e=>e),((e,t)=>t))(X,e,t,r)}),3),me=P((function(e,t,r,n){return ve((e=>e),((e,t)=>t))(H(t),e,r,n)}),4),be=P((function(e,t,r){return ve((e=>e),((e,t)=>t))(H(1),e,t,r)}),3);function we(e){return(t,...r)=>D(t)(...r,((t,...r)=>{"object"==typeof k&&(t?k.error&&k.error(t):k[e]&&r.forEach((t=>k[e](t))))}))}var xe=we("dir"),_e=P((function(e,t,r){r=q(r);var n,i=D(e),o=D(t);function a(e,...t){if(e)return r(e);!1!==e&&(n=t,o(...t,s))}function s(e,t){return e?r(e):!1!==e?t?void i(a):r(null,...n):void 0}return s(null,!0)}),3);function ke(e){return(t,r,n)=>e(t,n)}var je=P((function(e,t,r){return X(e,ke(D(t)),r)}),3),Te=P((function(e,t,r,n){return H(t)(e,ke(D(r)),n)}),4),Oe=P((function(e,t,r){return Te(e,1,t,r)}),3);function Ne(e){return L(e)?e:function(...t){var r=t.pop(),n=!0;t.push(((...e)=>{n?I((()=>r(...e))):r(...e)})),e.apply(this,t),n=!1}}var Se=P((function(e,t,r){return ve((e=>!e),(e=>!e))(X,e,t,r)}),3),Ee=P((function(e,t,r,n){return ve((e=>!e),(e=>!e))(H(t),e,r,n)}),4),Ie=P((function(e,t,r){return ve((e=>!e),(e=>!e))(W,e,t,r)}),3);function Ae(e,t,r,n){var i=new Array(t.length);e(t,((e,t,n)=>{r(e,((e,r)=>{i[t]=!!r,n(e)}))}),(e=>{if(e)return n(e);for(var r=[],o=0;o<t.length;o++)i[o]&&r.push(t[o]);n(null,r)}))}function Re(e,t,r,n){var i=[];e(t,((e,t,n)=>{r(e,((r,o)=>{if(r)return n(r);o&&i.push({index:t,value:e}),n(r)}))}),(e=>{if(e)return n(e);n(null,i.sort(((e,t)=>e.index-t.index)).map((e=>e.value)))}))}function Ce(e,t,r,n){return(U(t)?Ae:Re)(e,t,D(r),n)}var Le=P((function(e,t,r){return Ce(X,e,t,r)}),3),De=P((function(e,t,r,n){return Ce(H(t),e,r,n)}),4),Pe=P((function(e,t,r){return Ce(W,e,t,r)}),3),Me=P((function(e,t){var r=q(t),n=D(Ne(e));return function e(t){if(t)return r(t);!1!==t&&n(e)}()}),2),Fe=P((function(e,t,r,n){var i=D(r);return fe(e,t,((e,t)=>{i(e,((r,n)=>r?t(r):t(r,{key:n,val:e})))}),((e,t)=>{for(var r={},{hasOwnProperty:i}=Object.prototype,o=0;o<t.length;o++)if(t[o]){var{key:a}=t[o],{val:s}=t[o];i.call(r,a)?r[a].push(s):r[a]=[s]}return n(e,r)}))}),4),Ue=we("log"),Be=P((function(e,t,r,n){n=Z(n);var i={},o=D(r);return H(t)(e,((e,t,r)=>{o(e,t,((e,n)=>{if(e)return r(e);i[t]=n,r(e)}))}),(e=>n(e,i)))}),4),Ze=E(N?_.nextTick:O?setImmediate:S),qe=P(((e,t,r)=>{var n=U(t)?[]:{};e(t,((e,t,r)=>{D(e)(((e,...i)=>{i.length<2&&([i]=i),n[t]=i,r(e)}))}),(e=>r(e,n)))}),3);function $e(e,t){var r=D(e);return ue(((e,t)=>{r(e[0],t)}),t,1)}class He{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&ze(this.heap[e],this.heap[t=Ve(e)]);){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}percDown(e){let t;for(;(t=1+(e<<1))<this.heap.length&&(t+1<this.heap.length&&ze(this.heap[t+1],this.heap[t])&&(t+=1),!ze(this.heap[e],this.heap[t]));){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}push(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}unshift(e){return this.heap.push(e)}shift(){let[e]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}toArray(){return[...this]}*[Symbol.iterator](){for(let e=0;e<this.heap.length;e++)yield this.heap[e].data}remove(e){let t=0;for(let r=0;r<this.heap.length;r++)e(this.heap[r])||(this.heap[t]=this.heap[r],t++);this.heap.splice(t);for(let e=Ve(this.heap.length-1);e>=0;e--)this.percDown(e);return this}}function Ve(e){return(e+1>>1)-1}function ze(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}var Ge=P((function(e,t){if(t=Z(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var r=0,n=e.length;r<n;r++)D(e[r])(t)}),2);function Xe(e,t,r,n){var i=[...e].reverse();return le(i,t,r,n)}function Je(e){var t=D(e);return j((function(e,r){return e.push(((e,...t)=>{let n={};if(e&&(n.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),n.value=i}r(null,n)})),t.apply(this,e)}))}function Qe(e,t,r,n){const i=D(r);return Ce(e,t,((e,t)=>{i(e,((e,r)=>{t(e,!r)}))}),n)}var We=P((function(e,t,r){return Qe(X,e,t,r)}),3),Ye=P((function(e,t,r,n){return Qe(H(t),e,r,n)}),4),Ke=P((function(e,t,r){return Qe(W,e,t,r)}),3);function et(e){return function(){return e}}function tt(e,t,r){var n={times:5,intervalFunc:et(0)};if(arguments.length<3&&"function"==typeof e?(r=t||te(),t=e):(rt(n,e),r=r||te()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=D(t),o=1;function a(){i(((e,...t)=>{!1!==e&&(e&&o++<n.times&&("function"!=typeof n.errorFilter||n.errorFilter(e))?setTimeout(a,n.intervalFunc(o-1)):r(e,...t))}))}return a(),r[ee]}function rt(e,t){if("object"==typeof t)e.times=+t.times||5,e.intervalFunc="function"==typeof t.interval?t.interval:et(+t.interval||0),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||5}}var nt=P((function(e,t,r){return ve(Boolean,(e=>e))(X,e,t,r)}),3),it=P((function(e,t,r,n){return ve(Boolean,(e=>e))(H(t),e,r,n)}),4),ot=P((function(e,t,r){return ve(Boolean,(e=>e))(W,e,t,r)}),3),at=P((function(e,t,r){var n=D(t);return J(e,((e,t)=>{n(e,((r,n)=>{if(r)return t(r);t(r,{value:e,criteria:n})}))}),((e,t)=>{if(e)return r(e);r(null,t.sort(i).map((e=>e.value)))}));function i(e,t){var r=e.criteria,n=t.criteria;return r<n?-1:r>n?1:0}}),3);function st(e,t,r,n){var i=D(r);return fe(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,n)}var ct=P((function(e,t){var r,n=null;return Oe(e,((e,t)=>{D(e)(((e,...i)=>{if(!1===e)return t(e);i.length<2?[r]=i:r=i,n=e,t(e?null:{})}))}),(()=>t(n,r)))})),ut=P((function(e,t,r){r=q(r);var n=D(t),i=D(e),o=[];function a(e,...t){if(e)return r(e);o=t,!1!==e&&i(s)}function s(e,t){return e?r(e):!1!==e?t?void n(a):r(null,...o):void 0}return i(s)}),3),lt=P((function(e,t){if(t=Z(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(t){D(e[r++])(...t,q(i))}function i(i,...o){if(!1!==i)return i||r===e.length?t(i,...o):void n(o)}n([])})),ht={apply:function(e,...t){return(...r)=>e(...t,...r)},applyEach:Q,applyEachSeries:K,asyncify:A,auto:re,autoInject:function(e,t){var r={};return Object.keys(e).forEach((t=>{var n,i=e[t],o=L(i),a=!o&&1===i.length||o&&0===i.length;if(Array.isArray(i))n=[...i],i=n.pop(),r[t]=n.concat(n.length>0?s:i);else if(a)r[t]=i;else{if(n=function(e){const t=function(e){let t="",r=0,n=e.indexOf("*/");for(;r<e.length;)if("/"===e[r]&&"/"===e[r+1]){let t=e.indexOf("\n",r);r=-1===t?e.length:t}else if(-1!==n&&"/"===e[r]&&"*"===e[r+1]){let i=e.indexOf("*/",r);-1!==i?(r=i+2,n=e.indexOf("*/",r)):(t+=e[r],r++)}else t+=e[r],r++;return t}(e.toString());let r=t.match(ne);if(r||(r=t.match(ie)),!r)throw new Error("could not parse args in autoInject\nSource:\n"+t);let[,n]=r;return n.replace(/\s/g,"").split(oe).map((e=>e.replace(ae,"").trim()))}(i),0===i.length&&!o&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");o||n.pop(),r[t]=n.concat(s)}function s(e,t){var r=n.map((t=>e[t]));r.push(t),D(i)(...r)}})),re(r,t)},cargo:function(e,t){return ue(e,1,t)},cargoQueue:function(e,t,r){return ue(e,t,r)},compose:function(...e){return he(...e.reverse())},concat:pe,concatLimit:de,concatSeries:ye,constant:function(...e){return function(...t){return t.pop()(null,...e)}},detect:ge,detectLimit:me,detectSeries:be,dir:xe,doUntil:function(e,t,r){const n=D(t);return _e(e,((...e)=>{const t=e.pop();n(...e,((e,r)=>t(e,!r)))}),r)},doWhilst:_e,each:je,eachLimit:Te,eachOf:X,eachOfLimit:V,eachOfSeries:W,eachSeries:Oe,ensureAsync:Ne,every:Se,everyLimit:Ee,everySeries:Ie,filter:Le,filterLimit:De,filterSeries:Pe,forever:Me,groupBy:function(e,t,r){return Fe(e,1/0,t,r)},groupByLimit:Fe,groupBySeries:function(e,t,r){return Fe(e,1,t,r)},log:Ue,map:J,mapLimit:fe,mapSeries:Y,mapValues:function(e,t,r){return Be(e,1/0,t,r)},mapValuesLimit:Be,mapValuesSeries:function(e,t,r){return Be(e,1,t,r)},memoize:function(e,t=(e=>e)){var r=Object.create(null),n=Object.create(null),i=D(e),o=j(((e,o)=>{var a=t(...e);a in r?I((()=>o(null,...r[a]))):a in n?n[a].push(o):(n[a]=[o],i(...e,((e,...t)=>{e||(r[a]=t);var i=n[a];delete n[a];for(var o=0,s=i.length;o<s;o++)i[o](e,...t)})))}));return o.memo=r,o.unmemoized=e,o},nextTick:Ze,parallel:function(e,t){return qe(X,e,t)},parallelLimit:function(e,t,r){return qe(H(t),e,r)},priorityQueue:function(e,t){var r=$e(e,t),n=!1;return r._tasks=new He,r.push=function(e,t=0,i=(()=>{})){if("function"!=typeof i)throw new Error("task callback must be a function");if(r.started=!0,Array.isArray(e)||(e=[e]),0===e.length&&r.idle())return I((()=>r.drain()));for(var o=0,a=e.length;o<a;o++){var s={data:e[o],priority:t,callback:i};r._tasks.push(s)}n||(n=!0,I((()=>{n=!1,r.process()})))},delete r.unshift,r},queue:$e,race:Ge,reduce:le,reduceRight:Xe,reflect:Je,reflectAll:function(e){var t;return Array.isArray(e)?t=e.map(Je):(t={},Object.keys(e).forEach((r=>{t[r]=Je.call(this,e[r])}))),t},reject:We,rejectLimit:Ye,rejectSeries:Ke,retry:tt,retryable:function(e,t){t||(t=e,e=null);let r=e&&e.arity||t.length;L(t)&&(r+=1);var n=D(t);return j(((t,i)=>{function o(e){n(...t,e)}return(t.length<r-1||null==i)&&(t.push(i),i=te()),e?tt(e,o,i):tt(o,i),i[ee]}))},seq:he,series:function(e,t){return qe(W,e,t)},setImmediate:I,some:nt,someLimit:it,someSeries:ot,sortBy:at,timeout:function(e,t,r){var n=D(e);return j(((i,o)=>{var a,s=!1;i.push(((...e)=>{s||(o(...e),clearTimeout(a))})),a=setTimeout((function(){var t=e.name||"anonymous",n=new Error('Callback function "'+t+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),s=!0,o(n)}),t),n(...i)}))},times:function(e,t,r){return st(e,1/0,t,r)},timesLimit:st,timesSeries:function(e,t,r){return st(e,1,t,r)},transform:function(e,t,r,n){arguments.length<=3&&"function"==typeof t&&(n=r,r=t,t=Array.isArray(e)?[]:{}),n=Z(n||te());var i=D(r);return X(e,((e,r,n)=>{i(t,e,r,n)}),(e=>n(e,t))),n[ee]},tryEach:ct,unmemoize:function(e){return(...t)=>(e.unmemoized||e)(...t)},until:function(e,t,r){const n=D(e);return ut((e=>n(((t,r)=>e(t,!r)))),t,r)},waterfall:lt,whilst:ut,all:Se,allLimit:Ee,allSeries:Ie,any:nt,anyLimit:it,anySeries:ot,find:ge,findLimit:me,findSeries:be,flatMap:pe,flatMapLimit:de,flatMapSeries:ye,forEach:je,forEachSeries:Oe,forEachLimit:Te,forEachOf:X,forEachOfSeries:W,forEachOfLimit:V,inject:le,foldl:le,foldr:Xe,select:Le,selectLimit:De,selectSeries:Pe,wrapSync:A,during:ut,doDuring:_e};const ft=ht;var dt=n(730),pt=n.n(dt);const yt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",vt="http://www.w3.org/2001/XMLSchema#",gt="http://www.w3.org/2000/10/swap/",mt={xsd:{decimal:`${vt}decimal`,boolean:`${vt}boolean`,double:`${vt}double`,integer:`${vt}integer`,string:`${vt}string`},rdf:{type:`${yt}type`,nil:`${yt}nil`,first:`${yt}first`,rest:`${yt}rest`,langString:`${yt}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${gt}reify#forSome`,forAll:`${gt}reify#forAll`},log:{implies:`${gt}log#implies`}};var bt=n(5929),wt=n.n(bt),xt=n(2486).Buffer;const{xsd:_t}=mt,kt=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,jt={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Tt=/[\x00-\x20<>\\"\{\}\|\^\`]/,Ot={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Nt=/$0^/;class St{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in Ot)&&this[e]instanceof RegExp&&(this[e]=Nt)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,a;for(;e=this._newline.exec(r);)this._comments&&(a=this._comment.exec(e[0]))&&i("comment",a[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(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,c=r[0];let u="",l="",h="",f=null,d=0,p=!1;switch(c){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(d=1,u="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){p=!0;break}case"<":if(f=this._unescapedIri.exec(r))u="IRI",l=f[1];else if(f=this._iri.exec(r)){if(l=this._unescape(f[1]),null===l||Tt.test(l))return o(this);u="IRI"}else r.length>1&&"<"===r[1]?(u="<<",d=2):this._n3Mode&&r.length>1&&"="===r[1]&&(u="inverse",d=2,l=">");break;case">":r.length>1&&">"===r[1]&&(u=">>",d=2);break;case"_":((f=this._blank.exec(r))||t&&(f=this._blank.exec(`${r} `)))&&(u="blank",h="_",l=f[1]);break;case'"':if(f=this._simpleQuotedString.exec(r))l=f[1];else if(({value:l,matchLength:d}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===d||(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(f=this._simpleApostropheString.exec(r))l=f[1];else if(({value:l,matchLength:d}=this._parseLiteral(r)),null===l)return o(this);null===f&&0===d||(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(f=this._variable.exec(r))&&(u="var",l=f[0]);break;case"@":"literal"===this._previousMarker&&(f=this._langcode.exec(r))?(u="langcode",l=f[1]):(f=this._keyword.exec(r))&&(u=f[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){u=".",d=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)||t&&(f=this._number.exec(`${r} `)))&&(u="literal",l=f[0],h="string"==typeof f[1]?_t.double:"string"==typeof f[2]?_t.decimal:_t.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(f=this._sparqlKeyword.exec(r))?u=f[0].toUpperCase():p=!0;break;case"f":case"t":(f=this._boolean.exec(r))?(u="literal",l=f[0],h=_t.boolean):p=!0;break;case"a":(f=this._shortPredicates.exec(r))?(u="abbreviation",l="a"):p=!0;break;case"=":this._n3Mode&&r.length>1&&(u="abbreviation",">"!==r[1]?(d=1,l="="):(d=2,l=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(d=1,u=c);break;default:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(f=this._prefix.exec(r))?((f=this._prefixed.exec(r))||t&&(f=this._prefixed.exec(`${r} `)))&&(u="prefixed",h=f[1]||"",l=this._unescape(f[2])):(u="prefix",l=f[1]||"")),"^^"===this._previousMarker)switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const y=d||f[0].length,v=i(u,l,h,s,y);this.previousToken=v,this._previousMarker=u,r=r.substr(y,r.length)}function i(t,i,o,a,s){const c=r?n-r.length:n,u={type:t,value:i,prefix:o,line:a,start:c,end:c+s};return e(null,u),u}function o(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(kt,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in jt?jt[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,o=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}wt()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=xt.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:Et,xsd:It}=mt;let At,Rt=0;const Ct={namedNode:function(e){return new Dt(e)},blankNode:function(e){return new Mt(e||"n3-"+Rt++)},variable:function(e){return new Ft(e)},literal:function(e,t){if("string"==typeof t)return new Pt(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";return""===r&&("boolean"==typeof e?r=It.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?It.integer:It.double:(r=It.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===r||r===It.string?new Pt(`"${e}"`):new Pt(`"${e}"^^${r}`)},defaultGraph:function(){return At},quad:Bt,triple:Bt};class Lt{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Lt?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Dt extends Lt{get termType(){return"NamedNode"}}class Pt extends Lt{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new Dt(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?It.string:Et.langString}equals(e){return e instanceof Pt?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class Mt extends Lt{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Ft extends Lt{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}At=new class extends Lt{constructor(){return super(""),At||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class Ut extends Lt{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||At}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function Bt(e,t,r,n){return new Ut(e,t,r,n)}let Zt=0;class qt{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Ht(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),a=this._n3Mode=/n3/.test(t),s=i||o;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||a),this._supportsRDFStar=""===t||/star|\*$/.test(t),s&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new St({lineMode:s,n3:a}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Zt=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,r,n,i){const o=this._n3Mode;this._contextStack.push({subject:r,predicate:n,object:i,graph:t,type:e,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(){const e=this._contextStack.pop(),t=this._n3Mode;this._subject=e.subject,this._predicate=e.predicate,this._object=e.object,this._graph=e.graph,t&&(this._inversePredicate=e.inverse,this._prefixes._=e.blankPrefix,this._quantified=e.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(n+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext(),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext(),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===a.predicate?a.subject=r:a.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==n){const e=this._predicate,t=this._object;i?this._emit(t,e,n,r):this._emit(n,e,t,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const e=this._subject;this._restoreContext(),this._emit(this._subject,this.RDF_FIRST,e,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext(),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=$t}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,i=-1,o=0,a="/";for(;n<t;){switch(a){case":":if(i<0&&"/"===e[++n]&&"/"===e[++n])for(;(i=n+1)<t&&"/"!==e[i];)n=i;break;case"?":case"#":n=t;break;case"/":if("."===e[n+1])switch(a=e[1+ ++n],a){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(a=e[1+ ++n],void 0===a||"/"===a||"?"===a||"#"===a){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==a)return`${r}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return r+e.substring(o)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Zt++}_`,this._prefixCallback=r||$t,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=$t):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function $t(){}function Ht(e,t){const r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(mt.rdf.first),e.RDF_REST=r(mt.rdf.rest),e.RDF_NIL=r(mt.rdf.nil),e.N3_FORALL=r(mt.r.forAll),e.N3_FORSOME=r(mt.r.forSome),e.ABBREVIATIONS={a:r(mt.rdf.type),"=":r(mt.owl.sameAs),">":r(mt.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}Ht(qt.prototype,Ct);const Vt=Ct.defaultGraph(),{rdf:zt,xsd:Gt}=mt,Xt=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Jt=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Qt={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class Wt extends Lt{equals(){return!1}}class Yt{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,r,n){e+=t,n&&n()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Vt,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${er(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return Vt.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,i){try{n.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(Vt.equals(n)?"":`${this._encodeIriOrBlank(n)} {\n`)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,r,n,i){delete this._prefixMatch,this._write(this.quadToString(e,t,r,n),i)}quadToString(e,t,r,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${n&&n.value?` ${this._encodeIriOrBlank(n)} .\n`:" .\n"}`}quadsToString(e){return e.map((e=>this.quadToString(e.subject,e.predicate,e.object,e.graph))).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),Xt.test(t)&&(t=t.replace(Jt,Kt));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(Xt.test(t)&&(t=t.replace(Jt,Kt)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Gt.string)return`"${t}"`}else switch(e.datatype.value){case Gt.string:return`"${t}"`;case Gt.boolean:if("true"===t||"false"===t)return t;break;case Gt.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Gt.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Gt.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===zt.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:r,graph:n}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${function(e){return!!e&&"DefaultGraph"===e.termType}(n)?"":` ${this._encodeIriOrBlank(n)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,n,i){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof n?this._writeQuad(e,t,r,Vt,n):this._writeQuad(e,t,r,n||Vt,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,r){const n={};n[e]=t,this.addPrefixes(n,r)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let r=!1;for(let t in e){let n=e[t];"string"!=typeof n&&(n=n.value),r=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[n]=t+=":",this._write(`@prefix ${t} <${n}>.\n`)}if(r){let e="",t="";for(const r in this._prefixIRIs)e+=e?`|${r}`:r,t+=(t?"|":"")+this._prefixIRIs[r];e=er(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(r?"\n":"",t)}blank(e,t){let r,n,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),n=i.length){case 0:return new Wt("[]");case 1:if(r=i[0],!(r.object instanceof Wt))return new Wt(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t="[";for(let o=0;o<n;o++)r=i[o],r.predicate.equals(e)?t+=`, ${this._encodeObject(r.object)}`:(t+=`${(o?";\n ":"\n ")+this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)}`,e=r.predicate);return new Wt(`${t}\n]`)}}list(e){const t=e&&e.length||0,r=new Array(t);for(let n=0;n<t;n++)r[n]=this._encodeObject(e[n]);return new Wt(`(${r.join(" ")})`)}end(e){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let t=e&&((r,n)=>{t=null,e(r,n)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function Kt(e){let t=Qt[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function er(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function tr(e,t){var r,n=new qt,i=new Yt({format:"N-Quads"});ft.waterfall([function(t){n.parse(e,(function(e,r,n){e?t(e):null!==r?i.addQuad(r):i.end(t)}))},function(e,t){try{pt().fromRDF(e,{format:"application/nquads"}).then((function(e){t(null,e)}))}catch(e){t(e)}},function(e,n){r=JSON.stringify(e),t(null,r)}],(function(e,n){t(e,r)}))}function rr(e,t){var r,n=new qt,i=new Yt({format:"N-Quads"});ft.waterfall([function(t){n.parse(e,(function(e,r,n){e?t(e):null!==quad?i.addQuad(quad):i.end(t)}))},function(e,n){t(null,r=e)}],(function(e,n){t(e,r)}))}var nr=function(e){(0,a.Z)(h,e);var n,i,l=(n=h,i=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(e){return!1}}(),function(){var e,t=(0,c.Z)(n);if(i){var r=(0,c.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,s.Z)(this,e)});function h(){var e;return(0,r.Z)(this,h),e=l.call(this,""),(0,u.Z)((0,o.Z)(e),"termType",f.ls),e}return(0,t.Z)(h,[{key:"toString",value:function(){return"()"}}]),h}(h.Z);function ir(e,t,r,n,i,o,a){try{var s=e[o](a),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,i)}var or=n(107),ar=n.n(or),sr="chrome:theSession";new v.Z(sr);var cr=function(e){(0,a.Z)(h,e);var n,i,l=(n=h,i=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(e){return!1}}(),function(){var e,t=(0,c.Z)(n);if(i){var r=(0,c.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,s.Z)(this,e)});function h(){var e;return(0,r.Z)(this,h),e=l.call(this,""),(0,u.Z)((0,o.Z)(e),"value",""),(0,u.Z)((0,o.Z)(e),"termType",f.NK),(0,u.Z)((0,o.Z)(e),"uri",sr),e}return(0,t.Z)(h,[{key:"toCanonical",value:function(){return this.value}},{key:"toString",value:function(){return"DefaultGraph"}}]),h}(h.Z);function ur(e){return!!e&&e.termType===f.NK}var lr=n(292),hr=new cr,fr=function(){function e(t,n,i,o){(0,r.Z)(this,e),(0,u.Z)(this,"subject",void 0),(0,u.Z)(this,"predicate",void 0),(0,u.Z)(this,"object",void 0),(0,u.Z)(this,"graph",void 0),this.subject=h.Z.fromValue(t),this.predicate=h.Z.fromValue(n),this.object=h.Z.fromValue(i),this.graph=null==o?hr:h.Z.fromValue(o)}return(0,t.Z)(e,[{key:"why",get:function(){return this.graph},set:function(e){this.graph=e}},{key:"equals",value:function(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}},{key:"substitute",value:function(t){var r=new e(this.subject.substitute(t),this.predicate.substitute(t),this.object.substitute(t),ur(this.graph)?this.graph:this.graph.substitute(t));return lr.log("@@@ statement substitute:"+r),r}},{key:"toCanonical",value:function(){var e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==f.NK&&e.push(this.graph.toCanonical()),e.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(),ur(this.graph)?"":this.graph.toNT()].join(" ")+" ."}},{key:"toString",value:function(){return this.toNT()}}]),e}(),dr=n(3357);var pr,yr,vr=function(e){(0,a.Z)(d,e);var n,i,h=(n=d,i=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(e){return!1}}(),function(){var e,t=(0,c.Z)(n);if(i){var r=(0,c.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,s.Z)(this,e)});function d(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,r.Z)(this,d),e=h.call(this,t),(0,u.Z)((0,o.Z)(e),"termType",f.UH),(0,u.Z)((0,o.Z)(e),"base","varid:"),(0,u.Z)((0,o.Z)(e),"classOrder",l.Z.Variable),(0,u.Z)((0,o.Z)(e),"isVar",1),(0,u.Z)((0,o.Z)(e),"uri",void 0),e.base="varid:",e.uri=dr.join(t,e.base),e}return(0,t.Z)(d,[{key:"equals",value:function(e){return!!e&&this.termType===e.termType&&this.value===e.value}},{key:"hashString",value:function(){return this.toString()}},{key:"substitute",value:function(e){var t;return null!=(t=e[this.toNT()])?t:this}},{key:"toString",value:function(){return d.toString(this)}}],[{key:"toString",value:function(e){return e.uri.slice(0,e.base.length)===e.base?"?".concat(e.uri.slice(e.base.length)):"?".concat(e.uri)}}]),d}(h.Z);!function(e){e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE"}(pr||(pr={}));var gr=new cr,mr={supports:(yr={},(0,u.Z)(yr,pr.collections,!1),(0,u.Z)(yr,pr.defaultGraphType,!1),(0,u.Z)(yr,pr.equalsMethod,!0),(0,u.Z)(yr,pr.identity,!1),(0,u.Z)(yr,pr.id,!0),(0,u.Z)(yr,pr.reversibleId,!1),(0,u.Z)(yr,pr.variableType,!0),yr),blankNode:function(e){return new p(e)},defaultGraph:function(){return gr},equals:function(e,t){return e===t||!e||!t||((0,g.PY)(e)||(0,g.PY)(t)?!(!(0,g.PY)(e)||!(0,g.PY)(t))&&this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph):!(!(0,g.jt)(e)||!(0,g.jt)(t))&&this.id(e)===this.id(t))},id:function(e){if(!e)return"undefined";if((0,g.PY)(e))return this.quadToNQ(e);switch(e.termType){case f.NK:return"defaultGraph";case f.UH:return vr.toString(e);default:var t=this.termToNQ(e);if(t)return t;throw new Error("Can't id term with type '".concat(e.termType,"'"))}},isQuad:function(e){return e instanceof fr},literal:function(e,t){if("string"!=typeof e&&!t)return b.fromValue(e);var r="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new b(r,t):new b(r,null,this.namedNode(t)):new b(r,null,t)},namedNode:function(e){return new v.Z(e)},quad:function(e,t,r,n){return new fr(e,t,r,n||gr)},triple:function(e,t,r,n){return this.quad(e,t,r,n)},quadToNQ:function(e){return"".concat(this.termToNQ(e.subject)," ").concat(this.termToNQ(e.predicate)," ").concat(this.termToNQ(e.object)," ").concat(this.termToNQ(e.graph)," .")},termToNQ:function(e){var t=this;switch(e.termType){case f.V1:return"_:"+e.value;case f.NK:return"";case f.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case f.xH:return b.toNT(e);case f._A:case f.XM:return"<"+e.value+">";case f.fb:return"("+e.elements.map((function(e){return t.termToNQ(e)})).join(" ")+")";default:throw new Error("Can't serialize nonstandard term type (was '".concat(e.termType,"')"))}},toNQ:function(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:function(e){return new vr(e)}};const br=mr;var wr=n(7308);function xr(e,t){var r=t||{namedNode:function(e){return new v.Z(e)}};return function(t){return r.namedNode(e+(t||""))}}var _r=n(5115);function kr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:br;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}kr(br);var jr=n(9523),Tr=n.n(jr),Or=n(292);function Nr(e){return new Sr(e)}var Sr=function(){function e(t){(0,r.Z)(this,e),(0,u.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,u.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,u.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,u.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,u.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(Tr()());for(var i in n){var o=Tr()()[n[i]](""),a=n[i];this.prefixes[o]=a,this.namespaces[a]=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||br,this.xsd=kr(this.rdfFactory)}return(0,t.Z)(e,[{key:"setBase",value:function(e){return this.base=e,this}},{key:"setFlags",value:function(e){return this.flags=e||"",this}},{key:"toStr",value:function(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}},{key:"fromStr",value:function(e){if("{"===e[0]){var t=this.formulas[e];return t||Or.log("No formula object for "+e),t}return this.store.fromNT(e)}},{key:"setNamespaces",value:function(e){for(var t in e)this.setPrefix(t,e[t]);return this}},{key:"setPrefix",value:function(e,t){if("default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t){for(var r in this.prefixes)this.prefixes[r]==e&&delete this.prefixes[r];this.prefixes[t]=e,this.namespaces[e]=t}}},{key:"suggestPrefix",value:function(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}},{key:"suggestNamespaces",value:function(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}},{key:"checkIntegrity",value:function(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}},{key:"makeUpPrefix",value:function(e){var t=e,r=function(t){return!!this.validPrefix.test(t)&&"ns"!==t&&!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var n=t.lastIndexOf("/");n>=0&&(t=t.slice(n+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&r(t))return t;if(r(t.slice(0,3)))return t.slice(0,3);if(r(t.slice(0,2)))return t.slice(0,2);if(r(t.slice(0,4)))return t.slice(0,4);if(r(t.slice(0,1)))return t.slice(0,1);if(r(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var o=0;;o++)if(r(t.slice(0,3)+o))return t.slice(0,3)+o}},{key:"rootSubjects",value:function(e){for(var t={},r={},n={},i=0;i<e.length;i++){var o=e[i],a=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(o.subject)};[o.subject,o.predicate,o.object].map((function(e){"BlankNode"===e.termType?n[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){a(e)}))})),a(e[i].object);var s=r[this.toStr(o.subject)];s||(s=[]),s.push(o),r[this.toStr(o.subject)]=s}var c=[];for(var u in r)if(r.hasOwnProperty(u)){var l=this.fromStr(u);"BlankNode"===l.termType&&t[l]&&1===t[l].length||c.push(l)}this.incoming=t;for(var h={},f=0;f<c.length;f++)h[c[f].toNT()]=!0;return{roots:c,subjects:r,rootsHash:h,incoming:t}}},{key:"toN3",value:function(e){return this.statementsToN3(e.statements)}},{key:"explicitURI",value:function(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?dr.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,r="",n=0;n<e.length;n++)r+=(t=e.charCodeAt(n))>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[n];return r}(e):encodeURI(e))+">"}},{key:"statementsToNTriples",value:function(e){var t=e.slice();t.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,a=this.rdfFactory,s=function e(t){if("Collection"!==t.termType)return i.atomicTermToN3(t);for(var s=t.elements,c=o.sym(n+"nill"),u=s.length-1;u>=0;u--){var l=a.blankNode();r+=e(l)+" "+e(o.sym(n+"first"))+" "+e(s[u])+".\n",r+=e(l)+" "+e(o.sym(n+"rest"))+" "+e(c)+".\n",c=l}return i.atomicTermToN3(c)},c=0;c<t.length;c++){var u=t[c],l="";l+=s(u.subject)+" ",l+=s(u.predicate)+" ",l+=s(u.object)+" ",this.flags.indexOf("q")>=0&&(l+=s(u.why)+" "),r+=l+=".\n"}return r}},{key:"statementsToN3",value:function(t){var r=this.store,n={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};t.sort((function(e,t){return _r.heavyCompareSPO(e,t,r,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(e){for(var t="",r=0;r<e;r++)t+=" ";return t},a=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n],o="string"==typeof i?i:e(i);if(0!==n){var a=r.slice(-1)||" ";","===o||";"===o||("."!==o||"0123456789.:".includes(a))&&(r+=" ")}r+=o}return r},s=function(e){for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function c(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[h(e,t)].concat([u(e,t)]).concat(["."]):l(e,t,!0).concat(["."])}var u=function(e,t){var r=[],n=null,o=t.subjects[this.toStr(e)]||[];if(void 0===o)throw new Error("Cant find statements for "+e);for(var a=[],s=0;s<o.length;s++){var c=o[s];c.predicate.uri===n?a.push(","):(n&&(r=r.concat([a]).concat([";"]),a=[]),r.push(i[c.predicate.uri]?i[c.predicate.uri]:h(c.predicate,t))),n=c.predicate.uri,a.push(l(c.object,t))}return r.concat([a])}.bind(this),l=function(e,t,r){return"BlankNode"!==e.termType||!r&&void 0!==t.rootsHash[e.toNT()]?h(e,t):t.subjects[this.toStr(e)]?["[",u(e,t),"]"]:"[]"}.bind(this);e.prototype.termToN3=h;var h=function(e,t){var r,n;switch(e.termType){case"Graph":return(n=(n=["{"]).concat(s(e.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<e.elements.length;r++)n.push([l(e.elements[r],t)]);return n.push(")"),n;default:return this.atomicTermToN3(e)}}.bind(this),f=function(){var e="";for(var t in this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),d=s(t);return f()+function e(t,r){var n="",i=1e5;void 0===r&&(r=-1);for(var s=0;s<t.length;s++){var c=t[s];if("string"!=typeof c){var u=e(c,r+1);if(u.length<10*(80-4*r)&&u.indexOf('"""')<0){var l=a(c);l.length<80-4*r&&(c=l,u="")}u&&(i=1e4),n+=u}if("string"==typeof c){if(1===c.length&&"\n"===n.slice(-1)&&",.;".indexOf(c)>=0){n=n.slice(0,-1),"."==c&&"0123456789.:".includes(n.charAt(n.length-1))&&(n+=" ",i+=1),n+=c+"\n",i+=1;continue}if(i<4*r+4||i+c.length+1<80&&";.".indexOf(n[n.length-2])<0)n=n.slice(0,-1)+" "+c+"\n",i+=c.length+1;else{var h=o(4*r)+c;n+=h+"\n",i=h.length,r<0&&(n+="\n",i=1e5)}}}return n}(d)}},{key:"atomicTermToN3",value:function(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var r=e.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return r;case"http://www.w3.org/2001/XMLSchema#decimal":return r.indexOf(".")<0&&(r+=".0"),r;case"http://www.w3.org/2001/XMLSchema#double":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"===e.value?"true":"false"}var i=this.stringToN3(e.value);return e.language?i+="@"+e.language:e.datatype.equals(this.xsd.string)||(i+="^^"+this.atomicTermToN3(e.datatype,t)),i;case"NamedNode":return this.symbolToN3(e);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}},{key:"stringToN3",value:function(e,t){t||(t="e");var r,n,i,o,a,s="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(o='"""',a=this.forbidden3):(o='"',a=this.forbidden1),r=0;r<e.length&&(a.lastIndex=0,null!=a.exec(e.slice(r)));){n=r+a.lastIndex-1,s+=e.slice(r,n);var c=e[n];'"'===c&&'"""'===o&&'"""'!==e.slice(n,n+3)?s+=c:(i='\b\f\r\t\v\n\\"'.indexOf(c))>=0?s+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?s+="\\u"+("000"+c.charCodeAt(0).toString(16).toLowerCase()).slice(-4):s+=c,r=n+1}return o+s+e.slice(r)+o}},{key:"symbolToN3",value:function(e){var t=e.uri,r=t.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=t.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var n=!0,i=r+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){n=!1;break}if(n){var o=t.slice(r+1),a=t.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(t)}},{key:"writeStore",value:function(e){var t=this.store,r=t.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var a=t.fromNT(o);n&&a.equals(n)||e("\n"+this.atomicTermToN3(a)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,a))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){e("\n<"+r.object.value+"> log:metadata {\n");var n=t.statementsMatching(void 0,void 0,void 0,r.subject);e(this.statementsToN3(this.statementsToN3(n))),e("}.\n")}));var s=[];n&&s.push(n);var c=[];s.map((function(e){c=c.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(c))}},{key:"statementsToXML",value:function(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},i=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];r+="string"==typeof i?i:e(i)}return r},o=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function a(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var s=function(e){return a(this.base?dr.refTo(this.base,e.uri):e.uri)}.bind(this),c=function(e,t){var n,i,o,f,d=[],p=t.subjects[this.toStr(e)];if(void 0===p)return l(e,t);p.sort((function(e,t){var n=e.predicate.uri,i=t.predicate.uri;if(n.substring(0,r.length)===r||i.substring(0,r.length)===r)return n.localeCompare(i);var o=n.substring(r.length),a=i.substring(r.length),s=parseInt(o,10),c=parseInt(a,10);return isNaN(s)||isNaN(c)||s!==o||c!==a?n.localeCompare(i):s-c}));for(var y=0;y<p.length;y++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=p[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":d=1===t.incoming[o.object].length?d.concat(["<"+i+' rdf:parseType="Resource">',c(o.object,t),"</"+i+">"]):d.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":d=d.concat(["<"+i+' rdf:resource="'+s(o.object)+'"/>']);break;case"Literal":d=d.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":d=d.concat(["<"+i+' rdf:parseType="Collection">',u(o.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var g=n?h(n):"rdf:Description",m="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(m=' rdf:nodeID="'+e.toNT().slice(2)+'"'):m=' rdf:about="'+s(e)+'"',["<"+g+m+">"].concat([d]).concat(["</"+g+">"])}.bind(this);function u(e,t){for(var r=[],n=0;n<e.elements.length;n++)r.push(c(e.elements[n],t));return r}var l=function(e,t){var r=[],n=t.subjects[this.toStr(e)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"BlankNode":r=t.rootsHash[o.object.toNT()]?r.concat(["<"+h(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+h(o.predicate)+">"]):r.concat(["<"+h(o.predicate)+' rdf:parseType="Resource">',l(o.object,t),"</"+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">',u(o.object,t),"</"+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(e){var r=e.uri,n=r.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=r.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+r+">");for(var i=n+1;i<r.length;i++)if(this._notNameChars.indexOf(r[i])>=0)throw new Error('Invalid character "'+r[i]+'" cannot be in XML qname for URI: '+r);var o=r.slice(n+1),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)),t[a]=!0,s+":"+o}.bind(this),f=o(e),d="<rdf:RDF";for(var p in this.defaultNamespace&&(d+=' xmlns="'+a(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(p)){var y=this.base&&this.flags.includes("z")?dr.refTo(this.base,p):p;d+="\n xmlns:"+this.prefixes[p]+'="'+a(y)+'"'}return function e(t,r){var o,a="",s=1e5;r||(r=0);for(var c=0;c<t.length;c++){var u=t[c];if("string"!=typeof u){var l=e(u,r+1);l.length<10*(80-4*r)&&l.indexOf('"""')<0&&(o=i(u)).length<80-4*r&&(u=" "+o,l=""),l&&(s=1e4),a+=l}"string"==typeof u&&(s<4*r+4?(a=a.slice(0,-1)+" "+u+"\n",s+=u.length+1):(a+=(o=n(4*r)+u)+"\n",s=o.length))}return a}([d+=">",f,"</rdf:RDF>"],-1)}}]),e}();function Er(e,t,r,n,i,o){r=r||(null==e?void 0:e.value);var a=o||{};n=n||f.z8;try{var s=Nr(t);a.flags&&s.setFlags(a.flags);var c=t.statementsMatching(void 0,void 0,void 0,e);switch("namespaces"in t&&s.suggestNamespaces(t.namespaces),a.namespaces&&s.setNamespaces(a.namespaces),s.setBase(r),n){case f.Is:return u(null,s.statementsToXML(c));case f.qS:case f.sZ:return u(null,s.statementsToN3(c));case f.z8:case f.Eo:return s.setFlags("si"),u(null,s.statementsToN3(c));case f.aV:return s.setFlags("deinprstux"),u(null,s.statementsToNTriples(c));case f.ui:s.setFlags("deinprstux"),tr(s.statementsToNTriples(c),i);break;case f.b4:case f.lL:return s.setFlags("deinprstux q"),u(null,s.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(e){if(i)return i(e,void 0);throw e}function u(e,t){return i?void i(e,t):t}}var Ir=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],Ar="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function Rr(e,t,r){var n=[];return r.reduce((function(t,r,i,o){var a;return n.push(e.quad(t,e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(a=e.blankNode(),n.push(e.quad(t,e.namedNode(Ar),a))):n.push(e.quad(t,e.namedNode(Ar),e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),a}),t),n}function Cr(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=e.length;for(r<0&&(r=n+r);r<n;r++)if(e[r]===t)return r;return-1}var Lr=n(292);function Dr(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Pr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Pr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Mr=function(e){(0,a.Z)(p,e);var n,i,d=(n=p,i=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(e){return!1}}(),function(){var e,t=(0,c.Z)(n);if(i){var r=(0,c.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,s.Z)(this,e)});function p(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};(0,r.Z)(this,p),(e=d.call(this,"")).statements=t,e.constraints=n,e.initBindings=i,e.optional=a,(0,u.Z)((0,o.Z)(e),"termType",f._A),(0,u.Z)((0,o.Z)(e),"classOrder",l.Z.Graph),(0,u.Z)((0,o.Z)(e),"fetcher",void 0),(0,u.Z)((0,o.Z)(e),"isVar",0),(0,u.Z)((0,o.Z)(e),"ns",xr),(0,u.Z)((0,o.Z)(e),"rdfFactory",void 0),e.rdfFactory=s&&s.rdfFactory||br;var c,h=Dr(Ir);try{var y=function(){var t=c.value;e[t]=function(){var r;return(r=e.rdfFactory)[t].apply(r,arguments)}};for(h.s();!(c=h.n()).done;)y()}catch(e){h.e(e)}finally{h.f()}return e}return(0,t.Z)(p,[{key:"add",value:function(e,t,r,n){var i=this;return 1===arguments.length&&e.forEach((function(e){return i.add(e.subject,e.predicate,e.object,e.graph)})),this.statements.push(this.rdfFactory.quad(e,t,r,n))}},{key:"addStatement",value:function(e){return this.add(e)}},{key:"bnode",value:function(e){return this.rdfFactory.blankNode(e)}},{key:"addAll",value:function(e){var t=this;e.forEach((function(e){t.add(e.subject,e.predicate,e.object,e.graph)}))}},{key:"any",value:function(e,t,r,n){var i=this.anyStatementMatching(e,t,r,n);return null==i?null:null==e?i.subject:null==t?i.predicate:null==r?i.object:null}},{key:"anyValue",value:function(e,t,r,n){var i=this.any(e,t,r,n);return i?i.value:void 0}},{key:"anyJS",value:function(e,t,r,n){var i=this.any(e,t,r,n);return i?h.Z.toJS(i):void 0}},{key:"anyStatementMatching",value:function(e,t,r,n){var i=this.statementsMatching(e,t,r,n,!0);if(i&&0!==i.length)return i[0]}},{key:"id",value:function(e){return this.rdfFactory.id(e)}},{key:"statementsMatching",value:function(e,t,r,n,i){var o=this.statements.filter((function(i){return(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))}));return i?0===o.length?[]:[o[0]]:o}},{key:"bottomTypeURIs",value:function(e){var t,r,n,i,o,a;for(var s in t=[],e)if(e.hasOwnProperty(s)){for(a=e[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 e){r=!1;break}r&&(t[s]=a)}return t}},{key:"collection",value:function(){return new x}},{key:"each",value:function(e,t,r,n){var i=[],o=this.statementsMatching(e,t,r,n,!1);if(null==e)for(var a=0,s=o.length;a<s;a++)i.push(o[a].subject);else if(null==t)for(var c=0,u=o.length;c<u;c++)i.push(o[c].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,d=o.length;f<d;f++)i.push(new v.Z(o[f].graph.value));return i}},{key:"equals",value:function(e){return!!e&&this.hashString()===e.hashString()}},{key:"findMembersNT",value:function(e){var t,r,n,i,o,a,s,c,u,l,h,f,d,p;for(var y in(f={})[e.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[(d=s[v]).subject.toNT()]=d;for(var m=0,b=(c=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=c[m],n=0,t=(u=this.statementsMatching(void 0,o)).length;n<t;n++)i[(d=u[n]).subject.toNT()]=d;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],p=0,r=(h=this.statementsMatching(void 0,o)).length;p<r;p++)i[(d=h[p]).object.toNT()]=d}return i}},{key:"findMemberURIs",value:function(e){return this.NTtoURI(this.findMembersNT(e))}},{key:"findSubClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}},{key:"findSuperClassesNT",value:function(e){var t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypesNT",value:function(e){var t,r,n,i,o,a;a=[];for(var s=0,c=(t=this.statementsMatching(e,void 0,void 0)).length;s<c;s++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===(o=t[s]).predicate.uri)a[o.object.toNT()]=o;else for(var u=0,l=(r=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"))).length;u<l;u++)a[r[u].toNT()]=o;for(var h=0,f=(n=this.statementsMatching(void 0,void 0,e)).length;h<f;h++){o=n[h];for(var d=0,p=(i=this.each(o.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"))).length;d<p;d++)a[i[d].toNT()]=o}return this.transitiveClosure(a,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}},{key:"findTypeURIs",value:function(e){return this.NTtoURI(this.findTypesNT(e))}},{key:"connectedStatements",value:function(e,t,r){r=r||[];for(var n=[e],i={},o={},a=[],s=this,c=function(e){var c=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,n.push(e))},u=s.statementsMatching(null,null,e,t).concat(s.statementsMatching(e,null,null,t));u=u.filter((function(e){if(r[e.predicate.value])return!1;var t=e.toNT();return!o[t]&&(o[t]=!0,!0)})),u.forEach((function(e){c(e.subject),c(e.object)})),a=a.concat(u)};n.length;)c(n.shift());return a}},{key:"formula",value:function(e){return new p}},{key:"fromNT",value:function(e){var t,r,n;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(n=void 0,t=void 0,(r=e.lastIndexOf('"'))<e.length-1)if("@"===e[r+1])n=e.slice(r+2);else{if("^^"!==e.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(r+3))}return e=(e=(e=(e=e.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,n||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new vr(e.slice(1))}throw new Error("Can't convert from NT: "+e)}},{key:"holds",value:function(e,t,r,n){var i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if((0,g.Yi)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}var o=this.anyStatementMatching(e,t,r,n);return null!=o}},{key:"holdsStatement",value:function(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}},{key:"list",value:function(e,t){if(t.rdfFactory.supports.COLLECTIONS){var r=t.rdfFactory.collection();return e.forEach((function(e){r.append(e)})),r}var n=t.rdfFactory.blankNode(),i=Rr(t.rdfFactory,n,e);return t.addAll(i),n}},{key:"NTtoURI",value:function(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],"<"===t[0]&&(n[t.slice(1,-1)]=r));return n}},{key:"serialize",value:function(e,t,r,n){return Er(r,this,e,t,void 0,n)}},{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)}));Lr.log("Formula subs statmnts:"+t);var r=new p;return r.addAll(t),Lr.log("indexed-form subs formula:"+r),r}},{key:"sym",value:function(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}},{key:"the",value:function(e,t,r,n){var i=this.any(e,t,r,n);return null==i&&wr.Z.error("No value found for the() {"+e+" "+t+" "+r+"}."),i}},{key:"transitiveClosure",value:function(e,t,r){var n,i,o,a,s,c={};Object.assign(c,e);for(var u={};;){if(null==(s=function(){for(var e in c)if(c.hasOwnProperty(e))return e}()))return u;for(n=0,i=(a=r?this.each(void 0,t,this.fromNT(s)):this.each(this.fromNT(s),t)).length;n<i;n++)(o=a[n].toNT())in u||o in c||(c[o]=c[s]);u[s]=c[s],delete c[s]}}},{key:"topTypeURIs",value:function(e){var t,r,n,i,o,a,s;for(r in a=[],e)if(e.hasOwnProperty(r)){for(s=e[r],i=0,t=0,n=(o=this.each(this.rdfFactory.namedNode(r),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"))).length;t<n;t++)if("http://www.w3.org/2000/01/rdf-schema#Resource"!==o[t].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(e){return new vr(e)}},{key:"whether",value:function(e,t,r,n){return this.statementsMatching(e,t,r,n,!1).length}}]),p}(h.Z);h.Z.fromValue=w;const Fr=h.Z;var Ur={xsd:xr("http://www.w3.org/2001/XMLSchema#")};h.Z.toJS=function(e){return(0,g.uZ)(e)?e.elements.map(h.Z.toJS):(0,g.n_)(e)?e.datatype.equals(Ur.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(Ur.xsd("dateTime"))||e.datatype.equals(Ur.xsd("date"))?new Date(e.value):e.datatype.equals(Ur.xsd("integer"))||e.datatype.equals(Ur.xsd("float"))||e.datatype.equals(Ur.xsd("decimal"))?Number(e.value):e.value:e};var Br=n(292),Zr=(0,t.Z)((function e(t,n){(0,r.Z)(this,e),this.pat=new Wr,this.vars=[],this.name=t,this.id=n}));function qr(e,t,r,n){function i(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r+=" "+t+" -> "+e[t]);return r}function o(e){var t,r="Bindings: ",n=e.length;for(t=0;t<n;t++)r+=i(e[t][0])+";\n\t";return r}function a(e,t,r,n){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var o=function(e,t,r,n){var i=r[e];if(void 0===i){if(e.isVar){var o=[];return o[e]=t,[[o,null]]}i=e}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[t]&&(t=n.redirections[t]),i.equals(t)||i.uri&&i.uri===sr?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?a(e,t,r):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],r,n);if(0===o.length)return o;var s,c,u,l,h,f,d,p=[],y=o.length;for(s=0;s<y;s++){for(h in d=[],c=o[s][0])c.hasOwnProperty(h)&&(d[h]=c[h]);for(h in r)r.hasOwnProperty(h)&&(d[h]=r[h]);for(l=(i=a(e.slice(1),t.slice(1),d,n)).length,u=0;u<l;u++){for(h in f=i[u][0],c)c.hasOwnProperty(h)&&(f[h]=c[h]);p.push([f,null])}}return p}function s(e,t){var r,n={};for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function c(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function u(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}c.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;wr.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},c.prototype.doCallBacks=function(e,t){var r;if(e<0)return this.originalCallback(t);for(r=0;r<this.branches[e].results.length;r++)this.doCallBacks(e-1,s(t,this.branches[e].results[r]))},u.prototype.reportMatch=function(e){this.callback(e),this.success=!0},u.prototype.reportDone=function(){this.done=!0,wr.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var l=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function h(e,t,r){var n,i,o,a,s,c;for(t.nvars=0,t.index=null,n=[t.subject,t.predicate,t.object,t.why],a=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],o=0;o<4;o++){var u=n[o];if(u.uri&&u.uri===sr);else if(u.isVar&&void 0===r[u])t.nvars++;else{if(void 0,u=void 0===(c=r[s=n[o]])?s:c,e.redirections[e.id(u)]&&(u=e.redirections[e.id(u)]),!(i=a[o][e.id(u)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function f(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}l.prototype.reportMatch=function(e){this.results.push(e)},l.prototype.reportDone=function(){wr.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),wr.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var d=function e(r,n,o,a,s,u,h){wr.Z.debug("Match begins, Branch count now: "+h.count+" for "+h.pattern_debug);var f,d,p=n.statements;if(0===p.length){if(wr.Z.debug("FOUND MATCH WITH BINDINGS:"+i(o)),0===n.optional.length)h.reportMatch(o);else{wr.Z.debug("OPTIONAL: "+n.optional);var v,g=new c(t,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,e(r,n.optional[v],o,"",s,t,m[v])}return h.count--,void wr.Z.debug("Match ends -- success , Branch count now: "+h.count+" for "+h.pattern_debug)}var b=p.length;if(s){var w=function(t,i){var c=t.uri.split("#")[0];s.nowOrWhenFetched(c,void 0,(function(i,c,l){i||Br.log("Error following link to <"+t.uri+"> in query: "+c),e(r,n,o,a,s,u,h)}))};for(d=0;d<b;d++){if(f=p[d],void 0!==o[f.subject]&&o[f.subject].uri&&s&&"unrequested"===s.getState((0,dr.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,dr.docpart)(o[f.object].uri)))return void w(o[f.object])}}y(r,n,o,a,s,u,h)},p=function(e,t){var r,n,i=!0;for(r in e)e.hasOwnProperty(r)&&t[r]&&(n=t[r].test)&&!n(e[r])&&(i=!1);return i},y=function(e,t,r,n,s,c,u){var l,y,v,g,m,b,w,x=t.statements,_=x.length;for(l=0;l<_;l++)h(e,w=x[l],r);x.sort(f),w=x[0];var k,j=e.formula();j.optional=t.optional,j.constraints=t.constraints,j.statements=x.slice(1),wr.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var T,O,N=w.index.length,S=0;for(k=0;k<N;k++)for(O=w.index[k],T=a([w.subject,w.predicate,w.object,w.why],[O.subject,O.predicate,O.object,O.why],r,e),wr.Z.info(n+" From first: "+T.length+": "+o(T)),v=T.length,y=0;y<v;y++)if(m=[],b=T[y][0],p(b,t.constraints)){for(g in b)b.hasOwnProperty(g)&&(m[g]=b[g]);for(g in r)r.hasOwnProperty(g)&&(m[g]=r[g]);u.count++,S++,d(e,j,m,n+" ",s,c,u)}else wr.Z.debug("Branch count CS: "+u.count);u.count--,0===S&&wr.Z.debug("Match2 fails completely on "+w),wr.Z.debug("Match2 ends, Branch count: "+u.count+" for "+u.pattern_debug),0===u.count&&(wr.Z.debug("Branch finished."),u.reportDone())},v=this;wr.Z.debug("Query on "+this.statements.length);var g=new u(t,n);g.count++,e.sync?d(v,e.pat,e.pat.initBindings,"",r,t,g):setTimeout((function(){d(v,e.pat,e.pat.initBindings,"",r,t,g)}),0)}function $r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$r(Object(r),!0).forEach((function(t){(0,u.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$r(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Vr(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return zr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?zr(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function zr(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Gr="http://www.w3.org/2002/07/owl#";function Xr(e,t,r,n){var i=e.any(t,r,void 0);return!!i&&(e.equate(i,n),!0)}function Jr(e,t,r,n){var i=e.any(void 0,r,n);return!!i&&(e.equate(i,t),!0)}function Qr(e,t,r,n,i){e.typeCallback&&e.typeCallback(e,n,i);var o=e.classActions[e.id(n)],a=!1;if(o)for(var s=0;s<o.length;s++)a=a||o[s](e,t,r,n,i);return a}var Wr=function(e){(0,a.Z)(d,e);var n,i,h=(n=d,i=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(e){return!1}}(),function(){var e,t=(0,c.Z)(n);if(i){var r=(0,c.Z)(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return(0,s.Z)(this,e)});function d(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,r.Z)(this,d),t=h.call(this,void 0,void 0,void 0,void 0,n),(0,u.Z)((0,o.Z)(t),"updater",void 0),(0,u.Z)((0,o.Z)(t),"namespaces",void 0),(0,u.Z)((0,o.Z)(t),"classActions",void 0),(0,u.Z)((0,o.Z)(t),"propertyActions",void 0),(0,u.Z)((0,o.Z)(t),"redirections",void 0),(0,u.Z)((0,o.Z)(t),"aliases",void 0),(0,u.Z)((0,o.Z)(t),"HTTPRedirects",void 0),(0,u.Z)((0,o.Z)(t),"subjectIndex",void 0),(0,u.Z)((0,o.Z)(t),"predicateIndex",void 0),(0,u.Z)((0,o.Z)(t),"objectIndex",void 0),(0,u.Z)((0,o.Z)(t),"whyIndex",void 0),(0,u.Z)((0,o.Z)(t),"index",void 0),(0,u.Z)((0,o.Z)(t),"features",void 0),(0,u.Z)((0,o.Z)(t),"_universalVariables",void 0),(0,u.Z)((0,o.Z)(t),"_existentialVariables",void 0),(0,u.Z)((0,o.Z)(t),"rdfArrayRemove",void 0),(0,u.Z)((0,o.Z)(t),"dataCallbacks",void 0),t.propertyActions={},t.classActions={},t.redirections=[],t.aliases=[],t.HTTPRedirects=[],t.subjectIndex=[],t.predicateIndex=[],t.objectIndex=[],t.whyIndex=[],t.index=[t.subjectIndex,t.predicateIndex,t.objectIndex,t.whyIndex],t.namespaces={},t.features=e||[],t.rdfArrayRemove=n.rdfArrayRemove||_r.RDFArrayRemove,n.dataCallback&&(t.dataCallbacks=[n.dataCallback]),t.initPropertyActions(t.features),t}return(0,t.Z)(d,[{key:"substitute",value:function(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new d;return r.add(t),r}},{key:"addDataCallback",value:function(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}},{key:"applyPatch",value:function(e,t,r){var n,i=this,o=null;function a(a){if(e.delete){n=e.delete,o&&(n=n.substitute(o)),n=n.statements;var s=[],c=n.map((function(e){var r=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===r.length?(s.push(e),null):r[0]}));if(s.length)return r("Could not find to delete: "+s.join("\n or "));c.map((function(e){i.remove(e)}))}e.insert&&(n=e.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),a()}if(e.where){var s=new Zr("patch");s.pat=e.where,s.pat.statements.map((function(e){e.graph=xi(t.value)})),s.sync=!0;var c=[];i.query(s,(function(e){c.push(e)}),i.fetcher,(function(){return 0===c.length?r("No match found to be patched:"+e.where):c.length>1?r("Patch ambiguous. No patch done."):(o=c[0],void a(r))}))}else a(r)}},{key:"declareExistential",value:function(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}},{key:"initPropertyActions",value:function(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[Qr],Cr(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(Gr,"sameAs")))]=[function(e,t,r,n,i){return e.equate(t,n),!0}]),Cr(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(Gr,"InverseFunctionalProperty")))]=[function(e,t,r,n,i){return e.newPropertyAction(t,Jr)}]),Cr(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode("".concat(Gr,"FunctionalProperty")))]=[function(e,t,r,n,i){return e.newPropertyAction(t,Xr)}])}},{key:"addStatement",value:function(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}},{key:"add",value:function(e,t,r,n){var i,o,a;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else(0,g.PY)(e)?this.add(e.subject,e.predicate,e.object,e.graph):(0,g.Pv)(e)&&this.add(e.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=Fr.fromValue(t);var s=Fr.fromValue(r);if(n=Fr.fromValue(n),!(0,g.f)(e))throw new Error("Subject is not a subject type");if(!(0,g.nq)(t))throw new Error("Predicate ".concat(t," is not a predicate type"));if(!(0,g.Uc)(s))throw new Error("Object ".concat(s," is not an object type"));if(!(0,g.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,n);var c=this.id(this.canon(t)),u=!1;if(o=this.propertyActions[c])for(i=0;i<o.length;i++)u=u||o[i](this,e,t,s,n);if(this.holds(e,t,s,n))return null;var l=[this.id(this.canon(e)),c,this.id(this.canon(s)),this.id(this.canon(n))];for(a=this.rdfFactory.quad(e,t,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 d,p=Vr(this.dataCallbacks);try{for(p.s();!(d=p.n()).done;){var y=d.value;y(a)}}catch(e){p.e(e)}finally{p.f()}}return a}},{key:"canon",value:function(e){if(!e)return e;var t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case f.V1:return new p(e.value);case f.fb:return e;case f.NK:return new cr;case f.ls:case f._A:return e;case f.xH:return new b(e.value,e.language,e.datatype);case f.XM:return new v.Z(e.value);case f.UH:return new vr(e.value);default:throw new Error("Term Type not recognized for canonization: ".concat(e.termType))}}},{key:"check",value:function(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var r in t)t.hasOwnProperty(r)&&this.checkStatementList(t[r],e)}}},{key:"checkStatementList",value:function(e,t){void 0===t&&(t=0);for(var r,n=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var o=[(r=e[i]).subject,r.predicate,r.object,r.graph],a=function(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.graph))return!0},s=0;s<4;s++){var c=this.canon(o[s]),u=this.id(c);this.index[s][u]&&a(this.index[s][u],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(e,t){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(t):l.Z[e.termType]<l.Z[t.termType]?-1:l.Z[e.termType]>l.Z[t.termType]?1:e.value<t.value?-1:e.value>t.value?1:0}},{key:"copyTo",value:function(e,t,r){r||(r=[]);var n=this.statementsMatching(e);-1!==Cr(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,o.predicate,o.object.copy(this))}-1!==Cr(r,"delete")&&this.remove(o)}}},{key:"equate",value:function(e,t){var r=this.canon(e),n=this.canon(t),i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}},{key:"formula",value:function(e){return new d(e)}},{key:"length",get:function(){return this.statements.length}},{key:"match",value:function(e,t,r,n){return this.statementsMatching(Fr.fromValue(e),Fr.fromValue(t),Fr.fromValue(r),Fr.fromValue(n))}},{key:"mentionsURI",value:function(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}},{key:"newExistential",value:function(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}},{key:"newPropertyAction",value:function(e,t){var r=this.id(e);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(t);for(var n=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<n.length;o++)i=i||t(this,n[o].subject,e,n[o].object);return i}},{key:"newUniversal",value:function(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}},{key:"variable",value:function(e){return new vr(e)}},{key:"nextSymbol",value:function(e){for(var t=0;;t++){var r=e.value+"#n"+t;if(!this.mentionsURI(r))return this.sym(r)}}},{key:"query",value:function(e,t,r,n){return qr.call(this,e,t,r,n)}},{key:"querySync",value:function(e){var t=[],r=!1;if(e.sync=!0,qr.call(this,e,(function(e){t.push(e)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return t}},{key:"remove",value:function(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if((0,g.Pv)(e))return this.remove(e.statements);var r=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(r[0]),this}},{key:"removeDocument",value:function(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),r=0;r<t.length;r++)this.removeStatement(t[r]);return this}},{key:"removeMany",value:function(e,t,r,n,i){for(var o=this.statementsMatching(e,t,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(e,t,r,n){return this.removeMany(e,t,r,n),this}},{key:"removeStatement",value:function(e){for(var t=[e.subject,e.predicate,e.object,e.graph],r=0;r<4;r++){var n=this.canon(t[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],e)}return this.rdfArrayRemove(this.statements,e),this}},{key:"removeStatements",value:function(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}},{key:"replaceWith",value:function(e,t){for(var r=this.id(e),n=this.id(t),i=function(e){var t=e[r];if(t){var i=e[n];e[n]=i?t.concat(i):t,delete e[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=t,e.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(e),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=t,this.aliases[n].push(this.aliases[r][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}},{key:"allAliases",value:function(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}},{key:"sameThings",value:function(e,t){if(e.equals(t))return!0;var r=this.canon(e);if(!r)return!1;var n=this.canon(t);return!!n&&r.value===n.value}},{key:"setPrefixForURI",value:function(e,t){if(("tab"!==e||!this.namespaces.tab)&&"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)){for(var r in this.namespaces)this.namespaces[r]==t&&delete this.namespaces[r];this.namespaces[e]=t}}},{key:"statementsMatching",value:function(e,t,r,n,i){var o,a,s=[e,t,r,n],c=[],u=[],l=[],h=[];for(o=0;o<4;o++)c[o]=this.canon(Fr.fromValue(s[o])),c[o]?(h.push(o),u[o]=this.id(c[o])):l.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(a=this.index[o][u[o]])&&i&&a.length>1&&(a=a.slice(0,1)),a||[];var f,d,p=1e10;for(d=0;d<h.length;d++){if(o=h[d],!(a=this.index[o][u[o]]))return[];a.length<p&&(p=a.length,f=d)}for(var y=h[f],v=this.index[y][u[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(d=0;d<g.length;d++)if(o=g[d],!this.canon(x[b[o]]).equals(c[o])){x=null;break}if(null!=x&&(m.push(x),i))break}return m}},{key:"uris",value:function(e){var t=this.canon(e),r=this.aliases[this.id(t)];if(!t.value)return[];var n=[t.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}},{key:"serialize",value:function(e,t,r,n){var i,o=null!==(i=n)&&void 0!==i&&i.namespaces?Hr(Hr({},this.namespaces),n.namespaces):Hr({},this.namespaces);return Er(r,this,e,t,void 0,n=Hr(Hr({},n||{}),{},{namespaces:o}))}}],[{key:"defaultGraphURI",get:function(){return sr}}]),d}(Mr);(0,u.Z)(Wr,"handleRDFType",void 0),Wr.handleRDFType=Qr;var Yr="http://www.w3.org/2000/10/swap/log#",Kr=function(e){return e},en=function(e){return e},tn=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},rn=function(e){return e.length},nn=function(e,t,r){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+(0,y.Z)(e);return void 0===r||null==r?e.slice(t):e.slice(t,r)},on=Error("dummy error stop iteration"),an=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw on;return this.li[this.last++]},this},sn=function(e,t){return e.indexOf(t)},cn=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var un=function(e,t){return dr.join(t,e)},ln="http://www.w3.org/2002/07/owl#sameAs",hn="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",fn=hn+":",dn=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),pn=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?"),yn=new RegExp('[\\\\\\r\\n\\"]',"g"),vn=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const gn=function(e,t,r,n,i,o,a,s){return new bn(e,t,r,n,i,o,a,s)};var mn,bn=function(){function e(t,n,i,o,a,s,c,u){(0,r.Z)(this,e),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===c&&(c=""),void 0===u&&(u=null),this._bindings=new tn([]),this._flags=c,""!=i&&(cn(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.startOfLine=0,this.previousLine=0,this._genPrefix=a,this.keywords=new en(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new tn([]),this._variables=new tn([]),this._parentVariables=new tn([]),this._reason=u,this._reason2=null,this._baseURI=o||i||null,cn(!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)(e,[{key:"here",value:function(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}},{key:"formula",value:function(){return this._formula}},{key:"loadStream",value:function(e){return this.loadBuf(e.read())}},{key:"loadBuf",value:function(e){return this.startDoc(),this.feed(e),this.endDoc()}},{key:"feed",value:function(e){for(var t=e.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(t,r);if(n<0)return;if((r=this.directiveOrStatement(t,n))<0)throw wn(this._thisDoc,this.lines,t,n,"expected directive or statement")}}},{key:"directiveOrStatement",value:function(e,t){var r,n=this.skipSpace(e,t);return n<0?n:(r=this.directive(e,n))>=0||(r=this.statement(e,n))>=0?this.checkDot(e,r):r}},{key:"tok",value:function(e,t,r){if("@"==t.slice(r,r+1))r+=1;else if(Cr(this.keywords,e)<0)return-1;var n=r+rn(e);return t.slice(r,n)==e&&hn.indexOf(t.charAt(n))>=0?n:-1}},{key:"directive",value:function(e,t){if((o=this.skipSpace(e,t))<0)return o;var r=new en([]);if((o=this.tok("bind",e,t))>0)throw wn(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!1))<0)throw wn(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(nn(r,null,null)),t}if((o=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!0))<0)throw wn(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var n=new an(r);try{for(;;){var i=n.next();(Cr(this._variables,i)<0||Cr(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=on)throw e}return t}if((o=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,o,r,this.uri_ref2))<0)throw wn(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");n=new an(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(e){if(e!=on)throw e}return t}if((o=this.tok("prefix",e,t))>=0){var o,a=new en([]);if((t=this.qname(e,o,a))<0)throw wn(this._thisDoc,this.lines,e,o,"expected qname after @prefix");if((o=this.uri_ref2(e,t,a))<0)throw wn(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var s=a[1].uri;return this._baseURI?s=un(this._baseURI,s):cn(s.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),cn(s.indexOf(":")>=0),this._bindings[a[0][0]]=s,this.bind(a[0][0],function(e){return encodeURI(e)}(s)),o}if((o=this.tok("base",e,t))>=0){if(a=new en([]),(t=this.uri_ref2(e,o,a))<0)throw wn(this._thisDoc,this.lines,e,o,"expected <uri> after @base ");if(s=a[0].uri,!this._baseURI)throw wn(this._thisDoc,this.lines,e,o,"With no previous base URI, cannot use relative URI in @base <"+s+">");return s=un(this._baseURI,s),cn(s.indexOf(":")>=0),this._baseURI=s,t}return-1}},{key:"bind",value:function(e,t){""==e||this._store.setPrefixForURI(e,t)}},{key:"setKeywords",value:function(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}},{key:"startDoc",value:function(){}},{key:"endDoc",value:function(){return this._formula}},{key:"makeStatement",value:function(e){e[0].add(e[2],e[1],e[3],this.source),this.statementCount+=1}},{key:"statement",value:function(e,t){var r=new en([]);if((t=this.object(e,t,r))<0)return t;var n=this.property_list(e,t,r[0]);if(n<0)throw wn(this._thisDoc,this.lines,e,t,"expected propertylist");return n}},{key:"subject",value:function(e,t,r){return this.item(e,t,r)}},{key:"verb",value:function(e,t,r){if((i=this.skipSpace(e,t))<0)return i;var n=new en([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,n))<0)throw wn(this._thisDoc,this.lines,e,i,"expected property after 'has'");return r.push(new Kr(["->",n[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,n))<0)throw wn(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw wn(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;if(t=i,(i=this.tok("of",e,t))<0)throw wn(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return r.push(new Kr(["<-",n[0]])),i}if((i=this.tok("a",e,t))>=0)return r.push(new Kr(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return r.push(new Kr(["<-",this._store.sym(Yr+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(r.push(new Kr(["->",this._store.sym(Yr+"implies")])),t+2):(r.push(new Kr(["->",this._store.sym(ln)])),t+1);if(":="==e.slice(t,t+2))return r.push(new Kr(["->",Yr+"becomes"])),t+2;if((i=this.prop(e,t,n))>=0)return r.push(new Kr(["->",n[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw wn(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}},{key:"prop",value:function(e,t,r){return this.item(e,t,r)}},{key:"item",value:function(e,t,r){return this.path(e,t,r)}},{key:"blankNode",value:function(e){return this._context.bnode(e,this._reason2)}},{key:"path",value:function(e,t,r){if((o=this.nodeOrLiteral(e,t,r))<0)return o;for(;"!^.".indexOf(e.slice(o,o+1))>=0;){var n=e.slice(o,o+1);if("."==n){var i=e.slice(o+1,o+2);if(!i||fn.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,a=r.pop(),s=this.blankNode(this.here(o));if((o=this.node(e,o+1,r))<0)throw wn(this._thisDoc,this.lines,e,o,"EOF found in middle of path syntax");var c=r.pop();"^"==n?this.makeStatement(new Kr([this._context,c,s,a])):this.makeStatement(new Kr([this._context,c,a,s])),r.push(s)}return o}},{key:"anonymousNode",value:function(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}},{key:"node",value:function(e,t,r,n){void 0===n&&(n=null);var i=n;if((l=this.skipSpace(e,t))<0)return l;t=l;var o=e.slice(t,t+1);if("["==o){var a=this.here(t);if((l=this.skipSpace(e,t+1))<0)throw wn(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(l,l+1)){t=l+1;var s=new en([]);if(!((l=this.objectList(e,t,s))>=0))throw wn(this._thisDoc,this.lines,e,t,"objectList expected after [= ");if(i=s[0],rn(s)>1){var c=new an(s);try{for(;;){var u=c.next();this.makeStatement(new Kr([this._context,this._store.sym(ln),i,u]))}}catch(e){if(e!=on)throw e}}if((l=this.skipSpace(e,l))<0)throw wn(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(l,l+1))var l=l+1}if(null==i&&(i=this.blankNode(a)),(t=this.property_list(e,l,i))<0)throw wn(this._thisDoc,this.lines,e,l,"property_list expected");if((l=this.skipSpace(e,t))<0)throw wn(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(l,l+1))throw wn(this._thisDoc,this.lines,e,l,"']' expected");return r.push(i),l+1}if("{"==o){if("$"==e.slice(t+1,t+2)){l=(t+=1)+1;for(var h=new en([]),f=!0;;){if((t=this.skipSpace(e,l))<0)throw wn(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){l=t+2;break}if(f)f=!1;else{if(","!=e.slice(t,t+1))throw wn(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var d=new en([]);if((l=this.item(e,t,d))<0)throw wn(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");h.push(d[0])}return r.push(this._store.newSet(h,this._context)),l}l=t+1;var p=this._parentContext;this._parentContext=this._context;var y=this._anonymousNodes,v=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new tn([]),this._variables=this._variables.slice();var g=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((t=this.skipSpace(e,l))<0)throw wn(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){l=t+1;break}if((l=this.directiveOrStatement(e,t))<0)throw wn(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=y,this._variables=this._parentVariables,this._parentVariables=v,this._context=this._parentContext,this._reason2=g,this._parentContext=p,r.push(i.close()),l}if("("==o){var m=this._store.list;for("$"==e.slice(t+1,t+2)&&(m=this._store.newSet,t+=1),l=t+1,h=new en([]);;){if((t=this.skipSpace(e,l))<0)throw wn(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){l=t+1;break}if(d=new en([]),(l=this.item(e,t,d))<0)throw wn(this._thisDoc,this.lines,e,t,"expected item in list or ')'");h.push(d[0])}return r.push(m(h,this._context)),l}if((l=this.tok("this",e,t))>=0)throw wn(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(l=this.tok("true",e,t))>=0?(r.push(!0),l):(l=this.tok("false",e,t))>=0?(r.push(!1),l):null==i&&(l=this.uri_ref2(e,t,r))>=0?l:-1}},{key:"property_list",value:function(e,t,r){for(;;){if((l=this.skipSpace(e,t))<0)throw wn(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(l,l+2)){t=l;var n=new en([]);if((l=this.verb(e,t,n))<=0)return t;var i=new en([]);if((t=this.objectList(e,l,i))<0)throw wn(this._thisDoc,this.lines,e,l,"objectList expected");var o=new an(i);try{for(;;){var a=o.next(),s=n[0],c=s[0],u=s[1];"->"==c?this.makeStatement(new Kr([this._context,u,r,a])):this.makeStatement(new Kr([this._context,u,a,r]))}}catch(e){if(e!=on)throw e}if((l=this.skipSpace(e,t))<0)throw wn(this._thisDoc,this.lines,e,l,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t+=1}else{t=l+2;var l,h=new en([]);if((l=this.node(e,t,h,r))<0)throw wn(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");t=l}}}},{key:"commaSeparatedList",value:function(e,t,r,n){if((i=this.skipSpace(e,t))<0)throw wn(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(n)var i=this.uri_ref2(e,i,r);else i=this.bareWord(e,i,r);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=n?this.uri_ref2(e,t+1,r):this.bareWord(e,t+1,r))<0)throw wn(this._thisDoc,this.lines,e,i,"bad list content")}}},{key:"objectList",value:function(e,t,r){if((t=this.object(e,t,r))<0)return-1;for(;;){var n=this.skipSpace(e,t);if(n<0)throw wn(this._thisDoc,this.lines,e,n,"EOF found after object");if(","!=e.slice(n,n+1))return n;if((t=this.object(e,n+1,r))<0)return t}}},{key:"checkDot",value:function(e,t){var r=this.skipSpace(e,t);if(r<0)return r;if("."==e.slice(r,r+1))return r+1;if("}"==e.slice(r,r+1))return r;if("]"==e.slice(r,r+1))return r;throw wn(this._thisDoc,this.lines,e,r,"expected '.' or '}' or ']' at end of statement")}},{key:"uri_ref2",value:function(e,t,r){var n=new en([]);if((f=this.qname(e,t,n))>=0){var i=n[0],o=i[0],a=i[1];if(null==o){cn(0,"not used?");var s=this._baseURI+"#"}else if(!(s=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(a)),f;throw wn(this._thisDoc,this.lines,e,t,"Prefix "+o+" not bound.")}var c=this._store.sym(s+a);return Cr(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),f}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var u=new en([]);return(f=this.variable(e,t,u))>0?(r.push(u[0]),f):-1}if("<"==e.charAt(t)){for(var l=t+=1;t<rn(e);){if(">"==e.charAt(t)){var h=e.slice(l,t);return this._baseURI?h=un(this._baseURI,h):cn(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=nn(h,-1,null)&&(h+="#"),c=this._store.sym(h),Cr(this._variables,c)>=0?r.push(this._variables[c]):r.push(c),t+1}t+=1}throw wn(this._thisDoc,this.lines,e,f,"unterminated URI reference")}if(this.keywordsSet){var f;if(u=new en([]),(f=this.bareWord(e,t,u))<0)return-1;if(Cr(this.keywords,u[0])>=0)throw wn(this._thisDoc,this.lines,e,t,'Keyword "'+u[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+u[0])),f}return-1}},{key:"skipSpace",value:function(e,t){for(var r=t||0;r<e.length;r++){var n=e.charAt(r);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(n)<0){if("#"!==e.charAt(r))return r;for(;;r++){if(r===e.length)return-1;if("\n"===e.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(r)&&(this.lines=this.lines+1)}return-1}},{key:"variable",value:function(e,t,r){if((n=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(n,n+1))return-1;var n;if(t=n+=1,"0123456789-".indexOf(e.charAt(n))>=0)throw wn(this._thisDoc,this.lines,e,n,"Varible name can't start with '"+e.charAt(n)+"s'");for(;t<rn(e)&&fn.indexOf(e.charAt(t))<0;)t+=1;if(null==this._parentContext)throw wn(this._thisDoc,this.lines,e,n,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(n-1,t));return r.push(this._store.variable(e.slice(n,t))),t}},{key:"bareWord",value:function(e,t,r){var n=this.skipSpace(e,t);if(n<0)return-1;var i=e.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(fn.indexOf(i)>=0)return-1;for(t=n;t<rn(e)&&fn.indexOf(e.charAt(t))<0;)t+=1;return r.push(e.slice(n,t)),t}},{key:"qname",value:function(e,t,r){if((t=this.skipSpace(e,t))<0)return-1;var n=e.charAt(t);if("0123456789-+".indexOf(n)>=0)return-1;if(fn.indexOf(n)<0){var i=n;for(t+=1;t<rn(e)&&(n=e.charAt(t),fn.indexOf(n)<0);)i+=n,t+=1}else i="";if(t<rn(e)&&":"==e.charAt(t)){var o=i;for(t+=1,i="";t<rn(e)&&(n=e.charAt(t),fn.indexOf(n)<0);)i+=n,t+=1;return r.push(new Kr([o,i])),t}return i&&this.keywordsSet&&Cr(this.keywords,i)<0?(r.push(new Kr(["",i])),t):-1}},{key:"object",value:function(e,t,r){if((a=this.subject(e,t,r))>=0)return a;if((a=this.skipSpace(e,t))<0)return-1;t=a;var n=null,i=e.charAt(t);if('"'==i||"'"==i){n=e.slice(t,t+3==i+i)?i+i+i:i,t+=rn(n);var o=this.strconst(e,t,n),a=o[0],s=o[1];return r.push(this._store.literal(s)),a}return-1}},{key:"nodeOrLiteral",value:function(e,t,r){if((c=this.node(e,t,r))>=0)return c;if((c=this.skipSpace(e,t))<0)return-1;t=c;var n=e.charAt(t);if("-+0987654321".indexOf(n)>=0){if(pn.lastIndex=0,null!=(h=pn.exec(e.slice(t))))c=t+(i=h[0]).length,i.indexOf("T")>=0?r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(dn.lastIndex=0,null==(h=dn.exec(e.slice(t))))throw wn(this._thisDoc,this.lines,e,t,"Bad number or date syntax");c=t+dn.lastIndex,(i=e.slice(t,c)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,c).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 c}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var o='"""';else o='"';t+=rn(o);var a=null,s=this.strconst(e,t,o),c=s[0],u=s[1],l=null;if("@"==e.slice(c,c+1)){var h;if(vn.lastIndex=0,null==(h=vn.exec(e.slice(c+1))))throw wn(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=vn.lastIndex+c+1,l=e.slice(c+1,t),c=t}if("^^"==e.slice(c,c+2)){var f=new en([]);c=this.uri_ref2(e,c+2,f),a=f[0]}return r.push(this._store.literal(u,l||a)),c}return-1}},{key:"strconst",value:function(e,t,r){for(var n=t,i="",o=this.lines;n<rn(e);){if(t=n+rn(r),e.slice(n,t)==r)return new Kr([t,i]);if('"'!=e.charAt(n)){if(yn.lastIndex=0,!yn.exec(e.slice(n)))throw wn(this._thisDoc,o,e,n,"Closing quote missing in string at ^ in "+e.slice(n-20,n)+"^"+e.slice(n,n+20));if(t=n+yn.lastIndex-1,i+=e.slice(n,t),'"'!=(c=e.charAt(t)))if("\r"!=c){if("\n"==c){if('"'==r)throw wn(this._thisDoc,o,e,t,"newline found in string literal");this.lines=this.lines+1,i+=c,n=t+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==c){if(n=t+1,!(c=e.slice(n,n+1)))throw wn(this._thisDoc,o,e,t,"unterminated string literal (2)");var a=sn('abfrtvn\\"',c);if(a>=0)i+='a\b\f\r\t\v\n\\"'.charAt(a),n+=1;else if("u"==c)n=(s=this.uEscape(e,n+1,o))[0],i+=c=s[1];else{if("U"!=c)throw wn(this._thisDoc,this.lines,e,t,"bad escape");var s,c;n=(s=this.UEscape(e,n+1,o))[0],i+=c=s[1]}}}else n=t+1;else n=t}else i=i+'"',n=n+1}throw wn(this._thisDoc,this.lines,e,t,"unterminated string literal")}},{key:"uEscape",value:function(e,t,r){for(var n=t,i=0,o=0;i<4;){var a=e.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw wn(this._thisDoc,r,e,t,"unterminated string literal(3)");var s=sn("0123456789abcdef",a);if(s<0)throw wn(this._thisDoc,r,e,t,"bad string literal hex escape");o=16*o+s,i+=1}var c=String.fromCharCode(o);return new Kr([n,c])}},{key:"UEscape",value:function(e,t,r){for(var n=t,i=0,o="\\U";i<8;){var a=e.slice(n,n+1).toLowerCase();if(n+=1,""==a)throw wn(this._thisDoc,r,e,t,"unterminated string literal(3)");if(sn("0123456789abcdef",a)<0)throw wn(this._thisDoc,r,e,t,"bad string literal hex escape");o+=a,i+=1}var s,c=(s="0x"+nn(o,2,10)-0,String.fromCharCode(s));return new Kr([n,c])}}]),e}();function wn(e,t,r,n,i){var o=t+1,a="Line "+o+" of <"+e+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',s=new SyntaxError(a,e,o);return s.lineNo=o,s.characterInFile=n,s.syntaxProblem=i,s}function xn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _n(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xn(Object(r),!0).forEach((function(t){(0,u.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xn(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var kn=_n(_n({},br),{},{supports:(mn={},(0,u.Z)(mn,pr.collections,!0),(0,u.Z)(mn,pr.defaultGraphType,!1),(0,u.Z)(mn,pr.equalsMethod,!0),(0,u.Z)(mn,pr.identity,!1),(0,u.Z)(mn,pr.id,!0),(0,u.Z)(mn,pr.reversibleId,!1),(0,u.Z)(mn,pr.variableType,!0),mn),collection:function(e){return new x(e)},id:function(e){var t=this;return(0,g.uZ)(e)?"( ".concat(e.elements.map((function(e){return t.id(e)})).join(", ")," )"):(0,g.cG)(e)?vr.toString(e):br.id(e)},termToNQ:function(e){return e.termType===f.fb?x.toNT(e):br.termToNQ(e)}});const jn=kn;function Tn(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((function(t){return Tn(e,t)})))}(e,t["@list"]):function(e,t){var r=t["@id"]?e.rdfFactory.namedNode(t["@id"]):e.rdfFactory.blankNode(),n=t["@list"].map((function(t){return Tn(e,t)})),i=Rr(e.rdfFactory,r,n);return e.addAll(i),r}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?e.rdfFactory.namedNode(t["@id"]):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function On(e,t,r,n){var i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return pt().flatten(JSON.parse(e),null,{base:i}).then((function(e){return e.reduce((function(e,n){return t=Nn(t,r,n)}),t)})).then(n).catch(n)}function Nn(e,t,r){for(var n=r["@id"]?e.rdfFactory.namedNode(r["@id"]):e.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,c=r[a],u=0;u<c.length;u++)e=Nn(e,s,c[u]);var l=r[a];if(Array.isArray(l))for(var h=0;h<l.length;h++)e.addStatement(Sn(e,n,a,l[h],t));else e.addStatement(Sn(e,n,a,l,t))}}return e}function Sn(e,t,r,n,i){var o,a;return"@type"===r?(o=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),a=e.rdfFactory.namedNode(n)):(o=e.rdfFactory.namedNode(r),a=Tn(e,n)),e.rdfFactory.quad(t,o,a,e.rdfFactory.namedNode(i))}var En=n(292);if(void 0===In)var In={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 An=function(){function e(t,n){(0,r.Z)(this,e),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)(e,[{key:"addTriple",value:function(e,t,r,n){var i,o,a,s;i=void 0===t?br.namedNode(this.options.base):this.toRDFNodeObject(t),a=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),s=br.namedNode(this.options.base),this.kb.add(i,a,o,s)}},{key:"ancestorPath",value:function(e){for(var t="";e&&e.nodeType!==In.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}},{key:"copyMappings",value:function(e){var t={};for(var r in e)t[r]=e[r];return t}},{key:"copyProperties",value:function(){}},{key:"deriveDateTimeType",value:function(t){for(var r=0;r<e.dateTimeTypes.length;r++){var n=e.dateTimeTypes[r].pattern.exec(t);if(n&&n[0].length===t.length)return e.dateTimeTypes[r].type}return null}},{key:"init",value:function(){}},{key:"newBlankNode",value:function(){return this.blankCounter++,"_:"+this.blankCounter}},{key:"newSubjectOrigin",value:function(e,t){}},{key:"parseCURIE",value:function(t,r,n){var i,o=t.indexOf(":");if(o>=0){var a=t.substring(0,o);if(""===a)return(i=r[""])?i+t.substring(o+1):null;if("_"===a)return"_:"+t.substring(o+1);if(e.NCNAME.test(a)&&(i=r[a]))return i+t.substring(o+1)}return null}},{key:"parseCURIEOrURI",value:function(e,t,r){return this.parseCURIE(e,t,r)||this.resolveAndNormalize(r,e)}},{key:"parsePredicate",value:function(e,t,r,n,i,o){if(""===e)return null;var a=this.parseTermOrCURIEOrAbsURI(e,t,o?null:r,n,i);return a&&0===a.indexOf("_:")?null:a}},{key:"parsePrefixMappings",value:function(e,t){for(var r=this.tokenize(e),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(t[n]=this.options.base?dr.join(r[i],this.options.base):r[i],n=null)}},{key:"parseSafeCURIEOrCURIEOrURI",value:function(e,t,r){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,r):this.parseCURIEOrURI(e,t,r)}},{key:"parseTermOrCURIEOrAbsURI",value:function(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;if(r){if(t&&!this.absURIRE.exec(e))return t+e;var a=r[e];if(a)return a;if(a=r[e.toLowerCase()])return a}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}},{key:"parseTermOrCURIEOrURI",value:function(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;var a=r[e];return a||((a=r[e.toLowerCase()])?a:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}},{key:"parseURI",value:function(e){return e}},{key:"process",value:function(t,r){var n;r=r||{},t.nodeType===In.DOCUMENT_NODE?(t.baseURI&&!r.baseURI&&(r.baseURI=t.baseURI),n=t.baseURI,(t=t.documentElement).baseURI||(t.baseURI=n),this.setContext(t)):t.parentNode.nodeType===In.DOCUMENT_NODE&&this.setContext(t);var i=[],o=function(e){if(!e&&r&&r.baseURI)return r.baseURI;var t=e.indexOf("#");return t>=0&&(e=e.substring(0,t)),r&&r.baseURIMap&&(e=r.baseURIMap(e)),e};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 c=a.listMapping[s];if(0!==c.length){for(var u=[],l=0;l<c.length;l++)u.push(this.newBlankNode());for(var h=0;h<u.length;h++)this.addTriple(a.parent,u[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",c[h]),this.addTriple(a.parent,u[h],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:e.objectURI,value:h+1<u.length?u[h+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(a.parent,a.subject,s,{type:e.objectURI,value:u[0]})}else this.addTriple(a.parent,a.subject,s,{type:e.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var f=a.current,d=a.context,p=!1,y=null,v=null,g=null,m=d.prefixes,b=!1,w=[],x=d.listMapping,_=!d.parent,k=d.language,j=d.vocabulary;n=this.parseURI(o(f.baseURI)),f.item=null;var T=f.getAttributeNode("vocab");if(T){var O=this.trim(T.value);if(O.length>0){j=O;var N=n.spec;this.addTriple(f,N,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:e.objectURI,value:j})}else j=this.vocabulary}for(var S=0;S<f.attributes.length;S++){var E=f.attributes[S];if("x"===E.nodeName.charAt(0)&&0===E.nodeName.indexOf("xmlns:")){b||(m=this.copyMappings(m),b=!0);var I=E.nodeName.substring(6),A=e.trim(E.value);m[I]=this.options.base?dr.join(A,this.options.base):A}}var R=f.getAttributeNode("prefix");R&&(b||(m=this.copyMappings(m),b=!0),this.parsePrefixMappings(R.value,m));for(var C=null,L=0;!C&&L<this.langAttributes.length;L++)C=f.getAttributeNodeNS(this.langAttributes[L].namespaceURI,this.langAttributes[L].localName);if(C){var D=e.trim(C.value);k=D.length>0?D:null}var P,M,F=f.getAttributeNode("rel"),U=f.getAttributeNode("rev"),B=f.getAttributeNode("typeof"),Z=f.getAttributeNode("property"),q=f.getAttributeNode("datatype"),$=this.inHTMLMode?f.getAttributeNode("datetime"):null,H=f.getAttributeNode("content"),V=f.getAttributeNode("about"),z=f.getAttributeNode("src"),G=f.getAttributeNode("resource"),X=f.getAttributeNode("href"),J=f.getAttributeNode("inlist"),Q=[];if(F){M=this.tokenize(F.value);for(var W=0;W<M.length;W++)(P=this.parsePredicate(M[W],j,d.terms,m,n,this.inHTMLMode&&null!==Z))&&Q.push(P)}var Y=[];if(U){M=this.tokenize(U.value);for(var K=0;K<M.length;K++)(P=this.parsePredicate(M[K],j,d.terms,m,n,this.inHTMLMode&&Z))&&Y.push(P)}if(this.inHTMLMode&&(F||U)&&Z&&(0===Q.length&&(F=null),0===Y.length&&(U=null)),F||U?(V&&(y=this.parseSafeCURIEOrCURIEOrURI(V.value,m,n)),B&&(g=y),y||(f.parentNode.nodeType===In.DOCUMENT_NODE?y=o(f.baseURI):d.parentObject&&(y=o(f.parentNode.baseURI)===d.parentObject?o(f.baseURI):d.parentObject)),G&&(v=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),v||(X?v=this.resolveAndNormalize(n,encodeURI(X.value)):z?v=this.resolveAndNormalize(n,encodeURI(z.value)):!B||V||this.inXHTMLMode&&("head"===f.localName||"body"===f.localName)||(v=this.newBlankNode())),!B||V||!this.inXHTMLMode||"head"!==f.localName&&"body"!==f.localName?B&&!V&&(g=v):g=y):!Z||H||q?(V&&(y=this.parseSafeCURIEOrCURIEOrURI(V.value,m,n)),!y&&G&&(y=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!y&&X&&(y=this.resolveAndNormalize(n,encodeURI(X.value))),!y&&z&&(y=this.resolveAndNormalize(n,encodeURI(z.value))),y||(f.parentNode.nodeType===In.DOCUMENT_NODE?y=o(f.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName?B?y=this.newBlankNode():d.parentObject&&(y=o(f.parentNode.baseURI)===d.parentObject?o(f.baseURI):d.parentObject,Z||(p=!0)):y=o(f.parentNode.baseURI)===d.parentObject?o(f.baseURI):d.parentObject),B&&(g=y)):(V&&(y=this.parseSafeCURIEOrCURIEOrURI(V.value,m,n),B&&(g=y)),y||f.parentNode.nodeType!==In.DOCUMENT_NODE?!y&&d.parentObject&&(y=o(f.parentNode.baseURI)===d.parentObject?o(f.baseURI):d.parentObject):(y=o(f.baseURI),B&&(g=y)),B&&!g&&(G&&(g=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!g&&X&&(g=this.resolveAndNormalize(n,encodeURI(X.value))),!g&&z&&(g=this.resolveAndNormalize(n,encodeURI(z.value))),g||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==f.localName&&"body"!==f.localName||(g=y),g||(g=this.newBlankNode()),v=g)),y&&(V||G||g)){var ee=y;B&&!V&&!G&&v&&(ee=v),this.newSubjectOrigin(f,ee)}if(g){M=this.tokenize(B.value);for(var te=0;te<M.length;te++){var re=this.parseTermOrCURIEOrAbsURI(M[te],j,d.terms,m,n);re&&this.addTriple(f,g,e.typeURI,{type:e.objectURI,value:re})}}if(y&&y!==d.parentObject&&(x={},_=!0),v){if(F&&J)for(var ne=0;ne<Q.length;ne++){var ie=x[Q[ne]];ie||(ie=[],x[Q[ne]]=ie),ie.push({type:e.objectURI,value:v})}else if(F)for(var oe=0;oe<Q.length;oe++)this.addTriple(f,y,Q[oe],{type:e.objectURI,value:v});if(U)for(var ae=0;ae<Y.length;ae++)this.addTriple(f,v,Y[ae],{type:e.objectURI,value:y})}else{if(y&&!v&&(F||U)&&(v=this.newBlankNode()),F&&J)for(var se=0;se<Q.length;se++){var ce=x[Q[se]];ce||(ce=[],x[P]=ce),w.push({predicate:Q[se],list:ce})}else if(F)for(var ue=0;ue<Q.length;ue++)w.push({predicate:Q[ue],forward:!0});if(U)for(var le=0;le<Y.length;le++)w.push({predicate:Y[le],forward:!1})}if(Z){var he=null,fe=null;q?(he=""===q.value?e.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(q.value,j,d.terms,m,n),fe=$&&!H?$.value:he===e.XMLLiteralURI||he===e.HTMLLiteralURI?null:H?H.value:f.textContent):H?(he=e.PlainLiteralURI,fe=H.value):$?(fe=$.value,(he=e.deriveDateTimeType(fe))||(he=e.PlainLiteralURI)):F||U||(G&&(fe=this.parseSafeCURIEOrCURIEOrURI(G.value,m,n)),!fe&&X?fe=this.resolveAndNormalize(n,encodeURI(X.value)):!fe&&z&&(fe=this.resolveAndNormalize(n,encodeURI(z.value))),fe&&(he=e.objectURI)),he||(B&&!V?(he=e.objectURI,fe=g):(fe=f.textContent,this.inHTMLMode&&"time"===f.localName&&(he=e.deriveDateTimeType(fe)),he||(he=e.PlainLiteralURI))),M=this.tokenize(Z.value);for(var de=0;de<M.length;de++){var pe=this.parsePredicate(M[de],j,d.terms,m,n);if(pe)if(J){var ye=x[pe];ye||(ye=[],x[pe]=ye),ye.push(he===e.XMLLiteralURI||he===e.HTMLLiteralURI?{type:he,value:f.childNodes}:{type:he||e.PlainLiteralURI,value:fe,language:k})}else he===e.XMLLiteralURI||he===e.HTMLLiteralURI?this.addTriple(f,y,pe,{type:he,value:f.childNodes}):this.addTriple(f,y,pe,{type:he||e.PlainLiteralURI,value:fe,language:k})}}if(y&&!p)for(var ve=0;ve<d.incomplete.length;ve++)d.incomplete[ve].list?d.incomplete[ve].list.push({type:e.objectURI,value:y}):d.incomplete[ve].forward?this.addTriple(f,d.subject,d.incomplete[ve].predicate,{type:e.objectURI,value:y}):this.addTriple(f,y,d.incomplete[ve].predicate,{type:e.objectURI,value:d.subject});var ge=null,me=y;p?((ge=this.push(d,d.subject)).parentObject=o(f.parentNode.baseURI)===d.parentObject?o(f.baseURI):d.parentObject,ge.incomplete=d.incomplete,ge.language=k,ge.prefixes=m,ge.vocabulary=j):((ge=this.push(d,y)).parentObject=v||y||d.subject,ge.prefixes=m,ge.incomplete=w,v&&(me=v,x={},_=!0),ge.listMapping=x,ge.language=k,ge.vocabulary=j),_&&i.unshift({parent:f,context:d,subject:me,listMapping:x});for(var be=f.lastChild;be;be=be.previousSibling)be.nodeType===In.ELEMENT_NODE&&i.unshift({current:be,context:ge})}}this.inHTMLMode&&this.copyProperties();for(var we=0;we<this.finishedHandlers.length;we++)this.finishedHandlers[we](t)}},{key:"push",value:function(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}},{key:"resolveAndNormalize",value:function(e,t){return dr.join(t,e)}},{key:"setContext",value:function(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(En.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(e){return this.trim(e).split(/\s+/)}},{key:"toRDFNodeObject",value:function(t){var r=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)]):br.namedNode(t);switch(t.type){case e.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)]):br.namedNode(t.value);case e.PlainLiteralURI:return new b(t.value,t.language||"");case e.XMLLiteralURI:case e.HTMLLiteralURI:var n="";return Object.keys(t.value).forEach((function(e){n+=_r.domToString(t.value[e],r.htmlOptions)})),new b(n,"",new v.Z(t.type));default:return new b(t.value,"",new v.Z(t.type))}}}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}],[{key:"parseRDFaDOM",value:function(t,r,n){var i=new e(r,{base:n});t.baseURI||(t.baseURI=n),i.process(t,{baseURI:n})}},{key:"tokenize",value:function(e){return this.trim(e).split(/\s+/)}},{key:"trim",value:function(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}]),e}();An.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",An.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",An.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",An.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",An.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",An.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",An.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",An.NCNAME=new RegExp("^"+An.nameStartChar+An.nameChar+"*$"),An.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 Rn=An.parseRDFaDOM,Cn=function(){function e(t){(0,r.Z)(this,e),this.store=t,this.bnodes={},this.why=null,this.reify=!1}return(0,t.Z)(e,[{key:"frameFactory",value:function(t,r,n){return{NODE:1,ARC:2,parent:r,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(e,t){t=dr.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var t=this.store.sym(dr.join("#"+this.parent.rdfid,this.base));this.store.add(t,this.store.sym(e.ns.RDF+"type"),this.store.sym(e.ns.RDF+"Statement"),this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(t,this.store.sym(e.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(t){t===e.ns.RDF+"li"&&(t=e.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,t)},addLiteral:function(t){this.parent.datatype&&this.parent.datatype!==e.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(e,t,r){var n=null;if(e.getAttributeNodeNS)n=e.getAttributeNodeNS(t,r);else for(var i,o=e.attributes,a=0;a<o.length;++a)if((i=o[a]).namespaceURI===t&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}},{key:"parse",value:function(t,r,n){var i,o=t.childNodes;if(this.cleanParser(),t.nodeType===e.nodeType.DOCUMENT){for(var a=0;a<o.length;a++)if(o[a].nodeType===e.nodeType.ELEMENT){i=o[a];break}}else{if(t.nodeType!==e.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+r+". Halting. ");i=t}this.why=n;var s=this.frameFactory(this);return this.base=r,s.base=r,s.lang=null,this.parseDOM(this.buildFrame(s,i)),!0}},{key:"parseDOM",value:function(t){for(var r,n=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),i=!0;t.parent;){var o=t.element,a=o.attributes;if(o.nodeType===e.nodeType.TEXT||o.nodeType===e.nodeType.CDATA_SECTION)t.parent.nodeType===t.NODE&&(t.addArc(e.ns.RDF+"value"),t=this.buildFrame(t)),t.addLiteral(o.nodeValue);else if(n(o)!==e.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&&(r=this.getAttributeNodeNS(o,e.ns.RDF,"ID"))&&(t.rdfid=r.nodeValue,o.removeAttributeNode(r));var s=this.getAttributeNodeNS(o,e.ns.RDF,"parseType"),c=this.getAttributeNodeNS(o,e.ns.RDF,"datatype");if(c&&(t.datatype=c.nodeValue,o.removeAttributeNode(c)),s){var u=s.nodeValue;"Literal"===u?(t.datatype=e.ns.RDF+"XMLLiteral",(t=this.buildFrame(t)).addLiteral(o.childNodes),i=!1):"Resource"===u?((t=this.buildFrame(t,t.element)).parent.element=null,t.addBNode()):"Collection"===u&&((t=this.buildFrame(t,t.element)).parent.element=null,t.addCollection()),o.removeAttributeNode(s)}if(0!==a.length){var l=this.getAttributeNodeNS(o,e.ns.RDF,"resource"),h=this.getAttributeNodeNS(o,e.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 d=this.buildFrame(t);d.addArc(n(a[f])),n(a[f])===e.ns.RDF+"type"?this.buildFrame(d).addNode(a[f].nodeValue):this.buildFrame(d).addLiteral(a[f].nodeValue)}}else 0===o.childNodes.length&&this.buildFrame(t).addLiteral("")}else{var p=this.getAttributeNodeNS(o,e.ns.RDF,"about");if(r=this.getAttributeNodeNS(o,e.ns.RDF,"ID"),p&&r)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(!p&&r)t.addNode("#"+r.nodeValue),o.removeAttributeNode(r);else if(null==p&&null==r){var y=this.getAttributeNodeNS(o,e.ns.RDF,"nodeID");y?(t.addBNode(y.nodeValue),o.removeAttributeNode(y)):t.addBNode()}else t.addNode(p.nodeValue),o.removeAttributeNode(p);var v=this.getAttributeNodeNS(o,e.ns.RDF,"type");e.ns.RDF+"Description"!==n(o)&&(v={nodeValue:n(o)}),null!=v&&(this.store.add(t.node,this.store.sym(e.ns.RDF+"type"),this.store.sym(dr.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===e.nodeType.ELEMENT||b.nodeType===e.nodeType.TEXT||b.nodeType===e.nodeType.CDATA_SECTION)&&(b.nodeType!==e.nodeType.TEXT&&b.nodeType!==e.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,r){var n=this.frameFactory(this,t,r);if(t&&(n.base=t.base,n.lang=t.lang),!r||r.nodeType===e.nodeType.TEXT||r.nodeType===e.nodeType.CDATA_SECTION)return n;var i=r.attributes,o=r.getAttributeNode("xml:base");null!=o&&(n.base=o.nodeValue,r.removeAttribute("xml:base"));var a=r.getAttributeNode("xml:lang");null!=a&&(n.lang=a.nodeValue,r.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 c=i[s].nodeValue;this.base&&(c=dr.join(c,this.base)),this.store.setPrefixForURI(i[s].name.slice(6),c)}r.removeAttributeNode(i[s])}return n}}]),e}();function Ln(e,t,r){var n,i,o,a=["INSERT","DELETE","WHERE"],s=xr("http://www.w3.org/ns/pim/patch#"),c=gn(t,t,r,r,null,null,"",null),u={},l=function(e,t,r,n,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=t.sym(r+"#query");for(u.query=h;;){if((i=c.skipSpace(e,n))<0)return u;if(";"===e[i]){if((n=c.skipSpace(e,i+1))<0)return u;i=n}var f=!1;for(o=0;o<a.length;o++){var d=a[o];if(e.slice(i,i+d.length)===d){if((n=c.skipSpace(e,i+d.length))<0)throw l(c._thisDoc,c.lines,e,i+d.length,"found EOF, needed {...} after "+d);if(("INSERT"===d||"DELETE"===d)&&"DATA"===e.slice(n,n+4)){if((i=c.skipSpace(e,n+4))<0)throw l(c._thisDoc,c.lines,e,n+4,"needed {...} after INSERT DATA "+d);n=i}var p=[];if((i=c.node(e,n,p))<0)throw l(c._thisDoc,c.lines,e,n,"bad syntax or EOF in {...} after "+d);u[d.toLowerCase()]=p[0],t.add(h,s(d.toLowerCase()),p[0]),f=!0,n=i}}if(!f&&"@prefix"===e.slice(i,i+7)){if((n=c.directive(e,i))<0)throw l(c._thisDoc,c.lines,e,n,"bad syntax or EOF after @prefix ");n=c.checkDot(e,n),f=!0}if(!f)throw l(c._thisDoc,c.lines,e,i,"Unknown syntax at start of statememt: '"+e.slice(i).slice(0,20)+"'")}}function Dn(e,t,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||f.z8).split(";")[0];try{if(n===f.qS||n===f.z8){var o=gn(t,t,r,r,null,null,"",null);o.loadBuf(e),c()}else if(n===f.Is){var a=new Cn(t);a.parse(_r.parseXML(e),r,t.sym(r)),c()}else if(n===f.D7)Rn(_r.parseXML(e,{contentType:f.D7}),t,r),c();else if(n===f.us)Rn(_r.parseXML(e,{contentType:f.us}),t,r),c();else if(n===f.oW||n===f.xm)Ln(e,t,r),c();else if(n===f.ui)On(e,t,r,c);else{if(n!==f.b4&&n!==f.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var s=new qt({factory:jn});l(null,e)}}catch(e){u(e)}function c(){i&&i(null,t)}function u(e){if(n!==f.ui||n!==f.b4||n!==f.lL){if(!i){var o=new Error(e+" while trying to parse <"+r+"> as "+n);throw o.cause=e,o}i(e,t)}}function l(e,r){e&&i(e,t);try{s.parse(r,h)}catch(e){i(e,t)}}function h(e,r){r?t.add(r.subject,r.predicate,r.object,r.graph):i(e,t)}Dn.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,u.Z)(Cn,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,u.Z)(Cn,"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 Pn=n(7297),Mn=n.n(Pn),Fn=n(2598),Un=n(292);function Bn(e){var t=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(e){return!1}}();return function(){var r,n=(0,c.Z)(e);if(t){var i=(0,c.Z)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,s.Z)(this,r)}}var Zn={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},qn={rdf:f.Is,owl:f.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},$n=function(e){return{link:xr("http://www.w3.org/2007/ont/link#",e),http:xr("http://www.w3.org/2007/ont/http#",e),httph:xr("http://www.w3.org/2007/ont/httph#",e),rdf:xr("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:xr("http://www.w3.org/2000/01/rdf-schema#",e),dc:xr("http://purl.org/dc/elements/1.1/",e),ldp:xr("http://www.w3.org/ns/ldp#",e)}},Hn=$n(),Vn=(0,t.Z)((function e(t,n){(0,r.Z)(this,e),(0,u.Z)(this,"response",void 0),(0,u.Z)(this,"dom",void 0),this.response=t,this.dom=n}));(0,u.Z)(Vn,"pattern",void 0);var zn=function(e){(0,a.Z)(i,e);var n=Bn(i);function i(){return(0,r.Z)(this,i),n.apply(this,arguments)}return(0,t.Z)(i,[{key:"parse",value:function(e,t,r){var n=e.store;if(this.dom||(this.dom=_r.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");var i=new Cn(n);try{i.parse(this.dom,r.original.value,r.original)}catch(t){return e.failFetch(r,"Syntax error parsing RDF/XML! "+t,"parse_error")}return r.noMeta||n.add(r.original,Hn.rdf("type"),Hn.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"RDFXMLHandler"}},{key:"register",value:function(e){e.mediatypes[f.Is]={q:.9}}}]),i}(Vn);zn.pattern=new RegExp("application/rdf\\+xml");var Gn=function(e){(0,a.Z)(i,e);var n=Bn(i);function i(){return(0,r.Z)(this,i),n.apply(this,arguments)}return(0,t.Z)(i,[{key:"parse",value:function(e,t,r){var n,i;this.dom||(this.dom=_r.parseXML(t));var o=e.store,a=this.dom.getElementsByTagName("title");a.length>0&&o.add(r.resource,Hn.dc("title"),o.rdfFactory.literal(a[0].textContent),r.resource);for(var s=this.dom.getElementsByTagName("link"),c=s.length-1;c>=0;c--)i=!1,(n=s[c].getAttribute("rel"))||(n=s[c].getAttribute("rev"),i=!0),n&&e.linkData(r.original,n,s[c].getAttribute("href"),r.resource,i);for(var u=this.dom.getElementsByTagName("script"),l=0;l<u.length;l++){var h=u[l].getAttribute("type");Zn[h]&&(Dn(u[l].textContent,o,r.original.value,h),Dn(u[l].textContent,o,r.original.value,h))}if(r.noMeta||o.add(r.resource,Hn.rdf("type"),Hn.link("WebPage"),e.appNode),!r.noRDFa&&Rn)try{Rn(this.dom,o,r.original.value)}catch(t){var f="Error trying to parse "+r.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(r,f,"parse_error")}return e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"XHTMLHandler"}},{key:"register",value:function(e){e.mediatypes[f.D7]={}}}]),i}(Vn);Gn.pattern=new RegExp("application/xhtml");var Xn=function(e){(0,a.Z)(i,e);var n=Bn(i);function i(){return(0,r.Z)(this,i),n.apply(this,arguments)}return(0,t.Z)(i,[{key:"parse",value:function(e,t,r){for(var n=_r.parseXML(t),o=0;o<n.childNodes.length;o++){var a=n.childNodes[o];if(i.isElement(a)){var s=a.namespaceURI;if(s&&s===s.rdf)return e.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new zn(this.response,n).parse(e,t,r);break}}if(n.doctype&&"html"===n.doctype.name&&n.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&n.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new Gn(this.response,n).parse(e,t,r);var c=n.getElementsByTagName("html")[0];if(c){var u=c.getAttribute("xmlns");if(u&&u.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new Gn(this.response,n).parse(e,t,r)}return e.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}],[{key:"toString",value:function(){return"XMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}},{key:"isElement",value:function(e){return e.nodeType===Node.ELEMENT_NODE}}]),i}(Vn);Xn.pattern=new RegExp("(text|application)/(.*)xml");var Jn=function(e){(0,a.Z)(i,e);var n=Bn(i);function i(){return(0,r.Z)(this,i),n.apply(this,arguments)}return(0,t.Z)(i,[{key:"parse",value:function(e,t,r){var n=e.store;if(ei(t))return e.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new Gn(this.response).parse(e,t,r);if(function(e){var t=e.indexOf("<!DOCTYPE html"),r=e.indexOf(">");return!(-1===t||-1===r||t>r)&&-1!==e.substr(t,r-t).indexOf("XHTML")}(t))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new Gn(this.response).parse(e,t,r);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new Gn(this.response).parse(e,t,r);var i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&n.add(r.resource,Hn.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,Hn.rdf("type"),Hn.link("WebPage"),e.appNode),e.addStatus(r.req,"non-XML HTML document, not parsed for data."),e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"HTMLHandler"}},{key:"register",value:function(e){e.mediatypes["text/html"]={q:.9}}}]),i}(Vn);Jn.pattern=new RegExp("text/html");var Qn=function(e){(0,a.Z)(i,e);var n=Bn(i);function i(){return(0,r.Z)(this,i),n.apply(this,arguments)}return(0,t.Z)(i,[{key:"parse",value:function(e,t,r,n){var i=e.store;return new Promise((function(o,a){try{On(t,i,r.original.value,(function(){o(e.doneFetch(r,n))}))}catch(t){var s="Error trying to parse "+r.resource+" as JSON-LD:\n"+t;o(e.failFetch(r,s,"parse_error",n))}}))}}],[{key:"toString",value:function(){return"JsonLdHandler"}},{key:"register",value:function(e){e.mediatypes["application/ld+json"]={q:.9}}}]),i}(Vn);Qn.pattern=/application\/ld\+json/;var Wn=function(e){(0,a.Z)(i,e);var n=Bn(i);function i(){return(0,r.Z)(this,i),n.apply(this,arguments)}return(0,t.Z)(i,[{key:"parse",value:function(e,t,r){return ei(t)?(e.addStatus(r.req,"Warning: "+r.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Xn(this.response).parse(e,t,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Xn(this.response).parse(e,t,r)):(e.addStatus(r.req,"Plain text document, no known RDF semantics."),e.doneFetch(r,this.response))}}],[{key:"toString",value:function(){return"TextHandler"}},{key:"register",value:function(e){e.mediatypes["text/plain"]={q:.5}}}]),i}(Vn);Wn.pattern=new RegExp("text/plain");var Yn=function(e){(0,a.Z)(i,e);var n=Bn(i);function i(){return(0,r.Z)(this,i),n.apply(this,arguments)}return(0,t.Z)(i,[{key:"parse",value:function(e,t,r,n){var i=e.store,o=gn(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(t)}catch(t){var a="Error trying to parse "+r.resource+" as Notation3:\n"+t;return e.failFetch(r,a,"parse_error",n)}return e.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(r.original,Hn.rdf("type"),Hn.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}],[{key:"toString",value:function(){return"N3Handler"}},{key:"register",value:function(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}}]),i}(Vn);Yn.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");var Kn={RDFXMLHandler:zn,XHTMLHandler:Gn,XMLHandler:Xn,HTMLHandler:Jn,TextHandler:Wn,N3Handler:Yn,JsonLdHandler:Qn};function ei(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}var ti=function(){function e(t){var i=this,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,r.Z)(this,e),(0,u.Z)(this,"store",void 0),(0,u.Z)(this,"timeout",void 0),(0,u.Z)(this,"_fetch",void 0),(0,u.Z)(this,"mediatypes",void 0),(0,u.Z)(this,"appNode",void 0),(0,u.Z)(this,"requested",void 0),(0,u.Z)(this,"timeouts",void 0),(0,u.Z)(this,"redirectedTo",void 0),(0,u.Z)(this,"fetchQueue",void 0),(0,u.Z)(this,"fetchCallbacks",void 0),(0,u.Z)(this,"nonexistent",void 0),(0,u.Z)(this,"lookedUp",void 0),(0,u.Z)(this,"handlers",void 0),(0,u.Z)(this,"ns",void 0),(0,u.Z)(this,"fireCallbacks",void 0),this.store=t||new Wr,this.ns=$n(this.store.rdfFactory),this.timeout=o.timeout||3e4,this._fetch=o.fetch||void 0!==n.g&&(n.g.solidFetcher||n.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||Mn(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},_r.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(o.handlers||Kn).map((function(e){return i.addHandler(Kn[e])}))}var i,o;return(0,t.Z)(e,[{key:"load",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(r=Object.assign({},r),e instanceof Array)return Promise.all(e.map((function(e){return t.load(e,Object.assign({},r))})));var n=e,i=(0,Fn._)(n);i=i.split("#")[0],r=this.initFetchOptions(i,r);var o=this.initFetchOptions(i,r);return this.pendingFetchPromise(i,o.baseURI,o)}},{key:"pendingFetchPromise",value:function(e,t,r){var n,i=this;return!r.force&&this.fetchQueue[t]?n=this.fetchQueue[t]:(n=Promise.race([this.setRequestTimeout(e,r),this.fetchUri(e,r)]),this.fetchQueue[t]=n,this.cleanupFetchRequest(t,void 0,this.timeout)),n.then((function(t){return e in i.timeouts&&(i.timeouts[e].forEach(clearTimeout),delete i.timeouts[e]),t}))}},{key:"cleanupFetchRequest",value:function(e,t,r){var n=this;void 0!==t&&Un.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((function(){n.isPending(e)||delete n.fetchQueue[e]}),r))}},{key:"initFetchOptions",value:function(t,r){var n=this.store;!r.method||"GET"===r.method.toUpperCase()||(r.force=!0),r.resource=n.rdfFactory.namedNode(t),r.baseURI=r.baseURI||t,r.original=n.rdfFactory.namedNode(r.baseURI),r.req=n.bnode(),r.headers=r.headers||new Pn.Headers,r.contentType&&(r.headers["content-type"]=r.contentType),r.force&&(r.cache="no-cache");var i=this.acceptString();r.headers.accept=i;var o=e.offlineOverride(t);r.requestedURI=o,e.setCredentials(o,r);var a=e.proxyIfNecessary(o);return o!==a&&(r.proxyUsed=!0),r.actualProxyURI=a,r}},{key:"fetchUri",value:function(t,r){var n=this;if(!t)return Promise.reject(new Error("Cannot fetch an empty uri"));if(e.unsupportedProtocol(t))return this.failFetch(r,"fetcher: Unsupported protocol","unsupported_protocol");var i=this.getState(t);if(r.force)delete this.nonexistent[t];else{if("fetched"===i)return Promise.resolve(this.doneFetch(r,{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 Pn.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(r,o,this.requested[t],a)}}this.fireCallbacks("request",[t]),this.requested[t]=!0,r.noMeta||this.saveRequestMetadata(t,r);var s=r.actualProxyURI;return this._fetch(s,r).then((function(e){return n.handleResponse(e,t,r)}),(function(e){var i={url:s,status:999,statusText:(e.name||"network failure")+": "+(e.errno||e.code||e.type),responseText:e.message,headers:new Pn.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return Un.log("Fetcher: <"+s+"> Non-HTTP fetch exception: "+e),n.handleError(i,t,r)}))}},{key:"nowOrWhenFetched",value:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=(0,Fn._)(e);"function"==typeof t?r=t:void 0===t||((0,g.NX)(t)?n.referringTerm=t:n=t),this.load(i,n).then((function(e){if(r)if(e)if(e.ok)r(!0,"OK",e);else{var t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),Un.log(t+" fetching "+i),r(!1,t,e)}else{var n="@@ nowOrWhenFetched: no response object!";Un.log(n),r(!1,n)}}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,Un.log(t),e.response&&e.response.status&&(t+=" status: "+e.response.status),r(!1,t,e.response)}))}},{key:"addStatus",value:function(e,t){var r=new Date;t="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+t;var n=this.store,i=n.the(e,this.ns.link("status"));(0,g.uZ)(i)?i.append(n.rdfFactory.literal(t)):wr.Z.warn("web.js: No list to add to: "+i+","+t)}},{key:"failFetch",value:function(e,t,r,n){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));var i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[dr.docpart(e.original.value)]=r,this.fireCallbacks("fail",[e.original.value,t]));var o=new Error("Fetcher: "+t);return o.status=r,o.statusText=t,o.response=n,Promise.reject(o)}},{key:"linkData",value:function(e,t,r,n,i){if(r){var o,a=this.store,s=a.rdfFactory.namedNode(dr.join(r,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(s.value===e.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===t?a.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):a.rdfFactory.namedNode(dr.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?a.add(s,o,e,n):a.add(e,o,s,n)}}},{key:"parseLinkHeader",value:function(e,t,r){if(e){var n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.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),c=a[1].match(n);if(null==c)return;for(var u=0;u<c.length;u++){var l=c[u].split("=")[1].replace(/["']/g,"");this.linkData(t,l,s,r)}}}}},{key:"doneFetch",value:function(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}},{key:"nowKnownAs",value:function(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}},{key:"putBack",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,Fn._)(e),i=new v.Z(n).doc();return r.contentType=r["content-type"]||r["Content-Type"]||r.contentType||f.z8,"application/ld+json"===r.contentType?new Promise((function(n,o){Er(i,t.store,i.uri,r.contentType,(function(i,a){i?o(i):(r.data=a,t.webOperation("PUT",e,r).then((function(e){return n(e)})).catch((function(e){return o(e)})))}))})):(r.data=Er(i,this.store,i.value,r.contentType),this.webOperation("PUT",n,r))}},{key:"webCopy",value:function(e,t,r){var n=this;return this.webOperation("GET",e).then((function(e){return n.webOperation("PUT",t,{data:e.responseText,contentType:r})}))}},{key:"delete",value:function(e,t){var r=this;return this.webOperation("DELETE",e,t).then((function(t){return r.requested[e]=404,r.nonexistent[e]=!0,r.unload(r.store.rdfFactory.namedNode(e)),t}))}},{key:"createIfNotExists",value:(i=ar().mark((function e(t){var r,n,i,o,a=arguments;return ar().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:f.z8,n=a.length>2&&void 0!==a[2]?a[2]:"",i=this,e.prev=3,e.next=6,i.load(t);case 6:o=e.sent,e.next=29;break;case 9:if(e.prev=9,e.t0=e.catch(3),404!==e.t0.response.status){e.next=27;break}return Un.log("createIfNotExists: doc does NOT exist, will create... "+t),e.prev=13,e.next=16,i.webOperation("PUT",t.value,{data:n,contentType:r});case 16:o=e.sent,e.next=23;break;case 19:throw e.prev=19,e.t1=e.catch(13),Un.log("createIfNotExists doc FAILED: "+t+": "+e.t1),e.t1;case 23:return delete i.requested[t.value],e.abrupt("return",o);case 27:throw Un.log("createIfNotExists doc load error NOT 404: "+t+": "+e.t0),e.t0;case 29:return e.abrupt("return",o);case 30:case"end":return e.stop()}}),e,this,[[3,9],[13,19]])})),o=function(){var e=this,t=arguments;return new Promise((function(r,n){var o=i.apply(e,t);function a(e){ir(o,r,n,a,s,"next",e)}function s(e){ir(o,r,n,a,s,"throw",e)}a(void 0)}))},function(e){return o.apply(this,arguments)})},{key:"createContainer",value:function(e,t,r){var n={"content-type":f.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(n.slug=t);var i={headers:n};return r&&(i.body=r),this.webOperation("POST",e,i)}},{key:"invalidateCache",value:function(e){var t=(0,Fn._)(e),r=this;if(r.fetchQueue&&r.fetchQueue[t]&&(Un.log("Internal error - fetchQueue exists "+t),"resolved"===r.fetchQueue[t].PromiseStatus?delete r.fetchQueue[t]:(delete r.fetchQueue[t],Un.log("*** Fetcher: pending fetchQueue deleted "+t))),r.requested[t]&&"done"!==r.requested[t]&&"failed"!==r.requested[t]&&404!==r.requested[t]){var n="Rdflib: fetcher: Destructive operation on <".concat(r.requested[t],"> file being fetched! ")+t;Un.error(n)}else delete r.requested[t],delete r.nonexistent[t]}},{key:"webOperation",value:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=(0,Fn._)(r);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),e.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(e,t){var r=this,n=this.store.uris(e);return(n=n.map((function(e){return dr.docpart(e)}))).forEach((function(e){r.lookedUp[e]=!0})),this.load(n,{referringTerm:t})}},{key:"getHeader",value:function(e,t){for(var r=this.store,n=e.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 c=r.each(s,this.ns.httph(t.toLowerCase()));return c.length?c.map((function(e){return e.value})):[]}}}}},{key:"saveRequestMetadata",value:function(e,t){var r=t.req,n=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),(0,g.NX)(i)&&n.add(n.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(t.original.value),this.appNode);var o=new Date,a="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(a+" Request for "+e),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(e),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}},{key:"saveResponseMetadata",value:function(e,t){var r=this,n=this.store,i=n.bnode();return n.add(t.req,this.ns.link("response"),i,i),n.add(i,this.ns.http("status"),n.rdfFactory.literal(e.status),i),n.add(i,this.ns.http("statusText"),n.rdfFactory.literal(e.statusText),i),e.headers.forEach((function(e,o){n.add(i,r.ns.httph(o),r.store.rdfFactory.literal(e),i),"content-type"===o&&n.add(t.resource,r.ns.rdf("type"),n.rdfFactory.namedNode(_r.mediaTypeClass(e).value),i)})),i}},{key:"objectRefresh",value:function(e){var t=this.store.uris(e);if(void 0!==t)for(var r=0;r<t.length;r++)this.refresh(this.store.rdfFactory.namedNode(dr.docpart(t[r])))}},{key:"refresh",value:function(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}},{key:"refreshIfExpired",value:function(e,t){var r=this.getHeader(e,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}},{key:"retract",value:function(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[dr.docpart(e.value)],this.fireCallbacks("retract",arguments)}},{key:"getState",value:function(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}},{key:"isPending",value:function(e){return!0===this.requested[e]}},{key:"unload",value:function(e){this.store.removeDocument(e),delete this.requested[e.value]}},{key:"addHandler",value:function(e){this.handlers.push(e),e.register(this)}},{key:"retryNoCredentials",value:function(e,t){Un.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+t.resource),t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];var r=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,r)}},{key:"isCrossSite",value:function(e){if("undefined"==typeof document||!document.location)return!1;var t=dr.hostpart,r=""+document.location;return(t(r)&&t(e)&&t(r))!==t(e)}},{key:"handleError",value:function(t,r,n){if(this.isCrossSite(r)){if(n.credentials&&"include"===n.credentials&&!n.retriedWithNoCredentials)return this.retryNoCredentials(r,n);var i=e.crossSiteProxy(r);if(i&&!n.proxyUsed)return Un.log("web: Direct failed so trying proxy "+i),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(e,t,r,n){var i=t;if(n){var o=r.any(i,this.ns.link("requestedURI"));o&&o.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),e,this.appNode)}for(;;){var a=r.any(i,this.ns.link("requestedURI"));if(a&&a.value&&r.add(r.rdfFactory.namedNode(a.value),this.ns.rdf("type"),e,this.appNode),!(i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i)))break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var c=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!c)break;if("301"!==c&&"302"!==c)break}}},{key:"handleResponse",value:function(e,t,r){var n=this,i=this.store,o=e.headers,a=r.req,s=this.saveResponseMetadata(e,r),c=this.normalizedContentType(r,o)||"",u=o.get("content-location");if(0===e.status)return Un.log("Masked error - status 0 for "+t),this.handleError(e,t,r);if(e.status>=400)return 404===e.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((function(){var t=r.resource+" "+e.statusText;return n.failFetch(r,t,e.status,e)}));var l=null,h=null;if(u&&(h=dr.join(u,t))!==t&&(l=h),200===e.status){this.addType(this.ns.link("Document"),a,i,t),l&&this.addType(this.ns.link("Document"),a,i,l),r.clearPreviousData&&i.removeDocument(r.resource);var f=c.includes("image/")||c.includes("application/pdf");c&&f&&(this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,t),l&&this.addType(i.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),a,i,l))}if(u){if(!r.force&&l&&"done"===this.requested[h])return this.doneFetch(r,e);this.requested[h]=!0}this.parseLinkHeader(o.get("link"),r.original,a);var d=this.handlerForContentType(c,e);return d?e.text().then((function(t){return e.responseText=t,d.parse(n,t,r,e)})):(this.addStatus(a,"Fetch over. No data handled."),this.doneFetch(r,e))}},{key:"saveErrorResponse",value:function(e,t){var r=this,n=this.store;return e.text().then((function(e){e.length>10&&n.add(t,r.ns.http("content"),n.rdfFactory.literal(e),t)}))}},{key:"handlerForContentType",value:function(e,t){if(!e)return null;var r=this.handlers.find((function(t){return e.match(t.pattern)}));return r?new r(t):null}},{key:"guessContentType",value:function(e){return qn[e.split(".").pop()]}},{key:"normalizedContentType",value:function(e,t){if(e.forceContentType)return e.forceContentType;var r=t.get("content-type");if(!r||r.includes("application/octet-stream")){var n=this.guessContentType(e.resource.value);if(n)return n}var i=dr.protocol(e.resource.value);return!r&&["file","chrome"].includes(i)?"text/xml":r}},{key:"redirectToProxy",value:function(e,t){var r=this;this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;var n=this.store,i=t.req;t.noMeta||(n.add(i,this.ns.link("redirectedTo"),n.rdfFactory.namedNode(e),i),this.addStatus(i,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;var o=Object.assign({},t);return o.baseURI=t.resource.value,this.fetchUri(e,o).then((function(e){return o.noMeta||n.add(i,r.ns.link("redirectedRequest"),o.req,r.appNode),e}))}},{key:"setRequestTimeout",value:function(e,t){var r=this;return new Promise((function(n){r.timeouts[e]=(r.timeouts[e]||[]).concat(setTimeout((function(){!r.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||n(r.failFetch(t,"Request to ".concat(e," timed out"),"timeout"))}),r.timeout))}))}},{key:"addFetchCallback",value:function(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}},{key:"acceptString",value:function(){var e="";for(var t in this.mediatypes)for(var r in""!==e&&(e+=", "),e+=t,this.mediatypes[t])e+=";"+r+"="+this.mediatypes[t][r];return e}}],[{key:"crossSiteProxy",value:function(t){return e.crossSiteProxyTemplate?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):void 0}},{key:"offlineOverride",value:function(e){var t,r=e;return"undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.preferences&&t.preferences.get("offlineModeUsingLocalhost")&&"http://"===r.slice(0,7)&&"localhost/"!==r.slice(7,17)&&(r="http://localhost/"+r.slice(7),wr.Z.warn("Localhost kludge for offline use: actually getting <"+r+">")),r}},{key:"proxyIfNecessary",value:function(t){var r;if("undefined"!=typeof window&&window.panes&&(r=window.panes.UI)&&r.isExtension)return t;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){var n=function e(t,r){var n=r[t.shift()];return n?"string"==typeof n?n+t.join("/"):t?e(t,n):null:null}(t.split("/").slice(2),$SolidTestEnvironment.localSiteMap);if(n)return n}return e.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===t.slice(0,5)?e.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(t)):t}},{key:"unsupportedProtocol",value:function(e){var t=dr.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}},{key:"setCredentials",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}}]),e}();(0,u.Z)(ti,"HANDLERS",void 0),(0,u.Z)(ti,"CONTENT_TYPE_BY_EXT",void 0),(0,u.Z)(ti,"crossSiteProxyTemplate",void 0),ti.HANDLERS=Kn,ti.CONTENT_TYPE_BY_EXT=qn;const ri={parseJSON:function(e,t,r){var n,i,o,a={},s=r.sym(t);for(var c in e){0===c.indexOf("_:")?a[c]?n=a[c]:(n=r.bnode(c),a[c]=n):n=r.sym(c);var u=e[c];for(var l in u){var h=u[l];for(var f in i=r.sym(l),h){var d=h[f];if("uri"===d.type)o=r.sym(d.value),r.add(n,i,o,s);else if("BlankNode"===d.type)a[d.value]?o=a[d.value]:(o=r.bnode(d.value),a[d.value]=o),r.add(n,i,o,s);else{if("Literal"!==d.type)throw new Error("error: unexpected termtype: "+f.type);o=d.datatype?r.literal(d.value,void 0,r.sym(d.datatype)):d.lang?r.literal(d.value,d.lang):r.literal(d.value),r.add(n,i,o,s)}}}}}};function ni(e){var t=0;function r(e){var t="",r=e.statements;for(var n in r)wr.Z.debug("Found statement: "+r),t+=a()+r[n]+"\n";return t}function n(e){var t="";for(var r in e.constraints){var n=e.constraints[r];t+=a()+"FILTER ( "+n.describe(r)+" ) \n"}return t}function i(e){for(var o="",s=0;s<e.optional.length;s++)wr.Z.debug("Found optional query"),o+=a()+"OPTIONAL { \n",t++,o+=r(e.optional[s]),o+=n(e.optional[s]),o+=i(e.optional[s]),t--,o+=a()+"}\n";return o}function o(e){var o=a()+"WHERE \n{ \n";return t++,o+=r(e),o+=n(e),o+=i(e),t--,o+"}"}function a(){for(var e="",r=0;r<t;r++)e+=" ";return e}return function(e){return function(e){for(var t=a()+"SELECT ",r=0;r<e.vars.length;r++)t+=e.vars[r]+" ";return t+"\n"}(e)+o(e.pat)}(e)}function ii(e,t,r){var n=[];function i(e){if(n[e])return n[e];var t=r.variable(e);return n[e]=t,t}function o(e){return"string"==typeof e&&e.match(/[^ \n\t]/)}function a(e){return"string"==typeof e&&e.match(/^[\?\$]/)}function s(e){return"string"==typeof e?e.replace(/^&lt;/,"<").replace(/&gt;$/,">"):e}function c(e){return"string"==typeof e&&e.match(/^<[^>]*>$/)}function u(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function l(e){return"string"==typeof e&&e.match(/:$/)}function h(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function f(e){return e.split(":")[0]}function d(e){return e.split(":")[1]}function p(e){return c(e)?e.slice(1,e.length-1):e}function y(e){var t=-1===e.indexOf("'")?null:e.indexOf("'"),n=-1===e.indexOf('"')?null:e.indexOf('"');if(!t&&!n){var i=new Array(1);return i[0]=e,i}var o,a,s=new Array(2);if(!t||n&&n<t)o='"',a=n;else{if(n&&!(t&&t<n))return wr.Z.error("SQARQL QUERY OOPS!"),s;o="'",a=t}s[0]=e.slice(0,a);var c,u=e.slice(a+1).indexOf(o);return-1===u?(wr.Z.error("SPARQL parsing error: no matching parentheses in literal "+e),e):(e.slice(u+a+2).match(/^\^\^/)?(c=e.slice(u+a+2).indexOf(" "),s[1]=r.literal(e.slice(a+1,a+1+u),r.sym(p(e.slice(a+4+u,a+2+u+c)))),s=s.concat(y(e.slice(u+a+3+c)))):e.slice(u+a+2).match(/^@/)?(c=e.slice(u+a+2).indexOf(" "),s[1]=r.literal(e.slice(a+1,a+1+u),e.slice(a+3+u,a+2+u+c),null),s=s.concat(y(e.slice(u+a+2+c)))):(s[1]=r.literal(e.slice(a+1,a+1+u)),wr.Z.info("Literal found: "+s[1]),s=s.concat(y(e.slice(u+a+2)))),s)}function v(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),wr.Z.info("New str into spaceDelimit: \n"+e);var t=[],r=e.split(" ");for(var n in r)o(r[n])&&(t=t.concat(r[n]));return t}function g(e,t){for(var r=0;r<t.length;r++)if("string"==typeof t[r]&&t[r].toLowerCase()===e.toLowerCase())return r;return null}function m(e,t){for(var r=[],n=0;n<t.length;n++)"string"==typeof t[n]&&t[n].toLowerCase()===e.toLowerCase()&&r.push(n);return r}function b(e,t,r){wr.Z.info("Looking for a close bracket of type "+r+" in "+e);for(var n=0,i=0;i<e.length;i++)if(e[i]===t&&n++,e[i]===r&&n--,n<0)return i;return wr.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(e){return this.describe=function(t){return t+" = "+e.toNT()},this.test=function(t){return e.equals(t)},this}function x(e){this.describe=function(t){return"REGEXP( '"+e+"' , "+t+" )"},this.test=function(t){var r=new RegExp(e);return!!t.value&&r.test(t.value)}}function _(e,t){3!==e.length||"Variable"!==e[0].termType||"NamedNode"!==e[2].termType&&"Literal"!==e[2].termType?6===e.length&&"string"==typeof e[0]&&"regexp"===e[0].toLowerCase()&&"("===e[1]&&")"===e[5]&&","===e[3]&&"Variable"===e[4].termType&&"Literal"===e[2].termType&&(wr.Z.debug("Constraint added: "+e),t.constraints[e[4]]=new x(e[2].value)):"="===e[1]||">"===e[1]||"<"===e[1]?(wr.Z.debug("Constraint added: "+e),t.constraints[e[0]]=new w(e[2])):wr.Z.warn("I don't know how to handle the constraint: "+e)}function k(e,t){wr.Z.debug("Optional query: "+e+" not yet implemented.");var n=r.formula();j(e,n),t.optional.push(n)}function j(e,t){var n,o,l=function(e){for(var t=[],n=0;n<e.length;n++)"string"==typeof e[n]?(e[n]=s(e[n]),a(e[n])?t[n]=i(e[n].slice(1)):u(e[n])?(wr.Z.info(e[n]+" was identified as a bnode."),t[n]=r.bnode()):c(e[n])?(wr.Z.info(e[n]+" was identified as a symbol."),t[n]=r.sym(p(e[n]))):h(e[n])?(wr.Z.info(e[n]+" was identified as a prefixed symbol"),N[f(e[n])]?t[n]=r.sym(e[n]=N[f(e[n])]+d(e[n])):(wr.Z.error("SPARQL error: "+e[n]+" with prefix "+f(e[n])+" does not have a correct prefix entry."),t[n]=e[n])):t[n]=e[n]):t[n]=e[n];return t}(e);for(wr.Z.debug("WHERE: "+l);g("OPTIONAL",l);)o=g("OPTIONAL",l),wr.Z.debug("OPT: "+o+" "+l[o]+" in "+l),"{"!==l[o+1]&&wr.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(l.slice(o+2),"{","}"))?wr.Z.error("No matching bracket in word "+o):(k(l.slice(o+2,o+2+n),t),o=g("OPTIONAL",l),n=b(l.slice(o+2),"{","}"),l.splice(o,n+3));for(wr.Z.debug("WHERE after optionals: "+l);g("FILTER",l);){var y=g("FILTER",l);"("!==l[y+1]&&wr.Z.warn("Bad filter opening bracket in word "+y),-1===(n=b(l.slice(y+2),"(",")"))?wr.Z.error("No matching bracket in word "+y):(_(l.slice(y+2,y+2+n),t),y=g("FILTER",l),n=b(l.slice(y+2),"(",")"),l.splice(y,n+3))}wr.Z.debug("WHERE after filters and optionals: "+l),function(e,t){var r=new Array(1);r[0]=-1;for(var n=r.concat(m(".",e)),i=[],o=0;o<n.length-1;o++)i[o]=e.slice(n[o]+1,n[o+1]);for(o in i){wr.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 c=[],u=0;u<s.length-1;u++)c[u]=i[o].slice(s[u]+1,s[u+1]);for(o in c){wr.Z.info("p+o "+o+" = "+i[o]);var l=c[o][0];c[o].splice(0,1);var h=r.concat(m(",",c[o]));h.push(c[o].length);var f=[];for(u=0;u<h.length-1;u++)f[u]=c[o].slice(h[u]+1,h[u+1]);for(o in f){var d=f[o][0];wr.Z.info("Subj="+a+" Pred="+l+" Obj="+d),t.add(a,l,d)}}}}(l,t)}wr.Z.info("SPARQL input: \n"+e);var T=new Zr,O=function(e){var t=y(e),r=[];for(var n in t)r="string"==typeof t[n]?r.concat(v(t[n])):r.concat(t[n]);return r=function(e){for(var t=e,r=0;r<t.length;r++)if("a"===t[r]&&(t[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===t[r]&&"of"===t[r+2]){t.splice(r,1),t.splice(r+1,1);var n=t[r-1];t[r-1]=t[r+1],t[r+1]=n}return t}(r),wr.Z.info("SPARQL Tokens: "+r),r}(e),N=function(e){var t=m("PREFIX",e),r=[];for(var n in t){var i=e[t[n]+1],o=e[t[n]+2];if(l(i))if(c(o)){wr.Z.info("Prefix found: "+i+" -> "+o);var a=f(i),s=p(o);r[a]=s}else wr.Z.error("Invalid SPARQL symbol: "+o);else wr.Z.error("Invalid SPARQL prefix: "+i)}return r}(O);N.rdf||(N.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),N.rdfs||(N.rdfs="http://www.w3.org/2000/01/rdf-schema#");var S=g("SELECT",O),E=g("WHERE",O);if(S<0||E<0||S>E)return wr.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var r in wr.Z.info("SPARQL vars: "+e),e)if(a(e[r])){wr.Z.info("Added "+e[r]+" to query variables from SPARQL");var n=i(e[r].slice(1));t.vars.push(n),n.label=e[r].slice(1)}else wr.Z.warn("Incorrect SPARQL variable in SELECT: "+e[r])}(O.slice(S+1,E),T),j(O.slice(E+2,O.length-1),T.pat),t)return T;for(var I in T.pat.statements){var A=T.pat.statements[I];"NamedNode"===A.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(A.subject,"sparql:"+A.subject),"NamedNode"===A.object.termType&&r.fetcher&&r.fetcher.lookUpThing(A.object,"sparql:"+A.object)}return T}function oi(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ai(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ai(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},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(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function ai(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var si=function(){function e(t){if((0,r.Z)(this,e),(0,u.Z)(this,"store",void 0),(0,u.Z)(this,"ifps",void 0),(0,u.Z)(this,"fps",void 0),(0,u.Z)(this,"patchControl",void 0),(0,u.Z)(this,"ns",void 0),(t=t||new Wr).updater)throw new Error("You can't have two UpdateManagers for the same store");t.fetcher||(t.fetcher=new ti(t)),this.store=t,t.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=xr("http://www.w3.org/2007/ont/link#"),this.ns.http=xr("http://www.w3.org/2007/ont/http#"),this.ns.httph=xr("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=xr("http://www.w3.org/ns/ldp#"),this.ns.rdf=xr("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=xr("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=xr("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=xr("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}return(0,t.Z)(e,[{key:"patchControlFor",value:function(e){return this.patchControl[e.value]||(this.patchControl[e.value]=[]),this.patchControl[e.value]}},{key:"isHttpUri",value:function(e){return"http"===e.slice(0,4)}},{key:"editable",value:function(e,t){if(!e)return!1;if(t||(t=this.store),e=(0,Fn._)(e),!this.isHttpUri(e)&&t.holds(this.store.rdfFactory.namedNode(e),this.store.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.store.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var r,n,i=!1,o=t.each(void 0,this.ns.link("requestedURI"),(0,dr.docpart)(e)),a=0;a<o.length;a++)if(void 0!==(r=o[a])){var s=t.any(r,this.ns.link("response"));if(void 0!==r){var c=t.anyValue(s,this.ns.httph("wac-allow"));if(c){var u,l=oi(c.split(","));try{for(l.s();!(u=l.n()).done;){var h=u.value.split("=");if(h[0].includes("user")&&!h[1].includes("write")&&!h[1].includes("append"))return!1}}catch(e){l.e(e)}finally{l.f()}}var f=t.each(s,this.ns.httph("accept-patch"));if(f.length)for(var d=0;d<f.length;d++){if((n=f[d].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(n.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var p=t.each(s,this.ns.httph("ms-author-via"));if(p.length)for(var y=0;y<p.length;y++){if((n=p[y].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(n.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(e))return!!c&&"LOCALFILE";var v=t.each(s,this.ns.http("status"));if(v.length)for(var g=0;g<v.length;g++)200!==v[g]&&404!==v[g]||(i=!0)}}if(0===o.length);else if(i)return!1}},{key:"anonymize",value:function(e){return"_:"===e.toNT().substr(0,2)&&this.mentioned(e)?"?"+e.toNT().substr(2):e.toNT()}},{key:"anonymizeNT",value:function(e){return this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" ."}},{key:"nTriples",value:function(e){return"".concat(e.subject.toNT()," ").concat(e.predicate.toNT()," ").concat(e.object.toNT()," .")}},{key:"statementBnodes",value:function(e){return[e.subject,e.predicate,e.object].filter((function(e){return(0,g.B2)(e)}))}},{key:"statementArrayBnodes",value:function(e){for(var t=[],r=0;r<e.length;r++)t=t.concat(this.statementBnodes(e[r]));t.sort();for(var n=[],i=0;i<t.length;i++)0!==i&&t[i].equals(t[i-1])||n.push(t[i]);return n}},{key:"cacheIfps",value:function(){this.ifps={};for(var e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty")),t=0;t<e.length;t++)this.ifps[e[t].value]=!0;this.fps={},e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(var r=0;r<e.length;r++)this.fps[e[r].value]=!0}},{key:"bnodeContext2",value:function(e,t,r){for(var n,i,o=this.store.statementsMatching(void 0,void 0,e,t),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,t,r-1)))return i.concat([o[a]])}o=this.store.statementsMatching(e,void 0,void 0,t);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,t,r-1)))return i.concat([o[s]])}return null}},{key:"bnodeContext1",value:function(e,t){for(var r=0;r<3;r++){var n=this.bnodeContext2(e,t,r);if(null!==n)return n}return this.store.connectedStatements(e,t)}},{key:"mentioned",value:function(e){return 0!==this.store.statementsMatching(e,null,null,null).length||0!==this.store.statementsMatching(null,e).length||0!==this.store.statementsMatching(null,null,e).length}},{key:"bnodeContext",value:function(e,t){var r=[];if(e.length){this.cacheIfps();for(var n=0;n<e.length;n++){var i=e[n];this.mentioned(i)&&(r=r.concat(this.bnodeContext1(i,t)))}}return r}},{key:"statementContext",value:function(e){var t=this.statementBnodes(e);return this.bnodeContext(t,e.graph)}},{key:"contextWhere",value:function(e){var t=this;return e&&0!==e.length?"WHERE { "+e.map((function(e){return t.anonymizeNT(e)})).join("\n")+" }\n":""}},{key:"fire",value:function(e,t,r){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((function(){if(!e)throw new Error("No URI given for remote editing operation: "+t);return i.noMeta=!0,i.contentType="application/sparql-update",i.body=t,n.store.fetcher.webOperation("PATCH",e,i)})).then((function(n){if(!n.ok){var i="UpdateManager: update failed for <"+e+"> status="+n.status+", "+n.statusText+"\n for query: "+t;throw new Error(i)}r(e,n.ok,n.responseText,n)})).catch((function(t){r(e,!1,t.message,t)}))}},{key:"update_statement",value:function(e){if(!e||e.graph){var t=this,r=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.graph]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(r),set_object:function(e,r){var n=this.where;n+="DELETE DATA { "+this.statementNT+" } ;\n",n+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].value,n,r)}}}}},{key:"insert_statement",value:function(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){for(var i="",o=0;o<e.length;o++)i+=e[o]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}},{key:"delete_statement",value:function(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){for(var i="",o=0;o<e.length;o++)i+=e[o]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}},{key:"requestDownstreamAction",value:function(e,t){var r=this.patchControlFor(e);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+t)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=t;else t(e)}},{key:"clearUpstreamCount",value:function(e){this.patchControlFor(e).upstreamCount=0}},{key:"getUpdatesVia",value:function(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}},{key:"addDownstreamChangeListener",value:function(e,t){var r=this,n=this.patchControlFor(e);n.downstreamChangeListeners||(n.downstreamChangeListeners=[]),n.downstreamChangeListeners.push(t),this.setRefreshHandler(e,(function(e){r.reloadAndSync(e)}))}},{key:"reloadAndSync",value:function(e){var t=this.patchControlFor(e),r=this;if(t.reloading)t.outOfDate=!0;else{t.reloading=!0;var n=1e3;!function i(){r.reload(r.store,e,(function(e,r,o){if(e){if(t.downstreamChangeListeners)for(var a=0;a<t.downstreamChangeListeners.length;a++)t.downstreamChangeListeners[a]();t.reloading=!1,t.outOfDate&&(t.outOfDate=!1,i())}else t.reloading=!1,0===o.status&&(t.reloading=!0,setTimeout(i,n*=2))}))}()}}},{key:"setRefreshHandler",value:function(e,t){var r=this.getUpdatesVia(e),n=t,i=this,o=this,a=1500,s=0;if(!r)return!1;var c=(r=(0,dr.join)(r,e.value)).replace(/^http:/,"ws:").replace(/^https:/,"wss:");return function t(){var r;if("undefined"!=typeof WebSocket)r=new WebSocket(c);else{if("undefined"==typeof window||!window.WebSocket)return;r=window.WebSocket(c)}r.onopen=function(){a=1500,this.send("sub "+e.value),s&&o.requestDownstreamAction(e,n)};var u=i.patchControlFor(e);u.upstreamCount=0,r.onerror=function(e){},r.onclose=function(e){a*=2,s+=1,setTimeout((function(){t()}),a)},r.onmessage=function(t){if(t.data&&"pub"===t.data.slice(0,3)){if("upstreamCount"in u&&(u.upstreamCount-=1,u.upstreamCount>=0))return;u.upstreamCount=0,i.requestDownstreamAction(e,n)}}}(),!0}},{key:"updateMany",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=e.concat(t).map((function(e){return e.why})),n=this,i=[];r.forEach((function(e){i.find((function(t){return t.equals(e)}))||i.push(e)}));var o=i.map((function(r){return n.update(e.filter((function(e){return e.why.equals(r)})),t.filter((function(e){return e.why.equals(r)})))}));return o.length,Promise.all(o)}},{key:"update",value:function(e,t,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(e,t,(function(e,t,n){t?r():i(new Error(n))}),n,o)}))}try{var s=this.store,c=e?(0,g.Pv)(e)?e.statements:e instanceof Array?e:[e]:[],u=t?(0,g.Pv)(t)?t.statements:t instanceof Array?t:[t]:[];if(!(c instanceof Array))throw new Error("Type Error "+(0,y.Z)(c)+": "+c);if(!(u instanceof Array))throw new Error("Type Error "+(0,y.Z)(u)+": "+u);if(0===c.length&&0===u.length)return r(null,!0);var l=c.length?c[0].graph:u[0].graph;if(!l){var h="Error patching: statement does not specify which document to patch:"+c[0]+", "+u[0];throw new Error(h)}var f=this.patchControlFor(l),d=Date.now(),p=["subject","predicate","object","why"],v=["insert","delete"],m={delete:c,insert:u};v.map((function(e){m[e].map((function(e){if(!l.equals(e.graph))throw new Error("update: destination "+l+" inconsistent with delete quad "+e.graph);p.map((function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" 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 stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(l).then((function(n){i.update(e,t,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(e,t,r,!0,o)}))}if(b.indexOf("SPARQL")>=0){var w=[];c.length&&(w=this.statementArrayBnodes(c)),u.length&&(w=w.concat(this.statementArrayBnodes(u)));var x=this.bnodeContext(w,l),_=this.contextWhere(x),k="";if(_.length){if(c.length){k+="DELETE { ";for(var j=0;j<c.length;j++)k+=this.anonymizeNT(c[j])+"\n";k+=" }\n"}if(u.length){k+="INSERT { ";for(var T=0;T<u.length;T++)k+=this.anonymizeNT(u[T])+"\n";k+=" }\n"}k+=_}else{if(c.length){k+="DELETE DATA { ";for(var O=0;O<c.length;O++)k+=this.anonymizeNT(c[O])+"\n";k+=" } \n"}if(u.length){c.length&&(k+=" ; "),k+="INSERT DATA { ";for(var N=0;N<u.length;N++)k+=this.nTriples(u[N])+"\n";k+=" }\n"}}f.pendingUpstream=f.pendingUpstream?f.pendingUpstream+1:1,"upstreamCount"in f&&(f.upstreamCount+=1),this.fire(l.value,k,(function(e,t,n,i){if(i.elapsedTimeMs=Date.now()-d,t){try{s.remove(c)}catch(e){t=!1,n="Remote Ok BUT error deleting "+c.length+" from store!!! "+e}for(var o=0;o<u.length;o++)s.add(u[o].subject,u[o].predicate,u[o].object,l)}if(r(e,t,n,i),f.pendingUpstream-=1,0===f.pendingUpstream&&f.downstreamAction){var a=f.downstreamAction;delete f.downstreamAction,a(l)}}),o)}else if(b.indexOf("DAV")>=0)this.updateDav(l,c,u,r,o);else{if(!(b.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+b+"' for "+l);try{this.updateLocalFile(l,c,u,r,o)}catch(e){r(l.value,!1,"Exception trying to write back file <"+l.value+">\n")}}}catch(e){r(void 0,!1,"Exception in update: "+e+"\n"+_r.stackString(e))}}},{key:"updateDav",value:function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store,a=o.any(e,this.ns.link("request"));if(!a)throw new Error("No record of our HTTP GET request for document: "+e);var s=o.any(a,this.ns.link("response"));if(!s)return null;for(var c=o.the(s,this.ns.httph("content-type")).value,u=o.statementsMatching(void 0,void 0,void 0,e).slice(),l=0;l<t.length;l++)_r.RDFArrayRemove(u,t[l]);for(var h=0;h<r.length;h++)u.push(r[h]);var f,d=this.serialize(e.value,u,c),p=o.the(s,this.ns.httph("content-location"));return p&&(f=(0,dr.join)(p.value,f)),i.contentType=c,i.noMeta=!0,i.body=d,o.fetcher.webOperation("PUT",f,i).then((function(i){if(!i.ok)throw new Error(i.error);for(var a=0;a<t.length;a++)o.remove(t[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,e);n(e.value,i.ok,i.responseText,i)})).catch((function(t){n(e.value,!1,t.message,t)}))}},{key:"updateLocalFile",value:function(e,t,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,e).slice(),s=0;s<t.length;s++)_r.RDFArrayRemove(a,t[s]);for(var c=0;c<r.length;c++)a.push(r[c]);var u=e.value.lastIndexOf(".");if(u<1)throw new Error("Rewriting file: No filename extension: "+e.value);var l=e.value.slice(u+1),h=ti.CONTENT_TYPE_BY_EXT[l];if(!h)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(e.value,a,h),i.contentType=h,o.fetcher.webOperation("PUT",e.value,i).then((function(i){if(!i.ok)return n(e.value,!1,i.error);for(var a=0;a<t.length;a++)o.remove(t[a]);for(var s=0;s<r.length;s++)o.add(r[s].subject,r[s].predicate,r[s].object,e);n(e.value,!0,"")}))}},{key:"serialize",value:function(e,t,r){var n,i=this.store;if("string"==typeof t)return t;var o=Nr(i);switch(o.suggestNamespaces(i.namespaces),o.setBase(e),r){case"text/xml":case"application/rdf+xml":n=o.statementsToXML(t);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":n=o.statementsToN3(t);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return n}},{key:"put",value:function(e,t,r,n){var i,o=this,a=this.store;return Promise.resolve().then((function(){return i=o.serialize(e.value,t,r),a.fetcher.webOperation("PUT",e.value,{contentType:r,body:i})})).then((function(r){if(!r.ok)return n(e.value,r.ok,r.error,r);delete a.fetcher.nonexistent[e.value],delete a.fetcher.requested[e.value],"string"!=typeof t&&t.map((function(e){a.addStatement(e)})),n(e.value,r.ok,"",r)})).catch((function(t){n(e.value,!1,t.message)}))}},{key:"reload",value:function(e,t,r){var n=Date.now();e.fetcher.nowOrWhenFetched(t.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(e,i,o){if(e)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var a=Date.now()-n;t.reloadTimeTotal||(t.reloadTimeTotal=0),t.reloadTimeCount||(t.reloadTimeCount=0),t.reloadTimeTotal+=a,t.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}]),e}();function ci(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ui(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ci(Object(r),!0).forEach((function(t){(0,u.Z)(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ci(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var li=ui(ui({},jn),{},{fetcher:function(e,t){return new ti(e,t)},graph:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;return new Wr(e,t||{rdfFactory:jn})},lit:function(e,t,r){return this.literal(""+e,t||r)},st:function(e,t,r,n){return this.quad(e,t,r,n)}});const hi=li;var fi=function(){function e(t,n){(0,r.Z)(this,e),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(e){this.onError(e)}}return(0,t.Z)(e,[{key:"_decode",value:function(e){var t,r,n,i,o,a,s;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=e.split("&")).length;r<n;r++)t=i[r],o.push(t.split("="));return o}())t=o[r],s=(a=[decodeURIComponent(t[0]),decodeURIComponent(t[1])])[1],null==i[n=a[0]]&&(i[n]=[]),i[n].push(s);return i}},{key:"_send",value:function(e,t,r){var n,i;return i=[e,t,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}},{key:"_subscribe",value:function(e){return this._send("sub",e,""),this.subscribed[e]=!0,this.subscribed[e]}},{key:"onClose",value:function(e){var t;for(t in this.connected=!1,this.subscribed)this.pending[t]=!0;return this.subscribed={},this.subscribed}},{key:"onError",value:function(e){throw new Error("onError"+e)}},{key:"onMessage",value:function(e){var t,r;return"ping"===(r=e.data.split(" "))[0]?"function"==typeof(t=this.socket).send?t.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}},{key:"onOpen",value:function(e){var t,r;for(r in this.connected=!0,t=[],this.pending)delete this.pending[r],t.push(this._subscribe(r));return t}},{key:"subscribe",value:function(e){return this.connected?this._subscribe(e):(this.pending[e]=!0,this.pending[e])}}]),e}(),di=function(){function e(t){(0,r.Z)(this,e),this.fetcher=t,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}return(0,t.Z)(e,[{key:"onHeaders",value:function(e){var t,r,n;return null==e.headers||"undefined"==typeof WebSocket||null===WebSocket||(t=e.headers.etag,n=e.headers["updates-via"],r=e.uri,t&&n&&(this.graph[r]={etag:t,via:n},this.register(n,r))),!0}},{key:"onUpdate",value:function(e,t){return this.fetcher.refresh(hi.namedNode(e))}},{key:"register",value:function(e,t){return null==this.via[e]&&(this.via[e]=new fi(this,e)),this.via[e].subscribe(t)}}]),e}();function pi(e){var t=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(e){return!1}}();return function(){var r,n=(0,c.Z)(e);if(t){var i=(0,c.Z)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,s.Z)(this,r)}}var yi={};for(var vi in hi)"function"==typeof hi[vi]&&(yi[vi]=hi[vi].bind(hi));var gi=yi.fetcher,mi=yi.graph,bi=yi.lit,wi=yi.st,xi=yi.namedNode,_i=yi.variable,ki=yi.blankNode,ji=yi.defaultGraph,Ti=yi.literal,Oi=yi.quad,Ni=yi.triple,Si=new Mr,Ei=function(e){return Si.fromNT(e)},Ii=Fr.fromValue,Ai=p.nextId,Ri=function(e){(0,a.Z)(i,e);var n=pi(i);function i(e){var t;return(0,r.Z)(this,i),t=n.call(this,e),(0,u.Z)((0,o.Z)(t),"fetcher",void 0),t.fetcher=new ti((0,o.Z)(t),{}),t}return(0,t.Z)(i)}(Wr),Ci=function(e){(0,a.Z)(i,e);var n=pi(i);function i(e){var t;return(0,r.Z)(this,i),t=n.call(this,e),(0,u.Z)((0,o.Z)(t),"updater",void 0),t.updater=new si((0,o.Z)(t)),t}return(0,t.Z)(i)}(Ri)})(),i})()}));
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("window")):"function"==typeof define&&define.amd?define(["window"],t):"object"==typeof exports?exports.$rdf=t(require("window")):e.$rdf=t(e.window)}(self,(e=>(()=>{var t={8333:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},7308:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n={debug(e){},warn(e){},info(e){},error(e){},success(e){},msg(e){}}},6545:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var n=r(5305),i=r(8333),o=r(4806),s=r(9247),a=r(2598),l=r(5904);class c extends o.Z{constructor(e){if(super((0,a._)(e)),(0,n.Z)(this,"termType",s.XM),(0,n.Z)(this,"classOrder",i.Z.NamedNode),!this.value)throw new Error("Missing IRI for NamedNode");if(!this.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(this.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.')}dir(){var e=this.value.split("#")[0],t=e.slice(0,-1).lastIndexOf("/"),r=e.indexOf("//");return r>=0&&t<r+2||t<0?null:new c(e.slice(0,t+1))}site(){var e=this.value.split("#")[0],t=e.indexOf("//");if(t<0)throw new Error("This URI does not have a web site part (origin)");var r=e.indexOf("/",t+2);return new c(r<0?e.slice(0)+"/":e.slice(0,r+1))}doc(){return this.value.indexOf("#")<0?this:new c(this.value.split("#")[0])}toString(){return"<"+this.value+">"}id(){return this.value.split("#")[1]}get uri(){return this.value}set uri(e){this.value=e}static fromValue(e){return null==e||(0,l.jt)(e)?e:new c(e)}}},4806:(e,t,r)=>{"use strict";r.d(t,{Z:()=>o});var n=r(5305),i=r(292);class o{constructor(e){(0,n.Z)(this,"termType",void 0),(0,n.Z)(this,"classOrder",void 0),(0,n.Z)(this,"value",void 0),this.value=e}substitute(e){return i.log("@@@ node substitute"+this),this}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.value<e.value?-1:this.value>e.value?1:0}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toCanonical()}sameTerm(e){return this.equals(e)}toCanonical(){return this.toNT()}toNT(){return this.toString()}toNQ(){return this.toNT()}toString(){throw new Error("Node.toString() is abstract - see the subclasses instead")}}(0,n.Z)(o,"fromValue",void 0),(0,n.Z)(o,"toJS",void 0)},9247:(e,t,r)=>{"use strict";r.d(t,{D7:()=>T,Eo:()=>_,Is:()=>m,NK:()=>a,UH:()=>s,V1:()=>i,XM:()=>n,_A:()=>u,aV:()=>v,b4:()=>y,fb:()=>l,lL:()=>g,ls:()=>c,oW:()=>b,qS:()=>f,sZ:()=>p,ui:()=>d,us:()=>h,xH:()=>o,xm:()=>w,z8:()=>x});const n="NamedNode",i="BlankNode",o="Literal",s="Variable",a="DefaultGraph",l="Collection",c="Empty",u="Graph",h="text/html",d="application/ld+json",f="text/n3",p="application/n3",g="application/nquads",y="application/n-quads",v="application/n-triples",m="application/rdf+xml",b="application/sparql-update",w="application/sparql-update-single-match",x="text/turtle",_="application/x-turtle",T="application/xhtml+xml"},3357:(e,t,r)=>{"use strict";r.r(t),r.d(t,{docpart:()=>s,document:()=>a,hostpart:()=>l,join:()=>c,protocol:()=>u,refTo:()=>h});var n=r(6545),i=r(292),o=o||i.log;function s(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function a(e){return new n.Z(s(e))}function l(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function c(e,t){var r,n,i,s,a,l=t.indexOf("#");if(l>0&&(t=t.slice(0,l)),0===e.length)return t;if(0===e.indexOf("#"))return t+e;if(e.indexOf(":")>=0)return e;if(r=t.indexOf(":"),0===t.length)return e;if(r<0)return o("Invalid base: "+t+" in join with given: "+e),e;if(n=t.slice(0,+r+1||9e9),0===e.indexOf("//"))return n+e;if(t.indexOf("//",r)===r+1){if((i=t.indexOf("/",r+3))<0)return t.length-r-3>0?t+"/"+e:n+e}else if((i=t.indexOf("/",r+1))<0)return t.length-r-1>0?t+"/"+e:n+e;if(0===e.indexOf("/"))return t.slice(0,i)+e;if((s=(a=t.slice(i)).lastIndexOf("/"))<0)return n+e;for(s>=0&&s<a.length-1&&(a=a.slice(0,+s+1||9e9)),a+=e;a.match(/[^\/]*\/\.\.\//);)a=a.replace(/[^\/]*\/\.\.\//,"");return a=(a=a.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,i)+a}function u(e){const t=e.indexOf(":");return t<0?null:e.slice(0,t)}function h(e,t){var r,n,i,o,s,a,l,c,u,h,d,f,p=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=l=0,o=t.length;l<o&&t[r]===e[r];r=++l);if(e.slice(0,r).match(p)&&((n=t.indexOf("//"))<0&&(n=-2),i=t.indexOf("/",n+2),"/"!==t[i+1]&&"/"!==e[i+1]&&t.slice(0,i)===e.slice(0,i)))return t.slice(i);if("#"===t[r]&&e.length===r)return t.slice(r);for(;r>0&&"/"!==t[r-1];)r--;if(r<3)return t;if(e.indexOf("//",r-2)>0||t.indexOf("//",r-2)>0)return t;if(e.indexOf(":",r)>0)return t;for(a=0,c=0,s=(h=e.slice(r)).length;c<s;c++)"/"===h[c]&&a++;if(0===a&&r<t.length&&"#"===t[r])return"./"+t.slice(r);if(0===a&&r===t.length)return"./";if(f="",a>0)for(u=1,d=a;d>=1?u<=d:u>=d;d>=1?++u:--u)f+="../";return f+t.slice(r)}},5115:(e,t,r)=>{"use strict";r.r(t),r.d(t,{DOMParserFactory:()=>d,RDFArrayRemove:()=>w,callbackify:()=>h,domToString:()=>f,dtstamp:()=>g,dumpNode:()=>p,heavyCompare:()=>y,heavyCompareSPO:()=>v,linkRelationProperty:()=>u,log:()=>n.Z,mediaTypeClass:()=>c,output:()=>m,parseXML:()=>b,stackString:()=>_,string:()=>l,string_startswith:()=>x,uri:()=>i});var n=r(7308),i=r(3357),o=r(6545),s=r(870);e=r.hmd(e);var a=r(292);const l={template:function(e,t){for(var r=e.split("%s"),n="",i=0;i<t.length;i++)t[i]+="",n+=r[i]+t[i];return n+r.slice(t.length).join()}};function c(e){return e=e.split(";")[0].trim(),new o.Z("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function u(e){return new o.Z("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function h(e,t){e.callbacks={};for(var r=t.length-1;r>=0;r--)e.callbacks[t[r]]=[];e.addHook=function(t){e.callbacks[t]||(e.callbacks[t]=[])},e.addCallback=function(t,r){e.callbacks[t].push(r)},e.removeCallback=function(t,r){for(var n=0;n<e.callbacks[t].length;n++)if(e.callbacks[t][n].name===r)return e.callbacks[t].splice(n,1),!0;return!1},e.insertCallback=function(t,r){e.callbacks[t].unshift(r)},e.fireCallbacks=function(t,r){var n,i=[],o=[],s=e.callbacks[t].length;let a;for(n=s-1;n>=0;n--)a=e.callbacks[t][n],a&&a.apply(e,r)&&i.push(a);for(n=i.length-1;n>=0;n--)o.push(i[n]);for(n=s;n<e.callbacks[t].length;n++)o.push(e.callbacks[t][n]);e.callbacks[t]=o}}function d(){return window.DOMParser?new s.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function f(e,t){var r=[];(t=t||{})&&t.selfClosing&&t.selfClosing.split(" ").forEach((function(e){r[e]=!0}));var n=[];return t&&t.skipAttributes&&t.skipAttributes.split(" ").forEach((function(e){n[e]=!0})),p(e,t,r,n)}function p(e,t,r,n){var i,o="",s=[!1];if(void 0===e.nodeType)return o;if(1===e.nodeType){if(e.hasAttribute("class")&&t&&t.classWithChildText&&e.matches(t.classWithChildText.class))o+=e.querySelector(t.classWithChildText.element).textContent;else if(!(t&&t.skipNodeWithClass&&e.matches("."+t.skipNodeWithClass))){var l=e.nodeName.toLowerCase();o+="<"+l;var c=[];for(i=e.attributes.length-1;i>=0;i--){var u=e.attributes[i];if(!(n&&n.length>0&&n[u.name]||/^\d+$/.test(u.name))){if("class"===u.name&&t&&t.replaceClassItemWith&&u.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var h=new RegExp(t.replaceClassItemWith.source,"g");u.value=u.value.replace(h,t.replaceClassItemWith.target).trim()}"class"===u.name&&t&&t.skipClassWithValue&&t.skipClassWithValue===u.value||c.push(u.name+"='"+u.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(c.length>0&&(t&&t.sortAttributes&&c.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),o+=" "+c.join(" ")),r&&r.ename)o+=" />";else{for(o+=">",o+="html"===l?"\n ":"",s.push("style"===l||"script"===l),i=0;i<e.childNodes.length;i++)o+=p(e.childNodes[i]);s.pop(),o+="body"===l?"</"+l+">\n":"</"+l+">"}}}else if(8===e.nodeType)o+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var d=e.nodeValue.replace(/\n+$/,"");o+=s[s.length-1]?d:d.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else a.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),a.log(e);return o}function g(){var e=new Date,t=e.getYear()+1900,r=e.getMonth()+1,n=e.getDate(),i=e.getUTCHours(),o=e.getUTCMinutes(),s=e.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),o<10&&(o="0"+o),s<10&&(s="0"+s),t+"-"+r+"-"+n+"T"+i+":"+o+":"+s+"Z"}function y(e,t,r,n){var i=function(e){return"BlankNode"===e.termType?null:e},o=function(e){var t=r.statementsMatching(e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})).concat(r.statementsMatching(void 0,void 0,e).map((function(e){return i(e.subject)+" "+i(e.predicate)+" "+i(e.object)})));return t.sort(),t.join("\n")};const s=Object.prototype.hasOwnProperty.call(r,"compareTerms")?r.compareTerms(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===s?0:o(e)>o(t)?1:o(e)<o(t)?-1:s:n&&e.uri&&t.uri?(n[e.uri]||e.uri).localeCompare(n[t.uri]||t.uri):s}function v(e,t,r,n){return y(e.subject,t.subject,r,n)||y(e.predicate,t.predicate,r,n)||y(e.object,t.object,r,n)}function m(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function b(t,r){return r=r||{},e&&e.exports?(new s.DOMParser).parseFromString(t,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new s.DOMParser).parseFromString(t,"application/xml")}function w(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.why))return void e.splice(r,1);throw new Error("RDFArrayRemove: Array did not contain "+t+" "+t.why)}function x(e,t){return e.slice(0,t.length)===t}function _(e){var t=e+"\n";if(!e.stack)return t+"No stack available.\n";for(var r=e.stack.toString().split("\n"),n=[],i=0;i<r.length;i++){var o=r[i];if(o.indexOf("ecmaunit.js")>-1)break;"("==o.charAt(0)&&(o="function"+o);var s=o.split("@");n.push(s)}for(i=0;i<n.length;i++)t+=" "+n[i][1]+"\n "+n[i][0];return t}},2598:(e,t,r)=>{"use strict";function n(e){return"string"==typeof e?e:e.value}r.d(t,{_:()=>n})},5904:(e,t,r)=>{"use strict";r.d(t,{B2:()=>g,NA:()=>b,NX:()=>p,PY:()=>f,Pv:()=>o,Uc:()=>a,Yi:()=>i,cG:()=>u,f:()=>l,jt:()=>h,lt:()=>m,lx:()=>v,n_:()=>d,nq:()=>c,uZ:()=>s,zz:()=>y});var n=r(9247);function i(e){return"object"==typeof e&&null!==e&&"subject"in e}function o(e){return"object"==typeof e&&null!==e&&"statements"in e}function s(e){return h(e)&&e.termType===n.fb}function a(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function l(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.fb||e.termType===n.xH||e.termType===n._A)}function c(e){return h(e)&&(e.termType===n.XM||e.termType===n.V1||e.termType===n.UH)}function u(e){return h(e)&&e.termType===n.UH}function h(e){return"object"==typeof e&&null!==e&&"termType"in e}function d(e){return e.termType===n.xH}function f(e){return"object"==typeof e&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function p(e){return h(e)&&"NamedNode"===e.termType}function g(e){return h(e)&&"termType"in e&&"BlankNode"===e.termType}function y(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1)}function v(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH)}function m(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.xH)}function b(e){return h(e)&&(e.termType===n.XM||e.termType===n.UH||e.termType===n.V1||e.termType===n.NK)}},6118:(e,t,r)=>{"use strict";var n=r(2530),i=r(292);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var s,a,l=r(8619).codes,c=l.ERR_AMBIGUOUS_ARGUMENT,u=l.ERR_INVALID_ARG_TYPE,h=l.ERR_INVALID_ARG_VALUE,d=l.ERR_INVALID_RETURN_VALUE,f=l.ERR_MISSING_ARGS,p=r(6979),g=r(5663).inspect,y=r(5663).types,v=y.isPromise,m=y.isRegExp,b=Object.assign?Object.assign:r(1662).assign,w=Object.is?Object.is:r(7402);function x(){var e=r(1667);s=e.isDeepEqual,a=e.isDeepStrictEqual}new Map;var _=!1,T=e.exports=O,j={};function E(e){if(e.message instanceof Error)throw e.message;throw new p(e)}function N(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new p({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function O(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];N.apply(void 0,[O,t.length].concat(t))}T.fail=function e(t,r,o,s,a){var l,c=arguments.length;if(0===c)l="Failed";else if(1===c)o=t,t=void 0;else{if(!1===_){_=!0;var u=n.emitWarning?n.emitWarning:i.warn.bind(i);u("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}2===c&&(s="!=")}if(o instanceof Error)throw o;var h={actual:t,expected:r,operator:void 0===s?"fail":s,stackStartFn:a||e};void 0!==o&&(h.message=o);var d=new p(h);throw l&&(d.message=l,d.generatedMessage=!0),d},T.AssertionError=p,T.ok=O,T.equal=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");t!=r&&E({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},T.notEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");t==r&&E({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},T.deepEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),s(t,r)||E({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},T.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),s(t,r)&&E({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},T.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),a(t,r)||E({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},T.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");void 0===s&&x(),a(t,r)&&E({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},T.strictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");w(t,r)||E({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},T.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new f("actual","expected");w(t,r)&&E({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var S=function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach((function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&m(t[e])&&t[e].test(n[e])?i[e]=n[e]:i[e]=t[e])}))};function I(e,t,r,n,i,o){if(!(r in e)||!a(e[r],t[r])){if(!n){var s=new S(e,i),l=new S(t,i,e),c=new p({actual:s,expected:l,operator:"deepStrictEqual",stackStartFn:o});throw c.actual=e,c.expected=t,c.operator=o.name,c}E({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}function k(e,t,r,n){if("function"!=typeof t){if(m(t))return t.test(e);if(2===arguments.length)throw new u("expected",["Function","RegExp"],t);if("object"!==o(e)||null===e){var i=new p({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw i.operator=n.name,i}var a=Object.keys(t);if(t instanceof Error)a.push("name","message");else if(0===a.length)throw new h("error",t,"may not be an empty object");return void 0===s&&x(),a.forEach((function(i){"string"==typeof e[i]&&m(t[i])&&t[i].test(e[i])||I(e,t,i,r,a,n)})),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function A(e){if("function"!=typeof e)throw new u("fn","Function",e);try{e()}catch(e){return e}return j}function R(e){return v(e)||null!==e&&"object"===o(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then((function(){var t;if("function"==typeof e){if(!R(t=e()))throw new d("instance of Promise","promiseFn",t)}else{if(!R(e))throw new u("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then((function(){return t})).then((function(){return j})).catch((function(e){return e}))}))}function D(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new u("error",["Object","Error","Function","RegExp"],r);if("object"===o(t)&&null!==t){if(t.message===r)throw new c("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new c("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==o(r)&&"function"!=typeof r)throw new u("error",["Object","Error","Function","RegExp"],r);if(t===j){var i="";r&&r.name&&(i+=" (".concat(r.name,")")),i+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";E({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(i),stackStartFn:e})}if(r&&!k(t,r,n,e))throw t}function L(e,t,r,n){if(t!==j){if("string"==typeof r&&(n=r,r=void 0),!r||k(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";E({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function P(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];N.apply(void 0,[P,t.length].concat(t))}T.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,A(t)].concat(n))},T.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return D.apply(void 0,[e,t].concat(n))}))},T.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];L.apply(void 0,[e,A(t)].concat(n))},T.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then((function(t){return L.apply(void 0,[e,t].concat(n))}))},T.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===o(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=g(t);var n=new p({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),i=t.stack;if("string"==typeof i){var s=i.split("\n");s.shift();for(var a=n.stack.split("\n"),l=0;l<s.length;l++){var c=a.indexOf(s[l]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},T.strict=b(P,T,{equal:T.strictEqual,deepEqual:T.deepStrictEqual,notEqual:T.notStrictEqual,notDeepEqual:T.notDeepStrictEqual}),T.strict.strict=T.strict},6979:(e,t,r)=>{"use strict";var n=r(2530);function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){return!t||"object"!==f(t)&&"function"!=typeof t?a(e):t}function a(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e){var t="function"==typeof Map?new Map:void 0;return l=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return u(e,arguments,d(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),h(n,e)},l(e)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function u(e,t,r){return u=c()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&h(i,r.prototype),i},u.apply(null,arguments)}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function d(e){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},d(e)}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}var p=r(5663).inspect,g=r(8619).codes.ERR_INVALID_ARG_TYPE;function y(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var v="",m="",b="",w="",x={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function _(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach((function(t){r[t]=e[t]})),Object.defineProperty(r,"message",{value:e.message}),r}function T(e){return p(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var j=function(e){function t(e){var r;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),"object"!==f(e)||null===e)throw new g("options","Object",e);var i=e.message,o=e.operator,l=e.stackStartFn,c=e.actual,u=e.expected,h=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=i)r=s(this,d(t).call(this,String(i)));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(v="",m="",w="",b=""):(v="",m="",w="",b="")),"object"===f(c)&&null!==c&&"object"===f(u)&&null!==u&&"stack"in c&&c instanceof Error&&"stack"in u&&u instanceof Error&&(c=_(c),u=_(u)),"deepStrictEqual"===o||"strictEqual"===o)r=s(this,d(t).call(this,function(e,t,r){var i="",o="",s=0,a="",l=!1,c=T(e),u=c.split("\n"),h=T(t).split("\n"),d=0,p="";if("strictEqual"===r&&"object"===f(e)&&"object"===f(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===h.length&&u[0]!==h[0]){var g=u[0].length+h[0].length;if(g<=10){if(!("object"===f(e)&&null!==e||"object"===f(t)&&null!==t||0===e&&0===t))return"".concat(x[r],"\n\n")+"".concat(u[0]," !== ").concat(h[0],"\n")}else if("strictEqualObject"!==r&&g<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][d]===h[0][d];)d++;d>2&&(p="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",d),"^"),d=0)}}for(var _=u[u.length-1],j=h[h.length-1];_===j&&(d++<2?a="\n ".concat(_).concat(a):i=_,u.pop(),h.pop(),0!==u.length&&0!==h.length);)_=u[u.length-1],j=h[h.length-1];var E=Math.max(u.length,h.length);if(0===E){var N=c.split("\n");if(N.length>30)for(N[26]="".concat(v,"...").concat(w);N.length>27;)N.pop();return"".concat(x.notIdentical,"\n\n").concat(N.join("\n"),"\n")}d>3&&(a="\n".concat(v,"...").concat(w).concat(a),l=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var O=0,S=x[r]+"\n".concat(m,"+ actual").concat(w," ").concat(b,"- expected").concat(w),I=" ".concat(v,"...").concat(w," Lines skipped");for(d=0;d<E;d++){var k=d-s;if(u.length<d+1)k>1&&d>2&&(k>4?(o+="\n".concat(v,"...").concat(w),l=!0):k>3&&(o+="\n ".concat(h[d-2]),O++),o+="\n ".concat(h[d-1]),O++),s=d,i+="\n".concat(b,"-").concat(w," ").concat(h[d]),O++;else if(h.length<d+1)k>1&&d>2&&(k>4?(o+="\n".concat(v,"...").concat(w),l=!0):k>3&&(o+="\n ".concat(u[d-2]),O++),o+="\n ".concat(u[d-1]),O++),s=d,o+="\n".concat(m,"+").concat(w," ").concat(u[d]),O++;else{var A=h[d],R=u[d],C=R!==A&&(!y(R,",")||R.slice(0,-1)!==A);C&&y(A,",")&&A.slice(0,-1)===R&&(C=!1,R+=","),C?(k>1&&d>2&&(k>4?(o+="\n".concat(v,"...").concat(w),l=!0):k>3&&(o+="\n ".concat(u[d-2]),O++),o+="\n ".concat(u[d-1]),O++),s=d,o+="\n".concat(m,"+").concat(w," ").concat(R),i+="\n".concat(b,"-").concat(w," ").concat(A),O+=2):(o+=i,i="",1!==k&&0!==d||(o+="\n ".concat(R),O++))}if(O>20&&d<E-2)return"".concat(S).concat(I,"\n").concat(o,"\n").concat(v,"...").concat(w).concat(i,"\n")+"".concat(v,"...").concat(w)}return"".concat(S).concat(l?I:"","\n").concat(o).concat(i).concat(a).concat(p)}(c,u,o)));else if("notDeepStrictEqual"===o||"notStrictEqual"===o){var p=x[o],j=T(c).split("\n");if("notStrictEqual"===o&&"object"===f(c)&&null!==c&&(p=x.notStrictEqualObject),j.length>30)for(j[26]="".concat(v,"...").concat(w);j.length>27;)j.pop();r=1===j.length?s(this,d(t).call(this,"".concat(p," ").concat(j[0]))):s(this,d(t).call(this,"".concat(p,"\n\n").concat(j.join("\n"),"\n")))}else{var E=T(c),N="",O=x[o];"notDeepEqual"===o||"notEqual"===o?(E="".concat(x[o],"\n\n").concat(E)).length>1024&&(E="".concat(E.slice(0,1021),"...")):(N="".concat(T(u)),E.length>512&&(E="".concat(E.slice(0,509),"...")),N.length>512&&(N="".concat(N.slice(0,509),"...")),"deepEqual"===o||"equal"===o?E="".concat(O,"\n\n").concat(E,"\n\nshould equal\n\n"):N=" ".concat(o," ").concat(N)),r=s(this,d(t).call(this,"".concat(E).concat(N)))}return Error.stackTraceLimit=h,r.generatedMessage=!i,Object.defineProperty(a(r),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),r.code="ERR_ASSERTION",r.actual=c,r.expected=u,r.operator=o,Error.captureStackTrace&&Error.captureStackTrace(a(r),l),r.stack,r.name="AssertionError",s(r)}var r,l;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(t,e),r=t,l=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:p.custom,value:function(e,t){return p(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){i(e,t,r[t])}))}return e}({},t,{customInspect:!1,depth:0}))}}],l&&o(r.prototype,l),t}(l(Error));e.exports=j},8619:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e){return i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(e)}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}var s,a,l={};function c(e,t,r){r||(r=Error);var s=function(r){function s(r,o,a){var l;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),l=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}(this,i(s).call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,o,a))),l.code=e,l}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(s,r),s}(r);l[e]=s}function u(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",(function(e,t,i){var o,a,l,c,h;if(void 0===s&&(s=r(6118)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,a.length)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))l="The ".concat(e," ").concat(o," ").concat(u(t,"type"));else{var d=("number"!=typeof h&&(h=0),h+".".length>(c=e).length||-1===c.indexOf(".",h)?"argument":"property");l='The "'.concat(e,'" ').concat(d," ").concat(o," ").concat(u(t,"type"))}return l+". Received type ".concat(n(i))}),TypeError),c("ERR_INVALID_ARG_VALUE",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(5663));var i=a.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)}),TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")}),TypeError),c("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(6118)),s(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map((function(e){return'"'.concat(e,'"')})),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")}),TypeError),e.exports.codes=l},1667:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return r}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}var o=void 0!==/a/g.flags,s=function(e){var t=[];return e.forEach((function(e){return t.push(e)})),t},a=function(e){var t=[];return e.forEach((function(e,r){return t.push([r,e])})),t},l=Object.is?Object.is:r(7402),c=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},u=Number.isNaN?Number.isNaN:r(8622);function h(e){return e.call.bind(e)}var d=h(Object.prototype.hasOwnProperty),f=h(Object.prototype.propertyIsEnumerable),p=h(Object.prototype.toString),g=r(5663).types,y=g.isAnyArrayBuffer,v=g.isArrayBufferView,m=g.isDate,b=g.isMap,w=g.isRegExp,x=g.isSet,_=g.isNativeError,T=g.isBoxedPrimitive,j=g.isNumberObject,E=g.isStringObject,N=g.isBooleanObject,O=g.isBigIntObject,S=g.isSymbolObject,I=g.isFloat32Array,k=g.isFloat64Array;function A(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function R(e){return Object.keys(e).filter(A).concat(c(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function C(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function D(e,t,r,n){if(e===t)return 0!==e||!r||l(e,t);if(r){if("object"!==i(e))return"number"==typeof e&&u(e)&&u(t);if("object"!==i(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==i(e))return(null===t||"object"!==i(t))&&e==t;if(null===t||"object"!==i(t))return!1}var s,a,c,h,d=p(e);if(d!==p(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var f=R(e),g=R(t);return f.length===g.length&&P(e,t,r,n,1,f)}if("[object Object]"===d&&(!b(e)&&b(t)||!x(e)&&x(t)))return!1;if(m(e)){if(!m(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(w(e)){if(!w(t)||(c=e,h=t,!(o?c.source===h.source&&c.flags===h.flags:RegExp.prototype.toString.call(c)===RegExp.prototype.toString.call(h))))return!1}else if(_(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(v(e)){if(r||!I(e)&&!k(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===C(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var A=R(e),D=R(t);return A.length===D.length&&P(e,t,r,n,0,A)}if(x(e))return!(!x(t)||e.size!==t.size)&&P(e,t,r,n,2);if(b(e))return!(!b(t)||e.size!==t.size)&&P(e,t,r,n,3);if(y(e)){if(a=t,(s=e).byteLength!==a.byteLength||0!==C(new Uint8Array(s),new Uint8Array(a)))return!1}else if(T(e)&&!function(e,t){return j(e)?j(t)&&l(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):E(e)?E(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):N(e)?N(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):O(e)?O(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):S(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return P(e,t,r,n,0)}function L(e,t){return t.filter((function(t){return f(e,t)}))}function P(e,t,r,n,i,o){if(5===arguments.length){o=Object.keys(e);var s=Object.keys(t);if(o.length!==s.length)return!1}for(var a=0;a<o.length;a++)if(!d(t,o[a]))return!1;if(r&&5===arguments.length){var l=c(e);if(0!==l.length){var u=0;for(a=0;a<l.length;a++){var h=l[a];if(f(e,h)){if(!f(t,h))return!1;o.push(h),u++}else if(f(t,h))return!1}var p=c(t);if(l.length!==p.length&&L(t,p).length!==u)return!1}else{var g=c(t);if(0!==g.length&&0!==L(t,g).length)return!1}}if(0===o.length&&(0===i||1===i&&0===e.length||0===e.size))return!0;if(void 0===n)n={val1:new Map,val2:new Map,position:0};else{var y=n.val1.get(e);if(void 0!==y){var v=n.val2.get(t);if(void 0!==v)return y===v}n.position++}n.val1.set(e,n.position),n.val2.set(t,n.position);var m=H(e,t,r,o,n,i);return n.val1.delete(e),n.val2.delete(t),m}function M(e,t,r,n){for(var i=s(e),o=0;o<i.length;o++){var a=i[o];if(D(t,a,r,n))return e.delete(a),!0}return!1}function F(e){switch(i(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(u(e))return!1}return!0}function U(e,t,r){var n=F(r);return null!=n?n:t.has(n)&&!e.has(n)}function B(e,t,r,n,i){var o=F(r);if(null!=o)return o;var s=t.get(o);return!(void 0===s&&!t.has(o)||!D(n,s,!1,i))&&!e.has(o)&&D(n,s,!1,i)}function q(e,t,r,n,i,o){for(var a=s(e),l=0;l<a.length;l++){var c=a[l];if(D(r,c,i,o)&&D(n,t.get(c),i,o))return e.delete(c),!0}return!1}function H(e,t,r,o,l,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var o=null,a=s(e),l=0;l<a.length;l++){var c=a[l];if("object"===i(c)&&null!==c)null===o&&(o=new Set),o.add(c);else if(!t.has(c)){if(r)return!1;if(!U(e,t,c))return!1;null===o&&(o=new Set),o.add(c)}}if(null!==o){for(var u=s(t),h=0;h<u.length;h++){var d=u[h];if("object"===i(d)&&null!==d){if(!M(o,d,r,n))return!1}else if(!r&&!e.has(d)&&!M(o,d,r,n))return!1}return 0===o.size}return!0}(e,t,r,l))return!1}else if(3===c){if(!function(e,t,r,o){for(var s=null,l=a(e),c=0;c<l.length;c++){var u=n(l[c],2),h=u[0],d=u[1];if("object"===i(h)&&null!==h)null===s&&(s=new Set),s.add(h);else{var f=t.get(h);if(void 0===f&&!t.has(h)||!D(d,f,r,o)){if(r)return!1;if(!B(e,t,h,d,o))return!1;null===s&&(s=new Set),s.add(h)}}}if(null!==s){for(var p=a(t),g=0;g<p.length;g++){var y=n(p[g],2),v=(h=y[0],y[1]);if("object"===i(h)&&null!==h){if(!q(s,e,h,v,r,o))return!1}else if(!(r||e.has(h)&&D(e.get(h),v,!1,o)||q(s,e,h,v,!1,o)))return!1}return 0===s.size}return!0}(e,t,r,l))return!1}else if(1===c)for(;u<e.length;u++){if(!d(e,u)){if(d(t,u))return!1;for(var h=Object.keys(e);u<h.length;u++){var f=h[u];if(!d(t,f)||!D(e[f],t[f],r,l))return!1}return h.length===Object.keys(t).length}if(!d(t,u)||!D(e[u],t[u],r,l))return!1}for(u=0;u<o.length;u++){var p=o[u];if(!D(e[p],t[p],r,l))return!1}return!0}e.exports={isDeepEqual:function(e,t){return D(e,t,!1)},isDeepStrictEqual:function(e,t){return D(e,t,!0)}}},5155:(e,t)=>{"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=l(e),s=o[0],a=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,a)),u=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;a<l;a+=s)o.push(c(e,a,a+s>l?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function l(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e,t,n){for(var i,o,s=[],a=t;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(r[(o=i)>>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},2486:(e,t,r)=>{"use strict";var n=r(292);const i=r(5155),o=r(4525),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.lW=c,t.h2=50;const a=2147483647;function l(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return u(e,t,r)}function u(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=l(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|g(e.length),r=l(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||W(e.length)?l(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return h(e),l(e<0?0:0|g(e))}function f(e){const t=e.length<0?0:0|g(e.length),r=l(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function g(e){if(e>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function y(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(e).length;default:if(i)return n?-1:G(e).length;t=(""+t).toLowerCase(),i=!0}}function v(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,r);case"utf8":case"utf-8":return O(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return N(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),W(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function x(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(W(n))return s;e[r+s]=n}return s}function _(e,t,r,n){return X(G(t,e.length-r),e,r,n)}function T(e,t,r,n){return X(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function j(e,t,r,n){return X(J(t),e,r,n)}function E(e,t,r,n){return X(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function N(e,t,r){return 0===t&&r===e.length?i.fromByteArray(e):i.fromByteArray(e.slice(t,r))}function O(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=S)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=S));return r}(n)}c.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),c.TYPED_ARRAY_SUPPORT||void 0===n||"function"!=typeof n.error||n.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return u(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return h(e),e<=0?l(e):void 0!==t?"string"==typeof r?l(e).fill(t,r):l(e).fill(t):l(e)}(e,t,r)},c.allocUnsafe=function(e){return d(e)},c.allocUnsafeSlow=function(e){return d(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?O(this,0,e):v.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.h2;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},s&&(c.prototype[s]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==u[e]){o=l[e],s=u[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return _(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return j(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const S=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function A(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function R(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function D(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function P(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function U(e,t,r,n,i){return t=+t,r>>>=0,i||M(e,0,r,8),o.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=K((function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))})),c.prototype.readBigUInt64BE=K((function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=K((function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),c.prototype.readBigInt64BE=K((function(e){Z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)})),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),o.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),o.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||D(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigUInt64LE=K((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=K((function(e,t=0){return P(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);D(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||D(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeBigInt64LE=K((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=K((function(e,t=0){return P(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return U(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return U(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const B={};function q(e,t,r){B[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function H(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function $(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){Z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function Z(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw Z(e,r),new B.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}q("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),q("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),q("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=H(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=H(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const z=/[^+/0-9A-Za-z-_]/g;function G(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function J(e){return i.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function X(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function W(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function K(e){return"undefined"==typeof BigInt?ee:e}function ee(){throw new Error("BigInt not supported")}},7615:(e,t,r)=>{"use strict";var n=r(1801),i=r(2550),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},2550:(e,t,r)=>{"use strict";var n=r(1930),i=r(1801),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),l=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),u=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(e){c=null}e.exports=function(e){var t=a(n,s,arguments);if(l&&c){var r=l(t,"length");r.configurable&&c(t,"length",{value:1+u(0,e.length-(arguments.length-1))})}return t};var h=function(){return a(n,o,arguments)};c?c(e.exports,"apply",{value:h}):e.exports.apply=h},8981:e=>{"use strict";e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>void 0===t[n]||"symbol"==typeof t[n]?r:r+(0===r.length?"":",")+e(n)+":"+e(t[n])),"")+"}"}},292:(e,t,r)=>{var n=r(5663),i=r(6118);function o(){return(new Date).getTime()}var s,a=Array.prototype.slice,l={};s=void 0!==r.g&&r.g.console?r.g.console:"undefined"!=typeof window&&window.console?window.console:{};for(var c=[[function(){},"log"],[function(){s.log.apply(s,arguments)},"info"],[function(){s.log.apply(s,arguments)},"warn"],[function(){s.warn.apply(s,arguments)},"error"],[function(e){l[e]=o()},"time"],[function(e){var t=l[e];if(!t)throw new Error("No such label: "+e);delete l[e];var r=o()-t;s.log(e+": "+r+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=n.format.apply(null,arguments),s.error(e.stack)},"trace"],[function(e){s.log(n.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=a.call(arguments,1);i.ok(!1,n.format.apply(null,t))}},"assert"]],u=0;u<c.length;u++){var h=c[u],d=h[0],f=h[1];s[f]||(s[f]=d)}e.exports=s},7297:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function c(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function u(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function y(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=y(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=y(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e,t,r,n=f(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=p(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=c(e),t=u(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[c(e)]},d.prototype.get=function(e){return e=c(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(c(e))},d.prototype.set=function(e,t){this.map[c(e)]=u(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function b(e,t){var r,n,i=(t=t||{}).body;if(e instanceof b){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),m.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}b.prototype.clone=function(){return new b(this,{body:this._bodyInit})},v.call(b.prototype),v.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var _=[301,302,303,307,308];x.redirect=function(e,t){if(-1===_.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function T(e,r){return new Promise((function(n,o){var s=new b(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function l(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new x(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",l),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",l)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}T.polyfill=!0,e.fetch||(e.fetch=T,e.Headers=d,e.Request=b,e.Response=x),t.Headers=d,t.Request=b,t.Response=x,t.fetch=T,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},9170:(e,t,r)=>{"use strict";var n=r(806),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=Object.defineProperty,l=r(8198)(),c=a&&l,u=function(e,t,r,n){var i;(!(t in e)||"function"==typeof(i=n)&&"[object Function]"===o.call(i)&&n())&&(c?a(e,t,{configurable:!0,enumerable:!1,value:r,writable:!0}):e[t]=r)},h=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)u(e,o[a],t[o[a]],r[o[a]])};h.supportsDescriptors=!!c,e.exports=h},1662:e=>{"use strict";function t(e,t){if(null==e)throw new TypeError("Cannot convert first argument to object");for(var r=Object(e),n=1;n<arguments.length;n++){var i=arguments[n];if(null!=i)for(var o=Object.keys(Object(i)),s=0,a=o.length;s<a;s++){var l=o[s],c=Object.getOwnPropertyDescriptor(i,l);void 0!==c&&c.enumerable&&(r[l]=i[l])}}return r}e.exports={assign:t,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:t})}}},4843:(e,t,r)=>{"use strict";var n=r(5443),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty,s=function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},a=function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},l=function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var o;arguments.length>=3&&(o=r),"[object Array]"===i.call(e)?s(e,t,o):"string"==typeof e?a(e,t,o):l(e,t,o)}},9930:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(t+o);for(var s,a=r.call(arguments,1),l=function(){if(this instanceof s){var t=o.apply(this,a.concat(r.call(arguments)));return Object(t)===t?t:this}return o.apply(e,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),u=[],h=0;h<c;h++)u.push("$"+h);if(s=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")(l),o.prototype){var d=function(){};d.prototype=o.prototype,s.prototype=new d,d.prototype=null}return s}},1930:(e,t,r)=>{"use strict";var n=r(9930);e.exports=Function.prototype.bind||n},1801:(e,t,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},l=Object.getOwnPropertyDescriptor;if(l)try{l({},"")}catch(e){l=null}var c=function(){throw new s},u=l?function(){try{return c}catch(e){try{return l(arguments,"callee").get}catch(e){return c}}}():c,h=r(9905)(),d=Object.getPrototypeOf||function(e){return e.__proto__},f={},p="undefined"==typeof Uint8Array?n:d(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":h?d([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":f,"%AsyncGenerator%":f,"%AsyncGeneratorFunction%":f,"%AsyncIteratorPrototype%":f,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":f,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h?d(d([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&h?d((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&h?d((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h?d(""[Symbol.iterator]()):n,"%Symbol%":h?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":u,"%TypedArray%":p,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},y=function e(t){var r;if("%AsyncFunction%"===t)r=a("async function () {}");else if("%GeneratorFunction%"===t)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&(r=d(i.prototype))}return g[t]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},m=r(1930),b=r(9284),w=m.call(Function.call,Array.prototype.concat),x=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),T=m.call(Function.call,String.prototype.slice),j=m.call(Function.call,RegExp.prototype.exec),E=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,N=/\\(\\)?/g,O=function(e){var t=T(e,0,1),r=T(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(e,E,(function(e,t,r,i){n[n.length]=r?_(i,N,"$1"):t||e})),n},S=function(e,t){var r,n=e;if(b(v,n)&&(n="%"+(r=v[n])[0]+"%"),b(g,n)){var o=g[n];if(o===f&&(o=y(n)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=O(e),n=r.length>0?r[0]:"",o=S("%"+n+"%",t),a=o.name,c=o.value,u=!1,h=o.alias;h&&(n=h[0],x(r,w([0,1],h)));for(var d=1,f=!0;d<r.length;d+=1){var p=r[d],y=T(p,0,1),v=T(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===v||"'"===v||"`"===v)&&y!==v)throw new i("property names with quotes must have matching quotes");if("constructor"!==p&&f||(u=!0),b(g,a="%"+(n+="."+p)+"%"))c=g[a];else if(null!=c){if(!(p in c)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(l&&d+1>=r.length){var m=l(c,p);c=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[p]}else f=b(c,p),c=c[p];f&&!u&&(g[a]=c)}}return c}},3828:(e,t,r)=>{"use strict";var n=r(1801)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},8198:(e,t,r)=>{"use strict";var n=r(1801)("%Object.defineProperty%",!0),i=function(){if(n)try{return n({},"a",{value:1}),!0}catch(e){return!1}return!1};i.hasArrayLengthDefineBug=function(){if(!i())return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},9905:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5682);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5682:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},4111:(e,t,r)=>{"use strict";var n=r(5682);e.exports=function(){return n()&&!!Symbol.toStringTag}},9284:(e,t,r)=>{"use strict";var n=r(1930);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},4525:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,c=l>>1,u=-7,h=r?i-1:0,d=r?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=d,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=c}return(f?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,h=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?d/l:d*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+f]=255&s,f+=p,s/=256,c-=8);e[r+f-p]|=128*g}},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},7092:(e,t,r)=>{"use strict";var n=r(4111)(),i=r(7615)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},5443:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var d=document.all;l.call(d)===l.call(document.all)&&(h=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(h(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},7427:(e,t,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(4111)(),l=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(e);if(!l)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&l(t)}return l(e)===n}},2100:e=>{"use strict";e.exports=function(e){return e!=e}},8622:(e,t,r)=>{"use strict";var n=r(2550),i=r(9170),o=r(2100),s=r(4358),a=r(6232),l=n(s(),Number);i(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},4358:(e,t,r)=>{"use strict";var n=r(2100);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6232:(e,t,r)=>{"use strict";var n=r(9170),i=r(4358);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2527:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=o("Object.prototype.toString"),a=r(4111)(),l=r(3828),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},d=o("String.prototype.slice"),f={},p=Object.getPrototypeOf;a&&l&&p&&n(u,(function(e){var t=new c[e];if(Symbol.toStringTag in t){var r=p(t),n=l(r,Symbol.toStringTag);if(!n){var i=p(r);n=l(i,Symbol.toStringTag)}f[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!a||!(Symbol.toStringTag in e)){var t=d(s(e),8,-1);return h(u,t)>-1}return!!l&&function(e){var t=!1;return n(f,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},5777:(e,t,r)=>{"use strict";const{isArray:n,isObject:i,isString:o}=r(8285),{asArray:s}=r(4768),{prependBase:a}=r(3866),l=r(9699),c=r(1898);function u(e){throw new l("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:e})}function h({context:e,base:t}){if(!e)return;const r=e["@context"];if(o(r))e["@context"]=a(t,r);else if(n(r))for(let e=0;e<r.length;++e){const n=r[e];o(n)?r[e]=a(t,n):i(n)&&h({context:{"@context":n},base:t})}else if(i(r))for(const e in r)h({context:r[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:r,base:a,cycles:l=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=s(t);const h=[];for(const s of t){if(o(s)){let t=this._get(s);t||(t=await this._resolveRemoteContext({activeCtx:e,url:s,documentLoader:r,base:a,cycles:l})),n(t)?h.push(...t):h.push(t);continue}if(null===s){h.push(new c({document:null}));continue}i(s)||u(t);const d=JSON.stringify(s);let f=this._get(d);f||(f=new c({document:s}),this._cacheResolvedContext({key:d,resolved:f,tag:"static"})),h.push(f)}return h}_get(e){let t=this.perOpCache.get(e);if(!t){const r=this.sharedCache.get(e);r&&(t=r.get("static"),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:r}){if(this.perOpCache.set(e,t),void 0!==r){let n=this.sharedCache.get(e);n||(n=new Map,this.sharedCache.set(e,n)),n.set(r,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:r,base:n,cycles:i}){t=a(n,t);const{context:o,remoteDoc:s}=await this._fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:i});h({context:o,base:n=s.documentUrl||t});const l=await this.resolve({activeCtx:e,context:o,documentLoader:r,base:n,cycles:i});return this._cacheResolvedContext({key:t,resolved:l,tag:s.tag}),l}async _fetchContext({activeCtx:e,url:t,documentLoader:r,cycles:s}){if(s.size>10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(s.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let a,c;s.add(t);try{c=await r(t),a=c.document||null,o(a)&&(a=JSON.parse(a))}catch(e){throw new l("Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context.","jsonld.InvalidUrl",{code:"loading remote context failed",url:t,cause:e})}if(!i(a))throw new l("Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object.","jsonld.InvalidUrl",{code:"invalid remote context",url:t});return a="@context"in a?{"@context":a["@context"]}:{"@context":{}},c.contextUrl&&(n(a["@context"])||(a["@context"]=[a["@context"]]),a["@context"].push(c.contextUrl)),{context:a,remoteDoc:c}}}},9699:e=>{"use strict";e.exports=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",r={}){super(e),this.name=t,this.message=e,this.details=r}}},7298:e=>{"use strict";e.exports=e=>{class t{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):e.compact(t,r)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},7990:(e,t,r)=>{"use strict";e.exports=r(2948).NQuads},3114:e=>{"use strict";e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},1898:(e,t,r)=>{"use strict";const n=r(3666);e.exports=class{constructor({document:e}){this.document=e,this.cache=new n({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},120:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isString:s,isUndefined:a}=r(8285),{isList:l,isValue:c,isGraph:u,isSimpleGraph:h,isSubjectReference:d}=r(478),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:v}=r(2182),{removeBase:m,prependBase:b}=r(3866),{REGEX_KEYWORD:w,addValue:x,asArray:_,compareShortestLeast:T}=r(4768),j={};function E(e,t,r){if("@nest"!==f(e,t,{vocab:!0},r))throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=j,j.compact=async({activeCtx:e,activeProperty:t=null,element:r,options:f={}})=>{if(i(r)){let n=[];for(let i=0;i<r.length;++i){const o=await j.compact({activeCtx:e,activeProperty:t,element:r[i],options:f});null!==o&&n.push(o)}return f.compactArrays&&1===n.length&&0===(p(e,t,"@container")||[]).length&&(n=n[0]),n}const m=p(e,t,"@context");if(a(m)||(e=await y({activeCtx:e,localCtx:m,propagate:!0,overrideProtected:!0,options:f})),o(r)){if(f.link&&"@id"in r&&f.link.hasOwnProperty(r["@id"])){const e=f.link[r["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===r)return e[t].compacted}if(c(r)||d(r)){const n=j.compactValue({activeCtx:e,activeProperty:t,value:r,options:f});return f.link&&d(r)&&(f.link.hasOwnProperty(r["@id"])||(f.link[r["@id"]]=[]),f.link[r["@id"]].push({expanded:r,compacted:n})),n}if(l(r)&&(p(e,t,"@container")||[]).includes("@list"))return j.compact({activeCtx:e,activeProperty:t,element:r["@list"],options:f});const m="@reverse"===t,b={},w=e;c(r)||d(r)||(e=e.revertToPreviousContext());const T=p(w,t,"@context");a(T)||(e=await y({activeCtx:e,localCtx:T,propagate:!0,overrideProtected:!0,options:f})),f.link&&"@id"in r&&(f.link.hasOwnProperty(r["@id"])||(f.link[r["@id"]]=[]),f.link[r["@id"]].push({expanded:r,compacted:b}));let N=r["@type"]||[];N.length>1&&(N=Array.from(N).sort());const O=e;for(const t of N){const r=j.compactIri({activeCtx:O,iri:t,relativeTo:{vocab:!0}}),n=p(w,r,"@context");a(n)||(e=await y({activeCtx:e,localCtx:n,options:f,propagate:!1}))}const S=Object.keys(r).sort();for(const a of S){const d=r[a];if("@id"!==a)if("@type"!==a)if("@reverse"!==a)if("@preserve"!==a)if("@index"!==a)if("@graph"!==a&&"@list"!==a&&"@included"!==a&&g(a)){const t=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,t,d)}else{if(!i(d))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===d.length){const t=j.compactIri({activeCtx:e,iri:a,value:d,relativeTo:{vocab:!0},reverse:m}),r=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let n=b;r&&(E(e,r,f),o(b[r])||(b[r]={}),n=b[r]),x(n,t,d,{propertyIsArray:!0})}for(const t of d){const r=j.compactIri({activeCtx:e,iri:a,value:t,relativeTo:{vocab:!0},reverse:m}),n=e.mappings.has(r)?e.mappings.get(r)["@nest"]:null;let d=b;n&&(E(e,n,f),o(b[n])||(b[n]={}),d=b[n]);const g=p(e,r,"@container")||[],y=u(t),v=l(t);let w;v?w=t["@list"]:y&&(w=t["@graph"]);let T=await j.compact({activeCtx:e,activeProperty:r,element:v||y?w:t,options:f});if(v){if(i(T)||(T=[T]),g.includes("@list")){x(d,r,T,{valueIsArray:!0,allowDuplicate:!0});continue}T={[j.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:T},"@index"in t&&(T[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(y)if(g.includes("@graph")&&(g.includes("@id")||g.includes("@index")&&h(t))){let n;d.hasOwnProperty(r)?n=d[r]:d[r]=n={};const i=(g.includes("@id")?t["@id"]:t["@index"])||j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});x(n,i,T,{propertyIsArray:!f.compactArrays||g.includes("@set")})}else g.includes("@graph")&&h(t)?(i(T)&&T.length>1&&(T={"@included":T}),x(d,r,T,{propertyIsArray:!f.compactArrays||g.includes("@set")})):(i(T)&&1===T.length&&f.compactArrays&&(T=T[0]),T={[j.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:T},"@id"in t&&(T[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(T[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),x(d,r,T,{propertyIsArray:!f.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let n,i;if(d.hasOwnProperty(r)?n=d[r]:d[r]=n={},g.includes("@language"))c(T)&&(T=T["@value"]),i=t["@language"];else if(g.includes("@index")){const n=p(e,r,"@index")||"@index",o=j.compactIri({activeCtx:e,iri:n,relativeTo:{vocab:!0}});if("@index"===n)i=t["@index"],delete T[o];else{let e;if([i,...e]=_(T[n]||[]),s(i))switch(e.length){case 0:delete T[n];break;case 1:T[n]=e[0];break;default:T[n]=e}else i=null}}else if(g.includes("@id")){const t=j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=T[t],delete T[t]}else if(g.includes("@type")){const n=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let o;switch([i,...o]=_(T[n]||[]),o.length){case 0:delete T[n];break;case 1:T[n]=o[0];break;default:T[n]=o}1===Object.keys(T).length&&"@id"in t&&(T=await j.compact({activeCtx:e,activeProperty:r,element:{"@id":t["@id"]},options:f}))}i||(i=j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),x(n,i,T,{propertyIsArray:g.includes("@set")})}else{const e=!f.compactArrays||g.includes("@set")||g.includes("@list")||i(T)&&0===T.length||"@list"===a||"@graph"===a;x(d,r,T,{propertyIsArray:e})}}}else{if((p(e,t,"@container")||[]).includes("@index"))continue;const r=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,d)}else{const r=await j.compact({activeCtx:e,activeProperty:t,element:d,options:f});i(r)&&0===r.length||x(b,a,r)}else{const t=await j.compact({activeCtx:e,activeProperty:"@reverse",element:d,options:f});for(const r in t)if(e.mappings.has(r)&&e.mappings.get(r).reverse){const n=t[r],i=(p(e,r,"@container")||[]).includes("@set")||!f.compactArrays;x(b,r,n,{propertyIsArray:i}),delete t[r]}if(Object.keys(t).length>0){const r=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});x(b,r,t)}}else{let t=_(d).map((e=>j.compactIri({activeCtx:w,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const r=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),n=(p(e,r,"@container")||[]).includes("@set")&&v(e,1.1)||i(t)&&0===d.length;x(b,r,t,{propertyIsArray:n})}else{let t=_(d).map((t=>j.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:f.base})));1===t.length&&(t=t[0]),b[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return b}return r},j.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:i={vocab:!1},reverse:s=!1,base:a=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const h=e.getInverse();if(g(t)&&t in h&&"@none"in h[t]&&"@type"in h[t]["@none"]&&"@none"in h[t]["@none"]["@type"])return h[t]["@none"]["@type"]["@none"];if(i.vocab&&t in h){const n=e["@language"]||"@none",i=[];o(r)&&"@index"in r&&!("@graph"in r)&&i.push("@index","@index@set"),o(r)&&"@preserve"in r&&(r=r["@preserve"][0]),u(r)?("@index"in r&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in r||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in r||i.push("@graph@id","@graph@id@set")):o(r)&&!c(r)&&i.push("@id","@id@set","@type","@set@type");let a="@language",h="@null";if(s)a="@type",h="@reverse",i.push("@set");else if(l(r)){"@index"in r||i.push("@list");const e=r["@list"];if(0===e.length)a="@any",h="@none";else{let t=0===e.length?n:null,r=null;for(let n=0;n<e.length;++n){const i=e[n];let o="@none",s="@none";if(c(i)?"@direction"in i?o=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?o=i["@language"].toLowerCase():"@type"in i?s=i["@type"]:o="@null":s="@id",null===t?t=o:o!==t&&c(i)&&(t="@none"),null===r?r=s:s!==r&&(r="@none"),"@none"===t&&"@none"===r)break}t=t||"@none",r=r||"@none","@none"!==r?(a="@type",h=r):h=t}}else{if(c(r))if("@language"in r&&!("@index"in r)){i.push("@language","@language@set"),h=r["@language"];const e=r["@direction"];e&&(h=`${h}_${e}`)}else"@direction"in r&&!("@index"in r)?h=`_${r["@direction"]}`:"@type"in r&&(a="@type",h=r["@type"]);else a="@type",h="@id";i.push("@set")}i.push("@none"),o(r)&&!("@index"in r)&&i.push("@index","@index@set"),c(r)&&1===Object.keys(r).length&&i.push("@language","@language@set");const d=function(e,t,r,n,i,s){null===s&&(s="@null");const a=[];if(("@id"===s||"@reverse"===s)&&o(r)&&"@id"in r){"@reverse"===s&&a.push("@reverse");const t=j.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===r["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(s);const e=a.find((e=>e.includes("_")));e&&a.push(e.replace(/^[^_]+_/,"_"))}a.push("@none");const l=e.inverse[t];for(const e of n){if(!(e in l))continue;const t=l[e][i];for(const e of a)if(e in t)return t[e]}return null}(e,t,r,i,a,h);if(null!==d)return d}if(i.vocab&&"@vocab"in e){const r=e["@vocab"];if(0===t.indexOf(r)&&t!==r){const n=t.substr(r.length);if(!e.mappings.has(n))return n}}let d=null;const f=[];let p=e.fastCurieMap;const y=t.length-1;for(let e=0;e<y&&t[e]in p;++e)p=p[t[e]],""in p&&f.push(p[""][0]);for(let n=f.length-1;n>=0;--n){const i=f[n],o=i.terms;for(const n of o){const o=n+":"+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(o)||null===r&&e.mappings.get(o)["@id"]===t)&&(null===d||T(o,d)<0)&&(d=o)}}if(null!==d)return d;for(const[r,i]of e.mappings)if(i&&i._prefix&&t.startsWith(r+":"))throw new n(`Absolute IRI "${t}" confused with prefix "${r}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const r=m(b(a,e["@base"]),t);return w.test(r)?`./${r}`:r}return t}return m(a,t)}return t},j.compactValue=({activeCtx:e,activeProperty:t,value:r,options:n})=>{if(c(r)){const n=p(e,t,"@type"),i=p(e,t,"@language"),o=p(e,t,"@direction"),a=p(e,t,"@container")||[],l="@index"in r&&!a.includes("@index");if(!l&&"@none"!==n){if(r["@type"]===n)return r["@value"];if("@language"in r&&r["@language"]===i&&"@direction"in r&&r["@direction"]===o)return r["@value"];if("@language"in r&&r["@language"]===i)return r["@value"];if("@direction"in r&&r["@direction"]===o)return r["@value"]}const c=Object.keys(r).length,u=1===c||2===c&&"@index"in r&&!l,h="@language"in e,d=s(r["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(u&&"@none"!==n&&(!h||!d||f))return r["@value"];const g={};return l&&(g[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=r["@index"]),"@type"in r?g[j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=j.compactIri({activeCtx:e,iri:r["@type"],relativeTo:{vocab:!0}}):"@language"in r&&(g[j.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=r["@language"]),"@direction"in r&&(g[j.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=r["@direction"]),g[j.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=r["@value"],g}const i=f(e,t,{vocab:!0},n),o=p(e,t,"@type"),a=j.compactIri({activeCtx:e,iri:r["@id"],relativeTo:{vocab:"@vocab"===o},base:n.base});return"@id"===o||"@vocab"===o||"@graph"===i?a:{[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},2445:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",r="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:r,XSD_BOOLEAN:r+"boolean",XSD_DOUBLE:r+"double",XSD_INTEGER:r+"integer",XSD_STRING:r+"string"}},2182:(e,t,r)=>{"use strict";const n=r(4768),i=r(9699),{isArray:o,isObject:s,isString:a,isUndefined:l}=r(8285),{isAbsolute:c,isRelative:u,prependBase:h}=r(3866),{handleEvent:d}=r(5746),{REGEX_BCP47:f,REGEX_KEYWORD:p,asArray:g,compareShortestLeast:y}=r(4768),v=new Map,m={};function b(e,t,r,n,i,o){if(null===t||!a(t)||m.isKeyword(t))return t;if(t.match(p))return null;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&m.createTermDefinition({activeCtx:e,localCtx:n,term:t,defined:i,options:o}),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(s(r)&&"@id"in r)return r["@id"]}const l=t.indexOf(":");if(l>0){const r=t.substr(0,l),s=t.substr(l+1);if("_"===r||0===s.indexOf("//"))return t;n&&n.hasOwnProperty(r)&&m.createTermDefinition({activeCtx:e,localCtx:n,term:r,defined:i,options:o});const a=e.mappings.get(r);if(a&&a._prefix)return a["@id"]+s;if(c(t))return t}if(r.vocab&&"@vocab"in e)t=e["@vocab"]+t;else if(r.base){let r,n;"@base"in e?e["@base"]?(n=h(o.base,e["@base"]),r=h(n,t)):(n=e["@base"],r=t):(n=o.base,r=h(o.base,t)),t=r}return t}function w(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const r=Array.isArray(e);if(r!==Array.isArray(t))return!1;if(r){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!w(e[r],t[r]))return!1;return!0}const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r in e){let n=e[r],i=t[r];if("@container"===r&&Array.isArray(n)&&Array.isArray(i)&&(n=n.slice().sort(),i=i.slice().sort()),!w(n,i))return!1}return!0}e.exports=m,m.process=async({activeCtx:e,localCtx:t,options:r,propagate:n=!0,overrideProtected:l=!1,cycles:p=new Set})=>{if(s(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]),0===g(t).length)return e;const y=[],v=[({event:e,next:t})=>{y.push(e),t()}];r.eventHandler&&v.push(r.eventHandler);const w=r;r={...r,eventHandler:v};const x=await r.contextResolver.resolve({activeCtx:e,context:t,documentLoader:r.documentLoader,base:r.base});s(x[0].document)&&"boolean"==typeof x[0].document["@propagate"]&&(n=x[0].document["@propagate"]);let _=e;n||_.previousContext||(_=_.clone(),_.previousContext=e);for(const n of x){let{document:o}=n;if(e=_,null===o){if(!l&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});_=e=m.getInitialContext(r).clone();continue}const g=n.getProcessed(e);if(g){if(w.eventHandler)for(const e of g.events)d({event:e,options:w});_=e=g.context;continue}if(s(o)&&"@context"in o&&(o=o["@context"]),!s(o))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:o});_=_.clone();const v=new Map;if("@version"in o){if(1.1!==o["@version"])throw new i("Unsupported JSON-LD version: "+o["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:o});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+o["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:o});_.processingMode="json-ld-1.1",_["@version"]=o["@version"],v.set("@version",!0)}if(_.processingMode=_.processingMode||e.processingMode,"@base"in o){let e=o["@base"];if(null===e||c(e));else{if(!u(e))throw new i('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:o});e=h(_["@base"],e)}_["@base"]=e,v.set("@base",!0)}if("@vocab"in o){const e=o["@vocab"];if(null===e)delete _["@vocab"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:o});if(!c(e)&&m.processingMode(_,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:o});{const t=b(_,e,{vocab:!0,base:!0},void 0,void 0,r);c(t)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:r}),_["@vocab"]=t}}v.set("@vocab",!0)}if("@language"in o){const e=o["@language"];if(null===e)delete _["@language"];else{if(!a(e))throw new i('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:o});e.match(f)||r.eventHandler&&d({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:r}),_["@language"]=e.toLowerCase()}v.set("@language",!0)}if("@direction"in o){const t=o["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:o});if(null===t)delete _["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:o});_["@direction"]=t}v.set("@direction",!0)}if("@propagate"in o){const r=o["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:o});if("boolean"!=typeof r)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});v.set("@propagate",!0)}if("@import"in o){const n=o["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:o});if(!a(n))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const s=await r.contextResolver.resolve({activeCtx:e,context:n,documentLoader:r.documentLoader,base:r.base});if(1!==s.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=s[0].getProcessed(e);if(l)o=l;else{const r=s[0].document;if("@import"in r)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in r)o.hasOwnProperty(e)||(o[e]=r[e]);s[0].setProcessed(e,o)}v.set("@import",!0)}v.set("@protected",o["@protected"]||!1);for(const e in o)if(m.createTermDefinition({activeCtx:_,localCtx:o,term:e,defined:v,options:r,overrideProtected:l}),s(o[e])&&"@context"in o[e]){const t=o[e]["@context"];let n=!0;if(a(t)){const e=h(r.base,t);p.has(e)?n=!1:p.add(e)}if(n)try{await m.process({activeCtx:_.clone(),localCtx:o[e]["@context"],overrideProtected:!0,options:r,cycles:p})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:o[e]["@context"],term:e})}}n.setProcessed(e,{context:_,events:y})}return _},m.createTermDefinition=({activeCtx:e,localCtx:t,term:r,defined:n,options:l,overrideProtected:u=!1})=>{if(n.has(r)){if(n.get(r))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}let h;if(n.set(r,!1),t.hasOwnProperty(r)&&(h=t[r]),"@type"===r&&s(h)&&"@set"===(h["@container"]||"@set")&&m.processingMode(e,1.1)){const e=["@container","@id","@protected"],n=Object.keys(h);if(0===n.length||n.some((t=>!e.includes(t))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r})}else{if(m.isKeyword(r))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(r.match(p))return void(l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:r}},options:l}));if(""===r)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const f=e.mappings.get(r);e.mappings.has(r)&&e.mappings.delete(r);let g=!1;if((a(h)||null===h)&&(g=!0,h={"@id":h}),!s(h))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const y={};e.mappings.set(r,y),y.reverse=!1;const v=["@container","@id","@language","@reverse","@type"];m.processingMode(e,1.1)&&v.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in h)if(!v.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const x=r.indexOf(":");if(y._termHasColon=x>0,"@reverse"in h){if("@id"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in h)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const o=h["@reverse"];if(!a(o))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(o.match(p))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:o}},options:l}),void(f?e.mappings.set(r,f):e.mappings.delete(r));const s=b(e,o,{vocab:!0,base:!1},t,n,l);if(!c(s))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=s,y.reverse=!0}else if("@id"in h){let o=h["@id"];if(o&&!a(o))throw new i("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(null===o)y["@id"]=null;else{if(!m.isKeyword(o)&&o.match(p))return l.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:o}},options:l}),void(f?e.mappings.set(r,f):e.mappings.delete(r));if(o!==r){if(o=b(e,o,{vocab:!0,base:!1},t,n,l),!c(o)&&!m.isKeyword(o))throw new i("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(r.match(/(?::[^:])|\//)&&b(e,r,{vocab:!0,base:!1},t,new Map(n).set(r,!0),l)!==o)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=o,y._prefix=g&&!y._termHasColon&&o.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const i=r.substr(0,x);if(t.hasOwnProperty(i)&&m.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:n,options:l}),e.mappings.has(i)){const t=r.substr(x+1);y["@id"]=e.mappings.get(i)["@id"]+t}else y["@id"]=r}else if("@type"===r)y["@id"]=r;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});y["@id"]=e["@vocab"]+r}if((!0===h["@protected"]||!0===n.get("@protected")&&!1!==h["@protected"])&&(e.protected[r]=!0,y.protected=!0),n.set(r,!0),"@type"in h){let r=h["@type"];if(!a(r))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===r||"@none"===r){if(m.processingMode(e,1))throw new i(`Invalid JSON-LD syntax; an @context @type value must not be "${r}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else if("@id"!==r&&"@vocab"!==r){if(r=b(e,r,{vocab:!0,base:!1},t,n,l),!c(r))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===r.indexOf("_:"))throw new i("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}y["@type"]=r}if("@container"in h){const r=a(h["@container"])?[h["@container"]]:h["@container"]||[],n=["@list","@set","@index","@language"];let s=!0;const l=r.includes("@set");if(m.processingMode(e,1.1)){if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.length)throw new i("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else if(r.includes("@graph")){if(r.some((e=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new i("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:t})}else s&=r.length<=(l?2:1);if(r.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else s&=!o(h["@container"]),s&=r.length<=1;if(s&=r.every((e=>n.includes(e))),s&=!(l&&r.includes("@list")),!s)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(y.reverse&&!r.every((e=>["@index","@set"].includes(e))))throw new i("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});y["@container"]=r}if("@index"in h){if(!("@container"in h)||!y["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!a(h["@index"])||0===h["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${h["@index"]}" on term "${r}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=h["@index"]}if("@context"in h&&(y["@context"]=h["@context"]),"@language"in h&&!("@type"in h)){let e=h["@language"];if(null!==e&&!a(e))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),y["@language"]=e}if("@prefix"in h){if(r.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(m.isKeyword(y["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof h["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});y._prefix=!0===h["@prefix"]}if("@direction"in h){const e=h["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});y["@direction"]=e}if("@nest"in h){const e=h["@nest"];if(!a(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:t});y["@nest"]=e}const _=y["@id"];if("@context"===_||"@preserve"===_)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(f&&f.protected&&!u&&(e.protected[r]=!0,y.protected=!0,!w(f,y)))throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r})},m.expandIri=(e,t,r,n)=>b(e,t,r,void 0,void 0,n),m.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),r=v.get(t);if(r)return r;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},r=e.fastCurieMap={},n={},i=(e["@language"]||"@none").toLowerCase(),a=e["@direction"],l=e.mappings,c=[...l.keys()].sort(y);for(const e of c){const o=l.get(e);if(null===o)continue;let c=o["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===o["@id"])continue;const u=g(o["@id"]);for(const l of u){let u=t[l];const h=m.isKeyword(l);if(u)h||o._termHasColon||n[l].push(e);else if(t[l]=u={},!h&&!o._termHasColon){n[l]=[e];const t={iri:l,terms:n[l]};l[0]in r?r[l[0]].push(t):r[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],s(e,u["@any"],"@none"),o.reverse)s(e,u["@type"],"@reverse");else if("@none"===o["@type"])s(e,u["@any"],"@none"),s(e,u["@language"],"@none"),s(e,u["@type"],"@none");else if("@type"in o)s(e,u["@type"],o["@type"]);else if("@language"in o&&"@direction"in o){const t=o["@language"],r=o["@direction"];s(e,u["@language"],t&&r?`${t}_${r}`.toLowerCase():t?t.toLowerCase():r?`_${r}`:"@null")}else"@language"in o?s(e,u["@language"],(o["@language"]||"@null").toLowerCase()):"@direction"in o?o["@direction"]?s(e,u["@language"],`_${o["@direction"]}`):s(e,u["@language"],"@none"):a?(s(e,u["@language"],`_${a}`),s(e,u["@language"],"@none"),s(e,u["@type"],"@none")):(s(e,u["@language"],i),s(e,u["@language"],"@none"),s(e,u["@type"],"@none"))}}for(const e in r)o(r,e,1);return t},clone:function(){const e={};return e.mappings=n.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=n.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(e["@base"]=this["@base"]),"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===v.size&&v.clear(),v.set(t,i),i;function o(e,t,r){const n=e[t],i=e[t]={};let s,a;for(const e of n)s=e.iri,a=r>=s.length?"":s[r],a in i?i[a].push(e):i[a]=[e];for(const e in i)""!==e&&o(i,e,r+1)}function s(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},m.getContextValue=(e,t,r)=>{if(null===t){if("@context"===r)return;return null}if(e.mappings.has(t)){const n=e.mappings.get(t);if(l(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&r in e||"@direction"===r&&r in e?e[r]:"@context"!==r?null:void 0},m.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,m.isKeyword=e=>{if(!a(e)||"@"!==e[0])return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},2872:(e,t,r)=>{"use strict";const{parseLinkHeader:n,buildHeaders:i}=r(4768),{LINK_HEADER_CONTEXT:o}=r(2445),s=r(9699),a=r(3114),{prependBase:l}=r(3866),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:r}={headers:{}})=>(t=i(t),(new a).wrapLoader((async function i(a){if(0!==a.indexOf("http:")&&0!==a.indexOf("https:"))throw new s('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});if(e&&0!==a.indexOf("https"))throw new s('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:a});let u;try{u=await function(e,t,r){const n=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{n.onload=()=>e(n),n.onerror=e=>i(e),n.open("GET",t,!0);for(const e in r)n.setRequestHeader(e,r[e]);n.send()}))}(r,a,t)}catch(e){throw new s("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e})}if(u.status>=400)throw new s("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});let h={contextUrl:null,documentUrl:a,document:u.response},d=null;const f=u.getResponseHeader("Content-Type");let p;if(c.test(u.getAllResponseHeaders())&&(p=u.getResponseHeader("Link")),p&&"application/ld+json"!==f){const e=n(p),t=e[o];if(Array.isArray(t))throw new s("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});t&&(h.contextUrl=t.target),d=e.alternate,d&&"application/ld+json"==d.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(h=await i(l(a,d.target)))}return h})))},5746:(e,t,r)=>{"use strict";var n=r(292);const i=r(9699),{isArray:o}=r(8285),{asArray:s}=r(4768),a={};function l({event:e,handlers:t}){let r=!0;for(let n=0;r&&n<t.length;++n){r=!1;const s=t[n];if(o(s))r=l({event:e,handlers:s});else if("function"==typeof s)s({event:e,next:()=>{r=!0}});else{if("object"!=typeof s)throw new i("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in s?s[e.code]({event:e,next:()=>{r=!0}}):r=!0}}return r}e.exports=a,a.defaultEventHandler=null,a.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?a.safeEventHandler:[],e.eventHandler?s(e.eventHandler):[],a.defaultEventHandler?a.defaultEventHandler:[]);return 0===t.length?null:t},a.handleEvent=({event:e,options:t})=>{l({event:e,handlers:t.eventHandler})};const c=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference"]);a.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&c.has(e.code))throw new i("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},a.logEventHandler=function({event:e,next:t}){n.log(`EVENT: ${e.message}`,{event:e}),t()},a.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&n.warn(`WARNING: ${e.message}`,{event:e}),t()},a.unhandledEventHandler=function({event:e}){throw new i("No handler for event.","jsonld.UnhandledEvent",{event:e})},a.setDefaultEventHandler=function({eventHandler:e}={}){a.defaultEventHandler=e?s(e):null}},570:(e,t,r)=>{"use strict";const n=r(9699),{isArray:i,isObject:o,isEmptyObject:s,isString:a,isUndefined:l}=r(8285),{isList:c,isValue:u,isGraph:h,isSubject:d}=r(478),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:v}=r(2182),{isAbsolute:m}=r(3866),{REGEX_BCP47:b,REGEX_KEYWORD:w,addValue:x,asArray:_,getValues:T,validateTypeValue:j}=r(4768),{handleEvent:E}=r(5746),N={};async function O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:h,expandedParent:w,options:T={},insideList:S,typeKey:A,typeScopedContext:R}){const C=Object.keys(h).sort(),D=[];let L;const P=h[A]&&"@json"===f(e,i(h[A])?h[A][0]:h[A],{vocab:!0},{...T,typeExpansion:!0});for(const O of C){let S,A=h[O];if("@context"===O)continue;const C=f(e,O,{vocab:!0},T);if(null===C||!m(C)&&!g(C)){T.eventHandler&&E({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:O,expandedProperty:C}},options:T});continue}if(g(C)){if("@reverse"===r)throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:A});if(C in w&&"@included"!==C&&"@type"!==C)throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!a(A)){if(!T.isFrame)throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:A});if(o(A)){if(!s(A))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:A})}else{if(!i(A))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:A});if(!A.every((e=>a(e))))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:A})}}x(w,"@id",_(A).map((t=>{if(a(t)){const r=f(e,t,{base:!0},T);return T.eventHandler&&(null===r?E(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:T}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:T}):m(r)||E({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:r}},options:T})),r}return t})),{propertyIsArray:T.isFrame});continue}if("@type"===C){o(A)&&(A=Object.fromEntries(Object.entries(A).map((([e,t])=>[f(R,e,{vocab:!0}),_(t).map((e=>f(R,e,{base:!0,vocab:!0},{...T,typeExpansion:!0})))])))),j(A,T.isFrame),x(w,"@type",_(A).map((e=>{if(a(e)){const t=f(R,e,{base:!0,vocab:!0},{...T,typeExpansion:!0});return m(t)||T.eventHandler&&E({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:T}),t}return e})),{propertyIsArray:T.isFrame});continue}if("@included"===C&&v(e,1.1)){const r=_(await N.expand({activeCtx:e,activeProperty:t,element:A,options:T}));if(!r.every((e=>d(e))))throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:A});x(w,"@included",r,{propertyIsArray:!0});continue}if("@graph"===C&&!o(A)&&!i(A))throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:A});if("@value"===C){L=A,P&&v(e,1.1)?w["@value"]=A:x(w,"@value",A,{propertyIsArray:T.isFrame});continue}if("@language"===C){if(null===A)continue;if(!a(A)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:A});A=_(A).map((e=>a(e)?e.toLowerCase():e));for(const e of A)a(e)&&!e.match(b)&&T.eventHandler&&E({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:T});x(w,"@language",A,{propertyIsArray:T.isFrame});continue}if("@direction"===C){if(!a(A)&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:A});A=_(A);for(const e of A)if(a(e)&&"ltr"!==e&&"rtl"!==e)throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:A});x(w,"@direction",A,{propertyIsArray:T.isFrame});continue}if("@index"===C){if(!a(A))throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:A});x(w,"@index",A);continue}if("@reverse"===C){if(!o(A))throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:A});if(S=await N.expand({activeCtx:e,activeProperty:"@reverse",element:A,options:T}),"@reverse"in S)for(const e in S["@reverse"])x(w,e,S["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in S){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),x(t,e,[],{propertyIsArray:!0});const r=S[e];for(let i=0;i<r.length;++i){const o=r[i];if(u(o)||c(o))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:S});x(t,e,o,{propertyIsArray:!0})}}continue}if("@nest"===C){D.push(O);continue}let M=e;const F=p(e,O,"@context");l(F)||(M=await y({activeCtx:e,localCtx:F,propagate:!0,overrideProtected:!0,options:T}));const U=p(M,O,"@container")||[];if(U.includes("@language")&&o(A))S=I(M,A,p(M,O,"@direction"),T);else if(U.includes("@index")&&o(A)){const t=U.includes("@graph"),r=p(M,O,"@index")||"@index",n="@index"!==r&&f(e,r,{vocab:!0},T);S=await k({activeCtx:M,options:T,activeProperty:O,value:A,asGraph:t,indexKey:r,propertyIndex:n})}else if(U.includes("@id")&&o(A)){const e=U.includes("@graph");S=await k({activeCtx:M,options:T,activeProperty:O,value:A,asGraph:e,indexKey:"@id"})}else if(U.includes("@type")&&o(A))S=await k({activeCtx:M.revertToPreviousContext(),options:T,activeProperty:O,value:A,asGraph:!1,indexKey:"@type"});else{const n="@list"===C;if(n||"@set"===C){let e=t;n&&"@graph"===r&&(e=null),S=await N.expand({activeCtx:M,activeProperty:e,element:A,options:T,insideList:n})}else S="@json"===p(e,O,"@type")?{"@type":"@json","@value":A}:await N.expand({activeCtx:M,activeProperty:O,element:A,options:T,insideList:!1})}if(null!==S||"@value"===C)if("@list"!==C&&!c(S)&&U.includes("@list")&&(S={"@list":_(S)}),U.includes("@graph")&&!U.some((e=>"@id"===e||"@index"===e))&&(S=_(S).map((e=>({"@graph":_(e)})))),M.mappings.has(O)&&M.mappings.get(O).reverse){const e=w["@reverse"]=w["@reverse"]||{};S=_(S);for(let t=0;t<S.length;++t){const r=S[t];if(u(r)||c(r))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:S});x(e,C,r,{propertyIsArray:!0})}}else x(w,C,S,{propertyIsArray:!0})}if("@value"in w)if("@json"===w["@type"]&&v(e,1.1));else if((o(L)||i(L))&&!T.isFrame)throw new n('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:L});for(const s of D){const a=i(h[s])?h[s]:[h[s]];for(const i of a){if(!o(i)||Object.keys(i).some((t=>"@value"===f(e,t,{vocab:!0},T))))throw new n("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await O({activeCtx:e,activeProperty:t,expandedActiveProperty:r,element:i,expandedParent:w,options:T,insideList:S,typeScopedContext:R,typeKey:A})}}}function S({activeCtx:e,activeProperty:t,value:r,options:n}){if(null==r)return null;const i=f(e,t,{vocab:!0},n);if("@id"===i)return f(e,r,{base:!0},n);if("@type"===i)return f(e,r,{vocab:!0,base:!0},{...n,typeExpansion:!0});const o=p(e,t,"@type");if(("@id"===o||"@graph"===i)&&a(r)){const i=f(e,r,{base:!0},n);return null===i&&r.match(w)&&n.eventHandler&&E({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:n}),{"@id":i}}if("@vocab"===o&&a(r))return{"@id":f(e,r,{vocab:!0,base:!0},n)};if(g(i))return r;const s={};if(o&&!["@id","@vocab","@none"].includes(o))s["@type"]=o;else if(a(r)){const r=p(e,t,"@language");null!==r&&(s["@language"]=r);const n=p(e,t,"@direction");null!==n&&(s["@direction"]=n)}return["boolean","number","string"].includes(typeof r)||(r=r.toString()),s["@value"]=r,s}function I(e,t,r,o){const s=[],l=Object.keys(t).sort();for(const c of l){const l=f(e,c,{vocab:!0},o);let u=t[c];i(u)||(u=[u]);for(const e of u){if(null===e)continue;if(!a(e))throw new n("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==l&&(c.match(b)||o.eventHandler&&E({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:o}),i["@language"]=c.toLowerCase()),r&&(i["@direction"]=r),s.push(i)}}return s}async function k({activeCtx:e,options:t,activeProperty:r,value:o,asGraph:s,indexKey:a,propertyIndex:c}){const d=[],g=Object.keys(o).sort(),v="@type"===a;for(let m of g){if(v){const r=p(e,m,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,propagate:!1,options:t}))}let g,b=o[m];i(b)||(b=[b]),b=await N.expand({activeCtx:e,activeProperty:r,element:b,options:t,insideList:!1,insideIndex:!0}),g=c?"@none"===m?"@none":S({activeCtx:e,activeProperty:a,value:m,options:t}):f(e,m,{vocab:!0},t),"@id"===a?m=f(e,m,{base:!0},t):v&&(m=g);for(let e of b){if(s&&!h(e)&&(e={"@graph":[e]}),"@type"===a)"@none"===g||(e["@type"]?e["@type"]=[m].concat(e["@type"]):e["@type"]=[m]);else{if(u(e)&&!["@language","@type","@index"].includes(a))throw new n(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${a}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==g&&x(e,c,g,{propertyIsArray:!0,prependValue:!0}):"@none"===g||a in e||(e[a]=m)}d.push(e)}}return d}e.exports=N,N.expand=async({activeCtx:e,activeProperty:t=null,element:r,options:c={},insideList:u=!1,insideIndex:h=!1,typeScopedContext:d=null})=>{if(null==r)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(r)&&!o(r))return u||null!==t&&"@graph"!==f(e,t,{vocab:!0},c)?S({activeCtx:e,activeProperty:t,value:r,options:c}):(c.eventHandler&&E({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:r}},options:c}),null);if(i(r)){let n=[];const o=p(e,t,"@container")||[];u=u||o.includes("@list");for(let o=0;o<r.length;++o){let s=await N.expand({activeCtx:e,activeProperty:t,element:r[o],options:c,insideIndex:h,typeScopedContext:d});u&&i(s)&&(s={"@list":s}),null!==s&&(i(s)?n=n.concat(s):n.push(s))}return n}const g=f(e,t,{vocab:!0},c),b=p(e,t,"@context");d=d||(e.previousContext?e:null);let w=Object.keys(r).sort(),x=!h;if(x&&d&&w.length<=2&&!w.includes("@context"))for(const t of w){const r=f(d,t,{vocab:!0},c);if("@value"===r){x=!1,e=d;break}if("@id"===r&&1===w.length){x=!1;break}}x&&(e=e.revertToPreviousContext()),l(b)||(e=await y({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:c})),"@context"in r&&(e=await y({activeCtx:e,localCtx:r["@context"],options:c})),d=e;let j=null;for(const t of w)if("@type"===f(e,t,{vocab:!0},c)){j=j||t;const n=r[t],i=Array.isArray(n)?n.length>1?n.slice().sort():n:[n];for(const t of i){const r=p(d,t,"@context");l(r)||(e=await y({activeCtx:e,localCtx:r,options:c,propagate:!1}))}}let I={};await O({activeCtx:e,activeProperty:t,expandedActiveProperty:g,element:r,expandedParent:I,options:c,insideList:u,typeKey:j,typeScopedContext:d}),w=Object.keys(I);let k=w.length;if("@value"in I){if("@type"in I&&("@language"in I||"@direction"in I))throw new n('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:I});let t=k-1;if("@type"in I&&(t-=1),"@index"in I&&(t-=1),"@language"in I&&(t-=1),"@direction"in I&&(t-=1),0!==t)throw new n('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:I});const r=null===I["@value"]?[]:_(I["@value"]),i=T(I,"@type");if(v(e,1.1)&&i.includes("@json")&&1===i.length);else if(0===r.length)c.eventHandler&&E({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:I}},options:c}),I=null;else{if(!r.every((e=>a(e)||s(e)))&&"@language"in I)throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:I});if(!i.every((e=>m(e)&&!(a(e)&&0===e.indexOf("_:"))||s(e))))throw new n('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:I})}}else if("@type"in I&&!i(I["@type"]))I["@type"]=[I["@type"]];else if("@set"in I||"@list"in I){if(k>1&&(2!==k||!("@index"in I)))throw new n('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:I});"@set"in I&&(I=I["@set"],w=Object.keys(I),k=w.length)}else 1===k&&"@language"in I&&(c.eventHandler&&E({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:I}},options:c}),I=null);if(o(I)&&!c.keepFreeFloatingNodes&&!u&&(null===t||"@graph"===g)&&(0===k||"@value"in I||"@list"in I||1===k&&"@id"in I)){if(c.eventHandler){let e,t;0===k?(e="empty object",t="Dropping empty object."):"@value"in I?(e="object with only @value",t="Dropping object with only @value."):"@list"in I?(e="object with only @list",t="Dropping object with only @list."):1===k&&"@id"in I&&(e="object with only @id",t="Dropping object with only @id."),E({event:{type:["JsonLdEvent"],code:e,level:"warning",message:t,details:{value:I}},options:c})}I=null}return I}},1409:(e,t,r)=>{"use strict";const{isSubjectReference:n}=r(478),{createMergedNodeMap:i}=r(9646),o={};e.exports=o,o.flatten=e=>{const t=i(e),r=[],o=Object.keys(t).sort();for(let e=0;e<o.length;++e){const i=t[o[e]];n(i)||r.push(i)}return r}},1849:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(3866),l=r(9699),{createNodeMap:c,mergeNodeMapGraphs:u}=r(9646),h={};function d(e){const t={};for(const r in e)void 0!==e[r]&&(t["@"+r]=[e[r]]);return[t]}function f(e,t,r){for(let n=r.length-1;n>=0;--n){const i=r[n];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,r){const n="@"+r;let i=n in e?e[n][0]:t[r];if("embed"===r)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!o.isArray(e)||1!==e.length||!o.isObject(e[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of s.asArray(e[0]["@id"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of s.asArray(e[0]["@type"]))if(!o.isObject(t)&&!a.isAbsolute(t)||o.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,r,a){let l=!0,c=!1;for(const u in r){let h=!1;const d=s.getValues(t,u),f=0===s.getValues(r,u).length;if("@id"===u){if(o.isEmptyObject(r["@id"][0]||{})?h=!0:r["@id"].length>=0&&(h=r["@id"].includes(d[0])),!a.requireAll)return h}else if("@type"===u){if(l=!1,f){if(d.length>0)return!1;h=!0}else if(1===r["@type"].length&&o.isEmptyObject(r["@type"][0]))h=d.length>0;else for(const e of r["@type"])h=!(!o.isObject(e)||!("@default"in e))||h||d.some((t=>t===e));if(!a.requireAll)return h}else{if(n(u))continue;{const t=s.getValues(r,u)[0];let n=!1;if(t&&(g([t]),n="@default"in t),l=!1,0===d.length&&n)continue;if(d.length>0&&f)return!1;if(void 0===t){if(d.length>0)return!1;h=!0}else if(i.isList(t)){const r=t["@list"][0];if(i.isList(d[0])){const t=d[0]["@list"];i.isValue(r)?h=t.some((e=>x(r,e))):(i.isSubject(r)||i.isSubjectReference(r))&&(h=t.some((t=>w(e,r,t,a))))}}else h=i.isValue(t)?d.some((e=>x(t,e))):i.isSubjectReference(t)?d.some((r=>w(e,t,r,a))):!!o.isObject(t)&&d.length>0}}if(!h&&a.requireAll)return!1;c=c||h}return l||c}function v(e,t){const r=e.uniqueEmbeds[e.graph],n=r[t],i=n.parent,a=n.property,l={"@id":t};if(o.isArray(i)){for(let e=0;e<i.length;++e)if(s.compareValues(i[e],l)){i[e]=l;break}}else{const e=o.isArray(i[a]);s.removeValue(i,a,l,{propertyIsArray:e}),s.addValue(i,a,l,{propertyIsArray:e})}const c=e=>{const t=Object.keys(r);for(const n of t)n in r&&o.isObject(r[n].parent)&&r[n].parent["@id"]===e&&(delete r[n],c(n))};c(t)}function m(e,t){if(o.isArray(e))return e.map((e=>m(e,t)));if(o.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=m(e["@list"],t),e;if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)"@id"===r&&t.bnodesToClear.includes(e[r])?delete e["@id"]:e[r]=m(e[r],t)}return e}function b(e,t,r){o.isObject(e)?s.addValue(e,t,r,{propertyIsArray:!0}):e.push(r)}function w(e,t,r,n){if(!("@id"in r))return!1;const i=e.subjects[r["@id"]];return i&&y(e,i,t,n)}function x(e,t){const r=t["@value"],n=t["@type"],i=t["@language"],s=e["@value"]?o.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?o.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?o.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===s.length&&0===a.length&&0===l.length||!(!s.includes(r)&&!o.isEmptyObject(s[0]))&&!!(!n&&0===a.length||a.includes(n)||n&&o.isEmptyObject(a[0]))&&!!(!i&&0===l.length||l.includes(i)||i&&o.isEmptyObject(l[0]))}e.exports=h,h.frameMergedOrDefault=(e,t,r)=>{const n={options:r,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new s.IdentifierIssuer("_:b");c(e,n.graphMap,"@default",i),r.merged&&(n.graphMap["@merged"]=u(n.graphMap),n.graph="@merged"),n.subjects=n.graphMap[n.graph];const o=[];return h.frame(n,Object.keys(n.subjects).sort(),t,o),r.pruneBlankNodeIdentifiers&&(r.bnodesToClear=Object.keys(n.bnodeMap).filter((e=>1===n.bnodeMap[e].length))),r.link={},m(o,r)},h.frame=(e,t,r,a,c=null)=>{g(r),r=r[0];const u=e.options,m={embed:p(r,u,"embed"),explicit:p(r,u,"explicit"),requireAll:p(r,u,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],_=function(e,t,r,n){const i={};for(const o of t){const t=e.graphMap[e.graph][o];y(e,t,r,n)&&(i[o]=t)}return i}(e,t,r,m),T=Object.keys(_).sort();for(const g of T){const y=_[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===m.embed&&g in w){b(a,c,w[g]);continue}const T={"@id":g};if(0===g.indexOf("_:")&&s.addValue(e.bnodeMap,g,T,{propertyIsArray:!0}),w[g]=T,("@first"===m.embed||"@last"===m.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:r});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==m.embed&&!f(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=m.embed&&"@once"!=m.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===m.embed&&g in e.uniqueEmbeds[e.graph]&&v(e,g),e.uniqueEmbeds[e.graph][g]={parent:a,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,n=null;"@graph"in r?(n=r["@graph"][0],t=!("@merged"===g||"@default"===g),o.isObject(n)||(n={})):(t="@merged"!==e.graph,n={}),t&&h.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[n],T,"@graph")}"@included"in r&&h.frame({...e,embedded:!1},t,r["@included"],T,"@included");for(const t of Object.keys(y).sort())if(n(t)){if(T[t]=s.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&s.addValue(e.bnodeMap,t,T,{propertyIsArray:!0})}else if(!m.explicit||t in r)for(const n of y[t]){const o=t in r?r[t]:d(m);if(i.isList(n)){const o=r[t]&&r[t][0]&&r[t][0]["@list"]?r[t][0]["@list"]:d(m),a={"@list":[]};b(T,t,a);const l=n["@list"];for(const t of l)i.isSubjectReference(t)?h.frame({...e,embedded:!0},[t["@id"]],o,a,"@list"):b(a,"@list",s.clone(t))}else i.isSubjectReference(n)?h.frame({...e,embedded:!0},[n["@id"]],o,T,t):x(o[0],n)&&b(T,t,s.clone(n))}for(const e of Object.keys(r).sort()){if("@type"===e){if(!o.isObject(r[e][0])||!("@default"in r[e][0]))continue}else if(n(e))continue;const t=r[e][0]||{};if(!p(t,u,"omitDefault")&&!(e in T)){let r="@null";"@default"in t&&(r=s.clone(t["@default"])),o.isArray(r)||(r=[r]),T[e]=[{"@preserve":r}]}}for(const t of Object.keys(r["@reverse"]||{}).sort()){const n=r["@reverse"][t];for(const r of Object.keys(e.subjects))s.getValues(e.subjects[r],t).some((e=>e["@id"]===g))&&(T["@reverse"]=T["@reverse"]||{},s.addValue(T["@reverse"],t,[],{propertyIsArray:!0}),h.frame({...e,embedded:!0},[r],n,T["@reverse"][t],c))}b(a,c,T),e.subjectStack.pop()}else b(a,c,T);else b(a,c,T)}},h.cleanupNull=(e,t)=>{if(o.isArray(e))return e.map((e=>h.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(o.isObject(e)){if("@id"in e){const r=e["@id"];if(t.link.hasOwnProperty(r)){const n=t.link[r].indexOf(e);if(-1!==n)return t.link[r][n];t.link[r].push(e)}else t.link[r]=[e]}for(const r in e)e[r]=h.cleanupNull(e[r],t)}return e}},1176:(e,t,r)=>{"use strict";const n=r(9699),i=r(478),o=r(8285),{REGEX_BCP47:s,addValue:a}=r(4768),{handleEvent:l}=r(5746),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:v,XSD_STRING:m}=r(2445),b={};function w(e,t,r,i){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:i}),a["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=m),c===p){c="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new n("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(c===g)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(o.isNumeric(a["@value"]))if(c===v){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else c===y&&(a["@value"]=parseFloat(a["@value"]));[g,v,y,m].includes(c)||(a["@type"]=c)}else if("i18n-datatype"===r&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(s)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:i})),a["@direction"]=t}else c!==m&&(a["@type"]=c)}return a}e.exports=b,b.fromRDF=async(e,t)=>{const r={},n={"@default":r},s={},{useRdfType:l=!1,useNativeTypes:p=!1,rdfDirection:g=null}=t;for(const i of e){const e="DefaultGraph"===i.graph.termType?"@default":i.graph.value;e in n||(n[e]={}),"@default"===e||e in r||(r[e]={"@id":e});const o=n[e],c=i.subject.value,u=i.predicate.value,h=i.object;c in o||(o[c]={"@id":c});const y=o[c],v=h.termType.endsWith("Node");if(v&&!(h.value in o)&&(o[h.value]={"@id":h.value}),u===f&&!l&&v){a(y,"@type",h.value,{propertyIsArray:!0});continue}const m=w(h,p,g,t);if(a(y,u,m,{propertyIsArray:!0}),v)if(h.value===d){const e=o[h.value];"usages"in e||(e.usages=[]),e.usages.push({node:y,property:u,value:m})}else h.value in s?s[h.value]=!1:s[h.value]={node:y,property:u,value:m}}for(const e in n){const t=n[e];if(!(d in t))continue;const r=t[d];if(r.usages){for(let e of r.usages){let r=e.node,n=e.property,a=e.value;const l=[],d=[];let f=Object.keys(r).length;for(;n===h&&o.isObject(s[r["@id"]])&&o.isArray(r[u])&&1===r[u].length&&o.isArray(r[h])&&1===r[h].length&&(3===f||4===f&&o.isArray(r["@type"])&&1===r["@type"].length&&r["@type"][0]===c)&&(l.push(r[u][0]),d.push(r["@id"]),e=s[r["@id"]],r=e.node,n=e.property,a=e.value,f=Object.keys(r).length,i.isBlankNode(r)););delete a["@id"],a["@list"]=l.reverse();for(const e of d)delete t[e]}delete r.usages}}const y=[],v=Object.keys(r).sort();for(const e of v){const t=r[e];if(e in n){const r=t["@graph"]=[],o=n[e],s=Object.keys(o).sort();for(const e of s){const t=o[e];i.isSubjectReference(t)||r.push(t)}}i.isSubjectReference(t)||y.push(t)}return y}},478:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.isSubject=e=>!(!n.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>n.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>n.isObject(e)&&"@value"in e,i.isList=e=>n.isObject(e)&&"@list"in e,i.isGraph=e=>n.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>{if(n.isObject(e)){if("@id"in e){const t=e["@id"];return!n.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},730:(e,t,r)=>{const n=r(2948),i=r(1402),o=r(4768),s=r(5777),a=o.IdentifierIssuer,l=r(9699),c=r(3666),u=r(7990),{expand:h}=r(570),{flatten:d}=r(1409),{fromRDF:f}=r(1176),{toRDF:p}=r(2189),{frameMergedOrDefault:g,cleanupNull:y}=r(1849),{isArray:v,isObject:m,isString:b}=r(8285),{isSubjectReference:w}=r(478),{expandIri:x,getInitialContext:_,process:T,processingMode:j}=r(2182),{compact:E,compactIri:N}=r(120),{createNodeMap:O,createMergedNodeMap:S,mergeNodeMaps:I}=r(9646),{logEventHandler:k,logWarningEventHandler:A,safeEventHandler:R,setDefaultEventHandler:C,setupEventHandler:D,strictEventHandler:L,unhandledEventHandler:P}=r(5746),M=function(e){const t={},M=new c({max:100});function F(t,{documentLoader:r=e.documentLoader,...n}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:r},n,t,{eventHandler:D({options:t})})}return e.compact=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===r)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(n=F(n,{base:b(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new a("_:b"),contextResolver:new s({sharedCache:M})})).link&&(n.skipExpansion=!0),n.compactToRelative||delete n.base,i=n.skipExpansion?t:await e.expand(t,n);const c=await e.processContext(_(n),r,n);let u=await E({activeCtx:c,element:i,options:n});n.compactArrays&&!n.graph&&v(u)?1===u.length?u=u[0]:0===u.length&&(u={}):n.graph&&m(u)&&(u=[u]),m(r)&&"@context"in r&&(r=r["@context"]),r=o.clone(r),v(r)||(r=[r]);const h=r;r=[];for(let e=0;e<h.length;++e)(!m(h[e])||Object.keys(h[e]).length>0)&&r.push(h[e]);const d=r.length>0;if(1===r.length&&(r=r[0]),v(u)){const e=N({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=u;u={},d&&(u["@context"]=r),u[e]=t}else if(m(u)&&d){const e=u;u={"@context":r};for(const t in e)u[t]=e[t]}return u},e.expand=async function(t,r){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const n={},i=[];if("expandContext"in(r=F(r,{keepFreeFloatingNodes:!1,contextResolver:new s({sharedCache:M})}))){const e=o.clone(r.expandContext);m(e)&&"@context"in e?n.expandContext=e:n.expandContext={"@context":e},i.push(n.expandContext)}let a;if(b(t)){const o=await e.get(t,r);a=o.documentUrl,n.input=o.document,o.contextUrl&&(n.remoteContext={"@context":o.contextUrl},i.push(n.remoteContext))}else n.input=o.clone(t);"base"in r||(r.base=a||"");let l=_(r);for(const e of i)l=await T({activeCtx:l,localCtx:e,options:r});let c=await h({activeCtx:l,element:n.input,options:r});return m(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),v(c)||(c=[c]),c},e.flatten=async function(t,r,n){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");r="function"==typeof r?null:r||null,n=F(n,{base:b(t)?t:"",contextResolver:new s({sharedCache:M})});const i=await e.expand(t,n),o=d(i);if(null===r)return o;n.graph=!0,n.skipExpansion=!0;const a=await e.compact(o,r,n);return a},e.frame=async function(t,r,n){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(n=F(n,{base:b(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new s({sharedCache:M})}),b(r)){const t=await e.get(r,n);if(r=t.document,t.contextUrl){let e=r["@context"];e?v(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,r["@context"]=e}}const i=r&&r["@context"]||{},o=await e.processContext(_(n),i,n);n.hasOwnProperty("omitGraph")||(n.omitGraph=j(o,1.1)),n.hasOwnProperty("pruneBlankNodeIdentifiers")||(n.pruneBlankNodeIdentifiers=j(o,1.1));const a=await e.expand(t,n),l={...n};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(r,l),u=Object.keys(r).map((e=>x(o,e,{vocab:!0})));l.merged=!u.includes("@graph"),l.is11=j(o,1.1);const h=g(a,c,l);l.graph=!n.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let d=await e.compact(h,i,l);return l.link={},d=y(d,l),d},e.link=async function(t,r,n){const i={};return r&&(i["@context"]=r),i["@embed"]="@link",e.frame(t,i,n)},e.normalize=e.canonize=async function(t,r){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(r=F(r,{base:b(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new s({sharedCache:M})}))){if("application/n-quads"!==r.inputFormat&&"application/nquads"!==r.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=u.parse(t);return n.canonize(e,r)}const i={...r};delete i.format,i.produceGeneralizedRdf=!1;const o=await e.toRDF(t,i);return n.canonize(o,r)},e.fromRDF=async function(e,r){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");r=F(r,{format:b(e)?"application/n-quads":void 0});const{format:n}=r;let{rdfParser:i}=r;if(n){if(i=i||t[n],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:n})}else i=()=>e;const o=await i(e);return f(o,r)},e.toRDF=async function(t,r){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let n;n=(r=F(r,{base:b(t)?t:"",skipExpansion:!1,contextResolver:new s({sharedCache:M})})).skipExpansion?t:await e.expand(t,r);const i=p(n,r);if(r.format){if("application/n-quads"===r.format||"application/nquads"===r.format)return u.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:r.format})}return i},e.createNodeMap=async function(t,r){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");r=F(r,{base:b(t)?t:"",contextResolver:new s({sharedCache:M})});const n=await e.expand(t,r);return S(n,r)},e.merge=async function(t,r,n){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!v(t))throw new TypeError('Could not merge, "docs" must be an array.');r="function"==typeof r?null:r||null,n=F(n,{contextResolver:new s({sharedCache:M})});const i=await Promise.all(t.map((t=>{const r={...n};return e.expand(t,r)})));let l=!0;"mergeNodes"in n&&(l=n.mergeNodes);const c=n.issuer||new a("_:b"),u={"@default":{}};for(let e=0;e<i.length;++e){const t=o.relabelBlankNodes(i[e],{issuer:new a("_:b"+e+"-")}),r=l||0===e?u:{"@default":{}};if(O(t,r,"@default",c),r!==u)for(const e in r){const t=r[e];if(!(e in u)){u[e]=t;continue}const n=u[e];for(const e in t)e in n||(n[e]=t[e])}}const h=I(u),d=[],f=Object.keys(h).sort();for(let e=0;e<f.length;++e){const t=h[f[e]];w(t)||d.push(t)}if(null===r)return d;n.graph=!0,n.skipExpansion=!0;const p=await e.compact(d,r,n);return p},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:e})},e.get=async function(t,r){let n;n="function"==typeof r.documentLoader?r.documentLoader:e.documentLoader;const i=await n(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");b(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,r){return r=F(r,{base:"",contextResolver:new s({sharedCache:M})}),null===t?_(r):(t=o.clone(t),m(t)&&"@context"in t||(t={"@context":t}),T({activeCtx:e,localCtx:t,options:r}))},e.getContextValue=r(2182).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('Unknown document loader type: "'+t+'"',"jsonld.UnknownDocumentLoader",{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,r){t[e]=r},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser("application/n-quads",u.parse),e.registerRDFParser("application/nquads",u.parse),e.url=r(3866),e.logEventHandler=k,e.logWarningEventHandler=A,e.safeEventHandler=R,e.setDefaultEventHandler=C,e.strictEventHandler=L,e.unhandledEventHandler=P,e.util=o,Object.assign(e,o),e.promises=e,e.RequestQueue=r(3114),e.JsonLdProcessor=r(7298)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},F=function(){return M((function(){return F()}))};M(F),e.exports=F},9646:(e,t,r)=>{"use strict";const{isKeyword:n}=r(2182),i=r(478),o=r(8285),s=r(4768),a=r(9699),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new s.IdentifierIssuer("_:b"),n={"@default":{}};return l.createNodeMap(e,n,"@default",r),l.mergeNodeMaps(n)},l.createNodeMap=(e,t,r,c,u,h)=>{if(o.isArray(e)){for(const n of e)l.createNodeMap(n,t,r,c,void 0,h);return}if(!o.isObject(e))return void(h&&h.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(h&&h.push(e))}if(h&&i.isList(e)){const n=[];return l.createNodeMap(e["@list"],t,r,c,u,n),void h.push({"@list":n})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}o.isUndefined(u)&&(u=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),h&&h.push({"@id":u});const d=t[r],f=d[u]=d[u]||{};f["@id"]=u;const p=Object.keys(e).sort();for(let o of p){if("@id"===o)continue;if("@reverse"===o){const n={"@id":u},o=e["@reverse"];for(const e in o){const a=o[e];for(const o of a){let a=o["@id"];i.isBlankNode(o)&&(a=c.getId(a)),l.createNodeMap(o,t,r,c,a),s.addValue(d[a],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===o){u in t||(t[u]={}),l.createNodeMap(e[o],t,u,c);continue}if("@included"===o){l.createNodeMap(e[o],t,r,c);continue}if("@type"!==o&&n(o)){if("@index"===o&&o in f&&(e[o]!==f[o]||e[o]["@id"]!==f[o]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[o]=e[o];continue}const h=e[o];if(0===o.indexOf("_:")&&(o=c.getId(o)),0!==h.length)for(let e of h)if("@type"===o&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const n=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];s.addValue(f,o,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,r,c,n)}else if(i.isValue(e))s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const n=[];l.createNodeMap(e["@list"],t,r,c,u,n),e={"@list":n},s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,r,c,u),s.addValue(f,o,e,{propertyIsArray:!0,allowDuplicate:!1});else s.addValue(f,o,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const i of Object.keys(e[r]).sort()){const o=e[r][i];i in t||(t[i]={"@id":i});const a=t[i];for(const e of Object.keys(o).sort())if(n(e)&&"@type"!==e)a[e]=s.clone(o[e]);else for(const t of o[e])s.addValue(a,e,s.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],r=Object.keys(e).sort();for(const n of r){if("@default"===n)continue;const r=e[n];let o=t[n];o?"@graph"in o||(o["@graph"]=[]):t[n]=o={"@id":n,"@graph":[]};const s=o["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];i.isSubjectReference(t)||s.push(t)}}return t}},1402:(e,t,r)=>{"use strict";const n=r(2872),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=n,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},2189:(e,t,r)=>{"use strict";const{createNodeMap:n}=r(9646),{isKeyword:i}=r(2182),o=r(478),s=r(8981),a=r(8285),l=r(4768),{handleEvent:c}=r(5746),{RDF_FIRST:u,RDF_REST:h,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:p,RDF_LANGSTRING:g,XSD_BOOLEAN:y,XSD_DOUBLE:v,XSD_INTEGER:m,XSD_STRING:b}=r(2445),{isAbsolute:w}=r(3866),x={};function _(e,t,r,n,o){const s=Object.keys(t).sort();for(const a of s){const s=t[a],l=Object.keys(s).sort();for(let t of l){const l=s[t];if("@type"===t)t=f;else if(i(t))continue;for(const i of l){const s={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!w(a)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:a}},options:o});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!w(t)){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:o});continue}if("BlankNode"===l.termType&&!o.produceGeneralizedRdf){o.eventHandler&&c({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:n.getOldIds().find((e=>n.getId(e)===t))}},options:o});continue}const u=T(i,n,e,r,o.rdfDirection,o);u&&e.push({subject:s,predicate:l,object:u,graph:r})}}}}function T(e,t,r,n,i,l){const f={};if(o.isValue(e)){f.termType="Literal",f.value=void 0,f.datatype={termType:"NamedNode"};let t=e["@value"];const r=e["@type"]||null;if("@json"===r)f.value=s(t),f.datatype.value=p;else if(a.isBoolean(t))f.value=t.toString(),f.datatype.value=r||y;else if(a.isDouble(t)||r===v)a.isDouble(t)||(t=parseFloat(t)),f.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),f.datatype.value=r||v;else if(a.isNumber(t))f.value=t.toFixed(0),f.datatype.value=r||m;else if("i18n-datatype"===i&&"@direction"in e){const r="https://www.w3.org/ns/i18n#"+(e["@language"]||"")+`_${e["@direction"]}`;f.datatype.value=r,f.value=t}else"@language"in e?(f.value=t,f.datatype.value=r||g,f.language=e["@language"]):(f.value=t,f.datatype.value=r||b)}else if(o.isList(e)){const o=function(e,t,r,n,i,o){const s={termType:"NamedNode",value:u},a={termType:"NamedNode",value:h},l={termType:"NamedNode",value:d},c=e.pop(),f=c?{termType:"BlankNode",value:t.getId()}:l;let p=f;for(const l of e){const e=T(l,t,r,n,i,o),c={termType:"BlankNode",value:t.getId()};r.push({subject:p,predicate:s,object:e,graph:n}),r.push({subject:p,predicate:a,object:c,graph:n}),p=c}if(c){const e=T(c,t,r,n,i,o);r.push({subject:p,predicate:s,object:e,graph:n}),r.push({subject:p,predicate:a,object:l,graph:n})}return f}(e["@list"],t,r,n,i,l);f.termType=o.termType,f.value=o.value}else{const t=a.isObject(e)?e["@id"]:e;f.termType=t.startsWith("_:")?"BlankNode":"NamedNode",f.value=t}return"NamedNode"!==f.termType||w(f.value)?f:(l.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:f.value}},options:l}),null)}e.exports=x,x.toRDF=(e,t)=>{const r=new l.IdentifierIssuer("_:b"),i={"@default":{}};n(e,i,"@default",r);const o=[],s=Object.keys(i).sort();for(const e of s){let n;if("@default"===e)n={termType:"DefaultGraph",value:""};else{if(!w(e)){t.eventHandler&&c({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}n=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},n.value=e}_(o,i[e],n,r,t)}return o}},8285:e=>{"use strict";const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},3866:(e,t,r)=>{"use strict";const n=r(8285),i={};e.exports=i,i.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const r={},n=i.parsers[t||"full"],o=n.regex.exec(e);let s=n.keys.length;for(;s--;)r[n.keys[s]]=void 0===o[s]?null:o[s];return("https"===r.scheme&&"443"===r.port||"http"===r.scheme&&"80"===r.port)&&(r.href=r.href.replace(":"+r.port,""),r.authority=r.authority.replace(":"+r.port,""),r.port=null),r.normalizedPath=i.removeDotSegments(r.path),r},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!n.isString(e)||(e=i.parse(e||""));const r=i.parse(t),o={protocol:e.protocol||""};if(null!==r.authority)o.authority=r.authority,o.path=r.path,o.query=r.query;else if(o.authority=e.authority,""===r.path)o.path=e.path,null!==r.query?o.query=r.query:o.query=e.query;else{if(0===r.path.indexOf("/"))o.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,o.path=t}o.query=r.query}""!==r.path&&(o.path=i.removeDotSegments(o.path));let s=o.protocol;return null!==o.authority&&(s+="//"+o.authority),s+=o.path,null!==o.query&&(s+="?"+o.query),null!==r.fragment&&(s+="#"+r.fragment),""===s&&(s="./"),s},i.removeBase=(e,t)=>{if(null===e)return t;e&&!n.isString(e)||(e=i.parse(e||""));let r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;const o=i.parse(t.substr(r.length)),s=e.normalizedPath.split("/"),a=o.normalizedPath.split("/"),l=o.fragment||o.query?0:1;for(;s.length>0&&a.length>l&&s[0]===a[0];)s.shift(),a.shift();let c="";if(s.length>0){s.pop();for(let e=0;e<s.length;++e)c+="../"}return c+=a.join("/"),null!==o.query&&(c+="?"+o.query),null!==o.fragment&&(c+="#"+o.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),r=[];for(;t.length>0;){const e=t.shift(),n=0===t.length;"."!==e?".."!==e?r.push(e):(r.pop(),n&&r.push("")):n&&r.push("")}return"/"===e[0]&&r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const o=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>n.isString(e)&&o.test(e),i.isRelative=e=>n.isString(e)},4768:(e,t,r)=>{"use strict";const n=r(478),i=r(8285),o=r(2948).IdentifierIssuer,s=r(9699),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u="application/ld+json, application/json",h={};function d(e,t){if(i.isArray(t))for(let r=0;r<t.length;++r)t[r]=d(e,t[r]);else if(n.isList(t))t["@list"]=d(e,t["@list"]);else if(i.isObject(t)){n.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const r=Object.keys(t).sort();for(let n=0;n<r.length;++n){const i=r[n];"@id"!==i&&(t[i]=d(e,t[i]))}}return t}e.exports=h,h.IdentifierIssuer=o,h.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,h.REGEX_KEYWORD=/^@[a-zA-Z]+$/,h.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=h.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,h.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(h.clone(r))}else if(i.isObject(e)){t={};for(const r in e)t[r]=h.clone(e[r])}else t=e.toString();return t}return e},h.asArray=function(e){return Array.isArray(e)?e:[e]},h.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+u+'" is supported.');return Object.assign({Accept:u},e)},h.parseLinkHeader=e=>{const t={},r=e.match(a);for(let e=0;e<r.length;++e){let n=r[e].match(l);if(!n)continue;const i={target:n[1]},o=n[2];for(;n=c.exec(o);)i[n[1]]=void 0===n[2]?n[3]:n[2];const s=i.rel||"";Array.isArray(t[s])?t[s].push(i):t.hasOwnProperty(s)?t[s]=[t[s],i]:t[s]=i}return t},h.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every((e=>i.isString(e))))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&h.asArray(e["@default"]).every((e=>i.isString(e))))return}throw new s('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})}},h.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const r=e[t];return!i.isArray(r)||r.length>0}return!1},h.hasValue=(e,t,r)=>{if(h.hasProperty(e,t)){let o=e[t];const s=n.isList(o);if(i.isArray(o)||s){s&&(o=o["@list"]);for(let e=0;e<o.length;++e)if(h.compareValues(r,o[e]))return!0}else if(!i.isArray(r))return h.compareValues(r,o)}return!1},h.addValue=(e,t,r,n)=>{if("propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1),"valueIsArray"in n||(n.valueIsArray=!1),"allowDuplicate"in n||(n.allowDuplicate=!0),"prependValue"in n||(n.prependValue=!1),n.valueIsArray)e[t]=r;else if(i.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),n.prependValue&&(r=r.concat(e[t]),e[t]=[]);for(let i=0;i<r.length;++i)h.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const o=!n.allowDuplicate&&h.hasValue(e,t,r);i.isArray(e[t])||o&&!n.propertyIsArray||(e[t]=[e[t]]),o||(n.prependValue?e[t].unshift(r):e[t].push(r))}else e[t]=n.propertyIsArray?[r]:r},h.getValues=(e,t)=>[].concat(e[t]||[]),h.removeProperty=(e,t)=>{delete e[t]},h.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=h.getValues(e,t).filter((e=>!h.compareValues(e,r)));0===i.length?h.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},h.relabelBlankNodes=(e,t)=>d((t=t||{}).issuer||new o("_:b"),e),h.compareValues=(e,t)=>e===t||!(!n.isValue(e)||!n.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],h.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},3666:(e,t,r)=>{"use strict";const n=r(1123),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),h=Symbol("lruList"),d=Symbol("cache"),f=Symbol("updateAgeOnGet"),p=()=>1,g=(e,t,r)=>{const n=e[d].get(t);if(n){const t=n.value;if(y(e,t)){if(m(e,n),!e[a])return}else r&&(e[f]&&(n.value.now=Date.now()),e[h].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[l]&&r>e[l]},v=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const r=t.prev;m(e,t),t=r}},m=(e,t)=>{if(t){const r=t.value;e[c]&&e[c](r.key,r.value),e[o]-=r.length,e[d].delete(r.key),e[h].removeNode(t)}};class b{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const w=(e,t,r,n)=>{let i=r.value;y(e,i)&&(m(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[s]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,v(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,v(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[s]&&(this[s]=e,this[o]=0,this[h].forEach((e=>{e.length=this[s](e.value,e.key),this[o]+=e.length}))),v(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let r=this[h].tail;null!==r;){const n=r.prev;w(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[h].head;null!==r;){const n=r.next;w(this,e,r,t),r=n}}keys(){return this[h].toArray().map((e=>e.key))}values(){return this[h].toArray().map((e=>e.value))}reset(){this[c]&&this[h]&&this[h].length&&this[h].forEach((e=>this[c](e.key,e.value))),this[d]=new Map,this[h]=new n,this[o]=0}dump(){return this[h].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[h]}set(e,t,r){if((r=r||this[l])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[d].has(e)){if(a>this[i])return m(this,this[d].get(e)),!1;const s=this[d].get(e).value;return this[c]&&(this[u]||this[c](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),v(this),!0}const f=new b(e,t,a,n,r);return f.length>this[i]?(this[c]&&this[c](e,t),!1):(this[o]+=f.length,this[h].unshift(f),this[d].set(e,this[h].head),v(this),!0)}has(e){if(!this[d].has(e))return!1;const t=this[d].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[h].tail;return e?(m(this,e),e.value):null}del(e){m(this,this[d].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[d].forEach(((e,t)=>g(this,t,!1)))}}},8720:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},7402:(e,t,r)=>{"use strict";var n=r(9170),i=r(2550),o=r(8720),s=r(5280),a=r(9129),l=i(s(),Object);n(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},5280:(e,t,r)=>{"use strict";var n=r(8720);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9129:(e,t,r)=>{"use strict";var n=r(5280),i=r(9170);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},8383:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(4418),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call((function(){}),"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(e){var t=e.constructor;return t&&t.prototype===e},d={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},f=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!d["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{h(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=s(e),a=t&&"[object String]"===o.call(e),d=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var g=0;g<e.length;++g)d.push(String(g));if(n&&e.length>0)for(var y=0;y<e.length;++y)d.push(String(y));else for(var v in e)p&&"prototype"===v||!i.call(e,v)||d.push(String(v));if(l)for(var m=function(e){if("undefined"==typeof window||!f)return h(e);try{return h(e)}catch(e){return!1}}(e),b=0;b<u.length;++b)m&&"constructor"===u[b]||!i.call(e,u[b])||d.push(u[b]);return d}}e.exports=n},806:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(4418),o=Object.keys,s=o?function(e){return o(e)}:r(8383),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},4418:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},2530:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],c=!1,u=-1;function h(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&d())}function d(){if(!c){var e=s(h);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||c||s(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5929:(e,t,r)=>{let n;e.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):e=>(n||(n=Promise.resolve())).then(e).catch((e=>setTimeout((()=>{throw e}),0)))},2948:(e,t,r)=>{e.exports=r(2874)},577:e=>{"use strict";e.exports=class e{constructor(e,t=new Map,r=0){this.prefix=e,this._existing=t,this.counter=r}clone(){const{prefix:t,_existing:r,counter:n}=this;return new e(t,new Map(r),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},4071:(e,t,r)=>{"use strict";r(4828);const n=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!n||!n.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await n.subtle.digest(this.algorithm,e));let r="";for(let e=0;e<t.length;++e)r+=t[e].toString(16).padStart(2,"0");return r}}},6327:e=>{"use strict";const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",r="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",o="Literal",s="DefaultGraph",a={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�_",r=t+"0-9-·̀-ͯ‿-⁀",n="(_:(?:["+t+"0-9])(?:(?:["+r+".])*(?:["+r+"]))?)",i="[ \\t]+",o="[ \\t]*",s="(?:"+e+"|"+n+")"+i,l=e+i,c="(?:"+e+"|"+n+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+o,u="(?:\\.|(?:(?:"+e+"|"+n+")"+o+"\\.))";a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^"+o+"$"),a.quad=new RegExp("^"+o+s+l+c+u+o+"$")})(),e.exports=class e{static parse(e){const l=[],u={},h=e.split(a.eoln);let d=0;for(const e of h){if(d++,a.empty.test(e))continue;const h=e.match(a.quad);if(null===h)throw new Error("N-Quads parse error on line "+d+".");const g={subject:null,predicate:null,object:null,graph:null};if(void 0!==h[1]?g.subject={termType:n,value:h[1]}:g.subject={termType:i,value:h[2]},g.predicate={termType:n,value:h[3]},void 0!==h[4]?g.object={termType:n,value:h[4]}:void 0!==h[5]?g.object={termType:i,value:h[5]}:(g.object={termType:o,value:void 0,datatype:{termType:n}},void 0!==h[7]?g.object.datatype.value=h[7]:void 0!==h[8]?(g.object.datatype.value=t,g.object.language=h[8]):g.object.datatype.value=r,g.object.value=h[6].replace(c,(function(e,t,r,n){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(r)return String.fromCharCode(parseInt(r,16));if(n)throw new Error("Unsupported U escape")}))),void 0!==h[9]?g.graph={termType:n,value:h[9]}:void 0!==h[10]?g.graph={termType:i,value:h[10]}:g.graph={termType:s,value:""},g.graph.value in u){let e=!0;const t=u[g.graph.value];for(const r of t)if(p=g,(f=r).subject.termType===p.subject.termType&&f.object.termType===p.object.termType&&f.subject.value===p.subject.value&&f.predicate.value===p.predicate.value&&f.object.value===p.object.value&&(f.object.termType!==o||f.object.datatype.termType===p.object.datatype.termType&&f.object.language===p.object.language&&f.object.datatype.value===p.object.datatype.value)){e=!1;break}e&&(t.push(g),l.push(g))}else u[g.graph.value]=[g],l.push(g)}var f,p;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const r=[];for(const n of t)r.push(e.serializeQuad(n));return r.sort().join("")}static serializeQuadComponents(e,o,s,a){let c="";return e.termType===n?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${o.value}> `,s.termType===n?c+=`<${s.value}>`:s.termType===i?c+=s.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(s.value)}"`,s.datatype.value===t?s.language&&(c+=`@${s.language}`):s.datatype.value!==r&&(c+=`^^<${s.datatype.value}>`)),a.termType===n?c+=` <${a.value}>`:a.termType===i&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const a=[],l={"blank node":i,IRI:n,literal:o};for(const c in e)e[c].forEach((e=>{const u={};for(const i in e){const s=e[i],a={termType:l[s.type],value:s.value};a.termType===o&&(a.datatype={termType:n},"datatype"in s&&(a.datatype.value=s.datatype),"language"in s?("datatype"in s||(a.datatype.value=t),a.language=s.language):"datatype"in s||(a.datatype.value=r)),u[i]=a}u.graph="@default"===c?{termType:s,value:""}:{termType:c.startsWith("_:")?i:n,value:c},a.push(u)}));return a}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},83:e=>{"use strict";e.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){const{current:e,dir:t}=this,r=e.slice();let n=null,i=0;const o=e.length;for(let r=0;r<o;++r){const s=e[r],a=t.get(s);(null===n||s>n)&&(a&&r>0&&s>e[r-1]||!a&&r<o-1&&s>e[r+1])&&(n=s,i=r)}if(null===n)this.done=!0;else{const r=t.get(n)?i-1:i+1;e[i]=e[r],e[r]=n;for(const r of e)r>n&&t.set(r,!t.get(r))}return r}}},4515:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];let i=0;for(const e of r)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const o=[...t.keys()].sort(),l=[];for(const e of o){const r=t.get(e);if(r.length>1){l.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of l){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=await this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=await i.digest(),r.hash}async hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}async hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=await this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));let l=0;for(;a.hasNext();){const e=a.next();++l%3==0&&await this._yield();let n=t.clone(),i="";const o=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){c=!0;break}if(!c){for(const e of o){const t=await this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){c=!0;break}}c||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:await n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:o,component:o.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:o,component:o.graph,position:"g",id:e,issuer:t,hashToRelated:r})]);return r}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=await this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=await this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},2160:(e,t,r)=>{"use strict";const n=r(577),i=r(4071),o=r(83),s=r(6327);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=(()=>new i("sha256")),maxDeepIterations:t=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n"),this.createMessageDigest=e,this.maxDeepIterations=t,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,r=[...this.blankNodeInfo.keys()];for(const e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),o=[];for(const e of i){const r=t.get(e);if(r.length>1){o.push(r);continue}const n=r[0];this.canonicalIssuer.getId(n)}for(const e of o){const t=[];for(const r of e){if(this.canonicalIssuer.hasId(r))continue;const e=new n("_:b");e.getId(r);const i=this.hashNDegreeQuads(r,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=s.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],r=this.blankNodeInfo.get(e),n=r.quads;for(const r of n){const n={subject:null,predicate:r.predicate,object:null,graph:null};n.subject=this.modifyFirstDegreeComponent(e,r.subject,"subject"),n.object=this.modifyFirstDegreeComponent(e,r.object,"object"),n.graph=this.modifyFirstDegreeComponent(e,r.graph,"graph"),t.push(s.serializeQuad(n))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return r.hash=i.digest(),r.hash}hashRelatedBlankNode(e,t,r,n){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):r.hasId(e)?r.getId(e):this.blankNodeInfo.get(e).hash;const o=this.createMessageDigest();return o.update(n),"g"!==n&&o.update(this.getRelatedPredicate(t)),o.update(i),o.digest()}hashNDegreeQuads(e,t){const r=this.deepIterations.get(e)||0;if(r>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,r+1);const n=this.createMessageDigest(),i=this.createHashToRelated(e,t),s=[...i.keys()].sort();for(const e of s){n.update(e);let r,s="";const a=new o(i.get(e));for(;a.hasNext();){const e=a.next();let n=t.clone(),i="";const o=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(n.hasId(t)||o.push(t),i+=n.getId(t)),0!==s.length&&i>s){l=!0;break}if(!l){for(const e of o){const t=this.hashNDegreeQuads(e,n);if(i+=n.getId(e),i+=`<${t.hash}>`,n=t.issuer,0!==s.length&&i>s){l=!0;break}}l||(0===s.length||i<s)&&(s=i,r=n)}}n.update(s),t=r}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:"s",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:"o",id:e,issuer:t,hashToRelated:r}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:"g",id:e,issuer:t,hashToRelated:r});return r}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const r=this.hashFirstDegreeQuads(e),n=t.get(r);n?n.push(e):t.set(r,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const r=t.value,n=this.blankNodeInfo.get(r);n?n.quads.add(e):this.blankNodeInfo.set(r,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:r,id:n,issuer:i,hashToRelated:o}){if("BlankNode"!==t.termType||t.value===n)return;const s=t.value,a=this.hashRelatedBlankNode(s,e,i,r),l=o.get(a);l?l.push(s):o.set(a,[s])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},3663:(e,t,r)=>{"use strict";const n=r(4071),i=r(4515);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;let i=0;for(const o of n){let n,s;if("BlankNode"===o.subject.termType&&o.subject.value!==e)s=o.subject.value,n="p";else{if("BlankNode"!==o.object.termType||o.object.value===e)continue;s=o.object.value,n="r"}++i%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(s,o,t,n),l=r.get(a);l?l.push(s):r.set(a,[s])}return r}}},5393:(e,t,r)=>{"use strict";const n=r(4071),i=r(2160);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(e,t,r){return"BlankNode"!==t.termType?t:"graph"===r?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const r=new Map,n=this.blankNodeInfo.get(e).quads;for(const i of n){let n,o;if("BlankNode"===i.subject.termType&&i.subject.value!==e)o=i.subject.value,n="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;o=i.object.value,n="r"}const s=this.hashRelatedBlankNode(o,i,t,n),a=r.get(s);a?a.push(o):r.set(s,[o])}return r}}},2874:(e,t,r)=>{"use strict";const n=r(4515),i=r(3663),o=r(2160),s=r(5393);let a;try{a=r(7670)}catch(e){}t.NQuads=r(6327),t.IdentifierIssuer=r(577),t._rdfCanonizeNative=function(e){return e&&(a=e),a},t.canonize=async function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((t,n)=>a.canonize(e,r,((e,r)=>e?n(e):t(r)))))}if("URDNA2015"===r.algorithm)return new n(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)},t._canonizeSync=function(e,r){if(Array.isArray(e)||(e=t.NQuads.legacyDatasetToQuads(e)),r.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(e,r)}if("URDNA2015"===r.algorithm)return new o(r).main(e);if("URGNA2012"===r.algorithm){if(r.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new s(r).main(e)}if(!("algorithm"in r))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm)}},4828:function(e,t,r){var n=r(2530);!function(e,t){"use strict";if(!e.setImmediate){var r,i,o,s,a,l=1,c={},u=!1,h=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){n.nextTick((function(){p(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(s="setImmediate$"+Math.random()+"$",a=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&p(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",a,!1):e.attachEvent("onmessage",a),r=function(t){e.postMessage(s+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):h&&"onreadystatechange"in h.createElement("script")?(i=h.documentElement,r=function(e){var t=h.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[l]=i,r(l),l++},d.clearImmediate=f}function f(e){delete c[e]}function p(e){if(u)setTimeout(p,0,e);else{var t=c[e];if(t){u=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{f(e),u=!1}}}}}("undefined"==typeof self?void 0===r.g?this:r.g:self)},9523:e=>{const t={acl:"http://www.w3.org/ns/auth/acl#",arg:"http://www.w3.org/ns/pim/arg#",as:"https://www.w3.org/ns/activitystreams#",cal:"http://www.w3.org/2002/12/cal/ical#",cert:"http://www.w3.org/ns/auth/cert#",contact:"http://www.w3.org/2000/10/swap/pim/contact#",dc:"http://purl.org/dc/elements/1.1/",dct:"http://purl.org/dc/terms/",doap:"http://usefulinc.com/ns/doap#",foaf:"http://xmlns.com/foaf/0.1/",geo:"http://www.w3.org/2003/01/geo/wgs84_pos#",gpx:"http://www.w3.org/ns/pim/gpx#",http:"http://www.w3.org/2007/ont/http#",httph:"http://www.w3.org/2007/ont/httph#",icalTZ:"http://www.w3.org/2002/12/cal/icaltzd#",ldp:"http://www.w3.org/ns/ldp#",link:"http://www.w3.org/2007/ont/link#",log:"http://www.w3.org/2000/10/swap/log#",meeting:"http://www.w3.org/ns/pim/meeting#",mo:"http://purl.org/ontology/mo/",org:"http://www.w3.org/ns/org#",owl:"http://www.w3.org/2002/07/owl#",pad:"http://www.w3.org/ns/pim/pad#",patch:"http://www.w3.org/ns/pim/patch#",prov:"http://www.w3.org/ns/prov#",qu:"http://www.w3.org/2000/10/swap/pim/qif#",trip:"http://www.w3.org/ns/pim/trip#",rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",rss:"http://purl.org/rss/1.0/",sched:"http://www.w3.org/ns/pim/schedule#",schema:"http://schema.org/",sioc:"http://rdfs.org/sioc/ns#",solid:"http://www.w3.org/ns/solid/terms#",space:"http://www.w3.org/ns/pim/space#",stat:"http://www.w3.org/ns/posix/stat#",tab:"http://www.w3.org/2007/ont/link#",tabont:"http://www.w3.org/2007/ont/link#",ui:"http://www.w3.org/ns/ui#",vcard:"http://www.w3.org/2006/vcard/ns#",wf:"http://www.w3.org/2005/01/wf/flow#",xsd:"http://www.w3.org/2001/XMLSchema#",cco:"http://www.ontologyrepository.com/CommonCoreOntologies/"};e.exports=function(e={namedNode:e=>e}){const r={};for(const n in t){const i=t[n];r[n]=function(t=""){return e.namedNode(i+t)}}return r}},9397:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},4489:(e,t,r)=>{"use strict";var n=r(7092),i=r(7427),o=r(4010),s=r(2527);function a(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),h=a(Number.prototype.valueOf),d=a(String.prototype.valueOf),f=a(Boolean.prototype.valueOf);if(l)var p=a(BigInt.prototype.valueOf);if(c)var g=a(Symbol.prototype.valueOf);function y(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function v(e){return"[object Map]"===u(e)}function m(e){return"[object Set]"===u(e)}function b(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function x(e){return"[object ArrayBuffer]"===u(e)}function _(e){return"undefined"!=typeof ArrayBuffer&&(x.working?x(e):e instanceof ArrayBuffer)}function T(e){return"[object DataView]"===u(e)}function j(e){return"undefined"!=typeof DataView&&(T.working?T(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||j(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},v.working="undefined"!=typeof Map&&v(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(v.working?v(e):e instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(m.working?m(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},x.working="undefined"!=typeof ArrayBuffer&&x(new ArrayBuffer),t.isArrayBuffer=_,T.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&T(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=j;var E="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function N(e){return"[object SharedArrayBuffer]"===u(e)}function O(e){return void 0!==E&&(void 0===N.working&&(N.working=N(new E)),N.working?N(e):e instanceof E)}function S(e){return y(e,h)}function I(e){return y(e,d)}function k(e){return y(e,f)}function A(e){return l&&y(e,p)}function R(e){return c&&y(e,g)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=S,t.isStringObject=I,t.isBooleanObject=k,t.isBigIntObject=A,t.isSymbolObject=R,t.isBoxedPrimitive=function(e){return S(e)||I(e)||k(e)||A(e)||R(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(_(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},5663:(e,t,r)=>{var n=r(2530),i=r(292),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},s=/%[sdj%]/g;t.format=function(e){if(!w(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,o=String(e).replace(s,(function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),a=n[r];r<i;a=n[++r])m(a)||!T(a)?o+=" "+a:o+=" "+u(a);return o},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?i.trace(r):i.error(r),o=!0}return e.apply(this,arguments)}};var a={},l=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),l=new RegExp("^"+c+"$","i")}function u(e,r){var n={seen:[],stylize:d};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),v(r)?n.showHidden=r:r&&t._extend(n,r),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=h),f(n,e,n.depth)}function h(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function d(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&N(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return w(i)||(i=f(e,i,n)),i}var o=function(e,t){if(x(t))return e.stylize("undefined","undefined");if(w(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return b(t)?e.stylize(""+t,"number"):v(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),E(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(N(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(_(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(j(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return p(r)}var c,u="",h=!1,d=["{","}"];return y(r)&&(h=!0,d=["[","]"]),N(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),_(r)&&(u=" "+RegExp.prototype.toString.call(r)),j(r)&&(u=" "+Date.prototype.toUTCString.call(r)),E(r)&&(u=" "+p(r)),0!==s.length||h&&0!=r.length?n<0?_(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=h?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)A(t,String(s))?o.push(g(e,t,r,n,String(s),!0)):o.push("");return i.forEach((function(i){i.match(/^\d+$/)||o.push(g(e,t,r,n,i,!0))})),o}(e,r,n,a,s):s.map((function(t){return g(e,r,n,a,t,h)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,d)):d[0]+u+d[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),A(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(l.value)<0?(a=m(r)?f(e,l.value,null):f(e,l.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),x(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function y(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function m(e){return null===e}function b(e){return"number"==typeof e}function w(e){return"string"==typeof e}function x(e){return void 0===e}function _(e){return T(e)&&"[object RegExp]"===O(e)}function T(e){return"object"==typeof e&&null!==e}function j(e){return T(e)&&"[object Date]"===O(e)}function E(e){return T(e)&&("[object Error]"===O(e)||e instanceof Error)}function N(e){return"function"==typeof e}function O(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(l.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);i.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(4489),t.isArray=y,t.isBoolean=v,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=b,t.isString=w,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=x,t.isRegExp=_,t.types.isRegExp=_,t.isObject=T,t.isDate=j,t.types.isDate=j,t.isError=E,t.types.isNativeError=E,t.isFunction=N,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(9397);var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),I[e.getMonth()],t].join(" ")}function A(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){i.log("%s - %s",k(),t.format.apply(t,arguments))},t.inherits=r(8575),t._extend=function(e,t){if(!t||!T(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var R="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function C(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(R&&e[R]){var t;if("function"!=typeof(t=e[R]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),R&&Object.defineProperty(t,R,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=R,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,t).then((function(e){n.nextTick(s.bind(null,null,e))}),(function(e){n.nextTick(C.bind(null,e,s))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},4010:(e,t,r)=>{"use strict";var n=r(4843),i=r(4343),o=r(7615),s=r(3828),a=o("Object.prototype.toString"),l=r(4111)(),c="undefined"==typeof globalThis?r.g:globalThis,u=i(),h=o("String.prototype.slice"),d={},f=Object.getPrototypeOf;l&&s&&f&&n(u,(function(e){if("function"==typeof c[e]){var t=new c[e];if(Symbol.toStringTag in t){var r=f(t),n=s(r,Symbol.toStringTag);if(!n){var i=f(r);n=s(i,Symbol.toStringTag)}d[e]=n.get}}}));var p=r(2527);e.exports=function(e){return!!p(e)&&(l&&Symbol.toStringTag in e?function(e){var t=!1;return n(d,(function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}})),t}(e):h(a(e),8,-1))}},7876:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},1123:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var s=[];for(n=0;o&&n<t;n++)s.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<r.length;n++)o=i(this,o,r[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(7876)(n)}catch(e){}},870:t=>{"use strict";t.exports=e},7670:()=>{},4343:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},5305:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!==n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===n(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,{Z:()=>i})}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={id:e,loaded:!1,exports:{}};return t[e].call(o.exports,o,o.exports,n),o.loaded=!0,o.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.hmd=e=>((e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:()=>{throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var i={};return(()=>{"use strict";n.r(i),n.d(i,{BlankNode:()=>l,Collection:()=>p,ConnectedStore:()=>ii,DataFactory:()=>Un,Empty:()=>Xt,Fetcher:()=>Cn,Formula:()=>Tr,IndexedFormula:()=>Cr,Literal:()=>d,LiveStore:()=>oi,N3Parser:()=>Yr,NamedNode:()=>c.Z,Namespace:()=>cr,NextId:()=>ni,Node:()=>jr,Query:()=>Or,RDFParser:()=>dn,RDFaProcessor:()=>un,SPARQLToQuery:()=>Pn,Serializer:()=>gr,Statement:()=>tr,Store:()=>Cr,UpdateManager:()=>Mn,UpdatesSocket:()=>Bn,UpdatesVia:()=>qn,Util:()=>ur,Variable:()=>nr,blankNode:()=>Xn,convert:()=>e,defaultGraph:()=>Qn,fetcher:()=>$n,fromNT:()=>ti,graph:()=>Zn,isBlankNode:()=>u.B2,isCollection:()=>u.uZ,isGraph:()=>u.NA,isLiteral:()=>u.n_,isNamedNode:()=>u.NX,isPredicate:()=>u.lx,isQuad:()=>u.PY,isRDFObject:()=>u.lt,isRDFlibObject:()=>u.Uc,isRDFlibPredicate:()=>u.nq,isRDFlibSubject:()=>u.f,isStatement:()=>u.Yi,isStore:()=>u.Pv,isSubject:()=>u.zz,isTerm:()=>u.jt,isVariable:()=>u.cG,jsonParser:()=>Dn,lit:()=>Vn,literal:()=>Wn,log:()=>lr.Z,namedNode:()=>Gn,parse:()=>pn,quad:()=>Yn,queryToSPARQL:()=>Ln,serialize:()=>vr,sparqlUpdateParser:()=>fn,st:()=>zn,sym:()=>Gn,term:()=>ri,termValue:()=>vn._,triple:()=>Kn,uri:()=>rr,variable:()=>Jn});var e={};n.r(e),n.d(e,{convertToJson:()=>Gt,convertToNQuads:()=>Jt});var t=n(5305),r=n(8333),o=n(4806),s=n(9247),a=n(292);class l extends o.Z{static getId(e){if(e){if("string"!=typeof e)throw a.log("Bad blank id:",e),new Error("Bad id argument to new blank node: "+e);if(e.includes("#")){let t=e.split("#");return t[t.length-1]}return e}return"n"+l.nextId++}constructor(e){super(l.getId(e)),(0,t.Z)(this,"termType",s.V1),(0,t.Z)(this,"classOrder",r.Z.BlankNode),(0,t.Z)(this,"isBlank",1),(0,t.Z)(this,"isVar",1)}get id(){return this.value}set id(e){this.value=e}compareTerm(e){return this.classOrder<e.classOrder?-1:this.classOrder>e.classOrder?1:this.id<e.id?-1:this.id>e.id?1:0}copy(e){var t=new l;return e.copyTo(this,t),t}toCanonical(){return l.NTAnonymousNodePrefix+this.value}toString(){return l.NTAnonymousNodePrefix+this.id}}(0,t.Z)(l,"nextId",0),(0,t.Z)(l,"NTAnonymousNodePrefix","_:");var c=n(6545),u=n(5904);const h={boolean:new c.Z("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:new c.Z("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:new c.Z("http://www.w3.org/2001/XMLSchema#decimal"),double:new c.Z("http://www.w3.org/2001/XMLSchema#double"),integer:new c.Z("http://www.w3.org/2001/XMLSchema#integer"),langString:new c.Z("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:new c.Z("http://www.w3.org/2001/XMLSchema#string")};class d extends o.Z{constructor(e,n,i){super(e),(0,t.Z)(this,"termType",s.xH),(0,t.Z)(this,"classOrder",r.Z.Literal),(0,t.Z)(this,"datatype",h.string),(0,t.Z)(this,"isVar",0),(0,t.Z)(this,"language",""),n?(this.language=n,this.datatype=h.langString):this.datatype=i?c.Z.fromValue(i):h.string}copy(){return new d(this.value,this.lang,this.datatype)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(!this.datatype&&!e.datatype||this.datatype&&this.datatype.equals(e.datatype))}get lang(){return this.language}set lang(e){this.language=e||""}toNT(){return d.toNT(this)}static toNT(e){if("number"==typeof e.value)return""+e.value;if("string"!=typeof e.value)throw new Error("Value of RDF literal is not string or number: "+e.value);var t=e.value;return t='"'+(t=(t=(t=(t=t.replace(/\\/g,"\\\\")).replace(/\"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r"))+'"',e.language?t+="@"+e.language:e.datatype.equals(h.string)||(t+="^^"+e.datatype.toCanonical()),t}toString(){return""+this.value}static fromBoolean(e){return new d(e?"1":"0",null,h.boolean)}static fromDate(e){if(!(e instanceof Date))throw new TypeError("Invalid argument to Literal.fromDate()");let t=function(e){return(""+(100+e)).slice(1,3)},r=e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+":"+t(e.getUTCMinutes())+":"+t(e.getUTCSeconds())+"Z";return new d(r,null,h.dateTime)}static fromNumber(e){if("number"!=typeof e)throw new TypeError("Invalid argument to Literal.fromNumber()");let t;const r=e.toString();return t=r.indexOf("e")<0&&Math.abs(e)<=Number.MAX_SAFE_INTEGER?Number.isInteger(e)?h.integer:h.decimal:h.double,new d(r,null,t)}static fromValue(e){if((0,u.n_)(e))return e;switch(typeof e){case"object":if(e instanceof Date)return d.fromDate(e);case"boolean":return d.fromBoolean(e);case"number":return d.fromNumber(e);case"string":return new d(e)}throw new Error("Can't make literal from "+e+" of type "+typeof e)}}function f(e){return null==e||(0,u.jt)(e)?e:Array.isArray(e)?new p(e):d.fromValue(e)}class p extends o.Z{constructor(e){super((l.nextId++).toString()),(0,t.Z)(this,"termType",s.fb),(0,t.Z)(this,"classOrder",r.Z.Collection),(0,t.Z)(this,"closed",!1),(0,t.Z)(this,"compareTerm",l.prototype.compareTerm),(0,t.Z)(this,"elements",[]),(0,t.Z)(this,"isVar",0),e&&e.length>0&&e.forEach((e=>{this.elements.push(f(e))}))}get id(){return this.value}set id(e){this.value=e}append(e){return this.elements.push(e)}close(){return this.closed=!0,this.closed}shift(){return this.elements.shift()}substitute(e){const t=this.elements.map((t=>t.substitute(e)));return new p(t)}toNT(){return p.toNT(this)}static toNT(e){return l.NTAnonymousNodePrefix+e.id}toString(){return"("+this.elements.join(" ")+")"}unshift(e){return this.elements.unshift(e)}}(0,t.Z)(p,"termType",s.fb);var g=n(2530),y=n(292);function v(e){return function(...t){var r=t.pop();return e.call(this,t,r)}}var m="function"==typeof queueMicrotask&&queueMicrotask,b="function"==typeof setImmediate&&setImmediate,w="object"==typeof g&&"function"==typeof g.nextTick;function x(e){setTimeout(e,0)}function _(e){return(t,...r)=>e((()=>t(...r)))}var T=_(m?queueMicrotask:b?setImmediate:w?g.nextTick:x);function j(e){return O(e)?function(...t){const r=t.pop();return E(e.apply(this,t),r)}:v((function(t,r){var n;try{n=e.apply(this,t)}catch(e){return r(e)}if(n&&"function"==typeof n.then)return E(n,r);r(null,n)}))}function E(e,t){return e.then((e=>{N(t,null,e)}),(e=>{N(t,e&&e.message?e:new Error(e))}))}function N(e,t,r){try{e(t,r)}catch(e){T((e=>{throw e}),e)}}function O(e){return"AsyncFunction"===e[Symbol.toStringTag]}function S(e){if("function"!=typeof e)throw new Error("expected a function");return O(e)?j(e):e}function I(e,t=e.length){if(!t)throw new Error("arity is undefined");return function(...r){return"function"==typeof r[t-1]?e.apply(this,r):new Promise(((n,i)=>{r[t-1]=(e,...t)=>{if(e)return i(e);n(t.length>1?t:t[0])},e.apply(this,r)}))}}function k(e){return function(t,...r){return I((function(n){var i=this;return e(t,((e,t)=>{S(e).apply(i,r.concat(t))}),n)}))}}function A(e,t,r,n){t=t||[];var i=[],o=0,s=S(r);return e(t,((e,t,r)=>{var n=o++;s(e,((e,t)=>{i[n]=t,r(e)}))}),(e=>{n(e,i)}))}function R(e){return e&&"number"==typeof e.length&&e.length>=0&&e.length%1==0}const C={};function D(e){function t(...t){if(null!==e){var r=e;e=null,r.apply(this,t)}}return Object.assign(t,e),t}function L(e){return function(...t){if(null===e)throw new Error("Callback was already called.");var r=e;e=null,r.apply(this,t)}}function P(e,t,r,n){let i=!1,o=!1,s=!1,a=0,l=0;function c(){a>=t||s||i||(s=!0,e.next().then((({value:e,done:t})=>{if(!o&&!i){if(s=!1,t)return i=!0,void(a<=0&&n(null));a++,r(e,l,u),l++,c()}})).catch(h))}function u(e,t){if(a-=1,!o)return e?h(e):!1===e?(i=!0,void(o=!0)):t===C||i&&a<=0?(i=!0,n(null)):void c()}function h(e){o||(s=!1,i=!0,n(e))}c()}var M=e=>(t,r,n)=>{if(n=D(n),e<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!t)return n(null);if("AsyncGenerator"===t[Symbol.toStringTag])return P(t,e,r,n);if(function(e){return"function"==typeof e[Symbol.asyncIterator]}(t))return P(t[Symbol.asyncIterator](),e,r,n);var i=function(e){if(R(e))return function(e){var t=-1,r=e.length;return function(){return++t<r?{value:e[t],key:t}:null}}(e);var t,r,n,i,o=function(e){return e[Symbol.iterator]&&e[Symbol.iterator]()}(e);return o?function(e){var t=-1;return function(){var r=e.next();return r.done?null:(t++,{value:r.value,key:t})}}(o):(r=(t=e)?Object.keys(t):[],n=-1,i=r.length,function e(){var o=r[++n];return"__proto__"===o?e():n<i?{value:t[o],key:o}:null})}(t),o=!1,s=!1,a=0,l=!1;function c(e,t){if(!s)if(a-=1,e)o=!0,n(e);else if(!1===e)o=!0,s=!0;else{if(t===C||o&&a<=0)return o=!0,n(null);l||u()}}function u(){for(l=!0;a<e&&!o;){var t=i();if(null===t)return o=!0,void(a<=0&&n(null));a+=1,r(t.value,t.key,L(c))}l=!1}u()},F=I((function(e,t,r,n){return M(t)(e,S(r),n)}),4);function U(e,t,r){r=D(r);var n=0,i=0,{length:o}=e,s=!1;function a(e,t){!1===e&&(s=!0),!0!==s&&(e?r(e):++i!==o&&t!==C||r(null))}for(0===o&&r(null);n<o;n++)t(e[n],n,L(a))}function B(e,t,r){return F(e,1/0,t,r)}var q=I((function(e,t,r){return(R(e)?U:B)(e,S(t),r)}),3),H=I((function(e,t,r){return A(q,e,t,r)}),3),$=k(H),Z=I((function(e,t,r){return F(e,1,t,r)}),3),V=I((function(e,t,r){return A(Z,e,t,r)}),3),z=k(V);const G=Symbol("promiseCallback");function J(){let e,t;function r(r,...n){if(r)return t(r);e(n.length>1?n:n[0])}return r[G]=new Promise(((r,n)=>{e=r,t=n})),r}function X(e,t,r){"number"!=typeof t&&(r=t,t=null),r=D(r||J());var n=Object.keys(e).length;if(!n)return r(null);t||(t=n);var i={},o=0,s=!1,a=!1,l=Object.create(null),c=[],u=[],h={};function d(e,t){c.push((()=>function(e,t){if(!a){var n=L(((t,...n)=>{if(o--,!1!==t)if(n.length<2&&([n]=n),t){var c={};if(Object.keys(i).forEach((e=>{c[e]=i[e]})),c[e]=n,a=!0,l=Object.create(null),s)return;r(t,c)}else i[e]=n,(l[e]||[]).forEach((e=>e())),f();else s=!0}));o++;var c=S(t[t.length-1]);t.length>1?c(i,n):c(n)}}(e,t)))}function f(){if(!s){if(0===c.length&&0===o)return r(null,i);for(;c.length&&o<t;)c.shift()()}}function p(t){var r=[];return Object.keys(e).forEach((n=>{const i=e[n];Array.isArray(i)&&i.indexOf(t)>=0&&r.push(n)})),r}return Object.keys(e).forEach((t=>{var r=e[t];if(!Array.isArray(r))return d(t,[r]),void u.push(t);var n=r.slice(0,r.length-1),i=n.length;if(0===i)return d(t,r),void u.push(t);h[t]=i,n.forEach((o=>{if(!e[o])throw new Error("async.auto task `"+t+"` has a non-existent dependency `"+o+"` in "+n.join(", "));var s,a;(a=l[s=o])||(a=l[s]=[]),a.push((()=>{0==--i&&d(t,r)}))}))})),function(){for(var e=0;u.length;)e++,p(u.pop()).forEach((e=>{0==--h[e]&&u.push(e)}));if(e!==n)throw new Error("async.auto cannot execute tasks due to a recursive dependency")}(),f(),r[G]}var Q=/^(?:async\s+)?(?:function)?\s*\w*\s*\(\s*([^)]+)\s*\)(?:\s*{)/,W=/^(?:async\s+)?\(?\s*([^)=]+)\s*\)?(?:\s*=>)/,Y=/,/,K=/(=.+)?(\s*)$/;class ee{constructor(){this.head=this.tail=null,this.length=0}removeLink(e){return e.prev?e.prev.next=e.next:this.head=e.next,e.next?e.next.prev=e.prev:this.tail=e.prev,e.prev=e.next=null,this.length-=1,e}empty(){for(;this.head;)this.shift();return this}insertAfter(e,t){t.prev=e,t.next=e.next,e.next?e.next.prev=t:this.tail=t,e.next=t,this.length+=1}insertBefore(e,t){t.prev=e.prev,t.next=e,e.prev?e.prev.next=t:this.head=t,e.prev=t,this.length+=1}unshift(e){this.head?this.insertBefore(this.head,e):te(this,e)}push(e){this.tail?this.insertAfter(this.tail,e):te(this,e)}shift(){return this.head&&this.removeLink(this.head)}pop(){return this.tail&&this.removeLink(this.tail)}toArray(){return[...this]}*[Symbol.iterator](){for(var e=this.head;e;)yield e.data,e=e.next}remove(e){for(var t=this.head;t;){var{next:r}=t;e(t)&&this.removeLink(t),t=r}return this}}function te(e,t){e.length=1,e.head=e.tail=t}function re(e,t,r){if(null==t)t=1;else if(0===t)throw new RangeError("Concurrency must not be zero");var n=S(e),i=0,o=[];const s={error:[],drain:[],saturated:[],unsaturated:[],empty:[]};function a(e,t){return e?t?void(s[e]=s[e].filter((e=>e!==t))):s[e]=[]:Object.keys(s).forEach((e=>s[e]=[]))}function l(e,...t){s[e].forEach((e=>e(...t)))}var c=!1;function u(e,t,r,n){if(null!=n&&"function"!=typeof n)throw new Error("task callback must be a function");var i,o;function s(e,...t){return e?r?o(e):i():t.length<=1?i(t[0]):void i(t)}g.started=!0;var a=g._createTaskItem(e,r?s:n||s);if(t?g._tasks.unshift(a):g._tasks.push(a),c||(c=!0,T((()=>{c=!1,g.process()}))),r||!n)return new Promise(((e,t)=>{i=e,o=t}))}function h(e){return function(t,...r){i-=1;for(var n=0,s=e.length;n<s;n++){var a=e[n],c=o.indexOf(a);0===c?o.shift():c>0&&o.splice(c,1),a.callback(t,...r),null!=t&&l("error",t,a.data)}i<=g.concurrency-g.buffer&&l("unsaturated"),g.idle()&&l("drain"),g.process()}}function d(e){return!(0!==e.length||!g.idle()||(T((()=>l("drain"))),0))}const f=e=>t=>{if(!t)return new Promise(((t,r)=>{!function(e,n){const i=(...n)=>{a(e,i),((e,n)=>{if(e)return r(e);t(n)})(...n)};s[e].push(i)}(e)}));a(e),function(e,t){s[e].push(t)}(e,t)};var p=!1,g={_tasks:new ee,_createTaskItem:(e,t)=>({data:e,callback:t}),*[Symbol.iterator](){yield*g._tasks[Symbol.iterator]()},concurrency:t,payload:r,buffer:t/4,started:!1,paused:!1,push(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>u(e,!1,!1,t)))}return u(e,!1,!1,t)},pushAsync(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>u(e,!1,!0,t)))}return u(e,!1,!0,t)},kill(){a(),g._tasks.empty()},unshift(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>u(e,!0,!1,t)))}return u(e,!0,!1,t)},unshiftAsync(e,t){if(Array.isArray(e)){if(d(e))return;return e.map((e=>u(e,!0,!0,t)))}return u(e,!0,!0,t)},remove(e){g._tasks.remove(e)},process(){if(!p){for(p=!0;!g.paused&&i<g.concurrency&&g._tasks.length;){var e=[],t=[],r=g._tasks.length;g.payload&&(r=Math.min(r,g.payload));for(var s=0;s<r;s++){var a=g._tasks.shift();e.push(a),o.push(a),t.push(a.data)}i+=1,0===g._tasks.length&&l("empty"),i===g.concurrency&&l("saturated");var c=L(h(e));n(t,c)}p=!1}},length:()=>g._tasks.length,running:()=>i,workersList:()=>o,idle:()=>g._tasks.length+i===0,pause(){g.paused=!0},resume(){!1!==g.paused&&(g.paused=!1,T(g.process))}};return Object.defineProperties(g,{saturated:{writable:!1,value:f("saturated")},unsaturated:{writable:!1,value:f("unsaturated")},empty:{writable:!1,value:f("empty")},drain:{writable:!1,value:f("drain")},error:{writable:!1,value:f("error")}}),g}var ne=I((function(e,t,r,n){n=D(n);var i=S(r);return Z(e,((e,r,n)=>{i(t,e,((e,r)=>{t=r,n(e)}))}),(e=>n(e,t)))}),4);function ie(...e){var t=e.map(S);return function(...e){var r=this,n=e[e.length-1];return"function"==typeof n?e.pop():n=J(),ne(t,e,((e,t,n)=>{t.apply(r,e.concat(((e,...t)=>{n(e,t)})))}),((e,t)=>n(e,...t))),n[G]}}var oe=I((function(e,t,r,n){return A(M(t),e,r,n)}),4),se=I((function(e,t,r,n){var i=S(r);return oe(e,t,((e,t)=>{i(e,((e,...r)=>e?t(e):t(e,r)))}),((e,t)=>{for(var r=[],i=0;i<t.length;i++)t[i]&&(r=r.concat(...t[i]));return n(e,r)}))}),4),ae=I((function(e,t,r){return se(e,1/0,t,r)}),3),le=I((function(e,t,r){return se(e,1,t,r)}),3);function ce(e,t){return(r,n,i,o)=>{var s,a=!1;const l=S(i);r(n,((r,n,i)=>{l(r,((n,o)=>n||!1===n?i(n):e(o)&&!s?(a=!0,s=t(!0,r),i(null,C)):void i()))}),(e=>{if(e)return o(e);o(null,a?s:t(!1))}))}}var ue=I((function(e,t,r){return ce((e=>e),((e,t)=>t))(q,e,t,r)}),3),he=I((function(e,t,r,n){return ce((e=>e),((e,t)=>t))(M(t),e,r,n)}),4),de=I((function(e,t,r){return ce((e=>e),((e,t)=>t))(M(1),e,t,r)}),3);function fe(e){return(t,...r)=>S(t)(...r,((t,...r)=>{"object"==typeof y&&(t?y.error&&y.error(t):y[e]&&r.forEach((t=>y[e](t))))}))}var pe=fe("dir"),ge=I((function(e,t,r){r=L(r);var n,i=S(e),o=S(t);function s(e,...t){if(e)return r(e);!1!==e&&(n=t,o(...t,a))}function a(e,t){return e?r(e):!1!==e?t?void i(s):r(null,...n):void 0}return a(null,!0)}),3);function ye(e){return(t,r,n)=>e(t,n)}var ve=I((function(e,t,r){return q(e,ye(S(t)),r)}),3),me=I((function(e,t,r,n){return M(t)(e,ye(S(r)),n)}),4),be=I((function(e,t,r){return me(e,1,t,r)}),3);function we(e){return O(e)?e:function(...t){var r=t.pop(),n=!0;t.push(((...e)=>{n?T((()=>r(...e))):r(...e)})),e.apply(this,t),n=!1}}var xe=I((function(e,t,r){return ce((e=>!e),(e=>!e))(q,e,t,r)}),3),_e=I((function(e,t,r,n){return ce((e=>!e),(e=>!e))(M(t),e,r,n)}),4),Te=I((function(e,t,r){return ce((e=>!e),(e=>!e))(Z,e,t,r)}),3);function je(e,t,r,n){var i=new Array(t.length);e(t,((e,t,n)=>{r(e,((e,r)=>{i[t]=!!r,n(e)}))}),(e=>{if(e)return n(e);for(var r=[],o=0;o<t.length;o++)i[o]&&r.push(t[o]);n(null,r)}))}function Ee(e,t,r,n){var i=[];e(t,((e,t,n)=>{r(e,((r,o)=>{if(r)return n(r);o&&i.push({index:t,value:e}),n(r)}))}),(e=>{if(e)return n(e);n(null,i.sort(((e,t)=>e.index-t.index)).map((e=>e.value)))}))}function Ne(e,t,r,n){return(R(t)?je:Ee)(e,t,S(r),n)}var Oe=I((function(e,t,r){return Ne(q,e,t,r)}),3),Se=I((function(e,t,r,n){return Ne(M(t),e,r,n)}),4),Ie=I((function(e,t,r){return Ne(Z,e,t,r)}),3),ke=I((function(e,t){var r=L(t),n=S(we(e));return function e(t){if(t)return r(t);!1!==t&&n(e)}()}),2),Ae=I((function(e,t,r,n){var i=S(r);return oe(e,t,((e,t)=>{i(e,((r,n)=>r?t(r):t(r,{key:n,val:e})))}),((e,t)=>{for(var r={},{hasOwnProperty:i}=Object.prototype,o=0;o<t.length;o++)if(t[o]){var{key:s}=t[o],{val:a}=t[o];i.call(r,s)?r[s].push(a):r[s]=[a]}return n(e,r)}))}),4),Re=fe("log"),Ce=I((function(e,t,r,n){n=D(n);var i={},o=S(r);return M(t)(e,((e,t,r)=>{o(e,t,((e,n)=>{if(e)return r(e);i[t]=n,r(e)}))}),(e=>n(e,i)))}),4),De=_(w?g.nextTick:b?setImmediate:x),Le=I(((e,t,r)=>{var n=R(t)?[]:{};e(t,((e,t,r)=>{S(e)(((e,...i)=>{i.length<2&&([i]=i),n[t]=i,r(e)}))}),(e=>r(e,n)))}),3);function Pe(e,t){var r=S(e);return re(((e,t)=>{r(e[0],t)}),t,1)}class Me{constructor(){this.heap=[],this.pushCount=Number.MIN_SAFE_INTEGER}get length(){return this.heap.length}empty(){return this.heap=[],this}percUp(e){let t;for(;e>0&&Ue(this.heap[e],this.heap[t=Fe(e)]);){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}percDown(e){let t;for(;(t=1+(e<<1))<this.heap.length&&(t+1<this.heap.length&&Ue(this.heap[t+1],this.heap[t])&&(t+=1),!Ue(this.heap[e],this.heap[t]));){let r=this.heap[e];this.heap[e]=this.heap[t],this.heap[t]=r,e=t}}push(e){e.pushCount=++this.pushCount,this.heap.push(e),this.percUp(this.heap.length-1)}unshift(e){return this.heap.push(e)}shift(){let[e]=this.heap;return this.heap[0]=this.heap[this.heap.length-1],this.heap.pop(),this.percDown(0),e}toArray(){return[...this]}*[Symbol.iterator](){for(let e=0;e<this.heap.length;e++)yield this.heap[e].data}remove(e){let t=0;for(let r=0;r<this.heap.length;r++)e(this.heap[r])||(this.heap[t]=this.heap[r],t++);this.heap.splice(t);for(let e=Fe(this.heap.length-1);e>=0;e--)this.percDown(e);return this}}function Fe(e){return(e+1>>1)-1}function Ue(e,t){return e.priority!==t.priority?e.priority<t.priority:e.pushCount<t.pushCount}var Be=I((function(e,t){if(t=D(t),!Array.isArray(e))return t(new TypeError("First argument to race must be an array of functions"));if(!e.length)return t();for(var r=0,n=e.length;r<n;r++)S(e[r])(t)}),2);function qe(e,t,r,n){var i=[...e].reverse();return ne(i,t,r,n)}function He(e){var t=S(e);return v((function(e,r){return e.push(((e,...t)=>{let n={};if(e&&(n.error=e),t.length>0){var i=t;t.length<=1&&([i]=t),n.value=i}r(null,n)})),t.apply(this,e)}))}function $e(e,t,r,n){const i=S(r);return Ne(e,t,((e,t)=>{i(e,((e,r)=>{t(e,!r)}))}),n)}var Ze=I((function(e,t,r){return $e(q,e,t,r)}),3),Ve=I((function(e,t,r,n){return $e(M(t),e,r,n)}),4),ze=I((function(e,t,r){return $e(Z,e,t,r)}),3);function Ge(e){return function(){return e}}function Je(e,t,r){var n={times:5,intervalFunc:Ge(0)};if(arguments.length<3&&"function"==typeof e?(r=t||J(),t=e):(Xe(n,e),r=r||J()),"function"!=typeof t)throw new Error("Invalid arguments for async.retry");var i=S(t),o=1;function s(){i(((e,...t)=>{!1!==e&&(e&&o++<n.times&&("function"!=typeof n.errorFilter||n.errorFilter(e))?setTimeout(s,n.intervalFunc(o-1)):r(e,...t))}))}return s(),r[G]}function Xe(e,t){if("object"==typeof t)e.times=+t.times||5,e.intervalFunc="function"==typeof t.interval?t.interval:Ge(+t.interval||0),e.errorFilter=t.errorFilter;else{if("number"!=typeof t&&"string"!=typeof t)throw new Error("Invalid arguments for async.retry");e.times=+t||5}}var Qe=I((function(e,t,r){return ce(Boolean,(e=>e))(q,e,t,r)}),3),We=I((function(e,t,r,n){return ce(Boolean,(e=>e))(M(t),e,r,n)}),4),Ye=I((function(e,t,r){return ce(Boolean,(e=>e))(Z,e,t,r)}),3),Ke=I((function(e,t,r){var n=S(t);return H(e,((e,t)=>{n(e,((r,n)=>{if(r)return t(r);t(r,{value:e,criteria:n})}))}),((e,t)=>{if(e)return r(e);r(null,t.sort(i).map((e=>e.value)))}));function i(e,t){var r=e.criteria,n=t.criteria;return r<n?-1:r>n?1:0}}),3);function et(e,t,r,n){var i=S(r);return oe(function(e){for(var t=Array(e);e--;)t[e]=e;return t}(e),t,i,n)}var tt=I((function(e,t){var r,n=null;return be(e,((e,t)=>{S(e)(((e,...i)=>{if(!1===e)return t(e);i.length<2?[r]=i:r=i,n=e,t(e?null:{})}))}),(()=>t(n,r)))})),rt=I((function(e,t,r){r=L(r);var n=S(t),i=S(e),o=[];function s(e,...t){if(e)return r(e);o=t,!1!==e&&i(a)}function a(e,t){return e?r(e):!1!==e?t?void n(s):r(null,...o):void 0}return i(a)}),3),nt=I((function(e,t){if(t=D(t),!Array.isArray(e))return t(new Error("First argument to waterfall must be an array of functions"));if(!e.length)return t();var r=0;function n(t){S(e[r++])(...t,L(i))}function i(i,...o){if(!1!==i)return i||r===e.length?t(i,...o):void n(o)}n([])}));const it={apply:function(e,...t){return(...r)=>e(...t,...r)},applyEach:$,applyEachSeries:z,asyncify:j,auto:X,autoInject:function(e,t){var r={};return Object.keys(e).forEach((t=>{var n,i=e[t],o=O(i),s=!o&&1===i.length||o&&0===i.length;if(Array.isArray(i))n=[...i],i=n.pop(),r[t]=n.concat(n.length>0?a:i);else if(s)r[t]=i;else{if(n=function(e){const t=function(e){let t="",r=0,n=e.indexOf("*/");for(;r<e.length;)if("/"===e[r]&&"/"===e[r+1]){let t=e.indexOf("\n",r);r=-1===t?e.length:t}else if(-1!==n&&"/"===e[r]&&"*"===e[r+1]){let i=e.indexOf("*/",r);-1!==i?(r=i+2,n=e.indexOf("*/",r)):(t+=e[r],r++)}else t+=e[r],r++;return t}(e.toString());let r=t.match(Q);if(r||(r=t.match(W)),!r)throw new Error("could not parse args in autoInject\nSource:\n"+t);let[,n]=r;return n.replace(/\s/g,"").split(Y).map((e=>e.replace(K,"").trim()))}(i),0===i.length&&!o&&0===n.length)throw new Error("autoInject task functions require explicit parameters.");o||n.pop(),r[t]=n.concat(a)}function a(e,t){var r=n.map((t=>e[t]));r.push(t),S(i)(...r)}})),X(r,t)},cargo:function(e,t){return re(e,1,t)},cargoQueue:function(e,t,r){return re(e,t,r)},compose:function(...e){return ie(...e.reverse())},concat:ae,concatLimit:se,concatSeries:le,constant:function(...e){return function(...t){return t.pop()(null,...e)}},detect:ue,detectLimit:he,detectSeries:de,dir:pe,doUntil:function(e,t,r){const n=S(t);return ge(e,((...e)=>{const t=e.pop();n(...e,((e,r)=>t(e,!r)))}),r)},doWhilst:ge,each:ve,eachLimit:me,eachOf:q,eachOfLimit:F,eachOfSeries:Z,eachSeries:be,ensureAsync:we,every:xe,everyLimit:_e,everySeries:Te,filter:Oe,filterLimit:Se,filterSeries:Ie,forever:ke,groupBy:function(e,t,r){return Ae(e,1/0,t,r)},groupByLimit:Ae,groupBySeries:function(e,t,r){return Ae(e,1,t,r)},log:Re,map:H,mapLimit:oe,mapSeries:V,mapValues:function(e,t,r){return Ce(e,1/0,t,r)},mapValuesLimit:Ce,mapValuesSeries:function(e,t,r){return Ce(e,1,t,r)},memoize:function(e,t=(e=>e)){var r=Object.create(null),n=Object.create(null),i=S(e),o=v(((e,o)=>{var s=t(...e);s in r?T((()=>o(null,...r[s]))):s in n?n[s].push(o):(n[s]=[o],i(...e,((e,...t)=>{e||(r[s]=t);var i=n[s];delete n[s];for(var o=0,a=i.length;o<a;o++)i[o](e,...t)})))}));return o.memo=r,o.unmemoized=e,o},nextTick:De,parallel:function(e,t){return Le(q,e,t)},parallelLimit:function(e,t,r){return Le(M(t),e,r)},priorityQueue:function(e,t){var r=Pe(e,t),{push:n,pushAsync:i}=r;function o(e,t){return Array.isArray(e)?e.map((e=>({data:e,priority:t}))):{data:e,priority:t}}return r._tasks=new Me,r._createTaskItem=({data:e,priority:t},r)=>({data:e,priority:t,callback:r}),r.push=function(e,t=0,r){return n(o(e,t),r)},r.pushAsync=function(e,t=0,r){return i(o(e,t),r)},delete r.unshift,delete r.unshiftAsync,r},queue:Pe,race:Be,reduce:ne,reduceRight:qe,reflect:He,reflectAll:function(e){var t;return Array.isArray(e)?t=e.map(He):(t={},Object.keys(e).forEach((r=>{t[r]=He.call(this,e[r])}))),t},reject:Ze,rejectLimit:Ve,rejectSeries:ze,retry:Je,retryable:function(e,t){t||(t=e,e=null);let r=e&&e.arity||t.length;O(t)&&(r+=1);var n=S(t);return v(((t,i)=>{function o(e){n(...t,e)}return(t.length<r-1||null==i)&&(t.push(i),i=J()),e?Je(e,o,i):Je(o,i),i[G]}))},seq:ie,series:function(e,t){return Le(Z,e,t)},setImmediate:T,some:Qe,someLimit:We,someSeries:Ye,sortBy:Ke,timeout:function(e,t,r){var n=S(e);return v(((i,o)=>{var s,a=!1;i.push(((...e)=>{a||(o(...e),clearTimeout(s))})),s=setTimeout((function(){var t=e.name||"anonymous",n=new Error('Callback function "'+t+'" timed out.');n.code="ETIMEDOUT",r&&(n.info=r),a=!0,o(n)}),t),n(...i)}))},times:function(e,t,r){return et(e,1/0,t,r)},timesLimit:et,timesSeries:function(e,t,r){return et(e,1,t,r)},transform:function(e,t,r,n){arguments.length<=3&&"function"==typeof t&&(n=r,r=t,t=Array.isArray(e)?[]:{}),n=D(n||J());var i=S(r);return q(e,((e,r,n)=>{i(t,e,r,n)}),(e=>n(e,t))),n[G]},tryEach:tt,unmemoize:function(e){return(...t)=>(e.unmemoized||e)(...t)},until:function(e,t,r){const n=S(e);return rt((e=>n(((t,r)=>e(t,!r)))),t,r)},waterfall:nt,whilst:rt,all:xe,allLimit:_e,allSeries:Te,any:Qe,anyLimit:We,anySeries:Ye,find:ue,findLimit:he,findSeries:de,flatMap:ae,flatMapLimit:se,flatMapSeries:le,forEach:ve,forEachSeries:be,forEachLimit:me,forEachOf:q,forEachOfSeries:Z,forEachOfLimit:F,inject:ne,foldl:ne,foldr:qe,select:Oe,selectLimit:Se,selectSeries:Ie,wrapSync:j,during:rt,doDuring:ge};var ot=n(730),st=n.n(ot);const at="http://www.w3.org/1999/02/22-rdf-syntax-ns#",lt="http://www.w3.org/2001/XMLSchema#",ct="http://www.w3.org/2000/10/swap/",ut={xsd:{decimal:`${lt}decimal`,boolean:`${lt}boolean`,double:`${lt}double`,integer:`${lt}integer`,string:`${lt}string`},rdf:{type:`${at}type`,nil:`${at}nil`,first:`${at}first`,rest:`${at}rest`,langString:`${at}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${ct}reify#forSome`,forAll:`${ct}reify#forAll`},log:{implies:`${ct}log#implies`}};var ht=n(5929),dt=n.n(ht),ft=n(2486).lW;const{xsd:pt}=ut,gt=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,yt={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},vt=/[\x00-\x20<>\\"\{\}\|\^\`]/,mt={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},bt=/$0^/;class wt{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in mt)&&this[e]instanceof RegExp&&(this[e]=bt)}else this._n3Mode=!1!==e.n3;this._comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,n=r.length;for(;;){let e,s;for(;e=this._newline.exec(r);)this._comments&&(s=this._comment.exec(e[0]))&&i("comment",s[1],"",this._line,e[0].length),r=r.substr(e[0].length,r.length),n=r.length,this._line++;if(!e&&(e=this._whitespace.exec(r))&&(r=r.substr(e[0].length,r.length)),this._endOfFile.test(r))return t&&(this._comments&&(s=this._comment.exec(r))&&i("comment",s[1],"",this._line,r.length),r=null,i("eof","","",this._line,0)),this._input=r;const a=this._line,l=r[0];let c="",u="",h="",d=null,f=0,p=!1;switch(l){case"^":if(r.length<3)break;if("^"!==r[1]){this._n3Mode&&(f=1,c="^");break}if(this._previousMarker="^^",r=r.substr(2),"<"!==r[0]){p=!0;break}case"<":if(d=this._unescapedIri.exec(r))c="IRI",u=d[1];else if(d=this._iri.exec(r)){if(u=this._unescape(d[1]),null===u||vt.test(u))return o(this);c="IRI"}else r.length>1&&"<"===r[1]?(c="<<",f=2):this._n3Mode&&r.length>1&&"="===r[1]&&(c="inverse",f=2,u=">");break;case">":r.length>1&&">"===r[1]&&(c=">>",f=2);break;case"_":((d=this._blank.exec(r))||t&&(d=this._blank.exec(`${r} `)))&&(c="blank",h="_",u=d[1]);break;case'"':if(d=this._simpleQuotedString.exec(r))u=d[1];else if(({value:u,matchLength:f}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===f||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(d=this._simpleApostropheString.exec(r))u=d[1];else if(({value:u,matchLength:f}=this._parseLiteral(r)),null===u)return o(this);null===d&&0===f||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(d=this._variable.exec(r))&&(c="var",u=d[0]);break;case"@":"literal"===this._previousMarker&&(d=this._langcode.exec(r))?(c="langcode",u=d[1]):(d=this._keyword.exec(r))&&(c=d[0]);break;case".":if(1===r.length?t:r[1]<"0"||r[1]>"9"){c=".",f=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(d=this._number.exec(r)||t&&(d=this._number.exec(`${r} `)))&&(c="literal",u=d[0],h="string"==typeof d[1]?pt.double:"string"==typeof d[2]?pt.decimal:pt.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(d=this._sparqlKeyword.exec(r))?c=d[0].toUpperCase():p=!0;break;case"f":case"t":(d=this._boolean.exec(r))?(c="literal",u=d[0],h=pt.boolean):p=!0;break;case"a":(d=this._shortPredicates.exec(r))?(c="abbreviation",u="a"):p=!0;break;case"=":this._n3Mode&&r.length>1&&(c="abbreviation",">"!==r[1]?(f=1,u="="):(f=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":this._lineMode||(f=1,c=l);break;default:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(d=this._prefix.exec(r))?((d=this._prefixed.exec(r))||t&&(d=this._prefixed.exec(`${r} `)))&&(c="prefixed",h=d[1]||"",u=this._unescape(d[2])):(c="prefix",u=d[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?o(this):this._input=r;const g=f||d[0].length,y=i(c,u,h,a,g);this.previousToken=y,this._previousMarker=c,r=r.substr(g,r.length)}function i(t,i,o,s,a){const l=r?n-r.length:n,c={type:t,value:i,prefix:o,line:s,start:l,end:l+a};return e(null,c),c}function o(t){e(t._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(gt,((e,r,n,i)=>{if("string"==typeof r)return String.fromCharCode(Number.parseInt(r,16));if("string"==typeof n){let e=Number.parseInt(n,16);return e<=65535?String.fromCharCode(Number.parseInt(n,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in yt?yt[i]:(t=!0,"")}));return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let n=Math.max(this._literalClosingPos,r);for(;(n=e.indexOf(t,n))>0;){let t=0;for(;"\\"===e[n-t-1];)t++;if(t%2==0){const t=e.substring(r,n),i=t.split(/\r\n|\r|\n/).length-1,o=n+r;if(1===r&&0!==i||3===r&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:o}}n++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((r,n)=>r?t=r:e.push(n)),!0),t)throw t;return e}dt()((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=ft.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}const{rdf:xt,xsd:_t}=ut;let Tt,jt=0;const Et={namedNode:function(e){return new Ot(e)},blankNode:function(e){return new It(e||"n3-"+jt++)},variable:function(e){return new kt(e)},literal:function(e,t){if("string"==typeof t)return new St(`"${e}"@${t.toLowerCase()}`);let r=t?t.value:"";return""===r&&("boolean"==typeof e?r=_t.boolean:"number"==typeof e&&(Number.isFinite(e)?r=Number.isInteger(e)?_t.integer:_t.double:(r=_t.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===r||r===_t.string?new St(`"${e}"`):new St(`"${e}"^^${r}`)},defaultGraph:function(){return Tt},quad:Rt,triple:Rt};class Nt{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Nt?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Ot extends Nt{get termType(){return"NamedNode"}}class St extends Nt{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new Ot(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return"^"===r?e.substr(t+2):"@"!==r?_t.string:xt.langString}equals(e){return e instanceof St?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class It extends Nt{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class kt extends Nt{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}Tt=new class extends Nt{constructor(){return super(""),Tt||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class At extends Nt{constructor(e,t,r,n){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=n||Tt}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function Rt(e,t,r,n){return new At(e,t,r,n)}let Ct=0;class Dt{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Pt(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),n=/trig/.test(t),i=/triple/.test(t),o=/quad/.test(t),s=this._n3Mode=/n3/.test(t),a=i||o;(this._supportsNamedGraphs=!(r||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||n||i||s),this._supportsRDFStar=""===t||/star|\*$/.test(t),a&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new wt({lineMode:a,n3:s}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Ct=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,r,n,i){const o=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:n,object:i,graph:t,inverse:!!o&&this._inversePredicate,blankPrefix:o?this._prefixes._:"",quantified:o?this._quantified:null}),o&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.id.substr(2)}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let r;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);r=this._namedNode(t);break;case"type":case"prefixed":const n=this._prefixes[e.prefix];if(void 0===n)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._namedNode(n+e.value);break;case"blank":r=this._blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier=this._blankNode,this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier=this._variable,this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(0===e.prefix.length)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._literal(e.value,this._namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._literal(e.value,this._namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF* syntax",e);default:if(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,r=null,n=this._readListItem;const i=this._subject,o=this._contextStack,s=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._blankNode(),this.RDF_FIRST,this._subject=t=this._blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),0!==o.length&&"list"===o[o.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(n=this._readPredicate,this._subject===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._object===this.RDF_NIL)return n;r=this.RDF_NIL;break;case"literal":0===e.prefix.length?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(t=this._literal(e.value,this._namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if(void 0===(t=this._readEntity(e)))return}if(null===r&&(this._subject=r=this._blankNode()),null===i?null===s.predicate?s.subject=r:s.object=r:this._emit(i,this.RDF_REST,r,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(void 0===r)return;t=this._literal(this._literalValue,r),e=null;break;case"langcode":t=this._literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===r.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const n=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(r=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==n){const e=this._predicate,t=this._object;i?this._emit(t,e,n,r):this._emit(n,e,t,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return"."!==e.type?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._quantifier(this._blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&"item"===r.type){const t=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const n=this._blankNode();if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=n):(t=this._object,this._object=n),this._emit(t,r,n,this._graph),this._readPath}_readBackwardPath(e){const t=this._blankNode();let r,n;if(void 0!==(r=this._readEntity(e)))return null===this._predicate?(n=this._subject,this._subject=t):(n=this._object,this._object=t),this._emit(t,r,n,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return">>"!==e.type?this._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,n){this._callback(null,this._quad(e,t,r,n||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=Lt}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",n=-1,i=-1,o=0,s="/";for(;n<t;){switch(s){case":":if(i<0&&"/"===e[++n]&&"/"===e[++n])for(;(i=n+1)<t&&"/"!==e[i];)n=i;break;case"?":case"#":n=t;break;case"/":if("."===e[n+1])switch(s=e[1+ ++n],s){case"/":r+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return r+e.substring(o,n)+e.substr(n+1);case".":if(s=e[1+ ++n],void 0===s||"/"===s||"?"===s||"#"===s){if(r+=e.substring(o,n-2),(o=r.lastIndexOf("/"))>=i&&(r=r.substr(0,o)),"/"!==s)return`${r}/${e.substr(n+1)}`;o=n+1}}}s=e[++n]}return r+e.substring(o)}parse(e,t,r){if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Ct++}_`,this._prefixCallback=r||Lt,this._inversePredicate=!1,this._quantified=Object.create(null),!t){const t=[];let r;if(this._callback=(e,n)=>{e?r=e:n&&t.push(n)},this._lexer.tokenize(e).every((e=>this._readCallback=this._readCallback(e))),r)throw r;return t}this._callback=t,this._lexer.tokenize(e,((e,t)=>{null!==e?(this._callback(e),this._callback=Lt):this._readCallback&&(this._readCallback=this._readCallback(t))}))}}function Lt(){}function Pt(e,t){const r=t.namedNode;e._namedNode=r,e._blankNode=t.blankNode,e._literal=t.literal,e._variable=t.variable,e._quad=t.quad,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=r(ut.rdf.first),e.RDF_REST=r(ut.rdf.rest),e.RDF_NIL=r(ut.rdf.nil),e.N3_FORALL=r(ut.r.forAll),e.N3_FORSOME=r(ut.r.forSome),e.ABBREVIATIONS={a:r(ut.rdf.type),"=":r(ut.owl.sameAs),">":r(ut.log.implies)},e.QUANTIFIERS_GRAPH=r("urn:n3:quantifiers")}Pt(Dt.prototype,Et);const Mt=Et.defaultGraph(),{rdf:Ft,xsd:Ut}=ut,Bt=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,qt=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Ht={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class $t extends Nt{equals(){return!1}}class Zt{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!t.end;else{let e="";this._outputStream={write(t,r,n){e+=t,n&&n()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Mt,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseMatcher=new RegExp(`^${zt(t.baseIRI)}${t.baseIRI.endsWith("/")?"":"[#?]"}`),this._baseLength=t.baseIRI.length))}get _inDefaultGraph(){return Mt.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,n,i){try{n.equals(this._graph)||(this._write((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(Mt.equals(n)?"":`${this._encodeIriOrBlank(n)} {\n`)),this._graph=n,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i):this._write(`${(null===this._subject?"":".\n")+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,r,n,i){delete this._prefixMatch,this._write(this.quadToString(e,t,r,n),i)}quadToString(e,t,r,n){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${n&&n.value?` ${this._encodeIriOrBlank(n)} .\n`:" .\n"}`}quadsToString(e){return e.map((e=>this.quadToString(e.subject,e.predicate,e.object,e.graph))).join("")}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseMatcher&&this._baseMatcher.test(t)&&(t=t.substr(this._baseLength)),Bt.test(t)&&(t=t.replace(qt,Vt));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(Bt.test(t)&&(t=t.replace(qt,Vt)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Ut.string)return`"${t}"`}else switch(e.datatype.value){case Ut.string:return`"${t}"`;case Ut.boolean:if("true"===t||"false"===t)return t;break;case Ut.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Ut.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Ut.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===Ft.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:r,graph:n}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${function(e){return!!e&&"DefaultGraph"===e.termType}(n)?"":` ${this._encodeIriOrBlank(n)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,n,i){void 0===r?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof n?this._writeQuad(e,t,r,Mt,n):this._writeQuad(e,t,r,n||Mt,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,r){const n={};n[e]=t,this.addPrefixes(n,r)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let r=!1;for(let t in e){let n=e[t];"string"!=typeof n&&(n=n.value),r=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[n]=t+=":",this._write(`@prefix ${t} <${n}>.\n`)}if(r){let e="",t="";for(const r in this._prefixIRIs)e+=e?`|${r}`:r,t+=(t?"|":"")+this._prefixIRIs[r];e=zt(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z][\\-_a-zA-Z0-9]*)$`)}this._write(r?"\n":"",t)}blank(e,t){let r,n,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),n=i.length){case 0:return new $t("[]");case 1:if(r=i[0],!(r.object instanceof $t))return new $t(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t="[";for(let o=0;o<n;o++)r=i[o],r.predicate.equals(e)?t+=`, ${this._encodeObject(r.object)}`:(t+=`${(o?";\n ":"\n ")+this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)}`,e=r.predicate);return new $t(`${t}\n]`)}}list(e){const t=e&&e.length||0,r=new Array(t);for(let n=0;n<t;n++)r[n]=this._encodeObject(e[n]);return new $t(`(${r.join(" ")})`)}end(e){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null),this._write=this._blockedWrite;let t=e&&((r,n)=>{t=null,e(r,n)});if(this._endStream)try{return this._outputStream.end(t)}catch(e){}t&&t()}}function Vt(e){let t=Ht[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function zt(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}function Gt(e,t){var r,n=new Dt,i=new Zt({format:"N-Quads"});it.waterfall([function(t){n.parse(e,(function(e,r,n){e?t(e):null!==r?i.addQuad(r):i.end(t)}))},function(e,t){try{st().fromRDF(e,{format:"application/nquads"}).then((e=>{t(null,e)}))}catch(e){t(e)}},function(e,n){r=JSON.stringify(e),t(null,r)}],(function(e,n){t(e,r)}))}function Jt(e,t){var r,n=new Dt,i=new Zt({format:"N-Quads"});it.waterfall([function(t){n.parse(e,(function(e,r,n){e?t(e):null!==quad?i.addQuad(quad):i.end(t)}))},function(e,n){t(null,r=e)}],(function(e,n){t(e,r)}))}class Xt extends o.Z{constructor(){super(""),(0,t.Z)(this,"termType",s.ls)}toString(){return"()"}}const Qt="chrome:theSession";new c.Z(Qt);class Wt extends o.Z{constructor(){super(""),(0,t.Z)(this,"value",""),(0,t.Z)(this,"termType",s.NK),(0,t.Z)(this,"uri",Qt)}toCanonical(){return this.value}toString(){return"DefaultGraph"}}function Yt(e){return!!e&&e.termType===s.NK}var Kt=n(292);const er=new Wt;class tr{constructor(e,r,n,i){(0,t.Z)(this,"subject",void 0),(0,t.Z)(this,"predicate",void 0),(0,t.Z)(this,"object",void 0),(0,t.Z)(this,"graph",void 0),this.subject=o.Z.fromValue(e),this.predicate=o.Z.fromValue(r),this.object=o.Z.fromValue(n),this.graph=null==i?er:o.Z.fromValue(i)}get why(){return this.graph}set why(e){this.graph=e}equals(e){return e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}substitute(e){const t=new tr(this.subject.substitute(e),this.predicate.substitute(e),this.object.substitute(e),Yt(this.graph)?this.graph:this.graph.substitute(e));return Kt.log("@@@ statement substitute:"+t),t}toCanonical(){let e=[this.subject.toCanonical(),this.predicate.toCanonical(),this.object.toCanonical()];return this.graph&&this.graph.termType!==s.NK&&e.push(this.graph.toCanonical()),e.join(" ")+" ."}toNT(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT()].join(" ")+" ."}toNQ(){return[this.subject.toNT(),this.predicate.toNT(),this.object.toNT(),Yt(this.graph)?"":this.graph.toNT()].join(" ")+" ."}toString(){return this.toNT()}}var rr=n(3357);class nr extends o.Z{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";super(e),(0,t.Z)(this,"termType",s.UH),(0,t.Z)(this,"base","varid:"),(0,t.Z)(this,"classOrder",r.Z.Variable),(0,t.Z)(this,"isVar",1),(0,t.Z)(this,"uri",void 0),this.base="varid:",this.uri=rr.join(e,this.base)}equals(e){return!!e&&this.termType===e.termType&&this.value===e.value}hashString(){return this.toString()}substitute(e){var t;return null!=(t=e[this.toNT()])?t:this}toString(){return nr.toString(this)}static toString(e){return e.uri.slice(0,e.base.length)===e.base?`?${e.uri.slice(e.base.length)}`:`?${e.uri}`}}let ir;!function(e){e.collections="COLLECTIONS",e.defaultGraphType="DEFAULT_GRAPH_TYPE",e.equalsMethod="EQUALS_METHOD",e.id="ID",e.identity="IDENTITY",e.reversibleId="REVERSIBLE_ID",e.variableType="VARIABLE_TYPE"}(ir||(ir={}));const or=new Wt,sr={supports:{[ir.collections]:!1,[ir.defaultGraphType]:!1,[ir.equalsMethod]:!0,[ir.identity]:!1,[ir.id]:!0,[ir.reversibleId]:!1,[ir.variableType]:!0},blankNode:e=>new l(e),defaultGraph:()=>or,equals(e,t){return e===t||!e||!t||((0,u.PY)(e)||(0,u.PY)(t)?!(!(0,u.PY)(e)||!(0,u.PY)(t))&&this.equals(e.subject,t.subject)&&this.equals(e.predicate,t.predicate)&&this.equals(e.object,t.object)&&this.equals(e.graph,t.graph):!(!(0,u.jt)(e)||!(0,u.jt)(t))&&this.id(e)===this.id(t))},id(e){if(!e)return"undefined";if((0,u.PY)(e))return this.quadToNQ(e);switch(e.termType){case s.NK:return"defaultGraph";case s.UH:return nr.toString(e);default:const t=this.termToNQ(e);if(t)return t;throw new Error(`Can't id term with type '${e.termType}'`)}},isQuad:e=>e instanceof tr,literal(e,t){if("string"!=typeof e&&!t)return d.fromValue(e);const r="string"==typeof e?e:""+e;return"string"==typeof t?-1===t.indexOf(":")?new d(r,t):new d(r,null,this.namedNode(t)):new d(r,null,t)},namedNode:e=>new c.Z(e),quad:(e,t,r,n)=>new tr(e,t,r,n||or),triple(e,t,r,n){return this.quad(e,t,r,n)},quadToNQ(e){return`${this.termToNQ(e.subject)} ${this.termToNQ(e.predicate)} ${this.termToNQ(e.object)} ${this.termToNQ(e.graph)} .`},termToNQ(e){switch(e.termType){case s.V1:return"_:"+e.value;case s.NK:return"";case s.ls:return"<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>";case s.xH:return d.toNT(e);case s._A:case s.XM:return"<"+e.value+">";case s.fb:return"("+e.elements.map((e=>this.termToNQ(e))).join(" ")+")";default:throw new Error(`Can't serialize nonstandard term type (was '${e.termType}')`)}},toNQ(e){return this.isQuad(e)?this.quadToNQ(e):this.termToNQ(e)},variable:e=>new nr(e)},ar=sr;var lr=n(7308);function cr(e,t){const r=t||{namedNode:e=>new c.Z(e)};return function(t){return r.namedNode(e+(t||""))}}var ur=n(5115);function hr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ar;return{boolean:e.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),dateTime:e.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),decimal:e.namedNode("http://www.w3.org/2001/XMLSchema#decimal"),double:e.namedNode("http://www.w3.org/2001/XMLSchema#double"),integer:e.namedNode("http://www.w3.org/2001/XMLSchema#integer"),langString:e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),string:e.namedNode("http://www.w3.org/2001/XMLSchema#string")}}hr(ar);var dr=n(9523),fr=n.n(dr),pr=n(292);function gr(e){return new yr(e)}class yr{constructor(e){(0,t.Z)(this,"_notQNameChars","\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~"),(0,t.Z)(this,"_notNameChars",this._notQNameChars+":"),(0,t.Z)(this,"validPrefix",new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/)),(0,t.Z)(this,"forbidden1",new RegExp(/[\\"\b\f\r\v\t\n\u0080-\uffff]/gm)),(0,t.Z)(this,"forbidden3",new RegExp(/[\\"\b\f\r\v\u0080-\uffff]/gm)),this.flags="",this.base=null,this.prefixes=[],this.namespaces=[];const r=Object.keys(fr()());for(const e in r){const t=fr()()[r[e]](""),n=r[e];this.prefixes[t]=n,this.namespaces[n]=t}this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.suggestPrefix("xml","reserved:reservedForFutureUse"),this.namespacesUsed=[],this.keywords=["a"],this.prefixchars="abcdefghijklmnopqustuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",this.incoming=null,this.formulas=[],this.store=e,this.rdfFactory=e.rdfFactory||ar,this.xsd=hr(this.rdfFactory)}setBase(e){return this.base=e,this}setFlags(e){return this.flags=e||"",this}toStr(e){var t=e.toNT();return"Graph"===e.termType&&(this.formulas[t]=e),t}fromStr(e){if("{"===e[0]){var t=this.formulas[e];return t||pr.log("No formula object for "+e),t}return this.store.fromNT(e)}setNamespaces(e){for(var t in e)this.setPrefix(t,e[t]);return this}setPrefix(e,t){if("default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t){for(let t in this.prefixes)this.prefixes[t]==e&&delete this.prefixes[t];this.prefixes[t]=e,this.namespaces[e]=t}}suggestPrefix(e,t){"default"!==e.slice(0,7)&&"ns"!==e.slice(0,2)&&e&&t&&(e in this.namespaces||t in this.prefixes||(this.prefixes[t]=e,this.namespaces[e]=t))}suggestNamespaces(e){for(var t in e)this.suggestPrefix(t,e[t]);return this}checkIntegrity(){var e,t;for(e in this.namespaces)if(this.prefixes[this.namespaces[e]]!==e)throw new Error("Serializer integity error 1: "+e+", "+this.namespaces[e]+", "+this.prefixes[this.namespaces[e]]+"!");for(t in this.prefixes)if(this.namespaces[this.prefixes[t]]!==t)throw new Error("Serializer integity error 2: "+t+", "+this.prefixs[t]+", "+this.namespaces[this.prefixes[t]]+"!")}makeUpPrefix(e){var t=e,r=function(t){return!!this.validPrefix.test(t)&&"ns"!==t&&!(t in this.namespaces)&&(this.prefixes[e]=t,this.namespaces[t]=e,t)}.bind(this);"#/".indexOf(t[t.length-1])>=0&&(t=t.slice(0,-1));var n=t.lastIndexOf("/");n>=0&&(t=t.slice(n+1));for(var i=0;i<t.length&&this.prefixchars.indexOf(t[i]);)i++;if((t=t.slice(0,i)).length<6&&r(t))return t;if(r(t.slice(0,3)))return t.slice(0,3);if(r(t.slice(0,2)))return t.slice(0,2);if(r(t.slice(0,4)))return t.slice(0,4);if(r(t.slice(0,1)))return t.slice(0,1);if(r(t.slice(0,5)))return t.slice(0,5);this.validPrefix.test(t)||(t="n");for(var o=0;;o++)if(r(t.slice(0,3)+o))return t.slice(0,3)+o}rootSubjects(e){for(var t={},r={},n={},i=0;i<e.length;i++){var o=e[i],s=function(e){t.hasOwnProperty(e)||(t[e]=[]),t[e].push(o.subject)};[o.subject,o.predicate,o.object].map((function(e){"BlankNode"===e.termType?n[e.toNT()]=!0:"Collection"===e.termType&&e.elements.forEach((function(e){s(e)}))})),s(e[i].object);var a=r[this.toStr(o.subject)];a||(a=[]),a.push(o),r[this.toStr(o.subject)]=a}var l=[];for(var c in r)if(r.hasOwnProperty(c)){var u=this.fromStr(c);"BlankNode"===u.termType&&t[u]&&1===t[u].length||l.push(u)}this.incoming=t;for(var h={},d=0;d<l.length;d++)h[l[d].toNT()]=!0;return{roots:l,subjects:r,rootsHash:h,incoming:t}}toN3(e){return this.statementsToN3(e.statements)}explicitURI(e){return"<"+(e=this.flags.indexOf("r")<0&&this.base?rr.refTo(this.base,e):this.flags.indexOf("u")>=0?function(e){for(var t,r="",n=0;n<e.length;n++)r+=(t=e.charCodeAt(n))>65535?"\\U"+("00000000"+t.toString(16)).slice(-8):t>126?"\\u"+("0000"+t.toString(16)).slice(-4):e[n];return r}(e):encodeURI(e))+">"}statementsToNTriples(e){var t=e.slice();t.sort();for(var r="",n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i=this,o=this.store,s=this.rdfFactory,a=function(e){if("Collection"!==e.termType)return i.atomicTermToN3(e);for(var t=e.elements,l=o.sym(n+"nill"),c=t.length-1;c>=0;c--){var u=s.blankNode();r+=a(u)+" "+a(o.sym(n+"first"))+" "+a(t[c])+".\n",r+=a(u)+" "+a(o.sym(n+"rest"))+" "+a(l)+".\n",l=u}return i.atomicTermToN3(l)},l=0;l<t.length;l++){var c=t[l],u="";u+=a(c.subject)+" ",u+=a(c.predicate)+" ",u+=a(c.object)+" ",this.flags.indexOf("q")>=0&&(u+=a(c.why)+" "),r+=u+=".\n"}return r}statementsToN3(e){var t=this.store,r={"http://www.w3.org/1999/02/22-rdf-syntax-ns#type":"aaa:00"};e.sort((function(e,n){return ur.heavyCompareSPO(e,n,t,r)})),this.base&&!this.defaultNamespace&&(this.defaultNamespace=this.base+"#");var n={};this.flags.indexOf("s")<0&&(n["http://www.w3.org/2002/07/owl#sameAs"]="="),this.flags.indexOf("t")<0&&(n["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]="a"),this.flags.indexOf("i")<0&&(n["http://www.w3.org/2000/10/swap/log#implies"]="=>");var i=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},o=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r],i="string"==typeof n?n:o(n);if(0!==r){var s=t.slice(-1)||" ";","===i||";"===i||("."!==i||"0123456789.:".includes(s))&&(t+=" ")}t+=i}return t},s=function(e,t){var r="",n=1e5;void 0===t&&(t=-1);for(var a=0;a<e.length;a++){var l=e[a];if("string"!=typeof l){var c=s(l,t+1);if(c.length<10*(80-4*t)&&c.indexOf('"""')<0){var u=o(l);u.length<80-4*t&&(l=u,c="")}c&&(n=1e4),r+=c}if("string"==typeof l){if(1===l.length&&"\n"===r.slice(-1)&&",.;".indexOf(l)>=0){r=r.slice(0,-1),"."==l&&"0123456789.:".includes(r.charAt(r.length-1))&&(r+=" ",n+=1),r+=l+"\n",n+=1;continue}if(n<4*t+4||n+l.length+1<80&&";.".indexOf(r[r.length-2])<0)r=r.slice(0,-1)+" "+l+"\n",n+=l.length+1;else{let e=i(4*t)+l;r+=e+"\n",n=e.length,t<0&&(r+="\n",n=1e5)}}}return r},a=function(e){for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(l(o,t))}return n}.bind(this);function l(e,t){return"BlankNode"!==e.termType||t.incoming[e]?[h(e,t)].concat([c(e,t)]).concat(["."]):u(e,t,!0).concat(["."])}var c=function(e,t){var r=[],i=null,o=t.subjects[this.toStr(e)]||[];if(void 0===o)throw new Error("Cant find statements for "+e);for(var s=[],a=0;a<o.length;a++){var l=o[a];l.predicate.uri===i?s.push(","):(i&&(r=r.concat([s]).concat([";"]),s=[]),r.push(n[l.predicate.uri]?n[l.predicate.uri]:h(l.predicate,t))),i=l.predicate.uri,s.push(u(l.object,t))}return r.concat([s])}.bind(this),u=function(e,t,r){return"BlankNode"!==e.termType||!r&&void 0!==t.rootsHash[e.toNT()]?h(e,t):t.subjects[this.toStr(e)]?["[",c(e,t),"]"]:"[]"}.bind(this);yr.prototype.termToN3=h;var h=function(e,t){var r,n;switch(e.termType){case"Graph":return(n=(n=["{"]).concat(a(e.statements))).concat(["}"]);case"Collection":for(n=["("],r=0;r<e.elements.length;r++)n.push([u(e.elements[r],t)]);return n.push(")"),n;default:return this.atomicTermToN3(e)}}.bind(this),d=function(){var e="";for(var t in this.defaultNamespace&&(e+="@prefix : "+this.explicitURI(this.defaultNamespace)+".\n"),this.prefixes)this.prefixes.hasOwnProperty(t)&&this.namespacesUsed[t]&&(e+="@prefix "+this.prefixes[t]+": "+this.explicitURI(t)+".\n");return e+"\n"}.bind(this),f=a(e);return d()+s(f)}atomicTermToN3(e,t){switch(e.termType){case"BlankNode":case"Variable":return e.toNT();case"Literal":var r=e.value;if("string"!=typeof r)throw new TypeError("Value of RDF literal node must be a string");if(e.datatype&&this.flags.indexOf("x")<0)switch(e.datatype.uri){case"http://www.w3.org/2001/XMLSchema#integer":return r;case"http://www.w3.org/2001/XMLSchema#decimal":return r.indexOf(".")<0&&(r+=".0"),r;case"http://www.w3.org/2001/XMLSchema#double":{const e=r.toLowerCase().indexOf("e")>0;return r.indexOf(".")<0&&!e&&(r+=".0"),e||(r+="e0"),r}case"http://www.w3.org/2001/XMLSchema#boolean":return"1"===e.value?"true":"false"}var n=this.stringToN3(e.value);return e.language?n+="@"+e.language:e.datatype.equals(this.xsd.string)||(n+="^^"+this.atomicTermToN3(e.datatype,t)),n;case"NamedNode":return this.symbolToN3(e);case"DefaultGraph":return"";default:throw new Error("Internal: atomicTermToN3 cannot handle "+e+" of termType: "+e.termType)}}stringToN3(e,t){t||(t="e");var r,n,i,o,s,a="";for(e.length>20&&'"'!==e.slice(-1)&&t.indexOf("n")<0&&(e.indexOf("\n")>0||e.indexOf('"')>0)?(o='"""',s=this.forbidden3):(o='"',s=this.forbidden1),r=0;r<e.length&&(s.lastIndex=0,null!=s.exec(e.slice(r)));){n=r+s.lastIndex-1,a+=e.slice(r,n);var l=e[n];'"'===l&&'"""'===o&&'"""'!==e.slice(n,n+3)?a+=l:(i='\b\f\r\t\v\n\\"'.indexOf(l))>=0?a+="\\"+'bfrtvn\\"'[i]:t.indexOf("e")>=0?a+="\\u"+("000"+l.charCodeAt(0).toString(16).toLowerCase()).slice(-4):a+=l,r=n+1}return o+a+e.slice(r)+o}symbolToN3(e){var t=e.uri,r=t.indexOf("#");if(r<0&&this.flags.indexOf("/")<0&&(r=t.lastIndexOf("/")),r>=0&&this.flags.indexOf("p")<0&&(0===t.indexOf("http")||0===t.indexOf("ws")||0===t.indexOf("file"))){for(var n=!0,i=r+1;i<t.length;i++)if(this._notNameChars.indexOf(t[i])>=0){n=!1;break}if(n){var o=t.slice(r+1),s=t.slice(0,r+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return this.flags.indexOf("k")>=0&&this.keyords.indexOf(o)<0?o:":"+o;var a=this.prefixes[s];if(a||(a=this.makeUpPrefix(s)),a)return this.namespacesUsed[s]=!0,a+":"+o}}return this.explicitURI(t)}writeStore(e){var t=this.store,r=t.fetcher,n=r&&r.appNode,i=this.store.index[3];for(var o in i){var s=t.fromNT(o);n&&s.equals(n)||e("\n"+this.atomicTermToN3(s)+" "+this.atomicTermToN3(t.sym("http://www.w3.org/2000/10/swap/log#semantics"))+" { "+this.statementsToN3(t.statementsMatching(void 0,void 0,void 0,s))+" }.\n")}t.statementsMatching(void 0,t.sym("http://www.w3.org/2007/ont/link#requestedURI")).map((function(r){e("\n<"+r.object.value+"> log:metadata {\n");var n=t.statementsMatching(void 0,void 0,void 0,r.subject);e(this.statementsToN3(this.statementsToN3(n))),e("}.\n")}));var a=[];n&&a.push(n);var l=[];a.map((function(e){l=l.concat(t.statementsMatching(void 0,void 0,void 0,e))})),e(this.statementsToN3(l))}statementsToXML(e){var t=[];t["http://www.w3.org/1999/02/22-rdf-syntax-ns#"]=!0;var r="http://www.w3.org/1999/02/22-rdf-syntax-ns#_",n=function(e){for(var t="",r=0;r<e;r++)t+=" ";return t},i=function(e){for(var t="",r=0;r<e.length;r++){var n=e[r];t+="string"==typeof n?n:i(n)}return t},o=function(e,t){var r,s="",a=1e5;t||(t=0);for(var l=0;l<e.length;l++){var c=e[l];if("string"!=typeof c){var u=o(c,t+1);u.length<10*(80-4*t)&&u.indexOf('"""')<0&&(r=i(c)).length<80-4*t&&(c=" "+r,u=""),u&&(a=1e4),s+=u}"string"==typeof c&&(a<4*t+4?(s=s.slice(0,-1)+" "+c+"\n",a+=c.length+1):(s+=(r=n(4*t)+c)+"\n",a=r.length))}return s},s=function(e){this.suggestPrefix("rdf","http://www.w3.org/1999/02/22-rdf-syntax-ns#");for(var t=this.rootSubjects(e),r=t.roots,n=[],i=0;i<r.length;i++){var o=r[i];n.push(c(o,t))}return n}.bind(this);function a(e){return void 0===e?"@@@undefined@@@@":e.replace(/[&<"]/g,(function(e){switch(e[0]){case"&":return"&amp;";case"<":return"&lt;";case'"':return"&quot;"}}))}var l=function(e){return a(this.base?rr.refTo(this.base,e.uri):e.uri)}.bind(this),c=function(e,t){var n,i,o,s,f=[],p=t.subjects[this.toStr(e)];if(void 0===p)return h(e,t);p.sort((function(e,t){var n=e.predicate.uri,i=t.predicate.uri;if(n.substring(0,r.length)===r||i.substring(0,r.length)===r)return n.localeCompare(i);var o=n.substring(r.length),s=i.substring(r.length),a=parseInt(o,10),l=parseInt(s,10);return isNaN(a)||isNaN(l)||a!==o||l!==s?n.localeCompare(i):a-l}));for(var g=0;g<p.length;g++)if("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"!==(o=p[g]).predicate.uri||n||"NamedNode"!==o.object.termType){if((s=o.predicate).uri.substr(0,r.length)===r){var y=s.uri.substr(r.length);y===parseInt(y,10).toString()&&(s=this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#li"))}switch(i=d(s),o.object.termType){case"BlankNode":f=1===t.incoming[o.object].length?f.concat(["<"+i+' rdf:parseType="Resource">',c(o.object,t),"</"+i+">"]):f.concat(["<"+i+' rdf:nodeID="'+o.object.toNT().slice(2)+'"/>']);break;case"NamedNode":f=f.concat(["<"+i+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":f=f.concat(["<"+i+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.uri)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+i+">"]);break;case"Collection":f=f.concat(["<"+i+' rdf:parseType="Collection">',u(o.object,t),"</"+i+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}else n=o.object;var v=n?d(n):"rdf:Description",m="";return"BlankNode"===e.termType?t.incoming[e]&&1===t.incoming[e].length||(m=' rdf:nodeID="'+e.toNT().slice(2)+'"'):m=' rdf:about="'+l(e)+'"',["<"+v+m+">"].concat([f]).concat(["</"+v+">"])}.bind(this);function u(e,t){for(var r=[],n=0;n<e.elements.length;n++)r.push(c(e.elements[n],t));return r}var h=function(e,t){var r=[],n=t.subjects[this.toStr(e)];if(!n)return r;n.sort();for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"BlankNode":r=t.rootsHash[o.object.toNT()]?r.concat(["<"+d(o.predicate)+' rdf:nodeID="'+o.object.toNT().slice(2)+'">',"</"+d(o.predicate)+">"]):r.concat(["<"+d(o.predicate)+' rdf:parseType="Resource">',h(o.object,t),"</"+d(o.predicate)+">"]);break;case"NamedNode":r=r.concat(["<"+d(o.predicate)+' rdf:resource="'+l(o.object)+'"/>']);break;case"Literal":r=r.concat(["<"+d(o.predicate)+(o.object.datatype.equals(this.xsd.string)?"":' rdf:datatype="'+a(o.object.datatype.value)+'"')+(o.object.language?' xml:lang="'+o.object.language+'"':"")+">"+a(o.object.value)+"</"+d(o.predicate)+">"]);break;case"Collection":r=r.concat(["<"+d(o.predicate)+' rdf:parseType="Collection">',u(o.object,t),"</"+d(o.predicate)+">"]);break;default:throw new Error("Can't serialize object of type "+o.object.termType+" into XML")}}return r}.bind(this),d=function(e){var r=e.uri,n=r.indexOf("#");if(n<0&&this.flags.indexOf("/")<0&&(n=r.lastIndexOf("/")),n<0)throw new Error("Cannot make qname out of <"+r+">");for(var i=n+1;i<r.length;i++)if(this._notNameChars.indexOf(r[i])>=0)throw new Error('Invalid character "'+r[i]+'" cannot be in XML qname for URI: '+r);var o=r.slice(n+1),s=r.slice(0,n+1);if(this.defaultNamespace&&this.defaultNamespace===s&&this.flags.indexOf("d")<0)return o;var a=this.prefixes[s];return a||(a=this.makeUpPrefix(s)),t[s]=!0,a+":"+o}.bind(this),f=s(e),p="<rdf:RDF";for(var g in this.defaultNamespace&&(p+=' xmlns="'+a(this.defaultNamespace)+'"'),t)if(t.hasOwnProperty(g)){var y=this.base&&this.flags.includes("z")?rr.refTo(this.base,g):g;p+="\n xmlns:"+this.prefixes[g]+'="'+a(y)+'"'}return o([p+=">",f,"</rdf:RDF>"],-1)}}function vr(e,t,r,n,i,o){r=r||e?.value;const a=o||{};n=n||s.z8;try{var l=gr(t);a.flags&&l.setFlags(a.flags);var c=t.statementsMatching(void 0,void 0,void 0,e);switch("namespaces"in t&&l.suggestNamespaces(t.namespaces),a.namespaces&&l.setNamespaces(a.namespaces),l.setBase(r),n){case s.Is:return u(null,l.statementsToXML(c));case s.qS:case s.sZ:return u(null,l.statementsToN3(c));case s.z8:case s.Eo:return l.setFlags("si"),u(null,l.statementsToN3(c));case s.aV:return l.setFlags("deinprstux"),u(null,l.statementsToNTriples(c));case s.ui:l.setFlags("deinprstux"),Gt(l.statementsToNTriples(c),i);break;case s.b4:case s.lL:return l.setFlags("deinprstux q"),u(null,l.statementsToNTriples(c));default:throw new Error("Serialize: Content-type "+n+" not supported for data write.")}}catch(e){if(i)return i(e,void 0);throw e}function u(e,t){return i?void i(e,t):t}}const mr=["blankNode","defaultGraph","literal","namedNode","quad","variable","supports"],br="http://www.w3.org/1999/02/22-rdf-syntax-ns#rest";function wr(e,t,r){const n=[];return r.reduce(((t,r,i,o)=>{let s;return n.push(e.quad(t,e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#first"),o[i])),i<o.length-1?(s=e.blankNode(),n.push(e.quad(t,e.namedNode(br),s))):n.push(e.quad(t,e.namedNode(br),e.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"))),s}),t),n}function xr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;var n=e.length;for(r<0&&(r=n+r);r<n;r++)if(e[r]===t)return r;return-1}var _r=n(292);class Tr extends o.Z{constructor(){var e;let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],l=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};super(""),e=this,this.statements=n,this.constraints=i,this.initBindings=o,this.optional=a,(0,t.Z)(this,"termType",s._A),(0,t.Z)(this,"classOrder",r.Z.Graph),(0,t.Z)(this,"fetcher",void 0),(0,t.Z)(this,"isVar",0),(0,t.Z)(this,"ns",cr),(0,t.Z)(this,"rdfFactory",void 0),this.rdfFactory=l&&l.rdfFactory||ar;for(const t of mr)this[t]=function(){return e.rdfFactory[t](...arguments)}}add(e,t,r,n){return 1===arguments.length&&e.forEach((e=>this.add(e.subject,e.predicate,e.object,e.graph))),this.statements.push(this.rdfFactory.quad(e,t,r,n))}addStatement(e){return this.add(e)}bnode(e){return this.rdfFactory.blankNode(e)}addAll(e){e.forEach((e=>{this.add(e.subject,e.predicate,e.object,e.graph)}))}any(e,t,r,n){const i=this.anyStatementMatching(e,t,r,n);return null==i?null:null==e?i.subject:null==t?i.predicate:null==r?i.object:null}anyValue(e,t,r,n){const i=this.any(e,t,r,n);return i?i.value:void 0}anyJS(e,t,r,n){const i=this.any(e,t,r,n);return i?o.Z.toJS(i):void 0}anyStatementMatching(e,t,r,n){let i=this.statementsMatching(e,t,r,n,!0);if(i&&0!==i.length)return i[0]}id(e){return this.rdfFactory.id(e)}statementsMatching(e,t,r,n,i){const o=this.statements.filter((i=>(!e||e.equals(i.subject))&&(!t||t.equals(i.predicate))&&(!r||r.equals(i.object))&&(!n||n.equals(i.graph))));return i?0===o.length?[]:[o[0]]:o}bottomTypeURIs(e){let t,r,n,i,o,s,a,l;t=[];for(let c in e)if(e.hasOwnProperty(c)){for(l=e[c],a=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),this.rdfFactory.namedNode(c)),r=!0,i=0,o=a.length;i<o;i++)if(n=a[i],s=n.uri,s in e){r=!1;break}r&&(t[c]=l)}return t}collection(){return new p}each(e,t,r,n){const i=[];let o=this.statementsMatching(e,t,r,n,!1);if(null==e)for(let e=0,t=o.length;e<t;e++)i.push(o[e].subject);else if(null==t)for(let e=0,t=o.length;e<t;e++)i.push(o[e].predicate);else if(null==r)for(let e=0,t=o.length;e<t;e++)i.push(o[e].object);else if(null==n)for(let e=0,t=o.length;e<t;e++)i.push(new c.Z(o[e].graph.value));return i}equals(e){return!!e&&this.hashString()===e.hashString()}findMembersNT(e){let t,r,n,i,o,s,a,l,c,u,h,d,f,p;d={},d[e.toNT()]=!0,i={},s=this.transitiveClosure(d,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0);for(let e in s)if(s.hasOwnProperty(e)){a=this.statementsMatching(void 0,this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.fromNT(e));for(let e=0,t=a.length;e<t;e++)f=a[e],i[f.subject.toNT()]=f;l=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"),this.fromNT(e));for(let e=0,r=l.length;e<r;e++)for(o=l[e],c=this.statementsMatching(void 0,o),n=0,t=c.length;n<t;n++)f=c[n],i[f.subject.toNT()]=f;u=this.each(void 0,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"),this.fromNT(e));for(let e=0,t=u.length;e<t;e++)for(o=u[e],h=this.statementsMatching(void 0,o),p=0,r=h.length;p<r;p++)f=h[p],i[f.object.toNT()]=f}return i}findMemberURIs(e){return this.NTtoURI(this.findMembersNT(e))}findSubClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!0)}findSuperClassesNT(e){let t={};return t[e.toNT()]=!0,this.transitiveClosure(t,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypesNT(e){let t,r,n,i,o,s,a,l,c;n="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",c=[],i=this.statementsMatching(e,void 0,void 0);for(let e=0,t=i.length;e<t;e++)if(l=i[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#type"===l.predicate.uri)c[l.object.toNT()]=l;else{o=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#domain"));for(let e=0,t=o.length;e<t;e++)r=o[e],c[r.toNT()]=l}s=this.statementsMatching(void 0,void 0,e);for(let e=0,r=s.length;e<r;e++){l=s[e],a=this.each(l.predicate,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#range"));for(let e=0,r=a.length;e<r;e++)t=a[e],c[t.toNT()]=l}return this.transitiveClosure(c,this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"),!1)}findTypeURIs(e){return this.NTtoURI(this.findTypesNT(e))}connectedStatements(e,t,r){r=r||[];let n=[e],i={},o={},s=[],a=this,l=function(e){let l=function(e){"BlankNode"!==e.termType||i[e.value]||(i[e.value]=!0,n.push(e))},c=a.statementsMatching(null,null,e,t).concat(a.statementsMatching(e,null,null,t));c=c.filter((function(e){if(r[e.predicate.value])return!1;let t=e.toNT();return!o[t]&&(o[t]=!0,!0)})),c.forEach((function(e){l(e.subject),l(e.object)})),s=s.concat(c)};for(;n.length;)l(n.shift());return s}formula(e){return new Tr}fromNT(e){let t,r,n;switch(e[0]){case"<":return this.sym(e.slice(1,-1));case'"':if(n=void 0,t=void 0,r=e.lastIndexOf('"'),r<e.length-1)if("@"===e[r+1])n=e.slice(r+2);else{if("^^"!==e.slice(r+1,r+3))throw new Error("Can't convert string from NT: "+e);t=this.fromNT(e.slice(r+3))}return e=(e=(e=(e=e.slice(1,r)).replace(/\\"/g,'"')).replace(/\\n/g,"\n")).replace(/\\\\/g,"\\"),this.rdfFactory.literal(e,n||t);case"_":return this.rdfFactory.blankNode(e.slice(2));case"?":return new nr(e.slice(1))}throw new Error("Can't convert from NT: "+e)}holds(e,t,r,n){let i;if(1===arguments.length){if(!e)return!0;if(e instanceof Array){for(i=0;i<e.length;i++)if(!this.holds(e[i]))return!1;return!0}if((0,u.Yi)(e))return this.holds(e.subject,e.predicate,e.object,e.graph);if(e.statements)return this.holds(e.statements)}return null!=this.anyStatementMatching(e,t,r,n)}holdsStatement(e){return this.holds(e.subject,e.predicate,e.object,e.graph)}list(e,t){if(t.rdfFactory.supports.COLLECTIONS){const r=t.rdfFactory.collection();return e.forEach((function(e){r.append(e)})),r}{const r=t.rdfFactory.blankNode(),n=wr(t.rdfFactory,r,e);return t.addAll(n),r}}NTtoURI(e){let t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],"<"===t[0]&&(n[t.slice(1,-1)]=r));return n}serialize(e,t,r,n){return vr(r,this,e,t,void 0,n)}substitute(e){let t=this.statements.map((function(t){return t.substitute(e)}));_r.log("Formula subs statmnts:"+t);const r=new Tr;return r.addAll(t),_r.log("indexed-form subs formula:"+r),r}sym(e,t){if(t)throw new Error("This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.");return this.rdfFactory.namedNode(e)}the(e,t,r,n){let i=this.any(e,t,r,n);return null==i&&lr.Z.error("No value found for the() {"+e+" "+t+" "+r+"}."),i}transitiveClosure(e,t,r){let n,i,o,s,a,l,c={};Object.assign(c,e);let u={};for(;;){if(l=function(){for(let e in c)if(c.hasOwnProperty(e))return e}(),null==l)return u;for(a=r?this.each(void 0,t,this.fromNT(l)):this.each(this.fromNT(l),t),i=0,o=a.length;i<o;i++)n=a[i],s=n.toNT(),s in u||s in c||(c[s]=c[l]);u[l]=c[l],delete c[l]}}topTypeURIs(e){let t,r,n,i,o,s,a,l;for(n in a=[],e)if(e.hasOwnProperty(n)){for(l=e[n],o=0,s=this.each(this.rdfFactory.namedNode(n),this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf")),t=0,i=s.length;t<i;t++)if(r=s[t],"http://www.w3.org/2000/01/rdf-schema#Resource"!==r.uri){o++;break}o||(a[n]=l)}return a["http://www.w3.org/2000/01/rdf-schema#Resource"]&&delete a["http://www.w3.org/2000/01/rdf-schema#Resource"],a["http://www.w3.org/2002/07/owl#Thing"]&&delete a["http://www.w3.org/2002/07/owl#Thing"],a}toString(){return"{"+this.statements.join("\n")+"}"}variable(e){return new nr(e)}whether(e,t,r,n){return this.statementsMatching(e,t,r,n,!1).length}}o.Z.fromValue=f;const jr=o.Z,Er={xsd:cr("http://www.w3.org/2001/XMLSchema#")};o.Z.toJS=function(e){return(0,u.uZ)(e)?e.elements.map(o.Z.toJS):(0,u.n_)(e)?e.datatype.equals(Er.xsd("boolean"))?"1"===e.value||"true"===e.value:e.datatype.equals(Er.xsd("dateTime"))||e.datatype.equals(Er.xsd("date"))?new Date(e.value):e.datatype.equals(Er.xsd("integer"))||e.datatype.equals(Er.xsd("float"))||e.datatype.equals(Er.xsd("decimal"))?Number(e.value):e.value:e};var Nr=n(292);class Or{constructor(e,t){this.pat=new Cr,this.vars=[],this.name=e,this.id=t}}function Sr(e,t,r,n){function i(e){var t,r="";for(t in e)e.hasOwnProperty(t)&&(r+=" "+t+" -> "+e[t]);return r}function o(e){var t,r="Bindings: ",n=e.length;for(t=0;t<n;t++)r+=i(e[t][0])+";\n\t";return r}function s(e,t,r,n){var i;if(e.length!==t.length)return[];if(!e.length)return[[[],null]];var o=function(e,t,r,n){var i=r[e];if(void 0===i){if(e.isVar){var o=[];return o[e]=t,[[o,null]]}i=e}if(!i.complexType)return n.redirections[i]&&(i=n.redirections[i]),n.redirections[t]&&(t=n.redirections[t]),i.equals(t)||i.uri&&i.uri===Qt?[[[],null]]:[];if(e instanceof Array)return t instanceof Array?s(e,t,r):[];throw new Error("query.js: oops - code not written yet")}(e[0],t[0],r,n);if(0===o.length)return o;var a,l,c,u,h,d,f,p=[],g=o.length;for(a=0;a<g;a++){for(h in f=[],l=o[a][0])l.hasOwnProperty(h)&&(f[h]=l[h]);for(h in r)r.hasOwnProperty(h)&&(f[h]=r[h]);for(u=(i=s(e.slice(1),t.slice(1),f,n)).length,c=0;c<u;c++){for(h in d=i[c][0],l)l.hasOwnProperty(h)&&(d[h]=l[h]);p.push([d,null])}}return p}function a(e,t){var r,n={};for(r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r]);return n}function l(e,t){return this.trunkBindings=t,this.originalCallback=e,this.branches=[],this}function c(e,t){return this.count=0,this.success=!1,this.done=!1,this.callback=e,this.onDone=t,this}l.prototype.checkAllDone=function(){var e;for(e=0;e<this.branches.length;e++)if(!this.branches[e].done)return;lr.Z.debug("OPTIONAL BIDNINGS ALL DONE:"),this.doCallBacks(this.branches.length-1,this.trunkBindings)},l.prototype.doCallBacks=function(e,t){var r;if(e<0)return this.originalCallback(t);for(r=0;r<this.branches[e].results.length;r++)this.doCallBacks(e-1,a(t,this.branches[e].results[r]))},c.prototype.reportMatch=function(e){this.callback(e),this.success=!0},c.prototype.reportDone=function(){this.done=!0,lr.Z.info("Mandatory query branch finished.***"),void 0!==this.onDone&&this.onDone()};var u=function(e){return this.count=0,this.done=!1,this.results=[],this.junction=e,e.branches.push(this),this};function h(e,t,r){var n,i,o,s,a,l;for(t.nvars=0,t.index=null,n=[t.subject,t.predicate,t.object,t.why],s=[e.subjectIndex,e.predicateIndex,e.objectIndex,e.whyIndex],o=0;o<4;o++){let c=n[o];if(c.uri&&c.uri===Qt);else if(c.isVar&&void 0===r[c])t.nvars++;else{if(void 0,c=void 0===(l=r[a=n[o]])?a:l,e.redirections[e.id(c)]&&(c=e.redirections[e.id(c)]),!(i=s[o][e.id(c)]))return t.index=[],!1;(null===t.index||t.index.length>i.length)&&(t.index=i)}}return null===t.index&&(t.index=e.statements),!0}function d(e,t){return e.nvars!==t.nvars?e.nvars-t.nvars:e.index.length-t.index.length}u.prototype.reportMatch=function(e){this.results.push(e)},u.prototype.reportDone=function(){lr.Z.debug("Optional branch finished - results.length = "+this.results.length),0===this.results.length&&(this.results.push({}),lr.Z.debug("Optional branch FAILED - that's OK.")),this.done=!0,this.junction.checkAllDone()};var f=function(e,r,n,o,s,a,c){lr.Z.debug("Match begins, Branch count now: "+c.count+" for "+c.pattern_debug);var h,d,p=r.statements;if(0===p.length){if(lr.Z.debug("FOUND MATCH WITH BINDINGS:"+i(n)),0===r.optional.length)c.reportMatch(n);else{lr.Z.debug("OPTIONAL: "+r.optional);var y,v=new l(t,n),m=[];for(y=0;y<r.optional.length;y++)m[y]=new u(v),m[y].pattern_debug=r.optional[y];for(y=0;y<r.optional.length;y++)m[y].count=m[y].count+1,f(e,r.optional[y],n,"",s,t,m[y])}return c.count--,void lr.Z.debug("Match ends -- success , Branch count now: "+c.count+" for "+c.pattern_debug)}var b=p.length;if(s){var w=function(t,i){var l=t.uri.split("#")[0];s.nowOrWhenFetched(l,void 0,(function(i,l,u){i||Nr.log("Error following link to <"+t.uri+"> in query: "+l),f(e,r,n,o,s,a,c)}))};for(d=0;d<b;d++){if(h=p[d],void 0!==n[h.subject]&&n[h.subject].uri&&s&&"unrequested"===s.getState((0,rr.docpart)(n[h.subject].uri)))return void w(n[h.subject]);if(void 0!==n[h.object]&&n[h.object].uri&&s&&"unrequested"===s.getState((0,rr.docpart)(n[h.object].uri)))return void w(n[h.object])}}g(e,r,n,o,s,a,c)},p=function(e,t){var r,n,i=!0;for(r in e)e.hasOwnProperty(r)&&t[r]&&(n=t[r].test)&&!n(e[r])&&(i=!1);return i},g=function(e,t,r,n,a,l,c){var u,g,y,v,m,b,w,x=t.statements,_=x.length;for(u=0;u<_;u++)h(e,w=x[u],r);x.sort(d),w=x[0];var T,j=e.formula();j.optional=t.optional,j.constraints=t.constraints,j.statements=x.slice(1),lr.Z.debug(n+"match2 searching "+w.index.length+" for "+w+"; bindings so far="+i(r));var E,N,O=w.index.length,S=0;for(T=0;T<O;T++)for(N=w.index[T],E=s([w.subject,w.predicate,w.object,w.why],[N.subject,N.predicate,N.object,N.why],r,e),lr.Z.info(n+" From first: "+E.length+": "+o(E)),y=E.length,g=0;g<y;g++)if(m=[],b=E[g][0],p(b,t.constraints)){for(v in b)b.hasOwnProperty(v)&&(m[v]=b[v]);for(v in r)r.hasOwnProperty(v)&&(m[v]=r[v]);c.count++,S++,f(e,j,m,n+" ",a,l,c)}else lr.Z.debug("Branch count CS: "+c.count);c.count--,0===S&&lr.Z.debug("Match2 fails completely on "+w),lr.Z.debug("Match2 ends, Branch count: "+c.count+" for "+c.pattern_debug),0===c.count&&(lr.Z.debug("Branch finished."),c.reportDone())},y=this;lr.Z.debug("Query on "+this.statements.length);var v=new c(t,n);v.count++,e.sync?f(y,e.pat,e.pat.initBindings,"",r,t,v):setTimeout((function(){f(y,e.pat,e.pat.initBindings,"",r,t,v)}),0)}const Ir="http://www.w3.org/2002/07/owl#";function kr(e,t,r,n){var i=e.any(t,r,void 0);return!!i&&(e.equate(i,n),!0)}function Ar(e,t,r,n){var i=e.any(void 0,r,n);return!!i&&(e.equate(i,t),!0)}function Rr(e,t,r,n,i){e.typeCallback&&e.typeCallback(e,n,i);var o=e.classActions[e.id(n)],s=!1;if(o)for(var a=0;a<o.length;a++)s=s||o[a](e,t,r,n,i);return s}class Cr extends Tr{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(void 0,void 0,void 0,void 0,r),(0,t.Z)(this,"updater",void 0),(0,t.Z)(this,"namespaces",void 0),(0,t.Z)(this,"classActions",void 0),(0,t.Z)(this,"propertyActions",void 0),(0,t.Z)(this,"redirections",void 0),(0,t.Z)(this,"aliases",void 0),(0,t.Z)(this,"HTTPRedirects",void 0),(0,t.Z)(this,"subjectIndex",void 0),(0,t.Z)(this,"predicateIndex",void 0),(0,t.Z)(this,"objectIndex",void 0),(0,t.Z)(this,"whyIndex",void 0),(0,t.Z)(this,"index",void 0),(0,t.Z)(this,"features",void 0),(0,t.Z)(this,"_universalVariables",void 0),(0,t.Z)(this,"_existentialVariables",void 0),(0,t.Z)(this,"rdfArrayRemove",void 0),(0,t.Z)(this,"dataCallbacks",void 0),this.propertyActions={},this.classActions={},this.redirections=[],this.aliases=[],this.HTTPRedirects=[],this.subjectIndex=[],this.predicateIndex=[],this.objectIndex=[],this.whyIndex=[],this.index=[this.subjectIndex,this.predicateIndex,this.objectIndex,this.whyIndex],this.namespaces={},this.features=e||[],this.rdfArrayRemove=r.rdfArrayRemove||ur.RDFArrayRemove,r.dataCallback&&(this.dataCallbacks=[r.dataCallback]),this.initPropertyActions(this.features)}static get defaultGraphURI(){return Qt}substitute(e){var t=this.statements.map((function(t){return t.substitute(e)})),r=new Cr;return r.add(t),r}addDataCallback(e){this.dataCallbacks||(this.dataCallbacks=[]),this.dataCallbacks.push(e)}applyPatch(e,t,r){var n,i=this,o=null;function s(s){if(e.delete){n=e.delete,o&&(n=n.substitute(o)),n=n.statements;var a=[],l=n.map((function(e){var r=i.statementsMatching(e.subject,e.predicate,e.object,t);return 0===r.length?(a.push(e),null):r[0]}));if(a.length)return r("Could not find to delete: "+a.join("\n or "));l.map((function(e){i.remove(e)}))}e.insert&&(n=e.insert,o&&(n=n.substitute(o)),(n=n.statements).map((function(e){e.graph=t,i.add(e.subject,e.predicate,e.object,e.graph)}))),s()}if(e.where){var a=new Or("patch");a.pat=e.where,a.pat.statements.map((function(e){e.graph=Gn(t.value)})),a.sync=!0;var l=[];i.query(a,(function(e){l.push(e)}),i.fetcher,(function(){return 0===l.length?r("No match found to be patched:"+e.where):l.length>1?r("Patch ambiguous. No patch done."):(o=l[0],void s(r))}))}else s(r)}declareExistential(e){return this._existentialVariables||(this._existentialVariables=[]),this._existentialVariables.push(e),e}initPropertyActions(e){this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"))]=[Rr],xr(e,"sameAs")>=0&&(this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${Ir}sameAs`))]=[function(e,t,r,n,i){return e.equate(t,n),!0}]),xr(e,"InverseFunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${Ir}InverseFunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,Ar)}]),xr(e,"FunctionalProperty")>=0&&(this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${Ir}FunctionalProperty`))]=[function(e,t,r,n,i){return e.newPropertyAction(t,kr)}])}addStatement(e){return this.add(e.subject,e.predicate,e.object,e.graph),this.statements.length}add(e,t,r,n){var i,o,s;if(1===arguments.length){if(e instanceof Array)for(i=0;i<e.length;i++)this.add(e[i]);else(0,u.PY)(e)?this.add(e.subject,e.predicate,e.object,e.graph):(0,u.Pv)(e)&&this.add(e.statements);return this}n||(n=this.fetcher?this.fetcher.appNode:this.rdfFactory.defaultGraph()),"string"==typeof e&&(e=this.rdfFactory.namedNode(e)),t=jr.fromValue(t);const a=jr.fromValue(r);if(n=jr.fromValue(n),!(0,u.f)(e))throw new Error("Subject is not a subject type");if(!(0,u.nq)(t))throw new Error(`Predicate ${t} is not a predicate type`);if(!(0,u.Uc)(a))throw new Error(`Object ${a} is not an object type`);if(!(0,u.NA)(n))throw new Error("Why is not a graph type");this.predicateCallback&&this.predicateCallback(this,t,n);var l=this.id(this.canon(t)),c=!1;if(o=this.propertyActions[l])for(i=0;i<o.length;i++)c=c||o[i](this,e,t,a,n);if(this.holds(e,t,a,n))return null;var h=[this.id(this.canon(e)),l,this.id(this.canon(a)),this.id(this.canon(n))];for(s=this.rdfFactory.quad(e,t,a,n),i=0;i<4;i++){var d=this.index[i],f=h[i];d[f]||(d[f]=[]),d[f].push(s)}if(this.statements.push(s),this.dataCallbacks)for(const e of this.dataCallbacks)e(s);return s}canon(e){if(!e)return e;const t=this.redirections[this.id(e)];if(t)return t;switch(e.termType){case s.V1:return new l(e.value);case s.fb:return e;case s.NK:return new Wt;case s.ls:case s._A:return e;case s.xH:return new d(e.value,e.language,e.datatype);case s.XM:return new c.Z(e.value);case s.UH:return new nr(e.value);default:throw new Error(`Term Type not recognized for canonization: ${e.termType}`)}}check(){this.checkStatementList(this.statements);for(var e=0;e<4;e++){var t=this.index[e];for(var r in t)t.hasOwnProperty(r)&&this.checkStatementList(t[r],e)}}checkStatementList(e,t){void 0===t&&(t=0);for(var r,n=" found in "+["subject","predicate","object","why"][t]+" index.",i=0;i<e.length;i++){for(var o=[(r=e[i]).subject,r.predicate,r.object,r.graph],s=function(e,t){for(var r=0;r<e.length;r++)if(e[r].subject.equals(t.subject)&&e[r].predicate.equals(t.predicate)&&e[r].object.equals(t.object)&&e[r].why.equals(t.graph))return!0},a=0;a<4;a++){var l=this.canon(o[a]),c=this.id(l);this.index[a][c]&&s(this.index[a][c],r)}if(!s(this.statements,r))throw new Error("Statement list does not statement "+r+"@"+r.graph+n)}}close(){return this}compareTerms(e,t){return Object.prototype.hasOwnProperty.call(e,"compareTerm")?e.compareTerm(t):r.Z[e.termType]<r.Z[t.termType]?-1:r.Z[e.termType]>r.Z[t.termType]?1:e.value<t.value?-1:e.value>t.value?1:0}copyTo(e,t,r){r||(r=[]);var n=this.statementsMatching(e);-1!==xr(r,"two-direction")&&n.concat(this.statementsMatching(void 0,void 0,e));for(var i=0;i<n.length;i++){var o=n[i];switch(o.object.termType){case"NamedNode":this.add(t,o.predicate,o.object);break;case"Literal":case"BlankNode":case"Collection":this.add(t,o.predicate,o.object.copy(this))}-1!==xr(r,"delete")&&this.remove(o)}}equate(e,t){const r=this.canon(e),n=this.canon(t);var i=this.compareTerms(r,n);return!i||(i<0?this.replaceWith(n,r):this.replaceWith(r,n))}formula(e){return new Cr(e)}get length(){return this.statements.length}match(e,t,r,n){return this.statementsMatching(jr.fromValue(e),jr.fromValue(t),jr.fromValue(r),jr.fromValue(n))}mentionsURI(e){var t="<"+e+">";return!!this.subjectIndex[t]||!!this.objectIndex[t]||!!this.predicateIndex[t]}newExistential(e){if(!e)return this.bnode();var t=this.sym(e);return this.declareExistential(t)}newPropertyAction(e,t){var r=this.id(e);this.propertyActions[r]||(this.propertyActions[r]=[]),this.propertyActions[r].push(t);for(var n=this.statementsMatching(void 0,e,void 0),i=!1,o=0;o<n.length;o++)i=i||t(this,n[o].subject,e,n[o].object);return i}newUniversal(e){var t=this.sym(e);return this._universalVariables||(this._universalVariables=[]),this._universalVariables.push(t),t}variable(e){return new nr(e)}nextSymbol(e){for(var t=0;;t++){var r=e.value+"#n"+t;if(!this.mentionsURI(r))return this.sym(r)}}query(e,t,r,n){return Sr.call(this,e,t,r,n)}querySync(e){var t=[],r=!1;if(e.sync=!0,Sr.call(this,e,(function(e){t.push(e)}),null,(function(){r=!0})),!r)throw new Error("Sync query should have called done function");return t}remove(e){if(e instanceof Array){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}if((0,u.Pv)(e))return this.remove(e.statements);var r=this.statementsMatching(e.subject,e.predicate,e.object,e.graph);if(!r.length)throw new Error("Statement to be removed is not on store: "+e);return this.removeStatement(r[0]),this}removeDocument(e){for(var t=this.statementsMatching(void 0,void 0,void 0,e).slice(),r=0;r<t.length;r++)this.removeStatement(t[r]);return this}removeMany(e,t,r,n,i){for(var o=this.statementsMatching(e,t,r,n,!1),s=[],a=0;a<o.length;a++)s.push(o[a]);for(i&&(s=s.slice(0,i)),a=0;a<s.length;a++)this.remove(s[a])}removeMatches(e,t,r,n){return this.removeMany(e,t,r,n),this}removeStatement(e){for(var t=[e.subject,e.predicate,e.object,e.graph],r=0;r<4;r++){var n=this.canon(t[r]),i=this.id(n);this.index[r][i]&&this.rdfArrayRemove(this.index[r][i],e)}return this.rdfArrayRemove(this.statements,e),this}removeStatements(e){for(var t=0;t<e.length;t++)this.remove(e[t]);return this}replaceWith(e,t){for(var r=this.id(e),n=this.id(t),i=function(e){var t=e[r];if(t){var i=e[n];e[n]=i?t.concat(i):t,delete e[r]}},o=0;o<4;o++)i(this.index[o]);if(this.redirections[r]=t,e.value){if(this.aliases[n]||(this.aliases[n]=[]),this.aliases[n].push(e),this.aliases[r])for(o=0;o<this.aliases[r].length;o++)this.redirections[this.id(this.aliases[r][o])]=t,this.aliases[n].push(this.aliases[r][o]);this.add(t,this.sym("http://www.w3.org/2007/ont/link#uri"),e),this.fetcher&&this.fetcher.nowKnownAs(e,t)}return i(this.classActions),i(this.propertyActions),!0}allAliases(e){var t=this.aliases[this.id(this.canon(e))]||[];return t.push(this.canon(e)),t}sameThings(e,t){if(e.equals(t))return!0;var r=this.canon(e);if(!r)return!1;var n=this.canon(t);return!!n&&r.value===n.value}setPrefixForURI(e,t){if(("tab"!==e||!this.namespaces.tab)&&"ns"!==e.slice(0,2)&&"default"!==e.slice(0,7)){for(let e in this.namespaces)this.namespaces[e]==t&&delete this.namespaces[e];this.namespaces[e]=t}}statementsMatching(e,t,r,n,i){var o,s,a=[e,t,r,n],l=[],c=[],u=[],h=[];for(o=0;o<4;o++)l[o]=this.canon(jr.fromValue(a[o])),l[o]?(h.push(o),c[o]=this.id(l[o])):u.push(o);if(0===h.length)return this.statements;if(1===h.length)return o=h[0],(s=this.index[o][c[o]])&&i&&s.length>1&&(s=s.slice(0,1)),s||[];var d,f,p=1e10;for(f=0;f<h.length;f++){if(o=h[f],!(s=this.index[o][c[o]]))return[];s.length<p&&(p=s.length,d=f)}for(var g=h[d],y=this.index[g][c[g]],v=h.slice(0,d).concat(h.slice(d+1)),m=[],b=["subject","predicate","object","why"],w=0;w<y.length;w++){var x=y[w];for(f=0;f<v.length;f++)if(o=v[f],!this.canon(x[b[o]]).equals(l[o])){x=null;break}if(null!=x&&(m.push(x),i))break}return m}uris(e){var t=this.canon(e),r=this.aliases[this.id(t)];if(!t.value)return[];var n=[t.value];if(r)for(var i=0;i<r.length;i++)n.push(r[i].uri);return n}serialize(e,t,r,n){return vr(r,this,e,t,void 0,n={...n||{},namespaces:n?.namespaces?{...this.namespaces,...n.namespaces}:{...this.namespaces}})}}(0,t.Z)(Cr,"handleRDFType",void 0),Cr.handleRDFType=Rr;var Dr="http://www.w3.org/2000/10/swap/log#",Lr=function(e){return e},Pr=function(e){return e},Mr=function(e){if(e.length>0)throw"missing.js: oops nnonempty dict not imp";return[]},Fr=function(e){return e.length},Ur=function(e,t,r){if(void 0===e.slice)throw"@@ mising.js: No .slice function for "+e+" of type "+typeof e;return void 0===r||null==r?e.slice(t):e.slice(t,r)},Br=Error("dummy error stop iteration"),qr=function(e){return this.last=0,this.li=e,this.next=function(){if(this.last==this.li.length)throw Br;return this.li[this.last++]},this},Hr=function(e,t){return e.indexOf(t)},$r=function(e,t){if(!e){if(t)throw"python Assertion failed: "+t;throw"(python) Assertion failed."}};String.prototype.encode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return function(e){e=e.replace(/\r\n/g,"\n");for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r);n<128?t+=String.fromCharCode(n):n>127&&n<2048?(t+=String.fromCharCode(n>>6|192),t+=String.fromCharCode(63&n|128)):(t+=String.fromCharCode(n>>12|224),t+=String.fromCharCode(n>>6&63|128),t+=String.fromCharCode(63&n|128))}return t}(this)},String.prototype.decode=function(e){if("utf-8"!=e)throw"UTF8_converter: can only do utf-8";return this};var Zr=function(e,t){return rr.join(t,e)},Vr="http://www.w3.org/2002/07/owl#sameAs",zr="\t\r\n !\"#$%&'()*.,+/;<=>?@[\\]^`{|}~",Gr=zr+":",Jr=new RegExp("^([-+]?[0-9]+)(\\.[0-9]+)?(e[-+]?[0-9]+)?","g"),Xr=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?"),Qr=new RegExp('[\\\\\\r\\n\\"]',"g"),Wr=new RegExp("^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*","g");const Yr=function(e,t,r,n,i,o,s,a){return new Kr(e,t,r,n,i,o,s,a)};class Kr{constructor(e,t,r,n,i,o,s,a){void 0===t&&(t=null),void 0===r&&(r=""),void 0===n&&(n=null),void 0===i&&(i=""),void 0===o&&(o=null),void 0===s&&(s=""),void 0===a&&(a=null),this._bindings=new Mr([]),this._flags=s,""!=r&&($r(r.indexOf(":")>=0,"Document URI not absolute: "+r),this._bindings[""]=r+"#"),this._store=e,i&&e.setGenPrefix(i),this._thisDoc=r,this.source=e.sym(r),this.lines=0,this.statementCount=0,this.startOfLine=0,this.previousLine=0,this._genPrefix=i,this.keywords=new Pr(["a","this","bind","has","is","of","true","false"]),this.keywordsSet=0,this._anonymousNodes=new Mr([]),this._variables=new Mr([]),this._parentVariables=new Mr([]),this._reason=a,this._reason2=null,this._baseURI=n||r||null,$r(!this._baseURI||this._baseURI.indexOf(":")>=0),this._genPrefix||(this._thisDoc?this._genPrefix=this._thisDoc+"#_g":this._genPrefix=RDFSink_uniqueURI()),null==t?this._thisDoc?this._formula=e.formula(r+"#_formula"):this._formula=e.formula():this._formula=t,this._context=this._formula,this._parentContext=null}here(e){return this._genPrefix+"_L"+this.lines+"C"+(e-this.startOfLine+1)}formula(){return this._formula}loadStream(e){return this.loadBuf(e.read())}loadBuf(e){return this.startDoc(),this.feed(e),this.endDoc()}feed(e){for(var t=e.decode("utf-8"),r=0;r>=0;){var n=this.skipSpace(t,r);if(n<0)return;if((r=this.directiveOrStatement(t,n))<0)throw en(this._thisDoc,this.lines,t,n,"expected directive or statement")}}directiveOrStatement(e,t){var r,n=this.skipSpace(e,t);return n<0?n:(r=this.directive(e,n))>=0||(r=this.statement(e,n))>=0?this.checkDot(e,r):r}tok(e,t,r){if("@"==t.slice(r,r+1))r+=1;else if(xr(this.keywords,e)<0)return-1;var n=r+Fr(e);return t.slice(r,n)==e&&zr.indexOf(t.charAt(n))>=0?n:-1}directive(e,t){if((o=this.skipSpace(e,t))<0)return o;var r=new Pr([]);if((o=this.tok("bind",e,t))>0)throw en(this._thisDoc,this.lines,e,t,"keyword bind is obsolete: use @prefix");if((o=this.tok("keywords",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!1))<0)throw en(this._thisDoc,this.lines,e,t,"'@keywords' needs comma separated list of words");return this.setKeywords(Ur(r,null,null)),t}if((o=this.tok("forAll",e,t))>0){if((t=this.commaSeparatedList(e,o,r,!0))<0)throw en(this._thisDoc,this.lines,e,t,"Bad variable list after @forAll");var n=new qr(r);try{for(;;){var i=n.next();(xr(this._variables,i)<0||xr(this._parentVariables,i)>=0)&&(this._variables[i]=this._context.newUniversal(i))}}catch(e){if(e!=Br)throw e}return t}if((o=this.tok("forSome",e,t))>0){if((t=this.commaSeparatedList(e,o,r,this.uri_ref2))<0)throw en(this._thisDoc,this.lines,e,t,"Bad variable list after @forSome");n=new qr(r);try{for(;;)i=n.next(),this._context.declareExistential(i)}catch(e){if(e!=Br)throw e}return t}if((o=this.tok("prefix",e,t))>=0){var o,s=new Pr([]);if((t=this.qname(e,o,s))<0)throw en(this._thisDoc,this.lines,e,o,"expected qname after @prefix");if((o=this.uri_ref2(e,t,s))<0)throw en(this._thisDoc,this.lines,e,t,"expected <uriref> after @prefix _qname_");var a=s[1].uri;return this._baseURI?a=Zr(this._baseURI,a):$r(a.indexOf(":")>=0,"With no base URI, cannot handle relative URI for NS"),$r(a.indexOf(":")>=0),this._bindings[s[0][0]]=a,this.bind(s[0][0],function(e){return encodeURI(e)}(a)),o}if((o=this.tok("base",e,t))>=0){if(s=new Pr([]),(t=this.uri_ref2(e,o,s))<0)throw en(this._thisDoc,this.lines,e,o,"expected <uri> after @base ");if(a=s[0].uri,!this._baseURI)throw en(this._thisDoc,this.lines,e,o,"With no previous base URI, cannot use relative URI in @base <"+a+">");return a=Zr(this._baseURI,a),$r(a.indexOf(":")>=0),this._baseURI=a,t}return-1}bind(e,t){""==e||this._store.setPrefixForURI(e,t)}setKeywords(e){null==e?this.keywordsSet=0:(this.keywords=e,this.keywordsSet=1)}startDoc(){}endDoc(){return this._formula}makeStatement(e){e[0].add(e[2],e[1],e[3],this.source),this.statementCount+=1}statement(e,t){var r=new Pr([]);if((t=this.object(e,t,r))<0)return t;var n=this.property_list(e,t,r[0]);if(n<0)throw en(this._thisDoc,this.lines,e,t,"expected propertylist");return n}subject(e,t,r){return this.item(e,t,r)}verb(e,t,r){if((i=this.skipSpace(e,t))<0)return i;var n=new Pr([]);if((i=this.tok("has",e,t))>=0){if((t=this.prop(e,i,n))<0)throw en(this._thisDoc,this.lines,e,i,"expected property after 'has'");return r.push(new Lr(["->",n[0]])),t}if((i=this.tok("is",e,t))>=0){if((t=this.prop(e,i,n))<0)throw en(this._thisDoc,this.lines,e,i,"expected <property> after 'is'");if((i=this.skipSpace(e,t))<0)throw en(this._thisDoc,this.lines,e,t,"End of file found, expected property after 'is'");var i;if(t=i,(i=this.tok("of",e,t))<0)throw en(this._thisDoc,this.lines,e,t,"expected 'of' after 'is' <prop>");return r.push(new Lr(["<-",n[0]])),i}if((i=this.tok("a",e,t))>=0)return r.push(new Lr(["->",this._store.sym("http://www.w3.org/1999/02/22-rdf-syntax-ns#type")])),i;if("<="==e.slice(t,t+2))return r.push(new Lr(["<-",this._store.sym(Dr+"implies")])),t+2;if("="==e.slice(t,t+1))return">"==e.slice(t+1,t+2)?(r.push(new Lr(["->",this._store.sym(Dr+"implies")])),t+2):(r.push(new Lr(["->",this._store.sym(Vr)])),t+1);if(":="==e.slice(t,t+2))return r.push(new Lr(["->",Dr+"becomes"])),t+2;if((i=this.prop(e,t,n))>=0)return r.push(new Lr(["->",n[0]])),i;if(">-"==e.slice(t,t+2)||"<-"==e.slice(t,t+2))throw en(this._thisDoc,this.lines,e,i,">- ... -> syntax is obsolete.");return-1}prop(e,t,r){return this.item(e,t,r)}item(e,t,r){return this.path(e,t,r)}blankNode(e){return this._context.bnode(e,this._reason2)}path(e,t,r){if((o=this.nodeOrLiteral(e,t,r))<0)return o;for(;"!^.".indexOf(e.slice(o,o+1))>=0;){var n=e.slice(o,o+1);if("."==n){var i=e.slice(o+1,o+2);if(!i||Gr.indexOf(i)>=0&&":?<[{(".indexOf(i)<0)break}var o,s=r.pop(),a=this.blankNode(this.here(o));if((o=this.node(e,o+1,r))<0)throw en(this._thisDoc,this.lines,e,o,"EOF found in middle of path syntax");var l=r.pop();"^"==n?this.makeStatement(new Lr([this._context,l,a,s])):this.makeStatement(new Lr([this._context,l,s,a])),r.push(a)}return o}anonymousNode(e){if(t=this._anonymousNodes[e])return t;var t=this._store.bnode(e);return this._anonymousNodes[e]=t,t}node(e,t,r,n){void 0===n&&(n=null);var i=n;if((u=this.skipSpace(e,t))<0)return u;t=u;var o=e.slice(t,t+1);if("["==o){var s=this.here(t);if((u=this.skipSpace(e,t+1))<0)throw en(this._thisDoc,this.lines,e,t,"EOF after '['");if("="==e.slice(u,u+1)){t=u+1;var a=new Pr([]);if(!((u=this.objectList(e,t,a))>=0))throw en(this._thisDoc,this.lines,e,t,"objectList expected after [= ");if(i=a[0],Fr(a)>1){var l=new qr(a);try{for(;;){var c=l.next();this.makeStatement(new Lr([this._context,this._store.sym(Vr),i,c]))}}catch(e){if(e!=Br)throw e}}if((u=this.skipSpace(e,u))<0)throw en(this._thisDoc,this.lines,e,t,"EOF when objectList expected after [ = ");if(";"==e.slice(u,u+1))var u=u+1}if(null==i&&(i=this.blankNode(s)),(t=this.property_list(e,u,i))<0)throw en(this._thisDoc,this.lines,e,u,"property_list expected");if((u=this.skipSpace(e,t))<0)throw en(this._thisDoc,this.lines,e,t,"EOF when ']' expected after [ <propertyList>");if("]"!=e.slice(u,u+1))throw en(this._thisDoc,this.lines,e,u,"']' expected");return r.push(i),u+1}if("{"==o){if("$"==e.slice(t+1,t+2)){u=(t+=1)+1;for(var h=new Pr([]),d=!0;;){if((t=this.skipSpace(e,u))<0)throw en(this._thisDoc,this.lines,e,t,"needed '$}', found end.");if("$}"==e.slice(t,t+2)){u=t+2;break}if(d)d=!1;else{if(","!=e.slice(t,t+1))throw en(this._thisDoc,this.lines,e,t,"expected: ','");t+=1}var f=new Pr([]);if((u=this.item(e,t,f))<0)throw en(this._thisDoc,this.lines,e,t,"expected item in set or '$}'");h.push(f[0])}return r.push(this._store.newSet(h,this._context)),u}u=t+1;var p=this._parentContext;this._parentContext=this._context;var g=this._anonymousNodes,y=this._parentVariables;this._parentVariables=this._variables,this._anonymousNodes=new Mr([]),this._variables=this._variables.slice();var v=this._reason2;for(this._reason2=null,null==i&&(i=this._store.formula()),this._context=i;;){if((t=this.skipSpace(e,u))<0)throw en(this._thisDoc,this.lines,e,t,"needed '}', found end.");if("}"==e.slice(t,t+1)){u=t+1;break}if((u=this.directiveOrStatement(e,t))<0)throw en(this._thisDoc,this.lines,e,t,"expected statement or '}'")}return this._anonymousNodes=g,this._variables=this._parentVariables,this._parentVariables=y,this._context=this._parentContext,this._reason2=v,this._parentContext=p,r.push(i.close()),u}if("("==o){var m=this._store.list;for("$"==e.slice(t+1,t+2)&&(m=this._store.newSet,t+=1),u=t+1,h=new Pr([]);;){if((t=this.skipSpace(e,u))<0)throw en(this._thisDoc,this.lines,e,t,"needed ')', found end.");if(")"==e.slice(t,t+1)){u=t+1;break}if(f=new Pr([]),(u=this.item(e,t,f))<0)throw en(this._thisDoc,this.lines,e,t,"expected item in list or ')'");h.push(f[0])}return r.push(m(h,this._context)),u}if((u=this.tok("this",e,t))>=0)throw en(this._thisDoc,this.lines,e,t,"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.");return(u=this.tok("true",e,t))>=0?(r.push(!0),u):(u=this.tok("false",e,t))>=0?(r.push(!1),u):null==i&&(u=this.uri_ref2(e,t,r))>=0?u:-1}property_list(e,t,r){for(;;){if((u=this.skipSpace(e,t))<0)throw en(this._thisDoc,this.lines,e,t,"EOF found when expected verb in property list");if(":-"!=e.slice(u,u+2)){t=u;var n=new Pr([]);if((u=this.verb(e,t,n))<=0)return t;var i=new Pr([]);if((t=this.objectList(e,u,i))<0)throw en(this._thisDoc,this.lines,e,u,"objectList expected");var o=new qr(i);try{for(;;){var s=o.next(),a=n[0],l=a[0],c=a[1];"->"==l?this.makeStatement(new Lr([this._context,c,r,s])):this.makeStatement(new Lr([this._context,c,s,r]))}}catch(e){if(e!=Br)throw e}if((u=this.skipSpace(e,t))<0)throw en(this._thisDoc,this.lines,e,u,"EOF found in list of objects");if(";"!=e.slice(t,t+1))return t;t+=1}else{t=u+2;var u,h=new Pr([]);if((u=this.node(e,t,h,r))<0)throw en(this._thisDoc,this.lines,e,t,"bad {} or () or [] node after :- ");t=u}}}commaSeparatedList(e,t,r,n){if((i=this.skipSpace(e,t))<0)throw en(this._thisDoc,this.lines,e,i,"EOF found expecting comma sep list");if("."==e.charAt(i))return t;if(n)var i=this.uri_ref2(e,i,r);else i=this.bareWord(e,i,r);if(i<0)return-1;for(;;){if((t=this.skipSpace(e,i))<0)return t;var o=e.slice(t,t+1);if(","!=o)return"."!=o?-1:t;if((i=n?this.uri_ref2(e,t+1,r):this.bareWord(e,t+1,r))<0)throw en(this._thisDoc,this.lines,e,i,"bad list content")}}objectList(e,t,r){if((t=this.object(e,t,r))<0)return-1;for(;;){var n=this.skipSpace(e,t);if(n<0)throw en(this._thisDoc,this.lines,e,n,"EOF found after object");if(","!=e.slice(n,n+1))return n;if((t=this.object(e,n+1,r))<0)return t}}checkDot(e,t){var r=this.skipSpace(e,t);if(r<0)return r;if("."==e.slice(r,r+1))return r+1;if("}"==e.slice(r,r+1))return r;if("]"==e.slice(r,r+1))return r;throw en(this._thisDoc,this.lines,e,r,"expected '.' or '}' or ']' at end of statement")}uri_ref2(e,t,r){var n=new Pr([]);if((d=this.qname(e,t,n))>=0){var i=n[0],o=i[0],s=i[1];if(null==o){$r(0,"not used?");var a=this._baseURI+"#"}else if(!(a=this._bindings[o])){if("_"==o)return r.push(this.anonymousNode(s)),d;throw en(this._thisDoc,this.lines,e,t,"Prefix "+o+" not bound.")}var l=this._store.sym(a+s);return xr(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),d}if((t=this.skipSpace(e,t))<0)return-1;if("?"==e.charAt(t)){var c=new Pr([]);return(d=this.variable(e,t,c))>0?(r.push(c[0]),d):-1}if("<"==e.charAt(t)){for(var u=t+=1;t<Fr(e);){if(">"==e.charAt(t)){var h=e.slice(u,t);return this._baseURI?h=Zr(this._baseURI,h):$r(h.indexOf(":")>=0,"With no base URI, cannot deal with relative URIs"),"#"==e.slice(t-1,t)&&"#"!=Ur(h,-1,null)&&(h+="#"),l=this._store.sym(h),xr(this._variables,l)>=0?r.push(this._variables[l]):r.push(l),t+1}t+=1}throw en(this._thisDoc,this.lines,e,d,"unterminated URI reference")}if(this.keywordsSet){var d;if(c=new Pr([]),(d=this.bareWord(e,t,c))<0)return-1;if(xr(this.keywords,c[0])>=0)throw en(this._thisDoc,this.lines,e,t,'Keyword "'+c[0]+'" not allowed here.');return r.push(this._store.sym(this._bindings[""]+c[0])),d}return-1}skipSpace(e,t){for(var r=t||0;r<e.length;r++){var n=e.charAt(r);if(" \n\r\t\f\v            ​\u2028\u2029 ".indexOf(n)<0){if("#"!==e.charAt(r))return r;for(;;r++){if(r===e.length)return-1;if("\n"===e.charAt(r)){this.lines=this.lines+1;break}}}else"\n"===e.charAt(r)&&(this.lines=this.lines+1)}return-1}variable(e,t,r){if((n=this.skipSpace(e,t))<0)return-1;if("?"!=e.slice(n,n+1))return-1;var n;if(t=n+=1,"0123456789-".indexOf(e.charAt(n))>=0)throw en(this._thisDoc,this.lines,e,n,"Varible name can't start with '"+e.charAt(n)+"s'");for(;t<Fr(e)&&Gr.indexOf(e.charAt(t))<0;)t+=1;if(null==this._parentContext)throw en(this._thisDoc,this.lines,e,n,"Can't use ?xxx syntax for variable in outermost level: "+e.slice(n-1,t));return r.push(this._store.variable(e.slice(n,t))),t}bareWord(e,t,r){var n=this.skipSpace(e,t);if(n<0)return-1;var i=e.charAt(n);if("0123456789-".indexOf(i)>=0)return-1;if(Gr.indexOf(i)>=0)return-1;for(t=n;t<Fr(e)&&Gr.indexOf(e.charAt(t))<0;)t+=1;return r.push(e.slice(n,t)),t}qname(e,t,r){if((t=this.skipSpace(e,t))<0)return-1;var n=e.charAt(t);if("0123456789-+".indexOf(n)>=0)return-1;if(Gr.indexOf(n)<0){var i=n;for(t+=1;t<Fr(e)&&(n=e.charAt(t),Gr.indexOf(n)<0);)i+=n,t+=1}else i="";if(t<Fr(e)&&":"==e.charAt(t)){var o=i;for(t+=1,i="";t<Fr(e)&&(n=e.charAt(t),Gr.indexOf(n)<0);)i+=n,t+=1;return r.push(new Lr([o,i])),t}return i&&this.keywordsSet&&xr(this.keywords,i)<0?(r.push(new Lr(["",i])),t):-1}object(e,t,r){if((o=this.subject(e,t,r))>=0)return o;{if((o=this.skipSpace(e,t))<0)return-1;t=o;var n=null;let a=e.charAt(t);if('"'==a||"'"==a){n=e.slice(t,t+3==a+a)?a+a+a:a,t+=Fr(n);var i=this.strconst(e,t,n),o=i[0],s=i[1];return r.push(this._store.literal(s)),o}return-1}}nodeOrLiteral(e,t,r){if((l=this.node(e,t,r))>=0)return l;if((l=this.skipSpace(e,t))<0)return-1;t=l;var n=e.charAt(t);if("-+0987654321".indexOf(n)>=0){if(Xr.lastIndex=0,null!=(h=Xr.exec(e.slice(t))))l=t+(i=h[0]).length,i.indexOf("T")>=0?r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#dateTime"))):r.push(this._store.literal(i,this._store.sym("http://www.w3.org/2001/XMLSchema#date")));else{var i;if(Jr.lastIndex=0,null==(h=Jr.exec(e.slice(t))))throw en(this._thisDoc,this.lines,e,t,"Bad number or date syntax");l=t+Jr.lastIndex,(i=e.slice(t,l)).indexOf("e")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#double"))):e.slice(t,l).indexOf(".")>=0?r.push(this._store.literal(parseFloat(i),this._store.sym("http://www.w3.org/2001/XMLSchema#decimal"))):r.push(this._store.literal(parseInt(i),this._store.sym("http://www.w3.org/2001/XMLSchema#integer")))}return l}if('"'==e.charAt(t)){if('"""'==e.slice(t,t+3))var o='"""';else o='"';t+=Fr(o);var s=null,a=this.strconst(e,t,o),l=a[0],c=a[1],u=null;if("@"==e.slice(l,l+1)){var h;if(Wr.lastIndex=0,null==(h=Wr.exec(e.slice(l+1))))throw en(this._thisDoc,startline,e,t,"Bad language code syntax on string literal, after @");t=Wr.lastIndex+l+1,u=e.slice(l+1,t),l=t}if("^^"==e.slice(l,l+2)){var d=new Pr([]);l=this.uri_ref2(e,l+2,d),s=d[0]}return r.push(this._store.literal(c,u||s)),l}return-1}strconst(e,t,r){for(var n=t,i="",o=this.lines;n<Fr(e);){if(t=n+Fr(r),e.slice(n,t)==r)return new Lr([t,i]);if('"'!=e.charAt(n)){if(Qr.lastIndex=0,!Qr.exec(e.slice(n)))throw en(this._thisDoc,o,e,n,"Closing quote missing in string at ^ in "+e.slice(n-20,n)+"^"+e.slice(n,n+20));if(t=n+Qr.lastIndex-1,i+=e.slice(n,t),'"'!=(l=e.charAt(t)))if("\r"!=l){if("\n"==l){if('"'==r)throw en(this._thisDoc,o,e,t,"newline found in string literal");this.lines=this.lines+1,i+=l,n=t+1,this.previousLine=this.startOfLine,this.startOfLine=n}else if("\\"==l){if(n=t+1,!(l=e.slice(n,n+1)))throw en(this._thisDoc,o,e,t,"unterminated string literal (2)");var s=Hr('abfrtvn\\"',l);if(s>=0)i+='a\b\f\r\t\v\n\\"'.charAt(s),n+=1;else if("u"==l)n=(a=this.uEscape(e,n+1,o))[0],i+=l=a[1];else{if("U"!=l)throw en(this._thisDoc,this.lines,e,t,"bad escape");var a,l;n=(a=this.UEscape(e,n+1,o))[0],i+=l=a[1]}}}else n=t+1;else n=t}else i=i+'"',n=n+1}throw en(this._thisDoc,this.lines,e,t,"unterminated string literal")}uEscape(e,t,r){for(var n=t,i=0,o=0;i<4;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw en(this._thisDoc,r,e,t,"unterminated string literal(3)");var a=Hr("0123456789abcdef",s);if(a<0)throw en(this._thisDoc,r,e,t,"bad string literal hex escape");o=16*o+a,i+=1}var l=String.fromCharCode(o);return new Lr([n,l])}UEscape(e,t,r){for(var n=t,i=0,o="\\U";i<8;){var s=e.slice(n,n+1).toLowerCase();if(n+=1,""==s)throw en(this._thisDoc,r,e,t,"unterminated string literal(3)");if(Hr("0123456789abcdef",s)<0)throw en(this._thisDoc,r,e,t,"bad string literal hex escape");o+=s,i+=1}var a,l=(a="0x"+Ur(o,2,10)-0,String.fromCharCode(a));return new Lr([n,l])}}function en(e,t,r,n,i){let o=t+1,s="Line "+o+" of <"+e+">: Bad syntax: "+i+'\nat: "'+r.slice(n,n+30)+'"',a=new SyntaxError(s,e,o);return a.lineNo=o,a.characterInFile=n,a.syntaxProblem=i,a}const tn={...ar,supports:{[ir.collections]:!0,[ir.defaultGraphType]:!1,[ir.equalsMethod]:!0,[ir.identity]:!1,[ir.id]:!0,[ir.reversibleId]:!1,[ir.variableType]:!0},collection:e=>new p(e),id(e){return(0,u.uZ)(e)?`( ${e.elements.map((e=>this.id(e))).join(", ")} )`:(0,u.cG)(e)?nr.toString(e):ar.id(e)},termToNQ:e=>e.termType===s.fb?p.toNT(e):ar.termToNQ(e)},rn=tn;function nn(e,t){return"string"==typeof t?e.rdfFactory.literal(t):Object.prototype.hasOwnProperty.call(t,"@list")?!0===e.rdfFactory.supports.COLLECTIONS?function(e,t){if(!Array.isArray(t))throw new TypeError("Object must be an array");return e.rdfFactory.collection(t.map((t=>nn(e,t))))}(e,t["@list"]):function(e,t){const r=t["@id"]?e.rdfFactory.namedNode(t["@id"]):e.rdfFactory.blankNode(),n=t["@list"].map((t=>nn(e,t))),i=wr(e.rdfFactory,r,n);return e.addAll(i),r}(e,t):Object.prototype.hasOwnProperty.call(t,"@id")?e.rdfFactory.namedNode(t["@id"]):Object.prototype.hasOwnProperty.call(t,"@language")?e.rdfFactory.literal(t["@value"],t["@language"]):Object.prototype.hasOwnProperty.call(t,"@type")?e.rdfFactory.literal(t["@value"],e.rdfFactory.namedNode(t["@type"])):Object.prototype.hasOwnProperty.call(t,"@value")?e.rdfFactory.literal(t["@value"]):e.rdfFactory.literal(t)}function on(e,t,r,n){const i=r&&Object.prototype.hasOwnProperty.call(r,"termType")?r.value:r;return st().flatten(JSON.parse(e),null,{base:i}).then((e=>e.reduce(((e,n)=>t=sn(t,r,n)),t))).then(n).catch(n)}function sn(e,t,r){const n=r["@id"]?e.rdfFactory.namedNode(r["@id"]):e.rdfFactory.blankNode();for(const i of Object.keys(r)){if("@id"===i)continue;if("@graph"==i){const t=n,o=r[i];for(let r=0;r<o.length;r++)e=sn(e,t,o[r])}const o=r[i];if(Array.isArray(o))for(let r=0;r<o.length;r++)e.addStatement(an(e,n,i,o[r],t));else e.addStatement(an(e,n,i,o,t))}return e}function an(e,t,r,n,i){let o,s;return"@type"===r?(o=e.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),s=e.rdfFactory.namedNode(n)):(o=e.rdfFactory.namedNode(r),s=nn(e,n)),e.rdfFactory.quad(t,o,s,e.rdfFactory.namedNode(i))}var ln=n(292);if(void 0===cn)var cn={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12};class un{constructor(e,t){this.options=t||{},this.kb=e,this.target=t.target||{graph:{subjects:{},prefixes:{},terms:{}}},this.blankNodes=[],this.htmlOptions={selfClosing:"br img input area base basefont col colgroup source wbr isindex link meta param hr"},this.theOne="_:"+(new Date).getTime(),this.language=null,this.vocabulary=null,this.blankCounter=0,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}],this.inXHTMLMode=!1,this.absURIRE=/[\w\_\-]+:\S+/,this.finishedHandlers=[],this.init()}addTriple(e,t,r,n){var i,o,s,a;i=void 0===t?ar.namedNode(this.options.base):this.toRDFNodeObject(t),s=this.toRDFNodeObject(r),o=this.toRDFNodeObject(n),a=ar.namedNode(this.options.base),this.kb.add(i,s,o,a)}ancestorPath(e){for(var t="";e&&e.nodeType!==cn.DOCUMENT_NODE;)t="/"+e.localName+t,e=e.parentNode;return t}copyMappings(e){var t={};for(var r in e)t[r]=e[r];return t}copyProperties(){}deriveDateTimeType(e){for(var t=0;t<un.dateTimeTypes.length;t++){var r=un.dateTimeTypes[t].pattern.exec(e);if(r&&r[0].length===e.length)return un.dateTimeTypes[t].type}return null}init(){}newBlankNode(){return this.blankCounter++,"_:"+this.blankCounter}newSubjectOrigin(e,t){}parseCURIE(e,t,r){var n,i=e.indexOf(":");if(i>=0){var o=e.substring(0,i);if(""===o)return(n=t[""])?n+e.substring(i+1):null;if("_"===o)return"_:"+e.substring(i+1);if(un.NCNAME.test(o)&&(n=t[o]))return n+e.substring(i+1)}return null}parseCURIEOrURI(e,t,r){return this.parseCURIE(e,t,r)||this.resolveAndNormalize(r,e)}parsePredicate(e,t,r,n,i,o){if(""===e)return null;var s=this.parseTermOrCURIEOrAbsURI(e,t,o?null:r,n,i);return s&&0===s.indexOf("_:")?null:s}parsePrefixMappings(e,t){for(var r=this.tokenize(e),n=null,i=0;i<r.length;i++)":"===r[i][r[i].length-1]?n=r[i].substring(0,r[i].length-1):n&&(t[n]=this.options.base?rr.join(r[i],this.options.base):r[i],n=null)}static parseRDFaDOM(e,t,r){var n=new un(t,{base:r});e.baseURI||(e.baseURI=r),n.process(e,{baseURI:r})}parseSafeCURIEOrCURIEOrURI(e,t,r){return"["===(e=this.trim(e)).charAt(0)&&"]"===e.charAt(e.length-1)?0===(e=(e=e.substring(1,e.length-1)).trim(e)).length?null:"_:"===e?this.theOne:this.parseCURIE(e,t,r):this.parseCURIEOrURI(e,t,r)}parseTermOrCURIEOrAbsURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;if(r){if(t&&!this.absURIRE.exec(e))return t+e;var s=r[e];if(s)return s;if(s=r[e.toLowerCase()])return s}return this.absURIRE.exec(e)?this.resolveAndNormalize(i,e):null}parseTermOrCURIEOrURI(e,t,r,n,i){e=this.trim(e);var o=this.parseCURIE(e,n,i);if(o)return o;var s=r[e];return s||((s=r[e.toLowerCase()])?s:t&&!this.absURIRE.exec(e)?t+e:this.resolveAndNormalize(i,e))}parseURI(e){return e}process(e,t){var r;t=t||{},e.nodeType===cn.DOCUMENT_NODE?(e.baseURI&&!t.baseURI&&(t.baseURI=e.baseURI),r=e.baseURI,(e=e.documentElement).baseURI||(e.baseURI=r),this.setContext(e)):e.parentNode.nodeType===cn.DOCUMENT_NODE&&this.setContext(e);var n=[],i=function(e){if(!e&&t&&t.baseURI)return t.baseURI;var r=e.indexOf("#");return r>=0&&(e=e.substring(0,r)),t&&t.baseURIMap&&(e=t.baseURIMap(e)),e};for(n.push({current:e,context:this.push(null,i(e.baseURI))});n.length>0;){var o=n.shift();if(o.parent){if(o.context.parent&&o.context.parent.listMapping===o.listMapping)continue;for(let e in o.listMapping){var s=o.listMapping[e];if(0!==s.length){var a=[];for(let e=0;e<s.length;e++)a.push(this.newBlankNode());for(let e=0;e<a.length;e++)this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#first",s[e]),this.addTriple(o.parent,a[e],"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest",{type:un.objectURI,value:e+1<a.length?a[e+1]:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"});this.addTriple(o.parent,o.subject,e,{type:un.objectURI,value:a[0]})}else this.addTriple(o.parent,o.subject,e,{type:un.objectURI,value:"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil"})}}else{var l=o.current,c=o.context,u=!1,h=null,d=null,f=null,p=c.prefixes,g=!1,y=[],v=c.listMapping,m=!c.parent,b=c.language,w=c.vocabulary;r=this.parseURI(i(l.baseURI)),l.item=null;var x=l.getAttributeNode("vocab");if(x){let e=this.trim(x.value);if(e.length>0){w=e;var _=r.spec;this.addTriple(l,_,"http://www.w3.org/ns/rdfa#usesVocabulary",{type:un.objectURI,value:w})}else w=this.vocabulary}for(var T=0;T<l.attributes.length;T++){var j=l.attributes[T];if("x"===j.nodeName.charAt(0)&&0===j.nodeName.indexOf("xmlns:")){g||(p=this.copyMappings(p),g=!0);var E=j.nodeName.substring(6),N=un.trim(j.value);p[E]=this.options.base?rr.join(N,this.options.base):N}}var O=l.getAttributeNode("prefix");O&&(g||(p=this.copyMappings(p),g=!0),this.parsePrefixMappings(O.value,p));var S=null;for(let e=0;!S&&e<this.langAttributes.length;e++)S=l.getAttributeNodeNS(this.langAttributes[e].namespaceURI,this.langAttributes[e].localName);if(S){let e=un.trim(S.value);b=e.length>0?e:null}var I,k,A=l.getAttributeNode("rel"),R=l.getAttributeNode("rev"),C=l.getAttributeNode("typeof"),D=l.getAttributeNode("property"),L=l.getAttributeNode("datatype"),P=this.inHTMLMode?l.getAttributeNode("datetime"):null,M=l.getAttributeNode("content"),F=l.getAttributeNode("about"),U=l.getAttributeNode("src"),B=l.getAttributeNode("resource"),q=l.getAttributeNode("href"),H=l.getAttributeNode("inlist"),$=[];if(A){k=this.tokenize(A.value);for(let e=0;e<k.length;e++)(I=this.parsePredicate(k[e],w,c.terms,p,r,this.inHTMLMode&&null!==D))&&$.push(I)}var Z=[];if(R){k=this.tokenize(R.value);for(let e=0;e<k.length;e++)(I=this.parsePredicate(k[e],w,c.terms,p,r,this.inHTMLMode&&D))&&Z.push(I)}if(this.inHTMLMode&&(A||R)&&D&&(0===$.length&&(A=null),0===Z.length&&(R=null)),A||R?(F&&(h=this.parseSafeCURIEOrCURIEOrURI(F.value,p,r)),C&&(f=h),h||(l.parentNode.nodeType===cn.DOCUMENT_NODE?h=i(l.baseURI):c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject)),B&&(d=this.parseSafeCURIEOrCURIEOrURI(B.value,p,r)),d||(q?d=this.resolveAndNormalize(r,encodeURI(q.value)):U?d=this.resolveAndNormalize(r,encodeURI(U.value)):!C||F||this.inXHTMLMode&&("head"===l.localName||"body"===l.localName)||(d=this.newBlankNode())),!C||F||!this.inXHTMLMode||"head"!==l.localName&&"body"!==l.localName?C&&!F&&(f=d):f=h):!D||M||L?(F&&(h=this.parseSafeCURIEOrCURIEOrURI(F.value,p,r)),!h&&B&&(h=this.parseSafeCURIEOrCURIEOrURI(B.value,p,r)),!h&&q&&(h=this.resolveAndNormalize(r,encodeURI(q.value))),!h&&U&&(h=this.resolveAndNormalize(r,encodeURI(U.value))),h||(l.parentNode.nodeType===cn.DOCUMENT_NODE?h=i(l.baseURI):!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName?C?h=this.newBlankNode():c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,D||(u=!0)):h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject),C&&(f=h)):(F&&(h=this.parseSafeCURIEOrCURIEOrURI(F.value,p,r),C&&(f=h)),h||l.parentNode.nodeType!==cn.DOCUMENT_NODE?!h&&c.parentObject&&(h=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject):(h=i(l.baseURI),C&&(f=h)),C&&!f&&(B&&(f=this.parseSafeCURIEOrCURIEOrURI(B.value,p,r)),!f&&q&&(f=this.resolveAndNormalize(r,encodeURI(q.value))),!f&&U&&(f=this.resolveAndNormalize(r,encodeURI(U.value))),f||!this.inXHTMLMode&&!this.inHTMLMode||"head"!==l.localName&&"body"!==l.localName||(f=h),f||(f=this.newBlankNode()),d=f)),h&&(F||B||f)){var V=h;C&&!F&&!B&&d&&(V=d),this.newSubjectOrigin(l,V)}if(f){k=this.tokenize(C.value);for(let e=0;e<k.length;e++){var z=this.parseTermOrCURIEOrAbsURI(k[e],w,c.terms,p,r);z&&this.addTriple(l,f,un.typeURI,{type:un.objectURI,value:z})}}if(h&&h!==c.parentObject&&(v={},m=!0),d){if(A&&H)for(let e=0;e<$.length;e++){let t=v[$[e]];t||(t=[],v[$[e]]=t),t.push({type:un.objectURI,value:d})}else if(A)for(let e=0;e<$.length;e++)this.addTriple(l,h,$[e],{type:un.objectURI,value:d});if(R)for(let e=0;e<Z.length;e++)this.addTriple(l,d,Z[e],{type:un.objectURI,value:h})}else{if(h&&!d&&(A||R)&&(d=this.newBlankNode()),A&&H)for(let e=0;e<$.length;e++){let t=v[$[e]];t||(t=[],v[I]=t),y.push({predicate:$[e],list:t})}else if(A)for(let e=0;e<$.length;e++)y.push({predicate:$[e],forward:!0});if(R)for(let e=0;e<Z.length;e++)y.push({predicate:Z[e],forward:!1})}if(D){var G=null,J=null;L?(G=""===L.value?un.PlainLiteralURI:this.parseTermOrCURIEOrAbsURI(L.value,w,c.terms,p,r),J=P&&!M?P.value:G===un.XMLLiteralURI||G===un.HTMLLiteralURI?null:M?M.value:l.textContent):M?(G=un.PlainLiteralURI,J=M.value):P?(J=P.value,(G=un.deriveDateTimeType(J))||(G=un.PlainLiteralURI)):A||R||(B&&(J=this.parseSafeCURIEOrCURIEOrURI(B.value,p,r)),!J&&q?J=this.resolveAndNormalize(r,encodeURI(q.value)):!J&&U&&(J=this.resolveAndNormalize(r,encodeURI(U.value))),J&&(G=un.objectURI)),G||(C&&!F?(G=un.objectURI,J=f):(J=l.textContent,this.inHTMLMode&&"time"===l.localName&&(G=un.deriveDateTimeType(J)),G||(G=un.PlainLiteralURI))),k=this.tokenize(D.value);for(let e=0;e<k.length;e++){let t=this.parsePredicate(k[e],w,c.terms,p,r);if(t)if(H){let e=v[t];e||(e=[],v[t]=e),e.push(G===un.XMLLiteralURI||G===un.HTMLLiteralURI?{type:G,value:l.childNodes}:{type:G||un.PlainLiteralURI,value:J,language:b})}else G===un.XMLLiteralURI||G===un.HTMLLiteralURI?this.addTriple(l,h,t,{type:G,value:l.childNodes}):this.addTriple(l,h,t,{type:G||un.PlainLiteralURI,value:J,language:b})}}if(h&&!u)for(let e=0;e<c.incomplete.length;e++)c.incomplete[e].list?c.incomplete[e].list.push({type:un.objectURI,value:h}):c.incomplete[e].forward?this.addTriple(l,c.subject,c.incomplete[e].predicate,{type:un.objectURI,value:h}):this.addTriple(l,h,c.incomplete[e].predicate,{type:un.objectURI,value:c.subject});var X=null,Q=h;u?((X=this.push(c,c.subject)).parentObject=i(l.parentNode.baseURI)===c.parentObject?i(l.baseURI):c.parentObject,X.incomplete=c.incomplete,X.language=b,X.prefixes=p,X.vocabulary=w):((X=this.push(c,h)).parentObject=d||h||c.subject,X.prefixes=p,X.incomplete=y,d&&(Q=d,v={},m=!0),X.listMapping=v,X.language=b,X.vocabulary=w),m&&n.unshift({parent:l,context:c,subject:Q,listMapping:v});for(var W=l.lastChild;W;W=W.previousSibling)W.nodeType===cn.ELEMENT_NODE&&n.unshift({current:W,context:X})}}this.inHTMLMode&&this.copyProperties();for(let t=0;t<this.finishedHandlers.length;t++)this.finishedHandlers[t](e)}push(e,t){return{parent:e,subject:t||(e?e.subject:null),parentObject:null,incomplete:[],listMapping:e?e.listMapping:{},language:e?e.language:this.language,prefixes:e?e.prefixes:this.target.graph.prefixes,terms:e?e.terms:this.target.graph.terms,vocabulary:e?e.vocabulary:this.vocabulary}}resolveAndNormalize(e,t){return rr.join(t,e)}setContext(e){"html"===e.localName&&"XHTML+RDFa 1.1"===e.getAttribute("version")?this.setXHTMLContext():"html"===e.localName||"http://www.w3.org/1999/xhtml"===e.namespaceURI?"undefined"!=typeof document&&document.doctype?"-//W3C//DTD XHTML+RDFa 1.0//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"===document.doctype.systemId?(ln.log("WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode."),this.setHTMLContext()):"-//W3C//DTD XHTML+RDFa 1.1//EN"===document.doctype.publicId&&"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd"===document.doctype.systemId?this.setXHTMLContext():this.setHTMLContext():this.setHTMLContext():this.setXMLContext()}setHTMLContext(){this.setInitialContext(),this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.inXHTMLMode=!1,this.inHTMLMode=!0}setInitialContext(){this.vocabulary=null,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"}]}setXHTMLContext(){this.setInitialContext(),this.inXHTMLMode=!0,this.inHTMLMode=!1,this.langAttributes=[{namespaceURI:"http://www.w3.org/XML/1998/namespace",localName:"lang"},{namespaceURI:null,localName:"lang"}],this.target.graph.terms.alternate="http://www.w3.org/1999/xhtml/vocab#alternate",this.target.graph.terms.appendix="http://www.w3.org/1999/xhtml/vocab#appendix",this.target.graph.terms.bookmark="http://www.w3.org/1999/xhtml/vocab#bookmark",this.target.graph.terms.cite="http://www.w3.org/1999/xhtml/vocab#cite",this.target.graph.terms.chapter="http://www.w3.org/1999/xhtml/vocab#chapter",this.target.graph.terms.contents="http://www.w3.org/1999/xhtml/vocab#contents",this.target.graph.terms.copyright="http://www.w3.org/1999/xhtml/vocab#copyright",this.target.graph.terms.first="http://www.w3.org/1999/xhtml/vocab#first",this.target.graph.terms.glossary="http://www.w3.org/1999/xhtml/vocab#glossary",this.target.graph.terms.help="http://www.w3.org/1999/xhtml/vocab#help",this.target.graph.terms.icon="http://www.w3.org/1999/xhtml/vocab#icon",this.target.graph.terms.index="http://www.w3.org/1999/xhtml/vocab#index",this.target.graph.terms.last="http://www.w3.org/1999/xhtml/vocab#last",this.target.graph.terms.license="http://www.w3.org/1999/xhtml/vocab#license",this.target.graph.terms.meta="http://www.w3.org/1999/xhtml/vocab#meta",this.target.graph.terms.next="http://www.w3.org/1999/xhtml/vocab#next",this.target.graph.terms.prev="http://www.w3.org/1999/xhtml/vocab#prev",this.target.graph.terms.previous="http://www.w3.org/1999/xhtml/vocab#previous",this.target.graph.terms.section="http://www.w3.org/1999/xhtml/vocab#section",this.target.graph.terms.stylesheet="http://www.w3.org/1999/xhtml/vocab#stylesheet",this.target.graph.terms.subsection="http://www.w3.org/1999/xhtml/vocab#subsection",this.target.graph.terms.start="http://www.w3.org/1999/xhtml/vocab#start",this.target.graph.terms.top="http://www.w3.org/1999/xhtml/vocab#top",this.target.graph.terms.up="http://www.w3.org/1999/xhtml/vocab#up",this.target.graph.terms.p3pv1="http://www.w3.org/1999/xhtml/vocab#p3pv1",this.target.graph.terms.related="http://www.w3.org/1999/xhtml/vocab#related",this.target.graph.terms.role="http://www.w3.org/1999/xhtml/vocab#role",this.target.graph.terms.transformation="http://www.w3.org/1999/xhtml/vocab#transformation"}setXMLContext(){this.setInitialContext(),this.inXHTMLMode=!1,this.inHTMLMode=!1}tokenize(e){return this.trim(e).split(/\s+/)}static tokenize(e){return this.trim(e).split(/\s+/)}toRDFNodeObject(e){if(void 0!==e){if("string"==typeof e)return"_:"===e.substring(0,2)?(void 0===this.blankNodes[e.substring(2)]&&(this.blankNodes[e.substring(2)]=new l(e.substring(2))),this.blankNodes[e.substring(2)]):ar.namedNode(e);switch(e.type){case un.objectURI:return"_:"===e.value.substring(0,2)?(void 0===this.blankNodes[e.value.substring(2)]&&(this.blankNodes[e.value.substring(2)]=new l(e.value.substring(2))),this.blankNodes[e.value.substring(2)]):ar.namedNode(e.value);case un.PlainLiteralURI:return new d(e.value,e.language||"");case un.XMLLiteralURI:case un.HTMLLiteralURI:var t="";return Object.keys(e.value).forEach((r=>{t+=ur.domToString(e.value[r],this.htmlOptions)})),new d(t,"",new c.Z(e.type));default:return new d(e.value,"",new c.Z(e.type))}}}trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}static trim(e){return e.replace(/^\s\s*/,"").replace(/\s\s*$/,"")}}un.XMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",un.HTMLLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",un.PlainLiteralURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral",un.objectURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#object",un.typeURI="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",un.nameChar="[-A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�က0-F.0-9·̀-ͯ‿-⁀]",un.nameStartChar="[A-Za-zÀ-ÖØ-öø-ÿĀ-ıĴ-ľŁ-ňŊ-žƀ-ǃǍ-ǰǴ-ǵǺ-ȗɐ-ʨʻ-ˁΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϖϚϜϞϠϢ-ϳЁ-ЌЎ-яё-ќў-ҁҐ-ӄӇ-ӈӋ-ӌӐ-ӫӮ-ӵӸ-ӹԱ-Ֆՙա-ֆא-תװ-ײء-غف-يٱ-ڷں-ھۀ-ێې-ۓەۥ-ۦअ-हऽक़-ॡঅ-ঌএ-ঐও-নপ-রলশ-হড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઋઍએ-ઑઓ-નપ-રલ-ળવ-હઽૠଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଶ-ହଽଡ଼-ଢ଼ୟ-ୡஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-வஷ-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡก-ฮะา-ำเ-ๅກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ຮະາ-ຳຽເ-ໄཀ-ཇཉ-ཀྵႠ-Ⴥა-ჶᄀᄂ-ᄃᄅ-ᄇᄉᄋ-ᄌᄎ-ᄒᄼᄾᅀᅌᅎᅐᅔ-ᅕᅙᅟ-ᅡᅣᅥᅧᅩᅭ-ᅮᅲ-ᅳᅵᆞᆨᆫᆮ-ᆯᆷ-ᆸᆺᆼ-ᇂᇫᇰᇹḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼΩK-Å℮ↀ-ↂぁ-ゔァ-ヺㄅ-ㄬ가-힣一-龥〇〡-〩_]",un.NCNAME=new RegExp("^"+un.nameStartChar+un.nameChar+"*$"),un.dateTimeTypes=[{pattern:/-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\.[0-9]+)?S)?)?/,type:"http://www.w3.org/2001/XMLSchema#duration"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#dateTime"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#date"},{pattern:/(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\.[0-9]+)?(?:Z|[+\-][0-9][0-9]:[0-9][0-9])?/,type:"http://www.w3.org/2001/XMLSchema#time"},{pattern:/-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,type:"http://www.w3.org/2001/XMLSchema#gYearMonth"},{pattern:/-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,type:"http://www.w3.org/2001/XMLSchema#gYear"}];const hn=un.parseRDFaDOM;class dn{constructor(e){this.store=e,this.bnodes={},this.why=null,this.reify=!1}frameFactory(e,t,r){return{NODE:1,ARC:2,parent:t,parser:e,store:e.store,element:r,lastChild:0,base:null,lang:null,node:null,nodeType:null,listIndex:1,rdfid:null,datatype:null,collection:!1,terminateFrame:function(){this.collection&&this.node.close()},addSymbol:function(e,t){t=rr.join(t,this.base),this.node=this.store.sym(t),this.nodeType=e},loadTriple:function(){if(this.parent.parent.collection?this.parent.parent.node.append(this.node):this.store.add(this.parent.parent.node,this.parent.node,this.node,this.parser.why),null!=this.parent.rdfid){var e=this.store.sym(rr.join("#"+this.parent.rdfid,this.base));this.store.add(e,this.store.sym(dn.ns.RDF+"type"),this.store.sym(dn.ns.RDF+"Statement"),this.parser.why),this.store.add(e,this.store.sym(dn.ns.RDF+"subject"),this.parent.parent.node,this.parser.why),this.store.add(e,this.store.sym(dn.ns.RDF+"predicate"),this.parent.node,this.parser.why),this.store.add(e,this.store.sym(dn.ns.RDF+"object"),this.node,this.parser.why)}},isTripleToLoad:function(){return null!=this.parent&&null!=this.parent.parent&&this.nodeType===this.NODE&&this.parent.nodeType===this.ARC&&this.parent.parent.nodeType===this.NODE},addNode:function(e){this.addSymbol(this.NODE,e),this.isTripleToLoad()&&this.loadTriple()},addCollection:function(){this.nodeType=this.NODE,this.node=this.store.collection(),this.collection=!0,this.isTripleToLoad()&&this.loadTriple()},addCollectionArc:function(){this.nodeType=this.ARC},addBNode:function(e){null!=e?null!=this.parser.bnodes[e]?this.node=this.parser.bnodes[e]:this.node=this.parser.bnodes[e]=this.store.bnode():this.node=this.store.bnode(),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()},addArc:function(e){e===dn.ns.RDF+"li"&&(e=dn.ns.RDF+"_"+this.parent.listIndex,this.parent.listIndex++),this.addSymbol(this.ARC,e)},addLiteral:function(e){this.parent.datatype&&this.parent.datatype!==dn.ns.RDF+"langString"?this.node=this.store.literal(e,this.store.sym(this.parent.datatype)):this.node=this.store.literal(e,this.lang),this.nodeType=this.NODE,this.isTripleToLoad()&&this.loadTriple()}}}getAttributeNodeNS(e,t,r){var n=null;if(e.getAttributeNodeNS)n=e.getAttributeNodeNS(t,r);else for(var i,o=e.attributes,s=0;s<o.length;++s)if((i=o[s]).namespaceURI===t&&(i.prefix?i.prefix+":"+r:r)===i.nodeName){n=i;break}return n}parse(e,t,r){var n,i=e.childNodes;if(this.cleanParser(),e.nodeType===dn.nodeType.DOCUMENT){for(var o=0;o<i.length;o++)if(i[o].nodeType===dn.nodeType.ELEMENT){n=i[o];break}}else{if(e.nodeType!==dn.nodeType.ELEMENT)throw new Error("RDFParser: can't find root in "+t+". Halting. ");n=e}this.why=r;var s=this.frameFactory(this);return this.base=t,s.base=t,s.lang=null,this.parseDOM(this.buildFrame(s,n)),!0}parseDOM(e){for(var t,r=function(e){var t="";if(null==e.namespaceURI)throw new Error("RDF/XML syntax error: No namespace for "+e.localName+" in "+this.base);return e.namespaceURI&&(t+=e.namespaceURI),e.localName?t+=e.localName:e.nodeName&&(e.nodeName.indexOf(":")>=0?t+=e.nodeName.split(":")[1]:t+=e.nodeName),t}.bind(this),n=!0;e.parent;){var i=e.element,o=i.attributes;if(i.nodeType===dn.nodeType.TEXT||i.nodeType===dn.nodeType.CDATA_SECTION)e.parent.nodeType===e.NODE&&(e.addArc(dn.ns.RDF+"value"),e=this.buildFrame(e)),e.addLiteral(i.nodeValue);else if(r(i)!==dn.ns.RDF+"RDF")if(e.parent&&e.parent.collection&&(e.addCollectionArc(),(e=this.buildFrame(e,e.element)).parent.element=null),e.parent&&e.parent.nodeType&&e.parent.nodeType!==e.ARC){e.addArc(r(i)),this.reify&&(t=this.getAttributeNodeNS(i,dn.ns.RDF,"ID"))&&(e.rdfid=t.nodeValue,i.removeAttributeNode(t));var s=this.getAttributeNodeNS(i,dn.ns.RDF,"parseType"),a=this.getAttributeNodeNS(i,dn.ns.RDF,"datatype");if(a&&(e.datatype=a.nodeValue,i.removeAttributeNode(a)),s){var l=s.nodeValue;"Literal"===l?(e.datatype=dn.ns.RDF+"XMLLiteral",(e=this.buildFrame(e)).addLiteral(i.childNodes),n=!1):"Resource"===l?((e=this.buildFrame(e,e.element)).parent.element=null,e.addBNode()):"Collection"===l&&((e=this.buildFrame(e,e.element)).parent.element=null,e.addCollection()),i.removeAttributeNode(s)}if(0!==o.length){var c=this.getAttributeNodeNS(i,dn.ns.RDF,"resource"),u=this.getAttributeNodeNS(i,dn.ns.RDF,"nodeID");e=this.buildFrame(e),c?(e.addNode(c.nodeValue),i.removeAttributeNode(c)):u?(e.addBNode(u.nodeValue),i.removeAttributeNode(u)):e.addBNode();for(var h=o.length-1;h>=0;h--){var d=this.buildFrame(e);d.addArc(r(o[h])),r(o[h])===dn.ns.RDF+"type"?this.buildFrame(d).addNode(o[h].nodeValue):this.buildFrame(d).addLiteral(o[h].nodeValue)}}else 0===i.childNodes.length&&this.buildFrame(e).addLiteral("")}else{var f=this.getAttributeNodeNS(i,dn.ns.RDF,"about");if(t=this.getAttributeNodeNS(i,dn.ns.RDF,"ID"),f&&t)throw new Error("RDFParser: "+i.nodeName+" has both rdf:id and rdf:about. Halting. Only one of these properties may be specified on a node.");if(!f&&t)e.addNode("#"+t.nodeValue),i.removeAttributeNode(t);else if(null==f&&null==t){var p=this.getAttributeNodeNS(i,dn.ns.RDF,"nodeID");p?(e.addBNode(p.nodeValue),i.removeAttributeNode(p)):e.addBNode()}else e.addNode(f.nodeValue),i.removeAttributeNode(f);var g=this.getAttributeNodeNS(i,dn.ns.RDF,"type");dn.ns.RDF+"Description"!==r(i)&&(g={nodeValue:r(i)}),null!=g&&(this.store.add(e.node,this.store.sym(dn.ns.RDF+"type"),this.store.sym(rr.join(g.nodeValue,e.base)),this.why),g.nodeName&&i.removeAttributeNode(g));for(var y=o.length-1;y>=0;y--)this.store.add(e.node,this.store.sym(r(o[y])),this.store.literal(o[y].nodeValue,e.lang),this.why)}for(i=e.element;e.parent;){for(var v=e;null==i;)i=(e=e.parent).element;var m=i.childNodes&&i.childNodes[e.lastChild];if(m&&n){if((m.nodeType===dn.nodeType.ELEMENT||m.nodeType===dn.nodeType.TEXT||m.nodeType===dn.nodeType.CDATA_SECTION)&&(m.nodeType!==dn.nodeType.TEXT&&m.nodeType!==dn.nodeType.CDATA_SECTION||1===i.childNodes.length)){e.lastChild++,e=this.buildFrame(v,i.childNodes[e.lastChild-1]);break}e.lastChild++}else{if(e.terminateFrame(),!(e=e.parent))break;i=e.element,n=!0}}}}cleanParser(){this.bnodes={},this.why=null}buildFrame(e,t){var r=this.frameFactory(this,e,t);if(e&&(r.base=e.base,r.lang=e.lang),!t||t.nodeType===dn.nodeType.TEXT||t.nodeType===dn.nodeType.CDATA_SECTION)return r;var n=t.attributes,i=t.getAttributeNode("xml:base");null!=i&&(r.base=i.nodeValue,t.removeAttribute("xml:base"));var o=t.getAttributeNode("xml:lang");null!=o&&(r.lang=o.nodeValue,t.removeAttribute("xml:lang"));for(var s=n.length-1;s>=0;s--)if("xml"===n[s].nodeName.substr(0,3)){if("xmlns:"===n[s].name.slice(0,6)){var a=n[s].nodeValue;this.base&&(a=rr.join(a,this.base)),this.store.setPrefixForURI(n[s].name.slice(6),a)}t.removeAttributeNode(n[s])}return r}}function fn(e,t,r){var n,i,o,s=["INSERT","DELETE","WHERE"],a=cr("http://www.w3.org/ns/pim/patch#"),l=Yr(t,t,r,r,null,null,"",null),c={},u=function(e,t,r,n,i){return"Line "+(t+1)+" of <"+e+">: Bad syntax:\n "+i+'\n at: "'+r.slice(n,n+30)+'"'};n=0;var h=t.sym(r+"#query");for(c.query=h;;){if((i=l.skipSpace(e,n))<0)return c;if(";"===e[i]){if((n=l.skipSpace(e,i+1))<0)return c;i=n}var d=!1;for(o=0;o<s.length;o++){var f=s[o];if(e.slice(i,i+f.length)===f){if((n=l.skipSpace(e,i+f.length))<0)throw u(l._thisDoc,l.lines,e,i+f.length,"found EOF, needed {...} after "+f);if(("INSERT"===f||"DELETE"===f)&&"DATA"===e.slice(n,n+4)){if((i=l.skipSpace(e,n+4))<0)throw u(l._thisDoc,l.lines,e,n+4,"needed {...} after INSERT DATA "+f);n=i}var p=[];if((i=l.node(e,n,p))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF in {...} after "+f);c[f.toLowerCase()]=p[0],t.add(h,a(f.toLowerCase()),p[0]),d=!0,n=i}}if(!d&&"@prefix"===e.slice(i,i+7)){if((n=l.directive(e,i))<0)throw u(l._thisDoc,l.lines,e,n,"bad syntax or EOF after @prefix ");n=l.checkDot(e,n),d=!0}if(!d)throw u(l._thisDoc,l.lines,e,i,"Unknown syntax at start of statememt: '"+e.slice(i).slice(0,20)+"'")}}function pn(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"text/turtle",i=arguments.length>4?arguments[4]:void 0;n=n||s.z8,n=n.split(";")[0];try{if(n===s.qS||n===s.z8){var o=Yr(t,t,r,r,null,null,"",null);o.loadBuf(e),c()}else if(n===s.Is){var a=new dn(t);a.parse(ur.parseXML(e),r,t.sym(r)),c()}else if(n===s.D7)hn(ur.parseXML(e,{contentType:s.D7}),t,r),c();else if(n===s.us)hn(ur.parseXML(e,{contentType:s.us}),t,r),c();else if(n===s.oW||n===s.xm)fn(e,t,r),c();else if(n===s.ui)on(e,t,r,c);else{if(n!==s.b4&&n!==s.lL)throw void 0===n?new Error("contentType is undefined"):new Error("Don't know how to parse "+n+" yet");var l=new Dt({factory:rn});h(null,e)}}catch(e){u(e)}function c(){i&&i(null,t)}function u(e){if(n!==s.ui||n!==s.b4||n!==s.lL){if(!i){let t=new Error(e+" while trying to parse <"+r+"> as "+n);throw t.cause=e,t}i(e,t)}}function h(e,r){e&&i(e,t);try{l.parse(r,d)}catch(e){i(e,t)}}function d(e,r){r?t.add(r.subject,r.predicate,r.object,r.graph):i(e,t)}pn.handled={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/sparql-update":!0,"application/sparql-update-single-match":!0,"application/ld+json":!0,"application/nquads":!0,"application/n-quads":!0}}(0,t.Z)(dn,"ns",{RDF:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",RDFS:"http://www.w3.org/2000/01/rdf-schema#"}),(0,t.Z)(dn,"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 gn=n(7297),yn=n.n(gn),vn=n(2598),mn=n(292);const bn={"text/n3":!0,"text/turtle":!0,"application/rdf+xml":!0,"application/xhtml+xml":!0,"text/html":!0,"application/ld+json":!0},wn={rdf:s.Is,owl:s.Is,n3:"text/n3",ttl:"text/turtle",nt:"text/n3",acl:"text/n3",html:"text/html",xml:"text/xml"},xn=e=>({link:cr("http://www.w3.org/2007/ont/link#",e),http:cr("http://www.w3.org/2007/ont/http#",e),httph:cr("http://www.w3.org/2007/ont/httph#",e),rdf:cr("http://www.w3.org/1999/02/22-rdf-syntax-ns#",e),rdfs:cr("http://www.w3.org/2000/01/rdf-schema#",e),dc:cr("http://purl.org/dc/elements/1.1/",e),ldp:cr("http://www.w3.org/ns/ldp#",e)}),_n=xn();class Tn{constructor(e,r){(0,t.Z)(this,"response",void 0),(0,t.Z)(this,"dom",void 0),this.response=e,this.dom=r}}(0,t.Z)(Tn,"pattern",void 0);class jn extends Tn{static toString(){return"RDFXMLHandler"}static register(e){e.mediatypes[s.Is]={q:.9}}parse(e,t,r){let n=e.store;if(this.dom||(this.dom=ur.parseXML(t)),"parsererror"===this.dom.documentElement.nodeName)return e.failFetch(r,"Badly formed XML in "+r.resource.value,"parse_error");let i=new dn(n);try{i.parse(this.dom,r.original.value,r.original)}catch(t){return e.failFetch(r,"Syntax error parsing RDF/XML! "+t,"parse_error")}return r.noMeta||n.add(r.original,_n.rdf("type"),_n.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}jn.pattern=new RegExp("application/rdf\\+xml");class En extends Tn{static toString(){return"XHTMLHandler"}static register(e){e.mediatypes[s.D7]={}}parse(e,t,r){let n,i;this.dom||(this.dom=ur.parseXML(t));let o=e.store,s=this.dom.getElementsByTagName("title");s.length>0&&o.add(r.resource,_n.dc("title"),o.rdfFactory.literal(s[0].textContent),r.resource);let a=this.dom.getElementsByTagName("link");for(let t=a.length-1;t>=0;t--)n=a[t].getAttribute("rel"),i=!1,n||(n=a[t].getAttribute("rev"),i=!0),n&&e.linkData(r.original,n,a[t].getAttribute("href"),r.resource,i);let l=this.dom.getElementsByTagName("script");for(let e=0;e<l.length;e++){let t=l[e].getAttribute("type");bn[t]&&(pn(l[e].textContent,o,r.original.value,t),pn(l[e].textContent,o,r.original.value,t))}if(r.noMeta||o.add(r.resource,_n.rdf("type"),_n.link("WebPage"),e.appNode),!r.noRDFa&&hn)try{hn(this.dom,o,r.original.value)}catch(t){let n="Error trying to parse "+r.resource+" as RDFa:\n"+t+":\n"+t.stack;return e.failFetch(r,n,"parse_error")}return e.doneFetch(r,this.response)}}En.pattern=new RegExp("application/xhtml");class Nn extends Tn{static toString(){return"XMLHandler"}static register(e){e.mediatypes["text/xml"]={q:.5},e.mediatypes["application/xml"]={q:.5}}static isElement(e){return e.nodeType===Node.ELEMENT_NODE}parse(e,t,r){let n=ur.parseXML(t);for(let i=0;i<n.childNodes.length;i++){const o=n.childNodes[i];if(Nn.isElement(o)){let i=o.namespaceURI;if(i&&i===i.rdf)return e.addStatus(r.req,"Has XML root element in the RDF namespace, so assume RDF/XML."),new jn(this.response,n).parse(e,t,r);break}}if(n.doctype&&"html"===n.doctype.name&&n.doctype.publicId.match(/^-\/\/W3C\/\/DTD XHTML/)&&n.doctype.systemId.match(/http:\/\/www.w3.org\/TR\/xhtml/))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTML Handler.\n"),new En(this.response,n).parse(e,t,r);let i=n.getElementsByTagName("html")[0];if(i){let o=i.getAttribute("xmlns");if(o&&o.match(/^http:\/\/www.w3.org\/1999\/xhtml/))return e.addStatus(r.req,"Has a default namespace for XHTML. Switching to XHTMLHandler.\n"),new En(this.response,n).parse(e,t,r)}return e.failFetch(r,"Unsupported dialect of XML: not RDF or XHTML namespace, etc.\n"+t.slice(0,80),901)}}Nn.pattern=new RegExp("(text|application)/(.*)xml");class On extends Tn{static toString(){return"HTMLHandler"}static register(e){e.mediatypes["text/html"]={q:.9}}parse(e,t,r){let n=e.store;if(Rn(t))return e.addStatus(r.req,"Has an XML declaration. We'll assume it's XHTML as the content-type was text/html.\n"),new En(this.response).parse(e,t,r);if(function(e){const t=e.indexOf("<!DOCTYPE html"),r=e.indexOf(">");return!(-1===t||-1===r||t>r)&&-1!==e.substr(t,r-t).indexOf("XHTML")}(t))return e.addStatus(r.req,"Has XHTML DOCTYPE. Switching to XHTMLHandler.\n"),new En(this.response).parse(e,t,r);if(function(e){return!!e.match(/[^(<html)]*<html\s+[^<]*xmlns=['"]http:\/\/www.w3.org\/1999\/xhtml["'][^<]*>/)}(t))return e.addStatus(r.req,"Has default namespace for XHTML, so switching to XHTMLHandler.\n"),new En(this.response).parse(e,t,r);let i=new RegExp("<title>([\\s\\S]+?)</title>","im").exec(t);return i&&n.add(r.resource,_n.dc("title"),n.rdfFactory.literal(i[1]),r.resource),n.add(r.resource,_n.rdf("type"),_n.link("WebPage"),e.appNode),e.addStatus(r.req,"non-XML HTML document, not parsed for data."),e.doneFetch(r,this.response)}}On.pattern=new RegExp("text/html");class Sn extends Tn{static toString(){return"JsonLdHandler"}static register(e){e.mediatypes["application/ld+json"]={q:.9}}parse(e,t,r,n){const i=e.store;return new Promise(((o,s)=>{try{on(t,i,r.original.value,(()=>{o(e.doneFetch(r,n))}))}catch(t){const i="Error trying to parse "+r.resource+" as JSON-LD:\n"+t;o(e.failFetch(r,i,"parse_error",n))}}))}}Sn.pattern=/application\/ld\+json/;class In extends Tn{static toString(){return"TextHandler"}static register(e){e.mediatypes["text/plain"]={q:.5}}parse(e,t,r){return Rn(t)?(e.addStatus(r.req,"Warning: "+r.resource+" has an XML declaration. We'll assume it's XML but its content-type wasn't XML.\n"),new Nn(this.response).parse(e,t,r)):t.slice(0,500).match(/xmlns:/)?(e.addStatus(r.req,"May have an XML namespace. We'll assume it's XML but its content-type wasn't XML.\n"),new Nn(this.response).parse(e,t,r)):(e.addStatus(r.req,"Plain text document, no known RDF semantics."),e.doneFetch(r,this.response))}}In.pattern=new RegExp("text/plain");class kn extends Tn{static toString(){return"N3Handler"}static register(e){e.mediatypes["text/n3"]={q:"1.0"},e.mediatypes["text/turtle"]={q:1}}parse(e,t,r,n){let i=e.store,o=Yr(i,i,r.original.value,r.original.value,null,null,"",null);try{o.loadBuf(t)}catch(t){let i="Error trying to parse "+r.resource+" as Notation3:\n"+t;return e.failFetch(r,i,"parse_error",n)}return e.addStatus(r.req,"N3 parsed: "+o.statementCount+" triples in "+o.lines+" lines."),e.store.add(r.original,_n.rdf("type"),_n.link("RDFDocument"),e.appNode),e.doneFetch(r,this.response)}}kn.pattern=new RegExp("(application|text)/(x-)?(rdf\\+)?(n3|turtle)");const An={RDFXMLHandler:jn,XHTMLHandler:En,XMLHandler:Nn,HTMLHandler:On,TextHandler:In,N3Handler:kn,JsonLdHandler:Sn};function Rn(e){return!!e.match(/\s*<\?xml\s+version\s*=[^<>]+\?>/)}class Cn{constructor(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((0,t.Z)(this,"store",void 0),(0,t.Z)(this,"timeout",void 0),(0,t.Z)(this,"_fetch",void 0),(0,t.Z)(this,"mediatypes",void 0),(0,t.Z)(this,"appNode",void 0),(0,t.Z)(this,"requested",void 0),(0,t.Z)(this,"timeouts",void 0),(0,t.Z)(this,"redirectedTo",void 0),(0,t.Z)(this,"fetchQueue",void 0),(0,t.Z)(this,"fetchCallbacks",void 0),(0,t.Z)(this,"nonexistent",void 0),(0,t.Z)(this,"lookedUp",void 0),(0,t.Z)(this,"handlers",void 0),(0,t.Z)(this,"ns",void 0),(0,t.Z)(this,"fireCallbacks",void 0),this.store=e||new Cr,this.ns=xn(this.store.rdfFactory),this.timeout=r.timeout||3e4,this._fetch=r.fetch||void 0!==n.g&&(n.g.solidFetcher||n.g.solidFetch)||"undefined"!=typeof window&&(window.solidFetcher||window.solidFetch)||yn(),!this._fetch)throw new Error("No _fetch function available for Fetcher");this.appNode=this.store.rdfFactory.blankNode(),this.store.fetcher=this,this.requested={},this.timeouts={},this.redirectedTo={},this.fetchQueue={},this.fetchCallbacks={},this.nonexistent={},this.lookedUp={},this.handlers=[],this.mediatypes={"image/*":{q:.9},"*/*":{q:.1}},ur.callbackify(this,["request","fail","refresh","retract","done"]),Object.keys(r.handlers||An).map((e=>this.addHandler(An[e])))}static crossSiteProxy(e){return Cn.crossSiteProxyTemplate?Cn.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):void 0}static offlineOverride(e){let t=e;var r;return"undefined"!=typeof window&&window.panes&&(r=window.panes.UI)&&r.preferences&&r.preferences.get("offlineModeUsingLocalhost")&&"http://"===t.slice(0,7)&&"localhost/"!==t.slice(7,17)&&(t="http://localhost/"+t.slice(7),lr.Z.warn("Localhost kludge for offline use: actually getting <"+t+">")),t}static proxyIfNecessary(e){var t;if("undefined"!=typeof window&&window.panes&&(t=window.panes.UI)&&t.isExtension)return e;if("undefined"!=typeof $SolidTestEnvironment&&$SolidTestEnvironment.localSiteMap){let t=e.split("/").slice(2);const r=(e,t)=>{let n=t[e.shift()];return n?"string"==typeof n?n+e.join("/"):e?r(e,n):null:null},n=r(t,$SolidTestEnvironment.localSiteMap);if(n)return n}return Cn.crossSiteProxyTemplate&&"undefined"!=typeof document&&document.location&&"https:"===(""+document.location).slice(0,6)&&"http:"===e.slice(0,5)?Cn.crossSiteProxyTemplate.replace("{uri}",encodeURIComponent(e)):e}static unsupportedProtocol(e){let t=rr.protocol(e);return"tel"===t||"mailto"===t||"urn"===t}static setCredentials(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};void 0===t.credentials&&(void 0!==t.withCredentials?t.credentials=t.withCredentials?"include":"omit":t.credentials="include")}load(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=Object.assign({},t),e instanceof Array)return Promise.all(e.map((e=>this.load(e,Object.assign({},t)))));const r=e;let n=(0,vn._)(r);n=n.split("#")[0],t=this.initFetchOptions(n,t);const i=this.initFetchOptions(n,t);return this.pendingFetchPromise(n,i.baseURI,i)}async pendingFetchPromise(e,t,r){let n;return!r.force&&await this.fetchQueue[t]?n=this.fetchQueue[t]:(n=Promise.race([this.setRequestTimeout(e,r),this.fetchUri(e,r)]),this.fetchQueue[t]=n,this.cleanupFetchRequest(t,void 0,this.timeout)),n.then((t=>(e in this.timeouts&&(this.timeouts[e].forEach(clearTimeout),delete this.timeouts[e]),t)))}cleanupFetchRequest(e,t,r){void 0!==t&&mn.warn("_options is deprecated"),this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{this.isPending(e)||delete this.fetchQueue[e]}),r))}initFetchOptions(e,t){let r=this.store;!t.method||"GET"===t.method.toUpperCase()||(t.force=!0),t.resource=r.rdfFactory.namedNode(e),t.baseURI=t.baseURI||e,t.original=r.rdfFactory.namedNode(t.baseURI),t.req=r.bnode(),t.headers=t.headers||new gn.Headers,t.contentType&&(t.headers["content-type"]=t.contentType),t.force&&(t.cache="no-cache");let n=this.acceptString();t.headers.accept=n;let i=Cn.offlineOverride(e);t.requestedURI=i,Cn.setCredentials(i,t);let o=Cn.proxyIfNecessary(i);return i!==o&&(t.proxyUsed=!0),t.actualProxyURI=o,t}fetchUri(e,t){if(!e)return Promise.reject(new Error("Cannot fetch an empty uri"));if(Cn.unsupportedProtocol(e))return this.failFetch(t,"fetcher: Unsupported protocol","unsupported_protocol");let r=this.getState(e);if(t.force)delete this.nonexistent[e];else{if("fetched"===r)return Promise.resolve(this.doneFetch(t,{status:200,ok:!0,statusText:"Already loaded into quadstore."}));if("failed"===r&&404===this.requested[e]){let r="Previously failed: "+this.requested[e],n={url:e,status:this.requested[e],statusText:r,responseText:r,headers:new gn.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return this.failFetch(t,r,this.requested[e],n)}}this.fireCallbacks("request",[e]),this.requested[e]=!0,t.noMeta||this.saveRequestMetadata(e,t);let{actualProxyURI:n}=t;return this._fetch(n,t).then((r=>this.handleResponse(r,e,t)),(r=>{let i={url:n,status:999,statusText:(r.name||"network failure")+": "+(r.errno||r.code||r.type),responseText:r.message,headers:new gn.Headers,ok:!1,body:null,bodyUsed:!1,size:0,timeout:0};return mn.log("Fetcher: <"+n+"> Non-HTTP fetch exception: "+r),this.handleError(i,e,t)}))}nowOrWhenFetched(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const i=(0,vn._)(e);"function"==typeof t?r=t:void 0===t||((0,u.NX)(t)?n.referringTerm=t:n=t),this.load(i,n).then((e=>{if(r)if(e)if(e.ok)r(!0,"OK",e);else{let t="HTTP error: Status "+e.status+" ("+e.statusText+")";e.responseText&&(t+=" "+e.responseText),mn.log(t+" fetching "+i),r(!1,t,e)}else{let e="@@ nowOrWhenFetched: no response object!";mn.log(e),r(!1,e)}}),(function(e){var t=e.message||e.statusText;t="Failed to load <"+i+"> "+t,mn.log(t),e.response&&e.response.status&&(t+=" status: "+e.response.status),r(!1,t,e.response)}))}addStatus(e,t){let r=new Date;t="["+r.getHours()+":"+r.getMinutes()+":"+r.getSeconds()+"."+r.getMilliseconds()+"] "+t;let n=this.store;const i=n.the(e,this.ns.link("status"));(0,u.uZ)(i)?i.append(n.rdfFactory.literal(t)):lr.Z.warn("web.js: No list to add to: "+i+","+t)}failFetch(e,t,r,n){this.addStatus(e.req,t),e.noMeta||this.store.add(e.original,this.ns.link("error"),this.store.rdfFactory.literal(t));let i=(e.method||"GET").toUpperCase();("GET"===i||"HEAD"===i)&&(e.resource.equals(e.original),this.requested[rr.docpart(e.original.value)]=r,this.fireCallbacks("fail",[e.original.value,t]));var o=new Error("Fetcher: "+t);return o.status=r,o.statusText=t,o.response=n,Promise.reject(o)}linkData(e,t,r,n,i){if(!r)return;let o,s=this.store,a=s.rdfFactory.namedNode(rr.join(r,e.value));if("alternate"===t||"seeAlso"===t||"meta"===t||"describedby"===t){if(a.value===e.value)return;o=this.ns.rdfs("seeAlso")}else o="type"===t?s.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):s.rdfFactory.namedNode(rr.join(encodeURIComponent(t),"http://www.iana.org/assignments/link-relations/"));i?s.add(a,o,e,n):s.add(e,o,a,n)}parseLinkHeader(e,t,r){if(!e)return;const n=/[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g,i=e.match(/<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g);if(null!=i)for(let e=0;e<i.length;e++){let o=i[e].split(">"),s=o[0].substring(1),a=o[1].match(n);if(null==a)return;for(let e=0;e<a.length;e++){let n=a[e].split("=")[1].replace(/["']/g,"");this.linkData(t,n,s,r)}}}doneFetch(e,t){return this.addStatus(e.req,"Done."),this.requested[e.original.value]="done",this.fireCallbacks("done",[e.original.value]),t.req=e.req,t}nowKnownAs(e,t){this.lookedUp[e.value]?this.lookedUp[t.value]||this.lookUpThing(t,e):this.lookedUp[t.value]&&(this.lookedUp[e.value]||this.lookUpThing(e,t))}putBack(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const r=(0,vn._)(e);let n=new c.Z(r).doc();return t.contentType=t["content-type"]||t["Content-Type"]||t.contentType||s.z8,"application/ld+json"===t.contentType?new Promise(((r,i)=>{vr(n,this.store,n.uri,t.contentType,((n,o)=>{n?i(n):(t.data=o,this.webOperation("PUT",e,t).then((e=>r(e))).catch((e=>i(e))))}))})):(t.data=vr(n,this.store,n.value,t.contentType),this.webOperation("PUT",r,t))}webCopy(e,t,r){return this.webOperation("GET",e).then((e=>this.webOperation("PUT",t,{data:e.responseText,contentType:r})))}delete(e,t){return this.webOperation("DELETE",e,t).then((t=>(this.requested[e]=404,this.nonexistent[e]=!0,this.unload(this.store.rdfFactory.namedNode(e)),t)))}async createIfNotExists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:s.z8,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";const n=this;try{var i=await n.load(e)}catch(o){if(404===o.response.status){mn.log("createIfNotExists: doc does NOT exist, will create... "+e);try{i=await n.webOperation("PUT",e.value,{data:r,contentType:t})}catch(t){throw mn.log("createIfNotExists doc FAILED: "+e+": "+t),t}return delete n.requested[e.value],i}throw mn.log("createIfNotExists doc load error NOT 404: "+e+": "+o),o}return i}createContainer(e,t,r){let n={"content-type":s.z8,link:this.ns.ldp("BasicContainer")+'; rel="type"'};t&&(n.slug=t);let i={headers:n};return r&&(i.body=r),this.webOperation("POST",e,i)}invalidateCache(e){const t=(0,vn._)(e),r=this;if(r.fetchQueue&&r.fetchQueue[t]&&(mn.log("Internal error - fetchQueue exists "+t),"resolved"===r.fetchQueue[t].PromiseStatus?delete r.fetchQueue[t]:(delete r.fetchQueue[t],mn.log("*** Fetcher: pending fetchQueue deleted "+t))),r.requested[t]&&"done"!==r.requested[t]&&"failed"!==r.requested[t]&&404!==r.requested[t]){let e=`Rdflib: fetcher: Destructive operation on <${r.requested[t]}> file being fetched! `+t;mn.error(e)}else delete r.requested[t],delete r.nonexistent[t]}webOperation(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=(0,vn._)(t);r.method=e,r.body=r.data||r.body,r.force=!0;const i=this;if(r.body&&!r.contentType)throw new Error("Web operation sending data must have a defined contentType.");return r.contentType&&(r.headers=r.headers||{},r.headers["content-type"]=r.contentType),Cn.setCredentials(n,r),new Promise((function(t,o){i._fetch(n,r).then((r=>{if(r.ok)"PUT"!==e&&"PATCH"!==e&&"POST"!==e&&"DELETE"!==e||i.invalidateCache(n),r.text?r.text().then((e=>{r.responseText=e,t(r)})):t(r);else{let t="Web error: "+r.status;r.statusText&&(t+=" ("+r.statusText+")"),t+=" on "+e+" of <"+n+">",r.responseText&&(t+=": "+r.responseText);let i=new Error(t);i.response=r,o(i)}}),(t=>{o(new Error("Fetch error for "+e+" of <"+n+">:"+t))}))}))}lookUpThing(e,t){let r=this.store.uris(e);return r=r.map((e=>rr.docpart(e))),r.forEach((e=>{this.lookedUp[e]=!0})),this.load(r,{referringTerm:t})}getHeader(e,t){const r=this.store,n=e.value,i=r.each(void 0,this.ns.link("requestedURI"),r.rdfFactory.literal(n));for(let e=0;e<i.length;e++){let n=i[e];if(void 0!==n){let e=r.any(n,this.ns.link("response"));if(void 0!==e&&r.anyValue(e,this.ns.http("status"))&&r.anyValue(e,this.ns.http("status")).startsWith("2")){let n=r.each(e,this.ns.httph(t.toLowerCase()));return n.length?n.map((e=>e.value)):[]}}}}saveRequestMetadata(e,t){let r=t.req,n=this.store,i=t.referringTerm;this.addStatus(t.req,"Accept: "+t.headers.accept),(0,u.NX)(i)&&n.add(n.rdfFactory.namedNode(e),this.ns.link("requestedBy"),i,this.appNode),t.original&&t.original.value!==e&&n.add(r,this.ns.link("orginalURI"),n.rdfFactory.literal(t.original.value),this.appNode);const o=new Date,s="["+o.getHours()+":"+o.getMinutes()+":"+o.getSeconds()+"] ";n.add(r,this.ns.rdfs("label"),n.rdfFactory.literal(s+" Request for "+e),this.appNode),n.add(r,this.ns.link("requestedURI"),n.rdfFactory.literal(e),this.appNode),n.add(r,this.ns.link("status"),n.collection(),this.appNode)}saveResponseMetadata(e,t){const r=this.store;let n=r.bnode();return r.add(t.req,this.ns.link("response"),n,n),r.add(n,this.ns.http("status"),r.rdfFactory.literal(e.status),n),r.add(n,this.ns.http("statusText"),r.rdfFactory.literal(e.statusText),n),e.headers.forEach(((e,i)=>{r.add(n,this.ns.httph(i),this.store.rdfFactory.literal(e),n),"content-type"===i&&r.add(t.resource,this.ns.rdf("type"),r.rdfFactory.namedNode(ur.mediaTypeClass(e).value),n)})),n}objectRefresh(e){let t=this.store.uris(e);if(void 0!==t)for(let e=0;e<t.length;e++)this.refresh(this.store.rdfFactory.namedNode(rr.docpart(t[e])))}refresh(e,t){this.fireCallbacks("refresh",arguments),this.nowOrWhenFetched(e,{force:!0,clearPreviousData:!0},t)}refreshIfExpired(e,t){let r=this.getHeader(e,"Expires");!r||new Date(r[0]).getTime()<=(new Date).getTime()?this.refresh(e,t):t(!0,"Not expired",{})}retract(e){this.store.removeMany(void 0,void 0,void 0,e),e.value&&delete this.requested[rr.docpart(e.value)],this.fireCallbacks("retract",arguments)}getState(e){return void 0===this.requested[e]?"unrequested":!0===this.requested[e]?"requested":"done"===this.requested[e]?"fetched":"redirected"===this.requested[e]?this.getState(this.redirectedTo[e]):"failed"}isPending(e){return!0===this.requested[e]}unload(e){this.store.removeDocument(e),delete this.requested[e.value]}addHandler(e){this.handlers.push(e),e.register(this)}retryNoCredentials(e,t){mn.log("Fetcher: CORS: RETRYING with NO CREDENTIALS for "+t.resource),t.retriedWithNoCredentials=!0,delete this.requested[e],delete this.fetchQueue[e];let r=Object.assign({},t,{credentials:"omit"});return this.addStatus(t.req,"Abort: Will retry with credentials SUPPRESSED to see if that helps"),this.load(e,r)}isCrossSite(e){if("undefined"==typeof document||!document.location)return!1;const t=rr.hostpart,r=""+document.location;return(t(r)&&t(e)&&t(r))!==t(e)}handleError(e,t,r){if(this.isCrossSite(t)){if(r.credentials&&"include"===r.credentials&&!r.retriedWithNoCredentials)return this.retryNoCredentials(t,r);let e=Cn.crossSiteProxy(t);if(e&&!r.proxyUsed)return mn.log("web: Direct failed so trying proxy "+e),this.redirectToProxy(e,r)}var n;return e instanceof Error?n="Fetch error: "+e.message:(n=e.statusText,e.responseText&&(n+=` ${e.responseText}`)),this.failFetch(r,n,e.status||998,e)}addType(e,t,r,n){let i=t;if(n){var o=r.any(i,this.ns.link("requestedURI"));o&&o.value!==n&&r.add(r.rdfFactory.namedNode(n),this.ns.rdf("type"),e,this.appNode)}for(;;){const t=r.any(i,this.ns.link("requestedURI"));if(t&&t.value&&r.add(r.rdfFactory.namedNode(t.value),this.ns.rdf("type"),e,this.appNode),i=r.any(void 0,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#redirectedRequest"),i),!i)break;var s=r.any(i,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#response"));if(!s)break;var a=r.any(s,r.rdfFactory.namedNode("http://www.w3.org/2007/ont/http#status"));if(!a)break;if("301"!==a&&"302"!==a)break}}handleResponse(e,t,r){const n=this.store,i=e.headers,o=r.req,s=this.saveResponseMetadata(e,r),a=this.normalizedContentType(r,i)||"";let l=i.get("content-location");if(0===e.status)return mn.log("Masked error - status 0 for "+t),this.handleError(e,t,r);if(e.status>=400)return 404===e.status&&(this.nonexistent[r.original.value]=!0,this.nonexistent[t]=!0),this.saveErrorResponse(e,s).then((()=>{let t=r.resource+" "+e.statusText;return this.failFetch(r,t,e.status,e)}));var c=null,u=null;if(l&&(u=rr.join(l,t))!==t&&(c=u),200===e.status){this.addType(this.ns.link("Document"),o,n,t),c&&this.addType(this.ns.link("Document"),o,n,c),r.clearPreviousData&&n.removeDocument(r.resource);let e=a.includes("image/")||a.includes("application/pdf");a&&e&&(this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,t),c&&this.addType(n.rdfFactory.namedNode("http://purl.org/dc/terms/Image"),o,n,c))}if(l){if(!r.force&&c&&"done"===this.requested[u])return this.doneFetch(r,e);this.requested[u]=!0}this.parseLinkHeader(i.get("link"),r.original,o);let h=this.handlerForContentType(a,e);return h?e.text().then((t=>(e.responseText=t,h.parse(this,t,r,e)))):(this.addStatus(o,"Fetch over. No data handled."),this.doneFetch(r,e))}saveErrorResponse(e,t){let r=this.store;return e.text().then((e=>{e.length>10&&r.add(t,this.ns.http("content"),r.rdfFactory.literal(e),t)}))}handlerForContentType(e,t){if(!e)return null;let r=this.handlers.find((t=>e.match(t.pattern)));return r?new r(t):null}guessContentType(e){return wn[e.split(".").pop()]}normalizedContentType(e,t){if(e.forceContentType)return e.forceContentType;let r=t.get("content-type");if(!r||r.includes("application/octet-stream")){let t=this.guessContentType(e.resource.value);if(t)return t}let n=rr.protocol(e.resource.value);return!r&&["file","chrome"].includes(n)?"text/xml":r}redirectToProxy(e,t){this.addStatus(t.req,"BLOCKED -> Cross-site Proxy to <"+e+">"),t.proxyUsed=!0;const r=this.store,n=t.req;t.noMeta||(r.add(n,this.ns.link("redirectedTo"),r.rdfFactory.namedNode(e),n),this.addStatus(n,"redirected to new request")),this.requested[t.resource.value]="redirected",this.redirectedTo[t.resource.value]=e;let i=Object.assign({},t);return i.baseURI=t.resource.value,this.fetchUri(e,i).then((e=>(i.noMeta||r.add(n,this.ns.link("redirectedRequest"),i.req,this.appNode),e)))}setRequestTimeout(e,t){return new Promise((r=>{this.timeouts[e]=(this.timeouts[e]||[]).concat(setTimeout((()=>{!this.isPending(e)||t.retriedWithNoCredentials||t.proxyUsed||r(this.failFetch(t,`Request to ${e} timed out`,"timeout"))}),this.timeout))}))}addFetchCallback(e,t){this.fetchCallbacks[e]?this.fetchCallbacks[e].push(t):this.fetchCallbacks[e]=[t]}acceptString(){let e="";for(let t in this.mediatypes){""!==e&&(e+=", "),e+=t;for(let r in this.mediatypes[t])e+=";"+r+"="+this.mediatypes[t][r]}return e}}(0,t.Z)(Cn,"HANDLERS",void 0),(0,t.Z)(Cn,"CONTENT_TYPE_BY_EXT",void 0),(0,t.Z)(Cn,"crossSiteProxyTemplate",void 0),Cn.HANDLERS=An,Cn.CONTENT_TYPE_BY_EXT=wn;const Dn={parseJSON:function(e,t,r){var n,i,o,s={},a=r.sym(t);for(var l in e){0===l.indexOf("_:")?s[l]?n=s[l]:(n=r.bnode(l),s[l]=n):n=r.sym(l);var c=e[l];for(var u in c){var h=c[u];for(var d in i=r.sym(u),h){var f=h[d];if("uri"===f.type)o=r.sym(f.value),r.add(n,i,o,a);else if("BlankNode"===f.type)s[f.value]?o=s[f.value]:(o=r.bnode(f.value),s[f.value]=o),r.add(n,i,o,a);else{if("Literal"!==f.type)throw new Error("error: unexpected termtype: "+d.type);o=f.datatype?r.literal(f.value,void 0,r.sym(f.datatype)):f.lang?r.literal(f.value,f.lang):r.literal(f.value),r.add(n,i,o,a)}}}}}};function Ln(e){var t=0;function r(e){var t="",r=e.statements;for(var n in r)lr.Z.debug("Found statement: "+r),t+=s()+r[n]+"\n";return t}function n(e){var t="";for(var r in e.constraints){var n=e.constraints[r];t+=s()+"FILTER ( "+n.describe(r)+" ) \n"}return t}function i(e){for(var o="",a=0;a<e.optional.length;a++)lr.Z.debug("Found optional query"),o+=s()+"OPTIONAL { \n",t++,o+=r(e.optional[a]),o+=n(e.optional[a]),o+=i(e.optional[a]),t--,o+=s()+"}\n";return o}function o(e){var o=s()+"WHERE \n{ \n";return t++,o+=r(e),o+=n(e),o+=i(e),t--,o+"}"}function s(){for(var e="",r=0;r<t;r++)e+=" ";return e}return function(e){return function(e){for(var t=s()+"SELECT ",r=0;r<e.vars.length;r++)t+=e.vars[r]+" ";return t+"\n"}(e)+o(e.pat)}(e)}function Pn(e,t,r){var n=[];function i(e){if(n[e])return n[e];var t=r.variable(e);return n[e]=t,t}function o(e){return"string"==typeof e&&e.match(/[^ \n\t]/)}function s(e){return"string"==typeof e&&e.match(/^[\?\$]/)}function a(e){return"string"==typeof e?e.replace(/^&lt;/,"<").replace(/&gt;$/,">"):e}function l(e){return"string"==typeof e&&e.match(/^<[^>]*>$/)}function c(e){return"string"==typeof e&&(e.match(/^_:/)||e.match(/^$/))}function u(e){return"string"==typeof e&&e.match(/:$/)}function h(e){return"string"==typeof e&&e.match(/^:|^[^_][^:]*:/)}function d(e){return e.split(":")[0]}function f(e){return e.split(":")[1]}function p(e){return l(e)?e.slice(1,e.length-1):e}function g(e){var t=-1===e.indexOf("'")?null:e.indexOf("'"),n=-1===e.indexOf('"')?null:e.indexOf('"');if(!t&&!n){var i=new Array(1);return i[0]=e,i}var o,s,a=new Array(2);if(!t||n&&n<t)o='"',s=n;else{if(n&&!(t&&t<n))return lr.Z.error("SQARQL QUERY OOPS!"),a;o="'",s=t}a[0]=e.slice(0,s);var l,c=e.slice(s+1).indexOf(o);return-1===c?(lr.Z.error("SPARQL parsing error: no matching parentheses in literal "+e),e):(e.slice(c+s+2).match(/^\^\^/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),r.sym(p(e.slice(s+4+c,s+2+c+l)))),a=a.concat(g(e.slice(c+s+3+l)))):e.slice(c+s+2).match(/^@/)?(l=e.slice(c+s+2).indexOf(" "),a[1]=r.literal(e.slice(s+1,s+1+c),e.slice(s+3+c,s+2+c+l),null),a=a.concat(g(e.slice(c+s+2+l)))):(a[1]=r.literal(e.slice(s+1,s+1+c)),lr.Z.info("Literal found: "+a[1]),a=a.concat(g(e.slice(c+s+2)))),a)}function y(e){e=e.replace(/\(/g," ( ").replace(/\)/g," ) ").replace(/</g," <").replace(/>/g,"> ").replace(/{/g," { ").replace(/}/g," } ").replace(/[\t\n\r]/g," ").replace(/; /g," ; ").replace(/\. /g," . ").replace(/, /g," , "),lr.Z.info("New str into spaceDelimit: \n"+e);var t=[],r=e.split(" ");for(var n in r)o(r[n])&&(t=t.concat(r[n]));return t}function v(e,t){for(var r=0;r<t.length;r++)if("string"==typeof t[r]&&t[r].toLowerCase()===e.toLowerCase())return r;return null}function m(e,t){for(var r=[],n=0;n<t.length;n++)"string"==typeof t[n]&&t[n].toLowerCase()===e.toLowerCase()&&r.push(n);return r}function b(e,t,r){lr.Z.info("Looking for a close bracket of type "+r+" in "+e);for(var n=0,i=0;i<e.length;i++)if(e[i]===t&&n++,e[i]===r&&n--,n<0)return i;return lr.Z.error("Statement had no close parenthesis in SPARQL query"),0}function w(e){return this.describe=function(t){return t+" = "+e.toNT()},this.test=function(t){return e.equals(t)},this}function x(e){this.describe=function(t){return"REGEXP( '"+e+"' , "+t+" )"},this.test=function(t){var r=new RegExp(e);return!!t.value&&r.test(t.value)}}function _(e,t){3!==e.length||"Variable"!==e[0].termType||"NamedNode"!==e[2].termType&&"Literal"!==e[2].termType?6===e.length&&"string"==typeof e[0]&&"regexp"===e[0].toLowerCase()&&"("===e[1]&&")"===e[5]&&","===e[3]&&"Variable"===e[4].termType&&"Literal"===e[2].termType&&(lr.Z.debug("Constraint added: "+e),t.constraints[e[4]]=new x(e[2].value)):"="===e[1]||">"===e[1]||"<"===e[1]?(lr.Z.debug("Constraint added: "+e),t.constraints[e[0]]=new w(e[2])):lr.Z.warn("I don't know how to handle the constraint: "+e)}function T(e,t){lr.Z.debug("Optional query: "+e+" not yet implemented.");var n=r.formula();j(e,n),t.optional.push(n)}function j(e,t){var n,o,u=function(e){for(var t=[],n=0;n<e.length;n++)"string"==typeof e[n]?(e[n]=a(e[n]),s(e[n])?t[n]=i(e[n].slice(1)):c(e[n])?(lr.Z.info(e[n]+" was identified as a bnode."),t[n]=r.bnode()):l(e[n])?(lr.Z.info(e[n]+" was identified as a symbol."),t[n]=r.sym(p(e[n]))):h(e[n])?(lr.Z.info(e[n]+" was identified as a prefixed symbol"),O[d(e[n])]?t[n]=r.sym(e[n]=O[d(e[n])]+f(e[n])):(lr.Z.error("SPARQL error: "+e[n]+" with prefix "+d(e[n])+" does not have a correct prefix entry."),t[n]=e[n])):t[n]=e[n]):t[n]=e[n];return t}(e);for(lr.Z.debug("WHERE: "+u);v("OPTIONAL",u);)o=v("OPTIONAL",u),lr.Z.debug("OPT: "+o+" "+u[o]+" in "+u),"{"!==u[o+1]&&lr.Z.warn("Bad optional opening bracket in word "+o),-1===(n=b(u.slice(o+2),"{","}"))?lr.Z.error("No matching bracket in word "+o):(T(u.slice(o+2,o+2+n),t),o=v("OPTIONAL",u),n=b(u.slice(o+2),"{","}"),u.splice(o,n+3));for(lr.Z.debug("WHERE after optionals: "+u);v("FILTER",u);){var g=v("FILTER",u);"("!==u[g+1]&&lr.Z.warn("Bad filter opening bracket in word "+g),-1===(n=b(u.slice(g+2),"(",")"))?lr.Z.error("No matching bracket in word "+g):(_(u.slice(g+2,g+2+n),t),g=v("FILTER",u),n=b(u.slice(g+2),"(",")"),u.splice(g,n+3))}lr.Z.debug("WHERE after filters and optionals: "+u),function(e,t){var r=new Array(1);r[0]=-1;for(var n=r.concat(m(".",e)),i=[],o=0;o<n.length-1;o++)i[o]=e.slice(n[o]+1,n[o+1]);for(o in i){lr.Z.info("s+p+o "+o+" = "+i[o]);var s=i[o][0];i[o].splice(0,1);var a=r.concat(m(";",i[o]));a.push(i[o].length);for(var l=[],c=0;c<a.length-1;c++)l[c]=i[o].slice(a[c]+1,a[c+1]);for(o in l){lr.Z.info("p+o "+o+" = "+i[o]);var u=l[o][0];l[o].splice(0,1);var h=r.concat(m(",",l[o]));h.push(l[o].length);var d=[];for(c=0;c<h.length-1;c++)d[c]=l[o].slice(h[c]+1,h[c+1]);for(o in d){var f=d[o][0];lr.Z.info("Subj="+s+" Pred="+u+" Obj="+f),t.add(s,u,f)}}}}(u,t)}lr.Z.info("SPARQL input: \n"+e);var E=new Or,N=function(e){var t=g(e),r=[];for(var n in t)r="string"==typeof t[n]?r.concat(y(t[n])):r.concat(t[n]);return r=function(e){for(var t=e,r=0;r<t.length;r++)if("a"===t[r]&&(t[r]="<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>"),"is"===t[r]&&"of"===t[r+2]){t.splice(r,1),t.splice(r+1,1);var n=t[r-1];t[r-1]=t[r+1],t[r+1]=n}return t}(r),lr.Z.info("SPARQL Tokens: "+r),r}(e),O=function(e){var t=m("PREFIX",e),r=[];for(var n in t){var i=e[t[n]+1],o=e[t[n]+2];if(u(i))if(l(o)){lr.Z.info("Prefix found: "+i+" -> "+o);var s=d(i),a=p(o);r[s]=a}else lr.Z.error("Invalid SPARQL symbol: "+o);else lr.Z.error("Invalid SPARQL prefix: "+i)}return r}(N);O.rdf||(O.rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"),O.rdfs||(O.rdfs="http://www.w3.org/2000/01/rdf-schema#");var S=v("SELECT",N),I=v("WHERE",N);if(S<0||I<0||S>I)return lr.Z.error("Invalid or nonexistent SELECT and WHERE tags in SPARQL query"),!1;if(function(e,t){for(var r in lr.Z.info("SPARQL vars: "+e),e)if(s(e[r])){lr.Z.info("Added "+e[r]+" to query variables from SPARQL");var n=i(e[r].slice(1));t.vars.push(n),n.label=e[r].slice(1)}else lr.Z.warn("Incorrect SPARQL variable in SELECT: "+e[r])}(N.slice(S+1,I),E),j(N.slice(I+2,N.length-1),E.pat),t)return E;for(var k in E.pat.statements){var A=E.pat.statements[k];"NamedNode"===A.subject.termType&&r.fetcher&&r.fetcher.lookUpThing(A.subject,"sparql:"+A.subject),"NamedNode"===A.object.termType&&r.fetcher&&r.fetcher.lookUpThing(A.object,"sparql:"+A.object)}return E}class Mn{constructor(e){if((0,t.Z)(this,"store",void 0),(0,t.Z)(this,"ifps",void 0),(0,t.Z)(this,"fps",void 0),(0,t.Z)(this,"patchControl",void 0),(0,t.Z)(this,"ns",void 0),(e=e||new Cr).updater)throw new Error("You can't have two UpdateManagers for the same store");e.fetcher||(e.fetcher=new Cn(e)),this.store=e,e.updater=this,this.ifps={},this.fps={},this.ns={},this.ns.link=cr("http://www.w3.org/2007/ont/link#"),this.ns.http=cr("http://www.w3.org/2007/ont/http#"),this.ns.httph=cr("http://www.w3.org/2007/ont/httph#"),this.ns.ldp=cr("http://www.w3.org/ns/ldp#"),this.ns.rdf=cr("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.rdfs=cr("http://www.w3.org/2000/01/rdf-schema#"),this.ns.rdf=cr("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),this.ns.owl=cr("http://www.w3.org/2002/07/owl#"),this.patchControl=[]}patchControlFor(e){return this.patchControl[e.value]||(this.patchControl[e.value]=[]),this.patchControl[e.value]}isHttpUri(e){return"http"===e.slice(0,4)}editable(e,t){if(!e)return!1;if(t||(t=this.store),e=(0,vn._)(e),!this.isHttpUri(e)&&t.holds(this.store.rdfFactory.namedNode(e),this.store.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),this.store.rdfFactory.namedNode("http://www.w3.org/2007/ont/link#MachineEditableDocument")))return"LOCALFILE";for(var r,n,i=!1,o=t.each(void 0,this.ns.link("requestedURI"),(0,rr.docpart)(e)),s=0;s<o.length;s++)if(void 0!==(r=o[s])){var a=t.any(r,this.ns.link("response"));if(void 0!==r){var l=t.anyValue(a,this.ns.httph("wac-allow"));if(l)for(var c of l.split(",")){var u=c.split("=");if(u[0].includes("user")&&!u[1].includes("write")&&!u[1].includes("append"))return!1}var h=t.each(a,this.ns.httph("accept-patch"));if(h.length)for(let e=0;e<h.length;e++){if((n=h[e].value.trim()).indexOf("application/sparql-update")>=0)return"SPARQL";if(n.indexOf("application/sparql-update-single-match")>=0)return"SPARQL"}var d=t.each(a,this.ns.httph("ms-author-via"));if(d.length)for(let e=0;e<d.length;e++){if((n=d[e].value.trim()).indexOf("SPARQL")>=0)return"SPARQL";if(n.indexOf("DAV")>=0)return"DAV"}if(!this.isHttpUri(e))return!!l&&"LOCALFILE";var f=t.each(a,this.ns.http("status"));if(f.length)for(let e=0;e<f.length;e++)200!==f[e]&&404!==f[e]||(i=!0)}}if(0===o.length);else if(i)return!1}anonymize(e){return"_:"===e.toNT().substr(0,2)&&this.mentioned(e)?"?"+e.toNT().substr(2):e.toNT()}anonymizeNT(e){return this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" ."}nTriples(e){return`${e.subject.toNT()} ${e.predicate.toNT()} ${e.object.toNT()} .`}statementBnodes(e){return[e.subject,e.predicate,e.object].filter((function(e){return(0,u.B2)(e)}))}statementArrayBnodes(e){var t=[];for(let r=0;r<e.length;r++)t=t.concat(this.statementBnodes(e[r]));t.sort();var r=[];for(let e=0;e<t.length;e++)0!==e&&t[e].equals(t[e-1])||r.push(t[e]);return r}cacheIfps(){this.ifps={};var e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("InverseFunctionalProperty"));for(let t=0;t<e.length;t++)this.ifps[e[t].value]=!0;this.fps={},e=this.store.each(void 0,this.ns.rdf("type"),this.ns.owl("FunctionalProperty"));for(let t=0;t<e.length;t++)this.fps[e[t].value]=!0}bnodeContext2(e,t,r){var n,i,o=this.store.statementsMatching(void 0,void 0,e,t);for(let e=0;e<o.length;e++)if(this.fps[o[e].predicate.value]){if(!(n=o[e].subject).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}o=this.store.statementsMatching(e,void 0,void 0,t);for(let e=0;e<o.length;e++)if(this.ifps[o[e].predicate.value]){if(!(n=o[e].object).isBlank)return[o[e]];if(r&&(i=this.bnodeContext2(n,t,r-1)))return i.concat([o[e]])}return null}bnodeContext1(e,t){for(var r=0;r<3;r++){var n=this.bnodeContext2(e,t,r);if(null!==n)return n}return this.store.connectedStatements(e,t)}mentioned(e){return 0!==this.store.statementsMatching(e,null,null,null).length||0!==this.store.statementsMatching(null,e).length||0!==this.store.statementsMatching(null,null,e).length}bnodeContext(e,t){var r=[];if(e.length){this.cacheIfps();for(let i=0;i<e.length;i++){var n=e[i];this.mentioned(n)&&(r=r.concat(this.bnodeContext1(n,t)))}}return r}statementContext(e){var t=this.statementBnodes(e);return this.bnodeContext(t,e.graph)}contextWhere(e){var t=this;return e&&0!==e.length?"WHERE { "+e.map((function(e){return t.anonymizeNT(e)})).join("\n")+" }\n":""}fire(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Promise.resolve().then((()=>{if(!e)throw new Error("No URI given for remote editing operation: "+t);return n.noMeta=!0,n.contentType="application/sparql-update",n.body=t,this.store.fetcher.webOperation("PATCH",e,n)})).then((n=>{if(!n.ok){let r="UpdateManager: update failed for <"+e+"> status="+n.status+", "+n.statusText+"\n for query: "+t;throw new Error(r)}r(e,n.ok,n.responseText,n)})).catch((t=>{r(e,!1,t.message,t)}))}update_statement(e){if(!e||e.graph){var t=this,r=this.statementContext(e);return{statement:e?[e.subject,e.predicate,e.object,e.graph]:void 0,statementNT:e?this.anonymizeNT(e):void 0,where:t.contextWhere(r),set_object:function(e,r){var n=this.where;n+="DELETE DATA { "+this.statementNT+" } ;\n",n+="INSERT DATA { "+this.anonymize(this.statement[0])+" "+this.anonymize(this.statement[1])+" "+this.anonymize(e)+" . }\n",t.fire(this.statement[3].value,n,r)}}}}insert_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="INSERT DATA { "+i+" }\n"}else n+="INSERT DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}delete_statement(e,t){var r=e instanceof Array?e[0]:e,n=this.contextWhere(this.statementContext(r));if(e instanceof Array){var i="";for(let t=0;t<e.length;t++)i+=e[t]+"\n";n+="DELETE DATA { "+i+" }\n"}else n+="DELETE DATA { "+this.anonymize(e.subject)+" "+this.anonymize(e.predicate)+" "+this.anonymize(e.object)+" . }\n";this.fire(r.graph.value,n,t)}requestDownstreamAction(e,t){var r=this.patchControlFor(e);if(r.pendingUpstream)if(r.downstreamAction){if(""+r.downstreamAction!=""+t)throw new Error("Can't wait for > 1 different downstream actions")}else r.downstreamAction=t;else t(e)}clearUpstreamCount(e){this.patchControlFor(e).upstreamCount=0}getUpdatesVia(e){var t=this.store.fetcher.getHeader(e,"updates-via");return t&&t.length?t[0].trim():null}addDownstreamChangeListener(e,t){var r=this.patchControlFor(e);r.downstreamChangeListeners||(r.downstreamChangeListeners=[]),r.downstreamChangeListeners.push(t),this.setRefreshHandler(e,(e=>{this.reloadAndSync(e)}))}reloadAndSync(e){var t=this.patchControlFor(e),r=this;if(t.reloading)t.outOfDate=!0;else{t.reloading=!0;var n=1e3,i=function(){r.reload(r.store,e,(function(e,r,o){if(e){if(t.downstreamChangeListeners)for(let e=0;e<t.downstreamChangeListeners.length;e++)t.downstreamChangeListeners[e]();t.reloading=!1,t.outOfDate&&(t.outOfDate=!1,i())}else t.reloading=!1,0===o.status&&(t.reloading=!0,setTimeout(i,n*=2))}))};i()}}setRefreshHandler(e,t){let r=this.getUpdatesVia(e);var n=t,i=this,o=this,s=1500,a=0;if(!r)return!1;r=(0,rr.join)(r,e.value);const l=r.replace(/^http:/,"ws:").replace(/^https:/,"wss:");var c=function(){var t;if("undefined"!=typeof WebSocket)t=new WebSocket(l);else{if("undefined"==typeof window||!window.WebSocket)return;t=window.WebSocket(l)}t.onopen=function(){s=1500,this.send("sub "+e.value),a&&o.requestDownstreamAction(e,n)};var r=i.patchControlFor(e);r.upstreamCount=0,t.onerror=function(e){},t.onclose=function(e){s*=2,a+=1,setTimeout((function(){c()}),s)},t.onmessage=function(t){if(t.data&&"pub"===t.data.slice(0,3)){if("upstreamCount"in r&&(r.upstreamCount-=1,r.upstreamCount>=0))return;r.upstreamCount=0,i.requestDownstreamAction(e,n)}}};return c(),!0}updateMany(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=e.concat(t).map((e=>e.why)),n=this,i=[];r.forEach((e=>{i.find((t=>t.equals(e)))||i.push(e)}));const o=i.map((r=>n.update(e.filter((e=>e.why.equals(r))),t.filter((e=>e.why.equals(r))))));return o.length,Promise.all(o)}update(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};if(!r){var o=this;return new Promise((function(r,s){o.update(e,t,(function(e,t,n){t?r():s(new Error(n))}),n,i)}))}try{var s=this.store,a=e?(0,u.Pv)(e)?e.statements:e instanceof Array?e:[e]:[],l=t?(0,u.Pv)(t)?t.statements:t instanceof Array?t:[t]:[];if(!(a instanceof Array))throw new Error("Type Error "+typeof a+": "+a);if(!(l instanceof Array))throw new Error("Type Error "+typeof l+": "+l);if(0===a.length&&0===l.length)return r(null,!0);var c=a.length?a[0].graph:l[0].graph;if(!c){let e="Error patching: statement does not specify which document to patch:"+a[0]+", "+l[0];throw new Error(e)}if("NamedNode"!==c.termType){let e="Error patching: document not a NamedNode:"+a[0]+", "+l[0];throw new Error(e)}var h=this.patchControlFor(c),d=Date.now(),f=["subject","predicate","object","why"],p={delete:a,insert:l};["insert","delete"].map((function(e){p[e].map((function(e){if(!c.equals(e.graph))throw new Error("update: destination "+c+" inconsistent with delete quad "+e.graph);f.map((function(t){if(void 0===e[t])throw new Error("update: undefined "+t+" of statement.")}))}))}));var g=this.editable(c.value,s);if(!1===g)throw new Error("Update: Can't make changes in uneditable "+c);if(void 0===g){if(n)throw new Error("Update: Loaded "+c+"but stil can't figure out what editing protcol it supports.");return void this.store.fetcher.load(c).then((n=>{this.update(e,t,r,!0,i)}),(n=>{if(404!==n.response.status)throw new Error(`Update: Can't get updatability status ${c} before patching: ${n}`);this.update(e,t,r,!0,i)}))}if(g.indexOf("SPARQL")>=0){var y=[];a.length&&(y=this.statementArrayBnodes(a)),l.length&&(y=y.concat(this.statementArrayBnodes(l)));var v=this.bnodeContext(y,c),m=this.contextWhere(v),b="";if(m.length){if(a.length){b+="DELETE { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" }\n"}if(l.length){b+="INSERT { ";for(let e=0;e<l.length;e++)b+=this.anonymizeNT(l[e])+"\n";b+=" }\n"}b+=m}else{if(a.length){b+="DELETE DATA { ";for(let e=0;e<a.length;e++)b+=this.anonymizeNT(a[e])+"\n";b+=" } \n"}if(l.length){a.length&&(b+=" ; "),b+="INSERT DATA { ";for(let e=0;e<l.length;e++)b+=this.nTriples(l[e])+"\n";b+=" }\n"}}h.pendingUpstream=h.pendingUpstream?h.pendingUpstream+1:1,"upstreamCount"in h&&(h.upstreamCount+=1),this.fire(c.value,b,((e,t,n,i)=>{if(i.elapsedTimeMs=Date.now()-d,t){try{s.remove(a)}catch(e){t=!1,n="Remote Ok BUT error deleting "+a.length+" from store!!! "+e}for(let e=0;e<l.length;e++)s.add(l[e].subject,l[e].predicate,l[e].object,c)}if(r(e,t,n,i),h.pendingUpstream-=1,0===h.pendingUpstream&&h.downstreamAction){var o=h.downstreamAction;delete h.downstreamAction,o(c)}}),i)}else if(g.indexOf("DAV")>=0)this.updateDav(c,a,l,r,i);else{if(!(g.indexOf("LOCALFILE")>=0))throw new Error("Unhandled edit method: '"+g+"' for "+c);try{this.updateLocalFile(c,a,l,r,i)}catch(e){r(c.value,!1,"Exception trying to write back file <"+c.value+">\n")}}}catch(e){r(void 0,!1,"Exception in update: "+e+"\n"+ur.stackString(e))}}updateDav(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=this.store;var s=o.any(e,this.ns.link("request"));if(!s)throw new Error("No record of our HTTP GET request for document: "+e);var a=o.any(s,this.ns.link("response"));if(!a)return null;var l=o.the(a,this.ns.httph("content-type")).value;let c=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)ur.RDFArrayRemove(c,t[e]);for(let e=0;e<r.length;e++)c.push(r[e]);const u=this.serialize(e.value,c,l);var h,d=o.the(a,this.ns.httph("content-location"));return d&&(h=(0,rr.join)(d.value,h)),i.contentType=l,i.noMeta=!0,i.body=u,o.fetcher.webOperation("PUT",h,i).then((i=>{if(!i.ok)throw new Error(i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,i.ok,i.responseText,i)})).catch((t=>{n(e.value,!1,t.message,t)}))}updateLocalFile(e,t,r,n){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const o=this.store;let s=o.statementsMatching(void 0,void 0,void 0,e).slice();for(let e=0;e<t.length;e++)ur.RDFArrayRemove(s,t[e]);for(let e=0;e<r.length;e++)s.push(r[e]);var a=e.value.lastIndexOf(".");if(a<1)throw new Error("Rewriting file: No filename extension: "+e.value);var l=e.value.slice(a+1);let c=Cn.CONTENT_TYPE_BY_EXT[l];if(!c)throw new Error("File extension ."+l+" not supported for data write");i.body=this.serialize(e.value,s,c),i.contentType=c,o.fetcher.webOperation("PUT",e.value,i).then((i=>{if(!i.ok)return n(e.value,!1,i.error);for(let e=0;e<t.length;e++)o.remove(t[e]);for(let t=0;t<r.length;t++)o.add(r[t].subject,r[t].predicate,r[t].object,e);n(e.value,!0,"")}))}serialize(e,t,r){const n=this.store;let i;if("string"==typeof t)return t;var o=gr(n);switch(o.suggestNamespaces(n.namespaces),o.setBase(e),r){case"text/xml":case"application/rdf+xml":i=o.statementsToXML(t);break;case"text/n3":case"text/turtle":case"application/x-turtle":case"application/n3":i=o.statementsToN3(t);break;default:throw new Error("Content-type "+r+" not supported for data serialization")}return i}put(e,t,r,n){const i=this.store;let o;return Promise.resolve().then((()=>(o=this.serialize(e.value,t,r),i.fetcher.webOperation("PUT",e.value,{contentType:r,body:o})))).then((r=>{if(!r.ok)return n(e.value,r.ok,r.error,r);delete i.fetcher.nonexistent[e.value],delete i.fetcher.requested[e.value],"string"!=typeof t&&t.map((e=>{i.addStatement(e)})),n(e.value,r.ok,"",r)})).catch((t=>{n(e.value,!1,t.message)}))}reload(e,t,r){var n=Date.now();e.fetcher.nowOrWhenFetched(t.value,{force:!0,noMeta:!0,clearPreviousData:!0},(function(e,i,o){if(e)if(o.onErrorWasCalled||200!==o.status)r(!1,"Non-HTTP error reloading data: "+i,o);else{var s=Date.now()-n;t.reloadTimeTotal||(t.reloadTimeTotal=0),t.reloadTimeCount||(t.reloadTimeCount=0),t.reloadTimeTotal+=s,t.reloadTimeCount+=1,r(!0)}else r(!1,"Error reloading data: "+i,o)}))}}const Fn={...rn,fetcher:(e,t)=>new Cn(e,t),graph(){return new Cr(arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,(arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0)||{rdfFactory:rn})},lit(e,t,r){return this.literal(""+e,t||r)},st(e,t,r,n){return this.quad(e,t,r,n)}},Un=Fn;class Bn{constructor(e,t){this.parent=e,this.via=t,this.connected=!1,this.pending={},this.subscribed={},this.socket={};try{this.socket=new WebSocket(t),this.socket.onopen=this.onOpen,this.socket.onclose=this.onClose,this.socket.onmessage=this.onMessage,this.socket.onerror=this.onError}catch(e){this.onError(e)}}_decode(e){var t,r,n,i,o,s,a;for(r in i={},o=function(){var r,n,i,o;for(o=[],r=0,n=(i=e.split("&")).length;r<n;r++)t=i[r],o.push(t.split("="));return o}())t=o[r],a=(s=[decodeURIComponent(t[0]),decodeURIComponent(t[1])])[1],null==i[n=s[0]]&&(i[n]=[]),i[n].push(a);return i}_send(e,t,r){var n,i;return i=[e,t,r].join(" "),"function"==typeof(n=this.socket).send?n.send(i):void 0}_subscribe(e){return this._send("sub",e,""),this.subscribed[e]=!0,this.subscribed[e]}onClose(e){var t;for(t in this.connected=!1,this.subscribed)this.pending[t]=!0;return this.subscribed={},this.subscribed}onError(e){throw new Error("onError"+e)}onMessage(e){var t,r;return"ping"===(r=e.data.split(" "))[0]?"function"==typeof(t=this.socket).send?t.send("pong "+r.slice(1).join(" ")):void 0:"pub"===r[0]?this.parent.onUpdate(r[1],this._decode(r[2])):void 0}onOpen(e){var t,r;for(r in this.connected=!0,t=[],this.pending)delete this.pending[r],t.push(this._subscribe(r));return t}subscribe(e){return this.connected?this._subscribe(e):(this.pending[e]=!0,this.pending[e])}}class qn{constructor(e){this.fetcher=e,this.graph={},this.via={},this.fetcher.addCallback("headers",this.onHeaders)}onHeaders(e){var t,r,n;return null==e.headers||"undefined"==typeof WebSocket||null===WebSocket||(t=e.headers.etag,n=e.headers["updates-via"],r=e.uri,t&&n&&(this.graph[r]={etag:t,via:n},this.register(n,r))),!0}onUpdate(e,t){return this.fetcher.refresh(Un.namedNode(e))}register(e,t){return null==this.via[e]&&(this.via[e]=new Bn(this,e)),this.via[e].subscribe(t)}}const Hn={};for(const e in Un)"function"==typeof Un[e]&&(Hn[e]=Un[e].bind(Un));const{fetcher:$n,graph:Zn,lit:Vn,st:zn,namedNode:Gn,variable:Jn,blankNode:Xn,defaultGraph:Qn,literal:Wn,quad:Yn,triple:Kn}=Hn,ei=new Tr,ti=e=>ei.fromNT(e),ri=jr.fromValue,ni=l.nextId;class ii extends Cr{constructor(e){super(e),(0,t.Z)(this,"fetcher",void 0),this.fetcher=new Cn(this,{})}}class oi extends ii{constructor(e){super(e),(0,t.Z)(this,"updater",void 0),this.updater=new Mn(this)}}})(),i})()));
3
3
  //# sourceMappingURL=rdflib.min.js.map