!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.jsonld=t():e.jsonld=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:n})},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=73)}([function(e,t,r){var n=r(38)("wks"),a=r(20),i=r(1).Symbol,o="function"==typeof i;(e.exports=function(e){return n[e]||(n[e]=o&&i[e]||(o?i:a)("Symbol."+e))}).store=n},function(e,t){var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t){var r=e.exports={version:"2.5.6"};"number"==typeof __e&&(__e=r)},function(e,t,r){"use strict";function n(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(a,i){try{var o=t[a](i),u=o.value}catch(e){return void r(e)}if(!o.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}return n("next")})}}function a(e,t,r){v.nextTick(function(){return e(t,r)})}function i(e,t){if(s.isArray(t))for(var r=0;r]*?>|"[^"]*?"|[^,])+/g,p=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,d=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,h={headers:{accept:"application/ld+json, application/json"}},v={};e.exports=v,v.IdentifierIssuer=c;var y="function"==typeof setImmediate&&setImmediate,g=y?function(e){return y(e)}:function(e){return setTimeout(e,0)};"object"===("undefined"==typeof process?"undefined":o(process))&&"function"==typeof process.nextTick?v.nextTick=process.nextTick:v.nextTick=g,v.setImmediate=y?g:v.nextTick,v.clone=function(e){if(e&&"object"===(void 0===e?"undefined":o(e))){var t=void 0;if(s.isArray(e)){t=[];for(var r=0;r0&&void 0!==arguments[0]?arguments[0]:{};if(Object.keys(e).some(function(e){return"accept"===e.toLowerCase()}))throw new RangeError('Accept header may not be specified; only "'+h.headers.accept+'" is supported.');return Object.assign({Accept:h.headers.accept},e)},v.parseLinkHeader=function(e){for(var t={},r=e.match(f),n=0;n0}return!1},v.hasValue=function(e,t,r){if(v.hasProperty(e,t)){var n=e[t],a=u.isList(n);if(s.isArray(n)||a){a&&(n=n["@list"]);for(var i=0;i1||!("@id"in e)}return!1},a.isSubjectReference=function(e){return n.isObject(e)&&1===Object.keys(e).length&&"@id"in e},a.isValue=function(e){return n.isObject(e)&&"@value"in e},a.isList=function(e){return n.isObject(e)&&"@list"in e},a.isGraph=function(e){return n.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter(function(e){return"@id"!==e&&"@index"!==e}).length},a.isSimpleGraph=function(e){return a.isGraph(e)&&!("@id"in e)},a.isBlankNode=function(e){return!!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 n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}e.exports=function(e){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"An unspecified JSON-LD error occurred.",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"jsonld.Error",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};n(this,t);var o=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return o.name=r,o.message=e,o.details=i,o}return i(t,e),t}(Error)},function(e,t,r){var n=r(1),a=r(2),i=r(10),o=r(16),u=r(28),s=function(e,t,r){var c,l,f,p,d=e&s.F,h=e&s.G,v=e&s.S,y=e&s.P,g=e&s.B,m=h?n:v?n[t]||(n[t]={}):(n[t]||{}).prototype,b=h?a:a[t]||(a[t]={}),x=b.prototype||(b.prototype={});h&&(r=t);for(c in r)l=!d&&m&&void 0!==m[c],f=(l?m:r)[c],p=g&&l?u(f,n):y&&"function"==typeof f?u(Function.call,f):f,m&&o(m,c,f,e&s.U),b[c]!=f&&i(b,c,p),y&&x[c]!=f&&(x[c]=f)};n.core=a,s.F=1,s.G=2,s.S=4,s.P=8,s.B=16,s.W=32,s.U=64,s.R=128,e.exports=s},function(e,t,r){var n=r(9);e.exports=function(e){if(!n(e))throw TypeError(e+" is not an object!");return e}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,r){var n=r(11),a=r(27);e.exports=r(12)?function(e,t,r){return n.f(e,t,a(1,r))}:function(e,t,r){return e[t]=r,e}},function(e,t,r){var n=r(8),a=r(51),i=r(35),o=Object.defineProperty;t.f=r(12)?Object.defineProperty:function(e,t,r){if(n(e),t=i(t,!0),n(r),a)try{return o(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(e[t]=r.value),e}},function(e,t,r){e.exports=!r(19)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,r){"use strict";function n(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(a,i){try{var o=t[a](i),u=o.value}catch(e){return void r(e)}if(!o.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}return n("next")})}}function a(e,t,r){try{return e(t,r)}catch(e){process.nextTick(function(){throw e})}}var 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},o={};e.exports=o;var u="function"==typeof setImmediate&&setImmediate,s=u?function(e){return u(e)}:function(e){return setTimeout(e,0)};"object"===("undefined"==typeof process?"undefined":i(process))&&"function"==typeof process.nextTick?o.nextTick=process.nextTick:o.nextTick=s,o.setImmediate=u?s:o.nextTick,o.clone=function(e){if(e&&"object"===(void 0===e?"undefined":i(e))){var t=void 0;if(Array.isArray(e)){t=[];for(var r=0;rb)){e.next=2;break}throw new s("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"loading remote context failed",max:b});case 2:return h={},Object.keys(u).forEach(function(e){!1!==u[e]&&(h[e]=u[e])}),a(t,h,!1,r.base),v=Object.keys(h).filter(function(e){return!1===h[e]}),e.abrupt("return",Promise.all(v.map(function(){var e=n(regeneratorRuntime.mark(function e(n){var u,v,g;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(n in i)){e.next=2;break}throw new s("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"recursive context inclusion",url:n});case 2:return u=o.clone(i),u[n]=!0,v=void 0,g=void 0,e.prev=6,e.next=9,d(n);case 9:v=e.sent,g=v.document||null,p(g)&&(g=JSON.parse(g)),e.next=17;break;case 14:throw e.prev=14,e.t0=e.catch(6),new s("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:n,cause:e.t0});case 17:if(f(g)){e.next=19;break}throw new s("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:n});case 19:return g="@context"in g?{"@context":g["@context"]}:{"@context":{}},v.contextUrl&&(l(g["@context"])||(g["@context"]=[g["@context"]]),g["@context"].push(v.contextUrl)),e.next=23,c(g,u,d);case 23:h[n]=g["@context"],a(t,h,!0,r.base);case 25:case"end":return e.stop()}},e,y,[[6,14]])}));return function(t){return e.apply(this,arguments)}}())));case 7:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}();return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=o.normalizeDocumentLoader(r.documentLoader),u={},e.next=4,c(t,{},i);case 4:return e.abrupt("return",t);case 5:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}(),o=r(3),u=r(132),s=r(6),c=r(4),l=c.isArray,f=c.isObject,p=c.isString,d=c.isUndefined,h=r(26),v=h.isAbsolute,y=h.isRelative,g=h.prependBase,m=h.parse,b=10,x={};e.exports=x,x.cache=new u,x.process=function(e){var t=e.activeCtx,r=e.localCtx,n=e.options;f(r)&&"@context"in r&&l(r["@context"])&&(r=r["@context"]);var a=l(r)?r:[r];if(0===a.length)return t.clone();for(var i=t,o=0;o=o.length?"":o[n],u in i?i[u].push(a[s]):i[u]=[a[s]];for(var c in i)""!==c&&r(i,c,n+1)}function n(e,t,r){r in t||(t[r]=e)}function a(){var e={};return e["@base"]=this["@base"],e.mappings=o.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,"@language"in this&&(e["@language"]=this["@language"]),"@vocab"in this&&(e["@vocab"]=this["@vocab"]),e}return{"@base":m(e.base||""),processingMode:e.processingMode,mappings:{},inverse:null,getInverse:t,clone:a}},x.getContextValue=function(e,t,r){if(null===t)return null;if(e.mappings[t]){var n=e.mappings[t];if(d(r))return n;if(r in n)return n[r]}return"@language"===r&&r in e?e[r]:null},x.getAllContexts=function(){var e=n(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",i(t,r));case 1:case"end":return e.stop()}},e,void 0)}));return function(t,r){return e.apply(this,arguments)}}(),x.processingMode=function(e,t){return t.toString()>="1.1"?e.processingMode&&e.processingMode>="json-ld-"+t.toString():!e.processingMode||"json-ld-1.0"===e.processingMode},x.isKeyword=function(e){if(!p(e))return!1;switch(e){case"@base":case"@container":case"@context":case"@default":case"@embed":case"@explicit":case"@graph":case"@id":case"@index":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1}},function(e,t,r){var n=r(1),a=r(10),i=r(13),o=r(20)("src"),u=Function.toString,s=(""+u).split("toString");r(2).inspectSource=function(e){return u.call(e)},(e.exports=function(e,t,r,u){var c="function"==typeof r;c&&(i(r,"name")||a(r,"name",t)),e[t]!==r&&(c&&(i(r,o)||a(r,o,e[t]?""+e[t]:s.join(String(t)))),e===n?e[t]=r:u?e[t]?e[t]=r:a(e,t,r):(delete e[t],a(e,t,r)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[o]||u.call(this)})},function(e,t,r){var n=r(53),a=r(30);e.exports=function(e){return n(a(e))}},function(e,t){var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t){e.exports=function(e){try{return!!e()}catch(e){return!0}}},function(e,t){var r=0,n=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+n).toString(36))}},function(e,t){e.exports=!1},function(e,t,r){var n=r(55),a=r(40);e.exports=Object.keys||function(e){return n(e,a)}},function(e,t){e.exports={}},function(e,t){e.exports={options:{usePureJavaScript:!1}}},function(e,t,r){"use strict";var n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",a="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_OBJECT:n+"object",RDF_LANGSTRING:n+"langString",XSD:a,XSD_BOOLEAN:a+"boolean",XSD_DOUBLE:a+"double",XSD_INTEGER:a+"integer",XSD_STRING:a+"string"}},function(e,t,r){"use strict";var n=r(4),a={};e.exports=a,a.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},a.parse=function(e,t){for(var r={},n=a.parsers[t||"full"],i=n.regex.exec(e),o=n.keys.length;o--;)r[n.keys[o]]=void 0===i[o]?null:i[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=a.removeDotSegments(r.path),r},a.prependBase=function(e,t){if(null===e)return t;if(-1!==t.indexOf(":"))return t;n.isString(e)&&(e=a.parse(e||""));var r=a.parse(t),i={protocol:e.protocol||""};if(null!==r.authority)i.authority=r.authority,i.path=r.path,i.query=r.query;else if(i.authority=e.authority,""===r.path)i.path=e.path,null!==r.query?i.query=r.query:i.query=e.query;else{if(0===r.path.indexOf("/"))i.path=r.path;else{var o=e.path;o=o.substr(0,o.lastIndexOf("/")+1),o.length>0&&"/"!==o.substr(-1)&&(o+="/"),o+=r.path,i.path=o}i.query=r.query}""!==r.path&&(i.path=a.removeDotSegments(i.path));var u=i.protocol;return null!==i.authority&&(u+="//"+i.authority),u+=i.path,null!==i.query&&(u+="?"+i.query),null!==r.fragment&&(u+="#"+r.fragment),""===u&&(u="./"),u},a.removeBase=function(e,t){if(null===e)return t;n.isString(e)&&(e=a.parse(e||""));var r="";if(""!==e.href?r+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(r+="//"),0!==t.indexOf(r))return t;for(var i=a.parse(t.substr(r.length)),o=e.normalizedPath.split("/"),u=i.normalizedPath.split("/"),s=i.fragment||i.query?0:1;o.length>0&&u.length>s&&o[0]===u[0];)o.shift(),u.shift();var c="";if(o.length>0){o.pop();for(var l=0;l0;){var n=t.shift(),a=0===t.length;"."!==n?".."!==n?r.push(n):(r.pop(),a&&r.push("")):a&&r.push("")}return r.length>0&&""!==r[0]&&r.unshift(""),1===r.length&&""===r[0]?"/":r.join("/")};var i=/^([A-Za-z][A-Za-z0-9+-.]*|_):/;a.isAbsolute=function(e){return n.isString(e)&&i.test(e)},a.isRelative=function(e){return n.isString(e)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,r){var n=r(29);e.exports=function(e,t,r){if(n(e),void 0===t)return e;switch(r){case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,a){return e.call(t,r,n,a)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,r){var n=r(11).f,a=r(13),i=r(0)("toStringTag");e.exports=function(e,t,r){e&&!a(e=r?e:e.prototype,i)&&n(e,i,{configurable:!0,value:t})}},function(e,t,r){"use strict";var n=r(15),a=n.isKeyword,i=r(5),o=r(4),u=r(3),s=r(6),c={};e.exports=c,c.createMergedNodeMap=function(e,t){t=t||{};var r=t.issuer||new u.IdentifierIssuer("_:b"),n={"@default":{}};return c.createNodeMap(e,n,"@default",r),c.mergeNodeMaps(n)},c.createNodeMap=function(e,t,r,n,l,f){if(o.isArray(e))for(var p=0;p0?a(n(e),9007199254740991):0}},function(e,t){var r=Math.ceil,n=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?n:r)(e)}},function(e,t,r){var n=r(2),a=r(1),i=a["__core-js_shared__"]||(a["__core-js_shared__"]={});(e.exports=function(e,t){return i[e]||(i[e]=void 0!==t?t:{})})("versions",[]).push({version:n.version,mode:r(21)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(e,t,r){var n=r(38)("keys"),a=r(20);e.exports=function(e){return n[e]||(n[e]=a(e))}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t){t.f=Object.getOwnPropertySymbols},function(e,t,r){var n=r(18),a=r(0)("toStringTag"),i="Arguments"==n(function(){return arguments}()),o=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,r,u;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=o(t=Object(e),a))?r:i?n(t):"Object"==(u=n(t))&&"function"==typeof t.callee?"Arguments":u}},function(e,t,r){"use strict";function n(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=a(t),this.reject=a(r)}var a=r(29);e.exports.f=function(e){return new n(e)}},function(e,t,r){var n=r(1),a=r(2),i=r(21),o=r(65),u=r(11).f;e.exports=function(e){var t=a.Symbol||(a.Symbol=i?{}:n.Symbol||{});"_"==e.charAt(0)||e in t||u(t,e,{value:o.f(e)})}},function(e,t,r){"use strict";function n(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(a,i){try{var o=t[a](i),u=o.value}catch(e){return void r(e)}if(!o.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}return n("next")})}}var a=r(14),i=r(68),o=r(126),u=r(72),s=r(127),c=void 0;try{c=r(128)("urdna2015")}catch(e){}var l={};e.exports=l,l.NQuads=r(48),l.IdentifierIssuer=r(46),l.canonize=a.callbackify(function(){var e=n(regeneratorRuntime.mark(function e(t,r){var n,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=void 0,a=new Promise(function(e,t){n=function(r,n){if(r)return t(r);e(n)}}),Array.isArray(t)||(t=l.NQuads.legacyDatasetToQuads(t)),"URDNA2015"!==r.algorithm){e.next=7;break}c&&!r.usePureJavaScript?c.main({dataset:t},n):new i(r).main(t,n),e.next=12;break;case 7:if("URGNA2012"!==r.algorithm){e.next=11;break}new o(r).main(t,n),e.next=12;break;case 11:throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+r.algorithm);case 12:return e.abrupt("return",a);case 13:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()),l.canonizeSync=function(e,t){if(Array.isArray(e)||(e=l.NQuads.legacyDatasetToQuads(e)),"URDNA2015"===t.algorithm)return c&&!t.usePureJavaScript?c.mainSync({dataset:e}):new u(t).main(e);if("URGNA2012"===t.algorithm)return new s(t).main(e);throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var a=function(){function e(e,t){for(var r=0;r]*)>)|(_:(?:[A-Za-z0-9]+)))[ \\t]+(?:<([^:]+:[^>]*)>)[ \\t]+(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z0-9]+))|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<([^:]+:[^>]*)>))|(?:@([a-z]+(?:-[a-z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<([^:]+:[^>]*)>)|(_:(?:[A-Za-z0-9]+)))[ \\t]*\\.))[ \\t]*$')}(),e.exports=function(){function e(){n(this,e)}return i(e,null,[{key:"parse",value:function(e){var t=[],r={},n=e.split(c.eoln),i=0,l=!0,f=!1,p=void 0;try{for(var d,h=n[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var v=d.value;if(i++,!c.empty.test(v)){var y=v.match(c.quad);if(null===y)throw new Error("N-Quads parse error on line "+i+".");var g={};if(o.isUndefined(y[1])?g.subject={termType:"BlankNode",value:y[2]}:g.subject={termType:"NamedNode",value:y[1]},g.predicate={termType:"NamedNode",value:y[3]},o.isUndefined(y[4]))if(o.isUndefined(y[5])){g.object={termType:"Literal",value:void 0,datatype:{termType:"NamedNode"}},o.isUndefined(y[7])?o.isUndefined(y[8])?g.object.datatype.value=s:(g.object.datatype.value=u,g.object.language=y[8]):g.object.datatype.value=y[7];var m=y[6].replace(/\\"/g,'"').replace(/\\t/g,"\t").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\\\/g,"\\");g.object.value=m}else g.object={termType:"BlankNode",value:y[5]};else g.object={termType:"NamedNode",value:y[4]};if(o.isUndefined(y[9])?o.isUndefined(y[10])?g.graph={termType:"DefaultGraph",value:""}:g.graph={termType:"BlankNode",value:y[10]}:g.graph={termType:"NamedNode",value:y[9]},g.graph.value in r){var b=!0,x=r[g.graph.value],w=!0,S=!1,k=void 0;try{for(var j,I=x[Symbol.iterator]();!(w=(j=I.next()).done);w=!0){if(a(j.value,g)){b=!1;break}}}catch(e){S=!0,k=e}finally{try{!w&&I.return&&I.return()}finally{if(S)throw k}}b&&(x.push(g),t.push(g))}else r[g.graph.value]=[g],t.push(g)}}}catch(e){f=!0,p=e}finally{try{!l&&h.return&&h.return()}finally{if(f)throw p}}return t}},{key:"serialize",value:function(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));var r=[],n=!0,a=!1,i=void 0;try{for(var o,u=t[Symbol.iterator]();!(n=(o=u.next()).done);n=!0){var s=o.value;r.push(e.serializeQuad(s))}}catch(e){a=!0,i=e}finally{try{!n&&u.return&&u.return()}finally{if(a)throw i}}return r.sort().join("")}},{key:"serializeQuad",value:function(e){var t=e.subject,r=e.predicate,n=e.object,a=e.graph,i="";if([t,r].forEach(function(e){"NamedNode"===e.termType?i+="<"+e.value+">":i+=e.value,i+=" "}),"NamedNode"===n.termType)i+="<"+n.value+">";else if("BlankNode"===n.termType)i+=n.value;else{var o=n.value.replace(/\\/g,"\\\\").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\"/g,'\\"');i+='"'+o+'"',n.datatype.value===u?n.language&&(i+="@"+n.language):n.datatype.value!==s&&(i+="^^<"+n.datatype.value+">")}return"NamedNode"===a.termType?i+=" <"+a.value+">":"BlankNode"===a.termType&&(i+=" "+a.value),i+=" .\n"}},{key:"legacyDatasetToQuads",value:function(e){var t=[],r={"blank node":"BlankNode",IRI:"NamedNode",literal:"Literal"};for(var n in e)!function(n){e[n].forEach(function(e){var a={};for(var i in e){var o=e[i],c={termType:r[o.type],value:o.value};"Literal"===c.termType&&(c.datatype={termType:"NamedNode"},"datatype"in o&&(c.datatype.value=o.datatype),"language"in o?("datatype"in o||(c.datatype.value=u),c.language=o.language):"datatype"in o||(c.datatype.value=s)),a[i]=c}a.graph="@default"===n?{termType:"DefaultGraph",value:""}:{termType:n.startsWith("_:")?"BlankNode":"NamedNode",value:n},t.push(a)})}(n);return t}}]),e}()},function(e,t,r){"use strict"},function(e,t,r){"use strict";function n(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){function n(a,i){try{var o=t[a](i),u=o.value}catch(e){return void r(e)}if(!o.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}return n("next")})}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var r=0;rl;)if((u=s[l++])!=u)return!0}else for(;c>l;l++)if((e||l in s)&&s[l]===r)return e||l||0;return!e&&-1}}},function(e,t,r){var n=r(18);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==n(e)?e.split(""):Object(e)}},function(e,t,r){var n=r(0)("unscopables"),a=Array.prototype;void 0==a[n]&&r(10)(a,n,{}),e.exports=function(e){a[n][e]=!0}},function(e,t,r){var n=r(13),a=r(17),i=r(52)(!1),o=r(39)("IE_PROTO");e.exports=function(e,t){var r,u=a(e),s=0,c=[];for(r in u)r!=o&&n(u,r)&&c.push(r);for(;t.length>s;)n(u,r=t[s++])&&(~i(c,r)||c.push(r));return c}},function(e,t,r){var n=r(30);e.exports=function(e){return Object(n(e))}},function(e,t,r){"use strict";var n=r(42),a={};a[r(0)("toStringTag")]="z",a+""!="[object z]"&&r(16)(Object.prototype,"toString",function(){return"[object "+n(this)+"]"},!0)},function(e,t,r){"use strict";var n=r(21),a=r(7),i=r(16),o=r(10),u=r(23),s=r(84),c=r(32),l=r(86),f=r(0)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};e.exports=function(e,t,r,h,v,y,g){s(r,t,h);var m,b,x,w=function(e){if(!p&&e in I)return I[e];switch(e){case"keys":case"values":return function(){return new r(this,e)}}return function(){return new r(this,e)}},S=t+" Iterator",k="values"==v,j=!1,I=e.prototype,O=I[f]||I["@@iterator"]||v&&I[v],L=O||w(v),N=v?k?w("entries"):L:void 0,C="Array"==t?I.entries||O:O;if(C&&(x=l(C.call(new e)))!==Object.prototype&&x.next&&(c(x,S,!0),n||"function"==typeof x[f]||o(x,f,d)),k&&O&&"values"!==O.name&&(j=!0,L=function(){return O.call(this)}),n&&!g||!p&&!j&&I[f]||o(I,f,L),u[t]=L,u[S]=d,v)if(m={values:k?L:w("values"),keys:y?L:w("keys"),entries:N},g)for(b in m)b in I||i(I,b,m[b]);else a(a.P+a.F*(p||j),t,m);return m}},function(e,t,r){var n=r(8),a=r(85),i=r(40),o=r(39)("IE_PROTO"),u=function(){},s=function(){var e,t=r(34)("iframe"),n=i.length;for(t.style.display="none",r(60).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("