n3 2.13.5 → 2.13.7

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/browser/n3.min.js CHANGED
@@ -1,8 +1,8 @@
1
- var N3=(()=>{var fu=Object.create;var Ht=Object.defineProperty,cu=Object.defineProperties,hu=Object.getOwnPropertyDescriptor,du=Object.getOwnPropertyDescriptors,_u=Object.getOwnPropertyNames,Qn=Object.getOwnPropertySymbols,pu=Object.getPrototypeOf,Hn=Object.prototype.hasOwnProperty,bu=Object.prototype.propertyIsEnumerable;var ft=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),yu=t=>{throw TypeError(t)};var Vn=(t,e,r)=>e in t?Ht(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e)=>{for(var r in e||(e={}))Hn.call(e,r)&&Vn(t,r,e[r]);if(Qn)for(var r of Qn(e))bu.call(e,r)&&Vn(t,r,e[r]);return t},Oe=(t,e)=>cu(t,du(e));var T=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Kn=(t,e)=>{for(var r in e)Ht(t,r,{get:e[r],enumerable:!0})},Yn=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of _u(e))!Hn.call(t,n)&&n!==r&&Ht(t,n,{get:()=>e[n],enumerable:!(i=hu(e,n))||i.enumerable});return t};var ti=(t,e,r)=>(r=t!=null?fu(pu(t)):{},Yn(e||!t||!t.__esModule?Ht(r,"default",{value:t,enumerable:!0}):r,t)),gu=t=>Yn(Ht({},"__esModule",{value:!0}),t);var q=function(t,e){this[0]=t,this[1]=e},ee=(t,e,r)=>{var i=(a,l,u,f)=>{try{var c=r[a](l),_=(l=c.value)instanceof q,h=c.done;Promise.resolve(_?l[0]:l).then(b=>_?i(a==="return"?a:"next",l[1]?{done:b.done,value:b.value}:b,u,f):u({value:b,done:h})).catch(b=>i("throw",b,u,f))}catch(b){f(b)}},n=(a,l,u,f)=>o[a]=c=>(l=new Promise((_,h,b)=>(b=()=>i(a,c,_,h),s?s.then(b):b())),f=()=>s===u&&(s=0),s=u=l.then(f,f),l),s,o={};return r=r.apply(t,e),o[ft("asyncIterator")]=()=>o,n("next"),n("throw"),n("return"),o},ne=t=>{var e=t[ft("asyncIterator")],r=!1,i,n={};return e==null?(e=t[ft("iterator")](),i=s=>n[s]=o=>e[s](o)):(e=e.call(t),i=s=>n[s]=o=>{if(r){if(r=!1,s==="throw")throw o;return o}return r=!0,{done:!1,value:new q(new Promise(a=>{var l=e[s](o);l instanceof Object||yu("Object expected"),a(l)}),1)}}),n[ft("iterator")]=()=>n,i("next"),"throw"in e?i("throw"):n.throw=s=>{throw s},"return"in e&&i("return"),n},J=(t,e,r)=>(e=t[ft("asyncIterator")])?e.call(t):(t=t[ft("iterator")](),e={},r=(i,n)=>(n=t[i])&&(e[i]=s=>new Promise((o,a,l)=>(s=n.call(t,s),l=s.done,Promise.resolve(s.value).then(u=>o({value:u,done:l}),a)))),r("next"),r("return"),e);var Ts=T(pr=>{"use strict";pr.byteLength=of;pr.toByteArray=lf;pr.fromByteArray=cf;var he=[],te=[],sf=typeof Uint8Array!="undefined"?Uint8Array:Array,_i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ke=0,Is=_i.length;Ke<Is;++Ke)he[Ke]=_i[Ke],te[_i.charCodeAt(Ke)]=Ke;var Ke,Is;te[45]=62;te[95]=63;function Rs(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function of(t){var e=Rs(t),r=e[0],i=e[1];return(r+i)*3/4-i}function af(t,e,r){return(e+r)*3/4-r}function lf(t){var e,r=Rs(t),i=r[0],n=r[1],s=new sf(af(t,i,n)),o=0,a=n>0?i-4:i,l;for(l=0;l<a;l+=4)e=te[t.charCodeAt(l)]<<18|te[t.charCodeAt(l+1)]<<12|te[t.charCodeAt(l+2)]<<6|te[t.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return n===2&&(e=te[t.charCodeAt(l)]<<2|te[t.charCodeAt(l+1)]>>4,s[o++]=e&255),n===1&&(e=te[t.charCodeAt(l)]<<10|te[t.charCodeAt(l+1)]<<4|te[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function uf(t){return he[t>>18&63]+he[t>>12&63]+he[t>>6&63]+he[t&63]}function ff(t,e,r){for(var i,n=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(uf(i));return n.join("")}function cf(t){for(var e,r=t.length,i=r%3,n=[],s=16383,o=0,a=r-i;o<a;o+=s)n.push(ff(t,o,o+s>a?a:o+s));return i===1?(e=t[r-1],n.push(he[e>>2]+he[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(he[e>>10]+he[e>>4&63]+he[e<<2&63]+"=")),n.join("")}});var As=T(pi=>{pi.read=function(t,e,r,i,n){var s,o,a=n*8-i-1,l=(1<<a)-1,u=l>>1,f=-7,c=r?n-1:0,_=r?-1:1,h=t[e+c];for(c+=_,s=h&(1<<-f)-1,h>>=-f,f+=a;f>0;s=s*256+t[e+c],c+=_,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=i;f>0;o=o*256+t[e+c],c+=_,f-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-u}return(h?-1:1)*o*Math.pow(2,s-i)};pi.write=function(t,e,r,i,n,s){var o,a,l,u=s*8-n-1,f=(1<<u)-1,c=f>>1,_=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,b=i?1:-1,d=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?e+=_/l:e+=_*Math.pow(2,1-c),e*l>=2&&(o++,l/=2),o+c>=f?(a=0,o=f):o+c>=1?(a=(e*l-1)*Math.pow(2,n),o=o+c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[r+h]=a&255,h+=b,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;t[r+h]=o&255,h+=b,o/=256,u-=8);t[r+h-b]|=d*128}});var Ne=T(Rt=>{"use strict";var bi=Ts(),St=As(),vs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Rt.Buffer=p;Rt.SlowBuffer=yf;Rt.INSPECT_MAX_BYTES=50;var br=2147483647;Rt.kMaxLength=br;p.TYPED_ARRAY_SUPPORT=hf();!p.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&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 hf(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function ve(t){if(t>br)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}function p(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return wi(t)}return Ls(t,e,r)}p.poolSize=8192;function Ls(t,e,r){if(typeof t=="string")return _f(t,e);if(ArrayBuffer.isView(t))return pf(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(de(t,ArrayBuffer)||t&&de(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(de(t,SharedArrayBuffer)||t&&de(t.buffer,SharedArrayBuffer)))return gi(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return p.from(i,e,r);let n=bf(t);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}p.from=function(t,e,r){return Ls(t,e,r)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function Fs(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function df(t,e,r){return Fs(t),t<=0?ve(t):e!==void 0?typeof r=="string"?ve(t).fill(e,r):ve(t).fill(e):ve(t)}p.alloc=function(t,e,r){return df(t,e,r)};function wi(t){return Fs(t),ve(t<0?0:xi(t)|0)}p.allocUnsafe=function(t){return wi(t)};p.allocUnsafeSlow=function(t){return wi(t)};function _f(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Cs(t,e)|0,i=ve(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function yi(t){let e=t.length<0?0:xi(t.length)|0,r=ve(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function pf(t){if(de(t,Uint8Array)){let e=new Uint8Array(t);return gi(e.buffer,e.byteOffset,e.byteLength)}return yi(t)}function gi(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,p.prototype),i}function bf(t){if(p.isBuffer(t)){let e=xi(t.length)|0,r=ve(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Si(t.length)?ve(0):yi(t);if(t.type==="Buffer"&&Array.isArray(t.data))return yi(t.data)}function xi(t){if(t>=br)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+br.toString(16)+" bytes");return t|0}function yf(t){return+t!=t&&(t=0),p.alloc(+t)}p.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype};p.compare=function(e,r){if(de(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),de(r,Uint8Array)&&(r=p.from(r,r.offset,r.byteLength)),!p.isBuffer(e)||!p.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let s=0,o=Math.min(i,n);s<o;++s)if(e[s]!==r[s]){i=e[s],n=r[s];break}return i<n?-1:n<i?1:0};p.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};p.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=p.allocUnsafe(r),s=0;for(i=0;i<e.length;++i){let o=e[i];if(de(o,Uint8Array))s+o.length>n.length?(p.isBuffer(o)||(o=p.from(o)),o.copy(n,s)):Uint8Array.prototype.set.call(n,o,s);else if(p.isBuffer(o))o.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=o.length}return n};function Cs(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||de(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return mi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Ws(t).length;default:if(n)return i?-1:mi(t).length;e=(""+e).toLowerCase(),n=!0}}p.byteLength=Cs;function gf(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return vf(this,e,r);case"utf8":case"utf-8":return Ds(this,e,r);case"ascii":return Tf(this,e,r);case"latin1":case"binary":return Af(this,e,r);case"base64":return If(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nf(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}p.prototype._isBuffer=!0;function Ye(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}p.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)Ye(this,r,r+1);return this};p.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)Ye(this,r,r+3),Ye(this,r+1,r+2);return this};p.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)Ye(this,r,r+7),Ye(this,r+1,r+6),Ye(this,r+2,r+5),Ye(this,r+3,r+4);return this};p.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Ds(this,0,e):gf.apply(this,arguments)};p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0};p.prototype.inspect=function(){let e="",r=Rt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};vs&&(p.prototype[vs]=p.prototype.inspect);p.prototype.compare=function(e,r,i,n,s){if(de(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),r<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&r>=i)return 0;if(n>=s)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let o=s-n,a=i-r,l=Math.min(o,a),u=this.slice(n,s),f=e.slice(r,i);for(let c=0;c<l;++c)if(u[c]!==f[c]){o=u[c],a=f[c];break}return o<a?-1:a<o?1:0};function Bs(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Si(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,i)),p.isBuffer(e))return e.length===0?-1:Ns(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Ns(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function Ns(t,e,r,i,n){let s=1,o=t.length,a=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,o/=2,a/=2,r/=2}function l(f,c){return s===1?f[c]:f.readUInt16BE(c*s)}let u;if(n){let f=-1;for(u=r;u<o;u++)if(l(t,u)===l(e,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===a)return f*s}else f!==-1&&(u-=u-f),f=-1}else for(r+a>o&&(r=o-a),u=r;u>=0;u--){let f=!0;for(let c=0;c<a;c++)if(l(t,u+c)!==l(e,c)){f=!1;break}if(f)return u}return-1}p.prototype.includes=function(e,r,i){return this.indexOf(e,r,i)!==-1};p.prototype.indexOf=function(e,r,i){return Bs(this,e,r,i,!0)};p.prototype.lastIndexOf=function(e,r,i){return Bs(this,e,r,i,!1)};function mf(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let o;for(o=0;o<i;++o){let a=parseInt(e.substr(o*2,2),16);if(Si(a))return o;t[r+o]=a}return o}function wf(t,e,r,i){return yr(mi(e,t.length-r),t,r,i)}function xf(t,e,r,i){return yr(Ff(e),t,r,i)}function Ef(t,e,r,i){return yr(Ws(e),t,r,i)}function Sf(t,e,r,i){return yr(Cf(e,t.length-r),t,r,i)}p.prototype.write=function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return mf(this,e,r,i);case"utf8":case"utf-8":return wf(this,e,r,i);case"ascii":case"latin1":case"binary":return xf(this,e,r,i);case"base64":return Ef(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Sf(this,e,r,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function If(t,e,r){return e===0&&r===t.length?bi.fromByteArray(t):bi.fromByteArray(t.slice(e,r))}function Ds(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let s=t[n],o=null,a=s>239?4:s>223?3:s>191?2:1;if(n+a<=r){let l,u,f,c;switch(a){case 1:s<128&&(o=s);break;case 2:l=t[n+1],(l&192)===128&&(c=(s&31)<<6|l&63,c>127&&(o=c));break;case 3:l=t[n+1],u=t[n+2],(l&192)===128&&(u&192)===128&&(c=(s&15)<<12|(l&63)<<6|u&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:l=t[n+1],u=t[n+2],f=t[n+3],(l&192)===128&&(u&192)===128&&(f&192)===128&&(c=(s&15)<<18|(l&63)<<12|(u&63)<<6|f&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|o&1023),i.push(o),n+=a}return Rf(i)}var Ps=4096;function Rf(t){let e=t.length;if(e<=Ps)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=Ps));return r}function Tf(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}function Af(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function vf(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let s=e;s<r;++s)n+=Bf[t[s]];return n}function Nf(t,e,r){let i=t.slice(e,r),n="";for(let s=0;s<i.length-1;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}p.prototype.slice=function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,p.prototype),n};function U(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||U(e,r,this.length);let n=this[e],s=1,o=0;for(;++o<r&&(s*=256);)n+=this[e+o]*s;return n};p.prototype.readUintBE=p.prototype.readUIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||U(e,r,this.length);let n=this[e+--r],s=1;for(;r>0&&(s*=256);)n+=this[e+--r]*s;return n};p.prototype.readUint8=p.prototype.readUInt8=function(e,r){return e=e>>>0,r||U(e,1,this.length),this[e]};p.prototype.readUint16LE=p.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||U(e,2,this.length),this[e]|this[e+1]<<8};p.prototype.readUint16BE=p.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||U(e,2,this.length),this[e]<<8|this[e+1]};p.prototype.readUint32LE=p.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};p.prototype.readUint32BE=p.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||U(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};p.prototype.readBigUInt64LE=$e(function(e){e=e>>>0,It(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Jt(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))});p.prototype.readBigUInt64BE=$e(function(e){e=e>>>0,It(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Jt(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(s)});p.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||U(e,r,this.length);let n=this[e],s=1,o=0;for(;++o<r&&(s*=256);)n+=this[e+o]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*r)),n};p.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||U(e,r,this.length);let n=r,s=1,o=this[e+--n];for(;n>0&&(s*=256);)o+=this[e+--n]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*r)),o};p.prototype.readInt8=function(e,r){return e=e>>>0,r||U(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};p.prototype.readInt16LE=function(e,r){e=e>>>0,r||U(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};p.prototype.readInt16BE=function(e,r){e=e>>>0,r||U(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};p.prototype.readInt32LE=function(e,r){return e=e>>>0,r||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};p.prototype.readInt32BE=function(e,r){return e=e>>>0,r||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};p.prototype.readBigInt64LE=$e(function(e){e=e>>>0,It(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Jt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});p.prototype.readBigInt64BE=$e(function(e){e=e>>>0,It(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Jt(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)});p.prototype.readFloatLE=function(e,r){return e=e>>>0,r||U(e,4,this.length),St.read(this,e,!0,23,4)};p.prototype.readFloatBE=function(e,r){return e=e>>>0,r||U(e,4,this.length),St.read(this,e,!1,23,4)};p.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||U(e,8,this.length),St.read(this,e,!0,52,8)};p.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||U(e,8,this.length),St.read(this,e,!1,52,8)};function X(t,e,r,i,n,s){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;X(this,e,r,i,a,0)}let s=1,o=0;for(this[r]=e&255;++o<i&&(s*=256);)this[r+o]=e/s&255;return r+i};p.prototype.writeUintBE=p.prototype.writeUIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;X(this,e,r,i,a,0)}let s=i-1,o=1;for(this[r+s]=e&255;--s>=0&&(o*=256);)this[r+s]=e/o&255;return r+i};p.prototype.writeUint8=p.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,1,255,0),this[r]=e&255,r+1};p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Os(t,e,r,i,n){qs(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function Ms(t,e,r,i,n){qs(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}p.prototype.writeBigUInt64LE=$e(function(e,r=0){return Os(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});p.prototype.writeBigUInt64BE=$e(function(e,r=0){return Ms(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});p.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);X(this,e,r,i,l-1,-l)}let s=0,o=1,a=0;for(this[r]=e&255;++s<i&&(o*=256);)e<0&&a===0&&this[r+s-1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+i};p.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);X(this,e,r,i,l-1,-l)}let s=i-1,o=1,a=0;for(this[r+s]=e&255;--s>=0&&(o*=256);)e<0&&a===0&&this[r+s+1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+i};p.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};p.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};p.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};p.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};p.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};p.prototype.writeBigInt64LE=$e(function(e,r=0){return Os(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});p.prototype.writeBigInt64BE=$e(function(e,r=0){return Ms(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $s(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ks(t,e,r,i,n){return e=+e,r=r>>>0,n||$s(t,e,r,4,34028234663852886e22,-34028234663852886e22),St.write(t,e,r,i,23,4),r+4}p.prototype.writeFloatLE=function(e,r,i){return ks(this,e,r,!0,i)};p.prototype.writeFloatBE=function(e,r,i){return ks(this,e,r,!1,i)};function Us(t,e,r,i,n){return e=+e,r=r>>>0,n||$s(t,e,r,8,17976931348623157e292,-17976931348623157e292),St.write(t,e,r,i,52,8),r+8}p.prototype.writeDoubleLE=function(e,r,i){return Us(this,e,r,!0,i)};p.prototype.writeDoubleBE=function(e,r,i){return Us(this,e,r,!1,i)};p.prototype.copy=function(e,r,i,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let s=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),s};p.prototype.fill=function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let o=e.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{let o=p.isBuffer(e)?e:p.from(e,n),a=o.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-r;++s)this[s+r]=o[s%a]}return this};var Et={};function Ei(t,e,r){Et[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}Ei("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Ei("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Ei("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=js(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=js(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function js(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Pf(t,e,r){It(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Jt(e,t.length-(r+1))}function qs(t,e,r,i,n,s){if(t>r||t<e){let o=typeof e=="bigint"?"n":"",a;throw s>3?e===0||e===BigInt(0)?a=`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:a=`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:a=`>= ${e}${o} and <= ${r}${o}`,new Et.ERR_OUT_OF_RANGE("value",a,t)}Pf(i,n,s)}function It(t,e){if(typeof t!="number")throw new Et.ERR_INVALID_ARG_TYPE(e,"number",t)}function Jt(t,e,r){throw Math.floor(t)!==t?(It(t,r),new Et.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Et.ERR_BUFFER_OUT_OF_BOUNDS:new Et.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var jf=/[^+/0-9A-Za-z-_]/g;function Lf(t){if(t=t.split("=")[0],t=t.trim().replace(jf,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function mi(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Ff(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Cf(t,e){let r,i,n,s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}function Ws(t){return bi.toByteArray(Lf(t))}function yr(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function de(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Si(t){return t!==t}var Bf=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e})();function $e(t){return typeof BigInt=="undefined"?Df:t}function Df(){throw new Error("BigInt not supported")}});var F=T((Ub,Gs)=>{"use strict";var Ii=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let i=0;i<e.length;i++)r+=` ${e[i].stack}
2
- `;super(r),this.name="AggregateError",this.errors=e}};Gs.exports={AggregateError:Ii,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},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(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.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(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var Ri=T((qb,zs)=>{"use strict";zs.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}});var V=T((Wb,Hs)=>{"use strict";var{format:Of,inspect:gr}=Ri(),{AggregateError:Mf}=F(),$f=globalThis.AggregateError||Mf,kf=Symbol("kIsNodeError"),Uf=["string","function","number","object","Function","Object","boolean","bigint","symbol"],qf=/^([A-Z][a-z0-9]*)+$/,Wf="__node_internal_",mr={};function Je(t,e){if(!t)throw new mr.ERR_INTERNAL_ASSERTION(e)}function Qs(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Gf(t,e,r){if(typeof e=="function")return Je(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return Je(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:Of(e,...r)}function G(t,e,r){r||(r=Error);class i extends r{constructor(...s){super(Gf(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[kf]=!0,mr[t]=i}function Vs(t){let e=Wf+t.name;return Object.defineProperty(t,"name",{value:e}),t}function zf(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new $f([e,t],e.message);return r.code=e.code,r}return t||e}var Ti=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new mr.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};G("ERR_ASSERTION","%s",Error);G("ERR_INVALID_ARG_TYPE",(t,e,r)=>{Je(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let n=[],s=[],o=[];for(let l of e)Je(typeof l=="string","All expected entries have to be of type string"),Uf.includes(l)?n.push(l.toLowerCase()):qf.test(l)?s.push(l):(Je(l!=="object",'The value "object" should be written as "Object"'),o.push(l));if(s.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,1),s.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();i+=`one of type ${n.join(", ")}, or ${l}`}}(s.length>0||o.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();i+=`an instance of ${s.join(", ")}, or ${l}`}}o.length>0&&(i+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(i+="an "),i+=`${o[0]}`;break;case 2:i+=`one of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();i+=`one of ${o.join(", ")}, or ${l}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${r.constructor.name}`;else{let l=gr(r,{depth:-1});i+=`. Received ${l}`}}else{let l=gr(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),i+=`. Received type ${typeof r} (${l})`}return i},TypeError);G("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let i=gr(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`},TypeError);G("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);G("ERR_MISSING_ARGS",(...t)=>{Je(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);G("ERR_OUT_OF_RANGE",(t,e,r)=>{Je(e,'Missing "range" argument');let i;if(Number.isInteger(r)&&Math.abs(r)>2**32)i=Qs(String(r));else if(typeof r=="bigint"){i=String(r);let n=BigInt(2)**BigInt(32);(r>n||r<-n)&&(i=Qs(i)),i+="n"}else i=gr(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);G("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);G("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);G("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);G("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);G("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);G("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);G("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);G("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);G("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);G("ERR_STREAM_WRITE_AFTER_END","write after end",Error);G("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Hs.exports={AbortError:Ti,aggregateTwoErrors:Vs(zf),hideStackFrames:Vs,codes:mr}});var Tt=T((Gb,wr)=>{"use strict";var{AbortController:Ks,AbortSignal:Qf}=typeof self!="undefined"?self:typeof window!="undefined"?window:void 0;wr.exports=Ks;wr.exports.AbortSignal=Qf;wr.exports.default=Ks});var Xt=T((zb,Ai)=>{"use strict";var At=typeof Reflect=="object"?Reflect:null,Ys=At&&typeof At.apply=="function"?At.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},xr;At&&typeof At.ownKeys=="function"?xr=At.ownKeys:Object.getOwnPropertySymbols?xr=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:xr=function(e){return Object.getOwnPropertyNames(e)};function Vf(t){console&&console.warn&&console.warn(t)}var Xs=Number.isNaN||function(e){return e!==e};function v(){v.init.call(this)}Ai.exports=v;Ai.exports.once=Jf;v.EventEmitter=v;v.prototype._events=void 0;v.prototype._eventsCount=0;v.prototype._maxListeners=void 0;var Js=10;function Er(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return Js},set:function(t){if(typeof t!="number"||t<0||Xs(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Js=t}});v.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};v.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Xs(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Zs(t){return t._maxListeners===void 0?v.defaultMaxListeners:t._maxListeners}v.prototype.getMaxListeners=function(){return Zs(this)};v.prototype.emit=function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")Ys(l,this,r);else for(var u=l.length,f=no(l,u),i=0;i<u;++i)Ys(f[i],this,r);return!0};function eo(t,e,r,i){var n,s,o;if(Er(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),n=Zs(t),n>0&&o.length>n&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,Vf(a)}return t}v.prototype.addListener=function(e,r){return eo(this,e,r,!1)};v.prototype.on=v.prototype.addListener;v.prototype.prependListener=function(e,r){return eo(this,e,r,!0)};function Hf(){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 to(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Hf.bind(i);return n.listener=r,i.wrapFn=n,n}v.prototype.once=function(e,r){return Er(r),this.on(e,to(this,e,r)),this};v.prototype.prependOnceListener=function(e,r){return Er(r),this.prependListener(e,to(this,e,r)),this};v.prototype.removeListener=function(e,r){var i,n,s,o,a;if(Er(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(s=-1,o=i.length-1;o>=0;o--)if(i[o]===r||i[o].listener===r){a=i[o].listener,s=o;break}if(s<0)return this;s===0?i.shift():Kf(i,s),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};v.prototype.off=v.prototype.removeListener;v.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),o;for(n=0;n<s.length;++n)o=s[n],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this};function ro(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?Yf(n):no(n,n.length)}v.prototype.listeners=function(e){return ro(this,e,!0)};v.prototype.rawListeners=function(e){return ro(this,e,!1)};v.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):io.call(t,e)};v.prototype.listenerCount=io;function io(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}v.prototype.eventNames=function(){return this._eventsCount>0?xr(this._events):[]};function no(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function Kf(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function Yf(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Jf(t,e){return new Promise(function(r,i){function n(o){t.removeListener(e,s),i(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}so(t,e,s,{once:!0}),e!=="error"&&Xf(t,n,{once:!0})})}function Xf(t,e,r){typeof t.on=="function"&&so(t,"error",e,r)}function so(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function n(s){i.once&&t.removeEventListener(e,n),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var Y=T((Qb,Ni)=>{"use strict";var Zf=Ne(),{format:ec,inspect:tc}=Ri(),{codes:{ERR_INVALID_ARG_TYPE:vi}}=V(),{kResistStopPropagation:rc,AggregateError:ic,SymbolDispose:nc}=F(),sc=globalThis.AbortSignal||Tt().AbortSignal,oc=globalThis.AbortController||Tt().AbortController,ac=Object.getPrototypeOf(async function(){}).constructor,oo=globalThis.Blob||Zf.Blob,lc=typeof oo!="undefined"?function(e){return e instanceof oo}:function(e){return!1},ao=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new vi(e,"AbortSignal",t)},uc=(t,e)=>{if(typeof t!="function")throw new vi(e,"Function",t)};Ni.exports={AggregateError:ic,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,n)=>{t=i,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n))})},debuglog(){return function(){}},format:ec,inspect:tc,types:{isAsyncFunction(t){return t instanceof ac},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:lc,deprecate(t,e){return t},addAbortListener:Xt().addAbortListener||function(e,r){if(e===void 0)throw new vi("signal","AbortSignal",e);ao(e,"signal"),uc(r,"listener");let i;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[rc]:!0}),i=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[nc](){var n;(n=i)===null||n===void 0||n()}}},AbortSignalAny:sc.any||function(e){if(e.length===1)return e[0];let r=new oc,i=()=>r.abort();return e.forEach(n=>{ao(n,"signals"),n.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),r.signal}};Ni.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Nt=T((Vb,go)=>{"use strict";var{ArrayIsArray:ji,ArrayPrototypeIncludes:co,ArrayPrototypeJoin:ho,ArrayPrototypeMap:fc,NumberIsInteger:Li,NumberIsNaN:cc,NumberMAX_SAFE_INTEGER:hc,NumberMIN_SAFE_INTEGER:dc,NumberParseInt:_c,ObjectPrototypeHasOwnProperty:pc,RegExpPrototypeExec:_o,String:bc,StringPrototypeToUpperCase:yc,StringPrototypeTrim:gc}=F(),{hideStackFrames:re,codes:{ERR_SOCKET_BAD_PORT:mc,ERR_INVALID_ARG_TYPE:H,ERR_INVALID_ARG_VALUE:vt,ERR_OUT_OF_RANGE:Xe,ERR_UNKNOWN_SIGNAL:lo}}=V(),{normalizeEncoding:wc}=Y(),{isAsyncFunction:xc,isArrayBufferView:Ec}=Y().types,uo={};function Sc(t){return t===(t|0)}function Ic(t){return t===t>>>0}var Rc=/^[0-7]+$/,Tc="must be a 32-bit unsigned integer or an octal string";function Ac(t,e,r){if(typeof t=="undefined"&&(t=r),typeof t=="string"){if(_o(Rc,t)===null)throw new vt(e,t,Tc);t=_c(t,8)}return po(t,e),t}var vc=re((t,e,r=dc,i=hc)=>{if(typeof t!="number")throw new H(e,"number",t);if(!Li(t))throw new Xe(e,"an integer",t);if(t<r||t>i)throw new Xe(e,`>= ${r} && <= ${i}`,t)}),Nc=re((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new H(e,"number",t);if(!Li(t))throw new Xe(e,"an integer",t);if(t<r||t>i)throw new Xe(e,`>= ${r} && <= ${i}`,t)}),po=re((t,e,r=!1)=>{if(typeof t!="number")throw new H(e,"number",t);if(!Li(t))throw new Xe(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new Xe(e,`>= ${i} && <= ${n}`,t)});function Fi(t,e){if(typeof t!="string")throw new H(e,"string",t)}function Pc(t,e,r=void 0,i){if(typeof t!="number")throw new H(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&cc(t))throw new Xe(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}var jc=re((t,e,r)=>{if(!co(r,t)){let n="must be one of: "+ho(fc(r,s=>typeof s=="string"?`'${s}'`:bc(s)),", ");throw new vt(e,t,n)}});function bo(t,e){if(typeof t!="boolean")throw new H(e,"boolean",t)}function Pi(t,e,r){return t==null||!pc(t,e)?r:t[e]}var Lc=re((t,e,r=null)=>{let i=Pi(r,"allowArray",!1),n=Pi(r,"allowFunction",!1);if(!Pi(r,"nullable",!1)&&t===null||!i&&ji(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new H(e,"Object",t)}),Fc=re((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new H(e,"a dictionary",t)}),Sr=re((t,e,r=0)=>{if(!ji(t))throw new H(e,"Array",t);if(t.length<r){let i=`must be longer than ${r}`;throw new vt(e,t,i)}});function Cc(t,e){Sr(t,e);for(let r=0;r<t.length;r++)Fi(t[r],`${e}[${r}]`)}function Bc(t,e){Sr(t,e);for(let r=0;r<t.length;r++)bo(t[r],`${e}[${r}]`)}function Dc(t,e){Sr(t,e);for(let r=0;r<t.length;r++){let i=t[r],n=`${e}[${r}]`;if(i==null)throw new H(n,"AbortSignal",i);yo(i,n)}}function Oc(t,e="signal"){if(Fi(t,e),uo[t]===void 0)throw uo[yc(t)]!==void 0?new lo(t+" (signals must use all capital letters)"):new lo(t)}var Mc=re((t,e="buffer")=>{if(!Ec(t))throw new H(e,["Buffer","TypedArray","DataView"],t)});function $c(t,e){let r=wc(e),i=t.length;if(r==="hex"&&i%2!==0)throw new vt("encoding",e,`is invalid for data of length ${i}`)}function kc(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&gc(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new mc(e,t,r);return t|0}var yo=re((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new H(e,"AbortSignal",t)}),Uc=re((t,e)=>{if(typeof t!="function")throw new H(e,"Function",t)}),qc=re((t,e)=>{if(typeof t!="function"||xc(t))throw new H(e,"Function",t)}),Wc=re((t,e)=>{if(t!==void 0)throw new H(e,"undefined",t)});function Gc(t,e,r){if(!co(r,t))throw new H(e,`('${ho(r,"|")}')`,t)}var zc=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function fo(t,e){if(typeof t=="undefined"||!_o(zc,t))throw new vt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Qc(t){if(typeof t=="string")return fo(t,"hints"),t;if(ji(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];fo(n,"hints"),r+=n,i!==e-1&&(r+=", ")}return r}throw new vt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}go.exports={isInt32:Sc,isUint32:Ic,parseFileMode:Ac,validateArray:Sr,validateStringArray:Cc,validateBooleanArray:Bc,validateAbortSignalArray:Dc,validateBoolean:bo,validateBuffer:Mc,validateDictionary:Fc,validateEncoding:$c,validateFunction:Uc,validateInt32:Nc,validateInteger:vc,validateNumber:Pc,validateObject:Lc,validateOneOf:jc,validatePlainFunction:qc,validatePort:kc,validateSignalName:Oc,validateString:Fi,validateUint32:po,validateUndefined:Wc,validateUnion:Gc,validateAbortSignal:yo,validateLinkHeaderValue:Qc}});var ke=T((Hb,Eo)=>{var D=Eo.exports={},_e,pe;function Ci(){throw new Error("setTimeout has not been defined")}function Bi(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?_e=setTimeout:_e=Ci}catch(t){_e=Ci}try{typeof clearTimeout=="function"?pe=clearTimeout:pe=Bi}catch(t){pe=Bi}})();function mo(t){if(_e===setTimeout)return setTimeout(t,0);if((_e===Ci||!_e)&&setTimeout)return _e=setTimeout,setTimeout(t,0);try{return _e(t,0)}catch(e){try{return _e.call(null,t,0)}catch(r){return _e.call(this,t,0)}}}function Vc(t){if(pe===clearTimeout)return clearTimeout(t);if((pe===Bi||!pe)&&clearTimeout)return pe=clearTimeout,clearTimeout(t);try{return pe(t)}catch(e){try{return pe.call(null,t)}catch(r){return pe.call(this,t)}}}var Pe=[],Pt=!1,Ze,Ir=-1;function Hc(){!Pt||!Ze||(Pt=!1,Ze.length?Pe=Ze.concat(Pe):Ir=-1,Pe.length&&wo())}function wo(){if(!Pt){var t=mo(Hc);Pt=!0;for(var e=Pe.length;e;){for(Ze=Pe,Pe=[];++Ir<e;)Ze&&Ze[Ir].run();Ir=-1,e=Pe.length}Ze=null,Pt=!1,Vc(t)}}D.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Pe.push(new xo(t,e)),Pe.length===1&&!Pt&&mo(wo)};function xo(t,e){this.fun=t,this.array=e}xo.prototype.run=function(){this.fun.apply(null,this.array)};D.title="browser";D.browser=!0;D.env={};D.argv=[];D.version="";D.versions={};function je(){}D.on=je;D.addListener=je;D.once=je;D.off=je;D.removeListener=je;D.removeAllListeners=je;D.emit=je;D.prependListener=je;D.prependOnceListener=je;D.listeners=function(t){return[]};D.binding=function(t){throw new Error("process.binding is not supported")};D.cwd=function(){return"/"};D.chdir=function(t){throw new Error("process.chdir is not supported")};D.umask=function(){return 0}});var ye=T((Kb,Oo)=>{"use strict";var{SymbolAsyncIterator:So,SymbolIterator:Io,SymbolFor:et}=F(),Ro=et("nodejs.stream.destroyed"),To=et("nodejs.stream.errored"),Di=et("nodejs.stream.readable"),Oi=et("nodejs.stream.writable"),Ao=et("nodejs.stream.disturbed"),Kc=et("nodejs.webstream.isClosedPromise"),Yc=et("nodejs.webstream.controllerErrorFunction");function Rr(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function Tr(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function Jc(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function be(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function vo(t){return!!(t&&!be(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function No(t){return!!(t&&!be(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function Po(t){return!!(t&&!be(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function Xc(t){return vo(t)||No(t)||Po(t)}function Zc(t,e){return t==null?!1:e===!0?typeof t[So]=="function":e===!1?typeof t[Io]=="function":typeof t[So]=="function"||typeof t[Io]=="function"}function Ar(t){if(!be(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!!(t.destroyed||t[Ro]||i!=null&&i.destroyed)}function jo(t){if(!Tr(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function eh(t,e){if(!Tr(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function th(t){if(!Rr(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function Lo(t,e){if(!Rr(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function Fo(t){return t&&t[Di]!=null?t[Di]:typeof(t==null?void 0:t.readable)!="boolean"?null:Ar(t)?!1:Rr(t)&&t.readable&&!Lo(t)}function Co(t){return t&&t[Oi]!=null?t[Oi]:typeof(t==null?void 0:t.writable)!="boolean"?null:Ar(t)?!1:Tr(t)&&t.writable&&!jo(t)}function rh(t,e){return be(t)?Ar(t)?!0:!((e==null?void 0:e.readable)!==!1&&Fo(t)||(e==null?void 0:e.writable)!==!1&&Co(t)):null}function ih(t){var e,r;return be(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function nh(t){var e,r;return be(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function sh(t){if(!be(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof(e==null?void 0:e.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(e==null?void 0:e.closed)||(r==null?void 0:r.closed):typeof t._closed=="boolean"&&Bo(t)?t._closed:null}function Bo(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Do(t){return typeof t._sent100=="boolean"&&Bo(t)}function oh(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function ah(t){if(!be(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!i&&Do(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function lh(t){var e;return!!(t&&((e=t[Ao])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function uh(t){var e,r,i,n,s,o,a,l,u,f;return!!(t&&((e=(r=(i=(n=(s=(o=t[To])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&n!==void 0?n:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((f=t._writableState)===null||f===void 0)&&f.errored))}Oo.exports={isDestroyed:Ar,kIsDestroyed:Ro,isDisturbed:lh,kIsDisturbed:Ao,isErrored:uh,kIsErrored:To,isReadable:Fo,kIsReadable:Di,kIsClosedPromise:Kc,kControllerErrorFunction:Yc,kIsWritable:Oi,isClosed:sh,isDuplexNodeStream:Jc,isFinished:rh,isIterable:Zc,isReadableNodeStream:Rr,isReadableStream:vo,isReadableEnded:th,isReadableFinished:Lo,isReadableErrored:nh,isNodeStream:be,isWebStream:Xc,isWritable:Co,isWritableNodeStream:Tr,isWritableStream:No,isWritableEnded:jo,isWritableFinished:eh,isWritableErrored:ih,isServerRequest:oh,isServerResponse:Do,willEmitClose:ah,isTransformStream:Po}});var Le=T((Yb,qi)=>{"use strict";var Ue=ke(),{AbortError:Qo,codes:fh}=V(),{ERR_INVALID_ARG_TYPE:ch,ERR_STREAM_PREMATURE_CLOSE:Mo}=fh,{kEmptyObject:$i,once:ki}=Y(),{validateAbortSignal:hh,validateFunction:dh,validateObject:_h,validateBoolean:ph}=Nt(),{Promise:bh,PromisePrototypeThen:yh,SymbolDispose:Vo}=F(),{isClosed:gh,isReadable:$o,isReadableNodeStream:Mi,isReadableStream:mh,isReadableFinished:ko,isReadableErrored:Uo,isWritable:qo,isWritableNodeStream:Wo,isWritableStream:wh,isWritableFinished:Go,isWritableErrored:zo,isNodeStream:xh,willEmitClose:Eh,kIsClosedPromise:Sh}=ye(),jt;function Ih(t){return t.setHeader&&typeof t.abort=="function"}var Ui=()=>{};function Ho(t,e,r){var i,n;if(arguments.length===2?(r=e,e=$i):e==null?e=$i:_h(e,"options"),dh(r,"callback"),hh(e.signal,"options.signal"),r=ki(r),mh(t)||wh(t))return Rh(t,e,r);if(!xh(t))throw new ch("stream",["ReadableStream","WritableStream","Stream"],t);let s=(i=e.readable)!==null&&i!==void 0?i:Mi(t),o=(n=e.writable)!==null&&n!==void 0?n:Wo(t),a=t._writableState,l=t._readableState,u=()=>{t.writable||_()},f=Eh(t)&&Mi(t)===s&&Wo(t)===o,c=Go(t,!1),_=()=>{c=!0,t.destroyed&&(f=!1),!(f&&(!t.readable||s))&&(!s||h)&&r.call(t)},h=ko(t,!1),b=()=>{h=!0,t.destroyed&&(f=!1),!(f&&(!t.writable||o))&&(!o||c)&&r.call(t)},d=x=>{r.call(t,x)},y=gh(t),g=()=>{y=!0;let x=zo(t)||Uo(t);if(x&&typeof x!="boolean")return r.call(t,x);if(s&&!h&&Mi(t,!0)&&!ko(t,!1))return r.call(t,new Mo);if(o&&!c&&!Go(t,!1))return r.call(t,new Mo);r.call(t)},S=()=>{y=!0;let x=zo(t)||Uo(t);if(x&&typeof x!="boolean")return r.call(t,x);r.call(t)},m=()=>{t.req.on("finish",_)};Ih(t)?(t.on("complete",_),f||t.on("abort",g),t.req?m():t.on("request",m)):o&&!a&&(t.on("end",u),t.on("close",u)),!f&&typeof t.aborted=="boolean"&&t.on("aborted",g),t.on("end",b),t.on("finish",_),e.error!==!1&&t.on("error",d),t.on("close",g),y?Ue.nextTick(g):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?f||Ue.nextTick(S):(!s&&(!f||$o(t))&&(c||qo(t)===!1)||!o&&(!f||qo(t))&&(h||$o(t)===!1)||l&&t.req&&t.aborted)&&Ue.nextTick(S);let w=()=>{r=Ui,t.removeListener("aborted",g),t.removeListener("complete",_),t.removeListener("abort",g),t.removeListener("request",m),t.req&&t.req.removeListener("finish",_),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",_),t.removeListener("end",b),t.removeListener("error",d),t.removeListener("close",g)};if(e.signal&&!y){let x=()=>{let A=r;w(),A.call(t,new Qo(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Ue.nextTick(x);else{jt=jt||Y().addAbortListener;let A=jt(e.signal,x),E=r;r=ki((...B)=>{A[Vo](),E.apply(t,B)})}}return w}function Rh(t,e,r){let i=!1,n=Ui;if(e.signal)if(n=()=>{i=!0,r.call(t,new Qo(void 0,{cause:e.signal.reason}))},e.signal.aborted)Ue.nextTick(n);else{jt=jt||Y().addAbortListener;let o=jt(e.signal,n),a=r;r=ki((...l)=>{o[Vo](),a.apply(t,l)})}let s=(...o)=>{i||Ue.nextTick(()=>r.apply(t,o))};return yh(t[Sh].promise,s,s),Ui}function Th(t,e){var r;let i=!1;return e===null&&(e=$i),(r=e)!==null&&r!==void 0&&r.cleanup&&(ph(e.cleanup,"cleanup"),i=e.cleanup),new bh((n,s)=>{let o=Ho(t,e,a=>{i&&o(),a?s(a):n()})})}qi.exports=Ho;qi.exports.finished=Th});var tt=T((Jb,ra)=>{"use strict";var ge=ke(),{aggregateTwoErrors:Ah,codes:{ERR_MULTIPLE_CALLBACK:vh},AbortError:Nh}=V(),{Symbol:Jo}=F(),{kIsDestroyed:Ph,isDestroyed:jh,isFinished:Lh,isServerRequest:Fh}=ye(),Xo=Jo("kDestroy"),Wi=Jo("kConstruct");function Zo(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Ch(t,e){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(Zo(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?Ko(this,t,e):this.once(Xo,function(s){Ko(this,Ah(s,t),e)}),this)}function Ko(t,e,r){let i=!1;function n(s){if(i)return;i=!0;let o=t._readableState,a=t._writableState;Zo(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?ge.nextTick(Bh,t,s):ge.nextTick(ea,t)}try{t._destroy(e||null,n)}catch(s){n(s)}}function Bh(t,e){Gi(t,e),ea(t)}function ea(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function Gi(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function Dh(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function zi(t,e,r){let i=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),r?ge.nextTick(Gi,t,e):Gi(t,e))}function Oh(t,e){if(typeof t._construct!="function")return;let r=t._readableState,i=t._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),t.once(Wi,e),!(t.listenerCount(Wi)>1)&&ge.nextTick(Mh,t)}function Mh(t){let e=!1;function r(i){if(e){zi(t,i!=null?i:new vh);return}e=!0;let n=t._readableState,s=t._writableState,o=s||n;n&&(n.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(Xo,i):i?zi(t,i,!0):ge.nextTick($h,t)}try{t._construct(i=>{ge.nextTick(r,i)})}catch(i){ge.nextTick(r,i)}}function $h(t){t.emit(Wi)}function Yo(t){return(t==null?void 0:t.setHeader)&&typeof t.abort=="function"}function ta(t){t.emit("close")}function kh(t,e){t.emit("error",e),ge.nextTick(ta,t)}function Uh(t,e){!t||jh(t)||(!e&&!Lh(t)&&(e=new Nh),Fh(t)?(t.socket=null,t.destroy(e)):Yo(t)?t.abort():Yo(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?ge.nextTick(kh,t,e):ge.nextTick(ta,t),t.destroyed||(t[Ph]=!0))}ra.exports={construct:Oh,destroyer:Uh,destroy:Ch,undestroy:Dh,errorOrDestroy:zi}});var Pr=T((Xb,na)=>{"use strict";var{ArrayIsArray:qh,ObjectSetPrototypeOf:ia}=F(),{EventEmitter:vr}=Xt();function Nr(t){vr.call(this,t)}ia(Nr.prototype,vr.prototype);ia(Nr,vr);Nr.prototype.pipe=function(t,e){let r=this;function i(f){t.writable&&t.write(f)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",a));let s=!1;function o(){s||(s=!0,t.end())}function a(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function l(f){u(),vr.listenerCount(this,"error")===0&&this.emit("error",f)}Qi(r,"error",l),Qi(t,"error",l);function u(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t};function Qi(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):qh(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}na.exports={Stream:Nr,prependListener:Qi}});var Zt=T((Zb,jr)=>{"use strict";var{SymbolDispose:Wh}=F(),{AbortError:sa,codes:Gh}=V(),{isNodeStream:oa,isWebStream:zh,kControllerErrorFunction:Qh}=ye(),Vh=Le(),{ERR_INVALID_ARG_TYPE:aa}=Gh,Vi,Hh=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new aa(e,"AbortSignal",t)};jr.exports.addAbortSignal=function(e,r){if(Hh(e,"signal"),!oa(r)&&!zh(r))throw new aa("stream",["ReadableStream","WritableStream","Stream"],r);return jr.exports.addAbortSignalNoValidate(e,r)};jr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=oa(e)?()=>{e.destroy(new sa(void 0,{cause:t.reason}))}:()=>{e[Qh](new sa(void 0,{cause:t.reason}))};if(t.aborted)r();else{Vi=Vi||Y().addAbortListener;let i=Vi(t,r);Vh(e,i[Wh])}return e}});var fa=T((ty,ua)=>{"use strict";var{StringPrototypeSlice:la,SymbolIterator:Kh,TypedArrayPrototypeSet:Lr,Uint8Array:Yh}=F(),{Buffer:Hi}=Ne(),{inspect:Jh}=Y();ua.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=e+r.data;return i}concat(e){if(this.length===0)return Hi.alloc(0);let r=Hi.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)Lr(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(e,r){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Kh](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",i=this.head,n=0;do{let s=i.data;if(e>s.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=la(s,0,e),this.head=i,i.data=la(s,e));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(e){let r=Hi.allocUnsafe(e),i=e,n=this.head,s=0;do{let o=n.data;if(e>o.length)Lr(r,o,i-e),e-=o.length;else{e===o.length?(Lr(r,o,i-e),++s,n.next?this.head=n.next:this.head=this.tail=null):(Lr(r,new Yh(o.buffer,o.byteOffset,e),i-e),this.head=n,n.data=o.slice(e));break}++s}while((n=n.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Jh(this,Oe(M({},r),{depth:0,customInspect:!1}))}}});var er=T((iy,_a)=>{"use strict";var{MathFloor:Xh,NumberIsInteger:Zh}=F(),{validateInteger:ed}=Nt(),{ERR_INVALID_ARG_VALUE:td}=V().codes,ca=16*1024,ha=16;function rd(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function da(t){return t?ha:ca}function id(t,e){ed(e,"value",0),t?ha=e:ca=e}function nd(t,e,r,i){let n=rd(e,i,r);if(n!=null){if(!Zh(n)||n<0){let s=i?`options.${r}`:"options.highWaterMark";throw new td(s,n)}return Xh(n)}return da(t.objectMode)}_a.exports={getHighWaterMark:nd,getDefaultHighWaterMark:da,setDefaultHighWaterMark:id}});var ya=T((Ki,ba)=>{var Fr=Ne(),me=Fr.Buffer;function pa(t,e){for(var r in t)e[r]=t[r]}me.from&&me.alloc&&me.allocUnsafe&&me.allocUnsafeSlow?ba.exports=Fr:(pa(Fr,Ki),Ki.Buffer=rt);function rt(t,e,r){return me(t,e,r)}rt.prototype=Object.create(me.prototype);pa(me,rt);rt.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return me(t,e,r)};rt.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=me(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};rt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return me(t)};rt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fr.SlowBuffer(t)}});var wa=T(ma=>{"use strict";var Ji=ya().Buffer,ga=Ji.isEncoding||function(t){switch(t=""+t,t&&t.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 sd(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function od(t){var e=sd(t);if(typeof e!="string"&&(Ji.isEncoding===ga||!ga(t)))throw new Error("Unknown encoding: "+t);return e||t}ma.StringDecoder=tr;function tr(t){this.encoding=od(t);var e;switch(this.encoding){case"utf16le":this.text=hd,this.end=dd,e=4;break;case"utf8":this.fillLast=ud,e=4;break;case"base64":this.text=_d,this.end=pd,e=3;break;default:this.write=bd,this.end=yd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ji.allocUnsafe(e)}tr.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};tr.prototype.end=cd;tr.prototype.text=fd;tr.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Yi(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function ad(t,e,r){var i=e.length-1;if(i<r)return 0;var n=Yi(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=Yi(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=Yi(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function ld(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function ud(t){var e=this.lastTotal-this.lastNeed,r=ld(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function fd(t,e){var r=ad(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function cd(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function hd(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function dd(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function _d(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function pd(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function bd(t){return t.toString(this.encoding)}function yd(t){return t&&t.length?this.write(t):""}});var Xi=T((sy,Ia)=>{"use strict";var xa=ke(),{PromisePrototypeThen:gd,SymbolAsyncIterator:Ea,SymbolIterator:Sa}=F(),{Buffer:md}=Ne(),{ERR_INVALID_ARG_TYPE:wd,ERR_STREAM_NULL_VALUES:xd}=V().codes;function Ed(t,e,r){let i;if(typeof e=="string"||e instanceof md)return new t(Oe(M({objectMode:!0},r),{read(){this.push(e),this.push(null)}}));let n;if(e&&e[Ea])n=!0,i=e[Ea]();else if(e&&e[Sa])n=!1,i=e[Sa]();else throw new wd("iterable",["Iterable"],e);let s=new t(M({objectMode:!0,highWaterMark:1},r)),o=!1;s._read=function(){o||(o=!0,l())},s._destroy=function(u,f){gd(a(u),()=>xa.nextTick(f,u),c=>xa.nextTick(f,c||u))};async function a(u){let f=u!=null,c=typeof i.throw=="function";if(f&&c){let{value:_,done:h}=await i.throw(u);if(await _,h)return}if(typeof i.return=="function"){let{value:_}=await i.return();await _}}async function l(){for(;;){try{let{value:u,done:f}=n?await i.next():i.next();if(f)s.push(null);else{let c=u&&typeof u.then=="function"?await u:u;if(c===null)throw o=!1,new xd;if(s.push(c))continue;o=!1}}catch(u){s.destroy(u)}break}}return s}Ia.exports=Ed});var ir=T((ay,qa)=>{"use strict";var ae=ke(),{ArrayPrototypeIndexOf:Sd,NumberIsInteger:Id,NumberIsNaN:Rd,NumberParseInt:Td,ObjectDefineProperties:an,ObjectKeys:Ad,ObjectSetPrototypeOf:Aa,Promise:va,SafeSet:vd,SymbolAsyncDispose:Nd,SymbolAsyncIterator:Pd,Symbol:jd}=F();qa.exports=I;I.ReadableState=Or;var{EventEmitter:Ld}=Xt(),{Stream:qe,prependListener:Fd}=Pr(),{Buffer:Zi}=Ne(),{addAbortSignal:Cd}=Zt(),Na=Le(),R=Y().debuglog("stream",t=>{R=t}),Bd=fa(),Ct=tt(),{getHighWaterMark:Dd,getDefaultHighWaterMark:Od}=er(),{aggregateTwoErrors:Ra,codes:{ERR_INVALID_ARG_TYPE:Md,ERR_METHOD_NOT_IMPLEMENTED:$d,ERR_OUT_OF_RANGE:kd,ERR_STREAM_PUSH_AFTER_EOF:Ud,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:qd},AbortError:Wd}=V(),{validateObject:Gd}=Nt(),it=jd("kPaused"),{StringDecoder:Pa}=wa(),zd=Xi();Aa(I.prototype,qe.prototype);Aa(I,qe);var en=()=>{},{errorOrDestroy:Lt}=Ct,Ft=1,Qd=2,ja=4,rr=8,La=16,Cr=32,Br=64,Fa=128,Vd=256,Hd=512,Kd=1024,sn=2048,on=4096,Yd=8192,Jd=16384,Xd=32768,Ca=65536,Zd=1<<17,e_=1<<18;function $(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}an(Or.prototype,{objectMode:$(Ft),ended:$(Qd),endEmitted:$(ja),reading:$(rr),constructed:$(La),sync:$(Cr),needReadable:$(Br),emittedReadable:$(Fa),readableListening:$(Vd),resumeScheduled:$(Hd),errorEmitted:$(Kd),emitClose:$(sn),autoDestroy:$(on),destroyed:$(Yd),closed:$(Jd),closeEmitted:$(Xd),multiAwaitDrain:$(Ca),readingMore:$(Zd),dataEmitted:$(e_)});function Or(t,e,r){typeof r!="boolean"&&(r=e instanceof we()),this.state=sn|on|La|Cr,t&&t.objectMode&&(this.state|=Ft),r&&t&&t.readableObjectMode&&(this.state|=Ft),this.highWaterMark=t?Dd(this,t,"readableHighWaterMark",r):Od(!1),this.buffer=new Bd,this.length=0,this.pipes=[],this.flowing=null,this[it]=null,t&&t.emitClose===!1&&(this.state&=~sn),t&&t.autoDestroy===!1&&(this.state&=~on),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new Pa(t.encoding),this.encoding=t.encoding)}function I(t){if(!(this instanceof I))return new I(t);let e=this instanceof we();this._readableState=new Or(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Cd(t.signal,this)),qe.call(this,t),Ct.construct(this,()=>{this._readableState.needReadable&&Dr(this,this._readableState)})}I.prototype.destroy=Ct.destroy;I.prototype._undestroy=Ct.undestroy;I.prototype._destroy=function(t,e){e(t)};I.prototype[Ld.captureRejectionSymbol]=function(t){this.destroy(t)};I.prototype[Nd]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Wd,this.destroy(t)),new va((e,r)=>Na(this,i=>i&&i!==t?r(i):e(null)))};I.prototype.push=function(t,e){return Ba(this,t,e,!1)};I.prototype.unshift=function(t,e){return Ba(this,t,e,!0)};function Ba(t,e,r,i){R("readableAddChunk",e);let n=t._readableState,s;if((n.state&Ft)===0&&(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=Zi.from(e,r).toString(n.encoding):(e=Zi.from(e,r),r=""))):e instanceof Zi?r="":qe._isUint8Array(e)?(e=qe._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new Md("chunk",["string","Buffer","Uint8Array"],e))),s)Lt(t,s);else if(e===null)n.state&=~rr,i_(t,n);else if((n.state&Ft)!==0||e&&e.length>0)if(i)if((n.state&ja)!==0)Lt(t,new qd);else{if(n.destroyed||n.errored)return!1;tn(t,n,e,!0)}else if(n.ended)Lt(t,new Ud);else{if(n.destroyed||n.errored)return!1;n.state&=~rr,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?tn(t,n,e,!1):Dr(t,n)):tn(t,n,e,!1)}else i||(n.state&=~rr,Dr(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function tn(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&Ca)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),(e.state&Br)!==0&&Mr(t)),Dr(t,e)}I.prototype.isPaused=function(){let t=this._readableState;return t[it]===!0||t.flowing===!1};I.prototype.setEncoding=function(t){let e=new Pa(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=e.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var t_=1073741824;function r_(t){if(t>t_)throw new kd("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Ta(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Ft)!==0?1:Rd(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}I.prototype.read=function(t){R("read",t),t===void 0?t=NaN:Id(t)||(t=Td(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=r_(t)),t!==0&&(e.state&=~Fa),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return R("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?rn(this):Mr(this),null;if(t=Ta(t,e),t===0&&e.ended)return e.length===0&&rn(this),null;let i=(e.state&Br)!==0;if(R("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,R("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,R("reading, ended or constructing",i);else if(i){R("do read"),e.state|=rr|Cr,e.length===0&&(e.state|=Br);try{this._read(e.highWaterMark)}catch(s){Lt(this,s)}e.state&=~Cr,e.reading||(t=Ta(r,e))}let n;return t>0?n=ka(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&rn(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function i_(t,e){if(R("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Mr(t):(e.needReadable=!1,e.emittedReadable=!0,Da(t))}}function Mr(t){let e=t._readableState;R("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(R("emitReadable",e.flowing),e.emittedReadable=!0,ae.nextTick(Da,t))}function Da(t){let e=t._readableState;R("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Ma(t)}function Dr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ae.nextTick(n_,t,e))}function n_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(R("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}I.prototype._read=function(t){throw new $d("_read()")};I.prototype.pipe=function(t,e){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new vd(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),R("pipe count=%d opts=%j",i.pipes.length,e);let s=(!e||e.end!==!1)&&t!==ae.stdout&&t!==ae.stderr?a:y;i.endEmitted?ae.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(g,S){R("onunpipe"),g===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,f())}function a(){R("onend"),t.end()}let l,u=!1;function f(){R("cleanup"),t.removeListener("close",b),t.removeListener("finish",d),l&&t.removeListener("drain",l),t.removeListener("error",h),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",_),u=!0,l&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}function c(){u||(i.pipes.length===1&&i.pipes[0]===t?(R("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(R("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),r.pause()),l||(l=s_(r,t),t.on("drain",l))}r.on("data",_);function _(g){R("ondata");let S=t.write(g);R("dest.write",S),S===!1&&c()}function h(g){if(R("onerror",g),y(),t.removeListener("error",h),t.listenerCount("error")===0){let S=t._writableState||t._readableState;S&&!S.errorEmitted?Lt(t,g):t.emit("error",g)}}Fd(t,"error",h);function b(){t.removeListener("finish",d),y()}t.once("close",b);function d(){R("onfinish"),t.removeListener("close",b),y()}t.once("finish",d);function y(){R("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?c():i.flowing||(R("pipe resume"),r.resume()),t};function s_(t,e){return function(){let i=t._readableState;i.awaitDrainWriters===e?(R("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(R("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}I.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let s=0;s<n.length;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}let i=Sd(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};I.prototype.on=function(t,e){let r=qe.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,R("on readable",i.length,i.reading),i.length?Mr(this):i.reading||ae.nextTick(o_,this)),r};I.prototype.addListener=I.prototype.on;I.prototype.removeListener=function(t,e){let r=qe.prototype.removeListener.call(this,t,e);return t==="readable"&&ae.nextTick(Oa,this),r};I.prototype.off=I.prototype.removeListener;I.prototype.removeAllListeners=function(t){let e=qe.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ae.nextTick(Oa,this),e};function Oa(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[it]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function o_(t){R("readable nexttick read 0"),t.read(0)}I.prototype.resume=function(){let t=this._readableState;return t.flowing||(R("resume"),t.flowing=!t.readableListening,a_(this,t)),t[it]=!1,this};function a_(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ae.nextTick(l_,t,e))}function l_(t,e){R("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Ma(t),e.flowing&&!e.reading&&t.read(0)}I.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[it]=!0,this};function Ma(t){let e=t._readableState;for(R("flow",e.flowing);e.flowing&&t.read()!==null;);}I.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",i=>{Lt(this,i)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Ad(t);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};I.prototype[Pd]=function(){return $a(this)};I.prototype.iterator=function(t){return t!==void 0&&Gd(t,"options"),$a(this,t)};function $a(t,e){typeof t.read!="function"&&(t=I.wrap(t,{objectMode:!0}));let r=u_(t,e);return r.stream=t,r}function u_(t,e){return ee(this,null,function*(){let r=en;function i(o){this===t?(r(),r=en):r=o}t.on("readable",i);let n,s=Na(t,{writable:!1},o=>{n=o?Ra(n,o):null,r(),r=en});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(n)throw n;if(n===null)return;yield new q(new va(i))}}}catch(o){throw n=Ra(n,o),n}finally{(n||(e==null?void 0:e.destroyOnReturn)!==!1)&&(n===void 0||t._readableState.autoDestroy)?Ct.destroyer(t,null):(t.off("readable",i),s())}})}an(I.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},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(t){this._readableState&&(this._readableState.flowing=t)}},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(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});an(Or.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[it]!==!1},set(t){this[it]=!!t}}});I._fromList=ka;function ka(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function rn(t){let e=t._readableState;R("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ae.nextTick(f_,e,t))}function f_(t,e){if(R("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ae.nextTick(c_,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function c_(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}I.from=function(t,e){return zd(I,t,e)};var nn;function Ua(){return nn===void 0&&(nn={}),nn}I.fromWeb=function(t,e){return Ua().newStreamReadableFromReadableStream(t,e)};I.toWeb=function(t,e){return Ua().newReadableStreamFromStreamReadable(t,e)};I.wrap=function(t,e){var r,i;return new I(Oe(M({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0},e),{destroy(n,s){Ct.destroyer(t,n),s(n)}})).wrap(t)}});var Wr=T((uy,el)=>{"use strict";var nt=ke(),{ArrayPrototypeSlice:za,Error:h_,FunctionPrototypeSymbolHasInstance:Qa,ObjectDefineProperty:Va,ObjectDefineProperties:d_,ObjectSetPrototypeOf:Ha,StringPrototypeToLowerCase:__,Symbol:p_,SymbolHasInstance:b_}=F();el.exports=C;C.WritableState=or;var{EventEmitter:y_}=Xt(),nr=Pr().Stream,{Buffer:$r}=Ne(),qr=tt(),{addAbortSignal:g_}=Zt(),{getHighWaterMark:m_,getDefaultHighWaterMark:w_}=er(),{ERR_INVALID_ARG_TYPE:x_,ERR_METHOD_NOT_IMPLEMENTED:E_,ERR_MULTIPLE_CALLBACK:Ka,ERR_STREAM_CANNOT_PIPE:S_,ERR_STREAM_DESTROYED:sr,ERR_STREAM_ALREADY_FINISHED:I_,ERR_STREAM_NULL_VALUES:R_,ERR_STREAM_WRITE_AFTER_END:T_,ERR_UNKNOWN_ENCODING:Ya}=V().codes,{errorOrDestroy:Bt}=qr;Ha(C.prototype,nr.prototype);Ha(C,nr);function fn(){}var Dt=p_("kOnFinished");function or(t,e,r){typeof r!="boolean"&&(r=e instanceof we()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?m_(this,t,"writableHighWaterMark",r):w_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=v_.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Ur(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Dt]=[]}function Ur(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}or.prototype.getBuffer=function(){return za(this.buffered,this.bufferedIndex)};Va(or.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function C(t){let e=this instanceof we();if(!e&&!Qa(C,this))return new C(t);this._writableState=new or(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&g_(t.signal,this)),nr.call(this,t),qr.construct(this,()=>{let r=this._writableState;r.writing||hn(this,r),dn(this,r)})}Va(C,b_,{__proto__:null,value:function(t){return Qa(this,t)?!0:this!==C?!1:t&&t._writableState instanceof or}});C.prototype.pipe=function(){Bt(this,new S_)};function Ja(t,e,r,i){let n=t._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!$r.isEncoding(r))throw new Ya(r);typeof i!="function"&&(i=fn)}if(e===null)throw new R_;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=$r.from(e,r),r="buffer");else if(e instanceof $r)r="buffer";else if(nr._isUint8Array(e))e=nr._uint8ArrayToBuffer(e),r="buffer";else throw new x_("chunk",["string","Buffer","Uint8Array"],e);let s;return n.ending?s=new T_:n.destroyed&&(s=new sr("write")),s?(nt.nextTick(i,s),Bt(t,s,!0),s):(n.pendingcb++,A_(t,n,e,r,i))}C.prototype.write=function(t,e,r){return Ja(this,t,e,r)===!0};C.prototype.cork=function(){this._writableState.corked++};C.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||hn(this,t))};C.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=__(e)),!$r.isEncoding(e))throw new Ya(e);return this._writableState.defaultEncoding=e,this};function A_(t,e,r,i,n){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==fn&&(e.allNoop=!1)):(e.writelen=s,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function Wa(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new sr("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function Ga(t,e,r,i){--e.pendingcb,i(r),cn(e),Bt(t,r)}function v_(t,e){let r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){Bt(t,new Ka);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?nt.nextTick(Ga,t,r,e,n):Ga(t,r,e,n)):(r.buffered.length>r.bufferedIndex&&hn(t,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:t,state:r},nt.nextTick(N_,r.afterWriteTickInfo)):Xa(t,r,1,n))}function N_({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,Xa(t,e,r,i)}function Xa(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&cn(e),dn(t,e)}function cn(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:s,callback:o}=t.buffered[n],a=t.objectMode?1:s.length;t.length-=a,o((e=t.errored)!==null&&e!==void 0?e:new sr("write"))}let r=t[Dt].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=t.errored)!==null&&i!==void 0?i:new sr("end"))}Ur(t)}function hn(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=e,s=r.length-i;if(!s)return;let o=i;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let a=e.allNoop?fn:u=>{for(let f=o;f<r.length;++f)r[f].callback(u)},l=e.allNoop&&o===0?r:za(r,o);l.allBuffers=e.allBuffers,Wa(t,e,!0,e.length,l,"",a),Ur(e)}else{do{let{chunk:a,encoding:l,callback:u}=r[o];r[o++]=null;let f=n?1:a.length;Wa(t,e,!1,f,a,l,u)}while(o<r.length&&!e.writing);o===r.length?Ur(e):o>256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}C.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new E_("_write()")};C.prototype._writev=null;C.prototype.end=function(t,e,r){let i=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n;if(t!=null){let s=Ja(this,t,e);s instanceof h_&&(n=s)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,dn(this,i,!0),i.ended=!0):i.finished?n=new I_("end"):i.destroyed&&(n=new sr("end"))),typeof r=="function"&&(n||i.finished?nt.nextTick(r,n):i[Dt].push(r)),this};function kr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function P_(t,e){let r=!1;function i(n){if(r){Bt(t,n!=null?n:Ka());return}if(r=!0,e.pendingcb--,n){let s=e[Dt].splice(0);for(let o=0;o<s.length;o++)s[o](n);Bt(t,n,e.sync)}else kr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,nt.nextTick(un,t,e))}e.sync=!0,e.pendingcb++;try{t._final(i)}catch(n){i(n)}e.sync=!1}function j_(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,P_(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function dn(t,e,r){kr(e)&&(j_(t,e),e.pendingcb===0&&(r?(e.pendingcb++,nt.nextTick((i,n)=>{kr(n)?un(i,n):n.pendingcb--},t,e)):kr(e)&&(e.pendingcb++,un(t,e))))}function un(t,e){e.pendingcb--,e.finished=!0;let r=e[Dt].splice(0);for(let i=0;i<r.length;i++)r[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy()}}d_(C.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},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(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.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)}}});var L_=qr.destroy;C.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Dt].length)&&nt.nextTick(cn,r),L_.call(this,t,e),this};C.prototype._undestroy=qr.undestroy;C.prototype._destroy=function(t,e){e(t)};C.prototype[y_.captureRejectionSymbol]=function(t){this.destroy(t)};var ln;function Za(){return ln===void 0&&(ln={}),ln}C.fromWeb=function(t,e){return Za().newStreamWritableFromWritableStream(t,e)};C.toWeb=function(t){return Za().newWritableStreamFromStreamWritable(t)}});var pl=T((fy,_l)=>{var _n=ke(),F_=Ne(),{isReadable:C_,isWritable:B_,isIterable:tl,isNodeStream:D_,isReadableNodeStream:rl,isWritableNodeStream:il,isDuplexNodeStream:O_,isReadableStream:nl,isWritableStream:sl}=ye(),ol=Le(),{AbortError:hl,codes:{ERR_INVALID_ARG_TYPE:M_,ERR_INVALID_RETURN_VALUE:al}}=V(),{destroyer:Mt}=tt(),$_=we(),dl=ir(),k_=Wr(),{createDeferredPromise:ll}=Y(),ul=Xi(),fl=globalThis.Blob||F_.Blob,U_=typeof fl!="undefined"?function(e){return e instanceof fl}:function(e){return!1},q_=globalThis.AbortController||Tt().AbortController,{FunctionPrototypeCall:cl}=F(),We=class extends $_{constructor(e){super(e),(e==null?void 0:e.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(e==null?void 0:e.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};_l.exports=function t(e,r){if(O_(e))return e;if(rl(e))return Ot({readable:e});if(il(e))return Ot({writable:e});if(D_(e))return Ot({writable:!1,readable:!1});if(nl(e))return Ot({readable:dl.fromWeb(e)});if(sl(e))return Ot({writable:k_.fromWeb(e)});if(typeof e=="function"){let{value:n,write:s,final:o,destroy:a}=W_(e);if(tl(n))return ul(We,n,{objectMode:!0,write:s,final:o,destroy:a});let l=n==null?void 0:n.then;if(typeof l=="function"){let u,f=cl(l,n,c=>{if(c!=null)throw new al("nully","body",c)},c=>{Mt(u,c)});return u=new We({objectMode:!0,readable:!1,write:s,final(c){o(async()=>{try{await f,_n.nextTick(c,null)}catch(_){_n.nextTick(c,_)}})},destroy:a})}throw new al("Iterable, AsyncIterable or AsyncFunction",r,n)}if(U_(e))return t(e.arrayBuffer());if(tl(e))return ul(We,e,{objectMode:!0,writable:!1});if(nl(e==null?void 0:e.readable)&&sl(e==null?void 0:e.writable))return We.fromWeb(e);if(typeof(e==null?void 0:e.writable)=="object"||typeof(e==null?void 0:e.readable)=="object"){let n=e!=null&&e.readable?rl(e==null?void 0:e.readable)?e==null?void 0:e.readable:t(e.readable):void 0,s=e!=null&&e.writable?il(e==null?void 0:e.writable)?e==null?void 0:e.writable:t(e.writable):void 0;return Ot({readable:n,writable:s})}let i=e==null?void 0:e.then;if(typeof i=="function"){let n;return cl(i,e,s=>{s!=null&&n.push(s),n.push(null)},s=>{Mt(n,s)}),n=new We({objectMode:!0,writable:!1,read(){}})}throw new M_(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function W_(t){let{promise:e,resolve:r}=ll(),i=new q_,n=i.signal;return{value:t((function(){return ee(this,null,function*(){for(;;){let o=e;e=null;let{chunk:a,done:l,cb:u}=yield new q(o);if(_n.nextTick(u),l)return;if(n.aborted)throw new hl(void 0,{cause:n.reason});({promise:e,resolve:r}=ll()),yield a}})})(),{signal:n}),write(o,a,l){let u=r;r=null,u({chunk:o,done:!1,cb:l})},final(o){let a=r;r=null,a({done:!0,cb:o})},destroy(o,a){i.abort(),a(o)}}}function Ot(t){let e=t.readable&&typeof t.readable.read!="function"?dl.wrap(t.readable):t.readable,r=t.writable,i=!!C_(e),n=!!B_(r),s,o,a,l,u;function f(c){let _=l;l=null,_?_(c):c&&u.destroy(c)}return u=new We({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(ol(r,c=>{n=!1,c&&Mt(e,c),f(c)}),u._write=function(c,_,h){r.write(c,_)?h():s=h},u._final=function(c){r.end(),o=c},r.on("drain",function(){if(s){let c=s;s=null,c()}}),r.on("finish",function(){if(o){let c=o;o=null,c()}})),i&&(ol(e,c=>{i=!1,c&&Mt(e,c),f(c)}),e.on("readable",function(){if(a){let c=a;a=null,c()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let c=e.read();if(c===null){a=u._read;return}if(!u.push(c))return}}),u._destroy=function(c,_){!c&&l!==null&&(c=new hl),a=null,s=null,o=null,l===null?_(c):(l=_,Mt(r,c),Mt(e,c))},u}});var we=T((hy,gl)=>{"use strict";var{ObjectDefineProperties:G_,ObjectGetOwnPropertyDescriptor:Fe,ObjectKeys:z_,ObjectSetPrototypeOf:bl}=F();gl.exports=le;var yn=ir(),ie=Wr();bl(le.prototype,yn.prototype);bl(le,yn);{let t=z_(ie.prototype);for(let e=0;e<t.length;e++){let r=t[e];le.prototype[r]||(le.prototype[r]=ie.prototype[r])}}function le(t){if(!(this instanceof le))return new le(t);yn.call(this,t),ie.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}G_(le.prototype,{writable:M({__proto__:null},Fe(ie.prototype,"writable")),writableHighWaterMark:M({__proto__:null},Fe(ie.prototype,"writableHighWaterMark")),writableObjectMode:M({__proto__:null},Fe(ie.prototype,"writableObjectMode")),writableBuffer:M({__proto__:null},Fe(ie.prototype,"writableBuffer")),writableLength:M({__proto__:null},Fe(ie.prototype,"writableLength")),writableFinished:M({__proto__:null},Fe(ie.prototype,"writableFinished")),writableCorked:M({__proto__:null},Fe(ie.prototype,"writableCorked")),writableEnded:M({__proto__:null},Fe(ie.prototype,"writableEnded")),writableNeedDrain:M({__proto__:null},Fe(ie.prototype,"writableNeedDrain")),destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var pn;function yl(){return pn===void 0&&(pn={}),pn}le.fromWeb=function(t,e){return yl().newStreamDuplexFromReadableWritablePair(t,e)};le.toWeb=function(t){return yl().newReadableWritablePairFromDuplex(t)};var bn;le.from=function(t){return bn||(bn=pl()),bn(t,"body")}});var wn=T((_y,wl)=>{"use strict";var{ObjectSetPrototypeOf:ml,Symbol:Q_}=F();wl.exports=Ce;var{ERR_METHOD_NOT_IMPLEMENTED:V_}=V().codes,mn=we(),{getHighWaterMark:H_}=er();ml(Ce.prototype,mn.prototype);ml(Ce,mn);var ar=Q_("kCallback");function Ce(t){if(!(this instanceof Ce))return new Ce(t);let e=t?H_(this,t,"readableHighWaterMark",!0):null;e===0&&(t=Oe(M({},t),{highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0})),mn.call(this,t),this._readableState.sync=!1,this[ar]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",K_)}function gn(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function K_(){this._final!==gn&&gn.call(this)}Ce.prototype._final=gn;Ce.prototype._transform=function(t,e,r){throw new V_("_transform()")};Ce.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,s=i.length;this._transform(t,e,(o,a)=>{if(o){r(o);return}a!=null&&this.push(a),n.ended||s===i.length||i.length<i.highWaterMark?r():this[ar]=r})};Ce.prototype._read=function(){if(this[ar]){let t=this[ar];this[ar]=null,t()}}});var En=T((by,El)=>{"use strict";var{ObjectSetPrototypeOf:xl}=F();El.exports=$t;var xn=wn();xl($t.prototype,xn.prototype);xl($t,xn);function $t(t){if(!(this instanceof $t))return new $t(t);xn.call(this,t)}$t.prototype._transform=function(t,e,r){r(null,t)}});var Vr=T((yy,Al)=>{var lr=ke(),{ArrayIsArray:Y_,Promise:J_,SymbolAsyncIterator:X_,SymbolDispose:Z_}=F(),Qr=Le(),{once:ep}=Y(),tp=tt(),Sl=we(),{aggregateTwoErrors:rp,codes:{ERR_INVALID_ARG_TYPE:jn,ERR_INVALID_RETURN_VALUE:Sn,ERR_MISSING_ARGS:ip,ERR_STREAM_DESTROYED:np,ERR_STREAM_PREMATURE_CLOSE:sp},AbortError:op}=V(),{validateFunction:ap,validateAbortSignal:lp}=Nt(),{isIterable:st,isReadable:In,isReadableNodeStream:zr,isNodeStream:Il,isTransformStream:kt,isWebStream:up,isReadableStream:Rn,isReadableFinished:fp}=ye(),cp=globalThis.AbortController||Tt().AbortController,Tn,An,vn;function Rl(t,e,r){let i=!1;t.on("close",()=>{i=!0});let n=Qr(t,{readable:e,writable:r},s=>{i=!s});return{destroy:s=>{i||(i=!0,tp.destroyer(t,s||new np("pipe")))},cleanup:n}}function hp(t){return ap(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function Nn(t){if(st(t))return t;if(zr(t))return dp(t);throw new jn("val",["Readable","Iterable","AsyncIterable"],t)}function dp(t){return ee(this,null,function*(){An||(An=ir()),yield*ne(An.prototype[X_].call(t))})}async function Gr(t,e,r,{end:i}){let n,s=null,o=h=>{if(h&&(n=h),s){let b=s;s=null,b()}},a=()=>new J_((h,b)=>{n?b(n):s=()=>{n?b(n):h()}});e.on("drain",o);let l=Qr(e,{readable:!1},o);try{e.writableNeedDrain&&await a();try{for(var u=J(t),f,c,_;f=!(c=await u.next()).done;f=!1){let h=c.value;e.write(h)||await a()}}catch(c){_=[c]}finally{try{f&&(c=u.return)&&await c.call(u)}finally{if(_)throw _[0]}}i&&(e.end(),await a()),r()}catch(h){r(n!==h?rp(n,h):h)}finally{l(),e.off("drain",o)}}async function Pn(t,e,r,{end:i}){kt(e)&&(e=e.writable);let n=e.getWriter();try{try{for(var s=J(t),o,a,l;o=!(a=await s.next()).done;o=!1){let u=a.value;await n.ready,n.write(u).catch(()=>{})}}catch(a){l=[a]}finally{try{o&&(a=s.return)&&await a.call(s)}finally{if(l)throw l[0]}}await n.ready,i&&await n.close(),r()}catch(u){try{await n.abort(u),r(u)}catch(f){r(f)}}}function _p(...t){return Tl(t,ep(hp(t)))}function Tl(t,e,r){if(t.length===1&&Y_(t[0])&&(t=t[0]),t.length<2)throw new ip("streams");let i=new cp,n=i.signal,s=r==null?void 0:r.signal,o=[];lp(s,"options.signal");function a(){b(new op)}vn=vn||Y().addAbortListener;let l;s&&(l=vn(s,a));let u,f,c=[],_=0;function h(m){b(m,--_===0)}function b(m,w){var x;if(m&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=m),!(!u&&!w)){for(;c.length;)c.shift()(u);(x=l)===null||x===void 0||x[Z_](),i.abort(),w&&(u||o.forEach(A=>A()),lr.nextTick(e,u,f))}}let d;for(let m=0;m<t.length;m++){let w=t[m],x=m<t.length-1,A=m>0,E=x||(r==null?void 0:r.end)!==!1,B=m===t.length-1;if(Il(w)){let P=function(K){K&&K.name!=="AbortError"&&K.code!=="ERR_STREAM_PREMATURE_CLOSE"&&h(K)};var S=P;if(E){let{destroy:K,cleanup:ut}=Rl(w,x,A);c.push(K),In(w)&&B&&o.push(ut)}w.on("error",P),In(w)&&B&&o.push(()=>{w.removeListener("error",P)})}if(m===0)if(typeof w=="function"){if(d=w({signal:n}),!st(d))throw new Sn("Iterable, AsyncIterable or Stream","source",d)}else st(w)||zr(w)||kt(w)?d=w:d=Sl.from(w);else if(typeof w=="function"){if(kt(d)){var y;d=Nn((y=d)===null||y===void 0?void 0:y.readable)}else d=Nn(d);if(d=w(d,{signal:n}),x){if(!st(d,!0))throw new Sn("AsyncIterable",`transform[${m-1}]`,d)}else{var g;Tn||(Tn=En());let P=new Tn({objectMode:!0}),K=(g=d)===null||g===void 0?void 0:g.then;if(typeof K=="function")_++,K.call(d,De=>{f=De,De!=null&&P.write(De),E&&P.end(),lr.nextTick(h)},De=>{P.destroy(De),lr.nextTick(h,De)});else if(st(d,!0))_++,Gr(d,P,h,{end:E});else if(Rn(d)||kt(d)){let De=d.readable||d;_++,Gr(De,P,h,{end:E})}else throw new Sn("AsyncIterable or Promise","destination",d);d=P;let{destroy:ut,cleanup:uu}=Rl(d,!1,!0);c.push(ut),B&&o.push(uu)}}else if(Il(w)){if(zr(d)){_+=2;let P=pp(d,w,h,{end:E});In(w)&&B&&o.push(P)}else if(kt(d)||Rn(d)){let P=d.readable||d;_++,Gr(P,w,h,{end:E})}else if(st(d))_++,Gr(d,w,h,{end:E});else throw new jn("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],d);d=w}else if(up(w)){if(zr(d))_++,Pn(Nn(d),w,h,{end:E});else if(Rn(d)||st(d))_++,Pn(d,w,h,{end:E});else if(kt(d))_++,Pn(d.readable,w,h,{end:E});else throw new jn("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],d);d=w}else d=Sl.from(w)}return(n!=null&&n.aborted||s!=null&&s.aborted)&&lr.nextTick(a),d}function pp(t,e,r,{end:i}){let n=!1;if(e.on("close",()=>{n||r(new sp)}),t.pipe(e,{end:!1}),i){let o=function(){n=!0,e.end()};var s=o;fp(t)?lr.nextTick(o):t.once("end",o)}else r();return Qr(t,{readable:!0,writable:!1},o=>{let a=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(o)}),Qr(e,{readable:!1,writable:!0},r)}Al.exports={pipelineImpl:Tl,pipeline:_p}});var Fn=T((my,Fl)=>{"use strict";var{pipeline:bp}=Vr(),Hr=we(),{destroyer:yp}=tt(),{isNodeStream:Kr,isReadable:vl,isWritable:Nl,isWebStream:Ln,isTransformStream:ot,isWritableStream:Pl,isReadableStream:jl}=ye(),{AbortError:gp,codes:{ERR_INVALID_ARG_VALUE:Ll,ERR_MISSING_ARGS:mp}}=V(),wp=Le();Fl.exports=function(...e){if(e.length===0)throw new mp("streams");if(e.length===1)return Hr.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Hr.from(e[0])),typeof e[e.length-1]=="function"){let h=e.length-1;e[h]=Hr.from(e[h])}for(let h=0;h<e.length;++h)if(!(!Kr(e[h])&&!Ln(e[h]))){if(h<e.length-1&&!(vl(e[h])||jl(e[h])||ot(e[h])))throw new Ll(`streams[${h}]`,r[h],"must be readable");if(h>0&&!(Nl(e[h])||Pl(e[h])||ot(e[h])))throw new Ll(`streams[${h}]`,r[h],"must be writable")}let i,n,s,o,a;function l(h){let b=o;o=null,b?b(h):h?a.destroy(h):!_&&!c&&a.destroy()}let u=e[0],f=bp(e,l),c=!!(Nl(u)||Pl(u)||ot(u)),_=!!(vl(f)||jl(f)||ot(f));if(a=new Hr({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(f!=null&&f.readableObjectMode),writable:c,readable:_}),c){if(Kr(u))a._write=function(b,d,y){u.write(b,d)?y():i=y},a._final=function(b){u.end(),n=b},u.on("drain",function(){if(i){let b=i;i=null,b()}});else if(Ln(u)){let d=(ot(u)?u.writable:u).getWriter();a._write=async function(y,g,S){try{await d.ready,d.write(y).catch(()=>{}),S()}catch(m){S(m)}},a._final=async function(y){try{await d.ready,d.close().catch(()=>{}),n=y}catch(g){y(g)}}}let h=ot(f)?f.readable:f;wp(h,()=>{if(n){let b=n;n=null,b()}})}if(_){if(Kr(f))f.on("readable",function(){if(s){let h=s;s=null,h()}}),f.on("end",function(){a.push(null)}),a._read=function(){for(;;){let h=f.read();if(h===null){s=a._read;return}if(!a.push(h))return}};else if(Ln(f)){let b=(ot(f)?f.readable:f).getReader();a._read=async function(){for(;;)try{let{value:d,done:y}=await b.read();if(!a.push(d))return;if(y){a.push(null);return}}catch(d){return}}}}return a._destroy=function(h,b){!h&&o!==null&&(h=new gp),s=null,i=null,n=null,o===null?b(h):(o=b,Kr(f)&&yp(f,h))},a}});var Wl=T((wy,Dn)=>{"use strict";var xp=globalThis.AbortController||Tt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Ep,ERR_INVALID_ARG_TYPE:ur,ERR_MISSING_ARGS:Sp,ERR_OUT_OF_RANGE:Ip},AbortError:xe}=V(),{validateAbortSignal:at,validateInteger:Cl,validateObject:lt}=Nt(),Rp=F().Symbol("kWeak"),Tp=F().Symbol("kResistStopPropagation"),{finished:Ap}=Le(),vp=Fn(),{addAbortSignalNoValidate:Np}=Zt(),{isWritable:Pp,isNodeStream:jp}=ye(),{deprecate:Lp}=Y(),{ArrayPrototypePush:Fp,Boolean:Cp,MathFloor:Bl,Number:Bp,NumberIsNaN:Dp,Promise:Dl,PromiseReject:Ol,PromiseResolve:Op,PromisePrototypeThen:Ml,Symbol:kl}=F(),Yr=kl("kEmpty"),$l=kl("kEof");function Mp(t,e){if(e!=null&&lt(e,"options"),(e==null?void 0:e.signal)!=null&&at(e.signal,"options.signal"),jp(t)&&!Pp(t))throw new Ep("stream",t,"must be writable");let r=vp(this,t);return e!=null&&e.signal&&Np(e.signal,r),r}function Jr(t,e){if(typeof t!="function")throw new ur("fn",["Function","AsyncFunction"],t);e!=null&&lt(e,"options"),(e==null?void 0:e.signal)!=null&&at(e.signal,"options.signal");let r=1;(e==null?void 0:e.concurrency)!=null&&(r=Bl(e.concurrency));let i=r-1;return(e==null?void 0:e.highWaterMark)!=null&&(i=Bl(e.highWaterMark)),Cl(r,"options.concurrency",1),Cl(i,"options.highWaterMark",0),i+=r,function(){return ee(this,null,function*(){let s=Y().AbortSignalAny([e==null?void 0:e.signal].filter(Cp)),o=this,a=[],l={signal:s},u,f,c=!1,_=0;function h(){c=!0,b()}function b(){_-=1,d()}function d(){f&&!c&&_<r&&a.length<i&&(f(),f=null)}async function y(){try{try{for(var g=J(o),S,m,w;S=!(m=await g.next()).done;S=!1){let x=m.value;if(c)return;if(s.aborted)throw new xe;try{if(x=t(x,l),x===Yr)continue;x=Op(x)}catch(A){x=Ol(A)}_+=1,Ml(x,b,h),a.push(x),u&&(u(),u=null),!c&&(a.length>=i||_>=r)&&await new Dl(A=>{f=A})}}catch(m){w=[m]}finally{try{S&&(m=g.return)&&await m.call(g)}finally{if(w)throw w[0]}}a.push($l)}catch(x){let A=Ol(x);Ml(A,b,h),a.push(A)}finally{c=!0,u&&(u(),u=null)}}y();try{for(;;){for(;a.length>0;){let g=yield new q(a[0]);if(g===$l)return;if(s.aborted)throw new xe;g!==Yr&&(yield g),a.shift(),d()}yield new q(new Dl(g=>{u=g}))}}finally{c=!0,f&&(f(),f=null)}})}.call(this)}function $p(t=void 0){return t!=null&&lt(t,"options"),(t==null?void 0:t.signal)!=null&&at(t.signal,"options.signal"),function(){return ee(this,null,function*(){let r=0;try{for(var n=J(this),s,o,a;s=!(o=yield new q(n.next())).done;s=!1){let l=o.value;var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new xe({cause:t.signal.reason});yield[r++,l]}}catch(o){a=[o]}finally{try{s&&(o=n.return)&&(yield new q(o.call(n)))}finally{if(a)throw a[0]}}})}.call(this)}async function Ul(t,e=void 0){try{for(var r=J(Bn.call(this,t,e)),i,n,s;i=!(n=await r.next()).done;i=!1){let o=n.value;return!0}}catch(n){s=[n]}finally{try{i&&(n=r.return)&&await n.call(r)}finally{if(s)throw s[0]}}return!1}async function kp(t,e=void 0){if(typeof t!="function")throw new ur("fn",["Function","AsyncFunction"],t);return!await Ul.call(this,async(...r)=>!await t(...r),e)}async function Up(t,e){try{for(var r=J(Bn.call(this,t,e)),i,n,s;i=!(n=await r.next()).done;i=!1){let o=n.value;return o}}catch(n){s=[n]}finally{try{i&&(n=r.return)&&await n.call(r)}finally{if(s)throw s[0]}}}async function qp(t,e){if(typeof t!="function")throw new ur("fn",["Function","AsyncFunction"],t);async function r(a,l){return await t(a,l),Yr}try{for(var i=J(Jr.call(this,r,e)),n,s,o;n=!(s=await i.next()).done;n=!1){let a=s.value;;}}catch(s){o=[s]}finally{try{n&&(s=i.return)&&await s.call(i)}finally{if(o)throw o[0]}}}function Bn(t,e){if(typeof t!="function")throw new ur("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n)?i:Yr}return Jr.call(this,r,e)}var Cn=class extends Sp{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Wp(t,e,r){var i;if(typeof t!="function")throw new ur("reducer",["Function","AsyncFunction"],t);r!=null&&lt(r,"options"),(r==null?void 0:r.signal)!=null&&at(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let h=new xe(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await Ap(this.destroy(h)),h}let s=new xp,o=s.signal;if(r!=null&&r.signal){let h={once:!0,[Rp]:this,[Tp]:!0};r.signal.addEventListener("abort",()=>s.abort(),h)}let a=!1;try{try{for(var u=J(this),f,c,_;f=!(c=await u.next()).done;f=!1){let h=c.value;var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new xe;n?e=await t(e,h,{signal:o}):(e=h,n=!0)}}catch(c){_=[c]}finally{try{f&&(c=u.return)&&await c.call(u)}finally{if(_)throw _[0]}}if(!a&&!n)throw new Cn}finally{s.abort()}return e}async function Gp(t){t!=null&&lt(t,"options"),(t==null?void 0:t.signal)!=null&&at(t.signal,"options.signal");let e=[];try{for(var i=J(this),n,s,o;n=!(s=await i.next()).done;n=!1){let a=s.value;var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new xe(void 0,{cause:t.signal.reason});Fp(e,a)}}catch(s){o=[s]}finally{try{n&&(s=i.return)&&await s.call(i)}finally{if(o)throw o[0]}}return e}function zp(t,e){let r=Jr.call(this,t,e);return function(){return ee(this,null,function*(){try{for(var n=J(r),s,o,a;s=!(o=yield new q(n.next())).done;s=!1){let l=o.value;yield*ne(l)}}catch(o){a=[o]}finally{try{s&&(o=n.return)&&(yield new q(o.call(n)))}finally{if(a)throw a[0]}}})}.call(this)}function ql(t){if(t=Bp(t),Dp(t))return 0;if(t<0)throw new Ip("number",">= 0",t);return t}function Qp(t,e=void 0){return e!=null&&lt(e,"options"),(e==null?void 0:e.signal)!=null&&at(e.signal,"options.signal"),t=ql(t),function(){return ee(this,null,function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new xe;try{for(var s=J(this),o,a,l;o=!(a=yield new q(s.next())).done;o=!1){let u=a.value;var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new xe;t--<=0&&(yield u)}}catch(a){l=[a]}finally{try{o&&(a=s.return)&&(yield new q(a.call(s)))}finally{if(l)throw l[0]}}})}.call(this)}function Vp(t,e=void 0){return e!=null&&lt(e,"options"),(e==null?void 0:e.signal)!=null&&at(e.signal,"options.signal"),t=ql(t),function(){return ee(this,null,function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new xe;try{for(var s=J(this),o,a,l;o=!(a=yield new q(s.next())).done;o=!1){let u=a.value;var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new xe;if(t-- >0&&(yield u),t<=0)return}}catch(a){l=[a]}finally{try{o&&(a=s.return)&&(yield new q(a.call(s)))}finally{if(l)throw l[0]}}})}.call(this)}Dn.exports.streamReturningOperators={asIndexedPairs:Lp($p,"readable.asIndexedPairs will be removed in a future version."),drop:Qp,filter:Bn,flatMap:zp,map:Jr,take:Vp,compose:Mp};Dn.exports.promiseReturningOperators={every:kp,forEach:qp,reduce:Wp,toArray:Gp,some:Ul,find:Up}});var On=T((Ey,Gl)=>{"use strict";var{ArrayPrototypePop:Hp,Promise:Kp}=F(),{isIterable:Yp,isNodeStream:Jp,isWebStream:Xp}=ye(),{pipelineImpl:Zp}=Vr(),{finished:eb}=Le();Mn();function tb(...t){return new Kp((e,r)=>{let i,n,s=t[t.length-1];if(s&&typeof s=="object"&&!Jp(s)&&!Yp(s)&&!Xp(s)){let o=Hp(t);i=o.signal,n=o.end}Zp(t,(o,a)=>{o?r(o):e(a)},{signal:i,end:n})})}Gl.exports={finished:eb,pipeline:tb}});var Mn=T((Sy,Zl)=>{"use strict";var{Buffer:rb}=Ne(),{ObjectDefineProperty:Be,ObjectKeys:Vl,ReflectApply:Hl}=F(),{promisify:{custom:Kl}}=Y(),{streamReturningOperators:zl,promiseReturningOperators:Ql}=Wl(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Yl}}=V(),ib=Fn(),{setDefaultHighWaterMark:nb,getDefaultHighWaterMark:sb}=er(),{pipeline:Jl}=Vr(),{destroyer:ob}=tt(),Xl=Le(),$n=On(),fr=ye(),L=Zl.exports=Pr().Stream;L.isDestroyed=fr.isDestroyed;L.isDisturbed=fr.isDisturbed;L.isErrored=fr.isErrored;L.isReadable=fr.isReadable;L.isWritable=fr.isWritable;L.Readable=ir();for(let t of Vl(zl)){let r=function(...i){if(new.target)throw Yl();return L.Readable.from(Hl(e,this,i))},e=zl[t];Be(r,"name",{__proto__:null,value:e.name}),Be(r,"length",{__proto__:null,value:e.length}),Be(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of Vl(Ql)){let r=function(...i){if(new.target)throw Yl();return Hl(e,this,i)},e=Ql[t];Be(r,"name",{__proto__:null,value:e.name}),Be(r,"length",{__proto__:null,value:e.length}),Be(L.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}L.Writable=Wr();L.Duplex=we();L.Transform=wn();L.PassThrough=En();L.pipeline=Jl;var{addAbortSignal:ab}=Zt();L.addAbortSignal=ab;L.finished=Xl;L.destroy=ob;L.compose=ib;L.setDefaultHighWaterMark=nb;L.getDefaultHighWaterMark=sb;Be(L,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return $n}});Be(Jl,Kl,{__proto__:null,enumerable:!0,get(){return $n.pipeline}});Be(Xl,Kl,{__proto__:null,enumerable:!0,get(){return $n.finished}});L.Stream=L;L._isUint8Array=function(e){return e instanceof Uint8Array};L._uint8ArrayToBuffer=function(e){return rb.from(e.buffer,e.byteOffset,e.byteLength)}});var Xr=T((Iy,O)=>{"use strict";var k=Mn(),lb=On(),ub=k.Readable.destroy;O.exports=k.Readable;O.exports._uint8ArrayToBuffer=k._uint8ArrayToBuffer;O.exports._isUint8Array=k._isUint8Array;O.exports.isDisturbed=k.isDisturbed;O.exports.isErrored=k.isErrored;O.exports.isReadable=k.isReadable;O.exports.Readable=k.Readable;O.exports.Writable=k.Writable;O.exports.Duplex=k.Duplex;O.exports.Transform=k.Transform;O.exports.PassThrough=k.PassThrough;O.exports.addAbortSignal=k.addAbortSignal;O.exports.finished=k.finished;O.exports.destroy=k.destroy;O.exports.destroy=ub;O.exports.pipeline=k.pipeline;O.exports.compose=k.compose;Object.defineProperty(k,"promises",{configurable:!0,enumerable:!0,get(){return lb}});O.exports.Stream=k.Stream;O.exports.default=O.exports});var bb={};Kn(bb,{BaseIRI:()=>Me,BlankNode:()=>pt,DataFactory:()=>W,DefaultGraph:()=>yt,EntityIndex:()=>Wt,Lexer:()=>Se,Literal:()=>fe,NamedNode:()=>Qe,Parser:()=>ce,Quad:()=>Ae,Reasoner:()=>zt,Store:()=>ue,StoreFactory:()=>Gt,StreamParser:()=>Qt,StreamWriter:()=>Vt,Term:()=>Q,Triple:()=>Ae,Util:()=>_r,Variable:()=>bt,Writer:()=>oe,default:()=>pb,getRulesFromDataset:()=>zn,termFromId:()=>Re,termToId:()=>Te});var ze="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ct="http://www.w3.org/2001/XMLSchema#",cr="http://www.w3.org/2000/10/swap/",j={xsd:{decimal:`${ct}decimal`,boolean:`${ct}boolean`,dateTime:`${ct}dateTime`,double:`${ct}double`,integer:`${ct}integer`,string:`${ct}string`},rdf:{type:`${ze}type`,nil:`${ze}nil`,first:`${ze}first`,rest:`${ze}rest`,langString:`${ze}langString`,dirLangString:`${ze}dirLangString`,reifies:`${ze}reifies`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${cr}reify#forSome`,forAll:`${cr}reify#forAll`},log:{implies:`${cr}log#implies`,isImpliedBy:`${cr}log#isImpliedBy`}};var{xsd:hr}=j,ht=32,dt=9,ni=10,_t=13,es=35,li=46,ts=58,mu=48,wu=57,xu=37,Eu=92;function rs(t){return t===ht||t>=dt&&t<=_t||t>=160&&(t===160||t===5760||t>=8192&&t<=8202||t===8232||t===8233||t===8239||t===8287||t===12288||t===65279)}var is=new Uint8Array(128);for(let t of`,;!^#()[]{}"'<>
3
- \v\f\r`)is[t.charCodeAt(0)]=1;function Su(t){return t<128?is[t]===1:rs(t)}function Iu(t,e,r){let i=t.charCodeAt(e);return i===li&&(i=t.charCodeAt(++e)),e>=t.length?r:Su(i)}var Jn={"\\":"\\","'":"'",'"':'"',n:`
4
- `,r:"\r",t:" ",f:"\f",b:"\b"},ns={_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","'":"'","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},Ru=/[\x00-\x20<>\\"\{\}\|\^\`]/,ss=1,os=2,dr=4,si=8,as=16,Kt=new Uint8Array(128);for(let t=0;t<128;t++){let e=String.fromCharCode(t),r=e>="A"&&e<="Z"||e>="a"&&e<="z",i=r||e==="_"||e==="-"||e>="0"&&e<="9";Kt[t]=(r?ss:0)|(i&&e!=="-"||e===":"?os:0)|(i?dr:0)|(i||e===":"?si:0)|(e in ns?as:0)}function oi(t,e,r){let i=t.charCodeAt(e);if(i<128)return(Kt[i]&r)!==0?1:0;if(i>=55296&&i<=56191){let n=t.charCodeAt(e+1);return n>=56320&&n<=57343?2:0}return r>=dr&&(i===183||i>=768&&i<=879||i===8255||i===8256)||i>=192&&i<=8191&&i!==215&&i!==247&&(i<768||i>=880&&i!==894)||i>=8204&&i<=8205||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533?1:0}function Tu(t){return t<128&&(Kt[t]&as)!==0}function Xn(t){return t>=mu&&t<=wu||t>=65&&t<=70||t>=97&&t<=102}function ai(t,e){let r=oi(t,e,ss);for(;r!==0;){e+=r;let i=t.charCodeAt(e)===li?e+1:e,n=t.charCodeAt(i);r=n<128?(Kt[n]&dr)!==0?1:0:oi(t,i,dr),r!==0&&(e=i)}return e}function Au(t,e){let r=e,i=os;for(;;){let n=t.charCodeAt(e),s=n<128?(Kt[n]&i)!==0?1:0:oi(t,e,i);if(s===0&&n===xu&&Xn(t.charCodeAt(e+1))&&Xn(t.charCodeAt(e+2))?s=3:s===0&&n===Eu&&Tu(t.charCodeAt(e+1))&&(s=2),s!==0)r=e+=s,i=si;else if(n===li&&i===si)e++;else return r}}function Zn(t,e,r){let i=ai(t,e);if(t.charCodeAt(i)!==ts)return-1;let n=Au(t,i+1);return Iu(t,n,r)?n:-1}function vu(t){return t<=1114111&&(t<55296||t>57343)}var Nu={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_commentLine:!0,_whitespace:!0},Pu=/$0^/,ju=/\S*/y;function z(t,e,r){return t.lastIndex=r,t.exec(e)}function ri(t,e,r){return t.lastIndex=r,t.test(e)}function ii(t,e,r){return t.lastIndex=0,t.exec(`${e.slice(r)} `)}function Lu(t){return t===ht||t===dt||t===ni||t===_t||t===es}var Fu=/^(?:prefix|base|version|graph|forsome|forall|iri|a|true|false|has|is|of|id)$/i,Cu=1024,Se=class{constructor(e){if(this._iri=/<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/y,this._unescapedIri=/<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/y,this._simpleQuotedString=/"([^"\\\r\n]*)"(?=[^"])/y,this._simpleApostropheString=/'([^'\\\r\n]*)'(?=[^'])/y,this._langcode=/@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9])/iy,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-9: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#()\[\]\{\}"'<>])/y,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#()\[\]\{\}"'<>]))/y,this._number=/[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?\d+|(?=\.?\d)\d*(?:(\.)\d+)?)(?=\.?[,;:!\^\s#()\[\]\{\}"'<>])/y,this._boolean=/(?:true|false)(?=[.,;!\^\s#()\[\]\{\}"'<>])/y,this._atKeyword=/@[a-z]+(?=[\s#<:"'])/iy,this._keyword=/(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<"'])/iy,this._n3Verb=/(?:has|is|of)(?=[\s#()\[\]\{\}"'<>?_+\-0-9])/y,this._n3Id=/id(?=[\s#<])/y,this._shortPredicates=/a(?=[\s#()\[\]\{\}"'<>])/y,this._commentLine=/[ \t]*#([^\n\r]*)(?:\r\n|\n|\r)([ \t]*)/y,this._whitespace=/[ \t]+/y,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let r in this)!(r in Nu)&&this[r]instanceof RegExp&&(this[r]=Pu);this._keyword=/VERSION(?=[\s#<"])/y}else this._n3Mode=e.n3!==!1;if(this._directive=null,e.directives&&e.directives.length!==0){for(let r of e.directives)if(!/^[a-z]+$/i.test(r)||Fu.test(r))throw new Error(`Invalid directive name: "${r}"`);this._directive=new RegExp(`(?:${e.directives.join("|")})(?=[\\s#<])`,"iy"),this._directiveMaxLength=Math.max(...e.directives.map(r=>r.length)),this._directiveStarts=e.directives.map(r=>r[0].toLowerCase()+r[0].toUpperCase()).join("")}this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,r){let i=this._input,n=0,s=this._linePosition+i.length;for(;;){for(;;){let E=i.charCodeAt(n),B=0;if(E===ht||E===dt){let P=i.charCodeAt(n+1);B=P===ht||P===dt?z(this._whitespace,i,n)[0].length:1,E=i.charCodeAt(n+B)}if(E===es){let P=z(this._commentLine,i,n);if(P){let K=P[0].length;if(!r&&n+K===i.length&&i.charCodeAt(i.length-1)===_t)return this._suspend(i,n,s);this.comments&&o(P[1],this._line,s-(i.length-n)+B),n+=K,s=i.length-n+P[2].length,this._line++}else{if(n+=B,!r)return this._suspend(i,n,s);this.comments&&o(i.slice(n+1),this._line,s-(i.length-n)),n=i.length;break}}else if(E===ni||E===_t){if(!r&&E===_t&&n+B+1===i.length)return this._suspend(i,n,s);B+=E===_t&&i.charCodeAt(n+B+1)===ni?2:1;let P=0,K=i.charCodeAt(n+B);if(K===ht||K===dt){let ut=i.charCodeAt(n+B+1);P=ut===ht||ut===dt?z(this._whitespace,i,n+B)[0].length:1}n+=B+P,s=i.length-n+P,this._line++}else{n+=B;break}}if(n>=i.length)return r&&this._previousMarker==="^^"?l(this,i,n):(this._linePosition=s,r?(a("eof","","",this._line,s,0),this._input=null):this._input="");let u=this._line,f=i[n],c="",_="",h="",b=null,d=0,y=0,g=0,S=!1,m=!1;switch(f){case"^":if(this._previousMarker==="^^")return l(this,i,n);if(i.length-n<3)break;if(i[n+1]==="^"){if(this._previousMarker="^^",n+=2,i[n]!=="<"){if(Lu(i.charCodeAt(n)))continue;S=!0;break}}else{this._n3Mode&&(d=1,c="^");break}case"<":if(b=z(this._unescapedIri,i,n))c="IRI",_=b[1],y=b[1].length+2;else if(b=z(this._iri,i,n)){if(_=this._unescape(b[1],Jn),_===null||Ru.test(_))return l(this,i,n);c="IRI",y=b[1].length+2}else i.length-n>2&&i[n+1]==="<"&&i[n+2]==="("?(c="<<(",d=3):!this._lineMode&&i.length-n>(r?1:2)&&i[n+1]==="<"?(c="<<",d=2):this._n3Mode&&i.length-n>1&&i[n+1]==="="?(d=2,this._isImpliedBy?(c="abbreviation",_="<"):(c="inverse",_=">")):this._n3Mode&&i.length-n>1&&i[n+1]==="-"&&(c="inversePredicate",d=2);break;case">":i.length-n>1&&i[n+1]===">"&&(c=">>",d=2);break;case"_":((b=z(this._blank,i,n))||r&&(b=ii(this._blank,i,n)))&&(c="blank",h="_",_=b[1],y=b[1].length+2);break;case'"':if(b=z(this._simpleQuotedString,i,n))_=b[1];else if({value:_,matchLength:d,finalLineLength:g,tripleQuoted:m}=this._parseLiteral(i,n),_===null)return l(this,i,n);(b!==null||d!==0)&&(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(b=z(this._simpleApostropheString,i,n))_=b[1];else if({value:_,matchLength:d,finalLineLength:g,tripleQuoted:m}=this._parseLiteral(i,n),_===null)return l(this,i,n);(b!==null||d!==0)&&(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(b=z(this._variable,i,n))&&(c="var",_=b[0]);break;case"@":if(this._previousMarker==="literal"&&(b=z(this._langcode,i,n))&&b[1]!=="version"){let E=n+b[0].length;!r&&i[E]==="-"&&i[E+1]!=="-"?b=null:(c="langcode",_=b[1])}else(b=z(this._atKeyword,i,n))&&(c=b[0]);break;case".":if(i.length-n===1?r:i[n+1]<"0"||i[n+1]>"9"){c=".",d=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":if(i[n+1]==="-"){this._previousMarker==="langcode"&&(i.startsWith("--ltr",n)?(c="dircode",_="ltr",d=5):i.startsWith("--rtl",n)&&(c="dircode",_="rtl",d=5));break}(b=z(this._number,i,n)||r&&(b=ii(this._number,i,n)))&&(c="literal",_=b[0],h=typeof b[1]=="string"?hr.double:typeof b[2]=="string"?hr.decimal:hr.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":case"V":case"v":(b=z(this._keyword,i,n))?c=b[0].toUpperCase():S=!0;break;case"f":case"t":ri(this._boolean,i,n)?(c="literal",_=f==="t"?"true":"false",h=hr.boolean,d=_.length):S=!0;break;case"a":ri(this._shortPredicates,i,n)?(c="abbreviation",_="a",d=1):S=!0;break;case"h":case"o":this._n3Mode&&(b=this._matchN3Verb(i,n,r))?c=b[0]:S=!0;break;case"i":this._n3Mode&&ri(this._n3Id,i,n)?(c="id",d=2):this._n3Mode&&(b=this._matchN3Verb(i,n,r))?c=b[0]:S=!0;break;case"=":this._n3Mode&&i.length-n>1&&(c="abbreviation",i[n+1]!==">"?(d=1,_="="):(d=2,_=">"));break;case"!":if(!this._n3Mode)break;case")":if(!r&&(i.length-n===1||i.length-n===2&&i[n+1]===">"))break;if(i.length-n>2&&i[n+1]===">"&&i[n+2]===">"){c=")>>",d=3;break}case",":case";":case"[":case"]":case"(":case"}":case"~":this._lineMode||(d=1,c=f);break;case"{":!this._lineMode&&i.length-n>=2&&(i[n+1]==="|"?(c="{|",d=2):(c=f,d=1));break;case"|":i.length-n>=2&&i[n+1]==="}"&&(c="|}",d=2);break;default:S=!0}if(S){let E;if((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&i.charCodeAt(E=ai(i,n))===ts&&E+1<i.length&&(i[E+1]==="#"||i[E+1]==="<"||rs(i.charCodeAt(E+1))))c="prefix",_=i.slice(n,E),d=E+1-n;else if(this._directive!==null&&this._directiveStarts.includes(f)&&((b=z(this._directive,i,n))||r&&i.length-n<=this._directiveMaxLength&&(b=ii(this._directive,i,n))))c=b[0].toUpperCase();else if(!this._lineMode&&(E=Zn(i,n,r))>=0){let B=i.indexOf(":",n);c="prefixed",h=i.slice(n,B),_=this._unescape(i.slice(B+1,E),ns),d=E-n}}if(this._previousMarker==="^^")switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return r||!i.startsWith("'''",n)&&!i.startsWith('"""',n)&&/\n|\r/.test(i.slice(n))?l(this,i,n):this._suspend(i,n,s);let w=d||b[0].length,x=s-(i.length-n),A;g?(A={type:c,value:_,prefix:h,line:u,start:x,end:g,endLine:this._line,tripleQuoted:m},e(null,A)):m?(A={type:c,value:_,prefix:h,line:u,start:x,end:x+w,tripleQuoted:m},e(null,A)):A=a(c,_,h,u,x,y||w),this.previousToken=A,this._previousMarker=c==="literal"&&(this._previousMarker==="VERSION"||this._previousMarker==="@version")?"version":c,n=Math.min(n+w,i.length),g&&(s=i.length-n+g)}function o(u,f,c){e(null,{type:"comment",value:u,prefix:"",line:f,start:c,end:c+u.length+1})}function a(u,f,c,_,h,b){let d={type:u,value:f,prefix:c,line:_,start:h,end:h+b};return e(null,d),d}function l(u,f,c){e(u._syntaxError(z(ju,f,c)[0]))}}_suspend(e,r,i){return this._linePosition=i-(e.length-r),this._input=e.slice(r)}_matchN3Verb(e,r,i){let n=z(this._n3Verb,e,r);if(!n)return null;let s=e[r+n[0].length];return s!=="-"&&s!=="_"&&(s<"0"||s>"9")&&s!=="\u1680"&&s!=="\uFEFF"?n:Zn(e,r,!0)>=0||!i&&ai(e,r)===e.length?null:n}_unescape(e,r){let i=e.indexOf("\\");if(i<0)return e;let n="",s=0;for(;i>=0&&i+1<e.length;){let o=e[i+1],a=i+2,l;if(o==="u"||o==="U"){if(a+=o==="u"?4:8,a>e.length)return null;let u=0;for(let f=i+2;f<a;f++){let c=e.charCodeAt(f);if(c>=48&&c<=57)c-=48;else if(c>=65&&c<=70)c-=55;else if(c>=97&&c<=102)c-=87;else return null;u=u*16+c}if(!vu(u))return null;l=String.fromCodePoint(u)}else{if(!(o in r))return null;l=r[o]}n+=e.slice(s,i)+l,s=a,i=e.indexOf("\\",s)}return n+e.slice(s)}_parseLiteral(e,r){if(e.length-r>=3){let i=e[r],n=e[r+1]===i&&e[r+2]===i?3:1,s=i;n===3&&(s=i==='"'?'"""':"'''");let o=r+Math.max(this._literalClosingPos,n);for(;(o=e.indexOf(s,o))>r;){let a=0;for(;e[o-a-1]==="\\";)a++;if(a%2===0){let l=e.substring(r+n,o),u=l.split(/\r\n|\r|\n/),f=u.length-1,c=o-r+n;if(n===1&&f!==0||n===3&&this._lineMode)break;this._line+=f;let _=f===0?0:u[u.length-1].length+n;return{value:this._unescape(l,Jn),matchLength:c,finalLineLength:_,tripleQuoted:n===3}}o++}this._literalClosingPos=e.length-r-n+1}return{value:"",matchLength:0,finalLineLength:0,tripleQuoted:!1}}_tryTokenizeToEnd(e,r){let i;try{this._tokenizeToEnd((n,s)=>{try{return e(n,s)}catch(o){throw i=o}},r)}catch(n){if(n===i||!(n instanceof RangeError))throw n;e(this._syntaxError(null,`Token too long on line ${this._line}.`))}}_syntaxError(e,r=`Unexpected "${e}" on line ${this._line}.`){this._input=null;let i=new Error(r);return i.context={token:void 0,line:this._line,previousToken:this.previousToken},i}_startTokenization(){return this._line=1,this._linePosition=0,this._previousMarker=void 0,this.previousToken=void 0,this._literalClosingPos=0,this._input=void 0,this._tokenization={}}_tokenizeString(e,r){this._startTokenization(),this._input=this._readStartingBom(e),this._tryTokenizeToEnd(r,!0)}_readStartingBom(e){return e.startsWith("\uFEFF")?(this._linePosition=1,e.slice(1)):e}tokenize(e,r){let i=this._startTokenization();if(typeof e=="string")if(this._input=this._readStartingBom(e),typeof r=="function")queueMicrotask(()=>{this._tokenization===i&&this._tryTokenizeToEnd(r,!0)});else{let n=[],s;if(this._tryTokenizeToEnd((o,a)=>o?s=o:n.push(a),!0),s)throw s;return n}else{let n,s=0;typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",o=>{if(this._tokenization===i&&this._input!==null&&o.length!==0){if(typeof o!="string"&&(n=n||new TextDecoder("utf-8",{ignoreBOM:!0}),!(o=n.decode(o,{stream:!0}))))return;typeof this._input=="undefined"?this._input=this._readStartingBom(o):this._input+=o,this._input.length>=s&&(this._tryTokenizeToEnd(r,!1),s=this._input!==null&&this._input.length>Cu?2*this._input.length:0)}}),e.on("end",()=>{if(this._tokenization===i&&this._input!==null){let o=n?n.decode():"";o&&(this._input=typeof this._input=="string"?this._input+o:o),typeof this._input=="string"&&this._tryTokenizeToEnd(r,!0)}}),e.on("error",o=>{this._tokenization===i&&r(o)})}}};var{rdf:ls,xsd:Ie}=j,gt,Bu=0,ci="<>";var ui={namedNode:us,blankNode:fs,variable:hs,literal:cs,defaultGraph:Du,quad:fi,triple:fi,fromTerm:Yt,fromQuad:ds},W=ui,Q=class t{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof t?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},Qe=class extends Q{constructor(e){e!==""?super(e):(super(ci),Object.defineProperty(this,"value",{value:""}))}get termType(){return"NamedNode"}},fe=class t extends Q{constructor(e){super(e)}get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let e=this.id,r=e.lastIndexOf('"')+1,i=e.lastIndexOf("--");return r<e.length&&e[r++]==="@"?(i>r?e.substr(0,i):e).substr(r).toLowerCase():""}get direction(){let e=this.id,r=e.lastIndexOf('"'),i=e.lastIndexOf("--");return i>r&&i+2<e.length?e.substr(i+2).toLowerCase():""}get datatype(){return new Qe(this.datatypeString)}get datatypeString(){let e=this.id,r=e.lastIndexOf('"')+1,i=r<e.length?e[r]:"";return i==="^"?e.substr(r+2):i!=="@"?Ie.string:e.indexOf("--",r)>0?ls.dirLangString:ls.langString}equals(e){return e instanceof t?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(this.direction===e.direction||this.direction===""&&!e.direction)&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,direction:this.direction,datatype:{termType:"NamedNode",value:this.datatypeString}}}},pt=class extends Q{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},bt=class extends Q{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},yt=class extends Q{constructor(){return super(""),gt||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};gt=new yt;function Re(t,e,r){if(e=e||ui,!t)return e.defaultGraph();switch(t[0]){case"?":return e.variable(t.substr(1));case"_":return e.blankNode(t.substr(2));case'"':if(e===ui)return new fe(t);if(t[t.length-1]==='"')return e.literal(t.substr(1,t.length-2));let i=t.lastIndexOf('"',t.length-1),n;if(t[i+1]==="@"){n=t.substr(i+2);let s=n.lastIndexOf("--");s>0&&s<n.length&&(n={language:n.substr(0,s),direction:n.substr(s+2)})}else n=e.namedNode(t.substr(i+3));return e.literal(t.substr(1,i-1),n);case"[":t=JSON.parse(t);break;case"<":if(t===ci)return e.namedNode("");default:if(!r||!Array.isArray(t))return e.namedNode(t)}return e.quad(Re(t[0],e,!0),Re(t[1],e,!0),Re(t[2],e,!0),t[3]&&Re(t[3],e,!0))}function Te(t,e){if(typeof t=="string")return t;if(t instanceof Q&&t.termType!=="Quad")return t.id;if(!t)return gt.id;switch(t.termType){case"NamedNode":{let i=t.value;return i!==""?i:ci}case"BlankNode":return`_:${t.value}`;case"Variable":return`?${t.value}`;case"DefaultGraph":return"";case"Literal":return`"${t.value}"${t.language?`@${t.language}${t.direction?`--${t.direction}`:""}`:t.datatype&&t.datatype.value!==Ie.string?`^^${t.datatype.value}`:""}`;case"Quad":let r=[Te(t.subject,!0),Te(t.predicate,!0),Te(t.object,!0)];return t.graph&&t.graph.termType!=="DefaultGraph"&&r.push(Te(t.graph,!0)),e?r:JSON.stringify(r);default:throw new Error(`Unexpected termType: ${t.termType}`)}}var Ae=class extends Q{constructor(e,r,i,n){super(""),this._subject=e,this._predicate=r,this._object=i,this._graph=n||gt}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 us(t){return new Qe(t)}function fs(t){return new pt(t||`n3-${Bu++}`)}function cs(t,e){if(typeof e=="string")return new fe(`"${t}"@${e.toLowerCase()}`);if(e!==void 0&&!("termType"in e))return new fe(`"${t}"@${e.language.toLowerCase()}${e.direction?`--${e.direction.toLowerCase()}`:""}`);let r=e?e.value:"";return r===""&&(typeof t=="boolean"?r=Ie.boolean:typeof t=="number"?Number.isFinite(t)?r=Number.isInteger(t)&&Math.abs(t)<1e21?Ie.integer:Ie.double:(r=Ie.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")):typeof t=="bigint"?r=Ie.integer:t instanceof Date&&!Number.isNaN(t.getTime())&&(r=Ie.dateTime,t=t.toISOString())),r===""||r===Ie.string?new fe(`"${t}"`):new fe(`"${t}"^^${r}`)}function hs(t){return new bt(t)}function Du(){return gt}function fi(t,e,r,i){return new Ae(t,e,r,i)}function Yt(t){if(t instanceof Q)return t;switch(t.termType){case"NamedNode":return us(t.value);case"BlankNode":return fs(t.value);case"Variable":return hs(t.value);case"DefaultGraph":return gt;case"Literal":return cs(t.value,t.language?t.direction?{language:t.language,direction:t.direction}:t.language:t.datatype);case"Quad":return ds(t);default:throw new Error(`Unexpected termType: ${t.termType}`)}}function ds(t){if(t instanceof Ae)return t;if(t.termType!=="Quad")throw new Error(`Unexpected termType: ${t.termType}`);return fi(Yt(t.subject),Yt(t.predicate),Yt(t.object),Yt(t.graph))}var _s=0,ps=/(^|\/)\.\.?($|[/#?])/,Ou=/^[^?#]*(?:^|\/)\.\.?(?:$|[/#?])/,ce=class t{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&ys(this,e.factory);let r=typeof e.format=="string"?e.format.match(/(?:^|\W)(\w*)$/)[1].toLowerCase():"",i=/turtle/.test(r),n=/trig/.test(r),s=/triple/.test(r),o=/quad/.test(r),a=this._n3Mode=/n3/.test(r),l=s||o;if(this._emitCurrent=this._emit,a&&(this._createQuad=this._createQuadInDirection,this._emit=this._emitInDirection,this._emitCurrent=this._emitCurrentInDirection),(this._supportsNamedGraphs=!(i||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||n||s||a),this._isImpliedBy=e.isImpliedBy,this._implicitEmptyPrefix=!!e.implicitEmptyPrefix,this._emptyFormulaAsTrue=!!e.emptyFormulaAsTrue,l&&(this._resolveRelativeIRI=f=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._directives=null,e.directives){this._directives=Object.create(null);for(let f of e.directives)this._directives[`@${f.toLowerCase()}`]=this._directives[f.toUpperCase()]=f}this._lexer=e.lexer||new Se({lineMode:l,n3:a,isImpliedBy:this._isImpliedBy,directives:e.directives}),this._explicitQuantifiers=!!e.explicitQuantifiers,this._formulaScopedBlankNodes=!!e.formulaScopedBlankNodes,this._parseUnsupportedVersions=!!e.parseUnsupportedVersions,this._version=e.version;let u=e.maxTripleTermDepth;this._maxTripleTermDepth=u===1/0||Number.isInteger(u)&&u>=0?u:1024}static _resetBlankNodePrefix(){_s=0}_setBase(e){if(!e)this._base="",this._basePath="",this._basePathHasDotSegments=!1;else{let r=e.indexOf("#");r>=0&&(e=e.substr(0,r)),this._base=e;let i=e.indexOf("?"),n=i<0?e:e.substr(0,i);this._basePath=e.indexOf("/")<0?e:n.substr(0,n.lastIndexOf("/")+1);let s=e;e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(\/\/[^\/?#]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1],e[2]!==void 0&&(s.length===this._baseRoot.length||s[this._baseRoot.length]==="?")&&(this._basePath=`${this._baseRoot}/`),this._basePathHasDotSegments=ps.test(this._basePath)}}_enterTripleTerm(e,r,i,n){return this._tripleTermDepth>=this._maxTripleTermDepth?(this._error(`Triple terms nested deeper than ${this._maxTripleTermDepth} level${this._maxTripleTermDepth===1?"":"s"}`,n),!1):(this._tripleTermDepth++,this._saveContext(e,this._graph,r,i,null),this._graph=null,!0)}_saveContext(e,r,i,n,s){if(!this._n3Mode){this._contextStack.push({type:e,subject:i,predicate:n,object:s,graph:r});return}let o={type:e,subject:i,predicate:n,object:s,graph:r,inverse:this._inversePredicate,expectOf:this._expectOf,blankPrefix:this._prefixes._,prefixChanges:this._prefixChanges,quantifiedChanges:this._quantifiedChanges,emptyFormula:this._emptyFormula};e==="formula"&&(o.base=[this._base,this._basePath,this._baseRoot,this._baseScheme,this._basePathHasDotSegments],this._prefixChanges=[]),this._contextStack.push(o),this._inversePredicate=!1,this._expectOf=!1,(!this._formulaScopedBlankNodes||e==="formula")&&(this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantifiedChanges=[]),e==="formula"&&(this._subject=null,this._emptyFormula=!0)}_restoreContext(e,r){let i=this._contextStack.pop();if(!i||i.type!==e)return this._error(`Unexpected ${r.type}`,r);this._subject=i.subject,this._predicate=i.predicate,this._object=i.object,this._graph=i.graph,this._n3Mode&&(this._inversePredicate=i.inverse,this._expectOf=i.expectOf,e==="formula"&&([this._base,this._basePath,this._baseRoot,this._baseScheme,this._basePathHasDotSegments]=i.base),this._prefixChanges!==i.prefixChanges&&(bs(this._prefixes,this._prefixChanges),this._prefixChanges=i.prefixChanges),this._prefixes._=i.blankPrefix,this._quantifiedChanges!==i.quantifiedChanges&&(bs(this._quantified,this._quantifiedChanges),this._quantifiedChanges=i.quantifiedChanges),this._emptyFormula=i.emptyFormula)}_readBeforeTopContext(e){return this._version&&!this._isValidVersion(this._version)?this._error(`Detected unsupported version as media type parameter: "${this._version}"`,e):this._readInTopContext(e)}_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"VERSION":this._sparqlStyle=!0;case"@version":return this._readVersion;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._directives!==null&&e.type in this._directives&&this._graph===null?(this._sparqlStyle=e.type[0]!=="@",this._directiveCallback(this._directives[e.type]),this._readDeclarationPunctuation):this._readSubject(e)}}_readInFormulaContext(e){switch(e.type){case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;default:return this._readSubject(e)}}_getStatementReader(){let e=this._contextStack[this._contextStack.length-1];return e&&e.type==="formula"?this._readInFormulaContext:this._readInTopContext}_readEntity(e,r){let i;switch(e.type){case"IRI":case"typeIRI":let n=this._resolveIRI(e.value);if(n===null)return this._error("Invalid IRI",e);i=this._factory.namedNode(n);break;case"type":case"prefixed":let s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);i=this._factory.namedNode(s+e.value);break;case"blank":i=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":i=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!r&&this._n3Mode&&i.id in this._quantified&&(i=this._quantified[i.id]),i}_readList(e,r,i,n){let s=this._contextStack;return(s.length&&s[s.length-1]).type==="<<"?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,r,i,n),this._subject=null,this._readListItem)}_readSubject(e){switch(this._predicate=null,e.type!=="}"&&(this._emptyFormula=!1),e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._readList(e,this.RDF_NIL,null,null);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readInFormulaContext):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":return this._n3Mode?e.prefix.length===0?(this._literalValue=e.value,this._completeSubjectLiteral):(this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),this._getPathReader(this._readPredicateOrNamedGraph)):this._error("Unexpected literal",e);case"<<(":return this._n3Mode?this._enterTripleTerm("<<(",null,null,e)&&this._readSubject:this._error("Disallowed triple term as subject",e);case"<<":return this._enterTripleTerm("<<",null,null,e)&&this._readSubject;default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let r=e.type,i=!1;switch(r){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case"has":return this._readPredicateAfterVerb;case"is":return this._inversePredicate=!0,this._expectOf=!0,this._readPredicateAfterVerb;case"inversePredicate":return this._inversePredicate=!0,this._readPredicateAfterVerb;case"|}":return this._subject=null,this._readAnnotationBlockPunctuation(e);case".":case"]":case"}":return this._predicate===null&&!this._n3Mode?this._error(`Unexpected ${r}`,e):(this._subject=null,r==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completePredicateLiteral;this._predicate=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),i=!0;break;case"(":return this._n3Mode?this._readList(e,this._subject,this.RDF_NIL,null):this._error(`Expected entity but got ${r}`,e);case"[":return this._n3Mode?(this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead):this._error("Disallowed blank node as predicate",e);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._graph=this._factory.blankNode(),null),this._readSubject):this._readEntity(e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return;i=this._n3Mode}return this._validAnnotation=!0,i?this._getPathReader(this._readObject,"predicate"):this._readObject}_readPredicateAfterVerb(e){return e.type==="has"||e.type==="is"||e.type==="of"||e.type==="inversePredicate"?this._error(`Expected expression but got ${e.type}`,e):this._readPredicate(e)}_readObject(e){if(this._expectOf)return e.type!=="of"?this._error(`Expected of but got ${e.type}`,e):(this._expectOf=!1,this._readObject);switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;if(this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),this._n3Mode)return this._getPathReader(this._getContextEndReader());break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._readList(e,this._subject,this._predicate,this.RDF_NIL);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readInFormulaContext):this._error("Unexpected graph",e);case"<<(":return this._enterTripleTerm("<<(",this._subject,this._predicate,e)&&this._readSubject;case"<<":return this._enterTripleTerm("<<",this._subject,this._predicate,e)&&this._readSubject;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){if(e.type==="]")return this._subject=null,this._readBlankNodeTail(e);{let r=this._contextStack;return(r.length>1&&r[r.length-2]).type==="<<"?this._error("Unexpected compound blank node expression in reified triple",e):e.type==="id"?this._readIriPropertyListId:(this._predicate=null,this._readPredicate(e))}}_readIriPropertyListId(e){let r=this._readEntity(e);if(r===void 0)return;if(r.termType!=="NamedNode")return this._error(`Expected IRI after id but got ${e.type}`,e);let i=this._subject;this._subject=r;let n=this._contextStack[this._contextStack.length-1];return n.subject===i&&(n.subject=r),n.predicate===i&&(n.predicate=r),n.object===i&&(n.object=r),this._predicate=null,this._readIriPropertyListPredicate}_readIriPropertyListPredicate(e){return e.type===";"||e.type==="]"||e.type==="."||e.type==="}"?this._error(`Expected predicate but got ${e.type}`,e):this._readPredicate(e)}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let r=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._getPathReader(this._readObject,"predicate"):r?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 r=null,i=null,n=this._readListItem,s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,i=this._factory.blankNode(),this.RDF_FIRST,this._subject=r=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,i=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"){if(this._n3Mode)return s!==null&&this._emit(s,this.RDF_REST,this.RDF_NIL,this._graph),this._saveContext("item",this._graph,this._subject,this._predicate,this._object),this._subject=this._object,this._predicate=null,this._getPathReader(this._readListItem);this._emit(this._subject,this._predicate,this._object,this._graph)}if(this._predicate===null){if(n=this._n3Mode?this._getPathReader(this._readPredicate):this._readPredicate,this._subject===this.RDF_NIL)return n}else if(this._object===null){if(n=this._getPathReader(this._readObject,"predicate"),this._predicate===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._n3Mode&&(n=this._getPathReader(n)),this._object===this.RDF_NIL)return n;i=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(r=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(i=this._factory.blankNode(),r=this._factory.blankNode(),s===null?a.predicate===null?a.subject=i:a.object=i:this._emit(s,this.RDF_REST,i,this._graph),this._emit(i,this.RDF_FIRST,r,this._graph),this._saveContext("formula",this._graph,i,this.RDF_FIRST,this._graph=r),this._subject=null,this._readInFormulaContext):this._error("Unexpected graph",e);case"<<(":case"<<":if(!this._enterTripleTerm(e.type,null,null,e))return;n=this._readSubject;break;default:if((r=this._readEntity(e))===void 0)return}if(i===null&&(this._subject=i=this._factory.blankNode()),(e.type==="<<"||e.type==="<<(")&&(o[o.length-1].subject=this._subject),s===null?a.predicate===null?a.subject=i:a.object===null?a.predicate=i:a.object=i:this._emit(s,this.RDF_REST,i,this._graph),r!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"||e.type==="var"||e.type==="blank"||e.type==="literal"))return this._saveContext("item",this._graph,i,this.RDF_FIRST,r),this._subject=r,this._predicate=null,this._getPathReader(this._readListItem);this._emit(i,this.RDF_FIRST,r,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e,r){let i,n=!1;switch(e.type){case"type":case"typeIRI":let s=this._readEntity(e);if(s===void 0)return;if(s.value===j.rdf.langString||s.value===j.rdf.dirLangString)return this._error("Detected illegal (directional) languaged-tagged string with explicit datatype",e);i=this._factory.literal(this._literalValue,s),e=null;break;case"langcode":if(e.value.split("-").some(o=>o.length>8))return this._error("Detected language tag with subtag longer than 8 characters",e);i=this._factory.literal(this._literalValue,e.value),this._literalLanguage=e.value,e=null,this._literalComponent=r,n=!0;break;default:i=this._factory.literal(this._literalValue)}return{token:e,literal:i,readCb:n}}_readDirCode(e){let r=this._literalComponent,i=this._literalListItem;if(e.type==="dircode"){let n=this._factory.literal(this._literalValue,{language:this._literalLanguage,direction:e.value});r==="subject"?this._subject=n:r==="predicate"?this._predicate=n:this._object=n,this._literalLanguage=void 0,e=null}if(r==="subject"||r==="predicate"){let n=r==="subject"?this._readPredicateOrNamedGraph:this._readObject;return this._getPathEndReader(e,n,r)||n.call(this,e)}return this._completeObjectLiteralPost(e,i)}_completeTermLiteral(e,r){let i=this._completeLiteral(e,r);if(!i)return;let n;if(r==="subject"?(this._subject=i.literal,n=this._readPredicateOrNamedGraph):(this._predicate=i.literal,this._validAnnotation=!0,n=this._readObject),i.readCb)return this._literalListItem=!1,this._readDirCode;let s=this._getPathEndReader(i.token,n,r);return s||n.call(this,i.token)}_completeSubjectLiteral(e){return this._completeTermLiteral(e,"subject")}_completePredicateLiteral(e){return this._completeTermLiteral(e,"predicate")}_completeObjectLiteral(e,r){let i=this._completeLiteral(e,"object");if(i)return this._object=i.literal,i.readCb?(this._literalListItem=r,this._readDirCode):this._completeObjectLiteralPost(i.token,r)}_completeObjectLiteralPost(e,r){return this._n3Mode&&(e===null||e.type==="!"||e.type==="^")?r?(this._saveContext("item",this._graph,this._subject,this.RDF_FIRST,this._object),this._subject=this._object,this._predicate=null,this._getPathEndReader(e,this._readListItem)):this._getPathEndReader(e,this._getContextEndReader()):(r&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),e===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(e)))}_readFormulaTail(e){if(e.type!=="}")return this._readPunctuation(e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let r=this._graph,i=this._emptyFormula;return this._restoreContext("formula",e),i&&this._emptyFormulaAsTrue&&(this._subject===r?this._subject=this.N3_TRUE:this._predicate===r?this._predicate=this.N3_TRUE:this._object=this.N3_TRUE),this._object!==null?this._getPathReader(this._getContextEndReader(),"object"):this._predicate!==null?this._getPathReader(this._readObject,"predicate"):this._getPathReader(this._readPredicate,"subject")}_readPunctuation(e){let r,i=this._graph,n=this._subject,s=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,this._tripleTerm=null,r=this._getStatementReader(),s&&(this._inversePredicate=!1);break;case";":s&&(this._inversePredicate=!1),r=this._readPredicate;break;case",":r=this._readObject;break;case"~":case"{|":return this._readAnnotationStart(e);case"|}":return this._error("Unexpected annotation syntax closing",e);default:if(this._supportsQuads&&this._graph===null&&(i=this._readEntity(e))!==void 0){r=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(n!==null){let o=this._predicate,a=this._object;this._emit(n,o,a,i,s)}return r}_readBlankNodePunctuation(e){let r,i=!1;switch(e.type){case";":i=this._inversePredicate,r=this._readPredicate;break;case",":r=this._readObject;break;case"~":case"{|":return this._readAnnotationStart(e);case"|}":return this._error("Unexpected annotation syntax closing",e);default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emitCurrent(this._subject,this._predicate,this._object,this._graph),i&&(this._inversePredicate=!1),r}_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);let r=this._readEntity(e);return this._prefixChanges!==null&&this._prefixChanges.push(this._prefix,this._prefixes[this._prefix]),this._prefixes[this._prefix]=r.value,this._prefixCallback(this._prefix,r),this._readDeclarationPunctuation}_readBaseIRI(e){let r=e.type==="IRI"&&this._resolveIRI(e.value);return r?(this._setBase(r),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_isValidVersion(e){return this._parseUnsupportedVersions||t.SUPPORTED_VERSIONS.includes(e)}_readVersion(e){return e.type!=="literal"?this._error("Expected literal to follow version declaration",e):e.prefix!==""||e.tripleQuoted?this._error("Version declarations must use single quotes",e):(this._versionCallback(e.value),this._isValidVersion(e.value)?this._readDeclarationPunctuation:this._error(`Detected unsupported version: "${e.value}"`,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._getStatementReader().call(this,e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._getStatementReader()}_readQuantifierList(e){let r;switch(e.type){case"IRI":case"prefixed":if((r=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,r,this.QUANTIFIERS_GRAPH)):(this._quantifiedChanges!==null&&this._quantifiedChanges.push(r.id,this._quantified[r.id]),this._quantified[r.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,r){return this._afterPath=e,this._pathPosition=r||(this._predicate===null?"subject":"object"),this._readPath}_getPathEndReader(e,r,i){if(e!==null&&e.type!=="!"&&e.type!=="^")return null;let n=this._getPathReader(r,i);return e===null?n:n.call(this,e)}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let r=this._afterPath,i=this._contextStack,n=i.length&&i[i.length-1];if(n&&n.type==="item"){let s=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,s,this._graph)}return this._afterPath=null,this._pathPosition=null,r.call(this,e)}}_readForwardPath(e){let r,i,n=this._factory.blankNode();if((i=this._readEntity(e))!==void 0)return this._pathPosition==="subject"?(r=this._subject,this._subject=n):this._pathPosition==="predicate"?(r=this._predicate,this._predicate=n):(r=this._object,this._object=n),this._emit(r,i,n,this._graph),this._readPath}_readBackwardPath(e){let r=this._factory.blankNode(),i,n;if((i=this._readEntity(e))!==void 0)return this._pathPosition==="subject"?(n=this._subject,this._subject=r):this._pathPosition==="predicate"?(n=this._predicate,this._predicate=r):(n=this._object,this._object=r),this._emit(r,i,n,this._graph),this._readPath}_readTripleTermTail(e){if(e.type!==")>>")return this._error(`Expected )>> but got ${e.type}`,e);let r=this._createQuad(this._subject,this._predicate,this._object,this._graph,this._inversePredicate);this._restoreContext("<<(",e),this._tripleTermDepth--;let i=this._contextStack,n=i.length&&i[i.length-1];return n&&n.type==="list"?(this._emit(this._subject,this.RDF_FIRST,r,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=r,this._readPredicate):(this._object=r,this._getContextEndReader())}_readReifiedTripleTailOrReifier(e){return e.type==="~"?this._readReifier:this._readReifiedTripleTail(e)}_readReifiedTripleTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);this._tripleTerm=null;let r=this._readTripleTerm();this._restoreContext("<<",e),this._tripleTermDepth--;let i=this._contextStack,n=i.length&&i[i.length-1];return n&&n.type==="list"?(this._emit(this._subject,this.RDF_FIRST,r,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=r,this._readPredicateOrReifierTripleEnd):(this._object=r,this._getContextEndReader())}_readPredicateOrReifierTripleEnd(e){return e.type==="."?(this._subject=null,this._readPunctuation(e)):this._readPredicate(e)}_readReifier(e){return e.type===">>"?this._readReifiedTripleTail(e):(this._reifier=this._readEntity(e),this._readReifiedTripleTail)}_readAnnotationStart(e){return this._emitCurrent(this._subject,this._predicate,this._object,this._graph),this._tripleTerm=null,this._readAnnotation(e)}_readAnnotation(e){switch(e.type){case"~":return this._readReifierInAnnotation;case"{|":return this._readAnnotationBlockHead(e)}switch(this._tripleTerm=null,e.type){case";":return this._inversePredicate=!1,this._readPredicate;case",":return this._readObject;default:return this._subject=null,this._getContextEndReader().call(this,e)}}_readReifierInAnnotation(e){switch(e.type){case"IRI":case"typeIRI":case"type":case"prefixed":case"blank":case"var":return this._reifier=this._readEntity(e),this._readAnnotationBlockOrReifier}return this._reifier=this._factory.blankNode(),this._readAnnotationBlockOrReifier(e)}_readAnnotationBlockOrReifier(e){return e.type==="{|"?this._readAnnotationBlockHead(e):(this._readTripleTerm(),this._readAnnotation(e))}_readAnnotationBlockHead(e){let r=this._readTripleTerm();return this._saveContext("annotation",this._graph,this._subject,this._predicate,this._object),this._contextStack[this._contextStack.length-1].tripleTerm=this._tripleTerm,this._subject=r,this._predicate=this._object=this._tripleTerm=null,this._inversePredicate=!1,this._validAnnotation=!1,this._readPredicate}_readAnnotationBlockPunctuation(e){let r=this._contextStack;if(e.type==="|}"){if(!r.length||r[r.length-1].type!=="annotation")return this._error("Unexpected annotation syntax closing",e);if(!this._validAnnotation)return this._error("Annotation block can not be empty",e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let{tripleTerm:i}=r[r.length-1];return this._restoreContext("annotation",e),this._tripleTerm=i,this._readAnnotation}return this._readBlankNodePunctuation(e)}_readTripleTerm(){let e=this._contextStack,r=e.length&&e[e.length-1],i=r?r.graph:void 0,n=this._reifier||this._factory.blankNode();return this._reifier=null,this._tripleTerm=this._tripleTerm||this._createQuad(this._subject,this._predicate,this._object,null,this._inversePredicate),this._emit(n,this.RDF_REIFIES,this._tripleTerm,i||this._graph||this.DEFAULTGRAPH),n}_getContextEndReader(){let 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._readTripleTermTail;case"<<":return this._readReifiedTripleTailOrReifier;case"annotation":return this._readAnnotationBlockPunctuation}}_createQuad(e,r,i,n){return this._factory.quad(e,r,i,n||this.DEFAULTGRAPH)}_createQuadInDirection(e,r,i,n,s){return s?this._factory.quad(i,r,e,n||this.DEFAULTGRAPH):this._factory.quad(e,r,i,n||this.DEFAULTGRAPH)}_emitInDirection(e,r,i,n,s){this._callback(null,this._createQuad(e,r,i,n,s))}_emitCurrentInDirection(e,r,i,n){this._callback(null,this._createQuad(e,r,i,n,this._inversePredicate))}_emit(e,r,i,n){this._callback(null,this._factory.quad(e,r,i,n||this.DEFAULTGRAPH))}_error(e,r){let i=` on line ${r.line}.`;e.length+i.length>200&&(e=`${e.slice(0,199-i.length)}\u2026`);let n=new Error(`${e}${i}`);n.context={token:r,line:r.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=mt}_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"?":{let r=this._base.indexOf("?");return(r<0?this._base:this._base.substr(0,r))+e}case"/":return e[1]!=="/"?this._baseRoot+this._removeDotSegments(e):this._baseScheme?this._removeDotSegments(this._baseScheme+e):this._removeDotSegments(`:${e}`).substr(1);default:return/^[^/:]*:/.test(e)?null:this._basePathHasDotSegments||Ou.test(e)?this._removeDotSegments(this._basePath+e):this._basePath+e}}_removeDotSegments(e){if(!ps.test(e))return e;let r=e.length,i="",n=-1,s=-1,o=0,a="/";for(;n<r;){switch(a){case":":if(s<0&&e[++n]==="/"&&e[++n]==="/")for(;(s=n+1)<r&&e[s]!=="/"&&e[s]!=="?"&&e[s]!=="#";)n=s;break;case"?":case"#":n=r;break;case"/":if(e[n+1]===".")switch(a=e[++n+1],a){case"/":i+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return i+e.substring(o,n)+e.substr(n+1);case".":if(a=e[++n+1],a===void 0||a==="/"||a==="?"||a==="#"){if(i+=e.substring(o,n-2),(o=i.lastIndexOf("/"))>=s&&(i=i.substr(0,o)),a!=="/")return`${i}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return i+e.substring(o)}parse(e,r,i,n){let s,o,a,l,u,f,c;r&&(r.onQuad||r.onPrefix||r.onComment||r.onVersion||r.onDirective||r.onToken||r.onTokenEnd)?(s=r.onQuad,o=r.onPrefix,a=r.onComment,l=r.onVersion,u=r.onDirective,f=r.onToken,c=r.onTokenEnd):(s=r,o=i,l=n),this._readCallback=this._readBeforeTopContext,this._contextStack=[],this._graph=this._subject=this._predicate=this._object=null,this._tripleTerm=this._reifier=null,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${_s++}_`,this._n3Mode&&this._implicitEmptyPrefix&&this._base&&(this._prefixes[""]=this._resolveIRI("#")),this._prefixCallback=o||mt,this._versionCallback=l||mt,this._directiveCallback=u||mt,this._inversePredicate=!1,this._expectOf=!1,this._quantified=Object.create(null),this._prefixChanges=null,this._quantifiedChanges=null,this._emptyFormula=!1,this._tripleTermDepth=0;let _=d=>this._readCallback=this._readCallback(d),h=_;if((a||this._lexer.comments)&&(this._lexer.comments=!0,h=d=>d.type!=="comment"?_(d):(a&&a(d.value),this._readCallback)),f||c){let d=h;h=y=>{try{try{return f&&f(y),d(y)}finally{c&&c(y)}}catch(g){throw this._readCallback=null,g}}}if(!s){let d=[],y;this._callback=(S,m)=>{S?y=S:m&&d.push(m)};let g=this._lexer;if(!o&&!l&&!u&&!a&&!f&&!c&&g.tokenize===Se.prototype.tokenize&&typeof g._tokenizeString=="function"){let S=[this._base,this._basePath,this._baseRoot,this._baseScheme];g._tokenizeString(e,(m,w)=>{m?([this._base,this._basePath,this._baseRoot,this._baseScheme]=S,this._callback(m),this._callback=mt):this._readCallback&&h(w)})}else g.tokenize(e).every(h);if(y)throw y;return d}let b=(d,y)=>{d!==null?(this._callback(d),this._callback=mt):this._readCallback&&h(y)};this._callback=s,this._lexer.tokenize(e,b)}};function bs(t,e){for(let r=e.length-2;r>=0;r-=2)e[r+1]===void 0?delete t[e[r]]:t[e[r]]=e[r+1]}function mt(){}function ys(t,e){t._factory=e,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=e.namedNode(j.rdf.first),t.RDF_REST=e.namedNode(j.rdf.rest),t.RDF_NIL=e.namedNode(j.rdf.nil),t.RDF_REIFIES=e.namedNode(j.rdf.reifies),t.N3_FORALL=e.namedNode(j.r.forAll),t.N3_FORSOME=e.namedNode(j.r.forSome),t.N3_TRUE=e.literal("true",e.namedNode(j.xsd.boolean)),t.ABBREVIATIONS={a:e.namedNode(j.rdf.type),"=":e.namedNode(j.owl.sameAs),">":e.namedNode(j.log.implies),"<":e.namedNode(j.log.isImpliedBy)},t.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}ce.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"];ys(ce.prototype,W);var _r={};Kn(_r,{inDefaultGraph:()=>Wu,isBlankNode:()=>$u,isDefaultGraph:()=>se,isLiteral:()=>ku,isNamedNode:()=>Mu,isQuad:()=>qu,isVariable:()=>Uu,prefix:()=>Gu,prefixes:()=>gs});function Mu(t){return!!t&&t.termType==="NamedNode"}function $u(t){return!!t&&t.termType==="BlankNode"}function ku(t){return!!t&&t.termType==="Literal"}function Uu(t){return!!t&&t.termType==="Variable"}function qu(t){return!!t&&t.termType==="Quad"}function se(t){return!!t&&t.termType==="DefaultGraph"}function Wu(t){return se(t.graph)}function Gu(t,e){return gs({"":t.value||t},e)("")}function gs(t,e){let r=Object.create(null);for(let n in t)i(n,t[n]);e=e||W;function i(n,s){if(typeof s=="string"){let o=Object.create(null);r[n]=a=>o[a]||(o[a]=e.namedNode(s+a))}else if(!(n in r))throw new Error(`Unknown prefix: ${n}`);return r[n]}return i}function Ve(t){return t.replace(/[.*+?^${}()|[\]\\/-]/g,"\\$&")}var zu=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Qu=/^(?:(?!\.\.?(?:[/?#]|$))[^/?#]+(?:\/[^/?#]{3,})*\/?)?(?:[?#]|$)/,ms="./",Vu="../",hi="?",ws="#",Me=class t{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!zu.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!t.supports(this.base))return this._baseMatcher=/.^/;let e=/^[^:]*:\/*/.exec(this.base)[0],r=["^",Ve(e)],i=[],n=[],s=/[^/?#]*([/?#])/y,o,a=0,l=0,u=s.lastIndex=e.length;for(;!a&&!l&&(o=s.exec(this.base));)o[1]===ws?l=s.lastIndex-1:(r.push(Ve(o[0]),"(?:"),i.push(")?"),o[1]!==hi?n.push(u=s.lastIndex):(a=u=s.lastIndex,l=this.base.indexOf(ws,a),this._pathReplacements[a]=hi));for(let f=0;f<n.length;f++)this._pathReplacements[n[f]]=Vu.repeat(n.length-f-1);return this._pathReplacements[n[n.length-1]]=ms,this._baseLength=l>0?l:this.base.length,r.push(Ve(this.base.substring(u,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...r,...i].join(""))}toRelative(e){let r=this._getBaseMatcher().exec(e);if(!r)return e;let i=r[0].length;if(i===this._baseLength&&i===e.length)return"";let n=this._pathReplacements[i];if(n){let s=e.substring(i);return n!==hi&&!Qu.test(s)?e:n===ms&&/^[^?#]/.test(s)&&(s.indexOf(":")<0||!/^[^/?#]*:/.test(s))?s:n+s}return e.substring(i-1)}};var wt=W.defaultGraph(),{rdf:Hu,xsd:xt}=j,{hasOwnProperty:Ku}=Object.prototype,Yu=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Ju=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Xu=/[^ !#-\[\]-~\u0080-\uFFFD]/,Zu=/[^ !#-\[\]-~\u0080-\uFFFD]/g,Es={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},ef=/["\\\u0000-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?:^|[^\ud800-\udbff])[\udc00-\udfff]/,Ss="A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD_:0-9",xs=`${Ss}\\-\\u00B7\\u0300-\\u036F\\u203F\\u2040`,di="%[0-9A-Fa-f]{2}",tf=new RegExp(`^(?:(?:[${Ss}]|${di})(?:(?:[${xs}.]|${di})*(?:[${xs}]|${di}))?)?$`),He=class extends Q{equals(e){return e===this}},oe=class{constructor(e,r){if(this._prefixRegex=/$0^/,this._hasPrefixes=!1,e&&typeof e.write!="function"&&(r=e,e=null),r=r||{},this._lists=r.lists,e)this._outputStream=e,this._endStream=r.end===void 0?!0:!!r.end;else{let i="";this._outputStream={write(n,s,o){i+=n,o&&o()},end:n=>{n&&n(null,i)}},this._endStream=!0}if(r.version&&ef.test(r.version))throw new Error(`Invalid version label: ${JSON.stringify(r.version)}`);this._subject=null,/triple|quad/i.test(r.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine,this._escape=Xu,this._escapeAll=Zu,this._characterReplacer=nf,r.version&&this._write(`VERSION "${r.version}"
5
- `)):(this._lineMode=!1,this._escape=Yu,this._escapeAll=Ju,this._characterReplacer=rf,this._graph=wt,r.version&&this._write(`@version "${r.version}".
1
+ var N3=(()=>{var ou=Object.create;var Vt=Object.defineProperty,au=Object.defineProperties,lu=Object.getOwnPropertyDescriptor,uu=Object.getOwnPropertyDescriptors,fu=Object.getOwnPropertyNames,Gn=Object.getOwnPropertySymbols,cu=Object.getPrototypeOf,zn=Object.prototype.hasOwnProperty,hu=Object.prototype.propertyIsEnumerable;var ft=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),du=t=>{throw TypeError(t)};var Qn=(t,e,r)=>e in t?Vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,M=(t,e)=>{for(var r in e||(e={}))zn.call(e,r)&&Qn(t,r,e[r]);if(Gn)for(var r of Gn(e))hu.call(e,r)&&Qn(t,r,e[r]);return t},Oe=(t,e)=>au(t,uu(e));var T=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(r){throw e=0,r}},Vn=(t,e)=>{for(var r in e)Vt(t,r,{get:e[r],enumerable:!0})},Hn=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of fu(e))!zn.call(t,n)&&n!==r&&Vt(t,n,{get:()=>e[n],enumerable:!(i=lu(e,n))||i.enumerable});return t};var ei=(t,e,r)=>(r=t!=null?ou(cu(t)):{},Hn(e||!t||!t.__esModule?Vt(r,"default",{value:t,enumerable:!0}):r,t)),_u=t=>Hn(Vt({},"__esModule",{value:!0}),t);var q=function(t,e){this[0]=t,this[1]=e},ee=(t,e,r)=>{var i=(a,l,u,f)=>{try{var c=r[a](l),d=(l=c.value)instanceof q,h=c.done;Promise.resolve(d?l[0]:l).then(b=>d?i(a==="return"?a:"next",l[1]?{done:b.done,value:b.value}:b,u,f):u({value:b,done:h})).catch(b=>i("throw",b,u,f))}catch(b){f(b)}},n=(a,l,u,f)=>o[a]=c=>(l=new Promise((d,h,b)=>(b=()=>i(a,c,d,h),s?s.then(b):b())),f=()=>s===u&&(s=0),s=u=l.then(f,f),l),s,o={};return r=r.apply(t,e),o[ft("asyncIterator")]=()=>o,n("next"),n("throw"),n("return"),o},ne=t=>{var e=t[ft("asyncIterator")],r=!1,i,n={};return e==null?(e=t[ft("iterator")](),i=s=>n[s]=o=>e[s](o)):(e=e.call(t),i=s=>n[s]=o=>{if(r){if(r=!1,s==="throw")throw o;return o}return r=!0,{done:!1,value:new q(new Promise(a=>{var l=e[s](o);l instanceof Object||du("Object expected"),a(l)}),1)}}),n[ft("iterator")]=()=>n,i("next"),"throw"in e?i("throw"):n.throw=s=>{throw s},"return"in e&&i("return"),n},J=(t,e,r)=>(e=t[ft("asyncIterator")])?e.call(t):(t=t[ft("iterator")](),e={},r=(i,n)=>(n=t[i])&&(e[i]=s=>new Promise((o,a,l)=>(s=n.call(t,s),l=s.done,Promise.resolve(s.value).then(u=>o({value:u,done:l}),a)))),r("next"),r("return"),e);var Is=T(_r=>{"use strict";_r.byteLength=tf;_r.toByteArray=nf;_r.fromByteArray=af;var he=[],te=[],ef=typeof Uint8Array!="undefined"?Uint8Array:Array,di="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ke=0,Es=di.length;Ke<Es;++Ke)he[Ke]=di[Ke],te[di.charCodeAt(Ke)]=Ke;var Ke,Es;te[45]=62;te[95]=63;function Ss(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}function tf(t){var e=Ss(t),r=e[0],i=e[1];return(r+i)*3/4-i}function rf(t,e,r){return(e+r)*3/4-r}function nf(t){var e,r=Ss(t),i=r[0],n=r[1],s=new ef(rf(t,i,n)),o=0,a=n>0?i-4:i,l;for(l=0;l<a;l+=4)e=te[t.charCodeAt(l)]<<18|te[t.charCodeAt(l+1)]<<12|te[t.charCodeAt(l+2)]<<6|te[t.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return n===2&&(e=te[t.charCodeAt(l)]<<2|te[t.charCodeAt(l+1)]>>4,s[o++]=e&255),n===1&&(e=te[t.charCodeAt(l)]<<10|te[t.charCodeAt(l+1)]<<4|te[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function sf(t){return he[t>>18&63]+he[t>>12&63]+he[t>>6&63]+he[t&63]}function of(t,e,r){for(var i,n=[],s=e;s<r;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),n.push(sf(i));return n.join("")}function af(t){for(var e,r=t.length,i=r%3,n=[],s=16383,o=0,a=r-i;o<a;o+=s)n.push(of(t,o,o+s>a?a:o+s));return i===1?(e=t[r-1],n.push(he[e>>2]+he[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(he[e>>10]+he[e>>4&63]+he[e<<2&63]+"=")),n.join("")}});var Rs=T(_i=>{_i.read=function(t,e,r,i,n){var s,o,a=n*8-i-1,l=(1<<a)-1,u=l>>1,f=-7,c=r?n-1:0,d=r?-1:1,h=t[e+c];for(c+=d,s=h&(1<<-f)-1,h>>=-f,f+=a;f>0;s=s*256+t[e+c],c+=d,f-=8);for(o=s&(1<<-f)-1,s>>=-f,f+=i;f>0;o=o*256+t[e+c],c+=d,f-=8);if(s===0)s=1-u;else{if(s===l)return o?NaN:(h?-1:1)*(1/0);o=o+Math.pow(2,i),s=s-u}return(h?-1:1)*o*Math.pow(2,s-i)};_i.write=function(t,e,r,i,n,s){var o,a,l,u=s*8-n-1,f=(1<<u)-1,c=f>>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:s-1,b=i?1:-1,_=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=f):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+c>=1?e+=d/l:e+=d*Math.pow(2,1-c),e*l>=2&&(o++,l/=2),o+c>=f?(a=0,o=f):o+c>=1?(a=(e*l-1)*Math.pow(2,n),o=o+c):(a=e*Math.pow(2,c-1)*Math.pow(2,n),o=0));n>=8;t[r+h]=a&255,h+=b,a/=256,n-=8);for(o=o<<n|a,u+=n;u>0;t[r+h]=o&255,h+=b,o/=256,u-=8);t[r+h-b]|=_*128}});var Ne=T(Rt=>{"use strict";var pi=Is(),St=Rs(),Ts=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Rt.Buffer=p;Rt.SlowBuffer=df;Rt.INSPECT_MAX_BYTES=50;var pr=2147483647;Rt.kMaxLength=pr;p.TYPED_ARRAY_SUPPORT=lf();!p.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&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 lf(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}});Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function ve(t){if(t>pr)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,p.prototype),e}function p(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return mi(t)}return Ps(t,e,r)}p.poolSize=8192;function Ps(t,e,r){if(typeof t=="string")return ff(t,e);if(ArrayBuffer.isView(t))return cf(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(de(t,ArrayBuffer)||t&&de(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(de(t,SharedArrayBuffer)||t&&de(t.buffer,SharedArrayBuffer)))return yi(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return p.from(i,e,r);let n=hf(t);if(n)return n;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return p.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}p.from=function(t,e,r){return Ps(t,e,r)};Object.setPrototypeOf(p.prototype,Uint8Array.prototype);Object.setPrototypeOf(p,Uint8Array);function js(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function uf(t,e,r){return js(t),t<=0?ve(t):e!==void 0?typeof r=="string"?ve(t).fill(e,r):ve(t).fill(e):ve(t)}p.alloc=function(t,e,r){return uf(t,e,r)};function mi(t){return js(t),ve(t<0?0:wi(t)|0)}p.allocUnsafe=function(t){return mi(t)};p.allocUnsafeSlow=function(t){return mi(t)};function ff(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!p.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Fs(t,e)|0,i=ve(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}function bi(t){let e=t.length<0?0:wi(t.length)|0,r=ve(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}function cf(t){if(de(t,Uint8Array)){let e=new Uint8Array(t);return yi(e.buffer,e.byteOffset,e.byteLength)}return bi(t)}function yi(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,p.prototype),i}function hf(t){if(p.isBuffer(t)){let e=wi(t.length)|0,r=ve(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Ei(t.length)?ve(0):bi(t);if(t.type==="Buffer"&&Array.isArray(t.data))return bi(t.data)}function wi(t){if(t>=pr)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+pr.toString(16)+" bytes");return t|0}function df(t){return+t!=t&&(t=0),p.alloc(+t)}p.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==p.prototype};p.compare=function(e,r){if(de(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),de(r,Uint8Array)&&(r=p.from(r,r.offset,r.byteLength)),!p.isBuffer(e)||!p.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let s=0,o=Math.min(i,n);s<o;++s)if(e[s]!==r[s]){i=e[s],n=r[s];break}return i<n?-1:n<i?1:0};p.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}};p.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return p.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=p.allocUnsafe(r),s=0;for(i=0;i<e.length;++i){let o=e[i];if(de(o,Uint8Array))s+o.length>n.length?(p.isBuffer(o)||(o=p.from(o)),o.copy(n,s)):Uint8Array.prototype.set.call(n,o,s);else if(p.isBuffer(o))o.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=o.length}return n};function Fs(t,e){if(p.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||de(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return gi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Us(t).length;default:if(n)return i?-1:gi(t).length;e=(""+e).toLowerCase(),n=!0}}p.byteLength=Fs;function _f(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return If(this,e,r);case"utf8":case"utf-8":return Cs(this,e,r);case"ascii":return Ef(this,e,r);case"latin1":case"binary":return Sf(this,e,r);case"base64":return wf(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rf(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}p.prototype._isBuffer=!0;function Ye(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}p.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)Ye(this,r,r+1);return this};p.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)Ye(this,r,r+3),Ye(this,r+1,r+2);return this};p.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)Ye(this,r,r+7),Ye(this,r+1,r+6),Ye(this,r+2,r+5),Ye(this,r+3,r+4);return this};p.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Cs(this,0,e):_f.apply(this,arguments)};p.prototype.toLocaleString=p.prototype.toString;p.prototype.equals=function(e){if(!p.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:p.compare(this,e)===0};p.prototype.inspect=function(){let e="",r=Rt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Ts&&(p.prototype[Ts]=p.prototype.inspect);p.prototype.compare=function(e,r,i,n,s){if(de(e,Uint8Array)&&(e=p.from(e,e.offset,e.byteLength)),!p.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),r<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&r>=i)return 0;if(n>=s)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let o=s-n,a=i-r,l=Math.min(o,a),u=this.slice(n,s),f=e.slice(r,i);for(let c=0;c<l;++c)if(u[c]!==f[c]){o=u[c],a=f[c];break}return o<a?-1:a<o?1:0};function Ls(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Ei(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=p.from(e,i)),p.isBuffer(e))return e.length===0?-1:As(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):As(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}function As(t,e,r,i,n){let s=1,o=t.length,a=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;s=2,o/=2,a/=2,r/=2}function l(f,c){return s===1?f[c]:f.readUInt16BE(c*s)}let u;if(n){let f=-1;for(u=r;u<o;u++)if(l(t,u)===l(e,f===-1?0:u-f)){if(f===-1&&(f=u),u-f+1===a)return f*s}else f!==-1&&(u-=u-f),f=-1}else for(r+a>o&&(r=o-a),u=r;u>=0;u--){let f=!0;for(let c=0;c<a;c++)if(l(t,u+c)!==l(e,c)){f=!1;break}if(f)return u}return-1}p.prototype.includes=function(e,r,i){return this.indexOf(e,r,i)!==-1};p.prototype.indexOf=function(e,r,i){return Ls(this,e,r,i,!0)};p.prototype.lastIndexOf=function(e,r,i){return Ls(this,e,r,i,!1)};function pf(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let s=e.length;i>s/2&&(i=s/2);let o;for(o=0;o<i;++o){let a=parseInt(e.substr(o*2,2),16);if(Ei(a))return o;t[r+o]=a}return o}function bf(t,e,r,i){return br(gi(e,t.length-r),t,r,i)}function yf(t,e,r,i){return br(Nf(e),t,r,i)}function gf(t,e,r,i){return br(Us(e),t,r,i)}function mf(t,e,r,i){return br(Pf(e,t.length-r),t,r,i)}p.prototype.write=function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let s=this.length-r;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return pf(this,e,r,i);case"utf8":case"utf-8":return bf(this,e,r,i);case"ascii":case"latin1":case"binary":return yf(this,e,r,i);case"base64":return gf(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return mf(this,e,r,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}};p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wf(t,e,r){return e===0&&r===t.length?pi.fromByteArray(t):pi.fromByteArray(t.slice(e,r))}function Cs(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let s=t[n],o=null,a=s>239?4:s>223?3:s>191?2:1;if(n+a<=r){let l,u,f,c;switch(a){case 1:s<128&&(o=s);break;case 2:l=t[n+1],(l&192)===128&&(c=(s&31)<<6|l&63,c>127&&(o=c));break;case 3:l=t[n+1],u=t[n+2],(l&192)===128&&(u&192)===128&&(c=(s&15)<<12|(l&63)<<6|u&63,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:l=t[n+1],u=t[n+2],f=t[n+3],(l&192)===128&&(u&192)===128&&(f&192)===128&&(c=(s&15)<<18|(l&63)<<12|(u&63)<<6|f&63,c>65535&&c<1114112&&(o=c))}}o===null?(o=65533,a=1):o>65535&&(o-=65536,i.push(o>>>10&1023|55296),o=56320|o&1023),i.push(o),n+=a}return xf(i)}var vs=4096;function xf(t){let e=t.length;if(e<=vs)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=vs));return r}function Ef(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}function Sf(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}function If(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let s=e;s<r;++s)n+=jf[t[s]];return n}function Rf(t,e,r){let i=t.slice(e,r),n="";for(let s=0;s<i.length-1;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}p.prototype.slice=function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,p.prototype),n};function U(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||U(e,r,this.length);let n=this[e],s=1,o=0;for(;++o<r&&(s*=256);)n+=this[e+o]*s;return n};p.prototype.readUintBE=p.prototype.readUIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||U(e,r,this.length);let n=this[e+--r],s=1;for(;r>0&&(s*=256);)n+=this[e+--r]*s;return n};p.prototype.readUint8=p.prototype.readUInt8=function(e,r){return e=e>>>0,r||U(e,1,this.length),this[e]};p.prototype.readUint16LE=p.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||U(e,2,this.length),this[e]|this[e+1]<<8};p.prototype.readUint16BE=p.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||U(e,2,this.length),this[e]<<8|this[e+1]};p.prototype.readUint32LE=p.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};p.prototype.readUint32BE=p.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||U(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};p.prototype.readBigUInt64LE=$e(function(e){e=e>>>0,It(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Yt(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))});p.prototype.readBigUInt64BE=$e(function(e){e=e>>>0,It(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Yt(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(s)});p.prototype.readIntLE=function(e,r,i){e=e>>>0,r=r>>>0,i||U(e,r,this.length);let n=this[e],s=1,o=0;for(;++o<r&&(s*=256);)n+=this[e+o]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*r)),n};p.prototype.readIntBE=function(e,r,i){e=e>>>0,r=r>>>0,i||U(e,r,this.length);let n=r,s=1,o=this[e+--n];for(;n>0&&(s*=256);)o+=this[e+--n]*s;return s*=128,o>=s&&(o-=Math.pow(2,8*r)),o};p.prototype.readInt8=function(e,r){return e=e>>>0,r||U(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};p.prototype.readInt16LE=function(e,r){e=e>>>0,r||U(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i};p.prototype.readInt16BE=function(e,r){e=e>>>0,r||U(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i};p.prototype.readInt32LE=function(e,r){return e=e>>>0,r||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};p.prototype.readInt32BE=function(e,r){return e=e>>>0,r||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};p.prototype.readBigInt64LE=$e(function(e){e=e>>>0,It(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Yt(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});p.prototype.readBigInt64BE=$e(function(e){e=e>>>0,It(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&Yt(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)});p.prototype.readFloatLE=function(e,r){return e=e>>>0,r||U(e,4,this.length),St.read(this,e,!0,23,4)};p.prototype.readFloatBE=function(e,r){return e=e>>>0,r||U(e,4,this.length),St.read(this,e,!1,23,4)};p.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||U(e,8,this.length),St.read(this,e,!0,52,8)};p.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||U(e,8,this.length),St.read(this,e,!1,52,8)};function X(t,e,r,i,n,s){if(!p.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;X(this,e,r,i,a,0)}let s=1,o=0;for(this[r]=e&255;++o<i&&(s*=256);)this[r+o]=e/s&255;return r+i};p.prototype.writeUintBE=p.prototype.writeUIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let a=Math.pow(2,8*i)-1;X(this,e,r,i,a,0)}let s=i-1,o=1;for(this[r+s]=e&255;--s>=0&&(o*=256);)this[r+s]=e/o&255;return r+i};p.prototype.writeUint8=p.prototype.writeUInt8=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,1,255,0),this[r]=e&255,r+1};p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function Bs(t,e,r,i,n){ks(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,r}function Ds(t,e,r,i,n){ks(e,i,n,t,r,7);let s=Number(e&BigInt(4294967295));t[r+7]=s,s=s>>8,t[r+6]=s,s=s>>8,t[r+5]=s,s=s>>8,t[r+4]=s;let o=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=o,o=o>>8,t[r+2]=o,o=o>>8,t[r+1]=o,o=o>>8,t[r]=o,r+8}p.prototype.writeBigUInt64LE=$e(function(e,r=0){return Bs(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});p.prototype.writeBigUInt64BE=$e(function(e,r=0){return Ds(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});p.prototype.writeIntLE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);X(this,e,r,i,l-1,-l)}let s=0,o=1,a=0;for(this[r]=e&255;++s<i&&(o*=256);)e<0&&a===0&&this[r+s-1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+i};p.prototype.writeIntBE=function(e,r,i,n){if(e=+e,r=r>>>0,!n){let l=Math.pow(2,8*i-1);X(this,e,r,i,l-1,-l)}let s=i-1,o=1,a=0;for(this[r+s]=e&255;--s>=0&&(o*=256);)e<0&&a===0&&this[r+s+1]!==0&&(a=1),this[r+s]=(e/o>>0)-a&255;return r+i};p.prototype.writeInt8=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};p.prototype.writeInt16LE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};p.prototype.writeInt16BE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};p.prototype.writeInt32LE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};p.prototype.writeInt32BE=function(e,r,i){return e=+e,r=r>>>0,i||X(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};p.prototype.writeBigInt64LE=$e(function(e,r=0){return Bs(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});p.prototype.writeBigInt64BE=$e(function(e,r=0){return Ds(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Os(t,e,r,i,n,s){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ms(t,e,r,i,n){return e=+e,r=r>>>0,n||Os(t,e,r,4,34028234663852886e22,-34028234663852886e22),St.write(t,e,r,i,23,4),r+4}p.prototype.writeFloatLE=function(e,r,i){return Ms(this,e,r,!0,i)};p.prototype.writeFloatBE=function(e,r,i){return Ms(this,e,r,!1,i)};function $s(t,e,r,i,n){return e=+e,r=r>>>0,n||Os(t,e,r,8,17976931348623157e292,-17976931348623157e292),St.write(t,e,r,i,52,8),r+8}p.prototype.writeDoubleLE=function(e,r,i){return $s(this,e,r,!0,i)};p.prototype.writeDoubleBE=function(e,r,i){return $s(this,e,r,!1,i)};p.prototype.copy=function(e,r,i,n){if(!p.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let s=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),s};p.prototype.fill=function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!p.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let o=e.charCodeAt(0);(n==="utf8"&&o<128||n==="latin1")&&(e=o)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=r;s<i;++s)this[s]=e;else{let o=p.isBuffer(e)?e:p.from(e,n),a=o.length;if(a===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-r;++s)this[s+r]=o[s%a]}return this};var Et={};function xi(t,e,r){Et[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}xi("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);xi("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);xi("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Ns(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Ns(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Ns(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Tf(t,e,r){It(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&Yt(e,t.length-(r+1))}function ks(t,e,r,i,n,s){if(t>r||t<e){let o=typeof e=="bigint"?"n":"",a;throw s>3?e===0||e===BigInt(0)?a=`>= 0${o} and < 2${o} ** ${(s+1)*8}${o}`:a=`>= -(2${o} ** ${(s+1)*8-1}${o}) and < 2 ** ${(s+1)*8-1}${o}`:a=`>= ${e}${o} and <= ${r}${o}`,new Et.ERR_OUT_OF_RANGE("value",a,t)}Tf(i,n,s)}function It(t,e){if(typeof t!="number")throw new Et.ERR_INVALID_ARG_TYPE(e,"number",t)}function Yt(t,e,r){throw Math.floor(t)!==t?(It(t,r),new Et.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Et.ERR_BUFFER_OUT_OF_BOUNDS:new Et.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Af=/[^+/0-9A-Za-z-_]/g;function vf(t){if(t=t.split("=")[0],t=t.trim().replace(Af,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function gi(t,e){e=e||1/0;let r,i=t.length,n=null,s=[];for(let o=0;o<i;++o){if(r=t.charCodeAt(o),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(o+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&s.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return s}function Nf(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Pf(t,e){let r,i,n,s=[];for(let o=0;o<t.length&&!((e-=2)<0);++o)r=t.charCodeAt(o),i=r>>8,n=r%256,s.push(n),s.push(i);return s}function Us(t){return pi.toByteArray(vf(t))}function br(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}function de(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Ei(t){return t!==t}var jf=(function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e})();function $e(t){return typeof BigInt=="undefined"?Ff:t}function Ff(){throw new Error("BigInt not supported")}});var L=T((Ob,qs)=>{"use strict";var Si=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let i=0;i<e.length;i++)r+=` ${e[i].stack}
2
+ `;super(r),this.name="AggregateError",this.errors=e}};qs.exports={AggregateError:Si,ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},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(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.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(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var Ii=T((Mb,Ws)=>{"use strict";Ws.exports={format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,i]){let n=e.shift();return i==="f"?n.toFixed(6):i==="j"?JSON.stringify(n):i==="s"&&typeof n=="object"?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}}}});var V=T(($b,zs)=>{"use strict";var{format:Lf,inspect:yr}=Ii(),{AggregateError:Cf}=L(),Bf=globalThis.AggregateError||Cf,Df=Symbol("kIsNodeError"),Of=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Mf=/^([A-Z][a-z0-9]*)+$/,$f="__node_internal_",gr={};function Je(t,e){if(!t)throw new gr.ERR_INTERNAL_ASSERTION(e)}function Gs(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function kf(t,e,r){if(typeof e=="function")return Je(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let i=(e.match(/%[dfijoOs]/g)||[]).length;return Je(i===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?e:Lf(e,...r)}function G(t,e,r){r||(r=Error);class i extends r{constructor(...s){super(kf(t,e,s))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=t,i.prototype[Df]=!0,gr[t]=i}function Qs(t){let e=$f+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Uf(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new Bf([e,t],e.message);return r.code=e.code,r}return t||e}var Ri=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new gr.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};G("ERR_ASSERTION","%s",Error);G("ERR_INVALID_ARG_TYPE",(t,e,r)=>{Je(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let i="The ";t.endsWith(" argument")?i+=`${t} `:i+=`"${t}" ${t.includes(".")?"property":"argument"} `,i+="must be ";let n=[],s=[],o=[];for(let l of e)Je(typeof l=="string","All expected entries have to be of type string"),Of.includes(l)?n.push(l.toLowerCase()):Mf.test(l)?s.push(l):(Je(l!=="object",'The value "object" should be written as "Object"'),o.push(l));if(s.length>0){let l=n.indexOf("object");l!==-1&&(n.splice(n,l,1),s.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let l=n.pop();i+=`one of type ${n.join(", ")}, or ${l}`}}(s.length>0||o.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let l=s.pop();i+=`an instance of ${s.join(", ")}, or ${l}`}}o.length>0&&(i+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(i+="an "),i+=`${o[0]}`;break;case 2:i+=`one of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();i+=`one of ${o.join(", ")}, or ${l}`}}if(r==null)i+=`. Received ${r}`;else if(typeof r=="function"&&r.name)i+=`. Received function ${r.name}`;else if(typeof r=="object"){var a;if((a=r.constructor)!==null&&a!==void 0&&a.name)i+=`. Received an instance of ${r.constructor.name}`;else{let l=yr(r,{depth:-1});i+=`. Received ${l}`}}else{let l=yr(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),i+=`. Received type ${typeof r} (${l})`}return i},TypeError);G("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let i=yr(e);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${i}`},TypeError);G("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var i;let n=r!=null&&(i=r.constructor)!==null&&i!==void 0&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${n}.`},TypeError);G("ERR_MISSING_ARGS",(...t)=>{Je(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(i=>`"${i}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let i=t.pop();e+=`The ${t.join(", ")}, and ${i} arguments`}break}return`${e} must be specified`},TypeError);G("ERR_OUT_OF_RANGE",(t,e,r)=>{Je(e,'Missing "range" argument');let i;if(Number.isInteger(r)&&Math.abs(r)>2**32)i=Gs(String(r));else if(typeof r=="bigint"){i=String(r);let n=BigInt(2)**BigInt(32);(r>n||r<-n)&&(i=Gs(i)),i+="n"}else i=yr(r);return`The value of "${t}" is out of range. It must be ${e}. Received ${i}`},RangeError);G("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);G("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);G("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);G("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);G("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);G("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);G("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);G("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);G("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);G("ERR_STREAM_WRITE_AFTER_END","write after end",Error);G("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);zs.exports={AbortError:Ri,aggregateTwoErrors:Qs(Uf),hideStackFrames:Qs,codes:gr}});var Tt=T((kb,mr)=>{"use strict";var{AbortController:Vs,AbortSignal:qf}=typeof self!="undefined"?self:typeof window!="undefined"?window:void 0;mr.exports=Vs;mr.exports.AbortSignal=qf;mr.exports.default=Vs});var Jt=T((Ub,Ti)=>{"use strict";var At=typeof Reflect=="object"?Reflect:null,Hs=At&&typeof At.apply=="function"?At.apply:function(e,r,i){return Function.prototype.apply.call(e,r,i)},wr;At&&typeof At.ownKeys=="function"?wr=At.ownKeys:Object.getOwnPropertySymbols?wr=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:wr=function(e){return Object.getOwnPropertyNames(e)};function Wf(t){console&&console.warn&&console.warn(t)}var Ys=Number.isNaN||function(e){return e!==e};function v(){v.init.call(this)}Ti.exports=v;Ti.exports.once=Vf;v.EventEmitter=v;v.prototype._events=void 0;v.prototype._eventsCount=0;v.prototype._maxListeners=void 0;var Ks=10;function xr(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(v,"defaultMaxListeners",{enumerable:!0,get:function(){return Ks},set:function(t){if(typeof t!="number"||t<0||Ys(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ks=t}});v.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};v.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||Ys(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function Js(t){return t._maxListeners===void 0?v.defaultMaxListeners:t._maxListeners}v.prototype.getMaxListeners=function(){return Js(this)};v.prototype.emit=function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",s=this._events;if(s!==void 0)n=n&&s.error===void 0;else if(!n)return!1;if(n){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(l===void 0)return!1;if(typeof l=="function")Hs(l,this,r);else for(var u=l.length,f=ro(l,u),i=0;i<u;++i)Hs(f[i],this,r);return!0};function Xs(t,e,r,i){var n,s,o;if(xr(r),s=t._events,s===void 0?(s=t._events=Object.create(null),t._eventsCount=0):(s.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),s=t._events),o=s[e]),o===void 0)o=s[e]=r,++t._eventsCount;else if(typeof o=="function"?o=s[e]=i?[r,o]:[o,r]:i?o.unshift(r):o.push(r),n=Js(t),n>0&&o.length>n&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,Wf(a)}return t}v.prototype.addListener=function(e,r){return Xs(this,e,r,!1)};v.prototype.on=v.prototype.addListener;v.prototype.prependListener=function(e,r){return Xs(this,e,r,!0)};function Gf(){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 Zs(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=Gf.bind(i);return n.listener=r,i.wrapFn=n,n}v.prototype.once=function(e,r){return xr(r),this.on(e,Zs(this,e,r)),this};v.prototype.prependOnceListener=function(e,r){return xr(r),this.prependListener(e,Zs(this,e,r)),this};v.prototype.removeListener=function(e,r){var i,n,s,o,a;if(xr(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(s=-1,o=i.length-1;o>=0;o--)if(i[o]===r||i[o].listener===r){a=i[o].listener,s=o;break}if(s<0)return this;s===0?i.shift():Qf(i,s),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,a||r)}return this};v.prototype.off=v.prototype.removeListener;v.prototype.removeAllListeners=function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var s=Object.keys(i),o;for(n=0;n<s.length;++n)o=s[n],o!=="removeListener"&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this};function eo(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?zf(n):ro(n,n.length)}v.prototype.listeners=function(e){return eo(this,e,!0)};v.prototype.rawListeners=function(e){return eo(this,e,!1)};v.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):to.call(t,e)};v.prototype.listenerCount=to;function to(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}v.prototype.eventNames=function(){return this._eventsCount>0?wr(this._events):[]};function ro(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}function Qf(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function zf(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Vf(t,e){return new Promise(function(r,i){function n(o){t.removeListener(e,s),i(o)}function s(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}io(t,e,s,{once:!0}),e!=="error"&&Hf(t,n,{once:!0})})}function Hf(t,e,r){typeof t.on=="function"&&io(t,"error",e,r)}function io(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function n(s){i.once&&t.removeEventListener(e,n),r(s)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var Y=T((qb,vi)=>{"use strict";var Kf=Ne(),{format:Yf,inspect:Jf}=Ii(),{codes:{ERR_INVALID_ARG_TYPE:Ai}}=V(),{kResistStopPropagation:Xf,AggregateError:Zf,SymbolDispose:ec}=L(),tc=globalThis.AbortSignal||Tt().AbortSignal,rc=globalThis.AbortController||Tt().AbortController,ic=Object.getPrototypeOf(async function(){}).constructor,no=globalThis.Blob||Kf.Blob,nc=typeof no!="undefined"?function(e){return e instanceof no}:function(e){return!1},so=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Ai(e,"AbortSignal",t)},sc=(t,e)=>{if(typeof t!="function")throw new Ai(e,"Function",t)};vi.exports={AggregateError:Zf,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((i,n)=>{t=i,e=n}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((i,...n)=>i?r(i):e(...n))})},debuglog(){return function(){}},format:Yf,inspect:Jf,types:{isAsyncFunction(t){return t instanceof ic},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:nc,deprecate(t,e){return t},addAbortListener:Jt().addAbortListener||function(e,r){if(e===void 0)throw new Ai("signal","AbortSignal",e);so(e,"signal"),sc(r,"listener");let i;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[Xf]:!0}),i=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[ec](){var n;(n=i)===null||n===void 0||n()}}},AbortSignalAny:tc.any||function(e){if(e.length===1)return e[0];let r=new rc,i=()=>r.abort();return e.forEach(n=>{so(n,"signals"),n.addEventListener("abort",i,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(n=>n.removeEventListener("abort",i))},{once:!0}),r.signal}};vi.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var Nt=T((Wb,bo)=>{"use strict";var{ArrayIsArray:Pi,ArrayPrototypeIncludes:uo,ArrayPrototypeJoin:fo,ArrayPrototypeMap:oc,NumberIsInteger:ji,NumberIsNaN:ac,NumberMAX_SAFE_INTEGER:lc,NumberMIN_SAFE_INTEGER:uc,NumberParseInt:fc,ObjectPrototypeHasOwnProperty:cc,RegExpPrototypeExec:co,String:hc,StringPrototypeToUpperCase:dc,StringPrototypeTrim:_c}=L(),{hideStackFrames:re,codes:{ERR_SOCKET_BAD_PORT:pc,ERR_INVALID_ARG_TYPE:H,ERR_INVALID_ARG_VALUE:vt,ERR_OUT_OF_RANGE:Xe,ERR_UNKNOWN_SIGNAL:oo}}=V(),{normalizeEncoding:bc}=Y(),{isAsyncFunction:yc,isArrayBufferView:gc}=Y().types,ao={};function mc(t){return t===(t|0)}function wc(t){return t===t>>>0}var xc=/^[0-7]+$/,Ec="must be a 32-bit unsigned integer or an octal string";function Sc(t,e,r){if(typeof t=="undefined"&&(t=r),typeof t=="string"){if(co(xc,t)===null)throw new vt(e,t,Ec);t=fc(t,8)}return ho(t,e),t}var Ic=re((t,e,r=uc,i=lc)=>{if(typeof t!="number")throw new H(e,"number",t);if(!ji(t))throw new Xe(e,"an integer",t);if(t<r||t>i)throw new Xe(e,`>= ${r} && <= ${i}`,t)}),Rc=re((t,e,r=-2147483648,i=2147483647)=>{if(typeof t!="number")throw new H(e,"number",t);if(!ji(t))throw new Xe(e,"an integer",t);if(t<r||t>i)throw new Xe(e,`>= ${r} && <= ${i}`,t)}),ho=re((t,e,r=!1)=>{if(typeof t!="number")throw new H(e,"number",t);if(!ji(t))throw new Xe(e,"an integer",t);let i=r?1:0,n=4294967295;if(t<i||t>n)throw new Xe(e,`>= ${i} && <= ${n}`,t)});function Fi(t,e){if(typeof t!="string")throw new H(e,"string",t)}function Tc(t,e,r=void 0,i){if(typeof t!="number")throw new H(e,"number",t);if(r!=null&&t<r||i!=null&&t>i||(r!=null||i!=null)&&ac(t))throw new Xe(e,`${r!=null?`>= ${r}`:""}${r!=null&&i!=null?" && ":""}${i!=null?`<= ${i}`:""}`,t)}var Ac=re((t,e,r)=>{if(!uo(r,t)){let n="must be one of: "+fo(oc(r,s=>typeof s=="string"?`'${s}'`:hc(s)),", ");throw new vt(e,t,n)}});function _o(t,e){if(typeof t!="boolean")throw new H(e,"boolean",t)}function Ni(t,e,r){return t==null||!cc(t,e)?r:t[e]}var vc=re((t,e,r=null)=>{let i=Ni(r,"allowArray",!1),n=Ni(r,"allowFunction",!1);if(!Ni(r,"nullable",!1)&&t===null||!i&&Pi(t)||typeof t!="object"&&(!n||typeof t!="function"))throw new H(e,"Object",t)}),Nc=re((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new H(e,"a dictionary",t)}),Er=re((t,e,r=0)=>{if(!Pi(t))throw new H(e,"Array",t);if(t.length<r){let i=`must be longer than ${r}`;throw new vt(e,t,i)}});function Pc(t,e){Er(t,e);for(let r=0;r<t.length;r++)Fi(t[r],`${e}[${r}]`)}function jc(t,e){Er(t,e);for(let r=0;r<t.length;r++)_o(t[r],`${e}[${r}]`)}function Fc(t,e){Er(t,e);for(let r=0;r<t.length;r++){let i=t[r],n=`${e}[${r}]`;if(i==null)throw new H(n,"AbortSignal",i);po(i,n)}}function Lc(t,e="signal"){if(Fi(t,e),ao[t]===void 0)throw ao[dc(t)]!==void 0?new oo(t+" (signals must use all capital letters)"):new oo(t)}var Cc=re((t,e="buffer")=>{if(!gc(t))throw new H(e,["Buffer","TypedArray","DataView"],t)});function Bc(t,e){let r=bc(e),i=t.length;if(r==="hex"&&i%2!==0)throw new vt("encoding",e,`is invalid for data of length ${i}`)}function Dc(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&_c(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new pc(e,t,r);return t|0}var po=re((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new H(e,"AbortSignal",t)}),Oc=re((t,e)=>{if(typeof t!="function")throw new H(e,"Function",t)}),Mc=re((t,e)=>{if(typeof t!="function"||yc(t))throw new H(e,"Function",t)}),$c=re((t,e)=>{if(t!==void 0)throw new H(e,"undefined",t)});function kc(t,e,r){if(!uo(r,t))throw new H(e,`('${fo(r,"|")}')`,t)}var Uc=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function lo(t,e){if(typeof t=="undefined"||!co(Uc,t))throw new vt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function qc(t){if(typeof t=="string")return lo(t,"hints"),t;if(Pi(t)){let e=t.length,r="";if(e===0)return r;for(let i=0;i<e;i++){let n=t[i];lo(n,"hints"),r+=n,i!==e-1&&(r+=", ")}return r}throw new vt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}bo.exports={isInt32:mc,isUint32:wc,parseFileMode:Sc,validateArray:Er,validateStringArray:Pc,validateBooleanArray:jc,validateAbortSignalArray:Fc,validateBoolean:_o,validateBuffer:Cc,validateDictionary:Nc,validateEncoding:Bc,validateFunction:Oc,validateInt32:Rc,validateInteger:Ic,validateNumber:Tc,validateObject:vc,validateOneOf:Ac,validatePlainFunction:Mc,validatePort:Dc,validateSignalName:Lc,validateString:Fi,validateUint32:ho,validateUndefined:$c,validateUnion:kc,validateAbortSignal:po,validateLinkHeaderValue:qc}});var ke=T((Gb,wo)=>{var D=wo.exports={},_e,pe;function Li(){throw new Error("setTimeout has not been defined")}function Ci(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?_e=setTimeout:_e=Li}catch(t){_e=Li}try{typeof clearTimeout=="function"?pe=clearTimeout:pe=Ci}catch(t){pe=Ci}})();function yo(t){if(_e===setTimeout)return setTimeout(t,0);if((_e===Li||!_e)&&setTimeout)return _e=setTimeout,setTimeout(t,0);try{return _e(t,0)}catch(e){try{return _e.call(null,t,0)}catch(r){return _e.call(this,t,0)}}}function Wc(t){if(pe===clearTimeout)return clearTimeout(t);if((pe===Ci||!pe)&&clearTimeout)return pe=clearTimeout,clearTimeout(t);try{return pe(t)}catch(e){try{return pe.call(null,t)}catch(r){return pe.call(this,t)}}}var Pe=[],Pt=!1,Ze,Sr=-1;function Gc(){!Pt||!Ze||(Pt=!1,Ze.length?Pe=Ze.concat(Pe):Sr=-1,Pe.length&&go())}function go(){if(!Pt){var t=yo(Gc);Pt=!0;for(var e=Pe.length;e;){for(Ze=Pe,Pe=[];++Sr<e;)Ze&&Ze[Sr].run();Sr=-1,e=Pe.length}Ze=null,Pt=!1,Wc(t)}}D.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Pe.push(new mo(t,e)),Pe.length===1&&!Pt&&yo(go)};function mo(t,e){this.fun=t,this.array=e}mo.prototype.run=function(){this.fun.apply(null,this.array)};D.title="browser";D.browser=!0;D.env={};D.argv=[];D.version="";D.versions={};function je(){}D.on=je;D.addListener=je;D.once=je;D.off=je;D.removeListener=je;D.removeAllListeners=je;D.emit=je;D.prependListener=je;D.prependOnceListener=je;D.listeners=function(t){return[]};D.binding=function(t){throw new Error("process.binding is not supported")};D.cwd=function(){return"/"};D.chdir=function(t){throw new Error("process.chdir is not supported")};D.umask=function(){return 0}});var ye=T((Qb,Bo)=>{"use strict";var{SymbolAsyncIterator:xo,SymbolIterator:Eo,SymbolFor:et}=L(),So=et("nodejs.stream.destroyed"),Io=et("nodejs.stream.errored"),Bi=et("nodejs.stream.readable"),Di=et("nodejs.stream.writable"),Ro=et("nodejs.stream.disturbed"),Qc=et("nodejs.webstream.isClosedPromise"),zc=et("nodejs.webstream.controllerErrorFunction");function Ir(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function Rr(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function Vc(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function be(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function To(t){return!!(t&&!be(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Ao(t){return!!(t&&!be(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function vo(t){return!!(t&&!be(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function Hc(t){return To(t)||Ao(t)||vo(t)}function Kc(t,e){return t==null?!1:e===!0?typeof t[xo]=="function":e===!1?typeof t[Eo]=="function":typeof t[xo]=="function"||typeof t[Eo]=="function"}function Tr(t){if(!be(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!!(t.destroyed||t[So]||i!=null&&i.destroyed)}function No(t){if(!Rr(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function Yc(t,e){if(!Rr(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.finished)!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function Jc(t){if(!Ir(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof(e==null?void 0:e.ended)!="boolean"?null:e.ended}function Po(t,e){if(!Ir(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof(r==null?void 0:r.endEmitted)!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function jo(t){return t&&t[Bi]!=null?t[Bi]:typeof(t==null?void 0:t.readable)!="boolean"?null:Tr(t)?!1:Ir(t)&&t.readable&&!Po(t)}function Fo(t){return t&&t[Di]!=null?t[Di]:typeof(t==null?void 0:t.writable)!="boolean"?null:Tr(t)?!1:Rr(t)&&t.writable&&!No(t)}function Xc(t,e){return be(t)?Tr(t)?!0:!((e==null?void 0:e.readable)!==!1&&jo(t)||(e==null?void 0:e.writable)!==!1&&Fo(t)):null}function Zc(t){var e,r;return be(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function eh(t){var e,r;return be(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function th(t){if(!be(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof(e==null?void 0:e.closed)=="boolean"||typeof(r==null?void 0:r.closed)=="boolean"?(e==null?void 0:e.closed)||(r==null?void 0:r.closed):typeof t._closed=="boolean"&&Lo(t)?t._closed:null}function Lo(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Co(t){return typeof t._sent100=="boolean"&&Lo(t)}function rh(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function ih(t){if(!be(t))return null;let e=t._writableState,r=t._readableState,i=e||r;return!i&&Co(t)||!!(i&&i.autoDestroy&&i.emitClose&&i.closed===!1)}function nh(t){var e;return!!(t&&((e=t[Ro])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function sh(t){var e,r,i,n,s,o,a,l,u,f;return!!(t&&((e=(r=(i=(n=(s=(o=t[Io])!==null&&o!==void 0?o:t.readableErrored)!==null&&s!==void 0?s:t.writableErrored)!==null&&n!==void 0?n:(a=t._readableState)===null||a===void 0?void 0:a.errorEmitted)!==null&&i!==void 0?i:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((f=t._writableState)===null||f===void 0)&&f.errored))}Bo.exports={isDestroyed:Tr,kIsDestroyed:So,isDisturbed:nh,kIsDisturbed:Ro,isErrored:sh,kIsErrored:Io,isReadable:jo,kIsReadable:Bi,kIsClosedPromise:Qc,kControllerErrorFunction:zc,kIsWritable:Di,isClosed:th,isDuplexNodeStream:Vc,isFinished:Xc,isIterable:Kc,isReadableNodeStream:Ir,isReadableStream:To,isReadableEnded:Jc,isReadableFinished:Po,isReadableErrored:eh,isNodeStream:be,isWebStream:Hc,isWritable:Fo,isWritableNodeStream:Rr,isWritableStream:Ao,isWritableEnded:No,isWritableFinished:Yc,isWritableErrored:Zc,isServerRequest:rh,isServerResponse:Co,willEmitClose:ih,isTransformStream:vo}});var Fe=T((zb,Ui)=>{"use strict";var Ue=ke(),{AbortError:Go,codes:oh}=V(),{ERR_INVALID_ARG_TYPE:ah,ERR_STREAM_PREMATURE_CLOSE:Do}=oh,{kEmptyObject:Mi,once:$i}=Y(),{validateAbortSignal:lh,validateFunction:uh,validateObject:fh,validateBoolean:ch}=Nt(),{Promise:hh,PromisePrototypeThen:dh,SymbolDispose:Qo}=L(),{isClosed:_h,isReadable:Oo,isReadableNodeStream:Oi,isReadableStream:ph,isReadableFinished:Mo,isReadableErrored:$o,isWritable:ko,isWritableNodeStream:Uo,isWritableStream:bh,isWritableFinished:qo,isWritableErrored:Wo,isNodeStream:yh,willEmitClose:gh,kIsClosedPromise:mh}=ye(),jt;function wh(t){return t.setHeader&&typeof t.abort=="function"}var ki=()=>{};function zo(t,e,r){var i,n;if(arguments.length===2?(r=e,e=Mi):e==null?e=Mi:fh(e,"options"),uh(r,"callback"),lh(e.signal,"options.signal"),r=$i(r),ph(t)||bh(t))return xh(t,e,r);if(!yh(t))throw new ah("stream",["ReadableStream","WritableStream","Stream"],t);let s=(i=e.readable)!==null&&i!==void 0?i:Oi(t),o=(n=e.writable)!==null&&n!==void 0?n:Uo(t),a=t._writableState,l=t._readableState,u=()=>{t.writable||d()},f=gh(t)&&Oi(t)===s&&Uo(t)===o,c=qo(t,!1),d=()=>{c=!0,t.destroyed&&(f=!1),!(f&&(!t.readable||s))&&(!s||h)&&r.call(t)},h=Mo(t,!1),b=()=>{h=!0,t.destroyed&&(f=!1),!(f&&(!t.writable||o))&&(!o||c)&&r.call(t)},_=x=>{r.call(t,x)},y=_h(t),g=()=>{y=!0;let x=Wo(t)||$o(t);if(x&&typeof x!="boolean")return r.call(t,x);if(s&&!h&&Oi(t,!0)&&!Mo(t,!1))return r.call(t,new Do);if(o&&!c&&!qo(t,!1))return r.call(t,new Do);r.call(t)},S=()=>{y=!0;let x=Wo(t)||$o(t);if(x&&typeof x!="boolean")return r.call(t,x);r.call(t)},m=()=>{t.req.on("finish",d)};wh(t)?(t.on("complete",d),f||t.on("abort",g),t.req?m():t.on("request",m)):o&&!a&&(t.on("end",u),t.on("close",u)),!f&&typeof t.aborted=="boolean"&&t.on("aborted",g),t.on("end",b),t.on("finish",d),e.error!==!1&&t.on("error",_),t.on("close",g),y?Ue.nextTick(g):a!=null&&a.errorEmitted||l!=null&&l.errorEmitted?f||Ue.nextTick(S):(!s&&(!f||Oo(t))&&(c||ko(t)===!1)||!o&&(!f||ko(t))&&(h||Oo(t)===!1)||l&&t.req&&t.aborted)&&Ue.nextTick(S);let w=()=>{r=ki,t.removeListener("aborted",g),t.removeListener("complete",d),t.removeListener("abort",g),t.removeListener("request",m),t.req&&t.req.removeListener("finish",d),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",d),t.removeListener("end",b),t.removeListener("error",_),t.removeListener("close",g)};if(e.signal&&!y){let x=()=>{let A=r;w(),A.call(t,new Go(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)Ue.nextTick(x);else{jt=jt||Y().addAbortListener;let A=jt(e.signal,x),E=r;r=$i((...B)=>{A[Qo](),E.apply(t,B)})}}return w}function xh(t,e,r){let i=!1,n=ki;if(e.signal)if(n=()=>{i=!0,r.call(t,new Go(void 0,{cause:e.signal.reason}))},e.signal.aborted)Ue.nextTick(n);else{jt=jt||Y().addAbortListener;let o=jt(e.signal,n),a=r;r=$i((...l)=>{o[Qo](),a.apply(t,l)})}let s=(...o)=>{i||Ue.nextTick(()=>r.apply(t,o))};return dh(t[mh].promise,s,s),ki}function Eh(t,e){var r;let i=!1;return e===null&&(e=Mi),(r=e)!==null&&r!==void 0&&r.cleanup&&(ch(e.cleanup,"cleanup"),i=e.cleanup),new hh((n,s)=>{let o=zo(t,e,a=>{i&&o(),a?s(a):n()})})}Ui.exports=zo;Ui.exports.finished=Eh});var tt=T((Vb,ea)=>{"use strict";var ge=ke(),{aggregateTwoErrors:Sh,codes:{ERR_MULTIPLE_CALLBACK:Ih},AbortError:Rh}=V(),{Symbol:Ko}=L(),{kIsDestroyed:Th,isDestroyed:Ah,isFinished:vh,isServerRequest:Nh}=ye(),Yo=Ko("kDestroy"),qi=Ko("kConstruct");function Jo(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Ph(t,e){let r=this._readableState,i=this._writableState,n=i||r;return i!=null&&i.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(Jo(t,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),n.constructed?Vo(this,t,e):this.once(Yo,function(s){Vo(this,Sh(s,t),e)}),this)}function Vo(t,e,r){let i=!1;function n(s){if(i)return;i=!0;let o=t._readableState,a=t._writableState;Jo(s,a,o),a&&(a.closed=!0),o&&(o.closed=!0),typeof r=="function"&&r(s),s?ge.nextTick(jh,t,s):ge.nextTick(Xo,t)}try{t._destroy(e||null,n)}catch(s){n(s)}}function jh(t,e){Wi(t,e),Xo(t)}function Xo(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function Wi(t,e){let r=t._readableState,i=t._writableState;i!=null&&i.errorEmitted||r!=null&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function Fh(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function Gi(t,e,r){let i=t._readableState,n=t._writableState;if(n!=null&&n.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||n!=null&&n.autoDestroy?t.destroy(e):e&&(e.stack,n&&!n.errored&&(n.errored=e),i&&!i.errored&&(i.errored=e),r?ge.nextTick(Wi,t,e):Wi(t,e))}function Lh(t,e){if(typeof t._construct!="function")return;let r=t._readableState,i=t._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),t.once(qi,e),!(t.listenerCount(qi)>1)&&ge.nextTick(Ch,t)}function Ch(t){let e=!1;function r(i){if(e){Gi(t,i!=null?i:new Ih);return}e=!0;let n=t._readableState,s=t._writableState,o=s||n;n&&(n.constructed=!0),s&&(s.constructed=!0),o.destroyed?t.emit(Yo,i):i?Gi(t,i,!0):ge.nextTick(Bh,t)}try{t._construct(i=>{ge.nextTick(r,i)})}catch(i){ge.nextTick(r,i)}}function Bh(t){t.emit(qi)}function Ho(t){return(t==null?void 0:t.setHeader)&&typeof t.abort=="function"}function Zo(t){t.emit("close")}function Dh(t,e){t.emit("error",e),ge.nextTick(Zo,t)}function Oh(t,e){!t||Ah(t)||(!e&&!vh(t)&&(e=new Rh),Nh(t)?(t.socket=null,t.destroy(e)):Ho(t)?t.abort():Ho(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?ge.nextTick(Dh,t,e):ge.nextTick(Zo,t),t.destroyed||(t[Th]=!0))}ea.exports={construct:Lh,destroyer:Oh,destroy:Ph,undestroy:Fh,errorOrDestroy:Gi}});var Nr=T((Hb,ra)=>{"use strict";var{ArrayIsArray:Mh,ObjectSetPrototypeOf:ta}=L(),{EventEmitter:Ar}=Jt();function vr(t){Ar.call(this,t)}ta(vr.prototype,Ar.prototype);ta(vr,Ar);vr.prototype.pipe=function(t,e){let r=this;function i(f){t.writable&&t.write(f)===!1&&r.pause&&r.pause()}r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",o),r.on("close",a));let s=!1;function o(){s||(s=!0,t.end())}function a(){s||(s=!0,typeof t.destroy=="function"&&t.destroy())}function l(f){u(),Ar.listenerCount(this,"error")===0&&this.emit("error",f)}Qi(r,"error",l),Qi(t,"error",l);function u(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",o),r.removeListener("close",a),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",u),r.removeListener("close",u),t.removeListener("close",u)}return r.on("end",u),r.on("close",u),t.on("close",u),t.emit("pipe",r),t};function Qi(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Mh(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}ra.exports={Stream:vr,prependListener:Qi}});var Xt=T((Kb,Pr)=>{"use strict";var{SymbolDispose:$h}=L(),{AbortError:ia,codes:kh}=V(),{isNodeStream:na,isWebStream:Uh,kControllerErrorFunction:qh}=ye(),Wh=Fe(),{ERR_INVALID_ARG_TYPE:sa}=kh,zi,Gh=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new sa(e,"AbortSignal",t)};Pr.exports.addAbortSignal=function(e,r){if(Gh(e,"signal"),!na(r)&&!Uh(r))throw new sa("stream",["ReadableStream","WritableStream","Stream"],r);return Pr.exports.addAbortSignalNoValidate(e,r)};Pr.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=na(e)?()=>{e.destroy(new ia(void 0,{cause:t.reason}))}:()=>{e[qh](new ia(void 0,{cause:t.reason}))};if(t.aborted)r();else{zi=zi||Y().addAbortListener;let i=zi(t,r);Wh(e,i[$h])}return e}});var la=T((Jb,aa)=>{"use strict";var{StringPrototypeSlice:oa,SymbolIterator:Qh,TypedArrayPrototypeSet:jr,Uint8Array:zh}=L(),{Buffer:Vi}=Ne(),{inspect:Vh}=Y();aa.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,i=""+r.data;for(;(r=r.next)!==null;)i+=e+r.data;return i}concat(e){if(this.length===0)return Vi.alloc(0);let r=Vi.allocUnsafe(e>>>0),i=this.head,n=0;for(;i;)jr(r,i.data,n),n+=i.data.length,i=i.next;return r}consume(e,r){let i=this.head.data;if(e<i.length){let n=i.slice(0,e);return this.head.data=i.slice(e),n}return e===i.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Qh](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",i=this.head,n=0;do{let s=i.data;if(e>s.length)r+=s,e-=s.length;else{e===s.length?(r+=s,++n,i.next?this.head=i.next:this.head=this.tail=null):(r+=oa(s,0,e),this.head=i,i.data=oa(s,e));break}++n}while((i=i.next)!==null);return this.length-=n,r}_getBuffer(e){let r=Vi.allocUnsafe(e),i=e,n=this.head,s=0;do{let o=n.data;if(e>o.length)jr(r,o,i-e),e-=o.length;else{e===o.length?(jr(r,o,i-e),++s,n.next?this.head=n.next:this.head=this.tail=null):(jr(r,new zh(o.buffer,o.byteOffset,e),i-e),this.head=n,n.data=o.slice(e));break}++s}while((n=n.next)!==null);return this.length-=s,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return Vh(this,Oe(M({},r),{depth:0,customInspect:!1}))}}});var Zt=T((Zb,ha)=>{"use strict";var{MathFloor:Hh,NumberIsInteger:Kh}=L(),{validateInteger:Yh}=Nt(),{ERR_INVALID_ARG_VALUE:Jh}=V().codes,ua=16*1024,fa=16;function Xh(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function ca(t){return t?fa:ua}function Zh(t,e){Yh(e,"value",0),t?fa=e:ua=e}function ed(t,e,r,i){let n=Xh(e,i,r);if(n!=null){if(!Kh(n)||n<0){let s=i?`options.${r}`:"options.highWaterMark";throw new Jh(s,n)}return Hh(n)}return ca(t.objectMode)}ha.exports={getHighWaterMark:ed,getDefaultHighWaterMark:ca,setDefaultHighWaterMark:Zh}});var pa=T((Hi,_a)=>{var Fr=Ne(),me=Fr.Buffer;function da(t,e){for(var r in t)e[r]=t[r]}me.from&&me.alloc&&me.allocUnsafe&&me.allocUnsafeSlow?_a.exports=Fr:(da(Fr,Hi),Hi.Buffer=rt);function rt(t,e,r){return me(t,e,r)}rt.prototype=Object.create(me.prototype);da(me,rt);rt.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return me(t,e,r)};rt.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=me(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};rt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return me(t)};rt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Fr.SlowBuffer(t)}});var ga=T(ya=>{"use strict";var Yi=pa().Buffer,ba=Yi.isEncoding||function(t){switch(t=""+t,t&&t.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 td(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function rd(t){var e=td(t);if(typeof e!="string"&&(Yi.isEncoding===ba||!ba(t)))throw new Error("Unknown encoding: "+t);return e||t}ya.StringDecoder=er;function er(t){this.encoding=rd(t);var e;switch(this.encoding){case"utf16le":this.text=ld,this.end=ud,e=4;break;case"utf8":this.fillLast=sd,e=4;break;case"base64":this.text=fd,this.end=cd,e=3;break;default:this.write=hd,this.end=dd;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Yi.allocUnsafe(e)}er.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};er.prototype.end=ad;er.prototype.text=od;er.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ki(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function id(t,e,r){var i=e.length-1;if(i<r)return 0;var n=Ki(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=Ki(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=Ki(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function nd(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function sd(t){var e=this.lastTotal-this.lastNeed,r=nd(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function od(t,e){var r=id(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function ad(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function ld(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function ud(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function fd(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function cd(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function hd(t){return t.toString(this.encoding)}function dd(t){return t&&t.length?this.write(t):""}});var Ji=T((ty,Ea)=>{"use strict";var ma=ke(),{PromisePrototypeThen:_d,SymbolAsyncIterator:wa,SymbolIterator:xa}=L(),{Buffer:pd}=Ne(),{ERR_INVALID_ARG_TYPE:bd,ERR_STREAM_NULL_VALUES:yd}=V().codes;function gd(t,e,r){let i;if(typeof e=="string"||e instanceof pd)return new t(Oe(M({objectMode:!0},r),{read(){this.push(e),this.push(null)}}));let n;if(e&&e[wa])n=!0,i=e[wa]();else if(e&&e[xa])n=!1,i=e[xa]();else throw new bd("iterable",["Iterable"],e);let s=new t(M({objectMode:!0,highWaterMark:1},r)),o=!1;s._read=function(){o||(o=!0,l())},s._destroy=function(u,f){_d(a(u),()=>ma.nextTick(f,u),c=>ma.nextTick(f,c||u))};async function a(u){let f=u!=null,c=typeof i.throw=="function";if(f&&c){let{value:d,done:h}=await i.throw(u);if(await d,h)return}if(typeof i.return=="function"){let{value:d}=await i.return();await d}}async function l(){for(;;){try{let{value:u,done:f}=n?await i.next():i.next();if(f)s.push(null);else{let c=u&&typeof u.then=="function"?await u:u;if(c===null)throw o=!1,new yd;if(s.push(c))continue;o=!1}}catch(u){s.destroy(u)}break}}return s}Ea.exports=gd});var rr=T((iy,ka)=>{"use strict";var ae=ke(),{ArrayPrototypeIndexOf:md,NumberIsInteger:wd,NumberIsNaN:xd,NumberParseInt:Ed,ObjectDefineProperties:on,ObjectKeys:Sd,ObjectSetPrototypeOf:Ra,Promise:Ta,SafeSet:Id,SymbolAsyncDispose:Rd,SymbolAsyncIterator:Td,Symbol:Ad}=L();ka.exports=I;I.ReadableState=Dr;var{EventEmitter:vd}=Jt(),{Stream:qe,prependListener:Nd}=Nr(),{Buffer:Xi}=Ne(),{addAbortSignal:Pd}=Xt(),Aa=Fe(),R=Y().debuglog("stream",t=>{R=t}),jd=la(),Ct=tt(),{getHighWaterMark:Fd,getDefaultHighWaterMark:Ld}=Zt(),{aggregateTwoErrors:Sa,codes:{ERR_INVALID_ARG_TYPE:Cd,ERR_METHOD_NOT_IMPLEMENTED:Bd,ERR_OUT_OF_RANGE:Dd,ERR_STREAM_PUSH_AFTER_EOF:Od,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Md},AbortError:$d}=V(),{validateObject:kd}=Nt(),it=Ad("kPaused"),{StringDecoder:va}=ga(),Ud=Ji();Ra(I.prototype,qe.prototype);Ra(I,qe);var Zi=()=>{},{errorOrDestroy:Ft}=Ct,Lt=1,qd=2,Na=4,tr=8,Pa=16,Lr=32,Cr=64,ja=128,Wd=256,Gd=512,Qd=1024,nn=2048,sn=4096,zd=8192,Vd=16384,Hd=32768,Fa=65536,Kd=1<<17,Yd=1<<18;function $(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}on(Dr.prototype,{objectMode:$(Lt),ended:$(qd),endEmitted:$(Na),reading:$(tr),constructed:$(Pa),sync:$(Lr),needReadable:$(Cr),emittedReadable:$(ja),readableListening:$(Wd),resumeScheduled:$(Gd),errorEmitted:$(Qd),emitClose:$(nn),autoDestroy:$(sn),destroyed:$(zd),closed:$(Vd),closeEmitted:$(Hd),multiAwaitDrain:$(Fa),readingMore:$(Kd),dataEmitted:$(Yd)});function Dr(t,e,r){typeof r!="boolean"&&(r=e instanceof we()),this.state=nn|sn|Pa|Lr,t&&t.objectMode&&(this.state|=Lt),r&&t&&t.readableObjectMode&&(this.state|=Lt),this.highWaterMark=t?Fd(this,t,"readableHighWaterMark",r):Ld(!1),this.buffer=new jd,this.length=0,this.pipes=[],this.flowing=null,this[it]=null,t&&t.emitClose===!1&&(this.state&=~nn),t&&t.autoDestroy===!1&&(this.state&=~sn),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new va(t.encoding),this.encoding=t.encoding)}function I(t){if(!(this instanceof I))return new I(t);let e=this instanceof we();this._readableState=new Dr(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Pd(t.signal,this)),qe.call(this,t),Ct.construct(this,()=>{this._readableState.needReadable&&Br(this,this._readableState)})}I.prototype.destroy=Ct.destroy;I.prototype._undestroy=Ct.undestroy;I.prototype._destroy=function(t,e){e(t)};I.prototype[vd.captureRejectionSymbol]=function(t){this.destroy(t)};I.prototype[Rd]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new $d,this.destroy(t)),new Ta((e,r)=>Aa(this,i=>i&&i!==t?r(i):e(null)))};I.prototype.push=function(t,e){return La(this,t,e,!1)};I.prototype.unshift=function(t,e){return La(this,t,e,!0)};function La(t,e,r,i){R("readableAddChunk",e);let n=t._readableState,s;if((n.state&Lt)===0&&(typeof e=="string"?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?e=Xi.from(e,r).toString(n.encoding):(e=Xi.from(e,r),r=""))):e instanceof Xi?r="":qe._isUint8Array(e)?(e=qe._uint8ArrayToBuffer(e),r=""):e!=null&&(s=new Cd("chunk",["string","Buffer","Uint8Array"],e))),s)Ft(t,s);else if(e===null)n.state&=~tr,Zd(t,n);else if((n.state&Lt)!==0||e&&e.length>0)if(i)if((n.state&Na)!==0)Ft(t,new Md);else{if(n.destroyed||n.errored)return!1;en(t,n,e,!0)}else if(n.ended)Ft(t,new Od);else{if(n.destroyed||n.errored)return!1;n.state&=~tr,n.decoder&&!r?(e=n.decoder.write(e),n.objectMode||e.length!==0?en(t,n,e,!1):Br(t,n)):en(t,n,e,!1)}else i||(n.state&=~tr,Br(t,n));return!n.ended&&(n.length<n.highWaterMark||n.length===0)}function en(t,e,r,i){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?((e.state&Fa)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),(e.state&Cr)!==0&&Or(t)),Br(t,e)}I.prototype.isPaused=function(){let t=this._readableState;return t[it]===!0||t.flowing===!1};I.prototype.setEncoding=function(t){let e=new va(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let n of r)i+=e.write(n);return r.clear(),i!==""&&r.push(i),this._readableState.length=i.length,this};var Jd=1073741824;function Xd(t){if(t>Jd)throw new Dd("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Ia(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&Lt)!==0?1:xd(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}I.prototype.read=function(t){R("read",t),t===void 0?t=NaN:wd(t)||(t=Ed(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=Xd(t)),t!==0&&(e.state&=~ja),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return R("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?tn(this):Or(this),null;if(t=Ia(t,e),t===0&&e.ended)return e.length===0&&tn(this),null;let i=(e.state&Cr)!==0;if(R("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,R("length less than watermark",i)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)i=!1,R("reading, ended or constructing",i);else if(i){R("do read"),e.state|=tr|Lr,e.length===0&&(e.state|=Cr);try{this._read(e.highWaterMark)}catch(s){Ft(this,s)}e.state&=~Lr,e.reading||(t=Ia(r,e))}let n;return t>0?n=Ma(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&tn(this)),n!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",n)),n};function Zd(t,e){if(R("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Or(t):(e.needReadable=!1,e.emittedReadable=!0,Ca(t))}}function Or(t){let e=t._readableState;R("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(R("emitReadable",e.flowing),e.emittedReadable=!0,ae.nextTick(Ca,t))}function Ca(t){let e=t._readableState;R("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Da(t)}function Br(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,ae.nextTick(e_,t,e))}function e_(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(R("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}I.prototype._read=function(t){throw new Bd("_read()")};I.prototype.pipe=function(t,e){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new Id(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(t),R("pipe count=%d opts=%j",i.pipes.length,e);let s=(!e||e.end!==!1)&&t!==ae.stdout&&t!==ae.stderr?a:y;i.endEmitted?ae.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(g,S){R("onunpipe"),g===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,f())}function a(){R("onend"),t.end()}let l,u=!1;function f(){R("cleanup"),t.removeListener("close",b),t.removeListener("finish",_),l&&t.removeListener("drain",l),t.removeListener("error",h),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",d),u=!0,l&&i.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}function c(){u||(i.pipes.length===1&&i.pipes[0]===t?(R("false write response, pause",0),i.awaitDrainWriters=t,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(t)&&(R("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(t)),r.pause()),l||(l=t_(r,t),t.on("drain",l))}r.on("data",d);function d(g){R("ondata");let S=t.write(g);R("dest.write",S),S===!1&&c()}function h(g){if(R("onerror",g),y(),t.removeListener("error",h),t.listenerCount("error")===0){let S=t._writableState||t._readableState;S&&!S.errorEmitted?Ft(t,g):t.emit("error",g)}}Nd(t,"error",h);function b(){t.removeListener("finish",_),y()}t.once("close",b);function _(){R("onfinish"),t.removeListener("close",b),y()}t.once("finish",_);function y(){R("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?c():i.flowing||(R("pipe resume"),r.resume()),t};function t_(t,e){return function(){let i=t._readableState;i.awaitDrainWriters===e?(R("pipeOnDrain",1),i.awaitDrainWriters=null):i.multiAwaitDrain&&(R("pipeOnDrain",i.awaitDrainWriters.size),i.awaitDrainWriters.delete(e)),(!i.awaitDrainWriters||i.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}I.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let n=e.pipes;e.pipes=[],this.pause();for(let s=0;s<n.length;s++)n[s].emit("unpipe",this,{hasUnpiped:!1});return this}let i=md(e.pipes,t);return i===-1?this:(e.pipes.splice(i,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};I.prototype.on=function(t,e){let r=qe.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,R("on readable",i.length,i.reading),i.length?Or(this):i.reading||ae.nextTick(r_,this)),r};I.prototype.addListener=I.prototype.on;I.prototype.removeListener=function(t,e){let r=qe.prototype.removeListener.call(this,t,e);return t==="readable"&&ae.nextTick(Ba,this),r};I.prototype.off=I.prototype.removeListener;I.prototype.removeAllListeners=function(t){let e=qe.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&ae.nextTick(Ba,this),e};function Ba(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[it]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function r_(t){R("readable nexttick read 0"),t.read(0)}I.prototype.resume=function(){let t=this._readableState;return t.flowing||(R("resume"),t.flowing=!t.readableListening,i_(this,t)),t[it]=!1,this};function i_(t,e){e.resumeScheduled||(e.resumeScheduled=!0,ae.nextTick(n_,t,e))}function n_(t,e){R("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Da(t),e.flowing&&!e.reading&&t.read(0)}I.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[it]=!0,this};function Da(t){let e=t._readableState;for(R("flow",e.flowing);e.flowing&&t.read()!==null;);}I.prototype.wrap=function(t){let e=!1;t.on("data",i=>{!this.push(i)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",i=>{Ft(this,i)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=Sd(t);for(let i=1;i<r.length;i++){let n=r[i];this[n]===void 0&&typeof t[n]=="function"&&(this[n]=t[n].bind(t))}return this};I.prototype[Td]=function(){return Oa(this)};I.prototype.iterator=function(t){return t!==void 0&&kd(t,"options"),Oa(this,t)};function Oa(t,e){typeof t.read!="function"&&(t=I.wrap(t,{objectMode:!0}));let r=s_(t,e);return r.stream=t,r}function s_(t,e){return ee(this,null,function*(){let r=Zi;function i(o){this===t?(r(),r=Zi):r=o}t.on("readable",i);let n,s=Aa(t,{writable:!1},o=>{n=o?Sa(n,o):null,r(),r=Zi});try{for(;;){let o=t.destroyed?null:t.read();if(o!==null)yield o;else{if(n)throw n;if(n===null)return;yield new q(new Ta(i))}}}catch(o){throw n=Sa(n,o),n}finally{(n||(e==null?void 0:e.destroyOnReturn)!==!1)&&(n===void 0||t._readableState.autoDestroy)?Ct.destroyer(t,null):(t.off("readable",i),s())}})}on(I.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},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(t){this._readableState&&(this._readableState.flowing=t)}},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(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});on(Dr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[it]!==!1},set(t){this[it]=!!t}}});I._fromList=Ma;function Ma(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function tn(t){let e=t._readableState;R("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,ae.nextTick(o_,e,t))}function o_(t,e){if(R("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)ae.nextTick(a_,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function a_(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}I.from=function(t,e){return Ud(I,t,e)};var rn;function $a(){return rn===void 0&&(rn={}),rn}I.fromWeb=function(t,e){return $a().newStreamReadableFromReadableStream(t,e)};I.toWeb=function(t,e){return $a().newReadableStreamFromStreamReadable(t,e)};I.wrap=function(t,e){var r,i;return new I(Oe(M({objectMode:(r=(i=t.readableObjectMode)!==null&&i!==void 0?i:t.objectMode)!==null&&r!==void 0?r:!0},e),{destroy(n,s){Ct.destroyer(t,n),s(n)}})).wrap(t)}});var qr=T((sy,Xa)=>{"use strict";var nt=ke(),{ArrayPrototypeSlice:Wa,Error:l_,FunctionPrototypeSymbolHasInstance:Ga,ObjectDefineProperty:Qa,ObjectDefineProperties:u_,ObjectSetPrototypeOf:za,StringPrototypeToLowerCase:f_,Symbol:c_,SymbolHasInstance:h_}=L();Xa.exports=C;C.WritableState=sr;var{EventEmitter:d_}=Jt(),ir=Nr().Stream,{Buffer:Mr}=Ne(),Ur=tt(),{addAbortSignal:__}=Xt(),{getHighWaterMark:p_,getDefaultHighWaterMark:b_}=Zt(),{ERR_INVALID_ARG_TYPE:y_,ERR_METHOD_NOT_IMPLEMENTED:g_,ERR_MULTIPLE_CALLBACK:Va,ERR_STREAM_CANNOT_PIPE:m_,ERR_STREAM_DESTROYED:nr,ERR_STREAM_ALREADY_FINISHED:w_,ERR_STREAM_NULL_VALUES:x_,ERR_STREAM_WRITE_AFTER_END:E_,ERR_UNKNOWN_ENCODING:Ha}=V().codes,{errorOrDestroy:Bt}=Ur;za(C.prototype,ir.prototype);za(C,ir);function un(){}var Dt=c_("kOnFinished");function sr(t,e,r){typeof r!="boolean"&&(r=e instanceof we()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?p_(this,t,"writableHighWaterMark",r):b_(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(t&&t.decodeStrings===!1);this.decodeStrings=!i,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=I_.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,kr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Dt]=[]}function kr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}sr.prototype.getBuffer=function(){return Wa(this.buffered,this.bufferedIndex)};Qa(sr.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function C(t){let e=this instanceof we();if(!e&&!Ga(C,this))return new C(t);this._writableState=new sr(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&__(t.signal,this)),ir.call(this,t),Ur.construct(this,()=>{let r=this._writableState;r.writing||cn(this,r),hn(this,r)})}Qa(C,h_,{__proto__:null,value:function(t){return Ga(this,t)?!0:this!==C?!1:t&&t._writableState instanceof sr}});C.prototype.pipe=function(){Bt(this,new m_)};function Ka(t,e,r,i){let n=t._writableState;if(typeof r=="function")i=r,r=n.defaultEncoding;else{if(!r)r=n.defaultEncoding;else if(r!=="buffer"&&!Mr.isEncoding(r))throw new Ha(r);typeof i!="function"&&(i=un)}if(e===null)throw new x_;if(!n.objectMode)if(typeof e=="string")n.decodeStrings!==!1&&(e=Mr.from(e,r),r="buffer");else if(e instanceof Mr)r="buffer";else if(ir._isUint8Array(e))e=ir._uint8ArrayToBuffer(e),r="buffer";else throw new y_("chunk",["string","Buffer","Uint8Array"],e);let s;return n.ending?s=new E_:n.destroyed&&(s=new nr("write")),s?(nt.nextTick(i,s),Bt(t,s,!0),s):(n.pendingcb++,S_(t,n,e,r,i))}C.prototype.write=function(t,e,r){return Ka(this,t,e,r)===!0};C.prototype.cork=function(){this._writableState.corked++};C.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||cn(this,t))};C.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=f_(e)),!Mr.isEncoding(e))throw new Ha(e);return this._writableState.defaultEncoding=e,this};function S_(t,e,r,i,n){let s=e.objectMode?1:r.length;e.length+=s;let o=e.length<e.highWaterMark;return o||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:i,callback:n}),e.allBuffers&&i!=="buffer"&&(e.allBuffers=!1),e.allNoop&&n!==un&&(e.allNoop=!1)):(e.writelen=s,e.writecb=n,e.writing=!0,e.sync=!0,t._write(r,i,e.onwrite),e.sync=!1),o&&!e.errored&&!e.destroyed}function Ua(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new nr("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function qa(t,e,r,i){--e.pendingcb,i(r),fn(e),Bt(t,r)}function I_(t,e){let r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function"){Bt(t,new Va);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),i?nt.nextTick(qa,t,r,e,n):qa(t,r,e,n)):(r.buffered.length>r.bufferedIndex&&cn(t,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===n?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:n,stream:t,state:r},nt.nextTick(R_,r.afterWriteTickInfo)):Ya(t,r,1,n))}function R_({stream:t,state:e,count:r,cb:i}){return e.afterWriteTickInfo=null,Ya(t,e,r,i)}function Ya(t,e,r,i){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,i();e.destroyed&&fn(e),hn(t,e)}function fn(t){if(t.writing)return;for(let n=t.bufferedIndex;n<t.buffered.length;++n){var e;let{chunk:s,callback:o}=t.buffered[n],a=t.objectMode?1:s.length;t.length-=a,o((e=t.errored)!==null&&e!==void 0?e:new nr("write"))}let r=t[Dt].splice(0);for(let n=0;n<r.length;n++){var i;r[n]((i=t.errored)!==null&&i!==void 0?i:new nr("end"))}kr(t)}function cn(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:n}=e,s=r.length-i;if(!s)return;let o=i;if(e.bufferProcessing=!0,s>1&&t._writev){e.pendingcb-=s-1;let a=e.allNoop?un:u=>{for(let f=o;f<r.length;++f)r[f].callback(u)},l=e.allNoop&&o===0?r:Wa(r,o);l.allBuffers=e.allBuffers,Ua(t,e,!0,e.length,l,"",a),kr(e)}else{do{let{chunk:a,encoding:l,callback:u}=r[o];r[o++]=null;let f=n?1:a.length;Ua(t,e,!1,f,a,l,u)}while(o<r.length&&!e.writing);o===r.length?kr(e):o>256?(r.splice(0,o),e.bufferedIndex=0):e.bufferedIndex=o}e.bufferProcessing=!1}C.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new g_("_write()")};C.prototype._writev=null;C.prototype.end=function(t,e,r){let i=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n;if(t!=null){let s=Ka(this,t,e);s instanceof l_&&(n=s)}return i.corked&&(i.corked=1,this.uncork()),n||(!i.errored&&!i.ending?(i.ending=!0,hn(this,i,!0),i.ended=!0):i.finished?n=new w_("end"):i.destroyed&&(n=new nr("end"))),typeof r=="function"&&(n||i.finished?nt.nextTick(r,n):i[Dt].push(r)),this};function $r(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function T_(t,e){let r=!1;function i(n){if(r){Bt(t,n!=null?n:Va());return}if(r=!0,e.pendingcb--,n){let s=e[Dt].splice(0);for(let o=0;o<s.length;o++)s[o](n);Bt(t,n,e.sync)}else $r(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,nt.nextTick(ln,t,e))}e.sync=!0,e.pendingcb++;try{t._final(i)}catch(n){i(n)}e.sync=!1}function A_(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,T_(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function hn(t,e,r){$r(e)&&(A_(t,e),e.pendingcb===0&&(r?(e.pendingcb++,nt.nextTick((i,n)=>{$r(n)?ln(i,n):n.pendingcb--},t,e)):$r(e)&&(e.pendingcb++,ln(t,e))))}function ln(t,e){e.pendingcb--,e.finished=!0;let r=e[Dt].splice(0);for(let i=0;i<r.length;i++)r[i]();if(t.emit("finish"),e.autoDestroy){let i=t._readableState;(!i||i.autoDestroy&&(i.endEmitted||i.readable===!1))&&t.destroy()}}u_(C.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},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(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.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)}}});var v_=Ur.destroy;C.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Dt].length)&&nt.nextTick(fn,r),v_.call(this,t,e),this};C.prototype._undestroy=Ur.undestroy;C.prototype._destroy=function(t,e){e(t)};C.prototype[d_.captureRejectionSymbol]=function(t){this.destroy(t)};var an;function Ja(){return an===void 0&&(an={}),an}C.fromWeb=function(t,e){return Ja().newStreamWritableFromWritableStream(t,e)};C.toWeb=function(t){return Ja().newWritableStreamFromStreamWritable(t)}});var dl=T((oy,hl)=>{var dn=ke(),N_=Ne(),{isReadable:P_,isWritable:j_,isIterable:Za,isNodeStream:F_,isReadableNodeStream:el,isWritableNodeStream:tl,isDuplexNodeStream:L_,isReadableStream:rl,isWritableStream:il}=ye(),nl=Fe(),{AbortError:fl,codes:{ERR_INVALID_ARG_TYPE:C_,ERR_INVALID_RETURN_VALUE:sl}}=V(),{destroyer:Mt}=tt(),B_=we(),cl=rr(),D_=qr(),{createDeferredPromise:ol}=Y(),al=Ji(),ll=globalThis.Blob||N_.Blob,O_=typeof ll!="undefined"?function(e){return e instanceof ll}:function(e){return!1},M_=globalThis.AbortController||Tt().AbortController,{FunctionPrototypeCall:ul}=L(),We=class extends B_{constructor(e){super(e),(e==null?void 0:e.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(e==null?void 0:e.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};hl.exports=function t(e,r){if(L_(e))return e;if(el(e))return Ot({readable:e});if(tl(e))return Ot({writable:e});if(F_(e))return Ot({writable:!1,readable:!1});if(rl(e))return Ot({readable:cl.fromWeb(e)});if(il(e))return Ot({writable:D_.fromWeb(e)});if(typeof e=="function"){let{value:n,write:s,final:o,destroy:a}=$_(e);if(Za(n))return al(We,n,{objectMode:!0,write:s,final:o,destroy:a});let l=n==null?void 0:n.then;if(typeof l=="function"){let u,f=ul(l,n,c=>{if(c!=null)throw new sl("nully","body",c)},c=>{Mt(u,c)});return u=new We({objectMode:!0,readable:!1,write:s,final(c){o(async()=>{try{await f,dn.nextTick(c,null)}catch(d){dn.nextTick(c,d)}})},destroy:a})}throw new sl("Iterable, AsyncIterable or AsyncFunction",r,n)}if(O_(e))return t(e.arrayBuffer());if(Za(e))return al(We,e,{objectMode:!0,writable:!1});if(rl(e==null?void 0:e.readable)&&il(e==null?void 0:e.writable))return We.fromWeb(e);if(typeof(e==null?void 0:e.writable)=="object"||typeof(e==null?void 0:e.readable)=="object"){let n=e!=null&&e.readable?el(e==null?void 0:e.readable)?e==null?void 0:e.readable:t(e.readable):void 0,s=e!=null&&e.writable?tl(e==null?void 0:e.writable)?e==null?void 0:e.writable:t(e.writable):void 0;return Ot({readable:n,writable:s})}let i=e==null?void 0:e.then;if(typeof i=="function"){let n;return ul(i,e,s=>{s!=null&&n.push(s),n.push(null)},s=>{Mt(n,s)}),n=new We({objectMode:!0,writable:!1,read(){}})}throw new C_(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function $_(t){let{promise:e,resolve:r}=ol(),i=new M_,n=i.signal;return{value:t((function(){return ee(this,null,function*(){for(;;){let o=e;e=null;let{chunk:a,done:l,cb:u}=yield new q(o);if(dn.nextTick(u),l)return;if(n.aborted)throw new fl(void 0,{cause:n.reason});({promise:e,resolve:r}=ol()),yield a}})})(),{signal:n}),write(o,a,l){let u=r;r=null,u({chunk:o,done:!1,cb:l})},final(o){let a=r;r=null,a({done:!0,cb:o})},destroy(o,a){i.abort(),a(o)}}}function Ot(t){let e=t.readable&&typeof t.readable.read!="function"?cl.wrap(t.readable):t.readable,r=t.writable,i=!!P_(e),n=!!j_(r),s,o,a,l,u;function f(c){let d=l;l=null,d?d(c):c&&u.destroy(c)}return u=new We({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:i,writable:n}),n&&(nl(r,c=>{n=!1,c&&Mt(e,c),f(c)}),u._write=function(c,d,h){r.write(c,d)?h():s=h},u._final=function(c){r.end(),o=c},r.on("drain",function(){if(s){let c=s;s=null,c()}}),r.on("finish",function(){if(o){let c=o;o=null,c()}})),i&&(nl(e,c=>{i=!1,c&&Mt(e,c),f(c)}),e.on("readable",function(){if(a){let c=a;a=null,c()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let c=e.read();if(c===null){a=u._read;return}if(!u.push(c))return}}),u._destroy=function(c,d){!c&&l!==null&&(c=new fl),a=null,s=null,o=null,l===null?d(c):(l=d,Mt(r,c),Mt(e,c))},u}});var we=T((ly,bl)=>{"use strict";var{ObjectDefineProperties:k_,ObjectGetOwnPropertyDescriptor:Le,ObjectKeys:U_,ObjectSetPrototypeOf:_l}=L();bl.exports=le;var bn=rr(),ie=qr();_l(le.prototype,bn.prototype);_l(le,bn);{let t=U_(ie.prototype);for(let e=0;e<t.length;e++){let r=t[e];le.prototype[r]||(le.prototype[r]=ie.prototype[r])}}function le(t){if(!(this instanceof le))return new le(t);bn.call(this,t),ie.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}k_(le.prototype,{writable:M({__proto__:null},Le(ie.prototype,"writable")),writableHighWaterMark:M({__proto__:null},Le(ie.prototype,"writableHighWaterMark")),writableObjectMode:M({__proto__:null},Le(ie.prototype,"writableObjectMode")),writableBuffer:M({__proto__:null},Le(ie.prototype,"writableBuffer")),writableLength:M({__proto__:null},Le(ie.prototype,"writableLength")),writableFinished:M({__proto__:null},Le(ie.prototype,"writableFinished")),writableCorked:M({__proto__:null},Le(ie.prototype,"writableCorked")),writableEnded:M({__proto__:null},Le(ie.prototype,"writableEnded")),writableNeedDrain:M({__proto__:null},Le(ie.prototype,"writableNeedDrain")),destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var _n;function pl(){return _n===void 0&&(_n={}),_n}le.fromWeb=function(t,e){return pl().newStreamDuplexFromReadableWritablePair(t,e)};le.toWeb=function(t){return pl().newReadableWritablePairFromDuplex(t)};var pn;le.from=function(t){return pn||(pn=dl()),pn(t,"body")}});var mn=T((fy,gl)=>{"use strict";var{ObjectSetPrototypeOf:yl,Symbol:q_}=L();gl.exports=Ce;var{ERR_METHOD_NOT_IMPLEMENTED:W_}=V().codes,gn=we(),{getHighWaterMark:G_}=Zt();yl(Ce.prototype,gn.prototype);yl(Ce,gn);var or=q_("kCallback");function Ce(t){if(!(this instanceof Ce))return new Ce(t);let e=t?G_(this,t,"readableHighWaterMark",!0):null;e===0&&(t=Oe(M({},t),{highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0})),gn.call(this,t),this._readableState.sync=!1,this[or]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Q_)}function yn(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function Q_(){this._final!==yn&&yn.call(this)}Ce.prototype._final=yn;Ce.prototype._transform=function(t,e,r){throw new W_("_transform()")};Ce.prototype._write=function(t,e,r){let i=this._readableState,n=this._writableState,s=i.length;this._transform(t,e,(o,a)=>{if(o){r(o);return}a!=null&&this.push(a),n.ended||s===i.length||i.length<i.highWaterMark?r():this[or]=r})};Ce.prototype._read=function(){if(this[or]){let t=this[or];this[or]=null,t()}}});var xn=T((hy,wl)=>{"use strict";var{ObjectSetPrototypeOf:ml}=L();wl.exports=$t;var wn=mn();ml($t.prototype,wn.prototype);ml($t,wn);function $t(t){if(!(this instanceof $t))return new $t(t);wn.call(this,t)}$t.prototype._transform=function(t,e,r){r(null,t)}});var zr=T((dy,Rl)=>{var ar=ke(),{ArrayIsArray:z_,Promise:V_,SymbolAsyncIterator:H_,SymbolDispose:K_}=L(),Qr=Fe(),{once:Y_}=Y(),J_=tt(),xl=we(),{aggregateTwoErrors:X_,codes:{ERR_INVALID_ARG_TYPE:Pn,ERR_INVALID_RETURN_VALUE:En,ERR_MISSING_ARGS:Z_,ERR_STREAM_DESTROYED:ep,ERR_STREAM_PREMATURE_CLOSE:tp},AbortError:rp}=V(),{validateFunction:ip,validateAbortSignal:np}=Nt(),{isIterable:st,isReadable:Sn,isReadableNodeStream:Gr,isNodeStream:El,isTransformStream:kt,isWebStream:sp,isReadableStream:In,isReadableFinished:op}=ye(),ap=globalThis.AbortController||Tt().AbortController,Rn,Tn,An;function Sl(t,e,r){let i=!1;t.on("close",()=>{i=!0});let n=Qr(t,{readable:e,writable:r},s=>{i=!s});return{destroy:s=>{i||(i=!0,J_.destroyer(t,s||new ep("pipe")))},cleanup:n}}function lp(t){return ip(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function vn(t){if(st(t))return t;if(Gr(t))return up(t);throw new Pn("val",["Readable","Iterable","AsyncIterable"],t)}function up(t){return ee(this,null,function*(){Tn||(Tn=rr()),yield*ne(Tn.prototype[H_].call(t))})}async function Wr(t,e,r,{end:i}){let n,s=null,o=h=>{if(h&&(n=h),s){let b=s;s=null,b()}},a=()=>new V_((h,b)=>{n?b(n):s=()=>{n?b(n):h()}});e.on("drain",o);let l=Qr(e,{readable:!1},o);try{e.writableNeedDrain&&await a();try{for(var u=J(t),f,c,d;f=!(c=await u.next()).done;f=!1){let h=c.value;e.write(h)||await a()}}catch(c){d=[c]}finally{try{f&&(c=u.return)&&await c.call(u)}finally{if(d)throw d[0]}}i&&(e.end(),await a()),r()}catch(h){r(n!==h?X_(n,h):h)}finally{l(),e.off("drain",o)}}async function Nn(t,e,r,{end:i}){kt(e)&&(e=e.writable);let n=e.getWriter();try{try{for(var s=J(t),o,a,l;o=!(a=await s.next()).done;o=!1){let u=a.value;await n.ready,n.write(u).catch(()=>{})}}catch(a){l=[a]}finally{try{o&&(a=s.return)&&await a.call(s)}finally{if(l)throw l[0]}}await n.ready,i&&await n.close(),r()}catch(u){try{await n.abort(u),r(u)}catch(f){r(f)}}}function fp(...t){return Il(t,Y_(lp(t)))}function Il(t,e,r){if(t.length===1&&z_(t[0])&&(t=t[0]),t.length<2)throw new Z_("streams");let i=new ap,n=i.signal,s=r==null?void 0:r.signal,o=[];np(s,"options.signal");function a(){b(new rp)}An=An||Y().addAbortListener;let l;s&&(l=An(s,a));let u,f,c=[],d=0;function h(m){b(m,--d===0)}function b(m,w){var x;if(m&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=m),!(!u&&!w)){for(;c.length;)c.shift()(u);(x=l)===null||x===void 0||x[K_](),i.abort(),w&&(u||o.forEach(A=>A()),ar.nextTick(e,u,f))}}let _;for(let m=0;m<t.length;m++){let w=t[m],x=m<t.length-1,A=m>0,E=x||(r==null?void 0:r.end)!==!1,B=m===t.length-1;if(El(w)){let P=function(K){K&&K.name!=="AbortError"&&K.code!=="ERR_STREAM_PREMATURE_CLOSE"&&h(K)};var S=P;if(E){let{destroy:K,cleanup:ut}=Sl(w,x,A);c.push(K),Sn(w)&&B&&o.push(ut)}w.on("error",P),Sn(w)&&B&&o.push(()=>{w.removeListener("error",P)})}if(m===0)if(typeof w=="function"){if(_=w({signal:n}),!st(_))throw new En("Iterable, AsyncIterable or Stream","source",_)}else st(w)||Gr(w)||kt(w)?_=w:_=xl.from(w);else if(typeof w=="function"){if(kt(_)){var y;_=vn((y=_)===null||y===void 0?void 0:y.readable)}else _=vn(_);if(_=w(_,{signal:n}),x){if(!st(_,!0))throw new En("AsyncIterable",`transform[${m-1}]`,_)}else{var g;Rn||(Rn=xn());let P=new Rn({objectMode:!0}),K=(g=_)===null||g===void 0?void 0:g.then;if(typeof K=="function")d++,K.call(_,De=>{f=De,De!=null&&P.write(De),E&&P.end(),ar.nextTick(h)},De=>{P.destroy(De),ar.nextTick(h,De)});else if(st(_,!0))d++,Wr(_,P,h,{end:E});else if(In(_)||kt(_)){let De=_.readable||_;d++,Wr(De,P,h,{end:E})}else throw new En("AsyncIterable or Promise","destination",_);_=P;let{destroy:ut,cleanup:su}=Sl(_,!1,!0);c.push(ut),B&&o.push(su)}}else if(El(w)){if(Gr(_)){d+=2;let P=cp(_,w,h,{end:E});Sn(w)&&B&&o.push(P)}else if(kt(_)||In(_)){let P=_.readable||_;d++,Wr(P,w,h,{end:E})}else if(st(_))d++,Wr(_,w,h,{end:E});else throw new Pn("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=w}else if(sp(w)){if(Gr(_))d++,Nn(vn(_),w,h,{end:E});else if(In(_)||st(_))d++,Nn(_,w,h,{end:E});else if(kt(_))d++,Nn(_.readable,w,h,{end:E});else throw new Pn("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);_=w}else _=xl.from(w)}return(n!=null&&n.aborted||s!=null&&s.aborted)&&ar.nextTick(a),_}function cp(t,e,r,{end:i}){let n=!1;if(e.on("close",()=>{n||r(new tp)}),t.pipe(e,{end:!1}),i){let o=function(){n=!0,e.end()};var s=o;op(t)?ar.nextTick(o):t.once("end",o)}else r();return Qr(t,{readable:!0,writable:!1},o=>{let a=t._readableState;o&&o.code==="ERR_STREAM_PREMATURE_CLOSE"&&a&&a.ended&&!a.errored&&!a.errorEmitted?t.once("end",r).once("error",r):r(o)}),Qr(e,{readable:!1,writable:!0},r)}Rl.exports={pipelineImpl:Il,pipeline:fp}});var Fn=T((py,jl)=>{"use strict";var{pipeline:hp}=zr(),Vr=we(),{destroyer:dp}=tt(),{isNodeStream:Hr,isReadable:Tl,isWritable:Al,isWebStream:jn,isTransformStream:ot,isWritableStream:vl,isReadableStream:Nl}=ye(),{AbortError:_p,codes:{ERR_INVALID_ARG_VALUE:Pl,ERR_MISSING_ARGS:pp}}=V(),bp=Fe();jl.exports=function(...e){if(e.length===0)throw new pp("streams");if(e.length===1)return Vr.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Vr.from(e[0])),typeof e[e.length-1]=="function"){let h=e.length-1;e[h]=Vr.from(e[h])}for(let h=0;h<e.length;++h)if(!(!Hr(e[h])&&!jn(e[h]))){if(h<e.length-1&&!(Tl(e[h])||Nl(e[h])||ot(e[h])))throw new Pl(`streams[${h}]`,r[h],"must be readable");if(h>0&&!(Al(e[h])||vl(e[h])||ot(e[h])))throw new Pl(`streams[${h}]`,r[h],"must be writable")}let i,n,s,o,a;function l(h){let b=o;o=null,b?b(h):h?a.destroy(h):!d&&!c&&a.destroy()}let u=e[0],f=hp(e,l),c=!!(Al(u)||vl(u)||ot(u)),d=!!(Tl(f)||Nl(f)||ot(f));if(a=new Vr({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(f!=null&&f.readableObjectMode),writable:c,readable:d}),c){if(Hr(u))a._write=function(b,_,y){u.write(b,_)?y():i=y},a._final=function(b){u.end(),n=b},u.on("drain",function(){if(i){let b=i;i=null,b()}});else if(jn(u)){let _=(ot(u)?u.writable:u).getWriter();a._write=async function(y,g,S){try{await _.ready,_.write(y).catch(()=>{}),S()}catch(m){S(m)}},a._final=async function(y){try{await _.ready,_.close().catch(()=>{}),n=y}catch(g){y(g)}}}let h=ot(f)?f.readable:f;bp(h,()=>{if(n){let b=n;n=null,b()}})}if(d){if(Hr(f))f.on("readable",function(){if(s){let h=s;s=null,h()}}),f.on("end",function(){a.push(null)}),a._read=function(){for(;;){let h=f.read();if(h===null){s=a._read;return}if(!a.push(h))return}};else if(jn(f)){let b=(ot(f)?f.readable:f).getReader();a._read=async function(){for(;;)try{let{value:_,done:y}=await b.read();if(!a.push(_))return;if(y){a.push(null);return}}catch(_){return}}}}return a._destroy=function(h,b){!h&&o!==null&&(h=new _p),s=null,i=null,n=null,o===null?b(h):(o=b,Hr(f)&&dp(f,h))},a}});var Ul=T((by,Bn)=>{"use strict";var yp=globalThis.AbortController||Tt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:gp,ERR_INVALID_ARG_TYPE:lr,ERR_MISSING_ARGS:mp,ERR_OUT_OF_RANGE:wp},AbortError:xe}=V(),{validateAbortSignal:at,validateInteger:Fl,validateObject:lt}=Nt(),xp=L().Symbol("kWeak"),Ep=L().Symbol("kResistStopPropagation"),{finished:Sp}=Fe(),Ip=Fn(),{addAbortSignalNoValidate:Rp}=Xt(),{isWritable:Tp,isNodeStream:Ap}=ye(),{deprecate:vp}=Y(),{ArrayPrototypePush:Np,Boolean:Pp,MathFloor:Ll,Number:jp,NumberIsNaN:Fp,Promise:Cl,PromiseReject:Bl,PromiseResolve:Lp,PromisePrototypeThen:Dl,Symbol:Ml}=L(),Kr=Ml("kEmpty"),Ol=Ml("kEof");function Cp(t,e){if(e!=null&&lt(e,"options"),(e==null?void 0:e.signal)!=null&&at(e.signal,"options.signal"),Ap(t)&&!Tp(t))throw new gp("stream",t,"must be writable");let r=Ip(this,t);return e!=null&&e.signal&&Rp(e.signal,r),r}function Yr(t,e){if(typeof t!="function")throw new lr("fn",["Function","AsyncFunction"],t);e!=null&&lt(e,"options"),(e==null?void 0:e.signal)!=null&&at(e.signal,"options.signal");let r=1;(e==null?void 0:e.concurrency)!=null&&(r=Ll(e.concurrency));let i=r-1;return(e==null?void 0:e.highWaterMark)!=null&&(i=Ll(e.highWaterMark)),Fl(r,"options.concurrency",1),Fl(i,"options.highWaterMark",0),i+=r,function(){return ee(this,null,function*(){let s=Y().AbortSignalAny([e==null?void 0:e.signal].filter(Pp)),o=this,a=[],l={signal:s},u,f,c=!1,d=0;function h(){c=!0,b()}function b(){d-=1,_()}function _(){f&&!c&&d<r&&a.length<i&&(f(),f=null)}async function y(){try{try{for(var g=J(o),S,m,w;S=!(m=await g.next()).done;S=!1){let x=m.value;if(c)return;if(s.aborted)throw new xe;try{if(x=t(x,l),x===Kr)continue;x=Lp(x)}catch(A){x=Bl(A)}d+=1,Dl(x,b,h),a.push(x),u&&(u(),u=null),!c&&(a.length>=i||d>=r)&&await new Cl(A=>{f=A})}}catch(m){w=[m]}finally{try{S&&(m=g.return)&&await m.call(g)}finally{if(w)throw w[0]}}a.push(Ol)}catch(x){let A=Bl(x);Dl(A,b,h),a.push(A)}finally{c=!0,u&&(u(),u=null)}}y();try{for(;;){for(;a.length>0;){let g=yield new q(a[0]);if(g===Ol)return;if(s.aborted)throw new xe;g!==Kr&&(yield g),a.shift(),_()}yield new q(new Cl(g=>{u=g}))}}finally{c=!0,f&&(f(),f=null)}})}.call(this)}function Bp(t=void 0){return t!=null&&lt(t,"options"),(t==null?void 0:t.signal)!=null&&at(t.signal,"options.signal"),function(){return ee(this,null,function*(){let r=0;try{for(var n=J(this),s,o,a;s=!(o=yield new q(n.next())).done;s=!1){let l=o.value;var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new xe({cause:t.signal.reason});yield[r++,l]}}catch(o){a=[o]}finally{try{s&&(o=n.return)&&(yield new q(o.call(n)))}finally{if(a)throw a[0]}}})}.call(this)}async function $l(t,e=void 0){try{for(var r=J(Cn.call(this,t,e)),i,n,s;i=!(n=await r.next()).done;i=!1){let o=n.value;return!0}}catch(n){s=[n]}finally{try{i&&(n=r.return)&&await n.call(r)}finally{if(s)throw s[0]}}return!1}async function Dp(t,e=void 0){if(typeof t!="function")throw new lr("fn",["Function","AsyncFunction"],t);return!await $l.call(this,async(...r)=>!await t(...r),e)}async function Op(t,e){try{for(var r=J(Cn.call(this,t,e)),i,n,s;i=!(n=await r.next()).done;i=!1){let o=n.value;return o}}catch(n){s=[n]}finally{try{i&&(n=r.return)&&await n.call(r)}finally{if(s)throw s[0]}}}async function Mp(t,e){if(typeof t!="function")throw new lr("fn",["Function","AsyncFunction"],t);async function r(a,l){return await t(a,l),Kr}try{for(var i=J(Yr.call(this,r,e)),n,s,o;n=!(s=await i.next()).done;n=!1){let a=s.value;;}}catch(s){o=[s]}finally{try{n&&(s=i.return)&&await s.call(i)}finally{if(o)throw o[0]}}}function Cn(t,e){if(typeof t!="function")throw new lr("fn",["Function","AsyncFunction"],t);async function r(i,n){return await t(i,n)?i:Kr}return Yr.call(this,r,e)}var Ln=class extends mp{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function $p(t,e,r){var i;if(typeof t!="function")throw new lr("reducer",["Function","AsyncFunction"],t);r!=null&&lt(r,"options"),(r==null?void 0:r.signal)!=null&&at(r.signal,"options.signal");let n=arguments.length>1;if(r!=null&&(i=r.signal)!==null&&i!==void 0&&i.aborted){let h=new xe(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await Sp(this.destroy(h)),h}let s=new yp,o=s.signal;if(r!=null&&r.signal){let h={once:!0,[xp]:this,[Ep]:!0};r.signal.addEventListener("abort",()=>s.abort(),h)}let a=!1;try{try{for(var u=J(this),f,c,d;f=!(c=await u.next()).done;f=!1){let h=c.value;var l;if(a=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new xe;n?e=await t(e,h,{signal:o}):(e=h,n=!0)}}catch(c){d=[c]}finally{try{f&&(c=u.return)&&await c.call(u)}finally{if(d)throw d[0]}}if(!a&&!n)throw new Ln}finally{s.abort()}return e}async function kp(t){t!=null&&lt(t,"options"),(t==null?void 0:t.signal)!=null&&at(t.signal,"options.signal");let e=[];try{for(var i=J(this),n,s,o;n=!(s=await i.next()).done;n=!1){let a=s.value;var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new xe(void 0,{cause:t.signal.reason});Np(e,a)}}catch(s){o=[s]}finally{try{n&&(s=i.return)&&await s.call(i)}finally{if(o)throw o[0]}}return e}function Up(t,e){let r=Yr.call(this,t,e);return function(){return ee(this,null,function*(){try{for(var n=J(r),s,o,a;s=!(o=yield new q(n.next())).done;s=!1){let l=o.value;yield*ne(l)}}catch(o){a=[o]}finally{try{s&&(o=n.return)&&(yield new q(o.call(n)))}finally{if(a)throw a[0]}}})}.call(this)}function kl(t){if(t=jp(t),Fp(t))return 0;if(t<0)throw new wp("number",">= 0",t);return t}function qp(t,e=void 0){return e!=null&&lt(e,"options"),(e==null?void 0:e.signal)!=null&&at(e.signal,"options.signal"),t=kl(t),function(){return ee(this,null,function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new xe;try{for(var s=J(this),o,a,l;o=!(a=yield new q(s.next())).done;o=!1){let u=a.value;var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new xe;t--<=0&&(yield u)}}catch(a){l=[a]}finally{try{o&&(a=s.return)&&(yield new q(a.call(s)))}finally{if(l)throw l[0]}}})}.call(this)}function Wp(t,e=void 0){return e!=null&&lt(e,"options"),(e==null?void 0:e.signal)!=null&&at(e.signal,"options.signal"),t=kl(t),function(){return ee(this,null,function*(){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new xe;try{for(var s=J(this),o,a,l;o=!(a=yield new q(s.next())).done;o=!1){let u=a.value;var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new xe;if(t-- >0&&(yield u),t<=0)return}}catch(a){l=[a]}finally{try{o&&(a=s.return)&&(yield new q(a.call(s)))}finally{if(l)throw l[0]}}})}.call(this)}Bn.exports.streamReturningOperators={asIndexedPairs:vp(Bp,"readable.asIndexedPairs will be removed in a future version."),drop:qp,filter:Cn,flatMap:Up,map:Yr,take:Wp,compose:Cp};Bn.exports.promiseReturningOperators={every:Dp,forEach:Mp,reduce:$p,toArray:kp,some:$l,find:Op}});var Dn=T((gy,ql)=>{"use strict";var{ArrayPrototypePop:Gp,Promise:Qp}=L(),{isIterable:zp,isNodeStream:Vp,isWebStream:Hp}=ye(),{pipelineImpl:Kp}=zr(),{finished:Yp}=Fe();On();function Jp(...t){return new Qp((e,r)=>{let i,n,s=t[t.length-1];if(s&&typeof s=="object"&&!Vp(s)&&!zp(s)&&!Hp(s)){let o=Gp(t);i=o.signal,n=o.end}Kp(t,(o,a)=>{o?r(o):e(a)},{signal:i,end:n})})}ql.exports={finished:Yp,pipeline:Jp}});var On=T((my,Jl)=>{"use strict";var{Buffer:Xp}=Ne(),{ObjectDefineProperty:Be,ObjectKeys:Ql,ReflectApply:zl}=L(),{promisify:{custom:Vl}}=Y(),{streamReturningOperators:Wl,promiseReturningOperators:Gl}=Ul(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Hl}}=V(),Zp=Fn(),{setDefaultHighWaterMark:eb,getDefaultHighWaterMark:tb}=Zt(),{pipeline:Kl}=zr(),{destroyer:rb}=tt(),Yl=Fe(),Mn=Dn(),ur=ye(),F=Jl.exports=Nr().Stream;F.isDestroyed=ur.isDestroyed;F.isDisturbed=ur.isDisturbed;F.isErrored=ur.isErrored;F.isReadable=ur.isReadable;F.isWritable=ur.isWritable;F.Readable=rr();for(let t of Ql(Wl)){let r=function(...i){if(new.target)throw Hl();return F.Readable.from(zl(e,this,i))},e=Wl[t];Be(r,"name",{__proto__:null,value:e.name}),Be(r,"length",{__proto__:null,value:e.length}),Be(F.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}for(let t of Ql(Gl)){let r=function(...i){if(new.target)throw Hl();return zl(e,this,i)},e=Gl[t];Be(r,"name",{__proto__:null,value:e.name}),Be(r,"length",{__proto__:null,value:e.length}),Be(F.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}F.Writable=qr();F.Duplex=we();F.Transform=mn();F.PassThrough=xn();F.pipeline=Kl;var{addAbortSignal:ib}=Xt();F.addAbortSignal=ib;F.finished=Yl;F.destroy=rb;F.compose=Zp;F.setDefaultHighWaterMark=eb;F.getDefaultHighWaterMark=tb;Be(F,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Mn}});Be(Kl,Vl,{__proto__:null,enumerable:!0,get(){return Mn.pipeline}});Be(Yl,Vl,{__proto__:null,enumerable:!0,get(){return Mn.finished}});F.Stream=F;F._isUint8Array=function(e){return e instanceof Uint8Array};F._uint8ArrayToBuffer=function(e){return Xp.from(e.buffer,e.byteOffset,e.byteLength)}});var Jr=T((wy,O)=>{"use strict";var k=On(),nb=Dn(),sb=k.Readable.destroy;O.exports=k.Readable;O.exports._uint8ArrayToBuffer=k._uint8ArrayToBuffer;O.exports._isUint8Array=k._isUint8Array;O.exports.isDisturbed=k.isDisturbed;O.exports.isErrored=k.isErrored;O.exports.isReadable=k.isReadable;O.exports.Readable=k.Readable;O.exports.Writable=k.Writable;O.exports.Duplex=k.Duplex;O.exports.Transform=k.Transform;O.exports.PassThrough=k.PassThrough;O.exports.addAbortSignal=k.addAbortSignal;O.exports.finished=k.finished;O.exports.destroy=k.destroy;O.exports.destroy=sb;O.exports.pipeline=k.pipeline;O.exports.compose=k.compose;Object.defineProperty(k,"promises",{configurable:!0,enumerable:!0,get(){return nb}});O.exports.Stream=k.Stream;O.exports.default=O.exports});var hb={};Vn(hb,{BaseIRI:()=>Me,BlankNode:()=>pt,DataFactory:()=>W,DefaultGraph:()=>yt,EntityIndex:()=>qt,Lexer:()=>Se,Literal:()=>fe,NamedNode:()=>ze,Parser:()=>ce,Quad:()=>Ae,Reasoner:()=>Gt,Store:()=>ue,StoreFactory:()=>Wt,StreamParser:()=>Qt,StreamWriter:()=>zt,Term:()=>z,Triple:()=>Ae,Util:()=>dr,Variable:()=>bt,Writer:()=>oe,default:()=>cb,getRulesFromDataset:()=>Wn,termFromId:()=>Re,termToId:()=>Te});var Qe="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ct="http://www.w3.org/2001/XMLSchema#",fr="http://www.w3.org/2000/10/swap/",j={xsd:{decimal:`${ct}decimal`,boolean:`${ct}boolean`,dateTime:`${ct}dateTime`,double:`${ct}double`,integer:`${ct}integer`,string:`${ct}string`},rdf:{type:`${Qe}type`,nil:`${Qe}nil`,first:`${Qe}first`,rest:`${Qe}rest`,langString:`${Qe}langString`,dirLangString:`${Qe}dirLangString`,reifies:`${Qe}reifies`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${fr}reify#forSome`,forAll:`${fr}reify#forAll`},log:{implies:`${fr}log#implies`,isImpliedBy:`${fr}log#isImpliedBy`}};var{xsd:cr}=j,ht=32,dt=9,ii=10,_t=13,Xn=35,ai=46,Zn=58,pu=48,bu=57,yu=37,gu=92;function es(t){return t===ht||t>=dt&&t<=_t||t>=160&&(t===160||t===5760||t>=8192&&t<=8202||t===8232||t===8233||t===8239||t===8287||t===12288||t===65279)}var ts=new Uint8Array(128);for(let t of`,;!^#()[]{}"'<>
3
+ \v\f\r`)ts[t.charCodeAt(0)]=1;function mu(t){return t<128?ts[t]===1:es(t)}function wu(t,e,r){let i=t.charCodeAt(e);return i===ai&&(i=t.charCodeAt(++e)),e>=t.length?r:mu(i)}var Kn={"\\":"\\","'":"'",'"':'"',n:`
4
+ `,r:"\r",t:" ",f:"\f",b:"\b"},rs={_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","'":"'","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},xu=/[\x00-\x20<>\\"\{\}\|\^\`]/,is=1,ns=2,hr=4,ni=8,ss=16,Ht=new Uint8Array(128);for(let t=0;t<128;t++){let e=String.fromCharCode(t),r=e>="A"&&e<="Z"||e>="a"&&e<="z",i=r||e==="_"||e==="-"||e>="0"&&e<="9";Ht[t]=(r?is:0)|(i&&e!=="-"||e===":"?ns:0)|(i?hr:0)|(i||e===":"?ni:0)|(e in rs?ss:0)}function si(t,e,r){let i=t.charCodeAt(e);if(i<128)return(Ht[i]&r)!==0?1:0;if(i>=55296&&i<=56191){let n=t.charCodeAt(e+1);return n>=56320&&n<=57343?2:0}return r>=hr&&(i===183||i>=768&&i<=879||i===8255||i===8256)||i>=192&&i<=8191&&i!==215&&i!==247&&(i<768||i>=880&&i!==894)||i>=8204&&i<=8205||i>=8304&&i<=8591||i>=11264&&i<=12271||i>=12289&&i<=55295||i>=63744&&i<=64975||i>=65008&&i<=65533?1:0}function Eu(t){return t<128&&(Ht[t]&ss)!==0}function Yn(t){return t>=pu&&t<=bu||t>=65&&t<=70||t>=97&&t<=102}function oi(t,e){let r=si(t,e,is);for(;r!==0;){e+=r;let i=t.charCodeAt(e)===ai?e+1:e,n=t.charCodeAt(i);r=n<128?(Ht[n]&hr)!==0?1:0:si(t,i,hr),r!==0&&(e=i)}return e}function Su(t,e){let r=e,i=ns;for(;;){let n=t.charCodeAt(e),s=n<128?(Ht[n]&i)!==0?1:0:si(t,e,i);if(s===0&&n===yu&&Yn(t.charCodeAt(e+1))&&Yn(t.charCodeAt(e+2))?s=3:s===0&&n===gu&&Eu(t.charCodeAt(e+1))&&(s=2),s!==0)r=e+=s,i=ni;else if(n===ai&&i===ni)e++;else return r}}function Jn(t,e,r){let i=oi(t,e);if(t.charCodeAt(i)!==Zn)return-1;let n=Su(t,i+1);return wu(t,n,r)?n:-1}function Iu(t){return t<=1114111&&(t<55296||t>57343)}var Ru={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_commentLine:!0,_whitespace:!0},Tu=/$0^/,Au=/\S*/y;function Q(t,e,r){return t.lastIndex=r,t.exec(e)}function ti(t,e,r){return t.lastIndex=r,t.test(e)}function ri(t,e,r){return t.lastIndex=0,t.exec(`${e.slice(r)} `)}function vu(t){return t===ht||t===dt||t===ii||t===_t||t===Xn}var Nu=/^(?:prefix|base|version|graph|forsome|forall|iri|a|true|false|has|is|of|id)$/i,Pu=1024,Se=class{constructor(e){if(this._iri=/<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/y,this._unescapedIri=/<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/y,this._simpleQuotedString=/"([^"\\\r\n]*)"(?=[^"])/y,this._simpleApostropheString=/'([^'\\\r\n]*)'(?=[^'])/y,this._langcode=/@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9])/iy,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-9: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#()\[\]\{\}"'<>])/y,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#()\[\]\{\}"'<>]))/y,this._number=/[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?\d+|(?=\.?\d)\d*(?:(\.)\d+)?)(?=\.?[,;:!\^\s#()\[\]\{\}"'<>])/y,this._boolean=/(?:true|false)(?=[.,;!\^\s#()\[\]\{\}"'<>])/y,this._atKeyword=/@[a-z]+(?=[\s#<:"'.])/iy,this._keyword=/(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<"'])/iy,this._n3Verb=/(?:has|is|of)(?=[\s#()\[\]\{\}"'<>?_+\-0-9])/y,this._n3Id=/id(?=[\s#<])/y,this._shortPredicates=/a(?=[\s#()\[\]\{\}"'<>])/y,this._commentLine=/[ \t]*#([^\n\r]*)(?:\r\n|\n|\r)([ \t]*)/y,this._whitespace=/[ \t]+/y,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let r in this)!(r in Ru)&&this[r]instanceof RegExp&&(this[r]=Tu);this._keyword=/VERSION(?=[\s#<"])/y}else this._n3Mode=e.n3!==!1;if(this._directive=null,e.directives&&e.directives.length!==0){for(let r of e.directives)if(!/^[a-z]+$/i.test(r)||Nu.test(r))throw new Error(`Invalid directive name: "${r}"`);this._directive=new RegExp(`(?:${e.directives.join("|")})(?=[\\s#<])`,"iy"),this._directiveMaxLength=Math.max(...e.directives.map(r=>r.length)),this._directiveStarts=e.directives.map(r=>r[0].toLowerCase()+r[0].toUpperCase()).join("")}this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,r){let i=this._input,n=0,s=this._linePosition+i.length;for(;;){for(;;){let E=i.charCodeAt(n),B=0;if(E===ht||E===dt){let P=i.charCodeAt(n+1);B=P===ht||P===dt?Q(this._whitespace,i,n)[0].length:1,E=i.charCodeAt(n+B)}if(E===Xn){let P=Q(this._commentLine,i,n);if(P){let K=P[0].length;if(!r&&n+K===i.length&&i.charCodeAt(i.length-1)===_t)return this._suspend(i,n,s);this.comments&&o(P[1],this._line,s-(i.length-n)+B),n+=K,s=i.length-n+P[2].length,this._line++}else{if(n+=B,!r)return this._suspend(i,n,s);this.comments&&o(i.slice(n+1),this._line,s-(i.length-n)),n=i.length;break}}else if(E===ii||E===_t){if(!r&&E===_t&&n+B+1===i.length)return this._suspend(i,n,s);B+=E===_t&&i.charCodeAt(n+B+1)===ii?2:1;let P=0,K=i.charCodeAt(n+B);if(K===ht||K===dt){let ut=i.charCodeAt(n+B+1);P=ut===ht||ut===dt?Q(this._whitespace,i,n+B)[0].length:1}n+=B+P,s=i.length-n+P,this._line++}else{n+=B;break}}if(n>=i.length)return r&&this._previousMarker==="^^"?l(this,i,n):(this._linePosition=s,r?(a("eof","","",this._line,s,0),this._input=null):this._input="");let u=this._line,f=i[n],c="",d="",h="",b=null,_=0,y=0,g=0,S=!1,m=!1;switch(f){case"^":if(this._previousMarker==="^^")return l(this,i,n);if(i.length-n<3)break;if(i[n+1]==="^"){if(this._previousMarker="^^",n+=2,i[n]!=="<"){if(vu(i.charCodeAt(n)))continue;S=!0;break}}else{this._n3Mode&&(_=1,c="^");break}case"<":if(b=Q(this._unescapedIri,i,n))c="IRI",d=b[1],y=b[1].length+2;else if(b=Q(this._iri,i,n)){if(d=this._unescape(b[1],Kn),d===null||xu.test(d))return l(this,i,n);c="IRI",y=b[1].length+2}else i.length-n>2&&i[n+1]==="<"&&i[n+2]==="("?(c="<<(",_=3):!this._lineMode&&i.length-n>(r?1:2)&&i[n+1]==="<"?(c="<<",_=2):this._n3Mode&&i.length-n>1&&i[n+1]==="="?(_=2,this._isImpliedBy?(c="abbreviation",d="<"):(c="inverse",d=">")):this._n3Mode&&i.length-n>1&&i[n+1]==="-"&&(c="inversePredicate",_=2);break;case">":i.length-n>1&&i[n+1]===">"&&(c=">>",_=2);break;case"_":((b=Q(this._blank,i,n))||r&&(b=ri(this._blank,i,n)))&&(c="blank",h="_",d=b[1],y=b[1].length+2);break;case'"':if(b=Q(this._simpleQuotedString,i,n))d=b[1];else if({value:d,matchLength:_,finalLineLength:g,tripleQuoted:m}=this._parseLiteral(i,n),d===null)return l(this,i,n);(b!==null||_!==0)&&(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(b=Q(this._simpleApostropheString,i,n))d=b[1];else if({value:d,matchLength:_,finalLineLength:g,tripleQuoted:m}=this._parseLiteral(i,n),d===null)return l(this,i,n);(b!==null||_!==0)&&(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(b=Q(this._variable,i,n))&&(c="var",d=b[0]);break;case"@":if(this._previousMarker==="literal"&&(b=Q(this._langcode,i,n))&&b[1]!=="version"){let E=n+b[0].length;!r&&i[E]==="-"&&i[E+1]!=="-"?b=null:(c="langcode",d=b[1])}else(b=Q(this._atKeyword,i,n))&&(c=b[0]);break;case".":if(i.length-n===1?r:i[n+1]<"0"||i[n+1]>"9"){c=".",_=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":if(i[n+1]==="-"){this._previousMarker==="langcode"&&(i.startsWith("--ltr",n)?(c="dircode",d="ltr",_=5):i.startsWith("--rtl",n)&&(c="dircode",d="rtl",_=5));break}(b=Q(this._number,i,n)||r&&(b=ri(this._number,i,n)))&&(c="literal",d=b[0],h=typeof b[1]=="string"?cr.double:typeof b[2]=="string"?cr.decimal:cr.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":case"V":case"v":(b=Q(this._keyword,i,n))?c=b[0].toUpperCase():S=!0;break;case"f":case"t":ti(this._boolean,i,n)?(c="literal",d=f==="t"?"true":"false",h=cr.boolean,_=d.length):S=!0;break;case"a":ti(this._shortPredicates,i,n)?(c="abbreviation",d="a",_=1):S=!0;break;case"h":case"o":this._n3Mode&&(b=this._matchN3Verb(i,n,r))?c=b[0]:S=!0;break;case"i":this._n3Mode&&ti(this._n3Id,i,n)?(c="id",_=2):this._n3Mode&&(b=this._matchN3Verb(i,n,r))?c=b[0]:S=!0;break;case"=":this._n3Mode&&i.length-n>1&&(c="abbreviation",i[n+1]!==">"?(_=1,d="="):(_=2,d=">"));break;case"!":if(!this._n3Mode)break;case")":if(!r&&(i.length-n===1||i.length-n===2&&i[n+1]===">"))break;if(i.length-n>2&&i[n+1]===">"&&i[n+2]===">"){c=")>>",_=3;break}case",":case";":case"[":case"]":case"(":case"}":case"~":this._lineMode||(_=1,c=f);break;case"{":!this._lineMode&&i.length-n>=2&&(i[n+1]==="|"?(c="{|",_=2):(c=f,_=1));break;case"|":i.length-n>=2&&i[n+1]==="}"&&(c="|}",_=2);break;default:S=!0}if(S){let E;if((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&i.charCodeAt(E=oi(i,n))===Zn&&E+1<i.length&&(i[E+1]==="#"||i[E+1]==="<"||es(i.charCodeAt(E+1))))c="prefix",d=i.slice(n,E),_=E+1-n;else if(this._directive!==null&&this._directiveStarts.includes(f)&&((b=Q(this._directive,i,n))||r&&i.length-n<=this._directiveMaxLength&&(b=ri(this._directive,i,n))))c=b[0].toUpperCase();else if(!this._lineMode&&(E=Jn(i,n,r))>=0){let B=i.indexOf(":",n);c="prefixed",h=i.slice(n,B),d=this._unescape(i.slice(B+1,E),rs),_=E-n}}if(this._previousMarker==="^^")switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return r||!i.startsWith("'''",n)&&!i.startsWith('"""',n)&&/\n|\r/.test(i.slice(n))?l(this,i,n):this._suspend(i,n,s);let w=_||b[0].length,x=s-(i.length-n),A;g?(A={type:c,value:d,prefix:h,line:u,start:x,end:g,endLine:this._line,tripleQuoted:m},e(null,A)):m?(A={type:c,value:d,prefix:h,line:u,start:x,end:x+w,tripleQuoted:m},e(null,A)):A=a(c,d,h,u,x,y||w),this.previousToken=A,this._previousMarker=c==="literal"&&(this._previousMarker==="VERSION"||this._previousMarker==="@version")?"version":c,n=Math.min(n+w,i.length),g&&(s=i.length-n+g)}function o(u,f,c){e(null,{type:"comment",value:u,prefix:"",line:f,start:c,end:c+u.length+1})}function a(u,f,c,d,h,b){let _={type:u,value:f,prefix:c,line:d,start:h,end:h+b};return e(null,_),_}function l(u,f,c){e(u._syntaxError(Q(Au,f,c)[0]))}}_suspend(e,r,i){return this._linePosition=i-(e.length-r),this._input=e.slice(r)}_matchN3Verb(e,r,i){let n=Q(this._n3Verb,e,r);if(!n)return null;let s=e[r+n[0].length];return s!=="-"&&s!=="_"&&(s<"0"||s>"9")&&s!=="\u1680"&&s!=="\uFEFF"?n:Jn(e,r,!0)>=0||!i&&oi(e,r)===e.length?null:n}_unescape(e,r){let i=e.indexOf("\\");if(i<0)return e;let n="",s=0;for(;i>=0&&i+1<e.length;){let o=e[i+1],a=i+2,l;if(o==="u"||o==="U"){if(a+=o==="u"?4:8,a>e.length)return null;let u=0;for(let f=i+2;f<a;f++){let c=e.charCodeAt(f);if(c>=48&&c<=57)c-=48;else if(c>=65&&c<=70)c-=55;else if(c>=97&&c<=102)c-=87;else return null;u=u*16+c}if(!Iu(u))return null;l=String.fromCodePoint(u)}else{if(!(o in r))return null;l=r[o]}n+=e.slice(s,i)+l,s=a,i=e.indexOf("\\",s)}return n+e.slice(s)}_parseLiteral(e,r){if(e.length-r>=3){let i=e[r],n=e[r+1]===i&&e[r+2]===i?3:1,s=i;n===3&&(s=i==='"'?'"""':"'''");let o=r+Math.max(this._literalClosingPos,n);for(;(o=e.indexOf(s,o))>r;){let a=0;for(;e[o-a-1]==="\\";)a++;if(a%2===0){let l=e.substring(r+n,o),u=l.split(/\r\n|\r|\n/),f=u.length-1,c=o-r+n;if(n===1&&f!==0||n===3&&this._lineMode)break;this._line+=f;let d=f===0?0:u[u.length-1].length+n;return{value:this._unescape(l,Kn),matchLength:c,finalLineLength:d,tripleQuoted:n===3}}o++}this._literalClosingPos=e.length-r-n+1}return{value:"",matchLength:0,finalLineLength:0,tripleQuoted:!1}}_tryTokenizeToEnd(e,r){let i;try{this._tokenizeToEnd((n,s)=>{try{return e(n,s)}catch(o){throw i=o}},r)}catch(n){if(n===i||!(n instanceof RangeError))throw n;e(this._syntaxError(null,`Token too long on line ${this._line}.`))}}_syntaxError(e,r=`Unexpected "${e}" on line ${this._line}.`){this._input=null;let i=new Error(r);return i.context={token:void 0,line:this._line,previousToken:this.previousToken},i}_startTokenization(){return this._line=1,this._linePosition=0,this._previousMarker=void 0,this.previousToken=void 0,this._literalClosingPos=0,this._input=void 0,this._tokenization={}}_tokenizeString(e,r){this._startTokenization(),this._input=this._readStartingBom(e),this._tryTokenizeToEnd(r,!0)}_readStartingBom(e){return e.startsWith("\uFEFF")?(this._linePosition=1,e.slice(1)):e}tokenize(e,r){let i=this._startTokenization();if(typeof e=="string")if(this._input=this._readStartingBom(e),typeof r=="function")queueMicrotask(()=>{this._tokenization===i&&this._tryTokenizeToEnd(r,!0)});else{let n=[],s;if(this._tryTokenizeToEnd((o,a)=>o?s=o:n.push(a),!0),s)throw s;return n}else{let n,s=0;typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",o=>{if(this._tokenization===i&&this._input!==null&&o.length!==0){if(typeof o!="string"&&(n=n||new TextDecoder("utf-8",{ignoreBOM:!0}),!(o=n.decode(o,{stream:!0}))))return;typeof this._input=="undefined"?this._input=this._readStartingBom(o):this._input+=o,this._input.length>=s&&(this._tryTokenizeToEnd(r,!1),s=this._input!==null&&this._input.length>Pu?2*this._input.length:0)}}),e.on("end",()=>{if(this._tokenization===i&&this._input!==null){let o=n?n.decode():"";o&&(this._input=typeof this._input=="string"?this._input+o:o),typeof this._input=="string"&&this._tryTokenizeToEnd(r,!0)}}),e.on("error",o=>{this._tokenization===i&&r(o)})}}};var{rdf:os,xsd:Ie}=j,gt,ju=0,fi="<>";var li={namedNode:as,blankNode:ls,variable:fs,literal:us,defaultGraph:Fu,quad:ui,triple:ui,fromTerm:Kt,fromQuad:cs},W=li,z=class t{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof t?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},ze=class extends z{constructor(e){e!==""?super(e):(super(fi),Object.defineProperty(this,"value",{value:""}))}get termType(){return"NamedNode"}},fe=class t extends z{constructor(e){super(e)}get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){let e=this.id,r=e.lastIndexOf('"')+1,i=e.lastIndexOf("--");return r<e.length&&e[r++]==="@"?(i>r?e.substr(0,i):e).substr(r).toLowerCase():""}get direction(){let e=this.id,r=e.lastIndexOf('"'),i=e.lastIndexOf("--");return i>r&&i+2<e.length?e.substr(i+2).toLowerCase():""}get datatype(){return new ze(this.datatypeString)}get datatypeString(){let e=this.id,r=e.lastIndexOf('"')+1,i=r<e.length?e[r]:"";return i==="^"?e.substr(r+2):i!=="@"?Ie.string:e.indexOf("--",r)>0?os.dirLangString:os.langString}equals(e){return e instanceof t?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&(this.direction===e.direction||this.direction===""&&!e.direction)&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,direction:this.direction,datatype:{termType:"NamedNode",value:this.datatypeString}}}},pt=class extends z{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},bt=class extends z{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},yt=class extends z{constructor(){return super(""),gt||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};gt=new yt;function Re(t,e,r){if(e=e||li,!t)return e.defaultGraph();switch(t[0]){case"?":return e.variable(t.substr(1));case"_":return e.blankNode(t.substr(2));case'"':if(e===li)return new fe(t);if(t[t.length-1]==='"')return e.literal(t.substr(1,t.length-2));let i=t.lastIndexOf('"',t.length-1),n;if(t[i+1]==="@"){n=t.substr(i+2);let s=n.lastIndexOf("--");s>0&&s<n.length&&(n={language:n.substr(0,s),direction:n.substr(s+2)})}else n=e.namedNode(t.substr(i+3));return e.literal(t.substr(1,i-1),n);case"[":t=JSON.parse(t);break;case"<":if(t===fi)return e.namedNode("");default:if(!r||!Array.isArray(t))return e.namedNode(t)}return e.quad(Re(t[0],e,!0),Re(t[1],e,!0),Re(t[2],e,!0),t[3]&&Re(t[3],e,!0))}function Te(t,e){if(typeof t=="string")return t;if(t instanceof z&&t.termType!=="Quad")return t.id;if(!t)return gt.id;switch(t.termType){case"NamedNode":{let i=t.value;return i!==""?i:fi}case"BlankNode":return`_:${t.value}`;case"Variable":return`?${t.value}`;case"DefaultGraph":return"";case"Literal":return`"${t.value}"${t.language?`@${t.language}${t.direction?`--${t.direction}`:""}`:t.datatype&&t.datatype.value!==Ie.string?`^^${t.datatype.value}`:""}`;case"Quad":let r=[Te(t.subject,!0),Te(t.predicate,!0),Te(t.object,!0)];return t.graph&&t.graph.termType!=="DefaultGraph"&&r.push(Te(t.graph,!0)),e?r:JSON.stringify(r);default:throw new Error(`Unexpected termType: ${t.termType}`)}}var Ae=class extends z{constructor(e,r,i,n){super(""),this._subject=e,this._predicate=r,this._object=i,this._graph=n||gt}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 as(t){return new ze(t)}function ls(t){return new pt(t||`n3-${ju++}`)}function us(t,e){if(typeof e=="string")return new fe(`"${t}"@${e.toLowerCase()}`);if(e!==void 0&&!("termType"in e))return new fe(`"${t}"@${e.language.toLowerCase()}${e.direction?`--${e.direction.toLowerCase()}`:""}`);let r=e?e.value:"";return r===""&&(typeof t=="boolean"?r=Ie.boolean:typeof t=="number"?Number.isFinite(t)?r=Number.isInteger(t)&&Math.abs(t)<1e21?Ie.integer:Ie.double:(r=Ie.double,Number.isNaN(t)||(t=t>0?"INF":"-INF")):typeof t=="bigint"?r=Ie.integer:t instanceof Date&&!Number.isNaN(t.getTime())&&(r=Ie.dateTime,t=t.toISOString())),r===""||r===Ie.string?new fe(`"${t}"`):new fe(`"${t}"^^${r}`)}function fs(t){return new bt(t)}function Fu(){return gt}function ui(t,e,r,i){return new Ae(t,e,r,i)}function Kt(t){if(t instanceof z)return t;switch(t.termType){case"NamedNode":return as(t.value);case"BlankNode":return ls(t.value);case"Variable":return fs(t.value);case"DefaultGraph":return gt;case"Literal":return us(t.value,t.language?t.direction?{language:t.language,direction:t.direction}:t.language:t.datatype);case"Quad":return cs(t);default:throw new Error(`Unexpected termType: ${t.termType}`)}}function cs(t){if(t instanceof Ae)return t;if(t.termType!=="Quad")throw new Error(`Unexpected termType: ${t.termType}`);return ui(Kt(t.subject),Kt(t.predicate),Kt(t.object),Kt(t.graph))}var hs=0,ds=/(^|\/)\.\.?($|[/#?])/,Lu=/^[^?#]*(?:^|\/)\.\.?(?:$|[/#?])/,ce=class t{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&ps(this,e.factory);let r=typeof e.format=="string"?e.format.match(/(?:^|\W)(\w*)$/)[1].toLowerCase():"",i=/turtle/.test(r),n=/trig/.test(r),s=/triple/.test(r),o=/quad/.test(r),a=this._n3Mode=/n3/.test(r),l=s||o;if(this._emitCurrent=this._emit,a&&(this._createQuad=this._createQuadInDirection,this._emit=this._emitInDirection,this._emitCurrent=this._emitCurrentInDirection),(this._supportsNamedGraphs=!(i||a))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(i||n||s||a),this._isImpliedBy=e.isImpliedBy,this._implicitEmptyPrefix=!!e.implicitEmptyPrefix,this._emptyFormulaAsTrue=!!e.emptyFormulaAsTrue,l&&(this._resolveRelativeIRI=f=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._directives=null,e.directives){this._directives=Object.create(null);for(let f of e.directives)this._directives[`@${f.toLowerCase()}`]=this._directives[f.toUpperCase()]=f}this._lexer=e.lexer||new Se({lineMode:l,n3:a,isImpliedBy:this._isImpliedBy,directives:e.directives}),this._explicitQuantifiers=!!e.explicitQuantifiers,this._formulaScopedBlankNodes=!!e.formulaScopedBlankNodes,this._parseUnsupportedVersions=!!e.parseUnsupportedVersions,this._version=e.version;let u=e.maxTripleTermDepth;this._maxTripleTermDepth=u===1/0||Number.isInteger(u)&&u>=0?u:1024}static _resetBlankNodePrefix(){hs=0}_setBase(e){if(!e)this._base="",this._basePath="",this._basePathHasDotSegments=!1;else{let r=e.indexOf("#");r>=0&&(e=e.substr(0,r)),this._base=e;let i=e.indexOf("?"),n=i<0?e:e.substr(0,i);this._basePath=e.indexOf("/")<0?e:n.substr(0,n.lastIndexOf("/")+1);let s=e;e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(\/\/[^\/?#]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1],e[2]!==void 0&&(s.length===this._baseRoot.length||s[this._baseRoot.length]==="?")&&(this._basePath=`${this._baseRoot}/`),this._basePathHasDotSegments=ds.test(this._basePath)}}_enterTripleTerm(e,r,i,n){return this._tripleTermDepth>=this._maxTripleTermDepth?(this._error(`Triple terms nested deeper than ${this._maxTripleTermDepth} level${this._maxTripleTermDepth===1?"":"s"}`,n),!1):(this._tripleTermDepth++,this._saveContext(e,this._graph,r,i,null),this._graph=null,!0)}_saveContext(e,r,i,n,s){if(!this._n3Mode){this._contextStack.push({type:e,subject:i,predicate:n,object:s,graph:r});return}let o={type:e,subject:i,predicate:n,object:s,graph:r,inverse:this._inversePredicate,expectOf:this._expectOf,blankPrefix:this._prefixes._,prefixChanges:this._prefixChanges,quantifiedChanges:this._quantifiedChanges,emptyFormula:this._emptyFormula};e==="formula"&&(o.base=[this._base,this._basePath,this._baseRoot,this._baseScheme,this._basePathHasDotSegments],this._prefixChanges=[]),this._contextStack.push(o),this._inversePredicate=!1,this._expectOf=!1,(!this._formulaScopedBlankNodes||e==="formula")&&(this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantifiedChanges=[]),e==="formula"&&(this._subject=null,this._emptyFormula=!0)}_restoreContext(e,r){let i=this._contextStack.pop();if(!i||i.type!==e)return this._error(`Unexpected ${r.type}`,r);this._subject=i.subject,this._predicate=i.predicate,this._object=i.object,this._graph=i.graph,this._n3Mode&&(this._inversePredicate=i.inverse,this._expectOf=i.expectOf,e==="formula"&&([this._base,this._basePath,this._baseRoot,this._baseScheme,this._basePathHasDotSegments]=i.base),this._prefixChanges!==i.prefixChanges&&(_s(this._prefixes,this._prefixChanges),this._prefixChanges=i.prefixChanges),this._prefixes._=i.blankPrefix,this._quantifiedChanges!==i.quantifiedChanges&&(_s(this._quantified,this._quantifiedChanges),this._quantifiedChanges=i.quantifiedChanges),this._emptyFormula=i.emptyFormula)}_readBeforeTopContext(e){return this._version&&!this._isValidVersion(this._version)?this._error(`Detected unsupported version as media type parameter: "${this._version}"`,e):this._readInTopContext(e)}_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"VERSION":this._sparqlStyle=!0;case"@version":return this._readVersion;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._directives!==null&&e.type in this._directives&&this._graph===null?(this._sparqlStyle=e.type[0]!=="@",this._directiveCallback(this._directives[e.type]),this._readDeclarationPunctuation):this._readSubject(e)}}_readInFormulaContext(e){switch(e.type){case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;default:return this._readSubject(e)}}_getStatementReader(){let e=this._contextStack[this._contextStack.length-1];return e&&e.type==="formula"?this._readInFormulaContext:this._readInTopContext}_readEntity(e,r){let i;switch(e.type){case"IRI":case"typeIRI":let n=this._resolveIRI(e.value);if(n===null)return this._error("Invalid IRI",e);i=this._factory.namedNode(n);break;case"type":case"prefixed":let s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);i=this._factory.namedNode(s+e.value);break;case"blank":i=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":i=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!r&&this._n3Mode&&i.id in this._quantified&&(i=this._quantified[i.id]),i}_readList(e,r,i,n){let s=this._contextStack;return(s.length&&s[s.length-1]).type==="<<"?this._error("Unexpected list in reified triple",e):(this._saveContext("list",this._graph,r,i,n),this._subject=null,this._readListItem)}_readSubject(e){switch(this._predicate=null,e.type!=="}"&&(this._emptyFormula=!1),e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._readList(e,this.RDF_NIL,null,null);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readInFormulaContext):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":return this._n3Mode?e.prefix.length===0?(this._literalValue=e.value,this._completeSubjectLiteral):(this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),this._getPathReader(this._readPredicateOrNamedGraph)):this._error("Unexpected literal",e);case"<<(":return this._n3Mode?this._enterTripleTerm("<<(",null,null,e)&&this._readSubject:this._error("Disallowed triple term as subject",e);case"<<":return this._enterTripleTerm("<<",null,null,e)&&this._readSubject;default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){let r=e.type,i=!1;switch(r){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case"has":return this._readPredicateAfterVerb;case"is":return this._inversePredicate=!0,this._expectOf=!0,this._readPredicateAfterVerb;case"inversePredicate":return this._inversePredicate=!0,this._readPredicateAfterVerb;case"|}":return this._subject=null,this._readAnnotationBlockPunctuation(e);case".":case"]":case"}":return this._predicate===null&&!this._n3Mode?this._error(`Unexpected ${r}`,e):(this._subject=null,r==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completePredicateLiteral;this._predicate=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),i=!0;break;case"(":return this._n3Mode?this._readList(e,this._subject,this.RDF_NIL,null):this._error(`Expected entity but got ${r}`,e);case"[":return this._n3Mode?(this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead):this._error("Disallowed blank node as predicate",e);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._graph=this._factory.blankNode(),null),this._readSubject):this._readEntity(e);case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return;i=this._n3Mode}return this._validAnnotation=!0,i?this._getPathReader(this._readObject,"predicate"):this._readObject}_readPredicateAfterVerb(e){return e.type==="has"||e.type==="is"||e.type==="of"||e.type==="inversePredicate"?this._error(`Expected expression but got ${e.type}`,e):this._readPredicate(e)}_readObject(e){if(this._expectOf)return e.type!=="of"?this._error(`Expected of but got ${e.type}`,e):(this._expectOf=!1,this._readObject);switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;if(this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),this._n3Mode)return this._getPathReader(this._getContextEndReader());break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._readList(e,this._subject,this._predicate,this.RDF_NIL);case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readInFormulaContext):this._error("Unexpected graph",e);case"<<(":return this._enterTripleTerm("<<(",this._subject,this._predicate,e)&&this._readSubject;case"<<":return this._enterTripleTerm("<<",this._subject,this._predicate,e)&&this._readSubject;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){if(e.type==="]")return this._subject=null,this._readBlankNodeTail(e);{let r=this._contextStack;return(r.length>1&&r[r.length-2]).type==="<<"?this._error("Unexpected compound blank node expression in reified triple",e):e.type==="id"?this._readIriPropertyListId:(this._predicate=null,this._readPredicate(e))}}_readIriPropertyListId(e){let r=this._readEntity(e);if(r===void 0)return;if(r.termType!=="NamedNode")return this._error(`Expected IRI after id but got ${e.type}`,e);let i=this._subject;this._subject=r;let n=this._contextStack[this._contextStack.length-1];return n.subject===i&&(n.subject=r),n.predicate===i&&(n.predicate=r),n.object===i&&(n.object=r),this._predicate=null,this._readIriPropertyListPredicate}_readIriPropertyListPredicate(e){return e.type===";"||e.type==="]"||e.type==="."||e.type==="}"?this._error(`Expected predicate but got ${e.type}`,e):this._readPredicate(e)}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let r=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._getPathReader(this._readObject,"predicate"):r?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 r=null,i=null,n=this._readListItem,s=this._subject,o=this._contextStack,a=o[o.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,i=this._factory.blankNode(),this.RDF_FIRST,this._subject=r=this._factory.blankNode()),n=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,i=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),o.length!==0&&o[o.length-1].type==="list"){if(this._n3Mode)return s!==null&&this._emit(s,this.RDF_REST,this.RDF_NIL,this._graph),this._saveContext("item",this._graph,this._subject,this._predicate,this._object),this._subject=this._object,this._predicate=null,this._getPathReader(this._readListItem);this._emit(this._subject,this._predicate,this._object,this._graph)}if(this._predicate===null){if(n=this._n3Mode?this._getPathReader(this._readPredicate):this._readPredicate,this._subject===this.RDF_NIL)return n}else if(this._object===null){if(n=this._getPathReader(this._readObject,"predicate"),this._predicate===this.RDF_NIL)return n}else if(n=this._getContextEndReader(),this._n3Mode&&(n=this._getPathReader(n)),this._object===this.RDF_NIL)return n;i=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,n=this._readListItemDataTypeOrLang):(r=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),n=this._getContextEndReader());break;case"{":return this._n3Mode?(i=this._factory.blankNode(),r=this._factory.blankNode(),s===null?a.predicate===null?a.subject=i:a.object=i:this._emit(s,this.RDF_REST,i,this._graph),this._emit(i,this.RDF_FIRST,r,this._graph),this._saveContext("formula",this._graph,i,this.RDF_FIRST,this._graph=r),this._subject=null,this._readInFormulaContext):this._error("Unexpected graph",e);case"<<(":case"<<":if(!this._enterTripleTerm(e.type,null,null,e))return;n=this._readSubject;break;default:if((r=this._readEntity(e))===void 0)return}if(i===null&&(this._subject=i=this._factory.blankNode()),(e.type==="<<"||e.type==="<<(")&&(o[o.length-1].subject=this._subject),s===null?a.predicate===null?a.subject=i:a.object===null?a.predicate=i:a.object=i:this._emit(s,this.RDF_REST,i,this._graph),r!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"||e.type==="var"||e.type==="blank"||e.type==="literal"))return this._saveContext("item",this._graph,i,this.RDF_FIRST,r),this._subject=r,this._predicate=null,this._getPathReader(this._readListItem);this._emit(i,this.RDF_FIRST,r,this._graph)}return n}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e,r){let i,n=!1;switch(e.type){case"type":case"typeIRI":let s=this._readEntity(e);if(s===void 0)return;if(s.value===j.rdf.langString||s.value===j.rdf.dirLangString)return this._error("Detected illegal (directional) languaged-tagged string with explicit datatype",e);i=this._factory.literal(this._literalValue,s),e=null;break;case"langcode":if(e.value.split("-").some(o=>o.length>8))return this._error("Detected language tag with subtag longer than 8 characters",e);i=this._factory.literal(this._literalValue,e.value),this._literalLanguage=e.value,e=null,this._literalComponent=r,n=!0;break;default:i=this._factory.literal(this._literalValue)}return{token:e,literal:i,readCb:n}}_readDirCode(e){let r=this._literalComponent,i=this._literalListItem;if(e.type==="dircode"){let n=this._factory.literal(this._literalValue,{language:this._literalLanguage,direction:e.value});r==="subject"?this._subject=n:r==="predicate"?this._predicate=n:this._object=n,this._literalLanguage=void 0,e=null}if(r==="subject"||r==="predicate"){let n=r==="subject"?this._readPredicateOrNamedGraph:this._readObject;return this._getPathEndReader(e,n,r)||n.call(this,e)}return this._completeObjectLiteralPost(e,i)}_completeTermLiteral(e,r){let i=this._completeLiteral(e,r);if(!i)return;let n;if(r==="subject"?(this._subject=i.literal,n=this._readPredicateOrNamedGraph):(this._predicate=i.literal,this._validAnnotation=!0,n=this._readObject),i.readCb)return this._literalListItem=!1,this._readDirCode;let s=this._getPathEndReader(i.token,n,r);return s||n.call(this,i.token)}_completeSubjectLiteral(e){return this._completeTermLiteral(e,"subject")}_completePredicateLiteral(e){return this._completeTermLiteral(e,"predicate")}_completeObjectLiteral(e,r){let i=this._completeLiteral(e,"object");if(i)return this._object=i.literal,i.readCb?(this._literalListItem=r,this._readDirCode):this._completeObjectLiteralPost(i.token,r)}_completeObjectLiteralPost(e,r){return this._n3Mode&&(e===null||e.type==="!"||e.type==="^")?r?(this._saveContext("item",this._graph,this._subject,this.RDF_FIRST,this._object),this._subject=this._object,this._predicate=null,this._getPathEndReader(e,this._readListItem)):this._getPathEndReader(e,this._getContextEndReader()):(r&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),e===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(e)))}_readFormulaTail(e){if(e.type!=="}")return this._readPunctuation(e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let r=this._graph,i=this._emptyFormula;return this._restoreContext("formula",e),i&&this._emptyFormulaAsTrue&&(this._subject===r?this._subject=this.N3_TRUE:this._predicate===r?this._predicate=this.N3_TRUE:this._object=this.N3_TRUE),this._object!==null?this._getPathReader(this._getContextEndReader(),"object"):this._predicate!==null?this._getPathReader(this._readObject,"predicate"):this._getPathReader(this._readPredicate,"subject")}_readPunctuation(e){let r,i=this._graph,n=this._subject,s=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,this._tripleTerm=null,r=this._getStatementReader(),s&&(this._inversePredicate=!1);break;case";":s&&(this._inversePredicate=!1),r=this._readPredicate;break;case",":r=this._readObject;break;case"~":case"{|":return this._readAnnotationStart(e);case"|}":return this._error("Unexpected annotation syntax closing",e);default:if(this._supportsQuads&&this._graph===null&&(i=this._readEntity(e))!==void 0){r=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(n!==null){let o=this._predicate,a=this._object;this._emit(n,o,a,i,s)}return r}_readBlankNodePunctuation(e){let r,i=!1;switch(e.type){case";":i=this._inversePredicate,r=this._readPredicate;break;case",":r=this._readObject;break;case"~":case"{|":return this._readAnnotationStart(e);case"|}":return this._error("Unexpected annotation syntax closing",e);default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emitCurrent(this._subject,this._predicate,this._object,this._graph),i&&(this._inversePredicate=!1),r}_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);let r=this._readEntity(e);return this._prefixChanges!==null&&this._prefixChanges.push(this._prefix,this._prefixes[this._prefix]),this._prefixes[this._prefix]=r.value,this._prefixCallback(this._prefix,r),this._readDeclarationPunctuation}_readBaseIRI(e){let r=e.type==="IRI"&&this._resolveIRI(e.value);return r?(this._setBase(r),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_isValidVersion(e){return this._parseUnsupportedVersions||t.SUPPORTED_VERSIONS.includes(e)}_readVersion(e){return e.type!=="literal"?this._error("Expected literal to follow version declaration",e):e.prefix!==""||e.tripleQuoted?this._error("Version declarations must use single quotes",e):(this._versionCallback(e.value),this._isValidVersion(e.value)?this._readDeclarationPunctuation:this._error(`Detected unsupported version: "${e.value}"`,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._getStatementReader().call(this,e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._getStatementReader()}_readQuantifierList(e){let r;switch(e.type){case"IRI":case"prefixed":if((r=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,r,this.QUANTIFIERS_GRAPH)):(this._quantifiedChanges!==null&&this._quantifiedChanges.push(r.id,this._quantified[r.id]),this._quantified[r.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,r){return this._afterPath=e,this._pathPosition=r||(this._predicate===null?"subject":"object"),this._readPath}_getPathEndReader(e,r,i){if(e!==null&&e.type!=="!"&&e.type!=="^")return null;let n=this._getPathReader(r,i);return e===null?n:n.call(this,e)}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:let r=this._afterPath,i=this._contextStack,n=i.length&&i[i.length-1];if(n&&n.type==="item"){let s=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,s,this._graph)}return this._afterPath=null,this._pathPosition=null,r.call(this,e)}}_readForwardPath(e){let r,i,n=this._factory.blankNode();if((i=this._readEntity(e))!==void 0)return this._pathPosition==="subject"?(r=this._subject,this._subject=n):this._pathPosition==="predicate"?(r=this._predicate,this._predicate=n):(r=this._object,this._object=n),this._emit(r,i,n,this._graph),this._readPath}_readBackwardPath(e){let r=this._factory.blankNode(),i,n;if((i=this._readEntity(e))!==void 0)return this._pathPosition==="subject"?(n=this._subject,this._subject=r):this._pathPosition==="predicate"?(n=this._predicate,this._predicate=r):(n=this._object,this._object=r),this._emit(r,i,n,this._graph),this._readPath}_readTripleTermTail(e){if(e.type!==")>>")return this._error(`Expected )>> but got ${e.type}`,e);let r=this._createQuad(this._subject,this._predicate,this._object,this._graph,this._inversePredicate);this._restoreContext("<<(",e),this._tripleTermDepth--;let i=this._contextStack,n=i.length&&i[i.length-1];return n&&n.type==="list"?(this._emit(this._subject,this.RDF_FIRST,r,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=r,this._readPredicate):(this._object=r,this._getContextEndReader())}_readReifiedTripleTailOrReifier(e){return e.type==="~"?this._readReifier:this._readReifiedTripleTail(e)}_readReifiedTripleTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);this._tripleTerm=null;let r=this._readTripleTerm();this._restoreContext("<<",e),this._tripleTermDepth--;let i=this._contextStack,n=i.length&&i[i.length-1];return n&&n.type==="list"?(this._emit(this._subject,this.RDF_FIRST,r,this._graph),this._getContextEndReader()):this._subject===null?(this._subject=r,this._readPredicateOrReifierTripleEnd):(this._object=r,this._getContextEndReader())}_readPredicateOrReifierTripleEnd(e){return e.type==="."?(this._subject=null,this._readPunctuation(e)):this._readPredicate(e)}_readReifier(e){return e.type===">>"?this._readReifiedTripleTail(e):(this._reifier=this._readEntity(e),this._readReifiedTripleTail)}_readAnnotationStart(e){return this._emitCurrent(this._subject,this._predicate,this._object,this._graph),this._tripleTerm=null,this._readAnnotation(e)}_readAnnotation(e){switch(e.type){case"~":return this._readReifierInAnnotation;case"{|":return this._readAnnotationBlockHead(e)}switch(this._tripleTerm=null,e.type){case";":return this._inversePredicate=!1,this._readPredicate;case",":return this._readObject;default:return this._subject=null,this._getContextEndReader().call(this,e)}}_readReifierInAnnotation(e){switch(e.type){case"IRI":case"typeIRI":case"type":case"prefixed":case"blank":case"var":return this._reifier=this._readEntity(e),this._readAnnotationBlockOrReifier}return this._reifier=this._factory.blankNode(),this._readAnnotationBlockOrReifier(e)}_readAnnotationBlockOrReifier(e){return e.type==="{|"?this._readAnnotationBlockHead(e):(this._readTripleTerm(),this._readAnnotation(e))}_readAnnotationBlockHead(e){let r=this._readTripleTerm();return this._saveContext("annotation",this._graph,this._subject,this._predicate,this._object),this._contextStack[this._contextStack.length-1].tripleTerm=this._tripleTerm,this._subject=r,this._predicate=this._object=this._tripleTerm=null,this._inversePredicate=!1,this._validAnnotation=!1,this._readPredicate}_readAnnotationBlockPunctuation(e){let r=this._contextStack;if(e.type==="|}"){if(!r.length||r[r.length-1].type!=="annotation")return this._error("Unexpected annotation syntax closing",e);if(!this._validAnnotation)return this._error("Annotation block can not be empty",e);this._subject!==null&&this._emitCurrent(this._subject,this._predicate,this._object,this._graph);let{tripleTerm:i}=r[r.length-1];return this._restoreContext("annotation",e),this._tripleTerm=i,this._readAnnotation}return this._readBlankNodePunctuation(e)}_readTripleTerm(){let e=this._contextStack,r=e.length&&e[e.length-1],i=r?r.graph:void 0,n=this._reifier||this._factory.blankNode();return this._reifier=null,this._tripleTerm=this._tripleTerm||this._createQuad(this._subject,this._predicate,this._object,null,this._inversePredicate),this._emit(n,this.RDF_REIFIES,this._tripleTerm,i||this._graph||this.DEFAULTGRAPH),n}_getContextEndReader(){let 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._readTripleTermTail;case"<<":return this._readReifiedTripleTailOrReifier;case"annotation":return this._readAnnotationBlockPunctuation}}_createQuad(e,r,i,n){return this._factory.quad(e,r,i,n||this.DEFAULTGRAPH)}_createQuadInDirection(e,r,i,n,s){return s?this._factory.quad(i,r,e,n||this.DEFAULTGRAPH):this._factory.quad(e,r,i,n||this.DEFAULTGRAPH)}_emitInDirection(e,r,i,n,s){this._callback(null,this._createQuad(e,r,i,n,s))}_emitCurrentInDirection(e,r,i,n){this._callback(null,this._createQuad(e,r,i,n,this._inversePredicate))}_emit(e,r,i,n){this._callback(null,this._factory.quad(e,r,i,n||this.DEFAULTGRAPH))}_error(e,r){let i=` on line ${r.line}.`;e.length+i.length>200&&(e=`${e.slice(0,199-i.length)}\u2026`);let n=new Error(`${e}${i}`);n.context={token:r,line:r.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=mt}_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"?":{let r=this._base.indexOf("?");return(r<0?this._base:this._base.substr(0,r))+e}case"/":return e[1]!=="/"?this._baseRoot+this._removeDotSegments(e):this._baseScheme?this._removeDotSegments(this._baseScheme+e):this._removeDotSegments(`:${e}`).substr(1);default:return/^[^/:]*:/.test(e)?null:this._basePathHasDotSegments||Lu.test(e)?this._removeDotSegments(this._basePath+e):this._basePath+e}}_removeDotSegments(e){if(!ds.test(e))return e;let r=e.length,i="",n=-1,s=-1,o=0,a="/";for(;n<r;){switch(a){case":":if(s<0&&e[++n]==="/"&&e[++n]==="/")for(;(s=n+1)<r&&e[s]!=="/"&&e[s]!=="?"&&e[s]!=="#";)n=s;break;case"?":case"#":n=r;break;case"/":if(e[n+1]===".")switch(a=e[++n+1],a){case"/":i+=e.substring(o,n-1),o=n+1;break;case void 0:case"?":case"#":return i+e.substring(o,n)+e.substr(n+1);case".":if(a=e[++n+1],a===void 0||a==="/"||a==="?"||a==="#"){if(i+=e.substring(o,n-2),(o=i.lastIndexOf("/"))>=s&&(i=i.substr(0,o)),a!=="/")return`${i}/${e.substr(n+1)}`;o=n+1}}}a=e[++n]}return i+e.substring(o)}parse(e,r,i,n){let s,o,a,l,u,f,c;r&&(r.onQuad||r.onPrefix||r.onComment||r.onVersion||r.onDirective||r.onToken||r.onTokenEnd)?(s=r.onQuad,o=r.onPrefix,a=r.onComment,l=r.onVersion,u=r.onDirective,f=r.onToken,c=r.onTokenEnd):(s=r,o=i,l=n),this._readCallback=this._readBeforeTopContext,this._contextStack=[],this._graph=this._subject=this._predicate=this._object=null,this._tripleTerm=this._reifier=null,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${hs++}_`,this._n3Mode&&this._implicitEmptyPrefix&&this._base&&(this._prefixes[""]=this._resolveIRI("#")),this._prefixCallback=o||mt,this._versionCallback=l||mt,this._directiveCallback=u||mt,this._inversePredicate=!1,this._expectOf=!1,this._quantified=Object.create(null),this._prefixChanges=null,this._quantifiedChanges=null,this._emptyFormula=!1,this._tripleTermDepth=0;let d=_=>this._readCallback=this._readCallback(_),h=d;if((a||this._lexer.comments)&&(this._lexer.comments=!0,h=_=>_.type!=="comment"?d(_):(a&&a(_.value),this._readCallback)),f||c){let _=h;h=y=>{try{try{return f&&f(y),_(y)}finally{c&&c(y)}}catch(g){throw this._readCallback=null,g}}}if(!s){let _=[],y;this._callback=(S,m)=>{S?y=S:m&&_.push(m)};let g=this._lexer;if(!o&&!l&&!u&&!a&&!f&&!c&&g.tokenize===Se.prototype.tokenize&&typeof g._tokenizeString=="function"){let S=[this._base,this._basePath,this._baseRoot,this._baseScheme];g._tokenizeString(e,(m,w)=>{m?([this._base,this._basePath,this._baseRoot,this._baseScheme]=S,this._callback(m),this._callback=mt):this._readCallback&&h(w)})}else g.tokenize(e).every(h);if(y)throw y;return _}let b=(_,y)=>{_!==null?(this._callback(_),this._callback=mt):this._readCallback&&h(y)};this._callback=s,this._lexer.tokenize(e,b)}};function _s(t,e){for(let r=e.length-2;r>=0;r-=2)e[r+1]===void 0?delete t[e[r]]:t[e[r]]=e[r+1]}function mt(){}function ps(t,e){t._factory=e,t.DEFAULTGRAPH=e.defaultGraph(),t.RDF_FIRST=e.namedNode(j.rdf.first),t.RDF_REST=e.namedNode(j.rdf.rest),t.RDF_NIL=e.namedNode(j.rdf.nil),t.RDF_REIFIES=e.namedNode(j.rdf.reifies),t.N3_FORALL=e.namedNode(j.r.forAll),t.N3_FORSOME=e.namedNode(j.r.forSome),t.N3_TRUE=e.literal("true",e.namedNode(j.xsd.boolean)),t.ABBREVIATIONS={a:e.namedNode(j.rdf.type),"=":e.namedNode(j.owl.sameAs),">":e.namedNode(j.log.implies),"<":e.namedNode(j.log.isImpliedBy)},t.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}ce.SUPPORTED_VERSIONS=["1.2","1.2-basic","1.1"];ps(ce.prototype,W);var dr={};Vn(dr,{inDefaultGraph:()=>$u,isBlankNode:()=>Bu,isDefaultGraph:()=>se,isLiteral:()=>Du,isNamedNode:()=>Cu,isQuad:()=>Mu,isVariable:()=>Ou,prefix:()=>ku,prefixes:()=>bs});function Cu(t){return!!t&&t.termType==="NamedNode"}function Bu(t){return!!t&&t.termType==="BlankNode"}function Du(t){return!!t&&t.termType==="Literal"}function Ou(t){return!!t&&t.termType==="Variable"}function Mu(t){return!!t&&t.termType==="Quad"}function se(t){return!!t&&t.termType==="DefaultGraph"}function $u(t){return se(t.graph)}function ku(t,e){return bs({"":t.value||t},e)("")}function bs(t,e){let r=Object.create(null);for(let n in t)i(n,t[n]);e=e||W;function i(n,s){if(typeof s=="string"){let o=Object.create(null);r[n]=a=>o[a]||(o[a]=e.namedNode(s+a))}else if(!(n in r))throw new Error(`Unknown prefix: ${n}`);return r[n]}return i}function Ve(t){return t.replace(/[.*+?^${}()|[\]\\/-]/g,"\\$&")}var Uu=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,qu=/^(?:(?!\.\.?(?:[/?#]|$))[^/?#]+(?:\/[^/?#]{3,})*\/?)?(?:[?#]|$)/,ys="./",Wu="../",ci="?",gs="#",Me=class t{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Uu.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!t.supports(this.base))return this._baseMatcher=/.^/;let e=/^[^:]*:\/*/.exec(this.base)[0],r=["^",Ve(e)],i=[],n=[],s=/[^/?#]*([/?#])/y,o,a=0,l=0,u=s.lastIndex=e.length;for(;!a&&!l&&(o=s.exec(this.base));)o[1]===gs?l=s.lastIndex-1:(r.push(Ve(o[0]),"(?:"),i.push(")?"),o[1]!==ci?n.push(u=s.lastIndex):(a=u=s.lastIndex,l=this.base.indexOf(gs,a),this._pathReplacements[a]=ci));for(let f=0;f<n.length;f++)this._pathReplacements[n[f]]=Wu.repeat(n.length-f-1);return this._pathReplacements[n[n.length-1]]=ys,this._baseLength=l>0?l:this.base.length,r.push(Ve(this.base.substring(u,this._baseLength)),a?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...r,...i].join(""))}toRelative(e){let r=this._getBaseMatcher().exec(e);if(!r)return e;let i=r[0].length;if(i===this._baseLength&&i===e.length)return"";let n=this._pathReplacements[i];if(n){let s=e.substring(i);return n!==ci&&!qu.test(s)?e:n===ys&&/^[^?#]/.test(s)&&(s.indexOf(":")<0||!/^[^/?#]*:/.test(s))?s:n+s}return e.substring(i-1)}};var wt=W.defaultGraph(),{rdf:Gu,xsd:xt}=j,{hasOwnProperty:Qu}=Object.prototype,zu=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Vu=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Hu=/[^ !#-\[\]-~\u0080-\uFFFD]/,Ku=/[^ !#-\[\]-~\u0080-\uFFFD]/g,ws={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"},Yu=/["\\\u0000-\u001f\u007f]|[\ud800-\udbff](?![\udc00-\udfff])|(?:^|[^\ud800-\udbff])[\udc00-\udfff]/,xs="A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD_:0-9",ms=`${xs}\\-\\u00B7\\u0300-\\u036F\\u203F\\u2040`,hi="%[0-9A-Fa-f]{2}",Ju=new RegExp(`^(?:(?:[${xs}]|${hi})(?:(?:[${ms}.]|${hi})*(?:[${ms}]|${hi}))?)?$`),He=class extends z{equals(e){return e===this}},oe=class{constructor(e,r){if(this._prefixRegex=/$0^/,this._hasPrefixes=!1,e&&typeof e.write!="function"&&(r=e,e=null),r=r||{},this._lists=r.lists,e)this._outputStream=e,this._endStream=r.end===void 0?!0:!!r.end;else{let i="";this._outputStream={write(n,s,o){i+=n,o&&o()},end:n=>{n&&n(null,i)}},this._endStream=!0}if(r.version&&Yu.test(r.version))throw new Error(`Invalid version label: ${JSON.stringify(r.version)}`);this._subject=null,/triple|quad/i.test(r.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine,this._escape=Hu,this._escapeAll=Ku,this._characterReplacer=Zu,r.version&&this._write(`VERSION "${r.version}"
5
+ `)):(this._lineMode=!1,this._escape=zu,this._escapeAll=Vu,this._characterReplacer=Xu,this._graph=wt,r.version&&this._write(`@version "${r.version}".
6
6
  `),this._prefixIRIs=Object.create(null),this._prefixPatterns=Object.create(null),r.baseIRI&&(this._baseIri=new Me(r.baseIRI),r.writeBase&&this._write(`@base <${r.baseIRI}>.
7
7
  `)),r.prefixes&&this.addPrefixes(r.prefixes))}get _inDefaultGraph(){return wt.equals(this._graph)}_write(e,r){this._outputStream.write(e,"utf8",r)}_endStatement(){this._subject!==null&&(this._write(this._inDefaultGraph?`.
8
8
  `:`
@@ -15,12 +15,12 @@ var N3=(()=>{var fu=Object.create;var Ht=Object.defineProperty,cu=Object.defineP
15
15
  ${this._encodePredicate(this._predicate=r)} ${this._encodeObject(i)}`,s):this._write(`${(this._subject===null?"":`.
16
16
  `)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=r)} ${this._encodeObject(i)}`,s)}catch(o){s&&s(o)}}_writeQuadLine(e,r,i,n,s){delete this._prefixMatch,this._write(this.quadToString(e,r,i,n),s)}quadToString(e,r,i,n){return`${this._encodeSubject(e)} ${r.termType==="Literal"?this._encodeLiteral(r):this._encodeIriOrBlank(r)} ${this._encodeObject(i)}${n&&!se(n)?` ${this._encodeIriOrBlank(n)} .
17
17
  `:` .
18
- `}`}quadsToString(e){let r="";for(let i of e)r+=this.quadToString(i.subject,i.predicate,i.object,i.graph);return r}_encodeSubject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&Ku.call(this._lists,e.value)&&(e=this.list(this._lists[e.value])),e instanceof Q?e.id:e.termType==="Variable"?`?${e.value}`:`_:${e.value}`;let r=e.value;this._baseIri&&(r=this._baseIri.toRelative(r)),this._escape.test(r)&&(r=r.replace(this._escapeAll,this._characterReplacer));let i=this._hasPrefixes?(this._prefixRegex||this._createPrefixRegex()).exec(r):null;return i?i[1]?this._prefixIRIs[i[1]]+i[2]:tf.test(r.slice(i[0].length))?r:`<${r}>`:`<${r}>`}_encodeLiteral(e){let r=e.value;this._escape.test(r)&&(r=r.replace(this._escapeAll,this._characterReplacer));let i=e.language;if(i){let n=e.direction,s=n?`--${n}`:"";return`"${r}"@${i}${s}`}if(this._lineMode){if(e.datatype.value===xt.string)return`"${r}"`}else switch(e.datatype.value){case xt.string:return`"${r}"`;case xt.boolean:if(r==="true"||r==="false")return r;break;case xt.integer:if(/^[+-]?\d+$/.test(r))return r;break;case xt.decimal:if(/^[+-]?\d*\.\d+$/.test(r))return r;break;case xt.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(r))return r;break}return`"${r}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){switch(e.termType){case"NamedNode":return e.value===Hu.type?"a":this._encodeIriOrBlank(e);case"Literal":return this._encodeLiteral(e);default:return 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:r,object:i,graph:n}){let s=this._lineMode?" ":"";return`<<(${s}${this._encodeSubject(e)} ${this._encodePredicate(r)} ${this._encodeObject(i)}${se(n)?"":` ${this._encodeIriOrBlank(n)}`}${s})>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,r,i,n,s){i===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,r):typeof n=="function"?this._writeQuad(e,r,i,wt,n):this._writeQuad(e,r,i,n||wt,s)}addQuads(e){for(let r=0;r<e.length;r++)this.addQuad(e[r])}addPrefix(e,r,i){let n={};n[e]=r,this.addPrefixes(n,i)}addPrefixes(e,r){if(!this._prefixIRIs)return r&&r();let i=!1;for(let n in e){let s=e[n];typeof s!="string"&&(s=s.value),i=!0,this._endStatement(),this._prefixIRIs[s]=n+=":",this._prefixPatterns[s]=[Ve(s),Ve(n)],this._write(`@prefix ${n} <${s}>.
18
+ `}`}quadsToString(e){let r="";for(let i of e)r+=this.quadToString(i.subject,i.predicate,i.object,i.graph);return r}_encodeSubject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&Qu.call(this._lists,e.value)&&(e=this.list(this._lists[e.value])),e instanceof z?e.id:e.termType==="Variable"?`?${e.value}`:`_:${e.value}`;let r=e.value;this._baseIri&&(r=this._baseIri.toRelative(r)),this._escape.test(r)&&(r=r.replace(this._escapeAll,this._characterReplacer));let i=this._hasPrefixes?(this._prefixRegex||this._createPrefixRegex()).exec(r):null;return i?i[1]?this._prefixIRIs[i[1]]+i[2]:Ju.test(r.slice(i[0].length))?r:`<${r}>`:`<${r}>`}_encodeLiteral(e){let r=e.value;this._escape.test(r)&&(r=r.replace(this._escapeAll,this._characterReplacer));let i=e.language;if(i){let n=e.direction,s=n?`--${n}`:"";return`"${r}"@${i}${s}`}if(this._lineMode){if(e.datatype.value===xt.string)return`"${r}"`}else switch(e.datatype.value){case xt.string:return`"${r}"`;case xt.boolean:if(r==="true"||r==="false")return r;break;case xt.integer:if(/^[+-]?\d+$/.test(r))return r;break;case xt.decimal:if(/^[+-]?\d*\.\d+$/.test(r))return r;break;case xt.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(r))return r;break}return`"${r}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){switch(e.termType){case"NamedNode":return e.value===Gu.type?"a":this._encodeIriOrBlank(e);case"Literal":return this._encodeLiteral(e);default:return 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:r,object:i,graph:n}){let s=this._lineMode?" ":"";return`<<(${s}${this._encodeSubject(e)} ${this._encodePredicate(r)} ${this._encodeObject(i)}${se(n)?"":` ${this._encodeIriOrBlank(n)}`}${s})>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,r,i,n,s){i===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,r):typeof n=="function"?this._writeQuad(e,r,i,wt,n):this._writeQuad(e,r,i,n||wt,s)}addQuads(e){for(let r=0;r<e.length;r++)this.addQuad(e[r])}addPrefix(e,r,i){let n={};n[e]=r,this.addPrefixes(n,i)}addPrefixes(e,r){if(!this._prefixIRIs)return r&&r();let i=!1;for(let n in e){let s=e[n];typeof s!="string"&&(s=s.value),i=!0,this._endStatement(),this._prefixIRIs[s]=n+=":",this._prefixPatterns[s]=[Ve(s),Ve(n)],this._write(`@prefix ${n} <${s}>.
19
19
  `)}i&&(this._hasPrefixes=!0,this._prefixRegex=null),this._write(i?`
20
20
  `:"",r)}_createPrefixRegex(){let e="",r="";for(let i in this._prefixPatterns){let[n,s]=this._prefixPatterns[i];e+=e?`|${n}`:n,r+=r?`|${s}`:s}return this._prefixRegex=new RegExp(`^(${e})([_a-zA-Z0-9](?:\\.?[\\-_a-zA-Z0-9])*)$|^(?:${r})`)}blank(e,r){let i=e,n,s;switch(e===void 0?i=[]:e.termType?i=[{predicate:e,object:r}]:"length"in e||(i=[e]),s=i.length){case 0:return new He("[]");case 1:if(n=i[0],!(n.object instanceof He))return new He(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let o="[";for(let a=0;a<s;a++)n=i[a],n.predicate.equals(e)?o+=`, ${this._encodeObject(n.object)}`:(o+=`${(a?`;
21
21
  `:`
22
22
  `)+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new He(`${o}
23
- ]`)}}list(e){let r=e&&e.length||0,i=new Array(r);for(let n=0;n<r;n++)i[n]=this._encodeObject(e[n]);return new He(`(${i.join(" ")})`)}end(e){this._endStatement(),this._write=this._blockedWrite;let r=e&&((i,n)=>{r=null,e(i,n)});if(this._endStream)try{return this._outputStream.end(r)}catch(i){}r&&r()}};function rf(t){let e=Es[t];return e===void 0&&(t.length===1?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((t.charCodeAt(0)-55296)*1024+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}function nf(t){let e=Es[t];return e===void 0&&(e=t.charCodeAt(0).toString(16).toUpperCase(),e="\\u0000".substr(0,6-e.length)+e),e}var ei=ti(Xr());var Ut=Symbol("iter"),N=Symbol("size"),kn;function fb({store:t,observer:e}){let r=t.deref();r&&r._removeObserver(e)}function Un(t,e,r,i){let n=t&&t[e],s=n&&n[r];return!!s&&i in s}var qn=0;function qt(t,e,r=4){let i=t[N]||0;for(let n in e)n in t?r!==0&&qt(t[n],e[n],r-1):(i++,r===0&&qn++,t[n]=r===0?null:qt(Object.create(null),e[n],r-1));return r<=2&&(t[N]=i),t}function iu(t,e,r=4){let i=!1,n=0;r<=2&&e[N]<t[N]&&([t,e]=[e,t]);for(let s in t)if(s in e){let o=r===0?null:iu(t[s],e[s],r-1);if(o!==!1)i=i||Object.create(null),i[s]=o,n++;else if(r===3)return!1}return r<=2&&i&&(i[N]=n),i}function nu(t,e,r=4){let i=!1,n=0;for(let s in t)if(!(s in e))i=i||Object.create(null),i[s]=r===0?null:qt({},t[s],r-1),n++;else if(r!==0){let o=nu(t[s],e[s],r-1);if(o!==!1)i=i||Object.create(null),i[s]=o,n++;else if(r===3)return!1}return r<=2&&i&&(i[N]=n),i}var cb=/^[?_"[.<]/;function Z(t){if(typeof t=="string")return t.charCodeAt(0)!==60||t==="<>"?t:`<${t}>`;let e=Te(t);return e.charCodeAt(0)>=97||!t?e:t.termType==="Quad"?JSON.stringify(su(t)):t.termType!=="NamedNode"||!cb.test(t.value)?e:`<${t.value}>`}function su(t){let e=[Zr(t.subject),Zr(t.predicate),Zr(t.object)];return t.graph&&!se(t.graph)&&e.push(Zr(t.graph)),e}function Zr(t){return t.termType==="Quad"?su(t):Z(t)}var Wt=class{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||W}_termFromId(e){if(e[0]==="<")return this._factory.namedNode(e.substring(1,e.length-1));if(e[0]==="."){let r=this._entities,i=e.split(".");return this._factory.quad(this._termFromId(r[i[1]]),this._termFromId(r[i[2]]),this._termFromId(r[i[3]]),i[4]&&this._termFromId(r[i[4]]))}return Re(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){let r=this._termToNumericId(e.subject),i=this._termToNumericId(e.predicate),n=this._termToNumericId(e.object),s;return r&&i&&n&&(se(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${r}.${i}.${n}.${s}`:`.${r}.${i}.${n}`]}return typeof e=="string"?this._stringToNumericId(e):this._ids[Z(e)]}_stringToNumericId(e){let r=this._ids[e];return(r?this._entities[r].charCodeAt(0)!==60:e.charCodeAt(0)!==60)||e==="<>"?r:this._ids[`<${e}>`]}_termToNewNumericId(e){if(typeof e=="string")return this._stringToNumericId(e)||this._addEntity(Z(e));let r=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${se(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:Z(e);return this._ids[r]||this._addEntity(r)}_addEntity(e){return this._ids[this._entities[++this._id]=e]=this._id}createBlankNode(e){let r,i;if(e)for(r=e=`_:${e}`,i=1;this._ids[r];)r=e+i++;else do r=`_:b${this._blankNodeIndex++}`;while(this._ids[r]);return this._ids[r]=++this._id,this._entities[this._id]=r,this._factory.blankNode(r.substr(2))}};function eu(t){return t instanceof ue?t._size:null}var ue=class t{constructor(e,r){this._size=0,this._graphs=Object.create(null),this._observers=null,!r&&e&&!e[0]&&typeof e.match!="function"&&(r=e,e=null),r=r||{},this._factory=r.factory||W,this._matchSemantics=Wn(r.matchSemantics),this._entityIndex=r.entityIndex||new Wt({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(){return this._size===null&&(this._size=this.countQuads()),this._size}_addToIndex(e,r,i,n){let s=e[r];s||(e[r]=s={[N]:0},e[N]++);let o=s[i];o||(s[i]=o={[N]:0},s[N]++);let a=n in o;return a||(o[n]=null,o[N]++),!a}_removeFromIndex(e,r,i,n){let s=e[r],o=s[i];delete o[n],--o[N]===0&&(delete s[i],--s[N]===0&&(delete e[r],e[N]--))}*_findInIndex(e,r,i,n,s,o,a,l){let u=this._entities,f=this._termFromId(u[l]),c={subject:null,predicate:null,object:null};if(n){let h=e[r],b=h&&h[i];if(!b||!(n in b))return;c[s]=this._termFromId(u[r]),c[o]=this._termFromId(u[i]),c[a]=this._termFromId(u[n]),yield this._factory.quad(c.subject,c.predicate,c.object,f);return}if(r&&!(r in e))return;let _=r?null:Object.keys(e);for(let h=0,b=r||_[0];b;b=_&&_[++h]){let d=e[b];if(!d)continue;if(c[s]=this._termFromId(u[b]),i&&!(i in d))return;let y=i?null:Object.keys(d);for(let g=0,S=i||y[0];S;S=y&&y[++g]){let m=d[S];if(!m)continue;c[o]=this._termFromId(u[S]);let w=Object.keys(m);for(let x=0;x<w.length;x++)c[a]=this._termFromId(u[w[x]]),yield this._factory.quad(c.subject,c.predicate,c.object,f)}}}_loop(e,r){for(let i in e)r(i)}_loopByKey0(e,r,i){let n,s;if(n=e[r])for(s in n)i(s)}_loopByKey1(e,r,i){let n,s;for(n in e)s=e[n],s[r]&&i(n)}_loopBy2Keys(e,r,i,n){let s,o,a;if((s=e[r])&&(o=s[i]))for(a in o)n(a)}_loopByKey0Deep(e,r,i){let n,s,o,a;if(n=e[r])for(o in n){s=n[o];for(a in s)i(a)}}_countInIndex(e,r,i,n){let s=0,o,a;if(r){if(!(o=e[r]))return 0;if(i)return(a=o[i])?n?n in a?1:0:a[N]:0;let u=Object.keys(o);for(let f=0;f<u.length;f++)s+=o[u[f]][N];return s}let l=Object.keys(e);for(let u=0;u<l.length;u++){o=e[l[u]];let f=Object.keys(o);for(let c=0;c<f.length;c++)s+=o[f[c]][N]}return s}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_addObserver(e){let r=new WeakRef(e);return(kn||(kn=new FinalizationRegistry(fb))).register(e,{store:new WeakRef(this),observer:r},r),(this._observers||(this._observers=new Set)).add(r),r}_removeObserver(e){kn.unregister(e),this._observers&&(this._observers.delete(e),this._observers.size===0&&(this._observers=null))}_notifyObservers(e,r,i,n,s){for(let o of this._observers){let a=o.deref();a?a._onParentMutation(e,r,i,n,s):this._removeObserver(o)}}_uniqueEntities(e){let r=Object.create(null);return i=>{i in r||(r[i]=!0,e(this._termFromId(this._entities[i],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,r,i,n){return r||(n=e.graph,i=e.object,r=e.predicate,e=e.subject),n=n?this._termToNewNumericId(n):1,e=this._termToNewNumericId(e),r=this._termToNewNumericId(r),i=this._termToNewNumericId(i),this._addQuad(e,r,i,n)}_addQuad(e,r,i,n){let s=this._graphs[n];if(s||(s=this._graphs[n]={subjects:{[N]:0},predicates:{[N]:0},objects:{[N]:0}},Object.freeze(s)),this._observers!==null){if(Un(s.subjects,e,r,i))return!1;this._notifyObservers(e,r,i,n,!0)}return this._addToIndex(s.subjects,e,r,i)?(this._addToIndex(s.predicates,r,i,e),this._addToIndex(s.objects,i,e,r),this._size!==null&&this._size++,!0):!1}addQuads(e){for(let r=0;r<e.length;r++)this.addQuad(e[r])}delete(e){return this.removeQuad(e),this}has(e,r,i,n){if(e&&e.subject&&({subject:e,predicate:r,object:i,graph:n}=e),e&&r&&i&&n!==void 0&&n!==null){let s=this._termToNumericId(e),o=this._termToNumericId(r),a=this._termToNumericId(i),l=n===""||se(n)?1:this._termToNumericId(n),u=l&&this._graphs[l];return!!s&&!!o&&!!a&&!!u&&Un(u.subjects,s,o,a)}return!this.readQuads(e,r,i,n).next().done}import(e){return e.on("data",r=>{this.addQuad(r)}),e}removeQuad(e,r,i,n){return r||({subject:e,predicate:r,object:i,graph:n}=e),n=n?this._termToNumericId(n):1,!(e=e&&this._termToNumericId(e))||!(r=r&&this._termToNumericId(r))||!(i=i&&this._termToNumericId(i))?!1:this._removeQuad(e,r,i,n)}_removeQuad(e,r,i,n){let s=this._graphs,o=s[n];return!o||!Un(o.subjects,e,r,i)?!1:(this._observers!==null&&this._notifyObservers(e,r,i,n,!1),this._removeFromIndex(o.subjects,e,r,i),this._removeFromIndex(o.predicates,r,i,e),this._removeFromIndex(o.objects,i,e,r),this._size!==null&&this._size--,o.subjects[N]===0&&delete s[n],!0)}removeQuads(e){for(let r=0;r<e.length;r++)this.removeQuad(e[r])}remove(e){return e.on("data",r=>{this.removeQuad(r)}),e}removeMatches(e,r,i,n){let s=new ei.Readable({objectMode:!0}),o=this.readQuads(e,r,i,n);return s._read=a=>{for(;--a>=0;){let{done:l,value:u}=o.next();if(l){s.push(null);return}s.push(u)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,r,i,n){return[...this.readQuads(e,r,i,n)]}*readQuads(e,r,i,n){let s=this._getGraphs(n),o,a,l,u;if(!(e&&!(a=this._termToNumericId(e))||r&&!(l=this._termToNumericId(r))||i&&!(u=this._termToNumericId(i))))for(let f in s)(o=s[f])&&(a?u?yield*ne(this._findInIndex(o.objects,u,a,l,"object","subject","predicate",f)):yield*ne(this._findInIndex(o.subjects,a,l,null,"subject","predicate","object",f)):l?yield*ne(this._findInIndex(o.predicates,l,u,null,"predicate","object","subject",f)):u?yield*ne(this._findInIndex(o.objects,u,null,null,"object","subject","predicate",f)):yield*ne(this._findInIndex(o.subjects,null,null,null,"subject","predicate","object",f)))}match(e,r,i,n,s=null){return new Ge(this,e,r,i,n,{entityIndex:this._entityIndex,matchSemantics:s&&s.matchSemantics!==void 0?s.matchSemantics:this._matchSemantics})}countQuads(e,r,i,n){let s=this._getGraphs(n),o=0,a,l,u,f;if(e&&!(l=this._termToNumericId(e))||r&&!(u=this._termToNumericId(r))||i&&!(f=this._termToNumericId(i)))return 0;for(let c in s)(a=s[c])&&(e?i?o+=this._countInIndex(a.objects,f,l,u):o+=this._countInIndex(a.subjects,l,u,f):r?o+=this._countInIndex(a.predicates,u,f,l):i?o+=this._countInIndex(a.objects,f,l,u):o+=this._countInIndex(a.subjects));return o}forEach(e,r,i,n,s){this.some(o=>(e(o,this),!1),r,i,n,s)}every(e,r,i,n,s){return!this.some(o=>!e(o,this),r,i,n,s)}some(e,r,i,n,s){for(let o of this.readQuads(r,i,n,s))if(e(o,this))return!0;return!1}getSubjects(e,r,i){let n=[];return this.forSubjects(s=>{n.push(s)},e,r,i),n}forSubjects(e,r,i,n){let s=this._getGraphs(n),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.predicates,a,l,e):this._loopByKey1(o.subjects,a,e):l?this._loopByKey0(o.objects,l,e):this._loop(o.subjects,e))}getPredicates(e,r,i){let n=[];return this.forPredicates(s=>{n.push(s)},e,r,i),n}forPredicates(e,r,i,n){let s=this._getGraphs(n),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.objects,l,a,e):this._loopByKey0(o.subjects,a,e):l?this._loopByKey1(o.predicates,l,e):this._loop(o.predicates,e))}getObjects(e,r,i){let n=[];return this.forObjects(s=>{n.push(s)},e,r,i),n}forObjects(e,r,i,n){let s=this._getGraphs(n),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.subjects,a,l,e):this._loopByKey0Deep(o.subjects,a,e):l?this._loopByKey0(o.predicates,l,e):this._loop(o.objects,e))}getGraphs(e,r,i){let n=[];return this.forGraphs(s=>{n.push(s)},e,r,i),n}forGraphs(e,r,i,n){for(let s in this._graphs)this.some(o=>(e(o.graph),!0),r,i,n,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:r=!1,allowExtraArcs:i=!1}={}){let n=Object.create(null),s=r?(()=>!0):((l,u)=>{throw new Error(`${l.value} ${u}`)}),o=this.getQuads(null,j.rdf.rest,j.rdf.nil,null),a=[];return o.forEach(l=>{let u=[],f=!1,c=!1,_,h,b=l.graph,d=[],y=l.subject;for(;y&&!f;){let g=this.getQuads(null,null,y,null),S=this.getQuads(y,null,null,null),m,w=null,x=null,A=null;for(let E=0;E<S.length&&!f;E++)m=S[E],m.graph.equals(b)?_?f=s(y,"has non-list arcs out"):m.predicate.value===j.rdf.first?(w?f=s(y,"has multiple rdf:first arcs"):w=m,e&&w===m&&d.push(m)):m.predicate.value===j.rdf.rest?(x?f=s(y,"has multiple rdf:rest arcs"):x=m,e&&x===m&&d.push(m)):g.length?i?c=!0:f=s(y,`has non-list arc ${m.predicate.value}`):(_=m,h="subject"):f=s(y,"not confined to single graph");for(let E=0;E<g.length&&!f;++E)m=g[E],_?f=s(y,"can't have coreferences"):m.predicate.value===j.rdf.rest?A?f=s(y,"has incoming rdf:rest arcs"):A=m:(_=m,h="object");w?u.push(w.object):f=s(y,"has no list head"),y=A&&A.subject}if(f)e=!1;else if(u.reverse(),_&&(n[_[h].value]=u),e&&!c)for(let g=0;g<d.length;g++)a.push(d[g])}),e&&this.removeQuads(a),n}addAll(e){if(e instanceof Ge&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(this._observers===null&&e instanceof t&&e._entityIndex===this._entityIndex)e.size!==0&&(qn=0,this._graphs=qt(this._graphs,e._graphs),this._size!==null&&(this._size+=qn/3));else for(let r of e)this.add(r);return this}contains(e){if(e instanceof Ge&&(e=e.filtered),e===this)return!0;if(!(e instanceof t)||this._entityIndex!==e._entityIndex){let f=eu(e),c=this._size;return f!==null&&c!==null&&f>c?!1:e.every(_=>this.has(_))}let r=this._graphs,i=e._graphs,n,s,o,a,l,u;for(let f in i){if(!(n=r[f])||(n=n.subjects,(s=i[f].subjects)[N]>n[N]))return!1;for(let c in s){if(!(o=n[c])||(a=s[c])[N]>o[N])return!1;for(let _ in a){if(!(l=o[_])||(u=a[_])[N]>l[N])return!1;for(let h in u)if(!(h in l))return!1}}}return!0}deleteMatches(e,r,i,n){for(let s of this.match(e,r,i,n,{matchSemantics:"lazy"}))this.removeQuad(s);return this}difference(e){if(e&&e instanceof Ge&&(e=e.filtered),e===this)return new t({entityIndex:this._entityIndex});if(e instanceof t&&e._entityIndex===this._entityIndex){let r=new t({entityIndex:this._entityIndex}),i=nu(this._graphs,e._graphs);return i&&(r._graphs=i,r._size=null),r}return this.filter(r=>!e.has(r))}equals(e){return e instanceof Ge&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){let r=new t({entityIndex:this._entityIndex});for(let i of this)e(i,this)&&r.add(i);return r}intersection(e){if(e instanceof Ge&&(e=e.filtered),e===this){let n=new t({entityIndex:this._entityIndex});return n._graphs=qt(Object.create(null),this._graphs),n._size=this.size,n}else if(e instanceof t&&this._entityIndex===e._entityIndex){let n=new t({entityIndex:this._entityIndex}),s=iu(e._graphs,this._graphs);return s&&(n._graphs=s,n._size=null),n}let r=eu(e),i=this._size;if(r!==null&&i!==null&&r<i&&typeof e[Symbol.iterator]=="function"&&e._factory===W&&e._entityIndex._factory===W){let n=new t({entityIndex:this._entityIndex});for(let s of e)this.has(s)&&n.add(s);return n}return this.filter(n=>e.has(n))}map(e){let r=new t({entityIndex:this._entityIndex});for(let i of this)r.add(e(i,this));return r}reduce(e,r){let i=this.readQuads(),n=r===void 0?i.next().value:r;for(let s of i)n=e(n,s,this);return n}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match(null,null,null,null,{matchSemantics:"lazy"})}toString(){return new oe().quadsToString(this)}union(e){let r=new t({entityIndex:this._entityIndex});return r._graphs=qt(Object.create(null),this._graphs),r._size=this.size,r.addAll(e),r}[Symbol.iterator](){return this.readQuads()}};function Ee(t,e,r=0){let i=e[r];if(i&&!(i in t))return!1;let n=!1,s=0;for(let o in i?{[i]:t[i]}:t){let a=r===2?null:Ee(t[o],e,r+1);a!==!1&&(n=n||Object.create(null),n[o]=a,s++)}return n&&(n[N]=s),n}function tu(t,e,r,i,n){let s={store:t,ids:[]},o=e&&t._termToNumericId(e),a=r&&t._termToNumericId(r),l=i&&t._termToNumericId(i),u,f,c,_,h;l&&(o||!a)?(u="objects",[f,c,_]=[l,o,a],h=[2,0,1]):!o&&a?(u="predicates",[f,c,_]=[a,l,o],h=[1,2,0]):(u="subjects",[f,c,_]=[o,a,l],h=[0,1,2]);let b=t._getGraphs(n),d=[];for(let y in b){let g=b[y][u],S=Number(y);for(let m in f?{[f]:g[f]}:g){let w=g[m];if(w){d[h[0]]=Number(m);for(let x in c?{[c]:w[c]}:w){let A=w[x];if(A){d[h[1]]=Number(x);for(let E in _?_ in A?{[_]:null}:{}:A)d[h[2]]=Number(E),s.ids.push(d[0],d[1],d[2],S)}}}}}return s}function*hb({store:t,ids:e},r){let i=t._entities,n,s,o,a,l,u,f,c;for(let _=r*4;_<e.length;_+=4)l!==e[_]&&(n=t._termFromId(i[l=e[_]])),u!==e[_+1]&&(s=t._termFromId(i[u=e[_+1]])),f!==e[_+2]&&(o=t._termFromId(i[f=e[_+2]])),c!==e[_+3]&&(a=t._termFromId(i[c=e[_+3]])),yield t._factory.quad(n,s,o,a)}function Wn(t="lazy"){if(t!=="lazy"&&t!=="snapshot"&&t!=="forwarded")throw new Error(`Unknown matchSemantics: ${t}`);if(t!=="lazy"&&(typeof WeakRef!="function"||typeof FinalizationRegistry!="function"))throw new Error("Non-lazy matchSemantics requires WeakRef and FinalizationRegistry support");return t}function ru(t,e){let r=new Array(4);for(let i=0;i<4;i++){let n=t[i],s=e[i];if(n==null)r[i]=s;else if(s==null||Z(n)===Z(s))r[i]=n;else return!1}return r}var Ge=class t extends ei.Readable{constructor(e,r,i,n,s,o){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:r,predicate:i,object:n,graph:s,options:o});let a=this._semantics=Wn(o.matchSemantics);o.matchesNothing&&(this._matchesNothing=!0,this._filtered=new ue({factory:e._factory,entityIndex:o.entityIndex})),a!=="lazy"&&(this._readers=null,this._subjectId=this._predicateId=this._objectId=this._graphId=void 0,this._matchesNothing||(this._observer=e._addObserver(this)))}_matchesPattern(e,r,i,n){let{subject:s,predicate:o,object:a,graph:l,n3Store:u}=this;return s&&e!==(this._subjectId||(this._subjectId=u._termToNumericId(s)))||o&&r!==(this._predicateId||(this._predicateId=u._termToNumericId(o)))||a&&i!==(this._objectId||(this._objectId=u._termToNumericId(a)))?!1:l==null||n===(this._graphId||(this._graphId=l===""||se(l)?1:u._termToNumericId(l)))}_matchesQuad(e){let{subject:r,predicate:i,object:n,graph:s}=this;return!this._matchesNothing&&(r==null||Z(r)===Z(e.subject))&&(i==null||Z(i)===Z(e.predicate))&&(n==null||Z(n)===Z(e.object))&&(s==null||Z(s)===Z(e.graph))}_assertMatchesPattern(e){if(!this._matchesQuad(e))throw new Error("Quad does not match the forwarded view pattern")}_sourceIterator(){return this._filtered?this._filtered[Symbol.iterator]():this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}_freezeCurrentIterators(){this._readers&&(this._readers.snapshot=this._filtered?tu(this._filtered):tu(this.n3Store,this.subject,this.predicate,this.object,this.graph),this._readers=null)}_onParentMutation(e,r,i,n,s){if(this._matchesPattern(e,r,i,n)){if(this._freezeCurrentIterators(),this._semantics==="forwarded"){this._filtered&&(s?this._filtered._addQuad(e,r,i,n):this._filtered._removeQuad(e,r,i,n));return}this._filtered=this.filtered}}get filtered(){if(!this._filtered){let{n3Store:e,graph:r,object:i,predicate:n,subject:s}=this;this._semantics!=="lazy"&&this._freezeCurrentIterators();let o=this._filtered=new ue({factory:e._factory,entityIndex:this.options.entityIndex});this._semantics==="snapshot"&&this._detachObserver();let a,l,u;if(s&&!(a=o._termToNumericId(s))||n&&!(l=o._termToNumericId(n))||i&&!(u=o._termToNumericId(i)))return o;let f=e._getGraphs(r);for(let c in f){let _,h,b,d;(d=f[c])&&(!a&&l?(h=Ee(d.predicates,[l,u,a]))&&(_=Ee(d.subjects,[a,l,u]),b=Ee(d.objects,[u,a,l])):u?(b=Ee(d.objects,[u,a,l]))&&(_=Ee(d.subjects,[a,l,u]),h=Ee(d.predicates,[l,u,a])):(_=Ee(d.subjects,[a,l,u]))&&(h=Ee(d.predicates,[l,u,a]),b=Ee(d.objects,[u,a,l])),_&&(o._graphs[c]={subjects:_,predicates:h,objects:b}))}o._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[Ut]&&(this[Ut]=this[Symbol.iterator]());let r=this[Ut];for(;--e>=0;){let{done:i,value:n}=r.next();if(i){this.push(null);return}this.push(n)}}_destroy(e,r){this[Ut]&&(this[Ut].return(),this[Ut]=null),r(e)}_detachObserver(){this._observer&&(this.n3Store._removeObserver(this._observer),this._observer=null)}_detach(){return this._filtered=this.filtered,this._detachObserver(),this._semantics==="lazy"&&(this._readers=null),this._semantics="snapshot",this}addAll(e){if(this._semantics==="forwarded"){for(let r of e)this._assertMatchesPattern(r),this.n3Store.addQuad(r);return this}return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,r,i,n){if(this._semantics==="forwarded"){if(this._matchesNothing)throw new Error("Cannot delete from a conflicting forwarded view pattern");let s=ru([this.subject,this.predicate,this.object,this.graph],[e,r,i,n]);if(!s)throw new Error("Deletion pattern does not match the forwarded view pattern");return this.n3Store.deleteMatches(...s),this}return this.filtered.deleteMatches(e,r,i,n)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,r,i,n,s){return this.filtered.every(this._semantics==="forwarded"?o=>e(o,this):e,r,i,n,s)}filter(e){return this.filtered.filter(this._semantics==="forwarded"?r=>e(r,this):e)}forEach(e,r,i,n,s){return this.filtered.forEach(this._semantics==="forwarded"?o=>e(o,this):e,r,i,n,s)}import(e){if(this._semantics!=="forwarded")return this.filtered.import(e);let r=this;function i(n){try{r._assertMatchesPattern(n),r.n3Store.addQuad(n)}catch(s){e.removeListener("data",i),typeof e.destroy=="function"?e.destroy(s):e.emit("error",s)}}return e.on("data",i),e}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(this._semantics==="forwarded"?r=>e(r,this):e)}some(e,r,i,n,s){return this.filtered.some(this._semantics==="forwarded"?o=>e(o,this):e,r,i,n,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._semantics!=="lazy"?ei.Readable.from(this[Symbol.iterator]()):this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph,{matchSemantics:"lazy"})}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph,{matchSemantics:"lazy"}).addAll(e)}toArray(){return this._semantics!=="lazy"?[...this]:this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,r){return this.filtered.reduce(this._semantics==="forwarded"?(i,n)=>e(i,n,this):e,r)}toString(){return new oe().quadsToString(this)}add(e){return this._semantics==="forwarded"?(this._assertMatchesPattern(e),this.n3Store.addQuad(e),this):this.filtered.add(e)}delete(e){return this._semantics==="forwarded"?(this._assertMatchesPattern(e),this.n3Store.removeQuad(e),this):this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,r,i,n,s=null){let o=s&&s.matchSemantics;if(s&&o!==void 0&&(Wn(o),o!==this._semantics))throw new Error(`Cannot override matchSemantics on a view: inherited "${this._semantics}", received "${o}"`);if(this._semantics!=="forwarded")return new t(this.filtered,e,r,i,n,{entityIndex:this.options.entityIndex,matchSemantics:this._semantics});let a=!this._matchesNothing&&ru([this.subject,this.predicate,this.object,this.graph],[e,r,i,n]),[l,u,f,c]=a||[null,null,null,null];return new t(this.n3Store,l,u,f,c,{entityIndex:this.options.entityIndex,matchSemantics:"forwarded",matchesNothing:!a})}[Symbol.iterator](){return this._semantics==="lazy"?this._sourceIterator():this._iterateStable()}*_iterateStable(){let e=this._readers||(this._readers={count:0,snapshot:null}),r=this._sourceIterator(),i=0;e.count++;try{for(;!e.snapshot;){let{value:n,done:s}=r.next();if(e.snapshot||s)break;i++,yield n}e.snapshot&&(yield*ne(hb(e.snapshot,i)))}finally{r.return(),--e.count===0&&(e.snapshot=null,this._readers===e&&(this._readers=null))}}};var Gt=class{dataset(e){return new ue(e)}};function zn(t){let e=[];for(let{subject:r,object:i}of t.match(null,W.namedNode("http://www.w3.org/2000/10/swap/log#implies"),null,W.defaultGraph())){let n=[...t.match(null,null,null,r)],s=[...t.match(null,null,null,i)];e.push({premise:n,conclusion:s})}return e}var zt=class{constructor(e,r={}){this._store=e,this._maxDerivations=r.maxDerivations===void 0?1/0:r.maxDerivations,this._maxPremiseDepth=r.maxPremiseDepth===void 0?1/0:r.maxPremiseDepth}_add(e,r,i,n,s,o){let a=this._store;if(a._observers){if(!a._addQuad(e,r,i,this._graphId))return}else{if(!a._addToIndex(n.subjects,e,r,i))return;a._addToIndex(n.predicates,r,i,e),a._addToIndex(n.objects,i,e,r),this._indexed++}if(++this._derivations>this._maxDerivations)throw new Error(`Reasoning exceeded the maximum of ${this._maxDerivations} derivations`);o(s)}_emit(e,r,i){let n=e.conclusion;for(let s=0;s<n.length;s++){let o=n[s];this._add(o.subject.value,o.predicate.value,o.object.value,r,o,i)}}_evaluatePremise(e,r,i,n=0){let s,o,[a,l,u]=e.premise[n].value,f=r[e.premise[n].content],c=n===e.premise.length-1;if(!(s=a.value)){for(s in f)o=f[s],a.value=Number(s),this._evaluateLevel1(e,r,i,n,c,l,u,o);a.value=null}else(o=f[s])&&this._evaluateLevel1(e,r,i,n,c,l,u,o)}_evaluateLevel1(e,r,i,n,s,o,a,l){let u,f;if(!(u=o.value)){for(u in l)f=l[u],o.value=Number(u),this._evaluateLevel2(e,r,i,n,s,a,f);o.value=null}else(f=l[u])&&this._evaluateLevel2(e,r,i,n,s,a,f)}_evaluateLevel2(e,r,i,n,s,o,a){let l;if(!(l=o.value)){for(l in a)o.value=Number(l),s?this._emit(e,r,i):this._evaluatePremise(e,r,i,n+1);o.value=null}else s?this._emit(e,r,i):this._evaluatePremise(e,r,i,n+1)}_evaluateRules(e,r,i){for(let n=0;n<e.length;n++)this._evaluatePremise(e[n],r,i)}_reasonGraphNaive(e,r){let i=[];function n(a){a.next&&a.next.forEach(l=>{i.push([a.subject.value,a.predicate.value,a.object.value,l])})}let s=a=>{for(let l=0;l<a.length;l++){let u=a[l];this._add(u.subject.value,u.predicate.value,u.object.value,r,u,n)}};this._evaluateRules(e,r,n);let o;for(;(o=i.pop())!==void 0;){let[a,l,u,f]=o,c=f.basePremise.subject.value;c||(f.basePremise.subject.value=a);let _=f.basePremise.predicate.value;_||(f.basePremise.predicate.value=l);let h=f.basePremise.object.value;h||(f.basePremise.object.value=u),f.premise.length===0?s(f.conclusion):this._evaluatePremise(f,r,n),c||(f.basePremise.subject.value=null),_||(f.basePremise.predicate.value=null),h||(f.basePremise.object.value=null)}}_createRule({premise:e,conclusion:r}){let i=Object.create(null),n=o=>o.termType==="Variable"?i[o.value]=i[o.value]||{}:{value:this._store._termToNewNumericId(o)},s=o=>({subject:n(o.subject),predicate:n(o.predicate),object:n(o.object)});return{premise:e.map(o=>s(o)),conclusion:r.map(o=>s(o)),variables:Object.values(i)}}reason(e){this._derivations=this._indexed=0,Array.isArray(e)||(e=zn(e)),e=e.map(i=>this._createRule(i));for(let i of e)if(i.premise.length>this._maxPremiseDepth)throw new Error(`Reasoning rule exceeds the maximum premise depth of ${this._maxPremiseDepth}`);for(let i of e)for(let n of e)for(let s=0;s<n.premise.length;s++){let o=n.premise[s];for(let a of i.conclusion){if(Gn(o.subject,a.subject)&&Gn(o.predicate,a.predicate)&&Gn(o.object,a.object)){let l=new Set,u=[];o.subject.value=o.subject.value||1,o.object.value=o.object.value||1,o.predicate.value=o.predicate.value||1;for(let f=0;f<n.premise.length;f++)f!==s&&u.push(ou(n.premise[f],l));(a.next=a.next||[]).push({premise:u,conclusion:n.conclusion,basePremise:o})}for(let l=0;l<n.variables.length;l++)n.variables[l].value=null}}for(let i of e){let n=new Set;i.premise=i.premise.map(s=>ou(s,n))}let r=this._store._getGraphs();try{for(let i in r)this._graphId=Number(i),this._reasonGraphNaive(e,r[i])}finally{this._store._size!==null&&(this._store._size+=this._indexed)}}};function ou({subject:t,predicate:e,object:r},i){let n=t.value||i.has(t)||(i.add(t),!1),s=e.value||i.has(e)||(i.add(e),!1),o=r.value||i.has(r)||(i.add(r),!1);return!n&&s?{content:"predicates",value:[e,r,t]}:o?{content:"objects",value:[r,t,e]}:{content:"subjects",value:[t,e,r]}}function Gn(t,e){return t.value===null&&(t.value=e.value),t.value===e.value}var au=ti(Xr());var Qt=class extends au.Transform{constructor(e){super({decodeStrings:!0,readableObjectMode:!0});let r=new ce(e),i,n,s={onQuad:(o,a)=>{o&&this.emit("error",o)||a&&this.push(a)},onPrefix:(o,a)=>{this.emit("prefix",o,a)},onDirective:o=>{this.emit("directive",o)}};e&&e.comments&&(s.onComment=o=>{this.emit("comment",o)}),r.parse({on:(o,a)=>{switch(o){case"data":i=a;break;case"end":n=a;break}}},s),this._transform=(o,a,l)=>{i(o),l()},this._flush=o=>{n(),o()}}import(e){return e.on("error",r=>{this.emit("error",r)}),typeof e.pipe=="function"?e.pipe(this):(e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()})),this}};var lu=ti(Xr());var db=16*1024,_b=20,Vt=class extends lu.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0}),this._buffer="",this._flushTimer=null,this._flushDelay=e&&e.flushDelay!==void 0?e.flushDelay:_b;let r=this._writer=new oe({write:(s,o,a)=>{this._buffer+=s,this._buffer.length>=db?this._pushBuffer():this._flushTimer===null&&this._armFlushTimer(),a&&a()},end:s=>{this._pushBuffer(),this.push(null),s&&s()}},e),i=null,n=s=>{let o=i;i=null,s&&this._pushBuffer(),o(s)};this._transform=(s,o,a)=>{i=a,r.addQuad(s,n)},this._flush=s=>{r.end(s)}}_pushBuffer(){this._clearFlushTimer(),this._buffer!==""&&(this.push(this._buffer),this._buffer="")}_armFlushTimer(){this._flushTimer=setTimeout(()=>{this._flushTimer=null,this._pushBuffer()},this._flushDelay),this._flushTimer.unref&&this._flushTimer.unref()}_clearFlushTimer(){this._flushTimer!==null&&(clearTimeout(this._flushTimer),this._flushTimer=null)}_destroy(e,r){this._clearFlushTimer(),super._destroy(e,r)}import(e){return e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()}),e.on("error",r=>{this._pushBuffer(),this.emit("error",r)}),e.on("prefix",(r,i)=>{this._writer.addPrefix(r,i)}),this}};var pb={Lexer:Se,Parser:ce,Writer:oe,Store:ue,StoreFactory:Gt,EntityIndex:Wt,StreamParser:Qt,StreamWriter:Vt,Util:_r,Reasoner:zt,BaseIRI:Me,DataFactory:W,Term:Q,NamedNode:Qe,Literal:fe,BlankNode:pt,Variable:bt,DefaultGraph:yt,Quad:Ae,Triple:Ae,termFromId:Re,termToId:Te};return gu(bb);})();
23
+ ]`)}}list(e){let r=e&&e.length||0,i=new Array(r);for(let n=0;n<r;n++)i[n]=this._encodeObject(e[n]);return new He(`(${i.join(" ")})`)}end(e){this._endStatement(),this._write=this._blockedWrite;let r=e&&((i,n)=>{r=null,e(i,n)});if(this._endStream)try{return this._outputStream.end(r)}catch(i){}r&&r()}};function Xu(t){let e=ws[t];return e===void 0&&(t.length===1?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((t.charCodeAt(0)-55296)*1024+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}function Zu(t){let e=ws[t];return e===void 0&&(e=t.charCodeAt(0).toString(16).toUpperCase(),e="\\u0000".substr(0,6-e.length)+e),e}var Zr=ei(Jr());var Ut=Symbol("iter"),N=Symbol("size"),$n;function ob({store:t,observer:e}){let r=t.deref();r&&r._removeObserver(e)}function kn(t,e,r,i){let n=t&&t[e],s=n&&n[r];return!!s&&i in s}var ab=/^[?_"[.<]/;function Z(t){if(typeof t=="string")return t.charCodeAt(0)!==60||t==="<>"?t:`<${t}>`;let e=Te(t);return e.charCodeAt(0)>=97||!t?e:t.termType==="Quad"?JSON.stringify(tu(t)):t.termType!=="NamedNode"||!ab.test(t.value)?e:`<${t.value}>`}function tu(t){let e=[Xr(t.subject),Xr(t.predicate),Xr(t.object)];return t.graph&&!se(t.graph)&&e.push(Xr(t.graph)),e}function Xr(t){return t.termType==="Quad"?tu(t):Z(t)}var qt=class{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||W}_termFromId(e){if(e[0]==="<")return this._factory.namedNode(e.substring(1,e.length-1));if(e[0]==="."){let r=this._entities,i=e.split(".");return this._factory.quad(this._termFromId(r[i[1]]),this._termFromId(r[i[2]]),this._termFromId(r[i[3]]),i[4]&&this._termFromId(r[i[4]]))}return Re(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){let r=this._termToNumericId(e.subject),i=this._termToNumericId(e.predicate),n=this._termToNumericId(e.object),s;return r&&i&&n&&(se(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${r}.${i}.${n}.${s}`:`.${r}.${i}.${n}`]}return typeof e=="string"?this._stringToNumericId(e):this._ids[Z(e)]}_stringToNumericId(e){let r=this._ids[e];return(r?this._entities[r].charCodeAt(0)!==60:e.charCodeAt(0)!==60)||e==="<>"?r:this._ids[`<${e}>`]}_termToNewNumericId(e){if(typeof e=="string")return this._stringToNumericId(e)||this._addEntity(Z(e));let r=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${se(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:Z(e);return this._ids[r]||this._addEntity(r)}_addEntity(e){return this._ids[this._entities[++this._id]=e]=this._id}createBlankNode(e){let r,i;if(e)for(r=e=`_:${e}`,i=1;this._ids[r];)r=e+i++;else do r=`_:b${this._blankNodeIndex++}`;while(this._ids[r]);return this._ids[r]=++this._id,this._entities[this._id]=r,this._factory.blankNode(r.substr(2))}};function Xl(t){return t instanceof ue?t._size:null}var ue=class t{constructor(e,r){this._size=0,this._graphs=Object.create(null),this._graphCount=0,this._observers=null,!r&&e&&!e[0]&&typeof e.match!="function"&&(r=e,e=null),r=r||{},this._factory=r.factory||W,this._matchSemantics=Un(r.matchSemantics),this._entityIndex=r.entityIndex||new qt({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(){return this._size===null&&(this._size=this.countQuads()),this._size}_addToIndex(e,r,i,n){let s=e[r];s||(e[r]=s={[N]:0},e[N]++);let o=s[i];o||(s[i]=o={[N]:0},s[N]++);let a=n in o;return a||(o[n]=null,o[N]++),!a}_removeFromIndex(e,r,i,n){let s=e[r],o=s[i];delete o[n],--o[N]===0&&(delete s[i],--s[N]===0&&(delete e[r],e[N]--))}*_findInIndex(e,r,i,n,s,o,a,l){let u=this._entities,f=this._termFromId(u[l]),c={subject:null,predicate:null,object:null};if(n){let h=e[r],b=h&&h[i];if(!b||!(n in b))return;c[s]=this._termFromId(u[r]),c[o]=this._termFromId(u[i]),c[a]=this._termFromId(u[n]),yield this._factory.quad(c.subject,c.predicate,c.object,f);return}if(r&&!(r in e))return;let d=r?null:Object.keys(e);for(let h=0,b=r||d[0];b;b=d&&d[++h]){let _=e[b];if(!_)continue;if(c[s]=this._termFromId(u[b]),i&&!(i in _))return;let y=i?null:Object.keys(_);for(let g=0,S=i||y[0];S;S=y&&y[++g]){let m=_[S];if(!m)continue;c[o]=this._termFromId(u[S]);let w=Object.keys(m);for(let x=0;x<w.length;x++)c[a]=this._termFromId(u[w[x]]),yield this._factory.quad(c.subject,c.predicate,c.object,f)}}}_loop(e,r){for(let i in e)r(i)}_loopByKey0(e,r,i){let n,s;if(n=e[r])for(s in n)i(s)}_loopByKey1(e,r,i){let n,s;for(n in e)s=e[n],s[r]&&i(n)}_loopBy2Keys(e,r,i,n){let s,o,a;if((s=e[r])&&(o=s[i]))for(a in o)n(a)}_loopByKey0Deep(e,r,i){let n,s,o,a;if(n=e[r])for(o in n){s=n[o];for(a in s)i(a)}}_countInIndex(e,r,i,n){let s=0,o,a;if(r){if(!(o=e[r]))return 0;if(i)return(a=o[i])?n?n in a?1:0:a[N]:0;let u=Object.keys(o);for(let f=0;f<u.length;f++)s+=o[u[f]][N];return s}let l=Object.keys(e);for(let u=0;u<l.length;u++){o=e[l[u]];let f=Object.keys(o);for(let c=0;c<f.length;c++)s+=o[f[c]][N]}return s}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_addObserver(e){let r=new WeakRef(e);return($n||($n=new FinalizationRegistry(ob))).register(e,{store:new WeakRef(this),observer:r},r),(this._observers||(this._observers=new Set)).add(r),r}_removeObserver(e){$n.unregister(e),this._observers&&(this._observers.delete(e),this._observers.size===0&&(this._observers=null))}_notifyObservers(e,r,i,n,s){for(let o of this._observers){let a=o.deref();a?a._onParentMutation(e,r,i,n,s):this._removeObserver(o)}}_uniqueEntities(e){let r=Object.create(null);return i=>{i in r||(r[i]=!0,e(this._termFromId(this._entities[i],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,r,i,n){return r||(n=e.graph,i=e.object,r=e.predicate,e=e.subject),n=n?this._termToNewNumericId(n):1,e=this._termToNewNumericId(e),r=this._termToNewNumericId(r),i=this._termToNewNumericId(i),this._addQuad(e,r,i,n)}_addQuad(e,r,i,n){let s=this._graphs[n];if(s||(s=this._graphs[n]={subjects:{[N]:0},predicates:{[N]:0},objects:{[N]:0}},Object.freeze(s),this._graphCount++),this._observers!==null){if(kn(s.subjects,e,r,i))return!1;this._notifyObservers(e,r,i,n,!0)}return this._addToIndex(s.subjects,e,r,i)?(this._addToIndex(s.predicates,r,i,e),this._addToIndex(s.objects,i,e,r),this._size!==null&&this._size++,!0):!1}_addFromIndex(e,r=null){for(let i in e){let n=e[i].subjects,s=r&&r[i],o=s?s.subjects:null;for(let a in n){let l=Number(a),u=n[a],f=o&&o[a];for(let c in u){let d=Number(c),h=u[c],b=f&&f[c];for(let _ in h)(!b||!(_ in b))&&this._addQuad(l,d,Number(_),Number(i))}}}}_addIntersectionFromIndex(e,r){for(let i in e){let n=r[i];if(n){let s=e[i].subjects,o=n.subjects;o[N]<s[N]&&([s,o]=[o,s]);for(let a in s){let l=s[a],u=o[a];if(u){u[N]<l[N]&&([l,u]=[u,l]);for(let f in l){let c=l[f],d=u[f];if(d){d[N]<c[N]&&([c,d]=[d,c]);for(let h in c)h in d&&this._addQuad(Number(a),Number(f),Number(h),Number(i))}}}}}}}addQuads(e){for(let r=0;r<e.length;r++)this.addQuad(e[r])}delete(e){return this.removeQuad(e),this}has(e,r,i,n){if(e&&e.subject&&({subject:e,predicate:r,object:i,graph:n}=e),e&&r&&i&&n!==void 0&&n!==null){let s=this._termToNumericId(e),o=this._termToNumericId(r),a=this._termToNumericId(i),l=n===""||se(n)?1:this._termToNumericId(n),u=l&&this._graphs[l];return!!s&&!!o&&!!a&&!!u&&kn(u.subjects,s,o,a)}return!this.readQuads(e,r,i,n).next().done}import(e){return e.on("data",r=>{this.addQuad(r)}),e}removeQuad(e,r,i,n){return r||({subject:e,predicate:r,object:i,graph:n}=e),n=n?this._termToNumericId(n):1,!(e=e&&this._termToNumericId(e))||!(r=r&&this._termToNumericId(r))||!(i=i&&this._termToNumericId(i))?!1:this._removeQuad(e,r,i,n)}_removeQuad(e,r,i,n){let s=this._graphs,o=s[n];return!o||!kn(o.subjects,e,r,i)?!1:(this._observers!==null&&this._notifyObservers(e,r,i,n,!1),this._removeFromIndex(o.subjects,e,r,i),this._removeFromIndex(o.predicates,r,i,e),this._removeFromIndex(o.objects,i,e,r),this._size!==null&&this._size--,o.subjects[N]===0&&(delete s[n],this._graphCount--),!0)}removeQuads(e){for(let r=0;r<e.length;r++)this.removeQuad(e[r])}remove(e){return e.on("data",r=>{this.removeQuad(r)}),e}removeMatches(e,r,i,n){let s=new Zr.Readable({objectMode:!0}),o=this.readQuads(e,r,i,n);return s._read=a=>{for(;--a>=0;){let{done:l,value:u}=o.next();if(l){s.push(null);return}s.push(u)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,r,i,n){return[...this.readQuads(e,r,i,n)]}*readQuads(e,r,i,n){let s=this._getGraphs(n),o,a,l,u;if(!(e&&!(a=this._termToNumericId(e))||r&&!(l=this._termToNumericId(r))||i&&!(u=this._termToNumericId(i))))for(let f in s)(o=s[f])&&(a?u?yield*ne(this._findInIndex(o.objects,u,a,l,"object","subject","predicate",f)):yield*ne(this._findInIndex(o.subjects,a,l,null,"subject","predicate","object",f)):l?yield*ne(this._findInIndex(o.predicates,l,u,null,"predicate","object","subject",f)):u?yield*ne(this._findInIndex(o.objects,u,null,null,"object","subject","predicate",f)):yield*ne(this._findInIndex(o.subjects,null,null,null,"subject","predicate","object",f)))}match(e,r,i,n,s=null){return new Ge(this,e,r,i,n,{entityIndex:this._entityIndex,matchSemantics:s&&s.matchSemantics!==void 0?s.matchSemantics:this._matchSemantics})}countQuads(e,r,i,n){let s=this._getGraphs(n),o=0,a,l,u,f;if(e&&!(l=this._termToNumericId(e))||r&&!(u=this._termToNumericId(r))||i&&!(f=this._termToNumericId(i)))return 0;for(let c in s)(a=s[c])&&(e?i?o+=this._countInIndex(a.objects,f,l,u):o+=this._countInIndex(a.subjects,l,u,f):r?o+=this._countInIndex(a.predicates,u,f,l):i?o+=this._countInIndex(a.objects,f,l,u):o+=this._countInIndex(a.subjects));return o}forEach(e,r,i,n,s){this.some(o=>(e(o,this),!1),r,i,n,s)}every(e,r,i,n,s){return!this.some(o=>!e(o,this),r,i,n,s)}some(e,r,i,n,s){for(let o of this.readQuads(r,i,n,s))if(e(o,this))return!0;return!1}getSubjects(e,r,i){let n=[];return this.forSubjects(s=>{n.push(s)},e,r,i),n}forSubjects(e,r,i,n){let s=this._getGraphs(n),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.predicates,a,l,e):this._loopByKey1(o.subjects,a,e):l?this._loopByKey0(o.objects,l,e):this._loop(o.subjects,e))}getPredicates(e,r,i){let n=[];return this.forPredicates(s=>{n.push(s)},e,r,i),n}forPredicates(e,r,i,n){let s=this._getGraphs(n),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.objects,l,a,e):this._loopByKey0(o.subjects,a,e):l?this._loopByKey1(o.predicates,l,e):this._loop(o.predicates,e))}getObjects(e,r,i){let n=[];return this.forObjects(s=>{n.push(s)},e,r,i),n}forObjects(e,r,i,n){let s=this._getGraphs(n),o,a,l;if(e=this._uniqueEntities(e),!(r&&!(a=this._termToNumericId(r))||i&&!(l=this._termToNumericId(i))))for(n in s)(o=s[n])&&(a?l?this._loopBy2Keys(o.subjects,a,l,e):this._loopByKey0Deep(o.subjects,a,e):l?this._loopByKey0(o.predicates,l,e):this._loop(o.objects,e))}getGraphs(e,r,i){let n=[];return this.forGraphs(s=>{n.push(s)},e,r,i),n}forGraphs(e,r,i,n){for(let s in this._graphs)this.some(o=>(e(o.graph),!0),r,i,n,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:r=!1,allowExtraArcs:i=!1}={}){let n=Object.create(null),s=r?(()=>!0):((l,u)=>{throw new Error(`${l.value} ${u}`)}),o=this.getQuads(null,j.rdf.rest,j.rdf.nil,null),a=[];return o.forEach(l=>{let u=[],f=!1,c=!1,d,h,b=l.graph,_=[],y=l.subject;for(;y&&!f;){let g=this.getQuads(null,null,y,null),S=this.getQuads(y,null,null,null),m,w=null,x=null,A=null;for(let E=0;E<S.length&&!f;E++)m=S[E],m.graph.equals(b)?d?f=s(y,"has non-list arcs out"):m.predicate.value===j.rdf.first?(w?f=s(y,"has multiple rdf:first arcs"):w=m,e&&w===m&&_.push(m)):m.predicate.value===j.rdf.rest?(x?f=s(y,"has multiple rdf:rest arcs"):x=m,e&&x===m&&_.push(m)):g.length?i?c=!0:f=s(y,`has non-list arc ${m.predicate.value}`):(d=m,h="subject"):f=s(y,"not confined to single graph");for(let E=0;E<g.length&&!f;++E)m=g[E],d?f=s(y,"can't have coreferences"):m.predicate.value===j.rdf.rest?A?f=s(y,"has incoming rdf:rest arcs"):A=m:(d=m,h="object");w?u.push(w.object):f=s(y,"has no list head"),y=A&&A.subject}if(f)e=!1;else if(u.reverse(),d&&(n[d[h].value]=u),e&&!c)for(let g=0;g<_.length;g++)a.push(_[g])}),e&&this.removeQuads(a),n}addAll(e){if(e instanceof Ge&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof t&&e._entityIndex===this._entityIndex)this._addFromIndex(e._graphs);else for(let r of e)this.add(r);return this}contains(e){if(e instanceof Ge&&(e=e.filtered),e===this)return!0;if(!(e instanceof t)||this._entityIndex!==e._entityIndex){let f=Xl(e),c=this._size;return f!==null&&c!==null&&f>c?!1:e.every(d=>this.has(d))}let r=this._graphs,i=e._graphs,n,s,o,a,l,u;for(let f in i){if(!(n=r[f])||(n=n.subjects,(s=i[f].subjects)[N]>n[N]))return!1;for(let c in s){if(!(o=n[c])||(a=s[c])[N]>o[N])return!1;for(let d in a){if(!(l=o[d])||(u=a[d])[N]>l[N])return!1;for(let h in u)if(!(h in l))return!1}}}return!0}deleteMatches(e,r,i,n){for(let s of this.match(e,r,i,n,{matchSemantics:"lazy"}))this.removeQuad(s);return this}difference(e){if(e&&e instanceof Ge&&(e=e.filtered),e===this)return new t({entityIndex:this._entityIndex});if(e instanceof t&&e._entityIndex===this._entityIndex){let r=new t({entityIndex:this._entityIndex});return r._addFromIndex(this._graphs,e._graphs),r}return this.filter(r=>!e.has(r))}equals(e){return e instanceof Ge&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){let r=new t({entityIndex:this._entityIndex});for(let i of this)e(i,this)&&r.add(i);return r}intersection(e){if(e instanceof Ge&&(e=e.filtered),e===this){let n=new t({entityIndex:this._entityIndex});return n._addFromIndex(this._graphs),n}else if(e instanceof t&&this._entityIndex===e._entityIndex){let n=new t({entityIndex:this._entityIndex});return this._size!==0&&e._size!==0&&(e._graphCount<this._graphCount?n._addIntersectionFromIndex(e._graphs,this._graphs):n._addIntersectionFromIndex(this._graphs,e._graphs)),n}let r=Xl(e),i=this._size;if(r!==null&&i!==null&&r<i&&typeof e[Symbol.iterator]=="function"&&e._factory===W&&e._entityIndex._factory===W){let n=new t({entityIndex:this._entityIndex});for(let s of e)this.has(s)&&n.add(s);return n}return this.filter(n=>e.has(n))}map(e){let r=new t({entityIndex:this._entityIndex});for(let i of this)r.add(e(i,this));return r}reduce(e,r){let i=this.readQuads(),n=r===void 0?i.next().value:r;for(let s of i)n=e(n,s,this);return n}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match(null,null,null,null,{matchSemantics:"lazy"})}toString(){return new oe().quadsToString(this)}union(e){let r=new t({entityIndex:this._entityIndex});return r._addFromIndex(this._graphs),r.addAll(e),r}[Symbol.iterator](){return this.readQuads()}};function Ee(t,e,r=0){let i=e[r];if(i&&!(i in t))return!1;let n=!1,s=0;for(let o in i?{[i]:t[i]}:t){let a=r===2?null:Ee(t[o],e,r+1);a!==!1&&(n=n||Object.create(null),n[o]=a,s++)}return n&&(n[N]=s),n}function Zl(t,e,r,i,n){let s={store:t,ids:[]},o=e&&t._termToNumericId(e),a=r&&t._termToNumericId(r),l=i&&t._termToNumericId(i),u,f,c,d,h;l&&(o||!a)?(u="objects",[f,c,d]=[l,o,a],h=[2,0,1]):!o&&a?(u="predicates",[f,c,d]=[a,l,o],h=[1,2,0]):(u="subjects",[f,c,d]=[o,a,l],h=[0,1,2]);let b=t._getGraphs(n),_=[];for(let y in b){let g=b[y][u],S=Number(y);for(let m in f?{[f]:g[f]}:g){let w=g[m];if(w){_[h[0]]=Number(m);for(let x in c?{[c]:w[c]}:w){let A=w[x];if(A){_[h[1]]=Number(x);for(let E in d?d in A?{[d]:null}:{}:A)_[h[2]]=Number(E),s.ids.push(_[0],_[1],_[2],S)}}}}}return s}function*lb({store:t,ids:e},r){let i=t._entities,n,s,o,a,l,u,f,c;for(let d=r*4;d<e.length;d+=4)l!==e[d]&&(n=t._termFromId(i[l=e[d]])),u!==e[d+1]&&(s=t._termFromId(i[u=e[d+1]])),f!==e[d+2]&&(o=t._termFromId(i[f=e[d+2]])),c!==e[d+3]&&(a=t._termFromId(i[c=e[d+3]])),yield t._factory.quad(n,s,o,a)}function Un(t="lazy"){if(t!=="lazy"&&t!=="snapshot"&&t!=="forwarded")throw new Error(`Unknown matchSemantics: ${t}`);if(t!=="lazy"&&(typeof WeakRef!="function"||typeof FinalizationRegistry!="function"))throw new Error("Non-lazy matchSemantics requires WeakRef and FinalizationRegistry support");return t}function eu(t,e){let r=new Array(4);for(let i=0;i<4;i++){let n=t[i],s=e[i];if(n==null)r[i]=s;else if(s==null||Z(n)===Z(s))r[i]=n;else return!1}return r}var Ge=class t extends Zr.Readable{constructor(e,r,i,n,s,o){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:r,predicate:i,object:n,graph:s,options:o});let a=this._semantics=Un(o.matchSemantics);o.matchesNothing&&(this._matchesNothing=!0,this._filtered=new ue({factory:e._factory,entityIndex:o.entityIndex})),a!=="lazy"&&(this._readers=null,this._subjectId=this._predicateId=this._objectId=this._graphId=void 0,this._matchesNothing||(this._observer=e._addObserver(this)))}_matchesPattern(e,r,i,n){let{subject:s,predicate:o,object:a,graph:l,n3Store:u}=this;return s&&e!==(this._subjectId||(this._subjectId=u._termToNumericId(s)))||o&&r!==(this._predicateId||(this._predicateId=u._termToNumericId(o)))||a&&i!==(this._objectId||(this._objectId=u._termToNumericId(a)))?!1:l==null||n===(this._graphId||(this._graphId=l===""||se(l)?1:u._termToNumericId(l)))}_matchesQuad(e){let{subject:r,predicate:i,object:n,graph:s}=this;return!this._matchesNothing&&(r==null||Z(r)===Z(e.subject))&&(i==null||Z(i)===Z(e.predicate))&&(n==null||Z(n)===Z(e.object))&&(s==null||Z(s)===Z(e.graph))}_assertMatchesPattern(e){if(!this._matchesQuad(e))throw new Error("Quad does not match the forwarded view pattern")}_sourceIterator(){return this._filtered?this._filtered[Symbol.iterator]():this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}_freezeCurrentIterators(){this._readers&&(this._readers.snapshot=this._filtered?Zl(this._filtered):Zl(this.n3Store,this.subject,this.predicate,this.object,this.graph),this._readers=null)}_onParentMutation(e,r,i,n,s){if(this._matchesPattern(e,r,i,n)){if(this._freezeCurrentIterators(),this._semantics==="forwarded"){this._filtered&&(s?this._filtered._addQuad(e,r,i,n):this._filtered._removeQuad(e,r,i,n));return}this._filtered=this.filtered}}get filtered(){if(!this._filtered){let{n3Store:e,graph:r,object:i,predicate:n,subject:s}=this;this._semantics!=="lazy"&&this._freezeCurrentIterators();let o=this._filtered=new ue({factory:e._factory,entityIndex:this.options.entityIndex});this._semantics==="snapshot"&&this._detachObserver();let a,l,u;if(s&&!(a=o._termToNumericId(s))||n&&!(l=o._termToNumericId(n))||i&&!(u=o._termToNumericId(i)))return o;let f=e._getGraphs(r);for(let c in f){let d,h,b,_;(_=f[c])&&(!a&&l?(h=Ee(_.predicates,[l,u,a]))&&(d=Ee(_.subjects,[a,l,u]),b=Ee(_.objects,[u,a,l])):u?(b=Ee(_.objects,[u,a,l]))&&(d=Ee(_.subjects,[a,l,u]),h=Ee(_.predicates,[l,u,a])):(d=Ee(_.subjects,[a,l,u]))&&(h=Ee(_.predicates,[l,u,a]),b=Ee(_.objects,[u,a,l])),d&&(o._graphs[c]={subjects:d,predicates:h,objects:b},o._graphCount++))}o._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[Ut]&&(this[Ut]=this[Symbol.iterator]());let r=this[Ut];for(;--e>=0;){let{done:i,value:n}=r.next();if(i){this.push(null);return}this.push(n)}}_destroy(e,r){this[Ut]&&(this[Ut].return(),this[Ut]=null),r(e)}_detachObserver(){this._observer&&(this.n3Store._removeObserver(this._observer),this._observer=null)}_detach(){return this._filtered=this.filtered,this._detachObserver(),this._semantics==="lazy"&&(this._readers=null),this._semantics="snapshot",this}addAll(e){if(this._semantics==="forwarded"){for(let r of e)this._assertMatchesPattern(r),this.n3Store.addQuad(r);return this}return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,r,i,n){if(this._semantics==="forwarded"){if(this._matchesNothing)throw new Error("Cannot delete from a conflicting forwarded view pattern");let s=eu([this.subject,this.predicate,this.object,this.graph],[e,r,i,n]);if(!s)throw new Error("Deletion pattern does not match the forwarded view pattern");return this.n3Store.deleteMatches(...s),this}return this.filtered.deleteMatches(e,r,i,n)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,r,i,n,s){return this.filtered.every(this._semantics==="forwarded"?o=>e(o,this):e,r,i,n,s)}filter(e){return this.filtered.filter(this._semantics==="forwarded"?r=>e(r,this):e)}forEach(e,r,i,n,s){return this.filtered.forEach(this._semantics==="forwarded"?o=>e(o,this):e,r,i,n,s)}import(e){if(this._semantics!=="forwarded")return this.filtered.import(e);let r=this;function i(n){try{r._assertMatchesPattern(n),r.n3Store.addQuad(n)}catch(s){e.removeListener("data",i),typeof e.destroy=="function"?e.destroy(s):e.emit("error",s)}}return e.on("data",i),e}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(this._semantics==="forwarded"?r=>e(r,this):e)}some(e,r,i,n,s){return this.filtered.some(this._semantics==="forwarded"?o=>e(o,this):e,r,i,n,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._semantics!=="lazy"?Zr.Readable.from(this[Symbol.iterator]()):this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph,{matchSemantics:"lazy"})}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph,{matchSemantics:"lazy"}).addAll(e)}toArray(){return this._semantics!=="lazy"?[...this]:this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,r){return this.filtered.reduce(this._semantics==="forwarded"?(i,n)=>e(i,n,this):e,r)}toString(){return new oe().quadsToString(this)}add(e){return this._semantics==="forwarded"?(this._assertMatchesPattern(e),this.n3Store.addQuad(e),this):this.filtered.add(e)}delete(e){return this._semantics==="forwarded"?(this._assertMatchesPattern(e),this.n3Store.removeQuad(e),this):this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,r,i,n,s=null){let o=s&&s.matchSemantics;if(s&&o!==void 0&&(Un(o),o!==this._semantics))throw new Error(`Cannot override matchSemantics on a view: inherited "${this._semantics}", received "${o}"`);if(this._semantics!=="forwarded")return new t(this.filtered,e,r,i,n,{entityIndex:this.options.entityIndex,matchSemantics:this._semantics});let a=!this._matchesNothing&&eu([this.subject,this.predicate,this.object,this.graph],[e,r,i,n]),[l,u,f,c]=a||[null,null,null,null];return new t(this.n3Store,l,u,f,c,{entityIndex:this.options.entityIndex,matchSemantics:"forwarded",matchesNothing:!a})}[Symbol.iterator](){return this._semantics==="lazy"?this._sourceIterator():this._iterateStable()}*_iterateStable(){let e=this._readers||(this._readers={count:0,snapshot:null}),r=this._sourceIterator(),i=0;e.count++;try{for(;!e.snapshot;){let{value:n,done:s}=r.next();if(e.snapshot||s)break;i++,yield n}e.snapshot&&(yield*ne(lb(e.snapshot,i)))}finally{r.return(),--e.count===0&&(e.snapshot=null,this._readers===e&&(this._readers=null))}}};var Wt=class{dataset(e){return new ue(e)}};function Wn(t){let e=[];for(let{subject:r,object:i}of t.match(null,W.namedNode("http://www.w3.org/2000/10/swap/log#implies"),null,W.defaultGraph())){let n=[...t.match(null,null,null,r)],s=[...t.match(null,null,null,i)];e.push({premise:n,conclusion:s})}return e}var Gt=class{constructor(e,r={}){this._store=e,this._maxDerivations=r.maxDerivations===void 0?1/0:r.maxDerivations,this._maxPremiseDepth=r.maxPremiseDepth===void 0?1/0:r.maxPremiseDepth}_add(e,r,i,n,s,o){let a=this._store;if(a._observers){if(!a._addQuad(e,r,i,this._graphId))return}else{if(!a._addToIndex(n.subjects,e,r,i))return;a._addToIndex(n.predicates,r,i,e),a._addToIndex(n.objects,i,e,r),this._indexed++}if(++this._derivations>this._maxDerivations)throw new Error(`Reasoning exceeded the maximum of ${this._maxDerivations} derivations`);o(s)}_emit(e,r,i){let n=e.conclusion;for(let s=0;s<n.length;s++){let o=n[s];this._add(o.subject.value,o.predicate.value,o.object.value,r,o,i)}}_evaluatePremise(e,r,i,n=0){let s,o,[a,l,u]=e.premise[n].value,f=r[e.premise[n].content],c=n===e.premise.length-1;if(!(s=a.value)){for(s in f)o=f[s],a.value=Number(s),this._evaluateLevel1(e,r,i,n,c,l,u,o);a.value=null}else(o=f[s])&&this._evaluateLevel1(e,r,i,n,c,l,u,o)}_evaluateLevel1(e,r,i,n,s,o,a,l){let u,f;if(!(u=o.value)){for(u in l)f=l[u],o.value=Number(u),this._evaluateLevel2(e,r,i,n,s,a,f);o.value=null}else(f=l[u])&&this._evaluateLevel2(e,r,i,n,s,a,f)}_evaluateLevel2(e,r,i,n,s,o,a){let l;if(!(l=o.value)){for(l in a)o.value=Number(l),s?this._emit(e,r,i):this._evaluatePremise(e,r,i,n+1);o.value=null}else s?this._emit(e,r,i):this._evaluatePremise(e,r,i,n+1)}_evaluateRules(e,r,i){for(let n=0;n<e.length;n++)this._evaluatePremise(e[n],r,i)}_reasonGraphNaive(e,r){let i=[];function n(a){a.next&&a.next.forEach(l=>{i.push([a.subject.value,a.predicate.value,a.object.value,l])})}let s=a=>{for(let l=0;l<a.length;l++){let u=a[l];this._add(u.subject.value,u.predicate.value,u.object.value,r,u,n)}};this._evaluateRules(e,r,n);let o;for(;(o=i.pop())!==void 0;){let[a,l,u,f]=o,c=f.basePremise.subject.value;c||(f.basePremise.subject.value=a);let d=f.basePremise.predicate.value;d||(f.basePremise.predicate.value=l);let h=f.basePremise.object.value;h||(f.basePremise.object.value=u),f.premise.length===0?s(f.conclusion):this._evaluatePremise(f,r,n),c||(f.basePremise.subject.value=null),d||(f.basePremise.predicate.value=null),h||(f.basePremise.object.value=null)}}_createRule({premise:e,conclusion:r}){let i=Object.create(null),n=o=>o.termType==="Variable"?i[o.value]=i[o.value]||{}:{value:this._store._termToNewNumericId(o)},s=o=>({subject:n(o.subject),predicate:n(o.predicate),object:n(o.object)});return{premise:e.map(o=>s(o)),conclusion:r.map(o=>s(o)),variables:Object.values(i)}}reason(e){this._derivations=this._indexed=0,Array.isArray(e)||(e=Wn(e)),e=e.map(i=>this._createRule(i));for(let i of e)if(i.premise.length>this._maxPremiseDepth)throw new Error(`Reasoning rule exceeds the maximum premise depth of ${this._maxPremiseDepth}`);for(let i of e)for(let n of e)for(let s=0;s<n.premise.length;s++){let o=n.premise[s];for(let a of i.conclusion){if(qn(o.subject,a.subject)&&qn(o.predicate,a.predicate)&&qn(o.object,a.object)){let l=new Set,u=[];o.subject.value=o.subject.value||1,o.object.value=o.object.value||1,o.predicate.value=o.predicate.value||1;for(let f=0;f<n.premise.length;f++)f!==s&&u.push(ru(n.premise[f],l));(a.next=a.next||[]).push({premise:u,conclusion:n.conclusion,basePremise:o})}for(let l=0;l<n.variables.length;l++)n.variables[l].value=null}}for(let i of e){let n=new Set;i.premise=i.premise.map(s=>ru(s,n))}let r=this._store._getGraphs();try{for(let i in r)this._graphId=Number(i),this._reasonGraphNaive(e,r[i])}finally{this._store._size!==null&&(this._store._size+=this._indexed)}}};function ru({subject:t,predicate:e,object:r},i){let n=t.value||i.has(t)||(i.add(t),!1),s=e.value||i.has(e)||(i.add(e),!1),o=r.value||i.has(r)||(i.add(r),!1);return!n&&s?{content:"predicates",value:[e,r,t]}:o?{content:"objects",value:[r,t,e]}:{content:"subjects",value:[t,e,r]}}function qn(t,e){return t.value===null&&(t.value=e.value),t.value===e.value}var iu=ei(Jr());var Qt=class extends iu.Transform{constructor(e){super({decodeStrings:!0,readableObjectMode:!0});let r=new ce(e),i,n,s={onQuad:(o,a)=>{o&&this.emit("error",o)||a&&this.push(a)},onPrefix:(o,a)=>{this.emit("prefix",o,a)},onDirective:o=>{this.emit("directive",o)}};e&&e.comments&&(s.onComment=o=>{this.emit("comment",o)}),r.parse({on:(o,a)=>{switch(o){case"data":i=a;break;case"end":n=a;break}}},s),this._transform=(o,a,l)=>{i(o),l()},this._flush=o=>{n(),o()}}import(e){return e.on("error",r=>{this.emit("error",r)}),typeof e.pipe=="function"?e.pipe(this):(e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()})),this}};var nu=ei(Jr());var ub=16*1024,fb=20,zt=class extends nu.Transform{constructor(e){super({encoding:"utf8",writableObjectMode:!0}),this._buffer="",this._flushTimer=null,this._flushDelay=e&&e.flushDelay!==void 0?e.flushDelay:fb;let r=this._writer=new oe({write:(s,o,a)=>{this._buffer+=s,this._buffer.length>=ub?this._pushBuffer():this._flushTimer===null&&this._armFlushTimer(),a&&a()},end:s=>{this._pushBuffer(),this.push(null),s&&s()}},e),i=null,n=s=>{let o=i;i=null,s&&this._pushBuffer(),o(s)};this._transform=(s,o,a)=>{i=a,r.addQuad(s,n)},this._flush=s=>{r.end(s)}}_pushBuffer(){this._clearFlushTimer(),this._buffer!==""&&(this.push(this._buffer),this._buffer="")}_armFlushTimer(){this._flushTimer=setTimeout(()=>{this._flushTimer=null,this._pushBuffer()},this._flushDelay),this._flushTimer.unref&&this._flushTimer.unref()}_clearFlushTimer(){this._flushTimer!==null&&(clearTimeout(this._flushTimer),this._flushTimer=null)}_destroy(e,r){this._clearFlushTimer(),super._destroy(e,r)}import(e){return e.on("data",r=>{this.write(r)}),e.on("end",()=>{this.end()}),e.on("error",r=>{this._pushBuffer(),this.emit("error",r)}),e.on("prefix",(r,i)=>{this._writer.addPrefix(r,i)}),this}};var cb={Lexer:Se,Parser:ce,Writer:oe,Store:ue,StoreFactory:Wt,EntityIndex:qt,StreamParser:Qt,StreamWriter:zt,Util:dr,Reasoner:Gt,BaseIRI:Me,DataFactory:W,Term:z,NamedNode:ze,Literal:fe,BlankNode:pt,Variable:bt,DefaultGraph:yt,Quad:Ae,Triple:Ae,termFromId:Re,termToId:Te};return _u(hb);})();
24
24
  /*! Bundled license information:
25
25
 
26
26
  ieee754/index.js: