prez-lib 4.3.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -0
- package/dist/consts.d.ts +1 -0
- package/dist/prez-lib.js +1329 -1256
- package/dist/prez-lib.umd.cjs +8 -8
- package/dist/service.d.ts +3 -2
- package/dist/store.d.ts +12 -3
- package/dist/types.d.ts +46 -5
- package/package.json +2 -1
package/dist/prez-lib.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(me,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(me=typeof globalThis<"u"?globalThis:me||self,et(me["prez-lib"]={}))})(this,(function(me){"use strict";function et(l){return l.value!==void 0}function kt(l){const e={value:typeof l=="string"?l:l.value,termType:"NamedNode",equals:t=>!!t&&e.termType===t.termType&&e.value===t.value};return typeof l!="string"&&Object.assign(e,l),e}function gt(l){const e={value:typeof l=="string"?l:l.value,termType:"Literal",equals:t=>t&&e.termType===t.termType&&e.value===t.value?e.language!==t.language?!1:e.datatype===t.datatype:!1};return typeof l!="string"&&Object.assign(e,l),e}function yt(l){const e={value:typeof l=="string"?l:l.value,properties:{},termType:"BlankNode",equals:t=>!!t&&e.termType===t.termType&&e.value===t.value&&e.properties===t.properties};return typeof l!="string"&&Object.assign(e,l),e}var Ft={},tt={},xr;function Dn(){if(xr)return tt;xr=1,tt.byteLength=a,tt.toByteArray=h,tt.fromByteArray=j;for(var l=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=r.length;s<o;++s)l[s]=r[s],e[r.charCodeAt(s)]=s;e[45]=62,e[95]=63;function u(B){var A=B.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=B.indexOf("=");v===-1&&(v=A);var y=v===A?0:4-v%4;return[v,y]}function a(B){var A=u(B),v=A[0],y=A[1];return(v+y)*3/4-y}function b(B,A,v){return(A+v)*3/4-v}function h(B){var A,v=u(B),y=v[0],_=v[1],m=new t(b(B,y,_)),w=0,P=_>0?y-4:y,I;for(I=0;I<P;I+=4)A=e[B.charCodeAt(I)]<<18|e[B.charCodeAt(I+1)]<<12|e[B.charCodeAt(I+2)]<<6|e[B.charCodeAt(I+3)],m[w++]=A>>16&255,m[w++]=A>>8&255,m[w++]=A&255;return _===2&&(A=e[B.charCodeAt(I)]<<2|e[B.charCodeAt(I+1)]>>4,m[w++]=A&255),_===1&&(A=e[B.charCodeAt(I)]<<10|e[B.charCodeAt(I+1)]<<4|e[B.charCodeAt(I+2)]>>2,m[w++]=A>>8&255,m[w++]=A&255),m}function x(B){return l[B>>18&63]+l[B>>12&63]+l[B>>6&63]+l[B&63]}function T(B,A,v){for(var y,_=[],m=A;m<v;m+=3)y=(B[m]<<16&16711680)+(B[m+1]<<8&65280)+(B[m+2]&255),_.push(x(y));return _.join("")}function j(B){for(var A,v=B.length,y=v%3,_=[],m=16383,w=0,P=v-y;w<P;w+=m)_.push(T(B,w,w+m>P?P:w+m));return y===1?(A=B[v-1],_.push(l[A>>2]+l[A<<4&63]+"==")):y===2&&(A=(B[v-2]<<8)+B[v-1],_.push(l[A>>10]+l[A>>4&63]+l[A<<2&63]+"=")),_.join("")}return tt}var wt={};var Er;function $n(){return Er||(Er=1,wt.read=function(l,e,t,r,s){var o,u,a=s*8-r-1,b=(1<<a)-1,h=b>>1,x=-7,T=t?s-1:0,j=t?-1:1,B=l[e+T];for(T+=j,o=B&(1<<-x)-1,B>>=-x,x+=a;x>0;o=o*256+l[e+T],T+=j,x-=8);for(u=o&(1<<-x)-1,o>>=-x,x+=r;x>0;u=u*256+l[e+T],T+=j,x-=8);if(o===0)o=1-h;else{if(o===b)return u?NaN:(B?-1:1)*(1/0);u=u+Math.pow(2,r),o=o-h}return(B?-1:1)*u*Math.pow(2,o-r)},wt.write=function(l,e,t,r,s,o){var u,a,b,h=o*8-s-1,x=(1<<h)-1,T=x>>1,j=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=r?0:o-1,A=r?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=x):(u=Math.floor(Math.log(e)/Math.LN2),e*(b=Math.pow(2,-u))<1&&(u--,b*=2),u+T>=1?e+=j/b:e+=j*Math.pow(2,1-T),e*b>=2&&(u++,b/=2),u+T>=x?(a=0,u=x):u+T>=1?(a=(e*b-1)*Math.pow(2,s),u=u+T):(a=e*Math.pow(2,T-1)*Math.pow(2,s),u=0));s>=8;l[t+B]=a&255,B+=A,a/=256,s-=8);for(u=u<<s|a,h+=s;h>0;l[t+B]=u&255,B+=A,u/=256,h-=8);l[t+B-A]|=v*128}),wt}var Sr;function Me(){return Sr||(Sr=1,(function(l){const e=Dn(),t=$n(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;l.Buffer=a,l.SlowBuffer=m,l.INSPECT_MAX_BYTES=50;const s=2147483647;l.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=o(),!a.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 f=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(f,n),f.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function u(f){if(f>s)throw new RangeError('The value "'+f+'" is invalid for option "size"');const n=new Uint8Array(f);return Object.setPrototypeOf(n,a.prototype),n}function a(f,n,i){if(typeof f=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return T(f)}return b(f,n,i)}a.poolSize=8192;function b(f,n,i){if(typeof f=="string")return j(f,n);if(ArrayBuffer.isView(f))return A(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if($(f,ArrayBuffer)||f&&$(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($(f,SharedArrayBuffer)||f&&$(f.buffer,SharedArrayBuffer)))return v(f,n,i);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const d=f.valueOf&&f.valueOf();if(d!=null&&d!==f)return a.from(d,n,i);const E=y(f);if(E)return E;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return a.from(f[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}a.from=function(f,n,i){return b(f,n,i)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function h(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function x(f,n,i){return h(f),f<=0?u(f):n!==void 0?typeof i=="string"?u(f).fill(n,i):u(f).fill(n):u(f)}a.alloc=function(f,n,i){return x(f,n,i)};function T(f){return h(f),u(f<0?0:_(f)|0)}a.allocUnsafe=function(f){return T(f)},a.allocUnsafeSlow=function(f){return T(f)};function j(f,n){if((typeof n!="string"||n==="")&&(n="utf8"),!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const i=w(f,n)|0;let d=u(i);const E=d.write(f,n);return E!==i&&(d=d.slice(0,E)),d}function B(f){const n=f.length<0?0:_(f.length)|0,i=u(n);for(let d=0;d<n;d+=1)i[d]=f[d]&255;return i}function A(f){if($(f,Uint8Array)){const n=new Uint8Array(f);return v(n.buffer,n.byteOffset,n.byteLength)}return B(f)}function v(f,n,i){if(n<0||f.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');let d;return n===void 0&&i===void 0?d=new Uint8Array(f):i===void 0?d=new Uint8Array(f,n):d=new Uint8Array(f,n,i),Object.setPrototypeOf(d,a.prototype),d}function y(f){if(a.isBuffer(f)){const n=_(f.length)|0,i=u(n);return i.length===0||f.copy(i,0,0,n),i}if(f.length!==void 0)return typeof f.length!="number"||we(f.length)?u(0):B(f);if(f.type==="Buffer"&&Array.isArray(f.data))return B(f.data)}function _(f){if(f>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return f|0}function m(f){return+f!=f&&(f=0),a.alloc(+f)}a.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==a.prototype},a.compare=function(n,i){if($(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),$(i,Uint8Array)&&(i=a.from(i,i.offset,i.byteLength)),!a.isBuffer(n)||!a.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;let d=n.length,E=i.length;for(let F=0,q=Math.min(d,E);F<q;++F)if(n[F]!==i[F]){d=n[F],E=i[F];break}return d<E?-1:E<d?1:0},a.isEncoding=function(n){switch(String(n).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}},a.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return a.alloc(0);let d;if(i===void 0)for(i=0,d=0;d<n.length;++d)i+=n[d].length;const E=a.allocUnsafe(i);let F=0;for(d=0;d<n.length;++d){let q=n[d];if($(q,Uint8Array))F+q.length>E.length?(a.isBuffer(q)||(q=a.from(q)),q.copy(E,F)):Uint8Array.prototype.set.call(E,q,F);else if(a.isBuffer(q))q.copy(E,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=q.length}return E};function w(f,n){if(a.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||$(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);const i=f.length,d=arguments.length>2&&arguments[2]===!0;if(!d&&i===0)return 0;let E=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return J(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Q(f).length;default:if(E)return d?-1:J(f).length;n=(""+n).toLowerCase(),E=!0}}a.byteLength=w;function P(f,n,i){let d=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(f||(f="utf8");;)switch(f){case"hex":return ae(this,n,i);case"utf8":case"utf-8":return ne(this,n,i);case"ascii":return be(this,n,i);case"latin1":case"binary":return W(this,n,i);case"base64":return L(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,n,i);default:if(d)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),d=!0}}a.prototype._isBuffer=!0;function I(f,n,i){const d=f[n];f[n]=f[i],f[i]=d}a.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<n;i+=2)I(this,i,i+1);return this},a.prototype.swap32=function(){const n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<n;i+=4)I(this,i,i+3),I(this,i+1,i+2);return this},a.prototype.swap64=function(){const n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<n;i+=8)I(this,i,i+7),I(this,i+1,i+6),I(this,i+2,i+5),I(this,i+3,i+4);return this},a.prototype.toString=function(){const n=this.length;return n===0?"":arguments.length===0?ne(this,0,n):P.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(n){if(!a.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:a.compare(this,n)===0},a.prototype.inspect=function(){let n="";const i=l.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(n,i,d,E,F){if($(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(i===void 0&&(i=0),d===void 0&&(d=n?n.length:0),E===void 0&&(E=0),F===void 0&&(F=this.length),i<0||d>n.length||E<0||F>this.length)throw new RangeError("out of range index");if(E>=F&&i>=d)return 0;if(E>=F)return-1;if(i>=d)return 1;if(i>>>=0,d>>>=0,E>>>=0,F>>>=0,this===n)return 0;let q=F-E,_e=d-i;const Ie=Math.min(q,_e),Ee=this.slice(E,F),Re=n.slice(i,d);for(let xe=0;xe<Ie;++xe)if(Ee[xe]!==Re[xe]){q=Ee[xe],_e=Re[xe];break}return q<_e?-1:_e<q?1:0};function H(f,n,i,d,E){if(f.length===0)return-1;if(typeof i=="string"?(d=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,we(i)&&(i=E?0:f.length-1),i<0&&(i=f.length+i),i>=f.length){if(E)return-1;i=f.length-1}else if(i<0)if(E)i=0;else return-1;if(typeof n=="string"&&(n=a.from(n,d)),a.isBuffer(n))return n.length===0?-1:K(f,n,i,d,E);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?E?Uint8Array.prototype.indexOf.call(f,n,i):Uint8Array.prototype.lastIndexOf.call(f,n,i):K(f,[n],i,d,E);throw new TypeError("val must be string, number or Buffer")}function K(f,n,i,d,E){let F=1,q=f.length,_e=n.length;if(d!==void 0&&(d=String(d).toLowerCase(),d==="ucs2"||d==="ucs-2"||d==="utf16le"||d==="utf-16le")){if(f.length<2||n.length<2)return-1;F=2,q/=2,_e/=2,i/=2}function Ie(Re,xe){return F===1?Re[xe]:Re.readUInt16BE(xe*F)}let Ee;if(E){let Re=-1;for(Ee=i;Ee<q;Ee++)if(Ie(f,Ee)===Ie(n,Re===-1?0:Ee-Re)){if(Re===-1&&(Re=Ee),Ee-Re+1===_e)return Re*F}else Re!==-1&&(Ee-=Ee-Re),Re=-1}else for(i+_e>q&&(i=q-_e),Ee=i;Ee>=0;Ee--){let Re=!0;for(let xe=0;xe<_e;xe++)if(Ie(f,Ee+xe)!==Ie(n,xe)){Re=!1;break}if(Re)return Ee}return-1}a.prototype.includes=function(n,i,d){return this.indexOf(n,i,d)!==-1},a.prototype.indexOf=function(n,i,d){return H(this,n,i,d,!0)},a.prototype.lastIndexOf=function(n,i,d){return H(this,n,i,d,!1)};function z(f,n,i,d){i=Number(i)||0;const E=f.length-i;d?(d=Number(d),d>E&&(d=E)):d=E;const F=n.length;d>F/2&&(d=F/2);let q;for(q=0;q<d;++q){const _e=parseInt(n.substr(q*2,2),16);if(we(_e))return q;f[i+q]=_e}return q}function fe(f,n,i,d){return Y(J(n,f.length-i),f,i,d)}function k(f,n,i,d){return Y(Z(n),f,i,d)}function C(f,n,i,d){return Y(Q(n),f,i,d)}function V(f,n,i,d){return Y(R(n,f.length-i),f,i,d)}a.prototype.write=function(n,i,d,E){if(i===void 0)E="utf8",d=this.length,i=0;else if(d===void 0&&typeof i=="string")E=i,d=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(d)?(d=d>>>0,E===void 0&&(E="utf8")):(E=d,d=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const F=this.length-i;if((d===void 0||d>F)&&(d=F),n.length>0&&(d<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");E||(E="utf8");let q=!1;for(;;)switch(E){case"hex":return z(this,n,i,d);case"utf8":case"utf-8":return fe(this,n,i,d);case"ascii":case"latin1":case"binary":return k(this,n,i,d);case"base64":return C(this,n,i,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,n,i,d);default:if(q)throw new TypeError("Unknown encoding: "+E);E=(""+E).toLowerCase(),q=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(f,n,i){return n===0&&i===f.length?e.fromByteArray(f):e.fromByteArray(f.slice(n,i))}function ne(f,n,i){i=Math.min(f.length,i);const d=[];let E=n;for(;E<i;){const F=f[E];let q=null,_e=F>239?4:F>223?3:F>191?2:1;if(E+_e<=i){let Ie,Ee,Re,xe;switch(_e){case 1:F<128&&(q=F);break;case 2:Ie=f[E+1],(Ie&192)===128&&(xe=(F&31)<<6|Ie&63,xe>127&&(q=xe));break;case 3:Ie=f[E+1],Ee=f[E+2],(Ie&192)===128&&(Ee&192)===128&&(xe=(F&15)<<12|(Ie&63)<<6|Ee&63,xe>2047&&(xe<55296||xe>57343)&&(q=xe));break;case 4:Ie=f[E+1],Ee=f[E+2],Re=f[E+3],(Ie&192)===128&&(Ee&192)===128&&(Re&192)===128&&(xe=(F&15)<<18|(Ie&63)<<12|(Ee&63)<<6|Re&63,xe>65535&&xe<1114112&&(q=xe))}}q===null?(q=65533,_e=1):q>65535&&(q-=65536,d.push(q>>>10&1023|55296),q=56320|q&1023),d.push(q),E+=_e}return ue(d)}const se=4096;function ue(f){const n=f.length;if(n<=se)return String.fromCharCode.apply(String,f);let i="",d=0;for(;d<n;)i+=String.fromCharCode.apply(String,f.slice(d,d+=se));return i}function be(f,n,i){let d="";i=Math.min(f.length,i);for(let E=n;E<i;++E)d+=String.fromCharCode(f[E]&127);return d}function W(f,n,i){let d="";i=Math.min(f.length,i);for(let E=n;E<i;++E)d+=String.fromCharCode(f[E]);return d}function ae(f,n,i){const d=f.length;(!n||n<0)&&(n=0),(!i||i<0||i>d)&&(i=d);let E="";for(let F=n;F<i;++F)E+=Ne[f[F]];return E}function g(f,n,i){const d=f.slice(n,i);let E="";for(let F=0;F<d.length-1;F+=2)E+=String.fromCharCode(d[F]+d[F+1]*256);return E}a.prototype.slice=function(n,i){const d=this.length;n=~~n,i=i===void 0?d:~~i,n<0?(n+=d,n<0&&(n=0)):n>d&&(n=d),i<0?(i+=d,i<0&&(i=0)):i>d&&(i=d),i<n&&(i=n);const E=this.subarray(n,i);return Object.setPrototypeOf(E,a.prototype),E};function M(f,n,i){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+n>i)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(n,i,d){n=n>>>0,i=i>>>0,d||M(n,i,this.length);let E=this[n],F=1,q=0;for(;++q<i&&(F*=256);)E+=this[n+q]*F;return E},a.prototype.readUintBE=a.prototype.readUIntBE=function(n,i,d){n=n>>>0,i=i>>>0,d||M(n,i,this.length);let E=this[n+--i],F=1;for(;i>0&&(F*=256);)E+=this[n+--i]*F;return E},a.prototype.readUint8=a.prototype.readUInt8=function(n,i){return n=n>>>0,i||M(n,1,this.length),this[n]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||M(n,2,this.length),this[n]|this[n+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||M(n,2,this.length),this[n]<<8|this[n+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||M(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||M(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},a.prototype.readBigUInt64LE=ye(function(n){n=n>>>0,S(n,"offset");const i=this[n],d=this[n+7];(i===void 0||d===void 0)&&N(n,this.length-8);const E=i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,F=this[++n]+this[++n]*2**8+this[++n]*2**16+d*2**24;return BigInt(E)+(BigInt(F)<<BigInt(32))}),a.prototype.readBigUInt64BE=ye(function(n){n=n>>>0,S(n,"offset");const i=this[n],d=this[n+7];(i===void 0||d===void 0)&&N(n,this.length-8);const E=i*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],F=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+d;return(BigInt(E)<<BigInt(32))+BigInt(F)}),a.prototype.readIntLE=function(n,i,d){n=n>>>0,i=i>>>0,d||M(n,i,this.length);let E=this[n],F=1,q=0;for(;++q<i&&(F*=256);)E+=this[n+q]*F;return F*=128,E>=F&&(E-=Math.pow(2,8*i)),E},a.prototype.readIntBE=function(n,i,d){n=n>>>0,i=i>>>0,d||M(n,i,this.length);let E=i,F=1,q=this[n+--E];for(;E>0&&(F*=256);)q+=this[n+--E]*F;return F*=128,q>=F&&(q-=Math.pow(2,8*i)),q},a.prototype.readInt8=function(n,i){return n=n>>>0,i||M(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},a.prototype.readInt16LE=function(n,i){n=n>>>0,i||M(n,2,this.length);const d=this[n]|this[n+1]<<8;return d&32768?d|4294901760:d},a.prototype.readInt16BE=function(n,i){n=n>>>0,i||M(n,2,this.length);const d=this[n+1]|this[n]<<8;return d&32768?d|4294901760:d},a.prototype.readInt32LE=function(n,i){return n=n>>>0,i||M(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},a.prototype.readInt32BE=function(n,i){return n=n>>>0,i||M(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},a.prototype.readBigInt64LE=ye(function(n){n=n>>>0,S(n,"offset");const i=this[n],d=this[n+7];(i===void 0||d===void 0)&&N(n,this.length-8);const E=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(d<<24);return(BigInt(E)<<BigInt(32))+BigInt(i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)}),a.prototype.readBigInt64BE=ye(function(n){n=n>>>0,S(n,"offset");const i=this[n],d=this[n+7];(i===void 0||d===void 0)&&N(n,this.length-8);const E=(i<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(E)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+d)}),a.prototype.readFloatLE=function(n,i){return n=n>>>0,i||M(n,4,this.length),t.read(this,n,!0,23,4)},a.prototype.readFloatBE=function(n,i){return n=n>>>0,i||M(n,4,this.length),t.read(this,n,!1,23,4)},a.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||M(n,8,this.length),t.read(this,n,!0,52,8)},a.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||M(n,8,this.length),t.read(this,n,!1,52,8)};function X(f,n,i,d,E,F){if(!a.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>E||n<F)throw new RangeError('"value" argument is out of bounds');if(i+d>f.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(n,i,d,E){if(n=+n,i=i>>>0,d=d>>>0,!E){const _e=Math.pow(2,8*d)-1;X(this,n,i,d,_e,0)}let F=1,q=0;for(this[i]=n&255;++q<d&&(F*=256);)this[i+q]=n/F&255;return i+d},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(n,i,d,E){if(n=+n,i=i>>>0,d=d>>>0,!E){const _e=Math.pow(2,8*d)-1;X(this,n,i,d,_e,0)}let F=d-1,q=1;for(this[i+F]=n&255;--F>=0&&(q*=256);)this[i+F]=n/q&255;return i+d},a.prototype.writeUint8=a.prototype.writeUInt8=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,1,255,0),this[i]=n&255,i+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function U(f,n,i,d,E){de(n,d,E,f,i,7);let F=Number(n&BigInt(4294967295));f[i++]=F,F=F>>8,f[i++]=F,F=F>>8,f[i++]=F,F=F>>8,f[i++]=F;let q=Number(n>>BigInt(32)&BigInt(4294967295));return f[i++]=q,q=q>>8,f[i++]=q,q=q>>8,f[i++]=q,q=q>>8,f[i++]=q,i}function oe(f,n,i,d,E){de(n,d,E,f,i,7);let F=Number(n&BigInt(4294967295));f[i+7]=F,F=F>>8,f[i+6]=F,F=F>>8,f[i+5]=F,F=F>>8,f[i+4]=F;let q=Number(n>>BigInt(32)&BigInt(4294967295));return f[i+3]=q,q=q>>8,f[i+2]=q,q=q>>8,f[i+1]=q,q=q>>8,f[i]=q,i+8}a.prototype.writeBigUInt64LE=ye(function(n,i=0){return U(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ye(function(n,i=0){return oe(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(n,i,d,E){if(n=+n,i=i>>>0,!E){const Ie=Math.pow(2,8*d-1);X(this,n,i,d,Ie-1,-Ie)}let F=0,q=1,_e=0;for(this[i]=n&255;++F<d&&(q*=256);)n<0&&_e===0&&this[i+F-1]!==0&&(_e=1),this[i+F]=(n/q>>0)-_e&255;return i+d},a.prototype.writeIntBE=function(n,i,d,E){if(n=+n,i=i>>>0,!E){const Ie=Math.pow(2,8*d-1);X(this,n,i,d,Ie-1,-Ie)}let F=d-1,q=1,_e=0;for(this[i+F]=n&255;--F>=0&&(q*=256);)n<0&&_e===0&&this[i+F+1]!==0&&(_e=1),this[i+F]=(n/q>>0)-_e&255;return i+d},a.prototype.writeInt8=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},a.prototype.writeInt16LE=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeInt16BE=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeInt32LE=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},a.prototype.writeInt32BE=function(n,i,d){return n=+n,i=i>>>0,d||X(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},a.prototype.writeBigInt64LE=ye(function(n,i=0){return U(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ye(function(n,i=0){return oe(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ce(f,n,i,d,E,F){if(i+d>f.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function ge(f,n,i,d,E){return n=+n,i=i>>>0,E||ce(f,n,i,4),t.write(f,n,i,d,23,4),i+4}a.prototype.writeFloatLE=function(n,i,d){return ge(this,n,i,!0,d)},a.prototype.writeFloatBE=function(n,i,d){return ge(this,n,i,!1,d)};function pe(f,n,i,d,E){return n=+n,i=i>>>0,E||ce(f,n,i,8),t.write(f,n,i,d,52,8),i+8}a.prototype.writeDoubleLE=function(n,i,d){return pe(this,n,i,!0,d)},a.prototype.writeDoubleBE=function(n,i,d){return pe(this,n,i,!1,d)},a.prototype.copy=function(n,i,d,E){if(!a.isBuffer(n))throw new TypeError("argument should be a Buffer");if(d||(d=0),!E&&E!==0&&(E=this.length),i>=n.length&&(i=n.length),i||(i=0),E>0&&E<d&&(E=d),E===d||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(d<0||d>=this.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("sourceEnd out of bounds");E>this.length&&(E=this.length),n.length-i<E-d&&(E=n.length-i+d);const F=E-d;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,d,E):Uint8Array.prototype.set.call(n,this.subarray(d,E),i),F},a.prototype.fill=function(n,i,d,E){if(typeof n=="string"){if(typeof i=="string"?(E=i,i=0,d=this.length):typeof d=="string"&&(E=d,d=this.length),E!==void 0&&typeof E!="string")throw new TypeError("encoding must be a string");if(typeof E=="string"&&!a.isEncoding(E))throw new TypeError("Unknown encoding: "+E);if(n.length===1){const q=n.charCodeAt(0);(E==="utf8"&&q<128||E==="latin1")&&(n=q)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<d)throw new RangeError("Out of range index");if(d<=i)return this;i=i>>>0,d=d===void 0?this.length:d>>>0,n||(n=0);let F;if(typeof n=="number")for(F=i;F<d;++F)this[F]=n;else{const q=a.isBuffer(n)?n:a.from(n,E),_e=q.length;if(_e===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(F=0;F<d-i;++F)this[F+i]=q[F%_e]}return this};const D={};function G(f,n,i){D[f]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(E){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:E,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}G("ERR_BUFFER_OUT_OF_BOUNDS",function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(f,n){return`The "${f}" argument must be of type number. Received type ${typeof n}`},TypeError),G("ERR_OUT_OF_RANGE",function(f,n,i){let d=`The value of "${f}" is out of range.`,E=i;return Number.isInteger(i)&&Math.abs(i)>2**32?E=ie(String(i)):typeof i=="bigint"&&(E=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(E=ie(E)),E+="n"),d+=` It must be ${n}. Received ${E}`,d},RangeError);function ie(f){let n="",i=f.length;const d=f[0]==="-"?1:0;for(;i>=d+4;i-=3)n=`_${f.slice(i-3,i)}${n}`;return`${f.slice(0,i)}${n}`}function he(f,n,i){S(n,"offset"),(f[n]===void 0||f[n+i]===void 0)&&N(n,f.length-(i+1))}function de(f,n,i,d,E,F){if(f>i||f<n){const q=typeof n=="bigint"?"n":"";let _e;throw n===0||n===BigInt(0)?_e=`>= 0${q} and < 2${q} ** ${(F+1)*8}${q}`:_e=`>= -(2${q} ** ${(F+1)*8-1}${q}) and < 2 ** ${(F+1)*8-1}${q}`,new D.ERR_OUT_OF_RANGE("value",_e,f)}he(d,E,F)}function S(f,n){if(typeof f!="number")throw new D.ERR_INVALID_ARG_TYPE(n,"number",f)}function N(f,n,i){throw Math.floor(f)!==f?(S(f,i),new D.ERR_OUT_OF_RANGE("offset","an integer",f)):n<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${n}`,f)}const O=/[^+/0-9A-Za-z-_]/g;function ee(f){if(f=f.split("=")[0],f=f.trim().replace(O,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function J(f,n){n=n||1/0;let i;const d=f.length;let E=null;const F=[];for(let q=0;q<d;++q){if(i=f.charCodeAt(q),i>55295&&i<57344){if(!E){if(i>56319){(n-=3)>-1&&F.push(239,191,189);continue}else if(q+1===d){(n-=3)>-1&&F.push(239,191,189);continue}E=i;continue}if(i<56320){(n-=3)>-1&&F.push(239,191,189),E=i;continue}i=(E-55296<<10|i-56320)+65536}else E&&(n-=3)>-1&&F.push(239,191,189);if(E=null,i<128){if((n-=1)<0)break;F.push(i)}else if(i<2048){if((n-=2)<0)break;F.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;F.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;F.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return F}function Z(f){const n=[];for(let i=0;i<f.length;++i)n.push(f.charCodeAt(i)&255);return n}function R(f,n){let i,d,E;const F=[];for(let q=0;q<f.length&&!((n-=2)<0);++q)i=f.charCodeAt(q),d=i>>8,E=i%256,F.push(E),F.push(d);return F}function Q(f){return e.toByteArray(ee(f))}function Y(f,n,i,d){let E;for(E=0;E<d&&!(E+i>=n.length||E>=f.length);++E)n[E+i]=f[E];return E}function $(f,n){return f instanceof n||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===n.name}function we(f){return f!==f}const Ne=(function(){const f="0123456789abcdef",n=new Array(256);for(let i=0;i<16;++i){const d=i*16;for(let E=0;E<16;++E)n[d+E]=f[i]+f[E]}return n})();function ye(f){return typeof BigInt>"u"?Be:f}function Be(){throw new Error("BigInt not supported")}})(Ft)),Ft}var Un=Me();const rt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",nt="http://www.w3.org/2001/XMLSchema#",mt="http://www.w3.org/2000/10/swap/",Ae={xsd:{decimal:`${nt}decimal`,boolean:`${nt}boolean`,double:`${nt}double`,integer:`${nt}integer`,string:`${nt}string`},rdf:{type:`${rt}type`,nil:`${rt}nil`,first:`${rt}first`,rest:`${rt}rest`,langString:`${rt}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${mt}reify#forSome`,forAll:`${mt}reify#forAll`},log:{implies:`${mt}log#implies`,isImpliedBy:`${mt}log#isImpliedBy`}},{xsd:xt}=Ae,Wn=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Ir={"\\":"\\","'":"'",'"':'"',n:`
|
|
2
|
-
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},qn=/[\x00-\x20<>\\"\{\}\|\^\`]/,zn={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Gn=/$0^/;class Hn{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 zn)&&this[t]instanceof RegExp&&(this[t]=Gn)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,s=r.length;for(;;){let a,b;for(;a=this._newline.exec(r);)this.comments&&(b=this._comment.exec(a[0]))&&o("comment",b[1],"",this._line,a[0].length),r=r.substr(a[0].length,r.length),s=r.length,this._line++;if(!a&&(a=this._whitespace.exec(r))&&(r=r.substr(a[0].length,r.length)),this._endOfFile.test(r))return t&&(this.comments&&(b=this._comment.exec(r))&&o("comment",b[1],"",this._line,r.length),r=null,o("eof","","",this._line,0)),this._input=r;const h=this._line,x=r[0];let T="",j="",B="",A=null,v=0,y=!1;switch(x){case"^":if(r.length<3)break;if(r[1]==="^"){if(this._previousMarker="^^",r=r.substr(2),r[0]!=="<"){y=!0;break}}else{this._n3Mode&&(v=1,T="^");break}case"<":if(A=this._unescapedIri.exec(r))T="IRI",j=A[1];else if(A=this._iri.exec(r)){if(j=this._unescape(A[1]),j===null||qn.test(j))return u(this);T="IRI"}else r.length>1&&r[1]==="<"?(T="<<",v=2):this._n3Mode&&r.length>1&&r[1]==="="&&(v=2,this._isImpliedBy?(T="abbreviation",j="<"):(T="inverse",j=">"));break;case">":r.length>1&&r[1]===">"&&(T=">>",v=2);break;case"_":((A=this._blank.exec(r))||t&&(A=this._blank.exec(`${r} `)))&&(T="blank",B="_",j=A[1]);break;case'"':if(A=this._simpleQuotedString.exec(r))j=A[1];else if({value:j,matchLength:v}=this._parseLiteral(r),j===null)return u(this);(A!==null||v!==0)&&(T="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(A=this._simpleApostropheString.exec(r))j=A[1];else if({value:j,matchLength:v}=this._parseLiteral(r),j===null)return u(this);(A!==null||v!==0)&&(T="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(A=this._variable.exec(r))&&(T="var",j=A[0]);break;case"@":this._previousMarker==="literal"&&(A=this._langcode.exec(r))?(T="langcode",j=A[1]):(A=this._keyword.exec(r))&&(T=A[0]);break;case".":if(r.length===1?t:r[1]<"0"||r[1]>"9"){T=".",v=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(A=this._number.exec(r)||t&&(A=this._number.exec(`${r} `)))&&(T="literal",j=A[0],B=typeof A[1]=="string"?xt.double:typeof A[2]=="string"?xt.decimal:xt.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(A=this._sparqlKeyword.exec(r))?T=A[0].toUpperCase():y=!0;break;case"f":case"t":(A=this._boolean.exec(r))?(T="literal",j=A[0],B=xt.boolean):y=!0;break;case"a":(A=this._shortPredicates.exec(r))?(T="abbreviation",j="a"):y=!0;break;case"=":this._n3Mode&&r.length>1&&(T="abbreviation",r[1]!==">"?(v=1,j="="):(v=2,j=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(v=1,T=x);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(T="{|",v=2):(T=x,v=1));break;case"|":r.length>=2&&r[1]==="}"&&(T="|}",v=2);break;default:y=!0}if(y&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(A=this._prefix.exec(r))?(T="prefix",j=A[1]||""):((A=this._prefixed.exec(r))||t&&(A=this._prefixed.exec(`${r} `)))&&(T="prefixed",B=A[1]||"",j=this._unescape(A[2]))),this._previousMarker==="^^")switch(T){case"prefixed":T="type";break;case"IRI":T="typeIRI";break;default:T=""}if(!T)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?u(this):this._input=r;const _=v||A[0].length,m=o(T,j,B,h,_);this.previousToken=m,this._previousMarker=T,r=r.substr(_,r.length)}function o(a,b,h,x,T){const j=r?s-r.length:s,B=j+T,A={type:a,value:b,prefix:h,line:x,start:j,end:B};return e(null,A),A}function u(a){e(a._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(Wn,(s,o,u,a)=>{if(typeof o=="string")return String.fromCharCode(Number.parseInt(o,16));if(typeof u=="string"){let b=Number.parseInt(u,16);return b<=65535?String.fromCharCode(Number.parseInt(u,16)):String.fromCharCode(55296+((b-=65536)>>10),56320+(b&1023))}return a in Ir?Ir[a]:(t=!0,"")});return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let s=Math.max(this._literalClosingPos,r);for(;(s=e.indexOf(t,s))>0;){let o=0;for(;e[s-o-1]==="\\";)o++;if(o%2===0){const u=e.substring(r,s),a=u.split(/\r\n|\r|\n/).length-1,b=s+r;if(r===1&&a!==0||r===3&&this._lineMode)break;return this._line+=a,{value:this._unescape(u),matchLength:b}}s++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof t=="function")queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{const r=[];let s;if(this._tokenizeToEnd((o,u)=>o?s=o:r.push(u),!0),s)throw s;return r}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",r=>{this._input!==null&&r.length!==0&&(this._pendingBuffer&&(r=Un.Buffer.concat([this._pendingBuffer,r]),this._pendingBuffer=null),r[r.length-1]&128?this._pendingBuffer=r:(typeof this._input>"u"?this._input=this._readStartingBom(typeof r=="string"?r:r.toString()):this._input+=r,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}}const{rdf:Qn,xsd:ze}=Ae;let Ke,Vn=0;const Ge={namedNode:vr,blankNode:Ar,variable:Pr,literal:Nr,defaultGraph:Jn,quad:Ct,triple:Ct,fromTerm:st,fromQuad:jr};class Ce{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Ce?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Rr extends Ce{get termType(){return"NamedNode"}}class Ye extends Ce{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 Rr(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return r==="^"?e.substr(t+2):r!=="@"?ze.string:Qn.langString}equals(e){return e instanceof Ye?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class Kn extends Ce{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Yn extends Ce{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}class Xn extends Ce{constructor(){return super(""),Ke||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}}Ke=new Xn;function it(l,e,t){if(e=e||Ge,!l)return e.defaultGraph();switch(l[0]){case"?":return e.variable(l.substr(1));case"_":return e.blankNode(l.substr(2));case'"':if(e===Ge)return new Ye(l);if(l[l.length-1]==='"')return e.literal(l.substr(1,l.length-2));const r=l.lastIndexOf('"',l.length-1);return e.literal(l.substr(1,r-1),l[r+1]==="@"?l.substr(r+2):e.namedNode(l.substr(r+3)));case"[":l=JSON.parse(l);break;default:if(!t||!Array.isArray(l))return e.namedNode(l)}return e.quad(it(l[0],e,!0),it(l[1],e,!0),it(l[2],e,!0),l[3]&&it(l[3],e,!0))}function Xe(l,e){if(typeof l=="string")return l;if(l instanceof Ce&&l.termType!=="Quad")return l.id;if(!l)return Ke.id;switch(l.termType){case"NamedNode":return l.value;case"BlankNode":return`_:${l.value}`;case"Variable":return`?${l.value}`;case"DefaultGraph":return"";case"Literal":return`"${l.value}"${l.language?`@${l.language}`:l.datatype&&l.datatype.value!==ze.string?`^^${l.datatype.value}`:""}`;case"Quad":const t=[Xe(l.subject,!0),Xe(l.predicate,!0),Xe(l.object,!0)];return l.graph&&l.graph.termType!=="DefaultGraph"&&t.push(Xe(l.graph,!0)),e?t:JSON.stringify(t);default:throw new Error(`Unexpected termType: ${l.termType}`)}}class Tr extends Ce{constructor(e,t,r,s){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=s||Ke}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function vr(l){return new Rr(l)}function Ar(l){return new Kn(l||`n3-${Vn++}`)}function Nr(l,e){if(typeof e=="string")return new Ye(`"${l}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof l=="boolean"?t=ze.boolean:typeof l=="number"&&(Number.isFinite(l)?t=Number.isInteger(l)?ze.integer:ze.double:(t=ze.double,Number.isNaN(l)||(l=l>0?"INF":"-INF")))),t===""||t===ze.string?new Ye(`"${l}"`):new Ye(`"${l}"^^${t}`)}function Pr(l){return new Yn(l)}function Jn(){return Ke}function Ct(l,e,t,r){return new Tr(l,e,t,r)}function st(l){if(l instanceof Ce)return l;switch(l.termType){case"NamedNode":return vr(l.value);case"BlankNode":return Ar(l.value);case"Variable":return Pr(l.value);case"DefaultGraph":return Ke;case"Literal":return Nr(l.value,l.language||l.datatype);case"Quad":return jr(l);default:throw new Error(`Unexpected termType: ${l.termType}`)}}function jr(l){if(l instanceof Tr)return l;if(l.termType!=="Quad")throw new Error(`Unexpected termType: ${l.termType}`);return Ct(st(l.subject),st(l.predicate),st(l.object),st(l.graph))}let Br=0;class Lr{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&kr(this,e.factory);const t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),s=/trig/.test(t),o=/triple/.test(t),u=/quad/.test(t),a=this._n3Mode=/n3/.test(t),b=o||u;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||s||o||a),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=t===""||/star|\*$/.test(t),b&&(this._resolveRelativeIRI=h=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Hn({lineMode:b,n3:a,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Br=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,r,s,o){const u=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:s,object:o,graph:t,inverse:u?this._inversePredicate:!1,blankPrefix:u?this._prefixes._:"",quantified:u?this._quantified:null}),u&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return 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 r;switch(e.type){case"IRI":case"typeIRI":const s=this._resolveIRI(e.value);if(s===null)return this._error("Invalid IRI",e);r=this._factory.namedNode(s);break;case"type":case"prefixed":const o=this._prefixes[e.prefix];if(o===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._factory.namedNode(o+e.value);break;case"blank":r=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._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,r=null,s=this._readListItem;const o=this._subject,u=this._contextStack,a=u[u.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),s=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),u.length!==0&&u[u.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(s=this._readPredicate,this._subject===this.RDF_NIL)return s}else if(s=this._getContextEndReader(),this._object===this.RDF_NIL)return s;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,s=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),s=this._getContextEndReader());break;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);default:if((t=this._readEntity(e))===void 0)return}if(r===null&&(this._subject=r=this._factory.blankNode()),o===null?a.predicate===null?a.subject=r:a.object=r:this._emit(o,this.RDF_REST,r,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return s}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)return;t=this._factory.literal(this._literalValue,r),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const s=this._subject,o=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,o&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const u=this._predicate,a=this._object;this._subject=this._factory.quad(s,u,a,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(s!==null){const u=this._predicate,a=this._object;o?this._emit(a,u,s,r):this._emit(s,u,a,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&r.type==="item"){const s=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,s,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const s=this._factory.blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=s):(t=this._object,this._object=s),this._emit(t,r,s,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let r,s;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(s=this._subject,this._subject=t):(s=this._object,this._object=t),this._emit(t,r,s,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,s){this._callback(null,this._factory.quad(e,t,r,s||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=Et}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",s=-1,o=-1,u=0,a="/";for(;s<t;){switch(a){case":":if(o<0&&e[++s]==="/"&&e[++s]==="/")for(;(o=s+1)<t&&e[o]!=="/";)s=o;break;case"?":case"#":s=t;break;case"/":if(e[s+1]===".")switch(a=e[++s+1],a){case"/":r+=e.substring(u,s-1),u=s+1;break;case void 0:case"?":case"#":return r+e.substring(u,s)+e.substr(s+1);case".":if(a=e[++s+1],a===void 0||a==="/"||a==="?"||a==="#"){if(r+=e.substring(u,s-2),(u=r.lastIndexOf("/"))>=o&&(r=r.substr(0,u)),a!=="/")return`${r}/${e.substr(s+1)}`;u=s+1}}}a=e[++s]}return r+e.substring(u)}parse(e,t,r){let s,o,u;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(s=t.onQuad,o=t.onPrefix,u=t.onComment):(s=t,o=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Br++}_`,this._prefixCallback=o||Et,this._inversePredicate=!1,this._quantified=Object.create(null),!s){const b=[];let h;if(this._callback=(x,T)=>{x?h=x:T&&b.push(T)},this._lexer.tokenize(e).every(x=>this._readCallback=this._readCallback(x)),h)throw h;return b}let a=(b,h)=>{b!==null?(this._callback(b),this._callback=Et):this._readCallback&&(this._readCallback=this._readCallback(h))};u&&(this._lexer.comments=!0,a=(b,h)=>{b!==null?(this._callback(b),this._callback=Et):this._readCallback&&(h.type==="comment"?u(h.value):this._readCallback=this._readCallback(h))}),this._callback=s,this._lexer.tokenize(e,a)}}function Et(){}function kr(l,e){l._factory=e,l.DEFAULTGRAPH=e.defaultGraph(),l.RDF_FIRST=e.namedNode(Ae.rdf.first),l.RDF_REST=e.namedNode(Ae.rdf.rest),l.RDF_NIL=e.namedNode(Ae.rdf.nil),l.N3_FORALL=e.namedNode(Ae.r.forAll),l.N3_FORSOME=e.namedNode(Ae.r.forSome),l.ABBREVIATIONS={a:e.namedNode(Ae.rdf.type),"=":e.namedNode(Ae.owl.sameAs),">":e.namedNode(Ae.log.implies),"<":e.namedNode(Ae.log.isImpliedBy)},l.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}kr(Lr.prototype,Ge);function Ot(l){return!!l&&l.termType==="DefaultGraph"}function St(l){return l.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const Zn=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,ei=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,Fr="./",ti="../",Mt="?",Cr="#";class Dt{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Zn.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!Dt.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",St(e)],r=[],s=[],o=/[^/?#]*([/?#])/y;let u,a=0,b=0,h=o.lastIndex=e.length;for(;!a&&!b&&(u=o.exec(this.base));)u[1]===Cr?b=o.lastIndex-1:(t.push(St(u[0]),"(?:"),r.push(")?"),u[1]!==Mt?s.push(h=o.lastIndex):(a=h=o.lastIndex,b=this.base.indexOf(Cr,a),this._pathReplacements[a]=Mt));for(let x=0;x<s.length;x++)this._pathReplacements[s[x]]=ti.repeat(s.length-x-1);return this._pathReplacements[s[s.length-1]]=Fr,this._baseLength=b>0?b:this.base.length,t.push(St(this.base.substring(h,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...r].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const r=t[0].length;if(r===this._baseLength&&r===e.length)return"";const s=this._pathReplacements[r];if(s){const o=e.substring(r);return s!==Mt&&!ei.test(o)?e:s===Fr&&/^[^?#]/.test(o)?o:s+o}return e.substring(r-1)}}const ot=Ge.defaultGraph(),{rdf:ri,xsd:Je}=Ae,Or=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Mr=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,ni={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class at extends Ce{equals(e){return e===this}}class Dr{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0?!0:!!t.end;else{let r="";this._outputStream={write(s,o,u){r+=s,u&&u()},end:s=>{s&&s(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=ot,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new Dt(t.baseIRI)))}get _inDefaultGraph(){return ot.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,s,o){try{s.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
1
|
+
(function(me,et){typeof exports=="object"&&typeof module<"u"?et(exports):typeof define=="function"&&define.amd?define(["exports"],et):(me=typeof globalThis<"u"?globalThis:me||self,et(me["prez-lib"]={}))})(this,(function(me){"use strict";function et(l){return l.value!==void 0}function kt(l){const e={value:typeof l=="string"?l:l.value,termType:"NamedNode",equals:t=>!!t&&e.termType===t.termType&&e.value===t.value};return typeof l!="string"&&Object.assign(e,l),e}function bt(l){const e={value:typeof l=="string"?l:l.value,termType:"Literal",equals:t=>t&&e.termType===t.termType&&e.value===t.value?e.language!==t.language?!1:e.datatype===t.datatype:!1};return typeof l!="string"&&Object.assign(e,l),e}function gt(l){const e={value:typeof l=="string"?l:l.value,properties:{},termType:"BlankNode",equals:t=>!!t&&e.termType===t.termType&&e.value===t.value&&e.properties===t.properties};return typeof l!="string"&&Object.assign(e,l),e}var Ft={},tt={},xr;function Dn(){if(xr)return tt;xr=1,tt.byteLength=a,tt.toByteArray=h,tt.fromByteArray=j;for(var l=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,o=r.length;s<o;++s)l[s]=r[s],e[r.charCodeAt(s)]=s;e[45]=62,e[95]=63;function u(B){var A=B.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var v=B.indexOf("=");v===-1&&(v=A);var y=v===A?0:4-v%4;return[v,y]}function a(B){var A=u(B),v=A[0],y=A[1];return(v+y)*3/4-y}function p(B,A,v){return(A+v)*3/4-v}function h(B){var A,v=u(B),y=v[0],b=v[1],m=new t(p(B,y,b)),w=0,P=b>0?y-4:y,I;for(I=0;I<P;I+=4)A=e[B.charCodeAt(I)]<<18|e[B.charCodeAt(I+1)]<<12|e[B.charCodeAt(I+2)]<<6|e[B.charCodeAt(I+3)],m[w++]=A>>16&255,m[w++]=A>>8&255,m[w++]=A&255;return b===2&&(A=e[B.charCodeAt(I)]<<2|e[B.charCodeAt(I+1)]>>4,m[w++]=A&255),b===1&&(A=e[B.charCodeAt(I)]<<10|e[B.charCodeAt(I+1)]<<4|e[B.charCodeAt(I+2)]>>2,m[w++]=A>>8&255,m[w++]=A&255),m}function x(B){return l[B>>18&63]+l[B>>12&63]+l[B>>6&63]+l[B&63]}function T(B,A,v){for(var y,b=[],m=A;m<v;m+=3)y=(B[m]<<16&16711680)+(B[m+1]<<8&65280)+(B[m+2]&255),b.push(x(y));return b.join("")}function j(B){for(var A,v=B.length,y=v%3,b=[],m=16383,w=0,P=v-y;w<P;w+=m)b.push(T(B,w,w+m>P?P:w+m));return y===1?(A=B[v-1],b.push(l[A>>2]+l[A<<4&63]+"==")):y===2&&(A=(B[v-2]<<8)+B[v-1],b.push(l[A>>10]+l[A>>4&63]+l[A<<2&63]+"=")),b.join("")}return tt}var yt={};var Er;function $n(){return Er||(Er=1,yt.read=function(l,e,t,r,s){var o,u,a=s*8-r-1,p=(1<<a)-1,h=p>>1,x=-7,T=t?s-1:0,j=t?-1:1,B=l[e+T];for(T+=j,o=B&(1<<-x)-1,B>>=-x,x+=a;x>0;o=o*256+l[e+T],T+=j,x-=8);for(u=o&(1<<-x)-1,o>>=-x,x+=r;x>0;u=u*256+l[e+T],T+=j,x-=8);if(o===0)o=1-h;else{if(o===p)return u?NaN:(B?-1:1)*(1/0);u=u+Math.pow(2,r),o=o-h}return(B?-1:1)*u*Math.pow(2,o-r)},yt.write=function(l,e,t,r,s,o){var u,a,p,h=o*8-s-1,x=(1<<h)-1,T=x>>1,j=s===23?Math.pow(2,-24)-Math.pow(2,-77):0,B=r?0:o-1,A=r?1:-1,v=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=x):(u=Math.floor(Math.log(e)/Math.LN2),e*(p=Math.pow(2,-u))<1&&(u--,p*=2),u+T>=1?e+=j/p:e+=j*Math.pow(2,1-T),e*p>=2&&(u++,p/=2),u+T>=x?(a=0,u=x):u+T>=1?(a=(e*p-1)*Math.pow(2,s),u=u+T):(a=e*Math.pow(2,T-1)*Math.pow(2,s),u=0));s>=8;l[t+B]=a&255,B+=A,a/=256,s-=8);for(u=u<<s|a,h+=s;h>0;l[t+B]=u&255,B+=A,u/=256,h-=8);l[t+B-A]|=v*128}),yt}var Sr;function Me(){return Sr||(Sr=1,(function(l){const e=Dn(),t=$n(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;l.Buffer=a,l.SlowBuffer=m,l.INSPECT_MAX_BYTES=50;const s=2147483647;l.kMaxLength=s,a.TYPED_ARRAY_SUPPORT=o(),!a.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 f=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(f,n),f.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function u(f){if(f>s)throw new RangeError('The value "'+f+'" is invalid for option "size"');const n=new Uint8Array(f);return Object.setPrototypeOf(n,a.prototype),n}function a(f,n,i){if(typeof f=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return T(f)}return p(f,n,i)}a.poolSize=8192;function p(f,n,i){if(typeof f=="string")return j(f,n);if(ArrayBuffer.isView(f))return A(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if($(f,ArrayBuffer)||f&&$(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($(f,SharedArrayBuffer)||f&&$(f.buffer,SharedArrayBuffer)))return v(f,n,i);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const d=f.valueOf&&f.valueOf();if(d!=null&&d!==f)return a.from(d,n,i);const E=y(f);if(E)return E;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return a.from(f[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}a.from=function(f,n,i){return p(f,n,i)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function h(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function x(f,n,i){return h(f),f<=0?u(f):n!==void 0?typeof i=="string"?u(f).fill(n,i):u(f).fill(n):u(f)}a.alloc=function(f,n,i){return x(f,n,i)};function T(f){return h(f),u(f<0?0:b(f)|0)}a.allocUnsafe=function(f){return T(f)},a.allocUnsafeSlow=function(f){return T(f)};function j(f,n){if((typeof n!="string"||n==="")&&(n="utf8"),!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);const i=w(f,n)|0;let d=u(i);const E=d.write(f,n);return E!==i&&(d=d.slice(0,E)),d}function B(f){const n=f.length<0?0:b(f.length)|0,i=u(n);for(let d=0;d<n;d+=1)i[d]=f[d]&255;return i}function A(f){if($(f,Uint8Array)){const n=new Uint8Array(f);return v(n.buffer,n.byteOffset,n.byteLength)}return B(f)}function v(f,n,i){if(n<0||f.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');let d;return n===void 0&&i===void 0?d=new Uint8Array(f):i===void 0?d=new Uint8Array(f,n):d=new Uint8Array(f,n,i),Object.setPrototypeOf(d,a.prototype),d}function y(f){if(a.isBuffer(f)){const n=b(f.length)|0,i=u(n);return i.length===0||f.copy(i,0,0,n),i}if(f.length!==void 0)return typeof f.length!="number"||we(f.length)?u(0):B(f);if(f.type==="Buffer"&&Array.isArray(f.data))return B(f.data)}function b(f){if(f>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return f|0}function m(f){return+f!=f&&(f=0),a.alloc(+f)}a.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==a.prototype},a.compare=function(n,i){if($(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),$(i,Uint8Array)&&(i=a.from(i,i.offset,i.byteLength)),!a.isBuffer(n)||!a.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;let d=n.length,E=i.length;for(let F=0,q=Math.min(d,E);F<q;++F)if(n[F]!==i[F]){d=n[F],E=i[F];break}return d<E?-1:E<d?1:0},a.isEncoding=function(n){switch(String(n).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}},a.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return a.alloc(0);let d;if(i===void 0)for(i=0,d=0;d<n.length;++d)i+=n[d].length;const E=a.allocUnsafe(i);let F=0;for(d=0;d<n.length;++d){let q=n[d];if($(q,Uint8Array))F+q.length>E.length?(a.isBuffer(q)||(q=a.from(q)),q.copy(E,F)):Uint8Array.prototype.set.call(E,q,F);else if(a.isBuffer(q))q.copy(E,F);else throw new TypeError('"list" argument must be an Array of Buffers');F+=q.length}return E};function w(f,n){if(a.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||$(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);const i=f.length,d=arguments.length>2&&arguments[2]===!0;if(!d&&i===0)return 0;let E=!1;for(;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return X(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Q(f).length;default:if(E)return d?-1:X(f).length;n=(""+n).toLowerCase(),E=!0}}a.byteLength=w;function P(f,n,i){let d=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(f||(f="utf8");;)switch(f){case"hex":return ae(this,n,i);case"utf8":case"utf-8":return ne(this,n,i);case"ascii":return be(this,n,i);case"latin1":case"binary":return W(this,n,i);case"base64":return L(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,n,i);default:if(d)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),d=!0}}a.prototype._isBuffer=!0;function I(f,n,i){const d=f[n];f[n]=f[i],f[i]=d}a.prototype.swap16=function(){const n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<n;i+=2)I(this,i,i+1);return this},a.prototype.swap32=function(){const n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<n;i+=4)I(this,i,i+3),I(this,i+1,i+2);return this},a.prototype.swap64=function(){const n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<n;i+=8)I(this,i,i+7),I(this,i+1,i+6),I(this,i+2,i+5),I(this,i+3,i+4);return this},a.prototype.toString=function(){const n=this.length;return n===0?"":arguments.length===0?ne(this,0,n):P.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(n){if(!a.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:a.compare(this,n)===0},a.prototype.inspect=function(){let n="";const i=l.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(n,i,d,E,F){if($(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(i===void 0&&(i=0),d===void 0&&(d=n?n.length:0),E===void 0&&(E=0),F===void 0&&(F=this.length),i<0||d>n.length||E<0||F>this.length)throw new RangeError("out of range index");if(E>=F&&i>=d)return 0;if(E>=F)return-1;if(i>=d)return 1;if(i>>>=0,d>>>=0,E>>>=0,F>>>=0,this===n)return 0;let q=F-E,_e=d-i;const Re=Math.min(q,_e),Se=this.slice(E,F),Te=n.slice(i,d);for(let xe=0;xe<Re;++xe)if(Se[xe]!==Te[xe]){q=Se[xe],_e=Te[xe];break}return q<_e?-1:_e<q?1:0};function H(f,n,i,d,E){if(f.length===0)return-1;if(typeof i=="string"?(d=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,we(i)&&(i=E?0:f.length-1),i<0&&(i=f.length+i),i>=f.length){if(E)return-1;i=f.length-1}else if(i<0)if(E)i=0;else return-1;if(typeof n=="string"&&(n=a.from(n,d)),a.isBuffer(n))return n.length===0?-1:K(f,n,i,d,E);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?E?Uint8Array.prototype.indexOf.call(f,n,i):Uint8Array.prototype.lastIndexOf.call(f,n,i):K(f,[n],i,d,E);throw new TypeError("val must be string, number or Buffer")}function K(f,n,i,d,E){let F=1,q=f.length,_e=n.length;if(d!==void 0&&(d=String(d).toLowerCase(),d==="ucs2"||d==="ucs-2"||d==="utf16le"||d==="utf-16le")){if(f.length<2||n.length<2)return-1;F=2,q/=2,_e/=2,i/=2}function Re(Te,xe){return F===1?Te[xe]:Te.readUInt16BE(xe*F)}let Se;if(E){let Te=-1;for(Se=i;Se<q;Se++)if(Re(f,Se)===Re(n,Te===-1?0:Se-Te)){if(Te===-1&&(Te=Se),Se-Te+1===_e)return Te*F}else Te!==-1&&(Se-=Se-Te),Te=-1}else for(i+_e>q&&(i=q-_e),Se=i;Se>=0;Se--){let Te=!0;for(let xe=0;xe<_e;xe++)if(Re(f,Se+xe)!==Re(n,xe)){Te=!1;break}if(Te)return Se}return-1}a.prototype.includes=function(n,i,d){return this.indexOf(n,i,d)!==-1},a.prototype.indexOf=function(n,i,d){return H(this,n,i,d,!0)},a.prototype.lastIndexOf=function(n,i,d){return H(this,n,i,d,!1)};function z(f,n,i,d){i=Number(i)||0;const E=f.length-i;d?(d=Number(d),d>E&&(d=E)):d=E;const F=n.length;d>F/2&&(d=F/2);let q;for(q=0;q<d;++q){const _e=parseInt(n.substr(q*2,2),16);if(we(_e))return q;f[i+q]=_e}return q}function fe(f,n,i,d){return Y(X(n,f.length-i),f,i,d)}function k(f,n,i,d){return Y(Z(n),f,i,d)}function O(f,n,i,d){return Y(Q(n),f,i,d)}function V(f,n,i,d){return Y(R(n,f.length-i),f,i,d)}a.prototype.write=function(n,i,d,E){if(i===void 0)E="utf8",d=this.length,i=0;else if(d===void 0&&typeof i=="string")E=i,d=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(d)?(d=d>>>0,E===void 0&&(E="utf8")):(E=d,d=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const F=this.length-i;if((d===void 0||d>F)&&(d=F),n.length>0&&(d<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");E||(E="utf8");let q=!1;for(;;)switch(E){case"hex":return z(this,n,i,d);case"utf8":case"utf-8":return fe(this,n,i,d);case"ascii":case"latin1":case"binary":return k(this,n,i,d);case"base64":return O(this,n,i,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V(this,n,i,d);default:if(q)throw new TypeError("Unknown encoding: "+E);E=(""+E).toLowerCase(),q=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function L(f,n,i){return n===0&&i===f.length?e.fromByteArray(f):e.fromByteArray(f.slice(n,i))}function ne(f,n,i){i=Math.min(f.length,i);const d=[];let E=n;for(;E<i;){const F=f[E];let q=null,_e=F>239?4:F>223?3:F>191?2:1;if(E+_e<=i){let Re,Se,Te,xe;switch(_e){case 1:F<128&&(q=F);break;case 2:Re=f[E+1],(Re&192)===128&&(xe=(F&31)<<6|Re&63,xe>127&&(q=xe));break;case 3:Re=f[E+1],Se=f[E+2],(Re&192)===128&&(Se&192)===128&&(xe=(F&15)<<12|(Re&63)<<6|Se&63,xe>2047&&(xe<55296||xe>57343)&&(q=xe));break;case 4:Re=f[E+1],Se=f[E+2],Te=f[E+3],(Re&192)===128&&(Se&192)===128&&(Te&192)===128&&(xe=(F&15)<<18|(Re&63)<<12|(Se&63)<<6|Te&63,xe>65535&&xe<1114112&&(q=xe))}}q===null?(q=65533,_e=1):q>65535&&(q-=65536,d.push(q>>>10&1023|55296),q=56320|q&1023),d.push(q),E+=_e}return ue(d)}const se=4096;function ue(f){const n=f.length;if(n<=se)return String.fromCharCode.apply(String,f);let i="",d=0;for(;d<n;)i+=String.fromCharCode.apply(String,f.slice(d,d+=se));return i}function be(f,n,i){let d="";i=Math.min(f.length,i);for(let E=n;E<i;++E)d+=String.fromCharCode(f[E]&127);return d}function W(f,n,i){let d="";i=Math.min(f.length,i);for(let E=n;E<i;++E)d+=String.fromCharCode(f[E]);return d}function ae(f,n,i){const d=f.length;(!n||n<0)&&(n=0),(!i||i<0||i>d)&&(i=d);let E="";for(let F=n;F<i;++F)E+=Ne[f[F]];return E}function g(f,n,i){const d=f.slice(n,i);let E="";for(let F=0;F<d.length-1;F+=2)E+=String.fromCharCode(d[F]+d[F+1]*256);return E}a.prototype.slice=function(n,i){const d=this.length;n=~~n,i=i===void 0?d:~~i,n<0?(n+=d,n<0&&(n=0)):n>d&&(n=d),i<0?(i+=d,i<0&&(i=0)):i>d&&(i=d),i<n&&(i=n);const E=this.subarray(n,i);return Object.setPrototypeOf(E,a.prototype),E};function M(f,n,i){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+n>i)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(n,i,d){n=n>>>0,i=i>>>0,d||M(n,i,this.length);let E=this[n],F=1,q=0;for(;++q<i&&(F*=256);)E+=this[n+q]*F;return E},a.prototype.readUintBE=a.prototype.readUIntBE=function(n,i,d){n=n>>>0,i=i>>>0,d||M(n,i,this.length);let E=this[n+--i],F=1;for(;i>0&&(F*=256);)E+=this[n+--i]*F;return E},a.prototype.readUint8=a.prototype.readUInt8=function(n,i){return n=n>>>0,i||M(n,1,this.length),this[n]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||M(n,2,this.length),this[n]|this[n+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||M(n,2,this.length),this[n]<<8|this[n+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||M(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||M(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},a.prototype.readBigUInt64LE=ye(function(n){n=n>>>0,S(n,"offset");const i=this[n],d=this[n+7];(i===void 0||d===void 0)&&N(n,this.length-8);const E=i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24,F=this[++n]+this[++n]*2**8+this[++n]*2**16+d*2**24;return BigInt(E)+(BigInt(F)<<BigInt(32))}),a.prototype.readBigUInt64BE=ye(function(n){n=n>>>0,S(n,"offset");const i=this[n],d=this[n+7];(i===void 0||d===void 0)&&N(n,this.length-8);const E=i*2**24+this[++n]*2**16+this[++n]*2**8+this[++n],F=this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+d;return(BigInt(E)<<BigInt(32))+BigInt(F)}),a.prototype.readIntLE=function(n,i,d){n=n>>>0,i=i>>>0,d||M(n,i,this.length);let E=this[n],F=1,q=0;for(;++q<i&&(F*=256);)E+=this[n+q]*F;return F*=128,E>=F&&(E-=Math.pow(2,8*i)),E},a.prototype.readIntBE=function(n,i,d){n=n>>>0,i=i>>>0,d||M(n,i,this.length);let E=i,F=1,q=this[n+--E];for(;E>0&&(F*=256);)q+=this[n+--E]*F;return F*=128,q>=F&&(q-=Math.pow(2,8*i)),q},a.prototype.readInt8=function(n,i){return n=n>>>0,i||M(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},a.prototype.readInt16LE=function(n,i){n=n>>>0,i||M(n,2,this.length);const d=this[n]|this[n+1]<<8;return d&32768?d|4294901760:d},a.prototype.readInt16BE=function(n,i){n=n>>>0,i||M(n,2,this.length);const d=this[n+1]|this[n]<<8;return d&32768?d|4294901760:d},a.prototype.readInt32LE=function(n,i){return n=n>>>0,i||M(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},a.prototype.readInt32BE=function(n,i){return n=n>>>0,i||M(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},a.prototype.readBigInt64LE=ye(function(n){n=n>>>0,S(n,"offset");const i=this[n],d=this[n+7];(i===void 0||d===void 0)&&N(n,this.length-8);const E=this[n+4]+this[n+5]*2**8+this[n+6]*2**16+(d<<24);return(BigInt(E)<<BigInt(32))+BigInt(i+this[++n]*2**8+this[++n]*2**16+this[++n]*2**24)}),a.prototype.readBigInt64BE=ye(function(n){n=n>>>0,S(n,"offset");const i=this[n],d=this[n+7];(i===void 0||d===void 0)&&N(n,this.length-8);const E=(i<<24)+this[++n]*2**16+this[++n]*2**8+this[++n];return(BigInt(E)<<BigInt(32))+BigInt(this[++n]*2**24+this[++n]*2**16+this[++n]*2**8+d)}),a.prototype.readFloatLE=function(n,i){return n=n>>>0,i||M(n,4,this.length),t.read(this,n,!0,23,4)},a.prototype.readFloatBE=function(n,i){return n=n>>>0,i||M(n,4,this.length),t.read(this,n,!1,23,4)},a.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||M(n,8,this.length),t.read(this,n,!0,52,8)},a.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||M(n,8,this.length),t.read(this,n,!1,52,8)};function J(f,n,i,d,E,F){if(!a.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>E||n<F)throw new RangeError('"value" argument is out of bounds');if(i+d>f.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(n,i,d,E){if(n=+n,i=i>>>0,d=d>>>0,!E){const _e=Math.pow(2,8*d)-1;J(this,n,i,d,_e,0)}let F=1,q=0;for(this[i]=n&255;++q<d&&(F*=256);)this[i+q]=n/F&255;return i+d},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(n,i,d,E){if(n=+n,i=i>>>0,d=d>>>0,!E){const _e=Math.pow(2,8*d)-1;J(this,n,i,d,_e,0)}let F=d-1,q=1;for(this[i+F]=n&255;--F>=0&&(q*=256);)this[i+F]=n/q&255;return i+d},a.prototype.writeUint8=a.prototype.writeUInt8=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,1,255,0),this[i]=n&255,i+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function U(f,n,i,d,E){de(n,d,E,f,i,7);let F=Number(n&BigInt(4294967295));f[i++]=F,F=F>>8,f[i++]=F,F=F>>8,f[i++]=F,F=F>>8,f[i++]=F;let q=Number(n>>BigInt(32)&BigInt(4294967295));return f[i++]=q,q=q>>8,f[i++]=q,q=q>>8,f[i++]=q,q=q>>8,f[i++]=q,i}function oe(f,n,i,d,E){de(n,d,E,f,i,7);let F=Number(n&BigInt(4294967295));f[i+7]=F,F=F>>8,f[i+6]=F,F=F>>8,f[i+5]=F,F=F>>8,f[i+4]=F;let q=Number(n>>BigInt(32)&BigInt(4294967295));return f[i+3]=q,q=q>>8,f[i+2]=q,q=q>>8,f[i+1]=q,q=q>>8,f[i]=q,i+8}a.prototype.writeBigUInt64LE=ye(function(n,i=0){return U(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ye(function(n,i=0){return oe(this,n,i,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(n,i,d,E){if(n=+n,i=i>>>0,!E){const Re=Math.pow(2,8*d-1);J(this,n,i,d,Re-1,-Re)}let F=0,q=1,_e=0;for(this[i]=n&255;++F<d&&(q*=256);)n<0&&_e===0&&this[i+F-1]!==0&&(_e=1),this[i+F]=(n/q>>0)-_e&255;return i+d},a.prototype.writeIntBE=function(n,i,d,E){if(n=+n,i=i>>>0,!E){const Re=Math.pow(2,8*d-1);J(this,n,i,d,Re-1,-Re)}let F=d-1,q=1,_e=0;for(this[i+F]=n&255;--F>=0&&(q*=256);)n<0&&_e===0&&this[i+F+1]!==0&&(_e=1),this[i+F]=(n/q>>0)-_e&255;return i+d},a.prototype.writeInt8=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},a.prototype.writeInt16LE=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeInt16BE=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeInt32LE=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},a.prototype.writeInt32BE=function(n,i,d){return n=+n,i=i>>>0,d||J(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},a.prototype.writeBigInt64LE=ye(function(n,i=0){return U(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ye(function(n,i=0){return oe(this,n,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ce(f,n,i,d,E,F){if(i+d>f.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function ge(f,n,i,d,E){return n=+n,i=i>>>0,E||ce(f,n,i,4),t.write(f,n,i,d,23,4),i+4}a.prototype.writeFloatLE=function(n,i,d){return ge(this,n,i,!0,d)},a.prototype.writeFloatBE=function(n,i,d){return ge(this,n,i,!1,d)};function pe(f,n,i,d,E){return n=+n,i=i>>>0,E||ce(f,n,i,8),t.write(f,n,i,d,52,8),i+8}a.prototype.writeDoubleLE=function(n,i,d){return pe(this,n,i,!0,d)},a.prototype.writeDoubleBE=function(n,i,d){return pe(this,n,i,!1,d)},a.prototype.copy=function(n,i,d,E){if(!a.isBuffer(n))throw new TypeError("argument should be a Buffer");if(d||(d=0),!E&&E!==0&&(E=this.length),i>=n.length&&(i=n.length),i||(i=0),E>0&&E<d&&(E=d),E===d||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(d<0||d>=this.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("sourceEnd out of bounds");E>this.length&&(E=this.length),n.length-i<E-d&&(E=n.length-i+d);const F=E-d;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,d,E):Uint8Array.prototype.set.call(n,this.subarray(d,E),i),F},a.prototype.fill=function(n,i,d,E){if(typeof n=="string"){if(typeof i=="string"?(E=i,i=0,d=this.length):typeof d=="string"&&(E=d,d=this.length),E!==void 0&&typeof E!="string")throw new TypeError("encoding must be a string");if(typeof E=="string"&&!a.isEncoding(E))throw new TypeError("Unknown encoding: "+E);if(n.length===1){const q=n.charCodeAt(0);(E==="utf8"&&q<128||E==="latin1")&&(n=q)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<d)throw new RangeError("Out of range index");if(d<=i)return this;i=i>>>0,d=d===void 0?this.length:d>>>0,n||(n=0);let F;if(typeof n=="number")for(F=i;F<d;++F)this[F]=n;else{const q=a.isBuffer(n)?n:a.from(n,E),_e=q.length;if(_e===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(F=0;F<d-i;++F)this[F+i]=q[F%_e]}return this};const D={};function G(f,n,i){D[f]=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:n.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(E){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:E,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}G("ERR_BUFFER_OUT_OF_BOUNDS",function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(f,n){return`The "${f}" argument must be of type number. Received type ${typeof n}`},TypeError),G("ERR_OUT_OF_RANGE",function(f,n,i){let d=`The value of "${f}" is out of range.`,E=i;return Number.isInteger(i)&&Math.abs(i)>2**32?E=ie(String(i)):typeof i=="bigint"&&(E=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(E=ie(E)),E+="n"),d+=` It must be ${n}. Received ${E}`,d},RangeError);function ie(f){let n="",i=f.length;const d=f[0]==="-"?1:0;for(;i>=d+4;i-=3)n=`_${f.slice(i-3,i)}${n}`;return`${f.slice(0,i)}${n}`}function he(f,n,i){S(n,"offset"),(f[n]===void 0||f[n+i]===void 0)&&N(n,f.length-(i+1))}function de(f,n,i,d,E,F){if(f>i||f<n){const q=typeof n=="bigint"?"n":"";let _e;throw n===0||n===BigInt(0)?_e=`>= 0${q} and < 2${q} ** ${(F+1)*8}${q}`:_e=`>= -(2${q} ** ${(F+1)*8-1}${q}) and < 2 ** ${(F+1)*8-1}${q}`,new D.ERR_OUT_OF_RANGE("value",_e,f)}he(d,E,F)}function S(f,n){if(typeof f!="number")throw new D.ERR_INVALID_ARG_TYPE(n,"number",f)}function N(f,n,i){throw Math.floor(f)!==f?(S(f,i),new D.ERR_OUT_OF_RANGE("offset","an integer",f)):n<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${n}`,f)}const C=/[^+/0-9A-Za-z-_]/g;function ee(f){if(f=f.split("=")[0],f=f.trim().replace(C,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function X(f,n){n=n||1/0;let i;const d=f.length;let E=null;const F=[];for(let q=0;q<d;++q){if(i=f.charCodeAt(q),i>55295&&i<57344){if(!E){if(i>56319){(n-=3)>-1&&F.push(239,191,189);continue}else if(q+1===d){(n-=3)>-1&&F.push(239,191,189);continue}E=i;continue}if(i<56320){(n-=3)>-1&&F.push(239,191,189),E=i;continue}i=(E-55296<<10|i-56320)+65536}else E&&(n-=3)>-1&&F.push(239,191,189);if(E=null,i<128){if((n-=1)<0)break;F.push(i)}else if(i<2048){if((n-=2)<0)break;F.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;F.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;F.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return F}function Z(f){const n=[];for(let i=0;i<f.length;++i)n.push(f.charCodeAt(i)&255);return n}function R(f,n){let i,d,E;const F=[];for(let q=0;q<f.length&&!((n-=2)<0);++q)i=f.charCodeAt(q),d=i>>8,E=i%256,F.push(E),F.push(d);return F}function Q(f){return e.toByteArray(ee(f))}function Y(f,n,i,d){let E;for(E=0;E<d&&!(E+i>=n.length||E>=f.length);++E)n[E+i]=f[E];return E}function $(f,n){return f instanceof n||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===n.name}function we(f){return f!==f}const Ne=(function(){const f="0123456789abcdef",n=new Array(256);for(let i=0;i<16;++i){const d=i*16;for(let E=0;E<16;++E)n[d+E]=f[i]+f[E]}return n})();function ye(f){return typeof BigInt>"u"?Be:f}function Be(){throw new Error("BigInt not supported")}})(Ft)),Ft}var Un=Me();const rt="http://www.w3.org/1999/02/22-rdf-syntax-ns#",nt="http://www.w3.org/2001/XMLSchema#",wt="http://www.w3.org/2000/10/swap/",Ae={xsd:{decimal:`${nt}decimal`,boolean:`${nt}boolean`,double:`${nt}double`,integer:`${nt}integer`,string:`${nt}string`},rdf:{type:`${rt}type`,nil:`${rt}nil`,first:`${rt}first`,rest:`${rt}rest`,langString:`${rt}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${wt}reify#forSome`,forAll:`${wt}reify#forAll`},log:{implies:`${wt}log#implies`,isImpliedBy:`${wt}log#isImpliedBy`}},{xsd:mt}=Ae,Wn=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Ir={"\\":"\\","'":"'",'"':'"',n:`
|
|
2
|
+
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},qn=/[\x00-\x20<>\\"\{\}\|\^\`]/,zn={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Gn=/$0^/;class Hn{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 zn)&&this[t]instanceof RegExp&&(this[t]=Gn)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let r=this._input,s=r.length;for(;;){let a,p;for(;a=this._newline.exec(r);)this.comments&&(p=this._comment.exec(a[0]))&&o("comment",p[1],"",this._line,a[0].length),r=r.substr(a[0].length,r.length),s=r.length,this._line++;if(!a&&(a=this._whitespace.exec(r))&&(r=r.substr(a[0].length,r.length)),this._endOfFile.test(r))return t&&(this.comments&&(p=this._comment.exec(r))&&o("comment",p[1],"",this._line,r.length),r=null,o("eof","","",this._line,0)),this._input=r;const h=this._line,x=r[0];let T="",j="",B="",A=null,v=0,y=!1;switch(x){case"^":if(r.length<3)break;if(r[1]==="^"){if(this._previousMarker="^^",r=r.substr(2),r[0]!=="<"){y=!0;break}}else{this._n3Mode&&(v=1,T="^");break}case"<":if(A=this._unescapedIri.exec(r))T="IRI",j=A[1];else if(A=this._iri.exec(r)){if(j=this._unescape(A[1]),j===null||qn.test(j))return u(this);T="IRI"}else r.length>1&&r[1]==="<"?(T="<<",v=2):this._n3Mode&&r.length>1&&r[1]==="="&&(v=2,this._isImpliedBy?(T="abbreviation",j="<"):(T="inverse",j=">"));break;case">":r.length>1&&r[1]===">"&&(T=">>",v=2);break;case"_":((A=this._blank.exec(r))||t&&(A=this._blank.exec(`${r} `)))&&(T="blank",B="_",j=A[1]);break;case'"':if(A=this._simpleQuotedString.exec(r))j=A[1];else if({value:j,matchLength:v}=this._parseLiteral(r),j===null)return u(this);(A!==null||v!==0)&&(T="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(A=this._simpleApostropheString.exec(r))j=A[1];else if({value:j,matchLength:v}=this._parseLiteral(r),j===null)return u(this);(A!==null||v!==0)&&(T="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(A=this._variable.exec(r))&&(T="var",j=A[0]);break;case"@":this._previousMarker==="literal"&&(A=this._langcode.exec(r))?(T="langcode",j=A[1]):(A=this._keyword.exec(r))&&(T=A[0]);break;case".":if(r.length===1?t:r[1]<"0"||r[1]>"9"){T=".",v=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(A=this._number.exec(r)||t&&(A=this._number.exec(`${r} `)))&&(T="literal",j=A[0],B=typeof A[1]=="string"?mt.double:typeof A[2]=="string"?mt.decimal:mt.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(A=this._sparqlKeyword.exec(r))?T=A[0].toUpperCase():y=!0;break;case"f":case"t":(A=this._boolean.exec(r))?(T="literal",j=A[0],B=mt.boolean):y=!0;break;case"a":(A=this._shortPredicates.exec(r))?(T="abbreviation",j="a"):y=!0;break;case"=":this._n3Mode&&r.length>1&&(T="abbreviation",r[1]!==">"?(v=1,j="="):(v=2,j=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(v=1,T=x);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(T="{|",v=2):(T=x,v=1));break;case"|":r.length>=2&&r[1]==="}"&&(T="|}",v=2);break;default:y=!0}if(y&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(A=this._prefix.exec(r))?(T="prefix",j=A[1]||""):((A=this._prefixed.exec(r))||t&&(A=this._prefixed.exec(`${r} `)))&&(T="prefixed",B=A[1]||"",j=this._unescape(A[2]))),this._previousMarker==="^^")switch(T){case"prefixed":T="type";break;case"IRI":T="typeIRI";break;default:T=""}if(!T)return t||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?u(this):this._input=r;const b=v||A[0].length,m=o(T,j,B,h,b);this.previousToken=m,this._previousMarker=T,r=r.substr(b,r.length)}function o(a,p,h,x,T){const j=r?s-r.length:s,B=j+T,A={type:a,value:p,prefix:h,line:x,start:j,end:B};return e(null,A),A}function u(a){e(a._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let t=!1;const r=e.replace(Wn,(s,o,u,a)=>{if(typeof o=="string")return String.fromCharCode(Number.parseInt(o,16));if(typeof u=="string"){let p=Number.parseInt(u,16);return p<=65535?String.fromCharCode(Number.parseInt(u,16)):String.fromCharCode(55296+((p-=65536)>>10),56320+(p&1023))}return a in Ir?Ir[a]:(t=!0,"")});return t?null:r}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],r=t.length;let s=Math.max(this._literalClosingPos,r);for(;(s=e.indexOf(t,s))>0;){let o=0;for(;e[s-o-1]==="\\";)o++;if(o%2===0){const u=e.substring(r,s),a=u.split(/\r\n|\r|\n/).length-1,p=s+r;if(r===1&&a!==0||r===3&&this._lineMode)break;return this._line+=a,{value:this._unescape(u),matchLength:p}}s++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof t=="function")queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{const r=[];let s;if(this._tokenizeToEnd((o,u)=>o?s=o:r.push(u),!0),s)throw s;return r}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",r=>{this._input!==null&&r.length!==0&&(this._pendingBuffer&&(r=Un.Buffer.concat([this._pendingBuffer,r]),this._pendingBuffer=null),r[r.length-1]&128?this._pendingBuffer=r:(typeof this._input>"u"?this._input=this._readStartingBom(typeof r=="string"?r:r.toString()):this._input+=r,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}}const{rdf:Qn,xsd:ze}=Ae;let Ke,Vn=0;const Ge={namedNode:vr,blankNode:Ar,variable:Pr,literal:Nr,defaultGraph:Xn,quad:Ot,triple:Ot,fromTerm:st,fromQuad:jr};class Oe{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof Oe?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class Rr extends Oe{get termType(){return"NamedNode"}}class Ye extends Oe{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 Rr(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,r=t<e.length?e[t]:"";return r==="^"?e.substr(t+2):r!=="@"?ze.string:Qn.langString}equals(e){return e instanceof Ye?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class Kn extends Oe{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class Yn extends Oe{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}class Jn extends Oe{constructor(){return super(""),Ke||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}}Ke=new Jn;function it(l,e,t){if(e=e||Ge,!l)return e.defaultGraph();switch(l[0]){case"?":return e.variable(l.substr(1));case"_":return e.blankNode(l.substr(2));case'"':if(e===Ge)return new Ye(l);if(l[l.length-1]==='"')return e.literal(l.substr(1,l.length-2));const r=l.lastIndexOf('"',l.length-1);return e.literal(l.substr(1,r-1),l[r+1]==="@"?l.substr(r+2):e.namedNode(l.substr(r+3)));case"[":l=JSON.parse(l);break;default:if(!t||!Array.isArray(l))return e.namedNode(l)}return e.quad(it(l[0],e,!0),it(l[1],e,!0),it(l[2],e,!0),l[3]&&it(l[3],e,!0))}function Je(l,e){if(typeof l=="string")return l;if(l instanceof Oe&&l.termType!=="Quad")return l.id;if(!l)return Ke.id;switch(l.termType){case"NamedNode":return l.value;case"BlankNode":return`_:${l.value}`;case"Variable":return`?${l.value}`;case"DefaultGraph":return"";case"Literal":return`"${l.value}"${l.language?`@${l.language}`:l.datatype&&l.datatype.value!==ze.string?`^^${l.datatype.value}`:""}`;case"Quad":const t=[Je(l.subject,!0),Je(l.predicate,!0),Je(l.object,!0)];return l.graph&&l.graph.termType!=="DefaultGraph"&&t.push(Je(l.graph,!0)),e?t:JSON.stringify(t);default:throw new Error(`Unexpected termType: ${l.termType}`)}}class Tr extends Oe{constructor(e,t,r,s){super(""),this._subject=e,this._predicate=t,this._object=r,this._graph=s||Ke}get termType(){return"Quad"}get subject(){return this._subject}get predicate(){return this._predicate}get object(){return this._object}get graph(){return this._graph}toJSON(){return{termType:this.termType,subject:this._subject.toJSON(),predicate:this._predicate.toJSON(),object:this._object.toJSON(),graph:this._graph.toJSON()}}equals(e){return!!e&&this._subject.equals(e.subject)&&this._predicate.equals(e.predicate)&&this._object.equals(e.object)&&this._graph.equals(e.graph)}}function vr(l){return new Rr(l)}function Ar(l){return new Kn(l||`n3-${Vn++}`)}function Nr(l,e){if(typeof e=="string")return new Ye(`"${l}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof l=="boolean"?t=ze.boolean:typeof l=="number"&&(Number.isFinite(l)?t=Number.isInteger(l)?ze.integer:ze.double:(t=ze.double,Number.isNaN(l)||(l=l>0?"INF":"-INF")))),t===""||t===ze.string?new Ye(`"${l}"`):new Ye(`"${l}"^^${t}`)}function Pr(l){return new Yn(l)}function Xn(){return Ke}function Ot(l,e,t,r){return new Tr(l,e,t,r)}function st(l){if(l instanceof Oe)return l;switch(l.termType){case"NamedNode":return vr(l.value);case"BlankNode":return Ar(l.value);case"Variable":return Pr(l.value);case"DefaultGraph":return Ke;case"Literal":return Nr(l.value,l.language||l.datatype);case"Quad":return jr(l);default:throw new Error(`Unexpected termType: ${l.termType}`)}}function jr(l){if(l instanceof Tr)return l;if(l.termType!=="Quad")throw new Error(`Unexpected termType: ${l.termType}`);return Ot(st(l.subject),st(l.predicate),st(l.object),st(l.graph))}let Br=0;class Lr{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&kr(this,e.factory);const t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(t),s=/trig/.test(t),o=/triple/.test(t),u=/quad/.test(t),a=this._n3Mode=/n3/.test(t),p=o||u;(this._supportsNamedGraphs=!(r||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||s||o||a),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=t===""||/star|\*$/.test(t),p&&(this._resolveRelativeIRI=h=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Hn({lineMode:p,n3:a,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Br=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,r,s,o){const u=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:s,object:o,graph:t,inverse:u?this._inversePredicate:!1,blankPrefix:u?this._prefixes._:"",quantified:u?this._quantified:null}),u&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return 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 r;switch(e.type){case"IRI":case"typeIRI":const s=this._resolveIRI(e.value);if(s===null)return this._error("Invalid IRI",e);r=this._factory.namedNode(s);break;case"type":case"prefixed":const o=this._prefixes[e.prefix];if(o===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._factory.namedNode(o+e.value);break;case"blank":r=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._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,r=null,s=this._readListItem;const o=this._subject,u=this._contextStack,a=u[u.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),s=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),u.length!==0&&u[u.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(s=this._readPredicate,this._subject===this.RDF_NIL)return s}else if(s=this._getContextEndReader(),this._object===this.RDF_NIL)return s;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,s=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),s=this._getContextEndReader());break;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);default:if((t=this._readEntity(e))===void 0)return}if(r===null&&(this._subject=r=this._factory.blankNode()),o===null?a.predicate===null?a.subject=r:a.object=r:this._emit(o,this.RDF_REST,r,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,t,this._graph)}return s}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)return;t=this._factory.literal(this._literalValue,r),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const r=this._completeLiteral(e);if(r)return this._object=r.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,r=this._graph;const s=this._subject,o=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,o&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const u=this._predicate,a=this._object;this._subject=this._factory.quad(s,u,a,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(s!==null){const u=this._predicate,a=this._object;o?this._emit(a,u,s,r):this._emit(s,u,a,r)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,r=t.length&&t[t.length-1];if(r&&r.type==="item"){const s=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,s,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,r;const s=this._factory.blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=s):(t=this._object,this._object=s),this._emit(t,r,s,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let r,s;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(s=this._subject,this._subject=t):(s=this._object,this._object=t),this._emit(t,r,s,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,r,s){this._callback(null,this._factory.quad(e,t,r,s||this.DEFAULTGRAPH))}_error(e,t){const r=new Error(`${e} on line ${t.line}.`);r.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=xt}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let r="",s=-1,o=-1,u=0,a="/";for(;s<t;){switch(a){case":":if(o<0&&e[++s]==="/"&&e[++s]==="/")for(;(o=s+1)<t&&e[o]!=="/";)s=o;break;case"?":case"#":s=t;break;case"/":if(e[s+1]===".")switch(a=e[++s+1],a){case"/":r+=e.substring(u,s-1),u=s+1;break;case void 0:case"?":case"#":return r+e.substring(u,s)+e.substr(s+1);case".":if(a=e[++s+1],a===void 0||a==="/"||a==="?"||a==="#"){if(r+=e.substring(u,s-2),(u=r.lastIndexOf("/"))>=o&&(r=r.substr(0,u)),a!=="/")return`${r}/${e.substr(s+1)}`;u=s+1}}}a=e[++s]}return r+e.substring(u)}parse(e,t,r){let s,o,u;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(s=t.onQuad,o=t.onPrefix,u=t.onComment):(s=t,o=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Br++}_`,this._prefixCallback=o||xt,this._inversePredicate=!1,this._quantified=Object.create(null),!s){const p=[];let h;if(this._callback=(x,T)=>{x?h=x:T&&p.push(T)},this._lexer.tokenize(e).every(x=>this._readCallback=this._readCallback(x)),h)throw h;return p}let a=(p,h)=>{p!==null?(this._callback(p),this._callback=xt):this._readCallback&&(this._readCallback=this._readCallback(h))};u&&(this._lexer.comments=!0,a=(p,h)=>{p!==null?(this._callback(p),this._callback=xt):this._readCallback&&(h.type==="comment"?u(h.value):this._readCallback=this._readCallback(h))}),this._callback=s,this._lexer.tokenize(e,a)}}function xt(){}function kr(l,e){l._factory=e,l.DEFAULTGRAPH=e.defaultGraph(),l.RDF_FIRST=e.namedNode(Ae.rdf.first),l.RDF_REST=e.namedNode(Ae.rdf.rest),l.RDF_NIL=e.namedNode(Ae.rdf.nil),l.N3_FORALL=e.namedNode(Ae.r.forAll),l.N3_FORSOME=e.namedNode(Ae.r.forSome),l.ABBREVIATIONS={a:e.namedNode(Ae.rdf.type),"=":e.namedNode(Ae.owl.sameAs),">":e.namedNode(Ae.log.implies),"<":e.namedNode(Ae.log.isImpliedBy)},l.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}kr(Lr.prototype,Ge);function Ct(l){return!!l&&l.termType==="DefaultGraph"}function Et(l){return l.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const Zn=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,ei=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,Fr="./",ti="../",Mt="?",Or="#";class Dt{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Zn.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!Dt.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",Et(e)],r=[],s=[],o=/[^/?#]*([/?#])/y;let u,a=0,p=0,h=o.lastIndex=e.length;for(;!a&&!p&&(u=o.exec(this.base));)u[1]===Or?p=o.lastIndex-1:(t.push(Et(u[0]),"(?:"),r.push(")?"),u[1]!==Mt?s.push(h=o.lastIndex):(a=h=o.lastIndex,p=this.base.indexOf(Or,a),this._pathReplacements[a]=Mt));for(let x=0;x<s.length;x++)this._pathReplacements[s[x]]=ti.repeat(s.length-x-1);return this._pathReplacements[s[s.length-1]]=Fr,this._baseLength=p>0?p:this.base.length,t.push(Et(this.base.substring(h,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...r].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const r=t[0].length;if(r===this._baseLength&&r===e.length)return"";const s=this._pathReplacements[r];if(s){const o=e.substring(r);return s!==Mt&&!ei.test(o)?e:s===Fr&&/^[^?#]/.test(o)?o:s+o}return e.substring(r-1)}}const ot=Ge.defaultGraph(),{rdf:ri,xsd:Xe}=Ae,Cr=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Mr=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,ni={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class at extends Oe{equals(e){return e===this}}class Dr{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0?!0:!!t.end;else{let r="";this._outputStream={write(s,o,u){r+=s,u&&u()},end:s=>{s&&s(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=ot,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new Dt(t.baseIRI)))}get _inDefaultGraph(){return ot.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,r,s,o){try{s.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
3
3
|
`:`
|
|
4
4
|
}
|
|
5
5
|
`)+(ot.equals(s)?"":`${this._encodeIriOrBlank(s)} {
|
|
@@ -7,18 +7,18 @@
|
|
|
7
7
|
${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,o):this._write(`${(this._subject===null?"":`.
|
|
8
8
|
`)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(r)}`,o)}catch(u){o&&o(u)}}_writeQuadLine(e,t,r,s,o){delete this._prefixMatch,this._write(this.quadToString(e,t,r,s),o)}quadToString(e,t,r,s){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(r)}${s&&s.value?` ${this._encodeIriOrBlank(s)} .
|
|
9
9
|
`:` .
|
|
10
|
-
`}`}quadsToString(e){let t="";for(const r of e)t+=this.quadToString(r.subject,r.predicate,r.object,r.graph);return t}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseIri&&(t=this._baseIri.toRelative(t)),
|
|
10
|
+
`}`}quadsToString(e){let t="";for(const r of e)t+=this.quadToString(r.subject,r.predicate,r.object,r.graph);return t}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let t=e.value;this._baseIri&&(t=this._baseIri.toRelative(t)),Cr.test(t)&&(t=t.replace(Mr,$r));const r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(Cr.test(t)&&(t=t.replace(Mr,$r)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Xe.string)return`"${t}"`}else switch(e.datatype.value){case Xe.string:return`"${t}"`;case Xe.boolean:if(t==="true"||t==="false")return t;break;case Xe.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Xe.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Xe.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t;break}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===ri.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:r,graph:s}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(r)}${Ct(s)?"":` ${this._encodeIriOrBlank(s)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,r,s,o){r===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):typeof s=="function"?this._writeQuad(e,t,r,ot,s):this._writeQuad(e,t,r,s||ot,o)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,r){const s={};s[e]=t,this.addPrefixes(s,r)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let r=!1;for(let s in e){let o=e[s];typeof o!="string"&&(o=o.value),r=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
11
11
|
`:`
|
|
12
12
|
}
|
|
13
13
|
`),this._subject=null,this._graph=""),this._prefixIRIs[o]=s+=":",this._write(`@prefix ${s} <${o}>.
|
|
14
|
-
`)}if(r){let s="",o="";for(const u in this._prefixIRIs)s+=s?`|${u}`:u,o+=(o?"|":"")+this._prefixIRIs[u];s=
|
|
14
|
+
`)}if(r){let s="",o="";for(const u in this._prefixIRIs)s+=s?`|${u}`:u,o+=(o?"|":"")+this._prefixIRIs[u];s=Et(s),this._prefixRegex=new RegExp(`^(?:${o})[^/]*$|^(${s})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(r?`
|
|
15
15
|
`:"",t)}blank(e,t){let r=e,s,o;switch(e===void 0?r=[]:e.termType?r=[{predicate:e,object:t}]:"length"in e||(r=[e]),o=r.length){case 0:return new at("[]");case 1:if(s=r[0],!(s.object instanceof at))return new at(`[ ${this._encodePredicate(s.predicate)} ${this._encodeObject(s.object)} ]`);default:let u="[";for(let a=0;a<o;a++)s=r[a],s.predicate.equals(e)?u+=`, ${this._encodeObject(s.object)}`:(u+=`${(a?`;
|
|
16
16
|
`:`
|
|
17
17
|
`)+this._encodePredicate(s.predicate)} ${this._encodeObject(s.object)}`,e=s.predicate);return new at(`${u}
|
|
18
18
|
]`)}}list(e){const t=e&&e.length||0,r=new Array(t);for(let s=0;s<t;s++)r[s]=this._encodeObject(e[s]);return new at(`(${r.join(" ")})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
19
19
|
`:`
|
|
20
20
|
}
|
|
21
|
-
`),this._subject=null),this._write=this._blockedWrite;let t=e&&((r,s)=>{t=null,e(r,s)});if(this._endStream)try{return this._outputStream.end(t)}catch{}t&&t()}}function $r(l){let e=ni[l];return e===void 0&&(l.length===1?(e=l.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((l.charCodeAt(0)-55296)*1024+l.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var $t={exports:{}},Ut={exports:{}},Wt,Ur;function
|
|
22
|
-
`;super(r),this.name="AggregateError",this.errors=t}}return Wt={AggregateError:l,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array},Wt}var qt={exports:{}},zt,Wr;function qr(){return Wr||(Wr=1,zt={format(l,...e){return l.replace(/%([sdifj])/g,function(...[t,r]){const s=e.shift();return r==="f"?s.toFixed(6):r==="j"?JSON.stringify(s):r==="s"&&typeof s=="object"?`${s.constructor!==Object?s.constructor.name:""} {}`.trim():s.toString()})},inspect(l){switch(typeof l){case"string":if(l.includes("'"))if(l.includes('"')){if(!l.includes("`")&&!l.includes("${"))return`\`${l}\``}else return`"${l}"`;return`'${l}'`;case"number":return isNaN(l)?"NaN":Object.is(l,-0)?String(l):l;case"bigint":return`${String(l)}n`;case"boolean":case"undefined":return String(l);case"object":return"{}"}}}),zt}var Gt,zr;function je(){if(zr)return Gt;zr=1;const{format:l,inspect:e}=qr(),{AggregateError:t}=Te(),r=globalThis.AggregateError||t,s=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,a="__node_internal_",b={};function h(y,_){if(!y)throw new b.ERR_INTERNAL_ASSERTION(_)}function x(y){let _="",m=y.length;const w=y[0]==="-"?1:0;for(;m>=w+4;m-=3)_=`_${y.slice(m-3,m)}${_}`;return`${y.slice(0,m)}${_}`}function T(y,_,m){if(typeof _=="function")return h(_.length<=m.length,`Code: ${y}; The provided arguments length (${m.length}) does not match the required ones (${_.length}).`),_(...m);const w=(_.match(/%[dfijoOs]/g)||[]).length;return h(w===m.length,`Code: ${y}; The provided arguments length (${m.length}) does not match the required ones (${w}).`),m.length===0?_:l(_,...m)}function j(y,_,m){m||(m=Error);class w extends m{constructor(...I){super(T(y,_,I))}toString(){return`${this.name} [${y}]: ${this.message}`}}Object.defineProperties(w.prototype,{name:{value:m.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${y}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),w.prototype.code=y,w.prototype[s]=!0,b[y]=w}function B(y){const _=a+y.name;return Object.defineProperty(y,"name",{value:_}),y}function A(y,_){if(y&&_&&y!==_){if(Array.isArray(_.errors))return _.errors.push(y),_;const m=new r([_,y],_.message);return m.code=_.code,m}return y||_}class v extends Error{constructor(_="The operation was aborted",m=void 0){if(m!==void 0&&typeof m!="object")throw new b.ERR_INVALID_ARG_TYPE("options","Object",m);super(_,m),this.code="ABORT_ERR",this.name="AbortError"}}return j("ERR_ASSERTION","%s",Error),j("ERR_INVALID_ARG_TYPE",(y,_,m)=>{h(typeof y=="string","'name' must be a string"),Array.isArray(_)||(_=[_]);let w="The ";y.endsWith(" argument")?w+=`${y} `:w+=`"${y}" ${y.includes(".")?"property":"argument"} `,w+="must be ";const P=[],I=[],H=[];for(const z of _)h(typeof z=="string","All expected entries have to be of type string"),o.includes(z)?P.push(z.toLowerCase()):u.test(z)?I.push(z):(h(z!=="object",'The value "object" should be written as "Object"'),H.push(z));if(I.length>0){const z=P.indexOf("object");z!==-1&&(P.splice(P,z,1),I.push("Object"))}if(P.length>0){switch(P.length){case 1:w+=`of type ${P[0]}`;break;case 2:w+=`one of type ${P[0]} or ${P[1]}`;break;default:{const z=P.pop();w+=`one of type ${P.join(", ")}, or ${z}`}}(I.length>0||H.length>0)&&(w+=" or ")}if(I.length>0){switch(I.length){case 1:w+=`an instance of ${I[0]}`;break;case 2:w+=`an instance of ${I[0]} or ${I[1]}`;break;default:{const z=I.pop();w+=`an instance of ${I.join(", ")}, or ${z}`}}H.length>0&&(w+=" or ")}switch(H.length){case 0:break;case 1:H[0].toLowerCase()!==H[0]&&(w+="an "),w+=`${H[0]}`;break;case 2:w+=`one of ${H[0]} or ${H[1]}`;break;default:{const z=H.pop();w+=`one of ${H.join(", ")}, or ${z}`}}if(m==null)w+=`. Received ${m}`;else if(typeof m=="function"&&m.name)w+=`. Received function ${m.name}`;else if(typeof m=="object"){var K;if((K=m.constructor)!==null&&K!==void 0&&K.name)w+=`. Received an instance of ${m.constructor.name}`;else{const z=e(m,{depth:-1});w+=`. Received ${z}`}}else{let z=e(m,{colors:!1});z.length>25&&(z=`${z.slice(0,25)}...`),w+=`. Received type ${typeof m} (${z})`}return w},TypeError),j("ERR_INVALID_ARG_VALUE",(y,_,m="is invalid")=>{let w=e(_);return w.length>128&&(w=w.slice(0,128)+"..."),`The ${y.includes(".")?"property":"argument"} '${y}' ${m}. Received ${w}`},TypeError),j("ERR_INVALID_RETURN_VALUE",(y,_,m)=>{var w;const P=m!=null&&(w=m.constructor)!==null&&w!==void 0&&w.name?`instance of ${m.constructor.name}`:`type ${typeof m}`;return`Expected ${y} to be returned from the "${_}" function but got ${P}.`},TypeError),j("ERR_MISSING_ARGS",(...y)=>{h(y.length>0,"At least one arg needs to be specified");let _;const m=y.length;switch(y=(Array.isArray(y)?y:[y]).map(w=>`"${w}"`).join(" or "),m){case 1:_+=`The ${y[0]} argument`;break;case 2:_+=`The ${y[0]} and ${y[1]} arguments`;break;default:{const w=y.pop();_+=`The ${y.join(", ")}, and ${w} arguments`}break}return`${_} must be specified`},TypeError),j("ERR_OUT_OF_RANGE",(y,_,m)=>{h(_,'Missing "range" argument');let w;if(Number.isInteger(m)&&Math.abs(m)>2**32)w=x(String(m));else if(typeof m=="bigint"){w=String(m);const P=BigInt(2)**BigInt(32);(m>P||m<-P)&&(w=x(w)),w+="n"}else w=e(m);return`The value of "${y}" is out of range. It must be ${_}. Received ${w}`},RangeError),j("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),j("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),j("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),j("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),j("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),j("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),j("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),j("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),j("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),j("ERR_STREAM_WRITE_AFTER_END","write after end",Error),j("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Gt={AbortError:v,aggregateTwoErrors:B(A),hideStackFrames:B,codes:b},Gt}var lt={exports:{}},Gr;function ut(){if(Gr)return lt.exports;Gr=1;const{AbortController:l,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return lt.exports=l,lt.exports.AbortSignal=e,lt.exports.default=l,lt.exports}var It={exports:{}},Hr;function Rt(){if(Hr)return It.exports;Hr=1;var l=typeof Reflect=="object"?Reflect:null,e=l&&typeof l.apply=="function"?l.apply:function(I,H,K){return Function.prototype.apply.call(I,H,K)},t;l&&typeof l.ownKeys=="function"?t=l.ownKeys:Object.getOwnPropertySymbols?t=function(I){return Object.getOwnPropertyNames(I).concat(Object.getOwnPropertySymbols(I))}:t=function(I){return Object.getOwnPropertyNames(I)};function r(P){console&&console.warn&&console.warn(P)}var s=Number.isNaN||function(I){return I!==I};function o(){o.init.call(this)}It.exports=o,It.exports.once=_,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var u=10;function a(P){if(typeof P!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof P)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(P){if(typeof P!="number"||P<0||s(P))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+P+".");u=P}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(I){if(typeof I!="number"||I<0||s(I))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+I+".");return this._maxListeners=I,this};function b(P){return P._maxListeners===void 0?o.defaultMaxListeners:P._maxListeners}o.prototype.getMaxListeners=function(){return b(this)},o.prototype.emit=function(I){for(var H=[],K=1;K<arguments.length;K++)H.push(arguments[K]);var z=I==="error",fe=this._events;if(fe!==void 0)z=z&&fe.error===void 0;else if(!z)return!1;if(z){var k;if(H.length>0&&(k=H[0]),k instanceof Error)throw k;var C=new Error("Unhandled error."+(k?" ("+k.message+")":""));throw C.context=k,C}var V=fe[I];if(V===void 0)return!1;if(typeof V=="function")e(V,this,H);else for(var L=V.length,ne=A(V,L),K=0;K<L;++K)e(ne[K],this,H);return!0};function h(P,I,H,K){var z,fe,k;if(a(H),fe=P._events,fe===void 0?(fe=P._events=Object.create(null),P._eventsCount=0):(fe.newListener!==void 0&&(P.emit("newListener",I,H.listener?H.listener:H),fe=P._events),k=fe[I]),k===void 0)k=fe[I]=H,++P._eventsCount;else if(typeof k=="function"?k=fe[I]=K?[H,k]:[k,H]:K?k.unshift(H):k.push(H),z=b(P),z>0&&k.length>z&&!k.warned){k.warned=!0;var C=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");C.name="MaxListenersExceededWarning",C.emitter=P,C.type=I,C.count=k.length,r(C)}return P}o.prototype.addListener=function(I,H){return h(this,I,H,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(I,H){return h(this,I,H,!0)};function x(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function T(P,I,H){var K={fired:!1,wrapFn:void 0,target:P,type:I,listener:H},z=x.bind(K);return z.listener=H,K.wrapFn=z,z}o.prototype.once=function(I,H){return a(H),this.on(I,T(this,I,H)),this},o.prototype.prependOnceListener=function(I,H){return a(H),this.prependListener(I,T(this,I,H)),this},o.prototype.removeListener=function(I,H){var K,z,fe,k,C;if(a(H),z=this._events,z===void 0)return this;if(K=z[I],K===void 0)return this;if(K===H||K.listener===H)--this._eventsCount===0?this._events=Object.create(null):(delete z[I],z.removeListener&&this.emit("removeListener",I,K.listener||H));else if(typeof K!="function"){for(fe=-1,k=K.length-1;k>=0;k--)if(K[k]===H||K[k].listener===H){C=K[k].listener,fe=k;break}if(fe<0)return this;fe===0?K.shift():v(K,fe),K.length===1&&(z[I]=K[0]),z.removeListener!==void 0&&this.emit("removeListener",I,C||H)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(I){var H,K,z;if(K=this._events,K===void 0)return this;if(K.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):K[I]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete K[I]),this;if(arguments.length===0){var fe=Object.keys(K),k;for(z=0;z<fe.length;++z)k=fe[z],k!=="removeListener"&&this.removeAllListeners(k);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(H=K[I],typeof H=="function")this.removeListener(I,H);else if(H!==void 0)for(z=H.length-1;z>=0;z--)this.removeListener(I,H[z]);return this};function j(P,I,H){var K=P._events;if(K===void 0)return[];var z=K[I];return z===void 0?[]:typeof z=="function"?H?[z.listener||z]:[z]:H?y(z):A(z,z.length)}o.prototype.listeners=function(I){return j(this,I,!0)},o.prototype.rawListeners=function(I){return j(this,I,!1)},o.listenerCount=function(P,I){return typeof P.listenerCount=="function"?P.listenerCount(I):B.call(P,I)},o.prototype.listenerCount=B;function B(P){var I=this._events;if(I!==void 0){var H=I[P];if(typeof H=="function")return 1;if(H!==void 0)return H.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function A(P,I){for(var H=new Array(I),K=0;K<I;++K)H[K]=P[K];return H}function v(P,I){for(;I+1<P.length;I++)P[I]=P[I+1];P.pop()}function y(P){for(var I=new Array(P.length),H=0;H<I.length;++H)I[H]=P[H].listener||P[H];return I}function _(P,I){return new Promise(function(H,K){function z(k){P.removeListener(I,fe),K(k)}function fe(){typeof P.removeListener=="function"&&P.removeListener("error",z),H([].slice.call(arguments))}w(P,I,fe,{once:!0}),I!=="error"&&m(P,z,{once:!0})})}function m(P,I,H){typeof P.on=="function"&&w(P,"error",I,H)}function w(P,I,H,K){if(typeof P.on=="function")K.once?P.once(I,H):P.on(I,H);else if(typeof P.addEventListener=="function")P.addEventListener(I,function z(fe){K.once&&P.removeEventListener(I,z),H(fe)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}return It.exports}var Qr;function Le(){return Qr||(Qr=1,(function(l){const e=Me(),{format:t,inspect:r}=qr(),{codes:{ERR_INVALID_ARG_TYPE:s}}=je(),{kResistStopPropagation:o,AggregateError:u,SymbolDispose:a}=Te(),b=globalThis.AbortSignal||ut().AbortSignal,h=globalThis.AbortController||ut().AbortController,x=Object.getPrototypeOf(async function(){}).constructor,T=globalThis.Blob||e.Blob,j=typeof T<"u"?function(y){return y instanceof T}:function(y){return!1},B=(v,y)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new s(y,"AbortSignal",v)},A=(v,y)=>{if(typeof v!="function")throw new s(y,"Function",v)};l.exports={AggregateError:u,kEmptyObject:Object.freeze({}),once(v){let y=!1;return function(..._){y||(y=!0,v.apply(this,_))}},createDeferredPromise:function(){let v,y;return{promise:new Promise((m,w)=>{v=m,y=w}),resolve:v,reject:y}},promisify(v){return new Promise((y,_)=>{v((m,...w)=>m?_(m):y(...w))})},debuglog(){return function(){}},format:t,inspect:r,types:{isAsyncFunction(v){return v instanceof x},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:j,deprecate(v,y){return v},addAbortListener:Rt().addAbortListener||function(y,_){if(y===void 0)throw new s("signal","AbortSignal",y);B(y,"signal"),A(_,"listener");let m;return y.aborted?queueMicrotask(()=>_()):(y.addEventListener("abort",_,{__proto__:null,once:!0,[o]:!0}),m=()=>{y.removeEventListener("abort",_)}),{__proto__:null,[a](){var w;(w=m)===null||w===void 0||w()}}},AbortSignalAny:b.any||function(y){if(y.length===1)return y[0];const _=new h,m=()=>_.abort();return y.forEach(w=>{B(w,"signals"),w.addEventListener("abort",m,{once:!0})}),_.signal.addEventListener("abort",()=>{y.forEach(w=>w.removeEventListener("abort",m))},{once:!0}),_.signal}},l.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(qt)),qt.exports}var Tt={},Ht,Vr;function ft(){if(Vr)return Ht;Vr=1;const{ArrayIsArray:l,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:r,NumberIsInteger:s,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:a,NumberParseInt:b,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:x,String:T,StringPrototypeToUpperCase:j,StringPrototypeTrim:B}=Te(),{hideStackFrames:A,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:y,ERR_INVALID_ARG_VALUE:_,ERR_OUT_OF_RANGE:m,ERR_UNKNOWN_SIGNAL:w}}=je(),{normalizeEncoding:P}=Le(),{isAsyncFunction:I,isArrayBufferView:H}=Le().types,K={};function z(R){return R===(R|0)}function fe(R){return R===R>>>0}const k=/^[0-7]+$/,C="must be a 32-bit unsigned integer or an octal string";function V(R,Q,Y){if(typeof R>"u"&&(R=Y),typeof R=="string"){if(x(k,R)===null)throw new _(Q,R,C);R=b(R,8)}return se(R,Q),R}const L=A((R,Q,Y=a,$=u)=>{if(typeof R!="number")throw new y(Q,"number",R);if(!s(R))throw new m(Q,"an integer",R);if(R<Y||R>$)throw new m(Q,`>= ${Y} && <= ${$}`,R)}),ne=A((R,Q,Y=-2147483648,$=2147483647)=>{if(typeof R!="number")throw new y(Q,"number",R);if(!s(R))throw new m(Q,"an integer",R);if(R<Y||R>$)throw new m(Q,`>= ${Y} && <= ${$}`,R)}),se=A((R,Q,Y=!1)=>{if(typeof R!="number")throw new y(Q,"number",R);if(!s(R))throw new m(Q,"an integer",R);const $=Y?1:0,we=4294967295;if(R<$||R>we)throw new m(Q,`>= ${$} && <= ${we}`,R)});function ue(R,Q){if(typeof R!="string")throw new y(Q,"string",R)}function be(R,Q,Y=void 0,$){if(typeof R!="number")throw new y(Q,"number",R);if(Y!=null&&R<Y||$!=null&&R>$||(Y!=null||$!=null)&&o(R))throw new m(Q,`${Y!=null?`>= ${Y}`:""}${Y!=null&&$!=null?" && ":""}${$!=null?`<= ${$}`:""}`,R)}const W=A((R,Q,Y)=>{if(!e(Y,R)){const we="must be one of: "+t(r(Y,Ne=>typeof Ne=="string"?`'${Ne}'`:T(Ne)),", ");throw new _(Q,R,we)}});function ae(R,Q){if(typeof R!="boolean")throw new y(Q,"boolean",R)}function g(R,Q,Y){return R==null||!h(R,Q)?Y:R[Q]}const M=A((R,Q,Y=null)=>{const $=g(Y,"allowArray",!1),we=g(Y,"allowFunction",!1);if(!g(Y,"nullable",!1)&&R===null||!$&&l(R)||typeof R!="object"&&(!we||typeof R!="function"))throw new y(Q,"Object",R)}),X=A((R,Q)=>{if(R!=null&&typeof R!="object"&&typeof R!="function")throw new y(Q,"a dictionary",R)}),U=A((R,Q,Y=0)=>{if(!l(R))throw new y(Q,"Array",R);if(R.length<Y){const $=`must be longer than ${Y}`;throw new _(Q,R,$)}});function oe(R,Q){U(R,Q);for(let Y=0;Y<R.length;Y++)ue(R[Y],`${Q}[${Y}]`)}function ce(R,Q){U(R,Q);for(let Y=0;Y<R.length;Y++)ae(R[Y],`${Q}[${Y}]`)}function ge(R,Q){U(R,Q);for(let Y=0;Y<R.length;Y++){const $=R[Y],we=`${Q}[${Y}]`;if($==null)throw new y(we,"AbortSignal",$);he($,we)}}function pe(R,Q="signal"){if(ue(R,Q),K[R]===void 0)throw K[j(R)]!==void 0?new w(R+" (signals must use all capital letters)"):new w(R)}const D=A((R,Q="buffer")=>{if(!H(R))throw new y(Q,["Buffer","TypedArray","DataView"],R)});function G(R,Q){const Y=P(Q),$=R.length;if(Y==="hex"&&$%2!==0)throw new _("encoding",Q,`is invalid for data of length ${$}`)}function ie(R,Q="Port",Y=!0){if(typeof R!="number"&&typeof R!="string"||typeof R=="string"&&B(R).length===0||+R!==+R>>>0||R>65535||R===0&&!Y)throw new v(Q,R,Y);return R|0}const he=A((R,Q)=>{if(R!==void 0&&(R===null||typeof R!="object"||!("aborted"in R)))throw new y(Q,"AbortSignal",R)}),de=A((R,Q)=>{if(typeof R!="function")throw new y(Q,"Function",R)}),S=A((R,Q)=>{if(typeof R!="function"||I(R))throw new y(Q,"Function",R)}),N=A((R,Q)=>{if(R!==void 0)throw new y(Q,"undefined",R)});function O(R,Q,Y){if(!e(Y,R))throw new y(Q,`('${t(Y,"|")}')`,R)}const ee=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function J(R,Q){if(typeof R>"u"||!x(ee,R))throw new _(Q,R,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Z(R){if(typeof R=="string")return J(R,"hints"),R;if(l(R)){const Q=R.length;let Y="";if(Q===0)return Y;for(let $=0;$<Q;$++){const we=R[$];J(we,"hints"),Y+=we,$!==Q-1&&(Y+=", ")}return Y}throw new _("hints",R,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Ht={isInt32:z,isUint32:fe,parseFileMode:V,validateArray:U,validateStringArray:oe,validateBooleanArray:ce,validateAbortSignalArray:ge,validateBoolean:ae,validateBuffer:D,validateDictionary:X,validateEncoding:G,validateFunction:de,validateInt32:ne,validateInteger:L,validateNumber:be,validateObject:M,validateOneOf:W,validatePlainFunction:S,validatePort:ie,validateSignalName:pe,validateString:ue,validateUint32:se,validateUndefined:N,validateUnion:O,validateAbortSignal:he,validateLinkHeaderValue:Z},Ht}var vt={exports:{}},Qt={exports:{}},Kr;function He(){if(Kr)return Qt.exports;Kr=1;var l=Qt.exports={},e,t;function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?t=clearTimeout:t=s}catch{t=s}})();function o(v){if(e===setTimeout)return setTimeout(v,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(v,0);try{return e(v,0)}catch{try{return e.call(null,v,0)}catch{return e.call(this,v,0)}}}function u(v){if(t===clearTimeout)return clearTimeout(v);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(v);try{return t(v)}catch{try{return t.call(null,v)}catch{return t.call(this,v)}}}var a=[],b=!1,h,x=-1;function T(){!b||!h||(b=!1,h.length?a=h.concat(a):x=-1,a.length&&j())}function j(){if(!b){var v=o(T);b=!0;for(var y=a.length;y;){for(h=a,a=[];++x<y;)h&&h[x].run();x=-1,y=a.length}h=null,b=!1,u(v)}}l.nextTick=function(v){var y=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)y[_-1]=arguments[_];a.push(new B(v,y)),a.length===1&&!b&&o(j)};function B(v,y){this.fun=v,this.array=y}B.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={};function A(){}return l.on=A,l.addListener=A,l.once=A,l.off=A,l.removeListener=A,l.removeAllListeners=A,l.emit=A,l.prependListener=A,l.prependOnceListener=A,l.listeners=function(v){return[]},l.binding=function(v){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(v){throw new Error("process.chdir is not supported")},l.umask=function(){return 0},Qt.exports}var Vt,Yr;function De(){if(Yr)return Vt;Yr=1;const{SymbolAsyncIterator:l,SymbolIterator:e,SymbolFor:t}=Te(),r=t("nodejs.stream.destroyed"),s=t("nodejs.stream.errored"),o=t("nodejs.stream.readable"),u=t("nodejs.stream.writable"),a=t("nodejs.stream.disturbed"),b=t("nodejs.webstream.isClosedPromise"),h=t("nodejs.webstream.controllerErrorFunction");function x(g,M=!1){var X;return!!(g&&typeof g.pipe=="function"&&typeof g.on=="function"&&(!M||typeof g.pause=="function"&&typeof g.resume=="function")&&(!g._writableState||((X=g._readableState)===null||X===void 0?void 0:X.readable)!==!1)&&(!g._writableState||g._readableState))}function T(g){var M;return!!(g&&typeof g.write=="function"&&typeof g.on=="function"&&(!g._readableState||((M=g._writableState)===null||M===void 0?void 0:M.writable)!==!1))}function j(g){return!!(g&&typeof g.pipe=="function"&&g._readableState&&typeof g.on=="function"&&typeof g.write=="function")}function B(g){return g&&(g._readableState||g._writableState||typeof g.write=="function"&&typeof g.on=="function"||typeof g.pipe=="function"&&typeof g.on=="function")}function A(g){return!!(g&&!B(g)&&typeof g.pipeThrough=="function"&&typeof g.getReader=="function"&&typeof g.cancel=="function")}function v(g){return!!(g&&!B(g)&&typeof g.getWriter=="function"&&typeof g.abort=="function")}function y(g){return!!(g&&!B(g)&&typeof g.readable=="object"&&typeof g.writable=="object")}function _(g){return A(g)||v(g)||y(g)}function m(g,M){return g==null?!1:M===!0?typeof g[l]=="function":M===!1?typeof g[e]=="function":typeof g[l]=="function"||typeof g[e]=="function"}function w(g){if(!B(g))return null;const M=g._writableState,X=g._readableState,U=M||X;return!!(g.destroyed||g[r]||U!=null&&U.destroyed)}function P(g){if(!T(g))return null;if(g.writableEnded===!0)return!0;const M=g._writableState;return M!=null&&M.errored?!1:typeof M?.ended!="boolean"?null:M.ended}function I(g,M){if(!T(g))return null;if(g.writableFinished===!0)return!0;const X=g._writableState;return X!=null&&X.errored?!1:typeof X?.finished!="boolean"?null:!!(X.finished||M===!1&&X.ended===!0&&X.length===0)}function H(g){if(!x(g))return null;if(g.readableEnded===!0)return!0;const M=g._readableState;return!M||M.errored?!1:typeof M?.ended!="boolean"?null:M.ended}function K(g,M){if(!x(g))return null;const X=g._readableState;return X!=null&&X.errored?!1:typeof X?.endEmitted!="boolean"?null:!!(X.endEmitted||M===!1&&X.ended===!0&&X.length===0)}function z(g){return g&&g[o]!=null?g[o]:typeof g?.readable!="boolean"?null:w(g)?!1:x(g)&&g.readable&&!K(g)}function fe(g){return g&&g[u]!=null?g[u]:typeof g?.writable!="boolean"?null:w(g)?!1:T(g)&&g.writable&&!P(g)}function k(g,M){return B(g)?w(g)?!0:!(M?.readable!==!1&&z(g)||M?.writable!==!1&&fe(g)):null}function C(g){var M,X;return B(g)?g.writableErrored?g.writableErrored:(M=(X=g._writableState)===null||X===void 0?void 0:X.errored)!==null&&M!==void 0?M:null:null}function V(g){var M,X;return B(g)?g.readableErrored?g.readableErrored:(M=(X=g._readableState)===null||X===void 0?void 0:X.errored)!==null&&M!==void 0?M:null:null}function L(g){if(!B(g))return null;if(typeof g.closed=="boolean")return g.closed;const M=g._writableState,X=g._readableState;return typeof M?.closed=="boolean"||typeof X?.closed=="boolean"?M?.closed||X?.closed:typeof g._closed=="boolean"&&ne(g)?g._closed:null}function ne(g){return typeof g._closed=="boolean"&&typeof g._defaultKeepAlive=="boolean"&&typeof g._removedConnection=="boolean"&&typeof g._removedContLen=="boolean"}function se(g){return typeof g._sent100=="boolean"&&ne(g)}function ue(g){var M;return typeof g._consuming=="boolean"&&typeof g._dumped=="boolean"&&((M=g.req)===null||M===void 0?void 0:M.upgradeOrConnect)===void 0}function be(g){if(!B(g))return null;const M=g._writableState,X=g._readableState,U=M||X;return!U&&se(g)||!!(U&&U.autoDestroy&&U.emitClose&&U.closed===!1)}function W(g){var M;return!!(g&&((M=g[a])!==null&&M!==void 0?M:g.readableDidRead||g.readableAborted))}function ae(g){var M,X,U,oe,ce,ge,pe,D,G,ie;return!!(g&&((M=(X=(U=(oe=(ce=(ge=g[s])!==null&&ge!==void 0?ge:g.readableErrored)!==null&&ce!==void 0?ce:g.writableErrored)!==null&&oe!==void 0?oe:(pe=g._readableState)===null||pe===void 0?void 0:pe.errorEmitted)!==null&&U!==void 0?U:(D=g._writableState)===null||D===void 0?void 0:D.errorEmitted)!==null&&X!==void 0?X:(G=g._readableState)===null||G===void 0?void 0:G.errored)!==null&&M!==void 0?M:!((ie=g._writableState)===null||ie===void 0)&&ie.errored))}return Vt={isDestroyed:w,kIsDestroyed:r,isDisturbed:W,kIsDisturbed:a,isErrored:ae,kIsErrored:s,isReadable:z,kIsReadable:o,kIsClosedPromise:b,kControllerErrorFunction:h,kIsWritable:u,isClosed:L,isDuplexNodeStream:j,isFinished:k,isIterable:m,isReadableNodeStream:x,isReadableStream:A,isReadableEnded:H,isReadableFinished:K,isReadableErrored:V,isNodeStream:B,isWebStream:_,isWritable:fe,isWritableNodeStream:T,isWritableStream:v,isWritableEnded:P,isWritableFinished:I,isWritableErrored:C,isServerRequest:ue,isServerResponse:se,willEmitClose:be,isTransformStream:y},Vt}var Xr;function We(){if(Xr)return vt.exports;Xr=1;const l=He(),{AbortError:e,codes:t}=je(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:s}=t,{kEmptyObject:o,once:u}=Le(),{validateAbortSignal:a,validateFunction:b,validateObject:h,validateBoolean:x}=ft(),{Promise:T,PromisePrototypeThen:j,SymbolDispose:B}=Te(),{isClosed:A,isReadable:v,isReadableNodeStream:y,isReadableStream:_,isReadableFinished:m,isReadableErrored:w,isWritable:P,isWritableNodeStream:I,isWritableStream:H,isWritableFinished:K,isWritableErrored:z,isNodeStream:fe,willEmitClose:k,kIsClosedPromise:C}=De();let V;function L(W){return W.setHeader&&typeof W.abort=="function"}const ne=()=>{};function se(W,ae,g){var M,X;if(arguments.length===2?(g=ae,ae=o):ae==null?ae=o:h(ae,"options"),b(g,"callback"),a(ae.signal,"options.signal"),g=u(g),_(W)||H(W))return ue(W,ae,g);if(!fe(W))throw new r("stream",["ReadableStream","WritableStream","Stream"],W);const U=(M=ae.readable)!==null&&M!==void 0?M:y(W),oe=(X=ae.writable)!==null&&X!==void 0?X:I(W),ce=W._writableState,ge=W._readableState,pe=()=>{W.writable||ie()};let D=k(W)&&y(W)===U&&I(W)===oe,G=K(W,!1);const ie=()=>{G=!0,W.destroyed&&(D=!1),!(D&&(!W.readable||U))&&(!U||he)&&g.call(W)};let he=m(W,!1);const de=()=>{he=!0,W.destroyed&&(D=!1),!(D&&(!W.writable||oe))&&(!oe||G)&&g.call(W)},S=R=>{g.call(W,R)};let N=A(W);const O=()=>{N=!0;const R=z(W)||w(W);if(R&&typeof R!="boolean")return g.call(W,R);if(U&&!he&&y(W,!0)&&!m(W,!1))return g.call(W,new s);if(oe&&!G&&!K(W,!1))return g.call(W,new s);g.call(W)},ee=()=>{N=!0;const R=z(W)||w(W);if(R&&typeof R!="boolean")return g.call(W,R);g.call(W)},J=()=>{W.req.on("finish",ie)};L(W)?(W.on("complete",ie),D||W.on("abort",O),W.req?J():W.on("request",J)):oe&&!ce&&(W.on("end",pe),W.on("close",pe)),!D&&typeof W.aborted=="boolean"&&W.on("aborted",O),W.on("end",de),W.on("finish",ie),ae.error!==!1&&W.on("error",S),W.on("close",O),N?l.nextTick(O):ce!=null&&ce.errorEmitted||ge!=null&&ge.errorEmitted?D||l.nextTick(ee):(!U&&(!D||v(W))&&(G||P(W)===!1)||!oe&&(!D||P(W))&&(he||v(W)===!1)||ge&&W.req&&W.aborted)&&l.nextTick(ee);const Z=()=>{g=ne,W.removeListener("aborted",O),W.removeListener("complete",ie),W.removeListener("abort",O),W.removeListener("request",J),W.req&&W.req.removeListener("finish",ie),W.removeListener("end",pe),W.removeListener("close",pe),W.removeListener("finish",ie),W.removeListener("end",de),W.removeListener("error",S),W.removeListener("close",O)};if(ae.signal&&!N){const R=()=>{const Q=g;Z(),Q.call(W,new e(void 0,{cause:ae.signal.reason}))};if(ae.signal.aborted)l.nextTick(R);else{V=V||Le().addAbortListener;const Q=V(ae.signal,R),Y=g;g=u((...$)=>{Q[B](),Y.apply(W,$)})}}return Z}function ue(W,ae,g){let M=!1,X=ne;if(ae.signal)if(X=()=>{M=!0,g.call(W,new e(void 0,{cause:ae.signal.reason}))},ae.signal.aborted)l.nextTick(X);else{V=V||Le().addAbortListener;const oe=V(ae.signal,X),ce=g;g=u((...ge)=>{oe[B](),ce.apply(W,ge)})}const U=(...oe)=>{M||l.nextTick(()=>g.apply(W,oe))};return j(W[C].promise,U,U),ne}function be(W,ae){var g;let M=!1;return ae===null&&(ae=o),(g=ae)!==null&&g!==void 0&&g.cleanup&&(x(ae.cleanup,"cleanup"),M=ae.cleanup),new T((X,U)=>{const oe=se(W,ae,ce=>{M&&oe(),ce?U(ce):X()})})}return vt.exports=se,vt.exports.finished=be,vt.exports}var Kt,Jr;function Ze(){if(Jr)return Kt;Jr=1;const l=He(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:r}=je(),{Symbol:s}=Te(),{kIsDestroyed:o,isDestroyed:u,isFinished:a,isServerRequest:b}=De(),h=s("kDestroy"),x=s("kConstruct");function T(k,C,V){k&&(k.stack,C&&!C.errored&&(C.errored=k),V&&!V.errored&&(V.errored=k))}function j(k,C){const V=this._readableState,L=this._writableState,ne=L||V;return L!=null&&L.destroyed||V!=null&&V.destroyed?(typeof C=="function"&&C(),this):(T(k,L,V),L&&(L.destroyed=!0),V&&(V.destroyed=!0),ne.constructed?B(this,k,C):this.once(h,function(se){B(this,e(se,k),C)}),this)}function B(k,C,V){let L=!1;function ne(se){if(L)return;L=!0;const ue=k._readableState,be=k._writableState;T(se,be,ue),be&&(be.closed=!0),ue&&(ue.closed=!0),typeof V=="function"&&V(se),se?l.nextTick(A,k,se):l.nextTick(v,k)}try{k._destroy(C||null,ne)}catch(se){ne(se)}}function A(k,C){y(k,C),v(k)}function v(k){const C=k._readableState,V=k._writableState;V&&(V.closeEmitted=!0),C&&(C.closeEmitted=!0),(V!=null&&V.emitClose||C!=null&&C.emitClose)&&k.emit("close")}function y(k,C){const V=k._readableState,L=k._writableState;L!=null&&L.errorEmitted||V!=null&&V.errorEmitted||(L&&(L.errorEmitted=!0),V&&(V.errorEmitted=!0),k.emit("error",C))}function _(){const k=this._readableState,C=this._writableState;k&&(k.constructed=!0,k.closed=!1,k.closeEmitted=!1,k.destroyed=!1,k.errored=null,k.errorEmitted=!1,k.reading=!1,k.ended=k.readable===!1,k.endEmitted=k.readable===!1),C&&(C.constructed=!0,C.destroyed=!1,C.closed=!1,C.closeEmitted=!1,C.errored=null,C.errorEmitted=!1,C.finalCalled=!1,C.prefinished=!1,C.ended=C.writable===!1,C.ending=C.writable===!1,C.finished=C.writable===!1)}function m(k,C,V){const L=k._readableState,ne=k._writableState;if(ne!=null&&ne.destroyed||L!=null&&L.destroyed)return this;L!=null&&L.autoDestroy||ne!=null&&ne.autoDestroy?k.destroy(C):C&&(C.stack,ne&&!ne.errored&&(ne.errored=C),L&&!L.errored&&(L.errored=C),V?l.nextTick(y,k,C):y(k,C))}function w(k,C){if(typeof k._construct!="function")return;const V=k._readableState,L=k._writableState;V&&(V.constructed=!1),L&&(L.constructed=!1),k.once(x,C),!(k.listenerCount(x)>1)&&l.nextTick(P,k)}function P(k){let C=!1;function V(L){if(C){m(k,L??new t);return}C=!0;const ne=k._readableState,se=k._writableState,ue=se||ne;ne&&(ne.constructed=!0),se&&(se.constructed=!0),ue.destroyed?k.emit(h,L):L?m(k,L,!0):l.nextTick(I,k)}try{k._construct(L=>{l.nextTick(V,L)})}catch(L){l.nextTick(V,L)}}function I(k){k.emit(x)}function H(k){return k?.setHeader&&typeof k.abort=="function"}function K(k){k.emit("close")}function z(k,C){k.emit("error",C),l.nextTick(K,k)}function fe(k,C){!k||u(k)||(!C&&!a(k)&&(C=new r),b(k)?(k.socket=null,k.destroy(C)):H(k)?k.abort():H(k.req)?k.req.abort():typeof k.destroy=="function"?k.destroy(C):typeof k.close=="function"?k.close():C?l.nextTick(z,k,C):l.nextTick(K,k),k.destroyed||(k[o]=!0))}return Kt={construct:w,destroyer:fe,destroy:j,undestroy:_,errorOrDestroy:m},Kt}var Yt,Zr;function Xt(){if(Zr)return Yt;Zr=1;const{ArrayIsArray:l,ObjectSetPrototypeOf:e}=Te(),{EventEmitter:t}=Rt();function r(o){t.call(this,o)}e(r.prototype,t.prototype),e(r,t),r.prototype.pipe=function(o,u){const a=this;function b(v){o.writable&&o.write(v)===!1&&a.pause&&a.pause()}a.on("data",b);function h(){a.readable&&a.resume&&a.resume()}o.on("drain",h),!o._isStdio&&(!u||u.end!==!1)&&(a.on("end",T),a.on("close",j));let x=!1;function T(){x||(x=!0,o.end())}function j(){x||(x=!0,typeof o.destroy=="function"&&o.destroy())}function B(v){A(),t.listenerCount(this,"error")===0&&this.emit("error",v)}s(a,"error",B),s(o,"error",B);function A(){a.removeListener("data",b),o.removeListener("drain",h),a.removeListener("end",T),a.removeListener("close",j),a.removeListener("error",B),o.removeListener("error",B),a.removeListener("end",A),a.removeListener("close",A),o.removeListener("close",A)}return a.on("end",A),a.on("close",A),o.on("close",A),o.emit("pipe",a),o};function s(o,u,a){if(typeof o.prependListener=="function")return o.prependListener(u,a);!o._events||!o._events[u]?o.on(u,a):l(o._events[u])?o._events[u].unshift(a):o._events[u]=[a,o._events[u]]}return Yt={Stream:r,prependListener:s},Yt}var Jt={exports:{}},en;function At(){return en||(en=1,(function(l){const{SymbolDispose:e}=Te(),{AbortError:t,codes:r}=je(),{isNodeStream:s,isWebStream:o,kControllerErrorFunction:u}=De(),a=We(),{ERR_INVALID_ARG_TYPE:b}=r;let h;const x=(T,j)=>{if(typeof T!="object"||!("aborted"in T))throw new b(j,"AbortSignal",T)};l.exports.addAbortSignal=function(j,B){if(x(j,"signal"),!s(B)&&!o(B))throw new b("stream",["ReadableStream","WritableStream","Stream"],B);return l.exports.addAbortSignalNoValidate(j,B)},l.exports.addAbortSignalNoValidate=function(T,j){if(typeof T!="object"||!("aborted"in T))return j;const B=s(j)?()=>{j.destroy(new t(void 0,{cause:T.reason}))}:()=>{j[u](new t(void 0,{cause:T.reason}))};if(T.aborted)B();else{h=h||Le().addAbortListener;const A=h(T,B);a(j,A[e])}return j}})(Jt)),Jt.exports}var Zt,tn;function ii(){if(tn)return Zt;tn=1;const{StringPrototypeSlice:l,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:r}=Te(),{Buffer:s}=Me(),{inspect:o}=Le();return Zt=class{constructor(){this.head=null,this.tail=null,this.length=0}push(a){const b={data:a,next:null};this.length>0?this.tail.next=b:this.head=b,this.tail=b,++this.length}unshift(a){const b={data:a,next:this.head};this.length===0&&(this.tail=b),this.head=b,++this.length}shift(){if(this.length===0)return;const a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}clear(){this.head=this.tail=null,this.length=0}join(a){if(this.length===0)return"";let b=this.head,h=""+b.data;for(;(b=b.next)!==null;)h+=a+b.data;return h}concat(a){if(this.length===0)return s.alloc(0);const b=s.allocUnsafe(a>>>0);let h=this.head,x=0;for(;h;)t(b,h.data,x),x+=h.data.length,h=h.next;return b}consume(a,b){const h=this.head.data;if(a<h.length){const x=h.slice(0,a);return this.head.data=h.slice(a),x}return a===h.length?this.shift():b?this._getString(a):this._getBuffer(a)}first(){return this.head.data}*[e](){for(let a=this.head;a;a=a.next)yield a.data}_getString(a){let b="",h=this.head,x=0;do{const T=h.data;if(a>T.length)b+=T,a-=T.length;else{a===T.length?(b+=T,++x,h.next?this.head=h.next:this.head=this.tail=null):(b+=l(T,0,a),this.head=h,h.data=l(T,a));break}++x}while((h=h.next)!==null);return this.length-=x,b}_getBuffer(a){const b=s.allocUnsafe(a),h=a;let x=this.head,T=0;do{const j=x.data;if(a>j.length)t(b,j,h-a),a-=j.length;else{a===j.length?(t(b,j,h-a),++T,x.next?this.head=x.next:this.head=this.tail=null):(t(b,new r(j.buffer,j.byteOffset,a),h-a),this.head=x,x.data=j.slice(a));break}++T}while((x=x.next)!==null);return this.length-=T,b}[Symbol.for("nodejs.util.inspect.custom")](a,b){return o(this,{...b,depth:0,customInspect:!1})}},Zt}var er,rn;function Nt(){if(rn)return er;rn=1;const{MathFloor:l,NumberIsInteger:e}=Te(),{validateInteger:t}=ft(),{ERR_INVALID_ARG_VALUE:r}=je().codes;let s=16*1024,o=16;function u(x,T,j){return x.highWaterMark!=null?x.highWaterMark:T?x[j]:null}function a(x){return x?o:s}function b(x,T){t(T,"value",0),x?o=T:s=T}function h(x,T,j,B){const A=u(T,B,j);if(A!=null){if(!e(A)||A<0){const v=B?`options.${j}`:"options.highWaterMark";throw new r(v,A)}return l(A)}return a(x.objectMode)}return er={getHighWaterMark:h,getDefaultHighWaterMark:a,setDefaultHighWaterMark:b},er}var tr={},Pt={exports:{}};var nn;function si(){return nn||(nn=1,(function(l,e){var t=Me(),r=t.Buffer;function s(u,a){for(var b in u)a[b]=u[b]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?l.exports=t:(s(t,e),e.Buffer=o);function o(u,a,b){return r(u,a,b)}o.prototype=Object.create(r.prototype),s(r,o),o.from=function(u,a,b){if(typeof u=="number")throw new TypeError("Argument must not be a number");return r(u,a,b)},o.alloc=function(u,a,b){if(typeof u!="number")throw new TypeError("Argument must be a number");var h=r(u);return a!==void 0?typeof b=="string"?h.fill(a,b):h.fill(a):h.fill(0),h},o.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r(u)},o.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(u)}})(Pt,Pt.exports)),Pt.exports}var sn;function oi(){if(sn)return tr;sn=1;var l=si().Buffer,e=l.isEncoding||function(_){switch(_=""+_,_&&_.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(_){if(!_)return"utf8";for(var m;;)switch(_){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return _;default:if(m)return;_=(""+_).toLowerCase(),m=!0}}function r(_){var m=t(_);if(typeof m!="string"&&(l.isEncoding===e||!e(_)))throw new Error("Unknown encoding: "+_);return m||_}tr.StringDecoder=s;function s(_){this.encoding=r(_);var m;switch(this.encoding){case"utf16le":this.text=T,this.end=j,m=4;break;case"utf8":this.fillLast=b,m=4;break;case"base64":this.text=B,this.end=A,m=3;break;default:this.write=v,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=l.allocUnsafe(m)}s.prototype.write=function(_){if(_.length===0)return"";var m,w;if(this.lastNeed){if(m=this.fillLast(_),m===void 0)return"";w=this.lastNeed,this.lastNeed=0}else w=0;return w<_.length?m?m+this.text(_,w):this.text(_,w):m||""},s.prototype.end=x,s.prototype.text=h,s.prototype.fillLast=function(_){if(this.lastNeed<=_.length)return _.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,this.lastTotal-this.lastNeed,0,_.length),this.lastNeed-=_.length};function o(_){return _<=127?0:_>>5===6?2:_>>4===14?3:_>>3===30?4:_>>6===2?-1:-2}function u(_,m,w){var P=m.length-1;if(P<w)return 0;var I=o(m[P]);return I>=0?(I>0&&(_.lastNeed=I-1),I):--P<w||I===-2?0:(I=o(m[P]),I>=0?(I>0&&(_.lastNeed=I-2),I):--P<w||I===-2?0:(I=o(m[P]),I>=0?(I>0&&(I===2?I=0:_.lastNeed=I-3),I):0))}function a(_,m,w){if((m[0]&192)!==128)return _.lastNeed=0,"�";if(_.lastNeed>1&&m.length>1){if((m[1]&192)!==128)return _.lastNeed=1,"�";if(_.lastNeed>2&&m.length>2&&(m[2]&192)!==128)return _.lastNeed=2,"�"}}function b(_){var m=this.lastTotal-this.lastNeed,w=a(this,_);if(w!==void 0)return w;if(this.lastNeed<=_.length)return _.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);_.copy(this.lastChar,m,0,_.length),this.lastNeed-=_.length}function h(_,m){var w=u(this,_,m);if(!this.lastNeed)return _.toString("utf8",m);this.lastTotal=w;var P=_.length-(w-this.lastNeed);return _.copy(this.lastChar,0,P),_.toString("utf8",m,P)}function x(_){var m=_&&_.length?this.write(_):"";return this.lastNeed?m+"�":m}function T(_,m){if((_.length-m)%2===0){var w=_.toString("utf16le",m);if(w){var P=w.charCodeAt(w.length-1);if(P>=55296&&P<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1],w.slice(0,-1)}return w}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=_[_.length-1],_.toString("utf16le",m,_.length-1)}function j(_){var m=_&&_.length?this.write(_):"";if(this.lastNeed){var w=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,w)}return m}function B(_,m){var w=(_.length-m)%3;return w===0?_.toString("base64",m):(this.lastNeed=3-w,this.lastTotal=3,w===1?this.lastChar[0]=_[_.length-1]:(this.lastChar[0]=_[_.length-2],this.lastChar[1]=_[_.length-1]),_.toString("base64",m,_.length-w))}function A(_){var m=_&&_.length?this.write(_):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function v(_){return _.toString(this.encoding)}function y(_){return _&&_.length?this.write(_):""}return tr}var rr,on;function an(){if(on)return rr;on=1;const l=He(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:r}=Te(),{Buffer:s}=Me(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:u}=je().codes;function a(b,h,x){let T;if(typeof h=="string"||h instanceof s)return new b({objectMode:!0,...x,read(){this.push(h),this.push(null)}});let j;if(h&&h[t])j=!0,T=h[t]();else if(h&&h[r])j=!1,T=h[r]();else throw new o("iterable",["Iterable"],h);const B=new b({objectMode:!0,highWaterMark:1,...x});let A=!1;B._read=function(){A||(A=!0,y())},B._destroy=function(_,m){e(v(_),()=>l.nextTick(m,_),w=>l.nextTick(m,w||_))};async function v(_){const m=_!=null,w=typeof T.throw=="function";if(m&&w){const{value:P,done:I}=await T.throw(_);if(await P,I)return}if(typeof T.return=="function"){const{value:P}=await T.return();await P}}async function y(){for(;;){try{const{value:_,done:m}=j?await T.next():T.next();if(m)B.push(null);else{const w=_&&typeof _.then=="function"?await _:_;if(w===null)throw A=!1,new u;if(B.push(w))continue;A=!1}}catch(_){B.destroy(_)}break}}return B}return rr=a,rr}var nr,ln;function jt(){if(ln)return nr;ln=1;const l=He(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:r,NumberParseInt:s,ObjectDefineProperties:o,ObjectKeys:u,ObjectSetPrototypeOf:a,Promise:b,SafeSet:h,SymbolAsyncDispose:x,SymbolAsyncIterator:T,Symbol:j}=Te();nr=$,$.ReadableState=Y;const{EventEmitter:B}=Rt(),{Stream:A,prependListener:v}=Xt(),{Buffer:y}=Me(),{addAbortSignal:_}=At(),m=We();let w=Le().debuglog("stream",c=>{w=c});const P=ii(),I=Ze(),{getHighWaterMark:H,getDefaultHighWaterMark:K}=Nt(),{aggregateTwoErrors:z,codes:{ERR_INVALID_ARG_TYPE:fe,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_OUT_OF_RANGE:C,ERR_STREAM_PUSH_AFTER_EOF:V,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:L},AbortError:ne}=je(),{validateObject:se}=ft(),ue=j("kPaused"),{StringDecoder:be}=oi(),W=an();a($.prototype,A.prototype),a($,A);const ae=()=>{},{errorOrDestroy:g}=I,M=1,X=2,U=4,oe=8,ce=16,ge=32,pe=64,D=128,G=256,ie=512,he=1024,de=2048,S=4096,N=8192,O=16384,ee=32768,J=65536,Z=1<<17,R=1<<18;function Q(c){return{enumerable:!1,get(){return(this.state&c)!==0},set(p){p?this.state|=c:this.state&=~c}}}o(Y.prototype,{objectMode:Q(M),ended:Q(X),endEmitted:Q(U),reading:Q(oe),constructed:Q(ce),sync:Q(ge),needReadable:Q(pe),emittedReadable:Q(D),readableListening:Q(G),resumeScheduled:Q(ie),errorEmitted:Q(he),emitClose:Q(de),autoDestroy:Q(S),destroyed:Q(N),closed:Q(O),closeEmitted:Q(ee),multiAwaitDrain:Q(J),readingMore:Q(Z),dataEmitted:Q(R)});function Y(c,p,te){typeof te!="boolean"&&(te=p instanceof $e()),this.state=de|S|ce|ge,c&&c.objectMode&&(this.state|=M),te&&c&&c.readableObjectMode&&(this.state|=M),this.highWaterMark=c?H(this,c,"readableHighWaterMark",te):K(!1),this.buffer=new P,this.length=0,this.pipes=[],this.flowing=null,this[ue]=null,c&&c.emitClose===!1&&(this.state&=~de),c&&c.autoDestroy===!1&&(this.state&=~S),this.errored=null,this.defaultEncoding=c&&c.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,c&&c.encoding&&(this.decoder=new be(c.encoding),this.encoding=c.encoding)}function $(c){if(!(this instanceof $))return new $(c);const p=this instanceof $e();this._readableState=new Y(c,this,p),c&&(typeof c.read=="function"&&(this._read=c.read),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.construct=="function"&&(this._construct=c.construct),c.signal&&!p&&_(c.signal,this)),A.call(this,c),I.construct(this,()=>{this._readableState.needReadable&&E(this,this._readableState)})}$.prototype.destroy=I.destroy,$.prototype._undestroy=I.undestroy,$.prototype._destroy=function(c,p){p(c)},$.prototype[B.captureRejectionSymbol]=function(c){this.destroy(c)},$.prototype[x]=function(){let c;return this.destroyed||(c=this.readableEnded?null:new ne,this.destroy(c)),new b((p,te)=>m(this,re=>re&&re!==c?te(re):p(null)))},$.prototype.push=function(c,p){return we(this,c,p,!1)},$.prototype.unshift=function(c,p){return we(this,c,p,!0)};function we(c,p,te,re){w("readableAddChunk",p);const le=c._readableState;let Pe;if((le.state&M)===0&&(typeof p=="string"?(te=te||le.defaultEncoding,le.encoding!==te&&(re&&le.encoding?p=y.from(p,te).toString(le.encoding):(p=y.from(p,te),te=""))):p instanceof y?te="":A._isUint8Array(p)?(p=A._uint8ArrayToBuffer(p),te=""):p!=null&&(Pe=new fe("chunk",["string","Buffer","Uint8Array"],p))),Pe)g(c,Pe);else if(p===null)le.state&=~oe,n(c,le);else if((le.state&M)!==0||p&&p.length>0)if(re)if((le.state&U)!==0)g(c,new L);else{if(le.destroyed||le.errored)return!1;Ne(c,le,p,!0)}else if(le.ended)g(c,new V);else{if(le.destroyed||le.errored)return!1;le.state&=~oe,le.decoder&&!te?(p=le.decoder.write(p),le.objectMode||p.length!==0?Ne(c,le,p,!1):E(c,le)):Ne(c,le,p,!1)}else re||(le.state&=~oe,E(c,le));return!le.ended&&(le.length<le.highWaterMark||le.length===0)}function Ne(c,p,te,re){p.flowing&&p.length===0&&!p.sync&&c.listenerCount("data")>0?((p.state&J)!==0?p.awaitDrainWriters.clear():p.awaitDrainWriters=null,p.dataEmitted=!0,c.emit("data",te)):(p.length+=p.objectMode?1:te.length,re?p.buffer.unshift(te):p.buffer.push(te),(p.state&pe)!==0&&i(c)),E(c,p)}$.prototype.isPaused=function(){const c=this._readableState;return c[ue]===!0||c.flowing===!1},$.prototype.setEncoding=function(c){const p=new be(c);this._readableState.decoder=p,this._readableState.encoding=this._readableState.decoder.encoding;const te=this._readableState.buffer;let re="";for(const le of te)re+=p.write(le);return te.clear(),re!==""&&te.push(re),this._readableState.length=re.length,this};const ye=1073741824;function Be(c){if(c>ye)throw new C("size","<= 1GiB",c);return c--,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c++,c}function f(c,p){return c<=0||p.length===0&&p.ended?0:(p.state&M)!==0?1:r(c)?p.flowing&&p.length?p.buffer.first().length:p.length:c<=p.length?c:p.ended?p.length:0}$.prototype.read=function(c){w("read",c),c===void 0?c=NaN:t(c)||(c=s(c,10));const p=this._readableState,te=c;if(c>p.highWaterMark&&(p.highWaterMark=Be(c)),c!==0&&(p.state&=~D),c===0&&p.needReadable&&((p.highWaterMark!==0?p.length>=p.highWaterMark:p.length>0)||p.ended))return w("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?br(this):i(this),null;if(c=f(c,p),c===0&&p.ended)return p.length===0&&br(this),null;let re=(p.state&pe)!==0;if(w("need readable",re),(p.length===0||p.length-c<p.highWaterMark)&&(re=!0,w("length less than watermark",re)),p.ended||p.reading||p.destroyed||p.errored||!p.constructed)re=!1,w("reading, ended or constructing",re);else if(re){w("do read"),p.state|=oe|ge,p.length===0&&(p.state|=pe);try{this._read(p.highWaterMark)}catch(Pe){g(this,Pe)}p.state&=~ge,p.reading||(c=f(te,p))}let le;return c>0?le=Ln(c,p):le=null,le===null?(p.needReadable=p.length<=p.highWaterMark,c=0):(p.length-=c,p.multiAwaitDrain?p.awaitDrainWriters.clear():p.awaitDrainWriters=null),p.length===0&&(p.ended||(p.needReadable=!0),te!==c&&p.ended&&br(this)),le!==null&&!p.errorEmitted&&!p.closeEmitted&&(p.dataEmitted=!0,this.emit("data",le)),le};function n(c,p){if(w("onEofChunk"),!p.ended){if(p.decoder){const te=p.decoder.end();te&&te.length&&(p.buffer.push(te),p.length+=p.objectMode?1:te.length)}p.ended=!0,p.sync?i(c):(p.needReadable=!1,p.emittedReadable=!0,d(c))}}function i(c){const p=c._readableState;w("emitReadable",p.needReadable,p.emittedReadable),p.needReadable=!1,p.emittedReadable||(w("emitReadable",p.flowing),p.emittedReadable=!0,l.nextTick(d,c))}function d(c){const p=c._readableState;w("emitReadable_",p.destroyed,p.length,p.ended),!p.destroyed&&!p.errored&&(p.length||p.ended)&&(c.emit("readable"),p.emittedReadable=!1),p.needReadable=!p.flowing&&!p.ended&&p.length<=p.highWaterMark,xe(c)}function E(c,p){!p.readingMore&&p.constructed&&(p.readingMore=!0,l.nextTick(F,c,p))}function F(c,p){for(;!p.reading&&!p.ended&&(p.length<p.highWaterMark||p.flowing&&p.length===0);){const te=p.length;if(w("maybeReadMore read 0"),c.read(0),te===p.length)break}p.readingMore=!1}$.prototype._read=function(c){throw new k("_read()")},$.prototype.pipe=function(c,p){const te=this,re=this._readableState;re.pipes.length===1&&(re.multiAwaitDrain||(re.multiAwaitDrain=!0,re.awaitDrainWriters=new h(re.awaitDrainWriters?[re.awaitDrainWriters]:[]))),re.pipes.push(c),w("pipe count=%d opts=%j",re.pipes.length,p);const Pe=(!p||p.end!==!1)&&c!==l.stdout&&c!==l.stderr?Fn:bt;re.endEmitted?l.nextTick(Pe):te.once("end",Pe),c.on("unpipe",Fe);function Fe(Ve,Ue){w("onunpipe"),Ve===te&&Ue&&Ue.hasUnpiped===!1&&(Ue.hasUnpiped=!0,Ai())}function Fn(){w("onend"),c.end()}let Qe,Cn=!1;function Ai(){w("cleanup"),c.removeListener("close",wr),c.removeListener("finish",mr),Qe&&c.removeListener("drain",Qe),c.removeListener("error",yr),c.removeListener("unpipe",Fe),te.removeListener("end",Fn),te.removeListener("end",bt),te.removeListener("data",Mn),Cn=!0,Qe&&re.awaitDrainWriters&&(!c._writableState||c._writableState.needDrain)&&Qe()}function On(){Cn||(re.pipes.length===1&&re.pipes[0]===c?(w("false write response, pause",0),re.awaitDrainWriters=c,re.multiAwaitDrain=!1):re.pipes.length>1&&re.pipes.includes(c)&&(w("false write response, pause",re.awaitDrainWriters.size),re.awaitDrainWriters.add(c)),te.pause()),Qe||(Qe=q(te,c),c.on("drain",Qe))}te.on("data",Mn);function Mn(Ve){w("ondata");const Ue=c.write(Ve);w("dest.write",Ue),Ue===!1&&On()}function yr(Ve){if(w("onerror",Ve),bt(),c.removeListener("error",yr),c.listenerCount("error")===0){const Ue=c._writableState||c._readableState;Ue&&!Ue.errorEmitted?g(c,Ve):c.emit("error",Ve)}}v(c,"error",yr);function wr(){c.removeListener("finish",mr),bt()}c.once("close",wr);function mr(){w("onfinish"),c.removeListener("close",wr),bt()}c.once("finish",mr);function bt(){w("unpipe"),te.unpipe(c)}return c.emit("pipe",te),c.writableNeedDrain===!0?On():re.flowing||(w("pipe resume"),te.resume()),c};function q(c,p){return function(){const re=c._readableState;re.awaitDrainWriters===p?(w("pipeOnDrain",1),re.awaitDrainWriters=null):re.multiAwaitDrain&&(w("pipeOnDrain",re.awaitDrainWriters.size),re.awaitDrainWriters.delete(p)),(!re.awaitDrainWriters||re.awaitDrainWriters.size===0)&&c.listenerCount("data")&&c.resume()}}$.prototype.unpipe=function(c){const p=this._readableState,te={hasUnpiped:!1};if(p.pipes.length===0)return this;if(!c){const le=p.pipes;p.pipes=[],this.pause();for(let Pe=0;Pe<le.length;Pe++)le[Pe].emit("unpipe",this,{hasUnpiped:!1});return this}const re=e(p.pipes,c);return re===-1?this:(p.pipes.splice(re,1),p.pipes.length===0&&this.pause(),c.emit("unpipe",this,te),this)},$.prototype.on=function(c,p){const te=A.prototype.on.call(this,c,p),re=this._readableState;return c==="data"?(re.readableListening=this.listenerCount("readable")>0,re.flowing!==!1&&this.resume()):c==="readable"&&!re.endEmitted&&!re.readableListening&&(re.readableListening=re.needReadable=!0,re.flowing=!1,re.emittedReadable=!1,w("on readable",re.length,re.reading),re.length?i(this):re.reading||l.nextTick(Ie,this)),te},$.prototype.addListener=$.prototype.on,$.prototype.removeListener=function(c,p){const te=A.prototype.removeListener.call(this,c,p);return c==="readable"&&l.nextTick(_e,this),te},$.prototype.off=$.prototype.removeListener,$.prototype.removeAllListeners=function(c){const p=A.prototype.removeAllListeners.apply(this,arguments);return(c==="readable"||c===void 0)&&l.nextTick(_e,this),p};function _e(c){const p=c._readableState;p.readableListening=c.listenerCount("readable")>0,p.resumeScheduled&&p[ue]===!1?p.flowing=!0:c.listenerCount("data")>0?c.resume():p.readableListening||(p.flowing=null)}function Ie(c){w("readable nexttick read 0"),c.read(0)}$.prototype.resume=function(){const c=this._readableState;return c.flowing||(w("resume"),c.flowing=!c.readableListening,Ee(this,c)),c[ue]=!1,this};function Ee(c,p){p.resumeScheduled||(p.resumeScheduled=!0,l.nextTick(Re,c,p))}function Re(c,p){w("resume",p.reading),p.reading||c.read(0),p.resumeScheduled=!1,c.emit("resume"),xe(c),p.flowing&&!p.reading&&c.read(0)}$.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ue]=!0,this};function xe(c){const p=c._readableState;for(w("flow",p.flowing);p.flowing&&c.read()!==null;);}$.prototype.wrap=function(c){let p=!1;c.on("data",re=>{!this.push(re)&&c.pause&&(p=!0,c.pause())}),c.on("end",()=>{this.push(null)}),c.on("error",re=>{g(this,re)}),c.on("close",()=>{this.destroy()}),c.on("destroy",()=>{this.destroy()}),this._read=()=>{p&&c.resume&&(p=!1,c.resume())};const te=u(c);for(let re=1;re<te.length;re++){const le=te[re];this[le]===void 0&&typeof c[le]=="function"&&(this[le]=c[le].bind(c))}return this},$.prototype[T]=function(){return Bn(this)},$.prototype.iterator=function(c){return c!==void 0&&se(c,"options"),Bn(this,c)};function Bn(c,p){typeof c.read!="function"&&(c=$.wrap(c,{objectMode:!0}));const te=Ri(c,p);return te.stream=c,te}async function*Ri(c,p){let te=ae;function re(Fe){this===c?(te(),te=ae):te=Fe}c.on("readable",re);let le;const Pe=m(c,{writable:!1},Fe=>{le=Fe?z(le,Fe):null,te(),te=ae});try{for(;;){const Fe=c.destroyed?null:c.read();if(Fe!==null)yield Fe;else{if(le)throw le;if(le===null)return;await new b(re)}}}catch(Fe){throw le=z(le,Fe),le}finally{(le||p?.destroyOnReturn!==!1)&&(le===void 0||c._readableState.autoDestroy)?I.destroyer(c,null):(c.off("readable",re),Pe())}}o($.prototype,{readable:{__proto__:null,get(){const c=this._readableState;return!!c&&c.readable!==!1&&!c.destroyed&&!c.errorEmitted&&!c.endEmitted},set(c){this._readableState&&(this._readableState.readable=!!c)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(c){this._readableState&&(this._readableState.flowing=c)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(c){this._readableState&&(this._readableState.destroyed=c)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(Y.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ue]!==!1},set(c){this[ue]=!!c}}}),$._fromList=Ln;function Ln(c,p){if(p.length===0)return null;let te;return p.objectMode?te=p.buffer.shift():!c||c>=p.length?(p.decoder?te=p.buffer.join(""):p.buffer.length===1?te=p.buffer.first():te=p.buffer.concat(p.length),p.buffer.clear()):te=p.buffer.consume(c,p.decoder),te}function br(c){const p=c._readableState;w("endReadable",p.endEmitted),p.endEmitted||(p.ended=!0,l.nextTick(Ti,p,c))}function Ti(c,p){if(w("endReadableNT",c.endEmitted,c.length),!c.errored&&!c.closeEmitted&&!c.endEmitted&&c.length===0){if(c.endEmitted=!0,p.emit("end"),p.writable&&p.allowHalfOpen===!1)l.nextTick(vi,p);else if(c.autoDestroy){const te=p._writableState;(!te||te.autoDestroy&&(te.finished||te.writable===!1))&&p.destroy()}}}function vi(c){c.writable&&!c.writableEnded&&!c.destroyed&&c.end()}$.from=function(c,p){return W($,c,p)};let gr;function kn(){return gr===void 0&&(gr={}),gr}return $.fromWeb=function(c,p){return kn().newStreamReadableFromReadableStream(c,p)},$.toWeb=function(c,p){return kn().newReadableStreamFromStreamReadable(c,p)},$.wrap=function(c,p){var te,re;return new $({objectMode:(te=(re=c.readableObjectMode)!==null&&re!==void 0?re:c.objectMode)!==null&&te!==void 0?te:!0,...p,destroy(le,Pe){I.destroyer(c,le),Pe(le)}}).wrap(c)},nr}var ir,un;function sr(){if(un)return ir;un=1;const l=He(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:s,ObjectDefineProperties:o,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:a,Symbol:b,SymbolHasInstance:h}=Te();ir=se,se.WritableState=L;const{EventEmitter:x}=Rt(),T=Xt().Stream,{Buffer:j}=Me(),B=Ze(),{addAbortSignal:A}=At(),{getHighWaterMark:v,getDefaultHighWaterMark:y}=Nt(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:m,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:P,ERR_STREAM_DESTROYED:I,ERR_STREAM_ALREADY_FINISHED:H,ERR_STREAM_NULL_VALUES:K,ERR_STREAM_WRITE_AFTER_END:z,ERR_UNKNOWN_ENCODING:fe}=je().codes,{errorOrDestroy:k}=B;u(se.prototype,T.prototype),u(se,T);function C(){}const V=b("kOnFinished");function L(S,N,O){typeof O!="boolean"&&(O=N instanceof $e()),this.objectMode=!!(S&&S.objectMode),O&&(this.objectMode=this.objectMode||!!(S&&S.writableObjectMode)),this.highWaterMark=S?v(this,S,"writableHighWaterMark",O):y(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ee=!!(S&&S.decodeStrings===!1);this.decodeStrings=!ee,this.defaultEncoding=S&&S.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=g.bind(void 0,N),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ne(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!S||S.emitClose!==!1,this.autoDestroy=!S||S.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[V]=[]}function ne(S){S.buffered=[],S.bufferedIndex=0,S.allBuffers=!0,S.allNoop=!0}L.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},s(L.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function se(S){const N=this instanceof $e();if(!N&&!r(se,this))return new se(S);this._writableState=new L(S,this,N),S&&(typeof S.write=="function"&&(this._write=S.write),typeof S.writev=="function"&&(this._writev=S.writev),typeof S.destroy=="function"&&(this._destroy=S.destroy),typeof S.final=="function"&&(this._final=S.final),typeof S.construct=="function"&&(this._construct=S.construct),S.signal&&A(S.signal,this)),T.call(this,S),B.construct(this,()=>{const O=this._writableState;O.writing||oe(this,O),D(this,O)})}s(se,h,{__proto__:null,value:function(S){return r(this,S)?!0:this!==se?!1:S&&S._writableState instanceof L}}),se.prototype.pipe=function(){k(this,new P)};function ue(S,N,O,ee){const J=S._writableState;if(typeof O=="function")ee=O,O=J.defaultEncoding;else{if(!O)O=J.defaultEncoding;else if(O!=="buffer"&&!j.isEncoding(O))throw new fe(O);typeof ee!="function"&&(ee=C)}if(N===null)throw new K;if(!J.objectMode)if(typeof N=="string")J.decodeStrings!==!1&&(N=j.from(N,O),O="buffer");else if(N instanceof j)O="buffer";else if(T._isUint8Array(N))N=T._uint8ArrayToBuffer(N),O="buffer";else throw new _("chunk",["string","Buffer","Uint8Array"],N);let Z;return J.ending?Z=new z:J.destroyed&&(Z=new I("write")),Z?(l.nextTick(ee,Z),k(S,Z,!0),Z):(J.pendingcb++,be(S,J,N,O,ee))}se.prototype.write=function(S,N,O){return ue(this,S,N,O)===!0},se.prototype.cork=function(){this._writableState.corked++},se.prototype.uncork=function(){const S=this._writableState;S.corked&&(S.corked--,S.writing||oe(this,S))},se.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=a(N)),!j.isEncoding(N))throw new fe(N);return this._writableState.defaultEncoding=N,this};function be(S,N,O,ee,J){const Z=N.objectMode?1:O.length;N.length+=Z;const R=N.length<N.highWaterMark;return R||(N.needDrain=!0),N.writing||N.corked||N.errored||!N.constructed?(N.buffered.push({chunk:O,encoding:ee,callback:J}),N.allBuffers&&ee!=="buffer"&&(N.allBuffers=!1),N.allNoop&&J!==C&&(N.allNoop=!1)):(N.writelen=Z,N.writecb=J,N.writing=!0,N.sync=!0,S._write(O,ee,N.onwrite),N.sync=!1),R&&!N.errored&&!N.destroyed}function W(S,N,O,ee,J,Z,R){N.writelen=ee,N.writecb=R,N.writing=!0,N.sync=!0,N.destroyed?N.onwrite(new I("write")):O?S._writev(J,N.onwrite):S._write(J,Z,N.onwrite),N.sync=!1}function ae(S,N,O,ee){--N.pendingcb,ee(O),U(N),k(S,O)}function g(S,N){const O=S._writableState,ee=O.sync,J=O.writecb;if(typeof J!="function"){k(S,new w);return}O.writing=!1,O.writecb=null,O.length-=O.writelen,O.writelen=0,N?(N.stack,O.errored||(O.errored=N),S._readableState&&!S._readableState.errored&&(S._readableState.errored=N),ee?l.nextTick(ae,S,O,N,J):ae(S,O,N,J)):(O.buffered.length>O.bufferedIndex&&oe(S,O),ee?O.afterWriteTickInfo!==null&&O.afterWriteTickInfo.cb===J?O.afterWriteTickInfo.count++:(O.afterWriteTickInfo={count:1,cb:J,stream:S,state:O},l.nextTick(M,O.afterWriteTickInfo)):X(S,O,1,J))}function M({stream:S,state:N,count:O,cb:ee}){return N.afterWriteTickInfo=null,X(S,N,O,ee)}function X(S,N,O,ee){for(!N.ending&&!S.destroyed&&N.length===0&&N.needDrain&&(N.needDrain=!1,S.emit("drain"));O-- >0;)N.pendingcb--,ee();N.destroyed&&U(N),D(S,N)}function U(S){if(S.writing)return;for(let J=S.bufferedIndex;J<S.buffered.length;++J){var N;const{chunk:Z,callback:R}=S.buffered[J],Q=S.objectMode?1:Z.length;S.length-=Q,R((N=S.errored)!==null&&N!==void 0?N:new I("write"))}const O=S[V].splice(0);for(let J=0;J<O.length;J++){var ee;O[J]((ee=S.errored)!==null&&ee!==void 0?ee:new I("end"))}ne(S)}function oe(S,N){if(N.corked||N.bufferProcessing||N.destroyed||!N.constructed)return;const{buffered:O,bufferedIndex:ee,objectMode:J}=N,Z=O.length-ee;if(!Z)return;let R=ee;if(N.bufferProcessing=!0,Z>1&&S._writev){N.pendingcb-=Z-1;const Q=N.allNoop?C:$=>{for(let we=R;we<O.length;++we)O[we].callback($)},Y=N.allNoop&&R===0?O:e(O,R);Y.allBuffers=N.allBuffers,W(S,N,!0,N.length,Y,"",Q),ne(N)}else{do{const{chunk:Q,encoding:Y,callback:$}=O[R];O[R++]=null;const we=J?1:Q.length;W(S,N,!1,we,Q,Y,$)}while(R<O.length&&!N.writing);R===O.length?ne(N):R>256?(O.splice(0,R),N.bufferedIndex=0):N.bufferedIndex=R}N.bufferProcessing=!1}se.prototype._write=function(S,N,O){if(this._writev)this._writev([{chunk:S,encoding:N}],O);else throw new m("_write()")},se.prototype._writev=null,se.prototype.end=function(S,N,O){const ee=this._writableState;typeof S=="function"?(O=S,S=null,N=null):typeof N=="function"&&(O=N,N=null);let J;if(S!=null){const Z=ue(this,S,N);Z instanceof t&&(J=Z)}return ee.corked&&(ee.corked=1,this.uncork()),J||(!ee.errored&&!ee.ending?(ee.ending=!0,D(this,ee,!0),ee.ended=!0):ee.finished?J=new H("end"):ee.destroyed&&(J=new I("end"))),typeof O=="function"&&(J||ee.finished?l.nextTick(O,J):ee[V].push(O)),this};function ce(S){return S.ending&&!S.destroyed&&S.constructed&&S.length===0&&!S.errored&&S.buffered.length===0&&!S.finished&&!S.writing&&!S.errorEmitted&&!S.closeEmitted}function ge(S,N){let O=!1;function ee(J){if(O){k(S,J??w());return}if(O=!0,N.pendingcb--,J){const Z=N[V].splice(0);for(let R=0;R<Z.length;R++)Z[R](J);k(S,J,N.sync)}else ce(N)&&(N.prefinished=!0,S.emit("prefinish"),N.pendingcb++,l.nextTick(G,S,N))}N.sync=!0,N.pendingcb++;try{S._final(ee)}catch(J){ee(J)}N.sync=!1}function pe(S,N){!N.prefinished&&!N.finalCalled&&(typeof S._final=="function"&&!N.destroyed?(N.finalCalled=!0,ge(S,N)):(N.prefinished=!0,S.emit("prefinish")))}function D(S,N,O){ce(N)&&(pe(S,N),N.pendingcb===0&&(O?(N.pendingcb++,l.nextTick((ee,J)=>{ce(J)?G(ee,J):J.pendingcb--},S,N)):ce(N)&&(N.pendingcb++,G(S,N))))}function G(S,N){N.pendingcb--,N.finished=!0;const O=N[V].splice(0);for(let ee=0;ee<O.length;ee++)O[ee]();if(S.emit("finish"),N.autoDestroy){const ee=S._readableState;(!ee||ee.autoDestroy&&(ee.endEmitted||ee.readable===!1))&&S.destroy()}}o(se.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(S){this._writableState&&(this._writableState.destroyed=S)}},writable:{__proto__:null,get(){const S=this._writableState;return!!S&&S.writable!==!1&&!S.destroyed&&!S.errored&&!S.ending&&!S.ended},set(S){this._writableState&&(this._writableState.writable=!!S)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const S=this._writableState;return S?!S.destroyed&&!S.ending&&S.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ie=B.destroy;se.prototype.destroy=function(S,N){const O=this._writableState;return!O.destroyed&&(O.bufferedIndex<O.buffered.length||O[V].length)&&l.nextTick(U,O),ie.call(this,S,N),this},se.prototype._undestroy=B.undestroy,se.prototype._destroy=function(S,N){N(S)},se.prototype[x.captureRejectionSymbol]=function(S){this.destroy(S)};let he;function de(){return he===void 0&&(he={}),he}return se.fromWeb=function(S,N){return de().newStreamWritableFromWritableStream(S,N)},se.toWeb=function(S){return de().newWritableStreamFromStreamWritable(S)},ir}var or,fn;function ai(){if(fn)return or;fn=1;const l=He(),e=Me(),{isReadable:t,isWritable:r,isIterable:s,isNodeStream:o,isReadableNodeStream:u,isWritableNodeStream:a,isDuplexNodeStream:b,isReadableStream:h,isWritableStream:x}=De(),T=We(),{AbortError:j,codes:{ERR_INVALID_ARG_TYPE:B,ERR_INVALID_RETURN_VALUE:A}}=je(),{destroyer:v}=Ze(),y=$e(),_=jt(),m=sr(),{createDeferredPromise:w}=Le(),P=an(),I=globalThis.Blob||e.Blob,H=typeof I<"u"?function(L){return L instanceof I}:function(L){return!1},K=globalThis.AbortController||ut().AbortController,{FunctionPrototypeCall:z}=Te();class fe extends y{constructor(L){super(L),L?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),L?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}or=function V(L,ne){if(b(L))return L;if(u(L))return C({readable:L});if(a(L))return C({writable:L});if(o(L))return C({writable:!1,readable:!1});if(h(L))return C({readable:_.fromWeb(L)});if(x(L))return C({writable:m.fromWeb(L)});if(typeof L=="function"){const{value:ue,write:be,final:W,destroy:ae}=k(L);if(s(ue))return P(fe,ue,{objectMode:!0,write:be,final:W,destroy:ae});const g=ue?.then;if(typeof g=="function"){let M;const X=z(g,ue,U=>{if(U!=null)throw new A("nully","body",U)},U=>{v(M,U)});return M=new fe({objectMode:!0,readable:!1,write:be,final(U){W(async()=>{try{await X,l.nextTick(U,null)}catch(oe){l.nextTick(U,oe)}})},destroy:ae})}throw new A("Iterable, AsyncIterable or AsyncFunction",ne,ue)}if(H(L))return V(L.arrayBuffer());if(s(L))return P(fe,L,{objectMode:!0,writable:!1});if(h(L?.readable)&&x(L?.writable))return fe.fromWeb(L);if(typeof L?.writable=="object"||typeof L?.readable=="object"){const ue=L!=null&&L.readable?u(L?.readable)?L?.readable:V(L.readable):void 0,be=L!=null&&L.writable?a(L?.writable)?L?.writable:V(L.writable):void 0;return C({readable:ue,writable:be})}const se=L?.then;if(typeof se=="function"){let ue;return z(se,L,be=>{be!=null&&ue.push(be),ue.push(null)},be=>{v(ue,be)}),ue=new fe({objectMode:!0,writable:!1,read(){}})}throw new B(ne,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],L)};function k(V){let{promise:L,resolve:ne}=w();const se=new K,ue=se.signal;return{value:V((async function*(){for(;;){const W=L;L=null;const{chunk:ae,done:g,cb:M}=await W;if(l.nextTick(M),g)return;if(ue.aborted)throw new j(void 0,{cause:ue.reason});({promise:L,resolve:ne}=w()),yield ae}})(),{signal:ue}),write(W,ae,g){const M=ne;ne=null,M({chunk:W,done:!1,cb:g})},final(W){const ae=ne;ne=null,ae({done:!0,cb:W})},destroy(W,ae){se.abort(),ae(W)}}}function C(V){const L=V.readable&&typeof V.readable.read!="function"?_.wrap(V.readable):V.readable,ne=V.writable;let se=!!t(L),ue=!!r(ne),be,W,ae,g,M;function X(U){const oe=g;g=null,oe?oe(U):U&&M.destroy(U)}return M=new fe({readableObjectMode:!!(L!=null&&L.readableObjectMode),writableObjectMode:!!(ne!=null&&ne.writableObjectMode),readable:se,writable:ue}),ue&&(T(ne,U=>{ue=!1,U&&v(L,U),X(U)}),M._write=function(U,oe,ce){ne.write(U,oe)?ce():be=ce},M._final=function(U){ne.end(),W=U},ne.on("drain",function(){if(be){const U=be;be=null,U()}}),ne.on("finish",function(){if(W){const U=W;W=null,U()}})),se&&(T(L,U=>{se=!1,U&&v(L,U),X(U)}),L.on("readable",function(){if(ae){const U=ae;ae=null,U()}}),L.on("end",function(){M.push(null)}),M._read=function(){for(;;){const U=L.read();if(U===null){ae=M._read;return}if(!M.push(U))return}}),M._destroy=function(U,oe){!U&&g!==null&&(U=new j),ae=null,be=null,W=null,g===null?oe(U):(g=oe,v(ne,U),v(L,U))},M}return or}var ar,cn;function $e(){if(cn)return ar;cn=1;const{ObjectDefineProperties:l,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:r}=Te();ar=u;const s=jt(),o=sr();r(u.prototype,s.prototype),r(u,s);{const x=t(o.prototype);for(let T=0;T<x.length;T++){const j=x[T];u.prototype[j]||(u.prototype[j]=o.prototype[j])}}function u(x){if(!(this instanceof u))return new u(x);s.call(this,x),o.call(this,x),x?(this.allowHalfOpen=x.allowHalfOpen!==!1,x.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),x.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}l(u.prototype,{writable:{__proto__:null,...e(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(o.prototype,"writableLength")},writableFinished:{__proto__:null,...e(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(x){this._readableState&&this._writableState&&(this._readableState.destroyed=x,this._writableState.destroyed=x)}}});let a;function b(){return a===void 0&&(a={}),a}u.fromWeb=function(x,T){return b().newStreamDuplexFromReadableWritablePair(x,T)},u.toWeb=function(x){return b().newReadableWritablePairFromDuplex(x)};let h;return u.from=function(x){return h||(h=ai()),h(x,"body")},ar}var lr,dn;function hn(){if(dn)return lr;dn=1;const{ObjectSetPrototypeOf:l,Symbol:e}=Te();lr=u;const{ERR_METHOD_NOT_IMPLEMENTED:t}=je().codes,r=$e(),{getHighWaterMark:s}=Nt();l(u.prototype,r.prototype),l(u,r);const o=e("kCallback");function u(h){if(!(this instanceof u))return new u(h);const x=h?s(this,h,"readableHighWaterMark",!0):null;x===0&&(h={...h,highWaterMark:null,readableHighWaterMark:x,writableHighWaterMark:h.writableHighWaterMark||0}),r.call(this,h),this._readableState.sync=!1,this[o]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",b)}function a(h){typeof this._flush=="function"&&!this.destroyed?this._flush((x,T)=>{if(x){h?h(x):this.destroy(x);return}T!=null&&this.push(T),this.push(null),h&&h()}):(this.push(null),h&&h())}function b(){this._final!==a&&a.call(this)}return u.prototype._final=a,u.prototype._transform=function(h,x,T){throw new t("_transform()")},u.prototype._write=function(h,x,T){const j=this._readableState,B=this._writableState,A=j.length;this._transform(h,x,(v,y)=>{if(v){T(v);return}y!=null&&this.push(y),B.ended||A===j.length||j.length<j.highWaterMark?T():this[o]=T})},u.prototype._read=function(){if(this[o]){const h=this[o];this[o]=null,h()}},lr}var ur,pn;function _n(){if(pn)return ur;pn=1;const{ObjectSetPrototypeOf:l}=Te();ur=t;const e=hn();l(t.prototype,e.prototype),l(t,e);function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return t.prototype._transform=function(r,s,o){o(null,r)},ur}var fr,bn;function cr(){if(bn)return fr;bn=1;const l=He(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:r,SymbolDispose:s}=Te(),o=We(),{once:u}=Le(),a=Ze(),b=$e(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:x,ERR_INVALID_RETURN_VALUE:T,ERR_MISSING_ARGS:j,ERR_STREAM_DESTROYED:B,ERR_STREAM_PREMATURE_CLOSE:A},AbortError:v}=je(),{validateFunction:y,validateAbortSignal:_}=ft(),{isIterable:m,isReadable:w,isReadableNodeStream:P,isNodeStream:I,isTransformStream:H,isWebStream:K,isReadableStream:z,isReadableFinished:fe}=De(),k=globalThis.AbortController||ut().AbortController;let C,V,L;function ne(U,oe,ce){let ge=!1;U.on("close",()=>{ge=!0});const pe=o(U,{readable:oe,writable:ce},D=>{ge=!D});return{destroy:D=>{ge||(ge=!0,a.destroyer(U,D||new B("pipe")))},cleanup:pe}}function se(U){return y(U[U.length-1],"streams[stream.length - 1]"),U.pop()}function ue(U){if(m(U))return U;if(P(U))return be(U);throw new x("val",["Readable","Iterable","AsyncIterable"],U)}async function*be(U){V||(V=jt()),yield*V.prototype[r].call(U)}async function W(U,oe,ce,{end:ge}){let pe,D=null;const G=de=>{if(de&&(pe=de),D){const S=D;D=null,S()}},ie=()=>new t((de,S)=>{pe?S(pe):D=()=>{pe?S(pe):de()}});oe.on("drain",G);const he=o(oe,{readable:!1},G);try{oe.writableNeedDrain&&await ie();for await(const de of U)oe.write(de)||await ie();ge&&(oe.end(),await ie()),ce()}catch(de){ce(pe!==de?h(pe,de):de)}finally{he(),oe.off("drain",G)}}async function ae(U,oe,ce,{end:ge}){H(oe)&&(oe=oe.writable);const pe=oe.getWriter();try{for await(const D of U)await pe.ready,pe.write(D).catch(()=>{});await pe.ready,ge&&await pe.close(),ce()}catch(D){try{await pe.abort(D),ce(D)}catch(G){ce(G)}}}function g(...U){return M(U,u(se(U)))}function M(U,oe,ce){if(U.length===1&&e(U[0])&&(U=U[0]),U.length<2)throw new j("streams");const ge=new k,pe=ge.signal,D=ce?.signal,G=[];_(D,"options.signal");function ie(){J(new v)}L=L||Le().addAbortListener;let he;D&&(he=L(D,ie));let de,S;const N=[];let O=0;function ee(Y){J(Y,--O===0)}function J(Y,$){var we;if(Y&&(!de||de.code==="ERR_STREAM_PREMATURE_CLOSE")&&(de=Y),!(!de&&!$)){for(;N.length;)N.shift()(de);(we=he)===null||we===void 0||we[s](),ge.abort(),$&&(de||G.forEach(Ne=>Ne()),l.nextTick(oe,de,S))}}let Z;for(let Y=0;Y<U.length;Y++){const $=U[Y],we=Y<U.length-1,Ne=Y>0,ye=we||ce?.end!==!1,Be=Y===U.length-1;if(I($)){let f=function(n){n&&n.name!=="AbortError"&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ee(n)};if(ye){const{destroy:n,cleanup:i}=ne($,we,Ne);N.push(n),w($)&&Be&&G.push(i)}$.on("error",f),w($)&&Be&&G.push(()=>{$.removeListener("error",f)})}if(Y===0)if(typeof $=="function"){if(Z=$({signal:pe}),!m(Z))throw new T("Iterable, AsyncIterable or Stream","source",Z)}else m($)||P($)||H($)?Z=$:Z=b.from($);else if(typeof $=="function"){if(H(Z)){var R;Z=ue((R=Z)===null||R===void 0?void 0:R.readable)}else Z=ue(Z);if(Z=$(Z,{signal:pe}),we){if(!m(Z,!0))throw new T("AsyncIterable",`transform[${Y-1}]`,Z)}else{var Q;C||(C=_n());const f=new C({objectMode:!0}),n=(Q=Z)===null||Q===void 0?void 0:Q.then;if(typeof n=="function")O++,n.call(Z,E=>{S=E,E!=null&&f.write(E),ye&&f.end(),l.nextTick(ee)},E=>{f.destroy(E),l.nextTick(ee,E)});else if(m(Z,!0))O++,W(Z,f,ee,{end:ye});else if(z(Z)||H(Z)){const E=Z.readable||Z;O++,W(E,f,ee,{end:ye})}else throw new T("AsyncIterable or Promise","destination",Z);Z=f;const{destroy:i,cleanup:d}=ne(Z,!1,!0);N.push(i),Be&&G.push(d)}}else if(I($)){if(P(Z)){O+=2;const f=X(Z,$,ee,{end:ye});w($)&&Be&&G.push(f)}else if(H(Z)||z(Z)){const f=Z.readable||Z;O++,W(f,$,ee,{end:ye})}else if(m(Z))O++,W(Z,$,ee,{end:ye});else throw new x("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Z);Z=$}else if(K($)){if(P(Z))O++,ae(ue(Z),$,ee,{end:ye});else if(z(Z)||m(Z))O++,ae(Z,$,ee,{end:ye});else if(H(Z))O++,ae(Z.readable,$,ee,{end:ye});else throw new x("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Z);Z=$}else Z=b.from($)}return(pe!=null&&pe.aborted||D!=null&&D.aborted)&&l.nextTick(ie),Z}function X(U,oe,ce,{end:ge}){let pe=!1;if(oe.on("close",()=>{pe||ce(new A)}),U.pipe(oe,{end:!1}),ge){let D=function(){pe=!0,oe.end()};fe(U)?l.nextTick(D):U.once("end",D)}else ce();return o(U,{readable:!0,writable:!1},D=>{const G=U._readableState;D&&D.code==="ERR_STREAM_PREMATURE_CLOSE"&&G&&G.ended&&!G.errored&&!G.errorEmitted?U.once("end",ce).once("error",ce):ce(D)}),o(oe,{readable:!1,writable:!0},ce)}return fr={pipelineImpl:M,pipeline:g},fr}var dr,gn;function yn(){if(gn)return dr;gn=1;const{pipeline:l}=cr(),e=$e(),{destroyer:t}=Ze(),{isNodeStream:r,isReadable:s,isWritable:o,isWebStream:u,isTransformStream:a,isWritableStream:b,isReadableStream:h}=De(),{AbortError:x,codes:{ERR_INVALID_ARG_VALUE:T,ERR_MISSING_ARGS:j}}=je(),B=We();return dr=function(...v){if(v.length===0)throw new j("streams");if(v.length===1)return e.from(v[0]);const y=[...v];if(typeof v[0]=="function"&&(v[0]=e.from(v[0])),typeof v[v.length-1]=="function"){const C=v.length-1;v[C]=e.from(v[C])}for(let C=0;C<v.length;++C)if(!(!r(v[C])&&!u(v[C]))){if(C<v.length-1&&!(s(v[C])||h(v[C])||a(v[C])))throw new T(`streams[${C}]`,y[C],"must be readable");if(C>0&&!(o(v[C])||b(v[C])||a(v[C])))throw new T(`streams[${C}]`,y[C],"must be writable")}let _,m,w,P,I;function H(C){const V=P;P=null,V?V(C):C?I.destroy(C):!k&&!fe&&I.destroy()}const K=v[0],z=l(v,H),fe=!!(o(K)||b(K)||a(K)),k=!!(s(z)||h(z)||a(z));if(I=new e({writableObjectMode:!!(K!=null&&K.writableObjectMode),readableObjectMode:!!(z!=null&&z.readableObjectMode),writable:fe,readable:k}),fe){if(r(K))I._write=function(V,L,ne){K.write(V,L)?ne():_=ne},I._final=function(V){K.end(),m=V},K.on("drain",function(){if(_){const V=_;_=null,V()}});else if(u(K)){const L=(a(K)?K.writable:K).getWriter();I._write=async function(ne,se,ue){try{await L.ready,L.write(ne).catch(()=>{}),ue()}catch(be){ue(be)}},I._final=async function(ne){try{await L.ready,L.close().catch(()=>{}),m=ne}catch(se){ne(se)}}}const C=a(z)?z.readable:z;B(C,()=>{if(m){const V=m;m=null,V()}})}if(k){if(r(z))z.on("readable",function(){if(w){const C=w;w=null,C()}}),z.on("end",function(){I.push(null)}),I._read=function(){for(;;){const C=z.read();if(C===null){w=I._read;return}if(!I.push(C))return}};else if(u(z)){const V=(a(z)?z.readable:z).getReader();I._read=async function(){for(;;)try{const{value:L,done:ne}=await V.read();if(!I.push(L))return;if(ne){I.push(null);return}}catch{return}}}}return I._destroy=function(C,V){!C&&P!==null&&(C=new x),w=null,_=null,m=null,P===null?V(C):(P=V,r(z)&&t(z,C))},I},dr}var wn;function li(){if(wn)return Tt;wn=1;const l=globalThis.AbortController||ut().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:s},AbortError:o}=je(),{validateAbortSignal:u,validateInteger:a,validateObject:b}=ft(),h=Te().Symbol("kWeak"),x=Te().Symbol("kResistStopPropagation"),{finished:T}=We(),j=yn(),{addAbortSignalNoValidate:B}=At(),{isWritable:A,isNodeStream:v}=De(),{deprecate:y}=Le(),{ArrayPrototypePush:_,Boolean:m,MathFloor:w,Number:P,NumberIsNaN:I,Promise:H,PromiseReject:K,PromiseResolve:z,PromisePrototypeThen:fe,Symbol:k}=Te(),C=k("kEmpty"),V=k("kEof");function L(D,G){if(G!=null&&b(G,"options"),G?.signal!=null&&u(G.signal,"options.signal"),v(D)&&!A(D))throw new e("stream",D,"must be writable");const ie=j(this,D);return G!=null&&G.signal&&B(G.signal,ie),ie}function ne(D,G){if(typeof D!="function")throw new t("fn",["Function","AsyncFunction"],D);G!=null&&b(G,"options"),G?.signal!=null&&u(G.signal,"options.signal");let ie=1;G?.concurrency!=null&&(ie=w(G.concurrency));let he=ie-1;return G?.highWaterMark!=null&&(he=w(G.highWaterMark)),a(ie,"options.concurrency",1),a(he,"options.highWaterMark",0),he+=ie,(async function*(){const S=Le().AbortSignalAny([G?.signal].filter(m)),N=this,O=[],ee={signal:S};let J,Z,R=!1,Q=0;function Y(){R=!0,$()}function $(){Q-=1,we()}function we(){Z&&!R&&Q<ie&&O.length<he&&(Z(),Z=null)}async function Ne(){try{for await(let ye of N){if(R)return;if(S.aborted)throw new o;try{if(ye=D(ye,ee),ye===C)continue;ye=z(ye)}catch(Be){ye=K(Be)}Q+=1,fe(ye,$,Y),O.push(ye),J&&(J(),J=null),!R&&(O.length>=he||Q>=ie)&&await new H(Be=>{Z=Be})}O.push(V)}catch(ye){const Be=K(ye);fe(Be,$,Y),O.push(Be)}finally{R=!0,J&&(J(),J=null)}}Ne();try{for(;;){for(;O.length>0;){const ye=await O[0];if(ye===V)return;if(S.aborted)throw new o;ye!==C&&(yield ye),O.shift(),we()}await new H(ye=>{J=ye})}}finally{R=!0,Z&&(Z(),Z=null)}}).call(this)}function se(D=void 0){return D!=null&&b(D,"options"),D?.signal!=null&&u(D.signal,"options.signal"),(async function*(){let ie=0;for await(const de of this){var he;if(D!=null&&(he=D.signal)!==null&&he!==void 0&&he.aborted)throw new o({cause:D.signal.reason});yield[ie++,de]}}).call(this)}async function ue(D,G=void 0){for await(const ie of g.call(this,D,G))return!0;return!1}async function be(D,G=void 0){if(typeof D!="function")throw new t("fn",["Function","AsyncFunction"],D);return!await ue.call(this,async(...ie)=>!await D(...ie),G)}async function W(D,G){for await(const ie of g.call(this,D,G))return ie}async function ae(D,G){if(typeof D!="function")throw new t("fn",["Function","AsyncFunction"],D);async function ie(he,de){return await D(he,de),C}for await(const he of ne.call(this,ie,G));}function g(D,G){if(typeof D!="function")throw new t("fn",["Function","AsyncFunction"],D);async function ie(he,de){return await D(he,de)?he:C}return ne.call(this,ie,G)}class M extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function X(D,G,ie){var he;if(typeof D!="function")throw new t("reducer",["Function","AsyncFunction"],D);ie!=null&&b(ie,"options"),ie?.signal!=null&&u(ie.signal,"options.signal");let de=arguments.length>1;if(ie!=null&&(he=ie.signal)!==null&&he!==void 0&&he.aborted){const J=new o(void 0,{cause:ie.signal.reason});throw this.once("error",()=>{}),await T(this.destroy(J)),J}const S=new l,N=S.signal;if(ie!=null&&ie.signal){const J={once:!0,[h]:this,[x]:!0};ie.signal.addEventListener("abort",()=>S.abort(),J)}let O=!1;try{for await(const J of this){var ee;if(O=!0,ie!=null&&(ee=ie.signal)!==null&&ee!==void 0&&ee.aborted)throw new o;de?G=await D(G,J,{signal:N}):(G=J,de=!0)}if(!O&&!de)throw new M}finally{S.abort()}return G}async function U(D){D!=null&&b(D,"options"),D?.signal!=null&&u(D.signal,"options.signal");const G=[];for await(const he of this){var ie;if(D!=null&&(ie=D.signal)!==null&&ie!==void 0&&ie.aborted)throw new o(void 0,{cause:D.signal.reason});_(G,he)}return G}function oe(D,G){const ie=ne.call(this,D,G);return(async function*(){for await(const de of ie)yield*de}).call(this)}function ce(D){if(D=P(D),I(D))return 0;if(D<0)throw new s("number",">= 0",D);return D}function ge(D,G=void 0){return G!=null&&b(G,"options"),G?.signal!=null&&u(G.signal,"options.signal"),D=ce(D),(async function*(){var he;if(G!=null&&(he=G.signal)!==null&&he!==void 0&&he.aborted)throw new o;for await(const S of this){var de;if(G!=null&&(de=G.signal)!==null&&de!==void 0&&de.aborted)throw new o;D--<=0&&(yield S)}}).call(this)}function pe(D,G=void 0){return G!=null&&b(G,"options"),G?.signal!=null&&u(G.signal,"options.signal"),D=ce(D),(async function*(){var he;if(G!=null&&(he=G.signal)!==null&&he!==void 0&&he.aborted)throw new o;for await(const S of this){var de;if(G!=null&&(de=G.signal)!==null&&de!==void 0&&de.aborted)throw new o;if(D-- >0&&(yield S),D<=0)return}}).call(this)}return Tt.streamReturningOperators={asIndexedPairs:y(se,"readable.asIndexedPairs will be removed in a future version."),drop:ge,filter:g,flatMap:oe,map:ne,take:pe,compose:L},Tt.promiseReturningOperators={every:be,forEach:ae,reduce:X,toArray:U,some:ue,find:W},Tt}var hr,mn;function xn(){if(mn)return hr;mn=1;const{ArrayPrototypePop:l,Promise:e}=Te(),{isIterable:t,isNodeStream:r,isWebStream:s}=De(),{pipelineImpl:o}=cr(),{finished:u}=We();Sn();function a(...b){return new e((h,x)=>{let T,j;const B=b[b.length-1];if(B&&typeof B=="object"&&!r(B)&&!t(B)&&!s(B)){const A=l(b);T=A.signal,j=A.end}o(b,(A,v)=>{A?x(A):h(v)},{signal:T,end:j})})}return hr={finished:u,pipeline:a},hr}var En;function Sn(){if(En)return Ut.exports;En=1;const{Buffer:l}=Me(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:r}=Te(),{promisify:{custom:s}}=Le(),{streamReturningOperators:o,promiseReturningOperators:u}=li(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=je(),b=yn(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:x}=Nt(),{pipeline:T}=cr(),{destroyer:j}=Ze(),B=We(),A=xn(),v=De(),y=Ut.exports=Xt().Stream;y.isDestroyed=v.isDestroyed,y.isDisturbed=v.isDisturbed,y.isErrored=v.isErrored,y.isReadable=v.isReadable,y.isWritable=v.isWritable,y.Readable=jt();for(const m of t(o)){let P=function(...I){if(new.target)throw a();return y.Readable.from(r(w,this,I))};const w=o[m];e(P,"name",{__proto__:null,value:w.name}),e(P,"length",{__proto__:null,value:w.length}),e(y.Readable.prototype,m,{__proto__:null,value:P,enumerable:!1,configurable:!0,writable:!0})}for(const m of t(u)){let P=function(...I){if(new.target)throw a();return r(w,this,I)};const w=u[m];e(P,"name",{__proto__:null,value:w.name}),e(P,"length",{__proto__:null,value:w.length}),e(y.Readable.prototype,m,{__proto__:null,value:P,enumerable:!1,configurable:!0,writable:!0})}y.Writable=sr(),y.Duplex=$e(),y.Transform=hn(),y.PassThrough=_n(),y.pipeline=T;const{addAbortSignal:_}=At();return y.addAbortSignal=_,y.finished=B,y.destroy=j,y.compose=b,y.setDefaultHighWaterMark=h,y.getDefaultHighWaterMark=x,e(y,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return A}}),e(T,s,{__proto__:null,enumerable:!0,get(){return A.pipeline}}),e(B,s,{__proto__:null,enumerable:!0,get(){return A.finished}}),y.Stream=y,y._isUint8Array=function(w){return w instanceof Uint8Array},y._uint8ArrayToBuffer=function(w){return l.from(w.buffer,w.byteOffset,w.byteLength)},Ut.exports}var In;function ui(){return In||(In=1,(function(l){const e=Sn(),t=xn(),r=e.Readable.destroy;l.exports=e.Readable,l.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,l.exports._isUint8Array=e._isUint8Array,l.exports.isDisturbed=e.isDisturbed,l.exports.isErrored=e.isErrored,l.exports.isReadable=e.isReadable,l.exports.Readable=e.Readable,l.exports.Writable=e.Writable,l.exports.Duplex=e.Duplex,l.exports.Transform=e.Transform,l.exports.PassThrough=e.PassThrough,l.exports.addAbortSignal=e.addAbortSignal,l.exports.finished=e.finished,l.exports.destroy=e.destroy,l.exports.destroy=r,l.exports.pipeline=e.pipeline,l.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),l.exports.Stream=e.Stream,l.exports.default=l.exports})($t)),$t.exports}var Rn=ui();const pr=Symbol("iter");function ct(l,e,t=4){if(t===0)return Object.assign(l,e);for(const r in e)l[r]=ct(l[r]||Object.create(null),e[r],t-1);return l}function Tn(l,e,t=4){let r=!1;for(const s in l)if(s in e){const o=t===0?null:Tn(l[s],e[s],t-1);if(o!==!1)r=r||Object.create(null),r[s]=o;else if(t===3)return!1}return r}function vn(l,e,t=4){let r=!1;for(const s in l)if(!(s in e))r=r||Object.create(null),r[s]=t===0?null:ct({},l[s],t-1);else if(t!==0){const o=vn(l[s],e[s],t-1);if(o!==!1)r=r||Object.create(null),r[s]=o;else if(t===3)return!1}return r}class fi{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||Ge}_termFromId(e){if(e[0]==="."){const t=this._entities,r=e.split(".");return this._factory.quad(this._termFromId(t[r[1]]),this._termFromId(t[r[2]]),this._termFromId(t[r[3]]),r[4]&&this._termFromId(t[r[4]]))}return it(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const t=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),s=this._termToNumericId(e.object);let o;return t&&r&&s&&(Ot(e.graph)||(o=this._termToNumericId(e.graph)))&&this._ids[o?`.${t}.${r}.${s}.${o}`:`.${t}.${r}.${s}`]}return this._ids[Xe(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${Ot(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:Xe(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,r;if(e)for(t=e=`_:${e}`,r=1;this._ids[t];)t=e+r++;else do t=`_:b${this._blankNodeIndex++}`;while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class ke{constructor(e,t){this._size=0,this._graphs=Object.create(null),!t&&e&&!e[0]&&typeof e.match!="function"&&(t=e,e=null),t=t||{},this._factory=t.factory||Ge,this._entityIndex=t.entityIndex||new fi({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;const t=this._graphs;let r,s;for(const o in t)for(const u in r=t[o].subjects)for(const a in s=r[u])e+=Object.keys(s[a]).length;return this._size=e}_addToIndex(e,t,r,s){const o=e[t]||(e[t]={}),u=o[r]||(o[r]={}),a=s in u;return a||(u[s]=null),!a}_removeFromIndex(e,t,r,s){const o=e[t],u=o[r];delete u[s];for(const a in u)return;delete o[r];for(const a in o)return;delete e[t]}*_findInIndex(e,t,r,s,o,u,a,b){let h,x,T;const j=this._entities,B=this._termFromId(j[b]),A={subject:null,predicate:null,object:null};t&&((h=e,e={})[t]=h[t]);for(const v in e)if(x=e[v]){A[o]=this._termFromId(j[v]),r&&((h=x,x={})[r]=h[r]);for(const y in x)if(T=x[y]){A[u]=this._termFromId(j[y]);const _=s?s in T?[s]:[]:Object.keys(T);for(let m=0;m<_.length;m++)A[a]=this._termFromId(j[_[m]]),yield this._factory.quad(A.subject,A.predicate,A.object,B)}}}_loop(e,t){for(const r in e)t(r)}_loopByKey0(e,t,r){let s,o;if(s=e[t])for(o in s)r(o)}_loopByKey1(e,t,r){let s,o;for(s in e)o=e[s],o[t]&&r(s)}_loopBy2Keys(e,t,r,s){let o,u,a;if((o=e[t])&&(u=o[r]))for(a in u)s(a)}_countInIndex(e,t,r,s){let o=0,u,a,b;t&&((u=e,e={})[t]=u[t]);for(const h in e)if(a=e[h]){r&&((u=a,a={})[r]=u[r]);for(const x in a)(b=a[x])&&(s?s in b&&o++:o+=Object.keys(b).length)}return o}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const t=Object.create(null);return r=>{r in t||(t[r]=!0,e(this._termFromId(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,r,s){t||(s=e.graph,r=e.object,t=e.predicate,e=e.subject),s=s?this._termToNewNumericId(s):1;let o=this._graphs[s];return o||(o=this._graphs[s]={subjects:{},predicates:{},objects:{}},Object.freeze(o)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),r=this._termToNewNumericId(r),this._addToIndex(o.subjects,e,t,r)?(this._addToIndex(o.predicates,t,r,e),this._addToIndex(o.objects,r,e,t),this._size=null,!0):!1}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,r,s){return e&&e.subject&&({subject:e,predicate:t,object:r,graph:s}=e),!this.readQuads(e,t,r,s).next().done}import(e){return e.on("data",t=>{this.addQuad(t)}),e}removeQuad(e,t,r,s){t||({subject:e,predicate:t,object:r,graph:s}=e),s=s?this._termToNumericId(s):1;const o=this._graphs;let u,a,b;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(r=r&&this._termToNumericId(r))||!(u=o[s])||!(a=u.subjects[e])||!(b=a[t])||!(r in b))return!1;this._removeFromIndex(u.subjects,e,t,r),this._removeFromIndex(u.predicates,t,r,e),this._removeFromIndex(u.objects,r,e,t),this._size!==null&&this._size--;for(e in u.subjects)return!0;return delete o[s],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",t=>{this.removeQuad(t)}),e}removeMatches(e,t,r,s){const o=new Rn.Readable({objectMode:!0}),u=this.readQuads(e,t,r,s);return o._read=a=>{for(;--a>=0;){const{done:b,value:h}=u.next();if(b){o.push(null);return}o.push(h)}},this.remove(o)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,r,s){return[...this.readQuads(e,t,r,s)]}*readQuads(e,t,r,s){const o=this._getGraphs(s);let u,a,b,h;if(!(e&&!(a=this._termToNumericId(e))||t&&!(b=this._termToNumericId(t))||r&&!(h=this._termToNumericId(r))))for(const x in o)(u=o[x])&&(a?h?yield*this._findInIndex(u.objects,h,a,b,"object","subject","predicate",x):yield*this._findInIndex(u.subjects,a,b,null,"subject","predicate","object",x):b?yield*this._findInIndex(u.predicates,b,h,null,"predicate","object","subject",x):h?yield*this._findInIndex(u.objects,h,null,null,"object","subject","predicate",x):yield*this._findInIndex(u.subjects,null,null,null,"subject","predicate","object",x))}match(e,t,r,s){return new qe(this,e,t,r,s,{entityIndex:this._entityIndex})}countQuads(e,t,r,s){const o=this._getGraphs(s);let u=0,a,b,h,x;if(e&&!(b=this._termToNumericId(e))||t&&!(h=this._termToNumericId(t))||r&&!(x=this._termToNumericId(r)))return 0;for(const T in o)(a=o[T])&&(e?r?u+=this._countInIndex(a.objects,x,b,h):u+=this._countInIndex(a.subjects,b,h,x):t?u+=this._countInIndex(a.predicates,h,x,b):u+=this._countInIndex(a.objects,x,b,h));return u}forEach(e,t,r,s,o){this.some(u=>(e(u,this),!1),t,r,s,o)}every(e,t,r,s,o){return!this.some(u=>!e(u,this),t,r,s,o)}some(e,t,r,s,o){for(const u of this.readQuads(t,r,s,o))if(e(u,this))return!0;return!1}getSubjects(e,t,r){const s=[];return this.forSubjects(o=>{s.push(o)},e,t,r),s}forSubjects(e,t,r,s){const o=this._getGraphs(s);let u,a,b;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(b=this._termToNumericId(r))))for(s in o)(u=o[s])&&(a?b?this._loopBy2Keys(u.predicates,a,b,e):this._loopByKey1(u.subjects,a,e):b?this._loopByKey0(u.objects,b,e):this._loop(u.subjects,e))}getPredicates(e,t,r){const s=[];return this.forPredicates(o=>{s.push(o)},e,t,r),s}forPredicates(e,t,r,s){const o=this._getGraphs(s);let u,a,b;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(b=this._termToNumericId(r))))for(s in o)(u=o[s])&&(a?b?this._loopBy2Keys(u.objects,b,a,e):this._loopByKey0(u.subjects,a,e):b?this._loopByKey1(u.predicates,b,e):this._loop(u.predicates,e))}getObjects(e,t,r){const s=[];return this.forObjects(o=>{s.push(o)},e,t,r),s}forObjects(e,t,r,s){const o=this._getGraphs(s);let u,a,b;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(b=this._termToNumericId(r))))for(s in o)(u=o[s])&&(a?b?this._loopBy2Keys(u.subjects,a,b,e):this._loopByKey1(u.objects,a,e):b?this._loopByKey0(u.predicates,b,e):this._loop(u.objects,e))}getGraphs(e,t,r){const s=[];return this.forGraphs(o=>{s.push(o)},e,t,r),s}forGraphs(e,t,r,s){for(const o in this._graphs)this.some(u=>(e(u.graph),!0),t,r,s,this._termFromId(this._entities[o]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},s=t?(()=>!0):((a,b)=>{throw new Error(`${a.value} ${b}`)}),o=this.getQuads(null,Ae.rdf.rest,Ae.rdf.nil,null),u=e?[...o]:[];return o.forEach(a=>{const b=[];let h=!1,x,T;const j=a.graph;let B=a.subject;for(;B&&!h;){const A=this.getQuads(null,null,B,null),v=this.getQuads(B,null,null,null);let y,_=null,m=null,w=null;for(let P=0;P<v.length&&!h;P++)y=v[P],y.graph.equals(j)?x?h=s(B,"has non-list arcs out"):y.predicate.value===Ae.rdf.first?_?h=s(B,"has multiple rdf:first arcs"):u.push(_=y):y.predicate.value===Ae.rdf.rest?m?h=s(B,"has multiple rdf:rest arcs"):u.push(m=y):A.length?h=s(B,"can't be subject and object"):(x=y,T="subject"):h=s(B,"not confined to single graph");for(let P=0;P<A.length&&!h;++P)y=A[P],x?h=s(B,"can't have coreferences"):y.predicate.value===Ae.rdf.rest?w?h=s(B,"has incoming rdf:rest arcs"):w=y:(x=y,T="object");_?b.unshift(_.object):h=s(B,"has no list head"),B=w&&w.subject}h?e=!1:x&&(r[x[T].value]=b)}),e&&this.removeQuads(u),r}addAll(e){if(e instanceof qe&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof ke&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=ct(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof qe&&(e=e.filtered),e===this)return!0;if(!(e instanceof ke)||this._entityIndex!==e._entityIndex)return e.every(h=>this.has(h));const t=this._graphs,r=e._graphs;let s,o,u,a,b;for(const h in r){if(!(s=t[h]))return!1;s=s.subjects;for(const x in o=r[h].subjects){if(!(u=s[x]))return!1;for(const T in a=o[x]){if(!(b=u[T]))return!1;for(const j in a[T])if(!(j in b))return!1}}}return!0}deleteMatches(e,t,r,s){for(const o of this.match(e,t,r,s))this.removeQuad(o);return this}difference(e){if(e&&e instanceof qe&&(e=e.filtered),e===this)return new ke({entityIndex:this._entityIndex});if(e instanceof ke&&e._entityIndex===this._entityIndex){const t=new ke({entityIndex:this._entityIndex}),r=vn(this._graphs,e._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter(t=>!e.has(t))}equals(e){return e instanceof qe&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new ke({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e instanceof qe&&(e=e.filtered),e===this){const t=new ke({entityIndex:this._entityIndex});return t._graphs=ct(Object.create(null),this._graphs),t._size=this._size,t}else if(e instanceof ke&&this._entityIndex===e._entityIndex){const t=new ke({entityIndex:this._entityIndex}),r=Tn(e._graphs,this._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter(t=>e.has(t))}map(e){const t=new ke({entityIndex:this._entityIndex});for(const r of this)t.add(e(r,this));return t}reduce(e,t){const r=this.readQuads();let s=t===void 0?r.next().value:t;for(const o of r)s=e(s,o,this);return s}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new Dr().quadsToString(this)}union(e){const t=new ke({entityIndex:this._entityIndex});return t._graphs=ct(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function Oe(l,e,t=0){const r=e[t];if(r&&!(r in l))return!1;let s=!1;for(const o in r?{[r]:l[r]}:l){const u=t===2?null:Oe(l[o],e,t+1);u!==!1&&(s=s||Object.create(null),s[o]=u)}return s}class qe extends Rn.Readable{constructor(e,t,r,s,o,u){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:s,graph:o,options:u})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:s,subject:o}=this,u=this._filtered=new ke({factory:e._factory,entityIndex:this.options.entityIndex});let a,b,h;if(o&&!(a=u._termToNumericId(o))||s&&!(b=u._termToNumericId(s))||r&&!(h=u._termToNumericId(r)))return u;const x=e._getGraphs(t);for(const T in x){let j,B,A,v;(v=x[T])&&(!a&&b?(B=Oe(v.predicates,[b,h,a]))&&(j=Oe(v.subjects,[a,b,h]),A=Oe(v.objects,[h,a,b])):h?(A=Oe(v.objects,[h,a,b]))&&(j=Oe(v.subjects,[a,b,h]),B=Oe(v.predicates,[b,h,a])):(j=Oe(v.subjects,[a,b,h]))&&(B=Oe(v.predicates,[b,h,a]),A=Oe(v.objects,[h,a,b])),j&&(u._graphs[T]={subjects:j,predicates:B,objects:A}))}u._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[pr]&&(this[pr]=this[Symbol.iterator]());const t=this[pr];for(;--e>=0;){const{done:r,value:s}=t.next();if(r){this.push(null);return}this.push(s)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,r,s){return this.filtered.deleteMatches(e,t,r,s)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,r,s,o){return this.filtered.every(e,t,r,s,o)}filter(e){return this.filtered.filter(e)}forEach(e,t,r,s,o){return this.filtered.forEach(e,t,r,s,o)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,r,s,o){return this.filtered.some(e,t,r,s,o)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return new Dr().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,r,s){return new qe(this.filtered,e,t,r,s,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}const Bt={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#"},ve={namespace:"https://prez.dev/",label:"https://prez.dev/label",description:"https://prez.dev/description",provenance:"https://prez.dev/provenance",focusNode:"https://prez.dev/FocusNode",link:"https://prez.dev/link",members:"https://prez.dev/members",identifier:"https://prez.dev/identifier",count:"https://prez.dev/count",searchResult:"https://prez.dev/SearchResult",searchResultWeight:"https://prez.dev/searchResultWeight",searchResultPredicate:"https://prez.dev/searchResultPredicate",searchResultURI:"https://prez.dev/searchResultURI",searchResultMatch:"https://prez.dev/searchResultMatch",hasChildren:"https://prez.dev/hasChildren",facetCount:"https://prez.dev/facetCount",facetName:"https://prez.dev/facetName",facetValue:"https://prez.dev/facetValue",profile:"https://prez.dev/profile"},Se={skosConceptScheme:"http://www.w3.org/2004/02/skos/core#ConceptScheme",skosConcept:"http://www.w3.org/2004/02/skos/core#Concept",a:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",rdfLangString:"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",xmlString:"http://www.w3.org/2001/XMLSchema#string",w3Html:"http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",w3Markdown:"https://www.w3.org/ns/iana/media-types/text/markdown",w3token:"http://www.w3.org/2001/XMLSchema#token",shaclAllPredicates:"http://example.com/shacl-extension#allPredicateValues",shaclPathAlias:"http://example.com/shacl-extension#pathAlias",shaclProperty:"http://www.w3.org/ns/shacl#property",shaclPath:"http://www.w3.org/ns/shacl#path",shaclUnion:"http://www.w3.org/ns/shacl#union",dctermsIdentifier:"http://purl.org/dc/terms/identifier",owlOntology:"http://www.w3.org/2002/07/owl#Ontology"},An={bblock:"https://www.opengis.net/def/bblocks/BuildingBlock",bblockSchema:"https://www.opengis.net/def/bblocks/Schema",bblockModel:"https://www.opengis.net/def/bblocks/Model",bblockApi:"https://www.opengis.net/def/bblocks/Api",bblockPath:"https://www.opengis.net/def/bblocks/Response",bblockResponse:"https://www.opengis.net/def/bblocks/Datatype",bblockParameter:"https://www.opengis.net/def/bblocks/Parameter",bblockDatatype:"https://www.opengis.net/def/bblocks/Datatype"},ci={label:["https://prez.dev/label"],description:["https://prez.dev/description"],provenance:["https://prez.dev/provenance"]};function Nn(l,e=Bt){if(l==="a")return e.rdf+"type";{const[t,r]=l.split(":");return t?[t]+r:l}}function Pn(l,e=Bt){let t="";return Object.entries(e).forEach(([r,s])=>{l.startsWith(s)&&(t=r+":"+l.split(s)[1])}),t}const jn=l=>{const e=new URL(l);return`${e.protocol}//${e.hostname}`},di=l=>new URL(l).pathname,hi=(l,e)=>{const t=e.identifiers?.find(r=>r.value)?.value;return t?l+`/concept-hierarchy/${t}/narrowers`:""},pi=(l,e)=>{const t=e?jn(e):"",r=l.identifiers?.find(u=>u.value),s=r?r.value:"";return s?t+`/concept-hierarchy/${s}/top-concepts`:""},Lt=l=>l.flatMap(e=>e["@id"]?e["@id"]:e["@list"]&&e["@list"].length>0?e["@list"][0]?.["@id"]===Se.shaclUnion?Lt(e["@list"][1]?.["@list"]||[]).filter(Boolean):Lt(e["@list"]).flat():[]).filter(e=>!!e),_i=l=>l.reduce((e,t)=>{if(Se.shaclProperty in t)for(const r of t[Se.shaclProperty]){const s=l.find(o=>o["@id"]===r["@id"]);s&&Se.shaclPath in s&&(e[t["@id"]]=Lt(s[Se.shaclPath]).filter(o=>o!==Se.shaclAllPredicates))}return e},{});function dt(l){if(Array.isArray(l))return l.reduce((e,t)=>{const r=dt(t);return typeof r=="object"&&!Array.isArray(r)&&Object.assign(e,r),e},{});if(typeof l=="object"&&l!==null){if(l.hasOwnProperty("value"))return l.value;if(l.hasOwnProperty("node")&&l.hasOwnProperty("list")){const e={};return e[l.node.value]=l.list.length>0?dt(l.list):"",e}else{const e={};for(const t in l)e[t]=dt(l[t]);return e}}return l}function _r(l,e=""){let t="";const r=Object.entries(l),s=r.length;return r.forEach(([o,u],a)=>{const b=o.replace(/https?:\/\/(www\.)?/,""),[h,x]=b.split("#"),T=h.split("/"),j=T[T.length-1],B=x?`(${T[0]})/${j}#${x}`:`(${T[0]})/${j}`,A=a===s-1;t+=`${e}${A?"└── ":"├── "}${B}
|
|
23
|
-
`,typeof u=="object"&&u!==null&&(t+=_r(u,e+(A?" ":"│ ")))}),t}function bi(l){return l?_r(dt(l)):""}const{namedNode:
|
|
24
|
-
`+e;const t=this.parser.parse(e,null,(r,s)=>{this.prefixes[r]=s.value});this.store.addQuads(t),this.linkedLists=this.store.extractLists(),this.buildLists()}buildLists(){this.lists={};const e=this.linkedLists;this.store.getQuads(null,Se.shaclPath,null,null).forEach(t=>{const r=t.object;if(r.termType==="BlankNode"){const s=this.store.getQuads(r,Se.shaclUnion,null,null);if(s.length>0){const o=s[0].object;if(o.termType==="BlankNode"&&o.value in e){const u=e[o.value],a=r.value;this.lists[a]=this.buildSubList(u)}else console.warn(`[buildLists] Found sh:union for ${r.value}, but its object ${o.value} is not a valid list head in linkedLists.`)}}})}buildSubList(e){const t=[];for(const r of e)if(r.termType=="BlankNode"){const s=r.value;if(s in this.linkedLists){const o=this.buildSubList(this.linkedLists[s]);if(o.length>1){const u=t.find(a=>a.node.value==o[0].node.value);u?(u.list??=[]).push(...o.slice(1)):t.push({node:o[0].node,list:o.slice(1)})}else t.push(...o)}else{const o=this.store.getObjects(r,Se.shaclPathAlias,null)?.[0];if(o){const u=this.toPrezTerm(o);t.push({node:u,list:[]})}}}else if(r.termType=="NamedNode"&&r.value!=Se.shaclUnion){const s=this.toPrezTerm(r);t.push({node:s,list:[]})}return t}setBaseUrl(e){this.baseUrl=e,this.basePath=new URL(e).pathname}toIri(e){return Nn(e,this.prefixes)}fromIri(e){return Pn(e,this.prefixes)}getObjectLiteral(e,t){return this.getObjects(e,t).map(r=>this.toPrezTerm(r))[0]||void 0}getProperties(e,t){const r={};return this.store.forEach(s=>{t?.excludePrefix&&s.predicate.value.startsWith(t.excludePrefix)||t?.includePrefix&&!s.predicate.value.startsWith(t.includePrefix)||(r[s.predicate.value]??={predicate:this.toPrezTerm(s.predicate),objects:[]},r[s.predicate.value].objects.push(this.toPrezTerm(s.object)))},e,null,null,null),e.termType,r}getParents(e){e.startsWith(this.basePath)&&(e=e.substring(this.basePath.length));const t=e.split("/"),r=[];let s="";for(const o of t){if(o=="")continue;s+="/"+o;const u={url:s,segment:o};if(o.includes(":")){const a=o.split(":"),b=this.prefixes[a[0]];if(b){const h=this.getObjects(b+a[1],ve.label);h.length>0&&(u.label=gt(h[0].value))}}r.push(u)}return r}toPrezTerm(e){const t=`${e.termType}:${e.value}`;if(this.processedTerms.has(t))switch(e.termType){case"NamedNode":return kt(e.value);case"Literal":return gt(e.value);case"BlankNode":return yt(e.value);default:throw new Error("Invalid n3 Term object")}this.processedTerms.add(t);try{switch(e.termType){case"NamedNode":const r=kt(e.value);r.label=this.getObjectLiteral(e.value,ve.label),r.description=this.getObjectLiteral(e.value,ve.description),r.provenance=this.getObjectLiteral(e.value,ve.provenance);const s=this.getObjects(e.value,ve.identifier);s.length>0&&(r.identifiers=s.map(x=>this.toPrezTerm(x)));const o=this.getObjects(e.value,ve.link);o.length>0&&(r.links=o.map(x=>({value:x.value,parents:this.getParents(x.value)})));const u=this.getObjects(e.value,ve.members);u.length>0&&(r.members={value:u[0].value,parents:this.getParents(u[0].value)});const a=this.getObjects(e.value,Se.a);return a.length>0&&(r.rdfTypes=a.map(x=>this.toPrezTerm(x))),r;case"Literal":const b=gt(e.value);return e.datatype&&(b.datatype=this.toPrezTerm(e.datatype)),e.language&&(b.language=e.language),b;case"BlankNode":const h=yt(e.value);return h.properties=this.getProperties(e,void 0),e.value in this.lists&&(h.list=this.lists[e.value]),h;default:throw"Invalid n3 Term object"}}finally{this.processedTerms.delete(t)}}toPrezFocusNode(e){const t=this.toPrezTerm(e);return t.properties=this.getProperties(e,{excludePrefix:ve.namespace}),t.systemProperties=this.getProperties(e,{includePrefix:ve.namespace}),t.rdfTypes?.map(r=>r.value).includes(Se.skosConcept)&&(t.hasChildren=t.systemProperties?.[ve.hasChildren]?.objects?.[0]?.value=="true"),t}getSubjects(e,t){return this.store.getSubjects(e,t,null)}getObjects(e,t){if(typeof t=="string")return this.store.getObjects(ht(e),ht(t),null);{const r=[];return t.forEach(s=>{r.push(...this.store.getObjects(ht(e),ht(s),null))}),r}}getMembers(e){this.getObjects(e,this.toIri("prez:members")).forEach(r=>({value:r.value,parents:[]}))}getConcepts(e){const t=this.getSubjects(this.toIri("skos:inScheme"),e.value);function r(h){return t.map(x=>x.value).includes(h.value)}const s=this.getObjects(e.value,this.toIri("skos:hasTopConcept")),o=this.getObjects(e.value,this.toIri("skos:topConceptOf")),u={},a=[...s,...o].filter(h=>r(h));t.forEach(h=>{u[h.value]=[]}),t.forEach(h=>{this.getObjects(h.value,this.toIri("skos:broader")).forEach(j=>{r(j)&&u[j.value].push(h)}),this.getObjects(h.value,this.toIri("skos:narrower")).forEach(j=>{r(j)&&u[h.value].push(j)})});const b=[];return a.forEach(h=>{b.push(this.createHierarchy(h,u))}),b}createHierarchy(e,t){const r=t[e.value].map(s=>this.createHierarchy(s,t));return{...this.toPrezTerm(e),hasChildren:r.length>0,narrowers:r}}getByPrezId(e){const t=[];return this.store.forEach(r=>{t.push(r)},null,null,ht("https://prez.dev/FocusNode"),null),e?t.find(r=>r.object.value===e).subject:t.map(r=>r.subject)}getCount(){const e=this.store.getObjects(null,ve.count,null);return e.length>0?Number(e[0].value.replace(">","")):0}getMaxReached(){const e=this.store.getObjects(null,ve.count,null);return e.length>0?!e[0].value.includes(">"):!1}getList(){const e=[];return this.getByPrezId().forEach(r=>{e.push(this.toPrezFocusNode(r))}),e}getSkosCollections(e){const t=this.getSubjects("http://www.w3.org/2004/02/skos/core#inScheme",e.value);return this.getSubjects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.w3.org/2004/02/skos/core#Collection").filter(o=>t.find(u=>u.value===o.value)).map(o=>this.toPrezTerm(o)).sort((o,u)=>o.label&&u.label?o.label.value.localeCompare(u.label.value):o.label?-1:u.label?1:o.value.localeCompare(u.value))}getOntologyClasses(e){const t=this.getSubjects("http://www.w3.org/2000/01/rdf-schema#isDefinedBy",e.value);return this.getSubjects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.w3.org/2002/07/owl#Class").filter(o=>t.find(u=>u.value===o.value)).map(o=>this.toPrezTerm(o)).sort((o,u)=>o.label&&u.label?o.label.value.localeCompare(u.label.value):o.label?-1:u.label?1:o.value.localeCompare(u.value))}getOntologyProperties(e){const t=this.getSubjects("http://www.w3.org/2000/01/rdf-schema#isDefinedBy",e.value);return this.getSubjects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.w3.org/2002/07/owl#ObjectProperty").filter(o=>t.find(u=>u.value===o.value)).map(o=>this.toPrezTerm(o)).sort((o,u)=>o.label&&u.label?o.label.value.localeCompare(u.label.value):o.label?-1:u.label?1:o.value.localeCompare(u.value))}getBBlockDependencies(e){return this.getObjects(e.value,"https://www.opengis.net/def/bblocks/dependsOn").map(s=>this.toPrezTerm(s)).sort((s,o)=>s.label&&o.label?s.label.value.localeCompare(o.label.value):s.label?-1:o.label?1:s.value.localeCompare(o.value))}getItem(){const e=this.getByPrezId();if(e.length==0)throw new Error("Unable to find item");const t=this.toPrezFocusNode(e[0]);if(t.rdfTypes?.map(s=>s.value).includes(Se.owlOntology)&&t.rdfTypes?.map(s=>s.value).includes(Se.skosConceptScheme)){const s=this.getOntologyClasses(e[0]),o=this.getOntologyProperties(e[0]),u=this.getSkosCollections(e[0]);return{...t,collections:u,ontologyClasses:s,ontologyProperties:o}}if(t.rdfTypes?.map(s=>s.value).includes(Se.owlOntology)){const s=this.getOntologyClasses(e[0]),o=this.getOntologyProperties(e[0]);return{...t,ontologyClasses:s,ontologyProperties:o}}if(t.rdfTypes?.map(s=>s.value).includes(Se.skosConceptScheme)){const s=this.getSkosCollections(e[0]);return{...t,collections:s}}let r=!1;if(t.rdfTypes&&t.rdfTypes.length)for(let s=0;!r&&s<t.rdfTypes.length;s++)Object.values(An).includes(t.rdfTypes[s].value)&&(r=!0);if(r){const s=this.getBBlockDependencies(e[0]);return{...t,dependsOn:s,isBBlock:r}}return t}getSubItems(e){const t=this.store.getQuads(null,e,null,null),r=[];return t.forEach(s=>{const o=this.toPrezFocusNode(s.object);o&&r.push(o)}),r}search(){return this.getSubjects(Se.a,ve.searchResult).map(r=>({hash:r.value.split("urn:hash:").slice(-1)[0],weight:Number(this.getObjects(r.value,ve.searchResultWeight)[0].value),predicate:this.toPrezTerm(this.getObjects(r.value,ve.searchResultPredicate)[0]),match:this.toPrezTerm(this.getObjects(r.value,ve.searchResultMatch)[0]),resource:this.toPrezFocusNode(this.getObjects(r.value,ve.searchResultURI)[0])}))}getFacets(){const e=[];return this.store.getQuads(null,ve.facetName,null,null).forEach(t=>{if(t.subject.termType=="BlankNode"){const r=yt(t.subject.value);r.properties=this.getProperties(t.subject);const s=Number(r.properties?.[ve.facetCount]?.objects?.[0].value)||0,o=r.properties?.[ve.facetName]?.objects?.[0],u=r.properties?.[ve.facetValue]?.objects?.[0],a=o,b=e.find(h=>h.facetName.value==a?.value);if(s>0&&a!==void 0&&u!==void 0){const h=this.toPrezTerm(u);if(h.termType==="Literal"||h.termType==="NamedNode"){const x={term:h,count:s};b?b.facetValues.push(x):e.push({facetName:a,facetValues:[x]})}}}}),e}}class gi extends Error{constructor(e){super(e),this.name="NetworkError"}}function yi(l){let e={};const t=l.split(",").map(s=>{const[,o,u]=s.trim().match(/<(.+)>; (.+)/),a={uri:o};return u.split("; ").forEach(b=>{const[,h,x]=b.match(/(.+)=[\"<](.+)[\">]/);a[h]=x}),a});t.filter(s=>s.rel==="type").forEach(s=>{e[s.anchor]={default:!1,current:!1,token:s.token,mediatypes:[],title:s.title,description:"",uri:s.anchor}});const r=t.find(s=>s.rel==="self");return r.format in e&&(e[r.format].current=!0),t.filter(s=>s.rel==="alternate"&&s.format).forEach(s=>{e[s.format].mediatypes.map(o=>o.mediatype).includes(s.type)||e[s.format].mediatypes.push({title:"",mediatype:s.type,default:!1})}),Object.values(e)}async function _t(l){const e=await fetch(l,{method:"GET",headers:{Accept:"text/anot+turtle"}});if(!e.ok)throw new gi(`Network error - status code ${e.status}: ${e.statusText}`);const t=e.headers.get("link")||e.headers.get("Link"),r=t?yi(t):[];return{data:await e.text(),profiles:r}}async function wi(l,e){const t=l+e,r=new URL(t).pathname,{data:s,profiles:o}=await _t(t),u=new pt;return u.setBaseUrl(l),u.load(s),{type:"list",data:u.getList(),profiles:o,maxReached:u.getMaxReached(),count:u.getCount(),parents:u.getParents(r),facets:u.getFacets()}}async function mi(l,e){const t=l+e,r=new URL(t).pathname,{data:s,profiles:o}=await _t(t),u=new pt;return u.setBaseUrl(l),u.load(s),{type:"item",data:u.getItem(),profiles:o,parents:u.getParents(r),store:u,facets:u.getFacets()}}async function xi(l,e){const t=l+e,r=new URL(t).pathname,{data:s,profiles:o}=await _t(t),u=new pt;return u.setBaseUrl(l),u.load(s),{type:"search",data:u.search(),profiles:o,maxReached:u.getMaxReached(),count:u.getCount(),parents:u.getParents(r),facets:u.getFacets()}}async function Ei(l){const e=l+"/profiles?page=1&limit=999&_mediatype=application/anot%2Bturtle",{data:t}=await _t(e),r=new pt;r.setBaseUrl(l),r.load(t);const s=r.getList(),o={};for(const u of s){let a=[];if(u.properties&&u.properties?.[Se.shaclProperty]?.objects){const b=u.properties[Se.shaclProperty].objects;for(const h of b){const x=h;if(x.properties&&x.properties[Se.shaclPath])for(const T of x.properties[Se.shaclPath].objects){const j=T.list;j&&(a=j)}}}u.properties?.[Se.dctermsIdentifier]?.objects?.filter(b=>b?.termType=="Literal"&&b?.datatype?.value==Se.w3token)?.map(b=>b.value).forEach(b=>{o[b]=a,o[u.value]=a;const h=r.fromIri(u.value);h!=u.value&&(o[h]=a)})}return o}function Si(l,e){const t={},r=Object.keys(l),s=[...(e||[]).filter(o=>r.includes(o.node.value)).map(o=>o.node.value),...r.filter(o=>!(e||[]).find(u=>u.node.value==o))].filter(o=>o in(l||{})).map(o=>l[o]);for(const o of s)e.find(u=>u.node.value==o.predicate.value&&u.list&&u.list.length>0),t[o.predicate.value]=l[o.predicate.value];return t}function Ii(l,e){l.data.properties=Si(l.data.properties||{},e)}me.ANNOTATION_PREDICATES=ci,me.BBLOCK_TYPES=An,me.DEFAULT_PREFIXES=Bt,me.PREZ_PREDICATES=ve,me.RDFStore=pt,me.SYSTEM_PREDICATES=Se,me.apiGet=_t,me.applyProfileToItem=Ii,me.bnode=yt,me.buildProfiles=_i,me.defaultFromIri=Pn,me.defaultToIri=Nn,me.dumpNodeArray=bi,me.getBaseUrl=jn,me.getItem=mi,me.getList=wi,me.getNarrowersUrl=hi,me.getProfiles=Ei,me.getTopConceptsUrl=pi,me.getUrlPath=di,me.isTypePrezTerm=et,me.literal=gt,me.node=kt,me.nodeArrayToTree=_r,me.processShaclPath=Lt,me.search=xi,me.simplifyNodeArray=dt,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})}));
|
|
21
|
+
`),this._subject=null),this._write=this._blockedWrite;let t=e&&((r,s)=>{t=null,e(r,s)});if(this._endStream)try{return this._outputStream.end(t)}catch{}t&&t()}}function $r(l){let e=ni[l];return e===void 0&&(l.length===1?(e=l.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((l.charCodeAt(0)-55296)*1024+l.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var $t={exports:{}},Ut={exports:{}},Wt,Ur;function ve(){if(Ur)return Wt;Ur=1;class l extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let r="";for(let s=0;s<t.length;s++)r+=` ${t[s].stack}
|
|
22
|
+
`;super(r),this.name="AggregateError",this.errors=t}}return Wt={AggregateError:l,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,r){return e.slice(t,r)},Error,FunctionPrototypeCall(e,t,...r){return e.call(t,...r)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,r){return e.then(t,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,r){return e.set(t,r)},Boolean,Uint8Array},Wt}var qt={exports:{}},zt,Wr;function qr(){return Wr||(Wr=1,zt={format(l,...e){return l.replace(/%([sdifj])/g,function(...[t,r]){const s=e.shift();return r==="f"?s.toFixed(6):r==="j"?JSON.stringify(s):r==="s"&&typeof s=="object"?`${s.constructor!==Object?s.constructor.name:""} {}`.trim():s.toString()})},inspect(l){switch(typeof l){case"string":if(l.includes("'"))if(l.includes('"')){if(!l.includes("`")&&!l.includes("${"))return`\`${l}\``}else return`"${l}"`;return`'${l}'`;case"number":return isNaN(l)?"NaN":Object.is(l,-0)?String(l):l;case"bigint":return`${String(l)}n`;case"boolean":case"undefined":return String(l);case"object":return"{}"}}}),zt}var Gt,zr;function je(){if(zr)return Gt;zr=1;const{format:l,inspect:e}=qr(),{AggregateError:t}=ve(),r=globalThis.AggregateError||t,s=Symbol("kIsNodeError"),o=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,a="__node_internal_",p={};function h(y,b){if(!y)throw new p.ERR_INTERNAL_ASSERTION(b)}function x(y){let b="",m=y.length;const w=y[0]==="-"?1:0;for(;m>=w+4;m-=3)b=`_${y.slice(m-3,m)}${b}`;return`${y.slice(0,m)}${b}`}function T(y,b,m){if(typeof b=="function")return h(b.length<=m.length,`Code: ${y}; The provided arguments length (${m.length}) does not match the required ones (${b.length}).`),b(...m);const w=(b.match(/%[dfijoOs]/g)||[]).length;return h(w===m.length,`Code: ${y}; The provided arguments length (${m.length}) does not match the required ones (${w}).`),m.length===0?b:l(b,...m)}function j(y,b,m){m||(m=Error);class w extends m{constructor(...I){super(T(y,b,I))}toString(){return`${this.name} [${y}]: ${this.message}`}}Object.defineProperties(w.prototype,{name:{value:m.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${y}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),w.prototype.code=y,w.prototype[s]=!0,p[y]=w}function B(y){const b=a+y.name;return Object.defineProperty(y,"name",{value:b}),y}function A(y,b){if(y&&b&&y!==b){if(Array.isArray(b.errors))return b.errors.push(y),b;const m=new r([b,y],b.message);return m.code=b.code,m}return y||b}class v extends Error{constructor(b="The operation was aborted",m=void 0){if(m!==void 0&&typeof m!="object")throw new p.ERR_INVALID_ARG_TYPE("options","Object",m);super(b,m),this.code="ABORT_ERR",this.name="AbortError"}}return j("ERR_ASSERTION","%s",Error),j("ERR_INVALID_ARG_TYPE",(y,b,m)=>{h(typeof y=="string","'name' must be a string"),Array.isArray(b)||(b=[b]);let w="The ";y.endsWith(" argument")?w+=`${y} `:w+=`"${y}" ${y.includes(".")?"property":"argument"} `,w+="must be ";const P=[],I=[],H=[];for(const z of b)h(typeof z=="string","All expected entries have to be of type string"),o.includes(z)?P.push(z.toLowerCase()):u.test(z)?I.push(z):(h(z!=="object",'The value "object" should be written as "Object"'),H.push(z));if(I.length>0){const z=P.indexOf("object");z!==-1&&(P.splice(P,z,1),I.push("Object"))}if(P.length>0){switch(P.length){case 1:w+=`of type ${P[0]}`;break;case 2:w+=`one of type ${P[0]} or ${P[1]}`;break;default:{const z=P.pop();w+=`one of type ${P.join(", ")}, or ${z}`}}(I.length>0||H.length>0)&&(w+=" or ")}if(I.length>0){switch(I.length){case 1:w+=`an instance of ${I[0]}`;break;case 2:w+=`an instance of ${I[0]} or ${I[1]}`;break;default:{const z=I.pop();w+=`an instance of ${I.join(", ")}, or ${z}`}}H.length>0&&(w+=" or ")}switch(H.length){case 0:break;case 1:H[0].toLowerCase()!==H[0]&&(w+="an "),w+=`${H[0]}`;break;case 2:w+=`one of ${H[0]} or ${H[1]}`;break;default:{const z=H.pop();w+=`one of ${H.join(", ")}, or ${z}`}}if(m==null)w+=`. Received ${m}`;else if(typeof m=="function"&&m.name)w+=`. Received function ${m.name}`;else if(typeof m=="object"){var K;if((K=m.constructor)!==null&&K!==void 0&&K.name)w+=`. Received an instance of ${m.constructor.name}`;else{const z=e(m,{depth:-1});w+=`. Received ${z}`}}else{let z=e(m,{colors:!1});z.length>25&&(z=`${z.slice(0,25)}...`),w+=`. Received type ${typeof m} (${z})`}return w},TypeError),j("ERR_INVALID_ARG_VALUE",(y,b,m="is invalid")=>{let w=e(b);return w.length>128&&(w=w.slice(0,128)+"..."),`The ${y.includes(".")?"property":"argument"} '${y}' ${m}. Received ${w}`},TypeError),j("ERR_INVALID_RETURN_VALUE",(y,b,m)=>{var w;const P=m!=null&&(w=m.constructor)!==null&&w!==void 0&&w.name?`instance of ${m.constructor.name}`:`type ${typeof m}`;return`Expected ${y} to be returned from the "${b}" function but got ${P}.`},TypeError),j("ERR_MISSING_ARGS",(...y)=>{h(y.length>0,"At least one arg needs to be specified");let b;const m=y.length;switch(y=(Array.isArray(y)?y:[y]).map(w=>`"${w}"`).join(" or "),m){case 1:b+=`The ${y[0]} argument`;break;case 2:b+=`The ${y[0]} and ${y[1]} arguments`;break;default:{const w=y.pop();b+=`The ${y.join(", ")}, and ${w} arguments`}break}return`${b} must be specified`},TypeError),j("ERR_OUT_OF_RANGE",(y,b,m)=>{h(b,'Missing "range" argument');let w;if(Number.isInteger(m)&&Math.abs(m)>2**32)w=x(String(m));else if(typeof m=="bigint"){w=String(m);const P=BigInt(2)**BigInt(32);(m>P||m<-P)&&(w=x(w)),w+="n"}else w=e(m);return`The value of "${y}" is out of range. It must be ${b}. Received ${w}`},RangeError),j("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),j("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),j("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),j("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),j("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),j("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),j("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),j("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),j("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),j("ERR_STREAM_WRITE_AFTER_END","write after end",Error),j("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Gt={AbortError:v,aggregateTwoErrors:B(A),hideStackFrames:B,codes:p},Gt}var lt={exports:{}},Gr;function ut(){if(Gr)return lt.exports;Gr=1;const{AbortController:l,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return lt.exports=l,lt.exports.AbortSignal=e,lt.exports.default=l,lt.exports}var St={exports:{}},Hr;function It(){if(Hr)return St.exports;Hr=1;var l=typeof Reflect=="object"?Reflect:null,e=l&&typeof l.apply=="function"?l.apply:function(I,H,K){return Function.prototype.apply.call(I,H,K)},t;l&&typeof l.ownKeys=="function"?t=l.ownKeys:Object.getOwnPropertySymbols?t=function(I){return Object.getOwnPropertyNames(I).concat(Object.getOwnPropertySymbols(I))}:t=function(I){return Object.getOwnPropertyNames(I)};function r(P){console&&console.warn&&console.warn(P)}var s=Number.isNaN||function(I){return I!==I};function o(){o.init.call(this)}St.exports=o,St.exports.once=b,o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var u=10;function a(P){if(typeof P!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof P)}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(P){if(typeof P!="number"||P<0||s(P))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+P+".");u=P}}),o.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(I){if(typeof I!="number"||I<0||s(I))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+I+".");return this._maxListeners=I,this};function p(P){return P._maxListeners===void 0?o.defaultMaxListeners:P._maxListeners}o.prototype.getMaxListeners=function(){return p(this)},o.prototype.emit=function(I){for(var H=[],K=1;K<arguments.length;K++)H.push(arguments[K]);var z=I==="error",fe=this._events;if(fe!==void 0)z=z&&fe.error===void 0;else if(!z)return!1;if(z){var k;if(H.length>0&&(k=H[0]),k instanceof Error)throw k;var O=new Error("Unhandled error."+(k?" ("+k.message+")":""));throw O.context=k,O}var V=fe[I];if(V===void 0)return!1;if(typeof V=="function")e(V,this,H);else for(var L=V.length,ne=A(V,L),K=0;K<L;++K)e(ne[K],this,H);return!0};function h(P,I,H,K){var z,fe,k;if(a(H),fe=P._events,fe===void 0?(fe=P._events=Object.create(null),P._eventsCount=0):(fe.newListener!==void 0&&(P.emit("newListener",I,H.listener?H.listener:H),fe=P._events),k=fe[I]),k===void 0)k=fe[I]=H,++P._eventsCount;else if(typeof k=="function"?k=fe[I]=K?[H,k]:[k,H]:K?k.unshift(H):k.push(H),z=p(P),z>0&&k.length>z&&!k.warned){k.warned=!0;var O=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(I)+" listeners added. Use emitter.setMaxListeners() to increase limit");O.name="MaxListenersExceededWarning",O.emitter=P,O.type=I,O.count=k.length,r(O)}return P}o.prototype.addListener=function(I,H){return h(this,I,H,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(I,H){return h(this,I,H,!0)};function x(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function T(P,I,H){var K={fired:!1,wrapFn:void 0,target:P,type:I,listener:H},z=x.bind(K);return z.listener=H,K.wrapFn=z,z}o.prototype.once=function(I,H){return a(H),this.on(I,T(this,I,H)),this},o.prototype.prependOnceListener=function(I,H){return a(H),this.prependListener(I,T(this,I,H)),this},o.prototype.removeListener=function(I,H){var K,z,fe,k,O;if(a(H),z=this._events,z===void 0)return this;if(K=z[I],K===void 0)return this;if(K===H||K.listener===H)--this._eventsCount===0?this._events=Object.create(null):(delete z[I],z.removeListener&&this.emit("removeListener",I,K.listener||H));else if(typeof K!="function"){for(fe=-1,k=K.length-1;k>=0;k--)if(K[k]===H||K[k].listener===H){O=K[k].listener,fe=k;break}if(fe<0)return this;fe===0?K.shift():v(K,fe),K.length===1&&(z[I]=K[0]),z.removeListener!==void 0&&this.emit("removeListener",I,O||H)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(I){var H,K,z;if(K=this._events,K===void 0)return this;if(K.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):K[I]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete K[I]),this;if(arguments.length===0){var fe=Object.keys(K),k;for(z=0;z<fe.length;++z)k=fe[z],k!=="removeListener"&&this.removeAllListeners(k);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(H=K[I],typeof H=="function")this.removeListener(I,H);else if(H!==void 0)for(z=H.length-1;z>=0;z--)this.removeListener(I,H[z]);return this};function j(P,I,H){var K=P._events;if(K===void 0)return[];var z=K[I];return z===void 0?[]:typeof z=="function"?H?[z.listener||z]:[z]:H?y(z):A(z,z.length)}o.prototype.listeners=function(I){return j(this,I,!0)},o.prototype.rawListeners=function(I){return j(this,I,!1)},o.listenerCount=function(P,I){return typeof P.listenerCount=="function"?P.listenerCount(I):B.call(P,I)},o.prototype.listenerCount=B;function B(P){var I=this._events;if(I!==void 0){var H=I[P];if(typeof H=="function")return 1;if(H!==void 0)return H.length}return 0}o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function A(P,I){for(var H=new Array(I),K=0;K<I;++K)H[K]=P[K];return H}function v(P,I){for(;I+1<P.length;I++)P[I]=P[I+1];P.pop()}function y(P){for(var I=new Array(P.length),H=0;H<I.length;++H)I[H]=P[H].listener||P[H];return I}function b(P,I){return new Promise(function(H,K){function z(k){P.removeListener(I,fe),K(k)}function fe(){typeof P.removeListener=="function"&&P.removeListener("error",z),H([].slice.call(arguments))}w(P,I,fe,{once:!0}),I!=="error"&&m(P,z,{once:!0})})}function m(P,I,H){typeof P.on=="function"&&w(P,"error",I,H)}function w(P,I,H,K){if(typeof P.on=="function")K.once?P.once(I,H):P.on(I,H);else if(typeof P.addEventListener=="function")P.addEventListener(I,function z(fe){K.once&&P.removeEventListener(I,z),H(fe)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof P)}return St.exports}var Qr;function Le(){return Qr||(Qr=1,(function(l){const e=Me(),{format:t,inspect:r}=qr(),{codes:{ERR_INVALID_ARG_TYPE:s}}=je(),{kResistStopPropagation:o,AggregateError:u,SymbolDispose:a}=ve(),p=globalThis.AbortSignal||ut().AbortSignal,h=globalThis.AbortController||ut().AbortController,x=Object.getPrototypeOf(async function(){}).constructor,T=globalThis.Blob||e.Blob,j=typeof T<"u"?function(y){return y instanceof T}:function(y){return!1},B=(v,y)=>{if(v!==void 0&&(v===null||typeof v!="object"||!("aborted"in v)))throw new s(y,"AbortSignal",v)},A=(v,y)=>{if(typeof v!="function")throw new s(y,"Function",v)};l.exports={AggregateError:u,kEmptyObject:Object.freeze({}),once(v){let y=!1;return function(...b){y||(y=!0,v.apply(this,b))}},createDeferredPromise:function(){let v,y;return{promise:new Promise((m,w)=>{v=m,y=w}),resolve:v,reject:y}},promisify(v){return new Promise((y,b)=>{v((m,...w)=>m?b(m):y(...w))})},debuglog(){return function(){}},format:t,inspect:r,types:{isAsyncFunction(v){return v instanceof x},isArrayBufferView(v){return ArrayBuffer.isView(v)}},isBlob:j,deprecate(v,y){return v},addAbortListener:It().addAbortListener||function(y,b){if(y===void 0)throw new s("signal","AbortSignal",y);B(y,"signal"),A(b,"listener");let m;return y.aborted?queueMicrotask(()=>b()):(y.addEventListener("abort",b,{__proto__:null,once:!0,[o]:!0}),m=()=>{y.removeEventListener("abort",b)}),{__proto__:null,[a](){var w;(w=m)===null||w===void 0||w()}}},AbortSignalAny:p.any||function(y){if(y.length===1)return y[0];const b=new h,m=()=>b.abort();return y.forEach(w=>{B(w,"signals"),w.addEventListener("abort",m,{once:!0})}),b.signal.addEventListener("abort",()=>{y.forEach(w=>w.removeEventListener("abort",m))},{once:!0}),b.signal}},l.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(qt)),qt.exports}var Rt={},Ht,Vr;function ft(){if(Vr)return Ht;Vr=1;const{ArrayIsArray:l,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:r,NumberIsInteger:s,NumberIsNaN:o,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:a,NumberParseInt:p,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:x,String:T,StringPrototypeToUpperCase:j,StringPrototypeTrim:B}=ve(),{hideStackFrames:A,codes:{ERR_SOCKET_BAD_PORT:v,ERR_INVALID_ARG_TYPE:y,ERR_INVALID_ARG_VALUE:b,ERR_OUT_OF_RANGE:m,ERR_UNKNOWN_SIGNAL:w}}=je(),{normalizeEncoding:P}=Le(),{isAsyncFunction:I,isArrayBufferView:H}=Le().types,K={};function z(R){return R===(R|0)}function fe(R){return R===R>>>0}const k=/^[0-7]+$/,O="must be a 32-bit unsigned integer or an octal string";function V(R,Q,Y){if(typeof R>"u"&&(R=Y),typeof R=="string"){if(x(k,R)===null)throw new b(Q,R,O);R=p(R,8)}return se(R,Q),R}const L=A((R,Q,Y=a,$=u)=>{if(typeof R!="number")throw new y(Q,"number",R);if(!s(R))throw new m(Q,"an integer",R);if(R<Y||R>$)throw new m(Q,`>= ${Y} && <= ${$}`,R)}),ne=A((R,Q,Y=-2147483648,$=2147483647)=>{if(typeof R!="number")throw new y(Q,"number",R);if(!s(R))throw new m(Q,"an integer",R);if(R<Y||R>$)throw new m(Q,`>= ${Y} && <= ${$}`,R)}),se=A((R,Q,Y=!1)=>{if(typeof R!="number")throw new y(Q,"number",R);if(!s(R))throw new m(Q,"an integer",R);const $=Y?1:0,we=4294967295;if(R<$||R>we)throw new m(Q,`>= ${$} && <= ${we}`,R)});function ue(R,Q){if(typeof R!="string")throw new y(Q,"string",R)}function be(R,Q,Y=void 0,$){if(typeof R!="number")throw new y(Q,"number",R);if(Y!=null&&R<Y||$!=null&&R>$||(Y!=null||$!=null)&&o(R))throw new m(Q,`${Y!=null?`>= ${Y}`:""}${Y!=null&&$!=null?" && ":""}${$!=null?`<= ${$}`:""}`,R)}const W=A((R,Q,Y)=>{if(!e(Y,R)){const we="must be one of: "+t(r(Y,Ne=>typeof Ne=="string"?`'${Ne}'`:T(Ne)),", ");throw new b(Q,R,we)}});function ae(R,Q){if(typeof R!="boolean")throw new y(Q,"boolean",R)}function g(R,Q,Y){return R==null||!h(R,Q)?Y:R[Q]}const M=A((R,Q,Y=null)=>{const $=g(Y,"allowArray",!1),we=g(Y,"allowFunction",!1);if(!g(Y,"nullable",!1)&&R===null||!$&&l(R)||typeof R!="object"&&(!we||typeof R!="function"))throw new y(Q,"Object",R)}),J=A((R,Q)=>{if(R!=null&&typeof R!="object"&&typeof R!="function")throw new y(Q,"a dictionary",R)}),U=A((R,Q,Y=0)=>{if(!l(R))throw new y(Q,"Array",R);if(R.length<Y){const $=`must be longer than ${Y}`;throw new b(Q,R,$)}});function oe(R,Q){U(R,Q);for(let Y=0;Y<R.length;Y++)ue(R[Y],`${Q}[${Y}]`)}function ce(R,Q){U(R,Q);for(let Y=0;Y<R.length;Y++)ae(R[Y],`${Q}[${Y}]`)}function ge(R,Q){U(R,Q);for(let Y=0;Y<R.length;Y++){const $=R[Y],we=`${Q}[${Y}]`;if($==null)throw new y(we,"AbortSignal",$);he($,we)}}function pe(R,Q="signal"){if(ue(R,Q),K[R]===void 0)throw K[j(R)]!==void 0?new w(R+" (signals must use all capital letters)"):new w(R)}const D=A((R,Q="buffer")=>{if(!H(R))throw new y(Q,["Buffer","TypedArray","DataView"],R)});function G(R,Q){const Y=P(Q),$=R.length;if(Y==="hex"&&$%2!==0)throw new b("encoding",Q,`is invalid for data of length ${$}`)}function ie(R,Q="Port",Y=!0){if(typeof R!="number"&&typeof R!="string"||typeof R=="string"&&B(R).length===0||+R!==+R>>>0||R>65535||R===0&&!Y)throw new v(Q,R,Y);return R|0}const he=A((R,Q)=>{if(R!==void 0&&(R===null||typeof R!="object"||!("aborted"in R)))throw new y(Q,"AbortSignal",R)}),de=A((R,Q)=>{if(typeof R!="function")throw new y(Q,"Function",R)}),S=A((R,Q)=>{if(typeof R!="function"||I(R))throw new y(Q,"Function",R)}),N=A((R,Q)=>{if(R!==void 0)throw new y(Q,"undefined",R)});function C(R,Q,Y){if(!e(Y,R))throw new y(Q,`('${t(Y,"|")}')`,R)}const ee=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function X(R,Q){if(typeof R>"u"||!x(ee,R))throw new b(Q,R,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Z(R){if(typeof R=="string")return X(R,"hints"),R;if(l(R)){const Q=R.length;let Y="";if(Q===0)return Y;for(let $=0;$<Q;$++){const we=R[$];X(we,"hints"),Y+=we,$!==Q-1&&(Y+=", ")}return Y}throw new b("hints",R,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Ht={isInt32:z,isUint32:fe,parseFileMode:V,validateArray:U,validateStringArray:oe,validateBooleanArray:ce,validateAbortSignalArray:ge,validateBoolean:ae,validateBuffer:D,validateDictionary:J,validateEncoding:G,validateFunction:de,validateInt32:ne,validateInteger:L,validateNumber:be,validateObject:M,validateOneOf:W,validatePlainFunction:S,validatePort:ie,validateSignalName:pe,validateString:ue,validateUint32:se,validateUndefined:N,validateUnion:C,validateAbortSignal:he,validateLinkHeaderValue:Z},Ht}var Tt={exports:{}},Qt={exports:{}},Kr;function He(){if(Kr)return Qt.exports;Kr=1;var l=Qt.exports={},e,t;function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?t=clearTimeout:t=s}catch{t=s}})();function o(v){if(e===setTimeout)return setTimeout(v,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(v,0);try{return e(v,0)}catch{try{return e.call(null,v,0)}catch{return e.call(this,v,0)}}}function u(v){if(t===clearTimeout)return clearTimeout(v);if((t===s||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(v);try{return t(v)}catch{try{return t.call(null,v)}catch{return t.call(this,v)}}}var a=[],p=!1,h,x=-1;function T(){!p||!h||(p=!1,h.length?a=h.concat(a):x=-1,a.length&&j())}function j(){if(!p){var v=o(T);p=!0;for(var y=a.length;y;){for(h=a,a=[];++x<y;)h&&h[x].run();x=-1,y=a.length}h=null,p=!1,u(v)}}l.nextTick=function(v){var y=new Array(arguments.length-1);if(arguments.length>1)for(var b=1;b<arguments.length;b++)y[b-1]=arguments[b];a.push(new B(v,y)),a.length===1&&!p&&o(j)};function B(v,y){this.fun=v,this.array=y}B.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={};function A(){}return l.on=A,l.addListener=A,l.once=A,l.off=A,l.removeListener=A,l.removeAllListeners=A,l.emit=A,l.prependListener=A,l.prependOnceListener=A,l.listeners=function(v){return[]},l.binding=function(v){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(v){throw new Error("process.chdir is not supported")},l.umask=function(){return 0},Qt.exports}var Vt,Yr;function De(){if(Yr)return Vt;Yr=1;const{SymbolAsyncIterator:l,SymbolIterator:e,SymbolFor:t}=ve(),r=t("nodejs.stream.destroyed"),s=t("nodejs.stream.errored"),o=t("nodejs.stream.readable"),u=t("nodejs.stream.writable"),a=t("nodejs.stream.disturbed"),p=t("nodejs.webstream.isClosedPromise"),h=t("nodejs.webstream.controllerErrorFunction");function x(g,M=!1){var J;return!!(g&&typeof g.pipe=="function"&&typeof g.on=="function"&&(!M||typeof g.pause=="function"&&typeof g.resume=="function")&&(!g._writableState||((J=g._readableState)===null||J===void 0?void 0:J.readable)!==!1)&&(!g._writableState||g._readableState))}function T(g){var M;return!!(g&&typeof g.write=="function"&&typeof g.on=="function"&&(!g._readableState||((M=g._writableState)===null||M===void 0?void 0:M.writable)!==!1))}function j(g){return!!(g&&typeof g.pipe=="function"&&g._readableState&&typeof g.on=="function"&&typeof g.write=="function")}function B(g){return g&&(g._readableState||g._writableState||typeof g.write=="function"&&typeof g.on=="function"||typeof g.pipe=="function"&&typeof g.on=="function")}function A(g){return!!(g&&!B(g)&&typeof g.pipeThrough=="function"&&typeof g.getReader=="function"&&typeof g.cancel=="function")}function v(g){return!!(g&&!B(g)&&typeof g.getWriter=="function"&&typeof g.abort=="function")}function y(g){return!!(g&&!B(g)&&typeof g.readable=="object"&&typeof g.writable=="object")}function b(g){return A(g)||v(g)||y(g)}function m(g,M){return g==null?!1:M===!0?typeof g[l]=="function":M===!1?typeof g[e]=="function":typeof g[l]=="function"||typeof g[e]=="function"}function w(g){if(!B(g))return null;const M=g._writableState,J=g._readableState,U=M||J;return!!(g.destroyed||g[r]||U!=null&&U.destroyed)}function P(g){if(!T(g))return null;if(g.writableEnded===!0)return!0;const M=g._writableState;return M!=null&&M.errored?!1:typeof M?.ended!="boolean"?null:M.ended}function I(g,M){if(!T(g))return null;if(g.writableFinished===!0)return!0;const J=g._writableState;return J!=null&&J.errored?!1:typeof J?.finished!="boolean"?null:!!(J.finished||M===!1&&J.ended===!0&&J.length===0)}function H(g){if(!x(g))return null;if(g.readableEnded===!0)return!0;const M=g._readableState;return!M||M.errored?!1:typeof M?.ended!="boolean"?null:M.ended}function K(g,M){if(!x(g))return null;const J=g._readableState;return J!=null&&J.errored?!1:typeof J?.endEmitted!="boolean"?null:!!(J.endEmitted||M===!1&&J.ended===!0&&J.length===0)}function z(g){return g&&g[o]!=null?g[o]:typeof g?.readable!="boolean"?null:w(g)?!1:x(g)&&g.readable&&!K(g)}function fe(g){return g&&g[u]!=null?g[u]:typeof g?.writable!="boolean"?null:w(g)?!1:T(g)&&g.writable&&!P(g)}function k(g,M){return B(g)?w(g)?!0:!(M?.readable!==!1&&z(g)||M?.writable!==!1&&fe(g)):null}function O(g){var M,J;return B(g)?g.writableErrored?g.writableErrored:(M=(J=g._writableState)===null||J===void 0?void 0:J.errored)!==null&&M!==void 0?M:null:null}function V(g){var M,J;return B(g)?g.readableErrored?g.readableErrored:(M=(J=g._readableState)===null||J===void 0?void 0:J.errored)!==null&&M!==void 0?M:null:null}function L(g){if(!B(g))return null;if(typeof g.closed=="boolean")return g.closed;const M=g._writableState,J=g._readableState;return typeof M?.closed=="boolean"||typeof J?.closed=="boolean"?M?.closed||J?.closed:typeof g._closed=="boolean"&&ne(g)?g._closed:null}function ne(g){return typeof g._closed=="boolean"&&typeof g._defaultKeepAlive=="boolean"&&typeof g._removedConnection=="boolean"&&typeof g._removedContLen=="boolean"}function se(g){return typeof g._sent100=="boolean"&&ne(g)}function ue(g){var M;return typeof g._consuming=="boolean"&&typeof g._dumped=="boolean"&&((M=g.req)===null||M===void 0?void 0:M.upgradeOrConnect)===void 0}function be(g){if(!B(g))return null;const M=g._writableState,J=g._readableState,U=M||J;return!U&&se(g)||!!(U&&U.autoDestroy&&U.emitClose&&U.closed===!1)}function W(g){var M;return!!(g&&((M=g[a])!==null&&M!==void 0?M:g.readableDidRead||g.readableAborted))}function ae(g){var M,J,U,oe,ce,ge,pe,D,G,ie;return!!(g&&((M=(J=(U=(oe=(ce=(ge=g[s])!==null&&ge!==void 0?ge:g.readableErrored)!==null&&ce!==void 0?ce:g.writableErrored)!==null&&oe!==void 0?oe:(pe=g._readableState)===null||pe===void 0?void 0:pe.errorEmitted)!==null&&U!==void 0?U:(D=g._writableState)===null||D===void 0?void 0:D.errorEmitted)!==null&&J!==void 0?J:(G=g._readableState)===null||G===void 0?void 0:G.errored)!==null&&M!==void 0?M:!((ie=g._writableState)===null||ie===void 0)&&ie.errored))}return Vt={isDestroyed:w,kIsDestroyed:r,isDisturbed:W,kIsDisturbed:a,isErrored:ae,kIsErrored:s,isReadable:z,kIsReadable:o,kIsClosedPromise:p,kControllerErrorFunction:h,kIsWritable:u,isClosed:L,isDuplexNodeStream:j,isFinished:k,isIterable:m,isReadableNodeStream:x,isReadableStream:A,isReadableEnded:H,isReadableFinished:K,isReadableErrored:V,isNodeStream:B,isWebStream:b,isWritable:fe,isWritableNodeStream:T,isWritableStream:v,isWritableEnded:P,isWritableFinished:I,isWritableErrored:O,isServerRequest:ue,isServerResponse:se,willEmitClose:be,isTransformStream:y},Vt}var Jr;function We(){if(Jr)return Tt.exports;Jr=1;const l=He(),{AbortError:e,codes:t}=je(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:s}=t,{kEmptyObject:o,once:u}=Le(),{validateAbortSignal:a,validateFunction:p,validateObject:h,validateBoolean:x}=ft(),{Promise:T,PromisePrototypeThen:j,SymbolDispose:B}=ve(),{isClosed:A,isReadable:v,isReadableNodeStream:y,isReadableStream:b,isReadableFinished:m,isReadableErrored:w,isWritable:P,isWritableNodeStream:I,isWritableStream:H,isWritableFinished:K,isWritableErrored:z,isNodeStream:fe,willEmitClose:k,kIsClosedPromise:O}=De();let V;function L(W){return W.setHeader&&typeof W.abort=="function"}const ne=()=>{};function se(W,ae,g){var M,J;if(arguments.length===2?(g=ae,ae=o):ae==null?ae=o:h(ae,"options"),p(g,"callback"),a(ae.signal,"options.signal"),g=u(g),b(W)||H(W))return ue(W,ae,g);if(!fe(W))throw new r("stream",["ReadableStream","WritableStream","Stream"],W);const U=(M=ae.readable)!==null&&M!==void 0?M:y(W),oe=(J=ae.writable)!==null&&J!==void 0?J:I(W),ce=W._writableState,ge=W._readableState,pe=()=>{W.writable||ie()};let D=k(W)&&y(W)===U&&I(W)===oe,G=K(W,!1);const ie=()=>{G=!0,W.destroyed&&(D=!1),!(D&&(!W.readable||U))&&(!U||he)&&g.call(W)};let he=m(W,!1);const de=()=>{he=!0,W.destroyed&&(D=!1),!(D&&(!W.writable||oe))&&(!oe||G)&&g.call(W)},S=R=>{g.call(W,R)};let N=A(W);const C=()=>{N=!0;const R=z(W)||w(W);if(R&&typeof R!="boolean")return g.call(W,R);if(U&&!he&&y(W,!0)&&!m(W,!1))return g.call(W,new s);if(oe&&!G&&!K(W,!1))return g.call(W,new s);g.call(W)},ee=()=>{N=!0;const R=z(W)||w(W);if(R&&typeof R!="boolean")return g.call(W,R);g.call(W)},X=()=>{W.req.on("finish",ie)};L(W)?(W.on("complete",ie),D||W.on("abort",C),W.req?X():W.on("request",X)):oe&&!ce&&(W.on("end",pe),W.on("close",pe)),!D&&typeof W.aborted=="boolean"&&W.on("aborted",C),W.on("end",de),W.on("finish",ie),ae.error!==!1&&W.on("error",S),W.on("close",C),N?l.nextTick(C):ce!=null&&ce.errorEmitted||ge!=null&&ge.errorEmitted?D||l.nextTick(ee):(!U&&(!D||v(W))&&(G||P(W)===!1)||!oe&&(!D||P(W))&&(he||v(W)===!1)||ge&&W.req&&W.aborted)&&l.nextTick(ee);const Z=()=>{g=ne,W.removeListener("aborted",C),W.removeListener("complete",ie),W.removeListener("abort",C),W.removeListener("request",X),W.req&&W.req.removeListener("finish",ie),W.removeListener("end",pe),W.removeListener("close",pe),W.removeListener("finish",ie),W.removeListener("end",de),W.removeListener("error",S),W.removeListener("close",C)};if(ae.signal&&!N){const R=()=>{const Q=g;Z(),Q.call(W,new e(void 0,{cause:ae.signal.reason}))};if(ae.signal.aborted)l.nextTick(R);else{V=V||Le().addAbortListener;const Q=V(ae.signal,R),Y=g;g=u((...$)=>{Q[B](),Y.apply(W,$)})}}return Z}function ue(W,ae,g){let M=!1,J=ne;if(ae.signal)if(J=()=>{M=!0,g.call(W,new e(void 0,{cause:ae.signal.reason}))},ae.signal.aborted)l.nextTick(J);else{V=V||Le().addAbortListener;const oe=V(ae.signal,J),ce=g;g=u((...ge)=>{oe[B](),ce.apply(W,ge)})}const U=(...oe)=>{M||l.nextTick(()=>g.apply(W,oe))};return j(W[O].promise,U,U),ne}function be(W,ae){var g;let M=!1;return ae===null&&(ae=o),(g=ae)!==null&&g!==void 0&&g.cleanup&&(x(ae.cleanup,"cleanup"),M=ae.cleanup),new T((J,U)=>{const oe=se(W,ae,ce=>{M&&oe(),ce?U(ce):J()})})}return Tt.exports=se,Tt.exports.finished=be,Tt.exports}var Kt,Xr;function Ze(){if(Xr)return Kt;Xr=1;const l=He(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:r}=je(),{Symbol:s}=ve(),{kIsDestroyed:o,isDestroyed:u,isFinished:a,isServerRequest:p}=De(),h=s("kDestroy"),x=s("kConstruct");function T(k,O,V){k&&(k.stack,O&&!O.errored&&(O.errored=k),V&&!V.errored&&(V.errored=k))}function j(k,O){const V=this._readableState,L=this._writableState,ne=L||V;return L!=null&&L.destroyed||V!=null&&V.destroyed?(typeof O=="function"&&O(),this):(T(k,L,V),L&&(L.destroyed=!0),V&&(V.destroyed=!0),ne.constructed?B(this,k,O):this.once(h,function(se){B(this,e(se,k),O)}),this)}function B(k,O,V){let L=!1;function ne(se){if(L)return;L=!0;const ue=k._readableState,be=k._writableState;T(se,be,ue),be&&(be.closed=!0),ue&&(ue.closed=!0),typeof V=="function"&&V(se),se?l.nextTick(A,k,se):l.nextTick(v,k)}try{k._destroy(O||null,ne)}catch(se){ne(se)}}function A(k,O){y(k,O),v(k)}function v(k){const O=k._readableState,V=k._writableState;V&&(V.closeEmitted=!0),O&&(O.closeEmitted=!0),(V!=null&&V.emitClose||O!=null&&O.emitClose)&&k.emit("close")}function y(k,O){const V=k._readableState,L=k._writableState;L!=null&&L.errorEmitted||V!=null&&V.errorEmitted||(L&&(L.errorEmitted=!0),V&&(V.errorEmitted=!0),k.emit("error",O))}function b(){const k=this._readableState,O=this._writableState;k&&(k.constructed=!0,k.closed=!1,k.closeEmitted=!1,k.destroyed=!1,k.errored=null,k.errorEmitted=!1,k.reading=!1,k.ended=k.readable===!1,k.endEmitted=k.readable===!1),O&&(O.constructed=!0,O.destroyed=!1,O.closed=!1,O.closeEmitted=!1,O.errored=null,O.errorEmitted=!1,O.finalCalled=!1,O.prefinished=!1,O.ended=O.writable===!1,O.ending=O.writable===!1,O.finished=O.writable===!1)}function m(k,O,V){const L=k._readableState,ne=k._writableState;if(ne!=null&&ne.destroyed||L!=null&&L.destroyed)return this;L!=null&&L.autoDestroy||ne!=null&&ne.autoDestroy?k.destroy(O):O&&(O.stack,ne&&!ne.errored&&(ne.errored=O),L&&!L.errored&&(L.errored=O),V?l.nextTick(y,k,O):y(k,O))}function w(k,O){if(typeof k._construct!="function")return;const V=k._readableState,L=k._writableState;V&&(V.constructed=!1),L&&(L.constructed=!1),k.once(x,O),!(k.listenerCount(x)>1)&&l.nextTick(P,k)}function P(k){let O=!1;function V(L){if(O){m(k,L??new t);return}O=!0;const ne=k._readableState,se=k._writableState,ue=se||ne;ne&&(ne.constructed=!0),se&&(se.constructed=!0),ue.destroyed?k.emit(h,L):L?m(k,L,!0):l.nextTick(I,k)}try{k._construct(L=>{l.nextTick(V,L)})}catch(L){l.nextTick(V,L)}}function I(k){k.emit(x)}function H(k){return k?.setHeader&&typeof k.abort=="function"}function K(k){k.emit("close")}function z(k,O){k.emit("error",O),l.nextTick(K,k)}function fe(k,O){!k||u(k)||(!O&&!a(k)&&(O=new r),p(k)?(k.socket=null,k.destroy(O)):H(k)?k.abort():H(k.req)?k.req.abort():typeof k.destroy=="function"?k.destroy(O):typeof k.close=="function"?k.close():O?l.nextTick(z,k,O):l.nextTick(K,k),k.destroyed||(k[o]=!0))}return Kt={construct:w,destroyer:fe,destroy:j,undestroy:b,errorOrDestroy:m},Kt}var Yt,Zr;function Jt(){if(Zr)return Yt;Zr=1;const{ArrayIsArray:l,ObjectSetPrototypeOf:e}=ve(),{EventEmitter:t}=It();function r(o){t.call(this,o)}e(r.prototype,t.prototype),e(r,t),r.prototype.pipe=function(o,u){const a=this;function p(v){o.writable&&o.write(v)===!1&&a.pause&&a.pause()}a.on("data",p);function h(){a.readable&&a.resume&&a.resume()}o.on("drain",h),!o._isStdio&&(!u||u.end!==!1)&&(a.on("end",T),a.on("close",j));let x=!1;function T(){x||(x=!0,o.end())}function j(){x||(x=!0,typeof o.destroy=="function"&&o.destroy())}function B(v){A(),t.listenerCount(this,"error")===0&&this.emit("error",v)}s(a,"error",B),s(o,"error",B);function A(){a.removeListener("data",p),o.removeListener("drain",h),a.removeListener("end",T),a.removeListener("close",j),a.removeListener("error",B),o.removeListener("error",B),a.removeListener("end",A),a.removeListener("close",A),o.removeListener("close",A)}return a.on("end",A),a.on("close",A),o.on("close",A),o.emit("pipe",a),o};function s(o,u,a){if(typeof o.prependListener=="function")return o.prependListener(u,a);!o._events||!o._events[u]?o.on(u,a):l(o._events[u])?o._events[u].unshift(a):o._events[u]=[a,o._events[u]]}return Yt={Stream:r,prependListener:s},Yt}var Xt={exports:{}},en;function vt(){return en||(en=1,(function(l){const{SymbolDispose:e}=ve(),{AbortError:t,codes:r}=je(),{isNodeStream:s,isWebStream:o,kControllerErrorFunction:u}=De(),a=We(),{ERR_INVALID_ARG_TYPE:p}=r;let h;const x=(T,j)=>{if(typeof T!="object"||!("aborted"in T))throw new p(j,"AbortSignal",T)};l.exports.addAbortSignal=function(j,B){if(x(j,"signal"),!s(B)&&!o(B))throw new p("stream",["ReadableStream","WritableStream","Stream"],B);return l.exports.addAbortSignalNoValidate(j,B)},l.exports.addAbortSignalNoValidate=function(T,j){if(typeof T!="object"||!("aborted"in T))return j;const B=s(j)?()=>{j.destroy(new t(void 0,{cause:T.reason}))}:()=>{j[u](new t(void 0,{cause:T.reason}))};if(T.aborted)B();else{h=h||Le().addAbortListener;const A=h(T,B);a(j,A[e])}return j}})(Xt)),Xt.exports}var Zt,tn;function ii(){if(tn)return Zt;tn=1;const{StringPrototypeSlice:l,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:r}=ve(),{Buffer:s}=Me(),{inspect:o}=Le();return Zt=class{constructor(){this.head=null,this.tail=null,this.length=0}push(a){const p={data:a,next:null};this.length>0?this.tail.next=p:this.head=p,this.tail=p,++this.length}unshift(a){const p={data:a,next:this.head};this.length===0&&(this.tail=p),this.head=p,++this.length}shift(){if(this.length===0)return;const a=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,a}clear(){this.head=this.tail=null,this.length=0}join(a){if(this.length===0)return"";let p=this.head,h=""+p.data;for(;(p=p.next)!==null;)h+=a+p.data;return h}concat(a){if(this.length===0)return s.alloc(0);const p=s.allocUnsafe(a>>>0);let h=this.head,x=0;for(;h;)t(p,h.data,x),x+=h.data.length,h=h.next;return p}consume(a,p){const h=this.head.data;if(a<h.length){const x=h.slice(0,a);return this.head.data=h.slice(a),x}return a===h.length?this.shift():p?this._getString(a):this._getBuffer(a)}first(){return this.head.data}*[e](){for(let a=this.head;a;a=a.next)yield a.data}_getString(a){let p="",h=this.head,x=0;do{const T=h.data;if(a>T.length)p+=T,a-=T.length;else{a===T.length?(p+=T,++x,h.next?this.head=h.next:this.head=this.tail=null):(p+=l(T,0,a),this.head=h,h.data=l(T,a));break}++x}while((h=h.next)!==null);return this.length-=x,p}_getBuffer(a){const p=s.allocUnsafe(a),h=a;let x=this.head,T=0;do{const j=x.data;if(a>j.length)t(p,j,h-a),a-=j.length;else{a===j.length?(t(p,j,h-a),++T,x.next?this.head=x.next:this.head=this.tail=null):(t(p,new r(j.buffer,j.byteOffset,a),h-a),this.head=x,x.data=j.slice(a));break}++T}while((x=x.next)!==null);return this.length-=T,p}[Symbol.for("nodejs.util.inspect.custom")](a,p){return o(this,{...p,depth:0,customInspect:!1})}},Zt}var er,rn;function At(){if(rn)return er;rn=1;const{MathFloor:l,NumberIsInteger:e}=ve(),{validateInteger:t}=ft(),{ERR_INVALID_ARG_VALUE:r}=je().codes;let s=16*1024,o=16;function u(x,T,j){return x.highWaterMark!=null?x.highWaterMark:T?x[j]:null}function a(x){return x?o:s}function p(x,T){t(T,"value",0),x?o=T:s=T}function h(x,T,j,B){const A=u(T,B,j);if(A!=null){if(!e(A)||A<0){const v=B?`options.${j}`:"options.highWaterMark";throw new r(v,A)}return l(A)}return a(x.objectMode)}return er={getHighWaterMark:h,getDefaultHighWaterMark:a,setDefaultHighWaterMark:p},er}var tr={},Nt={exports:{}};var nn;function si(){return nn||(nn=1,(function(l,e){var t=Me(),r=t.Buffer;function s(u,a){for(var p in u)a[p]=u[p]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?l.exports=t:(s(t,e),e.Buffer=o);function o(u,a,p){return r(u,a,p)}o.prototype=Object.create(r.prototype),s(r,o),o.from=function(u,a,p){if(typeof u=="number")throw new TypeError("Argument must not be a number");return r(u,a,p)},o.alloc=function(u,a,p){if(typeof u!="number")throw new TypeError("Argument must be a number");var h=r(u);return a!==void 0?typeof p=="string"?h.fill(a,p):h.fill(a):h.fill(0),h},o.allocUnsafe=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return r(u)},o.allocUnsafeSlow=function(u){if(typeof u!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(u)}})(Nt,Nt.exports)),Nt.exports}var sn;function oi(){if(sn)return tr;sn=1;var l=si().Buffer,e=l.isEncoding||function(b){switch(b=""+b,b&&b.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(b){if(!b)return"utf8";for(var m;;)switch(b){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return b;default:if(m)return;b=(""+b).toLowerCase(),m=!0}}function r(b){var m=t(b);if(typeof m!="string"&&(l.isEncoding===e||!e(b)))throw new Error("Unknown encoding: "+b);return m||b}tr.StringDecoder=s;function s(b){this.encoding=r(b);var m;switch(this.encoding){case"utf16le":this.text=T,this.end=j,m=4;break;case"utf8":this.fillLast=p,m=4;break;case"base64":this.text=B,this.end=A,m=3;break;default:this.write=v,this.end=y;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=l.allocUnsafe(m)}s.prototype.write=function(b){if(b.length===0)return"";var m,w;if(this.lastNeed){if(m=this.fillLast(b),m===void 0)return"";w=this.lastNeed,this.lastNeed=0}else w=0;return w<b.length?m?m+this.text(b,w):this.text(b,w):m||""},s.prototype.end=x,s.prototype.text=h,s.prototype.fillLast=function(b){if(this.lastNeed<=b.length)return b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,this.lastTotal-this.lastNeed,0,b.length),this.lastNeed-=b.length};function o(b){return b<=127?0:b>>5===6?2:b>>4===14?3:b>>3===30?4:b>>6===2?-1:-2}function u(b,m,w){var P=m.length-1;if(P<w)return 0;var I=o(m[P]);return I>=0?(I>0&&(b.lastNeed=I-1),I):--P<w||I===-2?0:(I=o(m[P]),I>=0?(I>0&&(b.lastNeed=I-2),I):--P<w||I===-2?0:(I=o(m[P]),I>=0?(I>0&&(I===2?I=0:b.lastNeed=I-3),I):0))}function a(b,m,w){if((m[0]&192)!==128)return b.lastNeed=0,"�";if(b.lastNeed>1&&m.length>1){if((m[1]&192)!==128)return b.lastNeed=1,"�";if(b.lastNeed>2&&m.length>2&&(m[2]&192)!==128)return b.lastNeed=2,"�"}}function p(b){var m=this.lastTotal-this.lastNeed,w=a(this,b);if(w!==void 0)return w;if(this.lastNeed<=b.length)return b.copy(this.lastChar,m,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);b.copy(this.lastChar,m,0,b.length),this.lastNeed-=b.length}function h(b,m){var w=u(this,b,m);if(!this.lastNeed)return b.toString("utf8",m);this.lastTotal=w;var P=b.length-(w-this.lastNeed);return b.copy(this.lastChar,0,P),b.toString("utf8",m,P)}function x(b){var m=b&&b.length?this.write(b):"";return this.lastNeed?m+"�":m}function T(b,m){if((b.length-m)%2===0){var w=b.toString("utf16le",m);if(w){var P=w.charCodeAt(w.length-1);if(P>=55296&&P<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1],w.slice(0,-1)}return w}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=b[b.length-1],b.toString("utf16le",m,b.length-1)}function j(b){var m=b&&b.length?this.write(b):"";if(this.lastNeed){var w=this.lastTotal-this.lastNeed;return m+this.lastChar.toString("utf16le",0,w)}return m}function B(b,m){var w=(b.length-m)%3;return w===0?b.toString("base64",m):(this.lastNeed=3-w,this.lastTotal=3,w===1?this.lastChar[0]=b[b.length-1]:(this.lastChar[0]=b[b.length-2],this.lastChar[1]=b[b.length-1]),b.toString("base64",m,b.length-w))}function A(b){var m=b&&b.length?this.write(b):"";return this.lastNeed?m+this.lastChar.toString("base64",0,3-this.lastNeed):m}function v(b){return b.toString(this.encoding)}function y(b){return b&&b.length?this.write(b):""}return tr}var rr,on;function an(){if(on)return rr;on=1;const l=He(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:r}=ve(),{Buffer:s}=Me(),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_NULL_VALUES:u}=je().codes;function a(p,h,x){let T;if(typeof h=="string"||h instanceof s)return new p({objectMode:!0,...x,read(){this.push(h),this.push(null)}});let j;if(h&&h[t])j=!0,T=h[t]();else if(h&&h[r])j=!1,T=h[r]();else throw new o("iterable",["Iterable"],h);const B=new p({objectMode:!0,highWaterMark:1,...x});let A=!1;B._read=function(){A||(A=!0,y())},B._destroy=function(b,m){e(v(b),()=>l.nextTick(m,b),w=>l.nextTick(m,w||b))};async function v(b){const m=b!=null,w=typeof T.throw=="function";if(m&&w){const{value:P,done:I}=await T.throw(b);if(await P,I)return}if(typeof T.return=="function"){const{value:P}=await T.return();await P}}async function y(){for(;;){try{const{value:b,done:m}=j?await T.next():T.next();if(m)B.push(null);else{const w=b&&typeof b.then=="function"?await b:b;if(w===null)throw A=!1,new u;if(B.push(w))continue;A=!1}}catch(b){B.destroy(b)}break}}return B}return rr=a,rr}var nr,ln;function Pt(){if(ln)return nr;ln=1;const l=He(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:r,NumberParseInt:s,ObjectDefineProperties:o,ObjectKeys:u,ObjectSetPrototypeOf:a,Promise:p,SafeSet:h,SymbolAsyncDispose:x,SymbolAsyncIterator:T,Symbol:j}=ve();nr=$,$.ReadableState=Y;const{EventEmitter:B}=It(),{Stream:A,prependListener:v}=Jt(),{Buffer:y}=Me(),{addAbortSignal:b}=vt(),m=We();let w=Le().debuglog("stream",c=>{w=c});const P=ii(),I=Ze(),{getHighWaterMark:H,getDefaultHighWaterMark:K}=At(),{aggregateTwoErrors:z,codes:{ERR_INVALID_ARG_TYPE:fe,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:V,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:L},AbortError:ne}=je(),{validateObject:se}=ft(),ue=j("kPaused"),{StringDecoder:be}=oi(),W=an();a($.prototype,A.prototype),a($,A);const ae=()=>{},{errorOrDestroy:g}=I,M=1,J=2,U=4,oe=8,ce=16,ge=32,pe=64,D=128,G=256,ie=512,he=1024,de=2048,S=4096,N=8192,C=16384,ee=32768,X=65536,Z=1<<17,R=1<<18;function Q(c){return{enumerable:!1,get(){return(this.state&c)!==0},set(_){_?this.state|=c:this.state&=~c}}}o(Y.prototype,{objectMode:Q(M),ended:Q(J),endEmitted:Q(U),reading:Q(oe),constructed:Q(ce),sync:Q(ge),needReadable:Q(pe),emittedReadable:Q(D),readableListening:Q(G),resumeScheduled:Q(ie),errorEmitted:Q(he),emitClose:Q(de),autoDestroy:Q(S),destroyed:Q(N),closed:Q(C),closeEmitted:Q(ee),multiAwaitDrain:Q(X),readingMore:Q(Z),dataEmitted:Q(R)});function Y(c,_,te){typeof te!="boolean"&&(te=_ instanceof $e()),this.state=de|S|ce|ge,c&&c.objectMode&&(this.state|=M),te&&c&&c.readableObjectMode&&(this.state|=M),this.highWaterMark=c?H(this,c,"readableHighWaterMark",te):K(!1),this.buffer=new P,this.length=0,this.pipes=[],this.flowing=null,this[ue]=null,c&&c.emitClose===!1&&(this.state&=~de),c&&c.autoDestroy===!1&&(this.state&=~S),this.errored=null,this.defaultEncoding=c&&c.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,c&&c.encoding&&(this.decoder=new be(c.encoding),this.encoding=c.encoding)}function $(c){if(!(this instanceof $))return new $(c);const _=this instanceof $e();this._readableState=new Y(c,this,_),c&&(typeof c.read=="function"&&(this._read=c.read),typeof c.destroy=="function"&&(this._destroy=c.destroy),typeof c.construct=="function"&&(this._construct=c.construct),c.signal&&!_&&b(c.signal,this)),A.call(this,c),I.construct(this,()=>{this._readableState.needReadable&&E(this,this._readableState)})}$.prototype.destroy=I.destroy,$.prototype._undestroy=I.undestroy,$.prototype._destroy=function(c,_){_(c)},$.prototype[B.captureRejectionSymbol]=function(c){this.destroy(c)},$.prototype[x]=function(){let c;return this.destroyed||(c=this.readableEnded?null:new ne,this.destroy(c)),new p((_,te)=>m(this,re=>re&&re!==c?te(re):_(null)))},$.prototype.push=function(c,_){return we(this,c,_,!1)},$.prototype.unshift=function(c,_){return we(this,c,_,!0)};function we(c,_,te,re){w("readableAddChunk",_);const le=c._readableState;let Pe;if((le.state&M)===0&&(typeof _=="string"?(te=te||le.defaultEncoding,le.encoding!==te&&(re&&le.encoding?_=y.from(_,te).toString(le.encoding):(_=y.from(_,te),te=""))):_ instanceof y?te="":A._isUint8Array(_)?(_=A._uint8ArrayToBuffer(_),te=""):_!=null&&(Pe=new fe("chunk",["string","Buffer","Uint8Array"],_))),Pe)g(c,Pe);else if(_===null)le.state&=~oe,n(c,le);else if((le.state&M)!==0||_&&_.length>0)if(re)if((le.state&U)!==0)g(c,new L);else{if(le.destroyed||le.errored)return!1;Ne(c,le,_,!0)}else if(le.ended)g(c,new V);else{if(le.destroyed||le.errored)return!1;le.state&=~oe,le.decoder&&!te?(_=le.decoder.write(_),le.objectMode||_.length!==0?Ne(c,le,_,!1):E(c,le)):Ne(c,le,_,!1)}else re||(le.state&=~oe,E(c,le));return!le.ended&&(le.length<le.highWaterMark||le.length===0)}function Ne(c,_,te,re){_.flowing&&_.length===0&&!_.sync&&c.listenerCount("data")>0?((_.state&X)!==0?_.awaitDrainWriters.clear():_.awaitDrainWriters=null,_.dataEmitted=!0,c.emit("data",te)):(_.length+=_.objectMode?1:te.length,re?_.buffer.unshift(te):_.buffer.push(te),(_.state&pe)!==0&&i(c)),E(c,_)}$.prototype.isPaused=function(){const c=this._readableState;return c[ue]===!0||c.flowing===!1},$.prototype.setEncoding=function(c){const _=new be(c);this._readableState.decoder=_,this._readableState.encoding=this._readableState.decoder.encoding;const te=this._readableState.buffer;let re="";for(const le of te)re+=_.write(le);return te.clear(),re!==""&&te.push(re),this._readableState.length=re.length,this};const ye=1073741824;function Be(c){if(c>ye)throw new O("size","<= 1GiB",c);return c--,c|=c>>>1,c|=c>>>2,c|=c>>>4,c|=c>>>8,c|=c>>>16,c++,c}function f(c,_){return c<=0||_.length===0&&_.ended?0:(_.state&M)!==0?1:r(c)?_.flowing&&_.length?_.buffer.first().length:_.length:c<=_.length?c:_.ended?_.length:0}$.prototype.read=function(c){w("read",c),c===void 0?c=NaN:t(c)||(c=s(c,10));const _=this._readableState,te=c;if(c>_.highWaterMark&&(_.highWaterMark=Be(c)),c!==0&&(_.state&=~D),c===0&&_.needReadable&&((_.highWaterMark!==0?_.length>=_.highWaterMark:_.length>0)||_.ended))return w("read: emitReadable",_.length,_.ended),_.length===0&&_.ended?br(this):i(this),null;if(c=f(c,_),c===0&&_.ended)return _.length===0&&br(this),null;let re=(_.state&pe)!==0;if(w("need readable",re),(_.length===0||_.length-c<_.highWaterMark)&&(re=!0,w("length less than watermark",re)),_.ended||_.reading||_.destroyed||_.errored||!_.constructed)re=!1,w("reading, ended or constructing",re);else if(re){w("do read"),_.state|=oe|ge,_.length===0&&(_.state|=pe);try{this._read(_.highWaterMark)}catch(Pe){g(this,Pe)}_.state&=~ge,_.reading||(c=f(te,_))}let le;return c>0?le=Ln(c,_):le=null,le===null?(_.needReadable=_.length<=_.highWaterMark,c=0):(_.length-=c,_.multiAwaitDrain?_.awaitDrainWriters.clear():_.awaitDrainWriters=null),_.length===0&&(_.ended||(_.needReadable=!0),te!==c&&_.ended&&br(this)),le!==null&&!_.errorEmitted&&!_.closeEmitted&&(_.dataEmitted=!0,this.emit("data",le)),le};function n(c,_){if(w("onEofChunk"),!_.ended){if(_.decoder){const te=_.decoder.end();te&&te.length&&(_.buffer.push(te),_.length+=_.objectMode?1:te.length)}_.ended=!0,_.sync?i(c):(_.needReadable=!1,_.emittedReadable=!0,d(c))}}function i(c){const _=c._readableState;w("emitReadable",_.needReadable,_.emittedReadable),_.needReadable=!1,_.emittedReadable||(w("emitReadable",_.flowing),_.emittedReadable=!0,l.nextTick(d,c))}function d(c){const _=c._readableState;w("emitReadable_",_.destroyed,_.length,_.ended),!_.destroyed&&!_.errored&&(_.length||_.ended)&&(c.emit("readable"),_.emittedReadable=!1),_.needReadable=!_.flowing&&!_.ended&&_.length<=_.highWaterMark,xe(c)}function E(c,_){!_.readingMore&&_.constructed&&(_.readingMore=!0,l.nextTick(F,c,_))}function F(c,_){for(;!_.reading&&!_.ended&&(_.length<_.highWaterMark||_.flowing&&_.length===0);){const te=_.length;if(w("maybeReadMore read 0"),c.read(0),te===_.length)break}_.readingMore=!1}$.prototype._read=function(c){throw new k("_read()")},$.prototype.pipe=function(c,_){const te=this,re=this._readableState;re.pipes.length===1&&(re.multiAwaitDrain||(re.multiAwaitDrain=!0,re.awaitDrainWriters=new h(re.awaitDrainWriters?[re.awaitDrainWriters]:[]))),re.pipes.push(c),w("pipe count=%d opts=%j",re.pipes.length,_);const Pe=(!_||_.end!==!1)&&c!==l.stdout&&c!==l.stderr?Fn:_t;re.endEmitted?l.nextTick(Pe):te.once("end",Pe),c.on("unpipe",Fe);function Fe(Ve,Ue){w("onunpipe"),Ve===te&&Ue&&Ue.hasUnpiped===!1&&(Ue.hasUnpiped=!0,Ai())}function Fn(){w("onend"),c.end()}let Qe,On=!1;function Ai(){w("cleanup"),c.removeListener("close",wr),c.removeListener("finish",mr),Qe&&c.removeListener("drain",Qe),c.removeListener("error",yr),c.removeListener("unpipe",Fe),te.removeListener("end",Fn),te.removeListener("end",_t),te.removeListener("data",Mn),On=!0,Qe&&re.awaitDrainWriters&&(!c._writableState||c._writableState.needDrain)&&Qe()}function Cn(){On||(re.pipes.length===1&&re.pipes[0]===c?(w("false write response, pause",0),re.awaitDrainWriters=c,re.multiAwaitDrain=!1):re.pipes.length>1&&re.pipes.includes(c)&&(w("false write response, pause",re.awaitDrainWriters.size),re.awaitDrainWriters.add(c)),te.pause()),Qe||(Qe=q(te,c),c.on("drain",Qe))}te.on("data",Mn);function Mn(Ve){w("ondata");const Ue=c.write(Ve);w("dest.write",Ue),Ue===!1&&Cn()}function yr(Ve){if(w("onerror",Ve),_t(),c.removeListener("error",yr),c.listenerCount("error")===0){const Ue=c._writableState||c._readableState;Ue&&!Ue.errorEmitted?g(c,Ve):c.emit("error",Ve)}}v(c,"error",yr);function wr(){c.removeListener("finish",mr),_t()}c.once("close",wr);function mr(){w("onfinish"),c.removeListener("close",wr),_t()}c.once("finish",mr);function _t(){w("unpipe"),te.unpipe(c)}return c.emit("pipe",te),c.writableNeedDrain===!0?Cn():re.flowing||(w("pipe resume"),te.resume()),c};function q(c,_){return function(){const re=c._readableState;re.awaitDrainWriters===_?(w("pipeOnDrain",1),re.awaitDrainWriters=null):re.multiAwaitDrain&&(w("pipeOnDrain",re.awaitDrainWriters.size),re.awaitDrainWriters.delete(_)),(!re.awaitDrainWriters||re.awaitDrainWriters.size===0)&&c.listenerCount("data")&&c.resume()}}$.prototype.unpipe=function(c){const _=this._readableState,te={hasUnpiped:!1};if(_.pipes.length===0)return this;if(!c){const le=_.pipes;_.pipes=[],this.pause();for(let Pe=0;Pe<le.length;Pe++)le[Pe].emit("unpipe",this,{hasUnpiped:!1});return this}const re=e(_.pipes,c);return re===-1?this:(_.pipes.splice(re,1),_.pipes.length===0&&this.pause(),c.emit("unpipe",this,te),this)},$.prototype.on=function(c,_){const te=A.prototype.on.call(this,c,_),re=this._readableState;return c==="data"?(re.readableListening=this.listenerCount("readable")>0,re.flowing!==!1&&this.resume()):c==="readable"&&!re.endEmitted&&!re.readableListening&&(re.readableListening=re.needReadable=!0,re.flowing=!1,re.emittedReadable=!1,w("on readable",re.length,re.reading),re.length?i(this):re.reading||l.nextTick(Re,this)),te},$.prototype.addListener=$.prototype.on,$.prototype.removeListener=function(c,_){const te=A.prototype.removeListener.call(this,c,_);return c==="readable"&&l.nextTick(_e,this),te},$.prototype.off=$.prototype.removeListener,$.prototype.removeAllListeners=function(c){const _=A.prototype.removeAllListeners.apply(this,arguments);return(c==="readable"||c===void 0)&&l.nextTick(_e,this),_};function _e(c){const _=c._readableState;_.readableListening=c.listenerCount("readable")>0,_.resumeScheduled&&_[ue]===!1?_.flowing=!0:c.listenerCount("data")>0?c.resume():_.readableListening||(_.flowing=null)}function Re(c){w("readable nexttick read 0"),c.read(0)}$.prototype.resume=function(){const c=this._readableState;return c.flowing||(w("resume"),c.flowing=!c.readableListening,Se(this,c)),c[ue]=!1,this};function Se(c,_){_.resumeScheduled||(_.resumeScheduled=!0,l.nextTick(Te,c,_))}function Te(c,_){w("resume",_.reading),_.reading||c.read(0),_.resumeScheduled=!1,c.emit("resume"),xe(c),_.flowing&&!_.reading&&c.read(0)}$.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ue]=!0,this};function xe(c){const _=c._readableState;for(w("flow",_.flowing);_.flowing&&c.read()!==null;);}$.prototype.wrap=function(c){let _=!1;c.on("data",re=>{!this.push(re)&&c.pause&&(_=!0,c.pause())}),c.on("end",()=>{this.push(null)}),c.on("error",re=>{g(this,re)}),c.on("close",()=>{this.destroy()}),c.on("destroy",()=>{this.destroy()}),this._read=()=>{_&&c.resume&&(_=!1,c.resume())};const te=u(c);for(let re=1;re<te.length;re++){const le=te[re];this[le]===void 0&&typeof c[le]=="function"&&(this[le]=c[le].bind(c))}return this},$.prototype[T]=function(){return Bn(this)},$.prototype.iterator=function(c){return c!==void 0&&se(c,"options"),Bn(this,c)};function Bn(c,_){typeof c.read!="function"&&(c=$.wrap(c,{objectMode:!0}));const te=Ri(c,_);return te.stream=c,te}async function*Ri(c,_){let te=ae;function re(Fe){this===c?(te(),te=ae):te=Fe}c.on("readable",re);let le;const Pe=m(c,{writable:!1},Fe=>{le=Fe?z(le,Fe):null,te(),te=ae});try{for(;;){const Fe=c.destroyed?null:c.read();if(Fe!==null)yield Fe;else{if(le)throw le;if(le===null)return;await new p(re)}}}catch(Fe){throw le=z(le,Fe),le}finally{(le||_?.destroyOnReturn!==!1)&&(le===void 0||c._readableState.autoDestroy)?I.destroyer(c,null):(c.off("readable",re),Pe())}}o($.prototype,{readable:{__proto__:null,get(){const c=this._readableState;return!!c&&c.readable!==!1&&!c.destroyed&&!c.errorEmitted&&!c.endEmitted},set(c){this._readableState&&(this._readableState.readable=!!c)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(c){this._readableState&&(this._readableState.flowing=c)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(c){this._readableState&&(this._readableState.destroyed=c)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),o(Y.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ue]!==!1},set(c){this[ue]=!!c}}}),$._fromList=Ln;function Ln(c,_){if(_.length===0)return null;let te;return _.objectMode?te=_.buffer.shift():!c||c>=_.length?(_.decoder?te=_.buffer.join(""):_.buffer.length===1?te=_.buffer.first():te=_.buffer.concat(_.length),_.buffer.clear()):te=_.buffer.consume(c,_.decoder),te}function br(c){const _=c._readableState;w("endReadable",_.endEmitted),_.endEmitted||(_.ended=!0,l.nextTick(Ti,_,c))}function Ti(c,_){if(w("endReadableNT",c.endEmitted,c.length),!c.errored&&!c.closeEmitted&&!c.endEmitted&&c.length===0){if(c.endEmitted=!0,_.emit("end"),_.writable&&_.allowHalfOpen===!1)l.nextTick(vi,_);else if(c.autoDestroy){const te=_._writableState;(!te||te.autoDestroy&&(te.finished||te.writable===!1))&&_.destroy()}}}function vi(c){c.writable&&!c.writableEnded&&!c.destroyed&&c.end()}$.from=function(c,_){return W($,c,_)};let gr;function kn(){return gr===void 0&&(gr={}),gr}return $.fromWeb=function(c,_){return kn().newStreamReadableFromReadableStream(c,_)},$.toWeb=function(c,_){return kn().newReadableStreamFromStreamReadable(c,_)},$.wrap=function(c,_){var te,re;return new $({objectMode:(te=(re=c.readableObjectMode)!==null&&re!==void 0?re:c.objectMode)!==null&&te!==void 0?te:!0,..._,destroy(le,Pe){I.destroyer(c,le),Pe(le)}}).wrap(c)},nr}var ir,un;function sr(){if(un)return ir;un=1;const l=He(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:s,ObjectDefineProperties:o,ObjectSetPrototypeOf:u,StringPrototypeToLowerCase:a,Symbol:p,SymbolHasInstance:h}=ve();ir=se,se.WritableState=L;const{EventEmitter:x}=It(),T=Jt().Stream,{Buffer:j}=Me(),B=Ze(),{addAbortSignal:A}=vt(),{getHighWaterMark:v,getDefaultHighWaterMark:y}=At(),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:m,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:P,ERR_STREAM_DESTROYED:I,ERR_STREAM_ALREADY_FINISHED:H,ERR_STREAM_NULL_VALUES:K,ERR_STREAM_WRITE_AFTER_END:z,ERR_UNKNOWN_ENCODING:fe}=je().codes,{errorOrDestroy:k}=B;u(se.prototype,T.prototype),u(se,T);function O(){}const V=p("kOnFinished");function L(S,N,C){typeof C!="boolean"&&(C=N instanceof $e()),this.objectMode=!!(S&&S.objectMode),C&&(this.objectMode=this.objectMode||!!(S&&S.writableObjectMode)),this.highWaterMark=S?v(this,S,"writableHighWaterMark",C):y(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ee=!!(S&&S.decodeStrings===!1);this.decodeStrings=!ee,this.defaultEncoding=S&&S.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=g.bind(void 0,N),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,ne(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!S||S.emitClose!==!1,this.autoDestroy=!S||S.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[V]=[]}function ne(S){S.buffered=[],S.bufferedIndex=0,S.allBuffers=!0,S.allNoop=!0}L.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},s(L.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function se(S){const N=this instanceof $e();if(!N&&!r(se,this))return new se(S);this._writableState=new L(S,this,N),S&&(typeof S.write=="function"&&(this._write=S.write),typeof S.writev=="function"&&(this._writev=S.writev),typeof S.destroy=="function"&&(this._destroy=S.destroy),typeof S.final=="function"&&(this._final=S.final),typeof S.construct=="function"&&(this._construct=S.construct),S.signal&&A(S.signal,this)),T.call(this,S),B.construct(this,()=>{const C=this._writableState;C.writing||oe(this,C),D(this,C)})}s(se,h,{__proto__:null,value:function(S){return r(this,S)?!0:this!==se?!1:S&&S._writableState instanceof L}}),se.prototype.pipe=function(){k(this,new P)};function ue(S,N,C,ee){const X=S._writableState;if(typeof C=="function")ee=C,C=X.defaultEncoding;else{if(!C)C=X.defaultEncoding;else if(C!=="buffer"&&!j.isEncoding(C))throw new fe(C);typeof ee!="function"&&(ee=O)}if(N===null)throw new K;if(!X.objectMode)if(typeof N=="string")X.decodeStrings!==!1&&(N=j.from(N,C),C="buffer");else if(N instanceof j)C="buffer";else if(T._isUint8Array(N))N=T._uint8ArrayToBuffer(N),C="buffer";else throw new b("chunk",["string","Buffer","Uint8Array"],N);let Z;return X.ending?Z=new z:X.destroyed&&(Z=new I("write")),Z?(l.nextTick(ee,Z),k(S,Z,!0),Z):(X.pendingcb++,be(S,X,N,C,ee))}se.prototype.write=function(S,N,C){return ue(this,S,N,C)===!0},se.prototype.cork=function(){this._writableState.corked++},se.prototype.uncork=function(){const S=this._writableState;S.corked&&(S.corked--,S.writing||oe(this,S))},se.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=a(N)),!j.isEncoding(N))throw new fe(N);return this._writableState.defaultEncoding=N,this};function be(S,N,C,ee,X){const Z=N.objectMode?1:C.length;N.length+=Z;const R=N.length<N.highWaterMark;return R||(N.needDrain=!0),N.writing||N.corked||N.errored||!N.constructed?(N.buffered.push({chunk:C,encoding:ee,callback:X}),N.allBuffers&&ee!=="buffer"&&(N.allBuffers=!1),N.allNoop&&X!==O&&(N.allNoop=!1)):(N.writelen=Z,N.writecb=X,N.writing=!0,N.sync=!0,S._write(C,ee,N.onwrite),N.sync=!1),R&&!N.errored&&!N.destroyed}function W(S,N,C,ee,X,Z,R){N.writelen=ee,N.writecb=R,N.writing=!0,N.sync=!0,N.destroyed?N.onwrite(new I("write")):C?S._writev(X,N.onwrite):S._write(X,Z,N.onwrite),N.sync=!1}function ae(S,N,C,ee){--N.pendingcb,ee(C),U(N),k(S,C)}function g(S,N){const C=S._writableState,ee=C.sync,X=C.writecb;if(typeof X!="function"){k(S,new w);return}C.writing=!1,C.writecb=null,C.length-=C.writelen,C.writelen=0,N?(N.stack,C.errored||(C.errored=N),S._readableState&&!S._readableState.errored&&(S._readableState.errored=N),ee?l.nextTick(ae,S,C,N,X):ae(S,C,N,X)):(C.buffered.length>C.bufferedIndex&&oe(S,C),ee?C.afterWriteTickInfo!==null&&C.afterWriteTickInfo.cb===X?C.afterWriteTickInfo.count++:(C.afterWriteTickInfo={count:1,cb:X,stream:S,state:C},l.nextTick(M,C.afterWriteTickInfo)):J(S,C,1,X))}function M({stream:S,state:N,count:C,cb:ee}){return N.afterWriteTickInfo=null,J(S,N,C,ee)}function J(S,N,C,ee){for(!N.ending&&!S.destroyed&&N.length===0&&N.needDrain&&(N.needDrain=!1,S.emit("drain"));C-- >0;)N.pendingcb--,ee();N.destroyed&&U(N),D(S,N)}function U(S){if(S.writing)return;for(let X=S.bufferedIndex;X<S.buffered.length;++X){var N;const{chunk:Z,callback:R}=S.buffered[X],Q=S.objectMode?1:Z.length;S.length-=Q,R((N=S.errored)!==null&&N!==void 0?N:new I("write"))}const C=S[V].splice(0);for(let X=0;X<C.length;X++){var ee;C[X]((ee=S.errored)!==null&&ee!==void 0?ee:new I("end"))}ne(S)}function oe(S,N){if(N.corked||N.bufferProcessing||N.destroyed||!N.constructed)return;const{buffered:C,bufferedIndex:ee,objectMode:X}=N,Z=C.length-ee;if(!Z)return;let R=ee;if(N.bufferProcessing=!0,Z>1&&S._writev){N.pendingcb-=Z-1;const Q=N.allNoop?O:$=>{for(let we=R;we<C.length;++we)C[we].callback($)},Y=N.allNoop&&R===0?C:e(C,R);Y.allBuffers=N.allBuffers,W(S,N,!0,N.length,Y,"",Q),ne(N)}else{do{const{chunk:Q,encoding:Y,callback:$}=C[R];C[R++]=null;const we=X?1:Q.length;W(S,N,!1,we,Q,Y,$)}while(R<C.length&&!N.writing);R===C.length?ne(N):R>256?(C.splice(0,R),N.bufferedIndex=0):N.bufferedIndex=R}N.bufferProcessing=!1}se.prototype._write=function(S,N,C){if(this._writev)this._writev([{chunk:S,encoding:N}],C);else throw new m("_write()")},se.prototype._writev=null,se.prototype.end=function(S,N,C){const ee=this._writableState;typeof S=="function"?(C=S,S=null,N=null):typeof N=="function"&&(C=N,N=null);let X;if(S!=null){const Z=ue(this,S,N);Z instanceof t&&(X=Z)}return ee.corked&&(ee.corked=1,this.uncork()),X||(!ee.errored&&!ee.ending?(ee.ending=!0,D(this,ee,!0),ee.ended=!0):ee.finished?X=new H("end"):ee.destroyed&&(X=new I("end"))),typeof C=="function"&&(X||ee.finished?l.nextTick(C,X):ee[V].push(C)),this};function ce(S){return S.ending&&!S.destroyed&&S.constructed&&S.length===0&&!S.errored&&S.buffered.length===0&&!S.finished&&!S.writing&&!S.errorEmitted&&!S.closeEmitted}function ge(S,N){let C=!1;function ee(X){if(C){k(S,X??w());return}if(C=!0,N.pendingcb--,X){const Z=N[V].splice(0);for(let R=0;R<Z.length;R++)Z[R](X);k(S,X,N.sync)}else ce(N)&&(N.prefinished=!0,S.emit("prefinish"),N.pendingcb++,l.nextTick(G,S,N))}N.sync=!0,N.pendingcb++;try{S._final(ee)}catch(X){ee(X)}N.sync=!1}function pe(S,N){!N.prefinished&&!N.finalCalled&&(typeof S._final=="function"&&!N.destroyed?(N.finalCalled=!0,ge(S,N)):(N.prefinished=!0,S.emit("prefinish")))}function D(S,N,C){ce(N)&&(pe(S,N),N.pendingcb===0&&(C?(N.pendingcb++,l.nextTick((ee,X)=>{ce(X)?G(ee,X):X.pendingcb--},S,N)):ce(N)&&(N.pendingcb++,G(S,N))))}function G(S,N){N.pendingcb--,N.finished=!0;const C=N[V].splice(0);for(let ee=0;ee<C.length;ee++)C[ee]();if(S.emit("finish"),N.autoDestroy){const ee=S._readableState;(!ee||ee.autoDestroy&&(ee.endEmitted||ee.readable===!1))&&S.destroy()}}o(se.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(S){this._writableState&&(this._writableState.destroyed=S)}},writable:{__proto__:null,get(){const S=this._writableState;return!!S&&S.writable!==!1&&!S.destroyed&&!S.errored&&!S.ending&&!S.ended},set(S){this._writableState&&(this._writableState.writable=!!S)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const S=this._writableState;return S?!S.destroyed&&!S.ending&&S.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ie=B.destroy;se.prototype.destroy=function(S,N){const C=this._writableState;return!C.destroyed&&(C.bufferedIndex<C.buffered.length||C[V].length)&&l.nextTick(U,C),ie.call(this,S,N),this},se.prototype._undestroy=B.undestroy,se.prototype._destroy=function(S,N){N(S)},se.prototype[x.captureRejectionSymbol]=function(S){this.destroy(S)};let he;function de(){return he===void 0&&(he={}),he}return se.fromWeb=function(S,N){return de().newStreamWritableFromWritableStream(S,N)},se.toWeb=function(S){return de().newWritableStreamFromStreamWritable(S)},ir}var or,fn;function ai(){if(fn)return or;fn=1;const l=He(),e=Me(),{isReadable:t,isWritable:r,isIterable:s,isNodeStream:o,isReadableNodeStream:u,isWritableNodeStream:a,isDuplexNodeStream:p,isReadableStream:h,isWritableStream:x}=De(),T=We(),{AbortError:j,codes:{ERR_INVALID_ARG_TYPE:B,ERR_INVALID_RETURN_VALUE:A}}=je(),{destroyer:v}=Ze(),y=$e(),b=Pt(),m=sr(),{createDeferredPromise:w}=Le(),P=an(),I=globalThis.Blob||e.Blob,H=typeof I<"u"?function(L){return L instanceof I}:function(L){return!1},K=globalThis.AbortController||ut().AbortController,{FunctionPrototypeCall:z}=ve();class fe extends y{constructor(L){super(L),L?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),L?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}or=function V(L,ne){if(p(L))return L;if(u(L))return O({readable:L});if(a(L))return O({writable:L});if(o(L))return O({writable:!1,readable:!1});if(h(L))return O({readable:b.fromWeb(L)});if(x(L))return O({writable:m.fromWeb(L)});if(typeof L=="function"){const{value:ue,write:be,final:W,destroy:ae}=k(L);if(s(ue))return P(fe,ue,{objectMode:!0,write:be,final:W,destroy:ae});const g=ue?.then;if(typeof g=="function"){let M;const J=z(g,ue,U=>{if(U!=null)throw new A("nully","body",U)},U=>{v(M,U)});return M=new fe({objectMode:!0,readable:!1,write:be,final(U){W(async()=>{try{await J,l.nextTick(U,null)}catch(oe){l.nextTick(U,oe)}})},destroy:ae})}throw new A("Iterable, AsyncIterable or AsyncFunction",ne,ue)}if(H(L))return V(L.arrayBuffer());if(s(L))return P(fe,L,{objectMode:!0,writable:!1});if(h(L?.readable)&&x(L?.writable))return fe.fromWeb(L);if(typeof L?.writable=="object"||typeof L?.readable=="object"){const ue=L!=null&&L.readable?u(L?.readable)?L?.readable:V(L.readable):void 0,be=L!=null&&L.writable?a(L?.writable)?L?.writable:V(L.writable):void 0;return O({readable:ue,writable:be})}const se=L?.then;if(typeof se=="function"){let ue;return z(se,L,be=>{be!=null&&ue.push(be),ue.push(null)},be=>{v(ue,be)}),ue=new fe({objectMode:!0,writable:!1,read(){}})}throw new B(ne,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],L)};function k(V){let{promise:L,resolve:ne}=w();const se=new K,ue=se.signal;return{value:V((async function*(){for(;;){const W=L;L=null;const{chunk:ae,done:g,cb:M}=await W;if(l.nextTick(M),g)return;if(ue.aborted)throw new j(void 0,{cause:ue.reason});({promise:L,resolve:ne}=w()),yield ae}})(),{signal:ue}),write(W,ae,g){const M=ne;ne=null,M({chunk:W,done:!1,cb:g})},final(W){const ae=ne;ne=null,ae({done:!0,cb:W})},destroy(W,ae){se.abort(),ae(W)}}}function O(V){const L=V.readable&&typeof V.readable.read!="function"?b.wrap(V.readable):V.readable,ne=V.writable;let se=!!t(L),ue=!!r(ne),be,W,ae,g,M;function J(U){const oe=g;g=null,oe?oe(U):U&&M.destroy(U)}return M=new fe({readableObjectMode:!!(L!=null&&L.readableObjectMode),writableObjectMode:!!(ne!=null&&ne.writableObjectMode),readable:se,writable:ue}),ue&&(T(ne,U=>{ue=!1,U&&v(L,U),J(U)}),M._write=function(U,oe,ce){ne.write(U,oe)?ce():be=ce},M._final=function(U){ne.end(),W=U},ne.on("drain",function(){if(be){const U=be;be=null,U()}}),ne.on("finish",function(){if(W){const U=W;W=null,U()}})),se&&(T(L,U=>{se=!1,U&&v(L,U),J(U)}),L.on("readable",function(){if(ae){const U=ae;ae=null,U()}}),L.on("end",function(){M.push(null)}),M._read=function(){for(;;){const U=L.read();if(U===null){ae=M._read;return}if(!M.push(U))return}}),M._destroy=function(U,oe){!U&&g!==null&&(U=new j),ae=null,be=null,W=null,g===null?oe(U):(g=oe,v(ne,U),v(L,U))},M}return or}var ar,cn;function $e(){if(cn)return ar;cn=1;const{ObjectDefineProperties:l,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:r}=ve();ar=u;const s=Pt(),o=sr();r(u.prototype,s.prototype),r(u,s);{const x=t(o.prototype);for(let T=0;T<x.length;T++){const j=x[T];u.prototype[j]||(u.prototype[j]=o.prototype[j])}}function u(x){if(!(this instanceof u))return new u(x);s.call(this,x),o.call(this,x),x?(this.allowHalfOpen=x.allowHalfOpen!==!1,x.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),x.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}l(u.prototype,{writable:{__proto__:null,...e(o.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(o.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(o.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(o.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(o.prototype,"writableLength")},writableFinished:{__proto__:null,...e(o.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(o.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(o.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(o.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(x){this._readableState&&this._writableState&&(this._readableState.destroyed=x,this._writableState.destroyed=x)}}});let a;function p(){return a===void 0&&(a={}),a}u.fromWeb=function(x,T){return p().newStreamDuplexFromReadableWritablePair(x,T)},u.toWeb=function(x){return p().newReadableWritablePairFromDuplex(x)};let h;return u.from=function(x){return h||(h=ai()),h(x,"body")},ar}var lr,dn;function hn(){if(dn)return lr;dn=1;const{ObjectSetPrototypeOf:l,Symbol:e}=ve();lr=u;const{ERR_METHOD_NOT_IMPLEMENTED:t}=je().codes,r=$e(),{getHighWaterMark:s}=At();l(u.prototype,r.prototype),l(u,r);const o=e("kCallback");function u(h){if(!(this instanceof u))return new u(h);const x=h?s(this,h,"readableHighWaterMark",!0):null;x===0&&(h={...h,highWaterMark:null,readableHighWaterMark:x,writableHighWaterMark:h.writableHighWaterMark||0}),r.call(this,h),this._readableState.sync=!1,this[o]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",p)}function a(h){typeof this._flush=="function"&&!this.destroyed?this._flush((x,T)=>{if(x){h?h(x):this.destroy(x);return}T!=null&&this.push(T),this.push(null),h&&h()}):(this.push(null),h&&h())}function p(){this._final!==a&&a.call(this)}return u.prototype._final=a,u.prototype._transform=function(h,x,T){throw new t("_transform()")},u.prototype._write=function(h,x,T){const j=this._readableState,B=this._writableState,A=j.length;this._transform(h,x,(v,y)=>{if(v){T(v);return}y!=null&&this.push(y),B.ended||A===j.length||j.length<j.highWaterMark?T():this[o]=T})},u.prototype._read=function(){if(this[o]){const h=this[o];this[o]=null,h()}},lr}var ur,pn;function _n(){if(pn)return ur;pn=1;const{ObjectSetPrototypeOf:l}=ve();ur=t;const e=hn();l(t.prototype,e.prototype),l(t,e);function t(r){if(!(this instanceof t))return new t(r);e.call(this,r)}return t.prototype._transform=function(r,s,o){o(null,r)},ur}var fr,bn;function cr(){if(bn)return fr;bn=1;const l=He(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:r,SymbolDispose:s}=ve(),o=We(),{once:u}=Le(),a=Ze(),p=$e(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:x,ERR_INVALID_RETURN_VALUE:T,ERR_MISSING_ARGS:j,ERR_STREAM_DESTROYED:B,ERR_STREAM_PREMATURE_CLOSE:A},AbortError:v}=je(),{validateFunction:y,validateAbortSignal:b}=ft(),{isIterable:m,isReadable:w,isReadableNodeStream:P,isNodeStream:I,isTransformStream:H,isWebStream:K,isReadableStream:z,isReadableFinished:fe}=De(),k=globalThis.AbortController||ut().AbortController;let O,V,L;function ne(U,oe,ce){let ge=!1;U.on("close",()=>{ge=!0});const pe=o(U,{readable:oe,writable:ce},D=>{ge=!D});return{destroy:D=>{ge||(ge=!0,a.destroyer(U,D||new B("pipe")))},cleanup:pe}}function se(U){return y(U[U.length-1],"streams[stream.length - 1]"),U.pop()}function ue(U){if(m(U))return U;if(P(U))return be(U);throw new x("val",["Readable","Iterable","AsyncIterable"],U)}async function*be(U){V||(V=Pt()),yield*V.prototype[r].call(U)}async function W(U,oe,ce,{end:ge}){let pe,D=null;const G=de=>{if(de&&(pe=de),D){const S=D;D=null,S()}},ie=()=>new t((de,S)=>{pe?S(pe):D=()=>{pe?S(pe):de()}});oe.on("drain",G);const he=o(oe,{readable:!1},G);try{oe.writableNeedDrain&&await ie();for await(const de of U)oe.write(de)||await ie();ge&&(oe.end(),await ie()),ce()}catch(de){ce(pe!==de?h(pe,de):de)}finally{he(),oe.off("drain",G)}}async function ae(U,oe,ce,{end:ge}){H(oe)&&(oe=oe.writable);const pe=oe.getWriter();try{for await(const D of U)await pe.ready,pe.write(D).catch(()=>{});await pe.ready,ge&&await pe.close(),ce()}catch(D){try{await pe.abort(D),ce(D)}catch(G){ce(G)}}}function g(...U){return M(U,u(se(U)))}function M(U,oe,ce){if(U.length===1&&e(U[0])&&(U=U[0]),U.length<2)throw new j("streams");const ge=new k,pe=ge.signal,D=ce?.signal,G=[];b(D,"options.signal");function ie(){X(new v)}L=L||Le().addAbortListener;let he;D&&(he=L(D,ie));let de,S;const N=[];let C=0;function ee(Y){X(Y,--C===0)}function X(Y,$){var we;if(Y&&(!de||de.code==="ERR_STREAM_PREMATURE_CLOSE")&&(de=Y),!(!de&&!$)){for(;N.length;)N.shift()(de);(we=he)===null||we===void 0||we[s](),ge.abort(),$&&(de||G.forEach(Ne=>Ne()),l.nextTick(oe,de,S))}}let Z;for(let Y=0;Y<U.length;Y++){const $=U[Y],we=Y<U.length-1,Ne=Y>0,ye=we||ce?.end!==!1,Be=Y===U.length-1;if(I($)){let f=function(n){n&&n.name!=="AbortError"&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ee(n)};if(ye){const{destroy:n,cleanup:i}=ne($,we,Ne);N.push(n),w($)&&Be&&G.push(i)}$.on("error",f),w($)&&Be&&G.push(()=>{$.removeListener("error",f)})}if(Y===0)if(typeof $=="function"){if(Z=$({signal:pe}),!m(Z))throw new T("Iterable, AsyncIterable or Stream","source",Z)}else m($)||P($)||H($)?Z=$:Z=p.from($);else if(typeof $=="function"){if(H(Z)){var R;Z=ue((R=Z)===null||R===void 0?void 0:R.readable)}else Z=ue(Z);if(Z=$(Z,{signal:pe}),we){if(!m(Z,!0))throw new T("AsyncIterable",`transform[${Y-1}]`,Z)}else{var Q;O||(O=_n());const f=new O({objectMode:!0}),n=(Q=Z)===null||Q===void 0?void 0:Q.then;if(typeof n=="function")C++,n.call(Z,E=>{S=E,E!=null&&f.write(E),ye&&f.end(),l.nextTick(ee)},E=>{f.destroy(E),l.nextTick(ee,E)});else if(m(Z,!0))C++,W(Z,f,ee,{end:ye});else if(z(Z)||H(Z)){const E=Z.readable||Z;C++,W(E,f,ee,{end:ye})}else throw new T("AsyncIterable or Promise","destination",Z);Z=f;const{destroy:i,cleanup:d}=ne(Z,!1,!0);N.push(i),Be&&G.push(d)}}else if(I($)){if(P(Z)){C+=2;const f=J(Z,$,ee,{end:ye});w($)&&Be&&G.push(f)}else if(H(Z)||z(Z)){const f=Z.readable||Z;C++,W(f,$,ee,{end:ye})}else if(m(Z))C++,W(Z,$,ee,{end:ye});else throw new x("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Z);Z=$}else if(K($)){if(P(Z))C++,ae(ue(Z),$,ee,{end:ye});else if(z(Z)||m(Z))C++,ae(Z,$,ee,{end:ye});else if(H(Z))C++,ae(Z.readable,$,ee,{end:ye});else throw new x("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Z);Z=$}else Z=p.from($)}return(pe!=null&&pe.aborted||D!=null&&D.aborted)&&l.nextTick(ie),Z}function J(U,oe,ce,{end:ge}){let pe=!1;if(oe.on("close",()=>{pe||ce(new A)}),U.pipe(oe,{end:!1}),ge){let D=function(){pe=!0,oe.end()};fe(U)?l.nextTick(D):U.once("end",D)}else ce();return o(U,{readable:!0,writable:!1},D=>{const G=U._readableState;D&&D.code==="ERR_STREAM_PREMATURE_CLOSE"&&G&&G.ended&&!G.errored&&!G.errorEmitted?U.once("end",ce).once("error",ce):ce(D)}),o(oe,{readable:!1,writable:!0},ce)}return fr={pipelineImpl:M,pipeline:g},fr}var dr,gn;function yn(){if(gn)return dr;gn=1;const{pipeline:l}=cr(),e=$e(),{destroyer:t}=Ze(),{isNodeStream:r,isReadable:s,isWritable:o,isWebStream:u,isTransformStream:a,isWritableStream:p,isReadableStream:h}=De(),{AbortError:x,codes:{ERR_INVALID_ARG_VALUE:T,ERR_MISSING_ARGS:j}}=je(),B=We();return dr=function(...v){if(v.length===0)throw new j("streams");if(v.length===1)return e.from(v[0]);const y=[...v];if(typeof v[0]=="function"&&(v[0]=e.from(v[0])),typeof v[v.length-1]=="function"){const O=v.length-1;v[O]=e.from(v[O])}for(let O=0;O<v.length;++O)if(!(!r(v[O])&&!u(v[O]))){if(O<v.length-1&&!(s(v[O])||h(v[O])||a(v[O])))throw new T(`streams[${O}]`,y[O],"must be readable");if(O>0&&!(o(v[O])||p(v[O])||a(v[O])))throw new T(`streams[${O}]`,y[O],"must be writable")}let b,m,w,P,I;function H(O){const V=P;P=null,V?V(O):O?I.destroy(O):!k&&!fe&&I.destroy()}const K=v[0],z=l(v,H),fe=!!(o(K)||p(K)||a(K)),k=!!(s(z)||h(z)||a(z));if(I=new e({writableObjectMode:!!(K!=null&&K.writableObjectMode),readableObjectMode:!!(z!=null&&z.readableObjectMode),writable:fe,readable:k}),fe){if(r(K))I._write=function(V,L,ne){K.write(V,L)?ne():b=ne},I._final=function(V){K.end(),m=V},K.on("drain",function(){if(b){const V=b;b=null,V()}});else if(u(K)){const L=(a(K)?K.writable:K).getWriter();I._write=async function(ne,se,ue){try{await L.ready,L.write(ne).catch(()=>{}),ue()}catch(be){ue(be)}},I._final=async function(ne){try{await L.ready,L.close().catch(()=>{}),m=ne}catch(se){ne(se)}}}const O=a(z)?z.readable:z;B(O,()=>{if(m){const V=m;m=null,V()}})}if(k){if(r(z))z.on("readable",function(){if(w){const O=w;w=null,O()}}),z.on("end",function(){I.push(null)}),I._read=function(){for(;;){const O=z.read();if(O===null){w=I._read;return}if(!I.push(O))return}};else if(u(z)){const V=(a(z)?z.readable:z).getReader();I._read=async function(){for(;;)try{const{value:L,done:ne}=await V.read();if(!I.push(L))return;if(ne){I.push(null);return}}catch{return}}}}return I._destroy=function(O,V){!O&&P!==null&&(O=new x),w=null,b=null,m=null,P===null?V(O):(P=V,r(z)&&t(z,O))},I},dr}var wn;function li(){if(wn)return Rt;wn=1;const l=globalThis.AbortController||ut().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:s},AbortError:o}=je(),{validateAbortSignal:u,validateInteger:a,validateObject:p}=ft(),h=ve().Symbol("kWeak"),x=ve().Symbol("kResistStopPropagation"),{finished:T}=We(),j=yn(),{addAbortSignalNoValidate:B}=vt(),{isWritable:A,isNodeStream:v}=De(),{deprecate:y}=Le(),{ArrayPrototypePush:b,Boolean:m,MathFloor:w,Number:P,NumberIsNaN:I,Promise:H,PromiseReject:K,PromiseResolve:z,PromisePrototypeThen:fe,Symbol:k}=ve(),O=k("kEmpty"),V=k("kEof");function L(D,G){if(G!=null&&p(G,"options"),G?.signal!=null&&u(G.signal,"options.signal"),v(D)&&!A(D))throw new e("stream",D,"must be writable");const ie=j(this,D);return G!=null&&G.signal&&B(G.signal,ie),ie}function ne(D,G){if(typeof D!="function")throw new t("fn",["Function","AsyncFunction"],D);G!=null&&p(G,"options"),G?.signal!=null&&u(G.signal,"options.signal");let ie=1;G?.concurrency!=null&&(ie=w(G.concurrency));let he=ie-1;return G?.highWaterMark!=null&&(he=w(G.highWaterMark)),a(ie,"options.concurrency",1),a(he,"options.highWaterMark",0),he+=ie,(async function*(){const S=Le().AbortSignalAny([G?.signal].filter(m)),N=this,C=[],ee={signal:S};let X,Z,R=!1,Q=0;function Y(){R=!0,$()}function $(){Q-=1,we()}function we(){Z&&!R&&Q<ie&&C.length<he&&(Z(),Z=null)}async function Ne(){try{for await(let ye of N){if(R)return;if(S.aborted)throw new o;try{if(ye=D(ye,ee),ye===O)continue;ye=z(ye)}catch(Be){ye=K(Be)}Q+=1,fe(ye,$,Y),C.push(ye),X&&(X(),X=null),!R&&(C.length>=he||Q>=ie)&&await new H(Be=>{Z=Be})}C.push(V)}catch(ye){const Be=K(ye);fe(Be,$,Y),C.push(Be)}finally{R=!0,X&&(X(),X=null)}}Ne();try{for(;;){for(;C.length>0;){const ye=await C[0];if(ye===V)return;if(S.aborted)throw new o;ye!==O&&(yield ye),C.shift(),we()}await new H(ye=>{X=ye})}}finally{R=!0,Z&&(Z(),Z=null)}}).call(this)}function se(D=void 0){return D!=null&&p(D,"options"),D?.signal!=null&&u(D.signal,"options.signal"),(async function*(){let ie=0;for await(const de of this){var he;if(D!=null&&(he=D.signal)!==null&&he!==void 0&&he.aborted)throw new o({cause:D.signal.reason});yield[ie++,de]}}).call(this)}async function ue(D,G=void 0){for await(const ie of g.call(this,D,G))return!0;return!1}async function be(D,G=void 0){if(typeof D!="function")throw new t("fn",["Function","AsyncFunction"],D);return!await ue.call(this,async(...ie)=>!await D(...ie),G)}async function W(D,G){for await(const ie of g.call(this,D,G))return ie}async function ae(D,G){if(typeof D!="function")throw new t("fn",["Function","AsyncFunction"],D);async function ie(he,de){return await D(he,de),O}for await(const he of ne.call(this,ie,G));}function g(D,G){if(typeof D!="function")throw new t("fn",["Function","AsyncFunction"],D);async function ie(he,de){return await D(he,de)?he:O}return ne.call(this,ie,G)}class M extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function J(D,G,ie){var he;if(typeof D!="function")throw new t("reducer",["Function","AsyncFunction"],D);ie!=null&&p(ie,"options"),ie?.signal!=null&&u(ie.signal,"options.signal");let de=arguments.length>1;if(ie!=null&&(he=ie.signal)!==null&&he!==void 0&&he.aborted){const X=new o(void 0,{cause:ie.signal.reason});throw this.once("error",()=>{}),await T(this.destroy(X)),X}const S=new l,N=S.signal;if(ie!=null&&ie.signal){const X={once:!0,[h]:this,[x]:!0};ie.signal.addEventListener("abort",()=>S.abort(),X)}let C=!1;try{for await(const X of this){var ee;if(C=!0,ie!=null&&(ee=ie.signal)!==null&&ee!==void 0&&ee.aborted)throw new o;de?G=await D(G,X,{signal:N}):(G=X,de=!0)}if(!C&&!de)throw new M}finally{S.abort()}return G}async function U(D){D!=null&&p(D,"options"),D?.signal!=null&&u(D.signal,"options.signal");const G=[];for await(const he of this){var ie;if(D!=null&&(ie=D.signal)!==null&&ie!==void 0&&ie.aborted)throw new o(void 0,{cause:D.signal.reason});b(G,he)}return G}function oe(D,G){const ie=ne.call(this,D,G);return(async function*(){for await(const de of ie)yield*de}).call(this)}function ce(D){if(D=P(D),I(D))return 0;if(D<0)throw new s("number",">= 0",D);return D}function ge(D,G=void 0){return G!=null&&p(G,"options"),G?.signal!=null&&u(G.signal,"options.signal"),D=ce(D),(async function*(){var he;if(G!=null&&(he=G.signal)!==null&&he!==void 0&&he.aborted)throw new o;for await(const S of this){var de;if(G!=null&&(de=G.signal)!==null&&de!==void 0&&de.aborted)throw new o;D--<=0&&(yield S)}}).call(this)}function pe(D,G=void 0){return G!=null&&p(G,"options"),G?.signal!=null&&u(G.signal,"options.signal"),D=ce(D),(async function*(){var he;if(G!=null&&(he=G.signal)!==null&&he!==void 0&&he.aborted)throw new o;for await(const S of this){var de;if(G!=null&&(de=G.signal)!==null&&de!==void 0&&de.aborted)throw new o;if(D-- >0&&(yield S),D<=0)return}}).call(this)}return Rt.streamReturningOperators={asIndexedPairs:y(se,"readable.asIndexedPairs will be removed in a future version."),drop:ge,filter:g,flatMap:oe,map:ne,take:pe,compose:L},Rt.promiseReturningOperators={every:be,forEach:ae,reduce:J,toArray:U,some:ue,find:W},Rt}var hr,mn;function xn(){if(mn)return hr;mn=1;const{ArrayPrototypePop:l,Promise:e}=ve(),{isIterable:t,isNodeStream:r,isWebStream:s}=De(),{pipelineImpl:o}=cr(),{finished:u}=We();Sn();function a(...p){return new e((h,x)=>{let T,j;const B=p[p.length-1];if(B&&typeof B=="object"&&!r(B)&&!t(B)&&!s(B)){const A=l(p);T=A.signal,j=A.end}o(p,(A,v)=>{A?x(A):h(v)},{signal:T,end:j})})}return hr={finished:u,pipeline:a},hr}var En;function Sn(){if(En)return Ut.exports;En=1;const{Buffer:l}=Me(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:r}=ve(),{promisify:{custom:s}}=Le(),{streamReturningOperators:o,promiseReturningOperators:u}=li(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:a}}=je(),p=yn(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:x}=At(),{pipeline:T}=cr(),{destroyer:j}=Ze(),B=We(),A=xn(),v=De(),y=Ut.exports=Jt().Stream;y.isDestroyed=v.isDestroyed,y.isDisturbed=v.isDisturbed,y.isErrored=v.isErrored,y.isReadable=v.isReadable,y.isWritable=v.isWritable,y.Readable=Pt();for(const m of t(o)){let P=function(...I){if(new.target)throw a();return y.Readable.from(r(w,this,I))};const w=o[m];e(P,"name",{__proto__:null,value:w.name}),e(P,"length",{__proto__:null,value:w.length}),e(y.Readable.prototype,m,{__proto__:null,value:P,enumerable:!1,configurable:!0,writable:!0})}for(const m of t(u)){let P=function(...I){if(new.target)throw a();return r(w,this,I)};const w=u[m];e(P,"name",{__proto__:null,value:w.name}),e(P,"length",{__proto__:null,value:w.length}),e(y.Readable.prototype,m,{__proto__:null,value:P,enumerable:!1,configurable:!0,writable:!0})}y.Writable=sr(),y.Duplex=$e(),y.Transform=hn(),y.PassThrough=_n(),y.pipeline=T;const{addAbortSignal:b}=vt();return y.addAbortSignal=b,y.finished=B,y.destroy=j,y.compose=p,y.setDefaultHighWaterMark=h,y.getDefaultHighWaterMark=x,e(y,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return A}}),e(T,s,{__proto__:null,enumerable:!0,get(){return A.pipeline}}),e(B,s,{__proto__:null,enumerable:!0,get(){return A.finished}}),y.Stream=y,y._isUint8Array=function(w){return w instanceof Uint8Array},y._uint8ArrayToBuffer=function(w){return l.from(w.buffer,w.byteOffset,w.byteLength)},Ut.exports}var In;function ui(){return In||(In=1,(function(l){const e=Sn(),t=xn(),r=e.Readable.destroy;l.exports=e.Readable,l.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,l.exports._isUint8Array=e._isUint8Array,l.exports.isDisturbed=e.isDisturbed,l.exports.isErrored=e.isErrored,l.exports.isReadable=e.isReadable,l.exports.Readable=e.Readable,l.exports.Writable=e.Writable,l.exports.Duplex=e.Duplex,l.exports.Transform=e.Transform,l.exports.PassThrough=e.PassThrough,l.exports.addAbortSignal=e.addAbortSignal,l.exports.finished=e.finished,l.exports.destroy=e.destroy,l.exports.destroy=r,l.exports.pipeline=e.pipeline,l.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),l.exports.Stream=e.Stream,l.exports.default=l.exports})($t)),$t.exports}var Rn=ui();const pr=Symbol("iter");function ct(l,e,t=4){if(t===0)return Object.assign(l,e);for(const r in e)l[r]=ct(l[r]||Object.create(null),e[r],t-1);return l}function Tn(l,e,t=4){let r=!1;for(const s in l)if(s in e){const o=t===0?null:Tn(l[s],e[s],t-1);if(o!==!1)r=r||Object.create(null),r[s]=o;else if(t===3)return!1}return r}function vn(l,e,t=4){let r=!1;for(const s in l)if(!(s in e))r=r||Object.create(null),r[s]=t===0?null:ct({},l[s],t-1);else if(t!==0){const o=vn(l[s],e[s],t-1);if(o!==!1)r=r||Object.create(null),r[s]=o;else if(t===3)return!1}return r}class fi{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[""]=1,this._entities=Object.create(null),this._entities[1]="",this._blankNodeIndex=0,this._factory=e.factory||Ge}_termFromId(e){if(e[0]==="."){const t=this._entities,r=e.split(".");return this._factory.quad(this._termFromId(t[r[1]]),this._termFromId(t[r[2]]),this._termFromId(t[r[3]]),r[4]&&this._termFromId(t[r[4]]))}return it(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const t=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),s=this._termToNumericId(e.object);let o;return t&&r&&s&&(Ct(e.graph)||(o=this._termToNumericId(e.graph)))&&this._ids[o?`.${t}.${r}.${s}.${o}`:`.${t}.${r}.${s}`]}return this._ids[Je(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${Ct(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:Je(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,r;if(e)for(t=e=`_:${e}`,r=1;this._ids[t];)t=e+r++;else do t=`_:b${this._blankNodeIndex++}`;while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class ke{constructor(e,t){this._size=0,this._graphs=Object.create(null),!t&&e&&!e[0]&&typeof e.match!="function"&&(t=e,e=null),t=t||{},this._factory=t.factory||Ge,this._entityIndex=t.entityIndex||new fi({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;const t=this._graphs;let r,s;for(const o in t)for(const u in r=t[o].subjects)for(const a in s=r[u])e+=Object.keys(s[a]).length;return this._size=e}_addToIndex(e,t,r,s){const o=e[t]||(e[t]={}),u=o[r]||(o[r]={}),a=s in u;return a||(u[s]=null),!a}_removeFromIndex(e,t,r,s){const o=e[t],u=o[r];delete u[s];for(const a in u)return;delete o[r];for(const a in o)return;delete e[t]}*_findInIndex(e,t,r,s,o,u,a,p){let h,x,T;const j=this._entities,B=this._termFromId(j[p]),A={subject:null,predicate:null,object:null};t&&((h=e,e={})[t]=h[t]);for(const v in e)if(x=e[v]){A[o]=this._termFromId(j[v]),r&&((h=x,x={})[r]=h[r]);for(const y in x)if(T=x[y]){A[u]=this._termFromId(j[y]);const b=s?s in T?[s]:[]:Object.keys(T);for(let m=0;m<b.length;m++)A[a]=this._termFromId(j[b[m]]),yield this._factory.quad(A.subject,A.predicate,A.object,B)}}}_loop(e,t){for(const r in e)t(r)}_loopByKey0(e,t,r){let s,o;if(s=e[t])for(o in s)r(o)}_loopByKey1(e,t,r){let s,o;for(s in e)o=e[s],o[t]&&r(s)}_loopBy2Keys(e,t,r,s){let o,u,a;if((o=e[t])&&(u=o[r]))for(a in u)s(a)}_countInIndex(e,t,r,s){let o=0,u,a,p;t&&((u=e,e={})[t]=u[t]);for(const h in e)if(a=e[h]){r&&((u=a,a={})[r]=u[r]);for(const x in a)(p=a[x])&&(s?s in p&&o++:o+=Object.keys(p).length)}return o}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const t=Object.create(null);return r=>{r in t||(t[r]=!0,e(this._termFromId(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,r,s){t||(s=e.graph,r=e.object,t=e.predicate,e=e.subject),s=s?this._termToNewNumericId(s):1;let o=this._graphs[s];return o||(o=this._graphs[s]={subjects:{},predicates:{},objects:{}},Object.freeze(o)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),r=this._termToNewNumericId(r),this._addToIndex(o.subjects,e,t,r)?(this._addToIndex(o.predicates,t,r,e),this._addToIndex(o.objects,r,e,t),this._size=null,!0):!1}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,r,s){return e&&e.subject&&({subject:e,predicate:t,object:r,graph:s}=e),!this.readQuads(e,t,r,s).next().done}import(e){return e.on("data",t=>{this.addQuad(t)}),e}removeQuad(e,t,r,s){t||({subject:e,predicate:t,object:r,graph:s}=e),s=s?this._termToNumericId(s):1;const o=this._graphs;let u,a,p;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(r=r&&this._termToNumericId(r))||!(u=o[s])||!(a=u.subjects[e])||!(p=a[t])||!(r in p))return!1;this._removeFromIndex(u.subjects,e,t,r),this._removeFromIndex(u.predicates,t,r,e),this._removeFromIndex(u.objects,r,e,t),this._size!==null&&this._size--;for(e in u.subjects)return!0;return delete o[s],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",t=>{this.removeQuad(t)}),e}removeMatches(e,t,r,s){const o=new Rn.Readable({objectMode:!0}),u=this.readQuads(e,t,r,s);return o._read=a=>{for(;--a>=0;){const{done:p,value:h}=u.next();if(p){o.push(null);return}o.push(h)}},this.remove(o)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,r,s){return[...this.readQuads(e,t,r,s)]}*readQuads(e,t,r,s){const o=this._getGraphs(s);let u,a,p,h;if(!(e&&!(a=this._termToNumericId(e))||t&&!(p=this._termToNumericId(t))||r&&!(h=this._termToNumericId(r))))for(const x in o)(u=o[x])&&(a?h?yield*this._findInIndex(u.objects,h,a,p,"object","subject","predicate",x):yield*this._findInIndex(u.subjects,a,p,null,"subject","predicate","object",x):p?yield*this._findInIndex(u.predicates,p,h,null,"predicate","object","subject",x):h?yield*this._findInIndex(u.objects,h,null,null,"object","subject","predicate",x):yield*this._findInIndex(u.subjects,null,null,null,"subject","predicate","object",x))}match(e,t,r,s){return new qe(this,e,t,r,s,{entityIndex:this._entityIndex})}countQuads(e,t,r,s){const o=this._getGraphs(s);let u=0,a,p,h,x;if(e&&!(p=this._termToNumericId(e))||t&&!(h=this._termToNumericId(t))||r&&!(x=this._termToNumericId(r)))return 0;for(const T in o)(a=o[T])&&(e?r?u+=this._countInIndex(a.objects,x,p,h):u+=this._countInIndex(a.subjects,p,h,x):t?u+=this._countInIndex(a.predicates,h,x,p):u+=this._countInIndex(a.objects,x,p,h));return u}forEach(e,t,r,s,o){this.some(u=>(e(u,this),!1),t,r,s,o)}every(e,t,r,s,o){return!this.some(u=>!e(u,this),t,r,s,o)}some(e,t,r,s,o){for(const u of this.readQuads(t,r,s,o))if(e(u,this))return!0;return!1}getSubjects(e,t,r){const s=[];return this.forSubjects(o=>{s.push(o)},e,t,r),s}forSubjects(e,t,r,s){const o=this._getGraphs(s);let u,a,p;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(p=this._termToNumericId(r))))for(s in o)(u=o[s])&&(a?p?this._loopBy2Keys(u.predicates,a,p,e):this._loopByKey1(u.subjects,a,e):p?this._loopByKey0(u.objects,p,e):this._loop(u.subjects,e))}getPredicates(e,t,r){const s=[];return this.forPredicates(o=>{s.push(o)},e,t,r),s}forPredicates(e,t,r,s){const o=this._getGraphs(s);let u,a,p;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(p=this._termToNumericId(r))))for(s in o)(u=o[s])&&(a?p?this._loopBy2Keys(u.objects,p,a,e):this._loopByKey0(u.subjects,a,e):p?this._loopByKey1(u.predicates,p,e):this._loop(u.predicates,e))}getObjects(e,t,r){const s=[];return this.forObjects(o=>{s.push(o)},e,t,r),s}forObjects(e,t,r,s){const o=this._getGraphs(s);let u,a,p;if(e=this._uniqueEntities(e),!(t&&!(a=this._termToNumericId(t))||r&&!(p=this._termToNumericId(r))))for(s in o)(u=o[s])&&(a?p?this._loopBy2Keys(u.subjects,a,p,e):this._loopByKey1(u.objects,a,e):p?this._loopByKey0(u.predicates,p,e):this._loop(u.objects,e))}getGraphs(e,t,r){const s=[];return this.forGraphs(o=>{s.push(o)},e,t,r),s}forGraphs(e,t,r,s){for(const o in this._graphs)this.some(u=>(e(u.graph),!0),t,r,s,this._termFromId(this._entities[o]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const r={},s=t?(()=>!0):((a,p)=>{throw new Error(`${a.value} ${p}`)}),o=this.getQuads(null,Ae.rdf.rest,Ae.rdf.nil,null),u=e?[...o]:[];return o.forEach(a=>{const p=[];let h=!1,x,T;const j=a.graph;let B=a.subject;for(;B&&!h;){const A=this.getQuads(null,null,B,null),v=this.getQuads(B,null,null,null);let y,b=null,m=null,w=null;for(let P=0;P<v.length&&!h;P++)y=v[P],y.graph.equals(j)?x?h=s(B,"has non-list arcs out"):y.predicate.value===Ae.rdf.first?b?h=s(B,"has multiple rdf:first arcs"):u.push(b=y):y.predicate.value===Ae.rdf.rest?m?h=s(B,"has multiple rdf:rest arcs"):u.push(m=y):A.length?h=s(B,"can't be subject and object"):(x=y,T="subject"):h=s(B,"not confined to single graph");for(let P=0;P<A.length&&!h;++P)y=A[P],x?h=s(B,"can't have coreferences"):y.predicate.value===Ae.rdf.rest?w?h=s(B,"has incoming rdf:rest arcs"):w=y:(x=y,T="object");b?p.unshift(b.object):h=s(B,"has no list head"),B=w&&w.subject}h?e=!1:x&&(r[x[T].value]=p)}),e&&this.removeQuads(u),r}addAll(e){if(e instanceof qe&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof ke&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=ct(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof qe&&(e=e.filtered),e===this)return!0;if(!(e instanceof ke)||this._entityIndex!==e._entityIndex)return e.every(h=>this.has(h));const t=this._graphs,r=e._graphs;let s,o,u,a,p;for(const h in r){if(!(s=t[h]))return!1;s=s.subjects;for(const x in o=r[h].subjects){if(!(u=s[x]))return!1;for(const T in a=o[x]){if(!(p=u[T]))return!1;for(const j in a[T])if(!(j in p))return!1}}}return!0}deleteMatches(e,t,r,s){for(const o of this.match(e,t,r,s))this.removeQuad(o);return this}difference(e){if(e&&e instanceof qe&&(e=e.filtered),e===this)return new ke({entityIndex:this._entityIndex});if(e instanceof ke&&e._entityIndex===this._entityIndex){const t=new ke({entityIndex:this._entityIndex}),r=vn(this._graphs,e._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter(t=>!e.has(t))}equals(e){return e instanceof qe&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new ke({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&t.add(r);return t}intersection(e){if(e instanceof qe&&(e=e.filtered),e===this){const t=new ke({entityIndex:this._entityIndex});return t._graphs=ct(Object.create(null),this._graphs),t._size=this._size,t}else if(e instanceof ke&&this._entityIndex===e._entityIndex){const t=new ke({entityIndex:this._entityIndex}),r=Tn(e._graphs,this._graphs);return r&&(t._graphs=r,t._size=null),t}return this.filter(t=>e.has(t))}map(e){const t=new ke({entityIndex:this._entityIndex});for(const r of this)t.add(e(r,this));return t}reduce(e,t){const r=this.readQuads();let s=t===void 0?r.next().value:t;for(const o of r)s=e(s,o,this);return s}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new Dr().quadsToString(this)}union(e){const t=new ke({entityIndex:this._entityIndex});return t._graphs=ct(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function Ce(l,e,t=0){const r=e[t];if(r&&!(r in l))return!1;let s=!1;for(const o in r?{[r]:l[r]}:l){const u=t===2?null:Ce(l[o],e,t+1);u!==!1&&(s=s||Object.create(null),s[o]=u)}return s}class qe extends Rn.Readable{constructor(e,t,r,s,o,u){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:r,object:s,graph:o,options:u})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:r,predicate:s,subject:o}=this,u=this._filtered=new ke({factory:e._factory,entityIndex:this.options.entityIndex});let a,p,h;if(o&&!(a=u._termToNumericId(o))||s&&!(p=u._termToNumericId(s))||r&&!(h=u._termToNumericId(r)))return u;const x=e._getGraphs(t);for(const T in x){let j,B,A,v;(v=x[T])&&(!a&&p?(B=Ce(v.predicates,[p,h,a]))&&(j=Ce(v.subjects,[a,p,h]),A=Ce(v.objects,[h,a,p])):h?(A=Ce(v.objects,[h,a,p]))&&(j=Ce(v.subjects,[a,p,h]),B=Ce(v.predicates,[p,h,a])):(j=Ce(v.subjects,[a,p,h]))&&(B=Ce(v.predicates,[p,h,a]),A=Ce(v.objects,[h,a,p])),j&&(u._graphs[T]={subjects:j,predicates:B,objects:A}))}u._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[pr]&&(this[pr]=this[Symbol.iterator]());const t=this[pr];for(;--e>=0;){const{done:r,value:s}=t.next();if(r){this.push(null);return}this.push(s)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,r,s){return this.filtered.deleteMatches(e,t,r,s)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,r,s,o){return this.filtered.every(e,t,r,s,o)}filter(e){return this.filtered.filter(e)}forEach(e,t,r,s,o){return this.filtered.forEach(e,t,r,s,o)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,r,s,o){return this.filtered.some(e,t,r,s,o)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return new Dr().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,r,s){return new qe(this.filtered,e,t,r,s,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}const jt={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#"},Ee={namespace:"https://prez.dev/",label:"https://prez.dev/label",description:"https://prez.dev/description",provenance:"https://prez.dev/provenance",focusNode:"https://prez.dev/FocusNode",link:"https://prez.dev/link",members:"https://prez.dev/members",identifier:"https://prez.dev/identifier",count:"https://prez.dev/count",searchResult:"https://prez.dev/SearchResult",searchResultWeight:"https://prez.dev/searchResultWeight",searchResultPredicate:"https://prez.dev/searchResultPredicate",searchResultURI:"https://prez.dev/searchResultURI",searchResultMatch:"https://prez.dev/searchResultMatch",hasSearchMatch:"https://prez.dev/hasSearchMatch",hasChildren:"https://prez.dev/hasChildren",facetCount:"https://prez.dev/facetCount",facetName:"https://prez.dev/facetName",facetValue:"https://prez.dev/facetValue",profile:"https://prez.dev/profile"},Ie={skosConceptScheme:"http://www.w3.org/2004/02/skos/core#ConceptScheme",skosConcept:"http://www.w3.org/2004/02/skos/core#Concept",a:"http://www.w3.org/1999/02/22-rdf-syntax-ns#type",rdfLangString:"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",xmlString:"http://www.w3.org/2001/XMLSchema#string",w3Html:"http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML",w3Markdown:"https://www.w3.org/ns/iana/media-types/text/markdown",w3token:"http://www.w3.org/2001/XMLSchema#token",shaclAllPredicates:"http://example.com/shacl-extension#allPredicateValues",shaclPathAlias:"http://example.com/shacl-extension#pathAlias",shaclProperty:"http://www.w3.org/ns/shacl#property",shaclPath:"http://www.w3.org/ns/shacl#path",shaclUnion:"http://www.w3.org/ns/shacl#union",dctermsIdentifier:"http://purl.org/dc/terms/identifier",owlOntology:"http://www.w3.org/2002/07/owl#Ontology"},An={bblock:"https://www.opengis.net/def/bblocks/BuildingBlock",bblockSchema:"https://www.opengis.net/def/bblocks/Schema",bblockModel:"https://www.opengis.net/def/bblocks/Model",bblockApi:"https://www.opengis.net/def/bblocks/Api",bblockPath:"https://www.opengis.net/def/bblocks/Response",bblockResponse:"https://www.opengis.net/def/bblocks/Datatype",bblockParameter:"https://www.opengis.net/def/bblocks/Parameter",bblockDatatype:"https://www.opengis.net/def/bblocks/Datatype"},ci={label:["https://prez.dev/label"],description:["https://prez.dev/description"],provenance:["https://prez.dev/provenance"]};function Nn(l,e=jt){if(l==="a")return e.rdf+"type";{const[t,r]=l.split(":");return t?[t]+r:l}}function Pn(l,e=jt){let t="";return Object.entries(e).forEach(([r,s])=>{l.startsWith(s)&&(t=r+":"+l.split(s)[1])}),t}const jn=l=>{const e=new URL(l);return`${e.protocol}//${e.hostname}`},di=l=>new URL(l).pathname,hi=(l,e)=>{const t=e.identifiers?.find(r=>r.value)?.value;return t?l+`/concept-hierarchy/${t}/narrowers`:""},pi=(l,e)=>{const t=e?jn(e):"",r=l.identifiers?.find(u=>u.value),s=r?r.value:"";return s?t+`/concept-hierarchy/${s}/top-concepts`:""},Bt=l=>l.flatMap(e=>e["@id"]?e["@id"]:e["@list"]&&e["@list"].length>0?e["@list"][0]?.["@id"]===Ie.shaclUnion?Bt(e["@list"][1]?.["@list"]||[]).filter(Boolean):Bt(e["@list"]).flat():[]).filter(e=>!!e),_i=l=>l.reduce((e,t)=>{if(Ie.shaclProperty in t)for(const r of t[Ie.shaclProperty]){const s=l.find(o=>o["@id"]===r["@id"]);s&&Ie.shaclPath in s&&(e[t["@id"]]=Bt(s[Ie.shaclPath]).filter(o=>o!==Ie.shaclAllPredicates))}return e},{});function dt(l){if(Array.isArray(l))return l.reduce((e,t)=>{const r=dt(t);return typeof r=="object"&&!Array.isArray(r)&&Object.assign(e,r),e},{});if(typeof l=="object"&&l!==null){if(l.hasOwnProperty("value"))return l.value;if(l.hasOwnProperty("node")&&l.hasOwnProperty("list")){const e={};return e[l.node.value]=l.list.length>0?dt(l.list):"",e}else{const e={};for(const t in l)e[t]=dt(l[t]);return e}}return l}function _r(l,e=""){let t="";const r=Object.entries(l),s=r.length;return r.forEach(([o,u],a)=>{const p=o.replace(/https?:\/\/(www\.)?/,""),[h,x]=p.split("#"),T=h.split("/"),j=T[T.length-1],B=x?`(${T[0]})/${j}#${x}`:`(${T[0]})/${j}`,A=a===s-1;t+=`${e}${A?"└── ":"├── "}${B}
|
|
23
|
+
`,typeof u=="object"&&u!==null&&(t+=_r(u,e+(A?" ":"│ ")))}),t}function bi(l){return l?_r(dt(l)):""}const{namedNode:Lt}=Ge;class ht{store;parser;prefixes;basePath;baseUrl;linkedLists;lists;processedTerms;constructor(){this.store=new ke,this.baseUrl="",this.basePath="",this.parser=new Lr,this.prefixes=jt,this.linkedLists={},this.lists={},this.processedTerms=new Set}load(e){this.processedTerms.clear(),e=`PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
|
|
24
|
+
`+e;const t=this.parser.parse(e,null,(r,s)=>{this.prefixes[r]=s.value});this.store.addQuads(t),this.linkedLists=this.store.extractLists(),this.buildLists()}buildLists(){this.lists={};const e=this.linkedLists;this.store.getQuads(null,Ie.shaclPath,null,null).forEach(t=>{const r=t.object;if(r.termType==="BlankNode"){const s=this.store.getQuads(r,Ie.shaclUnion,null,null);if(s.length>0){const o=s[0].object;if(o.termType==="BlankNode"&&o.value in e){const u=e[o.value],a=r.value;this.lists[a]=this.buildSubList(u)}else console.warn(`[buildLists] Found sh:union for ${r.value}, but its object ${o.value} is not a valid list head in linkedLists.`)}}})}buildSubList(e){const t=[];for(const r of e)if(r.termType=="BlankNode"){const s=r.value;if(s in this.linkedLists){const o=this.buildSubList(this.linkedLists[s]);if(o.length>1){const u=t.find(a=>a.node.value==o[0].node.value);u?(u.list??=[]).push(...o.slice(1)):t.push({node:o[0].node,list:o.slice(1)})}else t.push(...o)}else{const o=this.store.getObjects(r,Ie.shaclPathAlias,null)?.[0];if(o){const u=this.toPrezTerm(o);t.push({node:u,list:[]})}}}else if(r.termType=="NamedNode"&&r.value!=Ie.shaclUnion){const s=this.toPrezTerm(r);t.push({node:s,list:[]})}return t}setBaseUrl(e){this.baseUrl=e,this.basePath=new URL(e).pathname}toIri(e){return Nn(e,this.prefixes)}fromIri(e){return Pn(e,this.prefixes)}getObjectLiteral(e,t){return this.getObjects(e,t).map(r=>this.toPrezTerm(r))[0]||void 0}toSubjectTerm(e){if(typeof e=="string")return Lt(e);if(e.termType==="Literal")throw new Error(`Cannot use literal ${e.value} as a subject.`);return e}getRequiredObject(e,t,r){const s=this.getObjects(e,t)[0];if(!s){const o=typeof e=="string"?e:e.value;throw new Error(`Missing ${r} for ${o}.`)}return s}getProperties(e,t){const r={};return this.store.forEach(s=>{t?.excludePrefix&&s.predicate.value.startsWith(t.excludePrefix)||t?.includePrefix&&!s.predicate.value.startsWith(t.includePrefix)||(r[s.predicate.value]??={predicate:this.toPrezTerm(s.predicate),objects:[]},r[s.predicate.value].objects.push(this.toPrezTerm(s.object)))},e,null,null,null),e.termType,r}getParents(e){e.startsWith(this.basePath)&&(e=e.substring(this.basePath.length));const t=e.split("/"),r=[];let s="";for(const o of t){if(o=="")continue;s+="/"+o;const u={url:s,segment:o};if(o.includes(":")){const a=o.split(":"),p=this.prefixes[a[0]];if(p){const h=this.getObjects(p+a[1],Ee.label);h.length>0&&(u.label=bt(h[0].value))}}r.push(u)}return r}toPrezTerm(e){const t=`${e.termType}:${e.value}`;if(this.processedTerms.has(t))switch(e.termType){case"NamedNode":return kt(e.value);case"Literal":return bt(e.value);case"BlankNode":return gt(e.value);default:throw new Error("Invalid n3 Term object")}this.processedTerms.add(t);try{switch(e.termType){case"NamedNode":const r=kt(e.value);r.label=this.getObjectLiteral(e.value,Ee.label),r.description=this.getObjectLiteral(e.value,Ee.description),r.provenance=this.getObjectLiteral(e.value,Ee.provenance);const s=this.getObjects(e.value,Ee.identifier);s.length>0&&(r.identifiers=s.map(x=>this.toPrezTerm(x)));const o=this.getObjects(e.value,Ee.link);o.length>0&&(r.links=o.map(x=>({value:x.value,parents:this.getParents(x.value)})));const u=this.getObjects(e.value,Ee.members);u.length>0&&(r.members={value:u[0].value,parents:this.getParents(u[0].value)});const a=this.getObjects(e.value,Ie.a);return a.length>0&&(r.rdfTypes=a.map(x=>this.toPrezTerm(x))),r;case"Literal":const p=bt(e.value);return e.datatype&&(p.datatype=this.toPrezTerm(e.datatype)),e.language&&(p.language=e.language),p;case"BlankNode":const h=gt(e.value);return h.properties=this.getProperties(e,void 0),e.value in this.lists&&(h.list=this.lists[e.value]),h;default:throw"Invalid n3 Term object"}}finally{this.processedTerms.delete(t)}}toPrezFocusNode(e){const t=this.toPrezTerm(e);return t.properties=this.getProperties(e,{excludePrefix:Ee.namespace}),t.systemProperties=this.getProperties(e,{includePrefix:Ee.namespace}),t.rdfTypes?.map(r=>r.value).includes(Ie.skosConcept)&&(t.hasChildren=t.systemProperties?.[Ee.hasChildren]?.objects?.[0]?.value=="true"),t}getSubjects(e,t){return this.store.getSubjects(e,t,null)}getObjects(e,t){const r=this.toSubjectTerm(e);if(typeof t=="string")return this.store.getObjects(r,Lt(t),null);{const s=[];return t.forEach(o=>{s.push(...this.store.getObjects(r,Lt(o),null))}),s}}getMembers(e){this.getObjects(e,this.toIri("prez:members")).forEach(r=>({value:r.value,parents:[]}))}getConcepts(e){const t=this.getSubjects(this.toIri("skos:inScheme"),e.value);function r(h){return t.map(x=>x.value).includes(h.value)}const s=this.getObjects(e.value,this.toIri("skos:hasTopConcept")),o=this.getObjects(e.value,this.toIri("skos:topConceptOf")),u={},a=[...s,...o].filter(h=>r(h));t.forEach(h=>{u[h.value]=[]}),t.forEach(h=>{this.getObjects(h.value,this.toIri("skos:broader")).forEach(j=>{r(j)&&u[j.value].push(h)}),this.getObjects(h.value,this.toIri("skos:narrower")).forEach(j=>{r(j)&&u[h.value].push(j)})});const p=[];return a.forEach(h=>{p.push(this.createHierarchy(h,u))}),p}createHierarchy(e,t){const r=t[e.value].map(s=>this.createHierarchy(s,t));return{...this.toPrezTerm(e),hasChildren:r.length>0,narrowers:r}}getByPrezId(e){const t=[];return this.store.forEach(r=>{t.push(r)},null,null,Lt("https://prez.dev/FocusNode"),null),e?t.find(r=>r.object.value===e).subject:t.map(r=>r.subject)}getCount(){const e=this.store.getObjects(null,Ee.count,null);return e.length>0?Number(e[0].value.replace(">","")):0}getMaxReached(){const e=this.store.getObjects(null,Ee.count,null);return e.length>0?!e[0].value.includes(">"):!1}getList(){const e=[];return this.getByPrezId().forEach(r=>{e.push(this.toPrezFocusNode(r))}),e}getSkosCollections(e){const t=this.getSubjects("http://www.w3.org/2004/02/skos/core#inScheme",e.value);return this.getSubjects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.w3.org/2004/02/skos/core#Collection").filter(o=>t.find(u=>u.value===o.value)).map(o=>this.toPrezTerm(o)).sort((o,u)=>o.label&&u.label?o.label.value.localeCompare(u.label.value):o.label?-1:u.label?1:o.value.localeCompare(u.value))}getOntologyClasses(e){const t=this.getSubjects("http://www.w3.org/2000/01/rdf-schema#isDefinedBy",e.value);return this.getSubjects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.w3.org/2002/07/owl#Class").filter(o=>t.find(u=>u.value===o.value)).map(o=>this.toPrezTerm(o)).sort((o,u)=>o.label&&u.label?o.label.value.localeCompare(u.label.value):o.label?-1:u.label?1:o.value.localeCompare(u.value))}getOntologyProperties(e){const t=this.getSubjects("http://www.w3.org/2000/01/rdf-schema#isDefinedBy",e.value);return this.getSubjects("http://www.w3.org/1999/02/22-rdf-syntax-ns#type","http://www.w3.org/2002/07/owl#ObjectProperty").filter(o=>t.find(u=>u.value===o.value)).map(o=>this.toPrezTerm(o)).sort((o,u)=>o.label&&u.label?o.label.value.localeCompare(u.label.value):o.label?-1:u.label?1:o.value.localeCompare(u.value))}getBBlockDependencies(e){return this.getObjects(e.value,"https://www.opengis.net/def/bblocks/dependsOn").map(s=>this.toPrezTerm(s)).sort((s,o)=>s.label&&o.label?s.label.value.localeCompare(o.label.value):s.label?-1:o.label?1:s.value.localeCompare(o.value))}getItem(){const e=this.getByPrezId();if(e.length==0)throw new Error("Unable to find item");const t=this.toPrezFocusNode(e[0]);if(t.rdfTypes?.map(s=>s.value).includes(Ie.owlOntology)&&t.rdfTypes?.map(s=>s.value).includes(Ie.skosConceptScheme)){const s=this.getOntologyClasses(e[0]),o=this.getOntologyProperties(e[0]),u=this.getSkosCollections(e[0]);return{...t,collections:u,ontologyClasses:s,ontologyProperties:o}}if(t.rdfTypes?.map(s=>s.value).includes(Ie.owlOntology)){const s=this.getOntologyClasses(e[0]),o=this.getOntologyProperties(e[0]);return{...t,ontologyClasses:s,ontologyProperties:o}}if(t.rdfTypes?.map(s=>s.value).includes(Ie.skosConceptScheme)){const s=this.getSkosCollections(e[0]);return{...t,collections:s}}let r=!1;if(t.rdfTypes&&t.rdfTypes.length)for(let s=0;!r&&s<t.rdfTypes.length;s++)Object.values(An).includes(t.rdfTypes[s].value)&&(r=!0);if(r){const s=this.getBBlockDependencies(e[0]);return{...t,dependsOn:s,isBBlock:r}}return t}getSubItems(e){const t=this.store.getQuads(null,e,null,null),r=[];return t.forEach(s=>{const o=this.toPrezFocusNode(s.object);o&&r.push(o)}),r}extractSearchResultHash(e){return e.value.startsWith("urn:hash:")?e.value.slice(9):e.value}getSearchResultBase(e){const t=this.getRequiredObject(e,Ee.searchResultWeight,"search result weight"),r=this.getRequiredObject(e,Ee.searchResultURI,"search result URI");return{hash:this.extractSearchResultHash(e),weight:Number(t.value),resource:this.toPrezFocusNode(r)}}getOptionalFlatSearchMatch(e){const t=this.getObjects(e,Ee.searchResultPredicate)[0],r=this.getObjects(e,Ee.searchResultMatch)[0];if(!(!t&&!r)){if(!t||!r)throw new Error(`Incomplete flat search match for ${e.value}.`);return{predicate:this.toPrezTerm(t),match:this.toPrezTerm(r)}}}parseSearchMatch(e){const t=this.getRequiredObject(e,Ee.searchResultPredicate,"search match predicate"),r=this.getRequiredObject(e,Ee.searchResultMatch,"search match literal");return{predicate:this.toPrezTerm(t),match:this.toPrezTerm(r)}}parseDefaultSearchResult(e){if(this.getObjects(e,Ee.hasSearchMatch).length>0)throw new Error(`Received Lucene SHACL search matches for ${e.value} while parserMode is default.`);const t=this.getOptionalFlatSearchMatch(e);if(!t)throw new Error(`Missing flat search match data for ${e.value}.`);return{...this.getSearchResultBase(e),...t}}parseJenaLuceneShaclSearchResult(e){const t=this.getObjects(e,Ee.hasSearchMatch);if(this.getOptionalFlatSearchMatch(e))throw new Error(`Received flat search match fields for ${e.value} while parserMode is jena-lucene-shacl.`);return{...this.getSearchResultBase(e),matches:t.map(r=>this.parseSearchMatch(r))}}search(e={}){const t=e.parserMode??"default",r=this.getSubjects(Ie.a,Ee.searchResult);return t==="jena-lucene-shacl"?r.map(s=>this.parseJenaLuceneShaclSearchResult(s)):r.map(s=>this.parseDefaultSearchResult(s))}getFacets(){const e=[];return this.store.getQuads(null,Ee.facetName,null,null).forEach(t=>{if(t.subject.termType=="BlankNode"){const r=gt(t.subject.value);r.properties=this.getProperties(t.subject);const s=Number(r.properties?.[Ee.facetCount]?.objects?.[0].value)||0,o=r.properties?.[Ee.facetName]?.objects?.[0],u=r.properties?.[Ee.facetValue]?.objects?.[0],a=o,p=e.find(h=>h.facetName.value==a?.value);if(s>0&&a!==void 0&&u!==void 0){const h=this.toPrezTerm(u);if(h.termType==="Literal"||h.termType==="NamedNode"){const x={term:h,count:s};p?p.facetValues.push(x):e.push({facetName:a,facetValues:[x]})}}}}),e}}class gi extends Error{constructor(e){super(e),this.name="NetworkError"}}function yi(l){let e={};const t=l.split(",").map(s=>{const[,o,u]=s.trim().match(/<(.+)>; (.+)/),a={uri:o};return u.split("; ").forEach(p=>{const[,h,x]=p.match(/(.+)=[\"<](.+)[\">]/);a[h]=x}),a});t.filter(s=>s.rel==="type").forEach(s=>{e[s.anchor]={default:!1,current:!1,token:s.token,mediatypes:[],title:s.title,description:"",uri:s.anchor}});const r=t.find(s=>s.rel==="self");return r.format in e&&(e[r.format].current=!0),t.filter(s=>s.rel==="alternate"&&s.format).forEach(s=>{e[s.format].mediatypes.map(o=>o.mediatype).includes(s.type)||e[s.format].mediatypes.push({title:"",mediatype:s.type,default:!1})}),Object.values(e)}async function pt(l){const e=await fetch(l,{method:"GET",headers:{Accept:"text/anot+turtle"}});if(!e.ok)throw new gi(`Network error - status code ${e.status}: ${e.statusText}`);const t=e.headers.get("link")||e.headers.get("Link"),r=t?yi(t):[];return{data:await e.text(),profiles:r}}async function wi(l,e){const t=l+e,r=new URL(t).pathname,{data:s,profiles:o}=await pt(t),u=new ht;return u.setBaseUrl(l),u.load(s),{type:"list",data:u.getList(),profiles:o,maxReached:u.getMaxReached(),count:u.getCount(),parents:u.getParents(r),facets:u.getFacets()}}async function mi(l,e){const t=l+e,r=new URL(t).pathname,{data:s,profiles:o}=await pt(t),u=new ht;return u.setBaseUrl(l),u.load(s),{type:"item",data:u.getItem(),profiles:o,parents:u.getParents(r),store:u,facets:u.getFacets()}}async function xi(l,e,t={}){const r=l+e,s=new URL(r).pathname,{data:o,profiles:u}=await pt(r),a=new ht;a.setBaseUrl(l),a.load(o);const p=t.parserMode??"default";return p==="jena-lucene-shacl"?{type:"search",parserMode:p,data:a.search({parserMode:p}),profiles:u,maxReached:a.getMaxReached(),count:a.getCount(),parents:a.getParents(s),facets:a.getFacets()}:{type:"search",parserMode:"default",data:a.search(),profiles:u,maxReached:a.getMaxReached(),count:a.getCount(),parents:a.getParents(s),facets:a.getFacets()}}async function Ei(l){const e=l+"/profiles?page=1&limit=999&_mediatype=application/anot%2Bturtle",{data:t}=await pt(e),r=new ht;r.setBaseUrl(l),r.load(t);const s=r.getList(),o={};for(const u of s){let a=[];if(u.properties&&u.properties?.[Ie.shaclProperty]?.objects){const p=u.properties[Ie.shaclProperty].objects;for(const h of p){const x=h;if(x.properties&&x.properties[Ie.shaclPath])for(const T of x.properties[Ie.shaclPath].objects){const j=T.list;j&&(a=j)}}}u.properties?.[Ie.dctermsIdentifier]?.objects?.filter(p=>p?.termType=="Literal"&&p?.datatype?.value==Ie.w3token)?.map(p=>p.value).forEach(p=>{o[p]=a,o[u.value]=a;const h=r.fromIri(u.value);h!=u.value&&(o[h]=a)})}return o}function Si(l,e){const t={},r=Object.keys(l),s=[...(e||[]).filter(o=>r.includes(o.node.value)).map(o=>o.node.value),...r.filter(o=>!(e||[]).find(u=>u.node.value==o))].filter(o=>o in(l||{})).map(o=>l[o]);for(const o of s)e.find(u=>u.node.value==o.predicate.value&&u.list&&u.list.length>0),t[o.predicate.value]=l[o.predicate.value];return t}function Ii(l,e){l.data.properties=Si(l.data.properties||{},e)}me.ANNOTATION_PREDICATES=ci,me.BBLOCK_TYPES=An,me.DEFAULT_PREFIXES=jt,me.PREZ_PREDICATES=Ee,me.RDFStore=ht,me.SYSTEM_PREDICATES=Ie,me.apiGet=pt,me.applyProfileToItem=Ii,me.bnode=gt,me.buildProfiles=_i,me.defaultFromIri=Pn,me.defaultToIri=Nn,me.dumpNodeArray=bi,me.getBaseUrl=jn,me.getItem=mi,me.getList=wi,me.getNarrowersUrl=hi,me.getProfiles=Ei,me.getTopConceptsUrl=pi,me.getUrlPath=di,me.isTypePrezTerm=et,me.literal=bt,me.node=kt,me.nodeArrayToTree=_r,me.processShaclPath=Bt,me.search=xi,me.simplifyNodeArray=dt,Object.defineProperty(me,Symbol.toStringTag,{value:"Module"})}));
|