@ulb-darmstadt/shacl-form
Version:
SHACL form generator
7 lines • 740 kB
JavaScript
var kr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ru(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function iu(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function i(){var n=!1;try{n=this instanceof i}catch{}return n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(i){var n=Object.getOwnPropertyDescriptor(r,i);Object.defineProperty(t,i,n.get?n:{enumerable:!0,get:function(){return r[i]}})}),t}var gn={},qr={},Qa;function nu(){if(Qa)return qr;Qa=1,qr.byteLength=s,qr.toByteArray=l,qr.fromByteArray=v;for(var r=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=i.length;n<o;++n)r[n]=i[n],e[i.charCodeAt(n)]=n;e[45]=62,e[95]=63;function a(g){var y=g.length;if(y%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=g.indexOf("=");k===-1&&(k=y);var x=k===y?0:4-k%4;return[k,x]}function s(g){var y=a(g),k=y[0],x=y[1];return(k+x)*3/4-x}function d(g,y,k){return(y+k)*3/4-k}function l(g){var y,k=a(g),x=k[0],_=k[1],E=new t(d(g,x,_)),m=0,f=_>0?x-4:x,b;for(b=0;b<f;b+=4)y=e[g.charCodeAt(b)]<<18|e[g.charCodeAt(b+1)]<<12|e[g.charCodeAt(b+2)]<<6|e[g.charCodeAt(b+3)],E[m++]=y>>16&255,E[m++]=y>>8&255,E[m++]=y&255;return _===2&&(y=e[g.charCodeAt(b)]<<2|e[g.charCodeAt(b+1)]>>4,E[m++]=y&255),_===1&&(y=e[g.charCodeAt(b)]<<10|e[g.charCodeAt(b+1)]<<4|e[g.charCodeAt(b+2)]>>2,E[m++]=y>>8&255,E[m++]=y&255),E}function c(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function u(g,y,k){for(var x,_=[],E=y;E<k;E+=3)x=(g[E]<<16&16711680)+(g[E+1]<<8&65280)+(g[E+2]&255),_.push(c(x));return _.join("")}function v(g){for(var y,k=g.length,x=k%3,_=[],E=16383,m=0,f=k-x;m<f;m+=E)_.push(u(g,m,m+E>f?f:m+E));return x===1?(y=g[k-1],_.push(r[y>>2]+r[y<<4&63]+"==")):x===2&&(y=(g[k-2]<<8)+g[k-1],_.push(r[y>>10]+r[y>>4&63]+r[y<<2&63]+"=")),_.join("")}return qr}var ji={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Ja;function ou(){return Ja||(Ja=1,ji.read=function(r,e,t,i,n){var o,a,s=n*8-i-1,d=(1<<s)-1,l=d>>1,c=-7,u=t?n-1:0,v=t?-1:1,g=r[e+u];for(u+=v,o=g&(1<<-c)-1,g>>=-c,c+=s;c>0;o=o*256+r[e+u],u+=v,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;c>0;a=a*256+r[e+u],u+=v,c-=8);if(o===0)o=1-l;else{if(o===d)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,i),o=o-l}return(g?-1:1)*a*Math.pow(2,o-i)},ji.write=function(r,e,t,i,n,o){var a,s,d,l=o*8-n-1,c=(1<<l)-1,u=c>>1,v=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=i?0:o-1,y=i?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(d=Math.pow(2,-a))<1&&(a--,d*=2),a+u>=1?e+=v/d:e+=v*Math.pow(2,1-u),e*d>=2&&(a++,d/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(e*d-1)*Math.pow(2,n),a=a+u):(s=e*Math.pow(2,u-1)*Math.pow(2,n),a=0));n>=8;r[t+g]=s&255,g+=y,s/=256,n-=8);for(a=a<<n|s,l+=n;l>0;r[t+g]=a&255,g+=y,a/=256,l-=8);r[t+g-y]|=k*128}),ji}/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/var Ka;function Dt(){return Ka||(Ka=1,function(r){const e=nu(),t=ou(),i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=s,r.SlowBuffer=E,r.INSPECT_MAX_BYTES=50;const n=2147483647;r.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=o(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.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.");function o(){try{const S=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(S,p),S.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(S){if(S>n)throw new RangeError('The value "'+S+'" is invalid for option "size"');const p=new Uint8Array(S);return Object.setPrototypeOf(p,s.prototype),p}function s(S,p,h){if(typeof S=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(S)}return d(S,p,h)}s.poolSize=8192;function d(S,p,h){if(typeof S=="string")return v(S,p);if(ArrayBuffer.isView(S))return y(S);if(S==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S);if(le(S,ArrayBuffer)||S&&le(S.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(le(S,SharedArrayBuffer)||S&&le(S.buffer,SharedArrayBuffer)))return k(S,p,h);if(typeof S=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const C=S.valueOf&&S.valueOf();if(C!=null&&C!==S)return s.from(C,p,h);const Q=x(S);if(Q)return Q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof S[Symbol.toPrimitive]=="function")return s.from(S[Symbol.toPrimitive]("string"),p,h);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof S)}s.from=function(S,p,h){return d(S,p,h)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(S){if(typeof S!="number")throw new TypeError('"size" argument must be of type number');if(S<0)throw new RangeError('The value "'+S+'" is invalid for option "size"')}function c(S,p,h){return l(S),S<=0?a(S):p!==void 0?typeof h=="string"?a(S).fill(p,h):a(S).fill(p):a(S)}s.alloc=function(S,p,h){return c(S,p,h)};function u(S){return l(S),a(S<0?0:_(S)|0)}s.allocUnsafe=function(S){return u(S)},s.allocUnsafeSlow=function(S){return u(S)};function v(S,p){if((typeof p!="string"||p==="")&&(p="utf8"),!s.isEncoding(p))throw new TypeError("Unknown encoding: "+p);const h=m(S,p)|0;let C=a(h);const Q=C.write(S,p);return Q!==h&&(C=C.slice(0,Q)),C}function g(S){const p=S.length<0?0:_(S.length)|0,h=a(p);for(let C=0;C<p;C+=1)h[C]=S[C]&255;return h}function y(S){if(le(S,Uint8Array)){const p=new Uint8Array(S);return k(p.buffer,p.byteOffset,p.byteLength)}return g(S)}function k(S,p,h){if(p<0||S.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(S.byteLength<p+(h||0))throw new RangeError('"length" is outside of buffer bounds');let C;return p===void 0&&h===void 0?C=new Uint8Array(S):h===void 0?C=new Uint8Array(S,p):C=new Uint8Array(S,p,h),Object.setPrototypeOf(C,s.prototype),C}function x(S){if(s.isBuffer(S)){const p=_(S.length)|0,h=a(p);return h.length===0||S.copy(h,0,0,p),h}if(S.length!==void 0)return typeof S.length!="number"||Re(S.length)?a(0):g(S);if(S.type==="Buffer"&&Array.isArray(S.data))return g(S.data)}function _(S){if(S>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return S|0}function E(S){return+S!=S&&(S=0),s.alloc(+S)}s.isBuffer=function(p){return p!=null&&p._isBuffer===!0&&p!==s.prototype},s.compare=function(p,h){if(le(p,Uint8Array)&&(p=s.from(p,p.offset,p.byteLength)),le(h,Uint8Array)&&(h=s.from(h,h.offset,h.byteLength)),!s.isBuffer(p)||!s.isBuffer(h))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(p===h)return 0;let C=p.length,Q=h.length;for(let se=0,ue=Math.min(C,Q);se<ue;++se)if(p[se]!==h[se]){C=p[se],Q=h[se];break}return C<Q?-1:Q<C?1:0},s.isEncoding=function(p){switch(String(p).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}},s.concat=function(p,h){if(!Array.isArray(p))throw new TypeError('"list" argument must be an Array of Buffers');if(p.length===0)return s.alloc(0);let C;if(h===void 0)for(h=0,C=0;C<p.length;++C)h+=p[C].length;const Q=s.allocUnsafe(h);let se=0;for(C=0;C<p.length;++C){let ue=p[C];if(le(ue,Uint8Array))se+ue.length>Q.length?(s.isBuffer(ue)||(ue=s.from(ue)),ue.copy(Q,se)):Uint8Array.prototype.set.call(Q,ue,se);else if(s.isBuffer(ue))ue.copy(Q,se);else throw new TypeError('"list" argument must be an Array of Buffers');se+=ue.length}return Q};function m(S,p){if(s.isBuffer(S))return S.length;if(ArrayBuffer.isView(S)||le(S,ArrayBuffer))return S.byteLength;if(typeof S!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof S);const h=S.length,C=arguments.length>2&&arguments[2]===!0;if(!C&&h===0)return 0;let Q=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return h;case"utf8":case"utf-8":return he(S).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return h*2;case"hex":return h>>>1;case"base64":return ce(S).length;default:if(Q)return C?-1:he(S).length;p=(""+p).toLowerCase(),Q=!0}}s.byteLength=m;function f(S,p,h){let C=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((h===void 0||h>this.length)&&(h=this.length),h<=0)||(h>>>=0,p>>>=0,h<=p))return"";for(S||(S="utf8");;)switch(S){case"hex":return Y(this,p,h);case"utf8":case"utf-8":return j(this,p,h);case"ascii":return Z(this,p,h);case"latin1":case"binary":return F(this,p,h);case"base64":return A(this,p,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,p,h);default:if(C)throw new TypeError("Unknown encoding: "+S);S=(S+"").toLowerCase(),C=!0}}s.prototype._isBuffer=!0;function b(S,p,h){const C=S[p];S[p]=S[h],S[h]=C}s.prototype.swap16=function(){const p=this.length;if(p%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let h=0;h<p;h+=2)b(this,h,h+1);return this},s.prototype.swap32=function(){const p=this.length;if(p%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let h=0;h<p;h+=4)b(this,h,h+3),b(this,h+1,h+2);return this},s.prototype.swap64=function(){const p=this.length;if(p%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let h=0;h<p;h+=8)b(this,h,h+7),b(this,h+1,h+6),b(this,h+2,h+5),b(this,h+3,h+4);return this},s.prototype.toString=function(){const p=this.length;return p===0?"":arguments.length===0?j(this,0,p):f.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(p){if(!s.isBuffer(p))throw new TypeError("Argument must be a Buffer");return this===p?!0:s.compare(this,p)===0},s.prototype.inspect=function(){let p="";const h=r.INSPECT_MAX_BYTES;return p=this.toString("hex",0,h).replace(/(.{2})/g,"$1 ").trim(),this.length>h&&(p+=" ... "),"<Buffer "+p+">"},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(p,h,C,Q,se){if(le(p,Uint8Array)&&(p=s.from(p,p.offset,p.byteLength)),!s.isBuffer(p))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof p);if(h===void 0&&(h=0),C===void 0&&(C=p?p.length:0),Q===void 0&&(Q=0),se===void 0&&(se=this.length),h<0||C>p.length||Q<0||se>this.length)throw new RangeError("out of range index");if(Q>=se&&h>=C)return 0;if(Q>=se)return-1;if(h>=C)return 1;if(h>>>=0,C>>>=0,Q>>>=0,se>>>=0,this===p)return 0;let ue=se-Q,ke=C-h;const Fe=Math.min(ue,ke),je=this.slice(Q,se),De=p.slice(h,C);for(let Ae=0;Ae<Fe;++Ae)if(je[Ae]!==De[Ae]){ue=je[Ae],ke=De[Ae];break}return ue<ke?-1:ke<ue?1:0};function R(S,p,h,C,Q){if(S.length===0)return-1;if(typeof h=="string"?(C=h,h=0):h>2147483647?h=2147483647:h<-2147483648&&(h=-2147483648),h=+h,Re(h)&&(h=Q?0:S.length-1),h<0&&(h=S.length+h),h>=S.length){if(Q)return-1;h=S.length-1}else if(h<0)if(Q)h=0;else return-1;if(typeof p=="string"&&(p=s.from(p,C)),s.isBuffer(p))return p.length===0?-1:L(S,p,h,C,Q);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?Q?Uint8Array.prototype.indexOf.call(S,p,h):Uint8Array.prototype.lastIndexOf.call(S,p,h):L(S,[p],h,C,Q);throw new TypeError("val must be string, number or Buffer")}function L(S,p,h,C,Q){let se=1,ue=S.length,ke=p.length;if(C!==void 0&&(C=String(C).toLowerCase(),C==="ucs2"||C==="ucs-2"||C==="utf16le"||C==="utf-16le")){if(S.length<2||p.length<2)return-1;se=2,ue/=2,ke/=2,h/=2}function Fe(De,Ae){return se===1?De[Ae]:De.readUInt16BE(Ae*se)}let je;if(Q){let De=-1;for(je=h;je<ue;je++)if(Fe(S,je)===Fe(p,De===-1?0:je-De)){if(De===-1&&(De=je),je-De+1===ke)return De*se}else De!==-1&&(je-=je-De),De=-1}else for(h+ke>ue&&(h=ue-ke),je=h;je>=0;je--){let De=!0;for(let Ae=0;Ae<ke;Ae++)if(Fe(S,je+Ae)!==Fe(p,Ae)){De=!1;break}if(De)return je}return-1}s.prototype.includes=function(p,h,C){return this.indexOf(p,h,C)!==-1},s.prototype.indexOf=function(p,h,C){return R(this,p,h,C,!0)},s.prototype.lastIndexOf=function(p,h,C){return R(this,p,h,C,!1)};function T(S,p,h,C){h=Number(h)||0;const Q=S.length-h;C?(C=Number(C),C>Q&&(C=Q)):C=Q;const se=p.length;C>se/2&&(C=se/2);let ue;for(ue=0;ue<C;++ue){const ke=parseInt(p.substr(ue*2,2),16);if(Re(ke))return ue;S[h+ue]=ke}return ue}function B(S,p,h,C){return ge(he(p,S.length-h),S,h,C)}function I(S,p,h,C){return ge(me(p),S,h,C)}function $(S,p,h,C){return ge(ce(p),S,h,C)}function q(S,p,h,C){return ge(J(p,S.length-h),S,h,C)}s.prototype.write=function(p,h,C,Q){if(h===void 0)Q="utf8",C=this.length,h=0;else if(C===void 0&&typeof h=="string")Q=h,C=this.length,h=0;else if(isFinite(h))h=h>>>0,isFinite(C)?(C=C>>>0,Q===void 0&&(Q="utf8")):(Q=C,C=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const se=this.length-h;if((C===void 0||C>se)&&(C=se),p.length>0&&(C<0||h<0)||h>this.length)throw new RangeError("Attempt to write outside buffer bounds");Q||(Q="utf8");let ue=!1;for(;;)switch(Q){case"hex":return T(this,p,h,C);case"utf8":case"utf-8":return B(this,p,h,C);case"ascii":case"latin1":case"binary":return I(this,p,h,C);case"base64":return $(this,p,h,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,p,h,C);default:if(ue)throw new TypeError("Unknown encoding: "+Q);Q=(""+Q).toLowerCase(),ue=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(S,p,h){return p===0&&h===S.length?e.fromByteArray(S):e.fromByteArray(S.slice(p,h))}function j(S,p,h){h=Math.min(S.length,h);const C=[];let Q=p;for(;Q<h;){const se=S[Q];let ue=null,ke=se>239?4:se>223?3:se>191?2:1;if(Q+ke<=h){let Fe,je,De,Ae;switch(ke){case 1:se<128&&(ue=se);break;case 2:Fe=S[Q+1],(Fe&192)===128&&(Ae=(se&31)<<6|Fe&63,Ae>127&&(ue=Ae));break;case 3:Fe=S[Q+1],je=S[Q+2],(Fe&192)===128&&(je&192)===128&&(Ae=(se&15)<<12|(Fe&63)<<6|je&63,Ae>2047&&(Ae<55296||Ae>57343)&&(ue=Ae));break;case 4:Fe=S[Q+1],je=S[Q+2],De=S[Q+3],(Fe&192)===128&&(je&192)===128&&(De&192)===128&&(Ae=(se&15)<<18|(Fe&63)<<12|(je&63)<<6|De&63,Ae>65535&&Ae<1114112&&(ue=Ae))}}ue===null?(ue=65533,ke=1):ue>65535&&(ue-=65536,C.push(ue>>>10&1023|55296),ue=56320|ue&1023),C.push(ue),Q+=ke}return N(C)}const te=4096;function N(S){const p=S.length;if(p<=te)return String.fromCharCode.apply(String,S);let h="",C=0;for(;C<p;)h+=String.fromCharCode.apply(String,S.slice(C,C+=te));return h}function Z(S,p,h){let C="";h=Math.min(S.length,h);for(let Q=p;Q<h;++Q)C+=String.fromCharCode(S[Q]&127);return C}function F(S,p,h){let C="";h=Math.min(S.length,h);for(let Q=p;Q<h;++Q)C+=String.fromCharCode(S[Q]);return C}function Y(S,p,h){const C=S.length;(!p||p<0)&&(p=0),(!h||h<0||h>C)&&(h=C);let Q="";for(let se=p;se<h;++se)Q+=We[S[se]];return Q}function w(S,p,h){const C=S.slice(p,h);let Q="";for(let se=0;se<C.length-1;se+=2)Q+=String.fromCharCode(C[se]+C[se+1]*256);return Q}s.prototype.slice=function(p,h){const C=this.length;p=~~p,h=h===void 0?C:~~h,p<0?(p+=C,p<0&&(p=0)):p>C&&(p=C),h<0?(h+=C,h<0&&(h=0)):h>C&&(h=C),h<p&&(h=p);const Q=this.subarray(p,h);return Object.setPrototypeOf(Q,s.prototype),Q};function U(S,p,h){if(S%1!==0||S<0)throw new RangeError("offset is not uint");if(S+p>h)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(p,h,C){p=p>>>0,h=h>>>0,C||U(p,h,this.length);let Q=this[p],se=1,ue=0;for(;++ue<h&&(se*=256);)Q+=this[p+ue]*se;return Q},s.prototype.readUintBE=s.prototype.readUIntBE=function(p,h,C){p=p>>>0,h=h>>>0,C||U(p,h,this.length);let Q=this[p+--h],se=1;for(;h>0&&(se*=256);)Q+=this[p+--h]*se;return Q},s.prototype.readUint8=s.prototype.readUInt8=function(p,h){return p=p>>>0,h||U(p,1,this.length),this[p]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(p,h){return p=p>>>0,h||U(p,2,this.length),this[p]|this[p+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(p,h){return p=p>>>0,h||U(p,2,this.length),this[p]<<8|this[p+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(p,h){return p=p>>>0,h||U(p,4,this.length),(this[p]|this[p+1]<<8|this[p+2]<<16)+this[p+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(p,h){return p=p>>>0,h||U(p,4,this.length),this[p]*16777216+(this[p+1]<<16|this[p+2]<<8|this[p+3])},s.prototype.readBigUInt64LE=Ee(function(p){p=p>>>0,O(p,"offset");const h=this[p],C=this[p+7];(h===void 0||C===void 0)&&V(p,this.length-8);const Q=h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24,se=this[++p]+this[++p]*2**8+this[++p]*2**16+C*2**24;return BigInt(Q)+(BigInt(se)<<BigInt(32))}),s.prototype.readBigUInt64BE=Ee(function(p){p=p>>>0,O(p,"offset");const h=this[p],C=this[p+7];(h===void 0||C===void 0)&&V(p,this.length-8);const Q=h*2**24+this[++p]*2**16+this[++p]*2**8+this[++p],se=this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+C;return(BigInt(Q)<<BigInt(32))+BigInt(se)}),s.prototype.readIntLE=function(p,h,C){p=p>>>0,h=h>>>0,C||U(p,h,this.length);let Q=this[p],se=1,ue=0;for(;++ue<h&&(se*=256);)Q+=this[p+ue]*se;return se*=128,Q>=se&&(Q-=Math.pow(2,8*h)),Q},s.prototype.readIntBE=function(p,h,C){p=p>>>0,h=h>>>0,C||U(p,h,this.length);let Q=h,se=1,ue=this[p+--Q];for(;Q>0&&(se*=256);)ue+=this[p+--Q]*se;return se*=128,ue>=se&&(ue-=Math.pow(2,8*h)),ue},s.prototype.readInt8=function(p,h){return p=p>>>0,h||U(p,1,this.length),this[p]&128?(255-this[p]+1)*-1:this[p]},s.prototype.readInt16LE=function(p,h){p=p>>>0,h||U(p,2,this.length);const C=this[p]|this[p+1]<<8;return C&32768?C|4294901760:C},s.prototype.readInt16BE=function(p,h){p=p>>>0,h||U(p,2,this.length);const C=this[p+1]|this[p]<<8;return C&32768?C|4294901760:C},s.prototype.readInt32LE=function(p,h){return p=p>>>0,h||U(p,4,this.length),this[p]|this[p+1]<<8|this[p+2]<<16|this[p+3]<<24},s.prototype.readInt32BE=function(p,h){return p=p>>>0,h||U(p,4,this.length),this[p]<<24|this[p+1]<<16|this[p+2]<<8|this[p+3]},s.prototype.readBigInt64LE=Ee(function(p){p=p>>>0,O(p,"offset");const h=this[p],C=this[p+7];(h===void 0||C===void 0)&&V(p,this.length-8);const Q=this[p+4]+this[p+5]*2**8+this[p+6]*2**16+(C<<24);return(BigInt(Q)<<BigInt(32))+BigInt(h+this[++p]*2**8+this[++p]*2**16+this[++p]*2**24)}),s.prototype.readBigInt64BE=Ee(function(p){p=p>>>0,O(p,"offset");const h=this[p],C=this[p+7];(h===void 0||C===void 0)&&V(p,this.length-8);const Q=(h<<24)+this[++p]*2**16+this[++p]*2**8+this[++p];return(BigInt(Q)<<BigInt(32))+BigInt(this[++p]*2**24+this[++p]*2**16+this[++p]*2**8+C)}),s.prototype.readFloatLE=function(p,h){return p=p>>>0,h||U(p,4,this.length),t.read(this,p,!0,23,4)},s.prototype.readFloatBE=function(p,h){return p=p>>>0,h||U(p,4,this.length),t.read(this,p,!1,23,4)},s.prototype.readDoubleLE=function(p,h){return p=p>>>0,h||U(p,8,this.length),t.read(this,p,!0,52,8)},s.prototype.readDoubleBE=function(p,h){return p=p>>>0,h||U(p,8,this.length),t.read(this,p,!1,52,8)};function K(S,p,h,C,Q,se){if(!s.isBuffer(S))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>Q||p<se)throw new RangeError('"value" argument is out of bounds');if(h+C>S.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(p,h,C,Q){if(p=+p,h=h>>>0,C=C>>>0,!Q){const ke=Math.pow(2,8*C)-1;K(this,p,h,C,ke,0)}let se=1,ue=0;for(this[h]=p&255;++ue<C&&(se*=256);)this[h+ue]=p/se&255;return h+C},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(p,h,C,Q){if(p=+p,h=h>>>0,C=C>>>0,!Q){const ke=Math.pow(2,8*C)-1;K(this,p,h,C,ke,0)}let se=C-1,ue=1;for(this[h+se]=p&255;--se>=0&&(ue*=256);)this[h+se]=p/ue&255;return h+C},s.prototype.writeUint8=s.prototype.writeUInt8=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,1,255,0),this[h]=p&255,h+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,2,65535,0),this[h]=p&255,this[h+1]=p>>>8,h+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,2,65535,0),this[h]=p>>>8,this[h+1]=p&255,h+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,4,4294967295,0),this[h+3]=p>>>24,this[h+2]=p>>>16,this[h+1]=p>>>8,this[h]=p&255,h+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,4,4294967295,0),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4};function X(S,p,h,C,Q){be(p,C,Q,S,h,7);let se=Number(p&BigInt(4294967295));S[h++]=se,se=se>>8,S[h++]=se,se=se>>8,S[h++]=se,se=se>>8,S[h++]=se;let ue=Number(p>>BigInt(32)&BigInt(4294967295));return S[h++]=ue,ue=ue>>8,S[h++]=ue,ue=ue>>8,S[h++]=ue,ue=ue>>8,S[h++]=ue,h}function de(S,p,h,C,Q){be(p,C,Q,S,h,7);let se=Number(p&BigInt(4294967295));S[h+7]=se,se=se>>8,S[h+6]=se,se=se>>8,S[h+5]=se,se=se>>8,S[h+4]=se;let ue=Number(p>>BigInt(32)&BigInt(4294967295));return S[h+3]=ue,ue=ue>>8,S[h+2]=ue,ue=ue>>8,S[h+1]=ue,ue=ue>>8,S[h]=ue,h+8}s.prototype.writeBigUInt64LE=Ee(function(p,h=0){return X(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Ee(function(p,h=0){return de(this,p,h,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(p,h,C,Q){if(p=+p,h=h>>>0,!Q){const Fe=Math.pow(2,8*C-1);K(this,p,h,C,Fe-1,-Fe)}let se=0,ue=1,ke=0;for(this[h]=p&255;++se<C&&(ue*=256);)p<0&&ke===0&&this[h+se-1]!==0&&(ke=1),this[h+se]=(p/ue>>0)-ke&255;return h+C},s.prototype.writeIntBE=function(p,h,C,Q){if(p=+p,h=h>>>0,!Q){const Fe=Math.pow(2,8*C-1);K(this,p,h,C,Fe-1,-Fe)}let se=C-1,ue=1,ke=0;for(this[h+se]=p&255;--se>=0&&(ue*=256);)p<0&&ke===0&&this[h+se+1]!==0&&(ke=1),this[h+se]=(p/ue>>0)-ke&255;return h+C},s.prototype.writeInt8=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,1,127,-128),p<0&&(p=255+p+1),this[h]=p&255,h+1},s.prototype.writeInt16LE=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,2,32767,-32768),this[h]=p&255,this[h+1]=p>>>8,h+2},s.prototype.writeInt16BE=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,2,32767,-32768),this[h]=p>>>8,this[h+1]=p&255,h+2},s.prototype.writeInt32LE=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,4,2147483647,-2147483648),this[h]=p&255,this[h+1]=p>>>8,this[h+2]=p>>>16,this[h+3]=p>>>24,h+4},s.prototype.writeInt32BE=function(p,h,C){return p=+p,h=h>>>0,C||K(this,p,h,4,2147483647,-2147483648),p<0&&(p=4294967295+p+1),this[h]=p>>>24,this[h+1]=p>>>16,this[h+2]=p>>>8,this[h+3]=p&255,h+4},s.prototype.writeBigInt64LE=Ee(function(p,h=0){return X(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Ee(function(p,h=0){return de(this,p,h,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(S,p,h,C,Q,se){if(h+C>S.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("Index out of range")}function G(S,p,h,C,Q){return p=+p,h=h>>>0,Q||H(S,p,h,4),t.write(S,p,h,C,23,4),h+4}s.prototype.writeFloatLE=function(p,h,C){return G(this,p,h,!0,C)},s.prototype.writeFloatBE=function(p,h,C){return G(this,p,h,!1,C)};function W(S,p,h,C,Q){return p=+p,h=h>>>0,Q||H(S,p,h,8),t.write(S,p,h,C,52,8),h+8}s.prototype.writeDoubleLE=function(p,h,C){return W(this,p,h,!0,C)},s.prototype.writeDoubleBE=function(p,h,C){return W(this,p,h,!1,C)},s.prototype.copy=function(p,h,C,Q){if(!s.isBuffer(p))throw new TypeError("argument should be a Buffer");if(C||(C=0),!Q&&Q!==0&&(Q=this.length),h>=p.length&&(h=p.length),h||(h=0),Q>0&&Q<C&&(Q=C),Q===C||p.length===0||this.length===0)return 0;if(h<0)throw new RangeError("targetStart out of bounds");if(C<0||C>=this.length)throw new RangeError("Index out of range");if(Q<0)throw new RangeError("sourceEnd out of bounds");Q>this.length&&(Q=this.length),p.length-h<Q-C&&(Q=p.length-h+C);const se=Q-C;return this===p&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(h,C,Q):Uint8Array.prototype.set.call(p,this.subarray(C,Q),h),se},s.prototype.fill=function(p,h,C,Q){if(typeof p=="string"){if(typeof h=="string"?(Q=h,h=0,C=this.length):typeof C=="string"&&(Q=C,C=this.length),Q!==void 0&&typeof Q!="string")throw new TypeError("encoding must be a string");if(typeof Q=="string"&&!s.isEncoding(Q))throw new TypeError("Unknown encoding: "+Q);if(p.length===1){const ue=p.charCodeAt(0);(Q==="utf8"&&ue<128||Q==="latin1")&&(p=ue)}}else typeof p=="number"?p=p&255:typeof p=="boolean"&&(p=Number(p));if(h<0||this.length<h||this.length<C)throw new RangeError("Out of range index");if(C<=h)return this;h=h>>>0,C=C===void 0?this.length:C>>>0,p||(p=0);let se;if(typeof p=="number")for(se=h;se<C;++se)this[se]=p;else{const ue=s.isBuffer(p)?p:s.from(p,Q),ke=ue.length;if(ke===0)throw new TypeError('The value "'+p+'" is invalid for argument "value"');for(se=0;se<C-h;++se)this[se+h]=ue[se%ke]}return this};const z={};function ee(S,p,h){z[S]=class extends h{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${S}]`,this.stack,delete this.name}get code(){return S}set code(Q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Q,writable:!0})}toString(){return`${this.name} [${S}]: ${this.message}`}}}ee("ERR_BUFFER_OUT_OF_BOUNDS",function(S){return S?`${S} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ee("ERR_INVALID_ARG_TYPE",function(S,p){return`The "${S}" argument must be of type number. Received type ${typeof p}`},TypeError),ee("ERR_OUT_OF_RANGE",function(S,p,h){let C=`The value of "${S}" is out of range.`,Q=h;return Number.isInteger(h)&&Math.abs(h)>2**32?Q=re(String(h)):typeof h=="bigint"&&(Q=String(h),(h>BigInt(2)**BigInt(32)||h<-(BigInt(2)**BigInt(32)))&&(Q=re(Q)),Q+="n"),C+=` It must be ${p}. Received ${Q}`,C},RangeError);function re(S){let p="",h=S.length;const C=S[0]==="-"?1:0;for(;h>=C+4;h-=3)p=`_${S.slice(h-3,h)}${p}`;return`${S.slice(0,h)}${p}`}function pe(S,p,h){O(p,"offset"),(S[p]===void 0||S[p+h]===void 0)&&V(p,S.length-(h+1))}function be(S,p,h,C,Q,se){if(S>h||S<p){const ue=typeof p=="bigint"?"n":"";let ke;throw p===0||p===BigInt(0)?ke=`>= 0${ue} and < 2${ue} ** ${(se+1)*8}${ue}`:ke=`>= -(2${ue} ** ${(se+1)*8-1}${ue}) and < 2 ** ${(se+1)*8-1}${ue}`,new z.ERR_OUT_OF_RANGE("value",ke,S)}pe(C,Q,se)}function O(S,p){if(typeof S!="number")throw new z.ERR_INVALID_ARG_TYPE(p,"number",S)}function V(S,p,h){throw Math.floor(S)!==S?(O(S,h),new z.ERR_OUT_OF_RANGE("offset","an integer",S)):p<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,S)}const oe=/[^+/0-9A-Za-z-_]/g;function fe(S){if(S=S.split("=")[0],S=S.trim().replace(oe,""),S.length<2)return"";for(;S.length%4!==0;)S=S+"=";return S}function he(S,p){p=p||1/0;let h;const C=S.length;let Q=null;const se=[];for(let ue=0;ue<C;++ue){if(h=S.charCodeAt(ue),h>55295&&h<57344){if(!Q){if(h>56319){(p-=3)>-1&&se.push(239,191,189);continue}else if(ue+1===C){(p-=3)>-1&&se.push(239,191,189);continue}Q=h;continue}if(h<56320){(p-=3)>-1&&se.push(239,191,189),Q=h;continue}h=(Q-55296<<10|h-56320)+65536}else Q&&(p-=3)>-1&&se.push(239,191,189);if(Q=null,h<128){if((p-=1)<0)break;se.push(h)}else if(h<2048){if((p-=2)<0)break;se.push(h>>6|192,h&63|128)}else if(h<65536){if((p-=3)<0)break;se.push(h>>12|224,h>>6&63|128,h&63|128)}else if(h<1114112){if((p-=4)<0)break;se.push(h>>18|240,h>>12&63|128,h>>6&63|128,h&63|128)}else throw new Error("Invalid code point")}return se}function me(S){const p=[];for(let h=0;h<S.length;++h)p.push(S.charCodeAt(h)&255);return p}function J(S,p){let h,C,Q;const se=[];for(let ue=0;ue<S.length&&!((p-=2)<0);++ue)h=S.charCodeAt(ue),C=h>>8,Q=h%256,se.push(Q),se.push(C);return se}function ce(S){return e.toByteArray(fe(S))}function ge(S,p,h,C){let Q;for(Q=0;Q<C&&!(Q+h>=p.length||Q>=S.length);++Q)p[Q+h]=S[Q];return Q}function le(S,p){return S instanceof p||S!=null&&S.constructor!=null&&S.constructor.name!=null&&S.constructor.name===p.name}function Re(S){return S!==S}const We=function(){const S="0123456789abcdef",p=new Array(256);for(let h=0;h<16;++h){const C=h*16;for(let Q=0;Q<16;++Q)p[C+Q]=S[h]+S[Q]}return p}();function Ee(S){return typeof BigInt>"u"?Qe:S}function Qe(){throw new Error("BigInt not supported")}}(gn)),gn}var au=Dt();const zr="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Ur="http://www.w3.org/2001/XMLSchema#",Di="http://www.w3.org/2000/10/swap/",Ke={xsd:{decimal:`${Ur}decimal`,boolean:`${Ur}boolean`,double:`${Ur}double`,integer:`${Ur}integer`,string:`${Ur}string`},rdf:{type:`${zr}type`,nil:`${zr}nil`,first:`${zr}first`,rest:`${zr}rest`,langString:`${zr}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Di}reify#forSome`,forAll:`${Di}reify#forAll`},log:{implies:`${Di}log#implies`,isImpliedBy:`${Di}log#isImpliedBy`}},{xsd:Li}=Ke,su=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Ya={"\\":"\\","'":"'",'"':'"',n:`
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},lu=/[\x00-\x20<>\\"\{\}\|\^\`]/,du={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},cu=/$0^/;class uu{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._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const t in this)!(t in du)&&this[t]instanceof RegExp&&(this[t]=cu)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let i=this._input,n=i.length;for(;;){let s,d;for(;s=this._newline.exec(i);)this.comments&&(d=this._comment.exec(s[0]))&&o("comment",d[1],"",this._line,s[0].length),i=i.substr(s[0].length,i.length),n=i.length,this._line++;if(!s&&(s=this._whitespace.exec(i))&&(i=i.substr(s[0].length,i.length)),this._endOfFile.test(i))return t&&(this.comments&&(d=this._comment.exec(i))&&o("comment",d[1],"",this._line,i.length),i=null,o("eof","","",this._line,0)),this._input=i;const l=this._line,c=i[0];let u="",v="",g="",y=null,k=0,x=!1;switch(c){case"^":if(i.length<3)break;if(i[1]==="^"){if(this._previousMarker="^^",i=i.substr(2),i[0]!=="<"){x=!0;break}}else{this._n3Mode&&(k=1,u="^");break}case"<":if(y=this._unescapedIri.exec(i))u="IRI",v=y[1];else if(y=this._iri.exec(i)){if(v=this._unescape(y[1]),v===null||lu.test(v))return a(this);u="IRI"}else i.length>1&&i[1]==="<"?(u="<<",k=2):this._n3Mode&&i.length>1&&i[1]==="="&&(k=2,this._isImpliedBy?(u="abbreviation",v="<"):(u="inverse",v=">"));break;case">":i.length>1&&i[1]===">"&&(u=">>",k=2);break;case"_":((y=this._blank.exec(i))||t&&(y=this._blank.exec(`${i} `)))&&(u="blank",g="_",v=y[1]);break;case'"':if(y=this._simpleQuotedString.exec(i))v=y[1];else if({value:v,matchLength:k}=this._parseLiteral(i),v===null)return a(this);(y!==null||k!==0)&&(u="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(y=this._simpleApostropheString.exec(i))v=y[1];else if({value:v,matchLength:k}=this._parseLiteral(i),v===null)return a(this);(y!==null||k!==0)&&(u="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(y=this._variable.exec(i))&&(u="var",v=y[0]);break;case"@":this._previousMarker==="literal"&&(y=this._langcode.exec(i))?(u="langcode",v=y[1]):(y=this._keyword.exec(i))&&(u=y[0]);break;case".":if(i.length===1?t:i[1]<"0"||i[1]>"9"){u=".",k=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(y=this._number.exec(i)||t&&(y=this._number.exec(`${i} `)))&&(u="literal",v=y[0],g=typeof y[1]=="string"?Li.double:typeof y[2]=="string"?Li.decimal:Li.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(y=this._sparqlKeyword.exec(i))?u=y[0].toUpperCase():x=!0;break;case"f":case"t":(y=this._boolean.exec(i))?(u="literal",v=y[0],g=Li.boolean):x=!0;break;case"a":(y=this._shortPredicates.exec(i))?(u="abbreviation",v="a"):x=!0;break;case"=":this._n3Mode&&i.length>1&&(u="abbreviation",i[1]!==">"?(k=1,v="="):(k=2,v=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(k=1,u=c);break;case"{":!this._lineMode&&i.length>=2&&(i[1]==="|"?(u="{|",k=2):(u=c,k=1));break;case"|":i.length>=2&&i[1]==="}"&&(u="|}",k=2);break;default:x=!0}if(x&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(y=this._prefix.exec(i))?(u="prefix",v=y[1]||""):((y=this._prefixed.exec(i))||t&&(y=this._prefixed.exec(`${i} `)))&&(u="prefixed",g=y[1]||"",v=this._unescape(y[2]))),this._previousMarker==="^^")switch(u){case"prefixed":u="type";break;case"IRI":u="typeIRI";break;default:u=""}if(!u)return t||!/^'''|^"""/.test(i)&&/\n|\r/.test(i)?a(this):this._input=i;const _=k||y[0].length,E=o(u,v,g,l,_);this.previousToken=E,this._previousMarker=u,i=i.substr(_,i.length)}function o(s,d,l,c,u){const v=i?n-i.length:n,g=v+u,y={type:s,value:d,prefix:l,line:c,start:v,end:g};return e(null,y),y}function a(s){e(s._syntaxError(/^\S*/.exec(i)[0]))}}_unescape(e){let t=!1;const i=e.replace(su,(n,o,a,s)=>{if(typeof o=="string")return String.fromCharCode(Number.parseInt(o,16));if(typeof a=="string"){let d=Number.parseInt(a,16);return d<=65535?String.fromCharCode(Number.parseInt(a,16)):String.fromCharCode(55296+((d-=65536)>>10),56320+(d&1023))}return s in Ya?Ya[s]:(t=!0,"")});return t?null:i}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],i=t.length;let n=Math.max(this._literalClosingPos,i);for(;(n=e.indexOf(t,n))>0;){let o=0;for(;e[n-o-1]==="\\";)o++;if(o%2===0){const a=e.substring(i,n),s=a.split(/\r\n|\r|\n/).length-1,d=n+i;if(i===1&&s!==0||i===3&&this._lineMode)break;return this._line+=s,{value:this._unescape(a),matchLength:d}}n++}this._literalClosingPos=e.length-i+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,typeof e=="string")if(this._input=this._readStartingBom(e),typeof t=="function")queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{const i=[];let n;if(this._tokenizeToEnd((o,a)=>o?n=o:i.push(a),!0),n)throw n;return i}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",i=>{this._input!==null&&i.length!==0&&(this._pendingBuffer&&(i=au.Buffer.concat([this._pendingBuffer,i]),this._pendingBuffer=null),i[i.length-1]&128?this._pendingBuffer=i:(typeof this._input>"u"?this._input=this._readStartingBom(typeof i=="string"?i:i.toString()):this._input+=i,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}}const{rdf:fu,xsd:nr}=Ke;let Dr,pu=0;const Ie={namedNode:Wd,blankNode:Xd,variable:Jd,literal:Qd,defaultGraph:gu,quad:ia,triple:ia,fromTerm:ci,fromQuad:Kd};class vt{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof vt?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}let nn=class extends vt{get termType(){return"NamedNode"}},dt=class Vd extends vt{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 nn(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,i=t<e.length?e[t]:"";return i==="^"?e.substr(t+2):i!=="@"?nr.string:fu.langString}equals(e){return e instanceof Vd?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}}}},hu=class extends vt{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},bu=class extends vt{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},mu=class extends vt{constructor(){return super(""),Dr||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};Dr=new mu;function di(r,e,t){if(e=e||Ie,!r)return e.defaultGraph();switch(r[0]){case"?":return e.variable(r.substr(1));case"_":return e.blankNode(r.substr(2));case'"':if(e===Ie)return new dt(r);if(r[r.length-1]==='"')return e.literal(r.substr(1,r.length-2));const i=r.lastIndexOf('"',r.length-1);return e.literal(r.substr(1,i-1),r[i+1]==="@"?r.substr(i+2):e.namedNode(r.substr(i+3)));case"[":r=JSON.parse(r);break;default:if(!t||!Array.isArray(r))return e.namedNode(r)}return e.quad(di(r[0],e,!0),di(r[1],e,!0),di(r[2],e,!0),r[3]&&di(r[3],e,!0))}function Er(r,e){if(typeof r=="string")return r;if(r instanceof vt&&r.termType!=="Quad")return r.id;if(!r)return Dr.id;switch(r.termType){case"NamedNode":return r.value;case"BlankNode":return`_:${r.value}`;case"Variable":return`?${r.value}`;case"DefaultGraph":return"";case"Literal":return`"${r.value}"${r.language?`@${r.language}`:r.datatype&&r.datatype.value!==nr.string?`^^${r.datatype.value}`:""}`;case"Quad":const t=[Er(r.subject,!0),Er(r.predicate,!0),Er(r.object,!0)];return r.graph&&r.graph.termType!=="DefaultGraph"&&t.push(Er(r.graph,!0)),e?t:JSON.stringify(t);default:throw new Error(`Unexpected termType: ${r.termType}`)}}let on=class extends vt{constructor(e,t,i,n){super(""),this._subject=e,this._predicate=t,this._object=i,this._graph=n||Dr}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 Wd(r){return new nn(r)}function Xd(r){return new hu(r||`n3-${pu++}`)}function Qd(r,e){if(typeof e=="string")return new dt(`"${r}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof r=="boolean"?t=nr.boolean:typeof r=="number"&&(Number.isFinite(r)?t=Number.isInteger(r)?nr.integer:nr.double:(t=nr.double,Number.isNaN(r)||(r=r>0?"INF":"-INF")))),t===""||t===nr.string?new dt(`"${r}"`):new dt(`"${r}"^^${t}`)}function Jd(r){return new bu(r)}function gu(){return Dr}function ia(r,e,t,i){return new on(r,e,t,i)}function ci(r){if(r instanceof vt)return r;switch(r.termType){case"NamedNode":return Wd(r.value);case"BlankNode":return Xd(r.value);case"Variable":return Jd(r.value);case"DefaultGraph":return Dr;case"Literal":return Qd(r.value,r.language||r.datatype);case"Quad":return Kd(r);default:throw new Error(`Unexpected termType: ${r.termType}`)}}function Kd(r){if(r instanceof on)return r;if(r.termType!=="Quad")throw new Error(`Unexpected termType: ${r.termType}`);return ia(ci(r.subject),ci(r.predicate),ci(r.object),ci(r.graph))}let Za=0;class Yd{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Zd(this,e.factory);const t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",i=/turtle/.test(t),n=/trig/.test(t),o=/triple/.test(t),a=/quad/.test(t),s=this._n3Mode=/n3/.test(t),d=o||a;(this._supportsNamedGraphs=!(i||s))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||n||o||s),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=t===""||/star|\*$/.test(t),d&&(this._resolveRelativeIRI=l=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new uu({lineMode:d,n3:s,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Za=0}_setBase(e){if(!e)this._base="",this._basePath="";else{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]}}_saveContext(e,t,i,n,o){const a=this._n3Mode;this._contextStack.push({type:e,subject:i,predicate:n,object:o,graph:t,inverse:a?this._inversePredicate:!1,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const i=this._contextStack.pop();if(!i||i.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=i.subject,this._predicate=i.predicate,this._object=i.object,this._graph=i.graph,this._n3Mode&&(this._inversePredicate=i.inverse,this._prefixes._=i.blankPrefix,this._quantified=i.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?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 i;switch(e.type){case"IRI":case"typeIRI":const n=this._resolveIRI(e.value);if(n===null)return this._error("Invalid IRI",e);i=this._factory.namedNode(n);break;case"type":case"prefixed":const o=this._prefixes[e.prefix];if(o===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);i=this._factory.namedNode(o+e.value);break;case"blank":i=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":i=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&i.id in this._quantified&&(i=this._quantified[i.id]),i}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.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._factory.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="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._subject=this._readEntity(e))===void 0)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 this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.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._factory.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-star syntax",e);default:if((this._object=this._readEntity(e))===void 0)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);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?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