UNPKG

@bahulneel/rdflib

Version:

an RDF library for node.js. Suitable for client and server side.

39 lines 389 kB
"undefined"!=typeof window&&(window.solid||(window.solid={}),window.solid.auth||(window.solid.auth={fetch:(e,t)=>window.fetch(e,t)})),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)}(window,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=48)}([function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},function(e,t,r){"use strict";r.d(t,"n",(function(){return n})),r.d(t,"a",(function(){return i})),r.d(t,"h",(function(){return a})),r.d(t,"s",(function(){return o})),r.d(t,"c",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"d",(function(){return c})),r.d(t,"e",(function(){return l})),r.d(t,"f",(function(){return h})),r.d(t,"g",(function(){return f})),r.d(t,"i",(function(){return d})),r.d(t,"j",(function(){return p})),r.d(t,"k",(function(){return v})),r.d(t,"l",(function(){return g})),r.d(t,"m",(function(){return y})),r.d(t,"o",(function(){return m})),r.d(t,"p",(function(){return b})),r.d(t,"q",(function(){return w})),r.d(t,"r",(function(){return x})),r.d(t,"t",(function(){return _}));var n="NamedNode",i="BlankNode",a="Literal",o="Variable",s="DefaultGraph",u="Collection",c="Empty",l="Graph",h="text/html",f="application/ld+json",d="text/n3",p="application/n3",v="application/nquads",g="application/n-quads",y="application/n-triples",m="application/rdf+xml",b="application/sparql-update",w="text/turtle",x="application/x-turtle",_="application/xhtml+xml"},function(e,t,r){"use strict";t.a={debug:function(e){},warn:function(e){},info:function(e){},error:function(e){},success:function(e){},msg:function(e){}}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,r){"use strict";r.r(t),r.d(t,"docpart",(function(){return a})),r.d(t,"document",(function(){return o})),r.d(t,"hostpart",(function(){return s})),r.d(t,"join",(function(){return u})),r.d(t,"protocol",(function(){return c})),r.d(t,"refTo",(function(){return l}));var n=r(9),i=i||console.log;function a(e){var t;return(t=e.indexOf("#"))<0?e:e.slice(0,t)}function o(e){return new n.a(a(e))}function s(e){var t=/[^\/]*\/\/([^\/]*)\//.exec(e);return t?t[1]:""}function u(e,t){var r,n,a,o,s,u=t.indexOf("#");if(u>0&&(t=t.slice(0,u)),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 i("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((a=t.indexOf("/",r+3))<0)return t.length-r-3>0?t+"/"+e:n+e}else if((a=t.indexOf("/",r+1))<0)return t.length-r-1>0?t+"/"+e:n+e;if(0===e.indexOf("/"))return t.slice(0,a)+e;if((o=(s=t.slice(a)).lastIndexOf("/"))<0)return n+e;for(o>=0&&o<s.length-1&&(s=s.slice(0,+o+1||9e9)),s+=e;s.match(/[^\/]*\/\.\.\//);)s=s.replace(/[^\/]*\/\.\.\//,"");return s=(s=s.replace(/\.\//g,"")).replace(/\/\.$/,"/"),t.slice(0,a)+s}function c(e){var t=e.indexOf(":");return t<0?null:e.slice(0,t)}function l(e,t){var r,n,i,a,o,s,u,c,l,h,f,d,p=new RegExp("^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$");if(!e)return t;if(e===t)return"";for(r=u=0,a=t.length;u<a;r=++u){if(t[r]!==e[r])break}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,c=0,o=(h=e.slice(r)).length;c<o;c++)"/"===h[c]&&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)}},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,r){"use strict";r.d(t,"j",(function(){return o})),r.d(t,"k",(function(){return s})),r.d(t,"b",(function(){return u})),r.d(t,"i",(function(){return c})),r.d(t,"n",(function(){return l})),r.d(t,"m",(function(){return h})),r.d(t,"d",(function(){return f})),r.d(t,"g",(function(){return d})),r.d(t,"e",(function(){return p})),r.d(t,"a",(function(){return v})),r.d(t,"l",(function(){return g})),r.d(t,"f",(function(){return y})),r.d(t,"h",(function(){return m})),r.d(t,"c",(function(){return b}));var n=r(16),i=r.n(n),a=r(1);function o(e){return"object"===i()(e)&&null!==e&&"subject"in e}function s(e){return"object"===i()(e)&&null!==e&&"statements"in e}function u(e){return h(e)&&e.termType===a.b}function c(e){return e&&Object.prototype.hasOwnProperty.call(e,"termType")&&(e.termType===a.n||e.termType===a.s||e.termType===a.a||e.termType===a.b||e.termType===a.h)}function l(e){return h(e)&&e.termType===a.s}function h(e){return"object"===i()(e)&&null!==e&&"termType"in e}function f(e){return e.termType===a.h}function d(e){return"object"===i()(e)&&null!==e&&"subject"in e&&"predicate"in e&&"object"in e}function p(e){return h(e)&&"NamedNode"===e.termType}function v(e){return h(e)&&"termType"in e&&"BlankNode"===e.termType}function g(e){return h(e)&&(e.termType===a.n||e.termType===a.s||e.termType===a.a)}function y(e){return h(e)&&(e.termType===a.n||e.termType===a.s)}function m(e){return h(e)&&(e.termType===a.n||e.termType===a.s||e.termType===a.a||e.termType===a.h)}function b(e){return h(e)&&(e.termType===a.n||e.termType===a.s||e.termType===a.a||e.termType===a.c)}},function(e,t){function r(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)}}e.exports=function(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),e}},function(e,t,r){"use strict";r.r(t),function(e){r.d(t,"string",(function(){return s})),r.d(t,"mediaTypeClass",(function(){return u})),r.d(t,"linkRelationProperty",(function(){return c})),r.d(t,"callbackify",(function(){return l})),r.d(t,"DOMParserFactory",(function(){return h})),r.d(t,"domToString",(function(){return f})),r.d(t,"dumpNode",(function(){return d})),r.d(t,"dtstamp",(function(){return p})),r.d(t,"heavyCompare",(function(){return v})),r.d(t,"heavyCompareSPO",(function(){return g})),r.d(t,"output",(function(){return y})),r.d(t,"parseXML",(function(){return m})),r.d(t,"RDFArrayRemove",(function(){return b})),r.d(t,"string_startswith",(function(){return w})),r.d(t,"stackString",(function(){return x}));var n=r(2);r.d(t,"log",(function(){return n.a}));var i=r(4);r.d(t,"uri",(function(){return i}));var a=r(9),o=r(29),s={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 a.a("http://www.w3.org/ns/iana/media-types/"+e+"#Resource")}function c(e){return new a.a("http://www.w3.org/ns/iana/link-relations/relation#"+e.trim())}function l(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,a=[],o=[],s=e.callbacks[t].length;for(n=s-1;n>=0;n--)(i=e.callbacks[t][n])&&i.apply(e,r)&&a.push(i);for(n=a.length-1;n>=0;n--)o.push(a[n]);for(n=s;n<e.callbacks[t].length;n++)o.push(e.callbacks[t][n]);e.callbacks[t]=o}}function h(){return window.DOMParser?new o.DOMParser:!!window.ActiveXObject&&new ActiveXObject("Microsoft.XMLDOM")}function f(e,t){var r=[];"selfClosing"in(t=t||{})&&t.selfClosing.split(" ").forEach((function(e){r[e]=!0}));var n=[];return"skipAttributes"in t&&t.skipAttributes.split(" ").forEach((function(e){n[e]=!0})),d(e,t,r,n)}function d(e,t,r,n){var i,a="",o=[!1];if(void 0===e.nodeType)return a;if(1===e.nodeType){if(e.hasAttribute("class")&&"classWithChildText"in t&&e.matches(t.classWithChildText.class))a+=e.querySelector(t.classWithChildText.element).textContent;else if(!("skipNodeWithClass"in t&&e.matches("."+t.skipNodeWithClass))){var s=e.nodeName.toLowerCase();a+="<"+s;var u=[];for(i=e.attributes.length-1;i>=0;i--){var c=e.attributes[i];if(!(n.length>0&&n[c.name])&&!/^\d+$/.test(c.name)){if("class"===c.name&&"replaceClassItemWith"in t&&c.value.split(" ").indexOf(t.replaceClassItemWith.source)>-1){var l=new RegExp(t.replaceClassItemWith.source,"g");c.value=c.value.replace(l,t.replaceClassItemWith.target).trim()}"class"===c.name&&"skipClassWithValue"in t&&t.skipClassWithValue===c.value||u.push(c.name+"='"+c.value.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/'/g,"&quot;")+"'")}}if(u.length>0&&("sortAttributes"in t&&t.sortAttributes&&u.sort((function(e,t){return e.toLowerCase().localeCompare(t.toLowerCase())})),a+=" "+u.join(" ")),r[s])a+=" />";else{for(a+=">",a+="html"===s?"\n ":"",o.push("style"===s||"script"===s),i=0;i<e.childNodes.length;i++)a+=d(e.childNodes[i]);o.pop(),a+="body"===s?"</"+s+">\n":"</"+s+">"}}}else if(8===e.nodeType)a+="\x3c!--"+e.nodeValue+"--\x3e";else if(3===e.nodeType||4===e.nodeType){var h=e.nodeValue.replace(/\n+$/,"");a+=o[o.length-1]?h:h.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}else console.log("Warning; Cannot handle serialising nodes of type: "+e.nodeType),console.log(e);return a}function p(){var e=new Date,t=e.getYear()+1900,r=e.getMonth()+1,n=e.getDate(),i=e.getUTCHours(),a=e.getUTCMinutes(),o=e.getSeconds();return r<10&&(r="0"+r),n<10&&(n="0"+n),i<10&&(i="0"+i),a<10&&(a="0"+a),o<10&&(o="0"+o),t+"-"+r+"-"+n+"T"+i+":"+a+":"+o+"Z"}function v(e,t,r,n){var i=function(e){return"BlankNode"===e.termType?null:e},a=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")},o=Object.prototype.hasOwnProperty.call(r,"compareTerm")?r.compareTerm(e,t):e.compareTerm(t);return"BlankNode"===e.termType&&"BlankNode"===t.termType?0===o?0:a(e)>a(t)?1:a(e)<a(t)?-1:o:n&&e.uri&&t.uri?(n[e.uri]||e.uri).localeCompare(n[t.uri]||t.uri):o}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 y(e){var t=document.createElement("div");t.textContent=e,document.body.appendChild(t)}function m(t,r){return r=r||{},e&&e.exports?(new o.DOMParser).parseFromString(t,r.contentType||"application/xhtml+xml"):("undefined"!=typeof window&&window.DOMParser?new window.DOMParser:new o.DOMParser).parseFromString(t,"application/xml")}function b(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 w(e,t){return e.slice(0,t.length)===t}function x(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 a=r[i];if(a.indexOf("ecmaunit.js")>-1)break;"("==a.charAt(0)&&(a="function"+a);var o=a.split("@");n.push(o)}for(i=0;i<n.length;i++)t+=" "+n[i][1]+"\n "+n[i][0];return t}}.call(this,r(50)(e))},function(e,t,r){"use strict";r.d(t,"a",(function(){return _}));var n=r(5),i=r.n(n),a=r(7),o=r.n(a),s=r(11),u=r.n(s),c=r(12),l=r.n(c),h=r(3),f=r.n(h),d=r(13),p=r.n(d),v=r(0),g=r.n(v),y=r(14),m=r(10),b=r(1),w=r(18),x=r(6),_=function(e){function t(e){var r;if(i()(this,t),r=u()(this,l()(t).call(this,Object(w.a)(e))),g()(f()(r),"termType",b.n),g()(f()(r),"classOrder",y.a.NamedNode),!r.value)throw new Error("Missing IRI for NamedNode");if(!r.value.includes(":"))throw new Error('NamedNode IRI "'+e+'" must be absolute.');if(r.value.includes(" "))throw new Error('Error: NamedNode IRI "'+e+'" must not contain unencoded spaces.');return r}return p()(t,e),o()(t,[{key:"dir",value:function(){var e=this.value.split("#")[0],r=e.slice(0,-1).lastIndexOf("/"),n=e.indexOf("//");return n>=0&&r<n+2||r<0?null:new t(e.slice(0,r+1))}},{key:"site",value:function(){var e=this.value.split("#")[0],r=e.indexOf("//");if(r<0)throw new Error("This URI does not have a web site part (origin)");var n=e.indexOf("/",r+2);return new t(n<0?e.slice(0)+"/":e.slice(0,n+1))}},{key:"doc",value:function(){return this.value.indexOf("#")<0?this:new t(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?e:Object(x.m)(e)?e:new t(e)}}]),t}(m.a)},function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(5),i=r.n(n),a=r(7),o=r.n(a),s=r(0),u=r.n(s),c=function(){function e(t){i()(this,e),u()(this,"termType",void 0),u()(this,"classOrder",void 0),u()(this,"value",void 0),this.value=t}return o()(e,[{key:"substitute",value:function(e){return console.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}();u()(c,"fromValue",void 0),u()(c,"toJS",void 0)},function(e,t,r){var n=r(16),i=r(3);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?i(e):t}},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},r(t)}e.exports=r},function(e,t,r){var n=r(49);e.exports=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&&n(e,t)}},function(e,t,r){"use strict";t.a={Literal:1,Collection:3,Graph:4,NamedNode:5,BlankNode:6,Variable:7}},function(e,t,r){"use strict";var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#",a="http://www.w3.org/2000/10/swap/";t.a={xsd:{decimal:i+"decimal",boolean:i+"boolean",double:i+"double",integer:i+"integer",string:i+"string"},rdf:{type:n+"type",nil:n+"nil",first:n+"first",rest:n+"rest",langString:n+"langString"},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:a+"reify#forSome",forAll:a+"reify#forAll"},log:{implies:a+"log#implies"}}},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=r=function(e){return typeof e}:e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(t)}e.exports=r},function(e,t,r){"use strict";(function(t,n){const i=r(21),a=r(19),o=r(33).IdentifierIssuer,s=r(20),u=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,l=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,h={accept:"application/ld+json, application/json"},f={};e.exports=f,f.IdentifierIssuer=o;const d="function"==typeof t&&t,p=d?e=>d(e):e=>setTimeout(e,0);function v(e,t,r){f.nextTick(()=>e(t,r))}"object"==typeof n&&"function"==typeof n.nextTick?f.nextTick=n.nextTick:f.nextTick=p,f.setImmediate=d?p:f.nextTick,f.clone=function(e){if(e&&"object"==typeof e){let t;if(a.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=f.clone(e[r])}else if(e instanceof Map){t=new Map;for(const[r,n]of e)t.set(r,f.clone(n))}else if(e instanceof Set){t=new Set;for(const r of e)t.add(f.clone(r))}else if(a.isObject(e)){t={};for(const r in e)t[r]=f.clone(e[r])}else t=e.toString();return t}return e},f.asArray=function(e){return Array.isArray(e)?e:[e]},f.buildHeaders=(e={})=>{if(Object.keys(e).some(e=>"accept"===e.toLowerCase()))throw new RangeError('Accept header may not be specified; only "'+h.accept+'" is supported.');return Object.assign({Accept:h.accept},e)},f.parseLinkHeader=e=>{const t={},r=e.match(u);for(let e=0;e<r.length;++e){let n=r[e].match(c);if(!n)continue;const i={target:n[1]},a=n[2];for(;n=l.exec(a);)i[n[1]]=void 0===n[2]?n[3]:n[2];const o=i.rel||"";Array.isArray(t[o])?t[o].push(i):t.hasOwnProperty(o)?t[o]=[t[o],i]:t[o]=i}return t},f.validateTypeValue=e=>{if(a.isString(e)||a.isEmptyObject(e))return;let t=!1;if(a.isArray(e)){t=!0;for(let r=0;r<e.length;++r)if(!a.isString(e[r])){t=!1;break}}if(!t)throw new s('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, or an empty object.',"jsonld.SyntaxError",{code:"invalid type value",value:e})},f.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const r=e[t];return!a.isArray(r)||r.length>0}return!1},f.hasValue=(e,t,r)=>{if(f.hasProperty(e,t)){let n=e[t];const o=i.isList(n);if(a.isArray(n)||o){o&&(n=n["@list"]);for(let e=0;e<n.length;++e)if(f.compareValues(r,n[e]))return!0}else if(!a.isArray(r))return f.compareValues(r,n)}return!1},f.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),n.valueIsArray)e[t]=r;else if(a.isArray(r)){0===r.length&&n.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]);for(let i=0;i<r.length;++i)f.addValue(e,t,r[i],n)}else if(e.hasOwnProperty(t)){const i=!n.allowDuplicate&&f.hasValue(e,t,r);a.isArray(e[t])||i&&!n.propertyIsArray||(e[t]=[e[t]]),i||e[t].push(r)}else e[t]=n.propertyIsArray?[r]:r},f.getValues=(e,t)=>[].concat(e[t]||[]),f.removeProperty=(e,t)=>{delete e[t]},f.removeValue=(e,t,r,n)=>{"propertyIsArray"in(n=n||{})||(n.propertyIsArray=!1);const i=f.getValues(e,t).filter(e=>!f.compareValues(e,r));0===i.length?f.removeProperty(e,t):1!==i.length||n.propertyIsArray?e[t]=i:e[t]=i[0]},f.relabelBlankNodes=(e,t)=>function e(t,r){if(a.isArray(r))for(let n=0;n<r.length;++n)r[n]=e(t,r[n]);else if(i.isList(r))r["@list"]=e(t,r["@list"]);else if(a.isObject(r)){i.isBlankNode(r)&&(r["@id"]=t.getId(r["@id"]));const n=Object.keys(r).sort();for(let i=0;i<n.length;++i){const a=n[i];"@id"!==a&&(r[a]=e(t,r[a]))}}return r}((t=t||{}).issuer||new o("_:b"),e),f.compareValues=(e,t)=>e===t||(!(!i.isValue(e)||!i.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(a.isObject(e)&&"@id"in e&&a.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"]),f.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1,f.normalizeDocumentLoader=e=>e.length<2?f.callbackify(e):async function(t){const r=arguments[1];return new Promise((n,i)=>{try{e(t,(e,t)=>{if("function"==typeof r)return v(r,e,t);e?i(e):n(t)})}catch(e){if("function"==typeof r)return v(r,e);i(e)}})},f.callbackify=e=>async function(...t){const r=t[t.length-1];let n;"function"==typeof r&&t.pop();try{n=await e.apply(null,t)}catch(e){if("function"==typeof r)return v(r,e);throw e}return"function"==typeof r?v(r,null,n):n}}).call(this,r(30).setImmediate,r(24))},function(e,t,r){"use strict";function n(e){return"string"==typeof e?e:e.value}r.d(t,"a",(function(){return n}))},function(e,t,r){"use strict";const n={};e.exports=n,n.isArray=Array.isArray,n.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),n.isDouble=e=>n.isNumber(e)&&-1!==String(e).indexOf("."),n.isEmptyObject=e=>n.isObject(e)&&0===Object.keys(e).length,n.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),n.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),n.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),n.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),n.isUndefined=e=>void 0===e},function(e,t,r){"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}}},function(e,t,r){"use strict";const n=r(19),i={};e.exports=i,i.isSubject=e=>{if(n.isObject(e)&&!("@value"in e||"@set"in e||"@list"in e)){return Object.keys(e).length>1||!("@id"in e)}return!1},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))},function(e,t,r){"use strict";(function(t,r){const n={};e.exports=n;const i="function"==typeof t&&t,a=i?e=>i(e):e=>setTimeout(e,0);function o(e,t,n){try{return e(t,n)}catch(e){r.nextTick(()=>{throw e})}}"object"==typeof r&&"function"==typeof r.nextTick?n.nextTick=r.nextTick:n.nextTick=a,n.setImmediate=i?a:n.nextTick,n.clone=function(e){if(e&&"object"==typeof e){let t;if(Array.isArray(e)){t=[];for(let r=0;r<e.length;++r)t[r]=n.clone(e[r])}else if(n.isObject(e)){t={};for(const r in e)t[r]=n.clone(e[r])}else t=e.toString();return t}return e},n.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),n.isUndefined=e=>void 0===e,n.callbackify=e=>async function(...t){const r=t[t.length-1];let n;"function"==typeof r&&t.pop();try{n=await e.apply(null,t)}catch(e){if("function"==typeof r)return o(r,e);throw e}return"function"==typeof r?o(r,null,n):n}}).call(this,r(30).setImmediate,r(24))},function(e,t,r){"use strict";const n=r(17),i=r(65),a=r(20),{isArray:o,isObject:s,isString:u,isUndefined:c}=r(19),{isAbsolute:l,isRelative:h,prependBase:f,parse:d}=r(28),{asArray:p,compareShortestLeast:v}=r(17),g=new Map,y={};function m(e,t,r,n,i,a){if(null===t||!u(t)||y.isKeyword(t))return t;if(n&&n.hasOwnProperty(t)&&!0!==i.get(t)&&y.createTermDefinition(e,n,t,i,a),e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext),(r=r||{}).vocab){const r=e.mappings.get(t);if(null===r)return null;if(r)return r["@id"]}const o=t.indexOf(":");if(-1!==o){const r=t.substr(0,o),s=t.substr(o+1);if("_"===r||0===s.indexOf("//"))return t;if(n&&n.hasOwnProperty(r)&&y.createTermDefinition(e,n,r,i,a),e.mappings.has(r)){return e.mappings.get(r)["@id"]+s}return t}return r.vocab&&"@vocab"in e?e["@vocab"]+t:r.base?f(e["@base"],t):t}function b(e,t,r,n){if(o(e))for(const i of e)b(i,t,r,n);else if(s(e))for(const i in e){if("@context"!==i){b(e[i],t,r,n);continue}const a=e[i];if(o(a)){let e=a.length;for(let i=0;i<e;++i){const c=a[i];if(u(c)){const s=f(n,c),u=t.get(s);r?o(u)?(Array.prototype.splice.apply(a,[i,1].concat(u)),i+=u.length-1,e=a.length):!1!==u&&(a[i]=u):void 0===u&&t.set(s,!1)}else for(const e in c)s(c[e])&&b(c[e],t,r,n)}}else if(u(a)){const o=f(n,a),s=t.get(o);r?!1!==s&&(e[i]=s):void 0===s&&t.set(o,!1)}else for(const e in a)s(a[e])&&b(a[e],t,r,n)}}e.exports=y,y.cache=new i,y.process=({activeCtx:e,localCtx:t,options:r,isPropertyTermScopedContext:i=!1,isTypeScopedContext:c=!1})=>{s(t)&&"@context"in t&&o(t["@context"])&&(t=t["@context"]);const v=p(t);if(0===v.length)return e;const g=e.previousContext||e;if(i&&e.previousContext)return(e=e.clone()).isPropertyTermScoped=!0,e.previousContext=y.process({activeCtx:e.previousContext,localCtx:v,options:r,isPropertyTermScopedContext:i}),e;let m=e;for(let o=0;o<v.length;++o){let p=v[o];if(e=m,null===p){if(!i&&0!==Object.keys(e.protected).length){const i=r&&r.protectedMode||"error";if("error"===i)throw new a("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});if("warn"===i){console.warn("WARNING: invalid context nullification");const t=e;m=e=y.getInitialContext(r).clone();for(const[r,i]of Object.entries(t.protected))i&&(e.mappings[r]=n.clone(t.mappings[r]));e.protected=n.clone(t.protected),y.cache&&y.cache.set(t,p,m);continue}throw new a("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,protectedMode:i})}m=e=y.getInitialContext(r).clone(),c&&(m.previousContext=g.clone());continue}if(y.cache){const t=y.cache.get(e,p);if(t){m=e=t;continue}}if(s(p)&&"@context"in p&&(p=p["@context"]),!s(p))throw new a("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:p});m=m.clone();const b=new Map;if("@version"in p){if(1.1!==p["@version"])throw new a("Unsupported JSON-LD version: "+p["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:p});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new a("@version: "+p["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:p});m.processingMode="json-ld-1.1",m["@version"]=p["@version"],b.set("@version",!0)}if(m.processingMode=m.processingMode||e.processingMode||"json-ld-1.0","@base"in p){let t=p["@base"];if(null===t);else if(l(t))t=d(t);else{if(!h(t))throw new a('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:p});t=d(f(e["@base"].href,t))}m["@base"]=t,b.set("@base",!0)}if("@vocab"in p){const e=p["@vocab"];if(null===e)delete m["@vocab"];else{if(!u(e))throw new a('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:p});if(!l(e))throw new a('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:p});m["@vocab"]=e}b.set("@vocab",!0)}if("@language"in p){const e=p["@language"];if(null===e)delete m["@language"];else{if(!u(e))throw new a('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:p});m["@language"]=e.toLowerCase()}b.set("@language",!0)}b.set("@protected",p["@protected"]||!1);for(const e in p)y.createTermDefinition(m,p,e,b,r,i);c&&!m.previousContext&&(m.previousContext=g.clone()),y.cache&&y.cache.set(e,p,m)}return m},y.createTermDefinition=(e,t,r,n,i,c=!1)=>{if(n.has(r)){if(n.get(r))return;throw new a("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:r})}if(n.set(r,!1),y.isKeyword(r))throw new a("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:r});if(""===r)throw new a("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const h=e.mappings.get(r);let f;if(e.mappings.has(r)&&e.mappings.delete(r),t.hasOwnProperty(r)&&(f=t[r]),null===f||s(f)&&null===f["@id"])return e.mappings.set(r,null),void n.set(r,!0);let d=!1;if(u(f)&&(d=!0,f={"@id":f}),!s(f))throw new a("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const p={};e.mappings.set(r,p),p.reverse=!1;const v=["@container","@id","@language","@reverse","@type"];y.processingMode(e,1.1)&&v.push("@context","@nest","@prefix","@protected");for(const e in f)if(!v.includes(e))throw new a("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const g=r.indexOf(":");if(p._termHasColon=-1!==g,"@reverse"in f){if("@id"in f)throw new a("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 a("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const r=f["@reverse"];if(!u(r))throw new a("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});const o=m(e,r,{vocab:!0,base:!1},t,n,i);if(!l(o))throw new a("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});p["@id"]=o,p.reverse=!0}else if("@id"in f){let o=f["@id"];if(!u(o))throw new a("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(o!==r){if(o=m(e,o,{vocab:!0,base:!1},t,n,i),!l(o)&&!y.isKeyword(o))throw new a("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});p["@id"]=o,p._prefix=!p._termHasColon&&o.match(/[:\/\?#\[\]@]$/)&&(d||y.processingMode(e,1))}}if(!("@id"in p))if(p._termHasColon){const a=r.substr(0,g);if(t.hasOwnProperty(a)&&y.createTermDefinition(e,t,a,n,i),e.mappings.has(a)){const t=r.substr(g+1);p["@id"]=e.mappings.get(a)["@id"]+t}else p["@id"]=r}else{if(!("@vocab"in e))throw new a("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:r});p["@id"]=e["@vocab"]+r}if((!0===f["@protected"]||!0===n.get("@protected")&&!1!==f["@protected"])&&(e.protected[r]=!0,p.protected=!0),n.set(r,!0),"@type"in f){let r=f["@type"];if(!u(r))throw new a("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@id"!==r&&"@vocab"!==r&&"@json"!==r){if(r=m(e,r,{vocab:!0,base:!1},t,n,i),!l(r))throw new a("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 a("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})}p["@type"]=r}if("@container"in f){const r=u(f["@container"])?[f["@container"]]:f["@container"]||[],n=["@list","@set","@index","@language"];let i=!0;const s=r.includes("@set");if(y.processingMode(e,1.1))if(n.push("@graph","@id","@type"),r.includes("@list")){if(1!==r.length)throw new a("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 a("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);else i&=!o(f["@container"]),i&=r.length<=1;if(i&=r.every(e=>n.includes(e)),i&=!(s&&r.includes("@list")),!i)throw new a("Invalid JSON-LD syntax; @context @container value must be one of the following: "+n.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(p.reverse&&!r.every(e=>["@index","@set"].includes(e)))throw new a("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});p["@container"]=r}if("@context"in f&&(p["@context"]=f["@context"]),"@language"in f&&!("@type"in f)){let e=f["@language"];if(null!==e&&!u(e))throw new a("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()),p["@language"]=e}if("@prefix"in f){if(p._termHasColon)throw new a("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof f["@prefix"])throw new a("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});p._prefix=!0===f["@prefix"]}if("@nest"in f){const e=f["@nest"];if(!u(e)||"@nest"!==e&&0===e.indexOf("@"))throw new a("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});p["@nest"]=e} // disallow aliasing @context and @preserve const b=p["@id"];if("@context"===b||"@preserve"===b)throw new a("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(h&&h.protected&&!c&&(e.protected[r]=!0,p.protected=!0,!function e(t,r){if(!t||"object"!=typeof t||!r||"object"!=typeof r)return t===r;const n=Array.isArray(t);if(n!==Array.isArray(r))return!1;if(n){if(t.length!==r.length)return!1;for(let n=0;n<t.length;++n)if(!e(t[n],r[n]))return!1;return!0}const i=Object.keys(t),a=Object.keys(r);if(i.length!==a.length)return!1;for(const n in t){let i=t[n],a=r[n];if("@container"===n&&Array.isArray(i)&&Array.isArray(a)&&(i=i.slice().sort(),a=a.slice().sort()),!e(i,a))return!1}return!0}(h,p))){const e=i&&i.protectedMode||"error";if("error"===e)throw new a("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:r});if("warn"===e)return void console.warn("WARNING: protected term redefinition",{term:r});throw new a("Invalid protectedMode.","jsonld.SyntaxError",{code:"invalid protected mode",context:t,term:r,protectedMode:e})}},y.expandIri=(e,t,r,n)=>m(e,t,r,void 0,void 0,n),y.getInitialContext=e=>{const t=d(e.base||""),r=JSON.stringify({base:t,processingMode:e.processingMode}),i=g.get(r);if(i)return i;const a={"@base":t,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",a=e.mappings,u=[...a.keys()].sort(v);for(const e of u){const o=a.get(e);if(null===o)continue;let u=o["@container"]||"@none";u=[].concat(u).sort().join("");const c=p(o["@id"]);for(const a of c){let c=t[a];const l=y.isKeyword(a);if(c)l||o._termHasColon||n[a].push(e);else if(t[a]=c={},!l&&!o._termHasColon){n[a]=[e];const t={iri:a,terms:n[a]};a[0]in r?r[a[0]].push(t):r[a[0]]=[t]}if(c[u]||(c[u]={"@language":{},"@type":{},"@any":{}}),c=c[u],s(e,c["@any"],"@none"),o.reverse)s(e,c["@type"],"@reverse");else if("@type"in o)s(e,c["@type"],o["@type"]);else if("@language"in o){const t=o["@language"]||"@null";s(e,c["@language"],t)}else s(e,c["@language"],i),s(e,c["@type"],"@none"),s(e,c["@language"],"@none")}}for(const e in r)o(r,e,1);return t},clone:function(){const e={};e["@base"]=this["@base"],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.isPropertyTermScoped=this.previousContext.isPropertyTermScoped,e.previousContext=this.previousContext.clone());e.revertTypeScopedContext=this.revertTypeScopedContext,"@language"in this&&(e["@language"]=this["@language"]);"@vocab"in this&&(e["@vocab"]=this["@vocab"]);return e},revertTypeScopedContext:function(){if(!this.previousContext)return this;return this.previousContext.clone()},protected:{}};return 1e4===g.size&&g.clear(),g.set(r,a),a;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 s(e,t,r){t.hasOwnProperty(r)||(t[r]=e)}},y.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(c(r))return n;if(n.hasOwnProperty(r))return n[r]}return"@language"===r&&e.hasOwnProperty(r)?e[r]:"@context"!==r?null:void 0},y.getAllContexts=async(e,t)=>async function(e,t){const r=n.normalizeDocumentLoader(t.documentLoader);return await i(e,new Set,r),e;async function i(e,r,n){if(r.size>10)throw new a("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"loading remote context failed",max:10});const c=new Map;if(b(e,c,!1,t.base),0===c.size)return;const l=[...c.keys()].filter(e=>!1===c.get(e));return Promise.all(l.map(async l=>{if(r.has(l))throw new a("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"recursive context inclusion",url:l});const h=new Set(r);let f,d;h.add(l);try{f=await n(l),d=f.document||null,u(d)&&(d=JSON.parse(d))}catch(e){throw new a("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:l,cause:e})}if(!s(d))throw new a("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:l});d="@context"in d?{"@context":d["@context"]}:{"@context":{}},f.contextUrl&&(o(d["@context"])||(d["@context"]=[d["@context"]]),d["@context"].push(f.contextUrl)),await i(d,h,n),c.set(l,d["@context"]),b(e,c,!0,t.base)}))}}(e,t),y.processingMode=(e,t)=>t.toString()>="1.1"?e.processingMode&&e.processingMode>="json-ld-"+t.toString():!e.processingMode||"json-ld-1.0"===e.processingMode,y.isKeyword=e=>{if(!u(e))return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@embed":case"@explicit":case"@graph":case"@id":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}},function(e,t){var r,n,i=e.exports={};function a(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{n="function"==typeof clearTimeout?clearTimeout:o}catch(e){n=o}}();var u,c=[],l=!1,h=-1;function f(){l&&u&&(l=!1,u.length?c=u.concat(c):h=-1,c.length&&d())}function d(){if(!l){var e=s(f);l=!0;for(var t=c.length;t;){for(u=c,c=[];++h<t;)u&&u[h].run();h=-1,t=c.length}u=null,l=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===o||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}i.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 p(e,t)),1!==c.length||l||s(d)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){"use strict";const n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",i="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",RDF:n,RDF_LIST:n+"List",RDF_FIRST:n+"first",RDF_REST:n+"rest",RDF_NIL:n+"nil",RDF_TYPE:n+"type",RDF_PLAIN_LITERAL:n+"PlainLiteral",RDF_XML_LITERAL:n+"XMLLiteral",RDF_JSON_LITERAL:n+"JSON",RDF_OBJECT:n+"object",RDF_LANGSTRING:n+"langString",XSD:i,XSD_BOOLEAN:i+"boolean",XSD_DOUBLE:i+"double",XSD_INTEGER:i+"integer",XSD_STRING:i+"string"}},function(e,t,r){"use strict";const n=r(19),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"],a=n.regex.exec(e);let o=n.keys.length;for(;o--;)r[n.keys[o]]=void 0===a[o]?null:a[o];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(-1!==t.indexOf(":"))return t;n.isString(e)&&(e=i.parse(e||""));const r=i.parse(t),a={protocol:e.protocol||""};if(null!==r.authority)a.authority=r.authority,a.path=r.path,a.query=r.query;else if(a.authority=e.authority,""===r.path)a.path=e.path,null!==r.query?a.query=r.query:a.query=e.query;else{if(0===r.path.indexOf("/"))a.path=r.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),t.length>0&&"/"!==t.substr(-1)&&(t+="/"),t+=r.path,a.path=t}a.query=r.query}""!==r.path&&(a.path=i.removeDotSegments(a.path));let o=a.protocol;return null!==a.authority&&(o+="//"+a.authority),o+=a.path,null!==a.query&&(o+="?"+a.query),null!==r.fragment&&(o+="#"+r.fragment),""===o&&(o="./"),o},i.removeBase=(e,t)=>{if(null===e)return t;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 a=i.parse(t.substr(r.length)),o=e.normalizedPath.split("/"),s=a.normalizedPath.split("/"),u=a.fragment||a.query?0:1;for(;o.length>0&&s.length>u&&o[0]===s[0];)o.shift(),s.shift();let c="";if(o.length>0){o.pop();for(let e=0;e<o.length;++e)c+="../"}return c+=s.join("/"),null!==a.query&&(c+="?"+a.query),null!==a.fragment&&(c+="#"+a.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 r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};const a=/^([A-Za-z][A-Za-z0-9+-.]*|_):/;i.isAbsolute=e=>n.isString(e)&&a.test(e),i.isRelative=e=>n.isString(e)},function(t,r){t.exports=e},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new a(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},r(51),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(25))},function(e,t,r){"use strict";const{isKeyword:n}=r(23),i=r(21),a=r(19),o=r(17),s=r(20),u={};e.exports=u,u.createMergedNodeMap=(e,t)=>{const r=(t=t||{}).issuer||new o.IdentifierIssuer("_:b"),n={"@default":{}};return u.createNodeMap(e,n,"@default",r),u.mergeNodeMaps(n)},u.createNodeMap=(e,t,r,c,l,h)=>{if(a.isArray(e)){for(const n of e)u.createNodeMap(n,t,r,c,void 0,h);return}if(!a.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 u.createNodeMap(e["@list"],t,r,c,l,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)}a.isUndefined(l)&&(l=i.isBlankNode(e)?c.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 a of p){if("@id"===a)continue;if("@reverse"===a){const n={"@id":l},a=e["@reverse"];for(const e in a){const s=a[e];for(const a of s){let s=a["@id"];i.isBlankNode(a)&&(s=c.getId(s)),u.createNodeMap(a,t,r,c,s),o.addValue(f[s],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===a){l in t||(t[l]={}),u.createNodeMap(e[a],t,l,c);continue}if("@type"!==a&&n(a)){if("@index"===a&&a in d&&(e[a]!==d[a]||e[a]["@id"]!==d[a]["@id"]))throw new s("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:d});d[a]=e[a];continue}const h=e[a];if(0===a.indexOf("_:")&&(a=c.getId(a)),0!==h.length)for(let e of h)if("@type"===a&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){const n=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];o.addValue(d,a,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),u.createNodeMap(e,t,r,c,n)}else if(i.isValue(e))o.addValue(d,a,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const n=[];u.createNodeMap(e["@list"],t,r,c,l,n),e={"@list":n},o.addValue(d,a,e,{propertyIsArray:!0,allowDuplicate:!1})}else u.createNodeMap(e,t,r,c,l),o.addValue(d,a,e,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(d,a,[],{propertyIsArray:!0})}},u.mergeNodeMapGraphs=e=>{const t={};for(const r of Object.keys(e).sort())for(const i of Object.keys(e[r]).sort()){const a=e[r][i];i in t||(t[i]={"@id":i});const s=t[i];for(const e of Object.keys(a).sort())if(n(e))s[e]=o.clone(a[e]);else for(const t of a[e])o.addValue(s,e,o.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},u.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 a=t[n];a?"@graph"in a||(a["@graph"]=[]):t[n]=a={"@id":n,"@graph":[]};const o=a["@graph"];for(const e of Object.keys(r).sort()){const t=r[e];i.isSubjectReference(t)||o.push(t)}}return t}},function(e,t,r){(function(t,n){ /** * A JavaScript implementation of the JSON-LD API. * * @author Dave Longley * * @license BSD 3-Clause License * Copyright (c) 2011-2017 Digital Bazaar, Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the Digital Bazaar, Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ const i=r(33),a=r(17),o=a.IdentifierIssuer,s=r(20),u=r(62),c=r(63),{expand:l}=r(64),{flatten:h}=r(66),{fromRDF:f}=r(67),{toRDF:d}=r(68),{frameMergedOrDefault:p}=r(70),{isArray:v,isObject:g,isString:y}=r(19),{isSubjectReference:m}=r(21),{getInitialContext:b,process:w,getAllCo