@ulb-darmstadt/shacl-form 2.0.0-rc1 → 2.0.0-rc2
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/dist/bundle.d.ts +3 -0
- package/dist/bundle.js +93 -90
- package/dist/plugins/leaflet.d.ts +5 -1
- package/dist/plugins/leaflet.js +3 -3
- package/package.json +1 -1
- package/dist/plugins/map-util.d.ts +0 -5
- package/dist/plugins/map-util.js +0 -1
package/dist/bundle.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Cn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eg(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function tg(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var e=n.default;if(typeof e=="function"){var i=function r(){var o=!1;try{o=this instanceof r}catch{}return o?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};i.prototype=e.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var o=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(i,r,o.get?o:{enumerable:!0,get:function(){return n[r]}})}),i}var Lo={},sr={},Zu;function ig(){if(Zu)return sr;Zu=1,sr.byteLength=u,sr.toByteArray=d,sr.fromByteArray=h;for(var n=[],e=[],i=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=r.length;o<a;++o)n[o]=r[o],e[r.charCodeAt(o)]=o;e[45]=62,e[95]=63;function l(m){var b=m.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var T=m.indexOf("=");T===-1&&(T=b);var A=T===b?0:4-T%4;return[T,A]}function u(m){var b=l(m),T=b[0],A=b[1];return(T+A)*3/4-A}function f(m,b,T){return(b+T)*3/4-T}function d(m){var b,T=l(m),A=T[0],N=T[1],R=new i(f(m,A,N)),S=0,y=N>0?A-4:A,x;for(x=0;x<y;x+=4)b=e[m.charCodeAt(x)]<<18|e[m.charCodeAt(x+1)]<<12|e[m.charCodeAt(x+2)]<<6|e[m.charCodeAt(x+3)],R[S++]=b>>16&255,R[S++]=b>>8&255,R[S++]=b&255;return N===2&&(b=e[m.charCodeAt(x)]<<2|e[m.charCodeAt(x+1)]>>4,R[S++]=b&255),N===1&&(b=e[m.charCodeAt(x)]<<10|e[m.charCodeAt(x+1)]<<4|e[m.charCodeAt(x+2)]>>2,R[S++]=b>>8&255,R[S++]=b&255),R}function g(m){return n[m>>18&63]+n[m>>12&63]+n[m>>6&63]+n[m&63]}function _(m,b,T){for(var A,N=[],R=b;R<T;R+=3)A=(m[R]<<16&16711680)+(m[R+1]<<8&65280)+(m[R+2]&255),N.push(g(A));return N.join("")}function h(m){for(var b,T=m.length,A=T%3,N=[],R=16383,S=0,y=T-A;S<y;S+=R)N.push(_(m,S,S+R>y?y:S+R));return A===1?(b=m[T-1],N.push(n[b>>2]+n[b<<4&63]+"==")):A===2&&(b=(m[T-2]<<8)+m[T-1],N.push(n[b>>10]+n[b>>4&63]+n[b<<2&63]+"=")),N.join("")}return sr}var hs={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Xu;function ng(){return Xu||(Xu=1,hs.read=function(n,e,i,r,o){var a,l,u=o*8-r-1,f=(1<<u)-1,d=f>>1,g=-7,_=i?o-1:0,h=i?-1:1,m=n[e+_];for(_+=h,a=m&(1<<-g)-1,m>>=-g,g+=u;g>0;a=a*256+n[e+_],_+=h,g-=8);for(l=a&(1<<-g)-1,a>>=-g,g+=r;g>0;l=l*256+n[e+_],_+=h,g-=8);if(a===0)a=1-d;else{if(a===f)return l?NaN:(m?-1:1)*(1/0);l=l+Math.pow(2,r),a=a-d}return(m?-1:1)*l*Math.pow(2,a-r)},hs.write=function(n,e,i,r,o,a){var l,u,f,d=a*8-o-1,g=(1<<d)-1,_=g>>1,h=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=r?0:a-1,b=r?1:-1,T=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,l=g):(l=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-l))<1&&(l--,f*=2),l+_>=1?e+=h/f:e+=h*Math.pow(2,1-_),e*f>=2&&(l++,f/=2),l+_>=g?(u=0,l=g):l+_>=1?(u=(e*f-1)*Math.pow(2,o),l=l+_):(u=e*Math.pow(2,_-1)*Math.pow(2,o),l=0));o>=8;n[i+m]=u&255,m+=b,u/=256,o-=8);for(l=l<<o|u,d+=o;d>0;n[i+m]=l&255,m+=b,l/=256,d-=8);n[i+m-b]|=T*128}),hs}/*!
|
|
2
2
|
* The buffer module from node.js, for the browser.
|
|
3
3
|
*
|
|
4
4
|
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
5
|
* @license MIT
|
|
6
|
-
*/var ro;function jt(){return ro||(ro=1,(function(r){const e=ud(),t=cd(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=o,r.SlowBuffer=S,r.INSPECT_MAX_BYTES=50;const i=2147483647;r.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=s(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const I=new Uint8Array(1),f={foo:function(){return 42}};return Object.setPrototypeOf(f,Uint8Array.prototype),Object.setPrototypeOf(I,f),I.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function a(I){if(I>i)throw new RangeError('The value "'+I+'" is invalid for option "size"');const f=new Uint8Array(I);return Object.setPrototypeOf(f,o.prototype),f}function o(I,f,p){if(typeof I=="number"){if(typeof f=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(I)}return u(I,f,p)}o.poolSize=8192;function u(I,f,p){if(typeof I=="string")return b(I,f);if(ArrayBuffer.isView(I))return _(I);if(I==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I);if(le(I,ArrayBuffer)||I&&le(I.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(le(I,SharedArrayBuffer)||I&&le(I.buffer,SharedArrayBuffer)))return E(I,f,p);if(typeof I=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const $=I.valueOf&&I.valueOf();if($!=null&&$!==I)return o.from($,f,p);const X=v(I);if(X)return X;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof I[Symbol.toPrimitive]=="function")return o.from(I[Symbol.toPrimitive]("string"),f,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof I)}o.from=function(I,f,p){return u(I,f,p)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function l(I){if(typeof I!="number")throw new TypeError('"size" argument must be of type number');if(I<0)throw new RangeError('The value "'+I+'" is invalid for option "size"')}function c(I,f,p){return l(I),I<=0?a(I):f!==void 0?typeof p=="string"?a(I).fill(f,p):a(I).fill(f):a(I)}o.alloc=function(I,f,p){return c(I,f,p)};function d(I){return l(I),a(I<0?0:x(I)|0)}o.allocUnsafe=function(I){return d(I)},o.allocUnsafeSlow=function(I){return d(I)};function b(I,f){if((typeof f!="string"||f==="")&&(f="utf8"),!o.isEncoding(f))throw new TypeError("Unknown encoding: "+f);const p=m(I,f)|0;let $=a(p);const X=$.write(I,f);return X!==p&&($=$.slice(0,X)),$}function y(I){const f=I.length<0?0:x(I.length)|0,p=a(f);for(let $=0;$<f;$+=1)p[$]=I[$]&255;return p}function _(I){if(le(I,Uint8Array)){const f=new Uint8Array(I);return E(f.buffer,f.byteOffset,f.byteLength)}return y(I)}function E(I,f,p){if(f<0||I.byteLength<f)throw new RangeError('"offset" is outside of buffer bounds');if(I.byteLength<f+(p||0))throw new RangeError('"length" is outside of buffer bounds');let $;return f===void 0&&p===void 0?$=new Uint8Array(I):p===void 0?$=new Uint8Array(I,f):$=new Uint8Array(I,f,p),Object.setPrototypeOf($,o.prototype),$}function v(I){if(o.isBuffer(I)){const f=x(I.length)|0,p=a(f);return p.length===0||I.copy(p,0,0,f),p}if(I.length!==void 0)return typeof I.length!="number"||Re(I.length)?a(0):y(I);if(I.type==="Buffer"&&Array.isArray(I.data))return y(I.data)}function x(I){if(I>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return I|0}function S(I){return+I!=I&&(I=0),o.alloc(+I)}o.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==o.prototype},o.compare=function(f,p){if(le(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),le(p,Uint8Array)&&(p=o.from(p,p.offset,p.byteLength)),!o.isBuffer(f)||!o.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===p)return 0;let $=f.length,X=p.length;for(let oe=0,de=Math.min($,X);oe<de;++oe)if(f[oe]!==p[oe]){$=f[oe],X=p[oe];break}return $<X?-1:X<$?1:0},o.isEncoding=function(f){switch(String(f).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}},o.concat=function(f,p){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return o.alloc(0);let $;if(p===void 0)for(p=0,$=0;$<f.length;++$)p+=f[$].length;const X=o.allocUnsafe(p);let oe=0;for($=0;$<f.length;++$){let de=f[$];if(le(de,Uint8Array))oe+de.length>X.length?(o.isBuffer(de)||(de=o.from(de)),de.copy(X,oe)):Uint8Array.prototype.set.call(X,de,oe);else if(o.isBuffer(de))de.copy(X,oe);else throw new TypeError('"list" argument must be an Array of Buffers');oe+=de.length}return X};function m(I,f){if(o.isBuffer(I))return I.length;if(ArrayBuffer.isView(I)||le(I,ArrayBuffer))return I.byteLength;if(typeof I!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof I);const p=I.length,$=arguments.length>2&&arguments[2]===!0;if(!$&&p===0)return 0;let X=!1;for(;;)switch(f){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return pe(I).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return ce(I).length;default:if(X)return $?-1:pe(I).length;f=(""+f).toLowerCase(),X=!0}}o.byteLength=m;function h(I,f,p){let $=!1;if((f===void 0||f<0)&&(f=0),f>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,f>>>=0,p<=f))return"";for(I||(I="utf8");;)switch(I){case"hex":return Y(this,f,p);case"utf8":case"utf-8":return L(this,f,p);case"ascii":return Z(this,f,p);case"latin1":case"binary":return k(this,f,p);case"base64":return D(this,f,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,f,p);default:if($)throw new TypeError("Unknown encoding: "+I);I=(I+"").toLowerCase(),$=!0}}o.prototype._isBuffer=!0;function g(I,f,p){const $=I[f];I[f]=I[p],I[p]=$}o.prototype.swap16=function(){const f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<f;p+=2)g(this,p,p+1);return this},o.prototype.swap32=function(){const f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<f;p+=4)g(this,p,p+3),g(this,p+1,p+2);return this},o.prototype.swap64=function(){const f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<f;p+=8)g(this,p,p+7),g(this,p+1,p+6),g(this,p+2,p+5),g(this,p+3,p+4);return this},o.prototype.toString=function(){const f=this.length;return f===0?"":arguments.length===0?L(this,0,f):h.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(f){if(!o.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:o.compare(this,f)===0},o.prototype.inspect=function(){let f="";const p=r.INSPECT_MAX_BYTES;return f=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(f+=" ... "),"<Buffer "+f+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(f,p,$,X,oe){if(le(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),!o.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(p===void 0&&(p=0),$===void 0&&($=f?f.length:0),X===void 0&&(X=0),oe===void 0&&(oe=this.length),p<0||$>f.length||X<0||oe>this.length)throw new RangeError("out of range index");if(X>=oe&&p>=$)return 0;if(X>=oe)return-1;if(p>=$)return 1;if(p>>>=0,$>>>=0,X>>>=0,oe>>>=0,this===f)return 0;let de=oe-X,Ee=$-p;const ke=Math.min(de,Ee),Le=this.slice(X,oe),Oe=f.slice(p,$);for(let De=0;De<ke;++De)if(Le[De]!==Oe[De]){de=Le[De],Ee=Oe[De];break}return de<Ee?-1:Ee<de?1:0};function N(I,f,p,$,X){if(I.length===0)return-1;if(typeof p=="string"?($=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,Re(p)&&(p=X?0:I.length-1),p<0&&(p=I.length+p),p>=I.length){if(X)return-1;p=I.length-1}else if(p<0)if(X)p=0;else return-1;if(typeof f=="string"&&(f=o.from(f,$)),o.isBuffer(f))return f.length===0?-1:C(I,f,p,$,X);if(typeof f=="number")return f=f&255,typeof Uint8Array.prototype.indexOf=="function"?X?Uint8Array.prototype.indexOf.call(I,f,p):Uint8Array.prototype.lastIndexOf.call(I,f,p):C(I,[f],p,$,X);throw new TypeError("val must be string, number or Buffer")}function C(I,f,p,$,X){let oe=1,de=I.length,Ee=f.length;if($!==void 0&&($=String($).toLowerCase(),$==="ucs2"||$==="ucs-2"||$==="utf16le"||$==="utf-16le")){if(I.length<2||f.length<2)return-1;oe=2,de/=2,Ee/=2,p/=2}function ke(Oe,De){return oe===1?Oe[De]:Oe.readUInt16BE(De*oe)}let Le;if(X){let Oe=-1;for(Le=p;Le<de;Le++)if(ke(I,Le)===ke(f,Oe===-1?0:Le-Oe)){if(Oe===-1&&(Oe=Le),Le-Oe+1===Ee)return Oe*oe}else Oe!==-1&&(Le-=Le-Oe),Oe=-1}else for(p+Ee>de&&(p=de-Ee),Le=p;Le>=0;Le--){let Oe=!0;for(let De=0;De<Ee;De++)if(ke(I,Le+De)!==ke(f,De)){Oe=!1;break}if(Oe)return Le}return-1}o.prototype.includes=function(f,p,$){return this.indexOf(f,p,$)!==-1},o.prototype.indexOf=function(f,p,$){return N(this,f,p,$,!0)},o.prototype.lastIndexOf=function(f,p,$){return N(this,f,p,$,!1)};function A(I,f,p,$){p=Number(p)||0;const X=I.length-p;$?($=Number($),$>X&&($=X)):$=X;const oe=f.length;$>oe/2&&($=oe/2);let de;for(de=0;de<$;++de){const Ee=parseInt(f.substr(de*2,2),16);if(Re(Ee))return de;I[p+de]=Ee}return de}function B(I,f,p,$){return ye(pe(f,I.length-p),I,p,$)}function R(I,f,p,$){return ye(me(f),I,p,$)}function F(I,f,p,$){return ye(ce(f),I,p,$)}function q(I,f,p,$){return ye(J(f,I.length-p),I,p,$)}o.prototype.write=function(f,p,$,X){if(p===void 0)X="utf8",$=this.length,p=0;else if($===void 0&&typeof p=="string")X=p,$=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite($)?($=$>>>0,X===void 0&&(X="utf8")):(X=$,$=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const oe=this.length-p;if(($===void 0||$>oe)&&($=oe),f.length>0&&($<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");X||(X="utf8");let de=!1;for(;;)switch(X){case"hex":return A(this,f,p,$);case"utf8":case"utf-8":return B(this,f,p,$);case"ascii":case"latin1":case"binary":return R(this,f,p,$);case"base64":return F(this,f,p,$);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return q(this,f,p,$);default:if(de)throw new TypeError("Unknown encoding: "+X);X=(""+X).toLowerCase(),de=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function D(I,f,p){return f===0&&p===I.length?e.fromByteArray(I):e.fromByteArray(I.slice(f,p))}function L(I,f,p){p=Math.min(I.length,p);const $=[];let X=f;for(;X<p;){const oe=I[X];let de=null,Ee=oe>239?4:oe>223?3:oe>191?2:1;if(X+Ee<=p){let ke,Le,Oe,De;switch(Ee){case 1:oe<128&&(de=oe);break;case 2:ke=I[X+1],(ke&192)===128&&(De=(oe&31)<<6|ke&63,De>127&&(de=De));break;case 3:ke=I[X+1],Le=I[X+2],(ke&192)===128&&(Le&192)===128&&(De=(oe&15)<<12|(ke&63)<<6|Le&63,De>2047&&(De<55296||De>57343)&&(de=De));break;case 4:ke=I[X+1],Le=I[X+2],Oe=I[X+3],(ke&192)===128&&(Le&192)===128&&(Oe&192)===128&&(De=(oe&15)<<18|(ke&63)<<12|(Le&63)<<6|Oe&63,De>65535&&De<1114112&&(de=De))}}de===null?(de=65533,Ee=1):de>65535&&(de-=65536,$.push(de>>>10&1023|55296),de=56320|de&1023),$.push(de),X+=Ee}return T($)}const te=4096;function T(I){const f=I.length;if(f<=te)return String.fromCharCode.apply(String,I);let p="",$=0;for(;$<f;)p+=String.fromCharCode.apply(String,I.slice($,$+=te));return p}function Z(I,f,p){let $="";p=Math.min(I.length,p);for(let X=f;X<p;++X)$+=String.fromCharCode(I[X]&127);return $}function k(I,f,p){let $="";p=Math.min(I.length,p);for(let X=f;X<p;++X)$+=String.fromCharCode(I[X]);return $}function Y(I,f,p){const $=I.length;(!f||f<0)&&(f=0),(!p||p<0||p>$)&&(p=$);let X="";for(let oe=f;oe<p;++oe)X+=ze[I[oe]];return X}function w(I,f,p){const $=I.slice(f,p);let X="";for(let oe=0;oe<$.length-1;oe+=2)X+=String.fromCharCode($[oe]+$[oe+1]*256);return X}o.prototype.slice=function(f,p){const $=this.length;f=~~f,p=p===void 0?$:~~p,f<0?(f+=$,f<0&&(f=0)):f>$&&(f=$),p<0?(p+=$,p<0&&(p=0)):p>$&&(p=$),p<f&&(p=f);const X=this.subarray(f,p);return Object.setPrototypeOf(X,o.prototype),X};function H(I,f,p){if(I%1!==0||I<0)throw new RangeError("offset is not uint");if(I+f>p)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(f,p,$){f=f>>>0,p=p>>>0,$||H(f,p,this.length);let X=this[f],oe=1,de=0;for(;++de<p&&(oe*=256);)X+=this[f+de]*oe;return X},o.prototype.readUintBE=o.prototype.readUIntBE=function(f,p,$){f=f>>>0,p=p>>>0,$||H(f,p,this.length);let X=this[f+--p],oe=1;for(;p>0&&(oe*=256);)X+=this[f+--p]*oe;return X},o.prototype.readUint8=o.prototype.readUInt8=function(f,p){return f=f>>>0,p||H(f,1,this.length),this[f]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(f,p){return f=f>>>0,p||H(f,2,this.length),this[f]|this[f+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(f,p){return f=f>>>0,p||H(f,2,this.length),this[f]<<8|this[f+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(f,p){return f=f>>>0,p||H(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(f,p){return f=f>>>0,p||H(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},o.prototype.readBigUInt64LE=Ie(function(f){f=f>>>0,j(f,"offset");const p=this[f],$=this[f+7];(p===void 0||$===void 0)&&W(f,this.length-8);const X=p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,oe=this[++f]+this[++f]*2**8+this[++f]*2**16+$*2**24;return BigInt(X)+(BigInt(oe)<<BigInt(32))}),o.prototype.readBigUInt64BE=Ie(function(f){f=f>>>0,j(f,"offset");const p=this[f],$=this[f+7];(p===void 0||$===void 0)&&W(f,this.length-8);const X=p*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],oe=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+$;return(BigInt(X)<<BigInt(32))+BigInt(oe)}),o.prototype.readIntLE=function(f,p,$){f=f>>>0,p=p>>>0,$||H(f,p,this.length);let X=this[f],oe=1,de=0;for(;++de<p&&(oe*=256);)X+=this[f+de]*oe;return oe*=128,X>=oe&&(X-=Math.pow(2,8*p)),X},o.prototype.readIntBE=function(f,p,$){f=f>>>0,p=p>>>0,$||H(f,p,this.length);let X=p,oe=1,de=this[f+--X];for(;X>0&&(oe*=256);)de+=this[f+--X]*oe;return oe*=128,de>=oe&&(de-=Math.pow(2,8*p)),de},o.prototype.readInt8=function(f,p){return f=f>>>0,p||H(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},o.prototype.readInt16LE=function(f,p){f=f>>>0,p||H(f,2,this.length);const $=this[f]|this[f+1]<<8;return $&32768?$|4294901760:$},o.prototype.readInt16BE=function(f,p){f=f>>>0,p||H(f,2,this.length);const $=this[f+1]|this[f]<<8;return $&32768?$|4294901760:$},o.prototype.readInt32LE=function(f,p){return f=f>>>0,p||H(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},o.prototype.readInt32BE=function(f,p){return f=f>>>0,p||H(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},o.prototype.readBigInt64LE=Ie(function(f){f=f>>>0,j(f,"offset");const p=this[f],$=this[f+7];(p===void 0||$===void 0)&&W(f,this.length-8);const X=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+($<<24);return(BigInt(X)<<BigInt(32))+BigInt(p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),o.prototype.readBigInt64BE=Ie(function(f){f=f>>>0,j(f,"offset");const p=this[f],$=this[f+7];(p===void 0||$===void 0)&&W(f,this.length-8);const X=(p<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(X)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+$)}),o.prototype.readFloatLE=function(f,p){return f=f>>>0,p||H(f,4,this.length),t.read(this,f,!0,23,4)},o.prototype.readFloatBE=function(f,p){return f=f>>>0,p||H(f,4,this.length),t.read(this,f,!1,23,4)},o.prototype.readDoubleLE=function(f,p){return f=f>>>0,p||H(f,8,this.length),t.read(this,f,!0,52,8)},o.prototype.readDoubleBE=function(f,p){return f=f>>>0,p||H(f,8,this.length),t.read(this,f,!1,52,8)};function K(I,f,p,$,X,oe){if(!o.isBuffer(I))throw new TypeError('"buffer" argument must be a Buffer instance');if(f>X||f<oe)throw new RangeError('"value" argument is out of bounds');if(p+$>I.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(f,p,$,X){if(f=+f,p=p>>>0,$=$>>>0,!X){const Ee=Math.pow(2,8*$)-1;K(this,f,p,$,Ee,0)}let oe=1,de=0;for(this[p]=f&255;++de<$&&(oe*=256);)this[p+de]=f/oe&255;return p+$},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(f,p,$,X){if(f=+f,p=p>>>0,$=$>>>0,!X){const Ee=Math.pow(2,8*$)-1;K(this,f,p,$,Ee,0)}let oe=$-1,de=1;for(this[p+oe]=f&255;--oe>=0&&(de*=256);)this[p+oe]=f/de&255;return p+$},o.prototype.writeUint8=o.prototype.writeUInt8=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,1,255,0),this[p]=f&255,p+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,2,65535,0),this[p]=f&255,this[p+1]=f>>>8,p+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,2,65535,0),this[p]=f>>>8,this[p+1]=f&255,p+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,4,4294967295,0),this[p+3]=f>>>24,this[p+2]=f>>>16,this[p+1]=f>>>8,this[p]=f&255,p+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,4,4294967295,0),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4};function Q(I,f,p,$,X){ge(f,$,X,I,p,7);let oe=Number(f&BigInt(4294967295));I[p++]=oe,oe=oe>>8,I[p++]=oe,oe=oe>>8,I[p++]=oe,oe=oe>>8,I[p++]=oe;let de=Number(f>>BigInt(32)&BigInt(4294967295));return I[p++]=de,de=de>>8,I[p++]=de,de=de>>8,I[p++]=de,de=de>>8,I[p++]=de,p}function ue(I,f,p,$,X){ge(f,$,X,I,p,7);let oe=Number(f&BigInt(4294967295));I[p+7]=oe,oe=oe>>8,I[p+6]=oe,oe=oe>>8,I[p+5]=oe,oe=oe>>8,I[p+4]=oe;let de=Number(f>>BigInt(32)&BigInt(4294967295));return I[p+3]=de,de=de>>8,I[p+2]=de,de=de>>8,I[p+1]=de,de=de>>8,I[p]=de,p+8}o.prototype.writeBigUInt64LE=Ie(function(f,p=0){return Q(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Ie(function(f,p=0){return ue(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(f,p,$,X){if(f=+f,p=p>>>0,!X){const ke=Math.pow(2,8*$-1);K(this,f,p,$,ke-1,-ke)}let oe=0,de=1,Ee=0;for(this[p]=f&255;++oe<$&&(de*=256);)f<0&&Ee===0&&this[p+oe-1]!==0&&(Ee=1),this[p+oe]=(f/de>>0)-Ee&255;return p+$},o.prototype.writeIntBE=function(f,p,$,X){if(f=+f,p=p>>>0,!X){const ke=Math.pow(2,8*$-1);K(this,f,p,$,ke-1,-ke)}let oe=$-1,de=1,Ee=0;for(this[p+oe]=f&255;--oe>=0&&(de*=256);)f<0&&Ee===0&&this[p+oe+1]!==0&&(Ee=1),this[p+oe]=(f/de>>0)-Ee&255;return p+$},o.prototype.writeInt8=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,1,127,-128),f<0&&(f=255+f+1),this[p]=f&255,p+1},o.prototype.writeInt16LE=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,2,32767,-32768),this[p]=f&255,this[p+1]=f>>>8,p+2},o.prototype.writeInt16BE=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,2,32767,-32768),this[p]=f>>>8,this[p+1]=f&255,p+2},o.prototype.writeInt32LE=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,4,2147483647,-2147483648),this[p]=f&255,this[p+1]=f>>>8,this[p+2]=f>>>16,this[p+3]=f>>>24,p+4},o.prototype.writeInt32BE=function(f,p,$){return f=+f,p=p>>>0,$||K(this,f,p,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4},o.prototype.writeBigInt64LE=Ie(function(f,p=0){return Q(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Ie(function(f,p=0){return ue(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function V(I,f,p,$,X,oe){if(p+$>I.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function G(I,f,p,$,X){return f=+f,p=p>>>0,X||V(I,f,p,4),t.write(I,f,p,$,23,4),p+4}o.prototype.writeFloatLE=function(f,p,$){return G(this,f,p,!0,$)},o.prototype.writeFloatBE=function(f,p,$){return G(this,f,p,!1,$)};function z(I,f,p,$,X){return f=+f,p=p>>>0,X||V(I,f,p,8),t.write(I,f,p,$,52,8),p+8}o.prototype.writeDoubleLE=function(f,p,$){return z(this,f,p,!0,$)},o.prototype.writeDoubleBE=function(f,p,$){return z(this,f,p,!1,$)},o.prototype.copy=function(f,p,$,X){if(!o.isBuffer(f))throw new TypeError("argument should be a Buffer");if($||($=0),!X&&X!==0&&(X=this.length),p>=f.length&&(p=f.length),p||(p=0),X>0&&X<$&&(X=$),X===$||f.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if($<0||$>=this.length)throw new RangeError("Index out of range");if(X<0)throw new RangeError("sourceEnd out of bounds");X>this.length&&(X=this.length),f.length-p<X-$&&(X=f.length-p+$);const oe=X-$;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,$,X):Uint8Array.prototype.set.call(f,this.subarray($,X),p),oe},o.prototype.fill=function(f,p,$,X){if(typeof f=="string"){if(typeof p=="string"?(X=p,p=0,$=this.length):typeof $=="string"&&(X=$,$=this.length),X!==void 0&&typeof X!="string")throw new TypeError("encoding must be a string");if(typeof X=="string"&&!o.isEncoding(X))throw new TypeError("Unknown encoding: "+X);if(f.length===1){const de=f.charCodeAt(0);(X==="utf8"&&de<128||X==="latin1")&&(f=de)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(p<0||this.length<p||this.length<$)throw new RangeError("Out of range index");if($<=p)return this;p=p>>>0,$=$===void 0?this.length:$>>>0,f||(f=0);let oe;if(typeof f=="number")for(oe=p;oe<$;++oe)this[oe]=f;else{const de=o.isBuffer(f)?f:o.from(f,X),Ee=de.length;if(Ee===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(oe=0;oe<$-p;++oe)this[oe+p]=de[oe%Ee]}return this};const U={};function ee(I,f,p){U[I]=class extends p{constructor(){super(),Object.defineProperty(this,"message",{value:f.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${I}]`,this.stack,delete this.name}get code(){return I}set code(X){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:X,writable:!0})}toString(){return`${this.name} [${I}]: ${this.message}`}}}ee("ERR_BUFFER_OUT_OF_BOUNDS",function(I){return I?`${I} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),ee("ERR_INVALID_ARG_TYPE",function(I,f){return`The "${I}" argument must be of type number. Received type ${typeof f}`},TypeError),ee("ERR_OUT_OF_RANGE",function(I,f,p){let $=`The value of "${I}" is out of range.`,X=p;return Number.isInteger(p)&&Math.abs(p)>2**32?X=re(String(p)):typeof p=="bigint"&&(X=String(p),(p>BigInt(2)**BigInt(32)||p<-(BigInt(2)**BigInt(32)))&&(X=re(X)),X+="n"),$+=` It must be ${f}. Received ${X}`,$},RangeError);function re(I){let f="",p=I.length;const $=I[0]==="-"?1:0;for(;p>=$+4;p-=3)f=`_${I.slice(p-3,p)}${f}`;return`${I.slice(0,p)}${f}`}function fe(I,f,p){j(f,"offset"),(I[f]===void 0||I[f+p]===void 0)&&W(f,I.length-(p+1))}function ge(I,f,p,$,X,oe){if(I>p||I<f){const de=typeof f=="bigint"?"n":"";let Ee;throw f===0||f===BigInt(0)?Ee=`>= 0${de} and < 2${de} ** ${(oe+1)*8}${de}`:Ee=`>= -(2${de} ** ${(oe+1)*8-1}${de}) and < 2 ** ${(oe+1)*8-1}${de}`,new U.ERR_OUT_OF_RANGE("value",Ee,I)}fe($,X,oe)}function j(I,f){if(typeof I!="number")throw new U.ERR_INVALID_ARG_TYPE(f,"number",I)}function W(I,f,p){throw Math.floor(I)!==I?(j(I,p),new U.ERR_OUT_OF_RANGE("offset","an integer",I)):f<0?new U.ERR_BUFFER_OUT_OF_BOUNDS:new U.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${f}`,I)}const se=/[^+/0-9A-Za-z-_]/g;function he(I){if(I=I.split("=")[0],I=I.trim().replace(se,""),I.length<2)return"";for(;I.length%4!==0;)I=I+"=";return I}function pe(I,f){f=f||1/0;let p;const $=I.length;let X=null;const oe=[];for(let de=0;de<$;++de){if(p=I.charCodeAt(de),p>55295&&p<57344){if(!X){if(p>56319){(f-=3)>-1&&oe.push(239,191,189);continue}else if(de+1===$){(f-=3)>-1&&oe.push(239,191,189);continue}X=p;continue}if(p<56320){(f-=3)>-1&&oe.push(239,191,189),X=p;continue}p=(X-55296<<10|p-56320)+65536}else X&&(f-=3)>-1&&oe.push(239,191,189);if(X=null,p<128){if((f-=1)<0)break;oe.push(p)}else if(p<2048){if((f-=2)<0)break;oe.push(p>>6|192,p&63|128)}else if(p<65536){if((f-=3)<0)break;oe.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((f-=4)<0)break;oe.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return oe}function me(I){const f=[];for(let p=0;p<I.length;++p)f.push(I.charCodeAt(p)&255);return f}function J(I,f){let p,$,X;const oe=[];for(let de=0;de<I.length&&!((f-=2)<0);++de)p=I.charCodeAt(de),$=p>>8,X=p%256,oe.push(X),oe.push($);return oe}function ce(I){return e.toByteArray(he(I))}function ye(I,f,p,$){let X;for(X=0;X<$&&!(X+p>=f.length||X>=I.length);++X)f[X+p]=I[X];return X}function le(I,f){return I instanceof f||I!=null&&I.constructor!=null&&I.constructor.name!=null&&I.constructor.name===f.name}function Re(I){return I!==I}const ze=(function(){const I="0123456789abcdef",f=new Array(256);for(let p=0;p<16;++p){const $=p*16;for(let X=0;X<16;++X)f[$+X]=I[p]+I[X]}return f})();function Ie(I){return typeof BigInt>"u"?Xe:I}function Xe(){throw new Error("BigInt not supported")}})(xi)),xi}var dd=jt();const Vr="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Gr="http://www.w3.org/2001/XMLSchema#",Fn="http://www.w3.org/2000/10/swap/",Ke={xsd:{decimal:`${Gr}decimal`,boolean:`${Gr}boolean`,double:`${Gr}double`,integer:`${Gr}integer`,string:`${Gr}string`},rdf:{type:`${Vr}type`,nil:`${Vr}nil`,first:`${Vr}first`,rest:`${Vr}rest`,langString:`${Vr}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${Fn}reify#forSome`,forAll:`${Fn}reify#forAll`},log:{implies:`${Fn}log#implies`,isImpliedBy:`${Fn}log#isImpliedBy`}},{xsd:kn}=Ke,hd=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,no={"\\":"\\","'":"'",'"':'"',n:`
|
|
7
|
-
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},fd=/[\x00-\x20<>\\"\{\}\|\^\`]/,pd={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},gd=/$0^/;class md{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const t in this)!(t in pd)&&this[t]instanceof RegExp&&(this[t]=gd)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,i=n.length;for(;;){let o,u;for(;o=this._newline.exec(n);)this.comments&&(u=this._comment.exec(o[0]))&&s("comment",u[1],"",this._line,o[0].length),n=n.substr(o[0].length,n.length),i=n.length,this._line++;if(!o&&(o=this._whitespace.exec(n))&&(n=n.substr(o[0].length,n.length)),this._endOfFile.test(n))return t&&(this.comments&&(u=this._comment.exec(n))&&s("comment",u[1],"",this._line,n.length),n=null,s("eof","","",this._line,0)),this._input=n;const l=this._line,c=n[0];let d="",b="",y="",_=null,E=0,v=!1;switch(c){case"^":if(n.length<3)break;if(n[1]==="^"){if(this._previousMarker="^^",n=n.substr(2),n[0]!=="<"){v=!0;break}}else{this._n3Mode&&(E=1,d="^");break}case"<":if(_=this._unescapedIri.exec(n))d="IRI",b=_[1];else if(_=this._iri.exec(n)){if(b=this._unescape(_[1]),b===null||fd.test(b))return a(this);d="IRI"}else n.length>1&&n[1]==="<"?(d="<<",E=2):this._n3Mode&&n.length>1&&n[1]==="="&&(E=2,this._isImpliedBy?(d="abbreviation",b="<"):(d="inverse",b=">"));break;case">":n.length>1&&n[1]===">"&&(d=">>",E=2);break;case"_":((_=this._blank.exec(n))||t&&(_=this._blank.exec(`${n} `)))&&(d="blank",y="_",b=_[1]);break;case'"':if(_=this._simpleQuotedString.exec(n))b=_[1];else if({value:b,matchLength:E}=this._parseLiteral(n),b===null)return a(this);(_!==null||E!==0)&&(d="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(_=this._simpleApostropheString.exec(n))b=_[1];else if({value:b,matchLength:E}=this._parseLiteral(n),b===null)return a(this);(_!==null||E!==0)&&(d="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(_=this._variable.exec(n))&&(d="var",b=_[0]);break;case"@":this._previousMarker==="literal"&&(_=this._langcode.exec(n))?(d="langcode",b=_[1]):(_=this._keyword.exec(n))&&(d=_[0]);break;case".":if(n.length===1?t:n[1]<"0"||n[1]>"9"){d=".",E=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(_=this._number.exec(n)||t&&(_=this._number.exec(`${n} `)))&&(d="literal",b=_[0],y=typeof _[1]=="string"?kn.double:typeof _[2]=="string"?kn.decimal:kn.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(_=this._sparqlKeyword.exec(n))?d=_[0].toUpperCase():v=!0;break;case"f":case"t":(_=this._boolean.exec(n))?(d="literal",b=_[0],y=kn.boolean):v=!0;break;case"a":(_=this._shortPredicates.exec(n))?(d="abbreviation",b="a"):v=!0;break;case"=":this._n3Mode&&n.length>1&&(d="abbreviation",n[1]!==">"?(E=1,b="="):(E=2,b=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(E=1,d=c);break;case"{":!this._lineMode&&n.length>=2&&(n[1]==="|"?(d="{|",E=2):(d=c,E=1));break;case"|":n.length>=2&&n[1]==="}"&&(d="|}",E=2);break;default:v=!0}if(v&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(_=this._prefix.exec(n))?(d="prefix",b=_[1]||""):((_=this._prefixed.exec(n))||t&&(_=this._prefixed.exec(`${n} `)))&&(d="prefixed",y=_[1]||"",b=this._unescape(_[2]))),this._previousMarker==="^^")switch(d){case"prefixed":d="type";break;case"IRI":d="typeIRI";break;default:d=""}if(!d)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?a(this):this._input=n;const x=E||_[0].length,S=s(d,b,y,l,x);this.previousToken=S,this._previousMarker=d,n=n.substr(x,n.length)}function s(o,u,l,c,d){const b=n?i-n.length:i,y=b+d,_={type:o,value:u,prefix:l,line:c,start:b,end:y};return e(null,_),_}function a(o){e(o._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(hd,(i,s,a,o)=>{if(typeof s=="string")return String.fromCharCode(Number.parseInt(s,16));if(typeof a=="string"){let u=Number.parseInt(a,16);return u<=65535?String.fromCharCode(Number.parseInt(a,16)):String.fromCharCode(55296+((u-=65536)>>10),56320+(u&1023))}return o in no?no[o]:(t=!0,"")});return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let i=Math.max(this._literalClosingPos,n);for(;(i=e.indexOf(t,i))>0;){let s=0;for(;e[i-s-1]==="\\";)s++;if(s%2===0){const a=e.substring(n,i),o=a.split(/\r\n|\r|\n/).length-1,u=i+n;if(n===1&&o!==0||n===3&&this._lineMode)break;return this._line+=o,{value:this._unescape(a),matchLength:u}}i++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof t=="function")queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{const n=[];let i;if(this._tokenizeToEnd((s,a)=>s?i=s:n.push(a),!0),i)throw i;return n}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",n=>{this._input!==null&&n.length!==0&&(this._pendingBuffer&&(n=dd.Buffer.concat([this._pendingBuffer,n]),this._pendingBuffer=null),n[n.length-1]&128?this._pendingBuffer=n:(typeof this._input>"u"?this._input=this._readStartingBom(typeof n=="string"?n:n.toString()):this._input+=n,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}}const{rdf:yd,xsd:ar}=Ke;let jr,bd=0;const Ne={namedNode:Ku,blankNode:Yu,variable:ec,literal:Zu,defaultGraph:xd,quad:la,triple:la,fromTerm:fn,fromQuad:tc};class wt{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof wt?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}let Nr=class extends wt{get termType(){return"NamedNode"}},_t=class Ju extends wt{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&e[t++]==="@"?e.substr(t).toLowerCase():""}get datatype(){return new Nr(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,n=t<e.length?e[t]:"";return n==="^"?e.substr(t+2):n!=="@"?ar.string:yd.langString}equals(e){return e instanceof Ju?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},_d=class extends wt{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},wd=class extends wt{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},vd=class extends wt{constructor(){return super(""),jr||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};jr=new vd;function hn(r,e,t){if(e=e||Ne,!r)return e.defaultGraph();switch(r[0]){case"?":return e.variable(r.substr(1));case"_":return e.blankNode(r.substr(2));case'"':if(e===Ne)return new _t(r);if(r[r.length-1]==='"')return e.literal(r.substr(1,r.length-2));const n=r.lastIndexOf('"',r.length-1);return e.literal(r.substr(1,n-1),r[n+1]==="@"?r.substr(n+2):e.namedNode(r.substr(n+3)));case"[":r=JSON.parse(r);break;default:if(!t||!Array.isArray(r))return e.namedNode(r)}return e.quad(hn(r[0],e,!0),hn(r[1],e,!0),hn(r[2],e,!0),r[3]&&hn(r[3],e,!0))}function Ir(r,e){if(typeof r=="string")return r;if(r instanceof wt&&r.termType!=="Quad")return r.id;if(!r)return jr.id;switch(r.termType){case"NamedNode":return r.value;case"BlankNode":return`_:${r.value}`;case"Variable":return`?${r.value}`;case"DefaultGraph":return"";case"Literal":return`"${r.value}"${r.language?`@${r.language}`:r.datatype&&r.datatype.value!==ar.string?`^^${r.datatype.value}`:""}`;case"Quad":const t=[Ir(r.subject,!0),Ir(r.predicate,!0),Ir(r.object,!0)];return r.graph&&r.graph.termType!=="DefaultGraph"&&t.push(Ir(r.graph,!0)),e?t:JSON.stringify(t);default:throw new Error(`Unexpected termType: ${r.termType}`)}}let ui=class extends wt{constructor(e,t,n,i){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=i||jr}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 Ku(r){return new Nr(r)}function Yu(r){return new _d(r||`n3-${bd++}`)}function Zu(r,e){if(typeof e=="string")return new _t(`"${r}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof r=="boolean"?t=ar.boolean:typeof r=="number"&&(Number.isFinite(r)?t=Number.isInteger(r)?ar.integer:ar.double:(t=ar.double,Number.isNaN(r)||(r=r>0?"INF":"-INF")))),t===""||t===ar.string?new _t(`"${r}"`):new _t(`"${r}"^^${t}`)}function ec(r){return new wd(r)}function xd(){return jr}function la(r,e,t,n){return new ui(r,e,t,n)}function fn(r){if(r instanceof wt)return r;switch(r.termType){case"NamedNode":return Ku(r.value);case"BlankNode":return Yu(r.value);case"Variable":return ec(r.value);case"DefaultGraph":return jr;case"Literal":return Zu(r.value,r.language||r.datatype);case"Quad":return tc(r);default:throw new Error(`Unexpected termType: ${r.termType}`)}}function tc(r){if(r instanceof ui)return r;if(r.termType!=="Quad")throw new Error(`Unexpected termType: ${r.termType}`);return la(fn(r.subject),fn(r.predicate),fn(r.object),fn(r.graph))}let io=0;class rc{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&nc(this,e.factory);const t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),i=/trig/.test(t),s=/triple/.test(t),a=/quad/.test(t),o=this._n3Mode=/n3/.test(t),u=s||a;(this._supportsNamedGraphs=!(n||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||s||o),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=t===""||/star|\*$/.test(t),u&&(this._resolveRelativeIRI=l=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new md({lineMode:u,n3:o,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){io=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,t,n,i,s){const a=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:i,object:s,graph:t,inverse:a?this._inversePredicate:!1,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case"IRI":case"typeIRI":const i=this._resolveIRI(e.value);if(i===null)return this._error("Invalid IRI",e);n=this._factory.namedNode(i);break;case"type":case"prefixed":const s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._factory.namedNode(s+e.value);break;case"blank":n=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,i=this._readListItem;const s=this._subject,a=this._contextStack,o=a[a.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),a.length!==0&&a[a.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,i=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((t=this._readEntity(e))===void 0)return}if(n===null&&(this._subject=n=this._factory.blankNode()),s===null?o.predicate===null?o.subject=n:o.object=n:this._emit(s,this.RDF_REST,n,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return i}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const n=this._readEntity(e);if(n===void 0)return;t=this._factory.literal(this._literalValue,n),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),n.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const i=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,t=this._contextStack.length?this._readSubject:this._readInTopContext,s&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const a=this._predicate,o=this._object;this._subject=this._factory.quad(i,a,o,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(n=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(i!==null){const a=this._predicate,o=this._object;s?this._emit(o,a,i,n):this._emit(i,a,o,n)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&n.type==="item"){const i=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,i,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n;const i=this._factory.blankNode();if((n=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=i):(t=this._object,this._object=i),this._emit(t,n,i,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let n,i;if((n=this._readEntity(e))!==void 0)return this._predicate===null?(i=this._subject,this._subject=t):(i=this._object,this._object=t),this._emit(t,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,i){this._callback(null,this._factory.quad(e,t,n,i||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=Pn}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let n="",i=-1,s=-1,a=0,o="/";for(;i<t;){switch(o){case":":if(s<0&&e[++i]==="/"&&e[++i]==="/")for(;(s=i+1)<t&&e[s]!=="/";)i=s;break;case"?":case"#":i=t;break;case"/":if(e[i+1]===".")switch(o=e[++i+1],o){case"/":n+=e.substring(a,i-1),a=i+1;break;case void 0:case"?":case"#":return n+e.substring(a,i)+e.substr(i+1);case".":if(o=e[++i+1],o===void 0||o==="/"||o==="?"||o==="#"){if(n+=e.substring(a,i-2),(a=n.lastIndexOf("/"))>=s&&(n=n.substr(0,a)),o!=="/")return`${n}/${e.substr(i+1)}`;a=i+1}}}o=e[++i]}return n+e.substring(a)}parse(e,t,n){let i,s,a;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(i=t.onQuad,s=t.onPrefix,a=t.onComment):(i=t,s=n),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${io++}_`,this._prefixCallback=s||Pn,this._inversePredicate=!1,this._quantified=Object.create(null),!i){const u=[];let l;if(this._callback=(c,d)=>{c?l=c:d&&u.push(d)},this._lexer.tokenize(e).every(c=>this._readCallback=this._readCallback(c)),l)throw l;return u}let o=(u,l)=>{u!==null?(this._callback(u),this._callback=Pn):this._readCallback&&(this._readCallback=this._readCallback(l))};a&&(this._lexer.comments=!0,o=(u,l)=>{u!==null?(this._callback(u),this._callback=Pn):this._readCallback&&(l.type==="comment"?a(l.value):this._readCallback=this._readCallback(l))}),this._callback=i,this._lexer.tokenize(e,o)}}function Pn(){}function nc(r,e){r._factory=e,r.DEFAULTGRAPH=e.defaultGraph(),r.RDF_FIRST=e.namedNode(Ke.rdf.first),r.RDF_REST=e.namedNode(Ke.rdf.rest),r.RDF_NIL=e.namedNode(Ke.rdf.nil),r.N3_FORALL=e.namedNode(Ke.r.forAll),r.N3_FORSOME=e.namedNode(Ke.r.forSome),r.ABBREVIATIONS={a:e.namedNode(Ke.rdf.type),"=":e.namedNode(Ke.owl.sameAs),">":e.namedNode(Ke.log.implies),"<":e.namedNode(Ke.log.isImpliedBy)},r.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}nc(rc.prototype,Ne);function ua(r){return!!r&&r.termType==="DefaultGraph"}function zn(r){return r.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const Ed=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Sd=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,so="./",Id="../",Ei="?",ao="#";class wa{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Ed.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!wa.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",zn(e)],n=[],i=[],s=/[^/?#]*([/?#])/y;let a,o=0,u=0,l=s.lastIndex=e.length;for(;!o&&!u&&(a=s.exec(this.base));)a[1]===ao?u=s.lastIndex-1:(t.push(zn(a[0]),"(?:"),n.push(")?"),a[1]!==Ei?i.push(l=s.lastIndex):(o=l=s.lastIndex,u=this.base.indexOf(ao,o),this._pathReplacements[o]=Ei));for(let c=0;c<i.length;c++)this._pathReplacements[i[c]]=Id.repeat(i.length-c-1);return this._pathReplacements[i[i.length-1]]=so,this._baseLength=u>0?u:this.base.length,t.push(zn(this.base.substring(l,this._baseLength)),o?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...n].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const n=t[0].length;if(n===this._baseLength&&n===e.length)return"";const i=this._pathReplacements[n];if(i){const s=e.substring(n);return i!==Ei&&!Sd.test(s)?e:i===so&&/^[^?#]/.test(s)?s:i+s}return e.substring(n-1)}}const Wr=Ne.defaultGraph(),{rdf:Nd,xsd:wr}=Ke,oo=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,lo=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Rd={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class zr extends wt{equals(e){return e===this}}class va{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0?!0:!!t.end;else{let n="";this._outputStream={write(i,s,a){n+=i,a&&a()},end:i=>{i&&i(null,n)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=Wr,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new wa(t.baseIRI)))}get _inDefaultGraph(){return Wr.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,n,i,s){try{i.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
6
|
+
*/var Ju;function Ti(){return Ju||(Ju=1,(function(n){const e=ig(),i=ng(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;n.Buffer=u,n.SlowBuffer=R,n.INSPECT_MAX_BYTES=50;const o=2147483647;n.kMaxLength=o,u.TYPED_ARRAY_SUPPORT=a(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const M=new Uint8Array(1),v={foo:function(){return 42}};return Object.setPrototypeOf(v,Uint8Array.prototype),Object.setPrototypeOf(M,v),M.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function l(M){if(M>o)throw new RangeError('The value "'+M+'" is invalid for option "size"');const v=new Uint8Array(M);return Object.setPrototypeOf(v,u.prototype),v}function u(M,v,w){if(typeof M=="number"){if(typeof v=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(M)}return f(M,v,w)}u.poolSize=8192;function f(M,v,w){if(typeof M=="string")return h(M,v);if(ArrayBuffer.isView(M))return b(M);if(M==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M);if(xe(M,ArrayBuffer)||M&&xe(M.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xe(M,SharedArrayBuffer)||M&&xe(M.buffer,SharedArrayBuffer)))return T(M,v,w);if(typeof M=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=M.valueOf&&M.valueOf();if(H!=null&&H!==M)return u.from(H,v,w);const le=A(M);if(le)return le;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof M[Symbol.toPrimitive]=="function")return u.from(M[Symbol.toPrimitive]("string"),v,w);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof M)}u.from=function(M,v,w){return f(M,v,w)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function d(M){if(typeof M!="number")throw new TypeError('"size" argument must be of type number');if(M<0)throw new RangeError('The value "'+M+'" is invalid for option "size"')}function g(M,v,w){return d(M),M<=0?l(M):v!==void 0?typeof w=="string"?l(M).fill(v,w):l(M).fill(v):l(M)}u.alloc=function(M,v,w){return g(M,v,w)};function _(M){return d(M),l(M<0?0:N(M)|0)}u.allocUnsafe=function(M){return _(M)},u.allocUnsafeSlow=function(M){return _(M)};function h(M,v){if((typeof v!="string"||v==="")&&(v="utf8"),!u.isEncoding(v))throw new TypeError("Unknown encoding: "+v);const w=S(M,v)|0;let H=l(w);const le=H.write(M,v);return le!==w&&(H=H.slice(0,le)),H}function m(M){const v=M.length<0?0:N(M.length)|0,w=l(v);for(let H=0;H<v;H+=1)w[H]=M[H]&255;return w}function b(M){if(xe(M,Uint8Array)){const v=new Uint8Array(M);return T(v.buffer,v.byteOffset,v.byteLength)}return m(M)}function T(M,v,w){if(v<0||M.byteLength<v)throw new RangeError('"offset" is outside of buffer bounds');if(M.byteLength<v+(w||0))throw new RangeError('"length" is outside of buffer bounds');let H;return v===void 0&&w===void 0?H=new Uint8Array(M):w===void 0?H=new Uint8Array(M,v):H=new Uint8Array(M,v,w),Object.setPrototypeOf(H,u.prototype),H}function A(M){if(u.isBuffer(M)){const v=N(M.length)|0,w=l(v);return w.length===0||M.copy(w,0,0,v),w}if(M.length!==void 0)return typeof M.length!="number"||ke(M.length)?l(0):m(M);if(M.type==="Buffer"&&Array.isArray(M.data))return m(M.data)}function N(M){if(M>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return M|0}function R(M){return+M!=M&&(M=0),u.alloc(+M)}u.isBuffer=function(v){return v!=null&&v._isBuffer===!0&&v!==u.prototype},u.compare=function(v,w){if(xe(v,Uint8Array)&&(v=u.from(v,v.offset,v.byteLength)),xe(w,Uint8Array)&&(w=u.from(w,w.offset,w.byteLength)),!u.isBuffer(v)||!u.isBuffer(w))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(v===w)return 0;let H=v.length,le=w.length;for(let pe=0,be=Math.min(H,le);pe<be;++pe)if(v[pe]!==w[pe]){H=v[pe],le=w[pe];break}return H<le?-1:le<H?1:0},u.isEncoding=function(v){switch(String(v).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}},u.concat=function(v,w){if(!Array.isArray(v))throw new TypeError('"list" argument must be an Array of Buffers');if(v.length===0)return u.alloc(0);let H;if(w===void 0)for(w=0,H=0;H<v.length;++H)w+=v[H].length;const le=u.allocUnsafe(w);let pe=0;for(H=0;H<v.length;++H){let be=v[H];if(xe(be,Uint8Array))pe+be.length>le.length?(u.isBuffer(be)||(be=u.from(be)),be.copy(le,pe)):Uint8Array.prototype.set.call(le,be,pe);else if(u.isBuffer(be))be.copy(le,pe);else throw new TypeError('"list" argument must be an Array of Buffers');pe+=be.length}return le};function S(M,v){if(u.isBuffer(M))return M.length;if(ArrayBuffer.isView(M)||xe(M,ArrayBuffer))return M.byteLength;if(typeof M!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof M);const w=M.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&w===0)return 0;let le=!1;for(;;)switch(v){case"ascii":case"latin1":case"binary":return w;case"utf8":case"utf-8":return Se(M).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w*2;case"hex":return w>>>1;case"base64":return ve(M).length;default:if(le)return H?-1:Se(M).length;v=(""+v).toLowerCase(),le=!0}}u.byteLength=S;function y(M,v,w){let H=!1;if((v===void 0||v<0)&&(v=0),v>this.length||((w===void 0||w>this.length)&&(w=this.length),w<=0)||(w>>>=0,v>>>=0,w<=v))return"";for(M||(M="utf8");;)switch(M){case"hex":return ae(this,v,w);case"utf8":case"utf-8":return $(this,v,w);case"ascii":return se(this,v,w);case"latin1":case"binary":return j(this,v,w);case"base64":return F(this,v,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,v,w);default:if(H)throw new TypeError("Unknown encoding: "+M);M=(M+"").toLowerCase(),H=!0}}u.prototype._isBuffer=!0;function x(M,v,w){const H=M[v];M[v]=M[w],M[w]=H}u.prototype.swap16=function(){const v=this.length;if(v%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let w=0;w<v;w+=2)x(this,w,w+1);return this},u.prototype.swap32=function(){const v=this.length;if(v%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let w=0;w<v;w+=4)x(this,w,w+3),x(this,w+1,w+2);return this},u.prototype.swap64=function(){const v=this.length;if(v%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let w=0;w<v;w+=8)x(this,w,w+7),x(this,w+1,w+6),x(this,w+2,w+5),x(this,w+3,w+4);return this},u.prototype.toString=function(){const v=this.length;return v===0?"":arguments.length===0?$(this,0,v):y.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(v){if(!u.isBuffer(v))throw new TypeError("Argument must be a Buffer");return this===v?!0:u.compare(this,v)===0},u.prototype.inspect=function(){let v="";const w=n.INSPECT_MAX_BYTES;return v=this.toString("hex",0,w).replace(/(.{2})/g,"$1 ").trim(),this.length>w&&(v+=" ... "),"<Buffer "+v+">"},r&&(u.prototype[r]=u.prototype.inspect),u.prototype.compare=function(v,w,H,le,pe){if(xe(v,Uint8Array)&&(v=u.from(v,v.offset,v.byteLength)),!u.isBuffer(v))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof v);if(w===void 0&&(w=0),H===void 0&&(H=v?v.length:0),le===void 0&&(le=0),pe===void 0&&(pe=this.length),w<0||H>v.length||le<0||pe>this.length)throw new RangeError("out of range index");if(le>=pe&&w>=H)return 0;if(le>=pe)return-1;if(w>=H)return 1;if(w>>>=0,H>>>=0,le>>>=0,pe>>>=0,this===v)return 0;let be=pe-le,Oe=H-w;const Ye=Math.min(be,Oe),Je=this.slice(le,pe),Ge=v.slice(w,H);for(let Ze=0;Ze<Ye;++Ze)if(Je[Ze]!==Ge[Ze]){be=Je[Ze],Oe=Ge[Ze];break}return be<Oe?-1:Oe<be?1:0};function P(M,v,w,H,le){if(M.length===0)return-1;if(typeof w=="string"?(H=w,w=0):w>2147483647?w=2147483647:w<-2147483648&&(w=-2147483648),w=+w,ke(w)&&(w=le?0:M.length-1),w<0&&(w=M.length+w),w>=M.length){if(le)return-1;w=M.length-1}else if(w<0)if(le)w=0;else return-1;if(typeof v=="string"&&(v=u.from(v,H)),u.isBuffer(v))return v.length===0?-1:B(M,v,w,H,le);if(typeof v=="number")return v=v&255,typeof Uint8Array.prototype.indexOf=="function"?le?Uint8Array.prototype.indexOf.call(M,v,w):Uint8Array.prototype.lastIndexOf.call(M,v,w):B(M,[v],w,H,le);throw new TypeError("val must be string, number or Buffer")}function B(M,v,w,H,le){let pe=1,be=M.length,Oe=v.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(M.length<2||v.length<2)return-1;pe=2,be/=2,Oe/=2,w/=2}function Ye(Ge,Ze){return pe===1?Ge[Ze]:Ge.readUInt16BE(Ze*pe)}let Je;if(le){let Ge=-1;for(Je=w;Je<be;Je++)if(Ye(M,Je)===Ye(v,Ge===-1?0:Je-Ge)){if(Ge===-1&&(Ge=Je),Je-Ge+1===Oe)return Ge*pe}else Ge!==-1&&(Je-=Je-Ge),Ge=-1}else for(w+Oe>be&&(w=be-Oe),Je=w;Je>=0;Je--){let Ge=!0;for(let Ze=0;Ze<Oe;Ze++)if(Ye(M,Je+Ze)!==Ye(v,Ze)){Ge=!1;break}if(Ge)return Je}return-1}u.prototype.includes=function(v,w,H){return this.indexOf(v,w,H)!==-1},u.prototype.indexOf=function(v,w,H){return P(this,v,w,H,!0)},u.prototype.lastIndexOf=function(v,w,H){return P(this,v,w,H,!1)};function O(M,v,w,H){w=Number(w)||0;const le=M.length-w;H?(H=Number(H),H>le&&(H=le)):H=le;const pe=v.length;H>pe/2&&(H=pe/2);let be;for(be=0;be<H;++be){const Oe=parseInt(v.substr(be*2,2),16);if(ke(Oe))return be;M[w+be]=Oe}return be}function J(M,v,w,H){return Ne(Se(v,M.length-w),M,w,H)}function k(M,v,w,H){return Ne(Ie(v),M,w,H)}function q(M,v,w,H){return Ne(ve(v),M,w,H)}function X(M,v,w,H){return Ne(re(v,M.length-w),M,w,H)}u.prototype.write=function(v,w,H,le){if(w===void 0)le="utf8",H=this.length,w=0;else if(H===void 0&&typeof w=="string")le=w,H=this.length,w=0;else if(isFinite(w))w=w>>>0,isFinite(H)?(H=H>>>0,le===void 0&&(le="utf8")):(le=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const pe=this.length-w;if((H===void 0||H>pe)&&(H=pe),v.length>0&&(H<0||w<0)||w>this.length)throw new RangeError("Attempt to write outside buffer bounds");le||(le="utf8");let be=!1;for(;;)switch(le){case"hex":return O(this,v,w,H);case"utf8":case"utf-8":return J(this,v,w,H);case"ascii":case"latin1":case"binary":return k(this,v,w,H);case"base64":return q(this,v,w,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return X(this,v,w,H);default:if(be)throw new TypeError("Unknown encoding: "+le);le=(""+le).toLowerCase(),be=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function F(M,v,w){return v===0&&w===M.length?e.fromByteArray(M):e.fromByteArray(M.slice(v,w))}function $(M,v,w){w=Math.min(M.length,w);const H=[];let le=v;for(;le<w;){const pe=M[le];let be=null,Oe=pe>239?4:pe>223?3:pe>191?2:1;if(le+Oe<=w){let Ye,Je,Ge,Ze;switch(Oe){case 1:pe<128&&(be=pe);break;case 2:Ye=M[le+1],(Ye&192)===128&&(Ze=(pe&31)<<6|Ye&63,Ze>127&&(be=Ze));break;case 3:Ye=M[le+1],Je=M[le+2],(Ye&192)===128&&(Je&192)===128&&(Ze=(pe&15)<<12|(Ye&63)<<6|Je&63,Ze>2047&&(Ze<55296||Ze>57343)&&(be=Ze));break;case 4:Ye=M[le+1],Je=M[le+2],Ge=M[le+3],(Ye&192)===128&&(Je&192)===128&&(Ge&192)===128&&(Ze=(pe&15)<<18|(Ye&63)<<12|(Je&63)<<6|Ge&63,Ze>65535&&Ze<1114112&&(be=Ze))}}be===null?(be=65533,Oe=1):be>65535&&(be-=65536,H.push(be>>>10&1023|55296),be=56320|be&1023),H.push(be),le+=Oe}return D(H)}const ue=4096;function D(M){const v=M.length;if(v<=ue)return String.fromCharCode.apply(String,M);let w="",H=0;for(;H<v;)w+=String.fromCharCode.apply(String,M.slice(H,H+=ue));return w}function se(M,v,w){let H="";w=Math.min(M.length,w);for(let le=v;le<w;++le)H+=String.fromCharCode(M[le]&127);return H}function j(M,v,w){let H="";w=Math.min(M.length,w);for(let le=v;le<w;++le)H+=String.fromCharCode(M[le]);return H}function ae(M,v,w){const H=M.length;(!v||v<0)&&(v=0),(!w||w<0||w>H)&&(w=H);let le="";for(let pe=v;pe<w;++pe)le+=lt[M[pe]];return le}function I(M,v,w){const H=M.slice(v,w);let le="";for(let pe=0;pe<H.length-1;pe+=2)le+=String.fromCharCode(H[pe]+H[pe+1]*256);return le}u.prototype.slice=function(v,w){const H=this.length;v=~~v,w=w===void 0?H:~~w,v<0?(v+=H,v<0&&(v=0)):v>H&&(v=H),w<0?(w+=H,w<0&&(w=0)):w>H&&(w=H),w<v&&(w=v);const le=this.subarray(v,w);return Object.setPrototypeOf(le,u.prototype),le};function Z(M,v,w){if(M%1!==0||M<0)throw new RangeError("offset is not uint");if(M+v>w)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUintLE=u.prototype.readUIntLE=function(v,w,H){v=v>>>0,w=w>>>0,H||Z(v,w,this.length);let le=this[v],pe=1,be=0;for(;++be<w&&(pe*=256);)le+=this[v+be]*pe;return le},u.prototype.readUintBE=u.prototype.readUIntBE=function(v,w,H){v=v>>>0,w=w>>>0,H||Z(v,w,this.length);let le=this[v+--w],pe=1;for(;w>0&&(pe*=256);)le+=this[v+--w]*pe;return le},u.prototype.readUint8=u.prototype.readUInt8=function(v,w){return v=v>>>0,w||Z(v,1,this.length),this[v]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(v,w){return v=v>>>0,w||Z(v,2,this.length),this[v]|this[v+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(v,w){return v=v>>>0,w||Z(v,2,this.length),this[v]<<8|this[v+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),(this[v]|this[v+1]<<8|this[v+2]<<16)+this[v+3]*16777216},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),this[v]*16777216+(this[v+1]<<16|this[v+2]<<8|this[v+3])},u.prototype.readBigUInt64LE=We(function(v){v=v>>>0,z(v,"offset");const w=this[v],H=this[v+7];(w===void 0||H===void 0)&&te(v,this.length-8);const le=w+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24,pe=this[++v]+this[++v]*2**8+this[++v]*2**16+H*2**24;return BigInt(le)+(BigInt(pe)<<BigInt(32))}),u.prototype.readBigUInt64BE=We(function(v){v=v>>>0,z(v,"offset");const w=this[v],H=this[v+7];(w===void 0||H===void 0)&&te(v,this.length-8);const le=w*2**24+this[++v]*2**16+this[++v]*2**8+this[++v],pe=this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+H;return(BigInt(le)<<BigInt(32))+BigInt(pe)}),u.prototype.readIntLE=function(v,w,H){v=v>>>0,w=w>>>0,H||Z(v,w,this.length);let le=this[v],pe=1,be=0;for(;++be<w&&(pe*=256);)le+=this[v+be]*pe;return pe*=128,le>=pe&&(le-=Math.pow(2,8*w)),le},u.prototype.readIntBE=function(v,w,H){v=v>>>0,w=w>>>0,H||Z(v,w,this.length);let le=w,pe=1,be=this[v+--le];for(;le>0&&(pe*=256);)be+=this[v+--le]*pe;return pe*=128,be>=pe&&(be-=Math.pow(2,8*w)),be},u.prototype.readInt8=function(v,w){return v=v>>>0,w||Z(v,1,this.length),this[v]&128?(255-this[v]+1)*-1:this[v]},u.prototype.readInt16LE=function(v,w){v=v>>>0,w||Z(v,2,this.length);const H=this[v]|this[v+1]<<8;return H&32768?H|4294901760:H},u.prototype.readInt16BE=function(v,w){v=v>>>0,w||Z(v,2,this.length);const H=this[v+1]|this[v]<<8;return H&32768?H|4294901760:H},u.prototype.readInt32LE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),this[v]|this[v+1]<<8|this[v+2]<<16|this[v+3]<<24},u.prototype.readInt32BE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),this[v]<<24|this[v+1]<<16|this[v+2]<<8|this[v+3]},u.prototype.readBigInt64LE=We(function(v){v=v>>>0,z(v,"offset");const w=this[v],H=this[v+7];(w===void 0||H===void 0)&&te(v,this.length-8);const le=this[v+4]+this[v+5]*2**8+this[v+6]*2**16+(H<<24);return(BigInt(le)<<BigInt(32))+BigInt(w+this[++v]*2**8+this[++v]*2**16+this[++v]*2**24)}),u.prototype.readBigInt64BE=We(function(v){v=v>>>0,z(v,"offset");const w=this[v],H=this[v+7];(w===void 0||H===void 0)&&te(v,this.length-8);const le=(w<<24)+this[++v]*2**16+this[++v]*2**8+this[++v];return(BigInt(le)<<BigInt(32))+BigInt(this[++v]*2**24+this[++v]*2**16+this[++v]*2**8+H)}),u.prototype.readFloatLE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),i.read(this,v,!0,23,4)},u.prototype.readFloatBE=function(v,w){return v=v>>>0,w||Z(v,4,this.length),i.read(this,v,!1,23,4)},u.prototype.readDoubleLE=function(v,w){return v=v>>>0,w||Z(v,8,this.length),i.read(this,v,!0,52,8)},u.prototype.readDoubleBE=function(v,w){return v=v>>>0,w||Z(v,8,this.length),i.read(this,v,!1,52,8)};function ne(M,v,w,H,le,pe){if(!u.isBuffer(M))throw new TypeError('"buffer" argument must be a Buffer instance');if(v>le||v<pe)throw new RangeError('"value" argument is out of bounds');if(w+H>M.length)throw new RangeError("Index out of range")}u.prototype.writeUintLE=u.prototype.writeUIntLE=function(v,w,H,le){if(v=+v,w=w>>>0,H=H>>>0,!le){const Oe=Math.pow(2,8*H)-1;ne(this,v,w,H,Oe,0)}let pe=1,be=0;for(this[w]=v&255;++be<H&&(pe*=256);)this[w+be]=v/pe&255;return w+H},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(v,w,H,le){if(v=+v,w=w>>>0,H=H>>>0,!le){const Oe=Math.pow(2,8*H)-1;ne(this,v,w,H,Oe,0)}let pe=H-1,be=1;for(this[w+pe]=v&255;--pe>=0&&(be*=256);)this[w+pe]=v/be&255;return w+H},u.prototype.writeUint8=u.prototype.writeUInt8=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,1,255,0),this[w]=v&255,w+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,2,65535,0),this[w]=v&255,this[w+1]=v>>>8,w+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,2,65535,0),this[w]=v>>>8,this[w+1]=v&255,w+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,4,4294967295,0),this[w+3]=v>>>24,this[w+2]=v>>>16,this[w+1]=v>>>8,this[w]=v&255,w+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,4,4294967295,0),this[w]=v>>>24,this[w+1]=v>>>16,this[w+2]=v>>>8,this[w+3]=v&255,w+4};function ee(M,v,w,H,le){Te(v,H,le,M,w,7);let pe=Number(v&BigInt(4294967295));M[w++]=pe,pe=pe>>8,M[w++]=pe,pe=pe>>8,M[w++]=pe,pe=pe>>8,M[w++]=pe;let be=Number(v>>BigInt(32)&BigInt(4294967295));return M[w++]=be,be=be>>8,M[w++]=be,be=be>>8,M[w++]=be,be=be>>8,M[w++]=be,w}function _e(M,v,w,H,le){Te(v,H,le,M,w,7);let pe=Number(v&BigInt(4294967295));M[w+7]=pe,pe=pe>>8,M[w+6]=pe,pe=pe>>8,M[w+5]=pe,pe=pe>>8,M[w+4]=pe;let be=Number(v>>BigInt(32)&BigInt(4294967295));return M[w+3]=be,be=be>>8,M[w+2]=be,be=be>>8,M[w+1]=be,be=be>>8,M[w]=be,w+8}u.prototype.writeBigUInt64LE=We(function(v,w=0){return ee(this,v,w,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=We(function(v,w=0){return _e(this,v,w,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(v,w,H,le){if(v=+v,w=w>>>0,!le){const Ye=Math.pow(2,8*H-1);ne(this,v,w,H,Ye-1,-Ye)}let pe=0,be=1,Oe=0;for(this[w]=v&255;++pe<H&&(be*=256);)v<0&&Oe===0&&this[w+pe-1]!==0&&(Oe=1),this[w+pe]=(v/be>>0)-Oe&255;return w+H},u.prototype.writeIntBE=function(v,w,H,le){if(v=+v,w=w>>>0,!le){const Ye=Math.pow(2,8*H-1);ne(this,v,w,H,Ye-1,-Ye)}let pe=H-1,be=1,Oe=0;for(this[w+pe]=v&255;--pe>=0&&(be*=256);)v<0&&Oe===0&&this[w+pe+1]!==0&&(Oe=1),this[w+pe]=(v/be>>0)-Oe&255;return w+H},u.prototype.writeInt8=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,1,127,-128),v<0&&(v=255+v+1),this[w]=v&255,w+1},u.prototype.writeInt16LE=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,2,32767,-32768),this[w]=v&255,this[w+1]=v>>>8,w+2},u.prototype.writeInt16BE=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,2,32767,-32768),this[w]=v>>>8,this[w+1]=v&255,w+2},u.prototype.writeInt32LE=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,4,2147483647,-2147483648),this[w]=v&255,this[w+1]=v>>>8,this[w+2]=v>>>16,this[w+3]=v>>>24,w+4},u.prototype.writeInt32BE=function(v,w,H){return v=+v,w=w>>>0,H||ne(this,v,w,4,2147483647,-2147483648),v<0&&(v=4294967295+v+1),this[w]=v>>>24,this[w+1]=v>>>16,this[w+2]=v>>>8,this[w+3]=v&255,w+4},u.prototype.writeBigInt64LE=We(function(v,w=0){return ee(this,v,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=We(function(v,w=0){return _e(this,v,w,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function G(M,v,w,H,le,pe){if(w+H>M.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("Index out of range")}function W(M,v,w,H,le){return v=+v,w=w>>>0,le||G(M,v,w,4),i.write(M,v,w,H,23,4),w+4}u.prototype.writeFloatLE=function(v,w,H){return W(this,v,w,!0,H)},u.prototype.writeFloatBE=function(v,w,H){return W(this,v,w,!1,H)};function Y(M,v,w,H,le){return v=+v,w=w>>>0,le||G(M,v,w,8),i.write(M,v,w,H,52,8),w+8}u.prototype.writeDoubleLE=function(v,w,H){return Y(this,v,w,!0,H)},u.prototype.writeDoubleBE=function(v,w,H){return Y(this,v,w,!1,H)},u.prototype.copy=function(v,w,H,le){if(!u.isBuffer(v))throw new TypeError("argument should be a Buffer");if(H||(H=0),!le&&le!==0&&(le=this.length),w>=v.length&&(w=v.length),w||(w=0),le>0&&le<H&&(le=H),le===H||v.length===0||this.length===0)return 0;if(w<0)throw new RangeError("targetStart out of bounds");if(H<0||H>=this.length)throw new RangeError("Index out of range");if(le<0)throw new RangeError("sourceEnd out of bounds");le>this.length&&(le=this.length),v.length-w<le-H&&(le=v.length-w+H);const pe=le-H;return this===v&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(w,H,le):Uint8Array.prototype.set.call(v,this.subarray(H,le),w),pe},u.prototype.fill=function(v,w,H,le){if(typeof v=="string"){if(typeof w=="string"?(le=w,w=0,H=this.length):typeof H=="string"&&(le=H,H=this.length),le!==void 0&&typeof le!="string")throw new TypeError("encoding must be a string");if(typeof le=="string"&&!u.isEncoding(le))throw new TypeError("Unknown encoding: "+le);if(v.length===1){const be=v.charCodeAt(0);(le==="utf8"&&be<128||le==="latin1")&&(v=be)}}else typeof v=="number"?v=v&255:typeof v=="boolean"&&(v=Number(v));if(w<0||this.length<w||this.length<H)throw new RangeError("Out of range index");if(H<=w)return this;w=w>>>0,H=H===void 0?this.length:H>>>0,v||(v=0);let pe;if(typeof v=="number")for(pe=w;pe<H;++pe)this[pe]=v;else{const be=u.isBuffer(v)?v:u.from(v,le),Oe=be.length;if(Oe===0)throw new TypeError('The value "'+v+'" is invalid for argument "value"');for(pe=0;pe<H-w;++pe)this[pe+w]=be[pe%Oe]}return this};const K={};function oe(M,v,w){K[M]=class extends w{constructor(){super(),Object.defineProperty(this,"message",{value:v.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${M}]`,this.stack,delete this.name}get code(){return M}set code(le){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:le,writable:!0})}toString(){return`${this.name} [${M}]: ${this.message}`}}}oe("ERR_BUFFER_OUT_OF_BOUNDS",function(M){return M?`${M} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),oe("ERR_INVALID_ARG_TYPE",function(M,v){return`The "${M}" argument must be of type number. Received type ${typeof v}`},TypeError),oe("ERR_OUT_OF_RANGE",function(M,v,w){let H=`The value of "${M}" is out of range.`,le=w;return Number.isInteger(w)&&Math.abs(w)>2**32?le=ce(String(w)):typeof w=="bigint"&&(le=String(w),(w>BigInt(2)**BigInt(32)||w<-(BigInt(2)**BigInt(32)))&&(le=ce(le)),le+="n"),H+=` It must be ${v}. Received ${le}`,H},RangeError);function ce(M){let v="",w=M.length;const H=M[0]==="-"?1:0;for(;w>=H+4;w-=3)v=`_${M.slice(w-3,w)}${v}`;return`${M.slice(0,w)}${v}`}function Ee(M,v,w){z(v,"offset"),(M[v]===void 0||M[v+w]===void 0)&&te(v,M.length-(w+1))}function Te(M,v,w,H,le,pe){if(M>w||M<v){const be=typeof v=="bigint"?"n":"";let Oe;throw v===0||v===BigInt(0)?Oe=`>= 0${be} and < 2${be} ** ${(pe+1)*8}${be}`:Oe=`>= -(2${be} ** ${(pe+1)*8-1}${be}) and < 2 ** ${(pe+1)*8-1}${be}`,new K.ERR_OUT_OF_RANGE("value",Oe,M)}Ee(H,le,pe)}function z(M,v){if(typeof M!="number")throw new K.ERR_INVALID_ARG_TYPE(v,"number",M)}function te(M,v,w){throw Math.floor(M)!==M?(z(M,w),new K.ERR_OUT_OF_RANGE("offset","an integer",M)):v<0?new K.ERR_BUFFER_OUT_OF_BOUNDS:new K.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${v}`,M)}const fe=/[^+/0-9A-Za-z-_]/g;function we(M){if(M=M.split("=")[0],M=M.trim().replace(fe,""),M.length<2)return"";for(;M.length%4!==0;)M=M+"=";return M}function Se(M,v){v=v||1/0;let w;const H=M.length;let le=null;const pe=[];for(let be=0;be<H;++be){if(w=M.charCodeAt(be),w>55295&&w<57344){if(!le){if(w>56319){(v-=3)>-1&&pe.push(239,191,189);continue}else if(be+1===H){(v-=3)>-1&&pe.push(239,191,189);continue}le=w;continue}if(w<56320){(v-=3)>-1&&pe.push(239,191,189),le=w;continue}w=(le-55296<<10|w-56320)+65536}else le&&(v-=3)>-1&&pe.push(239,191,189);if(le=null,w<128){if((v-=1)<0)break;pe.push(w)}else if(w<2048){if((v-=2)<0)break;pe.push(w>>6|192,w&63|128)}else if(w<65536){if((v-=3)<0)break;pe.push(w>>12|224,w>>6&63|128,w&63|128)}else if(w<1114112){if((v-=4)<0)break;pe.push(w>>18|240,w>>12&63|128,w>>6&63|128,w&63|128)}else throw new Error("Invalid code point")}return pe}function Ie(M){const v=[];for(let w=0;w<M.length;++w)v.push(M.charCodeAt(w)&255);return v}function re(M,v){let w,H,le;const pe=[];for(let be=0;be<M.length&&!((v-=2)<0);++be)w=M.charCodeAt(be),H=w>>8,le=w%256,pe.push(le),pe.push(H);return pe}function ve(M){return e.toByteArray(we(M))}function Ne(M,v,w,H){let le;for(le=0;le<H&&!(le+w>=v.length||le>=M.length);++le)v[le+w]=M[le];return le}function xe(M,v){return M instanceof v||M!=null&&M.constructor!=null&&M.constructor.name!=null&&M.constructor.name===v.name}function ke(M){return M!==M}const lt=(function(){const M="0123456789abcdef",v=new Array(256);for(let w=0;w<16;++w){const H=w*16;for(let le=0;le<16;++le)v[H+le]=M[w]+M[le]}return v})();function We(M){return typeof BigInt>"u"?nt:M}function nt(){throw new Error("BigInt not supported")}})(Lo)),Lo}var rg=Ti();const or="http://www.w3.org/1999/02/22-rdf-syntax-ns#",ar="http://www.w3.org/2001/XMLSchema#",ds="http://www.w3.org/2000/10/swap/",Tt={xsd:{decimal:`${ar}decimal`,boolean:`${ar}boolean`,double:`${ar}double`,integer:`${ar}integer`,string:`${ar}string`},rdf:{type:`${or}type`,nil:`${or}nil`,first:`${or}first`,rest:`${or}rest`,langString:`${or}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${ds}reify#forSome`,forAll:`${ds}reify#forAll`},log:{implies:`${ds}log#implies`,isImpliedBy:`${ds}log#isImpliedBy`}},{xsd:fs}=Tt,sg=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,Qu={"\\":"\\","'":"'",'"':'"',n:`
|
|
7
|
+
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},og=/[\x00-\x20<>\\"\{\}\|\^\`]/,ag={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},lg=/$0^/;class ug{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const i in this)!(i in ag)&&this[i]instanceof RegExp&&(this[i]=lg)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,i){let r=this._input,o=r.length;for(;;){let u,f;for(;u=this._newline.exec(r);)this.comments&&(f=this._comment.exec(u[0]))&&a("comment",f[1],"",this._line,u[0].length),r=r.substr(u[0].length,r.length),o=r.length,this._line++;if(!u&&(u=this._whitespace.exec(r))&&(r=r.substr(u[0].length,r.length)),this._endOfFile.test(r))return i&&(this.comments&&(f=this._comment.exec(r))&&a("comment",f[1],"",this._line,r.length),r=null,a("eof","","",this._line,0)),this._input=r;const d=this._line,g=r[0];let _="",h="",m="",b=null,T=0,A=!1;switch(g){case"^":if(r.length<3)break;if(r[1]==="^"){if(this._previousMarker="^^",r=r.substr(2),r[0]!=="<"){A=!0;break}}else{this._n3Mode&&(T=1,_="^");break}case"<":if(b=this._unescapedIri.exec(r))_="IRI",h=b[1];else if(b=this._iri.exec(r)){if(h=this._unescape(b[1]),h===null||og.test(h))return l(this);_="IRI"}else r.length>1&&r[1]==="<"?(_="<<",T=2):this._n3Mode&&r.length>1&&r[1]==="="&&(T=2,this._isImpliedBy?(_="abbreviation",h="<"):(_="inverse",h=">"));break;case">":r.length>1&&r[1]===">"&&(_=">>",T=2);break;case"_":((b=this._blank.exec(r))||i&&(b=this._blank.exec(`${r} `)))&&(_="blank",m="_",h=b[1]);break;case'"':if(b=this._simpleQuotedString.exec(r))h=b[1];else if({value:h,matchLength:T}=this._parseLiteral(r),h===null)return l(this);(b!==null||T!==0)&&(_="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(b=this._simpleApostropheString.exec(r))h=b[1];else if({value:h,matchLength:T}=this._parseLiteral(r),h===null)return l(this);(b!==null||T!==0)&&(_="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(b=this._variable.exec(r))&&(_="var",h=b[0]);break;case"@":this._previousMarker==="literal"&&(b=this._langcode.exec(r))?(_="langcode",h=b[1]):(b=this._keyword.exec(r))&&(_=b[0]);break;case".":if(r.length===1?i:r[1]<"0"||r[1]>"9"){_=".",T=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(b=this._number.exec(r)||i&&(b=this._number.exec(`${r} `)))&&(_="literal",h=b[0],m=typeof b[1]=="string"?fs.double:typeof b[2]=="string"?fs.decimal:fs.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(b=this._sparqlKeyword.exec(r))?_=b[0].toUpperCase():A=!0;break;case"f":case"t":(b=this._boolean.exec(r))?(_="literal",h=b[0],m=fs.boolean):A=!0;break;case"a":(b=this._shortPredicates.exec(r))?(_="abbreviation",h="a"):A=!0;break;case"=":this._n3Mode&&r.length>1&&(_="abbreviation",r[1]!==">"?(T=1,h="="):(T=2,h=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(T=1,_=g);break;case"{":!this._lineMode&&r.length>=2&&(r[1]==="|"?(_="{|",T=2):(_=g,T=1));break;case"|":r.length>=2&&r[1]==="}"&&(_="|}",T=2);break;default:A=!0}if(A&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(b=this._prefix.exec(r))?(_="prefix",h=b[1]||""):((b=this._prefixed.exec(r))||i&&(b=this._prefixed.exec(`${r} `)))&&(_="prefixed",m=b[1]||"",h=this._unescape(b[2]))),this._previousMarker==="^^")switch(_){case"prefixed":_="type";break;case"IRI":_="typeIRI";break;default:_=""}if(!_)return i||!/^'''|^"""/.test(r)&&/\n|\r/.test(r)?l(this):this._input=r;const N=T||b[0].length,R=a(_,h,m,d,N);this.previousToken=R,this._previousMarker=_,r=r.substr(N,r.length)}function a(u,f,d,g,_){const h=r?o-r.length:o,m=h+_,b={type:u,value:f,prefix:d,line:g,start:h,end:m};return e(null,b),b}function l(u){e(u._syntaxError(/^\S*/.exec(r)[0]))}}_unescape(e){let i=!1;const r=e.replace(sg,(o,a,l,u)=>{if(typeof a=="string")return String.fromCharCode(Number.parseInt(a,16));if(typeof l=="string"){let f=Number.parseInt(l,16);return f<=65535?String.fromCharCode(Number.parseInt(l,16)):String.fromCharCode(55296+((f-=65536)>>10),56320+(f&1023))}return u in Qu?Qu[u]:(i=!0,"")});return i?null:r}_parseLiteral(e){if(e.length>=3){const i=e.match(/^(?:"""|"|'''|'|)/)[0],r=i.length;let o=Math.max(this._literalClosingPos,r);for(;(o=e.indexOf(i,o))>0;){let a=0;for(;e[o-a-1]==="\\";)a++;if(a%2===0){const l=e.substring(r,o),u=l.split(/\r\n|\r|\n/).length-1,f=o+r;if(r===1&&u!==0||r===3&&this._lineMode)break;return this._line+=u,{value:this._unescape(l),matchLength:f}}o++}this._literalClosingPos=e.length-r+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const i=new Error(`Unexpected "${e}" on line ${this._line}.`);return i.context={token:void 0,line:this._line,previousToken:this.previousToken},i}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,i){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof i=="function")queueMicrotask(()=>this._tokenizeToEnd(i,!0));else{const r=[];let o;if(this._tokenizeToEnd((a,l)=>a?o=a:r.push(l),!0),o)throw o;return r}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",r=>{this._input!==null&&r.length!==0&&(this._pendingBuffer&&(r=rg.Buffer.concat([this._pendingBuffer,r]),this._pendingBuffer=null),r[r.length-1]&128?this._pendingBuffer=r:(typeof this._input>"u"?this._input=this._readStartingBom(typeof r=="string"?r:r.toString()):this._input+=r,this._tokenizeToEnd(i,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(i,!0)}),e.on("error",i)}}const{rdf:cg,xsd:cn}=Tt;let zn,hg=0;const ze={namedNode:Gd,blankNode:Zd,variable:Jd,literal:Xd,defaultGraph:gg,quad:fl,triple:fl,fromTerm:Ar,fromQuad:Qd};class ni{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof ni?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}let kn=class extends ni{get termType(){return"NamedNode"}},ii=class Wd extends ni{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let i=e.lastIndexOf('"')+1;return i<e.length&&e[i++]==="@"?e.substr(i).toLowerCase():""}get datatype(){return new kn(this.datatypeString)}get datatypeString(){const e=this.id,i=e.lastIndexOf('"')+1,r=i<e.length?e[i]:"";return r==="^"?e.substr(i+2):r!=="@"?cn.string:cg.langString}equals(e){return e instanceof Wd?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},dg=class extends ni{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},fg=class extends ni{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},pg=class extends ni{constructor(){return super(""),zn||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};zn=new pg;function Ir(n,e,i){if(e=e||ze,!n)return e.defaultGraph();switch(n[0]){case"?":return e.variable(n.substr(1));case"_":return e.blankNode(n.substr(2));case'"':if(e===ze)return new ii(n);if(n[n.length-1]==='"')return e.literal(n.substr(1,n.length-2));const r=n.lastIndexOf('"',n.length-1);return e.literal(n.substr(1,r-1),n[r+1]==="@"?n.substr(r+2):e.namedNode(n.substr(r+3)));case"[":n=JSON.parse(n);break;default:if(!i||!Array.isArray(n))return e.namedNode(n)}return e.quad(Ir(n[0],e,!0),Ir(n[1],e,!0),Ir(n[2],e,!0),n[3]&&Ir(n[3],e,!0))}function Dn(n,e){if(typeof n=="string")return n;if(n instanceof ni&&n.termType!=="Quad")return n.id;if(!n)return zn.id;switch(n.termType){case"NamedNode":return n.value;case"BlankNode":return`_:${n.value}`;case"Variable":return`?${n.value}`;case"DefaultGraph":return"";case"Literal":return`"${n.value}"${n.language?`@${n.language}`:n.datatype&&n.datatype.value!==cn.string?`^^${n.datatype.value}`:""}`;case"Quad":const i=[Dn(n.subject,!0),Dn(n.predicate,!0),Dn(n.object,!0)];return n.graph&&n.graph.termType!=="DefaultGraph"&&i.push(Dn(n.graph,!0)),e?i:JSON.stringify(i);default:throw new Error(`Unexpected termType: ${n.termType}`)}}let Bs=class extends ni{constructor(e,i,r,o){super(""),this._subject=e,this._predicate=i,this._object=r,this._graph=o||zn}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 Gd(n){return new kn(n)}function Zd(n){return new dg(n||`n3-${hg++}`)}function Xd(n,e){if(typeof e=="string")return new ii(`"${n}"@${e.toLowerCase()}`);let i=e?e.value:"";return i===""&&(typeof n=="boolean"?i=cn.boolean:typeof n=="number"&&(Number.isFinite(n)?i=Number.isInteger(n)?cn.integer:cn.double:(i=cn.double,Number.isNaN(n)||(n=n>0?"INF":"-INF")))),i===""||i===cn.string?new ii(`"${n}"`):new ii(`"${n}"^^${i}`)}function Jd(n){return new fg(n)}function gg(){return zn}function fl(n,e,i,r){return new Bs(n,e,i,r)}function Ar(n){if(n instanceof ni)return n;switch(n.termType){case"NamedNode":return Gd(n.value);case"BlankNode":return Zd(n.value);case"Variable":return Jd(n.value);case"DefaultGraph":return zn;case"Literal":return Xd(n.value,n.language||n.datatype);case"Quad":return Qd(n);default:throw new Error(`Unexpected termType: ${n.termType}`)}}function Qd(n){if(n instanceof Bs)return n;if(n.termType!=="Quad")throw new Error(`Unexpected termType: ${n.termType}`);return fl(Ar(n.subject),Ar(n.predicate),Ar(n.object),Ar(n.graph))}let Ku=0;class Kd{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&Yd(this,e.factory);const i=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",r=/turtle/.test(i),o=/trig/.test(i),a=/triple/.test(i),l=/quad/.test(i),u=this._n3Mode=/n3/.test(i),f=a||l;(this._supportsNamedGraphs=!(r||u))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||o||a||u),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=i===""||/star|\*$/.test(i),f&&(this._resolveRelativeIRI=d=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new ug({lineMode:f,n3:u,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Ku=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const i=e.indexOf("#");i>=0&&(e=e.substr(0,i)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,i,r,o,a){const l=this._n3Mode;this._contextStack.push({type:e,subject:r,predicate:o,object:a,graph:i,inverse:l?this._inversePredicate:!1,blankPrefix:l?this._prefixes._:"",quantified:l?this._quantified:null}),l&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,i){const r=this._contextStack.pop();if(!r||r.type!==e)return this._error(`Unexpected ${i.type}`,i);this._subject=r.subject,this._predicate=r.predicate,this._object=r.object,this._graph=r.graph,this._n3Mode&&(this._inversePredicate=r.inverse,this._prefixes._=r.blankPrefix,this._quantified=r.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,i){let r;switch(e.type){case"IRI":case"typeIRI":const o=this._resolveIRI(e.value);if(o===null)return this._error("Invalid IRI",e);r=this._factory.namedNode(o);break;case"type":case"prefixed":const a=this._prefixes[e.prefix];if(a===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);r=this._factory.namedNode(a+e.value);break;case"blank":r=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":r=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!i&&this._n3Mode&&r.id in this._quantified&&(r=this._quantified[r.id]),r}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const i=e.type;switch(i){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${i}`,e):(this._subject=null,i==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const i=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:i?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 i=null,r=null,o=this._readListItem;const a=this._subject,l=this._contextStack,u=l[l.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this._subject=i=this._factory.blankNode()),o=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),l.length!==0&&l[l.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(o=this._readPredicate,this._subject===this.RDF_NIL)return o}else if(o=this._getContextEndReader(),this._object===this.RDF_NIL)return o;r=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,o=this._readListItemDataTypeOrLang):(i=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),o=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((i=this._readEntity(e))===void 0)return}if(r===null&&(this._subject=r=this._factory.blankNode()),a===null?u.predicate===null?u.subject=r:u.object=r:this._emit(a,this.RDF_REST,r,this._graph),i!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,r,this.RDF_FIRST,i),this._subject=i,this._predicate=null,this._getPathReader(this._readListItem);this._emit(r,this.RDF_FIRST,i,this._graph)}return o}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let i=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const r=this._readEntity(e);if(r===void 0)return;i=this._factory.literal(this._literalValue,r),e=null;break;case"langcode":i=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:i}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,i){const r=this._completeLiteral(e);if(r)return this._object=r.literal,i&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),r.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(r.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let i,r=this._graph;const o=this._subject,a=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,i=this._contextStack.length?this._readSubject:this._readInTopContext,a&&(this._inversePredicate=!1);break;case";":i=this._readPredicate;break;case",":i=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const l=this._predicate,u=this._object;this._subject=this._factory.quad(o,l,u,this.DEFAULTGRAPH),i=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,i=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(r=this._readEntity(e))!==void 0){i=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(o!==null){const l=this._predicate,u=this._object;a?this._emit(u,l,o,r):this._emit(o,l,u,r)}return i}_readBlankNodePunctuation(e){let i;switch(e.type){case";":i=this._readPredicate;break;case",":i=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),i}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const i=this._readEntity(e);return this._prefixes[this._prefix]=i.value,this._prefixCallback(this._prefix,i),this._readDeclarationPunctuation}_readBaseIRI(e){const i=e.type==="IRI"&&this._resolveIRI(e.value);return i?(this._setBase(i),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let i;switch(e.type){case"IRI":case"prefixed":if((i=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,i,this.QUANTIFIERS_GRAPH)):this._quantified[i.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const i=this._contextStack,r=i.length&&i[i.length-1];if(r&&r.type==="item"){const o=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,o,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let i,r;const o=this._factory.blankNode();if((r=this._readEntity(e))!==void 0)return this._predicate===null?(i=this._subject,this._subject=o):(i=this._object,this._object=o),this._emit(i,r,o,this._graph),this._readPath}_readBackwardPath(e){const i=this._factory.blankNode();let r,o;if((r=this._readEntity(e))!==void 0)return this._predicate===null?(o=this._subject,this._subject=i):(o=this._object,this._object=i),this._emit(i,r,o,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const i=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=i,this._readPredicate):(this._object=i,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,i,r,o){this._callback(null,this._factory.quad(e,i,r,o||this.DEFAULTGRAPH))}_error(e,i){const r=new Error(`${e} on line ${i.line}.`);r.context={token:i,line:i.line,previousToken:this._lexer.previousToken},this._callback(r),this._callback=ps}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const i=e.length;let r="",o=-1,a=-1,l=0,u="/";for(;o<i;){switch(u){case":":if(a<0&&e[++o]==="/"&&e[++o]==="/")for(;(a=o+1)<i&&e[a]!=="/";)o=a;break;case"?":case"#":o=i;break;case"/":if(e[o+1]===".")switch(u=e[++o+1],u){case"/":r+=e.substring(l,o-1),l=o+1;break;case void 0:case"?":case"#":return r+e.substring(l,o)+e.substr(o+1);case".":if(u=e[++o+1],u===void 0||u==="/"||u==="?"||u==="#"){if(r+=e.substring(l,o-2),(l=r.lastIndexOf("/"))>=a&&(r=r.substr(0,l)),u!=="/")return`${r}/${e.substr(o+1)}`;l=o+1}}}u=e[++o]}return r+e.substring(l)}parse(e,i,r){let o,a,l;if(i&&(i.onQuad||i.onPrefix||i.onComment)?(o=i.onQuad,a=i.onPrefix,l=i.onComment):(o=i,a=r),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Ku++}_`,this._prefixCallback=a||ps,this._inversePredicate=!1,this._quantified=Object.create(null),!o){const f=[];let d;if(this._callback=(g,_)=>{g?d=g:_&&f.push(_)},this._lexer.tokenize(e).every(g=>this._readCallback=this._readCallback(g)),d)throw d;return f}let u=(f,d)=>{f!==null?(this._callback(f),this._callback=ps):this._readCallback&&(this._readCallback=this._readCallback(d))};l&&(this._lexer.comments=!0,u=(f,d)=>{f!==null?(this._callback(f),this._callback=ps):this._readCallback&&(d.type==="comment"?l(d.value):this._readCallback=this._readCallback(d))}),this._callback=o,this._lexer.tokenize(e,u)}}function ps(){}function Yd(n,e){n._factory=e,n.DEFAULTGRAPH=e.defaultGraph(),n.RDF_FIRST=e.namedNode(Tt.rdf.first),n.RDF_REST=e.namedNode(Tt.rdf.rest),n.RDF_NIL=e.namedNode(Tt.rdf.nil),n.N3_FORALL=e.namedNode(Tt.r.forAll),n.N3_FORSOME=e.namedNode(Tt.r.forSome),n.ABBREVIATIONS={a:e.namedNode(Tt.rdf.type),"=":e.namedNode(Tt.owl.sameAs),">":e.namedNode(Tt.log.implies),"<":e.namedNode(Tt.log.isImpliedBy)},n.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}Yd(Kd.prototype,ze);function pl(n){return!!n&&n.termType==="DefaultGraph"}function Es(n){return n.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const mg=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,_g=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,Yu="./",yg="../",Io="?",ec="#";class Tl{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!mg.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!Tl.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],i=["^",Es(e)],r=[],o=[],a=/[^/?#]*([/?#])/y;let l,u=0,f=0,d=a.lastIndex=e.length;for(;!u&&!f&&(l=a.exec(this.base));)l[1]===ec?f=a.lastIndex-1:(i.push(Es(l[0]),"(?:"),r.push(")?"),l[1]!==Io?o.push(d=a.lastIndex):(u=d=a.lastIndex,f=this.base.indexOf(ec,u),this._pathReplacements[u]=Io));for(let g=0;g<o.length;g++)this._pathReplacements[o[g]]=yg.repeat(o.length-g-1);return this._pathReplacements[o[o.length-1]]=Yu,this._baseLength=f>0?f:this.base.length,i.push(Es(this.base.substring(d,this._baseLength)),u?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...i,...r].join(""))}toRelative(e){const i=this._getBaseMatcher().exec(e);if(!i)return e;const r=i[0].length;if(r===this._baseLength&&r===e.length)return"";const o=this._pathReplacements[r];if(o){const a=e.substring(r);return o!==Io&&!_g.test(a)?e:o===Yu&&/^[^?#]/.test(a)?a:o+a}return e.substring(r-1)}}const lr=ze.defaultGraph(),{rdf:vg,xsd:An}=Tt,tc=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ic=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,bg={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class ur extends ni{equals(e){return e===this}}class Ll{constructor(e,i){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(i=e,e=null),i=i||{},this._lists=i.lists,e)this._outputStream=e,this._endStream=i.end===void 0?!0:!!i.end;else{let r="";this._outputStream={write(o,a,l){r+=o,l&&l()},end:o=>{o&&o(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(i.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=lr,this._prefixIRIs=Object.create(null),i.prefixes&&this.addPrefixes(i.prefixes),i.baseIRI&&(this._baseIri=new Tl(i.baseIRI)))}get _inDefaultGraph(){return lr.equals(this._graph)}_write(e,i){this._outputStream.write(e,"utf8",i)}_writeQuad(e,i,r,o,a){try{o.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
8
8
|
`:`
|
|
9
9
|
}
|
|
10
|
-
`)+(
|
|
11
|
-
`)),this._graph=
|
|
12
|
-
${this._encodePredicate(this._predicate=
|
|
13
|
-
`)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=
|
|
10
|
+
`)+(lr.equals(o)?"":`${this._encodeIriOrBlank(o)} {
|
|
11
|
+
`)),this._graph=o,this._subject=null),e.equals(this._subject)?i.equals(this._predicate)?this._write(`, ${this._encodeObject(r)}`,a):this._write(`;
|
|
12
|
+
${this._encodePredicate(this._predicate=i)} ${this._encodeObject(r)}`,a):this._write(`${(this._subject===null?"":`.
|
|
13
|
+
`)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=i)} ${this._encodeObject(r)}`,a)}catch(l){a&&a(l)}}_writeQuadLine(e,i,r,o,a){delete this._prefixMatch,this._write(this.quadToString(e,i,r,o),a)}quadToString(e,i,r,o){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(i)} ${this._encodeObject(r)}${o&&o.value?` ${this._encodeIriOrBlank(o)} .
|
|
14
14
|
`:` .
|
|
15
|
-
`}`}quadsToString(e){let
|
|
15
|
+
`}`}quadsToString(e){let i="";for(const r of e)i+=this.quadToString(r.subject,r.predicate,r.object,r.graph);return i}_encodeSubject(e){return e.termType==="Quad"?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!=="NamedNode")return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),"id"in e?e.id:`_:${e.value}`;let i=e.value;this._baseIri&&(i=this._baseIri.toRelative(i)),tc.test(i)&&(i=i.replace(ic,nc));const r=this._prefixRegex.exec(i);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:i:`<${i}>`}_encodeLiteral(e){let i=e.value;if(tc.test(i)&&(i=i.replace(ic,nc)),e.language)return`"${i}"@${e.language}`;if(this._lineMode){if(e.datatype.value===An.string)return`"${i}"`}else switch(e.datatype.value){case An.string:return`"${i}"`;case An.boolean:if(i==="true"||i==="false")return i;break;case An.integer:if(/^[+-]?\d+$/.test(i))return i;break;case An.decimal:if(/^[+-]?\d*\.\d+$/.test(i))return i;break;case An.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(i))return i;break}return`"${i}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===vg.type?"a":this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case"Quad":return this._encodeQuad(e);case"Literal":return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:i,object:r,graph:o}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(i)} ${this._encodeObject(r)}${pl(o)?"":` ${this._encodeIriOrBlank(o)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,i,r,o,a){r===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,i):typeof o=="function"?this._writeQuad(e,i,r,lr,o):this._writeQuad(e,i,r,o||lr,a)}addQuads(e){for(let i=0;i<e.length;i++)this.addQuad(e[i])}addPrefix(e,i,r){const o={};o[e]=i,this.addPrefixes(o,r)}addPrefixes(e,i){if(!this._prefixIRIs)return i&&i();let r=!1;for(let o in e){let a=e[o];typeof a!="string"&&(a=a.value),r=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
16
16
|
`:`
|
|
17
17
|
}
|
|
18
|
-
`),this._subject=null,this._graph=""),this._prefixIRIs[
|
|
19
|
-
`)}if(
|
|
20
|
-
`:"",
|
|
18
|
+
`),this._subject=null,this._graph=""),this._prefixIRIs[a]=o+=":",this._write(`@prefix ${o} <${a}>.
|
|
19
|
+
`)}if(r){let o="",a="";for(const l in this._prefixIRIs)o+=o?`|${l}`:l,a+=(a?"|":"")+this._prefixIRIs[l];o=Es(o),this._prefixRegex=new RegExp(`^(?:${a})[^/]*$|^(${o})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(r?`
|
|
20
|
+
`:"",i)}blank(e,i){let r=e,o,a;switch(e===void 0?r=[]:e.termType?r=[{predicate:e,object:i}]:"length"in e||(r=[e]),a=r.length){case 0:return new ur("[]");case 1:if(o=r[0],!(o.object instanceof ur))return new ur(`[ ${this._encodePredicate(o.predicate)} ${this._encodeObject(o.object)} ]`);default:let l="[";for(let u=0;u<a;u++)o=r[u],o.predicate.equals(e)?l+=`, ${this._encodeObject(o.object)}`:(l+=`${(u?`;
|
|
21
21
|
`:`
|
|
22
|
-
`)+this._encodePredicate(
|
|
23
|
-
]`)}}list(e){const
|
|
22
|
+
`)+this._encodePredicate(o.predicate)} ${this._encodeObject(o.object)}`,e=o.predicate);return new ur(`${l}
|
|
23
|
+
]`)}}list(e){const i=e&&e.length||0,r=new Array(i);for(let o=0;o<i;o++)r[o]=this._encodeObject(e[o]);return new ur(`(${r.join(" ")})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
24
24
|
`:`
|
|
25
25
|
}
|
|
26
|
-
`),this._subject=null),this._write=this._blockedWrite;let
|
|
27
|
-
`;super(n),this.name="AggregateError",this.errors=t}}return Ni={AggregateError:r,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,n){return Object.defineProperty(e,t,n)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array},Ni}var Ri={exports:{}},Ti,ho;function ic(){return ho||(ho=1,Ti={format(r,...e){return r.replace(/%([sdifj])/g,function(...[t,n]){const i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}),Ti}var Ai,fo;function it(){if(fo)return Ai;fo=1;const{format:r,inspect:e}=ic(),{AggregateError:t}=Be(),n=globalThis.AggregateError||t,i=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,o="__node_internal_",u={};function l(v,x){if(!v)throw new u.ERR_INTERNAL_ASSERTION(x)}function c(v){let x="",S=v.length;const m=v[0]==="-"?1:0;for(;S>=m+4;S-=3)x=`_${v.slice(S-3,S)}${x}`;return`${v.slice(0,S)}${x}`}function d(v,x,S){if(typeof x=="function")return l(x.length<=S.length,`Code: ${v}; The provided arguments length (${S.length}) does not match the required ones (${x.length}).`),x(...S);const m=(x.match(/%[dfijoOs]/g)||[]).length;return l(m===S.length,`Code: ${v}; The provided arguments length (${S.length}) does not match the required ones (${m}).`),S.length===0?x:r(x,...S)}function b(v,x,S){S||(S=Error);class m extends S{constructor(...g){super(d(v,x,g))}toString(){return`${this.name} [${v}]: ${this.message}`}}Object.defineProperties(m.prototype,{name:{value:S.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${v}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),m.prototype.code=v,m.prototype[i]=!0,u[v]=m}function y(v){const x=o+v.name;return Object.defineProperty(v,"name",{value:x}),v}function _(v,x){if(v&&x&&v!==x){if(Array.isArray(x.errors))return x.errors.push(v),x;const S=new n([x,v],x.message);return S.code=x.code,S}return v||x}class E extends Error{constructor(x="The operation was aborted",S=void 0){if(S!==void 0&&typeof S!="object")throw new u.ERR_INVALID_ARG_TYPE("options","Object",S);super(x,S),this.code="ABORT_ERR",this.name="AbortError"}}return b("ERR_ASSERTION","%s",Error),b("ERR_INVALID_ARG_TYPE",(v,x,S)=>{l(typeof v=="string","'name' must be a string"),Array.isArray(x)||(x=[x]);let m="The ";v.endsWith(" argument")?m+=`${v} `:m+=`"${v}" ${v.includes(".")?"property":"argument"} `,m+="must be ";const h=[],g=[],N=[];for(const A of x)l(typeof A=="string","All expected entries have to be of type string"),s.includes(A)?h.push(A.toLowerCase()):a.test(A)?g.push(A):(l(A!=="object",'The value "object" should be written as "Object"'),N.push(A));if(g.length>0){const A=h.indexOf("object");A!==-1&&(h.splice(h,A,1),g.push("Object"))}if(h.length>0){switch(h.length){case 1:m+=`of type ${h[0]}`;break;case 2:m+=`one of type ${h[0]} or ${h[1]}`;break;default:{const A=h.pop();m+=`one of type ${h.join(", ")}, or ${A}`}}(g.length>0||N.length>0)&&(m+=" or ")}if(g.length>0){switch(g.length){case 1:m+=`an instance of ${g[0]}`;break;case 2:m+=`an instance of ${g[0]} or ${g[1]}`;break;default:{const A=g.pop();m+=`an instance of ${g.join(", ")}, or ${A}`}}N.length>0&&(m+=" or ")}switch(N.length){case 0:break;case 1:N[0].toLowerCase()!==N[0]&&(m+="an "),m+=`${N[0]}`;break;case 2:m+=`one of ${N[0]} or ${N[1]}`;break;default:{const A=N.pop();m+=`one of ${N.join(", ")}, or ${A}`}}if(S==null)m+=`. Received ${S}`;else if(typeof S=="function"&&S.name)m+=`. Received function ${S.name}`;else if(typeof S=="object"){var C;if((C=S.constructor)!==null&&C!==void 0&&C.name)m+=`. Received an instance of ${S.constructor.name}`;else{const A=e(S,{depth:-1});m+=`. Received ${A}`}}else{let A=e(S,{colors:!1});A.length>25&&(A=`${A.slice(0,25)}...`),m+=`. Received type ${typeof S} (${A})`}return m},TypeError),b("ERR_INVALID_ARG_VALUE",(v,x,S="is invalid")=>{let m=e(x);return m.length>128&&(m=m.slice(0,128)+"..."),`The ${v.includes(".")?"property":"argument"} '${v}' ${S}. Received ${m}`},TypeError),b("ERR_INVALID_RETURN_VALUE",(v,x,S)=>{var m;const h=S!=null&&(m=S.constructor)!==null&&m!==void 0&&m.name?`instance of ${S.constructor.name}`:`type ${typeof S}`;return`Expected ${v} to be returned from the "${x}" function but got ${h}.`},TypeError),b("ERR_MISSING_ARGS",(...v)=>{l(v.length>0,"At least one arg needs to be specified");let x;const S=v.length;switch(v=(Array.isArray(v)?v:[v]).map(m=>`"${m}"`).join(" or "),S){case 1:x+=`The ${v[0]} argument`;break;case 2:x+=`The ${v[0]} and ${v[1]} arguments`;break;default:{const m=v.pop();x+=`The ${v.join(", ")}, and ${m} arguments`}break}return`${x} must be specified`},TypeError),b("ERR_OUT_OF_RANGE",(v,x,S)=>{l(x,'Missing "range" argument');let m;if(Number.isInteger(S)&&Math.abs(S)>2**32)m=c(String(S));else if(typeof S=="bigint"){m=String(S);const h=BigInt(2)**BigInt(32);(S>h||S<-h)&&(m=c(m)),m+="n"}else m=e(S);return`The value of "${v}" is out of range. It must be ${x}. Received ${m}`},RangeError),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),b("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),b("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),b("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),b("ERR_STREAM_WRITE_AFTER_END","write after end",Error),b("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Ai={AbortError:E,aggregateTwoErrors:y(_),hideStackFrames:y,codes:u},Ai}var Qr={exports:{}},po;function xn(){if(po)return Qr.exports;po=1;const{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return Qr.exports=r,Qr.exports.AbortSignal=e,Qr.exports.default=r,Qr.exports}var Mn={exports:{}},go;function ci(){if(go)return Mn.exports;go=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(g,N,C){return Function.prototype.apply.call(g,N,C)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(g){return Object.getOwnPropertyNames(g).concat(Object.getOwnPropertySymbols(g))}:t=function(g){return Object.getOwnPropertyNames(g)};function n(h){console&&console.warn&&console.warn(h)}var i=Number.isNaN||function(g){return g!==g};function s(){s.init.call(this)}Mn.exports=s,Mn.exports.once=x,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(h){if(typeof h!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof h)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(h){if(typeof h!="number"||h<0||i(h))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+h+".");a=h}}),s.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},s.prototype.setMaxListeners=function(g){if(typeof g!="number"||g<0||i(g))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+g+".");return this._maxListeners=g,this};function u(h){return h._maxListeners===void 0?s.defaultMaxListeners:h._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(g){for(var N=[],C=1;C<arguments.length;C++)N.push(arguments[C]);var A=g==="error",B=this._events;if(B!==void 0)A=A&&B.error===void 0;else if(!A)return!1;if(A){var R;if(N.length>0&&(R=N[0]),R instanceof Error)throw R;var F=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw F.context=R,F}var q=B[g];if(q===void 0)return!1;if(typeof q=="function")e(q,this,N);else for(var D=q.length,L=_(q,D),C=0;C<D;++C)e(L[C],this,N);return!0};function l(h,g,N,C){var A,B,R;if(o(N),B=h._events,B===void 0?(B=h._events=Object.create(null),h._eventsCount=0):(B.newListener!==void 0&&(h.emit("newListener",g,N.listener?N.listener:N),B=h._events),R=B[g]),R===void 0)R=B[g]=N,++h._eventsCount;else if(typeof R=="function"?R=B[g]=C?[N,R]:[R,N]:C?R.unshift(N):R.push(N),A=u(h),A>0&&R.length>A&&!R.warned){R.warned=!0;var F=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(g)+" listeners added. Use emitter.setMaxListeners() to increase limit");F.name="MaxListenersExceededWarning",F.emitter=h,F.type=g,F.count=R.length,n(F)}return h}s.prototype.addListener=function(g,N){return l(this,g,N,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(g,N){return l(this,g,N,!0)};function c(){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 d(h,g,N){var C={fired:!1,wrapFn:void 0,target:h,type:g,listener:N},A=c.bind(C);return A.listener=N,C.wrapFn=A,A}s.prototype.once=function(g,N){return o(N),this.on(g,d(this,g,N)),this},s.prototype.prependOnceListener=function(g,N){return o(N),this.prependListener(g,d(this,g,N)),this},s.prototype.removeListener=function(g,N){var C,A,B,R,F;if(o(N),A=this._events,A===void 0)return this;if(C=A[g],C===void 0)return this;if(C===N||C.listener===N)--this._eventsCount===0?this._events=Object.create(null):(delete A[g],A.removeListener&&this.emit("removeListener",g,C.listener||N));else if(typeof C!="function"){for(B=-1,R=C.length-1;R>=0;R--)if(C[R]===N||C[R].listener===N){F=C[R].listener,B=R;break}if(B<0)return this;B===0?C.shift():E(C,B),C.length===1&&(A[g]=C[0]),A.removeListener!==void 0&&this.emit("removeListener",g,F||N)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(g){var N,C,A;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[g]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[g]),this;if(arguments.length===0){var B=Object.keys(C),R;for(A=0;A<B.length;++A)R=B[A],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(N=C[g],typeof N=="function")this.removeListener(g,N);else if(N!==void 0)for(A=N.length-1;A>=0;A--)this.removeListener(g,N[A]);return this};function b(h,g,N){var C=h._events;if(C===void 0)return[];var A=C[g];return A===void 0?[]:typeof A=="function"?N?[A.listener||A]:[A]:N?v(A):_(A,A.length)}s.prototype.listeners=function(g){return b(this,g,!0)},s.prototype.rawListeners=function(g){return b(this,g,!1)},s.listenerCount=function(h,g){return typeof h.listenerCount=="function"?h.listenerCount(g):y.call(h,g)},s.prototype.listenerCount=y;function y(h){var g=this._events;if(g!==void 0){var N=g[h];if(typeof N=="function")return 1;if(N!==void 0)return N.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function _(h,g){for(var N=new Array(g),C=0;C<g;++C)N[C]=h[C];return N}function E(h,g){for(;g+1<h.length;g++)h[g]=h[g+1];h.pop()}function v(h){for(var g=new Array(h.length),N=0;N<g.length;++N)g[N]=h[N].listener||h[N];return g}function x(h,g){return new Promise(function(N,C){function A(R){h.removeListener(g,B),C(R)}function B(){typeof h.removeListener=="function"&&h.removeListener("error",A),N([].slice.call(arguments))}m(h,g,B,{once:!0}),g!=="error"&&S(h,A,{once:!0})})}function S(h,g,N){typeof h.on=="function"&&m(h,"error",g,N)}function m(h,g,N,C){if(typeof h.on=="function")C.once?h.once(g,N):h.on(g,N);else if(typeof h.addEventListener=="function")h.addEventListener(g,function A(B){C.once&&h.removeEventListener(g,A),N(B)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof h)}return Mn.exports}var mo;function at(){return mo||(mo=1,(function(r){const e=jt(),{format:t,inspect:n}=ic(),{codes:{ERR_INVALID_ARG_TYPE:i}}=it(),{kResistStopPropagation:s,AggregateError:a,SymbolDispose:o}=Be(),u=globalThis.AbortSignal||xn().AbortSignal,l=globalThis.AbortController||xn().AbortController,c=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||e.Blob,b=typeof d<"u"?function(v){return v instanceof d}:function(v){return!1},y=(E,v)=>{if(E!==void 0&&(E===null||typeof E!="object"||!("aborted"in E)))throw new i(v,"AbortSignal",E)},_=(E,v)=>{if(typeof E!="function")throw new i(v,"Function",E)};r.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(E){let v=!1;return function(...x){v||(v=!0,E.apply(this,x))}},createDeferredPromise:function(){let E,v;return{promise:new Promise((S,m)=>{E=S,v=m}),resolve:E,reject:v}},promisify(E){return new Promise((v,x)=>{E((S,...m)=>S?x(S):v(...m))})},debuglog(){return function(){}},format:t,inspect:n,types:{isAsyncFunction(E){return E instanceof c},isArrayBufferView(E){return ArrayBuffer.isView(E)}},isBlob:b,deprecate(E,v){return E},addAbortListener:ci().addAbortListener||function(v,x){if(v===void 0)throw new i("signal","AbortSignal",v);y(v,"signal"),_(x,"listener");let S;return v.aborted?queueMicrotask(()=>x()):(v.addEventListener("abort",x,{__proto__:null,once:!0,[s]:!0}),S=()=>{v.removeEventListener("abort",x)}),{__proto__:null,[o](){var m;(m=S)===null||m===void 0||m()}}},AbortSignalAny:u.any||function(v){if(v.length===1)return v[0];const x=new l,S=()=>x.abort();return v.forEach(m=>{y(m,"signals"),m.addEventListener("abort",S,{once:!0})}),x.signal.addEventListener("abort",()=>{v.forEach(m=>m.removeEventListener("abort",S))},{once:!0}),x.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Ri)),Ri.exports}var Bn={},Di,yo;function Rn(){if(yo)return Di;yo=1;const{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:o,NumberParseInt:u,ObjectPrototypeHasOwnProperty:l,RegExpPrototypeExec:c,String:d,StringPrototypeToUpperCase:b,StringPrototypeTrim:y}=Be(),{hideStackFrames:_,codes:{ERR_SOCKET_BAD_PORT:E,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:S,ERR_UNKNOWN_SIGNAL:m}}=it(),{normalizeEncoding:h}=at(),{isAsyncFunction:g,isArrayBufferView:N}=at().types,C={};function A(J){return J===(J|0)}function B(J){return J===J>>>0}const R=/^[0-7]+$/,F="must be a 32-bit unsigned integer or an octal string";function q(J,ce,ye){if(typeof J>"u"&&(J=ye),typeof J=="string"){if(c(R,J)===null)throw new x(ce,J,F);J=u(J,8)}return te(J,ce),J}const D=_((J,ce,ye=o,le=a)=>{if(typeof J!="number")throw new v(ce,"number",J);if(!i(J))throw new S(ce,"an integer",J);if(J<ye||J>le)throw new S(ce,`>= ${ye} && <= ${le}`,J)}),L=_((J,ce,ye=-2147483648,le=2147483647)=>{if(typeof J!="number")throw new v(ce,"number",J);if(!i(J))throw new S(ce,"an integer",J);if(J<ye||J>le)throw new S(ce,`>= ${ye} && <= ${le}`,J)}),te=_((J,ce,ye=!1)=>{if(typeof J!="number")throw new v(ce,"number",J);if(!i(J))throw new S(ce,"an integer",J);const le=ye?1:0,Re=4294967295;if(J<le||J>Re)throw new S(ce,`>= ${le} && <= ${Re}`,J)});function T(J,ce){if(typeof J!="string")throw new v(ce,"string",J)}function Z(J,ce,ye=void 0,le){if(typeof J!="number")throw new v(ce,"number",J);if(ye!=null&&J<ye||le!=null&&J>le||(ye!=null||le!=null)&&s(J))throw new S(ce,`${ye!=null?`>= ${ye}`:""}${ye!=null&&le!=null?" && ":""}${le!=null?`<= ${le}`:""}`,J)}const k=_((J,ce,ye)=>{if(!e(ye,J)){const Re="must be one of: "+t(n(ye,ze=>typeof ze=="string"?`'${ze}'`:d(ze)),", ");throw new x(ce,J,Re)}});function Y(J,ce){if(typeof J!="boolean")throw new v(ce,"boolean",J)}function w(J,ce,ye){return J==null||!l(J,ce)?ye:J[ce]}const H=_((J,ce,ye=null)=>{const le=w(ye,"allowArray",!1),Re=w(ye,"allowFunction",!1);if(!w(ye,"nullable",!1)&&J===null||!le&&r(J)||typeof J!="object"&&(!Re||typeof J!="function"))throw new v(ce,"Object",J)}),K=_((J,ce)=>{if(J!=null&&typeof J!="object"&&typeof J!="function")throw new v(ce,"a dictionary",J)}),Q=_((J,ce,ye=0)=>{if(!r(J))throw new v(ce,"Array",J);if(J.length<ye){const le=`must be longer than ${ye}`;throw new x(ce,J,le)}});function ue(J,ce){Q(J,ce);for(let ye=0;ye<J.length;ye++)T(J[ye],`${ce}[${ye}]`)}function V(J,ce){Q(J,ce);for(let ye=0;ye<J.length;ye++)Y(J[ye],`${ce}[${ye}]`)}function G(J,ce){Q(J,ce);for(let ye=0;ye<J.length;ye++){const le=J[ye],Re=`${ce}[${ye}]`;if(le==null)throw new v(Re,"AbortSignal",le);fe(le,Re)}}function z(J,ce="signal"){if(T(J,ce),C[J]===void 0)throw C[b(J)]!==void 0?new m(J+" (signals must use all capital letters)"):new m(J)}const U=_((J,ce="buffer")=>{if(!N(J))throw new v(ce,["Buffer","TypedArray","DataView"],J)});function ee(J,ce){const ye=h(ce),le=J.length;if(ye==="hex"&&le%2!==0)throw new x("encoding",ce,`is invalid for data of length ${le}`)}function re(J,ce="Port",ye=!0){if(typeof J!="number"&&typeof J!="string"||typeof J=="string"&&y(J).length===0||+J!==+J>>>0||J>65535||J===0&&!ye)throw new E(ce,J,ye);return J|0}const fe=_((J,ce)=>{if(J!==void 0&&(J===null||typeof J!="object"||!("aborted"in J)))throw new v(ce,"AbortSignal",J)}),ge=_((J,ce)=>{if(typeof J!="function")throw new v(ce,"Function",J)}),j=_((J,ce)=>{if(typeof J!="function"||g(J))throw new v(ce,"Function",J)}),W=_((J,ce)=>{if(J!==void 0)throw new v(ce,"undefined",J)});function se(J,ce,ye){if(!e(ye,J))throw new v(ce,`('${t(ye,"|")}')`,J)}const he=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function pe(J,ce){if(typeof J>"u"||!c(he,J))throw new x(ce,J,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function me(J){if(typeof J=="string")return pe(J,"hints"),J;if(r(J)){const ce=J.length;let ye="";if(ce===0)return ye;for(let le=0;le<ce;le++){const Re=J[le];pe(Re,"hints"),ye+=Re,le!==ce-1&&(ye+=", ")}return ye}throw new x("hints",J,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return Di={isInt32:A,isUint32:B,parseFileMode:q,validateArray:Q,validateStringArray:ue,validateBooleanArray:V,validateAbortSignalArray:G,validateBoolean:Y,validateBuffer:U,validateDictionary:K,validateEncoding:ee,validateFunction:ge,validateInt32:L,validateInteger:D,validateNumber:Z,validateObject:H,validateOneOf:k,validatePlainFunction:j,validatePort:re,validateSignalName:z,validateString:T,validateUint32:te,validateUndefined:W,validateUnion:se,validateAbortSignal:fe,validateLinkHeaderValue:me},Di}var qn={exports:{}},Li={exports:{}},bo;function pr(){if(bo)return Li.exports;bo=1;var r=Li.exports={},e,t;function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=n}catch{e=n}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function s(E){if(e===setTimeout)return setTimeout(E,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(E,0);try{return e(E,0)}catch{try{return e.call(null,E,0)}catch{return e.call(this,E,0)}}}function a(E){if(t===clearTimeout)return clearTimeout(E);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(E);try{return t(E)}catch{try{return t.call(null,E)}catch{return t.call(this,E)}}}var o=[],u=!1,l,c=-1;function d(){!u||!l||(u=!1,l.length?o=l.concat(o):c=-1,o.length&&b())}function b(){if(!u){var E=s(d);u=!0;for(var v=o.length;v;){for(l=o,o=[];++c<v;)l&&l[c].run();c=-1,v=o.length}l=null,u=!1,a(E)}}r.nextTick=function(E){var v=new Array(arguments.length-1);if(arguments.length>1)for(var x=1;x<arguments.length;x++)v[x-1]=arguments[x];o.push(new y(E,v)),o.length===1&&!u&&s(b)};function y(E,v){this.fun=E,this.array=v}y.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function _(){}return r.on=_,r.addListener=_,r.once=_,r.off=_,r.removeListener=_,r.removeAllListeners=_,r.emit=_,r.prependListener=_,r.prependOnceListener=_,r.listeners=function(E){return[]},r.binding=function(E){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(E){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},Li.exports}var Oi,_o;function $t(){if(_o)return Oi;_o=1;const{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=Be(),n=t("nodejs.stream.destroyed"),i=t("nodejs.stream.errored"),s=t("nodejs.stream.readable"),a=t("nodejs.stream.writable"),o=t("nodejs.stream.disturbed"),u=t("nodejs.webstream.isClosedPromise"),l=t("nodejs.webstream.controllerErrorFunction");function c(w,H=!1){var K;return!!(w&&typeof w.pipe=="function"&&typeof w.on=="function"&&(!H||typeof w.pause=="function"&&typeof w.resume=="function")&&(!w._writableState||((K=w._readableState)===null||K===void 0?void 0:K.readable)!==!1)&&(!w._writableState||w._readableState))}function d(w){var H;return!!(w&&typeof w.write=="function"&&typeof w.on=="function"&&(!w._readableState||((H=w._writableState)===null||H===void 0?void 0:H.writable)!==!1))}function b(w){return!!(w&&typeof w.pipe=="function"&&w._readableState&&typeof w.on=="function"&&typeof w.write=="function")}function y(w){return w&&(w._readableState||w._writableState||typeof w.write=="function"&&typeof w.on=="function"||typeof w.pipe=="function"&&typeof w.on=="function")}function _(w){return!!(w&&!y(w)&&typeof w.pipeThrough=="function"&&typeof w.getReader=="function"&&typeof w.cancel=="function")}function E(w){return!!(w&&!y(w)&&typeof w.getWriter=="function"&&typeof w.abort=="function")}function v(w){return!!(w&&!y(w)&&typeof w.readable=="object"&&typeof w.writable=="object")}function x(w){return _(w)||E(w)||v(w)}function S(w,H){return w==null?!1:H===!0?typeof w[r]=="function":H===!1?typeof w[e]=="function":typeof w[r]=="function"||typeof w[e]=="function"}function m(w){if(!y(w))return null;const H=w._writableState,K=w._readableState,Q=H||K;return!!(w.destroyed||w[n]||Q!=null&&Q.destroyed)}function h(w){if(!d(w))return null;if(w.writableEnded===!0)return!0;const H=w._writableState;return H!=null&&H.errored?!1:typeof H?.ended!="boolean"?null:H.ended}function g(w,H){if(!d(w))return null;if(w.writableFinished===!0)return!0;const K=w._writableState;return K!=null&&K.errored?!1:typeof K?.finished!="boolean"?null:!!(K.finished||H===!1&&K.ended===!0&&K.length===0)}function N(w){if(!c(w))return null;if(w.readableEnded===!0)return!0;const H=w._readableState;return!H||H.errored?!1:typeof H?.ended!="boolean"?null:H.ended}function C(w,H){if(!c(w))return null;const K=w._readableState;return K!=null&&K.errored?!1:typeof K?.endEmitted!="boolean"?null:!!(K.endEmitted||H===!1&&K.ended===!0&&K.length===0)}function A(w){return w&&w[s]!=null?w[s]:typeof w?.readable!="boolean"?null:m(w)?!1:c(w)&&w.readable&&!C(w)}function B(w){return w&&w[a]!=null?w[a]:typeof w?.writable!="boolean"?null:m(w)?!1:d(w)&&w.writable&&!h(w)}function R(w,H){return y(w)?m(w)?!0:!(H?.readable!==!1&&A(w)||H?.writable!==!1&&B(w)):null}function F(w){var H,K;return y(w)?w.writableErrored?w.writableErrored:(H=(K=w._writableState)===null||K===void 0?void 0:K.errored)!==null&&H!==void 0?H:null:null}function q(w){var H,K;return y(w)?w.readableErrored?w.readableErrored:(H=(K=w._readableState)===null||K===void 0?void 0:K.errored)!==null&&H!==void 0?H:null:null}function D(w){if(!y(w))return null;if(typeof w.closed=="boolean")return w.closed;const H=w._writableState,K=w._readableState;return typeof H?.closed=="boolean"||typeof K?.closed=="boolean"?H?.closed||K?.closed:typeof w._closed=="boolean"&&L(w)?w._closed:null}function L(w){return typeof w._closed=="boolean"&&typeof w._defaultKeepAlive=="boolean"&&typeof w._removedConnection=="boolean"&&typeof w._removedContLen=="boolean"}function te(w){return typeof w._sent100=="boolean"&&L(w)}function T(w){var H;return typeof w._consuming=="boolean"&&typeof w._dumped=="boolean"&&((H=w.req)===null||H===void 0?void 0:H.upgradeOrConnect)===void 0}function Z(w){if(!y(w))return null;const H=w._writableState,K=w._readableState,Q=H||K;return!Q&&te(w)||!!(Q&&Q.autoDestroy&&Q.emitClose&&Q.closed===!1)}function k(w){var H;return!!(w&&((H=w[o])!==null&&H!==void 0?H:w.readableDidRead||w.readableAborted))}function Y(w){var H,K,Q,ue,V,G,z,U,ee,re;return!!(w&&((H=(K=(Q=(ue=(V=(G=w[i])!==null&&G!==void 0?G:w.readableErrored)!==null&&V!==void 0?V:w.writableErrored)!==null&&ue!==void 0?ue:(z=w._readableState)===null||z===void 0?void 0:z.errorEmitted)!==null&&Q!==void 0?Q:(U=w._writableState)===null||U===void 0?void 0:U.errorEmitted)!==null&&K!==void 0?K:(ee=w._readableState)===null||ee===void 0?void 0:ee.errored)!==null&&H!==void 0?H:!((re=w._writableState)===null||re===void 0)&&re.errored))}return Oi={isDestroyed:m,kIsDestroyed:n,isDisturbed:k,kIsDisturbed:o,isErrored:Y,kIsErrored:i,isReadable:A,kIsReadable:s,kIsClosedPromise:u,kControllerErrorFunction:l,kIsWritable:a,isClosed:D,isDuplexNodeStream:b,isFinished:R,isIterable:S,isReadableNodeStream:c,isReadableStream:_,isReadableEnded:N,isReadableFinished:C,isReadableErrored:q,isNodeStream:y,isWebStream:x,isWritable:B,isWritableNodeStream:d,isWritableStream:E,isWritableEnded:h,isWritableFinished:g,isWritableErrored:F,isServerRequest:T,isServerResponse:te,willEmitClose:Z,isTransformStream:v},Oi}var wo;function Qt(){if(wo)return qn.exports;wo=1;const r=pr(),{AbortError:e,codes:t}=it(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=t,{kEmptyObject:s,once:a}=at(),{validateAbortSignal:o,validateFunction:u,validateObject:l,validateBoolean:c}=Rn(),{Promise:d,PromisePrototypeThen:b,SymbolDispose:y}=Be(),{isClosed:_,isReadable:E,isReadableNodeStream:v,isReadableStream:x,isReadableFinished:S,isReadableErrored:m,isWritable:h,isWritableNodeStream:g,isWritableStream:N,isWritableFinished:C,isWritableErrored:A,isNodeStream:B,willEmitClose:R,kIsClosedPromise:F}=$t();let q;function D(k){return k.setHeader&&typeof k.abort=="function"}const L=()=>{};function te(k,Y,w){var H,K;if(arguments.length===2?(w=Y,Y=s):Y==null?Y=s:l(Y,"options"),u(w,"callback"),o(Y.signal,"options.signal"),w=a(w),x(k)||N(k))return T(k,Y,w);if(!B(k))throw new n("stream",["ReadableStream","WritableStream","Stream"],k);const Q=(H=Y.readable)!==null&&H!==void 0?H:v(k),ue=(K=Y.writable)!==null&&K!==void 0?K:g(k),V=k._writableState,G=k._readableState,z=()=>{k.writable||re()};let U=R(k)&&v(k)===Q&&g(k)===ue,ee=C(k,!1);const re=()=>{ee=!0,k.destroyed&&(U=!1),!(U&&(!k.readable||Q))&&(!Q||fe)&&w.call(k)};let fe=S(k,!1);const ge=()=>{fe=!0,k.destroyed&&(U=!1),!(U&&(!k.writable||ue))&&(!ue||ee)&&w.call(k)},j=J=>{w.call(k,J)};let W=_(k);const se=()=>{W=!0;const J=A(k)||m(k);if(J&&typeof J!="boolean")return w.call(k,J);if(Q&&!fe&&v(k,!0)&&!S(k,!1))return w.call(k,new i);if(ue&&!ee&&!C(k,!1))return w.call(k,new i);w.call(k)},he=()=>{W=!0;const J=A(k)||m(k);if(J&&typeof J!="boolean")return w.call(k,J);w.call(k)},pe=()=>{k.req.on("finish",re)};D(k)?(k.on("complete",re),U||k.on("abort",se),k.req?pe():k.on("request",pe)):ue&&!V&&(k.on("end",z),k.on("close",z)),!U&&typeof k.aborted=="boolean"&&k.on("aborted",se),k.on("end",ge),k.on("finish",re),Y.error!==!1&&k.on("error",j),k.on("close",se),W?r.nextTick(se):V!=null&&V.errorEmitted||G!=null&&G.errorEmitted?U||r.nextTick(he):(!Q&&(!U||E(k))&&(ee||h(k)===!1)||!ue&&(!U||h(k))&&(fe||E(k)===!1)||G&&k.req&&k.aborted)&&r.nextTick(he);const me=()=>{w=L,k.removeListener("aborted",se),k.removeListener("complete",re),k.removeListener("abort",se),k.removeListener("request",pe),k.req&&k.req.removeListener("finish",re),k.removeListener("end",z),k.removeListener("close",z),k.removeListener("finish",re),k.removeListener("end",ge),k.removeListener("error",j),k.removeListener("close",se)};if(Y.signal&&!W){const J=()=>{const ce=w;me(),ce.call(k,new e(void 0,{cause:Y.signal.reason}))};if(Y.signal.aborted)r.nextTick(J);else{q=q||at().addAbortListener;const ce=q(Y.signal,J),ye=w;w=a((...le)=>{ce[y](),ye.apply(k,le)})}}return me}function T(k,Y,w){let H=!1,K=L;if(Y.signal)if(K=()=>{H=!0,w.call(k,new e(void 0,{cause:Y.signal.reason}))},Y.signal.aborted)r.nextTick(K);else{q=q||at().addAbortListener;const ue=q(Y.signal,K),V=w;w=a((...G)=>{ue[y](),V.apply(k,G)})}const Q=(...ue)=>{H||r.nextTick(()=>w.apply(k,ue))};return b(k[F].promise,Q,Q),L}function Z(k,Y){var w;let H=!1;return Y===null&&(Y=s),(w=Y)!==null&&w!==void 0&&w.cleanup&&(c(Y.cleanup,"cleanup"),H=Y.cleanup),new d((K,Q)=>{const ue=te(k,Y,V=>{H&&ue(),V?Q(V):K()})})}return qn.exports=te,qn.exports.finished=Z,qn.exports}var Ci,vo;function $r(){if(vo)return Ci;vo=1;const r=pr(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:n}=it(),{Symbol:i}=Be(),{kIsDestroyed:s,isDestroyed:a,isFinished:o,isServerRequest:u}=$t(),l=i("kDestroy"),c=i("kConstruct");function d(R,F,q){R&&(R.stack,F&&!F.errored&&(F.errored=R),q&&!q.errored&&(q.errored=R))}function b(R,F){const q=this._readableState,D=this._writableState,L=D||q;return D!=null&&D.destroyed||q!=null&&q.destroyed?(typeof F=="function"&&F(),this):(d(R,D,q),D&&(D.destroyed=!0),q&&(q.destroyed=!0),L.constructed?y(this,R,F):this.once(l,function(te){y(this,e(te,R),F)}),this)}function y(R,F,q){let D=!1;function L(te){if(D)return;D=!0;const T=R._readableState,Z=R._writableState;d(te,Z,T),Z&&(Z.closed=!0),T&&(T.closed=!0),typeof q=="function"&&q(te),te?r.nextTick(_,R,te):r.nextTick(E,R)}try{R._destroy(F||null,L)}catch(te){L(te)}}function _(R,F){v(R,F),E(R)}function E(R){const F=R._readableState,q=R._writableState;q&&(q.closeEmitted=!0),F&&(F.closeEmitted=!0),(q!=null&&q.emitClose||F!=null&&F.emitClose)&&R.emit("close")}function v(R,F){const q=R._readableState,D=R._writableState;D!=null&&D.errorEmitted||q!=null&&q.errorEmitted||(D&&(D.errorEmitted=!0),q&&(q.errorEmitted=!0),R.emit("error",F))}function x(){const R=this._readableState,F=this._writableState;R&&(R.constructed=!0,R.closed=!1,R.closeEmitted=!1,R.destroyed=!1,R.errored=null,R.errorEmitted=!1,R.reading=!1,R.ended=R.readable===!1,R.endEmitted=R.readable===!1),F&&(F.constructed=!0,F.destroyed=!1,F.closed=!1,F.closeEmitted=!1,F.errored=null,F.errorEmitted=!1,F.finalCalled=!1,F.prefinished=!1,F.ended=F.writable===!1,F.ending=F.writable===!1,F.finished=F.writable===!1)}function S(R,F,q){const D=R._readableState,L=R._writableState;if(L!=null&&L.destroyed||D!=null&&D.destroyed)return this;D!=null&&D.autoDestroy||L!=null&&L.autoDestroy?R.destroy(F):F&&(F.stack,L&&!L.errored&&(L.errored=F),D&&!D.errored&&(D.errored=F),q?r.nextTick(v,R,F):v(R,F))}function m(R,F){if(typeof R._construct!="function")return;const q=R._readableState,D=R._writableState;q&&(q.constructed=!1),D&&(D.constructed=!1),R.once(c,F),!(R.listenerCount(c)>1)&&r.nextTick(h,R)}function h(R){let F=!1;function q(D){if(F){S(R,D??new t);return}F=!0;const L=R._readableState,te=R._writableState,T=te||L;L&&(L.constructed=!0),te&&(te.constructed=!0),T.destroyed?R.emit(l,D):D?S(R,D,!0):r.nextTick(g,R)}try{R._construct(D=>{r.nextTick(q,D)})}catch(D){r.nextTick(q,D)}}function g(R){R.emit(c)}function N(R){return R?.setHeader&&typeof R.abort=="function"}function C(R){R.emit("close")}function A(R,F){R.emit("error",F),r.nextTick(C,R)}function B(R,F){!R||a(R)||(!F&&!o(R)&&(F=new n),u(R)?(R.socket=null,R.destroy(F)):N(R)?R.abort():N(R.req)?R.req.abort():typeof R.destroy=="function"?R.destroy(F):typeof R.close=="function"?R.close():F?r.nextTick(A,R,F):r.nextTick(C,R),R.destroyed||(R[s]=!0))}return Ci={construct:m,destroyer:B,destroy:b,undestroy:x,errorOrDestroy:S},Ci}var ji,xo;function xa(){if(xo)return ji;xo=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=Be(),{EventEmitter:t}=ci();function n(s){t.call(this,s)}e(n.prototype,t.prototype),e(n,t),n.prototype.pipe=function(s,a){const o=this;function u(E){s.writable&&s.write(E)===!1&&o.pause&&o.pause()}o.on("data",u);function l(){o.readable&&o.resume&&o.resume()}s.on("drain",l),!s._isStdio&&(!a||a.end!==!1)&&(o.on("end",d),o.on("close",b));let c=!1;function d(){c||(c=!0,s.end())}function b(){c||(c=!0,typeof s.destroy=="function"&&s.destroy())}function y(E){_(),t.listenerCount(this,"error")===0&&this.emit("error",E)}i(o,"error",y),i(s,"error",y);function _(){o.removeListener("data",u),s.removeListener("drain",l),o.removeListener("end",d),o.removeListener("close",b),o.removeListener("error",y),s.removeListener("error",y),o.removeListener("end",_),o.removeListener("close",_),s.removeListener("close",_)}return o.on("end",_),o.on("close",_),s.on("close",_),s.emit("pipe",o),s};function i(s,a,o){if(typeof s.prependListener=="function")return s.prependListener(a,o);!s._events||!s._events[a]?s.on(a,o):r(s._events[a])?s._events[a].unshift(o):s._events[a]=[o,s._events[a]]}return ji={Stream:n,prependListener:i},ji}var $i={exports:{}},Eo;function di(){return Eo||(Eo=1,(function(r){const{SymbolDispose:e}=Be(),{AbortError:t,codes:n}=it(),{isNodeStream:i,isWebStream:s,kControllerErrorFunction:a}=$t(),o=Qt(),{ERR_INVALID_ARG_TYPE:u}=n;let l;const c=(d,b)=>{if(typeof d!="object"||!("aborted"in d))throw new u(b,"AbortSignal",d)};r.exports.addAbortSignal=function(b,y){if(c(b,"signal"),!i(y)&&!s(y))throw new u("stream",["ReadableStream","WritableStream","Stream"],y);return r.exports.addAbortSignalNoValidate(b,y)},r.exports.addAbortSignalNoValidate=function(d,b){if(typeof d!="object"||!("aborted"in d))return b;const y=i(b)?()=>{b.destroy(new t(void 0,{cause:d.reason}))}:()=>{b[a](new t(void 0,{cause:d.reason}))};if(d.aborted)y();else{l=l||at().addAbortListener;const _=l(d,y);o(b,_[e])}return b}})($i)),$i.exports}var Fi,So;function Td(){if(So)return Fi;So=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:n}=Be(),{Buffer:i}=jt(),{inspect:s}=at();return Fi=class{constructor(){this.head=null,this.tail=null,this.length=0}push(o){const u={data:o,next:null};this.length>0?this.tail.next=u:this.head=u,this.tail=u,++this.length}unshift(o){const u={data:o,next:this.head};this.length===0&&(this.tail=u),this.head=u,++this.length}shift(){if(this.length===0)return;const o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}clear(){this.head=this.tail=null,this.length=0}join(o){if(this.length===0)return"";let u=this.head,l=""+u.data;for(;(u=u.next)!==null;)l+=o+u.data;return l}concat(o){if(this.length===0)return i.alloc(0);const u=i.allocUnsafe(o>>>0);let l=this.head,c=0;for(;l;)t(u,l.data,c),c+=l.data.length,l=l.next;return u}consume(o,u){const l=this.head.data;if(o<l.length){const c=l.slice(0,o);return this.head.data=l.slice(o),c}return o===l.length?this.shift():u?this._getString(o):this._getBuffer(o)}first(){return this.head.data}*[e](){for(let o=this.head;o;o=o.next)yield o.data}_getString(o){let u="",l=this.head,c=0;do{const d=l.data;if(o>d.length)u+=d,o-=d.length;else{o===d.length?(u+=d,++c,l.next?this.head=l.next:this.head=this.tail=null):(u+=r(d,0,o),this.head=l,l.data=r(d,o));break}++c}while((l=l.next)!==null);return this.length-=c,u}_getBuffer(o){const u=i.allocUnsafe(o),l=o;let c=this.head,d=0;do{const b=c.data;if(o>b.length)t(u,b,l-o),o-=b.length;else{o===b.length?(t(u,b,l-o),++d,c.next?this.head=c.next:this.head=this.tail=null):(t(u,new n(b.buffer,b.byteOffset,o),l-o),this.head=c,c.data=b.slice(o));break}++d}while((c=c.next)!==null);return this.length-=d,u}[Symbol.for("nodejs.util.inspect.custom")](o,u){return s(this,{...u,depth:0,customInspect:!1})}},Fi}var ki,Io;function hi(){if(Io)return ki;Io=1;const{MathFloor:r,NumberIsInteger:e}=Be(),{validateInteger:t}=Rn(),{ERR_INVALID_ARG_VALUE:n}=it().codes;let i=16*1024,s=16;function a(c,d,b){return c.highWaterMark!=null?c.highWaterMark:d?c[b]:null}function o(c){return c?s:i}function u(c,d){t(d,"value",0),c?s=d:i=d}function l(c,d,b,y){const _=a(d,y,b);if(_!=null){if(!e(_)||_<0){const E=y?`options.${b}`:"options.highWaterMark";throw new n(E,_)}return r(_)}return o(c.objectMode)}return ki={getHighWaterMark:l,getDefaultHighWaterMark:o,setDefaultHighWaterMark:u},ki}var Pi={},Un={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var No;function Ad(){return No||(No=1,(function(r,e){var t=jt(),n=t.Buffer;function i(a,o){for(var u in a)o[u]=a[u]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?r.exports=t:(i(t,e),e.Buffer=s);function s(a,o,u){return n(a,o,u)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,o,u){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,o,u)},s.alloc=function(a,o,u){if(typeof a!="number")throw new TypeError("Argument must be a number");var l=n(a);return o!==void 0?typeof u=="string"?l.fill(o,u):l.fill(o):l.fill(0),l},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(a)}})(Un,Un.exports)),Un.exports}var Ro;function Dd(){if(Ro)return Pi;Ro=1;var r=Ad().Buffer,e=r.isEncoding||function(x){switch(x=""+x,x&&x.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(x){if(!x)return"utf8";for(var S;;)switch(x){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 x;default:if(S)return;x=(""+x).toLowerCase(),S=!0}}function n(x){var S=t(x);if(typeof S!="string"&&(r.isEncoding===e||!e(x)))throw new Error("Unknown encoding: "+x);return S||x}Pi.StringDecoder=i;function i(x){this.encoding=n(x);var S;switch(this.encoding){case"utf16le":this.text=d,this.end=b,S=4;break;case"utf8":this.fillLast=u,S=4;break;case"base64":this.text=y,this.end=_,S=3;break;default:this.write=E,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(S)}i.prototype.write=function(x){if(x.length===0)return"";var S,m;if(this.lastNeed){if(S=this.fillLast(x),S===void 0)return"";m=this.lastNeed,this.lastNeed=0}else m=0;return m<x.length?S?S+this.text(x,m):this.text(x,m):S||""},i.prototype.end=c,i.prototype.text=l,i.prototype.fillLast=function(x){if(this.lastNeed<=x.length)return x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,this.lastTotal-this.lastNeed,0,x.length),this.lastNeed-=x.length};function s(x){return x<=127?0:x>>5===6?2:x>>4===14?3:x>>3===30?4:x>>6===2?-1:-2}function a(x,S,m){var h=S.length-1;if(h<m)return 0;var g=s(S[h]);return g>=0?(g>0&&(x.lastNeed=g-1),g):--h<m||g===-2?0:(g=s(S[h]),g>=0?(g>0&&(x.lastNeed=g-2),g):--h<m||g===-2?0:(g=s(S[h]),g>=0?(g>0&&(g===2?g=0:x.lastNeed=g-3),g):0))}function o(x,S,m){if((S[0]&192)!==128)return x.lastNeed=0,"�";if(x.lastNeed>1&&S.length>1){if((S[1]&192)!==128)return x.lastNeed=1,"�";if(x.lastNeed>2&&S.length>2&&(S[2]&192)!==128)return x.lastNeed=2,"�"}}function u(x){var S=this.lastTotal-this.lastNeed,m=o(this,x);if(m!==void 0)return m;if(this.lastNeed<=x.length)return x.copy(this.lastChar,S,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);x.copy(this.lastChar,S,0,x.length),this.lastNeed-=x.length}function l(x,S){var m=a(this,x,S);if(!this.lastNeed)return x.toString("utf8",S);this.lastTotal=m;var h=x.length-(m-this.lastNeed);return x.copy(this.lastChar,0,h),x.toString("utf8",S,h)}function c(x){var S=x&&x.length?this.write(x):"";return this.lastNeed?S+"�":S}function d(x,S){if((x.length-S)%2===0){var m=x.toString("utf16le",S);if(m){var h=m.charCodeAt(m.length-1);if(h>=55296&&h<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1],m.slice(0,-1)}return m}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=x[x.length-1],x.toString("utf16le",S,x.length-1)}function b(x){var S=x&&x.length?this.write(x):"";if(this.lastNeed){var m=this.lastTotal-this.lastNeed;return S+this.lastChar.toString("utf16le",0,m)}return S}function y(x,S){var m=(x.length-S)%3;return m===0?x.toString("base64",S):(this.lastNeed=3-m,this.lastTotal=3,m===1?this.lastChar[0]=x[x.length-1]:(this.lastChar[0]=x[x.length-2],this.lastChar[1]=x[x.length-1]),x.toString("base64",S,x.length-m))}function _(x){var S=x&&x.length?this.write(x):"";return this.lastNeed?S+this.lastChar.toString("base64",0,3-this.lastNeed):S}function E(x){return x.toString(this.encoding)}function v(x){return x&&x.length?this.write(x):""}return Pi}var Mi,To;function sc(){if(To)return Mi;To=1;const r=pr(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:n}=Be(),{Buffer:i}=jt(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:a}=it().codes;function o(u,l,c){let d;if(typeof l=="string"||l instanceof i)return new u({objectMode:!0,...c,read(){this.push(l),this.push(null)}});let b;if(l&&l[t])b=!0,d=l[t]();else if(l&&l[n])b=!1,d=l[n]();else throw new s("iterable",["Iterable"],l);const y=new u({objectMode:!0,highWaterMark:1,...c});let _=!1;y._read=function(){_||(_=!0,v())},y._destroy=function(x,S){e(E(x),()=>r.nextTick(S,x),m=>r.nextTick(S,m||x))};async function E(x){const S=x!=null,m=typeof d.throw=="function";if(S&&m){const{value:h,done:g}=await d.throw(x);if(await h,g)return}if(typeof d.return=="function"){const{value:h}=await d.return();await h}}async function v(){for(;;){try{const{value:x,done:S}=b?await d.next():d.next();if(S)y.push(null);else{const m=x&&typeof x.then=="function"?await x:x;if(m===null)throw _=!1,new a;if(y.push(m))continue;_=!1}}catch(x){y.destroy(x)}break}}return y}return Mi=o,Mi}var Bi,Ao;function fi(){if(Ao)return Bi;Ao=1;const r=pr(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:s,ObjectKeys:a,ObjectSetPrototypeOf:o,Promise:u,SafeSet:l,SymbolAsyncDispose:c,SymbolAsyncIterator:d,Symbol:b}=Be();Bi=le,le.ReadableState=ye;const{EventEmitter:y}=ci(),{Stream:_,prependListener:E}=xa(),{Buffer:v}=jt(),{addAbortSignal:x}=di(),S=Qt();let m=at().debuglog("stream",O=>{m=O});const h=Td(),g=$r(),{getHighWaterMark:N,getDefaultHighWaterMark:C}=hi(),{aggregateTwoErrors:A,codes:{ERR_INVALID_ARG_TYPE:B,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:F,ERR_STREAM_PUSH_AFTER_EOF:q,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:D},AbortError:L}=it(),{validateObject:te}=Rn(),T=b("kPaused"),{StringDecoder:Z}=Dd(),k=sc();o(le.prototype,_.prototype),o(le,_);const Y=()=>{},{errorOrDestroy:w}=g,H=1,K=2,Q=4,ue=8,V=16,G=32,z=64,U=128,ee=256,re=512,fe=1024,ge=2048,j=4096,W=8192,se=16384,he=32768,pe=65536,me=1<<17,J=1<<18;function ce(O){return{enumerable:!1,get(){return(this.state&O)!==0},set(M){M?this.state|=O:this.state&=~O}}}s(ye.prototype,{objectMode:ce(H),ended:ce(K),endEmitted:ce(Q),reading:ce(ue),constructed:ce(V),sync:ce(G),needReadable:ce(z),emittedReadable:ce(U),readableListening:ce(ee),resumeScheduled:ce(re),errorEmitted:ce(fe),emitClose:ce(ge),autoDestroy:ce(j),destroyed:ce(W),closed:ce(se),closeEmitted:ce(he),multiAwaitDrain:ce(pe),readingMore:ce(me),dataEmitted:ce(J)});function ye(O,M,be){typeof be!="boolean"&&(be=M instanceof Ot()),this.state=ge|j|V|G,O&&O.objectMode&&(this.state|=H),be&&O&&O.readableObjectMode&&(this.state|=H),this.highWaterMark=O?N(this,O,"readableHighWaterMark",be):C(!1),this.buffer=new h,this.length=0,this.pipes=[],this.flowing=null,this[T]=null,O&&O.emitClose===!1&&(this.state&=~ge),O&&O.autoDestroy===!1&&(this.state&=~j),this.errored=null,this.defaultEncoding=O&&O.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,O&&O.encoding&&(this.decoder=new Z(O.encoding),this.encoding=O.encoding)}function le(O){if(!(this instanceof le))return new le(O);const M=this instanceof Ot();this._readableState=new ye(O,this,M),O&&(typeof O.read=="function"&&(this._read=O.read),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.construct=="function"&&(this._construct=O.construct),O.signal&&!M&&x(O.signal,this)),_.call(this,O),g.construct(this,()=>{this._readableState.needReadable&&X(this,this._readableState)})}le.prototype.destroy=g.destroy,le.prototype._undestroy=g.undestroy,le.prototype._destroy=function(O,M){M(O)},le.prototype[y.captureRejectionSymbol]=function(O){this.destroy(O)},le.prototype[c]=function(){let O;return this.destroyed||(O=this.readableEnded?null:new L,this.destroy(O)),new u((M,be)=>S(this,_e=>_e&&_e!==O?be(_e):M(null)))},le.prototype.push=function(O,M){return Re(this,O,M,!1)},le.prototype.unshift=function(O,M){return Re(this,O,M,!0)};function Re(O,M,be,_e){m("readableAddChunk",M);const ve=O._readableState;let Qe;if((ve.state&H)===0&&(typeof M=="string"?(be=be||ve.defaultEncoding,ve.encoding!==be&&(_e&&ve.encoding?M=v.from(M,be).toString(ve.encoding):(M=v.from(M,be),be=""))):M instanceof v?be="":_._isUint8Array(M)?(M=_._uint8ArrayToBuffer(M),be=""):M!=null&&(Qe=new B("chunk",["string","Buffer","Uint8Array"],M))),Qe)w(O,Qe);else if(M===null)ve.state&=~ue,f(O,ve);else if((ve.state&H)!==0||M&&M.length>0)if(_e)if((ve.state&Q)!==0)w(O,new D);else{if(ve.destroyed||ve.errored)return!1;ze(O,ve,M,!0)}else if(ve.ended)w(O,new q);else{if(ve.destroyed||ve.errored)return!1;ve.state&=~ue,ve.decoder&&!be?(M=ve.decoder.write(M),ve.objectMode||M.length!==0?ze(O,ve,M,!1):X(O,ve)):ze(O,ve,M,!1)}else _e||(ve.state&=~ue,X(O,ve));return!ve.ended&&(ve.length<ve.highWaterMark||ve.length===0)}function ze(O,M,be,_e){M.flowing&&M.length===0&&!M.sync&&O.listenerCount("data")>0?((M.state&pe)!==0?M.awaitDrainWriters.clear():M.awaitDrainWriters=null,M.dataEmitted=!0,O.emit("data",be)):(M.length+=M.objectMode?1:be.length,_e?M.buffer.unshift(be):M.buffer.push(be),(M.state&z)!==0&&p(O)),X(O,M)}le.prototype.isPaused=function(){const O=this._readableState;return O[T]===!0||O.flowing===!1},le.prototype.setEncoding=function(O){const M=new Z(O);this._readableState.decoder=M,this._readableState.encoding=this._readableState.decoder.encoding;const be=this._readableState.buffer;let _e="";for(const ve of be)_e+=M.write(ve);return be.clear(),_e!==""&&be.push(_e),this._readableState.length=_e.length,this};const Ie=1073741824;function Xe(O){if(O>Ie)throw new F("size","<= 1GiB",O);return O--,O|=O>>>1,O|=O>>>2,O|=O>>>4,O|=O>>>8,O|=O>>>16,O++,O}function I(O,M){return O<=0||M.length===0&&M.ended?0:(M.state&H)!==0?1:n(O)?M.flowing&&M.length?M.buffer.first().length:M.length:O<=M.length?O:M.ended?M.length:0}le.prototype.read=function(O){m("read",O),O===void 0?O=NaN:t(O)||(O=i(O,10));const M=this._readableState,be=O;if(O>M.highWaterMark&&(M.highWaterMark=Xe(O)),O!==0&&(M.state&=~U),O===0&&M.needReadable&&((M.highWaterMark!==0?M.length>=M.highWaterMark:M.length>0)||M.ended))return m("read: emitReadable",M.length,M.ended),M.length===0&&M.ended?He(this):p(this),null;if(O=I(O,M),O===0&&M.ended)return M.length===0&&He(this),null;let _e=(M.state&z)!==0;if(m("need readable",_e),(M.length===0||M.length-O<M.highWaterMark)&&(_e=!0,m("length less than watermark",_e)),M.ended||M.reading||M.destroyed||M.errored||!M.constructed)_e=!1,m("reading, ended or constructing",_e);else if(_e){m("do read"),M.state|=ue|G,M.length===0&&(M.state|=z);try{this._read(M.highWaterMark)}catch(Qe){w(this,Qe)}M.state&=~G,M.reading||(O=I(be,M))}let ve;return O>0?ve=qe(O,M):ve=null,ve===null?(M.needReadable=M.length<=M.highWaterMark,O=0):(M.length-=O,M.multiAwaitDrain?M.awaitDrainWriters.clear():M.awaitDrainWriters=null),M.length===0&&(M.ended||(M.needReadable=!0),be!==O&&M.ended&&He(this)),ve!==null&&!M.errorEmitted&&!M.closeEmitted&&(M.dataEmitted=!0,this.emit("data",ve)),ve};function f(O,M){if(m("onEofChunk"),!M.ended){if(M.decoder){const be=M.decoder.end();be&&be.length&&(M.buffer.push(be),M.length+=M.objectMode?1:be.length)}M.ended=!0,M.sync?p(O):(M.needReadable=!1,M.emittedReadable=!0,$(O))}}function p(O){const M=O._readableState;m("emitReadable",M.needReadable,M.emittedReadable),M.needReadable=!1,M.emittedReadable||(m("emitReadable",M.flowing),M.emittedReadable=!0,r.nextTick($,O))}function $(O){const M=O._readableState;m("emitReadable_",M.destroyed,M.length,M.ended),!M.destroyed&&!M.errored&&(M.length||M.ended)&&(O.emit("readable"),M.emittedReadable=!1),M.needReadable=!M.flowing&&!M.ended&&M.length<=M.highWaterMark,De(O)}function X(O,M){!M.readingMore&&M.constructed&&(M.readingMore=!0,r.nextTick(oe,O,M))}function oe(O,M){for(;!M.reading&&!M.ended&&(M.length<M.highWaterMark||M.flowing&&M.length===0);){const be=M.length;if(m("maybeReadMore read 0"),O.read(0),be===M.length)break}M.readingMore=!1}le.prototype._read=function(O){throw new R("_read()")},le.prototype.pipe=function(O,M){const be=this,_e=this._readableState;_e.pipes.length===1&&(_e.multiAwaitDrain||(_e.multiAwaitDrain=!0,_e.awaitDrainWriters=new l(_e.awaitDrainWriters?[_e.awaitDrainWriters]:[]))),_e.pipes.push(O),m("pipe count=%d opts=%j",_e.pipes.length,M);const Qe=(!M||M.end!==!1)&&O!==r.stdout&&O!==r.stderr?Cn:P;_e.endEmitted?r.nextTick(Qe):be.once("end",Qe),O.on("unpipe",Ye);function Ye(ne,ie){m("onunpipe"),ne===be&&ie&&ie.hasUnpiped===!1&&(ie.hasUnpiped=!0,Tt())}function Cn(){m("onend"),O.end()}let Rt,jn=!1;function Tt(){m("cleanup"),O.removeListener("close",qr),O.removeListener("finish",We),Rt&&O.removeListener("drain",Rt),O.removeListener("error",yr),O.removeListener("unpipe",Ye),be.removeListener("end",Cn),be.removeListener("end",P),be.removeListener("data",mr),jn=!0,Rt&&_e.awaitDrainWriters&&(!O._writableState||O._writableState.needDrain)&&Rt()}function Br(){jn||(_e.pipes.length===1&&_e.pipes[0]===O?(m("false write response, pause",0),_e.awaitDrainWriters=O,_e.multiAwaitDrain=!1):_e.pipes.length>1&&_e.pipes.includes(O)&&(m("false write response, pause",_e.awaitDrainWriters.size),_e.awaitDrainWriters.add(O)),be.pause()),Rt||(Rt=de(be,O),O.on("drain",Rt))}be.on("data",mr);function mr(ne){m("ondata");const ie=O.write(ne);m("dest.write",ie),ie===!1&&Br()}function yr(ne){if(m("onerror",ne),P(),O.removeListener("error",yr),O.listenerCount("error")===0){const ie=O._writableState||O._readableState;ie&&!ie.errorEmitted?w(O,ne):O.emit("error",ne)}}E(O,"error",yr);function qr(){O.removeListener("finish",We),P()}O.once("close",qr);function We(){m("onfinish"),O.removeListener("close",qr),P()}O.once("finish",We);function P(){m("unpipe"),be.unpipe(O)}return O.emit("pipe",be),O.writableNeedDrain===!0?Br():_e.flowing||(m("pipe resume"),be.resume()),O};function de(O,M){return function(){const _e=O._readableState;_e.awaitDrainWriters===M?(m("pipeOnDrain",1),_e.awaitDrainWriters=null):_e.multiAwaitDrain&&(m("pipeOnDrain",_e.awaitDrainWriters.size),_e.awaitDrainWriters.delete(M)),(!_e.awaitDrainWriters||_e.awaitDrainWriters.size===0)&&O.listenerCount("data")&&O.resume()}}le.prototype.unpipe=function(O){const M=this._readableState,be={hasUnpiped:!1};if(M.pipes.length===0)return this;if(!O){const ve=M.pipes;M.pipes=[],this.pause();for(let Qe=0;Qe<ve.length;Qe++)ve[Qe].emit("unpipe",this,{hasUnpiped:!1});return this}const _e=e(M.pipes,O);return _e===-1?this:(M.pipes.splice(_e,1),M.pipes.length===0&&this.pause(),O.emit("unpipe",this,be),this)},le.prototype.on=function(O,M){const be=_.prototype.on.call(this,O,M),_e=this._readableState;return O==="data"?(_e.readableListening=this.listenerCount("readable")>0,_e.flowing!==!1&&this.resume()):O==="readable"&&!_e.endEmitted&&!_e.readableListening&&(_e.readableListening=_e.needReadable=!0,_e.flowing=!1,_e.emittedReadable=!1,m("on readable",_e.length,_e.reading),_e.length?p(this):_e.reading||r.nextTick(ke,this)),be},le.prototype.addListener=le.prototype.on,le.prototype.removeListener=function(O,M){const be=_.prototype.removeListener.call(this,O,M);return O==="readable"&&r.nextTick(Ee,this),be},le.prototype.off=le.prototype.removeListener,le.prototype.removeAllListeners=function(O){const M=_.prototype.removeAllListeners.apply(this,arguments);return(O==="readable"||O===void 0)&&r.nextTick(Ee,this),M};function Ee(O){const M=O._readableState;M.readableListening=O.listenerCount("readable")>0,M.resumeScheduled&&M[T]===!1?M.flowing=!0:O.listenerCount("data")>0?O.resume():M.readableListening||(M.flowing=null)}function ke(O){m("readable nexttick read 0"),O.read(0)}le.prototype.resume=function(){const O=this._readableState;return O.flowing||(m("resume"),O.flowing=!O.readableListening,Le(this,O)),O[T]=!1,this};function Le(O,M){M.resumeScheduled||(M.resumeScheduled=!0,r.nextTick(Oe,O,M))}function Oe(O,M){m("resume",M.reading),M.reading||O.read(0),M.resumeScheduled=!1,O.emit("resume"),De(O),M.flowing&&!M.reading&&O.read(0)}le.prototype.pause=function(){return m("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(m("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[T]=!0,this};function De(O){const M=O._readableState;for(m("flow",M.flowing);M.flowing&&O.read()!==null;);}le.prototype.wrap=function(O){let M=!1;O.on("data",_e=>{!this.push(_e)&&O.pause&&(M=!0,O.pause())}),O.on("end",()=>{this.push(null)}),O.on("error",_e=>{w(this,_e)}),O.on("close",()=>{this.destroy()}),O.on("destroy",()=>{this.destroy()}),this._read=()=>{M&&O.resume&&(M=!1,O.resume())};const be=a(O);for(let _e=1;_e<be.length;_e++){const ve=be[_e];this[ve]===void 0&&typeof O[ve]=="function"&&(this[ve]=O[ve].bind(O))}return this},le.prototype[d]=function(){return mt(this)},le.prototype.iterator=function(O){return O!==void 0&&te(O,"options"),mt(this,O)};function mt(O,M){typeof O.read!="function"&&(O=le.wrap(O,{objectMode:!0}));const be=Mt(O,M);return be.stream=O,be}async function*Mt(O,M){let be=Y;function _e(Ye){this===O?(be(),be=Y):be=Ye}O.on("readable",_e);let ve;const Qe=S(O,{writable:!1},Ye=>{ve=Ye?A(ve,Ye):null,be(),be=Y});try{for(;;){const Ye=O.destroyed?null:O.read();if(Ye!==null)yield Ye;else{if(ve)throw ve;if(ve===null)return;await new u(_e)}}}catch(Ye){throw ve=A(ve,Ye),ve}finally{(ve||M?.destroyOnReturn!==!1)&&(ve===void 0||O._readableState.autoDestroy)?g.destroyer(O,null):(O.off("readable",_e),Qe())}}s(le.prototype,{readable:{__proto__:null,get(){const O=this._readableState;return!!O&&O.readable!==!1&&!O.destroyed&&!O.errorEmitted&&!O.endEmitted},set(O){this._readableState&&(this._readableState.readable=!!O)}},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(O){this._readableState&&(this._readableState.flowing=O)}},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(O){this._readableState&&(this._readableState.destroyed=O)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(ye.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[T]!==!1},set(O){this[T]=!!O}}}),le._fromList=qe;function qe(O,M){if(M.length===0)return null;let be;return M.objectMode?be=M.buffer.shift():!O||O>=M.length?(M.decoder?be=M.buffer.join(""):M.buffer.length===1?be=M.buffer.first():be=M.buffer.concat(M.length),M.buffer.clear()):be=M.buffer.consume(O,M.decoder),be}function He(O){const M=O._readableState;m("endReadable",M.endEmitted),M.endEmitted||(M.ended=!0,r.nextTick(On,M,O))}function On(O,M){if(m("endReadableNT",O.endEmitted,O.length),!O.errored&&!O.closeEmitted&&!O.endEmitted&&O.length===0){if(O.endEmitted=!0,M.emit("end"),M.writable&&M.allowHalfOpen===!1)r.nextTick(Bt,M);else if(O.autoDestroy){const be=M._writableState;(!be||be.autoDestroy&&(be.finished||be.writable===!1))&&M.destroy()}}}function Bt(O){O.writable&&!O.writableEnded&&!O.destroyed&&O.end()}le.from=function(O,M){return k(le,O,M)};let gr;function Mr(){return gr===void 0&&(gr={}),gr}return le.fromWeb=function(O,M){return Mr().newStreamReadableFromReadableStream(O,M)},le.toWeb=function(O,M){return Mr().newReadableStreamFromStreamReadable(O,M)},le.wrap=function(O,M){var be,_e;return new le({objectMode:(be=(_e=O.readableObjectMode)!==null&&_e!==void 0?_e:O.objectMode)!==null&&be!==void 0?be:!0,...M,destroy(ve,Qe){g.destroyer(O,ve),Qe(ve)}}).wrap(O)},Bi}var qi,Do;function Ea(){if(Do)return qi;Do=1;const r=pr(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:s,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:o,Symbol:u,SymbolHasInstance:l}=Be();qi=te,te.WritableState=D;const{EventEmitter:c}=ci(),d=xa().Stream,{Buffer:b}=jt(),y=$r(),{addAbortSignal:_}=di(),{getHighWaterMark:E,getDefaultHighWaterMark:v}=hi(),{ERR_INVALID_ARG_TYPE:x,ERR_METHOD_NOT_IMPLEMENTED:S,ERR_MULTIPLE_CALLBACK:m,ERR_STREAM_CANNOT_PIPE:h,ERR_STREAM_DESTROYED:g,ERR_STREAM_ALREADY_FINISHED:N,ERR_STREAM_NULL_VALUES:C,ERR_STREAM_WRITE_AFTER_END:A,ERR_UNKNOWN_ENCODING:B}=it().codes,{errorOrDestroy:R}=y;a(te.prototype,d.prototype),a(te,d);function F(){}const q=u("kOnFinished");function D(j,W,se){typeof se!="boolean"&&(se=W instanceof Ot()),this.objectMode=!!(j&&j.objectMode),se&&(this.objectMode=this.objectMode||!!(j&&j.writableObjectMode)),this.highWaterMark=j?E(this,j,"writableHighWaterMark",se):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const he=!!(j&&j.decodeStrings===!1);this.decodeStrings=!he,this.defaultEncoding=j&&j.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=w.bind(void 0,W),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,L(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!j||j.emitClose!==!1,this.autoDestroy=!j||j.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[q]=[]}function L(j){j.buffered=[],j.bufferedIndex=0,j.allBuffers=!0,j.allNoop=!0}D.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(D.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function te(j){const W=this instanceof Ot();if(!W&&!n(te,this))return new te(j);this._writableState=new D(j,this,W),j&&(typeof j.write=="function"&&(this._write=j.write),typeof j.writev=="function"&&(this._writev=j.writev),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.final=="function"&&(this._final=j.final),typeof j.construct=="function"&&(this._construct=j.construct),j.signal&&_(j.signal,this)),d.call(this,j),y.construct(this,()=>{const se=this._writableState;se.writing||ue(this,se),U(this,se)})}i(te,l,{__proto__:null,value:function(j){return n(this,j)?!0:this!==te?!1:j&&j._writableState instanceof D}}),te.prototype.pipe=function(){R(this,new h)};function T(j,W,se,he){const pe=j._writableState;if(typeof se=="function")he=se,se=pe.defaultEncoding;else{if(!se)se=pe.defaultEncoding;else if(se!=="buffer"&&!b.isEncoding(se))throw new B(se);typeof he!="function"&&(he=F)}if(W===null)throw new C;if(!pe.objectMode)if(typeof W=="string")pe.decodeStrings!==!1&&(W=b.from(W,se),se="buffer");else if(W instanceof b)se="buffer";else if(d._isUint8Array(W))W=d._uint8ArrayToBuffer(W),se="buffer";else throw new x("chunk",["string","Buffer","Uint8Array"],W);let me;return pe.ending?me=new A:pe.destroyed&&(me=new g("write")),me?(r.nextTick(he,me),R(j,me,!0),me):(pe.pendingcb++,Z(j,pe,W,se,he))}te.prototype.write=function(j,W,se){return T(this,j,W,se)===!0},te.prototype.cork=function(){this._writableState.corked++},te.prototype.uncork=function(){const j=this._writableState;j.corked&&(j.corked--,j.writing||ue(this,j))},te.prototype.setDefaultEncoding=function(W){if(typeof W=="string"&&(W=o(W)),!b.isEncoding(W))throw new B(W);return this._writableState.defaultEncoding=W,this};function Z(j,W,se,he,pe){const me=W.objectMode?1:se.length;W.length+=me;const J=W.length<W.highWaterMark;return J||(W.needDrain=!0),W.writing||W.corked||W.errored||!W.constructed?(W.buffered.push({chunk:se,encoding:he,callback:pe}),W.allBuffers&&he!=="buffer"&&(W.allBuffers=!1),W.allNoop&&pe!==F&&(W.allNoop=!1)):(W.writelen=me,W.writecb=pe,W.writing=!0,W.sync=!0,j._write(se,he,W.onwrite),W.sync=!1),J&&!W.errored&&!W.destroyed}function k(j,W,se,he,pe,me,J){W.writelen=he,W.writecb=J,W.writing=!0,W.sync=!0,W.destroyed?W.onwrite(new g("write")):se?j._writev(pe,W.onwrite):j._write(pe,me,W.onwrite),W.sync=!1}function Y(j,W,se,he){--W.pendingcb,he(se),Q(W),R(j,se)}function w(j,W){const se=j._writableState,he=se.sync,pe=se.writecb;if(typeof pe!="function"){R(j,new m);return}se.writing=!1,se.writecb=null,se.length-=se.writelen,se.writelen=0,W?(W.stack,se.errored||(se.errored=W),j._readableState&&!j._readableState.errored&&(j._readableState.errored=W),he?r.nextTick(Y,j,se,W,pe):Y(j,se,W,pe)):(se.buffered.length>se.bufferedIndex&&ue(j,se),he?se.afterWriteTickInfo!==null&&se.afterWriteTickInfo.cb===pe?se.afterWriteTickInfo.count++:(se.afterWriteTickInfo={count:1,cb:pe,stream:j,state:se},r.nextTick(H,se.afterWriteTickInfo)):K(j,se,1,pe))}function H({stream:j,state:W,count:se,cb:he}){return W.afterWriteTickInfo=null,K(j,W,se,he)}function K(j,W,se,he){for(!W.ending&&!j.destroyed&&W.length===0&&W.needDrain&&(W.needDrain=!1,j.emit("drain"));se-- >0;)W.pendingcb--,he();W.destroyed&&Q(W),U(j,W)}function Q(j){if(j.writing)return;for(let pe=j.bufferedIndex;pe<j.buffered.length;++pe){var W;const{chunk:me,callback:J}=j.buffered[pe],ce=j.objectMode?1:me.length;j.length-=ce,J((W=j.errored)!==null&&W!==void 0?W:new g("write"))}const se=j[q].splice(0);for(let pe=0;pe<se.length;pe++){var he;se[pe]((he=j.errored)!==null&&he!==void 0?he:new g("end"))}L(j)}function ue(j,W){if(W.corked||W.bufferProcessing||W.destroyed||!W.constructed)return;const{buffered:se,bufferedIndex:he,objectMode:pe}=W,me=se.length-he;if(!me)return;let J=he;if(W.bufferProcessing=!0,me>1&&j._writev){W.pendingcb-=me-1;const ce=W.allNoop?F:le=>{for(let Re=J;Re<se.length;++Re)se[Re].callback(le)},ye=W.allNoop&&J===0?se:e(se,J);ye.allBuffers=W.allBuffers,k(j,W,!0,W.length,ye,"",ce),L(W)}else{do{const{chunk:ce,encoding:ye,callback:le}=se[J];se[J++]=null;const Re=pe?1:ce.length;k(j,W,!1,Re,ce,ye,le)}while(J<se.length&&!W.writing);J===se.length?L(W):J>256?(se.splice(0,J),W.bufferedIndex=0):W.bufferedIndex=J}W.bufferProcessing=!1}te.prototype._write=function(j,W,se){if(this._writev)this._writev([{chunk:j,encoding:W}],se);else throw new S("_write()")},te.prototype._writev=null,te.prototype.end=function(j,W,se){const he=this._writableState;typeof j=="function"?(se=j,j=null,W=null):typeof W=="function"&&(se=W,W=null);let pe;if(j!=null){const me=T(this,j,W);me instanceof t&&(pe=me)}return he.corked&&(he.corked=1,this.uncork()),pe||(!he.errored&&!he.ending?(he.ending=!0,U(this,he,!0),he.ended=!0):he.finished?pe=new N("end"):he.destroyed&&(pe=new g("end"))),typeof se=="function"&&(pe||he.finished?r.nextTick(se,pe):he[q].push(se)),this};function V(j){return j.ending&&!j.destroyed&&j.constructed&&j.length===0&&!j.errored&&j.buffered.length===0&&!j.finished&&!j.writing&&!j.errorEmitted&&!j.closeEmitted}function G(j,W){let se=!1;function he(pe){if(se){R(j,pe??m());return}if(se=!0,W.pendingcb--,pe){const me=W[q].splice(0);for(let J=0;J<me.length;J++)me[J](pe);R(j,pe,W.sync)}else V(W)&&(W.prefinished=!0,j.emit("prefinish"),W.pendingcb++,r.nextTick(ee,j,W))}W.sync=!0,W.pendingcb++;try{j._final(he)}catch(pe){he(pe)}W.sync=!1}function z(j,W){!W.prefinished&&!W.finalCalled&&(typeof j._final=="function"&&!W.destroyed?(W.finalCalled=!0,G(j,W)):(W.prefinished=!0,j.emit("prefinish")))}function U(j,W,se){V(W)&&(z(j,W),W.pendingcb===0&&(se?(W.pendingcb++,r.nextTick((he,pe)=>{V(pe)?ee(he,pe):pe.pendingcb--},j,W)):V(W)&&(W.pendingcb++,ee(j,W))))}function ee(j,W){W.pendingcb--,W.finished=!0;const se=W[q].splice(0);for(let he=0;he<se.length;he++)se[he]();if(j.emit("finish"),W.autoDestroy){const he=j._readableState;(!he||he.autoDestroy&&(he.endEmitted||he.readable===!1))&&j.destroy()}}s(te.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(j){this._writableState&&(this._writableState.destroyed=j)}},writable:{__proto__:null,get(){const j=this._writableState;return!!j&&j.writable!==!1&&!j.destroyed&&!j.errored&&!j.ending&&!j.ended},set(j){this._writableState&&(this._writableState.writable=!!j)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const j=this._writableState;return j?!j.destroyed&&!j.ending&&j.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const re=y.destroy;te.prototype.destroy=function(j,W){const se=this._writableState;return!se.destroyed&&(se.bufferedIndex<se.buffered.length||se[q].length)&&r.nextTick(Q,se),re.call(this,j,W),this},te.prototype._undestroy=y.undestroy,te.prototype._destroy=function(j,W){W(j)},te.prototype[c.captureRejectionSymbol]=function(j){this.destroy(j)};let fe;function ge(){return fe===void 0&&(fe={}),fe}return te.fromWeb=function(j,W){return ge().newStreamWritableFromWritableStream(j,W)},te.toWeb=function(j){return ge().newWritableStreamFromStreamWritable(j)},qi}var Ui,Lo;function Ld(){if(Lo)return Ui;Lo=1;const r=pr(),e=jt(),{isReadable:t,isWritable:n,isIterable:i,isNodeStream:s,isReadableNodeStream:a,isWritableNodeStream:o,isDuplexNodeStream:u,isReadableStream:l,isWritableStream:c}=$t(),d=Qt(),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:_}}=it(),{destroyer:E}=$r(),v=Ot(),x=fi(),S=Ea(),{createDeferredPromise:m}=at(),h=sc(),g=globalThis.Blob||e.Blob,N=typeof g<"u"?function(D){return D instanceof g}:function(D){return!1},C=globalThis.AbortController||xn().AbortController,{FunctionPrototypeCall:A}=Be();class B extends v{constructor(D){super(D),D?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),D?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Ui=function q(D,L){if(u(D))return D;if(a(D))return F({readable:D});if(o(D))return F({writable:D});if(s(D))return F({writable:!1,readable:!1});if(l(D))return F({readable:x.fromWeb(D)});if(c(D))return F({writable:S.fromWeb(D)});if(typeof D=="function"){const{value:T,write:Z,final:k,destroy:Y}=R(D);if(i(T))return h(B,T,{objectMode:!0,write:Z,final:k,destroy:Y});const w=T?.then;if(typeof w=="function"){let H;const K=A(w,T,Q=>{if(Q!=null)throw new _("nully","body",Q)},Q=>{E(H,Q)});return H=new B({objectMode:!0,readable:!1,write:Z,final(Q){k(async()=>{try{await K,r.nextTick(Q,null)}catch(ue){r.nextTick(Q,ue)}})},destroy:Y})}throw new _("Iterable, AsyncIterable or AsyncFunction",L,T)}if(N(D))return q(D.arrayBuffer());if(i(D))return h(B,D,{objectMode:!0,writable:!1});if(l(D?.readable)&&c(D?.writable))return B.fromWeb(D);if(typeof D?.writable=="object"||typeof D?.readable=="object"){const T=D!=null&&D.readable?a(D?.readable)?D?.readable:q(D.readable):void 0,Z=D!=null&&D.writable?o(D?.writable)?D?.writable:q(D.writable):void 0;return F({readable:T,writable:Z})}const te=D?.then;if(typeof te=="function"){let T;return A(te,D,Z=>{Z!=null&&T.push(Z),T.push(null)},Z=>{E(T,Z)}),T=new B({objectMode:!0,writable:!1,read(){}})}throw new y(L,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],D)};function R(q){let{promise:D,resolve:L}=m();const te=new C,T=te.signal;return{value:q((async function*(){for(;;){const k=D;D=null;const{chunk:Y,done:w,cb:H}=await k;if(r.nextTick(H),w)return;if(T.aborted)throw new b(void 0,{cause:T.reason});({promise:D,resolve:L}=m()),yield Y}})(),{signal:T}),write(k,Y,w){const H=L;L=null,H({chunk:k,done:!1,cb:w})},final(k){const Y=L;L=null,Y({done:!0,cb:k})},destroy(k,Y){te.abort(),Y(k)}}}function F(q){const D=q.readable&&typeof q.readable.read!="function"?x.wrap(q.readable):q.readable,L=q.writable;let te=!!t(D),T=!!n(L),Z,k,Y,w,H;function K(Q){const ue=w;w=null,ue?ue(Q):Q&&H.destroy(Q)}return H=new B({readableObjectMode:!!(D!=null&&D.readableObjectMode),writableObjectMode:!!(L!=null&&L.writableObjectMode),readable:te,writable:T}),T&&(d(L,Q=>{T=!1,Q&&E(D,Q),K(Q)}),H._write=function(Q,ue,V){L.write(Q,ue)?V():Z=V},H._final=function(Q){L.end(),k=Q},L.on("drain",function(){if(Z){const Q=Z;Z=null,Q()}}),L.on("finish",function(){if(k){const Q=k;k=null,Q()}})),te&&(d(D,Q=>{te=!1,Q&&E(D,Q),K(Q)}),D.on("readable",function(){if(Y){const Q=Y;Y=null,Q()}}),D.on("end",function(){H.push(null)}),H._read=function(){for(;;){const Q=D.read();if(Q===null){Y=H._read;return}if(!H.push(Q))return}}),H._destroy=function(Q,ue){!Q&&w!==null&&(Q=new b),Y=null,Z=null,k=null,w===null?ue(Q):(w=ue,E(L,Q),E(D,Q))},H}return Ui}var Hi,Oo;function Ot(){if(Oo)return Hi;Oo=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:n}=Be();Hi=a;const i=fi(),s=Ea();n(a.prototype,i.prototype),n(a,i);{const c=t(s.prototype);for(let d=0;d<c.length;d++){const b=c[d];a.prototype[b]||(a.prototype[b]=s.prototype[b])}}function a(c){if(!(this instanceof a))return new a(c);i.call(this,c),s.call(this,c),c?(this.allowHalfOpen=c.allowHalfOpen!==!1,c.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),c.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(a.prototype,{writable:{__proto__:null,...e(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(s.prototype,"writableLength")},writableFinished:{__proto__:null,...e(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(c){this._readableState&&this._writableState&&(this._readableState.destroyed=c,this._writableState.destroyed=c)}}});let o;function u(){return o===void 0&&(o={}),o}a.fromWeb=function(c,d){return u().newStreamDuplexFromReadableWritablePair(c,d)},a.toWeb=function(c){return u().newReadableWritablePairFromDuplex(c)};let l;return a.from=function(c){return l||(l=Ld()),l(c,"body")},Hi}var Vi,Co;function ac(){if(Co)return Vi;Co=1;const{ObjectSetPrototypeOf:r,Symbol:e}=Be();Vi=a;const{ERR_METHOD_NOT_IMPLEMENTED:t}=it().codes,n=Ot(),{getHighWaterMark:i}=hi();r(a.prototype,n.prototype),r(a,n);const s=e("kCallback");function a(l){if(!(this instanceof a))return new a(l);const c=l?i(this,l,"readableHighWaterMark",!0):null;c===0&&(l={...l,highWaterMark:null,readableHighWaterMark:c,writableHighWaterMark:l.writableHighWaterMark||0}),n.call(this,l),this._readableState.sync=!1,this[s]=null,l&&(typeof l.transform=="function"&&(this._transform=l.transform),typeof l.flush=="function"&&(this._flush=l.flush)),this.on("prefinish",u)}function o(l){typeof this._flush=="function"&&!this.destroyed?this._flush((c,d)=>{if(c){l?l(c):this.destroy(c);return}d!=null&&this.push(d),this.push(null),l&&l()}):(this.push(null),l&&l())}function u(){this._final!==o&&o.call(this)}return a.prototype._final=o,a.prototype._transform=function(l,c,d){throw new t("_transform()")},a.prototype._write=function(l,c,d){const b=this._readableState,y=this._writableState,_=b.length;this._transform(l,c,(E,v)=>{if(E){d(E);return}v!=null&&this.push(v),y.ended||_===b.length||b.length<b.highWaterMark?d():this[s]=d})},a.prototype._read=function(){if(this[s]){const l=this[s];this[s]=null,l()}},Vi}var Gi,jo;function oc(){if(jo)return Gi;jo=1;const{ObjectSetPrototypeOf:r}=Be();Gi=t;const e=ac();r(t.prototype,e.prototype),r(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,i,s){s(null,n)},Gi}var Wi,$o;function Sa(){if($o)return Wi;$o=1;const r=pr(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:n,SymbolDispose:i}=Be(),s=Qt(),{once:a}=at(),o=$r(),u=Ot(),{aggregateTwoErrors:l,codes:{ERR_INVALID_ARG_TYPE:c,ERR_INVALID_RETURN_VALUE:d,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:y,ERR_STREAM_PREMATURE_CLOSE:_},AbortError:E}=it(),{validateFunction:v,validateAbortSignal:x}=Rn(),{isIterable:S,isReadable:m,isReadableNodeStream:h,isNodeStream:g,isTransformStream:N,isWebStream:C,isReadableStream:A,isReadableFinished:B}=$t(),R=globalThis.AbortController||xn().AbortController;let F,q,D;function L(Q,ue,V){let G=!1;Q.on("close",()=>{G=!0});const z=s(Q,{readable:ue,writable:V},U=>{G=!U});return{destroy:U=>{G||(G=!0,o.destroyer(Q,U||new y("pipe")))},cleanup:z}}function te(Q){return v(Q[Q.length-1],"streams[stream.length - 1]"),Q.pop()}function T(Q){if(S(Q))return Q;if(h(Q))return Z(Q);throw new c("val",["Readable","Iterable","AsyncIterable"],Q)}async function*Z(Q){q||(q=fi()),yield*q.prototype[n].call(Q)}async function k(Q,ue,V,{end:G}){let z,U=null;const ee=ge=>{if(ge&&(z=ge),U){const j=U;U=null,j()}},re=()=>new t((ge,j)=>{z?j(z):U=()=>{z?j(z):ge()}});ue.on("drain",ee);const fe=s(ue,{readable:!1},ee);try{ue.writableNeedDrain&&await re();for await(const ge of Q)ue.write(ge)||await re();G&&(ue.end(),await re()),V()}catch(ge){V(z!==ge?l(z,ge):ge)}finally{fe(),ue.off("drain",ee)}}async function Y(Q,ue,V,{end:G}){N(ue)&&(ue=ue.writable);const z=ue.getWriter();try{for await(const U of Q)await z.ready,z.write(U).catch(()=>{});await z.ready,G&&await z.close(),V()}catch(U){try{await z.abort(U),V(U)}catch(ee){V(ee)}}}function w(...Q){return H(Q,a(te(Q)))}function H(Q,ue,V){if(Q.length===1&&e(Q[0])&&(Q=Q[0]),Q.length<2)throw new b("streams");const G=new R,z=G.signal,U=V?.signal,ee=[];x(U,"options.signal");function re(){pe(new E)}D=D||at().addAbortListener;let fe;U&&(fe=D(U,re));let ge,j;const W=[];let se=0;function he(ye){pe(ye,--se===0)}function pe(ye,le){var Re;if(ye&&(!ge||ge.code==="ERR_STREAM_PREMATURE_CLOSE")&&(ge=ye),!(!ge&&!le)){for(;W.length;)W.shift()(ge);(Re=fe)===null||Re===void 0||Re[i](),G.abort(),le&&(ge||ee.forEach(ze=>ze()),r.nextTick(ue,ge,j))}}let me;for(let ye=0;ye<Q.length;ye++){const le=Q[ye],Re=ye<Q.length-1,ze=ye>0,Ie=Re||V?.end!==!1,Xe=ye===Q.length-1;if(g(le)){let I=function(f){f&&f.name!=="AbortError"&&f.code!=="ERR_STREAM_PREMATURE_CLOSE"&&he(f)};if(Ie){const{destroy:f,cleanup:p}=L(le,Re,ze);W.push(f),m(le)&&Xe&&ee.push(p)}le.on("error",I),m(le)&&Xe&&ee.push(()=>{le.removeListener("error",I)})}if(ye===0)if(typeof le=="function"){if(me=le({signal:z}),!S(me))throw new d("Iterable, AsyncIterable or Stream","source",me)}else S(le)||h(le)||N(le)?me=le:me=u.from(le);else if(typeof le=="function"){if(N(me)){var J;me=T((J=me)===null||J===void 0?void 0:J.readable)}else me=T(me);if(me=le(me,{signal:z}),Re){if(!S(me,!0))throw new d("AsyncIterable",`transform[${ye-1}]`,me)}else{var ce;F||(F=oc());const I=new F({objectMode:!0}),f=(ce=me)===null||ce===void 0?void 0:ce.then;if(typeof f=="function")se++,f.call(me,X=>{j=X,X!=null&&I.write(X),Ie&&I.end(),r.nextTick(he)},X=>{I.destroy(X),r.nextTick(he,X)});else if(S(me,!0))se++,k(me,I,he,{end:Ie});else if(A(me)||N(me)){const X=me.readable||me;se++,k(X,I,he,{end:Ie})}else throw new d("AsyncIterable or Promise","destination",me);me=I;const{destroy:p,cleanup:$}=L(me,!1,!0);W.push(p),Xe&&ee.push($)}}else if(g(le)){if(h(me)){se+=2;const I=K(me,le,he,{end:Ie});m(le)&&Xe&&ee.push(I)}else if(N(me)||A(me)){const I=me.readable||me;se++,k(I,le,he,{end:Ie})}else if(S(me))se++,k(me,le,he,{end:Ie});else throw new c("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],me);me=le}else if(C(le)){if(h(me))se++,Y(T(me),le,he,{end:Ie});else if(A(me)||S(me))se++,Y(me,le,he,{end:Ie});else if(N(me))se++,Y(me.readable,le,he,{end:Ie});else throw new c("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],me);me=le}else me=u.from(le)}return(z!=null&&z.aborted||U!=null&&U.aborted)&&r.nextTick(re),me}function K(Q,ue,V,{end:G}){let z=!1;if(ue.on("close",()=>{z||V(new _)}),Q.pipe(ue,{end:!1}),G){let U=function(){z=!0,ue.end()};B(Q)?r.nextTick(U):Q.once("end",U)}else V();return s(Q,{readable:!0,writable:!1},U=>{const ee=Q._readableState;U&&U.code==="ERR_STREAM_PREMATURE_CLOSE"&&ee&&ee.ended&&!ee.errored&&!ee.errorEmitted?Q.once("end",V).once("error",V):V(U)}),s(ue,{readable:!1,writable:!0},V)}return Wi={pipelineImpl:H,pipeline:w},Wi}var zi,Fo;function lc(){if(Fo)return zi;Fo=1;const{pipeline:r}=Sa(),e=Ot(),{destroyer:t}=$r(),{isNodeStream:n,isReadable:i,isWritable:s,isWebStream:a,isTransformStream:o,isWritableStream:u,isReadableStream:l}=$t(),{AbortError:c,codes:{ERR_INVALID_ARG_VALUE:d,ERR_MISSING_ARGS:b}}=it(),y=Qt();return zi=function(...E){if(E.length===0)throw new b("streams");if(E.length===1)return e.from(E[0]);const v=[...E];if(typeof E[0]=="function"&&(E[0]=e.from(E[0])),typeof E[E.length-1]=="function"){const F=E.length-1;E[F]=e.from(E[F])}for(let F=0;F<E.length;++F)if(!(!n(E[F])&&!a(E[F]))){if(F<E.length-1&&!(i(E[F])||l(E[F])||o(E[F])))throw new d(`streams[${F}]`,v[F],"must be readable");if(F>0&&!(s(E[F])||u(E[F])||o(E[F])))throw new d(`streams[${F}]`,v[F],"must be writable")}let x,S,m,h,g;function N(F){const q=h;h=null,q?q(F):F?g.destroy(F):!R&&!B&&g.destroy()}const C=E[0],A=r(E,N),B=!!(s(C)||u(C)||o(C)),R=!!(i(A)||l(A)||o(A));if(g=new e({writableObjectMode:!!(C!=null&&C.writableObjectMode),readableObjectMode:!!(A!=null&&A.readableObjectMode),writable:B,readable:R}),B){if(n(C))g._write=function(q,D,L){C.write(q,D)?L():x=L},g._final=function(q){C.end(),S=q},C.on("drain",function(){if(x){const q=x;x=null,q()}});else if(a(C)){const D=(o(C)?C.writable:C).getWriter();g._write=async function(L,te,T){try{await D.ready,D.write(L).catch(()=>{}),T()}catch(Z){T(Z)}},g._final=async function(L){try{await D.ready,D.close().catch(()=>{}),S=L}catch(te){L(te)}}}const F=o(A)?A.readable:A;y(F,()=>{if(S){const q=S;S=null,q()}})}if(R){if(n(A))A.on("readable",function(){if(m){const F=m;m=null,F()}}),A.on("end",function(){g.push(null)}),g._read=function(){for(;;){const F=A.read();if(F===null){m=g._read;return}if(!g.push(F))return}};else if(a(A)){const q=(o(A)?A.readable:A).getReader();g._read=async function(){for(;;)try{const{value:D,done:L}=await q.read();if(!g.push(D))return;if(L){g.push(null);return}}catch{return}}}}return g._destroy=function(F,q){!F&&h!==null&&(F=new c),m=null,x=null,S=null,h===null?q(F):(h=q,n(A)&&t(A,F))},g},zi}var ko;function Od(){if(ko)return Bn;ko=1;const r=globalThis.AbortController||xn().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:s}=it(),{validateAbortSignal:a,validateInteger:o,validateObject:u}=Rn(),l=Be().Symbol("kWeak"),c=Be().Symbol("kResistStopPropagation"),{finished:d}=Qt(),b=lc(),{addAbortSignalNoValidate:y}=di(),{isWritable:_,isNodeStream:E}=$t(),{deprecate:v}=at(),{ArrayPrototypePush:x,Boolean:S,MathFloor:m,Number:h,NumberIsNaN:g,Promise:N,PromiseReject:C,PromiseResolve:A,PromisePrototypeThen:B,Symbol:R}=Be(),F=R("kEmpty"),q=R("kEof");function D(U,ee){if(ee!=null&&u(ee,"options"),ee?.signal!=null&&a(ee.signal,"options.signal"),E(U)&&!_(U))throw new e("stream",U,"must be writable");const re=b(this,U);return ee!=null&&ee.signal&&y(ee.signal,re),re}function L(U,ee){if(typeof U!="function")throw new t("fn",["Function","AsyncFunction"],U);ee!=null&&u(ee,"options"),ee?.signal!=null&&a(ee.signal,"options.signal");let re=1;ee?.concurrency!=null&&(re=m(ee.concurrency));let fe=re-1;return ee?.highWaterMark!=null&&(fe=m(ee.highWaterMark)),o(re,"options.concurrency",1),o(fe,"options.highWaterMark",0),fe+=re,(async function*(){const j=at().AbortSignalAny([ee?.signal].filter(S)),W=this,se=[],he={signal:j};let pe,me,J=!1,ce=0;function ye(){J=!0,le()}function le(){ce-=1,Re()}function Re(){me&&!J&&ce<re&&se.length<fe&&(me(),me=null)}async function ze(){try{for await(let Ie of W){if(J)return;if(j.aborted)throw new s;try{if(Ie=U(Ie,he),Ie===F)continue;Ie=A(Ie)}catch(Xe){Ie=C(Xe)}ce+=1,B(Ie,le,ye),se.push(Ie),pe&&(pe(),pe=null),!J&&(se.length>=fe||ce>=re)&&await new N(Xe=>{me=Xe})}se.push(q)}catch(Ie){const Xe=C(Ie);B(Xe,le,ye),se.push(Xe)}finally{J=!0,pe&&(pe(),pe=null)}}ze();try{for(;;){for(;se.length>0;){const Ie=await se[0];if(Ie===q)return;if(j.aborted)throw new s;Ie!==F&&(yield Ie),se.shift(),Re()}await new N(Ie=>{pe=Ie})}}finally{J=!0,me&&(me(),me=null)}}).call(this)}function te(U=void 0){return U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal"),(async function*(){let re=0;for await(const ge of this){var fe;if(U!=null&&(fe=U.signal)!==null&&fe!==void 0&&fe.aborted)throw new s({cause:U.signal.reason});yield[re++,ge]}}).call(this)}async function T(U,ee=void 0){for await(const re of w.call(this,U,ee))return!0;return!1}async function Z(U,ee=void 0){if(typeof U!="function")throw new t("fn",["Function","AsyncFunction"],U);return!await T.call(this,async(...re)=>!await U(...re),ee)}async function k(U,ee){for await(const re of w.call(this,U,ee))return re}async function Y(U,ee){if(typeof U!="function")throw new t("fn",["Function","AsyncFunction"],U);async function re(fe,ge){return await U(fe,ge),F}for await(const fe of L.call(this,re,ee));}function w(U,ee){if(typeof U!="function")throw new t("fn",["Function","AsyncFunction"],U);async function re(fe,ge){return await U(fe,ge)?fe:F}return L.call(this,re,ee)}class H extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function K(U,ee,re){var fe;if(typeof U!="function")throw new t("reducer",["Function","AsyncFunction"],U);re!=null&&u(re,"options"),re?.signal!=null&&a(re.signal,"options.signal");let ge=arguments.length>1;if(re!=null&&(fe=re.signal)!==null&&fe!==void 0&&fe.aborted){const pe=new s(void 0,{cause:re.signal.reason});throw this.once("error",()=>{}),await d(this.destroy(pe)),pe}const j=new r,W=j.signal;if(re!=null&&re.signal){const pe={once:!0,[l]:this,[c]:!0};re.signal.addEventListener("abort",()=>j.abort(),pe)}let se=!1;try{for await(const pe of this){var he;if(se=!0,re!=null&&(he=re.signal)!==null&&he!==void 0&&he.aborted)throw new s;ge?ee=await U(ee,pe,{signal:W}):(ee=pe,ge=!0)}if(!se&&!ge)throw new H}finally{j.abort()}return ee}async function Q(U){U!=null&&u(U,"options"),U?.signal!=null&&a(U.signal,"options.signal");const ee=[];for await(const fe of this){var re;if(U!=null&&(re=U.signal)!==null&&re!==void 0&&re.aborted)throw new s(void 0,{cause:U.signal.reason});x(ee,fe)}return ee}function ue(U,ee){const re=L.call(this,U,ee);return(async function*(){for await(const ge of re)yield*ge}).call(this)}function V(U){if(U=h(U),g(U))return 0;if(U<0)throw new i("number",">= 0",U);return U}function G(U,ee=void 0){return ee!=null&&u(ee,"options"),ee?.signal!=null&&a(ee.signal,"options.signal"),U=V(U),(async function*(){var fe;if(ee!=null&&(fe=ee.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;for await(const j of this){var ge;if(ee!=null&&(ge=ee.signal)!==null&&ge!==void 0&&ge.aborted)throw new s;U--<=0&&(yield j)}}).call(this)}function z(U,ee=void 0){return ee!=null&&u(ee,"options"),ee?.signal!=null&&a(ee.signal,"options.signal"),U=V(U),(async function*(){var fe;if(ee!=null&&(fe=ee.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;for await(const j of this){var ge;if(ee!=null&&(ge=ee.signal)!==null&&ge!==void 0&&ge.aborted)throw new s;if(U-- >0&&(yield j),U<=0)return}}).call(this)}return Bn.streamReturningOperators={asIndexedPairs:v(te,"readable.asIndexedPairs will be removed in a future version."),drop:G,filter:w,flatMap:ue,map:L,take:z,compose:D},Bn.promiseReturningOperators={every:Z,forEach:Y,reduce:K,toArray:Q,some:T,find:k},Bn}var Qi,Po;function uc(){if(Po)return Qi;Po=1;const{ArrayPrototypePop:r,Promise:e}=Be(),{isIterable:t,isNodeStream:n,isWebStream:i}=$t(),{pipelineImpl:s}=Sa(),{finished:a}=Qt();cc();function o(...u){return new e((l,c)=>{let d,b;const y=u[u.length-1];if(y&&typeof y=="object"&&!n(y)&&!t(y)&&!i(y)){const _=r(u);d=_.signal,b=_.end}s(u,(_,E)=>{_?c(_):l(E)},{signal:d,end:b})})}return Qi={finished:a,pipeline:o},Qi}var Mo;function cc(){if(Mo)return Ii.exports;Mo=1;const{Buffer:r}=jt(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:n}=Be(),{promisify:{custom:i}}=at(),{streamReturningOperators:s,promiseReturningOperators:a}=Od(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:o}}=it(),u=lc(),{setDefaultHighWaterMark:l,getDefaultHighWaterMark:c}=hi(),{pipeline:d}=Sa(),{destroyer:b}=$r(),y=Qt(),_=uc(),E=$t(),v=Ii.exports=xa().Stream;v.isDestroyed=E.isDestroyed,v.isDisturbed=E.isDisturbed,v.isErrored=E.isErrored,v.isReadable=E.isReadable,v.isWritable=E.isWritable,v.Readable=fi();for(const S of t(s)){let h=function(...g){if(new.target)throw o();return v.Readable.from(n(m,this,g))};const m=s[S];e(h,"name",{__proto__:null,value:m.name}),e(h,"length",{__proto__:null,value:m.length}),e(v.Readable.prototype,S,{__proto__:null,value:h,enumerable:!1,configurable:!0,writable:!0})}for(const S of t(a)){let h=function(...g){if(new.target)throw o();return n(m,this,g)};const m=a[S];e(h,"name",{__proto__:null,value:m.name}),e(h,"length",{__proto__:null,value:m.length}),e(v.Readable.prototype,S,{__proto__:null,value:h,enumerable:!1,configurable:!0,writable:!0})}v.Writable=Ea(),v.Duplex=Ot(),v.Transform=ac(),v.PassThrough=oc(),v.pipeline=d;const{addAbortSignal:x}=di();return v.addAbortSignal=x,v.finished=y,v.destroy=b,v.compose=u,v.setDefaultHighWaterMark=l,v.getDefaultHighWaterMark=c,e(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return _}}),e(d,i,{__proto__:null,enumerable:!0,get(){return _.pipeline}}),e(y,i,{__proto__:null,enumerable:!0,get(){return _.finished}}),v.Stream=v,v._isUint8Array=function(m){return m instanceof Uint8Array},v._uint8ArrayToBuffer=function(m){return r.from(m.buffer,m.byteOffset,m.byteLength)},Ii.exports}var Bo;function dc(){return Bo||(Bo=1,(function(r){const e=cc(),t=uc(),n=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=n,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports})(Si)),Si.exports}var Ia=dc();const Xi=Symbol("iter");function mn(r,e,t=4){if(t===0)return Object.assign(r,e);for(const n in e)r[n]=mn(r[n]||Object.create(null),e[n],t-1);return r}function hc(r,e,t=4){let n=!1;for(const i in r)if(i in e){const s=t===0?null:hc(r[i],e[i],t-1);if(s!==!1)n=n||Object.create(null),n[i]=s;else if(t===3)return!1}return n}function fc(r,e,t=4){let n=!1;for(const i in r)if(!(i in e))n=n||Object.create(null),n[i]=t===0?null:mn({},r[i],t-1);else if(t!==0){const s=fc(r[i],e[i],t-1);if(s!==!1)n=n||Object.create(null),n[i]=s;else if(t===3)return!1}return n}class Cd{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||Ne}_termFromId(e){if(e[0]==="."){const t=this._entities,n=e.split(".");return this._factory.quad(this._termFromId(t[n[1]]),this._termFromId(t[n[2]]),this._termFromId(t[n[3]]),n[4]&&this._termFromId(t[n[4]]))}return hn(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const t=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),i=this._termToNumericId(e.object);let s;return t&&n&&i&&(ua(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${t}.${n}.${i}.${s}`:`.${t}.${n}.${i}`]}return this._ids[Ir(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${ua(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:Ir(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+n++;else do t=`_:b${this._blankNodeIndex++}`;while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class et{constructor(e,t){this._size=0,this._graphs=Object.create(null),!t&&e&&!e[0]&&typeof e.match!="function"&&(t=e,e=null),t=t||{},this._factory=t.factory||Ne,this._entityIndex=t.entityIndex||new Cd({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;const t=this._graphs;let n,i;for(const s in t)for(const a in n=t[s].subjects)for(const o in i=n[a])e+=Object.keys(i[o]).length;return this._size=e}_addToIndex(e,t,n,i){const s=e[t]||(e[t]={}),a=s[n]||(s[n]={}),o=i in a;return o||(a[i]=null),!o}_removeFromIndex(e,t,n,i){const s=e[t],a=s[n];delete a[i];for(const o in a)return;delete s[n];for(const o in s)return;delete e[t]}*_findInIndex(e,t,n,i,s,a,o,u){let l,c,d;const b=this._entities,y=this._termFromId(b[u]),_={subject:null,predicate:null,object:null};t&&((l=e,e={})[t]=l[t]);for(const E in e)if(c=e[E]){_[s]=this._termFromId(b[E]),n&&((l=c,c={})[n]=l[n]);for(const v in c)if(d=c[v]){_[a]=this._termFromId(b[v]);const x=i?i in d?[i]:[]:Object.keys(d);for(let S=0;S<x.length;S++)_[o]=this._termFromId(b[x[S]]),yield this._factory.quad(_.subject,_.predicate,_.object,y)}}}_loop(e,t){for(const n in e)t(n)}_loopByKey0(e,t,n){let i,s;if(i=e[t])for(s in i)n(s)}_loopByKey1(e,t,n){let i,s;for(i in e)s=e[i],s[t]&&n(i)}_loopBy2Keys(e,t,n,i){let s,a,o;if((s=e[t])&&(a=s[n]))for(o in a)i(o)}_countInIndex(e,t,n,i){let s=0,a,o,u;t&&((a=e,e={})[t]=a[t]);for(const l in e)if(o=e[l]){n&&((a=o,o={})[n]=a[n]);for(const c in o)(u=o[c])&&(i?i in u&&s++:s+=Object.keys(u).length)}return s}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const t=Object.create(null);return n=>{n in t||(t[n]=!0,e(this._termFromId(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,i){t||(i=e.graph,n=e.object,t=e.predicate,e=e.subject),i=i?this._termToNewNumericId(i):1;let s=this._graphs[i];return s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),n=this._termToNewNumericId(n),this._addToIndex(s.subjects,e,t,n)?(this._addToIndex(s.predicates,t,n,e),this._addToIndex(s.objects,n,e,t),this._size=null,!0):!1}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,n,i){return e&&e.subject&&({subject:e,predicate:t,object:n,graph:i}=e),!this.readQuads(e,t,n,i).next().done}import(e){return e.on("data",t=>{this.addQuad(t)}),e}removeQuad(e,t,n,i){t||({subject:e,predicate:t,object:n,graph:i}=e),i=i?this._termToNumericId(i):1;const s=this._graphs;let a,o,u;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(n=n&&this._termToNumericId(n))||!(a=s[i])||!(o=a.subjects[e])||!(u=o[t])||!(n in u))return!1;this._removeFromIndex(a.subjects,e,t,n),this._removeFromIndex(a.predicates,t,n,e),this._removeFromIndex(a.objects,n,e,t),this._size!==null&&this._size--;for(e in a.subjects)return!0;return delete s[i],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",t=>{this.removeQuad(t)}),e}removeMatches(e,t,n,i){const s=new Ia.Readable({objectMode:!0}),a=this.readQuads(e,t,n,i);return s._read=o=>{for(;--o>=0;){const{done:u,value:l}=a.next();if(u){s.push(null);return}s.push(l)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,i){return[...this.readQuads(e,t,n,i)]}*readQuads(e,t,n,i){const s=this._getGraphs(i);let a,o,u,l;if(!(e&&!(o=this._termToNumericId(e))||t&&!(u=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(const c in s)(a=s[c])&&(o?l?yield*this._findInIndex(a.objects,l,o,u,"object","subject","predicate",c):yield*this._findInIndex(a.subjects,o,u,null,"subject","predicate","object",c):u?yield*this._findInIndex(a.predicates,u,l,null,"predicate","object","subject",c):l?yield*this._findInIndex(a.objects,l,null,null,"object","subject","predicate",c):yield*this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",c))}match(e,t,n,i){return new Ut(this,e,t,n,i,{entityIndex:this._entityIndex})}countQuads(e,t,n,i){const s=this._getGraphs(i);let a=0,o,u,l,c;if(e&&!(u=this._termToNumericId(e))||t&&!(l=this._termToNumericId(t))||n&&!(c=this._termToNumericId(n)))return 0;for(const d in s)(o=s[d])&&(e?n?a+=this._countInIndex(o.objects,c,u,l):a+=this._countInIndex(o.subjects,u,l,c):t?a+=this._countInIndex(o.predicates,l,c,u):a+=this._countInIndex(o.objects,c,u,l));return a}forEach(e,t,n,i,s){this.some(a=>(e(a,this),!1),t,n,i,s)}every(e,t,n,i,s){return!this.some(a=>!e(a,this),t,n,i,s)}some(e,t,n,i,s){for(const a of this.readQuads(t,n,i,s))if(e(a,this))return!0;return!1}getSubjects(e,t,n){const i=[];return this.forSubjects(s=>{i.push(s)},e,t,n),i}forSubjects(e,t,n,i){const s=this._getGraphs(i);let a,o,u;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(u=this._termToNumericId(n))))for(i in s)(a=s[i])&&(o?u?this._loopBy2Keys(a.predicates,o,u,e):this._loopByKey1(a.subjects,o,e):u?this._loopByKey0(a.objects,u,e):this._loop(a.subjects,e))}getPredicates(e,t,n){const i=[];return this.forPredicates(s=>{i.push(s)},e,t,n),i}forPredicates(e,t,n,i){const s=this._getGraphs(i);let a,o,u;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(u=this._termToNumericId(n))))for(i in s)(a=s[i])&&(o?u?this._loopBy2Keys(a.objects,u,o,e):this._loopByKey0(a.subjects,o,e):u?this._loopByKey1(a.predicates,u,e):this._loop(a.predicates,e))}getObjects(e,t,n){const i=[];return this.forObjects(s=>{i.push(s)},e,t,n),i}forObjects(e,t,n,i){const s=this._getGraphs(i);let a,o,u;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(u=this._termToNumericId(n))))for(i in s)(a=s[i])&&(o?u?this._loopBy2Keys(a.subjects,o,u,e):this._loopByKey1(a.objects,o,e):u?this._loopByKey0(a.predicates,u,e):this._loop(a.objects,e))}getGraphs(e,t,n){const i=[];return this.forGraphs(s=>{i.push(s)},e,t,n),i}forGraphs(e,t,n,i){for(const s in this._graphs)this.some(a=>(e(a.graph),!0),t,n,i,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const n={},i=t?(()=>!0):((o,u)=>{throw new Error(`${o.value} ${u}`)}),s=this.getQuads(null,Ke.rdf.rest,Ke.rdf.nil,null),a=e?[...s]:[];return s.forEach(o=>{const u=[];let l=!1,c,d;const b=o.graph;let y=o.subject;for(;y&&!l;){const _=this.getQuads(null,null,y,null),E=this.getQuads(y,null,null,null);let v,x=null,S=null,m=null;for(let h=0;h<E.length&&!l;h++)v=E[h],v.graph.equals(b)?c?l=i(y,"has non-list arcs out"):v.predicate.value===Ke.rdf.first?x?l=i(y,"has multiple rdf:first arcs"):a.push(x=v):v.predicate.value===Ke.rdf.rest?S?l=i(y,"has multiple rdf:rest arcs"):a.push(S=v):_.length?l=i(y,"can't be subject and object"):(c=v,d="subject"):l=i(y,"not confined to single graph");for(let h=0;h<_.length&&!l;++h)v=_[h],c?l=i(y,"can't have coreferences"):v.predicate.value===Ke.rdf.rest?m?l=i(y,"has incoming rdf:rest arcs"):m=v:(c=v,d="object");x?u.unshift(x.object):l=i(y,"has no list head"),y=m&&m.subject}l?e=!1:c&&(n[c[d].value]=u)}),e&&this.removeQuads(a),n}addAll(e){if(e instanceof Ut&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof et&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=mn(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof Ut&&(e=e.filtered),e===this)return!0;if(!(e instanceof et)||this._entityIndex!==e._entityIndex)return e.every(l=>this.has(l));const t=this._graphs,n=e._graphs;let i,s,a,o,u;for(const l in n){if(!(i=t[l]))return!1;i=i.subjects;for(const c in s=n[l].subjects){if(!(a=i[c]))return!1;for(const d in o=s[c]){if(!(u=a[d]))return!1;for(const b in o[d])if(!(b in u))return!1}}}return!0}deleteMatches(e,t,n,i){for(const s of this.match(e,t,n,i))this.removeQuad(s);return this}difference(e){if(e&&e instanceof Ut&&(e=e.filtered),e===this)return new et({entityIndex:this._entityIndex});if(e instanceof et&&e._entityIndex===this._entityIndex){const t=new et({entityIndex:this._entityIndex}),n=fc(this._graphs,e._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter(t=>!e.has(t))}equals(e){return e instanceof Ut&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new et({entityIndex:this._entityIndex});for(const n of this)e(n,this)&&t.add(n);return t}intersection(e){if(e instanceof Ut&&(e=e.filtered),e===this){const t=new et({entityIndex:this._entityIndex});return t._graphs=mn(Object.create(null),this._graphs),t._size=this._size,t}else if(e instanceof et&&this._entityIndex===e._entityIndex){const t=new et({entityIndex:this._entityIndex}),n=hc(e._graphs,this._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter(t=>e.has(t))}map(e){const t=new et({entityIndex:this._entityIndex});for(const n of this)t.add(e(n,this));return t}reduce(e,t){const n=this.readQuads();let i=t===void 0?n.next().value:t;for(const s of n)i=e(i,s,this);return i}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new va().quadsToString(this)}union(e){const t=new et({entityIndex:this._entityIndex});return t._graphs=mn(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function It(r,e,t=0){const n=e[t];if(n&&!(n in r))return!1;let i=!1;for(const s in n?{[n]:r[n]}:r){const a=t===2?null:It(r[s],e,t+1);a!==!1&&(i=i||Object.create(null),i[s]=a)}return i}class Ut extends Ia.Readable{constructor(e,t,n,i,s,a){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:n,object:i,graph:s,options:a})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:n,predicate:i,subject:s}=this,a=this._filtered=new et({factory:e._factory,entityIndex:this.options.entityIndex});let o,u,l;if(s&&!(o=a._termToNumericId(s))||i&&!(u=a._termToNumericId(i))||n&&!(l=a._termToNumericId(n)))return a;const c=e._getGraphs(t);for(const d in c){let b,y,_,E;(E=c[d])&&(!o&&u?(y=It(E.predicates,[u,l,o]))&&(b=It(E.subjects,[o,u,l]),_=It(E.objects,[l,o,u])):l?(_=It(E.objects,[l,o,u]))&&(b=It(E.subjects,[o,u,l]),y=It(E.predicates,[u,l,o])):(b=It(E.subjects,[o,u,l]))&&(y=It(E.predicates,[u,l,o]),_=It(E.objects,[l,o,u])),b&&(a._graphs[d]={subjects:b,predicates:y,objects:_}))}a._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[Xi]&&(this[Xi]=this[Symbol.iterator]());const t=this[Xi];for(;--e>=0;){const{done:n,value:i}=t.next();if(n){this.push(null);return}this.push(i)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,n,i){return this.filtered.deleteMatches(e,t,n,i)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,n,i,s){return this.filtered.every(e,t,n,i,s)}filter(e){return this.filtered.filter(e)}forEach(e,t,n,i,s){return this.filtered.forEach(e,t,n,i,s)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,n,i,s){return this.filtered.some(e,t,n,i,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return new va().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,n,i){return new Ut(this.filtered,e,t,n,i,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}class jd extends Ia.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;const t=new rc(e);let n,i;const s={onQuad:(a,o)=>{a&&this.emit("error",a)||o&&this.push(o)},onPrefix:(a,o)=>{this.emit("prefix",a,o)}};e&&e.comments&&(s.onComment=a=>{this.emit("comment",a)}),t.parse({on:(a,o)=>{switch(a){case"data":n=o;break;case"end":i=o;break}}},s),this._transform=(a,o,u)=>{n(a),u()},this._flush=a=>{i(),a()}}import(e){return e.on("data",t=>{this.write(t)}),e.on("end",()=>{this.end()}),e.on("error",t=>{this.emit("error",t)}),this}}const xe="http://www.w3.org/ns/shacl#",qo="http://datashapes.org/dash#",Wt="http://www.w3.org/2001/XMLSchema#",Ht="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Na="http://www.w3.org/2000/01/rdf-schema#",Ra="http://www.w3.org/2004/02/skos/core#",$d="http://www.w3.org/2002/07/owl#",Fd="http://www.w3.org/ns/oa#",kd="http://purl.org/dc/terms/",Pd="http://xmlns.com/foaf/0.1/",yn=Ne.namedNode("loaded-shapes"),Lt=Ne.namedNode("loaded-data"),tt=Ne.namedNode(Ht+"type"),ca=Ne.namedNode(kd+"conformsTo"),Uo=Ne.namedNode(Na+"subClassOf"),Ta=Ne.namedNode($d+"imports"),Md=Ne.namedNode(Ra+"broader"),Bd=Ne.namedNode(Ra+"narrower"),Hn=Ne.namedNode(xe+"NodeShape"),qd=Ne.namedNode(xe+"IRI"),ni=Ne.namedNode(xe+"property"),Aa=Ne.namedNode(xe+"class"),Ud=Ne.namedNode(xe+"node"),Rr=Ne.namedNode(xe+"targetClass"),Hd=Ne.namedNode(xe+"nodeKind");Ne.namedNode(Wt+"string");function bn(r,e,t=xe,n){let i="";const s=Vd(r,e,t,n);return s&&(i=s.value),i}function Vd(r,e,t=xe,n){let i;const s=t+e;if(n?.length){for(const a of n)for(const o of r)if(o.predicate.value===s){if(o.object.id.endsWith(`@${a}`))return o.object;o.object.id.indexOf("@")<0?i=o.object:i||(i=o.object)}}else for(const a of r)if(a.predicate.value===s)return a.object;return i}function Gd(r){r.querySelector(".editor")?.focus()}function Tn(r,e){return bn(r,"prefLabel",Ra,e)||bn(r,"label",Na,e)||bn(r,"name",Pd,e)}function pc(r,e,t){const n=[];for(const i of r)n.push({value:i,label:Tn(e.getQuads(i,null,null,null),t),children:[]});return n}function da(r,e){for(const t in e)r=r.replace(e[t],"");return r}function gc(r,e,t,n,i=new Set){for(const s of e.owlImports)i.has(s.id)||(i.add(s.id),n.push(...t.getSubjects(tt,r,s)));e.parent&&gc(r,e.parent,t,n,i)}function Da(r,e){if(e.shaclIn){const t=e.config.lists[e.shaclIn];return pc(t?.length?t:[],e.config.store,e.config.languages)}else{const t=e.config.store.getSubjects(tt,r,yn);t.push(...e.config.store.getSubjects(tt,r,Lt)),gc(r,e,e.config.store,t);const n=new Map,i=new Map;for(const a of t)n.set(a.id,{value:a,label:Tn(e.config.store.getQuads(a,null,null,null),e.config.languages),children:[]});for(const a of t){for(const o of e.config.store.getObjects(a,Md,null))n.has(o.id)&&i.set(a.id,o.id);for(const o of e.config.store.getObjects(a,Bd,null))n.has(o.id)&&i.set(o.id,a.id);for(const o of e.config.store.getObjects(a,Uo,null))n.has(o.id)&&i.set(a.id,o.id)}for(const[a,o]of i.entries())n.get(o)?.children?.push(n.get(a));const s=[];for(const[a,o]of n.entries())i.has(a)||s.push(o);for(const a of e.config.store.getSubjects(Uo,r,null))s.push(...Da(a,e));return s}}function ha(r){let e;try{e=new URL(r)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Ho(r,e,t){if(e===void 0)return t;if(t===void 0)return e;const n=r.indexOf(e.language);if(n<0)return t;const i=r.indexOf(t.language);return i<0||i>n?e:t}function Wd(r,{remove:e=!1,ignoreErrors:t=!1}={}){const n={},i=t?(()=>!0):((o,u)=>{throw new Error(`${o.value} ${u}`)}),s=r.getQuads(null,Ht+"rest",Ht+"nil",null),a=e?[...s]:[];return s.forEach(o=>{const u=[];let l=!1,c,d;const b=o.graph;let y=o.subject;for(;y&&!l;){const _=r.getQuads(null,null,y,null),E=r.getQuads(y,null,null,null).filter(h=>!h.predicate.equals(tt));let v,x=null,S=null,m=null;for(let h=0;h<E.length&&!l;h++)v=E[h],v.graph.equals(b)?c?l=i(y,"has non-list arcs out"):v.predicate.value===Ht+"first"?x?l=i(y,"has multiple rdf:first arcs"):a.push(x=v):v.predicate.value===Ht+"rest"?S?l=i(y,"has multiple rdf:rest arcs"):a.push(S=v):_.length?l=i(y,"can't be subject and object"):(c=v,d="subject"):l=i(y,"not confined to single graph");for(let h=0;h<_.length&&!l;++h)v=_[h],c?l=i(y,"can't have coreferences"):v.predicate.value===Ht+"rest"?m?l=i(y,"has incoming rdf:rest arcs"):m=v:(c=v,d="object");x?u.unshift(x.object):l=i(y,"has no list head"),y=m&&m.subject}l?e=!1:c&&(n[c[d].value]=u)}),e&&r.removeQuads(a),n}function mc(r,e,t){const n=document.createElement("div");n.classList.add("shacl-or-constraint");const i=[];if(e instanceof zt){const s=[];let a=!1;r.length&&(a=t.store.countQuads(r[0],ni,null,null)>0);for(let l=0;l<r.length;l++)if(a){const c=t.store.getObjects(r[l],ni,null),d=[];let b="";for(const y of c){const _=new ai(y,e,t);d.push(_),b+=(b.length>1?" / ":"")+_.template.label}s.push(d),i.push({label:b,value:l.toString()})}else{const c=new ai(r[l],e,t);s.push([c]),i.push({label:c.template.label,value:l.toString()})}const o=t.theme.createListEditor("Please choose",null,!1,i),u=o.querySelector(".editor");u.onchange=()=>{if(u.value){const l=s[parseInt(u.value)];let c;l.length&&(c=l[0],n.replaceWith(l[0]));for(let d=1;d<l.length;d++)c.after(l[d]),c=l[d]}},n.appendChild(o)}else{const s=[];for(let u=0;u<r.length;u++){const l=t.store.getQuads(r[u],null,null,null);l.length&&(s.push(l),i.push({label:Tn(l,t.languages)||da(l[0].predicate.value,t.prefixes)+" = "+da(l[0].object.value,t.prefixes),value:u.toString()}))}const a=t.theme.createListEditor(e.template.label+"?",null,!1,i,e.template),o=a.querySelector(".editor");o.onchange=()=>{o.value&&n.replaceWith(Zn(e.template.clone().merge(s[parseInt(o.value)]),void 0,!0))},n.appendChild(a)}return n}function zd(r,e,t){if(e instanceof _t){const n=e.datatype;for(const i of r){const s=t.store.getQuads(i,null,null,null);for(const a of s)if(a.predicate.value===`${xe}datatype`&&a.object.equals(n))return s}}else{const n=t.store.getObjects(e,tt,null);for(const i of r){const s=t.store.getQuads(i,null,null,null);for(const a of s)if(n.length>0){if(a.predicate.value===`${xe}node`){for(const o of n)if(t.store.getQuads(a.object,Rr,o,null).length>0)return s}if(a.predicate.equals(Aa)){for(const o of n)if(a.object.equals(o))return s}}else if(a.predicate.equals(Hd)&&a.object.equals(qd))return s}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function Qd(r,e,t){for(const n of r){let i=!1;const s=t.store.getObjects(n,ni,null);for(const a of s){const o=t.store.getObjects(a,`${xe}path`,null);for(const u of o)if(i=t.store.countQuads(e,u,null,null)>0,i)break}if(i)return s}return console.error("couldn't resolve sh:or/sh:xone on node for value",e),[]}const Xd={[`${xe}name`]:(r,e)=>{const t=e;r.name=Ho(r.config.languages,r.name,t)},[`${xe}description`]:(r,e)=>{const t=e;r.description=Ho(r.config.languages,r.description,t)},[`${xe}path`]:(r,e)=>{r.path=e.value},[`${xe}node`]:(r,e)=>{r.node=e},[`${xe}datatype`]:(r,e)=>{r.datatype=e},[`${xe}nodeKind`]:(r,e)=>{r.nodeKind=e},[`${xe}minCount`]:(r,e)=>{r.minCount=parseInt(e.value)},[`${xe}maxCount`]:(r,e)=>{r.maxCount=parseInt(e.value)},[`${xe}minLength`]:(r,e)=>{r.minLength=parseInt(e.value)},[`${xe}maxLength`]:(r,e)=>{r.maxLength=parseInt(e.value)},[`${xe}minInclusive`]:(r,e)=>{r.minInclusive=parseInt(e.value)},[`${xe}maxInclusive`]:(r,e)=>{r.maxInclusive=parseInt(e.value)},[`${xe}minExclusive`]:(r,e)=>{r.minExclusive=parseInt(e.value)},[`${xe}maxExclusive`]:(r,e)=>{r.maxExclusive=parseInt(e.value)},[`${xe}pattern`]:(r,e)=>{r.pattern=e.value},[`${xe}order`]:(r,e)=>{r.order=parseInt(e.value)},[`${qo}singleLine`]:(r,e)=>{r.singleLine=e.value==="true"},[`${qo}readonly`]:(r,e)=>{r.readonly=e.value==="true"},[`${Fd}styleClass`]:(r,e)=>{r.cssClass=e.value},[`${xe}and`]:(r,e)=>{r.shaclAnd=e.value},[`${xe}in`]:(r,e)=>{r.shaclIn=e.value},[`${xe}languageIn`]:(r,e)=>{r.languageIn=r.config.lists[e.value],r.datatype=Ne.namedNode(Ht+"langString")},[`${xe}defaultValue`]:(r,e)=>{r.defaultValue=e},[`${xe}hasValue`]:(r,e)=>{r.hasValue=e},[`${xe}qualifiedValueShape`]:(r,e)=>{r.qualifiedValueShape=e},[`${xe}qualifiedMinCount`]:(r,e)=>{r.minCount=parseInt(e.value)},[`${xe}qualifiedMaxCount`]:(r,e)=>{r.maxCount=parseInt(e.value)},[Ta.id]:(r,e)=>{r.owlImports.push(e)},[Aa.id]:(r,e)=>{r.class=e;const t=r.config.store.getSubjects(Rr,e,null);t.length>0&&(r.node=t[0])},[`${xe}or`]:(r,e)=>{const t=r.config.lists[e.value];t?.length?r.shaclOr=t:console.error("list for sh:or not found:",e.value,"existing lists:",r.config.lists)},[`${xe}xone`]:(r,e)=>{const t=r.config.lists[e.value];t?.length?r.shaclXone=t:console.error("list for sh:xone not found:",e.value,"existing lists:",r.config.lists)}};class Jd{constructor(e,t,n){this.label="",this.owlImports=[],this.extendedShapes=[],this.parent=t,this.config=n,this.merge(e),this.qualifiedValueShape&&this.merge(n.store.getQuads(this.qualifiedValueShape,null,null,null))}merge(e){for(const t of e)Xd[t.predicate.id]?.call(this,this,t.object);if(this.label=this.name?.value||Tn(e,this.config.languages),!this.label&&!this.shaclAnd&&(this.label=this.path?da(this.path,this.config.prefixes):"unknown"),this.node&&this.extendedShapes.push(this.node),this.shaclAnd){const t=this.config.lists[this.shaclAnd];if(t?.length)for(const n of t)this.extendedShapes.push(n)}return this}clone(){const e=Object.assign({},this);return e.extendedShapes=[...this.extendedShapes],e.owlImports=[...this.owlImports],this.languageIn&&(e.languageIn=[...this.languageIn]),this.shaclOr&&(e.shaclOr=[...this.shaclOr]),this.shaclXone&&(e.shaclXone=[...this.shaclXone]),e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}const Kd=`form { display:block; --label-width: 8em; --caret-size: 10px; }
|
|
26
|
+
`),this._subject=null),this._write=this._blockedWrite;let i=e&&((r,o)=>{i=null,e(r,o)});if(this._endStream)try{return this._outputStream.end(i)}catch{}i&&i()}}function nc(n){let e=bg[n];return e===void 0&&(n.length===1?(e=n.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((n.charCodeAt(0)-55296)*1024+n.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var Ao={exports:{}},No={exports:{}},Ro,rc;function dt(){if(rc)return Ro;rc=1;class n extends Error{constructor(i){if(!Array.isArray(i))throw new TypeError(`Expected input to be an Array, got ${typeof i}`);let r="";for(let o=0;o<i.length;o++)r+=` ${i[o].stack}
|
|
27
|
+
`;super(r),this.name="AggregateError",this.errors=i}}return Ro={AggregateError:n,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,i){return e.includes(i)},ArrayPrototypeIndexOf(e,i){return e.indexOf(i)},ArrayPrototypeJoin(e,i){return e.join(i)},ArrayPrototypeMap(e,i){return e.map(i)},ArrayPrototypePop(e,i){return e.pop(i)},ArrayPrototypePush(e,i){return e.push(i)},ArrayPrototypeSlice(e,i,r){return e.slice(i,r)},Error,FunctionPrototypeCall(e,i,...r){return e.call(i,...r)},FunctionPrototypeSymbolHasInstance(e,i){return Function.prototype[Symbol.hasInstance].call(e,i)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,i){return Object.defineProperties(e,i)},ObjectDefineProperty(e,i,r){return Object.defineProperty(e,i,r)},ObjectGetOwnPropertyDescriptor(e,i){return Object.getOwnPropertyDescriptor(e,i)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,i){return Object.setPrototypeOf(e,i)},Promise,PromisePrototypeCatch(e,i){return e.catch(i)},PromisePrototypeThen(e,i,r){return e.then(i,r)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,i){return e.test(i)},SafeSet:Set,String,StringPrototypeSlice(e,i,r){return e.slice(i,r)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,i,r){return e.set(i,r)},Boolean,Uint8Array},Ro}var Po={exports:{}},Co,sc;function ef(){return sc||(sc=1,Co={format(n,...e){return n.replace(/%([sdifj])/g,function(...[i,r]){const o=e.shift();return r==="f"?o.toFixed(6):r==="j"?JSON.stringify(o):r==="s"&&typeof o=="object"?`${o.constructor!==Object?o.constructor.name:""} {}`.trim():o.toString()})},inspect(n){switch(typeof n){case"string":if(n.includes("'"))if(n.includes('"')){if(!n.includes("`")&&!n.includes("${"))return`\`${n}\``}else return`"${n}"`;return`'${n}'`;case"number":return isNaN(n)?"NaN":Object.is(n,-0)?String(n):n;case"bigint":return`${String(n)}n`;case"boolean":case"undefined":return String(n);case"object":return"{}"}}}),Co}var Do,oc;function Ct(){if(oc)return Do;oc=1;const{format:n,inspect:e}=ef(),{AggregateError:i}=dt(),r=globalThis.AggregateError||i,o=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,u="__node_internal_",f={};function d(A,N){if(!A)throw new f.ERR_INTERNAL_ASSERTION(N)}function g(A){let N="",R=A.length;const S=A[0]==="-"?1:0;for(;R>=S+4;R-=3)N=`_${A.slice(R-3,R)}${N}`;return`${A.slice(0,R)}${N}`}function _(A,N,R){if(typeof N=="function")return d(N.length<=R.length,`Code: ${A}; The provided arguments length (${R.length}) does not match the required ones (${N.length}).`),N(...R);const S=(N.match(/%[dfijoOs]/g)||[]).length;return d(S===R.length,`Code: ${A}; The provided arguments length (${R.length}) does not match the required ones (${S}).`),R.length===0?N:n(N,...R)}function h(A,N,R){R||(R=Error);class S extends R{constructor(...x){super(_(A,N,x))}toString(){return`${this.name} [${A}]: ${this.message}`}}Object.defineProperties(S.prototype,{name:{value:R.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${A}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),S.prototype.code=A,S.prototype[o]=!0,f[A]=S}function m(A){const N=u+A.name;return Object.defineProperty(A,"name",{value:N}),A}function b(A,N){if(A&&N&&A!==N){if(Array.isArray(N.errors))return N.errors.push(A),N;const R=new r([N,A],N.message);return R.code=N.code,R}return A||N}class T extends Error{constructor(N="The operation was aborted",R=void 0){if(R!==void 0&&typeof R!="object")throw new f.ERR_INVALID_ARG_TYPE("options","Object",R);super(N,R),this.code="ABORT_ERR",this.name="AbortError"}}return h("ERR_ASSERTION","%s",Error),h("ERR_INVALID_ARG_TYPE",(A,N,R)=>{d(typeof A=="string","'name' must be a string"),Array.isArray(N)||(N=[N]);let S="The ";A.endsWith(" argument")?S+=`${A} `:S+=`"${A}" ${A.includes(".")?"property":"argument"} `,S+="must be ";const y=[],x=[],P=[];for(const O of N)d(typeof O=="string","All expected entries have to be of type string"),a.includes(O)?y.push(O.toLowerCase()):l.test(O)?x.push(O):(d(O!=="object",'The value "object" should be written as "Object"'),P.push(O));if(x.length>0){const O=y.indexOf("object");O!==-1&&(y.splice(y,O,1),x.push("Object"))}if(y.length>0){switch(y.length){case 1:S+=`of type ${y[0]}`;break;case 2:S+=`one of type ${y[0]} or ${y[1]}`;break;default:{const O=y.pop();S+=`one of type ${y.join(", ")}, or ${O}`}}(x.length>0||P.length>0)&&(S+=" or ")}if(x.length>0){switch(x.length){case 1:S+=`an instance of ${x[0]}`;break;case 2:S+=`an instance of ${x[0]} or ${x[1]}`;break;default:{const O=x.pop();S+=`an instance of ${x.join(", ")}, or ${O}`}}P.length>0&&(S+=" or ")}switch(P.length){case 0:break;case 1:P[0].toLowerCase()!==P[0]&&(S+="an "),S+=`${P[0]}`;break;case 2:S+=`one of ${P[0]} or ${P[1]}`;break;default:{const O=P.pop();S+=`one of ${P.join(", ")}, or ${O}`}}if(R==null)S+=`. Received ${R}`;else if(typeof R=="function"&&R.name)S+=`. Received function ${R.name}`;else if(typeof R=="object"){var B;if((B=R.constructor)!==null&&B!==void 0&&B.name)S+=`. Received an instance of ${R.constructor.name}`;else{const O=e(R,{depth:-1});S+=`. Received ${O}`}}else{let O=e(R,{colors:!1});O.length>25&&(O=`${O.slice(0,25)}...`),S+=`. Received type ${typeof R} (${O})`}return S},TypeError),h("ERR_INVALID_ARG_VALUE",(A,N,R="is invalid")=>{let S=e(N);return S.length>128&&(S=S.slice(0,128)+"..."),`The ${A.includes(".")?"property":"argument"} '${A}' ${R}. Received ${S}`},TypeError),h("ERR_INVALID_RETURN_VALUE",(A,N,R)=>{var S;const y=R!=null&&(S=R.constructor)!==null&&S!==void 0&&S.name?`instance of ${R.constructor.name}`:`type ${typeof R}`;return`Expected ${A} to be returned from the "${N}" function but got ${y}.`},TypeError),h("ERR_MISSING_ARGS",(...A)=>{d(A.length>0,"At least one arg needs to be specified");let N;const R=A.length;switch(A=(Array.isArray(A)?A:[A]).map(S=>`"${S}"`).join(" or "),R){case 1:N+=`The ${A[0]} argument`;break;case 2:N+=`The ${A[0]} and ${A[1]} arguments`;break;default:{const S=A.pop();N+=`The ${A.join(", ")}, and ${S} arguments`}break}return`${N} must be specified`},TypeError),h("ERR_OUT_OF_RANGE",(A,N,R)=>{d(N,'Missing "range" argument');let S;if(Number.isInteger(R)&&Math.abs(R)>2**32)S=g(String(R));else if(typeof R=="bigint"){S=String(R);const y=BigInt(2)**BigInt(32);(R>y||R<-y)&&(S=g(S)),S+="n"}else S=e(R);return`The value of "${A}" is out of range. It must be ${N}. Received ${S}`},RangeError),h("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),h("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),h("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),h("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),h("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),h("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),h("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),h("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),h("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),h("ERR_STREAM_WRITE_AFTER_END","write after end",Error),h("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Do={AbortError:T,aggregateTwoErrors:m(b),hideStackFrames:m,codes:f},Do}var cr={exports:{}},ac;function jr(){if(ac)return cr.exports;ac=1;const{AbortController:n,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return cr.exports=n,cr.exports.AbortSignal=e,cr.exports.default=n,cr.exports}var gs={exports:{}},lc;function qs(){if(lc)return gs.exports;lc=1;var n=typeof Reflect=="object"?Reflect:null,e=n&&typeof n.apply=="function"?n.apply:function(x,P,B){return Function.prototype.apply.call(x,P,B)},i;n&&typeof n.ownKeys=="function"?i=n.ownKeys:Object.getOwnPropertySymbols?i=function(x){return Object.getOwnPropertyNames(x).concat(Object.getOwnPropertySymbols(x))}:i=function(x){return Object.getOwnPropertyNames(x)};function r(y){console&&console.warn&&console.warn(y)}var o=Number.isNaN||function(x){return x!==x};function a(){a.init.call(this)}gs.exports=a,gs.exports.once=N,a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var l=10;function u(y){if(typeof y!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof y)}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(y){if(typeof y!="number"||y<0||o(y))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+y+".");l=y}}),a.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},a.prototype.setMaxListeners=function(x){if(typeof x!="number"||x<0||o(x))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+x+".");return this._maxListeners=x,this};function f(y){return y._maxListeners===void 0?a.defaultMaxListeners:y._maxListeners}a.prototype.getMaxListeners=function(){return f(this)},a.prototype.emit=function(x){for(var P=[],B=1;B<arguments.length;B++)P.push(arguments[B]);var O=x==="error",J=this._events;if(J!==void 0)O=O&&J.error===void 0;else if(!O)return!1;if(O){var k;if(P.length>0&&(k=P[0]),k instanceof Error)throw k;var q=new Error("Unhandled error."+(k?" ("+k.message+")":""));throw q.context=k,q}var X=J[x];if(X===void 0)return!1;if(typeof X=="function")e(X,this,P);else for(var F=X.length,$=b(X,F),B=0;B<F;++B)e($[B],this,P);return!0};function d(y,x,P,B){var O,J,k;if(u(P),J=y._events,J===void 0?(J=y._events=Object.create(null),y._eventsCount=0):(J.newListener!==void 0&&(y.emit("newListener",x,P.listener?P.listener:P),J=y._events),k=J[x]),k===void 0)k=J[x]=P,++y._eventsCount;else if(typeof k=="function"?k=J[x]=B?[P,k]:[k,P]:B?k.unshift(P):k.push(P),O=f(y),O>0&&k.length>O&&!k.warned){k.warned=!0;var q=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(x)+" listeners added. Use emitter.setMaxListeners() to increase limit");q.name="MaxListenersExceededWarning",q.emitter=y,q.type=x,q.count=k.length,r(q)}return y}a.prototype.addListener=function(x,P){return d(this,x,P,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(x,P){return d(this,x,P,!0)};function g(){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 _(y,x,P){var B={fired:!1,wrapFn:void 0,target:y,type:x,listener:P},O=g.bind(B);return O.listener=P,B.wrapFn=O,O}a.prototype.once=function(x,P){return u(P),this.on(x,_(this,x,P)),this},a.prototype.prependOnceListener=function(x,P){return u(P),this.prependListener(x,_(this,x,P)),this},a.prototype.removeListener=function(x,P){var B,O,J,k,q;if(u(P),O=this._events,O===void 0)return this;if(B=O[x],B===void 0)return this;if(B===P||B.listener===P)--this._eventsCount===0?this._events=Object.create(null):(delete O[x],O.removeListener&&this.emit("removeListener",x,B.listener||P));else if(typeof B!="function"){for(J=-1,k=B.length-1;k>=0;k--)if(B[k]===P||B[k].listener===P){q=B[k].listener,J=k;break}if(J<0)return this;J===0?B.shift():T(B,J),B.length===1&&(O[x]=B[0]),O.removeListener!==void 0&&this.emit("removeListener",x,q||P)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(x){var P,B,O;if(B=this._events,B===void 0)return this;if(B.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):B[x]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete B[x]),this;if(arguments.length===0){var J=Object.keys(B),k;for(O=0;O<J.length;++O)k=J[O],k!=="removeListener"&&this.removeAllListeners(k);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(P=B[x],typeof P=="function")this.removeListener(x,P);else if(P!==void 0)for(O=P.length-1;O>=0;O--)this.removeListener(x,P[O]);return this};function h(y,x,P){var B=y._events;if(B===void 0)return[];var O=B[x];return O===void 0?[]:typeof O=="function"?P?[O.listener||O]:[O]:P?A(O):b(O,O.length)}a.prototype.listeners=function(x){return h(this,x,!0)},a.prototype.rawListeners=function(x){return h(this,x,!1)},a.listenerCount=function(y,x){return typeof y.listenerCount=="function"?y.listenerCount(x):m.call(y,x)},a.prototype.listenerCount=m;function m(y){var x=this._events;if(x!==void 0){var P=x[y];if(typeof P=="function")return 1;if(P!==void 0)return P.length}return 0}a.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function b(y,x){for(var P=new Array(x),B=0;B<x;++B)P[B]=y[B];return P}function T(y,x){for(;x+1<y.length;x++)y[x]=y[x+1];y.pop()}function A(y){for(var x=new Array(y.length),P=0;P<x.length;++P)x[P]=y[P].listener||y[P];return x}function N(y,x){return new Promise(function(P,B){function O(k){y.removeListener(x,J),B(k)}function J(){typeof y.removeListener=="function"&&y.removeListener("error",O),P([].slice.call(arguments))}S(y,x,J,{once:!0}),x!=="error"&&R(y,O,{once:!0})})}function R(y,x,P){typeof y.on=="function"&&S(y,"error",x,P)}function S(y,x,P,B){if(typeof y.on=="function")B.once?y.once(x,P):y.on(x,P);else if(typeof y.addEventListener=="function")y.addEventListener(x,function O(J){B.once&&y.removeEventListener(x,O),P(J)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof y)}return gs.exports}var uc;function Mt(){return uc||(uc=1,(function(n){const e=Ti(),{format:i,inspect:r}=ef(),{codes:{ERR_INVALID_ARG_TYPE:o}}=Ct(),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:u}=dt(),f=globalThis.AbortSignal||jr().AbortSignal,d=globalThis.AbortController||jr().AbortController,g=Object.getPrototypeOf(async function(){}).constructor,_=globalThis.Blob||e.Blob,h=typeof _<"u"?function(A){return A instanceof _}:function(A){return!1},m=(T,A)=>{if(T!==void 0&&(T===null||typeof T!="object"||!("aborted"in T)))throw new o(A,"AbortSignal",T)},b=(T,A)=>{if(typeof T!="function")throw new o(A,"Function",T)};n.exports={AggregateError:l,kEmptyObject:Object.freeze({}),once(T){let A=!1;return function(...N){A||(A=!0,T.apply(this,N))}},createDeferredPromise:function(){let T,A;return{promise:new Promise((R,S)=>{T=R,A=S}),resolve:T,reject:A}},promisify(T){return new Promise((A,N)=>{T((R,...S)=>R?N(R):A(...S))})},debuglog(){return function(){}},format:i,inspect:r,types:{isAsyncFunction(T){return T instanceof g},isArrayBufferView(T){return ArrayBuffer.isView(T)}},isBlob:h,deprecate(T,A){return T},addAbortListener:qs().addAbortListener||function(A,N){if(A===void 0)throw new o("signal","AbortSignal",A);m(A,"signal"),b(N,"listener");let R;return A.aborted?queueMicrotask(()=>N()):(A.addEventListener("abort",N,{__proto__:null,once:!0,[a]:!0}),R=()=>{A.removeEventListener("abort",N)}),{__proto__:null,[u](){var S;(S=R)===null||S===void 0||S()}}},AbortSignalAny:f.any||function(A){if(A.length===1)return A[0];const N=new d,R=()=>N.abort();return A.forEach(S=>{m(S,"signals"),S.addEventListener("abort",R,{once:!0})}),N.signal.addEventListener("abort",()=>{A.forEach(S=>S.removeEventListener("abort",R))},{once:!0}),N.signal}},n.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(Po)),Po.exports}var ms={},ko,cc;function Ur(){if(cc)return ko;cc=1;const{ArrayIsArray:n,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:i,ArrayPrototypeMap:r,NumberIsInteger:o,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:g,String:_,StringPrototypeToUpperCase:h,StringPrototypeTrim:m}=dt(),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:T,ERR_INVALID_ARG_TYPE:A,ERR_INVALID_ARG_VALUE:N,ERR_OUT_OF_RANGE:R,ERR_UNKNOWN_SIGNAL:S}}=Ct(),{normalizeEncoding:y}=Mt(),{isAsyncFunction:x,isArrayBufferView:P}=Mt().types,B={};function O(re){return re===(re|0)}function J(re){return re===re>>>0}const k=/^[0-7]+$/,q="must be a 32-bit unsigned integer or an octal string";function X(re,ve,Ne){if(typeof re>"u"&&(re=Ne),typeof re=="string"){if(g(k,re)===null)throw new N(ve,re,q);re=f(re,8)}return ue(re,ve),re}const F=b((re,ve,Ne=u,xe=l)=>{if(typeof re!="number")throw new A(ve,"number",re);if(!o(re))throw new R(ve,"an integer",re);if(re<Ne||re>xe)throw new R(ve,`>= ${Ne} && <= ${xe}`,re)}),$=b((re,ve,Ne=-2147483648,xe=2147483647)=>{if(typeof re!="number")throw new A(ve,"number",re);if(!o(re))throw new R(ve,"an integer",re);if(re<Ne||re>xe)throw new R(ve,`>= ${Ne} && <= ${xe}`,re)}),ue=b((re,ve,Ne=!1)=>{if(typeof re!="number")throw new A(ve,"number",re);if(!o(re))throw new R(ve,"an integer",re);const xe=Ne?1:0,ke=4294967295;if(re<xe||re>ke)throw new R(ve,`>= ${xe} && <= ${ke}`,re)});function D(re,ve){if(typeof re!="string")throw new A(ve,"string",re)}function se(re,ve,Ne=void 0,xe){if(typeof re!="number")throw new A(ve,"number",re);if(Ne!=null&&re<Ne||xe!=null&&re>xe||(Ne!=null||xe!=null)&&a(re))throw new R(ve,`${Ne!=null?`>= ${Ne}`:""}${Ne!=null&&xe!=null?" && ":""}${xe!=null?`<= ${xe}`:""}`,re)}const j=b((re,ve,Ne)=>{if(!e(Ne,re)){const ke="must be one of: "+i(r(Ne,lt=>typeof lt=="string"?`'${lt}'`:_(lt)),", ");throw new N(ve,re,ke)}});function ae(re,ve){if(typeof re!="boolean")throw new A(ve,"boolean",re)}function I(re,ve,Ne){return re==null||!d(re,ve)?Ne:re[ve]}const Z=b((re,ve,Ne=null)=>{const xe=I(Ne,"allowArray",!1),ke=I(Ne,"allowFunction",!1);if(!I(Ne,"nullable",!1)&&re===null||!xe&&n(re)||typeof re!="object"&&(!ke||typeof re!="function"))throw new A(ve,"Object",re)}),ne=b((re,ve)=>{if(re!=null&&typeof re!="object"&&typeof re!="function")throw new A(ve,"a dictionary",re)}),ee=b((re,ve,Ne=0)=>{if(!n(re))throw new A(ve,"Array",re);if(re.length<Ne){const xe=`must be longer than ${Ne}`;throw new N(ve,re,xe)}});function _e(re,ve){ee(re,ve);for(let Ne=0;Ne<re.length;Ne++)D(re[Ne],`${ve}[${Ne}]`)}function G(re,ve){ee(re,ve);for(let Ne=0;Ne<re.length;Ne++)ae(re[Ne],`${ve}[${Ne}]`)}function W(re,ve){ee(re,ve);for(let Ne=0;Ne<re.length;Ne++){const xe=re[Ne],ke=`${ve}[${Ne}]`;if(xe==null)throw new A(ke,"AbortSignal",xe);Ee(xe,ke)}}function Y(re,ve="signal"){if(D(re,ve),B[re]===void 0)throw B[h(re)]!==void 0?new S(re+" (signals must use all capital letters)"):new S(re)}const K=b((re,ve="buffer")=>{if(!P(re))throw new A(ve,["Buffer","TypedArray","DataView"],re)});function oe(re,ve){const Ne=y(ve),xe=re.length;if(Ne==="hex"&&xe%2!==0)throw new N("encoding",ve,`is invalid for data of length ${xe}`)}function ce(re,ve="Port",Ne=!0){if(typeof re!="number"&&typeof re!="string"||typeof re=="string"&&m(re).length===0||+re!==+re>>>0||re>65535||re===0&&!Ne)throw new T(ve,re,Ne);return re|0}const Ee=b((re,ve)=>{if(re!==void 0&&(re===null||typeof re!="object"||!("aborted"in re)))throw new A(ve,"AbortSignal",re)}),Te=b((re,ve)=>{if(typeof re!="function")throw new A(ve,"Function",re)}),z=b((re,ve)=>{if(typeof re!="function"||x(re))throw new A(ve,"Function",re)}),te=b((re,ve)=>{if(re!==void 0)throw new A(ve,"undefined",re)});function fe(re,ve,Ne){if(!e(Ne,re))throw new A(ve,`('${i(Ne,"|")}')`,re)}const we=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Se(re,ve){if(typeof re>"u"||!g(we,re))throw new N(ve,re,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Ie(re){if(typeof re=="string")return Se(re,"hints"),re;if(n(re)){const ve=re.length;let Ne="";if(ve===0)return Ne;for(let xe=0;xe<ve;xe++){const ke=re[xe];Se(ke,"hints"),Ne+=ke,xe!==ve-1&&(Ne+=", ")}return Ne}throw new N("hints",re,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return ko={isInt32:O,isUint32:J,parseFileMode:X,validateArray:ee,validateStringArray:_e,validateBooleanArray:G,validateAbortSignalArray:W,validateBoolean:ae,validateBuffer:K,validateDictionary:ne,validateEncoding:oe,validateFunction:Te,validateInt32:$,validateInteger:F,validateNumber:se,validateObject:Z,validateOneOf:j,validatePlainFunction:z,validatePort:ce,validateSignalName:Y,validateString:D,validateUint32:ue,validateUndefined:te,validateUnion:fe,validateAbortSignal:Ee,validateLinkHeaderValue:Ie},ko}var _s={exports:{}},Mo={exports:{}},hc;function yn(){if(hc)return Mo.exports;hc=1;var n=Mo.exports={},e,i;function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=r}catch{e=r}try{typeof clearTimeout=="function"?i=clearTimeout:i=o}catch{i=o}})();function a(T){if(e===setTimeout)return setTimeout(T,0);if((e===r||!e)&&setTimeout)return e=setTimeout,setTimeout(T,0);try{return e(T,0)}catch{try{return e.call(null,T,0)}catch{return e.call(this,T,0)}}}function l(T){if(i===clearTimeout)return clearTimeout(T);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(T);try{return i(T)}catch{try{return i.call(null,T)}catch{return i.call(this,T)}}}var u=[],f=!1,d,g=-1;function _(){!f||!d||(f=!1,d.length?u=d.concat(u):g=-1,u.length&&h())}function h(){if(!f){var T=a(_);f=!0;for(var A=u.length;A;){for(d=u,u=[];++g<A;)d&&d[g].run();g=-1,A=u.length}d=null,f=!1,l(T)}}n.nextTick=function(T){var A=new Array(arguments.length-1);if(arguments.length>1)for(var N=1;N<arguments.length;N++)A[N-1]=arguments[N];u.push(new m(T,A)),u.length===1&&!f&&a(h)};function m(T,A){this.fun=T,this.array=A}m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={};function b(){}return n.on=b,n.addListener=b,n.once=b,n.off=b,n.removeListener=b,n.removeAllListeners=b,n.emit=b,n.prependListener=b,n.prependOnceListener=b,n.listeners=function(T){return[]},n.binding=function(T){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(T){throw new Error("process.chdir is not supported")},n.umask=function(){return 0},Mo.exports}var Oo,dc;function Li(){if(dc)return Oo;dc=1;const{SymbolAsyncIterator:n,SymbolIterator:e,SymbolFor:i}=dt(),r=i("nodejs.stream.destroyed"),o=i("nodejs.stream.errored"),a=i("nodejs.stream.readable"),l=i("nodejs.stream.writable"),u=i("nodejs.stream.disturbed"),f=i("nodejs.webstream.isClosedPromise"),d=i("nodejs.webstream.controllerErrorFunction");function g(I,Z=!1){var ne;return!!(I&&typeof I.pipe=="function"&&typeof I.on=="function"&&(!Z||typeof I.pause=="function"&&typeof I.resume=="function")&&(!I._writableState||((ne=I._readableState)===null||ne===void 0?void 0:ne.readable)!==!1)&&(!I._writableState||I._readableState))}function _(I){var Z;return!!(I&&typeof I.write=="function"&&typeof I.on=="function"&&(!I._readableState||((Z=I._writableState)===null||Z===void 0?void 0:Z.writable)!==!1))}function h(I){return!!(I&&typeof I.pipe=="function"&&I._readableState&&typeof I.on=="function"&&typeof I.write=="function")}function m(I){return I&&(I._readableState||I._writableState||typeof I.write=="function"&&typeof I.on=="function"||typeof I.pipe=="function"&&typeof I.on=="function")}function b(I){return!!(I&&!m(I)&&typeof I.pipeThrough=="function"&&typeof I.getReader=="function"&&typeof I.cancel=="function")}function T(I){return!!(I&&!m(I)&&typeof I.getWriter=="function"&&typeof I.abort=="function")}function A(I){return!!(I&&!m(I)&&typeof I.readable=="object"&&typeof I.writable=="object")}function N(I){return b(I)||T(I)||A(I)}function R(I,Z){return I==null?!1:Z===!0?typeof I[n]=="function":Z===!1?typeof I[e]=="function":typeof I[n]=="function"||typeof I[e]=="function"}function S(I){if(!m(I))return null;const Z=I._writableState,ne=I._readableState,ee=Z||ne;return!!(I.destroyed||I[r]||ee!=null&&ee.destroyed)}function y(I){if(!_(I))return null;if(I.writableEnded===!0)return!0;const Z=I._writableState;return Z!=null&&Z.errored?!1:typeof Z?.ended!="boolean"?null:Z.ended}function x(I,Z){if(!_(I))return null;if(I.writableFinished===!0)return!0;const ne=I._writableState;return ne!=null&&ne.errored?!1:typeof ne?.finished!="boolean"?null:!!(ne.finished||Z===!1&&ne.ended===!0&&ne.length===0)}function P(I){if(!g(I))return null;if(I.readableEnded===!0)return!0;const Z=I._readableState;return!Z||Z.errored?!1:typeof Z?.ended!="boolean"?null:Z.ended}function B(I,Z){if(!g(I))return null;const ne=I._readableState;return ne!=null&&ne.errored?!1:typeof ne?.endEmitted!="boolean"?null:!!(ne.endEmitted||Z===!1&&ne.ended===!0&&ne.length===0)}function O(I){return I&&I[a]!=null?I[a]:typeof I?.readable!="boolean"?null:S(I)?!1:g(I)&&I.readable&&!B(I)}function J(I){return I&&I[l]!=null?I[l]:typeof I?.writable!="boolean"?null:S(I)?!1:_(I)&&I.writable&&!y(I)}function k(I,Z){return m(I)?S(I)?!0:!(Z?.readable!==!1&&O(I)||Z?.writable!==!1&&J(I)):null}function q(I){var Z,ne;return m(I)?I.writableErrored?I.writableErrored:(Z=(ne=I._writableState)===null||ne===void 0?void 0:ne.errored)!==null&&Z!==void 0?Z:null:null}function X(I){var Z,ne;return m(I)?I.readableErrored?I.readableErrored:(Z=(ne=I._readableState)===null||ne===void 0?void 0:ne.errored)!==null&&Z!==void 0?Z:null:null}function F(I){if(!m(I))return null;if(typeof I.closed=="boolean")return I.closed;const Z=I._writableState,ne=I._readableState;return typeof Z?.closed=="boolean"||typeof ne?.closed=="boolean"?Z?.closed||ne?.closed:typeof I._closed=="boolean"&&$(I)?I._closed:null}function $(I){return typeof I._closed=="boolean"&&typeof I._defaultKeepAlive=="boolean"&&typeof I._removedConnection=="boolean"&&typeof I._removedContLen=="boolean"}function ue(I){return typeof I._sent100=="boolean"&&$(I)}function D(I){var Z;return typeof I._consuming=="boolean"&&typeof I._dumped=="boolean"&&((Z=I.req)===null||Z===void 0?void 0:Z.upgradeOrConnect)===void 0}function se(I){if(!m(I))return null;const Z=I._writableState,ne=I._readableState,ee=Z||ne;return!ee&&ue(I)||!!(ee&&ee.autoDestroy&&ee.emitClose&&ee.closed===!1)}function j(I){var Z;return!!(I&&((Z=I[u])!==null&&Z!==void 0?Z:I.readableDidRead||I.readableAborted))}function ae(I){var Z,ne,ee,_e,G,W,Y,K,oe,ce;return!!(I&&((Z=(ne=(ee=(_e=(G=(W=I[o])!==null&&W!==void 0?W:I.readableErrored)!==null&&G!==void 0?G:I.writableErrored)!==null&&_e!==void 0?_e:(Y=I._readableState)===null||Y===void 0?void 0:Y.errorEmitted)!==null&&ee!==void 0?ee:(K=I._writableState)===null||K===void 0?void 0:K.errorEmitted)!==null&&ne!==void 0?ne:(oe=I._readableState)===null||oe===void 0?void 0:oe.errored)!==null&&Z!==void 0?Z:!((ce=I._writableState)===null||ce===void 0)&&ce.errored))}return Oo={isDestroyed:S,kIsDestroyed:r,isDisturbed:j,kIsDisturbed:u,isErrored:ae,kIsErrored:o,isReadable:O,kIsReadable:a,kIsClosedPromise:f,kControllerErrorFunction:d,kIsWritable:l,isClosed:F,isDuplexNodeStream:h,isFinished:k,isIterable:R,isReadableNodeStream:g,isReadableStream:b,isReadableEnded:P,isReadableFinished:B,isReadableErrored:X,isNodeStream:m,isWebStream:N,isWritable:J,isWritableNodeStream:_,isWritableStream:T,isWritableEnded:y,isWritableFinished:x,isWritableErrored:q,isServerRequest:D,isServerResponse:ue,willEmitClose:se,isTransformStream:A},Oo}var fc;function Ui(){if(fc)return _s.exports;fc=1;const n=yn(),{AbortError:e,codes:i}=Ct(),{ERR_INVALID_ARG_TYPE:r,ERR_STREAM_PREMATURE_CLOSE:o}=i,{kEmptyObject:a,once:l}=Mt(),{validateAbortSignal:u,validateFunction:f,validateObject:d,validateBoolean:g}=Ur(),{Promise:_,PromisePrototypeThen:h,SymbolDispose:m}=dt(),{isClosed:b,isReadable:T,isReadableNodeStream:A,isReadableStream:N,isReadableFinished:R,isReadableErrored:S,isWritable:y,isWritableNodeStream:x,isWritableStream:P,isWritableFinished:B,isWritableErrored:O,isNodeStream:J,willEmitClose:k,kIsClosedPromise:q}=Li();let X;function F(j){return j.setHeader&&typeof j.abort=="function"}const $=()=>{};function ue(j,ae,I){var Z,ne;if(arguments.length===2?(I=ae,ae=a):ae==null?ae=a:d(ae,"options"),f(I,"callback"),u(ae.signal,"options.signal"),I=l(I),N(j)||P(j))return D(j,ae,I);if(!J(j))throw new r("stream",["ReadableStream","WritableStream","Stream"],j);const ee=(Z=ae.readable)!==null&&Z!==void 0?Z:A(j),_e=(ne=ae.writable)!==null&&ne!==void 0?ne:x(j),G=j._writableState,W=j._readableState,Y=()=>{j.writable||ce()};let K=k(j)&&A(j)===ee&&x(j)===_e,oe=B(j,!1);const ce=()=>{oe=!0,j.destroyed&&(K=!1),!(K&&(!j.readable||ee))&&(!ee||Ee)&&I.call(j)};let Ee=R(j,!1);const Te=()=>{Ee=!0,j.destroyed&&(K=!1),!(K&&(!j.writable||_e))&&(!_e||oe)&&I.call(j)},z=re=>{I.call(j,re)};let te=b(j);const fe=()=>{te=!0;const re=O(j)||S(j);if(re&&typeof re!="boolean")return I.call(j,re);if(ee&&!Ee&&A(j,!0)&&!R(j,!1))return I.call(j,new o);if(_e&&!oe&&!B(j,!1))return I.call(j,new o);I.call(j)},we=()=>{te=!0;const re=O(j)||S(j);if(re&&typeof re!="boolean")return I.call(j,re);I.call(j)},Se=()=>{j.req.on("finish",ce)};F(j)?(j.on("complete",ce),K||j.on("abort",fe),j.req?Se():j.on("request",Se)):_e&&!G&&(j.on("end",Y),j.on("close",Y)),!K&&typeof j.aborted=="boolean"&&j.on("aborted",fe),j.on("end",Te),j.on("finish",ce),ae.error!==!1&&j.on("error",z),j.on("close",fe),te?n.nextTick(fe):G!=null&&G.errorEmitted||W!=null&&W.errorEmitted?K||n.nextTick(we):(!ee&&(!K||T(j))&&(oe||y(j)===!1)||!_e&&(!K||y(j))&&(Ee||T(j)===!1)||W&&j.req&&j.aborted)&&n.nextTick(we);const Ie=()=>{I=$,j.removeListener("aborted",fe),j.removeListener("complete",ce),j.removeListener("abort",fe),j.removeListener("request",Se),j.req&&j.req.removeListener("finish",ce),j.removeListener("end",Y),j.removeListener("close",Y),j.removeListener("finish",ce),j.removeListener("end",Te),j.removeListener("error",z),j.removeListener("close",fe)};if(ae.signal&&!te){const re=()=>{const ve=I;Ie(),ve.call(j,new e(void 0,{cause:ae.signal.reason}))};if(ae.signal.aborted)n.nextTick(re);else{X=X||Mt().addAbortListener;const ve=X(ae.signal,re),Ne=I;I=l((...xe)=>{ve[m](),Ne.apply(j,xe)})}}return Ie}function D(j,ae,I){let Z=!1,ne=$;if(ae.signal)if(ne=()=>{Z=!0,I.call(j,new e(void 0,{cause:ae.signal.reason}))},ae.signal.aborted)n.nextTick(ne);else{X=X||Mt().addAbortListener;const _e=X(ae.signal,ne),G=I;I=l((...W)=>{_e[m](),G.apply(j,W)})}const ee=(..._e)=>{Z||n.nextTick(()=>I.apply(j,_e))};return h(j[q].promise,ee,ee),$}function se(j,ae){var I;let Z=!1;return ae===null&&(ae=a),(I=ae)!==null&&I!==void 0&&I.cleanup&&(g(ae.cleanup,"cleanup"),Z=ae.cleanup),new _((ne,ee)=>{const _e=ue(j,ae,G=>{Z&&_e(),G?ee(G):ne()})})}return _s.exports=ue,_s.exports.finished=se,_s.exports}var Fo,pc;function Un(){if(pc)return Fo;pc=1;const n=yn(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:r}=Ct(),{Symbol:o}=dt(),{kIsDestroyed:a,isDestroyed:l,isFinished:u,isServerRequest:f}=Li(),d=o("kDestroy"),g=o("kConstruct");function _(k,q,X){k&&(k.stack,q&&!q.errored&&(q.errored=k),X&&!X.errored&&(X.errored=k))}function h(k,q){const X=this._readableState,F=this._writableState,$=F||X;return F!=null&&F.destroyed||X!=null&&X.destroyed?(typeof q=="function"&&q(),this):(_(k,F,X),F&&(F.destroyed=!0),X&&(X.destroyed=!0),$.constructed?m(this,k,q):this.once(d,function(ue){m(this,e(ue,k),q)}),this)}function m(k,q,X){let F=!1;function $(ue){if(F)return;F=!0;const D=k._readableState,se=k._writableState;_(ue,se,D),se&&(se.closed=!0),D&&(D.closed=!0),typeof X=="function"&&X(ue),ue?n.nextTick(b,k,ue):n.nextTick(T,k)}try{k._destroy(q||null,$)}catch(ue){$(ue)}}function b(k,q){A(k,q),T(k)}function T(k){const q=k._readableState,X=k._writableState;X&&(X.closeEmitted=!0),q&&(q.closeEmitted=!0),(X!=null&&X.emitClose||q!=null&&q.emitClose)&&k.emit("close")}function A(k,q){const X=k._readableState,F=k._writableState;F!=null&&F.errorEmitted||X!=null&&X.errorEmitted||(F&&(F.errorEmitted=!0),X&&(X.errorEmitted=!0),k.emit("error",q))}function N(){const k=this._readableState,q=this._writableState;k&&(k.constructed=!0,k.closed=!1,k.closeEmitted=!1,k.destroyed=!1,k.errored=null,k.errorEmitted=!1,k.reading=!1,k.ended=k.readable===!1,k.endEmitted=k.readable===!1),q&&(q.constructed=!0,q.destroyed=!1,q.closed=!1,q.closeEmitted=!1,q.errored=null,q.errorEmitted=!1,q.finalCalled=!1,q.prefinished=!1,q.ended=q.writable===!1,q.ending=q.writable===!1,q.finished=q.writable===!1)}function R(k,q,X){const F=k._readableState,$=k._writableState;if($!=null&&$.destroyed||F!=null&&F.destroyed)return this;F!=null&&F.autoDestroy||$!=null&&$.autoDestroy?k.destroy(q):q&&(q.stack,$&&!$.errored&&($.errored=q),F&&!F.errored&&(F.errored=q),X?n.nextTick(A,k,q):A(k,q))}function S(k,q){if(typeof k._construct!="function")return;const X=k._readableState,F=k._writableState;X&&(X.constructed=!1),F&&(F.constructed=!1),k.once(g,q),!(k.listenerCount(g)>1)&&n.nextTick(y,k)}function y(k){let q=!1;function X(F){if(q){R(k,F??new i);return}q=!0;const $=k._readableState,ue=k._writableState,D=ue||$;$&&($.constructed=!0),ue&&(ue.constructed=!0),D.destroyed?k.emit(d,F):F?R(k,F,!0):n.nextTick(x,k)}try{k._construct(F=>{n.nextTick(X,F)})}catch(F){n.nextTick(X,F)}}function x(k){k.emit(g)}function P(k){return k?.setHeader&&typeof k.abort=="function"}function B(k){k.emit("close")}function O(k,q){k.emit("error",q),n.nextTick(B,k)}function J(k,q){!k||l(k)||(!q&&!u(k)&&(q=new r),f(k)?(k.socket=null,k.destroy(q)):P(k)?k.abort():P(k.req)?k.req.abort():typeof k.destroy=="function"?k.destroy(q):typeof k.close=="function"?k.close():q?n.nextTick(O,k,q):n.nextTick(B,k),k.destroyed||(k[a]=!0))}return Fo={construct:S,destroyer:J,destroy:h,undestroy:N,errorOrDestroy:R},Fo}var jo,gc;function Il(){if(gc)return jo;gc=1;const{ArrayIsArray:n,ObjectSetPrototypeOf:e}=dt(),{EventEmitter:i}=qs();function r(a){i.call(this,a)}e(r.prototype,i.prototype),e(r,i),r.prototype.pipe=function(a,l){const u=this;function f(T){a.writable&&a.write(T)===!1&&u.pause&&u.pause()}u.on("data",f);function d(){u.readable&&u.resume&&u.resume()}a.on("drain",d),!a._isStdio&&(!l||l.end!==!1)&&(u.on("end",_),u.on("close",h));let g=!1;function _(){g||(g=!0,a.end())}function h(){g||(g=!0,typeof a.destroy=="function"&&a.destroy())}function m(T){b(),i.listenerCount(this,"error")===0&&this.emit("error",T)}o(u,"error",m),o(a,"error",m);function b(){u.removeListener("data",f),a.removeListener("drain",d),u.removeListener("end",_),u.removeListener("close",h),u.removeListener("error",m),a.removeListener("error",m),u.removeListener("end",b),u.removeListener("close",b),a.removeListener("close",b)}return u.on("end",b),u.on("close",b),a.on("close",b),a.emit("pipe",u),a};function o(a,l,u){if(typeof a.prependListener=="function")return a.prependListener(l,u);!a._events||!a._events[l]?a.on(l,u):n(a._events[l])?a._events[l].unshift(u):a._events[l]=[u,a._events[l]]}return jo={Stream:r,prependListener:o},jo}var $o={exports:{}},mc;function zs(){return mc||(mc=1,(function(n){const{SymbolDispose:e}=dt(),{AbortError:i,codes:r}=Ct(),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:l}=Li(),u=Ui(),{ERR_INVALID_ARG_TYPE:f}=r;let d;const g=(_,h)=>{if(typeof _!="object"||!("aborted"in _))throw new f(h,"AbortSignal",_)};n.exports.addAbortSignal=function(h,m){if(g(h,"signal"),!o(m)&&!a(m))throw new f("stream",["ReadableStream","WritableStream","Stream"],m);return n.exports.addAbortSignalNoValidate(h,m)},n.exports.addAbortSignalNoValidate=function(_,h){if(typeof _!="object"||!("aborted"in _))return h;const m=o(h)?()=>{h.destroy(new i(void 0,{cause:_.reason}))}:()=>{h[l](new i(void 0,{cause:_.reason}))};if(_.aborted)m();else{d=d||Mt().addAbortListener;const b=d(_,m);u(h,b[e])}return h}})($o)),$o.exports}var Bo,_c;function wg(){if(_c)return Bo;_c=1;const{StringPrototypeSlice:n,SymbolIterator:e,TypedArrayPrototypeSet:i,Uint8Array:r}=dt(),{Buffer:o}=Ti(),{inspect:a}=Mt();return Bo=class{constructor(){this.head=null,this.tail=null,this.length=0}push(u){const f={data:u,next:null};this.length>0?this.tail.next=f:this.head=f,this.tail=f,++this.length}unshift(u){const f={data:u,next:this.head};this.length===0&&(this.tail=f),this.head=f,++this.length}shift(){if(this.length===0)return;const u=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,u}clear(){this.head=this.tail=null,this.length=0}join(u){if(this.length===0)return"";let f=this.head,d=""+f.data;for(;(f=f.next)!==null;)d+=u+f.data;return d}concat(u){if(this.length===0)return o.alloc(0);const f=o.allocUnsafe(u>>>0);let d=this.head,g=0;for(;d;)i(f,d.data,g),g+=d.data.length,d=d.next;return f}consume(u,f){const d=this.head.data;if(u<d.length){const g=d.slice(0,u);return this.head.data=d.slice(u),g}return u===d.length?this.shift():f?this._getString(u):this._getBuffer(u)}first(){return this.head.data}*[e](){for(let u=this.head;u;u=u.next)yield u.data}_getString(u){let f="",d=this.head,g=0;do{const _=d.data;if(u>_.length)f+=_,u-=_.length;else{u===_.length?(f+=_,++g,d.next?this.head=d.next:this.head=this.tail=null):(f+=n(_,0,u),this.head=d,d.data=n(_,u));break}++g}while((d=d.next)!==null);return this.length-=g,f}_getBuffer(u){const f=o.allocUnsafe(u),d=u;let g=this.head,_=0;do{const h=g.data;if(u>h.length)i(f,h,d-u),u-=h.length;else{u===h.length?(i(f,h,d-u),++_,g.next?this.head=g.next:this.head=this.tail=null):(i(f,new r(h.buffer,h.byteOffset,u),d-u),this.head=g,g.data=h.slice(u));break}++_}while((g=g.next)!==null);return this.length-=_,f}[Symbol.for("nodejs.util.inspect.custom")](u,f){return a(this,{...f,depth:0,customInspect:!1})}},Bo}var qo,yc;function Us(){if(yc)return qo;yc=1;const{MathFloor:n,NumberIsInteger:e}=dt(),{validateInteger:i}=Ur(),{ERR_INVALID_ARG_VALUE:r}=Ct().codes;let o=16*1024,a=16;function l(g,_,h){return g.highWaterMark!=null?g.highWaterMark:_?g[h]:null}function u(g){return g?a:o}function f(g,_){i(_,"value",0),g?a=_:o=_}function d(g,_,h,m){const b=l(_,m,h);if(b!=null){if(!e(b)||b<0){const T=m?`options.${h}`:"options.highWaterMark";throw new r(T,b)}return n(b)}return u(g.objectMode)}return qo={getHighWaterMark:d,getDefaultHighWaterMark:u,setDefaultHighWaterMark:f},qo}var zo={},ys={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var vc;function xg(){return vc||(vc=1,(function(n,e){var i=Ti(),r=i.Buffer;function o(l,u){for(var f in l)u[f]=l[f]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?n.exports=i:(o(i,e),e.Buffer=a);function a(l,u,f){return r(l,u,f)}a.prototype=Object.create(r.prototype),o(r,a),a.from=function(l,u,f){if(typeof l=="number")throw new TypeError("Argument must not be a number");return r(l,u,f)},a.alloc=function(l,u,f){if(typeof l!="number")throw new TypeError("Argument must be a number");var d=r(l);return u!==void 0?typeof f=="string"?d.fill(u,f):d.fill(u):d.fill(0),d},a.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r(l)},a.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return i.SlowBuffer(l)}})(ys,ys.exports)),ys.exports}var bc;function Eg(){if(bc)return zo;bc=1;var n=xg().Buffer,e=n.isEncoding||function(N){switch(N=""+N,N&&N.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 i(N){if(!N)return"utf8";for(var R;;)switch(N){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 N;default:if(R)return;N=(""+N).toLowerCase(),R=!0}}function r(N){var R=i(N);if(typeof R!="string"&&(n.isEncoding===e||!e(N)))throw new Error("Unknown encoding: "+N);return R||N}zo.StringDecoder=o;function o(N){this.encoding=r(N);var R;switch(this.encoding){case"utf16le":this.text=_,this.end=h,R=4;break;case"utf8":this.fillLast=f,R=4;break;case"base64":this.text=m,this.end=b,R=3;break;default:this.write=T,this.end=A;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(R)}o.prototype.write=function(N){if(N.length===0)return"";var R,S;if(this.lastNeed){if(R=this.fillLast(N),R===void 0)return"";S=this.lastNeed,this.lastNeed=0}else S=0;return S<N.length?R?R+this.text(N,S):this.text(N,S):R||""},o.prototype.end=g,o.prototype.text=d,o.prototype.fillLast=function(N){if(this.lastNeed<=N.length)return N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,this.lastTotal-this.lastNeed,0,N.length),this.lastNeed-=N.length};function a(N){return N<=127?0:N>>5===6?2:N>>4===14?3:N>>3===30?4:N>>6===2?-1:-2}function l(N,R,S){var y=R.length-1;if(y<S)return 0;var x=a(R[y]);return x>=0?(x>0&&(N.lastNeed=x-1),x):--y<S||x===-2?0:(x=a(R[y]),x>=0?(x>0&&(N.lastNeed=x-2),x):--y<S||x===-2?0:(x=a(R[y]),x>=0?(x>0&&(x===2?x=0:N.lastNeed=x-3),x):0))}function u(N,R,S){if((R[0]&192)!==128)return N.lastNeed=0,"�";if(N.lastNeed>1&&R.length>1){if((R[1]&192)!==128)return N.lastNeed=1,"�";if(N.lastNeed>2&&R.length>2&&(R[2]&192)!==128)return N.lastNeed=2,"�"}}function f(N){var R=this.lastTotal-this.lastNeed,S=u(this,N);if(S!==void 0)return S;if(this.lastNeed<=N.length)return N.copy(this.lastChar,R,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);N.copy(this.lastChar,R,0,N.length),this.lastNeed-=N.length}function d(N,R){var S=l(this,N,R);if(!this.lastNeed)return N.toString("utf8",R);this.lastTotal=S;var y=N.length-(S-this.lastNeed);return N.copy(this.lastChar,0,y),N.toString("utf8",R,y)}function g(N){var R=N&&N.length?this.write(N):"";return this.lastNeed?R+"�":R}function _(N,R){if((N.length-R)%2===0){var S=N.toString("utf16le",R);if(S){var y=S.charCodeAt(S.length-1);if(y>=55296&&y<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1],S.slice(0,-1)}return S}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=N[N.length-1],N.toString("utf16le",R,N.length-1)}function h(N){var R=N&&N.length?this.write(N):"";if(this.lastNeed){var S=this.lastTotal-this.lastNeed;return R+this.lastChar.toString("utf16le",0,S)}return R}function m(N,R){var S=(N.length-R)%3;return S===0?N.toString("base64",R):(this.lastNeed=3-S,this.lastTotal=3,S===1?this.lastChar[0]=N[N.length-1]:(this.lastChar[0]=N[N.length-2],this.lastChar[1]=N[N.length-1]),N.toString("base64",R,N.length-S))}function b(N){var R=N&&N.length?this.write(N):"";return this.lastNeed?R+this.lastChar.toString("base64",0,3-this.lastNeed):R}function T(N){return N.toString(this.encoding)}function A(N){return N&&N.length?this.write(N):""}return zo}var Uo,wc;function tf(){if(wc)return Uo;wc=1;const n=yn(),{PromisePrototypeThen:e,SymbolAsyncIterator:i,SymbolIterator:r}=dt(),{Buffer:o}=Ti(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=Ct().codes;function u(f,d,g){let _;if(typeof d=="string"||d instanceof o)return new f({objectMode:!0,...g,read(){this.push(d),this.push(null)}});let h;if(d&&d[i])h=!0,_=d[i]();else if(d&&d[r])h=!1,_=d[r]();else throw new a("iterable",["Iterable"],d);const m=new f({objectMode:!0,highWaterMark:1,...g});let b=!1;m._read=function(){b||(b=!0,A())},m._destroy=function(N,R){e(T(N),()=>n.nextTick(R,N),S=>n.nextTick(R,S||N))};async function T(N){const R=N!=null,S=typeof _.throw=="function";if(R&&S){const{value:y,done:x}=await _.throw(N);if(await y,x)return}if(typeof _.return=="function"){const{value:y}=await _.return();await y}}async function A(){for(;;){try{const{value:N,done:R}=h?await _.next():_.next();if(R)m.push(null);else{const S=N&&typeof N.then=="function"?await N:N;if(S===null)throw b=!1,new l;if(m.push(S))continue;b=!1}}catch(N){m.destroy(N)}break}}return m}return Uo=u,Uo}var Ho,xc;function Hs(){if(xc)return Ho;xc=1;const n=yn(),{ArrayPrototypeIndexOf:e,NumberIsInteger:i,NumberIsNaN:r,NumberParseInt:o,ObjectDefineProperties:a,ObjectKeys:l,ObjectSetPrototypeOf:u,Promise:f,SafeSet:d,SymbolAsyncDispose:g,SymbolAsyncIterator:_,Symbol:h}=dt();Ho=xe,xe.ReadableState=Ne;const{EventEmitter:m}=qs(),{Stream:b,prependListener:T}=Il(),{Buffer:A}=Ti(),{addAbortSignal:N}=zs(),R=Ui();let S=Mt().debuglog("stream",U=>{S=U});const y=wg(),x=Un(),{getHighWaterMark:P,getDefaultHighWaterMark:B}=Us(),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:J,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_OUT_OF_RANGE:q,ERR_STREAM_PUSH_AFTER_EOF:X,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:F},AbortError:$}=Ct(),{validateObject:ue}=Ur(),D=h("kPaused"),{StringDecoder:se}=Eg(),j=tf();u(xe.prototype,b.prototype),u(xe,b);const ae=()=>{},{errorOrDestroy:I}=x,Z=1,ne=2,ee=4,_e=8,G=16,W=32,Y=64,K=128,oe=256,ce=512,Ee=1024,Te=2048,z=4096,te=8192,fe=16384,we=32768,Se=65536,Ie=1<<17,re=1<<18;function ve(U){return{enumerable:!1,get(){return(this.state&U)!==0},set(Q){Q?this.state|=U:this.state&=~U}}}a(Ne.prototype,{objectMode:ve(Z),ended:ve(ne),endEmitted:ve(ee),reading:ve(_e),constructed:ve(G),sync:ve(W),needReadable:ve(Y),emittedReadable:ve(K),readableListening:ve(oe),resumeScheduled:ve(ce),errorEmitted:ve(Ee),emitClose:ve(Te),autoDestroy:ve(z),destroyed:ve(te),closed:ve(fe),closeEmitted:ve(we),multiAwaitDrain:ve(Se),readingMore:ve(Ie),dataEmitted:ve(re)});function Ne(U,Q,Ae){typeof Ae!="boolean"&&(Ae=Q instanceof Ei()),this.state=Te|z|G|W,U&&U.objectMode&&(this.state|=Z),Ae&&U&&U.readableObjectMode&&(this.state|=Z),this.highWaterMark=U?P(this,U,"readableHighWaterMark",Ae):B(!1),this.buffer=new y,this.length=0,this.pipes=[],this.flowing=null,this[D]=null,U&&U.emitClose===!1&&(this.state&=~Te),U&&U.autoDestroy===!1&&(this.state&=~z),this.errored=null,this.defaultEncoding=U&&U.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,U&&U.encoding&&(this.decoder=new se(U.encoding),this.encoding=U.encoding)}function xe(U){if(!(this instanceof xe))return new xe(U);const Q=this instanceof Ei();this._readableState=new Ne(U,this,Q),U&&(typeof U.read=="function"&&(this._read=U.read),typeof U.destroy=="function"&&(this._destroy=U.destroy),typeof U.construct=="function"&&(this._construct=U.construct),U.signal&&!Q&&N(U.signal,this)),b.call(this,U),x.construct(this,()=>{this._readableState.needReadable&&le(this,this._readableState)})}xe.prototype.destroy=x.destroy,xe.prototype._undestroy=x.undestroy,xe.prototype._destroy=function(U,Q){Q(U)},xe.prototype[m.captureRejectionSymbol]=function(U){this.destroy(U)},xe.prototype[g]=function(){let U;return this.destroyed||(U=this.readableEnded?null:new $,this.destroy(U)),new f((Q,Ae)=>R(this,Re=>Re&&Re!==U?Ae(Re):Q(null)))},xe.prototype.push=function(U,Q){return ke(this,U,Q,!1)},xe.prototype.unshift=function(U,Q){return ke(this,U,Q,!0)};function ke(U,Q,Ae,Re){S("readableAddChunk",Q);const Me=U._readableState;let mt;if((Me.state&Z)===0&&(typeof Q=="string"?(Ae=Ae||Me.defaultEncoding,Me.encoding!==Ae&&(Re&&Me.encoding?Q=A.from(Q,Ae).toString(Me.encoding):(Q=A.from(Q,Ae),Ae=""))):Q instanceof A?Ae="":b._isUint8Array(Q)?(Q=b._uint8ArrayToBuffer(Q),Ae=""):Q!=null&&(mt=new J("chunk",["string","Buffer","Uint8Array"],Q))),mt)I(U,mt);else if(Q===null)Me.state&=~_e,v(U,Me);else if((Me.state&Z)!==0||Q&&Q.length>0)if(Re)if((Me.state&ee)!==0)I(U,new F);else{if(Me.destroyed||Me.errored)return!1;lt(U,Me,Q,!0)}else if(Me.ended)I(U,new X);else{if(Me.destroyed||Me.errored)return!1;Me.state&=~_e,Me.decoder&&!Ae?(Q=Me.decoder.write(Q),Me.objectMode||Q.length!==0?lt(U,Me,Q,!1):le(U,Me)):lt(U,Me,Q,!1)}else Re||(Me.state&=~_e,le(U,Me));return!Me.ended&&(Me.length<Me.highWaterMark||Me.length===0)}function lt(U,Q,Ae,Re){Q.flowing&&Q.length===0&&!Q.sync&&U.listenerCount("data")>0?((Q.state&Se)!==0?Q.awaitDrainWriters.clear():Q.awaitDrainWriters=null,Q.dataEmitted=!0,U.emit("data",Ae)):(Q.length+=Q.objectMode?1:Ae.length,Re?Q.buffer.unshift(Ae):Q.buffer.push(Ae),(Q.state&Y)!==0&&w(U)),le(U,Q)}xe.prototype.isPaused=function(){const U=this._readableState;return U[D]===!0||U.flowing===!1},xe.prototype.setEncoding=function(U){const Q=new se(U);this._readableState.decoder=Q,this._readableState.encoding=this._readableState.decoder.encoding;const Ae=this._readableState.buffer;let Re="";for(const Me of Ae)Re+=Q.write(Me);return Ae.clear(),Re!==""&&Ae.push(Re),this._readableState.length=Re.length,this};const We=1073741824;function nt(U){if(U>We)throw new q("size","<= 1GiB",U);return U--,U|=U>>>1,U|=U>>>2,U|=U>>>4,U|=U>>>8,U|=U>>>16,U++,U}function M(U,Q){return U<=0||Q.length===0&&Q.ended?0:(Q.state&Z)!==0?1:r(U)?Q.flowing&&Q.length?Q.buffer.first().length:Q.length:U<=Q.length?U:Q.ended?Q.length:0}xe.prototype.read=function(U){S("read",U),U===void 0?U=NaN:i(U)||(U=o(U,10));const Q=this._readableState,Ae=U;if(U>Q.highWaterMark&&(Q.highWaterMark=nt(U)),U!==0&&(Q.state&=~K),U===0&&Q.needReadable&&((Q.highWaterMark!==0?Q.length>=Q.highWaterMark:Q.length>0)||Q.ended))return S("read: emitReadable",Q.length,Q.ended),Q.length===0&&Q.ended?ut(this):w(this),null;if(U=M(U,Q),U===0&&Q.ended)return Q.length===0&&ut(this),null;let Re=(Q.state&Y)!==0;if(S("need readable",Re),(Q.length===0||Q.length-U<Q.highWaterMark)&&(Re=!0,S("length less than watermark",Re)),Q.ended||Q.reading||Q.destroyed||Q.errored||!Q.constructed)Re=!1,S("reading, ended or constructing",Re);else if(Re){S("do read"),Q.state|=_e|W,Q.length===0&&(Q.state|=Y);try{this._read(Q.highWaterMark)}catch(mt){I(this,mt)}Q.state&=~W,Q.reading||(U=M(Ae,Q))}let Me;return U>0?Me=ot(U,Q):Me=null,Me===null?(Q.needReadable=Q.length<=Q.highWaterMark,U=0):(Q.length-=U,Q.multiAwaitDrain?Q.awaitDrainWriters.clear():Q.awaitDrainWriters=null),Q.length===0&&(Q.ended||(Q.needReadable=!0),Ae!==U&&Q.ended&&ut(this)),Me!==null&&!Q.errorEmitted&&!Q.closeEmitted&&(Q.dataEmitted=!0,this.emit("data",Me)),Me};function v(U,Q){if(S("onEofChunk"),!Q.ended){if(Q.decoder){const Ae=Q.decoder.end();Ae&&Ae.length&&(Q.buffer.push(Ae),Q.length+=Q.objectMode?1:Ae.length)}Q.ended=!0,Q.sync?w(U):(Q.needReadable=!1,Q.emittedReadable=!0,H(U))}}function w(U){const Q=U._readableState;S("emitReadable",Q.needReadable,Q.emittedReadable),Q.needReadable=!1,Q.emittedReadable||(S("emitReadable",Q.flowing),Q.emittedReadable=!0,n.nextTick(H,U))}function H(U){const Q=U._readableState;S("emitReadable_",Q.destroyed,Q.length,Q.ended),!Q.destroyed&&!Q.errored&&(Q.length||Q.ended)&&(U.emit("readable"),Q.emittedReadable=!1),Q.needReadable=!Q.flowing&&!Q.ended&&Q.length<=Q.highWaterMark,Ze(U)}function le(U,Q){!Q.readingMore&&Q.constructed&&(Q.readingMore=!0,n.nextTick(pe,U,Q))}function pe(U,Q){for(;!Q.reading&&!Q.ended&&(Q.length<Q.highWaterMark||Q.flowing&&Q.length===0);){const Ae=Q.length;if(S("maybeReadMore read 0"),U.read(0),Ae===Q.length)break}Q.readingMore=!1}xe.prototype._read=function(U){throw new k("_read()")},xe.prototype.pipe=function(U,Q){const Ae=this,Re=this._readableState;Re.pipes.length===1&&(Re.multiAwaitDrain||(Re.multiAwaitDrain=!0,Re.awaitDrainWriters=new d(Re.awaitDrainWriters?[Re.awaitDrainWriters]:[]))),Re.pipes.push(U),S("pipe count=%d opts=%j",Re.pipes.length,Q);const mt=(!Q||Q.end!==!1)&&U!==n.stdout&&U!==n.stderr?Nt:V;Re.endEmitted?n.nextTick(mt):Ae.once("end",mt),U.on("unpipe",bt);function bt(he,ge){S("onunpipe"),he===Ae&&ge&&ge.hasUnpiped===!1&&(ge.hasUnpiped=!0,zt())}function Nt(){S("onend"),U.end()}let De,Gi=!1;function zt(){S("cleanup"),U.removeListener("close",Ci),U.removeListener("finish",rt),De&&U.removeListener("drain",De),U.removeListener("error",li),U.removeListener("unpipe",bt),Ae.removeListener("end",Nt),Ae.removeListener("end",V),Ae.removeListener("data",gi),Gi=!0,De&&Re.awaitDrainWriters&&(!U._writableState||U._writableState.needDrain)&&De()}function Pi(){Gi||(Re.pipes.length===1&&Re.pipes[0]===U?(S("false write response, pause",0),Re.awaitDrainWriters=U,Re.multiAwaitDrain=!1):Re.pipes.length>1&&Re.pipes.includes(U)&&(S("false write response, pause",Re.awaitDrainWriters.size),Re.awaitDrainWriters.add(U)),Ae.pause()),De||(De=be(Ae,U),U.on("drain",De))}Ae.on("data",gi);function gi(he){S("ondata");const ge=U.write(he);S("dest.write",ge),ge===!1&&Pi()}function li(he){if(S("onerror",he),V(),U.removeListener("error",li),U.listenerCount("error")===0){const ge=U._writableState||U._readableState;ge&&!ge.errorEmitted?I(U,he):U.emit("error",he)}}T(U,"error",li);function Ci(){U.removeListener("finish",rt),V()}U.once("close",Ci);function rt(){S("onfinish"),U.removeListener("close",Ci),V()}U.once("finish",rt);function V(){S("unpipe"),Ae.unpipe(U)}return U.emit("pipe",Ae),U.writableNeedDrain===!0?Pi():Re.flowing||(S("pipe resume"),Ae.resume()),U};function be(U,Q){return function(){const Re=U._readableState;Re.awaitDrainWriters===Q?(S("pipeOnDrain",1),Re.awaitDrainWriters=null):Re.multiAwaitDrain&&(S("pipeOnDrain",Re.awaitDrainWriters.size),Re.awaitDrainWriters.delete(Q)),(!Re.awaitDrainWriters||Re.awaitDrainWriters.size===0)&&U.listenerCount("data")&&U.resume()}}xe.prototype.unpipe=function(U){const Q=this._readableState,Ae={hasUnpiped:!1};if(Q.pipes.length===0)return this;if(!U){const Me=Q.pipes;Q.pipes=[],this.pause();for(let mt=0;mt<Me.length;mt++)Me[mt].emit("unpipe",this,{hasUnpiped:!1});return this}const Re=e(Q.pipes,U);return Re===-1?this:(Q.pipes.splice(Re,1),Q.pipes.length===0&&this.pause(),U.emit("unpipe",this,Ae),this)},xe.prototype.on=function(U,Q){const Ae=b.prototype.on.call(this,U,Q),Re=this._readableState;return U==="data"?(Re.readableListening=this.listenerCount("readable")>0,Re.flowing!==!1&&this.resume()):U==="readable"&&!Re.endEmitted&&!Re.readableListening&&(Re.readableListening=Re.needReadable=!0,Re.flowing=!1,Re.emittedReadable=!1,S("on readable",Re.length,Re.reading),Re.length?w(this):Re.reading||n.nextTick(Ye,this)),Ae},xe.prototype.addListener=xe.prototype.on,xe.prototype.removeListener=function(U,Q){const Ae=b.prototype.removeListener.call(this,U,Q);return U==="readable"&&n.nextTick(Oe,this),Ae},xe.prototype.off=xe.prototype.removeListener,xe.prototype.removeAllListeners=function(U){const Q=b.prototype.removeAllListeners.apply(this,arguments);return(U==="readable"||U===void 0)&&n.nextTick(Oe,this),Q};function Oe(U){const Q=U._readableState;Q.readableListening=U.listenerCount("readable")>0,Q.resumeScheduled&&Q[D]===!1?Q.flowing=!0:U.listenerCount("data")>0?U.resume():Q.readableListening||(Q.flowing=null)}function Ye(U){S("readable nexttick read 0"),U.read(0)}xe.prototype.resume=function(){const U=this._readableState;return U.flowing||(S("resume"),U.flowing=!U.readableListening,Je(this,U)),U[D]=!1,this};function Je(U,Q){Q.resumeScheduled||(Q.resumeScheduled=!0,n.nextTick(Ge,U,Q))}function Ge(U,Q){S("resume",Q.reading),Q.reading||U.read(0),Q.resumeScheduled=!1,U.emit("resume"),Ze(U),Q.flowing&&!Q.reading&&U.read(0)}xe.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[D]=!0,this};function Ze(U){const Q=U._readableState;for(S("flow",Q.flowing);Q.flowing&&U.read()!==null;);}xe.prototype.wrap=function(U){let Q=!1;U.on("data",Re=>{!this.push(Re)&&U.pause&&(Q=!0,U.pause())}),U.on("end",()=>{this.push(null)}),U.on("error",Re=>{I(this,Re)}),U.on("close",()=>{this.destroy()}),U.on("destroy",()=>{this.destroy()}),this._read=()=>{Q&&U.resume&&(Q=!1,U.resume())};const Ae=l(U);for(let Re=1;Re<Ae.length;Re++){const Me=Ae[Re];this[Me]===void 0&&typeof U[Me]=="function"&&(this[Me]=U[Me].bind(U))}return this},xe.prototype[_]=function(){return Ot(this)},xe.prototype.iterator=function(U){return U!==void 0&&ue(U,"options"),Ot(this,U)};function Ot(U,Q){typeof U.read!="function"&&(U=xe.wrap(U,{objectMode:!0}));const Ae=Jt(U,Q);return Ae.stream=U,Ae}async function*Jt(U,Q){let Ae=ae;function Re(bt){this===U?(Ae(),Ae=ae):Ae=bt}U.on("readable",Re);let Me;const mt=R(U,{writable:!1},bt=>{Me=bt?O(Me,bt):null,Ae(),Ae=ae});try{for(;;){const bt=U.destroyed?null:U.read();if(bt!==null)yield bt;else{if(Me)throw Me;if(Me===null)return;await new f(Re)}}}catch(bt){throw Me=O(Me,bt),Me}finally{(Me||Q?.destroyOnReturn!==!1)&&(Me===void 0||U._readableState.autoDestroy)?x.destroyer(U,null):(U.off("readable",Re),mt())}}a(xe.prototype,{readable:{__proto__:null,get(){const U=this._readableState;return!!U&&U.readable!==!1&&!U.destroyed&&!U.errorEmitted&&!U.endEmitted},set(U){this._readableState&&(this._readableState.readable=!!U)}},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(U){this._readableState&&(this._readableState.flowing=U)}},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(U){this._readableState&&(this._readableState.destroyed=U)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),a(Ne.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[D]!==!1},set(U){this[D]=!!U}}}),xe._fromList=ot;function ot(U,Q){if(Q.length===0)return null;let Ae;return Q.objectMode?Ae=Q.buffer.shift():!U||U>=Q.length?(Q.decoder?Ae=Q.buffer.join(""):Q.buffer.length===1?Ae=Q.buffer.first():Ae=Q.buffer.concat(Q.length),Q.buffer.clear()):Ae=Q.buffer.consume(U,Q.decoder),Ae}function ut(U){const Q=U._readableState;S("endReadable",Q.endEmitted),Q.endEmitted||(Q.ended=!0,n.nextTick(vn,Q,U))}function vn(U,Q){if(S("endReadableNT",U.endEmitted,U.length),!U.errored&&!U.closeEmitted&&!U.endEmitted&&U.length===0){if(U.endEmitted=!0,Q.emit("end"),Q.writable&&Q.allowHalfOpen===!1)n.nextTick(ai,Q);else if(U.autoDestroy){const Ae=Q._writableState;(!Ae||Ae.autoDestroy&&(Ae.finished||Ae.writable===!1))&&Q.destroy()}}}function ai(U){U.writable&&!U.writableEnded&&!U.destroyed&&U.end()}xe.from=function(U,Q){return j(xe,U,Q)};let Ri;function Wi(){return Ri===void 0&&(Ri={}),Ri}return xe.fromWeb=function(U,Q){return Wi().newStreamReadableFromReadableStream(U,Q)},xe.toWeb=function(U,Q){return Wi().newReadableStreamFromStreamReadable(U,Q)},xe.wrap=function(U,Q){var Ae,Re;return new xe({objectMode:(Ae=(Re=U.readableObjectMode)!==null&&Re!==void 0?Re:U.objectMode)!==null&&Ae!==void 0?Ae:!0,...Q,destroy(Me,mt){x.destroyer(U,Me),mt(Me)}}).wrap(U)},Ho}var Vo,Ec;function Al(){if(Ec)return Vo;Ec=1;const n=yn(),{ArrayPrototypeSlice:e,Error:i,FunctionPrototypeSymbolHasInstance:r,ObjectDefineProperty:o,ObjectDefineProperties:a,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:d}=dt();Vo=ue,ue.WritableState=F;const{EventEmitter:g}=qs(),_=Il().Stream,{Buffer:h}=Ti(),m=Un(),{addAbortSignal:b}=zs(),{getHighWaterMark:T,getDefaultHighWaterMark:A}=Us(),{ERR_INVALID_ARG_TYPE:N,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:y,ERR_STREAM_DESTROYED:x,ERR_STREAM_ALREADY_FINISHED:P,ERR_STREAM_NULL_VALUES:B,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:J}=Ct().codes,{errorOrDestroy:k}=m;l(ue.prototype,_.prototype),l(ue,_);function q(){}const X=f("kOnFinished");function F(z,te,fe){typeof fe!="boolean"&&(fe=te instanceof Ei()),this.objectMode=!!(z&&z.objectMode),fe&&(this.objectMode=this.objectMode||!!(z&&z.writableObjectMode)),this.highWaterMark=z?T(this,z,"writableHighWaterMark",fe):A(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const we=!!(z&&z.decodeStrings===!1);this.decodeStrings=!we,this.defaultEncoding=z&&z.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=I.bind(void 0,te),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,$(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!z||z.emitClose!==!1,this.autoDestroy=!z||z.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[X]=[]}function $(z){z.buffered=[],z.bufferedIndex=0,z.allBuffers=!0,z.allNoop=!0}F.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},o(F.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function ue(z){const te=this instanceof Ei();if(!te&&!r(ue,this))return new ue(z);this._writableState=new F(z,this,te),z&&(typeof z.write=="function"&&(this._write=z.write),typeof z.writev=="function"&&(this._writev=z.writev),typeof z.destroy=="function"&&(this._destroy=z.destroy),typeof z.final=="function"&&(this._final=z.final),typeof z.construct=="function"&&(this._construct=z.construct),z.signal&&b(z.signal,this)),_.call(this,z),m.construct(this,()=>{const fe=this._writableState;fe.writing||_e(this,fe),K(this,fe)})}o(ue,d,{__proto__:null,value:function(z){return r(this,z)?!0:this!==ue?!1:z&&z._writableState instanceof F}}),ue.prototype.pipe=function(){k(this,new y)};function D(z,te,fe,we){const Se=z._writableState;if(typeof fe=="function")we=fe,fe=Se.defaultEncoding;else{if(!fe)fe=Se.defaultEncoding;else if(fe!=="buffer"&&!h.isEncoding(fe))throw new J(fe);typeof we!="function"&&(we=q)}if(te===null)throw new B;if(!Se.objectMode)if(typeof te=="string")Se.decodeStrings!==!1&&(te=h.from(te,fe),fe="buffer");else if(te instanceof h)fe="buffer";else if(_._isUint8Array(te))te=_._uint8ArrayToBuffer(te),fe="buffer";else throw new N("chunk",["string","Buffer","Uint8Array"],te);let Ie;return Se.ending?Ie=new O:Se.destroyed&&(Ie=new x("write")),Ie?(n.nextTick(we,Ie),k(z,Ie,!0),Ie):(Se.pendingcb++,se(z,Se,te,fe,we))}ue.prototype.write=function(z,te,fe){return D(this,z,te,fe)===!0},ue.prototype.cork=function(){this._writableState.corked++},ue.prototype.uncork=function(){const z=this._writableState;z.corked&&(z.corked--,z.writing||_e(this,z))},ue.prototype.setDefaultEncoding=function(te){if(typeof te=="string"&&(te=u(te)),!h.isEncoding(te))throw new J(te);return this._writableState.defaultEncoding=te,this};function se(z,te,fe,we,Se){const Ie=te.objectMode?1:fe.length;te.length+=Ie;const re=te.length<te.highWaterMark;return re||(te.needDrain=!0),te.writing||te.corked||te.errored||!te.constructed?(te.buffered.push({chunk:fe,encoding:we,callback:Se}),te.allBuffers&&we!=="buffer"&&(te.allBuffers=!1),te.allNoop&&Se!==q&&(te.allNoop=!1)):(te.writelen=Ie,te.writecb=Se,te.writing=!0,te.sync=!0,z._write(fe,we,te.onwrite),te.sync=!1),re&&!te.errored&&!te.destroyed}function j(z,te,fe,we,Se,Ie,re){te.writelen=we,te.writecb=re,te.writing=!0,te.sync=!0,te.destroyed?te.onwrite(new x("write")):fe?z._writev(Se,te.onwrite):z._write(Se,Ie,te.onwrite),te.sync=!1}function ae(z,te,fe,we){--te.pendingcb,we(fe),ee(te),k(z,fe)}function I(z,te){const fe=z._writableState,we=fe.sync,Se=fe.writecb;if(typeof Se!="function"){k(z,new S);return}fe.writing=!1,fe.writecb=null,fe.length-=fe.writelen,fe.writelen=0,te?(te.stack,fe.errored||(fe.errored=te),z._readableState&&!z._readableState.errored&&(z._readableState.errored=te),we?n.nextTick(ae,z,fe,te,Se):ae(z,fe,te,Se)):(fe.buffered.length>fe.bufferedIndex&&_e(z,fe),we?fe.afterWriteTickInfo!==null&&fe.afterWriteTickInfo.cb===Se?fe.afterWriteTickInfo.count++:(fe.afterWriteTickInfo={count:1,cb:Se,stream:z,state:fe},n.nextTick(Z,fe.afterWriteTickInfo)):ne(z,fe,1,Se))}function Z({stream:z,state:te,count:fe,cb:we}){return te.afterWriteTickInfo=null,ne(z,te,fe,we)}function ne(z,te,fe,we){for(!te.ending&&!z.destroyed&&te.length===0&&te.needDrain&&(te.needDrain=!1,z.emit("drain"));fe-- >0;)te.pendingcb--,we();te.destroyed&&ee(te),K(z,te)}function ee(z){if(z.writing)return;for(let Se=z.bufferedIndex;Se<z.buffered.length;++Se){var te;const{chunk:Ie,callback:re}=z.buffered[Se],ve=z.objectMode?1:Ie.length;z.length-=ve,re((te=z.errored)!==null&&te!==void 0?te:new x("write"))}const fe=z[X].splice(0);for(let Se=0;Se<fe.length;Se++){var we;fe[Se]((we=z.errored)!==null&&we!==void 0?we:new x("end"))}$(z)}function _e(z,te){if(te.corked||te.bufferProcessing||te.destroyed||!te.constructed)return;const{buffered:fe,bufferedIndex:we,objectMode:Se}=te,Ie=fe.length-we;if(!Ie)return;let re=we;if(te.bufferProcessing=!0,Ie>1&&z._writev){te.pendingcb-=Ie-1;const ve=te.allNoop?q:xe=>{for(let ke=re;ke<fe.length;++ke)fe[ke].callback(xe)},Ne=te.allNoop&&re===0?fe:e(fe,re);Ne.allBuffers=te.allBuffers,j(z,te,!0,te.length,Ne,"",ve),$(te)}else{do{const{chunk:ve,encoding:Ne,callback:xe}=fe[re];fe[re++]=null;const ke=Se?1:ve.length;j(z,te,!1,ke,ve,Ne,xe)}while(re<fe.length&&!te.writing);re===fe.length?$(te):re>256?(fe.splice(0,re),te.bufferedIndex=0):te.bufferedIndex=re}te.bufferProcessing=!1}ue.prototype._write=function(z,te,fe){if(this._writev)this._writev([{chunk:z,encoding:te}],fe);else throw new R("_write()")},ue.prototype._writev=null,ue.prototype.end=function(z,te,fe){const we=this._writableState;typeof z=="function"?(fe=z,z=null,te=null):typeof te=="function"&&(fe=te,te=null);let Se;if(z!=null){const Ie=D(this,z,te);Ie instanceof i&&(Se=Ie)}return we.corked&&(we.corked=1,this.uncork()),Se||(!we.errored&&!we.ending?(we.ending=!0,K(this,we,!0),we.ended=!0):we.finished?Se=new P("end"):we.destroyed&&(Se=new x("end"))),typeof fe=="function"&&(Se||we.finished?n.nextTick(fe,Se):we[X].push(fe)),this};function G(z){return z.ending&&!z.destroyed&&z.constructed&&z.length===0&&!z.errored&&z.buffered.length===0&&!z.finished&&!z.writing&&!z.errorEmitted&&!z.closeEmitted}function W(z,te){let fe=!1;function we(Se){if(fe){k(z,Se??S());return}if(fe=!0,te.pendingcb--,Se){const Ie=te[X].splice(0);for(let re=0;re<Ie.length;re++)Ie[re](Se);k(z,Se,te.sync)}else G(te)&&(te.prefinished=!0,z.emit("prefinish"),te.pendingcb++,n.nextTick(oe,z,te))}te.sync=!0,te.pendingcb++;try{z._final(we)}catch(Se){we(Se)}te.sync=!1}function Y(z,te){!te.prefinished&&!te.finalCalled&&(typeof z._final=="function"&&!te.destroyed?(te.finalCalled=!0,W(z,te)):(te.prefinished=!0,z.emit("prefinish")))}function K(z,te,fe){G(te)&&(Y(z,te),te.pendingcb===0&&(fe?(te.pendingcb++,n.nextTick((we,Se)=>{G(Se)?oe(we,Se):Se.pendingcb--},z,te)):G(te)&&(te.pendingcb++,oe(z,te))))}function oe(z,te){te.pendingcb--,te.finished=!0;const fe=te[X].splice(0);for(let we=0;we<fe.length;we++)fe[we]();if(z.emit("finish"),te.autoDestroy){const we=z._readableState;(!we||we.autoDestroy&&(we.endEmitted||we.readable===!1))&&z.destroy()}}a(ue.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(z){this._writableState&&(this._writableState.destroyed=z)}},writable:{__proto__:null,get(){const z=this._writableState;return!!z&&z.writable!==!1&&!z.destroyed&&!z.errored&&!z.ending&&!z.ended},set(z){this._writableState&&(this._writableState.writable=!!z)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const z=this._writableState;return z?!z.destroyed&&!z.ending&&z.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const ce=m.destroy;ue.prototype.destroy=function(z,te){const fe=this._writableState;return!fe.destroyed&&(fe.bufferedIndex<fe.buffered.length||fe[X].length)&&n.nextTick(ee,fe),ce.call(this,z,te),this},ue.prototype._undestroy=m.undestroy,ue.prototype._destroy=function(z,te){te(z)},ue.prototype[g.captureRejectionSymbol]=function(z){this.destroy(z)};let Ee;function Te(){return Ee===void 0&&(Ee={}),Ee}return ue.fromWeb=function(z,te){return Te().newStreamWritableFromWritableStream(z,te)},ue.toWeb=function(z){return Te().newWritableStreamFromStreamWritable(z)},Vo}var Wo,Sc;function Sg(){if(Sc)return Wo;Sc=1;const n=yn(),e=Ti(),{isReadable:i,isWritable:r,isIterable:o,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:d,isWritableStream:g}=Li(),_=Ui(),{AbortError:h,codes:{ERR_INVALID_ARG_TYPE:m,ERR_INVALID_RETURN_VALUE:b}}=Ct(),{destroyer:T}=Un(),A=Ei(),N=Hs(),R=Al(),{createDeferredPromise:S}=Mt(),y=tf(),x=globalThis.Blob||e.Blob,P=typeof x<"u"?function(F){return F instanceof x}:function(F){return!1},B=globalThis.AbortController||jr().AbortController,{FunctionPrototypeCall:O}=dt();class J extends A{constructor(F){super(F),F?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),F?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}Wo=function X(F,$){if(f(F))return F;if(l(F))return q({readable:F});if(u(F))return q({writable:F});if(a(F))return q({writable:!1,readable:!1});if(d(F))return q({readable:N.fromWeb(F)});if(g(F))return q({writable:R.fromWeb(F)});if(typeof F=="function"){const{value:D,write:se,final:j,destroy:ae}=k(F);if(o(D))return y(J,D,{objectMode:!0,write:se,final:j,destroy:ae});const I=D?.then;if(typeof I=="function"){let Z;const ne=O(I,D,ee=>{if(ee!=null)throw new b("nully","body",ee)},ee=>{T(Z,ee)});return Z=new J({objectMode:!0,readable:!1,write:se,final(ee){j(async()=>{try{await ne,n.nextTick(ee,null)}catch(_e){n.nextTick(ee,_e)}})},destroy:ae})}throw new b("Iterable, AsyncIterable or AsyncFunction",$,D)}if(P(F))return X(F.arrayBuffer());if(o(F))return y(J,F,{objectMode:!0,writable:!1});if(d(F?.readable)&&g(F?.writable))return J.fromWeb(F);if(typeof F?.writable=="object"||typeof F?.readable=="object"){const D=F!=null&&F.readable?l(F?.readable)?F?.readable:X(F.readable):void 0,se=F!=null&&F.writable?u(F?.writable)?F?.writable:X(F.writable):void 0;return q({readable:D,writable:se})}const ue=F?.then;if(typeof ue=="function"){let D;return O(ue,F,se=>{se!=null&&D.push(se),D.push(null)},se=>{T(D,se)}),D=new J({objectMode:!0,writable:!1,read(){}})}throw new m($,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],F)};function k(X){let{promise:F,resolve:$}=S();const ue=new B,D=ue.signal;return{value:X((async function*(){for(;;){const j=F;F=null;const{chunk:ae,done:I,cb:Z}=await j;if(n.nextTick(Z),I)return;if(D.aborted)throw new h(void 0,{cause:D.reason});({promise:F,resolve:$}=S()),yield ae}})(),{signal:D}),write(j,ae,I){const Z=$;$=null,Z({chunk:j,done:!1,cb:I})},final(j){const ae=$;$=null,ae({done:!0,cb:j})},destroy(j,ae){ue.abort(),ae(j)}}}function q(X){const F=X.readable&&typeof X.readable.read!="function"?N.wrap(X.readable):X.readable,$=X.writable;let ue=!!i(F),D=!!r($),se,j,ae,I,Z;function ne(ee){const _e=I;I=null,_e?_e(ee):ee&&Z.destroy(ee)}return Z=new J({readableObjectMode:!!(F!=null&&F.readableObjectMode),writableObjectMode:!!($!=null&&$.writableObjectMode),readable:ue,writable:D}),D&&(_($,ee=>{D=!1,ee&&T(F,ee),ne(ee)}),Z._write=function(ee,_e,G){$.write(ee,_e)?G():se=G},Z._final=function(ee){$.end(),j=ee},$.on("drain",function(){if(se){const ee=se;se=null,ee()}}),$.on("finish",function(){if(j){const ee=j;j=null,ee()}})),ue&&(_(F,ee=>{ue=!1,ee&&T(F,ee),ne(ee)}),F.on("readable",function(){if(ae){const ee=ae;ae=null,ee()}}),F.on("end",function(){Z.push(null)}),Z._read=function(){for(;;){const ee=F.read();if(ee===null){ae=Z._read;return}if(!Z.push(ee))return}}),Z._destroy=function(ee,_e){!ee&&I!==null&&(ee=new h),ae=null,se=null,j=null,I===null?_e(ee):(I=_e,T($,ee),T(F,ee))},Z}return Wo}var Go,Tc;function Ei(){if(Tc)return Go;Tc=1;const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:i,ObjectSetPrototypeOf:r}=dt();Go=l;const o=Hs(),a=Al();r(l.prototype,o.prototype),r(l,o);{const g=i(a.prototype);for(let _=0;_<g.length;_++){const h=g[_];l.prototype[h]||(l.prototype[h]=a.prototype[h])}}function l(g){if(!(this instanceof l))return new l(g);o.call(this,g),a.call(this,g),g?(this.allowHalfOpen=g.allowHalfOpen!==!1,g.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),g.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(l.prototype,{writable:{__proto__:null,...e(a.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(a.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(a.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(a.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(a.prototype,"writableLength")},writableFinished:{__proto__:null,...e(a.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(a.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(a.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(a.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(g){this._readableState&&this._writableState&&(this._readableState.destroyed=g,this._writableState.destroyed=g)}}});let u;function f(){return u===void 0&&(u={}),u}l.fromWeb=function(g,_){return f().newStreamDuplexFromReadableWritablePair(g,_)},l.toWeb=function(g){return f().newReadableWritablePairFromDuplex(g)};let d;return l.from=function(g){return d||(d=Sg()),d(g,"body")},Go}var Zo,Lc;function nf(){if(Lc)return Zo;Lc=1;const{ObjectSetPrototypeOf:n,Symbol:e}=dt();Zo=l;const{ERR_METHOD_NOT_IMPLEMENTED:i}=Ct().codes,r=Ei(),{getHighWaterMark:o}=Us();n(l.prototype,r.prototype),n(l,r);const a=e("kCallback");function l(d){if(!(this instanceof l))return new l(d);const g=d?o(this,d,"readableHighWaterMark",!0):null;g===0&&(d={...d,highWaterMark:null,readableHighWaterMark:g,writableHighWaterMark:d.writableHighWaterMark||0}),r.call(this,d),this._readableState.sync=!1,this[a]=null,d&&(typeof d.transform=="function"&&(this._transform=d.transform),typeof d.flush=="function"&&(this._flush=d.flush)),this.on("prefinish",f)}function u(d){typeof this._flush=="function"&&!this.destroyed?this._flush((g,_)=>{if(g){d?d(g):this.destroy(g);return}_!=null&&this.push(_),this.push(null),d&&d()}):(this.push(null),d&&d())}function f(){this._final!==u&&u.call(this)}return l.prototype._final=u,l.prototype._transform=function(d,g,_){throw new i("_transform()")},l.prototype._write=function(d,g,_){const h=this._readableState,m=this._writableState,b=h.length;this._transform(d,g,(T,A)=>{if(T){_(T);return}A!=null&&this.push(A),m.ended||b===h.length||h.length<h.highWaterMark?_():this[a]=_})},l.prototype._read=function(){if(this[a]){const d=this[a];this[a]=null,d()}},Zo}var Xo,Ic;function rf(){if(Ic)return Xo;Ic=1;const{ObjectSetPrototypeOf:n}=dt();Xo=i;const e=nf();n(i.prototype,e.prototype),n(i,e);function i(r){if(!(this instanceof i))return new i(r);e.call(this,r)}return i.prototype._transform=function(r,o,a){a(null,r)},Xo}var Jo,Ac;function Nl(){if(Ac)return Jo;Ac=1;const n=yn(),{ArrayIsArray:e,Promise:i,SymbolAsyncIterator:r,SymbolDispose:o}=dt(),a=Ui(),{once:l}=Mt(),u=Un(),f=Ei(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:_,ERR_MISSING_ARGS:h,ERR_STREAM_DESTROYED:m,ERR_STREAM_PREMATURE_CLOSE:b},AbortError:T}=Ct(),{validateFunction:A,validateAbortSignal:N}=Ur(),{isIterable:R,isReadable:S,isReadableNodeStream:y,isNodeStream:x,isTransformStream:P,isWebStream:B,isReadableStream:O,isReadableFinished:J}=Li(),k=globalThis.AbortController||jr().AbortController;let q,X,F;function $(ee,_e,G){let W=!1;ee.on("close",()=>{W=!0});const Y=a(ee,{readable:_e,writable:G},K=>{W=!K});return{destroy:K=>{W||(W=!0,u.destroyer(ee,K||new m("pipe")))},cleanup:Y}}function ue(ee){return A(ee[ee.length-1],"streams[stream.length - 1]"),ee.pop()}function D(ee){if(R(ee))return ee;if(y(ee))return se(ee);throw new g("val",["Readable","Iterable","AsyncIterable"],ee)}async function*se(ee){X||(X=Hs()),yield*X.prototype[r].call(ee)}async function j(ee,_e,G,{end:W}){let Y,K=null;const oe=Te=>{if(Te&&(Y=Te),K){const z=K;K=null,z()}},ce=()=>new i((Te,z)=>{Y?z(Y):K=()=>{Y?z(Y):Te()}});_e.on("drain",oe);const Ee=a(_e,{readable:!1},oe);try{_e.writableNeedDrain&&await ce();for await(const Te of ee)_e.write(Te)||await ce();W&&(_e.end(),await ce()),G()}catch(Te){G(Y!==Te?d(Y,Te):Te)}finally{Ee(),_e.off("drain",oe)}}async function ae(ee,_e,G,{end:W}){P(_e)&&(_e=_e.writable);const Y=_e.getWriter();try{for await(const K of ee)await Y.ready,Y.write(K).catch(()=>{});await Y.ready,W&&await Y.close(),G()}catch(K){try{await Y.abort(K),G(K)}catch(oe){G(oe)}}}function I(...ee){return Z(ee,l(ue(ee)))}function Z(ee,_e,G){if(ee.length===1&&e(ee[0])&&(ee=ee[0]),ee.length<2)throw new h("streams");const W=new k,Y=W.signal,K=G?.signal,oe=[];N(K,"options.signal");function ce(){Se(new T)}F=F||Mt().addAbortListener;let Ee;K&&(Ee=F(K,ce));let Te,z;const te=[];let fe=0;function we(xe){Se(xe,--fe===0)}function Se(xe,ke){var lt;if(xe&&(!Te||Te.code==="ERR_STREAM_PREMATURE_CLOSE")&&(Te=xe),!(!Te&&!ke)){for(;te.length;)te.shift()(Te);(lt=Ee)===null||lt===void 0||lt[o](),W.abort(),ke&&(Te||oe.forEach(We=>We()),n.nextTick(_e,Te,z))}}let Ie;for(let xe=0;xe<ee.length;xe++){const ke=ee[xe],lt=xe<ee.length-1,We=xe>0,nt=lt||G?.end!==!1,M=xe===ee.length-1;if(x(ke)){let v=function(w){w&&w.name!=="AbortError"&&w.code!=="ERR_STREAM_PREMATURE_CLOSE"&&we(w)};var Ne=v;if(nt){const{destroy:w,cleanup:H}=$(ke,lt,We);te.push(w),S(ke)&&M&&oe.push(H)}ke.on("error",v),S(ke)&&M&&oe.push(()=>{ke.removeListener("error",v)})}if(xe===0)if(typeof ke=="function"){if(Ie=ke({signal:Y}),!R(Ie))throw new _("Iterable, AsyncIterable or Stream","source",Ie)}else R(ke)||y(ke)||P(ke)?Ie=ke:Ie=f.from(ke);else if(typeof ke=="function"){if(P(Ie)){var re;Ie=D((re=Ie)===null||re===void 0?void 0:re.readable)}else Ie=D(Ie);if(Ie=ke(Ie,{signal:Y}),lt){if(!R(Ie,!0))throw new _("AsyncIterable",`transform[${xe-1}]`,Ie)}else{var ve;q||(q=rf());const v=new q({objectMode:!0}),w=(ve=Ie)===null||ve===void 0?void 0:ve.then;if(typeof w=="function")fe++,w.call(Ie,pe=>{z=pe,pe!=null&&v.write(pe),nt&&v.end(),n.nextTick(we)},pe=>{v.destroy(pe),n.nextTick(we,pe)});else if(R(Ie,!0))fe++,j(Ie,v,we,{end:nt});else if(O(Ie)||P(Ie)){const pe=Ie.readable||Ie;fe++,j(pe,v,we,{end:nt})}else throw new _("AsyncIterable or Promise","destination",Ie);Ie=v;const{destroy:H,cleanup:le}=$(Ie,!1,!0);te.push(H),M&&oe.push(le)}}else if(x(ke)){if(y(Ie)){fe+=2;const v=ne(Ie,ke,we,{end:nt});S(ke)&&M&&oe.push(v)}else if(P(Ie)||O(Ie)){const v=Ie.readable||Ie;fe++,j(v,ke,we,{end:nt})}else if(R(Ie))fe++,j(Ie,ke,we,{end:nt});else throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Ie);Ie=ke}else if(B(ke)){if(y(Ie))fe++,ae(D(Ie),ke,we,{end:nt});else if(O(Ie)||R(Ie))fe++,ae(Ie,ke,we,{end:nt});else if(P(Ie))fe++,ae(Ie.readable,ke,we,{end:nt});else throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],Ie);Ie=ke}else Ie=f.from(ke)}return(Y!=null&&Y.aborted||K!=null&&K.aborted)&&n.nextTick(ce),Ie}function ne(ee,_e,G,{end:W}){let Y=!1;if(_e.on("close",()=>{Y||G(new b)}),ee.pipe(_e,{end:!1}),W){let oe=function(){Y=!0,_e.end()};var K=oe;J(ee)?n.nextTick(oe):ee.once("end",oe)}else G();return a(ee,{readable:!0,writable:!1},oe=>{const ce=ee._readableState;oe&&oe.code==="ERR_STREAM_PREMATURE_CLOSE"&&ce&&ce.ended&&!ce.errored&&!ce.errorEmitted?ee.once("end",G).once("error",G):G(oe)}),a(_e,{readable:!1,writable:!0},G)}return Jo={pipelineImpl:Z,pipeline:I},Jo}var Qo,Nc;function sf(){if(Nc)return Qo;Nc=1;const{pipeline:n}=Nl(),e=Ei(),{destroyer:i}=Un(),{isNodeStream:r,isReadable:o,isWritable:a,isWebStream:l,isTransformStream:u,isWritableStream:f,isReadableStream:d}=Li(),{AbortError:g,codes:{ERR_INVALID_ARG_VALUE:_,ERR_MISSING_ARGS:h}}=Ct(),m=Ui();return Qo=function(...T){if(T.length===0)throw new h("streams");if(T.length===1)return e.from(T[0]);const A=[...T];if(typeof T[0]=="function"&&(T[0]=e.from(T[0])),typeof T[T.length-1]=="function"){const q=T.length-1;T[q]=e.from(T[q])}for(let q=0;q<T.length;++q)if(!(!r(T[q])&&!l(T[q]))){if(q<T.length-1&&!(o(T[q])||d(T[q])||u(T[q])))throw new _(`streams[${q}]`,A[q],"must be readable");if(q>0&&!(a(T[q])||f(T[q])||u(T[q])))throw new _(`streams[${q}]`,A[q],"must be writable")}let N,R,S,y,x;function P(q){const X=y;y=null,X?X(q):q?x.destroy(q):!k&&!J&&x.destroy()}const B=T[0],O=n(T,P),J=!!(a(B)||f(B)||u(B)),k=!!(o(O)||d(O)||u(O));if(x=new e({writableObjectMode:!!(B!=null&&B.writableObjectMode),readableObjectMode:!!(O!=null&&O.readableObjectMode),writable:J,readable:k}),J){if(r(B))x._write=function(X,F,$){B.write(X,F)?$():N=$},x._final=function(X){B.end(),R=X},B.on("drain",function(){if(N){const X=N;N=null,X()}});else if(l(B)){const F=(u(B)?B.writable:B).getWriter();x._write=async function($,ue,D){try{await F.ready,F.write($).catch(()=>{}),D()}catch(se){D(se)}},x._final=async function($){try{await F.ready,F.close().catch(()=>{}),R=$}catch(ue){$(ue)}}}const q=u(O)?O.readable:O;m(q,()=>{if(R){const X=R;R=null,X()}})}if(k){if(r(O))O.on("readable",function(){if(S){const q=S;S=null,q()}}),O.on("end",function(){x.push(null)}),x._read=function(){for(;;){const q=O.read();if(q===null){S=x._read;return}if(!x.push(q))return}};else if(l(O)){const X=(u(O)?O.readable:O).getReader();x._read=async function(){for(;;)try{const{value:F,done:$}=await X.read();if(!x.push(F))return;if($){x.push(null);return}}catch{return}}}}return x._destroy=function(q,X){!q&&y!==null&&(q=new g),S=null,N=null,R=null,y===null?X(q):(y=X,r(O)&&i(O,q))},x},Qo}var Rc;function Tg(){if(Rc)return ms;Rc=1;const n=globalThis.AbortController||jr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:r,ERR_OUT_OF_RANGE:o},AbortError:a}=Ct(),{validateAbortSignal:l,validateInteger:u,validateObject:f}=Ur(),d=dt().Symbol("kWeak"),g=dt().Symbol("kResistStopPropagation"),{finished:_}=Ui(),h=sf(),{addAbortSignalNoValidate:m}=zs(),{isWritable:b,isNodeStream:T}=Li(),{deprecate:A}=Mt(),{ArrayPrototypePush:N,Boolean:R,MathFloor:S,Number:y,NumberIsNaN:x,Promise:P,PromiseReject:B,PromiseResolve:O,PromisePrototypeThen:J,Symbol:k}=dt(),q=k("kEmpty"),X=k("kEof");function F(K,oe){if(oe!=null&&f(oe,"options"),oe?.signal!=null&&l(oe.signal,"options.signal"),T(K)&&!b(K))throw new e("stream",K,"must be writable");const ce=h(this,K);return oe!=null&&oe.signal&&m(oe.signal,ce),ce}function $(K,oe){if(typeof K!="function")throw new i("fn",["Function","AsyncFunction"],K);oe!=null&&f(oe,"options"),oe?.signal!=null&&l(oe.signal,"options.signal");let ce=1;oe?.concurrency!=null&&(ce=S(oe.concurrency));let Ee=ce-1;return oe?.highWaterMark!=null&&(Ee=S(oe.highWaterMark)),u(ce,"options.concurrency",1),u(Ee,"options.highWaterMark",0),Ee+=ce,(async function*(){const z=Mt().AbortSignalAny([oe?.signal].filter(R)),te=this,fe=[],we={signal:z};let Se,Ie,re=!1,ve=0;function Ne(){re=!0,xe()}function xe(){ve-=1,ke()}function ke(){Ie&&!re&&ve<ce&&fe.length<Ee&&(Ie(),Ie=null)}async function lt(){try{for await(let We of te){if(re)return;if(z.aborted)throw new a;try{if(We=K(We,we),We===q)continue;We=O(We)}catch(nt){We=B(nt)}ve+=1,J(We,xe,Ne),fe.push(We),Se&&(Se(),Se=null),!re&&(fe.length>=Ee||ve>=ce)&&await new P(nt=>{Ie=nt})}fe.push(X)}catch(We){const nt=B(We);J(nt,xe,Ne),fe.push(nt)}finally{re=!0,Se&&(Se(),Se=null)}}lt();try{for(;;){for(;fe.length>0;){const We=await fe[0];if(We===X)return;if(z.aborted)throw new a;We!==q&&(yield We),fe.shift(),ke()}await new P(We=>{Se=We})}}finally{re=!0,Ie&&(Ie(),Ie=null)}}).call(this)}function ue(K=void 0){return K!=null&&f(K,"options"),K?.signal!=null&&l(K.signal,"options.signal"),(async function*(){let ce=0;for await(const Te of this){var Ee;if(K!=null&&(Ee=K.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new a({cause:K.signal.reason});yield[ce++,Te]}}).call(this)}async function D(K,oe=void 0){for await(const ce of I.call(this,K,oe))return!0;return!1}async function se(K,oe=void 0){if(typeof K!="function")throw new i("fn",["Function","AsyncFunction"],K);return!await D.call(this,async(...ce)=>!await K(...ce),oe)}async function j(K,oe){for await(const ce of I.call(this,K,oe))return ce}async function ae(K,oe){if(typeof K!="function")throw new i("fn",["Function","AsyncFunction"],K);async function ce(Ee,Te){return await K(Ee,Te),q}for await(const Ee of $.call(this,ce,oe));}function I(K,oe){if(typeof K!="function")throw new i("fn",["Function","AsyncFunction"],K);async function ce(Ee,Te){return await K(Ee,Te)?Ee:q}return $.call(this,ce,oe)}class Z extends r{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function ne(K,oe,ce){var Ee;if(typeof K!="function")throw new i("reducer",["Function","AsyncFunction"],K);ce!=null&&f(ce,"options"),ce?.signal!=null&&l(ce.signal,"options.signal");let Te=arguments.length>1;if(ce!=null&&(Ee=ce.signal)!==null&&Ee!==void 0&&Ee.aborted){const Se=new a(void 0,{cause:ce.signal.reason});throw this.once("error",()=>{}),await _(this.destroy(Se)),Se}const z=new n,te=z.signal;if(ce!=null&&ce.signal){const Se={once:!0,[d]:this,[g]:!0};ce.signal.addEventListener("abort",()=>z.abort(),Se)}let fe=!1;try{for await(const Se of this){var we;if(fe=!0,ce!=null&&(we=ce.signal)!==null&&we!==void 0&&we.aborted)throw new a;Te?oe=await K(oe,Se,{signal:te}):(oe=Se,Te=!0)}if(!fe&&!Te)throw new Z}finally{z.abort()}return oe}async function ee(K){K!=null&&f(K,"options"),K?.signal!=null&&l(K.signal,"options.signal");const oe=[];for await(const Ee of this){var ce;if(K!=null&&(ce=K.signal)!==null&&ce!==void 0&&ce.aborted)throw new a(void 0,{cause:K.signal.reason});N(oe,Ee)}return oe}function _e(K,oe){const ce=$.call(this,K,oe);return(async function*(){for await(const Te of ce)yield*Te}).call(this)}function G(K){if(K=y(K),x(K))return 0;if(K<0)throw new o("number",">= 0",K);return K}function W(K,oe=void 0){return oe!=null&&f(oe,"options"),oe?.signal!=null&&l(oe.signal,"options.signal"),K=G(K),(async function*(){var Ee;if(oe!=null&&(Ee=oe.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new a;for await(const z of this){var Te;if(oe!=null&&(Te=oe.signal)!==null&&Te!==void 0&&Te.aborted)throw new a;K--<=0&&(yield z)}}).call(this)}function Y(K,oe=void 0){return oe!=null&&f(oe,"options"),oe?.signal!=null&&l(oe.signal,"options.signal"),K=G(K),(async function*(){var Ee;if(oe!=null&&(Ee=oe.signal)!==null&&Ee!==void 0&&Ee.aborted)throw new a;for await(const z of this){var Te;if(oe!=null&&(Te=oe.signal)!==null&&Te!==void 0&&Te.aborted)throw new a;if(K-- >0&&(yield z),K<=0)return}}).call(this)}return ms.streamReturningOperators={asIndexedPairs:A(ue,"readable.asIndexedPairs will be removed in a future version."),drop:W,filter:I,flatMap:_e,map:$,take:Y,compose:F},ms.promiseReturningOperators={every:se,forEach:ae,reduce:ne,toArray:ee,some:D,find:j},ms}var Ko,Pc;function of(){if(Pc)return Ko;Pc=1;const{ArrayPrototypePop:n,Promise:e}=dt(),{isIterable:i,isNodeStream:r,isWebStream:o}=Li(),{pipelineImpl:a}=Nl(),{finished:l}=Ui();af();function u(...f){return new e((d,g)=>{let _,h;const m=f[f.length-1];if(m&&typeof m=="object"&&!r(m)&&!i(m)&&!o(m)){const b=n(f);_=b.signal,h=b.end}a(f,(b,T)=>{b?g(b):d(T)},{signal:_,end:h})})}return Ko={finished:l,pipeline:u},Ko}var Cc;function af(){if(Cc)return No.exports;Cc=1;const{Buffer:n}=Ti(),{ObjectDefineProperty:e,ObjectKeys:i,ReflectApply:r}=dt(),{promisify:{custom:o}}=Mt(),{streamReturningOperators:a,promiseReturningOperators:l}=Tg(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=Ct(),f=sf(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:g}=Us(),{pipeline:_}=Nl(),{destroyer:h}=Un(),m=Ui(),b=of(),T=Li(),A=No.exports=Il().Stream;A.isDestroyed=T.isDestroyed,A.isDisturbed=T.isDisturbed,A.isErrored=T.isErrored,A.isReadable=T.isReadable,A.isWritable=T.isWritable,A.Readable=Hs();for(const S of i(a)){let x=function(...P){if(new.target)throw u();return A.Readable.from(r(y,this,P))};var R=x;const y=a[S];e(x,"name",{__proto__:null,value:y.name}),e(x,"length",{__proto__:null,value:y.length}),e(A.Readable.prototype,S,{__proto__:null,value:x,enumerable:!1,configurable:!0,writable:!0})}for(const S of i(l)){let x=function(...B){if(new.target)throw u();return r(y,this,B)};var R=x;const y=l[S];e(x,"name",{__proto__:null,value:y.name}),e(x,"length",{__proto__:null,value:y.length}),e(A.Readable.prototype,S,{__proto__:null,value:x,enumerable:!1,configurable:!0,writable:!0})}A.Writable=Al(),A.Duplex=Ei(),A.Transform=nf(),A.PassThrough=rf(),A.pipeline=_;const{addAbortSignal:N}=zs();return A.addAbortSignal=N,A.finished=m,A.destroy=h,A.compose=f,A.setDefaultHighWaterMark=d,A.getDefaultHighWaterMark=g,e(A,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return b}}),e(_,o,{__proto__:null,enumerable:!0,get(){return b.pipeline}}),e(m,o,{__proto__:null,enumerable:!0,get(){return b.finished}}),A.Stream=A,A._isUint8Array=function(y){return y instanceof Uint8Array},A._uint8ArrayToBuffer=function(y){return n.from(y.buffer,y.byteOffset,y.byteLength)},No.exports}var Dc;function lf(){return Dc||(Dc=1,(function(n){const e=af(),i=of(),r=e.Readable.destroy;n.exports=e.Readable,n.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,n.exports._isUint8Array=e._isUint8Array,n.exports.isDisturbed=e.isDisturbed,n.exports.isErrored=e.isErrored,n.exports.isReadable=e.isReadable,n.exports.Readable=e.Readable,n.exports.Writable=e.Writable,n.exports.Duplex=e.Duplex,n.exports.Transform=e.Transform,n.exports.PassThrough=e.PassThrough,n.exports.addAbortSignal=e.addAbortSignal,n.exports.finished=e.finished,n.exports.destroy=e.destroy,n.exports.destroy=r,n.exports.pipeline=e.pipeline,n.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return i}}),n.exports.Stream=e.Stream,n.exports.default=n.exports})(Ao)),Ao.exports}var Rl=lf();const Yo=Symbol("iter");function Cr(n,e,i=4){if(i===0)return Object.assign(n,e);for(const r in e)n[r]=Cr(n[r]||Object.create(null),e[r],i-1);return n}function uf(n,e,i=4){let r=!1;for(const o in n)if(o in e){const a=i===0?null:uf(n[o],e[o],i-1);if(a!==!1)r=r||Object.create(null),r[o]=a;else if(i===3)return!1}return r}function cf(n,e,i=4){let r=!1;for(const o in n)if(!(o in e))r=r||Object.create(null),r[o]=i===0?null:Cr({},n[o],i-1);else if(i!==0){const a=cf(n[o],e[o],i-1);if(a!==!1)r=r||Object.create(null),r[o]=a;else if(i===3)return!1}return r}class Lg{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||ze}_termFromId(e){if(e[0]==="."){const i=this._entities,r=e.split(".");return this._factory.quad(this._termFromId(i[r[1]]),this._termFromId(i[r[2]]),this._termFromId(i[r[3]]),r[4]&&this._termFromId(i[r[4]]))}return Ir(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const i=this._termToNumericId(e.subject),r=this._termToNumericId(e.predicate),o=this._termToNumericId(e.object);let a;return i&&r&&o&&(pl(e.graph)||(a=this._termToNumericId(e.graph)))&&this._ids[a?`.${i}.${r}.${o}.${a}`:`.${i}.${r}.${o}`]}return this._ids[Dn(e)]}_termToNewNumericId(e){const i=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${pl(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:Dn(e);return this._ids[i]||(this._ids[this._entities[++this._id]=i]=this._id)}createBlankNode(e){let i,r;if(e)for(i=e=`_:${e}`,r=1;this._ids[i];)i=e+r++;else do i=`_:b${this._blankNodeIndex++}`;while(this._ids[i]);return this._ids[i]=++this._id,this._entities[this._id]=i,this._factory.blankNode(i.substr(2))}}class Lt{constructor(e,i){this._size=0,this._graphs=Object.create(null),!i&&e&&!e[0]&&typeof e.match!="function"&&(i=e,e=null),i=i||{},this._factory=i.factory||ze,this._entityIndex=i.entityIndex||new Lg({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;const i=this._graphs;let r,o;for(const a in i)for(const l in r=i[a].subjects)for(const u in o=r[l])e+=Object.keys(o[u]).length;return this._size=e}_addToIndex(e,i,r,o){const a=e[i]||(e[i]={}),l=a[r]||(a[r]={}),u=o in l;return u||(l[o]=null),!u}_removeFromIndex(e,i,r,o){const a=e[i],l=a[r];delete l[o];for(const u in l)return;delete a[r];for(const u in a)return;delete e[i]}*_findInIndex(e,i,r,o,a,l,u,f){let d,g,_;const h=this._entities,m=this._termFromId(h[f]),b={subject:null,predicate:null,object:null};i&&((d=e,e={})[i]=d[i]);for(const T in e)if(g=e[T]){b[a]=this._termFromId(h[T]),r&&((d=g,g={})[r]=d[r]);for(const A in g)if(_=g[A]){b[l]=this._termFromId(h[A]);const N=o?o in _?[o]:[]:Object.keys(_);for(let R=0;R<N.length;R++)b[u]=this._termFromId(h[N[R]]),yield this._factory.quad(b.subject,b.predicate,b.object,m)}}}_loop(e,i){for(const r in e)i(r)}_loopByKey0(e,i,r){let o,a;if(o=e[i])for(a in o)r(a)}_loopByKey1(e,i,r){let o,a;for(o in e)a=e[o],a[i]&&r(o)}_loopBy2Keys(e,i,r,o){let a,l,u;if((a=e[i])&&(l=a[r]))for(u in l)o(u)}_countInIndex(e,i,r,o){let a=0,l,u,f;i&&((l=e,e={})[i]=l[i]);for(const d in e)if(u=e[d]){r&&((l=u,u={})[r]=l[r]);for(const g in u)(f=u[g])&&(o?o in f&&a++:a+=Object.keys(f).length)}return a}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const i=Object.create(null);return r=>{r in i||(i[r]=!0,e(this._termFromId(this._entities[r],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,i,r,o){i||(o=e.graph,r=e.object,i=e.predicate,e=e.subject),o=o?this._termToNewNumericId(o):1;let a=this._graphs[o];return a||(a=this._graphs[o]={subjects:{},predicates:{},objects:{}},Object.freeze(a)),e=this._termToNewNumericId(e),i=this._termToNewNumericId(i),r=this._termToNewNumericId(r),this._addToIndex(a.subjects,e,i,r)?(this._addToIndex(a.predicates,i,r,e),this._addToIndex(a.objects,r,e,i),this._size=null,!0):!1}addQuads(e){for(let i=0;i<e.length;i++)this.addQuad(e[i])}delete(e){return this.removeQuad(e),this}has(e,i,r,o){return e&&e.subject&&({subject:e,predicate:i,object:r,graph:o}=e),!this.readQuads(e,i,r,o).next().done}import(e){return e.on("data",i=>{this.addQuad(i)}),e}removeQuad(e,i,r,o){i||({subject:e,predicate:i,object:r,graph:o}=e),o=o?this._termToNumericId(o):1;const a=this._graphs;let l,u,f;if(!(e=e&&this._termToNumericId(e))||!(i=i&&this._termToNumericId(i))||!(r=r&&this._termToNumericId(r))||!(l=a[o])||!(u=l.subjects[e])||!(f=u[i])||!(r in f))return!1;this._removeFromIndex(l.subjects,e,i,r),this._removeFromIndex(l.predicates,i,r,e),this._removeFromIndex(l.objects,r,e,i),this._size!==null&&this._size--;for(e in l.subjects)return!0;return delete a[o],!0}removeQuads(e){for(let i=0;i<e.length;i++)this.removeQuad(e[i])}remove(e){return e.on("data",i=>{this.removeQuad(i)}),e}removeMatches(e,i,r,o){const a=new Rl.Readable({objectMode:!0}),l=this.readQuads(e,i,r,o);return a._read=u=>{for(;--u>=0;){const{done:f,value:d}=l.next();if(f){a.push(null);return}a.push(d)}},this.remove(a)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,i,r,o){return[...this.readQuads(e,i,r,o)]}*readQuads(e,i,r,o){const a=this._getGraphs(o);let l,u,f,d;if(!(e&&!(u=this._termToNumericId(e))||i&&!(f=this._termToNumericId(i))||r&&!(d=this._termToNumericId(r))))for(const g in a)(l=a[g])&&(u?d?yield*this._findInIndex(l.objects,d,u,f,"object","subject","predicate",g):yield*this._findInIndex(l.subjects,u,f,null,"subject","predicate","object",g):f?yield*this._findInIndex(l.predicates,f,d,null,"predicate","object","subject",g):d?yield*this._findInIndex(l.objects,d,null,null,"object","subject","predicate",g):yield*this._findInIndex(l.subjects,null,null,null,"subject","predicate","object",g))}match(e,i,r,o){return new Fi(this,e,i,r,o,{entityIndex:this._entityIndex})}countQuads(e,i,r,o){const a=this._getGraphs(o);let l=0,u,f,d,g;if(e&&!(f=this._termToNumericId(e))||i&&!(d=this._termToNumericId(i))||r&&!(g=this._termToNumericId(r)))return 0;for(const _ in a)(u=a[_])&&(e?r?l+=this._countInIndex(u.objects,g,f,d):l+=this._countInIndex(u.subjects,f,d,g):i?l+=this._countInIndex(u.predicates,d,g,f):l+=this._countInIndex(u.objects,g,f,d));return l}forEach(e,i,r,o,a){this.some(l=>(e(l,this),!1),i,r,o,a)}every(e,i,r,o,a){return!this.some(l=>!e(l,this),i,r,o,a)}some(e,i,r,o,a){for(const l of this.readQuads(i,r,o,a))if(e(l,this))return!0;return!1}getSubjects(e,i,r){const o=[];return this.forSubjects(a=>{o.push(a)},e,i,r),o}forSubjects(e,i,r,o){const a=this._getGraphs(o);let l,u,f;if(e=this._uniqueEntities(e),!(i&&!(u=this._termToNumericId(i))||r&&!(f=this._termToNumericId(r))))for(o in a)(l=a[o])&&(u?f?this._loopBy2Keys(l.predicates,u,f,e):this._loopByKey1(l.subjects,u,e):f?this._loopByKey0(l.objects,f,e):this._loop(l.subjects,e))}getPredicates(e,i,r){const o=[];return this.forPredicates(a=>{o.push(a)},e,i,r),o}forPredicates(e,i,r,o){const a=this._getGraphs(o);let l,u,f;if(e=this._uniqueEntities(e),!(i&&!(u=this._termToNumericId(i))||r&&!(f=this._termToNumericId(r))))for(o in a)(l=a[o])&&(u?f?this._loopBy2Keys(l.objects,f,u,e):this._loopByKey0(l.subjects,u,e):f?this._loopByKey1(l.predicates,f,e):this._loop(l.predicates,e))}getObjects(e,i,r){const o=[];return this.forObjects(a=>{o.push(a)},e,i,r),o}forObjects(e,i,r,o){const a=this._getGraphs(o);let l,u,f;if(e=this._uniqueEntities(e),!(i&&!(u=this._termToNumericId(i))||r&&!(f=this._termToNumericId(r))))for(o in a)(l=a[o])&&(u?f?this._loopBy2Keys(l.subjects,u,f,e):this._loopByKey1(l.objects,u,e):f?this._loopByKey0(l.predicates,f,e):this._loop(l.objects,e))}getGraphs(e,i,r){const o=[];return this.forGraphs(a=>{o.push(a)},e,i,r),o}forGraphs(e,i,r,o){for(const a in this._graphs)this.some(l=>(e(l.graph),!0),i,r,o,this._termFromId(this._entities[a]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:i=!1}={}){const r={},o=i?(()=>!0):((u,f)=>{throw new Error(`${u.value} ${f}`)}),a=this.getQuads(null,Tt.rdf.rest,Tt.rdf.nil,null),l=e?[...a]:[];return a.forEach(u=>{const f=[];let d=!1,g,_;const h=u.graph;let m=u.subject;for(;m&&!d;){const b=this.getQuads(null,null,m,null),T=this.getQuads(m,null,null,null);let A,N=null,R=null,S=null;for(let y=0;y<T.length&&!d;y++)A=T[y],A.graph.equals(h)?g?d=o(m,"has non-list arcs out"):A.predicate.value===Tt.rdf.first?N?d=o(m,"has multiple rdf:first arcs"):l.push(N=A):A.predicate.value===Tt.rdf.rest?R?d=o(m,"has multiple rdf:rest arcs"):l.push(R=A):b.length?d=o(m,"can't be subject and object"):(g=A,_="subject"):d=o(m,"not confined to single graph");for(let y=0;y<b.length&&!d;++y)A=b[y],g?d=o(m,"can't have coreferences"):A.predicate.value===Tt.rdf.rest?S?d=o(m,"has incoming rdf:rest arcs"):S=A:(g=A,_="object");N?f.unshift(N.object):d=o(m,"has no list head"),m=S&&S.subject}d?e=!1:g&&(r[g[_].value]=f)}),e&&this.removeQuads(l),r}addAll(e){if(e instanceof Fi&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof Lt&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=Cr(this._graphs,e._graphs),this._size=null);else for(const i of e)this.add(i);return this}contains(e){if(e instanceof Fi&&(e=e.filtered),e===this)return!0;if(!(e instanceof Lt)||this._entityIndex!==e._entityIndex)return e.every(d=>this.has(d));const i=this._graphs,r=e._graphs;let o,a,l,u,f;for(const d in r){if(!(o=i[d]))return!1;o=o.subjects;for(const g in a=r[d].subjects){if(!(l=o[g]))return!1;for(const _ in u=a[g]){if(!(f=l[_]))return!1;for(const h in u[_])if(!(h in f))return!1}}}return!0}deleteMatches(e,i,r,o){for(const a of this.match(e,i,r,o))this.removeQuad(a);return this}difference(e){if(e&&e instanceof Fi&&(e=e.filtered),e===this)return new Lt({entityIndex:this._entityIndex});if(e instanceof Lt&&e._entityIndex===this._entityIndex){const i=new Lt({entityIndex:this._entityIndex}),r=cf(this._graphs,e._graphs);return r&&(i._graphs=r,i._size=null),i}return this.filter(i=>!e.has(i))}equals(e){return e instanceof Fi&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const i=new Lt({entityIndex:this._entityIndex});for(const r of this)e(r,this)&&i.add(r);return i}intersection(e){if(e instanceof Fi&&(e=e.filtered),e===this){const i=new Lt({entityIndex:this._entityIndex});return i._graphs=Cr(Object.create(null),this._graphs),i._size=this._size,i}else if(e instanceof Lt&&this._entityIndex===e._entityIndex){const i=new Lt({entityIndex:this._entityIndex}),r=uf(e._graphs,this._graphs);return r&&(i._graphs=r,i._size=null),i}return this.filter(i=>e.has(i))}map(e){const i=new Lt({entityIndex:this._entityIndex});for(const r of this)i.add(e(r,this));return i}reduce(e,i){const r=this.readQuads();let o=i===void 0?r.next().value:i;for(const a of r)o=e(o,a,this);return o}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new Ll().quadsToString(this)}union(e){const i=new Lt({entityIndex:this._entityIndex});return i._graphs=Cr(Object.create(null),this._graphs),i._size=this._size,i.addAll(e),i}*[Symbol.iterator](){yield*this.readQuads()}}function fi(n,e,i=0){const r=e[i];if(r&&!(r in n))return!1;let o=!1;for(const a in r?{[r]:n[r]}:n){const l=i===2?null:fi(n[a],e,i+1);l!==!1&&(o=o||Object.create(null),o[a]=l)}return o}class Fi extends Rl.Readable{constructor(e,i,r,o,a,l){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:i,predicate:r,object:o,graph:a,options:l})}get filtered(){if(!this._filtered){const{n3Store:e,graph:i,object:r,predicate:o,subject:a}=this,l=this._filtered=new Lt({factory:e._factory,entityIndex:this.options.entityIndex});let u,f,d;if(a&&!(u=l._termToNumericId(a))||o&&!(f=l._termToNumericId(o))||r&&!(d=l._termToNumericId(r)))return l;const g=e._getGraphs(i);for(const _ in g){let h,m,b,T;(T=g[_])&&(!u&&f?(m=fi(T.predicates,[f,d,u]))&&(h=fi(T.subjects,[u,f,d]),b=fi(T.objects,[d,u,f])):d?(b=fi(T.objects,[d,u,f]))&&(h=fi(T.subjects,[u,f,d]),m=fi(T.predicates,[f,d,u])):(h=fi(T.subjects,[u,f,d]))&&(m=fi(T.predicates,[f,d,u]),b=fi(T.objects,[d,u,f])),h&&(l._graphs[_]={subjects:h,predicates:m,objects:b}))}l._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[Yo]&&(this[Yo]=this[Symbol.iterator]());const i=this[Yo];for(;--e>=0;){const{done:r,value:o}=i.next();if(r){this.push(null);return}this.push(o)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,i,r,o){return this.filtered.deleteMatches(e,i,r,o)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,i,r,o,a){return this.filtered.every(e,i,r,o,a)}filter(e){return this.filtered.filter(e)}forEach(e,i,r,o,a){return this.filtered.forEach(e,i,r,o,a)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,i,r,o,a){return this.filtered.some(e,i,r,o,a)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,i){return this.filtered.reduce(e,i)}toString(){return new Ll().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,i,r,o){return new Fi(this.filtered,e,i,r,o,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}class Ig extends Rl.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;const i=new Kd(e);let r,o;const a={onQuad:(l,u)=>{l&&this.emit("error",l)||u&&this.push(u)},onPrefix:(l,u)=>{this.emit("prefix",l,u)}};e&&e.comments&&(a.onComment=l=>{this.emit("comment",l)}),i.parse({on:(l,u)=>{switch(l){case"data":r=u;break;case"end":o=u;break}}},a),this._transform=(l,u,f)=>{r(l),f()},this._flush=l=>{o(),l()}}import(e){return e.on("data",i=>{this.write(i)}),e.on("end",()=>{this.end()}),e.on("error",i=>{this.emit("error",i)}),this}}const je="http://www.w3.org/ns/shacl#",kc="http://datashapes.org/dash#",qi="http://www.w3.org/2001/XMLSchema#",ji="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Pl="http://www.w3.org/2000/01/rdf-schema#",Cl="http://www.w3.org/2004/02/skos/core#",Ag="http://www.w3.org/2002/07/owl#",Ng="http://www.w3.org/ns/oa#",Rg="http://purl.org/dc/terms/",Pg="http://xmlns.com/foaf/0.1/",Dr=ze.namedNode("loaded-shapes"),xi=ze.namedNode("loaded-data"),It=ze.namedNode(ji+"type"),gl=ze.namedNode(Rg+"conformsTo"),Mc=ze.namedNode(Pl+"subClassOf"),Dl=ze.namedNode(Ag+"imports"),Cg=ze.namedNode(Cl+"broader"),Dg=ze.namedNode(Cl+"narrower"),vs=ze.namedNode(je+"NodeShape"),kg=ze.namedNode(je+"IRI"),ks=ze.namedNode(je+"property"),kl=ze.namedNode(je+"class"),Mg=ze.namedNode(je+"node"),Mn=ze.namedNode(je+"targetClass"),Og=ze.namedNode(je+"nodeKind");ze.namedNode(qi+"string");function kr(n,e,i=je,r){let o="";const a=Fg(n,e,i,r);return a&&(o=a.value),o}function Fg(n,e,i=je,r){let o;const a=i+e;if(r?.length){for(const l of r)for(const u of n)if(u.predicate.value===a){if(u.object.id.endsWith(`@${l}`))return u.object;u.object.id.indexOf("@")<0?o=u.object:o||(o=u.object)}}else for(const l of n)if(l.predicate.value===a)return l.object;return o}function jg(n){n.querySelector(".editor")?.focus()}function Hr(n,e){return kr(n,"prefLabel",Cl,e)||kr(n,"label",Pl,e)||kr(n,"name",Pg,e)}function hf(n,e,i){const r=[];for(const o of n)r.push({value:o,label:Hr(e.getQuads(o,null,null,null),i),children:[]});return r}function ml(n,e){for(const i in e)n=n.replace(e[i],"");return n}function df(n,e,i,r,o=new Set){for(const a of e.owlImports)o.has(a.id)||(o.add(a.id),r.push(...i.getSubjects(It,n,a)));e.parent&&df(n,e.parent,i,r,o)}function Ml(n,e){if(e.shaclIn){const i=e.config.lists[e.shaclIn];return hf(i?.length?i:[],e.config.store,e.config.languages)}else{const i=e.config.store.getSubjects(It,n,Dr);i.push(...e.config.store.getSubjects(It,n,xi)),df(n,e,e.config.store,i);const r=new Map,o=new Map;for(const l of i)r.set(l.id,{value:l,label:Hr(e.config.store.getQuads(l,null,null,null),e.config.languages),children:[]});for(const l of i){for(const u of e.config.store.getObjects(l,Cg,null))r.has(u.id)&&o.set(l.id,u.id);for(const u of e.config.store.getObjects(l,Dg,null))r.has(u.id)&&o.set(u.id,l.id);for(const u of e.config.store.getObjects(l,Mc,null))r.has(u.id)&&o.set(l.id,u.id)}for(const[l,u]of o.entries())r.get(u)?.children?.push(r.get(l));const a=[];for(const[l,u]of r.entries())o.has(l)||a.push(u);for(const l of e.config.store.getSubjects(Mc,n,null))a.push(...Ml(l,e));return a}}function _l(n){let e;try{e=new URL(n)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function Oc(n,e,i){if(e===void 0)return i;if(i===void 0)return e;const r=n.indexOf(e.language);if(r<0)return i;const o=n.indexOf(i.language);return o<0||o>r?e:i}function $g(n,{remove:e=!1,ignoreErrors:i=!1}={}){const r={},o=i?(()=>!0):((u,f)=>{throw new Error(`${u.value} ${f}`)}),a=n.getQuads(null,ji+"rest",ji+"nil",null),l=e?[...a]:[];return a.forEach(u=>{const f=[];let d=!1,g,_;const h=u.graph;let m=u.subject;for(;m&&!d;){const b=n.getQuads(null,null,m,null),T=n.getQuads(m,null,null,null).filter(y=>!y.predicate.equals(It));let A,N=null,R=null,S=null;for(let y=0;y<T.length&&!d;y++)A=T[y],A.graph.equals(h)?g?d=o(m,"has non-list arcs out"):A.predicate.value===ji+"first"?N?d=o(m,"has multiple rdf:first arcs"):l.push(N=A):A.predicate.value===ji+"rest"?R?d=o(m,"has multiple rdf:rest arcs"):l.push(R=A):b.length?d=o(m,"can't be subject and object"):(g=A,_="subject"):d=o(m,"not confined to single graph");for(let y=0;y<b.length&&!d;++y)A=b[y],g?d=o(m,"can't have coreferences"):A.predicate.value===ji+"rest"?S?d=o(m,"has incoming rdf:rest arcs"):S=A:(g=A,_="object");N?f.unshift(N.object):d=o(m,"has no list head"),m=S&&S.subject}d?e=!1:g&&(r[g[_].value]=f)}),e&&n.removeQuads(l),r}function ff(n,e,i){const r=document.createElement("div");r.classList.add("shacl-or-constraint");const o=[];if(e instanceof zi){const a=[];let l=!1;n.length&&(l=i.store.countQuads(n[0],ks,null,null)>0);for(let d=0;d<n.length;d++)if(l){const g=i.store.getObjects(n[d],ks,null),_=[];let h="";for(const m of g){const b=new Fs(m,e,i);_.push(b),h+=(h.length>1?" / ":"")+b.template.label}a.push(_),o.push({label:h,value:d.toString()})}else{const g=new Fs(n[d],e,i);a.push([g]),o.push({label:g.template.label,value:d.toString()})}const u=i.theme.createListEditor("Please choose",null,!1,o),f=u.querySelector(".editor");f.onchange=()=>{if(f.value){const d=a[parseInt(f.value)];let g;d.length&&(g=d[0],r.replaceWith(d[0]));for(let _=1;_<d.length;_++)g.after(d[_]),g=d[_]}},r.appendChild(u)}else{const a=[];for(let f=0;f<n.length;f++){const d=i.store.getQuads(n[f],null,null,null);d.length&&(a.push(d),o.push({label:Hr(d,i.languages)||ml(d[0].predicate.value,i.prefixes)+" = "+ml(d[0].object.value,i.prefixes),value:f.toString()}))}const l=i.theme.createListEditor(e.template.label+"?",null,!1,o,e.template),u=l.querySelector(".editor");u.onchange=()=>{u.value&&r.replaceWith(Ns(e.template.clone().merge(a[parseInt(u.value)]),void 0,!0))},r.appendChild(l)}return r}function Bg(n,e,i){if(e instanceof ii){const r=e.datatype;for(const o of n){const a=i.store.getQuads(o,null,null,null);for(const l of a)if(l.predicate.value===`${je}datatype`&&l.object.equals(r))return a}}else{const r=i.store.getObjects(e,It,null);for(const o of n){const a=i.store.getQuads(o,null,null,null);for(const l of a)if(r.length>0){if(l.predicate.value===`${je}node`){for(const u of r)if(i.store.getQuads(l.object,Mn,u,null).length>0)return a}if(l.predicate.equals(kl)){for(const u of r)if(l.object.equals(u))return a}}else if(l.predicate.equals(Og)&&l.object.equals(kg))return a}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function qg(n,e,i){for(const r of n){let o=!1;const a=i.store.getObjects(r,ks,null);for(const l of a){const u=i.store.getObjects(l,`${je}path`,null);for(const f of u)if(o=i.store.countQuads(e,f,null,null)>0,o)break}if(o)return a}return console.error("couldn't resolve sh:or/sh:xone on node for value",e),[]}const zg={[`${je}name`]:(n,e)=>{const i=e;n.name=Oc(n.config.languages,n.name,i)},[`${je}description`]:(n,e)=>{const i=e;n.description=Oc(n.config.languages,n.description,i)},[`${je}path`]:(n,e)=>{n.path=e.value},[`${je}node`]:(n,e)=>{n.node=e},[`${je}datatype`]:(n,e)=>{n.datatype=e},[`${je}nodeKind`]:(n,e)=>{n.nodeKind=e},[`${je}minCount`]:(n,e)=>{n.minCount=parseInt(e.value)},[`${je}maxCount`]:(n,e)=>{n.maxCount=parseInt(e.value)},[`${je}minLength`]:(n,e)=>{n.minLength=parseInt(e.value)},[`${je}maxLength`]:(n,e)=>{n.maxLength=parseInt(e.value)},[`${je}minInclusive`]:(n,e)=>{n.minInclusive=parseInt(e.value)},[`${je}maxInclusive`]:(n,e)=>{n.maxInclusive=parseInt(e.value)},[`${je}minExclusive`]:(n,e)=>{n.minExclusive=parseInt(e.value)},[`${je}maxExclusive`]:(n,e)=>{n.maxExclusive=parseInt(e.value)},[`${je}pattern`]:(n,e)=>{n.pattern=e.value},[`${je}order`]:(n,e)=>{n.order=parseInt(e.value)},[`${kc}singleLine`]:(n,e)=>{n.singleLine=e.value==="true"},[`${kc}readonly`]:(n,e)=>{n.readonly=e.value==="true"},[`${Ng}styleClass`]:(n,e)=>{n.cssClass=e.value},[`${je}and`]:(n,e)=>{n.shaclAnd=e.value},[`${je}in`]:(n,e)=>{n.shaclIn=e.value},[`${je}languageIn`]:(n,e)=>{n.languageIn=n.config.lists[e.value],n.datatype=ze.namedNode(ji+"langString")},[`${je}defaultValue`]:(n,e)=>{n.defaultValue=e},[`${je}hasValue`]:(n,e)=>{n.hasValue=e},[`${je}qualifiedValueShape`]:(n,e)=>{n.qualifiedValueShape=e},[`${je}qualifiedMinCount`]:(n,e)=>{n.minCount=parseInt(e.value)},[`${je}qualifiedMaxCount`]:(n,e)=>{n.maxCount=parseInt(e.value)},[Dl.id]:(n,e)=>{n.owlImports.push(e)},[kl.id]:(n,e)=>{n.class=e;const i=n.config.store.getSubjects(Mn,e,null);i.length>0&&(n.node=i[0])},[`${je}or`]:(n,e)=>{const i=n.config.lists[e.value];i?.length?n.shaclOr=i:console.error("list for sh:or not found:",e.value,"existing lists:",n.config.lists)},[`${je}xone`]:(n,e)=>{const i=n.config.lists[e.value];i?.length?n.shaclXone=i:console.error("list for sh:xone not found:",e.value,"existing lists:",n.config.lists)}};class Ug{constructor(e,i,r){this.label="",this.owlImports=[],this.extendedShapes=[],this.parent=i,this.config=r,this.merge(e),this.qualifiedValueShape&&this.merge(r.store.getQuads(this.qualifiedValueShape,null,null,null))}merge(e){for(const i of e)zg[i.predicate.id]?.call(this,this,i.object);if(this.label=this.name?.value||Hr(e,this.config.languages),!this.label&&!this.shaclAnd&&(this.label=this.path?ml(this.path,this.config.prefixes):"unknown"),this.node&&this.extendedShapes.push(this.node),this.shaclAnd){const i=this.config.lists[this.shaclAnd];if(i?.length)for(const r of i)this.extendedShapes.push(r)}return this}clone(){const e=Object.assign({},this);return e.extendedShapes=[...this.extendedShapes],e.owlImports=[...this.owlImports],this.languageIn&&(e.languageIn=[...this.languageIn]),this.shaclOr&&(e.shaclOr=[...this.shaclOr]),this.shaclXone&&(e.shaclXone=[...this.shaclXone]),e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}const Hg=`form { display:block; --label-width: 8em; --caret-size: 10px; }
|
|
28
28
|
form.mode-edit { padding-left: 1em; }
|
|
29
29
|
form, form * { box-sizing: border-box; }
|
|
30
30
|
shacl-node, .collapsible::part(content) { display: flex; flex-direction: column; width: 100%; position: relative; }
|
|
@@ -72,26 +72,26 @@ a, a:visited { color: inherit; }
|
|
|
72
72
|
.collapsible > .property-instance > shacl-node > h1 { display: none; }
|
|
73
73
|
.ref-link { cursor: pointer; }
|
|
74
74
|
.ref-link:hover { text-decoration: underline; }
|
|
75
|
-
.node-id-display { color: #999; font-size: 11px; }`;class
|
|
76
|
-
`+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(
|
|
75
|
+
.node-id-display { color: #999; font-size: 11px; }`;class Vg{constructor(e){let i=Hg;e&&(i+=`
|
|
76
|
+
`+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(i)}apply(e){}createViewer(e,i,r){const o=document.createElement("div"),a=document.createElement("label");a.innerHTML=e+":",r.description&&a.setAttribute("title",r.description.value),o.appendChild(a);let l=i.value,u=null;if(i instanceof kn){const d=r.config.store.getQuads(l,null,null,null);if(d.length){const g=Hr(d,r.config.languages);g&&(l=g)}}else i instanceof ii&&(i.language?(u=document.createElement("span"),u.classList.add("lang"),u.innerText=`@${i.language}`):i.datatype.value===`${qi}date`?l=new Date(Date.parse(i.value)).toDateString():i.datatype.value===`${qi}dateTime`&&(l=new Date(Date.parse(i.value)).toLocaleString()));let f;return _l(i.value)?(f=document.createElement("a"),f.setAttribute("href",i.value)):f=document.createElement("div"),f.classList.add("d-flex"),f.innerText=l,u&&f.appendChild(u),o.appendChild(f),o}}function Wg(n,e,i){if(i){const r=n.minCount!==void 0&&n.minCount>0;if(n.class)return n.config.theme.createListEditor(n.label,e,r,Ml(n.class,n),n);if(n.shaclIn){const o=n.config.lists[n.shaclIn];if(o?.length){const a=hf(o,n.config.store,n.config.languages);return n.config.theme.createListEditor(n.label,e,r,a,n)}else console.error("list not found:",n.shaclIn,"existing lists:",n.config.lists)}if(n.datatype?.value===`${ji}langString`||n.languageIn?.length)return n.config.theme.createLangStringEditor(n.label,e,r,n);switch(n.datatype?.value.replace(qi,"")){case"integer":case"float":case"double":case"decimal":return n.config.theme.createNumberEditor(n.label,e,r,n);case"date":case"dateTime":return n.config.theme.createDateEditor(n.label,e,r,n);case"boolean":return n.config.theme.createBooleanEditor(n.label,e,r,n);case"base64Binary":return n.config.theme.createFileEditor(n.label,e,r,n)}return n.config.theme.createTextEditor(n.label,e,r,n)}else{if(e)return n.config.theme.createViewer(n.label,e,n);const r=document.createElement("div");return r.innerHTML="No value",r}}function Gg(n,e,i){if(e==="application/ld+json")return Zg(n);{const r=new Ll({format:e,prefixes:i});r.addQuads(n);let o="";return r.end((a,l)=>{a&&console.error(a),o=l}),o}}function Zg(n){const e=[];for(const i of n){const r={"@id":i.subject.id};if(i.predicate===It)r["@type"]=i.object.id;else{let o=i.object.value;i.object instanceof ii?i.object.language?o={"@language":i.object.language,"@value":i.object.value}:i.object.datatype&&i.object.datatype.value!==`${qi}#string`&&(o={"@type":i.object.datatype.value,"@value":i.object.value}):o={"@id":i.object.id},r[i.predicate.value]=o}e.push(r)}return JSON.stringify(e)}function Xg(n){let e=n.shaclDatatype,i=n.value;if(i){if(i.startsWith("<")&&i.endsWith(">")&&i.indexOf(":")>-1)return ze.namedNode(i.substring(1,i.length-1));if(n.dataset.class||n.dataset.nodeKind===je+"IRI")return ze.namedNode(i);if(n.dataset.link)return JSON.parse(n.dataset.link);if(n.dataset.lang?e=n.dataset.lang:n.type==="number"?i=parseFloat(i):n.type==="file"&&n.binaryData?i=n.binaryData:n.type==="datetime-local"&&(i=new Date(i).toISOString().slice(0,19)),!e&&typeof i=="string"){let r=i.split("^^");r.length===2&&r[0].startsWith('"')&&r[0].endsWith('"')&&r[1].split(":").length===2?(i=r[0].substring(1,r[0].length-1),e=ze.namedNode(r[1])):(r=i.split("@"),r.length===2&&r[0].startsWith('"')&&r[0].endsWith('"')&&(i=r[0].substring(1,r[0].length-1),e=r[1]))}return ze.literal(i,e)}else if((n.type==="checkbox"||n.getAttribute("type")==="checkbox")&&(n.checked||parseInt(n.dataset.minCount||"0")>0))return ze.literal(n.checked?"true":"false",e)}const Mr={};function Jg(n){n.predicate===void 0&&n.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',n):Mr[`${n.predicate}^${n.datatype}`]=n}function Qg(){return Object.entries(Mr).map(n=>n[1])}function Kg(n,e){let i=Mr[`${n}^${e}`];return i||(i=Mr[`${n}^undefined`],i)?i:Mr[`undefined^${e}`]}/**
|
|
77
77
|
* @license
|
|
78
78
|
* Copyright 2019 Google LLC
|
|
79
79
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
80
|
-
*/const
|
|
80
|
+
*/const Ss=globalThis,Ol=Ss.ShadowRoot&&(Ss.ShadyCSS===void 0||Ss.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fl=Symbol(),Fc=new WeakMap;let pf=class{constructor(e,i,r){if(this._$cssResult$=!0,r!==Fl)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=i}get styleSheet(){let e=this.o;const i=this.t;if(Ol&&e===void 0){const r=i!==void 0&&i.length===1;r&&(e=Fc.get(i)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&Fc.set(i,e))}return e}toString(){return this.cssText}};const Yg=n=>new pf(typeof n=="string"?n:n+"",void 0,Fl),ri=(n,...e)=>{const i=n.length===1?n[0]:e.reduce(((r,o,a)=>r+(l=>{if(l._$cssResult$===!0)return l.cssText;if(typeof l=="number")return l;throw Error("Value passed to 'css' function must be a 'css' function result: "+l+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(o)+n[a+1]),n[0]);return new pf(i,n,Fl)},em=(n,e)=>{if(Ol)n.adoptedStyleSheets=e.map((i=>i instanceof CSSStyleSheet?i:i.styleSheet));else for(const i of e){const r=document.createElement("style"),o=Ss.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=i.cssText,n.appendChild(r)}},jc=Ol?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let i="";for(const r of e.cssRules)i+=r.cssText;return Yg(i)})(n):n;/**
|
|
81
81
|
* @license
|
|
82
82
|
* Copyright 2017 Google LLC
|
|
83
83
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
84
|
-
*/const{is:
|
|
84
|
+
*/const{is:tm,defineProperty:im,getOwnPropertyDescriptor:nm,getOwnPropertyNames:rm,getOwnPropertySymbols:sm,getPrototypeOf:om}=Object,Vs=globalThis,$c=Vs.trustedTypes,am=$c?$c.emptyScript:"",lm=Vs.reactiveElementPolyfillSupport,Or=(n,e)=>n,yl={toAttribute(n,e){switch(e){case Boolean:n=n?am:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let i=n;switch(e){case Boolean:i=n!==null;break;case Number:i=n===null?null:Number(n);break;case Object:case Array:try{i=JSON.parse(n)}catch{i=null}}return i}},gf=(n,e)=>!tm(n,e),Bc={attribute:!0,type:String,converter:yl,reflect:!1,useDefault:!1,hasChanged:gf};Symbol.metadata??=Symbol("metadata"),Vs.litPropertyMetadata??=new WeakMap;let Nn=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,i=Bc){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(e,i),!i.noAccessor){const r=Symbol(),o=this.getPropertyDescriptor(e,r,i);o!==void 0&&im(this.prototype,e,o)}}static getPropertyDescriptor(e,i,r){const{get:o,set:a}=nm(this.prototype,e)??{get(){return this[i]},set(l){this[i]=l}};return{get:o,set(l){const u=o?.call(this);a?.call(this,l),this.requestUpdate(e,u,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Bc}static _$Ei(){if(this.hasOwnProperty(Or("elementProperties")))return;const e=om(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Or("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Or("properties"))){const i=this.properties,r=[...rm(i),...sm(i)];for(const o of r)this.createProperty(o,i[o])}const e=this[Symbol.metadata];if(e!==null){const i=litPropertyMetadata.get(e);if(i!==void 0)for(const[r,o]of i)this.elementProperties.set(r,o)}this._$Eh=new Map;for(const[i,r]of this.elementProperties){const o=this._$Eu(i,r);o!==void 0&&this._$Eh.set(o,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const i=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const o of r)i.unshift(jc(o))}else e!==void 0&&i.push(jc(e));return i}static _$Eu(e,i){const r=i.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,i=this.constructor.elementProperties;for(const r of i.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return em(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,i,r){this._$AK(e,r)}_$ET(e,i){const r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){const a=(r.converter?.toAttribute!==void 0?r.converter:yl).toAttribute(i,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,i){const r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const a=r.getPropertyOptions(o),l=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:yl;this._$Em=o;const u=l.fromAttribute(i,a.type);this[o]=u??this._$Ej?.get(o)??u,this._$Em=null}}requestUpdate(e,i,r){if(e!==void 0){const o=this.constructor,a=this[e];if(r??=o.getPropertyOptions(e),!((r.hasChanged??gf)(a,i)||r.useDefault&&r.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,r))))return;this.C(e,i,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,i,{useDefault:r,reflect:o,wrapped:a},l){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,l??i??this[e]),a!==!0||l!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(i=void 0),this._$AL.set(e,i)),o===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,a]of r){const{wrapped:l}=a,u=this[o];l!==!0||this._$AL.has(o)||u===void 0||this.C(o,void 0,a,u)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),this._$EO?.forEach((r=>r.hostUpdate?.())),this.update(i)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(i)}willUpdate(e){}_$AE(e){this._$EO?.forEach((i=>i.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((i=>this._$ET(i,this[i]))),this._$EM()}updated(e){}firstUpdated(e){}};Nn.elementStyles=[],Nn.shadowRootOptions={mode:"open"},Nn[Or("elementProperties")]=new Map,Nn[Or("finalized")]=new Map,lm?.({ReactiveElement:Nn}),(Vs.reactiveElementVersions??=[]).push("2.1.1");/**
|
|
85
85
|
* @license
|
|
86
86
|
* Copyright 2017 Google LLC
|
|
87
87
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
88
|
-
*/const
|
|
89
|
-
\f\r]`,
|
|
90
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
88
|
+
*/const jl=globalThis,Ms=jl.trustedTypes,qc=Ms?Ms.createPolicy("lit-html",{createHTML:n=>n}):void 0,mf="$lit$",$i=`lit$${Math.random().toFixed(9).slice(2)}$`,_f="?"+$i,um=`<${_f}>`,fn=document,$r=()=>fn.createComment(""),Br=n=>n===null||typeof n!="object"&&typeof n!="function",$l=Array.isArray,cm=n=>$l(n)||typeof n?.[Symbol.iterator]=="function",ea=`[
|
|
89
|
+
\f\r]`,hr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,zc=/-->/g,Uc=/>/g,en=RegExp(`>|${ea}(?:([^\\s"'>=/]+)(${ea}*=${ea}*(?:[^
|
|
90
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Hc=/'/g,Vc=/"/g,yf=/^(?:script|style|textarea|title)$/i,hm=n=>(e,...i)=>({_$litType$:n,strings:e,values:i}),jt=hm(1),On=Symbol.for("lit-noChange"),gt=Symbol.for("lit-nothing"),Wc=new WeakMap,hn=fn.createTreeWalker(fn,129);function vf(n,e){if(!$l(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return qc!==void 0?qc.createHTML(e):e}const dm=(n,e)=>{const i=n.length-1,r=[];let o,a=e===2?"<svg>":e===3?"<math>":"",l=hr;for(let u=0;u<i;u++){const f=n[u];let d,g,_=-1,h=0;for(;h<f.length&&(l.lastIndex=h,g=l.exec(f),g!==null);)h=l.lastIndex,l===hr?g[1]==="!--"?l=zc:g[1]!==void 0?l=Uc:g[2]!==void 0?(yf.test(g[2])&&(o=RegExp("</"+g[2],"g")),l=en):g[3]!==void 0&&(l=en):l===en?g[0]===">"?(l=o??hr,_=-1):g[1]===void 0?_=-2:(_=l.lastIndex-g[2].length,d=g[1],l=g[3]===void 0?en:g[3]==='"'?Vc:Hc):l===Vc||l===Hc?l=en:l===zc||l===Uc?l=hr:(l=en,o=void 0);const m=l===en&&n[u+1].startsWith("/>")?" ":"";a+=l===hr?f+um:_>=0?(r.push(d),f.slice(0,_)+mf+f.slice(_)+$i+m):f+$i+(_===-2?u:m)}return[vf(n,a+(n[i]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]};let vl=class bf{constructor({strings:e,_$litType$:i},r){let o;this.parts=[];let a=0,l=0;const u=e.length-1,f=this.parts,[d,g]=dm(e,i);if(this.el=bf.createElement(d,r),hn.currentNode=this.el.content,i===2||i===3){const _=this.el.content.firstChild;_.replaceWith(..._.childNodes)}for(;(o=hn.nextNode())!==null&&f.length<u;){if(o.nodeType===1){if(o.hasAttributes())for(const _ of o.getAttributeNames())if(_.endsWith(mf)){const h=g[l++],m=o.getAttribute(_).split($i),b=/([.?@])?(.*)/.exec(h);f.push({type:1,index:a,name:b[2],strings:m,ctor:b[1]==="."?pm:b[1]==="?"?gm:b[1]==="@"?mm:Ws}),o.removeAttribute(_)}else _.startsWith($i)&&(f.push({type:6,index:a}),o.removeAttribute(_));if(yf.test(o.tagName)){const _=o.textContent.split($i),h=_.length-1;if(h>0){o.textContent=Ms?Ms.emptyScript:"";for(let m=0;m<h;m++)o.append(_[m],$r()),hn.nextNode(),f.push({type:2,index:++a});o.append(_[h],$r())}}}else if(o.nodeType===8)if(o.data===_f)f.push({type:2,index:a});else{let _=-1;for(;(_=o.data.indexOf($i,_+1))!==-1;)f.push({type:7,index:a}),_+=$i.length-1}a++}}static createElement(e,i){const r=fn.createElement("template");return r.innerHTML=e,r}};function Fn(n,e,i=n,r){if(e===On)return e;let o=r!==void 0?i._$Co?.[r]:i._$Cl;const a=Br(e)?void 0:e._$litDirective$;return o?.constructor!==a&&(o?._$AO?.(!1),a===void 0?o=void 0:(o=new a(n),o._$AT(n,i,r)),r!==void 0?(i._$Co??=[])[r]=o:i._$Cl=o),o!==void 0&&(e=Fn(n,o._$AS(n,e.values),o,r)),e}class fm{constructor(e,i){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:i},parts:r}=this._$AD,o=(e?.creationScope??fn).importNode(i,!0);hn.currentNode=o;let a=hn.nextNode(),l=0,u=0,f=r[0];for(;f!==void 0;){if(l===f.index){let d;f.type===2?d=new Bl(a,a.nextSibling,this,e):f.type===1?d=new f.ctor(a,f.name,f.strings,this,e):f.type===6&&(d=new _m(a,this,e)),this._$AV.push(d),f=r[++u]}l!==f?.index&&(a=hn.nextNode(),l++)}return hn.currentNode=fn,o}p(e){let i=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,i),i+=r.strings.length-2):r._$AI(e[i])),i++}}let Bl=class wf{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,i,r,o){this.type=2,this._$AH=gt,this._$AN=void 0,this._$AA=e,this._$AB=i,this._$AM=r,this.options=o,this._$Cv=o?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const i=this._$AM;return i!==void 0&&e?.nodeType===11&&(e=i.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,i=this){e=Fn(this,e,i),Br(e)?e===gt||e==null||e===""?(this._$AH!==gt&&this._$AR(),this._$AH=gt):e!==this._$AH&&e!==On&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):cm(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==gt&&Br(this._$AH)?this._$AA.nextSibling.data=e:this.T(fn.createTextNode(e)),this._$AH=e}$(e){const{values:i,_$litType$:r}=e,o=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=vl.createElement(vf(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===o)this._$AH.p(i);else{const a=new fm(o,this),l=a.u(this.options);a.p(i),this.T(l),this._$AH=a}}_$AC(e){let i=Wc.get(e.strings);return i===void 0&&Wc.set(e.strings,i=new vl(e)),i}k(e){$l(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let r,o=0;for(const a of e)o===i.length?i.push(r=new wf(this.O($r()),this.O($r()),this,this.options)):r=i[o],r._$AI(a),o++;o<i.length&&(this._$AR(r&&r._$AB.nextSibling,o),i.length=o)}_$AR(e=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ws=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,i,r,o,a){this.type=1,this._$AH=gt,this._$AN=void 0,this.element=e,this.name=i,this._$AM=o,this.options=a,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=gt}_$AI(e,i=this,r,o){const a=this.strings;let l=!1;if(a===void 0)e=Fn(this,e,i,0),l=!Br(e)||e!==this._$AH&&e!==On,l&&(this._$AH=e);else{const u=e;let f,d;for(e=a[0],f=0;f<a.length-1;f++)d=Fn(this,u[r+f],i,f),d===On&&(d=this._$AH[f]),l||=!Br(d)||d!==this._$AH[f],d===gt?e=gt:e!==gt&&(e+=(d??"")+a[f+1]),this._$AH[f]=d}l&&!o&&this.j(e)}j(e){e===gt?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},pm=class extends Ws{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===gt?void 0:e}},gm=class extends Ws{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==gt)}},mm=class extends Ws{constructor(e,i,r,o,a){super(e,i,r,o,a),this.type=5}_$AI(e,i=this){if((e=Fn(this,e,i,0)??gt)===On)return;const r=this._$AH,o=e===gt&&r!==gt||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,a=e!==gt&&(r===gt||o);o&&this.element.removeEventListener(this.name,this,r),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},_m=class{constructor(e,i,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=i,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){Fn(this,e)}};const ym=jl.litHtmlPolyfillSupport;ym?.(vl,Bl),(jl.litHtmlVersions??=[]).push("3.3.1");const vm=(n,e,i)=>{const r=i?.renderBefore??e;let o=r._$litPart$;if(o===void 0){const a=i?.renderBefore??null;r._$litPart$=o=new Bl(e.insertBefore($r(),a),a,void 0,i??{})}return o._$AI(n),o};/**
|
|
91
91
|
* @license
|
|
92
92
|
* Copyright 2017 Google LLC
|
|
93
93
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
94
|
-
*/const
|
|
94
|
+
*/const ql=globalThis;class dn extends Nn{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){const i=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=vm(i,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return On}}dn._$litElement$=!0,dn.finalized=!0,ql.litElementHydrateSupport?.({LitElement:dn});const bm=ql.litElementPolyfillSupport;bm?.({LitElement:dn});(ql.litElementVersions??=[]).push("4.2.1");var xf=n=>{throw TypeError(n)},Ef=(n,e,i)=>e.has(n)||xf("Cannot "+i),Oi=(n,e,i)=>(Ef(n,e,"read from private field"),i?i.call(n):e.get(n)),wm=(n,e,i)=>e.has(n)?xf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),xm=(n,e,i,r)=>(Ef(n,e,"write to private field"),e.set(n,i),i);const Ii=n=>(e,i)=>{i!==void 0?i.addInitializer(()=>{customElements.define(n,e)}):customElements.define(n,e)},Ts=globalThis,zl=Ts.ShadowRoot&&(Ts.ShadyCSS===void 0||Ts.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Sf=Symbol(),Gc=new WeakMap;let Em=class{constructor(n,e,i){if(this._$cssResult$=!0,i!==Sf)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o;const e=this.t;if(zl&&n===void 0){const i=e!==void 0&&e.length===1;i&&(n=Gc.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),i&&Gc.set(e,n))}return n}toString(){return this.cssText}};const Sm=n=>new Em(typeof n=="string"?n:n+"",void 0,Sf),Tm=(n,e)=>{if(zl)n.adoptedStyleSheets=e.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of e){const r=document.createElement("style"),o=Ts.litNonce;o!==void 0&&r.setAttribute("nonce",o),r.textContent=i.cssText,n.appendChild(r)}},Zc=zl?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let i="";for(const r of e.cssRules)i+=r.cssText;return Sm(i)})(n):n,{is:Lm,defineProperty:Im,getOwnPropertyDescriptor:Am,getOwnPropertyNames:Nm,getOwnPropertySymbols:Rm,getPrototypeOf:Pm}=Object,Gs=globalThis,Xc=Gs.trustedTypes,Cm=Xc?Xc.emptyScript:"",Dm=Gs.reactiveElementPolyfillSupport,Fr=(n,e)=>n,Os={toAttribute(n,e){switch(e){case Boolean:n=n?Cm:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let i=n;switch(e){case Boolean:i=n!==null;break;case Number:i=n===null?null:Number(n);break;case Object:case Array:try{i=JSON.parse(n)}catch{i=null}}return i}},Ul=(n,e)=>!Lm(n,e),Jc={attribute:!0,type:String,converter:Os,reflect:!1,useDefault:!1,hasChanged:Ul};Symbol.metadata??=Symbol("metadata"),Gs.litPropertyMetadata??=new WeakMap;class dr extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,i=Jc){if(i.state&&(i.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((i=Object.create(i)).wrapped=!0),this.elementProperties.set(e,i),!i.noAccessor){const r=Symbol(),o=this.getPropertyDescriptor(e,r,i);o!==void 0&&Im(this.prototype,e,o)}}static getPropertyDescriptor(e,i,r){const{get:o,set:a}=Am(this.prototype,e)??{get(){return this[i]},set(l){this[i]=l}};return{get:o,set(l){const u=o?.call(this);a?.call(this,l),this.requestUpdate(e,u,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??Jc}static _$Ei(){if(this.hasOwnProperty(Fr("elementProperties")))return;const e=Pm(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Fr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Fr("properties"))){const i=this.properties,r=[...Nm(i),...Rm(i)];for(const o of r)this.createProperty(o,i[o])}const e=this[Symbol.metadata];if(e!==null){const i=litPropertyMetadata.get(e);if(i!==void 0)for(const[r,o]of i)this.elementProperties.set(r,o)}this._$Eh=new Map;for(const[i,r]of this.elementProperties){const o=this._$Eu(i,r);o!==void 0&&this._$Eh.set(o,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const i=[];if(Array.isArray(e)){const r=new Set(e.flat(1/0).reverse());for(const o of r)i.unshift(Zc(o))}else e!==void 0&&i.push(Zc(e));return i}static _$Eu(e,i){const r=i.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){const e=new Map,i=this.constructor.elementProperties;for(const r of i.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Tm(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,i,r){this._$AK(e,r)}_$ET(e,i){const r=this.constructor.elementProperties.get(e),o=this.constructor._$Eu(e,r);if(o!==void 0&&r.reflect===!0){const a=(r.converter?.toAttribute!==void 0?r.converter:Os).toAttribute(i,r.type);this._$Em=e,a==null?this.removeAttribute(o):this.setAttribute(o,a),this._$Em=null}}_$AK(e,i){const r=this.constructor,o=r._$Eh.get(e);if(o!==void 0&&this._$Em!==o){const a=r.getPropertyOptions(o),l=typeof a.converter=="function"?{fromAttribute:a.converter}:a.converter?.fromAttribute!==void 0?a.converter:Os;this._$Em=o,this[o]=l.fromAttribute(i,a.type)??this._$Ej?.get(o)??null,this._$Em=null}}requestUpdate(e,i,r){if(e!==void 0){const o=this.constructor,a=this[e];if(r??=o.getPropertyOptions(e),!((r.hasChanged??Ul)(a,i)||r.useDefault&&r.reflect&&a===this._$Ej?.get(e)&&!this.hasAttribute(o._$Eu(e,r))))return;this.C(e,i,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,i,{useDefault:r,reflect:o,wrapped:a},l){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,l??i??this[e]),a!==!0||l!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(i=void 0),this._$AL.set(e,i)),o===!0&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[o,a]of this._$Ep)this[o]=a;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[o,a]of r){const{wrapped:l}=a,u=this[o];l!==!0||this._$AL.has(o)||u===void 0||this.C(o,void 0,a,u)}}let e=!1;const i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),this._$EO?.forEach(r=>r.hostUpdate?.()),this.update(i)):this._$EM()}catch(r){throw e=!1,this._$EM(),r}e&&this._$AE(i)}willUpdate(e){}_$AE(e){this._$EO?.forEach(i=>i.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(i=>this._$ET(i,this[i])),this._$EM()}updated(e){}firstUpdated(e){}}dr.elementStyles=[],dr.shadowRootOptions={mode:"open"},dr[Fr("elementProperties")]=new Map,dr[Fr("finalized")]=new Map,Dm?.({ReactiveElement:dr}),(Gs.reactiveElementVersions??=[]).push("2.1.0");const km={attribute:!0,type:String,converter:Os,reflect:!1,hasChanged:Ul},Mm=(n=km,e,i)=>{const{kind:r,metadata:o}=i;let a=globalThis.litPropertyMetadata.get(o);if(a===void 0&&globalThis.litPropertyMetadata.set(o,a=new Map),r==="setter"&&((n=Object.create(n)).wrapped=!0),a.set(i.name,n),r==="accessor"){const{name:l}=i;return{set(u){const f=e.get.call(this);e.set.call(this,u),this.requestUpdate(l,f,n)},init(u){return u!==void 0&&this.C(l,void 0,n,u),u}}}if(r==="setter"){const{name:l}=i;return function(u){const f=this[l];e.call(this,u),this.requestUpdate(l,f,n)}}throw Error("Unsupported decorator location: "+r)};function $e(n){return(e,i)=>typeof i=="object"?Mm(n,e,i):((r,o,a)=>{const l=o.hasOwnProperty(a);return o.constructor.createProperty(a,r),l?Object.getOwnPropertyDescriptor(o,a):void 0})(n,e,i)}function Hl(n){return $e({...n,state:!0,attribute:!1})}const Om=(n,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(n,e,i),i);function $t(n,e){return(i,r,o)=>{const a=l=>l.renderRoot?.querySelector(n)??null;return Om(i,r,{get(){return a(this)}})}}var Fm=Object.defineProperty,Hi=(n,e,i,r)=>{for(var o=void 0,a=n.length-1,l;a>=0;a--)(l=n[a])&&(o=l(e,i,o)||o);return o&&Fm(e,i,o),o};const bl=class extends dn{constructor(){super(...arguments),this.dense=!1}};bl.shadowRootOptions={...dn.shadowRootOptions,delegatesFocus:!0},bl.styles=[ri`
|
|
95
95
|
:host {
|
|
96
96
|
/* color-scheme: light dark; */
|
|
97
97
|
--rokit-primary-color-inner: var(--rokit-primary-color, #008877);
|
|
@@ -114,11 +114,11 @@ a, a:visited { color: inherit; }
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
*/
|
|
117
|
-
`];let
|
|
117
|
+
`];let si=bl;Hi([$e({type:Boolean,reflect:!0})],si.prototype,"dense");var ei;const wl=class extends si{constructor(){super(),wm(this,ei),this.value="",this.clearable=!1,this.required=!1,this.disabled=!1,xm(this,ei,this.attachInternals())}checkValidity(){return Oi(this,ei).checkValidity()}reportValidity(){const e=Oi(this,ei).reportValidity();return this.classList.toggle("invalid",!e),e}get validity(){return Oi(this,ei).validity}get validationMessage(){return Oi(this,ei).validationMessage}setCustomValidity(e,i){e?Oi(this,ei).setValidity({customError:!0},e,i):Oi(this,ei).setValidity(void 0)}updateValidity(e,i,r){Oi(this,ei).setValidity(e,i,r)}setFormValue(e,i){Oi(this,ei).setFormValue(e,i)}};ei=new WeakMap,wl.formAssociated=!0,wl.styles=[...si.styles,ri`
|
|
118
118
|
:host { display: inline-flex; align-items: center; padding: 6px 8px; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); box-sizing: border-box; position: relative; }
|
|
119
119
|
:host(:focus) { border-color: var(--rokit-primary-color-inner); }
|
|
120
120
|
:host(.invalid) { border-color: var(--rokit-error-color-inner); }
|
|
121
|
-
`];let
|
|
121
|
+
`];let oi=wl;Hi([$e()],oi.prototype,"name");Hi([$e()],oi.prototype,"value");Hi([$e({type:Boolean})],oi.prototype,"clearable");Hi([$e({type:Boolean})],oi.prototype,"required");Hi([$e({type:Boolean})],oi.prototype,"disabled");Hi([$e()],oi.prototype,"label");Hi([$e()],oi.prototype,"placeholder");function jm(n){const e=parseFloat(n),i=n.match(/m?s/);let r=0;if(i)switch(i[0]){case"s":r=e*1e3;break;case"ms":r=e;break;default:r=0;break}return r}var $m=Object.defineProperty,Bm=Object.getOwnPropertyDescriptor,Tf=(n,e,i,r)=>{for(var o=r>1?void 0:r?Bm(e,i):e,a=n.length-1,l;a>=0;a--)(l=n[a])&&(o=(r?l(e,i,o):l(o))||o);return r&&o&&$m(e,i,o),o};let jn=class extends si{constructor(){super(...arguments),this.icon=!1}render(){return jt`<a part="link"><slot><slot></a>`}};jn.styles=[...si.styles,ri`
|
|
122
122
|
:host { display: inline-flex; }
|
|
123
123
|
:host a { display: flex; min-width: 1em; height: 1em; padding: 0.5em; cursor: pointer; border-radius: 0.6em; align-items: center; justify-content: center; }
|
|
124
124
|
:host a:hover { text-shadow: 0 0 1px; }
|
|
@@ -130,7 +130,7 @@ a, a:visited { color: inherit; }
|
|
|
130
130
|
:host(.caret) a:before { content: ''; width: var(--rokit-caret-size-inner); height: var(--rokit-caret-size-inner); border-style: none solid solid none; border-width: calc(0.3 * var(--rokit-caret-size-inner)); transform: translate(0.15em, -0.15em) rotate(45deg); transition: transform var(--rokit-transition-duration-inner) ease-out; margin-right: calc(0.5 * var(--rokit-caret-size-inner)); }
|
|
131
131
|
:host(.caret.down) a:before { transform: translate(0.15em, 0.15em) rotate(225deg); }
|
|
132
132
|
:host(.caret.right) a:before { transform: translate(0em, 0em) rotate(-45deg); }
|
|
133
|
-
`];
|
|
133
|
+
`];Tf([$e({type:Boolean,reflect:!0})],jn.prototype,"icon",2);jn=Tf([Ii("rokit-button")],jn);var qm=Object.defineProperty,zm=Object.getOwnPropertyDescriptor,Lf=n=>{throw TypeError(n)},Ai=(n,e,i,r)=>{for(var o=r>1?void 0:r?zm(e,i):e,a=n.length-1,l;a>=0;a--)(l=n[a])&&(o=(r?l(e,i,o):l(o))||o);return r&&o&&qm(e,i,o),o},Um=(n,e,i)=>e.has(n)||Lf("Cannot "+i),Qc=(n,e,i)=>(Um(n,e,"read from private field"),i?i.call(n):e.get(n)),Hm=(n,e,i)=>e.has(n)?Lf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),Ls;let Pt=class extends si{constructor(){super(...arguments),this.open=!1,this.disabled=!1,this.transitioning=!1,this.closedBeforeTransition=!1,Hm(this,Ls,new MutationObserver(()=>this.updateContentHeight())),this.onMouseDown=(()=>{this.closedBeforeTransition=!this.open&&!this.transitioning}).bind(this),this.onClick=(()=>{this.toggle(this.closedBeforeTransition,!0)}).bind(this)}firstUpdated(){this.transitionDuration=jm(getComputedStyle(this).getPropertyValue("--rokit-transition-duration-inner")),new IntersectionObserver(n=>{n.length&&n[0].isIntersecting&&this.updateContentHeight()}).observe(this)}updated(n){n.has("transitioning")&&this.classList.toggle("transitioning",this.transitioning),n.has("disabled")&&(this.disabled?(this.header.removeEventListener("mousedown",this.onMouseDown),this.header.removeEventListener("click",this.onClick)):(this.header.addEventListener("mousedown",this.onMouseDown),this.header.addEventListener("click",this.onClick))),n.has("open")&&!this.disabled&&(this.transitioning||this.toggle(this.open))}updateContentHeight(){setTimeout(()=>{this.content.style.maxHeight=(this.maxHeight!==void 0?Math.min(this.maxHeight,this.content.scrollHeight):this.content.scrollHeight)+"px",this.classList.toggle("has-content",this.content.style.maxHeight!=="0px")})}onSlotChange(){const n=this.shadowRoot.querySelector("#content > slot").assignedNodes();Qc(this,Ls).disconnect();for(const e of n)Qc(this,Ls).observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0});this.updateContentHeight()}toggle(n=!this.open,e=!1){this.disabled||(this.transitioning=!0,this.open=n,this.toggleButton.classList.toggle("down",n),setTimeout(()=>{this.transitioning=!1,this.open&&e&&this.content.scrollIntoView({block:"nearest"})},this.transitionDuration))}render(){return jt`
|
|
134
134
|
<header part="header">
|
|
135
135
|
<slot name="prefix" part="prefix"></slot>
|
|
136
136
|
<span class="label"><slot name="label" part="label">${this.label}</slot></span>
|
|
@@ -141,7 +141,7 @@ a, a:visited { color: inherit; }
|
|
|
141
141
|
<div id="content" part="content">
|
|
142
142
|
<slot @slotchange=${this.onSlotChange}></slot>
|
|
143
143
|
</div>
|
|
144
|
-
`}};
|
|
144
|
+
`}};Ls=new WeakMap;Pt.styles=[...si.styles,ri`
|
|
145
145
|
:host { display: flex; flex-direction: column; align-items: stretch; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); }
|
|
146
146
|
:host header { cursor: pointer; }
|
|
147
147
|
:host([dense]) header { padding: 2px 4px; }
|
|
@@ -153,17 +153,17 @@ a, a:visited { color: inherit; }
|
|
|
153
153
|
.label { flex-grow: 1; overflow: hidden; }
|
|
154
154
|
#content { display: flex; transition: max-height var(--rokit-transition-duration-inner) ease-in-out; position: relative; scrollbar-width: thin; }
|
|
155
155
|
#toggle { margin-left: 3px; }
|
|
156
|
-
`];
|
|
156
|
+
`];Ai([$e({type:Boolean,reflect:!0})],Pt.prototype,"open",2);Ai([$e()],Pt.prototype,"label",2);Ai([$e({reflect:!0})],Pt.prototype,"maxHeight",2);Ai([$e({type:Boolean})],Pt.prototype,"disabled",2);Ai([$t("#content")],Pt.prototype,"content",2);Ai([$t("#toggle")],Pt.prototype,"toggleButton",2);Ai([$t("header")],Pt.prototype,"header",2);Ai([Hl()],Pt.prototype,"transitioning",2);Pt=Ai([Ii("rokit-collapsible")],Pt);var Vm=Object.defineProperty,Wm=Object.getOwnPropertyDescriptor,If=n=>{throw TypeError(n)},Bt=(n,e,i,r)=>{for(var o=r>1?void 0:r?Wm(e,i):e,a=n.length-1,l;a>=0;a--)(l=n[a])&&(o=(r?l(e,i,o):l(o))||o);return r&&o&&Vm(e,i,o),o},Af=(n,e,i)=>e.has(n)||If("Cannot "+i),Gm=(n,e,i)=>(Af(n,e,"read from private field"),e.get(n)),Zm=(n,e,i)=>e.has(n)?If("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),Kc=(n,e,i,r)=>(Af(n,e,"write to private field"),e.set(n,i),i),Nr;let ft=class extends oi{constructor(){super(),this.type="text",this.readonly=!1,this.sticky=!1,this.minWidth=80,this.autoGrowLabelWidth=!1,Zm(this,Nr,""),this.addEventListener("keydown",n=>{n.code==="Escape"&&this.blur()}),this.addEventListener("focus",()=>{this.classList.add("has-focus")}),this.addEventListener("blur",()=>{this.inputElement.scrollLeft=0,this.classList.remove("has-focus")})}firstUpdated(){Kc(this,Nr,this.value),this.inputElement.addEventListener("change",()=>{this.value=this.inputElement.value}),this.autoGrowLabelWidth&&new IntersectionObserver(n=>{n.length&&n[0].isIntersecting&&this.updateMinWidth()}).observe(this)}updateMinWidth(){const n=this.shadowRoot.querySelector(".wrapper");if(n){const e=this.shadowRoot?.querySelector("label")?.scrollWidth||0,i=this.minWidth>e?this.minWidth:e;n.style.minWidth=i>0?i+"px":""}}updated(n){n.has("label")&&(this.classList.toggle("has-label",this.label!==void 0),this.autoGrowLabelWidth&&this.updateMinWidth()),n.has("min")&&(this.inputElement.min=this.min||""),n.has("max")&&(this.inputElement.max=this.max||""),n.has("step")&&(this.inputElement.step=this.step||""),n.has("placeholder")&&(this.inputElement.placeholder=this.placeholder||""),n.has("pattern")&&(this.inputElement.pattern=this.pattern||""),n.has("minLength")&&(this.inputElement.minLength=this.minLength===void 0?-1:this.minLength),n.has("maxLength")&&(this.inputElement.maxLength=this.maxLength===void 0?-1:this.maxLength),n.has("value")&&(this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.updateValidity(this.inputElement.validity,this.inputElement.validationMessage,this.inputElement),this.value!==Gm(this,Nr)&&(Kc(this,Nr,this.value),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))))}clear(){this.inputElement.value="",this.value="",this.blur()}renderInput(){return jt`<input id="input" part="input" size="1" name="${this.name}" type="${this.type}" autocomplete="off" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.type==="file"?"":this.value}">`}render(){return jt`
|
|
157
157
|
<slot name="prefix" part="prefix"></slot>
|
|
158
158
|
<div class="wrapper">
|
|
159
159
|
<label for="input" part="label">${this.label}</label>
|
|
160
160
|
${this.renderInput()}
|
|
161
|
-
${this.clearable?
|
|
162
|
-
<rokit-button class="clear" icon ?dense="${this.dense}" @mousedown="${
|
|
163
|
-
`:
|
|
161
|
+
${this.clearable?jt`
|
|
162
|
+
<rokit-button class="clear" icon ?dense="${this.dense}" @mousedown="${n=>{n.preventDefault()}}" @click="${n=>{n.stopPropagation(),this.clear()}}" title="Clear"></rokit-button>
|
|
163
|
+
`:gt}
|
|
164
164
|
</div>
|
|
165
165
|
<slot name="suffix" part="suffix"></slot>
|
|
166
|
-
`}};
|
|
166
|
+
`}};Nr=new WeakMap;ft.styles=[...oi.styles,ri`
|
|
167
167
|
:host { background-color: var(--rokit-light-background-color-inner); user-select: none; }
|
|
168
168
|
:host([dense]) { padding: 2px 4px; }
|
|
169
169
|
:host(.has-focus:not([readonly])) label, :host(.has-value) label, :host([sticky]) label { font-size: 0.75em; top: 0.5em; font-weight: 600; }
|
|
@@ -177,7 +177,7 @@ a, a:visited { color: inherit; }
|
|
|
177
177
|
:host(.has-label) #input { margin-top: 0.9em; }
|
|
178
178
|
:host(.has-label:not(.has-focus):not(.has-value):not([sticky])) #input { clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
|
|
179
179
|
:host(:not(.has-value)) .clear { visibility: hidden; }
|
|
180
|
-
`];
|
|
180
|
+
`];Bt([$e()],ft.prototype,"type",2);Bt([$e({type:Boolean,reflect:!0})],ft.prototype,"readonly",2);Bt([$e({type:Boolean,reflect:!0})],ft.prototype,"sticky",2);Bt([$e()],ft.prototype,"pattern",2);Bt([$e()],ft.prototype,"minLength",2);Bt([$e()],ft.prototype,"maxLength",2);Bt([$e()],ft.prototype,"min",2);Bt([$e()],ft.prototype,"max",2);Bt([$e()],ft.prototype,"step",2);Bt([$e()],ft.prototype,"minWidth",2);Bt([$e({type:Boolean})],ft.prototype,"autoGrowLabelWidth",2);Bt([$t("#input")],ft.prototype,"inputElement",2);ft=Bt([Ii("rokit-input")],ft);var Xm=Object.defineProperty,Jm=Object.getOwnPropertyDescriptor,Nf=n=>{throw TypeError(n)},At=(n,e,i,r)=>{for(var o=r>1?void 0:r?Jm(e,i):e,a=n.length-1,l;a>=0;a--)(l=n[a])&&(o=(r?l(e,i,o):l(o))||o);return r&&o&&Xm(e,i,o),o},Rf=(n,e,i)=>e.has(n)||Nf("Cannot "+i),bs=(n,e,i)=>(Rf(n,e,"read from private field"),i?i.call(n):e.get(n)),ta=(n,e,i)=>e.has(n)?Nf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),ws=(n,e,i,r)=>(Rf(n,e,"write to private field"),e.set(n,i),i),Rn,Is,As;let vt=class extends oi{constructor(){super(),this.emptyMessage="Nothing to select",this.collapsibleOrientationLeft="0",this.collapsibleOrientationRight="0",this.collapsibleWidth="",this.autoGrowLabelWidth=!1,this.collapse=!1,this.filterableThreshold=15,this.itemCount=0,ta(this,Rn,""),ta(this,Is,""),ta(this,As,new MutationObserver(()=>this.onSlotChange())),this.addEventListener("focus",()=>{this.collapsible.toggle(!0)}),this.addEventListener("blur",()=>{this.checkInputValue(),this.collapsible.toggle(!1)}),this.addEventListener("input",()=>{this.collapsible.toggle(!0)})}firstUpdated(){ws(this,Rn,this.value),ws(this,Is,getComputedStyle(this).getPropertyValue("--rokit-list-indent-inner")),this.input.placeholder=this.placeholder===void 0?"Type to filter list...":this.placeholder,this.input.label=this.label,this.inputMinWidth!==void 0&&(this.input.minWidth=this.inputMinWidth),setTimeout(()=>{this.collapsible.maxHeight=parseInt(this.collapsibleMaxHeight!==void 0?this.collapsibleMaxHeight:getComputedStyle(this).getPropertyValue("--rokit-list-max-height-inner")),this.collapsible.content.style.width=this.collapsibleWidth,this.collapsible.content.style.left=this.collapsibleOrientationLeft,this.collapsible.content.style.right=this.collapsibleOrientationRight})}updated(n){if(n.has("selectedItem")){const e=this.value;this.value=this.selectedItem?this.itemValue(this.selectedItem):"",this.input.value=this.selectedItem?this.itemText(this.selectedItem):this.value,this.input.title=this.input.value,this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.required&&this.value===""?this.updateValidity({valueMissing:!0},"Please select a value",this.listContainer):this.updateValidity(),e!==this.value&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}n.has("value")&&this.selectItem(this.findItem(this.value)),n.has("disabled")&&(this.input.disabled=this.disabled,this.collapsible.disabled=this.disabled),(n.has("filterableThreshold")||n.has("itemCount"))&&(this.input.readonly=this.filterableThreshold<0||this.itemCount<this.filterableThreshold),this.collapsible?.toggleButton&&(this.collapsible.toggleButton.style.display=this.listContainer.childElementCount===0?"none":"")}checkInputValue(n=!0){if(this.input.value){const e=this.findItem(this.input.value);if(e){this.selectItem(e);return}}n&&(this.input.value="",this.input.title="",ws(this,Rn,""),this.selectItem(null,!1))}filter(n){n=n.toLowerCase();let e=!0;for(const i of this.listContainer.querySelectorAll("li"))if(i.id!=="noresult"){const r=this.itemText(i).toLowerCase().indexOf(n)==-1;i.classList.toggle("hidden",r),this.collapse&&(i.classList.remove("open"),i.querySelector("ul")?.classList.remove("open")),r||(e=!1)}for(const i of this.listContainer.querySelectorAll("li:has(li:not(.hidden))"))i.classList.remove("hidden"),n&&this.collapse&&(i.classList.add("open"),i.querySelector("ul")?.classList.add("open")),e=!1;this.highlightItem(null),this.listContainer.querySelector("#noresult")?.classList.toggle("hidden",!e)}selectItem(n,e=!0){n?.getAttribute("disabled")!==null&&(n=null),this.selectedItem=n,this.filter(""),this.highlightItem(n,!1),e&&this.value&&ws(this,Rn,this.value),setTimeout(()=>this.blur())}findItem(n){if(n){for(const e of this.listContainer.querySelectorAll("li"))if(this.itemValue(e)===n||this.itemText(e)===n)return e}return null}highlightItem(n,e=!0){if(this.listContainer.querySelector("li.active")?.classList.remove("active"),n){if(e&&this.listContainer.focus(),n.classList.add("active"),this.collapse)for(let i=n.closest("ul");i;i=i.parentElement.closest("ul"))i.classList.add("open"),i.closest("li")?.classList.add("open");this.collapsible.open&&n.scrollIntoView({block:"nearest"})}}highlightNextItem(){const n=this.listContainer.querySelector("li.active");let e=n;const i=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");if(n){for(let r=0;r<i.length;r++)if(i[r]===n&&r<i.length-1){e=i[r+1];break}}else i.length>0&&(e=i[0]);this.highlightItem(e)}highlightPreviousItem(){const n=this.listContainer.querySelector("li.active");let e=null;if(n){const i=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");for(let r=0;r<i.length;r++)if(i[r]===n&&r>0){e=i[r-1];break}}this.highlightItem(e),e||this.input.focus()}itemValue(n){return n.dataset.value||this.itemText(n)||""}itemText(n){return n.querySelector("div > div")?.innerText||""}elementText(n){let e="";for(const i of n.childNodes)i.nodeType==3&&(e+=i.nodeValue?.trim());return e}onSlotChange(){this.listContainer.replaceChildren(),this.itemCount=0;let n=null;const e=this.shadowRoot.querySelector("#list-container-slot").assignedElements();if(e?.length===1&&(n=Array.prototype.slice.call(e[0].querySelectorAll(":scope > li")),this.copyItems(n,this.listContainer),bs(this,As).disconnect(),bs(this,As).observe(e[0],{subtree:!0,childList:!0,characterData:!0,attributes:!0})),this.emptyMessage){const i=document.createElement("li");i.id="noresult",i.setAttribute("disabled",""),i.innerText=this.emptyMessage,this.listContainer.appendChild(i),n&&n.length>0&&i.classList.add("hidden")}this.value=this.value||bs(this,Rn),this.selectItem(this.findItem(this.value))}copyItems(n,e,i=0){if(this.sort!==void 0){const o=this.sort||"asc";n=n.sort((a,l)=>o==="desc"?(this.elementText(l)||this.itemValue(l)).localeCompare(this.elementText(a)||this.itemValue(a)):(this.elementText(a)||this.itemValue(a)).localeCompare(this.elementText(l)||this.itemValue(l)))}let r="";i>0&&(r=`calc(0.3em + ${i}*${bs(this,Is)})`);for(const o of n){const a=o.cloneNode();a.replaceChildren();const l=document.createElement("div");r&&(l.style.paddingLeft=r);const u=document.createElement("div");l.appendChild(u);for(const d of o.childNodes)if(d.nodeName!=="UL"){const g=d.cloneNode(!0);g.nodeType===3&&g.nodeValue&&(g.nodeValue=g.nodeValue.trim()),u.appendChild(g)}a.appendChild(l),a.title=a.title||this.itemText(a);const f=o.querySelector("ul");if(f?.childElementCount){const d=document.createElement("ul");if(a.appendChild(d),this.copyItems(Array.prototype.slice.call(f.children),d,i+1),this.collapse){const g=new jn;g.title="Open",g.dense=!0,g.icon=!0,g.classList.add("toggle-node","caret"),g.addEventListener("click",_=>{_.stopPropagation(),a.classList.toggle("open"),d.classList.toggle("open"),g.title=a.classList.contains("open")?"Close":"Open",this.collapsible.updateContentHeight()}),l.prepend(g)}else d.classList.add("open")}e.appendChild(a),this.itemCount++}}render(){return jt`
|
|
181
181
|
<rokit-collapsible ?dense="${this.dense}" part="collapsible">
|
|
182
182
|
<slot name="prefix" part="prefix" slot="prefix"></slot>
|
|
183
183
|
<slot name="suffix" part="suffix" slot="suffix"></slot>
|
|
@@ -188,16 +188,16 @@ a, a:visited { color: inherit; }
|
|
|
188
188
|
@input="${()=>{this.filter(this.input.inputElement.value)}}"
|
|
189
189
|
@click="${()=>{this.collapsible.toggle(!0)}}"
|
|
190
190
|
?autoGrowLabelWidth="${this.autoGrowLabelWidth}"
|
|
191
|
-
@keydown="${
|
|
191
|
+
@keydown="${n=>{switch(n.code){case"ArrowDown":n.preventDefault(),this.highlightNextItem();break;case"Enter":{const e=this.findItem(this.input.value);e?this.selectItem(e):this.filter(this.input.value);break}}}}"
|
|
192
192
|
></rokit-input>
|
|
193
193
|
<ul id="list-container" tabindex="-1" part="list" class="open"
|
|
194
|
-
@mousedown="${
|
|
195
|
-
@click="${
|
|
196
|
-
@keydown="${
|
|
194
|
+
@mousedown="${n=>{n.preventDefault()}}"
|
|
195
|
+
@click="${n=>{const e=n.target.closest("li");e&&e.getAttribute("disabled")===null&&!e.classList.contains("divider")&&this.selectItem(e)}}"
|
|
196
|
+
@keydown="${n=>{switch(n.code){case"Enter":this.selectItem(this.listContainer.querySelector("li.active"));break;case"ArrowDown":n.preventDefault(),this.highlightNextItem();break;case"ArrowUp":n.preventDefault(),this.highlightPreviousItem();break;case"ArrowRight":if(this.collapse){const e=this.listContainer.querySelector("li.active");e&&(n.preventDefault(),e.classList.add("open"),e.querySelector("ul")?.classList.add("open"),this.collapsible.updateContentHeight())}break;case"ArrowLeft":if(this.collapse){const e=this.listContainer.querySelector("li.active");e&&(n.preventDefault(),e.classList.remove("open"),e.querySelector("ul")?.classList.remove("open"),this.collapsible.updateContentHeight())}break;case"Escape":this.listContainer.blur();break}}}">
|
|
197
197
|
</ul>
|
|
198
198
|
<slot id="list-container-slot" @slotchange=${this.onSlotChange}></slot>
|
|
199
199
|
</rokit-collapsible>
|
|
200
|
-
`}};
|
|
200
|
+
`}};Rn=new WeakMap;Is=new WeakMap;As=new WeakMap;vt.styles=[...oi.styles,ri`
|
|
201
201
|
:host { background-color: var(--rokit-light-background-color-inner); user-select: none; padding: 0; }
|
|
202
202
|
:host([dense]) li > div { padding: 4px 2px; }
|
|
203
203
|
:host([dense]) li.large > div, :host([dense]) li.header > div { padding-top: 6px; padding-bottom: 6px; }
|
|
@@ -223,37 +223,37 @@ a, a:visited { color: inherit; }
|
|
|
223
223
|
:host([collapse]) li > div > div { padding-left: 1.8em; }
|
|
224
224
|
:host([collapse]) ul:not(.open) { display: none; }
|
|
225
225
|
:host([collapse]) li:not(.open) > div > .toggle-node::part(link):before { transform: translate(0em, 0em) rotate(-45deg); }
|
|
226
|
-
`];
|
|
226
|
+
`];At([$e()],vt.prototype,"emptyMessage",2);At([$e()],vt.prototype,"sort",2);At([$e()],vt.prototype,"collapsibleMaxHeight",2);At([$e()],vt.prototype,"collapsibleOrientationLeft",2);At([$e()],vt.prototype,"collapsibleOrientationRight",2);At([$e()],vt.prototype,"collapsibleWidth",2);At([$e({type:Boolean})],vt.prototype,"autoGrowLabelWidth",2);At([$e()],vt.prototype,"inputMinWidth",2);At([$e({type:Boolean,reflect:!0})],vt.prototype,"collapse",2);At([$e()],vt.prototype,"filterableThreshold",2);At([$t("rokit-collapsible")],vt.prototype,"collapsible",2);At([$t("#input")],vt.prototype,"input",2);At([$t("#list-container")],vt.prototype,"listContainer",2);At([Hl()],vt.prototype,"selectedItem",2);At([Hl()],vt.prototype,"itemCount",2);vt=At([Ii("rokit-select")],vt);var Qm=Object.defineProperty,Km=Object.getOwnPropertyDescriptor,Zs=(n,e,i,r)=>{for(var o=r>1?void 0:r?Km(e,i):e,a=n.length-1,l;a>=0;a--)(l=n[a])&&(o=(r?l(e,i,o):l(o))||o);return r&&o&&Qm(e,i,o),o};let pn=class extends ft{constructor(){super(...arguments),this.resize="none",this.rows=3}firstUpdated(){super.firstUpdated(),this.inputElement.rows=this.rows,this.cols!==void 0&&(this.inputElement.cols=this.cols),this.resize==="auto"?(this.inputElement.style.resize="none",this.inputElement.addEventListener("input",()=>this.autoResize())):this.inputElement.style.resize=this.resize}updated(n){super.updated(n),this.resize==="auto"&&n.has("resize")&&new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.autoResize()}).observe(this),this.resize==="auto"&&n.has("value")&&this.autoResize()}autoResize(){this.inputElement.style.height="",this.inputElement.style.height=this.inputElement.scrollHeight+"px"}onSlotChange(){const n=this.shadowRoot.querySelector("#content").assignedNodes().map(e=>e.textContent).join("");n.trim()!==""&&(this.value=n)}renderInput(){return jt`
|
|
227
227
|
<textarea id="input" part="input" autocomplete="off" name="${this.name}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.value}"></textarea>
|
|
228
228
|
<slot id="content" @slotchange=${this.onSlotChange}></slot>
|
|
229
|
-
`}};
|
|
229
|
+
`}};pn.styles=[...ft.styles,ri`
|
|
230
230
|
:host, .wrapper { align-items: flex-start; }
|
|
231
231
|
#input { height: initial; }
|
|
232
232
|
#content { display: none; }
|
|
233
|
-
`];
|
|
233
|
+
`];Zs([$e()],pn.prototype,"resize",2);Zs([$e()],pn.prototype,"rows",2);Zs([$e()],pn.prototype,"cols",2);pn=Zs([Ii("rokit-textarea")],pn);var Ym=Object.defineProperty,e_=Object.getOwnPropertyDescriptor,Pf=n=>{throw TypeError(n)},pi=(n,e,i,r)=>{for(var o=r>1?void 0:r?e_(e,i):e,a=n.length-1,l;a>=0;a--)(l=n[a])&&(o=(r?l(e,i,o):l(o))||o);return r&&o&&Ym(e,i,o),o},Cf=(n,e,i)=>e.has(n)||Pf("Cannot "+i),et=(n,e,i)=>(Cf(n,e,"read from private field"),i?i.call(n):e.get(n)),ia=(n,e,i)=>e.has(n)?Pf("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,i),xs=(n,e,i,r)=>(Cf(n,e,"write to private field"),e.set(n,i),i),ct,wi,Pn;const Bi=18;let Si=class extends ft{constructor(){super(...arguments),this.labelFormatter=n=>String(n),ia(this,ct,[0,1]),ia(this,wi,[et(this,ct)[0],et(this,ct)[1]]),ia(this,Pn)}firstUpdated(){super.firstUpdated(),this.sliderElement.addEventListener("mousedown",n=>this.onKnobDrag(n)),this.sliderElement.addEventListener("touchstart",n=>this.onKnobDrag(n)),new ResizeObserver(()=>{this.updateKnobPositions()}).observe(this.sliderElement)}updated(n){if(super.updated(n),n.has("min")&&(et(this,ct)[0]=parseFloat(this.min||"0"),et(this,ct)[1]=Math.max(et(this,ct)[0],et(this,ct)[1])),n.has("max")&&(et(this,ct)[1]=parseFloat(this.max||"1"),et(this,ct)[0]=Math.min(et(this,ct)[0],et(this,ct)[1])),n.has("step")&&xs(this,Pn,this.step?parseFloat(this.step):void 0),n.has("value")||n.has("min")||n.has("max"))if(this.value)if(this.range!==void 0){const e=JSON.parse(this.value);xs(this,wi,[this.applyConstraints(e[0]),this.applyConstraints(e[1])])}else xs(this,wi,[this.applyConstraints(parseFloat(this.value))]);else xs(this,wi,[et(this,ct)[0],et(this,ct)[1]]);this.updateKnobPositions()}updateValidity(n,e){super.updateValidity(n,e,this.sliderElement)}chooseKnob(n){if(!this.endKnob)return this.startKnob;let e=Math.abs(n-this.startKnob.offsetLeft)<Math.abs(n-this.endKnob.offsetLeft)?this.startKnob:this.endKnob;return this.startKnob.value===this.endKnob.value&&(e.id==="start"&&e.value===et(this,ct)[0]?e=this.endKnob:e.id==="end"&&e.value===et(this,ct)[1]&&(e=this.startKnob)),e}toScreenSpace(n){return(n-et(this,ct)[0])/(et(this,ct)[1]-et(this,ct)[0])*this.track.offsetWidth}toValueSpace(n){return n/this.track.offsetWidth*(et(this,ct)[1]-et(this,ct)[0])+et(this,ct)[0]}applyConstraints(n,e){let i=Math.min(Math.max(n,et(this,ct)[0]),et(this,ct)[1]);return et(this,Pn)&&(i=Math.round(i/et(this,Pn))*et(this,Pn)),e!==void 0&&this.endKnob&&(i=e?Math.min(i,this.endKnob.value):Math.max(i,this.startKnob.value)),i}updateKnob(n,e){n.value=e,n.offset=this.toScreenSpace(e),n.label=this.labelFormatter(e),this.endKnob&&(n.id==="start"?this.track.style.borderLeftWidth=n.offset+"px":this.track.style.borderRightWidth=this.track.offsetWidth-n.offset+"px")}updateKnobPositions(){this.updateKnob(this.startKnob,et(this,wi)[0]),this.endKnob&&this.updateKnob(this.endKnob,et(this,wi)[1])}onKnobDrag(n){if(n.target instanceof $n||this.classList.contains("has-value")||this.classList.contains("has-focus")){let e;const i=o=>{let a=0;o.type==="touchmove"||o.type==="touchstart"?a=o.touches[0].clientX:a=o.clientX,a=a-this.track.getBoundingClientRect().left,e||(e=this.chooseKnob(a),e.classList.add("focus")),this.updateKnob(e,this.applyConstraints(this.toValueSpace(a),e.id==="start"))},r=()=>{document.removeEventListener("mousemove",i),document.removeEventListener("touchmove",i),document.removeEventListener("mouseup",r),document.removeEventListener("touchend",r),e&&(e.classList.remove("focus"),this.range!==void 0?e.id==="end"?this.value=JSON.stringify([et(this,wi)[0],e.value]):this.value=JSON.stringify([e.value,et(this,wi)[1]]):this.value=String(e.value)),e=void 0};this.sliderElement.focus(),document.addEventListener("mousemove",i),document.addEventListener("touchmove",i),document.addEventListener("mouseup",r),document.addEventListener("touchend",r),i(n)}}renderInput(){return jt`
|
|
234
234
|
${super.renderInput()}
|
|
235
235
|
<div id="slider" part="slider" tabindex="0" ?range="${this.range!==void 0}">
|
|
236
236
|
<div id="track"></div>
|
|
237
237
|
<rokit-slider-knob id="start"></rokit-slider-knob>
|
|
238
|
-
${this.range===void 0?
|
|
238
|
+
${this.range===void 0?gt:jt`
|
|
239
239
|
<rokit-slider-knob id="end"></rokit-slider-knob>
|
|
240
240
|
`}
|
|
241
241
|
</div>
|
|
242
|
-
`}};
|
|
242
|
+
`}};ct=new WeakMap;wi=new WeakMap;Pn=new WeakMap;Si.styles=[...ft.styles,ri`
|
|
243
243
|
:host(.has-label:not(:focus):not(.has-value):not([sticky])) #slider > * { visibility: hidden; }
|
|
244
244
|
:host(.has-label) .wrapper { padding-top: 1em; }
|
|
245
|
-
:host([sticky]) #slider { margin-top: ${.25*
|
|
245
|
+
:host([sticky]) #slider { margin-top: ${.25*Bi+22}px; }
|
|
246
246
|
#input { display: none; }
|
|
247
|
-
#slider { display: flex; position: relative; align-items: center; width: 100%; height: ${
|
|
247
|
+
#slider { display: flex; position: relative; align-items: center; width: 100%; height: ${Bi}px; padding: 0 ${Bi/2}px; outline: 0; }
|
|
248
248
|
:host(:not([sticky])) #slider:not(:focus) rokit-slider-knob::part(label) { color: transparent; background-color: transparent; border-color: transparent; top: 0; }
|
|
249
249
|
#track { height: 2px; flex-grow: 1; background-color: #CCC; }
|
|
250
250
|
#slider[range] #track { background-color: color-mix(in srgb, var(--rokit-primary-color-inner) 60%, transparent); border-width: 0; border-color: #CCC; border-style: solid; }
|
|
251
|
-
`];
|
|
252
|
-
:host { position: absolute; width: ${
|
|
253
|
-
:host(.focus), :host(:hover) { box-shadow: 0 0 0 ${
|
|
251
|
+
`];pi([$e()],Si.prototype,"range",2);pi([$e()],Si.prototype,"labelFormatter",2);pi([$t("#slider")],Si.prototype,"sliderElement",2);pi([$t("#track")],Si.prototype,"track",2);pi([$t("#start")],Si.prototype,"startKnob",2);pi([$t("#end")],Si.prototype,"endKnob",2);Si=pi([Ii("rokit-slider")],Si);let $n=class extends dn{constructor(){super(...arguments),this.offset=0,this.label="",this.value=0}updated(n){n.has("offset")&&(this.style.left=this.offset+"px")}render(){return jt`<label part="label">${this.label}</label>`}};$n.styles=[ri`
|
|
252
|
+
:host { position: absolute; width: ${Bi}px; height: ${Bi}px; border-radius: ${Bi}px; background-color: var(--rokit-primary-color-inner); }
|
|
253
|
+
:host(.focus), :host(:hover) { box-shadow: 0 0 0 ${Bi/2}px var(--rokit-primary-color-transparent-inner); z-index: 1; }
|
|
254
254
|
label {
|
|
255
255
|
position: absolute;
|
|
256
|
-
top: calc(-2em - ${
|
|
256
|
+
top: calc(-2em - ${Bi/4}px);
|
|
257
257
|
left: 50%;
|
|
258
258
|
transform: translate(-50%, 0);
|
|
259
259
|
white-space: nowrap;
|
|
@@ -278,28 +278,28 @@ a, a:visited { color: inherit; }
|
|
|
278
278
|
background-color: inherit;
|
|
279
279
|
clip-path: polygon(50% 50%, 100% 50%, 50% 100%, 0 50%);
|
|
280
280
|
}
|
|
281
|
-
`];
|
|
281
|
+
`];pi([$e()],$n.prototype,"offset",2);pi([$e()],$n.prototype,"label",2);$n=pi([Ii("rokit-slider-knob")],$n);var t_=Object.defineProperty,i_=Object.getOwnPropertyDescriptor,Vr=(n,e,i,r)=>{for(var o=r>1?void 0:r?i_(e,i):e,a=n.length-1,l;a>=0;a--)(l=n[a])&&(o=(r?l(e,i,o):l(o))||o);return r&&o&&t_(e,i,o),o};let gn=class extends si{constructor(){super(...arguments),this.open=!1,this.closable=!1,this.title=""}firstUpdated(){this.dialogElement.addEventListener("close",()=>{this.open=!1,this.dispatchEvent(new Event("close"))})}updated(n){if(n.has("open"))if(this.open)document.body.style.left=`-${window.scrollX}px`,document.body.style.top=`-${window.scrollY}px`,document.body.style.position="fixed",this.dialogElement.showModal();else{const e=document.body.style.left,i=document.body.style.top;document.body.style.position="",document.body.style.left="",document.body.style.top="",window.scrollTo(parseInt(e||"0")*-1,parseInt(i||"0")*-1),this.dialogElement.close()}}render(){return jt`
|
|
282
282
|
<dialog id="dialog" part="dialog">
|
|
283
283
|
<header>
|
|
284
284
|
<div class="title" part="title">
|
|
285
285
|
<slot name="header">${this.title}</slot>
|
|
286
286
|
</div>
|
|
287
|
-
${this.closable?
|
|
287
|
+
${this.closable?jt`
|
|
288
288
|
<rokit-button class="clear" icon ?dense="${this.dense}" @click="${()=>{this.open=!1}}" title="Close"></rokit-button>
|
|
289
|
-
`:
|
|
289
|
+
`:gt}
|
|
290
290
|
</header>
|
|
291
291
|
<main>
|
|
292
292
|
<slot></slot>
|
|
293
293
|
</main>
|
|
294
294
|
</dialog>
|
|
295
|
-
`}};
|
|
295
|
+
`}};gn.styles=[...si.styles,ri`
|
|
296
296
|
dialog[open] { display: flex; flex-direction: column; width: 100%; max-width: 90vw; max-height: 90vh; margin: auto; outline: 0; border: 0; border-radius: 1em; }
|
|
297
297
|
dialog::backdrop { background-color: #0007; }
|
|
298
298
|
header { display: flex; align-items: center; }
|
|
299
299
|
.title { font-weight: 600; flex-grow: 1; text-align: center; }
|
|
300
300
|
.clear { justify-self: flex-end; }
|
|
301
301
|
main { flex-grow: 1; overflow: auto; }
|
|
302
|
-
`];
|
|
302
|
+
`];Vr([$e({type:Boolean,reflect:!0})],gn.prototype,"open",2);Vr([$e({type:Boolean})],gn.prototype,"closable",2);Vr([$e()],gn.prototype,"title",2);Vr([$t("#dialog")],gn.prototype,"dialogElement",2);gn=Vr([Ii("rokit-dialog")],gn);var n_=Object.defineProperty,r_=Object.getOwnPropertyDescriptor,Vl=(n,e,i,r)=>{for(var o=r>1?void 0:r?r_(e,i):e,a=n.length-1,l;a>=0;a--)(l=n[a])&&(o=(r?l(e,i,o):l(o))||o);return r&&o&&n_(e,i,o),o};let qr=class extends si{updated(n){n.has("percent")&&(this.bar.style.width=this.percent?this.percent+"%":"")}render(){return jt`<div class="bar"></div>`}};qr.styles=[...si.styles,ri`
|
|
303
303
|
:host { display: flex; }
|
|
304
304
|
.bar { height: 3px; background-color: var(--rokit-primary-color-inner); }
|
|
305
305
|
:host(:not([percent])) .bar { width: 100%; --c: no-repeat linear-gradient(var(--rokit-primary-color-inner) 0 0); background: var(--c), var(--c); background-size: 60% 100%; animation: indeterminate 3s infinite; }
|
|
@@ -308,60 +308,60 @@ a, a:visited { color: inherit; }
|
|
|
308
308
|
66% { background-position: 250% 0,-150% 0 }
|
|
309
309
|
100% { background-position: 250% 0, 250% 0 }
|
|
310
310
|
}
|
|
311
|
-
`];Ba([Se({reflect:!0})],In.prototype,"percent",2);Ba([ut(".bar")],In.prototype,"bar",2);In=Ba([Ft("rokit-progressbar")],In);class ai extends HTMLElement{constructor(e,t,n,i){if(super(),this.template=new Jd(n.store.getQuads(e,null,null,null),t,n),this.container=this,this.template.extendedShapes.length&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)){const s=new nt;s.classList.add("collapsible","shacl-group"),s.open=n.attributes.collapse==="open",s.label=this.template.label,this.container=s}if(this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),n.editMode&&!t.linked&&(this.addButton=this.createAddButton(),this.container.appendChild(this.addButton)),this.template.path){let s=[];i&&(t.linked?s=n.store.getQuads(i,this.template.path,null,null):s=n.store.getQuads(i,this.template.path,null,Lt));let a=!1;for(const o of s)this.isValueValid(o.object)&&(this.addPropertyInstance(o.object),this.template.hasValue&&o.object.equals(this.template.hasValue)&&(a=!0));n.editMode&&this.template.hasValue&&!a&&!t.linked&&this.addPropertyInstance(this.template.hasValue)}n.editMode&&!t.linked&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),this.container instanceof nt&&(n.editMode&&!t.linked||this.container.childElementCount>0)&&this.appendChild(this.container)}addPropertyInstance(e){let t;if(this.template.shaclOr?.length||this.template.shaclXone?.length){const n=this.template.shaclOr?.length?this.template.shaclOr:this.template.shaclXone;let i=!1;if(e){const s=zd(n,e,this.template.config);s.length&&(t=Zn(this.template.clone().merge(s),e,!0),i=!0)}i||(t=mc(n,this,this.template.config),Fc(t,""))}else{let n=!1;if(e&&!(e instanceof _t)){const i=this.getRdfClassToLinkOrCreate();i&&this.template.config.store.countQuads(e,tt,i,Lt)===0&&(n=!0)}t=Zn(this.template,e,void 0,n||this.template.parent.linked)}return this.addButton?this.container.insertBefore(t,this.addButton):this.container.appendChild(t),t}updateControls(){let e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;e===0&&(!this.template.extendedShapes.length||this.template.minCount!==void 0&&this.template.minCount>0)&&(this.addPropertyInstance(),e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length);let t;this.template.minCount!==void 0?t=e>this.template.minCount:t=this.template.extendedShapes.length>0||e>1;const n=this.template.maxCount===void 0||e<this.template.maxCount;this.classList.toggle("may-remove",t),this.classList.toggle("may-add",n)}toRDF(e,t){for(const n of this.querySelectorAll(":scope > .property-instance, :scope > .collapsible > .property-instance")){const i=Ne.namedNode(n.dataset.path);if(n.firstChild instanceof zt){const s=n.firstChild.toRDF(e);e.addQuad(t,i,s,this.template.config.valuesGraphId)}else for(const s of n.querySelectorAll(":scope > .editor")){const a=rh(s);a&&e.addQuad(t,i,a,this.template.config.valuesGraphId)}}}getRdfClassToLinkOrCreate(){if(this.template.class&&this.template.node)return this.template.class;for(const e of this.template.extendedShapes){const t=this.template.config.store.getObjects(e,Rr,null);if(t.length>0)return t[0]}}isValueValid(e){if(!this.template.extendedShapes.length)return!0;for(const t of this.template.extendedShapes){const n=this.template.config.store.getObjects(t,Rr,null);for(const i of n)if(this.template.config.store.countQuads(e,tt,i,null)>0)return!0}return!1}createAddButton(){const e=new Ge;e.dense=!0,e.label="+ "+this.template.label,e.title="Add "+this.template.label,e.autoGrowLabelWidth=!0,e.classList.add("add-button");let t=[],n=this.getRdfClassToLinkOrCreate();if(n&&(t=Da(n,this.template)),t.length===0)e.emptyMessage="",e.inputMinWidth=0,e.addEventListener("click",i=>{e.blur();const s=this.addPropertyInstance();s.classList.add("fadeIn"),this.updateControls(),setTimeout(()=>{Gd(s),s.classList.remove("fadeIn")},200)});else{const i=document.createElement("ul"),s=document.createElement("li");s.innerHTML="+ Create new "+this.template.label+"...",s.dataset.value="new",s.classList.add("large"),i.appendChild(s);const a=document.createElement("li");a.classList.add("divider"),i.appendChild(a);const o=document.createElement("li");o.classList.add("header"),o.innerText="Or link existing:",i.appendChild(o);for(const u of t){const l=document.createElement("li"),c=typeof u.value=="string"?u.value:u.value.value;l.innerText=u.label?u.label:c,l.dataset.value=JSON.stringify(u.value),i.appendChild(l)}e.appendChild(i),e.collapsibleWidth="250px",e.collapsibleOrientationLeft="",e.addEventListener("change",()=>{if(e.value==="new")this.addPropertyInstance();else{const u=JSON.parse(e.value);this.container.insertBefore(Zn(this.template,u,!0,!0),e)}e.value=""})}return e}}function Zn(r,e,t=!1,n=!1){let i;if(r.extendedShapes.length){i=document.createElement("div"),i.classList.add("property-instance");for(const s of r.extendedShapes)i.appendChild(new zt(s,r.config,e,r.parent,r.nodeKind,r.label,n))}else{const s=sh(r.path,r.datatype?.value);s?r.config.editMode&&!n?i=s.createEditor(r,e):i=s.createViewer(r,e):i=Zd(r,e||null,r.config.editMode&&!n),i.classList.add("property-instance"),n&&i.classList.add("linked")}return r.config.editMode&&Fc(i,r.label,t),i.dataset.path=r.path,i}function Fc(r,e,t=!1){const n=new Dr;n.classList.add("remove-button","clear"),n.title="Remove "+e,n.dense=!0,n.icon=!0,n.addEventListener("click",i=>{r.classList.remove("fadeIn"),r.classList.add("fadeOut"),setTimeout(()=>{const s=r.parentElement;r.remove(),s?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&n.classList.add("persistent"),r.appendChild(n)}window.customElements.define("shacl-property",ai);function ff(r,e){let t=r;const n=e.store.getQuads(r,null,null,null),i=bn(n,"label",Na,e.languages);i&&(t=i);let s;if(e.attributes.collapse!==null)s=new nt,s.classList.add("collapsible"),s.open=e.attributes.collapse==="open",s.label=t;else{s=document.createElement("div");const o=document.createElement("h1");o.innerText=t,s.appendChild(o)}s.dataset.subject=r,s.classList.add("shacl-group");const a=bn(n,"order");return a&&(s.style.order=a),s}const Je=[];for(let r=0;r<256;++r)Je.push((r+256).toString(16).slice(1));function pf(r,e=0){return(Je[r[e+0]]+Je[r[e+1]]+Je[r[e+2]]+Je[r[e+3]]+"-"+Je[r[e+4]]+Je[r[e+5]]+"-"+Je[r[e+6]]+Je[r[e+7]]+"-"+Je[r[e+8]]+Je[r[e+9]]+"-"+Je[r[e+10]]+Je[r[e+11]]+Je[r[e+12]]+Je[r[e+13]]+Je[r[e+14]]+Je[r[e+15]]).toLowerCase()}let Zi;const gf=new Uint8Array(16);function mf(){if(!Zi){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Zi=crypto.getRandomValues.bind(crypto)}return Zi(gf)}const yf=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),al={randomUUID:yf};function bf(r,e,t){r=r||{};const n=r.random??r.rng?.()??mf();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,pf(n)}function ol(r,e,t){return al.randomUUID&&!r?al.randomUUID():bf(r)}class zt extends HTMLElement{constructor(e,t,n,i,s,a,o){super(),this.owlImports=[],this.parent=i,this.config=t,this.shaclSubject=e,this.linked=o||!1;let u=n;if(!u){if(!s){const c=t.store.getObjects(e,`${xe}nodeKind`,null);c.length&&(s=c[0])}s===void 0&&t.attributes.valuesNamespace||s?.value===`${xe}IRI`?u=Ne.namedNode(t.attributes.valuesNamespace+ol()):u=Ne.blankNode(ol())}this.nodeId=u;const l=JSON.stringify([e,n]);if(n&&t.renderedNodes.has(l)){a=a||"Link";const c=document.createElement("label");c.innerText=a,c.classList.add("linked"),this.appendChild(c);const d=document.createElement("a");let b=n.termType==="BlankNode"?"_:"+n.value:n.value;d.innerText=b,d.classList.add("ref-link"),d.onclick=()=>{this.config.form.querySelector(`shacl-node[data-node-id='${b}']`)?.scrollIntoView()},this.appendChild(d),this.style.flexDirection="row"}else{if(n&&t.renderedNodes.add(l),this.dataset.nodeId=this.nodeId.id,this.config.attributes.showNodeIds!==null){const c=document.createElement("div");c.innerText=`id: ${this.nodeId.id}`,c.classList.add("node-id-display"),this.appendChild(c)}for(const c of t.store.getQuads(e,Ta,null,null))this.owlImports.push(c.object);for(const c of t.store.getQuads(e,null,null,null))switch(c.predicate.id){case ni.id:this.addPropertyInstance(c.object,t,n);break;case`${xe}and`:const d=t.lists[c.object.value];if(d?.length)for(const b of d)this.prepend(new zt(b,t,n,this));else console.error("list not found:",c.object.value,"existing lists:",t.lists);break;case Ud.id:this.prepend(new zt(c.object,t,n,this));break;case`${xe}targetClass`:this.targetClass=c.object;break;case`${xe}or`:this.tryResolve(c.object,n,t);break;case`${xe}xone`:this.tryResolve(c.object,n,t);break}if(a){const c=document.createElement("h1");c.innerText=a,this.prepend(c)}}}toRDF(e,t){if(t||(t=this.nodeId),!this.linked){for(const n of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))n.toRDF(e,t);this.targetClass&&e.addQuad(t,tt,this.targetClass,this.config.valuesGraphId),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,Ne.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraphId)}return t}addPropertyInstance(e,t,n){let i=this;const s=t.store.getQuads(e,`${xe}group`,null,null);if(s.length>0){const o=s[0].object.value;if(t.groups.indexOf(o)>-1){let u=this.querySelector(`:scope > .shacl-group[data-subject='${o}']`);u||(u=ff(o,t),this.appendChild(u)),i=u}else console.warn("ignoring unknown group reference",s[0],"existing groups:",t.groups)}const a=new ai(e,this,t,n);a.childElementCount>0&&i.appendChild(a)}tryResolve(e,t,n){const i=n.lists[e.value];if(i?.length){let s=!1;if(t){const a=Qd(i,t,n);if(a.length){for(const o of a)this.addPropertyInstance(o,n,t);s=!0}}s||this.appendChild(mc(i,this,n))}else console.error("list for sh:or/sh:xone not found:",e,"existing lists:",n.lists)}}window.customElements.define("shacl-node",zt);var Yt={},Zt={},er={},At={},ll;function _f(){if(ll)return At;ll=1,Object.defineProperty(At,"__esModule",{value:!0}),At.removeDotSegmentsOfPath=At.removeDotSegments=At.resolve=void 0;function r(i,s){s=s||"";const a=s.indexOf("#");if(a>0&&(s=s.substr(0,a)),!i.length){if(s.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${s}' for value '${i}'`);return s}if(i.startsWith("?")){const y=s.indexOf("?");return y>0&&(s=s.substr(0,y)),s+i}if(i.startsWith("#"))return s+i;if(!s.length){const y=i.indexOf(":");if(y<0)throw new Error(`Found invalid relative IRI '${i}' for a missing baseIRI`);return t(i,y)}const o=i.indexOf(":");if(o>=0)return t(i,o);const u=s.indexOf(":");if(u<0)throw new Error(`Found invalid baseIRI '${s}' for value '${i}'`);const l=s.substr(0,u+1);if(i.indexOf("//")===0)return l+t(i,o);let c;if(s.indexOf("//",u)===u+1){if(c=s.indexOf("/",u+3),c<0)return s.length>u+3?s+"/"+t(i,o):l+t(i,o)}else if(c=s.indexOf("/",u+1),c<0)return l+t(i,o);if(i.indexOf("/")===0)return s.substr(0,c)+e(i);let d=s.substr(c);const b=d.lastIndexOf("/");return b>=0&&b<d.length-1&&(d=d.substr(0,b+1),i[0]==="."&&i[1]!=="."&&i[1]!=="/"&&i[2]&&(i=i.substr(1))),i=d+i,i=e(i),s.substr(0,c)+i}At.resolve=r;function e(i){const s=[];let a=0;for(;a<i.length;)switch(i[a]){case"/":if(i[a+1]===".")if(i[a+2]==="."){if(!n(i[a+3])){s.push([]),a++;break}s.pop(),i[a+3]||s.push([]),a+=3}else{if(!n(i[a+2])){s.push([]),a++;break}i[a+2]||s.push([]),a+=2}else s.push([]),a++;break;case"#":case"?":s.length||s.push([]),s[s.length-1].push(i.substr(a)),a=i.length;break;default:s.length||s.push([]),s[s.length-1].push(i[a]),a++;break}return"/"+s.map(o=>o.join("")).join("/")}At.removeDotSegments=e;function t(i,s){let a=s+1;s>=0?i[s+1]==="/"&&i[s+2]==="/"&&(a=s+3):i[0]==="/"&&i[1]==="/"&&(a=2);const o=i.indexOf("/",a);if(o<0)return i;const u=i.substr(0,o),l=i.substr(o);return u+e(l)}At.removeDotSegmentsOfPath=t;function n(i){return!i||i==="#"||i==="?"||i==="/"}return At}var ul;function wf(){return ul||(ul=1,(function(r){var e=er&&er.__createBinding||(Object.create?(function(n,i,s,a){a===void 0&&(a=s),Object.defineProperty(n,a,{enumerable:!0,get:function(){return i[s]}})}):(function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]})),t=er&&er.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(r,"__esModule",{value:!0}),t(_f(),r)})(er)),er}var tr={},es={},cl;function vf(){return cl||(cl=1,(function(r){/**
|
|
311
|
+
`];Vl([$e({reflect:!0})],qr.prototype,"percent",2);Vl([$t(".bar")],qr.prototype,"bar",2);qr=Vl([Ii("rokit-progressbar")],qr);class Fs extends HTMLElement{constructor(e,i,r,o){if(super(),this.template=new Ug(r.store.getQuads(e,null,null,null),i,r),this.container=this,this.template.extendedShapes.length&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)){const a=new Pt;a.classList.add("collapsible","shacl-group"),a.open=r.attributes.collapse==="open",a.label=this.template.label,this.container=a}if(this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),r.editMode&&!i.linked&&(this.addButton=this.createAddButton(),this.container.appendChild(this.addButton)),this.template.path){let a=[];o&&(i.linked?a=r.store.getQuads(o,this.template.path,null,null):a=r.store.getQuads(o,this.template.path,null,xi));let l=!1;for(const u of a)this.isValueValid(u.object)&&(this.addPropertyInstance(u.object),this.template.hasValue&&u.object.equals(this.template.hasValue)&&(l=!0));r.editMode&&this.template.hasValue&&!l&&!i.linked&&this.addPropertyInstance(this.template.hasValue)}r.editMode&&!i.linked&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),this.container instanceof Pt&&(r.editMode&&!i.linked||this.container.childElementCount>0)&&this.appendChild(this.container)}addPropertyInstance(e){let i;if(this.template.shaclOr?.length||this.template.shaclXone?.length){const r=this.template.shaclOr?.length?this.template.shaclOr:this.template.shaclXone;let o=!1;if(e){const a=Bg(r,e,this.template.config);a.length&&(i=Ns(this.template.clone().merge(a),e,!0),o=!0)}o||(i=ff(r,this,this.template.config),Df(i,""))}else{let r=!1;if(e&&!(e instanceof ii)){const o=this.getRdfClassToLinkOrCreate();o&&this.template.config.store.countQuads(e,It,o,xi)===0&&(r=!0)}i=Ns(this.template,e,void 0,r||this.template.parent.linked)}return this.addButton?this.container.insertBefore(i,this.addButton):this.container.appendChild(i),i}updateControls(){let e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;e===0&&(!this.template.extendedShapes.length||this.template.minCount!==void 0&&this.template.minCount>0)&&(this.addPropertyInstance(),e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length);let i;this.template.minCount!==void 0?i=e>this.template.minCount:i=this.template.extendedShapes.length>0||e>1;const r=this.template.maxCount===void 0||e<this.template.maxCount;this.classList.toggle("may-remove",i),this.classList.toggle("may-add",r)}toRDF(e,i){for(const r of this.querySelectorAll(":scope > .property-instance, :scope > .collapsible > .property-instance")){const o=ze.namedNode(r.dataset.path);if(r.firstChild instanceof zi){const a=r.firstChild.toRDF(e);e.addQuad(i,o,a,this.template.config.valuesGraphId)}else for(const a of r.querySelectorAll(":scope > .editor")){const l=Xg(a);l&&e.addQuad(i,o,l,this.template.config.valuesGraphId)}}}getRdfClassToLinkOrCreate(){if(this.template.class&&this.template.node)return this.template.class;for(const e of this.template.extendedShapes){const i=this.template.config.store.getObjects(e,Mn,null);if(i.length>0)return i[0]}}isValueValid(e){if(!this.template.extendedShapes.length)return!0;for(const i of this.template.extendedShapes){const r=this.template.config.store.getObjects(i,Mn,null);for(const o of r)if(this.template.config.store.countQuads(e,It,o,null)>0)return!0}return!1}createAddButton(){const e=new vt;e.dense=!0,e.label="+ "+this.template.label,e.title="Add "+this.template.label,e.autoGrowLabelWidth=!0,e.classList.add("add-button");let i=[],r=this.getRdfClassToLinkOrCreate();if(r&&(i=Ml(r,this.template)),i.length===0)e.emptyMessage="",e.inputMinWidth=0,e.addEventListener("click",o=>{e.blur();const a=this.addPropertyInstance();a.classList.add("fadeIn"),this.updateControls(),setTimeout(()=>{jg(a),a.classList.remove("fadeIn")},200)});else{const o=document.createElement("ul"),a=document.createElement("li");a.innerHTML="+ Create new "+this.template.label+"...",a.dataset.value="new",a.classList.add("large"),o.appendChild(a);const l=document.createElement("li");l.classList.add("divider"),o.appendChild(l);const u=document.createElement("li");u.classList.add("header"),u.innerText="Or link existing:",o.appendChild(u);for(const f of i){const d=document.createElement("li"),g=typeof f.value=="string"?f.value:f.value.value;d.innerText=f.label?f.label:g,d.dataset.value=JSON.stringify(f.value),o.appendChild(d)}e.appendChild(o),e.collapsibleWidth="250px",e.collapsibleOrientationLeft="",e.addEventListener("change",()=>{if(e.value==="new")this.addPropertyInstance();else{const f=JSON.parse(e.value);this.container.insertBefore(Ns(this.template,f,!0,!0),e)}e.value=""})}return e}}function Ns(n,e,i=!1,r=!1){let o;if(n.extendedShapes.length){o=document.createElement("div"),o.classList.add("property-instance");for(const a of n.extendedShapes)o.appendChild(new zi(a,n.config,e,n.parent,n.nodeKind,n.label,r))}else{const a=Kg(n.path,n.datatype?.value);a?n.config.editMode&&!r?o=a.createEditor(n,e):o=a.createViewer(n,e):o=Wg(n,e||null,n.config.editMode&&!r),o.classList.add("property-instance"),r&&o.classList.add("linked")}return n.config.editMode&&Df(o,n.label,i),o.dataset.path=n.path,o}function Df(n,e,i=!1){const r=new jn;r.classList.add("remove-button","clear"),r.title="Remove "+e,r.dense=!0,r.icon=!0,r.addEventListener("click",o=>{n.classList.remove("fadeIn"),n.classList.add("fadeOut"),setTimeout(()=>{const a=n.parentElement;n.remove(),a?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),i&&r.classList.add("persistent"),n.appendChild(r)}window.customElements.define("shacl-property",Fs);function s_(n,e){let i=n;const r=e.store.getQuads(n,null,null,null),o=kr(r,"label",Pl,e.languages);o&&(i=o);let a;if(e.attributes.collapse!==null)a=new Pt,a.classList.add("collapsible"),a.open=e.attributes.collapse==="open",a.label=i;else{a=document.createElement("div");const u=document.createElement("h1");u.innerText=i,a.appendChild(u)}a.dataset.subject=n,a.classList.add("shacl-group");const l=kr(r,"order");return l&&(a.style.order=l),a}const St=[];for(let n=0;n<256;++n)St.push((n+256).toString(16).slice(1));function o_(n,e=0){return(St[n[e+0]]+St[n[e+1]]+St[n[e+2]]+St[n[e+3]]+"-"+St[n[e+4]]+St[n[e+5]]+"-"+St[n[e+6]]+St[n[e+7]]+"-"+St[n[e+8]]+St[n[e+9]]+"-"+St[n[e+10]]+St[n[e+11]]+St[n[e+12]]+St[n[e+13]]+St[n[e+14]]+St[n[e+15]]).toLowerCase()}let na;const a_=new Uint8Array(16);function l_(){if(!na){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");na=crypto.getRandomValues.bind(crypto)}return na(a_)}const u_=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Yc={randomUUID:u_};function c_(n,e,i){n=n||{};const r=n.random??n.rng?.()??l_();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,o_(r)}function eh(n,e,i){return Yc.randomUUID&&!n?Yc.randomUUID():c_(n)}class zi extends HTMLElement{constructor(e,i,r,o,a,l,u){super(),this.owlImports=[],this.parent=o,this.config=i,this.shaclSubject=e,this.linked=u||!1;let f=r;if(!f){if(!a){const g=i.store.getObjects(e,`${je}nodeKind`,null);g.length&&(a=g[0])}a===void 0&&i.attributes.valuesNamespace||a?.value===`${je}IRI`?f=ze.namedNode(i.attributes.valuesNamespace+eh()):f=ze.blankNode(eh())}this.nodeId=f;const d=JSON.stringify([e,r]);if(r&&i.renderedNodes.has(d)){l=l||"Link";const g=document.createElement("label");g.innerText=l,g.classList.add("linked"),this.appendChild(g);const _=document.createElement("a");let h=r.termType==="BlankNode"?"_:"+r.value:r.value;_.innerText=h,_.classList.add("ref-link"),_.onclick=()=>{this.config.form.querySelector(`shacl-node[data-node-id='${h}']`)?.scrollIntoView()},this.appendChild(_),this.style.flexDirection="row"}else{if(r&&i.renderedNodes.add(d),this.dataset.nodeId=this.nodeId.id,this.config.attributes.showNodeIds!==null){const g=document.createElement("div");g.innerText=`id: ${this.nodeId.id}`,g.classList.add("node-id-display"),this.appendChild(g)}for(const g of i.store.getQuads(e,Dl,null,null))this.owlImports.push(g.object);for(const g of i.store.getQuads(e,null,null,null))switch(g.predicate.id){case ks.id:this.addPropertyInstance(g.object,i,r);break;case`${je}and`:const _=i.lists[g.object.value];if(_?.length)for(const h of _)this.prepend(new zi(h,i,r,this));else console.error("list not found:",g.object.value,"existing lists:",i.lists);break;case Mg.id:this.prepend(new zi(g.object,i,r,this));break;case`${je}targetClass`:this.targetClass=g.object;break;case`${je}or`:this.tryResolve(g.object,r,i);break;case`${je}xone`:this.tryResolve(g.object,r,i);break}if(l){const g=document.createElement("h1");g.innerText=l,this.prepend(g)}}}toRDF(e,i){if(i||(i=this.nodeId),!this.linked){for(const r of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))r.toRDF(e,i);this.targetClass&&e.addQuad(i,It,this.targetClass,this.config.valuesGraphId),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(i,ze.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraphId)}return i}addPropertyInstance(e,i,r){let o=this;const a=i.store.getQuads(e,`${je}group`,null,null);if(a.length>0){const u=a[0].object.value;if(i.groups.indexOf(u)>-1){let f=this.querySelector(`:scope > .shacl-group[data-subject='${u}']`);f||(f=s_(u,i),this.appendChild(f)),o=f}else console.warn("ignoring unknown group reference",a[0],"existing groups:",i.groups)}const l=new Fs(e,this,i,r);l.childElementCount>0&&o.appendChild(l)}tryResolve(e,i,r){const o=r.lists[e.value];if(o?.length){let a=!1;if(i){const l=qg(o,i,r);if(l.length){for(const u of l)this.addPropertyInstance(u,r,i);a=!0}}a||this.appendChild(ff(o,this,r))}else console.error("list for sh:or/sh:xone not found:",e,"existing lists:",r.lists)}}window.customElements.define("shacl-node",zi);var tn={},nn={},rn={},bi={},th;function h_(){if(th)return bi;th=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.removeDotSegmentsOfPath=bi.removeDotSegments=bi.resolve=void 0;function n(o,a){a=a||"";const l=a.indexOf("#");if(l>0&&(a=a.substr(0,l)),!o.length){if(a.indexOf(":")<0)throw new Error(`Found invalid baseIRI '${a}' for value '${o}'`);return a}if(o.startsWith("?")){const m=a.indexOf("?");return m>0&&(a=a.substr(0,m)),a+o}if(o.startsWith("#"))return a+o;if(!a.length){const m=o.indexOf(":");if(m<0)throw new Error(`Found invalid relative IRI '${o}' for a missing baseIRI`);return i(o,m)}const u=o.indexOf(":");if(u>=0)return i(o,u);const f=a.indexOf(":");if(f<0)throw new Error(`Found invalid baseIRI '${a}' for value '${o}'`);const d=a.substr(0,f+1);if(o.indexOf("//")===0)return d+i(o,u);let g;if(a.indexOf("//",f)===f+1){if(g=a.indexOf("/",f+3),g<0)return a.length>f+3?a+"/"+i(o,u):d+i(o,u)}else if(g=a.indexOf("/",f+1),g<0)return d+i(o,u);if(o.indexOf("/")===0)return a.substr(0,g)+e(o);let _=a.substr(g);const h=_.lastIndexOf("/");return h>=0&&h<_.length-1&&(_=_.substr(0,h+1),o[0]==="."&&o[1]!=="."&&o[1]!=="/"&&o[2]&&(o=o.substr(1))),o=_+o,o=e(o),a.substr(0,g)+o}bi.resolve=n;function e(o){const a=[];let l=0;for(;l<o.length;)switch(o[l]){case"/":if(o[l+1]===".")if(o[l+2]==="."){if(!r(o[l+3])){a.push([]),l++;break}a.pop(),o[l+3]||a.push([]),l+=3}else{if(!r(o[l+2])){a.push([]),l++;break}o[l+2]||a.push([]),l+=2}else a.push([]),l++;break;case"#":case"?":a.length||a.push([]),a[a.length-1].push(o.substr(l)),l=o.length;break;default:a.length||a.push([]),a[a.length-1].push(o[l]),l++;break}return"/"+a.map(u=>u.join("")).join("/")}bi.removeDotSegments=e;function i(o,a){let l=a+1;a>=0?o[a+1]==="/"&&o[a+2]==="/"&&(l=a+3):o[0]==="/"&&o[1]==="/"&&(l=2);const u=o.indexOf("/",l);if(u<0)return o;const f=o.substr(0,u),d=o.substr(u);return f+e(d)}bi.removeDotSegmentsOfPath=i;function r(o){return!o||o==="#"||o==="?"||o==="/"}return bi}var ih;function d_(){return ih||(ih=1,(function(n){var e=rn&&rn.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a),Object.defineProperty(r,l,{enumerable:!0,get:function(){return o[a]}})}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),i=rn&&rn.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),i(h_(),n)})(rn)),rn}var sn={},ra={},nh;function f_(){return nh||(nh=1,(function(n){/**
|
|
312
312
|
* Character classes and associated utilities for the 5th edition of XML 1.0.
|
|
313
313
|
*
|
|
314
314
|
* @author Louis-Dominique Dubeau
|
|
315
315
|
* @license MIT
|
|
316
316
|
* @copyright Louis-Dominique Dubeau
|
|
317
|
-
*/Object.defineProperty(
|
|
318
|
-
\r --�𐀀-`,
|
|
319
|
-
`,
|
|
317
|
+
*/Object.defineProperty(n,"__esModule",{value:!0}),n.CHAR=`
|
|
318
|
+
\r --�𐀀-`,n.S=` \r
|
|
319
|
+
`,n.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",n.NAME_CHAR="-"+n.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",n.CHAR_RE=new RegExp("^["+n.CHAR+"]$","u"),n.S_RE=new RegExp("^["+n.S+"]+$","u"),n.NAME_START_CHAR_RE=new RegExp("^["+n.NAME_START_CHAR+"]$","u"),n.NAME_CHAR_RE=new RegExp("^["+n.NAME_CHAR+"]$","u"),n.NAME_RE=new RegExp("^["+n.NAME_START_CHAR+"]["+n.NAME_CHAR+"]*$","u"),n.NMTOKEN_RE=new RegExp("^["+n.NAME_CHAR+"]+$","u");var e=9,i=10,r=13,o=32;n.S_LIST=[o,i,r,e];function a(d){return d>=o&&d<=55295||d===i||d===r||d===e||d>=57344&&d<=65533||d>=65536&&d<=1114111}n.isChar=a;function l(d){return d===o||d===i||d===r||d===e}n.isS=l;function u(d){return d>=65&&d<=90||d>=97&&d<=122||d===58||d===95||d===8204||d===8205||d>=192&&d<=214||d>=216&&d<=246||d>=248&&d<=767||d>=880&&d<=893||d>=895&&d<=8191||d>=8304&&d<=8591||d>=11264&&d<=12271||d>=12289&&d<=55295||d>=63744&&d<=64975||d>=65008&&d<=65533||d>=65536&&d<=983039}n.isNameStartChar=u;function f(d){return u(d)||d>=48&&d<=57||d===45||d===46||d===183||d>=768&&d<=879||d>=8255&&d<=8256}n.isNameChar=f})(ra)),ra}var sa={},rh;function p_(){return rh||(rh=1,(function(n){/**
|
|
320
320
|
* Character classes and associated utilities for the 2nd edition of XML 1.1.
|
|
321
321
|
*
|
|
322
322
|
* @author Louis-Dominique Dubeau
|
|
323
323
|
* @license MIT
|
|
324
324
|
* @copyright Louis-Dominique Dubeau
|
|
325
|
-
*/Object.defineProperty(
|
|
326
|
-
`,
|
|
325
|
+
*/Object.defineProperty(n,"__esModule",{value:!0}),n.CHAR="--�𐀀-",n.RESTRICTED_CHAR="-\b\v\f---",n.S=` \r
|
|
326
|
+
`,n.NAME_START_CHAR=":A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",n.NAME_CHAR="-"+n.NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",n.CHAR_RE=new RegExp("^["+n.CHAR+"]$","u"),n.RESTRICTED_CHAR_RE=new RegExp("^["+n.RESTRICTED_CHAR+"]$","u"),n.S_RE=new RegExp("^["+n.S+"]+$","u"),n.NAME_START_CHAR_RE=new RegExp("^["+n.NAME_START_CHAR+"]$","u"),n.NAME_CHAR_RE=new RegExp("^["+n.NAME_CHAR+"]$","u"),n.NAME_RE=new RegExp("^["+n.NAME_START_CHAR+"]["+n.NAME_CHAR+"]*$","u"),n.NMTOKEN_RE=new RegExp("^["+n.NAME_CHAR+"]+$","u");var e=9,i=10,r=13,o=32;n.S_LIST=[o,i,r,e];function a(_){return _>=1&&_<=55295||_>=57344&&_<=65533||_>=65536&&_<=1114111}n.isChar=a;function l(_){return _>=1&&_<=8||_===11||_===12||_>=14&&_<=31||_>=127&&_<=132||_>=134&&_<=159}n.isRestrictedChar=l;function u(_){return _===9||_===10||_===13||_>31&&_<127||_===133||_>159&&_<=55295||_>=57344&&_<=65533||_>=65536&&_<=1114111}n.isCharAndNotRestricted=u;function f(_){return _===o||_===i||_===r||_===e}n.isS=f;function d(_){return _>=65&&_<=90||_>=97&&_<=122||_===58||_===95||_===8204||_===8205||_>=192&&_<=214||_>=216&&_<=246||_>=248&&_<=767||_>=880&&_<=893||_>=895&&_<=8191||_>=8304&&_<=8591||_>=11264&&_<=12271||_>=12289&&_<=55295||_>=63744&&_<=64975||_>=65008&&_<=65533||_>=65536&&_<=983039}n.isNameStartChar=d;function g(_){return d(_)||_>=48&&_<=57||_===45||_===46||_===183||_>=768&&_<=879||_>=8255&&_<=8256}n.isNameChar=g})(sa)),sa}var oa={},sh;function g_(){return sh||(sh=1,(function(n){/**
|
|
327
327
|
* Character class utilities for XML NS 1.0 edition 3.
|
|
328
328
|
*
|
|
329
329
|
* @author Louis-Dominique Dubeau
|
|
330
330
|
* @license MIT
|
|
331
331
|
* @copyright Louis-Dominique Dubeau
|
|
332
|
-
*/Object.defineProperty(
|
|
333
|
-
`,
|
|
334
|
-
`,
|
|
335
|
-
`,
|
|
336
|
-
`),
|
|
337
|
-
`),P=this.i;break;case x:ie!==void 0&&(this.text+=ne.slice(P));break e;default:n(Ae)||(we=!0)}}we&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(P,ne){var ie;const{prefix:we,local:Ae}=this.qname(P),Ce={name:P,prefix:we,local:Ae,value:ne};if(this.attribList.push(Ce),(ie=this.attributeHandler)===null||ie===void 0||ie.call(this,Ce),we==="xmlns"){const Ze=ne.trim();this.currentXMLVersion==="1.0"&&Ze===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[Ae]=Ze,Ye(this,Ae,Ze)}else if(P==="xmlns"){const Ze=ne.trim();this.topNS[""]=Ze,Ye(this,"",Ze)}}pushAttribPlain(P,ne){var ie;const we={name:P,value:ne};this.attribList.push(we),(ie=this.attributeHandler)===null||ie===void 0||ie.call(this,we)}end(){var P,ne;this.sawRoot||this.fail("document must contain a root element.");const{tags:ie}=this;for(;ie.length>0;){const Ae=ie.pop();this.fail(`unclosed tag: ${Ae.name}`)}this.state!==m&&this.state!==T&&this.fail("unexpected end.");const{text:we}=this;return we.length!==0&&((P=this.textHandler)===null||P===void 0||P.call(this,we),this.text=""),this._closed=!0,(ne=this.endHandler)===null||ne===void 0||ne.call(this),this._init(),this}resolve(P){var ne,ie;let we=this.topNS[P];if(we!==void 0)return we;const{tags:Ae}=this;for(let Ce=Ae.length-1;Ce>=0;Ce--)if(we=Ae[Ce].ns[P],we!==void 0)return we;return we=this.ns[P],we!==void 0?we:(ie=(ne=this.opt).resolvePrefix)===null||ie===void 0?void 0:ie.call(ne,P)}qname(P){const ne=P.indexOf(":");if(ne===-1)return{prefix:"",local:P};const ie=P.slice(ne+1),we=P.slice(0,ne);return(we===""||ie===""||ie.includes(":"))&&this.fail(`malformed name: ${P}.`),{prefix:we,local:ie}}processAttribsNS(){var P;const{attribList:ne}=this,ie=this.tag;{const{prefix:Ce,local:Ze}=this.qname(ie.name);ie.prefix=Ce,ie.local=Ze;const br=ie.uri=(P=this.resolve(Ce))!==null&&P!==void 0?P:"";Ce!==""&&(Ce==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),br===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(Ce)}.`),ie.uri=Ce))}if(ne.length===0)return;const{attributes:we}=ie,Ae=new Set;for(const Ce of ne){const{name:Ze,prefix:br,local:ad}=Ce;let _r,Ur;br===""?(_r=Ze==="xmlns"?_:"",Ur=Ze):(_r=this.resolve(br),_r===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(br)}.`),_r=br),Ur=`{${_r}}${ad}`),Ae.has(Ur)&&this.fail(`duplicate attribute: ${Ur}.`),Ae.add(Ur),Ce.uri=_r,we[Ze]=Ce}this.attribList=[]}processAttribsPlain(){const{attribList:P}=this,ne=this.tag.attributes;for(const{name:ie,value:we}of P)ne[ie]!==void 0&&this.fail(`duplicate attribute: ${ie}.`),ne[ie]=we;this.attribList=[]}openTag(){var P;this.processAttribs();const{tags:ne}=this,ie=this.tag;ie.isSelfClosing=!1,(P=this.openTagHandler)===null||P===void 0||P.call(this,ie),ne.push(ie),this.state=T,this.name=""}openSelfClosingTag(){var P,ne,ie;this.processAttribs();const{tags:we}=this,Ae=this.tag;Ae.isSelfClosing=!0,(P=this.openTagHandler)===null||P===void 0||P.call(this,Ae),(ne=this.closeTagHandler)===null||ne===void 0||ne.call(this,Ae),(this.tag=(ie=we[we.length-1])!==null&&ie!==void 0?ie:null)===null&&(this.closedRoot=!0),this.state=T,this.name=""}closeTag(){const{tags:P,name:ne}=this;if(this.state=T,this.name="",ne===""){this.fail("weird empty close tag."),this.text+="</>";return}const ie=this.closeTagHandler;let we=P.length;for(;we-- >0;){const Ae=this.tag=P.pop();if(this.topNS=Ae.ns,ie?.(Ae),Ae.name===ne)break;this.fail("unexpected close tag.")}we===0?this.closedRoot=!0:we<0&&(this.fail(`unmatched closing tag: ${ne}.`),this.text+=`</${ne}>`)}parseEntity(P){if(P[0]!=="#"){const ie=this.ENTITIES[P];return ie!==void 0?ie:(this.fail(this.isName(P)?"undefined entity.":"disallowed character in entity name."),`&${P};`)}let ne=NaN;return P[1]==="x"&&/^#x[0-9a-f]+$/i.test(P)?ne=parseInt(P.slice(2),16):/^#[0-9]+$/.test(P)&&(ne=parseInt(P.slice(1),10)),this.isChar(ne)?String.fromCodePoint(ne):(this.fail("malformed character entity."),`&${P};`)}}return tr.SaxesParser=qr,tr}var Kr={},pl;function If(){if(pl)return Kr;pl=1,Object.defineProperty(Kr,"__esModule",{value:!0}),Kr.ParseError=void 0;let r=class extends Error{constructor(t,n){const i=t.saxParser;super(t.trackPosition?`Line ${i.line} column ${i.column+1}: ${n}`:n)}};return Kr.ParseError=r,Kr}var rr={},Yr={},gl;function kc(){if(gl)return Yr;gl=1,Object.defineProperty(Yr,"__esModule",{value:!0}),Yr.BlankNode=void 0;class r{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&t.termType==="BlankNode"&&t.value===this.value}}return Yr.BlankNode=r,Yr}var Zr={},en={},ml;function Pc(){if(ml)return en;ml=1,Object.defineProperty(en,"__esModule",{value:!0}),en.DefaultGraph=void 0;class r{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&t.termType==="DefaultGraph"}}return en.DefaultGraph=r,r.INSTANCE=new r,en}var tn={},rn={},yl;function qa(){if(yl)return rn;yl=1,Object.defineProperty(rn,"__esModule",{value:!0}),rn.NamedNode=void 0;class r{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&t.termType==="NamedNode"&&t.value===this.value}}return rn.NamedNode=r,rn}var bl;function Mc(){if(bl)return tn;bl=1,Object.defineProperty(tn,"__esModule",{value:!0}),tn.Literal=void 0;const r=qa();class e{constructor(n,i){this.termType="Literal",this.value=n,typeof i=="string"?(this.language=i,this.datatype=e.RDF_LANGUAGE_STRING,this.direction=""):i?"termType"in i?(this.language="",this.datatype=i,this.direction=""):(this.language=i.language,this.datatype=i.direction?e.RDF_DIRECTIONAL_LANGUAGE_STRING:e.RDF_LANGUAGE_STRING,this.direction=i.direction||""):(this.language="",this.datatype=e.XSD_STRING,this.direction="")}equals(n){return!!n&&n.termType==="Literal"&&n.value===this.value&&n.language===this.language&&(n.direction===this.direction||!n.direction&&this.direction==="")&&this.datatype.equals(n.datatype)}}return tn.Literal=e,e.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),e.RDF_DIRECTIONAL_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),e.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string"),tn}var nn={},_l;function Bc(){if(_l)return nn;_l=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.Quad=void 0;class r{constructor(t,n,i,s){this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=i,this.graph=s}equals(t){return!!t&&(t.termType==="Quad"||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}}return nn.Quad=r,nn}var sn={},wl;function qc(){if(wl)return sn;wl=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.Variable=void 0;class r{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&t.termType==="Variable"&&t.value===this.value}}return sn.Variable=r,sn}var vl;function Nf(){if(vl)return Zr;vl=1,Object.defineProperty(Zr,"__esModule",{value:!0}),Zr.DataFactory=void 0;const r=kc(),e=Pc(),t=Mc(),n=qa(),i=Bc(),s=qc();let a=0;class o{constructor(l){this.blankNodeCounter=0,l=l||{},this.blankNodePrefix=l.blankNodePrefix||`df_${a++}_`}namedNode(l){return new n.NamedNode(l)}blankNode(l){return new r.BlankNode(l||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(l,c){return new t.Literal(l,c)}variable(l){return new s.Variable(l)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(l,c,d,b){return new i.Quad(l,c,d,b||this.defaultGraph())}fromTerm(l){switch(l.termType){case"NamedNode":return this.namedNode(l.value);case"BlankNode":return this.blankNode(l.value);case"Literal":return l.language?this.literal(l.value,l.language):l.datatype.equals(t.Literal.XSD_STRING)?this.literal(l.value):this.literal(l.value,this.fromTerm(l.datatype));case"Variable":return this.variable(l.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(l.subject),this.fromTerm(l.predicate),this.fromTerm(l.object),this.fromTerm(l.graph))}}fromQuad(l){return this.fromTerm(l)}resetBlankNodeCounter(){this.blankNodeCounter=0}}return Zr.DataFactory=o,Zr}var xl;function Uc(){return xl||(xl=1,(function(r){var e=rr&&rr.__createBinding||(Object.create?(function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}):(function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]})),t=rr&&rr.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(r,"__esModule",{value:!0}),t(kc(),r),t(Nf(),r),t(Pc(),r),t(Mc(),r),t(qa(),r),t(Bc(),r),t(qc(),r)})(rr)),rr}var nr={},ns={},El;function Rf(){return El||(El=1,(function(r){Object.defineProperty(r,"__esModule",{value:!0}),r.validateIri=r.IriValidationStrategy=void 0;function e(){const o="[!$&'()*+,;=]",u="%[a-fA-F0-9]{2}",l="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",c=`${l}\\.${l}\\.${l}\\.${l}`,d="[a-fA-F0-9]{1,4}",b=`(${d}:${d}|${c})`,y=`((${d}:){6}${b}|::(${d}:){5}${b}|(${d})?::(${d}:){4}${b}|((${d}:){0,1}${d})?::(${d}:){3}${b}|((${d}:){0,2}${d})?::(${d}:){2}${b}|((${d}:){0,3}${d})?::${d}:${b}|((${d}:){0,4}${d})?::${b}|((${d}:){0,5}${d})?::${d}|((${d}:){0,6}${d})?::)`,_=`v[a-fA-F0-9]+\\.(${o}|${o}|":)+`,E=`\\[(${y}|${_})\\]`,v="[0-9]*",x="[a-zA-Z][a-zA-Z0-9+\\-.]*",m="[---]",N="[a-zA-Z0-9\\-._~ -豈-﷏ﷰ-𐀀-𠀀-𰀀------------]",C=`(${N}|${u}|${o}|[:@])*`,A=`(${C}|[\\/?])*`,B=`(${C}|${m}|[\\/?])*`,R=`(${C})+`,F=`(${C})*`,q="",D=`${R}(\\/${F})*`,L=`\\/(${R}(\\/${F})*)?`,te=`(\\/${F})*`,T=`(${N}|${u}|${o})*`,Z=`(${E}|${c}|${T})`,w=`(\\/\\/${`(${`(${N}|${u}|${o}|:)*`}@)?${Z}(:${v})?`}${te}|${L}|${D}|${q})`,H=`^${x}:${w}(\\?${B})?(#${A})?$`;return new RegExp(H,"u")}const t=e(),n=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var i;(function(a){a.Strict="strict",a.Pragmatic="pragmatic",a.None="none"})(i=r.IriValidationStrategy||(r.IriValidationStrategy={}));function s(a,o=i.Strict){switch(o){case i.Strict:return t.test(a)?void 0:new Error(`Invalid IRI according to RFC 3987: '${a}'`);case i.Pragmatic:return n.test(a)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${a}'`);case i.None:return;default:return new Error(`Not supported validation strategy "${o}"`)}}r.validateIri=s})(ns)),ns}var Sl;function Tf(){return Sl||(Sl=1,(function(r){var e=nr&&nr.__createBinding||(Object.create?(function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}):(function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]})),t=nr&&nr.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(r,"__esModule",{value:!0}),t(Rf(),r)})(nr)),nr}var Il;function Af(){if(Il)return Zt;Il=1,Object.defineProperty(Zt,"__esModule",{value:!0}),Zt.ParseType=Zt.RdfXmlParser=void 0;const r=wf(),e=Sf(),t=dc(),n=If(),i=Uc(),s=Tf();let a=class $e extends t.Transform{constructor(l){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},l&&(Object.assign(this,l),this.options=l),this.dataFactory||(this.dataFactory=new i.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.validateUri!==!1&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?s.IriValidationStrategy.Pragmatic:s.IriValidationStrategy.None),this.saxParser=new e.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(l){const c=new t.PassThrough({readableObjectMode:!0});l.on("error",b=>d.emit("error",b)),l.on("data",b=>c.push(b)),l.on("end",()=>c.push(null));const d=c.pipe(new $e(this.options));return d}_transform(l,c,d){try{this.saxParser.write(l)}catch(b){return d(b)}d()}newParseError(l){return new n.ParseError(this,l)}valueToUri(l,c){return this.uriToNamedNode((0,r.resolve)(l,c.baseIRI))}uriToNamedNode(l){const c=(0,s.validateIri)(l,this.iriValidationStrategy);if(c instanceof Error)throw this.newParseError(c.message);return this.dataFactory.namedNode(l)}validateNcname(l){if(!$e.NCNAME_MATCHER.test(l))throw this.newParseError(`Not a valid NCName: ${l}`)}createLiteral(l,c){return this.dataFactory.literal(l,c.datatype?c.datatype:c.language?{language:c.language,direction:c.rdfVersion?c.direction:void 0}:void 0)}attachSaxListeners(){this.saxParser.on("error",l=>this.emit("error",l)),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(l){const c=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let d=o.RESOURCE;if(c&&(c.hadChildren=!0,d=c.childrenParseType),c&&c.childrenStringTags){const y=l.name;let _="";for(const{key:S,value:m}of c.namespaces||[])_+=` ${S}="${m}"`;for(const S in l.attributes)_+=` ${S}="${l.attributes[S].value}"`;const v=`<${`${y}${_}`}>`;c.childrenStringTags.push(v);const x={childrenStringTags:c.childrenStringTags};x.childrenStringEmitClosingTag=`</${y}>`,this.activeTagStack.push(x);return}const b={};c?(b.language=c.language,b.direction=c.direction,b.baseIRI=c.baseIRI,b.childrenTripleTerms=c.childrenTripleTerms,b.rdfVersion=c.rdfVersion):b.baseIRI=this.baseIRI,this.activeTagStack.push(b),d===o.RESOURCE?this.onTagResource(l,b,c,!c):this.onTagProperty(l,b,c);for(const y in l.attributes){const _=l.attributes[y];_.prefix==="xmlns"&&(b.namespaces||(b.namespaces=[]),b.namespaces.push({key:`${_.prefix}:${_.local}`,value:_.value}))}c&&c.namespaces&&(b.namespaces=[...b.namespaces||[],...c.namespaces])}onTagResource(l,c,d,b){c.childrenParseType=o.PROPERTY;let y=!0;if(l.uri===$e.RDF){if(!b&&$e.FORBIDDEN_NODE_ELEMENTS.indexOf(l.local)>=0)throw this.newParseError(`Illegal node element name: ${l.local}`);switch(l.local){case"RDF":c.childrenParseType=o.RESOURCE;case"Description":y=!1}}const _=[],E=[];let v=null,x=!1,S=!1,m=null;for(const h in l.attributes){const g=l.attributes[h];if(g.uri===$e.RDF&&g.local==="version"){this.setVersion(c,g.value);continue}else if(d&&g.uri===$e.RDF)switch(g.local){case"about":if(v)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${g.value} and ${v} where found.`);v=g.value;continue;case"ID":if(v)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${g.value} and ${v} where found.`);this.validateNcname(g.value),v="#"+g.value,x=!0;continue;case"nodeID":if(v)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${g.value} and ${v} where found.`);this.validateNcname(g.value),v=g.value,S=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":m=g.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(g.uri===$e.XML){if(g.local==="lang"){c.language=g.value===""?null:g.value.toLowerCase();continue}else if(g.local==="base"){c.baseIRI=(0,r.resolve)(g.value,c.baseIRI);continue}}else if(g.uri===$e.ITS&&g.local==="dir"){this.setDirection(c,g.value);continue}g.prefix!=="xml"&&g.prefix!=="xmlns"&&(g.prefix!==""||g.local!=="xmlns")&&g.uri&&(_.push(this.uriToNamedNode(g.uri+g.local)),E.push(g.value))}if(v!==null&&(c.subject=S?this.dataFactory.blankNode(v):this.valueToUri(v,c),x&&this.claimNodeId(c.subject)),c.subject||(c.subject=this.dataFactory.blankNode()),y){const h=this.uriToNamedNode(l.uri+l.local);this.emitTriple(c.subject,this.dataFactory.namedNode($e.RDF+"type"),h,d?d.reifiedStatementId:null,c.childrenTripleTerms,c.reifier)}if(d){if(d.predicate)if(d.childrenCollectionSubject){const h=this.dataFactory.blankNode(),g=this.dataFactory.namedNode($e.RDF+"rest"),N=d.childrenCollectionPredicate.equals(g);this.emitTriple(d.childrenCollectionSubject,d.childrenCollectionPredicate,h,N?null:d.reifiedStatementId,d.childrenTripleTerms,N?null:d.reifier),this.emitTriple(h,this.dataFactory.namedNode($e.RDF+"first"),c.subject,null,c.childrenTripleTerms),d.childrenCollectionSubject=h,d.childrenCollectionPredicate=g}else{d.childrenTagsToTripleTerms||(this.emitTriple(d.subject,d.predicate,c.subject,d.reifiedStatementId,d.childrenTripleTerms,d.reifier),d.predicateEmitted=!0);for(let h=0;h<d.predicateSubPredicates.length;h++)this.emitTriple(c.subject,d.predicateSubPredicates[h],d.predicateSubObjects[h],null,d.childrenTripleTerms,d.reifier);d.predicateSubPredicates=[],d.predicateSubObjects=[]}for(let h=0;h<_.length;h++){const g=this.createLiteral(E[h],c);this.emitTriple(c.subject,_[h],g,d.reifiedStatementId,d.childrenTripleTerms,d.reifier)}m&&this.emitTriple(c.subject,this.dataFactory.namedNode($e.RDF+"type"),this.uriToNamedNode(m),null,c.childrenTripleTerms,c.reifier)}}onTagProperty(l,c,d){if(c.childrenParseType=o.RESOURCE,c.subject=d.subject,l.uri===$e.RDF&&l.local==="li"?(d.listItemCounter||(d.listItemCounter=1),c.predicate=this.uriToNamedNode(l.uri+"_"+d.listItemCounter++)):c.predicate=this.uriToNamedNode(l.uri+l.local),l.uri===$e.RDF&&$e.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(l.local)>=0)throw this.newParseError(`Illegal property element name: ${l.local}`);c.predicateSubPredicates=[],c.predicateSubObjects=[];let b=!1,y=!1,_=null,E=!0;const v=[],x=[];for(const S in l.attributes){const m=l.attributes[S];if(m.uri===$e.RDF&&m.local==="version"){this.setVersion(c,m.value);continue}else if(m.uri===$e.RDF)switch(m.local){case"resource":if(_)throw this.newParseError(`Found both rdf:resource (${m.value}) and rdf:nodeID (${_}).`);if(b)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${m.value})`);c.hadChildren=!0,_=m.value,E=!1;continue;case"datatype":if(y)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${m.value}).`);if(b)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${m.value})`);c.datatype=this.valueToUri(m.value,c);continue;case"nodeID":if(y)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${m.value}).`);if(c.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${m.value}).`);if(b)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${m.value})`);this.validateNcname(m.value),c.hadChildren=!0,_=m.value,E=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(y)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(c.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${c.datatype.value})`);if(_)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${_})`);if(m.value==="Resource"){b=!0,c.childrenParseType=o.PROPERTY;const h=this.dataFactory.blankNode();this.emitTriple(c.subject,c.predicate,h,c.reifiedStatementId,c.childrenTripleTerms,c.reifier),c.subject=h,c.predicate=null}else m.value==="Collection"?(b=!0,c.hadChildren=!0,c.childrenCollectionSubject=c.subject,c.childrenCollectionPredicate=c.predicate,E=!1):m.value==="Literal"?(b=!0,c.childrenTagsToString=!0,c.childrenStringTags=[]):m.value==="Triple"&&(b=!0,c.childrenTagsToTripleTerms=!0,c.childrenTripleTerms=[]);continue;case"ID":this.validateNcname(m.value),c.reifiedStatementId=this.valueToUri("#"+m.value,c),this.claimNodeId(c.reifiedStatementId);continue;case"annotation":c.reifier=this.dataFactory.namedNode(m.value);continue;case"annotationNodeID":c.reifier=this.dataFactory.blankNode(m.value);continue}else if(m.uri===$e.XML&&m.local==="lang"){c.language=m.value===""?null:m.value.toLowerCase();continue}else if(m.uri===$e.ITS&&m.local==="dir"){this.setDirection(c,m.value);continue}else if(m.uri===$e.ITS&&m.local==="version")continue;if(m.prefix!=="xml"&&m.prefix!=="xmlns"&&(m.prefix!==""||m.local!=="xmlns")&&m.uri){if(b||c.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${m.value}`);c.hadChildren=!0,y=!0,v.push(this.uriToNamedNode(m.uri+m.local)),x.push(this.createLiteral(m.value,c))}}if(_!==null){const S=c.subject;c.subject=E?this.dataFactory.blankNode(_):this.valueToUri(_,c),this.emitTriple(S,c.predicate,c.subject,c.reifiedStatementId,c.childrenTripleTerms,c.reifier);for(let m=0;m<v.length;m++)this.emitTriple(c.subject,v[m],x[m],null,c.childrenTripleTerms,c.reifier);c.predicateEmitted=!0}else E&&(c.predicateSubPredicates=v,c.predicateSubObjects=x,c.predicateEmitted=!1)}emitTriple(l,c,d,b,y,_){const E=this.dataFactory.quad(l,c,d,this.defaultGraph);y?y.push(E):this.push(E),_&&this.push(this.dataFactory.quad(_,this.dataFactory.namedNode($e.RDF+"reifies"),E)),b&&(this.push(this.dataFactory.quad(b,this.dataFactory.namedNode($e.RDF+"type"),this.dataFactory.namedNode($e.RDF+"Statement"),this.defaultGraph)),this.push(this.dataFactory.quad(b,this.dataFactory.namedNode($e.RDF+"subject"),l,this.defaultGraph)),this.push(this.dataFactory.quad(b,this.dataFactory.namedNode($e.RDF+"predicate"),c,this.defaultGraph)),this.push(this.dataFactory.quad(b,this.dataFactory.namedNode($e.RDF+"object"),d,this.defaultGraph)))}claimNodeId(l){if(!this.allowDuplicateRdfIds){if(this.nodeIds[l.value])throw this.newParseError(`Found multiple occurrences of rdf:ID='${l.value}'.`);this.nodeIds[l.value]=!0}}onText(l){const c=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;c&&(c.childrenStringTags?c.childrenStringTags.push(l):c.predicate&&(c.text=l))}onCloseTag(){const l=this.activeTagStack.pop(),c=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;if(l.childrenStringEmitClosingTag&&l.childrenStringTags.push(l.childrenStringEmitClosingTag),l.childrenTagsToString&&(l.datatype=this.dataFactory.namedNode($e.RDF+"XMLLiteral"),l.text=l.childrenStringTags.join(""),l.hadChildren=!1),l.childrenTagsToTripleTerms&&l.predicate&&l.rdfVersion){if(l.childrenTripleTerms.length!==1)throw this.newParseError(`Expected exactly one triple term in rdf:parseType="Triple" but got ${l.childrenTripleTerms.length}`);for(const d of l.childrenTripleTerms)this.emitTriple(l.subject,l.predicate,d,null,c.childrenTripleTerms,c.reifier);l.predicateEmitted=!0}if(l.childrenCollectionSubject)this.emitTriple(l.childrenCollectionSubject,l.childrenCollectionPredicate,this.dataFactory.namedNode($e.RDF+"nil"),null,l.childrenTripleTerms);else if(l.predicate){if(!l.hadChildren&&l.childrenParseType!==o.PROPERTY)this.emitTriple(l.subject,l.predicate,this.createLiteral(l.text||"",l),l.reifiedStatementId,l.childrenTripleTerms,l.reifier);else if(!l.predicateEmitted){const d=this.dataFactory.blankNode();this.emitTriple(l.subject,l.predicate,d,l.reifiedStatementId,l.childrenTripleTerms,l.reifier);for(let b=0;b<l.predicateSubPredicates.length;b++)this.emitTriple(d,l.predicateSubPredicates[b],l.predicateSubObjects[b],null,l.childrenTripleTerms)}}}onDoctype(l){l.replace(/<!ENTITY\s+([^\s]+)\s+["']([^"']+)["']\s*>/g,(c,d,b)=>(this.saxParser.ENTITIES[d]=b,""))}setDirection(l,c){if(c){if(c!=="ltr"&&c!=="rtl")throw this.newParseError(`Base directions must either be 'ltr' or 'rtl', while '${c}' was found.`);l.direction=c}else delete l.direction}setVersion(l,c){l.rdfVersion=c,this.emit("version",c)}};Zt.RdfXmlParser=a,a.MIME_TYPE="application/rdf+xml",a.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",a.XML="http://www.w3.org/XML/1998/namespace",a.ITS="http://www.w3.org/2005/11/its",a.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],a.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],a.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u;var o;return(function(u){u[u.RESOURCE=0]="RESOURCE",u[u.PROPERTY=1]="PROPERTY"})(o||(Zt.ParseType=o={})),Zt}var Nl;function Df(){return Nl||(Nl=1,(function(r){var e=Yt&&Yt.__createBinding||(Object.create?(function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}):(function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]})),t=Yt&&Yt.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(r,"__esModule",{value:!0}),t(Af(),r)})(Yt)),Yt}var Lf=Df(),is={},ss,Rl;function Ua(){return Rl||(Rl=1,ss=class Hc{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:e,_existing:t,counter:n}=this;return new Hc(e,new Map(t),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}),ss}var as={},Tl;function Of(){return Tl||(Tl=1,(function(r,e){if(r.setImmediate)return;var t=1,n={},i=!1,s=r.document,a;function o(S){typeof S!="function"&&(S=new Function(""+S));for(var m=new Array(arguments.length-1),h=0;h<m.length;h++)m[h]=arguments[h+1];var g={callback:S,args:m};return n[t]=g,a(t),t++}function u(S){delete n[S]}function l(S){var m=S.callback,h=S.args;switch(h.length){case 0:m();break;case 1:m(h[0]);break;case 2:m(h[0],h[1]);break;case 3:m(h[0],h[1],h[2]);break;default:m.apply(e,h);break}}function c(S){if(i)setTimeout(c,0,S);else{var m=n[S];if(m){i=!0;try{l(m)}finally{u(S),i=!1}}}}function d(){a=function(S){process.nextTick(function(){c(S)})}}function b(){if(r.postMessage&&!r.importScripts){var S=!0,m=r.onmessage;return r.onmessage=function(){S=!1},r.postMessage("","*"),r.onmessage=m,S}}function y(){var S="setImmediate$"+Math.random()+"$",m=function(h){h.source===r&&typeof h.data=="string"&&h.data.indexOf(S)===0&&c(+h.data.slice(S.length))};r.addEventListener?r.addEventListener("message",m,!1):r.attachEvent("onmessage",m),a=function(h){r.postMessage(S+h,"*")}}function _(){var S=new MessageChannel;S.port1.onmessage=function(m){var h=m.data;c(h)},a=function(m){S.port2.postMessage(m)}}function E(){var S=s.documentElement;a=function(m){var h=s.createElement("script");h.onreadystatechange=function(){c(m),h.onreadystatechange=null,S.removeChild(h),h=null},S.appendChild(h)}}function v(){a=function(S){setTimeout(c,0,S)}}var x=Object.getPrototypeOf&&Object.getPrototypeOf(r);x=x&&x.setTimeout?x:r,{}.toString.call(r.process)==="[object process]"?d():b()?y():r.MessageChannel?_():s&&"onreadystatechange"in s.createElement("script")?E():v(),x.setImmediate=o,x.clearImmediate=u})(typeof self>"u"?typeof Sr>"u"?as:Sr:self)),as}/*!
|
|
332
|
+
*/Object.defineProperty(n,"__esModule",{value:!0}),n.NC_NAME_START_CHAR="A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-",n.NC_NAME_CHAR="-"+n.NC_NAME_START_CHAR+".0-9·̀-ͯ‿-⁀",n.NC_NAME_START_CHAR_RE=new RegExp("^["+n.NC_NAME_START_CHAR+"]$","u"),n.NC_NAME_CHAR_RE=new RegExp("^["+n.NC_NAME_CHAR+"]$","u"),n.NC_NAME_RE=new RegExp("^["+n.NC_NAME_START_CHAR+"]["+n.NC_NAME_CHAR+"]*$","u");function e(r){return r>=65&&r<=90||r===95||r>=97&&r<=122||r>=192&&r<=214||r>=216&&r<=246||r>=248&&r<=767||r>=880&&r<=893||r>=895&&r<=8191||r>=8204&&r<=8205||r>=8304&&r<=8591||r>=11264&&r<=12271||r>=12289&&r<=55295||r>=63744&&r<=64975||r>=65008&&r<=65533||r>=65536&&r<=983039}n.isNCNameStartChar=e;function i(r){return e(r)||r===45||r===46||r>=48&&r<=57||r===183||r>=768&&r<=879||r>=8255&&r<=8256}n.isNCNameChar=i})(oa)),oa}var oh;function m_(){if(oh)return sn;oh=1,Object.defineProperty(sn,"__esModule",{value:!0}),sn.SaxesParser=sn.EVENTS=void 0;const n=f_(),e=p_(),i=g_();var r=n.isS,o=n.isChar,a=n.isNameStartChar,l=n.isNameChar,u=n.S_LIST,f=n.NAME_RE,d=e.isChar,g=i.isNCNameStartChar,_=i.isNCNameChar,h=i.NC_NAME_RE;const m="http://www.w3.org/XML/1998/namespace",b="http://www.w3.org/2000/xmlns/",T={__proto__:null,xml:m,xmlns:b},A={__proto__:null,amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},N=-1,R=-2,S=0,y=1,x=2,P=3,B=4,O=5,J=6,k=7,q=8,X=9,F=10,$=11,ue=12,D=13,se=14,j=15,ae=16,I=17,Z=18,ne=19,ee=20,_e=21,G=22,W=23,Y=24,K=25,oe=26,ce=27,Ee=28,Te=29,z=30,te=31,fe=32,we=33,Se=34,Ie=35,re=36,ve=37,Ne=38,xe=39,ke=40,lt=41,We=42,nt=43,M=44,v=9,w=10,H=13,le=32,pe=33,be=34,Oe=38,Ye=39,Je=45,Ge=47,Ze=59,Ot=60,Jt=61,ot=62,ut=63,vn=91,ai=93,Ri=133,Wi=8232,U=rt=>rt===be||rt===Ye,Q=[be,Ye],Ae=[...Q,vn,ot],Re=[...Q,Ot,ai],Me=[Jt,ut,...u],mt=[...u,ot,Oe,Ot];function bt(rt,V,he){switch(V){case"xml":he!==m&&rt.fail(`xml prefix must be bound to ${m}.`);break;case"xmlns":he!==b&&rt.fail(`xmlns prefix must be bound to ${b}.`);break}switch(he){case b:rt.fail(V===""?`the default namespace may not be set to ${he}.`:`may not assign a prefix (even "xmlns") to the URI ${b}.`);break;case m:switch(V){case"xml":break;case"":rt.fail(`the default namespace may not be set to ${he}.`);break;default:rt.fail("may not assign the xml namespace to another prefix.")}break}}function Nt(rt,V){for(const he of Object.keys(V))bt(rt,he,V[he])}const De=rt=>h.test(rt),Gi=rt=>f.test(rt),zt=0,Pi=1,gi=2;sn.EVENTS=["xmldecl","text","processinginstruction","doctype","comment","opentagstart","attribute","opentag","closetag","cdata","error","end","ready"];const li={xmldecl:"xmldeclHandler",text:"textHandler",processinginstruction:"piHandler",doctype:"doctypeHandler",comment:"commentHandler",opentagstart:"openTagStartHandler",attribute:"attributeHandler",opentag:"openTagHandler",closetag:"closeTagHandler",cdata:"cdataHandler",error:"errorHandler",end:"endHandler",ready:"readyHandler"};class Ci{get closed(){return this._closed}constructor(V){this.opt=V??{},this.fragmentOpt=!!this.opt.fragment;const he=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,he){this.nameStartCheck=g,this.nameCheck=_,this.isName=De,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},T);const ge=this.opt.additionalNamespaces;ge!=null&&(Nt(this,ge),Object.assign(this.ns,ge))}else this.nameStartCheck=a,this.nameCheck=l,this.isName=Gi,this.processAttribs=this.processAttribsPlain,this.pushAttrib=this.pushAttribPlain;this.stateTable=[this.sBegin,this.sBeginWhitespace,this.sDoctype,this.sDoctypeQuote,this.sDTD,this.sDTDQuoted,this.sDTDOpenWaka,this.sDTDOpenWakaBang,this.sDTDComment,this.sDTDCommentEnding,this.sDTDCommentEnded,this.sDTDPI,this.sDTDPIEnding,this.sText,this.sEntity,this.sOpenWaka,this.sOpenWakaBang,this.sComment,this.sCommentEnding,this.sCommentEnded,this.sCData,this.sCDataEnding,this.sCDataEnding2,this.sPIFirstChar,this.sPIRest,this.sPIBody,this.sPIEnding,this.sXMLDeclNameStart,this.sXMLDeclName,this.sXMLDeclEq,this.sXMLDeclValueStart,this.sXMLDeclValue,this.sXMLDeclSeparator,this.sXMLDeclEnding,this.sOpenTag,this.sOpenTagSlash,this.sAttrib,this.sAttribName,this.sAttribNameSawWhite,this.sAttribValue,this.sAttribValueQuoted,this.sAttribValueClosed,this.sAttribValueUnquoted,this.sCloseTag,this.sCloseTagSawWhite],this._init()}_init(){var V;this.openWakaBang="",this.text="",this.name="",this.piTarget="",this.entity="",this.q=null,this.tags=[],this.tag=null,this.topNS=null,this.chunk="",this.chunkPosition=0,this.i=0,this.prevI=0,this.carriedFromPrevious=void 0,this.forbiddenState=zt,this.attribList=[];const{fragmentOpt:he}=this;this.state=he?D:S,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=he,this.xmlDeclPossible=!he,this.xmlDeclExpects=["version"],this.entityReturnState=void 0;let{defaultXMLVersion:ge}=this.opt;if(ge===void 0){if(this.opt.forceXMLVersion===!0)throw new Error("forceXMLVersion set but defaultXMLVersion is not set");ge="1.0"}this.setXMLVersion(ge),this.positionAtNewLine=0,this.doctype=!1,this._closed=!1,this.xmlDecl={version:void 0,encoding:void 0,standalone:void 0},this.line=1,this.column=0,this.ENTITIES=Object.create(A),(V=this.readyHandler)===null||V===void 0||V.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(V,he){this[li[V]]=he}off(V){this[li[V]]=void 0}makeError(V){var he;let ge=(he=this.fileName)!==null&&he!==void 0?he:"";return this.trackPosition&&(ge.length>0&&(ge+=":"),ge+=`${this.line}:${this.column}`),ge.length>0&&(ge+=": "),new Error(ge+V)}fail(V){const he=this.makeError(V),ge=this.errorHandler;if(ge===void 0)throw he;return ge(he),this}write(V){if(this.closed)return this.fail("cannot write after close; assign an onready handler.");let he=!1;V===null?(he=!0,V=""):typeof V=="object"&&(V=V.toString()),this.carriedFromPrevious!==void 0&&(V=`${this.carriedFromPrevious}${V}`,this.carriedFromPrevious=void 0);let ge=V.length;const Ce=V.charCodeAt(ge-1);!he&&(Ce===H||Ce>=55296&&Ce<=56319)&&(this.carriedFromPrevious=V[ge-1],ge--,V=V.slice(0,ge));const{stateTable:Ue}=this;for(this.chunk=V,this.i=0;this.i<ge;)Ue[this.state].call(this);return this.chunkPosition+=ge,he?this.end():this}close(){return this.write(null)}getCode10(){const{chunk:V,i:he}=this;if(this.prevI=he,this.i=he+1,he>=V.length)return N;const ge=V.charCodeAt(he);if(this.column++,ge<55296){if(ge>=le||ge===v)return ge;switch(ge){case w:return this.line++,this.column=0,this.positionAtNewLine=this.position,w;case H:return V.charCodeAt(he+1)===w&&(this.i=he+2),this.line++,this.column=0,this.positionAtNewLine=this.position,R;default:return this.fail("disallowed character."),ge}}if(ge>56319)return ge>=57344&&ge<=65533||this.fail("disallowed character."),ge;const Ce=65536+(ge-55296)*1024+(V.charCodeAt(he+1)-56320);return this.i=he+2,Ce>1114111&&this.fail("disallowed character."),Ce}getCode11(){const{chunk:V,i:he}=this;if(this.prevI=he,this.i=he+1,he>=V.length)return N;const ge=V.charCodeAt(he);if(this.column++,ge<55296){if(ge>31&&ge<127||ge>159&&ge!==Wi||ge===v)return ge;switch(ge){case w:return this.line++,this.column=0,this.positionAtNewLine=this.position,w;case H:{const Ue=V.charCodeAt(he+1);(Ue===w||Ue===Ri)&&(this.i=he+2)}case Ri:case Wi:return this.line++,this.column=0,this.positionAtNewLine=this.position,R;default:return this.fail("disallowed character."),ge}}if(ge>56319)return ge>=57344&&ge<=65533||this.fail("disallowed character."),ge;const Ce=65536+(ge-55296)*1024+(V.charCodeAt(he+1)-56320);return this.i=he+2,Ce>1114111&&this.fail("disallowed character."),Ce}getCodeNorm(){const V=this.getCode();return V===R?w:V}unget(){this.i=this.prevI,this.column--}captureTo(V){let{i:he}=this;const{chunk:ge}=this;for(;;){const Ce=this.getCode(),Ue=Ce===R,Qe=Ue?w:Ce;if(Qe===N||V.includes(Qe))return this.text+=ge.slice(he,this.prevI),Qe;Ue&&(this.text+=`${ge.slice(he,this.prevI)}
|
|
333
|
+
`,he=this.i)}}captureToChar(V){let{i:he}=this;const{chunk:ge}=this;for(;;){let Ce=this.getCode();switch(Ce){case R:this.text+=`${ge.slice(he,this.prevI)}
|
|
334
|
+
`,he=this.i,Ce=w;break;case N:return this.text+=ge.slice(he),!1}if(Ce===V)return this.text+=ge.slice(he,this.prevI),!0}}captureNameChars(){const{chunk:V,i:he}=this;for(;;){const ge=this.getCode();if(ge===N)return this.name+=V.slice(he),N;if(!l(ge))return this.name+=V.slice(he,this.prevI),ge===R?w:ge}}skipSpaces(){for(;;){const V=this.getCodeNorm();if(V===N||!r(V))return V}}setXMLVersion(V){this.currentXMLVersion=V,V==="1.0"?(this.isChar=o,this.getCode=this.getCode10):(this.isChar=d,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=y}sBeginWhitespace(){const V=this.i,he=this.skipSpaces();switch(this.prevI!==V&&(this.xmlDeclPossible=!1),he){case Ot:if(this.state=j,this.text.length!==0)throw new Error("no-empty text at start");break;case N:break;default:this.unget(),this.state=D,this.xmlDeclPossible=!1}}sDoctype(){var V;const he=this.captureTo(Ae);switch(he){case ot:{(V=this.doctypeHandler)===null||V===void 0||V.call(this,this.text),this.text="",this.state=D,this.doctype=!0;break}case N:break;default:this.text+=String.fromCodePoint(he),he===vn?this.state=B:U(he)&&(this.state=P,this.q=he)}}sDoctypeQuote(){const V=this.q;this.captureToChar(V)&&(this.text+=String.fromCodePoint(V),this.q=null,this.state=x)}sDTD(){const V=this.captureTo(Re);V!==N&&(this.text+=String.fromCodePoint(V),V===ai?this.state=x:V===Ot?this.state=J:U(V)&&(this.state=O,this.q=V))}sDTDQuoted(){const V=this.q;this.captureToChar(V)&&(this.text+=String.fromCodePoint(V),this.state=B,this.q=null)}sDTDOpenWaka(){const V=this.getCodeNorm();switch(this.text+=String.fromCodePoint(V),V){case pe:this.state=k,this.openWakaBang="";break;case ut:this.state=$;break;default:this.state=B}}sDTDOpenWakaBang(){const V=String.fromCodePoint(this.getCodeNorm()),he=this.openWakaBang+=V;this.text+=V,he!=="-"&&(this.state=he==="--"?q:B,this.openWakaBang="")}sDTDComment(){this.captureToChar(Je)&&(this.text+="-",this.state=X)}sDTDCommentEnding(){const V=this.getCodeNorm();this.text+=String.fromCodePoint(V),this.state=V===Je?F:q}sDTDCommentEnded(){const V=this.getCodeNorm();this.text+=String.fromCodePoint(V),V===ot?this.state=B:(this.fail("malformed comment."),this.state=q)}sDTDPI(){this.captureToChar(ut)&&(this.text+="?",this.state=ue)}sDTDPIEnding(){const V=this.getCodeNorm();this.text+=String.fromCodePoint(V),V===ot&&(this.state=B)}sText(){this.tags.length!==0?this.handleTextInRoot():this.handleTextOutsideRoot()}sEntity(){let{i:V}=this;const{chunk:he}=this;e:for(;;)switch(this.getCode()){case R:this.entity+=`${he.slice(V,this.prevI)}
|
|
335
|
+
`,V=this.i;break;case Ze:{const{entityReturnState:ge}=this,Ce=this.entity+he.slice(V,this.prevI);this.state=ge;let Ue;Ce===""?(this.fail("empty entity name."),Ue="&;"):(Ue=this.parseEntity(Ce),this.entity=""),(ge!==D||this.textHandler!==void 0)&&(this.text+=Ue);break e}case N:this.entity+=he.slice(V);break e}}sOpenWaka(){const V=this.getCode();if(a(V))this.state=Se,this.unget(),this.xmlDeclPossible=!1;else switch(V){case Ge:this.state=nt,this.xmlDeclPossible=!1;break;case pe:this.state=ae,this.openWakaBang="",this.xmlDeclPossible=!1;break;case ut:this.state=W;break;default:this.fail("disallowed character in tag name"),this.state=D,this.xmlDeclPossible=!1}}sOpenWakaBang(){switch(this.openWakaBang+=String.fromCodePoint(this.getCodeNorm()),this.openWakaBang){case"[CDATA[":!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0),this.state=ee,this.openWakaBang="";break;case"--":this.state=I,this.openWakaBang="";break;case"DOCTYPE":this.state=x,(this.doctype||this.sawRoot)&&this.fail("inappropriately located doctype declaration."),this.openWakaBang="";break;default:this.openWakaBang.length>=7&&this.fail("incorrect syntax.")}}sComment(){this.captureToChar(Je)&&(this.state=Z)}sCommentEnding(){var V;const he=this.getCodeNorm();he===Je?(this.state=ne,(V=this.commentHandler)===null||V===void 0||V.call(this,this.text),this.text=""):(this.text+=`-${String.fromCodePoint(he)}`,this.state=I)}sCommentEnded(){const V=this.getCodeNorm();V!==ot?(this.fail("malformed comment."),this.text+=`--${String.fromCodePoint(V)}`,this.state=I):this.state=D}sCData(){this.captureToChar(ai)&&(this.state=_e)}sCDataEnding(){const V=this.getCodeNorm();V===ai?this.state=G:(this.text+=`]${String.fromCodePoint(V)}`,this.state=ee)}sCDataEnding2(){var V;const he=this.getCodeNorm();switch(he){case ot:{(V=this.cdataHandler)===null||V===void 0||V.call(this,this.text),this.text="",this.state=D;break}case ai:this.text+="]";break;default:this.text+=`]]${String.fromCodePoint(he)}`,this.state=ee}}sPIFirstChar(){const V=this.getCodeNorm();this.nameStartCheck(V)?(this.piTarget+=String.fromCodePoint(V),this.state=Y):V===ut||r(V)?(this.fail("processing instruction without a target."),this.state=V===ut?oe:K):(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(V),this.state=Y)}sPIRest(){const{chunk:V,i:he}=this;for(;;){const ge=this.getCodeNorm();if(ge===N){this.piTarget+=V.slice(he);return}if(!this.nameCheck(ge)){this.piTarget+=V.slice(he,this.prevI);const Ce=ge===ut;Ce||r(ge)?this.piTarget==="xml"?(this.xmlDeclPossible||this.fail("an XML declaration must be at the start of the document."),this.state=Ce?we:ce):this.state=Ce?oe:K:(this.fail("disallowed character in processing instruction name."),this.piTarget+=String.fromCodePoint(ge));break}}}sPIBody(){if(this.text.length===0){const V=this.getCodeNorm();V===ut?this.state=oe:r(V)||(this.text=String.fromCodePoint(V))}else this.captureToChar(ut)&&(this.state=oe)}sPIEnding(){var V;const he=this.getCodeNorm();if(he===ot){const{piTarget:ge}=this;ge.toLowerCase()==="xml"&&this.fail("the XML declaration must appear at the start of the document."),(V=this.piHandler)===null||V===void 0||V.call(this,{target:ge,body:this.text}),this.piTarget=this.text="",this.state=D}else he===ut?this.text+="?":(this.text+=`?${String.fromCodePoint(he)}`,this.state=K);this.xmlDeclPossible=!1}sXMLDeclNameStart(){const V=this.skipSpaces();if(V===ut){this.state=we;return}V!==N&&(this.state=Ee,this.name=String.fromCodePoint(V))}sXMLDeclName(){const V=this.captureTo(Me);if(V===ut){this.state=we,this.name+=this.text,this.text="",this.fail("XML declaration is incomplete.");return}if(r(V)||V===Jt){if(this.name+=this.text,this.text="",!this.xmlDeclExpects.includes(this.name))switch(this.name.length){case 0:this.fail("did not expect any more name/value pairs.");break;case 1:this.fail(`expected the name ${this.xmlDeclExpects[0]}.`);break;default:this.fail(`expected one of ${this.xmlDeclExpects.join(", ")}`)}this.state=V===Jt?z:Te}}sXMLDeclEq(){const V=this.getCodeNorm();if(V===ut){this.state=we,this.fail("XML declaration is incomplete.");return}r(V)||(V!==Jt&&this.fail("value required."),this.state=z)}sXMLDeclValueStart(){const V=this.getCodeNorm();if(V===ut){this.state=we,this.fail("XML declaration is incomplete.");return}r(V)||(U(V)?this.q=V:(this.fail("value must be quoted."),this.q=le),this.state=te)}sXMLDeclValue(){const V=this.captureTo([this.q,ut]);if(V===ut){this.state=we,this.text="",this.fail("XML declaration is incomplete.");return}if(V===N)return;const he=this.text;switch(this.text="",this.name){case"version":{this.xmlDeclExpects=["encoding","standalone"];const ge=he;this.xmlDecl.version=ge,/^1\.[0-9]+$/.test(ge)?this.opt.forceXMLVersion||this.setXMLVersion(ge):this.fail("version number must match /^1\\.[0-9]+$/.");break}case"encoding":/^[A-Za-z][A-Za-z0-9._-]*$/.test(he)||this.fail("encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/."),this.xmlDeclExpects=["standalone"],this.xmlDecl.encoding=he;break;case"standalone":he!=="yes"&&he!=="no"&&this.fail('standalone value must match "yes" or "no".'),this.xmlDeclExpects=[],this.xmlDecl.standalone=he;break}this.name="",this.state=fe}sXMLDeclSeparator(){const V=this.getCodeNorm();if(V===ut){this.state=we;return}r(V)||(this.fail("whitespace required."),this.unget()),this.state=ce}sXMLDeclEnding(){var V;this.getCodeNorm()===ot?(this.piTarget!=="xml"?this.fail("processing instructions are not allowed before root."):this.name!=="version"&&this.xmlDeclExpects.includes("version")&&this.fail("XML declaration must contain a version."),(V=this.xmldeclHandler)===null||V===void 0||V.call(this,this.xmlDecl),this.name="",this.piTarget=this.text="",this.state=D):this.fail("The character ? is disallowed anywhere in XML declarations."),this.xmlDeclPossible=!1}sOpenTag(){var V;const he=this.captureNameChars();if(he===N)return;const ge=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name="",this.xmlnsOpt&&(this.topNS=ge.ns=Object.create(null)),(V=this.openTagStartHandler)===null||V===void 0||V.call(this,ge),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail("documents may contain only one root."),he){case ot:this.openTag();break;case Ge:this.state=Ie;break;default:r(he)||this.fail("disallowed character in tag name."),this.state=re}}sOpenTagSlash(){this.getCode()===ot?this.openSelfClosingTag():(this.fail("forward-slash in opening tag not followed by >."),this.state=re)}sAttrib(){const V=this.skipSpaces();V!==N&&(a(V)?(this.unget(),this.state=ve):V===ot?this.openTag():V===Ge?this.state=Ie:this.fail("disallowed character in attribute name."))}sAttribName(){const V=this.captureNameChars();V===Jt?this.state=xe:r(V)?this.state=Ne:V===ot?(this.fail("attribute without value."),this.pushAttrib(this.name,this.name),this.name=this.text="",this.openTag()):V!==N&&this.fail("disallowed character in attribute name.")}sAttribNameSawWhite(){const V=this.skipSpaces();switch(V){case N:return;case Jt:this.state=xe;break;default:this.fail("attribute without value."),this.text="",this.name="",V===ot?this.openTag():a(V)?(this.unget(),this.state=ve):(this.fail("disallowed character in attribute name."),this.state=re)}}sAttribValue(){const V=this.getCodeNorm();U(V)?(this.q=V,this.state=ke):r(V)||(this.fail("unquoted attribute value."),this.state=We,this.unget())}sAttribValueQuoted(){const{q:V,chunk:he}=this;let{i:ge}=this;for(;;)switch(this.getCode()){case V:this.pushAttrib(this.name,this.text+he.slice(ge,this.prevI)),this.name=this.text="",this.q=null,this.state=lt;return;case Oe:this.text+=he.slice(ge,this.prevI),this.state=se,this.entityReturnState=ke;return;case w:case R:case v:this.text+=`${he.slice(ge,this.prevI)} `,ge=this.i;break;case Ot:this.text+=he.slice(ge,this.prevI),this.fail("disallowed character.");return;case N:this.text+=he.slice(ge);return}}sAttribValueClosed(){const V=this.getCodeNorm();r(V)?this.state=re:V===ot?this.openTag():V===Ge?this.state=Ie:a(V)?(this.fail("no whitespace between attributes."),this.unget(),this.state=ve):this.fail("disallowed character in attribute name.")}sAttribValueUnquoted(){const V=this.captureTo(mt);switch(V){case Oe:this.state=se,this.entityReturnState=We;break;case Ot:this.fail("disallowed character.");break;case N:break;default:this.text.includes("]]>")&&this.fail('the string "]]>" is disallowed in char data.'),this.pushAttrib(this.name,this.text),this.name=this.text="",V===ot?this.openTag():this.state=re}}sCloseTag(){const V=this.captureNameChars();V===ot?this.closeTag():r(V)?this.state=M:V!==N&&this.fail("disallowed character in closing tag.")}sCloseTagSawWhite(){switch(this.skipSpaces()){case ot:this.closeTag();break;case N:break;default:this.fail("disallowed character in closing tag.")}}handleTextInRoot(){let{i:V,forbiddenState:he}=this;const{chunk:ge,textHandler:Ce}=this;e:for(;;)switch(this.getCode()){case Ot:{if(this.state=j,Ce!==void 0){const{text:Ue}=this,Qe=ge.slice(V,this.prevI);Ue.length!==0?(Ce(Ue+Qe),this.text=""):Qe.length!==0&&Ce(Qe)}he=zt;break e}case Oe:this.state=se,this.entityReturnState=D,Ce!==void 0&&(this.text+=ge.slice(V,this.prevI)),he=zt;break e;case ai:switch(he){case zt:he=Pi;break;case Pi:he=gi;break;case gi:break;default:throw new Error("impossible state")}break;case ot:he===gi&&this.fail('the string "]]>" is disallowed in char data.'),he=zt;break;case R:Ce!==void 0&&(this.text+=`${ge.slice(V,this.prevI)}
|
|
336
|
+
`),V=this.i,he=zt;break;case N:Ce!==void 0&&(this.text+=ge.slice(V));break e;default:he=zt}this.forbiddenState=he}handleTextOutsideRoot(){let{i:V}=this;const{chunk:he,textHandler:ge}=this;let Ce=!1;e:for(;;){const Ue=this.getCode();switch(Ue){case Ot:{if(this.state=j,ge!==void 0){const{text:Qe}=this,wt=he.slice(V,this.prevI);Qe.length!==0?(ge(Qe+wt),this.text=""):wt.length!==0&&ge(wt)}break e}case Oe:this.state=se,this.entityReturnState=D,ge!==void 0&&(this.text+=he.slice(V,this.prevI)),Ce=!0;break e;case R:ge!==void 0&&(this.text+=`${he.slice(V,this.prevI)}
|
|
337
|
+
`),V=this.i;break;case N:ge!==void 0&&(this.text+=he.slice(V));break e;default:r(Ue)||(Ce=!0)}}Ce&&(!this.sawRoot&&!this.reportedTextBeforeRoot&&(this.fail("text data outside of root node."),this.reportedTextBeforeRoot=!0),this.closedRoot&&!this.reportedTextAfterRoot&&(this.fail("text data outside of root node."),this.reportedTextAfterRoot=!0))}pushAttribNS(V,he){var ge;const{prefix:Ce,local:Ue}=this.qname(V),Qe={name:V,prefix:Ce,local:Ue,value:he};if(this.attribList.push(Qe),(ge=this.attributeHandler)===null||ge===void 0||ge.call(this,Qe),Ce==="xmlns"){const wt=he.trim();this.currentXMLVersion==="1.0"&&wt===""&&this.fail("invalid attempt to undefine prefix in XML 1.0"),this.topNS[Ue]=wt,bt(this,Ue,wt)}else if(V==="xmlns"){const wt=he.trim();this.topNS[""]=wt,bt(this,"",wt)}}pushAttribPlain(V,he){var ge;const Ce={name:V,value:he};this.attribList.push(Ce),(ge=this.attributeHandler)===null||ge===void 0||ge.call(this,Ce)}end(){var V,he;this.sawRoot||this.fail("document must contain a root element.");const{tags:ge}=this;for(;ge.length>0;){const Ue=ge.pop();this.fail(`unclosed tag: ${Ue.name}`)}this.state!==S&&this.state!==D&&this.fail("unexpected end.");const{text:Ce}=this;return Ce.length!==0&&((V=this.textHandler)===null||V===void 0||V.call(this,Ce),this.text=""),this._closed=!0,(he=this.endHandler)===null||he===void 0||he.call(this),this._init(),this}resolve(V){var he,ge;let Ce=this.topNS[V];if(Ce!==void 0)return Ce;const{tags:Ue}=this;for(let Qe=Ue.length-1;Qe>=0;Qe--)if(Ce=Ue[Qe].ns[V],Ce!==void 0)return Ce;return Ce=this.ns[V],Ce!==void 0?Ce:(ge=(he=this.opt).resolvePrefix)===null||ge===void 0?void 0:ge.call(he,V)}qname(V){const he=V.indexOf(":");if(he===-1)return{prefix:"",local:V};const ge=V.slice(he+1),Ce=V.slice(0,he);return(Ce===""||ge===""||ge.includes(":"))&&this.fail(`malformed name: ${V}.`),{prefix:Ce,local:ge}}processAttribsNS(){var V;const{attribList:he}=this,ge=this.tag;{const{prefix:Qe,local:wt}=this.qname(ge.name);ge.prefix=Qe,ge.local=wt;const Qt=ge.uri=(V=this.resolve(Qe))!==null&&V!==void 0?V:"";Qe!==""&&(Qe==="xmlns"&&this.fail('tags may not have "xmlns" as prefix.'),Qt===""&&(this.fail(`unbound namespace prefix: ${JSON.stringify(Qe)}.`),ge.uri=Qe))}if(he.length===0)return;const{attributes:Ce}=ge,Ue=new Set;for(const Qe of he){const{name:wt,prefix:Qt,local:Ys}=Qe;let Di,Zi;Qt===""?(Di=wt==="xmlns"?b:"",Zi=wt):(Di=this.resolve(Qt),Di===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(Qt)}.`),Di=Qt),Zi=`{${Di}}${Ys}`),Ue.has(Zi)&&this.fail(`duplicate attribute: ${Zi}.`),Ue.add(Zi),Qe.uri=Di,Ce[wt]=Qe}this.attribList=[]}processAttribsPlain(){const{attribList:V}=this,he=this.tag.attributes;for(const{name:ge,value:Ce}of V)he[ge]!==void 0&&this.fail(`duplicate attribute: ${ge}.`),he[ge]=Ce;this.attribList=[]}openTag(){var V;this.processAttribs();const{tags:he}=this,ge=this.tag;ge.isSelfClosing=!1,(V=this.openTagHandler)===null||V===void 0||V.call(this,ge),he.push(ge),this.state=D,this.name=""}openSelfClosingTag(){var V,he,ge;this.processAttribs();const{tags:Ce}=this,Ue=this.tag;Ue.isSelfClosing=!0,(V=this.openTagHandler)===null||V===void 0||V.call(this,Ue),(he=this.closeTagHandler)===null||he===void 0||he.call(this,Ue),(this.tag=(ge=Ce[Ce.length-1])!==null&&ge!==void 0?ge:null)===null&&(this.closedRoot=!0),this.state=D,this.name=""}closeTag(){const{tags:V,name:he}=this;if(this.state=D,this.name="",he===""){this.fail("weird empty close tag."),this.text+="</>";return}const ge=this.closeTagHandler;let Ce=V.length;for(;Ce-- >0;){const Ue=this.tag=V.pop();if(this.topNS=Ue.ns,ge?.(Ue),Ue.name===he)break;this.fail("unexpected close tag.")}Ce===0?this.closedRoot=!0:Ce<0&&(this.fail(`unmatched closing tag: ${he}.`),this.text+=`</${he}>`)}parseEntity(V){if(V[0]!=="#"){const ge=this.ENTITIES[V];return ge!==void 0?ge:(this.fail(this.isName(V)?"undefined entity.":"disallowed character in entity name."),`&${V};`)}let he=NaN;return V[1]==="x"&&/^#x[0-9a-f]+$/i.test(V)?he=parseInt(V.slice(2),16):/^#[0-9]+$/.test(V)&&(he=parseInt(V.slice(1),10)),this.isChar(he)?String.fromCodePoint(he):(this.fail("malformed character entity."),`&${V};`)}}return sn.SaxesParser=Ci,sn}var fr={},ah;function __(){if(ah)return fr;ah=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.ParseError=void 0;let n=class extends Error{constructor(i,r){const o=i.saxParser;super(i.trackPosition?`Line ${o.line} column ${o.column+1}: ${r}`:r)}};return fr.ParseError=n,fr}var on={},pr={},lh;function kf(){if(lh)return pr;lh=1,Object.defineProperty(pr,"__esModule",{value:!0}),pr.BlankNode=void 0;class n{constructor(i){this.termType="BlankNode",this.value=i}equals(i){return!!i&&i.termType==="BlankNode"&&i.value===this.value}}return pr.BlankNode=n,pr}var gr={},mr={},uh;function Mf(){if(uh)return mr;uh=1,Object.defineProperty(mr,"__esModule",{value:!0}),mr.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(i){return!!i&&i.termType==="DefaultGraph"}}return mr.DefaultGraph=n,n.INSTANCE=new n,mr}var _r={},yr={},ch;function Wl(){if(ch)return yr;ch=1,Object.defineProperty(yr,"__esModule",{value:!0}),yr.NamedNode=void 0;class n{constructor(i){this.termType="NamedNode",this.value=i}equals(i){return!!i&&i.termType==="NamedNode"&&i.value===this.value}}return yr.NamedNode=n,yr}var hh;function Of(){if(hh)return _r;hh=1,Object.defineProperty(_r,"__esModule",{value:!0}),_r.Literal=void 0;const n=Wl();class e{constructor(r,o){this.termType="Literal",this.value=r,typeof o=="string"?(this.language=o,this.datatype=e.RDF_LANGUAGE_STRING,this.direction=""):o?"termType"in o?(this.language="",this.datatype=o,this.direction=""):(this.language=o.language,this.datatype=o.direction?e.RDF_DIRECTIONAL_LANGUAGE_STRING:e.RDF_LANGUAGE_STRING,this.direction=o.direction||""):(this.language="",this.datatype=e.XSD_STRING,this.direction="")}equals(r){return!!r&&r.termType==="Literal"&&r.value===this.value&&r.language===this.language&&(r.direction===this.direction||!r.direction&&this.direction==="")&&this.datatype.equals(r.datatype)}}return _r.Literal=e,e.RDF_LANGUAGE_STRING=new n.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),e.RDF_DIRECTIONAL_LANGUAGE_STRING=new n.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),e.XSD_STRING=new n.NamedNode("http://www.w3.org/2001/XMLSchema#string"),_r}var vr={},dh;function Ff(){if(dh)return vr;dh=1,Object.defineProperty(vr,"__esModule",{value:!0}),vr.Quad=void 0;class n{constructor(i,r,o,a){this.termType="Quad",this.value="",this.subject=i,this.predicate=r,this.object=o,this.graph=a}equals(i){return!!i&&(i.termType==="Quad"||!i.termType)&&this.subject.equals(i.subject)&&this.predicate.equals(i.predicate)&&this.object.equals(i.object)&&this.graph.equals(i.graph)}}return vr.Quad=n,vr}var br={},fh;function jf(){if(fh)return br;fh=1,Object.defineProperty(br,"__esModule",{value:!0}),br.Variable=void 0;class n{constructor(i){this.termType="Variable",this.value=i}equals(i){return!!i&&i.termType==="Variable"&&i.value===this.value}}return br.Variable=n,br}var ph;function y_(){if(ph)return gr;ph=1,Object.defineProperty(gr,"__esModule",{value:!0}),gr.DataFactory=void 0;const n=kf(),e=Mf(),i=Of(),r=Wl(),o=Ff(),a=jf();let l=0;class u{constructor(d){this.blankNodeCounter=0,d=d||{},this.blankNodePrefix=d.blankNodePrefix||`df_${l++}_`}namedNode(d){return new r.NamedNode(d)}blankNode(d){return new n.BlankNode(d||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(d,g){return new i.Literal(d,g)}variable(d){return new a.Variable(d)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(d,g,_,h){return new o.Quad(d,g,_,h||this.defaultGraph())}fromTerm(d){switch(d.termType){case"NamedNode":return this.namedNode(d.value);case"BlankNode":return this.blankNode(d.value);case"Literal":return d.language?this.literal(d.value,d.language):d.datatype.equals(i.Literal.XSD_STRING)?this.literal(d.value):this.literal(d.value,this.fromTerm(d.datatype));case"Variable":return this.variable(d.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(d.subject),this.fromTerm(d.predicate),this.fromTerm(d.object),this.fromTerm(d.graph))}}fromQuad(d){return this.fromTerm(d)}resetBlankNodeCounter(){this.blankNodeCounter=0}}return gr.DataFactory=u,gr}var gh;function $f(){return gh||(gh=1,(function(n){var e=on&&on.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),i=on&&on.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),i(kf(),n),i(y_(),n),i(Mf(),n),i(Of(),n),i(Wl(),n),i(Ff(),n),i(jf(),n)})(on)),on}var an={},aa={},mh;function v_(){return mh||(mh=1,(function(n){Object.defineProperty(n,"__esModule",{value:!0}),n.validateIri=n.IriValidationStrategy=void 0;function e(){const u="[!$&'()*+,;=]",f="%[a-fA-F0-9]{2}",d="([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",g=`${d}\\.${d}\\.${d}\\.${d}`,_="[a-fA-F0-9]{1,4}",h=`(${_}:${_}|${g})`,m=`((${_}:){6}${h}|::(${_}:){5}${h}|(${_})?::(${_}:){4}${h}|((${_}:){0,1}${_})?::(${_}:){3}${h}|((${_}:){0,2}${_})?::(${_}:){2}${h}|((${_}:){0,3}${_})?::${_}:${h}|((${_}:){0,4}${_})?::${h}|((${_}:){0,5}${_})?::${_}|((${_}:){0,6}${_})?::)`,b=`v[a-fA-F0-9]+\\.(${u}|${u}|":)+`,T=`\\[(${m}|${b})\\]`,A="[0-9]*",N="[a-zA-Z][a-zA-Z0-9+\\-.]*",S="[---]",P="[a-zA-Z0-9\\-._~ -豈-﷏ﷰ-𐀀-𠀀-𰀀------------]",B=`(${P}|${f}|${u}|[:@])*`,O=`(${B}|[\\/?])*`,J=`(${B}|${S}|[\\/?])*`,k=`(${B})+`,q=`(${B})*`,X="",F=`${k}(\\/${q})*`,$=`\\/(${k}(\\/${q})*)?`,ue=`(\\/${q})*`,D=`(${P}|${f}|${u})*`,se=`(${T}|${g}|${D})`,I=`(\\/\\/${`(${`(${P}|${f}|${u}|:)*`}@)?${se}(:${A})?`}${ue}|${$}|${F}|${X})`,Z=`^${N}:${I}(\\?${J})?(#${O})?$`;return new RegExp(Z,"u")}const i=e(),r=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u;var o;(function(l){l.Strict="strict",l.Pragmatic="pragmatic",l.None="none"})(o=n.IriValidationStrategy||(n.IriValidationStrategy={}));function a(l,u=o.Strict){switch(u){case o.Strict:return i.test(l)?void 0:new Error(`Invalid IRI according to RFC 3987: '${l}'`);case o.Pragmatic:return r.test(l)?void 0:new Error(`Invalid IRI according to RDF Turtle: '${l}'`);case o.None:return;default:return new Error(`Not supported validation strategy "${u}"`)}}n.validateIri=a})(aa)),aa}var _h;function b_(){return _h||(_h=1,(function(n){var e=an&&an.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),i=an&&an.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),i(v_(),n)})(an)),an}var yh;function w_(){if(yh)return nn;yh=1,Object.defineProperty(nn,"__esModule",{value:!0}),nn.ParseType=nn.RdfXmlParser=void 0;const n=d_(),e=m_(),i=lf(),r=__(),o=$f(),a=b_();let l=class tt extends i.Transform{constructor(d){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},d&&(Object.assign(this,d),this.options=d),this.dataFactory||(this.dataFactory=new o.DataFactory),this.baseIRI||(this.baseIRI=""),this.defaultGraph||(this.defaultGraph=this.dataFactory.defaultGraph()),this.validateUri!==!1&&(this.validateUri=!0),this.iriValidationStrategy||(this.iriValidationStrategy=this.validateUri?a.IriValidationStrategy.Pragmatic:a.IriValidationStrategy.None),this.saxParser=new e.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(d){const g=new i.PassThrough({readableObjectMode:!0});d.on("error",h=>_.emit("error",h)),d.on("data",h=>g.push(h)),d.on("end",()=>g.push(null));const _=g.pipe(new tt(this.options));return _}_transform(d,g,_){try{this.saxParser.write(d)}catch(h){return _(h)}_()}newParseError(d){return new r.ParseError(this,d)}valueToUri(d,g){return this.uriToNamedNode((0,n.resolve)(d,g.baseIRI))}uriToNamedNode(d){const g=(0,a.validateIri)(d,this.iriValidationStrategy);if(g instanceof Error)throw this.newParseError(g.message);return this.dataFactory.namedNode(d)}validateNcname(d){if(!tt.NCNAME_MATCHER.test(d))throw this.newParseError(`Not a valid NCName: ${d}`)}createLiteral(d,g){return this.dataFactory.literal(d,g.datatype?g.datatype:g.language?{language:g.language,direction:g.rdfVersion?g.direction:void 0}:void 0)}attachSaxListeners(){this.saxParser.on("error",d=>this.emit("error",d)),this.saxParser.on("opentag",this.onTag.bind(this)),this.saxParser.on("text",this.onText.bind(this)),this.saxParser.on("cdata",this.onText.bind(this)),this.saxParser.on("closetag",this.onCloseTag.bind(this)),this.saxParser.on("doctype",this.onDoctype.bind(this))}onTag(d){const g=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;let _=u.RESOURCE;if(g&&(g.hadChildren=!0,_=g.childrenParseType),g&&g.childrenStringTags){const m=d.name;let b="";for(const{key:R,value:S}of g.namespaces||[])b+=` ${R}="${S}"`;for(const R in d.attributes)b+=` ${R}="${d.attributes[R].value}"`;const A=`<${`${m}${b}`}>`;g.childrenStringTags.push(A);const N={childrenStringTags:g.childrenStringTags};N.childrenStringEmitClosingTag=`</${m}>`,this.activeTagStack.push(N);return}const h={};g?(h.language=g.language,h.direction=g.direction,h.baseIRI=g.baseIRI,h.childrenTripleTerms=g.childrenTripleTerms,h.rdfVersion=g.rdfVersion):h.baseIRI=this.baseIRI,this.activeTagStack.push(h),_===u.RESOURCE?this.onTagResource(d,h,g,!g):this.onTagProperty(d,h,g);for(const m in d.attributes){const b=d.attributes[m];b.prefix==="xmlns"&&(h.namespaces||(h.namespaces=[]),h.namespaces.push({key:`${b.prefix}:${b.local}`,value:b.value}))}g&&g.namespaces&&(h.namespaces=[...h.namespaces||[],...g.namespaces])}onTagResource(d,g,_,h){g.childrenParseType=u.PROPERTY;let m=!0;if(d.uri===tt.RDF){if(!h&&tt.FORBIDDEN_NODE_ELEMENTS.indexOf(d.local)>=0)throw this.newParseError(`Illegal node element name: ${d.local}`);switch(d.local){case"RDF":g.childrenParseType=u.RESOURCE;case"Description":m=!1}}const b=[],T=[];let A=null,N=!1,R=!1,S=null;for(const y in d.attributes){const x=d.attributes[y];if(x.uri===tt.RDF&&x.local==="version"){this.setVersion(g,x.value);continue}else if(_&&x.uri===tt.RDF)switch(x.local){case"about":if(A)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${x.value} and ${A} where found.`);A=x.value;continue;case"ID":if(A)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${x.value} and ${A} where found.`);this.validateNcname(x.value),A="#"+x.value,N=!0;continue;case"nodeID":if(A)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, while ${x.value} and ${A} where found.`);this.validateNcname(x.value),A=x.value,R=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"type":S=x.value;continue;case"aboutEach":throw this.newParseError("rdf:aboutEach is not supported.");case"aboutEachPrefix":throw this.newParseError("rdf:aboutEachPrefix is not supported.");case"li":throw this.newParseError("rdf:li on node elements are not supported.")}else if(x.uri===tt.XML){if(x.local==="lang"){g.language=x.value===""?null:x.value.toLowerCase();continue}else if(x.local==="base"){g.baseIRI=(0,n.resolve)(x.value,g.baseIRI);continue}}else if(x.uri===tt.ITS&&x.local==="dir"){this.setDirection(g,x.value);continue}x.prefix!=="xml"&&x.prefix!=="xmlns"&&(x.prefix!==""||x.local!=="xmlns")&&x.uri&&(b.push(this.uriToNamedNode(x.uri+x.local)),T.push(x.value))}if(A!==null&&(g.subject=R?this.dataFactory.blankNode(A):this.valueToUri(A,g),N&&this.claimNodeId(g.subject)),g.subject||(g.subject=this.dataFactory.blankNode()),m){const y=this.uriToNamedNode(d.uri+d.local);this.emitTriple(g.subject,this.dataFactory.namedNode(tt.RDF+"type"),y,_?_.reifiedStatementId:null,g.childrenTripleTerms,g.reifier)}if(_){if(_.predicate)if(_.childrenCollectionSubject){const y=this.dataFactory.blankNode(),x=this.dataFactory.namedNode(tt.RDF+"rest"),P=_.childrenCollectionPredicate.equals(x);this.emitTriple(_.childrenCollectionSubject,_.childrenCollectionPredicate,y,P?null:_.reifiedStatementId,_.childrenTripleTerms,P?null:_.reifier),this.emitTriple(y,this.dataFactory.namedNode(tt.RDF+"first"),g.subject,null,g.childrenTripleTerms),_.childrenCollectionSubject=y,_.childrenCollectionPredicate=x}else{_.childrenTagsToTripleTerms||(this.emitTriple(_.subject,_.predicate,g.subject,_.reifiedStatementId,_.childrenTripleTerms,_.reifier),_.predicateEmitted=!0);for(let y=0;y<_.predicateSubPredicates.length;y++)this.emitTriple(g.subject,_.predicateSubPredicates[y],_.predicateSubObjects[y],null,_.childrenTripleTerms,_.reifier);_.predicateSubPredicates=[],_.predicateSubObjects=[]}for(let y=0;y<b.length;y++){const x=this.createLiteral(T[y],g);this.emitTriple(g.subject,b[y],x,_.reifiedStatementId,_.childrenTripleTerms,_.reifier)}S&&this.emitTriple(g.subject,this.dataFactory.namedNode(tt.RDF+"type"),this.uriToNamedNode(S),null,g.childrenTripleTerms,g.reifier)}}onTagProperty(d,g,_){if(g.childrenParseType=u.RESOURCE,g.subject=_.subject,d.uri===tt.RDF&&d.local==="li"?(_.listItemCounter||(_.listItemCounter=1),g.predicate=this.uriToNamedNode(d.uri+"_"+_.listItemCounter++)):g.predicate=this.uriToNamedNode(d.uri+d.local),d.uri===tt.RDF&&tt.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(d.local)>=0)throw this.newParseError(`Illegal property element name: ${d.local}`);g.predicateSubPredicates=[],g.predicateSubObjects=[];let h=!1,m=!1,b=null,T=!0;const A=[],N=[];for(const R in d.attributes){const S=d.attributes[R];if(S.uri===tt.RDF&&S.local==="version"){this.setVersion(g,S.value);continue}else if(S.uri===tt.RDF)switch(S.local){case"resource":if(b)throw this.newParseError(`Found both rdf:resource (${S.value}) and rdf:nodeID (${b}).`);if(h)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${S.value})`);g.hadChildren=!0,b=S.value,T=!1;continue;case"datatype":if(m)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${S.value}).`);if(h)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${S.value})`);g.datatype=this.valueToUri(S.value,g);continue;case"nodeID":if(m)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${S.value}).`);if(g.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${S.value}).`);if(h)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${S.value})`);this.validateNcname(S.value),g.hadChildren=!0,b=S.value,T=!0;continue;case"bagID":throw this.newParseError("rdf:bagID is not supported.");case"parseType":if(m)throw this.newParseError("rdf:parseType is not allowed when non-rdf:* property attributes are present");if(g.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${g.datatype.value})`);if(b)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${b})`);if(S.value==="Resource"){h=!0,g.childrenParseType=u.PROPERTY;const y=this.dataFactory.blankNode();this.emitTriple(g.subject,g.predicate,y,g.reifiedStatementId,g.childrenTripleTerms,g.reifier),g.subject=y,g.predicate=null}else S.value==="Collection"?(h=!0,g.hadChildren=!0,g.childrenCollectionSubject=g.subject,g.childrenCollectionPredicate=g.predicate,T=!1):S.value==="Literal"?(h=!0,g.childrenTagsToString=!0,g.childrenStringTags=[]):S.value==="Triple"&&(h=!0,g.childrenTagsToTripleTerms=!0,g.childrenTripleTerms=[]);continue;case"ID":this.validateNcname(S.value),g.reifiedStatementId=this.valueToUri("#"+S.value,g),this.claimNodeId(g.reifiedStatementId);continue;case"annotation":g.reifier=this.dataFactory.namedNode(S.value);continue;case"annotationNodeID":g.reifier=this.dataFactory.blankNode(S.value);continue}else if(S.uri===tt.XML&&S.local==="lang"){g.language=S.value===""?null:S.value.toLowerCase();continue}else if(S.uri===tt.ITS&&S.local==="dir"){this.setDirection(g,S.value);continue}else if(S.uri===tt.ITS&&S.local==="version")continue;if(S.prefix!=="xml"&&S.prefix!=="xmlns"&&(S.prefix!==""||S.local!=="xmlns")&&S.uri){if(h||g.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${S.value}`);g.hadChildren=!0,m=!0,A.push(this.uriToNamedNode(S.uri+S.local)),N.push(this.createLiteral(S.value,g))}}if(b!==null){const R=g.subject;g.subject=T?this.dataFactory.blankNode(b):this.valueToUri(b,g),this.emitTriple(R,g.predicate,g.subject,g.reifiedStatementId,g.childrenTripleTerms,g.reifier);for(let S=0;S<A.length;S++)this.emitTriple(g.subject,A[S],N[S],null,g.childrenTripleTerms,g.reifier);g.predicateEmitted=!0}else T&&(g.predicateSubPredicates=A,g.predicateSubObjects=N,g.predicateEmitted=!1)}emitTriple(d,g,_,h,m,b){const T=this.dataFactory.quad(d,g,_,this.defaultGraph);m?m.push(T):this.push(T),b&&this.push(this.dataFactory.quad(b,this.dataFactory.namedNode(tt.RDF+"reifies"),T)),h&&(this.push(this.dataFactory.quad(h,this.dataFactory.namedNode(tt.RDF+"type"),this.dataFactory.namedNode(tt.RDF+"Statement"),this.defaultGraph)),this.push(this.dataFactory.quad(h,this.dataFactory.namedNode(tt.RDF+"subject"),d,this.defaultGraph)),this.push(this.dataFactory.quad(h,this.dataFactory.namedNode(tt.RDF+"predicate"),g,this.defaultGraph)),this.push(this.dataFactory.quad(h,this.dataFactory.namedNode(tt.RDF+"object"),_,this.defaultGraph)))}claimNodeId(d){if(!this.allowDuplicateRdfIds){if(this.nodeIds[d.value])throw this.newParseError(`Found multiple occurrences of rdf:ID='${d.value}'.`);this.nodeIds[d.value]=!0}}onText(d){const g=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;g&&(g.childrenStringTags?g.childrenStringTags.push(d):g.predicate&&(g.text=d))}onCloseTag(){const d=this.activeTagStack.pop(),g=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;if(d.childrenStringEmitClosingTag&&d.childrenStringTags.push(d.childrenStringEmitClosingTag),d.childrenTagsToString&&(d.datatype=this.dataFactory.namedNode(tt.RDF+"XMLLiteral"),d.text=d.childrenStringTags.join(""),d.hadChildren=!1),d.childrenTagsToTripleTerms&&d.predicate&&d.rdfVersion){if(d.childrenTripleTerms.length!==1)throw this.newParseError(`Expected exactly one triple term in rdf:parseType="Triple" but got ${d.childrenTripleTerms.length}`);for(const _ of d.childrenTripleTerms)this.emitTriple(d.subject,d.predicate,_,null,g.childrenTripleTerms,g.reifier);d.predicateEmitted=!0}if(d.childrenCollectionSubject)this.emitTriple(d.childrenCollectionSubject,d.childrenCollectionPredicate,this.dataFactory.namedNode(tt.RDF+"nil"),null,d.childrenTripleTerms);else if(d.predicate){if(!d.hadChildren&&d.childrenParseType!==u.PROPERTY)this.emitTriple(d.subject,d.predicate,this.createLiteral(d.text||"",d),d.reifiedStatementId,d.childrenTripleTerms,d.reifier);else if(!d.predicateEmitted){const _=this.dataFactory.blankNode();this.emitTriple(d.subject,d.predicate,_,d.reifiedStatementId,d.childrenTripleTerms,d.reifier);for(let h=0;h<d.predicateSubPredicates.length;h++)this.emitTriple(_,d.predicateSubPredicates[h],d.predicateSubObjects[h],null,d.childrenTripleTerms)}}}onDoctype(d){d.replace(/<!ENTITY\s+([^\s]+)\s+["']([^"']+)["']\s*>/g,(g,_,h)=>(this.saxParser.ENTITIES[_]=h,""))}setDirection(d,g){if(g){if(g!=="ltr"&&g!=="rtl")throw this.newParseError(`Base directions must either be 'ltr' or 'rtl', while '${g}' was found.`);d.direction=g}else delete d.direction}setVersion(d,g){d.rdfVersion=g,this.emit("version",g)}};nn.RdfXmlParser=l,l.MIME_TYPE="application/rdf+xml",l.RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#",l.XML="http://www.w3.org/XML/1998/namespace",l.ITS="http://www.w3.org/2005/11/its",l.FORBIDDEN_NODE_ELEMENTS=["RDF","ID","about","bagID","parseType","resource","nodeID","li","aboutEach","aboutEachPrefix"],l.FORBIDDEN_PROPERTY_ELEMENTS=["Description","RDF","ID","about","bagID","parseType","resource","nodeID","aboutEach","aboutEachPrefix"],l.NCNAME_MATCHER=/^([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_])([A-Za-z\xC0-\xD6\xD8-\xF6\u{F8}-\u{2FF}\u{370}-\u{37D}\u{37F}-\u{1FFF}\u{200C}-\u{200D}\u{2070}-\u{218F}\u{2C00}-\u{2FEF}\u{3001}-\u{D7FF}\u{F900}-\u{FDCF}\u{FDF0}-\u{FFFD}\u{10000}-\u{EFFFF}_\-.0-9#xB7\u{0300}-\u{036F}\u{203F}-\u{2040}])*$/u;var u;return(function(f){f[f.RESOURCE=0]="RESOURCE",f[f.PROPERTY=1]="PROPERTY"})(u||(nn.ParseType=u={})),nn}var vh;function x_(){return vh||(vh=1,(function(n){var e=tn&&tn.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),i=tn&&tn.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),i(w_(),n)})(tn)),tn}var E_=x_(),la={},ua,bh;function Gl(){return bh||(bh=1,ua=class Bf{constructor(e,i=new Map,r=0){this.prefix=e,this._existing=i,this.counter=r}clone(){const{prefix:e,_existing:i,counter:r}=this;return new Bf(e,new Map(i),r)}getId(e){const i=e&&this._existing.get(e);if(i)return i;const r=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,r),r}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}),ua}var ca={},wh;function S_(){return wh||(wh=1,(function(n,e){if(n.setImmediate)return;var i=1,r={},o=!1,a=n.document,l;function u(R){typeof R!="function"&&(R=new Function(""+R));for(var S=new Array(arguments.length-1),y=0;y<S.length;y++)S[y]=arguments[y+1];var x={callback:R,args:S};return r[i]=x,l(i),i++}function f(R){delete r[R]}function d(R){var S=R.callback,y=R.args;switch(y.length){case 0:S();break;case 1:S(y[0]);break;case 2:S(y[0],y[1]);break;case 3:S(y[0],y[1],y[2]);break;default:S.apply(e,y);break}}function g(R){if(o)setTimeout(g,0,R);else{var S=r[R];if(S){o=!0;try{d(S)}finally{f(R),o=!1}}}}function _(){l=function(R){process.nextTick(function(){g(R)})}}function h(){if(n.postMessage&&!n.importScripts){var R=!0,S=n.onmessage;return n.onmessage=function(){R=!1},n.postMessage("","*"),n.onmessage=S,R}}function m(){var R="setImmediate$"+Math.random()+"$",S=function(y){y.source===n&&typeof y.data=="string"&&y.data.indexOf(R)===0&&g(+y.data.slice(R.length))};n.addEventListener?n.addEventListener("message",S,!1):n.attachEvent("onmessage",S),l=function(y){n.postMessage(R+y,"*")}}function b(){var R=new MessageChannel;R.port1.onmessage=function(S){var y=S.data;g(y)},l=function(S){R.port2.postMessage(S)}}function T(){var R=a.documentElement;l=function(S){var y=a.createElement("script");y.onreadystatechange=function(){g(S),y.onreadystatechange=null,R.removeChild(y),y=null},R.appendChild(y)}}function A(){l=function(R){setTimeout(g,0,R)}}var N=Object.getPrototypeOf&&Object.getPrototypeOf(n);N=N&&N.setTimeout?N:n,{}.toString.call(n.process)==="[object process]"?_():h()?m():n.MessageChannel?b():a&&"onreadystatechange"in a.createElement("script")?T():A(),N.setImmediate=u,N.clearImmediate=f})(typeof self>"u"?typeof Cn>"u"?ca:Cn:self)),ca}/*!
|
|
338
338
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
339
|
-
*/var
|
|
339
|
+
*/var ha,xh;function Xs(){if(xh)return ha;xh=1,S_();const n=self.crypto||self.msCrypto;return ha=class{constructor(i){if(!(n&&n.subtle))throw new Error("crypto.subtle not found.");if(i==="sha256")this.algorithm={name:"SHA-256"};else if(i==="sha1")this.algorithm={name:"SHA-1"};else throw new Error(`Unsupported algorithm "${i}".`);this._content=""}update(i){this._content+=i}async digest(){const i=new TextEncoder().encode(this._content),r=new Uint8Array(await n.subtle.digest(this.algorithm,i));let o="";for(let a=0;a<r.length;++a)o+=r[a].toString(16).padStart(2,"0");return o}},ha}/*!
|
|
340
340
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
341
|
-
*/var
|
|
341
|
+
*/var da,Eh;function qf(){return Eh||(Eh=1,da=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let i=0;i<e.length;++i)this.dir.set(e[i],!0)}hasNext(){return!this.done}next(){const{current:e,dir:i}=this,r=e.slice();let o=null,a=0;const l=e.length;for(let u=0;u<l;++u){const f=e[u],d=i.get(f);(o===null||f>o)&&(d&&u>0&&f>e[u-1]||!d&&u<l-1&&f>e[u+1])&&(o=f,a=u)}if(o===null)this.done=!0;else{const u=i.get(o)?a-1:a+1;e[a]=e[u],e[u]=o;for(const f of e)f>o&&i.set(f,!i.get(f))}return r}}),da}/*!
|
|
342
342
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
343
|
-
*/var
|
|
344
|
-
`,
|
|
345
|
-
`:return"\\n";case"\r":return"\\r"}})}const
|
|
346
|
-
`;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(
|
|
343
|
+
*/var fa,Sh;function Zl(){if(Sh)return fa;Sh=1;const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#"+"langString",i="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",o="BlankNode",a="Literal",l="DefaultGraph",u={};(()=>{const m="(?:<([^:]+:[^>]*)>)",T="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�"+"_",A=T+"0-9-·̀-ͯ‿-⁀",R="(_:(?:["+T+"0-9])(?:(?:["+A+".])*(?:["+A+"]))?)",S='"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',y="(?:\\^\\^"+m+")",P="(?:"+S+"(?:"+y+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",B="[ \\t]+",O="[ \\t]*",J="(?:"+m+"|"+R+")"+B,k=m+B,q="(?:"+m+"|"+R+"|"+P+")"+O,X="(?:\\.|(?:(?:"+m+"|"+R+")"+O+"\\.))";u.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,u.empty=new RegExp("^"+O+"$"),u.quad=new RegExp("^"+O+J+k+q+X+O+"$")})(),fa=class Rs{static parse(b){const T=[],A={},N=b.split(u.eoln);let R=0;for(const S of N){if(R++,u.empty.test(S))continue;const y=S.match(u.quad);if(y===null)throw new Error("N-Quads parse error on line "+R+".");const x={subject:null,predicate:null,object:null,graph:null};if(y[1]!==void 0?x.subject={termType:r,value:y[1]}:x.subject={termType:o,value:y[2]},x.predicate={termType:r,value:y[3]},y[4]!==void 0?x.object={termType:r,value:y[4]}:y[5]!==void 0?x.object={termType:o,value:y[5]}:(x.object={termType:a,value:void 0,datatype:{termType:r}},y[7]!==void 0?x.object.datatype.value=y[7]:y[8]!==void 0?(x.object.datatype.value=e,x.object.language=y[8]):x.object.datatype.value=i,x.object.value=h(y[6])),y[9]!==void 0?x.graph={termType:r,value:y[9]}:y[10]!==void 0?x.graph={termType:o,value:y[10]}:x.graph={termType:l,value:""},!(x.graph.value in A))A[x.graph.value]=[x],T.push(x);else{let P=!0;const B=A[x.graph.value];for(const O of B)if(f(O,x)){P=!1;break}P&&(B.push(x),T.push(x))}}return T}static serialize(b){Array.isArray(b)||(b=Rs.legacyDatasetToQuads(b));const T=[];for(const A of b)T.push(Rs.serializeQuad(A));return T.sort().join("")}static serializeQuadComponents(b,T,A,N){let R="";return b.termType===r?R+=`<${b.value}>`:R+=`${b.value}`,R+=` <${T.value}> `,A.termType===r?R+=`<${A.value}>`:A.termType===o?R+=A.value:(R+=`"${g(A.value)}"`,A.datatype.value===e?A.language&&(R+=`@${A.language}`):A.datatype.value!==i&&(R+=`^^<${A.datatype.value}>`)),N.termType===r?R+=` <${N.value}>`:N.termType===o&&(R+=` ${N.value}`),R+=` .
|
|
344
|
+
`,R}static serializeQuad(b){return Rs.serializeQuadComponents(b.subject,b.predicate,b.object,b.graph)}static legacyDatasetToQuads(b){const T=[],A={"blank node":o,IRI:r,literal:a};for(const N in b)b[N].forEach(S=>{const y={};for(const x in S){const P=S[x],B={termType:A[P.type],value:P.value};B.termType===a&&(B.datatype={termType:r},"datatype"in P&&(B.datatype.value=P.datatype),"language"in P?("datatype"in P||(B.datatype.value=e),B.language=P.language):"datatype"in P||(B.datatype.value=i)),y[x]=B}N==="@default"?y.graph={termType:l,value:""}:y.graph={termType:N.startsWith("_:")?o:r,value:N},T.push(y)});return T}};function f(m,b){return!(m.subject.termType===b.subject.termType&&m.object.termType===b.object.termType)||!(m.subject.value===b.subject.value&&m.predicate.value===b.predicate.value&&m.object.value===b.object.value)?!1:m.object.termType!==a?!0:m.object.datatype.termType===b.object.datatype.termType&&m.object.language===b.object.language&&m.object.datatype.value===b.object.datatype.value}const d=/["\\\n\r]/g;function g(m){return m.replace(d,function(b){switch(b){case'"':return'\\"';case"\\":return"\\\\";case`
|
|
345
|
+
`:return"\\n";case"\r":return"\\r"}})}const _=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function h(m){return m.replace(_,function(b,T,A,N){if(T)switch(T){case"t":return" ";case"b":return"\b";case"n":return`
|
|
346
|
+
`;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(A)return String.fromCharCode(parseInt(A,16));if(N)throw new Error("Unsupported U escape")})}return fa}/*!
|
|
347
347
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
348
|
-
*/var
|
|
348
|
+
*/var pa,Th;function zf(){if(Th)return pa;Th=1;const n=Gl(),e=Xs(),i=qf(),r=Zl();pa=class{constructor({createMessageDigest:l=()=>new e("sha256"),canonicalIdMap:u=new Map,maxDeepIterations:f=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n",u),this.createMessageDigest=l,this.maxDeepIterations=f,this.quads=null,this.deepIterations=null}async main(l){this.deepIterations=new Map,this.quads=l;for(const m of l)this._addBlankNodeQuadInfo({quad:m,component:m.subject}),this._addBlankNodeQuadInfo({quad:m,component:m.object}),this._addBlankNodeQuadInfo({quad:m,component:m.graph});const u=new Map,f=[...this.blankNodeInfo.keys()];let d=0;for(const m of f)++d%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:m,hashToBlankNodes:u});const g=[...u.keys()].sort(),_=[];for(const m of g){const b=u.get(m);if(b.length>1){_.push(b);continue}const T=b[0];this.canonicalIssuer.getId(T)}for(const m of _){const b=[];for(const T of m){if(this.canonicalIssuer.hasId(T))continue;const A=new n("_:b");A.getId(T);const N=await this.hashNDegreeQuads(T,A);b.push(N)}b.sort(o);for(const T of b){const A=T.issuer.getOldIds();for(const N of A)this.canonicalIssuer.getId(N)}}const h=[];for(const m of this.quads){const b=r.serializeQuadComponents(this._componentWithCanonicalId(m.subject),m.predicate,this._componentWithCanonicalId(m.object),this._componentWithCanonicalId(m.graph));h.push(b)}return h.sort(),h.join("")}async hashFirstDegreeQuads(l){const u=[],f=this.blankNodeInfo.get(l),d=f.quads;for(const _ of d){const h={subject:null,predicate:_.predicate,object:null,graph:null};h.subject=this.modifyFirstDegreeComponent(l,_.subject,"subject"),h.object=this.modifyFirstDegreeComponent(l,_.object,"object"),h.graph=this.modifyFirstDegreeComponent(l,_.graph,"graph"),u.push(r.serializeQuad(h))}u.sort();const g=this.createMessageDigest();for(const _ of u)g.update(_);return f.hash=await g.digest(),f.hash}async hashRelatedBlankNode(l,u,f,d){let g;this.canonicalIssuer.hasId(l)?g=this.canonicalIssuer.getId(l):f.hasId(l)?g=f.getId(l):g=this.blankNodeInfo.get(l).hash;const _=this.createMessageDigest();return _.update(d),d!=="g"&&_.update(this.getRelatedPredicate(u)),_.update(g),_.digest()}async hashNDegreeQuads(l,u){const f=this.deepIterations.get(l)||0;if(f>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(l,f+1);const d=this.createMessageDigest(),g=await this.createHashToRelated(l,u),_=[...g.keys()].sort();for(const h of _){d.update(h);let m="",b;const T=new i(g.get(h));let A=0;for(;T.hasNext();){const N=T.next();++A%3===0&&await this._yield();let R=u.clone(),S="";const y=[];let x=!1;for(const P of N)if(this.canonicalIssuer.hasId(P)?S+=this.canonicalIssuer.getId(P):(R.hasId(P)||y.push(P),S+=R.getId(P)),m.length!==0&&S>m){x=!0;break}if(!x){for(const P of y){const B=await this.hashNDegreeQuads(P,R);if(S+=R.getId(P),S+=`<${B.hash}>`,R=B.issuer,m.length!==0&&S>m){x=!0;break}}x||(m.length===0||S<m)&&(m=S,b=R)}}d.update(m),u=b}return{hash:await d.digest(),issuer:u}}modifyFirstDegreeComponent(l,u){return u.termType!=="BlankNode"?u:{termType:"BlankNode",value:u.value===l?"_:a":"_:z"}}getRelatedPredicate(l){return`<${l.predicate.value}>`}async createHashToRelated(l,u){const f=new Map,d=this.blankNodeInfo.get(l).quads;let g=0;for(const _ of d)++g%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:_,component:_.subject,position:"s",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:_,component:_.object,position:"o",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:_,component:_.graph,position:"g",id:l,issuer:u,hashToRelated:f})]);return f}async _hashAndTrackBlankNode({id:l,hashToBlankNodes:u}){const f=await this.hashFirstDegreeQuads(l),d=u.get(f);d?d.push(l):u.set(f,[l])}_addBlankNodeQuadInfo({quad:l,component:u}){if(u.termType!=="BlankNode")return;const f=u.value,d=this.blankNodeInfo.get(f);d?d.quads.add(l):this.blankNodeInfo.set(f,{quads:new Set([l]),hash:null})}async _addRelatedBlankNodeHash({quad:l,component:u,position:f,id:d,issuer:g,hashToRelated:_}){if(!(u.termType==="BlankNode"&&u.value!==d))return;const h=u.value,m=await this.hashRelatedBlankNode(h,l,g,f),b=_.get(m);b?b.push(h):_.set(m,[h])}_componentWithCanonicalId(l){return l.termType==="BlankNode"&&!l.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(l.value)}:l}async _yield(){return new Promise(l=>setImmediate(l))}};function o(a,l){return a.hash<l.hash?-1:a.hash>l.hash?1:0}return pa}/*!
|
|
349
349
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
350
|
-
*/var
|
|
350
|
+
*/var ga,Lh;function T_(){if(Lh)return ga;Lh=1;const n=Xs(),e=zf();return ga=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(r,o,a){return o.termType!=="BlankNode"?o:a==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:o.value===r?"_:a":"_:z"}}getRelatedPredicate(r){return r.predicate.value}async createHashToRelated(r,o){const a=new Map,l=this.blankNodeInfo.get(r).quads;let u=0;for(const f of l){let d,g;if(f.subject.termType==="BlankNode"&&f.subject.value!==r)g=f.subject.value,d="p";else if(f.object.termType==="BlankNode"&&f.object.value!==r)g=f.object.value,d="r";else continue;++u%100===0&&await this._yield();const _=await this.hashRelatedBlankNode(g,f,o,d),h=a.get(_);h?h.push(g):a.set(_,[g])}return a}},ga}/*!
|
|
351
351
|
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
352
|
-
*/var
|
|
352
|
+
*/var ma,Ih;function Uf(){if(Ih)return ma;Ih=1;const n=Gl(),e=Xs(),i=qf(),r=Zl();ma=class{constructor({createMessageDigest:l=()=>new e("sha256"),canonicalIdMap:u=new Map,maxDeepIterations:f=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new n("_:c14n",u),this.createMessageDigest=l,this.maxDeepIterations=f,this.quads=null,this.deepIterations=null}main(l){this.deepIterations=new Map,this.quads=l;for(const h of l)this._addBlankNodeQuadInfo({quad:h,component:h.subject}),this._addBlankNodeQuadInfo({quad:h,component:h.object}),this._addBlankNodeQuadInfo({quad:h,component:h.graph});const u=new Map,f=[...this.blankNodeInfo.keys()];for(const h of f)this._hashAndTrackBlankNode({id:h,hashToBlankNodes:u});const d=[...u.keys()].sort(),g=[];for(const h of d){const m=u.get(h);if(m.length>1){g.push(m);continue}const b=m[0];this.canonicalIssuer.getId(b)}for(const h of g){const m=[];for(const b of h){if(this.canonicalIssuer.hasId(b))continue;const T=new n("_:b");T.getId(b);const A=this.hashNDegreeQuads(b,T);m.push(A)}m.sort(o);for(const b of m){const T=b.issuer.getOldIds();for(const A of T)this.canonicalIssuer.getId(A)}}const _=[];for(const h of this.quads){const m=r.serializeQuadComponents(this._componentWithCanonicalId({component:h.subject}),h.predicate,this._componentWithCanonicalId({component:h.object}),this._componentWithCanonicalId({component:h.graph}));_.push(m)}return _.sort(),_.join("")}hashFirstDegreeQuads(l){const u=[],f=this.blankNodeInfo.get(l),d=f.quads;for(const _ of d){const h={subject:null,predicate:_.predicate,object:null,graph:null};h.subject=this.modifyFirstDegreeComponent(l,_.subject,"subject"),h.object=this.modifyFirstDegreeComponent(l,_.object,"object"),h.graph=this.modifyFirstDegreeComponent(l,_.graph,"graph"),u.push(r.serializeQuad(h))}u.sort();const g=this.createMessageDigest();for(const _ of u)g.update(_);return f.hash=g.digest(),f.hash}hashRelatedBlankNode(l,u,f,d){let g;this.canonicalIssuer.hasId(l)?g=this.canonicalIssuer.getId(l):f.hasId(l)?g=f.getId(l):g=this.blankNodeInfo.get(l).hash;const _=this.createMessageDigest();return _.update(d),d!=="g"&&_.update(this.getRelatedPredicate(u)),_.update(g),_.digest()}hashNDegreeQuads(l,u){const f=this.deepIterations.get(l)||0;if(f>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(l,f+1);const d=this.createMessageDigest(),g=this.createHashToRelated(l,u),_=[...g.keys()].sort();for(const h of _){d.update(h);let m="",b;const T=new i(g.get(h));for(;T.hasNext();){const A=T.next();let N=u.clone(),R="";const S=[];let y=!1;for(const x of A)if(this.canonicalIssuer.hasId(x)?R+=this.canonicalIssuer.getId(x):(N.hasId(x)||S.push(x),R+=N.getId(x)),m.length!==0&&R>m){y=!0;break}if(!y){for(const x of S){const P=this.hashNDegreeQuads(x,N);if(R+=N.getId(x),R+=`<${P.hash}>`,N=P.issuer,m.length!==0&&R>m){y=!0;break}}y||(m.length===0||R<m)&&(m=R,b=N)}}d.update(m),u=b}return{hash:d.digest(),issuer:u}}modifyFirstDegreeComponent(l,u){return u.termType!=="BlankNode"?u:{termType:"BlankNode",value:u.value===l?"_:a":"_:z"}}getRelatedPredicate(l){return`<${l.predicate.value}>`}createHashToRelated(l,u){const f=new Map,d=this.blankNodeInfo.get(l).quads;for(const g of d)this._addRelatedBlankNodeHash({quad:g,component:g.subject,position:"s",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:g,component:g.object,position:"o",id:l,issuer:u,hashToRelated:f}),this._addRelatedBlankNodeHash({quad:g,component:g.graph,position:"g",id:l,issuer:u,hashToRelated:f});return f}_hashAndTrackBlankNode({id:l,hashToBlankNodes:u}){const f=this.hashFirstDegreeQuads(l),d=u.get(f);d?d.push(l):u.set(f,[l])}_addBlankNodeQuadInfo({quad:l,component:u}){if(u.termType!=="BlankNode")return;const f=u.value,d=this.blankNodeInfo.get(f);d?d.quads.add(l):this.blankNodeInfo.set(f,{quads:new Set([l]),hash:null})}_addRelatedBlankNodeHash({quad:l,component:u,position:f,id:d,issuer:g,hashToRelated:_}){if(!(u.termType==="BlankNode"&&u.value!==d))return;const h=u.value,m=this.hashRelatedBlankNode(h,l,g,f),b=_.get(m);b?b.push(h):_.set(m,[h])}_componentWithCanonicalId({component:l}){return l.termType==="BlankNode"&&!l.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(l.value)}:l}};function o(a,l){return a.hash<l.hash?-1:a.hash>l.hash?1:0}return ma}/*!
|
|
353
353
|
* Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
|
|
354
|
-
*/var fs,$l;function jf(){if($l)return fs;$l=1;const r=bi(),e=Wc();return fs=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(n,i,s){return i.termType!=="BlankNode"?i:s==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:i.value===n?"_:a":"_:z"}}getRelatedPredicate(n){return n.predicate.value}createHashToRelated(n,i){const s=new Map,a=this.blankNodeInfo.get(n).quads;for(const o of a){let u,l;if(o.subject.termType==="BlankNode"&&o.subject.value!==n)l=o.subject.value,u="p";else if(o.object.termType==="BlankNode"&&o.object.value!==n)l=o.object.value,u="r";else continue;const c=this.hashRelatedBlankNode(l,o,i,u),d=s.get(c);d?d.push(l):s.set(c,[l])}return s}},fs}const $f={},Ff=Object.freeze(Object.defineProperty({__proto__:null,default:$f},Symbol.toStringTag,{value:"Module"})),kf=ld(Ff);var Fl;function Pf(){return Fl||(Fl=1,(function(r){const e=Gc(),t=Cf(),n=Wc(),i=jf();let s;try{s=kf}catch{}function a(o){return Array.isArray(o)?o:r.NQuads.legacyDatasetToQuads(o)}r.NQuads=Ha(),r.IdentifierIssuer=Ua(),r._rdfCanonizeNative=function(o){return o&&(s=o),s},r.canonize=async function(o,u){const l=a(o);if(u.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(u.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((c,d)=>s.canonize(l,u,(b,y)=>b?d(b):c(y)))}if(u.algorithm==="URDNA2015")return new e(u).main(l);if(u.algorithm==="URGNA2012"){if(u.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new t(u).main(l)}throw"algorithm"in u?new Error("Invalid RDF Dataset Canonicalization algorithm: "+u.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},r._canonizeSync=function(o,u){const l=a(o);if(u.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(u.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(l,u)}if(u.algorithm==="URDNA2015")return new n(u).main(l);if(u.algorithm==="URGNA2012"){if(u.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(u).main(l)}throw"algorithm"in u?new Error("Invalid RDF Dataset Canonicalization algorithm: "+u.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}})(is)),is}var ps,kl;function Va(){return kl||(kl=1,ps=Pf()),ps}var gs,Pl;function dt(){if(Pl)return gs;Pl=1;const r={};return gs=r,r.isArray=Array.isArray,r.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]",r.isDouble=e=>r.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21),r.isEmptyObject=e=>r.isObject(e)&&Object.keys(e).length===0,r.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]",r.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),r.isObject=e=>Object.prototype.toString.call(e)==="[object Object]",r.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]",r.isUndefined=e=>typeof e>"u",gs}var ms,Ml;function Pt(){if(Ml)return ms;Ml=1;const r=dt(),e={};return ms=e,e.isSubject=t=>r.isObject(t)&&!("@value"in t||"@set"in t||"@list"in t)?Object.keys(t).length>1||!("@id"in t):!1,e.isSubjectReference=t=>r.isObject(t)&&Object.keys(t).length===1&&"@id"in t,e.isValue=t=>r.isObject(t)&&"@value"in t,e.isList=t=>r.isObject(t)&&"@list"in t,e.isGraph=t=>r.isObject(t)&&"@graph"in t&&Object.keys(t).filter(n=>n!=="@id"&&n!=="@index").length===1,e.isSimpleGraph=t=>e.isGraph(t)&&!("@id"in t),e.isBlankNode=t=>{if(r.isObject(t)){if("@id"in t){const n=t["@id"];return!r.isString(n)||n.indexOf("_:")===0}return Object.keys(t).length===0||!("@value"in t||"@set"in t||"@list"in t)}return!1},ms}var ys,Bl;function pt(){return Bl||(Bl=1,ys=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",t="jsonld.Error",n={}){super(e),this.name=t,this.message=e,this.details=n}}),ys}var bs,ql;function ht(){if(ql)return bs;ql=1;const r=Pt(),e=dt(),t=Va().IdentifierIssuer,n=pt(),i=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,a=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,o=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u=/^@[a-zA-Z]+$/,l={headers:{accept:"application/ld+json, application/json"}},c={};bs=c,c.IdentifierIssuer=t,c.REGEX_BCP47=i,c.REGEX_KEYWORD=u,c.clone=function(b){if(b&&typeof b=="object"){let y;if(e.isArray(b)){y=[];for(let _=0;_<b.length;++_)y[_]=c.clone(b[_])}else if(b instanceof Map){y=new Map;for(const[_,E]of b)y.set(_,c.clone(E))}else if(b instanceof Set){y=new Set;for(const _ of b)y.add(c.clone(_))}else if(e.isObject(b)){y={};for(const _ in b)y[_]=c.clone(b[_])}else y=b.toString();return y}return b},c.asArray=function(b){return Array.isArray(b)?b:[b]},c.buildHeaders=(b={})=>{if(Object.keys(b).some(_=>_.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+l.headers.accept+'" is supported.');return Object.assign({Accept:l.headers.accept},b)},c.parseLinkHeader=b=>{const y={},_=b.match(s);for(let E=0;E<_.length;++E){let v=_[E].match(a);if(!v)continue;const x={target:v[1]},S=v[2];for(;v=o.exec(S);)x[v[1]]=v[2]===void 0?v[3]:v[2];const m=x.rel||"";Array.isArray(y[m])?y[m].push(x):y.hasOwnProperty(m)?y[m]=[y[m],x]:y[m]=x}return y},c.validateTypeValue=(b,y)=>{if(!e.isString(b)&&!(e.isArray(b)&&b.every(_=>e.isString(_)))){if(y&&e.isObject(b))switch(Object.keys(b).length){case 0:return;case 1:if("@default"in b&&c.asArray(b["@default"]).every(_=>e.isString(_)))return}throw new n('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:b})}},c.hasProperty=(b,y)=>{if(b.hasOwnProperty(y)){const _=b[y];return!e.isArray(_)||_.length>0}return!1},c.hasValue=(b,y,_)=>{if(c.hasProperty(b,y)){let E=b[y];const v=r.isList(E);if(e.isArray(E)||v){v&&(E=E["@list"]);for(let x=0;x<E.length;++x)if(c.compareValues(_,E[x]))return!0}else if(!e.isArray(_))return c.compareValues(_,E)}return!1},c.addValue=(b,y,_,E)=>{if(E=E||{},"propertyIsArray"in E||(E.propertyIsArray=!1),"valueIsArray"in E||(E.valueIsArray=!1),"allowDuplicate"in E||(E.allowDuplicate=!0),"prependValue"in E||(E.prependValue=!1),E.valueIsArray)b[y]=_;else if(e.isArray(_)){_.length===0&&E.propertyIsArray&&!b.hasOwnProperty(y)&&(b[y]=[]),E.prependValue&&(_=_.concat(b[y]),b[y]=[]);for(let v=0;v<_.length;++v)c.addValue(b,y,_[v],E)}else if(b.hasOwnProperty(y)){const v=!E.allowDuplicate&&c.hasValue(b,y,_);!e.isArray(b[y])&&(!v||E.propertyIsArray)&&(b[y]=[b[y]]),v||(E.prependValue?b[y].unshift(_):b[y].push(_))}else b[y]=E.propertyIsArray?[_]:_},c.getValues=(b,y)=>[].concat(b[y]||[]),c.removeProperty=(b,y)=>{delete b[y]},c.removeValue=(b,y,_,E)=>{E=E||{},"propertyIsArray"in E||(E.propertyIsArray=!1);const v=c.getValues(b,y).filter(x=>!c.compareValues(x,_));v.length===0?c.removeProperty(b,y):v.length===1&&!E.propertyIsArray?b[y]=v[0]:b[y]=v},c.relabelBlankNodes=(b,y)=>{y=y||{};const _=y.issuer||new t("_:b");return d(_,b)},c.compareValues=(b,y)=>b===y||r.isValue(b)&&r.isValue(y)&&b["@value"]===y["@value"]&&b["@type"]===y["@type"]&&b["@language"]===y["@language"]&&b["@index"]===y["@index"]?!0:e.isObject(b)&&"@id"in b&&e.isObject(y)&&"@id"in y?b["@id"]===y["@id"]:!1,c.compareShortestLeast=(b,y)=>b.length<y.length?-1:y.length<b.length?1:b===y?0:b<y?-1:1;function d(b,y){if(e.isArray(y))for(let _=0;_<y.length;++_)y[_]=d(b,y[_]);else if(r.isList(y))y["@list"]=d(b,y["@list"]);else if(e.isObject(y)){r.isBlankNode(y)&&(y["@id"]=b.getId(y["@id"]));const _=Object.keys(y).sort();for(let E=0;E<_.length;++E){const v=_[E];v!=="@id"&&(y[v]=d(b,y[v]))}}return y}return bs}var _s,Ul;function Ga(){if(Ul)return _s;Ul=1;const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return _s={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:r,RDF_LIST:r+"List",RDF_FIRST:r+"first",RDF_REST:r+"rest",RDF_NIL:r+"nil",RDF_TYPE:r+"type",RDF_PLAIN_LITERAL:r+"PlainLiteral",RDF_XML_LITERAL:r+"XMLLiteral",RDF_JSON_LITERAL:r+"JSON",RDF_OBJECT:r+"object",RDF_LANGSTRING:r+"langString",XSD:e,XSD_BOOLEAN:e+"boolean",XSD_DOUBLE:e+"double",XSD_INTEGER:e+"integer",XSD_STRING:e+"string"},_s}var ws,Hl;function zc(){return Hl||(Hl=1,ws=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}),ws}var vs,Vl;function Jt(){if(Vl)return vs;Vl=1;const r=dt(),e={};vs=e,e.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.parse=(n,i)=>{const s={},a=e.parsers[i||"full"],o=a.regex.exec(n);let u=a.keys.length;for(;u--;)s[a.keys[u]]=o[u]===void 0?null:o[u];return(s.scheme==="https"&&s.port==="443"||s.scheme==="http"&&s.port==="80")&&(s.href=s.href.replace(":"+s.port,""),s.authority=s.authority.replace(":"+s.port,""),s.port=null),s.normalizedPath=e.removeDotSegments(s.path),s},e.prependBase=(n,i)=>{if(n===null||e.isAbsolute(i))return i;(!n||r.isString(n))&&(n=e.parse(n||""));const s=e.parse(i),a={protocol:n.protocol||""};if(s.authority!==null)a.authority=s.authority,a.path=s.path,a.query=s.query;else if(a.authority=n.authority,s.path==="")a.path=n.path,s.query!==null?a.query=s.query:a.query=n.query;else{if(s.path.indexOf("/")===0)a.path=s.path;else{let u=n.path;u=u.substr(0,u.lastIndexOf("/")+1),(u.length>0||n.authority)&&u.substr(-1)!=="/"&&(u+="/"),u+=s.path,a.path=u}a.query=s.query}s.path!==""&&(a.path=e.removeDotSegments(a.path));let o=a.protocol;return a.authority!==null&&(o+="//"+a.authority),o+=a.path,a.query!==null&&(o+="?"+a.query),s.fragment!==null&&(o+="#"+s.fragment),o===""&&(o="./"),o},e.removeBase=(n,i)=>{if(n===null)return i;(!n||r.isString(n))&&(n=e.parse(n||""));let s="";if(n.href!==""?s+=(n.protocol||"")+"//"+(n.authority||""):i.indexOf("//")&&(s+="//"),i.indexOf(s)!==0)return i;const a=e.parse(i.substr(s.length)),o=n.normalizedPath.split("/"),u=a.normalizedPath.split("/"),l=a.fragment||a.query?0:1;for(;o.length>0&&u.length>l&&o[0]===u[0];)o.shift(),u.shift();let c="";if(o.length>0){o.pop();for(let d=0;d<o.length;++d)c+="../"}return c+=u.join("/"),a.query!==null&&(c+="?"+a.query),a.fragment!==null&&(c+="#"+a.fragment),c===""&&(c="./"),c},e.removeDotSegments=n=>{if(n.length===0)return"";const i=n.split("/"),s=[];for(;i.length>0;){const a=i.shift(),o=i.length===0;if(a==="."){o&&s.push("");continue}if(a===".."){s.pop(),o&&s.push("");continue}s.push(a)}return n[0]==="/"&&s.length>0&&s[0]!==""&&s.unshift(""),s.length===1&&s[0]===""?"/":s.join("/")};const t=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return e.isAbsolute=n=>r.isString(n)&&t.test(n),e.isRelative=n=>r.isString(n),vs}var xs,Gl;function Mf(){if(Gl)return xs;Gl=1;const{parseLinkHeader:r,buildHeaders:e}=ht(),{LINK_HEADER_CONTEXT:t}=Ga(),n=pt(),i=zc(),{prependBase:s}=Jt(),a=/(^|(\r\n))link:/i;xs=({secure:u,headers:l={},xhr:c}={headers:{}})=>{return l=e(l),new i().wrapLoader(b);async function b(y){if(y.indexOf("http:")!==0&&y.indexOf("https:")!==0)throw new n('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:y});if(u&&y.indexOf("https")!==0)throw new n(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:y});let _;try{_=await o(c,y,l)}catch(m){throw new n("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:y,cause:m})}if(_.status>=400)throw new n("URL could not be dereferenced: "+_.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:y,httpStatusCode:_.status});let E={contextUrl:null,documentUrl:y,document:_.response},v=null;const x=_.getResponseHeader("Content-Type");let S;if(a.test(_.getAllResponseHeaders())&&(S=_.getResponseHeader("Link")),S&&x!=="application/ld+json"){const m=r(S),h=m[t];if(Array.isArray(h))throw new n("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:y});h&&(E.contextUrl=h.target),v=m.alternate,v&&v.type=="application/ld+json"&&!(x||"").match(/^application\/(\w*\+)?json$/)&&(E=await b(s(y,v.target)))}return E}};function o(u,l,c){u=u||XMLHttpRequest;const d=new u;return new Promise((b,y)=>{d.onload=()=>b(d),d.onerror=_=>y(_),d.open("GET",l,!0);for(const _ in c)d.setRequestHeader(_,c[_]);d.send()})}return xs}var Es,Wl;function Bf(){if(Wl)return Es;Wl=1;const r=Mf(),e={};return Es=e,e.setupDocumentLoaders=function(t){typeof XMLHttpRequest<"u"&&(t.documentLoaders.xhr=r,t.useDocumentLoader("xhr"))},e.setupGlobals=function(t){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})},Es}var Ss,zl;function qf(){return zl||(zl=1,Ss=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Ss}var Is,Ql;function Uf(){if(Ql)return Is;Ql=1,Is=r,r.Node=i,r.create=r;function r(s){var a=this;if(a instanceof r||(a=new r),a.tail=null,a.head=null,a.length=0,s&&typeof s.forEach=="function")s.forEach(function(l){a.push(l)});else if(arguments.length>0)for(var o=0,u=arguments.length;o<u;o++)a.push(arguments[o]);return a}r.prototype.removeNode=function(s){if(s.list!==this)throw new Error("removing node which does not belong to this list");var a=s.next,o=s.prev;return a&&(a.prev=o),o&&(o.next=a),s===this.head&&(this.head=a),s===this.tail&&(this.tail=o),s.list.length--,s.next=null,s.prev=null,s.list=null,a},r.prototype.unshiftNode=function(s){if(s!==this.head){s.list&&s.list.removeNode(s);var a=this.head;s.list=this,s.next=a,a&&(a.prev=s),this.head=s,this.tail||(this.tail=s),this.length++}},r.prototype.pushNode=function(s){if(s!==this.tail){s.list&&s.list.removeNode(s);var a=this.tail;s.list=this,s.prev=a,a&&(a.next=s),this.tail=s,this.head||(this.head=s),this.length++}},r.prototype.push=function(){for(var s=0,a=arguments.length;s<a;s++)t(this,arguments[s]);return this.length},r.prototype.unshift=function(){for(var s=0,a=arguments.length;s<a;s++)n(this,arguments[s]);return this.length},r.prototype.pop=function(){if(this.tail){var s=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,s}},r.prototype.shift=function(){if(this.head){var s=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,s}},r.prototype.forEach=function(s,a){a=a||this;for(var o=this.head,u=0;o!==null;u++)s.call(a,o.value,u,this),o=o.next},r.prototype.forEachReverse=function(s,a){a=a||this;for(var o=this.tail,u=this.length-1;o!==null;u--)s.call(a,o.value,u,this),o=o.prev},r.prototype.get=function(s){for(var a=0,o=this.head;o!==null&&a<s;a++)o=o.next;if(a===s&&o!==null)return o.value},r.prototype.getReverse=function(s){for(var a=0,o=this.tail;o!==null&&a<s;a++)o=o.prev;if(a===s&&o!==null)return o.value},r.prototype.map=function(s,a){a=a||this;for(var o=new r,u=this.head;u!==null;)o.push(s.call(a,u.value,this)),u=u.next;return o},r.prototype.mapReverse=function(s,a){a=a||this;for(var o=new r,u=this.tail;u!==null;)o.push(s.call(a,u.value,this)),u=u.prev;return o},r.prototype.reduce=function(s,a){var o,u=this.head;if(arguments.length>1)o=a;else if(this.head)u=this.head.next,o=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var l=0;u!==null;l++)o=s(o,u.value,l),u=u.next;return o},r.prototype.reduceReverse=function(s,a){var o,u=this.tail;if(arguments.length>1)o=a;else if(this.tail)u=this.tail.prev,o=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var l=this.length-1;u!==null;l--)o=s(o,u.value,l),u=u.prev;return o},r.prototype.toArray=function(){for(var s=new Array(this.length),a=0,o=this.head;o!==null;a++)s[a]=o.value,o=o.next;return s},r.prototype.toArrayReverse=function(){for(var s=new Array(this.length),a=0,o=this.tail;o!==null;a++)s[a]=o.value,o=o.prev;return s},r.prototype.slice=function(s,a){a=a||this.length,a<0&&(a+=this.length),s=s||0,s<0&&(s+=this.length);var o=new r;if(a<s||a<0)return o;s<0&&(s=0),a>this.length&&(a=this.length);for(var u=0,l=this.head;l!==null&&u<s;u++)l=l.next;for(;l!==null&&u<a;u++,l=l.next)o.push(l.value);return o},r.prototype.sliceReverse=function(s,a){a=a||this.length,a<0&&(a+=this.length),s=s||0,s<0&&(s+=this.length);var o=new r;if(a<s||a<0)return o;s<0&&(s=0),a>this.length&&(a=this.length);for(var u=this.length,l=this.tail;l!==null&&u>a;u--)l=l.prev;for(;l!==null&&u>s;u--,l=l.prev)o.push(l.value);return o},r.prototype.splice=function(s,a,...o){s>this.length&&(s=this.length-1),s<0&&(s=this.length+s);for(var u=0,l=this.head;l!==null&&u<s;u++)l=l.next;for(var c=[],u=0;l&&u<a;u++)c.push(l.value),l=this.removeNode(l);l===null&&(l=this.tail),l!==this.head&&l!==this.tail&&(l=l.prev);for(var u=0;u<o.length;u++)l=e(this,l,o[u]);return c},r.prototype.reverse=function(){for(var s=this.head,a=this.tail,o=s;o!==null;o=o.prev){var u=o.prev;o.prev=o.next,o.next=u}return this.head=a,this.tail=s,this};function e(s,a,o){var u=a===s.head?new i(o,null,a,s):new i(o,a,a.next,s);return u.next===null&&(s.tail=u),u.prev===null&&(s.head=u),s.length++,u}function t(s,a){s.tail=new i(a,s.tail,null,s),s.head||(s.head=s.tail),s.length++}function n(s,a){s.head=new i(a,null,s.head,s),s.tail||(s.tail=s.head),s.length++}function i(s,a,o,u){if(!(this instanceof i))return new i(s,a,o,u);this.list=u,this.value=s,a?(a.next=this,this.prev=a):this.prev=null,o?(o.prev=this,this.next=o):this.next=null}try{qf()(r)}catch{}return Is}var Ns,Xl;function Qc(){if(Xl)return Ns;Xl=1;const r=Uf(),e=Symbol("max"),t=Symbol("length"),n=Symbol("lengthCalculator"),i=Symbol("allowStale"),s=Symbol("maxAge"),a=Symbol("dispose"),o=Symbol("noDisposeOnSet"),u=Symbol("lruList"),l=Symbol("cache"),c=Symbol("updateAgeOnGet"),d=()=>1;class b{constructor(h){if(typeof h=="number"&&(h={max:h}),h||(h={}),h.max&&(typeof h.max!="number"||h.max<0))throw new TypeError("max must be a non-negative number");this[e]=h.max||1/0;const g=h.length||d;if(this[n]=typeof g!="function"?d:g,this[i]=h.stale||!1,h.maxAge&&typeof h.maxAge!="number")throw new TypeError("maxAge must be a number");this[s]=h.maxAge||0,this[a]=h.dispose,this[o]=h.noDisposeOnSet||!1,this[c]=h.updateAgeOnGet||!1,this.reset()}set max(h){if(typeof h!="number"||h<0)throw new TypeError("max must be a non-negative number");this[e]=h||1/0,E(this)}get max(){return this[e]}set allowStale(h){this[i]=!!h}get allowStale(){return this[i]}set maxAge(h){if(typeof h!="number")throw new TypeError("maxAge must be a non-negative number");this[s]=h,E(this)}get maxAge(){return this[s]}set lengthCalculator(h){typeof h!="function"&&(h=d),h!==this[n]&&(this[n]=h,this[t]=0,this[u].forEach(g=>{g.length=this[n](g.value,g.key),this[t]+=g.length})),E(this)}get lengthCalculator(){return this[n]}get length(){return this[t]}get itemCount(){return this[u].length}rforEach(h,g){g=g||this;for(let N=this[u].tail;N!==null;){const C=N.prev;S(this,h,N,g),N=C}}forEach(h,g){g=g||this;for(let N=this[u].head;N!==null;){const C=N.next;S(this,h,N,g),N=C}}keys(){return this[u].toArray().map(h=>h.key)}values(){return this[u].toArray().map(h=>h.value)}reset(){this[a]&&this[u]&&this[u].length&&this[u].forEach(h=>this[a](h.key,h.value)),this[l]=new Map,this[u]=new r,this[t]=0}dump(){return this[u].map(h=>_(this,h)?!1:{k:h.key,v:h.value,e:h.now+(h.maxAge||0)}).toArray().filter(h=>h)}dumpLru(){return this[u]}set(h,g,N){if(N=N||this[s],N&&typeof N!="number")throw new TypeError("maxAge must be a number");const C=N?Date.now():0,A=this[n](g,h);if(this[l].has(h)){if(A>this[e])return v(this,this[l].get(h)),!1;const F=this[l].get(h).value;return this[a]&&(this[o]||this[a](h,F.value)),F.now=C,F.maxAge=N,F.value=g,this[t]+=A-F.length,F.length=A,this.get(h),E(this),!0}const B=new x(h,g,A,C,N);return B.length>this[e]?(this[a]&&this[a](h,g),!1):(this[t]+=B.length,this[u].unshift(B),this[l].set(h,this[u].head),E(this),!0)}has(h){if(!this[l].has(h))return!1;const g=this[l].get(h).value;return!_(this,g)}get(h){return y(this,h,!0)}peek(h){return y(this,h,!1)}pop(){const h=this[u].tail;return h?(v(this,h),h.value):null}del(h){v(this,this[l].get(h))}load(h){this.reset();const g=Date.now();for(let N=h.length-1;N>=0;N--){const C=h[N],A=C.e||0;if(A===0)this.set(C.k,C.v);else{const B=A-g;B>0&&this.set(C.k,C.v,B)}}}prune(){this[l].forEach((h,g)=>y(this,g,!1))}}const y=(m,h,g)=>{const N=m[l].get(h);if(N){const C=N.value;if(_(m,C)){if(v(m,N),!m[i])return}else g&&(m[c]&&(N.value.now=Date.now()),m[u].unshiftNode(N));return C.value}},_=(m,h)=>{if(!h||!h.maxAge&&!m[s])return!1;const g=Date.now()-h.now;return h.maxAge?g>h.maxAge:m[s]&&g>m[s]},E=m=>{if(m[t]>m[e])for(let h=m[u].tail;m[t]>m[e]&&h!==null;){const g=h.prev;v(m,h),h=g}},v=(m,h)=>{if(h){const g=h.value;m[a]&&m[a](g.key,g.value),m[t]-=g.length,m[l].delete(g.key),m[u].removeNode(h)}};class x{constructor(h,g,N,C,A){this.key=h,this.value=g,this.length=N,this.now=C,this.maxAge=A||0}}const S=(m,h,g,N)=>{let C=g.value;_(m,C)&&(v(m,g),m[i]||(C=void 0)),C&&h.call(N,C.value,C.key,m)};return Ns=b,Ns}var Rs,Jl;function Hf(){if(Jl)return Rs;Jl=1;const r=Qc(),e=10;return Rs=class{constructor({document:n}){this.document=n,this.cache=new r({max:e})}getProcessed(n){return this.cache.get(n)}setProcessed(n,i){this.cache.set(n,i)}},Rs}var Ts,Kl;function Vf(){if(Kl)return Ts;Kl=1;const{isArray:r,isObject:e,isString:t}=dt(),{asArray:n}=ht(),{prependBase:i}=Jt(),s=pt(),a=Hf(),o=10;Ts=class{constructor({sharedCache:d}){this.perOpCache=new Map,this.sharedCache=d}async resolve({activeCtx:d,context:b,documentLoader:y,base:_,cycles:E=new Set}){b&&e(b)&&b["@context"]&&(b=b["@context"]),b=n(b);const v=[];for(const x of b){if(t(x)){let h=this._get(x);h||(h=await this._resolveRemoteContext({activeCtx:d,url:x,documentLoader:y,base:_,cycles:E})),r(h)?v.push(...h):v.push(h);continue}if(x===null){v.push(new a({document:null}));continue}e(x)||u(b);const S=JSON.stringify(x);let m=this._get(S);m||(m=new a({document:x}),this._cacheResolvedContext({key:S,resolved:m,tag:"static"})),v.push(m)}return v}_get(d){let b=this.perOpCache.get(d);if(!b){const y=this.sharedCache.get(d);y&&(b=y.get("static"),b&&this.perOpCache.set(d,b))}return b}_cacheResolvedContext({key:d,resolved:b,tag:y}){if(this.perOpCache.set(d,b),y!==void 0){let _=this.sharedCache.get(d);_||(_=new Map,this.sharedCache.set(d,_)),_.set(y,b)}return b}async _resolveRemoteContext({activeCtx:d,url:b,documentLoader:y,base:_,cycles:E}){b=i(_,b);const{context:v,remoteDoc:x}=await this._fetchContext({activeCtx:d,url:b,documentLoader:y,cycles:E});_=x.documentUrl||b,l({context:v,base:_});const S=await this.resolve({activeCtx:d,context:v,documentLoader:y,base:_,cycles:E});return this._cacheResolvedContext({key:b,resolved:S,tag:x.tag}),S}async _fetchContext({activeCtx:d,url:b,documentLoader:y,cycles:_}){if(_.size>o)throw new s("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:d.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:o});if(_.has(b))throw new s("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:d.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:b});_.add(b);let E,v;try{v=await y(b),E=v.document||null,t(E)&&(E=JSON.parse(E))}catch(x){throw new s(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${b}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:b,cause:x})}if(!e(E))throw new s(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${b}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:b});return"@context"in E?E={"@context":E["@context"]}:E={"@context":{}},v.contextUrl&&(r(E["@context"])||(E["@context"]=[E["@context"]]),E["@context"].push(v.contextUrl)),{context:E,remoteDoc:v}}};function u(c){throw new s("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:c})}function l({context:c,base:d}){if(!c)return;const b=c["@context"];if(t(b)){c["@context"]=i(d,b);return}if(r(b)){for(let y=0;y<b.length;++y){const _=b[y];if(t(_)){b[y]=i(d,_);continue}e(_)&&l({context:{"@context":_},base:d})}return}if(e(b))for(const y in b)l({context:b[y],base:d})}return Ts}var As,Yl;function Gf(){return Yl||(Yl=1,As=Va().NQuads),As}var Ds,Zl;function Dn(){if(Zl)return Ds;Zl=1;const r=pt(),{isArray:e}=dt(),{asArray:t}=ht(),n={};Ds=n,n.defaultEventHandler=null,n.setupEventHandler=({options:a={}})=>{const o=[].concat(a.safe?n.safeEventHandler:[],a.eventHandler?t(a.eventHandler):[],n.defaultEventHandler?n.defaultEventHandler:[]);return o.length===0?null:o},n.handleEvent=({event:a,options:o})=>{i({event:a,handlers:o.eventHandler})};function i({event:a,handlers:o}){let u=!0;for(let l=0;u&&l<o.length;++l){u=!1;const c=o[l];if(e(c))u=i({event:a,handlers:c});else if(typeof c=="function")c({event:a,next:()=>{u=!0}});else if(typeof c=="object")a.code in c?c[a.code]({event:a,next:()=>{u=!0}}):u=!0;else throw new r("Invalid event handler.","jsonld.InvalidEventHandler",{event:a})}return u}const s=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);return n.safeEventHandler=function({event:o,next:u}){if(o.level==="warning"&&s.has(o.code))throw new r("Safe mode validation error.","jsonld.ValidationError",{event:o});u()},n.logEventHandler=function({event:o,next:u}){console.log(`EVENT: ${o.message}`,{event:o}),u()},n.logWarningEventHandler=function({event:o,next:u}){o.level==="warning"&&console.warn(`WARNING: ${o.message}`,{event:o}),u()},n.unhandledEventHandler=function({event:o}){throw new r("No handler for event.","jsonld.UnhandledEvent",{event:o})},n.setDefaultEventHandler=function({eventHandler:a}={}){n.defaultEventHandler=a?t(a):null},Ds}var Ls,eu;function hr(){if(eu)return Ls;eu=1;const r=ht(),e=pt(),{isArray:t,isObject:n,isString:i,isUndefined:s}=dt(),{isAbsolute:a,isRelative:o,prependBase:u}=Jt(),{handleEvent:l}=Dn(),{REGEX_BCP47:c,REGEX_KEYWORD:d,asArray:b,compareShortestLeast:y}=ht(),_=new Map,E=1e4,v={};Ls=v,v.process=async({activeCtx:m,localCtx:h,options:g,propagate:N=!0,overrideProtected:C=!1,cycles:A=new Set})=>{if(n(h)&&"@context"in h&&t(h["@context"])&&(h=h["@context"]),b(h).length===0)return m;const R=[],F=[({event:te,next:T})=>{R.push(te),T()}];g.eventHandler&&F.push(g.eventHandler);const q=g;g={...g,eventHandler:F};const D=await g.contextResolver.resolve({activeCtx:m,context:h,documentLoader:g.documentLoader,base:g.base});n(D[0].document)&&typeof D[0].document["@propagate"]=="boolean"&&(N=D[0].document["@propagate"]);let L=m;!N&&!L.previousContext&&(L=L.clone(),L.previousContext=m);for(const te of D){let{document:T}=te;if(m=L,T===null){if(!C&&Object.keys(m.protected).length!==0)throw new e("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});L=m=v.getInitialContext(g).clone();continue}const Z=te.getProcessed(m);if(Z){if(q.eventHandler)for(const Y of Z.events)l({event:Y,options:q});L=m=Z.context;continue}if(n(T)&&"@context"in T&&(T=T["@context"]),!n(T))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:T});L=L.clone();const k=new Map;if("@version"in T){if(T["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+T["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:T});if(m.processingMode&&m.processingMode==="json-ld-1.0")throw new e("@version: "+T["@version"]+" not compatible with "+m.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:T});L.processingMode="json-ld-1.1",L["@version"]=T["@version"],k.set("@version",!0)}if(L.processingMode=L.processingMode||m.processingMode,"@base"in T){let Y=T["@base"];if(!(Y===null||a(Y)))if(o(Y))Y=u(L["@base"],Y);else throw new e('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:T});L["@base"]=Y,k.set("@base",!0)}if("@vocab"in T){const Y=T["@vocab"];if(Y===null)delete L["@vocab"];else if(i(Y)){if(!a(Y)&&v.processingMode(L,1))throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:T});{const w=x(L,Y,{vocab:!0,base:!0},void 0,void 0,g);a(w)||g.eventHandler&&l({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:w}},options:g}),L["@vocab"]=w}}else throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:T});k.set("@vocab",!0)}if("@language"in T){const Y=T["@language"];if(Y===null)delete L["@language"];else if(i(Y))Y.match(c)||g.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:Y}},options:g}),L["@language"]=Y.toLowerCase();else throw new e('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:T});k.set("@language",!0)}if("@direction"in T){const Y=T["@direction"];if(m.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+m.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:T});if(Y===null)delete L["@direction"];else{if(Y!=="ltr"&&Y!=="rtl")throw new e('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:T});L["@direction"]=Y}k.set("@direction",!0)}if("@propagate"in T){const Y=T["@propagate"];if(m.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+m.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:T});if(typeof Y!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:h});k.set("@propagate",!0)}if("@import"in T){const Y=T["@import"];if(m.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+m.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:T});if(!i(Y))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:h});const w=await g.contextResolver.resolve({activeCtx:m,context:Y,documentLoader:g.documentLoader,base:g.base});if(w.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:h});const H=w[0].getProcessed(m);if(H)T=H;else{const K=w[0].document;if("@import"in K)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:h});for(const Q in K)T.hasOwnProperty(Q)||(T[Q]=K[Q]);w[0].setProcessed(m,T)}k.set("@import",!0)}k.set("@protected",T["@protected"]||!1);for(const Y in T)if(v.createTermDefinition({activeCtx:L,localCtx:T,term:Y,defined:k,options:g,overrideProtected:C}),n(T[Y])&&"@context"in T[Y]){const w=T[Y]["@context"];let H=!0;if(i(w)){const K=u(g.base,w);A.has(K)?H=!1:A.add(K)}if(H)try{await v.process({activeCtx:L.clone(),localCtx:T[Y]["@context"],overrideProtected:!0,options:g,cycles:A})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:T[Y]["@context"],term:Y})}}te.setProcessed(m,{context:L,events:R})}return L},v.createTermDefinition=({activeCtx:m,localCtx:h,term:g,defined:N,options:C,overrideProtected:A=!1})=>{if(N.has(g)){if(N.get(g))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:h,term:g})}N.set(g,!1);let B;if(h.hasOwnProperty(g)&&(B=h[g]),g==="@type"&&n(B)&&(B["@container"]||"@set")==="@set"&&v.processingMode(m,1.1)){const T=["@container","@id","@protected"],Z=Object.keys(B);if(Z.length===0||Z.some(k=>!T.includes(k)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:h,term:g})}else{if(v.isKeyword(g))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:h,term:g});if(g.match(d)){C.eventHandler&&l({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:g}},options:C});return}else if(g==="")throw new e("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:h})}const R=m.mappings.get(g);m.mappings.has(g)&&m.mappings.delete(g);let F=!1;if((i(B)||B===null)&&(F=!0,B={"@id":B}),!n(B))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:h});const q={};m.mappings.set(g,q),q.reverse=!1;const D=["@container","@id","@language","@reverse","@type"];v.processingMode(m,1.1)&&D.push("@context","@direction","@index","@nest","@prefix","@protected");for(const T in B)if(!D.includes(T))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+T,"jsonld.SyntaxError",{code:"invalid term definition",context:h});const L=g.indexOf(":");if(q._termHasColon=L>0,"@reverse"in B){if("@id"in B)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:h});if("@nest"in B)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:h});const T=B["@reverse"];if(!i(T))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:h});if(T.match(d)){C.eventHandler&&l({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:T}},options:C}),R?m.mappings.set(g,R):m.mappings.delete(g);return}const Z=x(m,T,{vocab:!0,base:!1},h,N,C);if(!a(Z))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:h});q["@id"]=Z,q.reverse=!0}else if("@id"in B){let T=B["@id"];if(T&&!i(T))throw new e("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:h});if(T===null)q["@id"]=null;else if(!v.isKeyword(T)&&T.match(d)){C.eventHandler&&l({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:T}},options:C}),R?m.mappings.set(g,R):m.mappings.delete(g);return}else if(T!==g){if(T=x(m,T,{vocab:!0,base:!1},h,N,C),!a(T)&&!v.isKeyword(T))throw new e("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:h});if(g.match(/(?::[^:])|\//)){const Z=new Map(N).set(g,!0);if(x(m,g,{vocab:!0,base:!1},h,Z,C)!==T)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:h})}q["@id"]=T,q._prefix=F&&!q._termHasColon&&T.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in q))if(q._termHasColon){const T=g.substr(0,L);if(h.hasOwnProperty(T)&&v.createTermDefinition({activeCtx:m,localCtx:h,term:T,defined:N,options:C}),m.mappings.has(T)){const Z=g.substr(L+1);q["@id"]=m.mappings.get(T)["@id"]+Z}else q["@id"]=g}else if(g==="@type")q["@id"]=g;else{if(!("@vocab"in m))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:h,term:g});q["@id"]=m["@vocab"]+g}if((B["@protected"]===!0||N.get("@protected")===!0&&B["@protected"]!==!1)&&(m.protected[g]=!0,q.protected=!0),N.set(g,!0),"@type"in B){let T=B["@type"];if(!i(T))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:h});if(T==="@json"||T==="@none"){if(v.processingMode(m,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${T}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:h})}else if(T!=="@id"&&T!=="@vocab"){if(T=x(m,T,{vocab:!0,base:!1},h,N,C),!a(T))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:h});if(T.indexOf("_:")===0)throw new e("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:h})}q["@type"]=T}if("@container"in B){const T=i(B["@container"])?[B["@container"]]:B["@container"]||[],Z=["@list","@set","@index","@language"];let k=!0;const Y=T.includes("@set");if(v.processingMode(m,1.1)){if(Z.push("@graph","@id","@type"),T.includes("@list")){if(T.length!==1)throw new e("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:h})}else if(T.includes("@graph")){if(T.some(w=>w!=="@graph"&&w!=="@id"&&w!=="@index"&&w!=="@set"))throw new e("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:h})}else k&=T.length<=(Y?2:1);if(T.includes("@type")&&(q["@type"]=q["@type"]||"@id",!["@id","@vocab"].includes(q["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:h})}else k&=!t(B["@container"]),k&=T.length<=1;if(k&=T.every(w=>Z.includes(w)),k&=!(Y&&T.includes("@list")),!k)throw new e("Invalid JSON-LD syntax; @context @container value must be one of the following: "+Z.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:h});if(q.reverse&&!T.every(w=>["@index","@set"].includes(w)))throw new e("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:h});q["@container"]=T}if("@index"in B){if(!("@container"in B)||!q["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${B["@index"]}" on term "${g}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:h});if(!i(B["@index"])||B["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${B["@index"]}" on term "${g}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:h});q["@index"]=B["@index"]}if("@context"in B&&(q["@context"]=B["@context"]),"@language"in B&&!("@type"in B)){let T=B["@language"];if(T!==null&&!i(T))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:h});T!==null&&(T=T.toLowerCase()),q["@language"]=T}if("@prefix"in B){if(g.match(/:|\//))throw new e("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:h});if(v.isKeyword(q["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:h});if(typeof B["@prefix"]=="boolean")q._prefix=B["@prefix"]===!0;else throw new e("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:h})}if("@direction"in B){const T=B["@direction"];if(T!==null&&T!=="ltr"&&T!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:h});q["@direction"]=T}if("@nest"in B){const T=B["@nest"];if(!i(T)||T!=="@nest"&&T.indexOf("@")===0)throw new e("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:h});q["@nest"]=T}// disallow aliasing @context and @preserve
|
|
355
|
-
const te=q["@id"];if(te==="@context"||te==="@preserve")throw new e("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:h});if(R&&R.protected&&!A&&(m.protected[g]=!0,q.protected=!0,!S(R,q)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:h,term:g})},v.expandIri=(m,h,g,N)=>x(m,h,g,void 0,void 0,N);function x(m,h,g,N,C,A){if(h===null||!i(h)||v.isKeyword(h))return h;if(h.match(d))return null;if(N&&N.hasOwnProperty(h)&&C.get(h)!==!0&&v.createTermDefinition({activeCtx:m,localCtx:N,term:h,defined:C,options:A}),g=g||{},g.vocab){const R=m.mappings.get(h);if(R===null)return null;if(n(R)&&"@id"in R)return R["@id"]}const B=h.indexOf(":");if(B>0){const R=h.substr(0,B),F=h.substr(B+1);if(R==="_"||F.indexOf("//")===0)return h;N&&N.hasOwnProperty(R)&&v.createTermDefinition({activeCtx:m,localCtx:N,term:R,defined:C,options:A});const q=m.mappings.get(R);if(q&&q._prefix)return q["@id"]+F;if(a(h))return h}if(g.vocab&&"@vocab"in m)h=m["@vocab"]+h;else if(g.base){let R,F;"@base"in m?m["@base"]?(F=u(A.base,m["@base"]),R=u(F,h)):(F=m["@base"],R=h):(F=A.base,R=u(A.base,h)),h=R}return h}v.getInitialContext=m=>{const h=JSON.stringify({processingMode:m.processingMode}),g=_.get(h);if(g)return g;const N={processingMode:m.processingMode,mappings:new Map,inverse:null,getInverse:C,clone:R,revertToPreviousContext:F,protected:{}};return _.size===E&&_.clear(),_.set(h,N),N;function C(){const q=this;if(q.inverse)return q.inverse;const D=q.inverse={},L=q.fastCurieMap={},te={},T=(q["@language"]||"@none").toLowerCase(),Z=q["@direction"],k=q.mappings,Y=[...k.keys()].sort(y);for(const w of Y){const H=k.get(w);if(H===null)continue;let K=H["@container"]||"@none";if(K=[].concat(K).sort().join(""),H["@id"]===null)continue;const Q=b(H["@id"]);for(const ue of Q){let V=D[ue];const G=v.isKeyword(ue);if(V)!G&&!H._termHasColon&&te[ue].push(w);else if(D[ue]=V={},!G&&!H._termHasColon){te[ue]=[w];const z={iri:ue,terms:te[ue]};ue[0]in L?L[ue[0]].push(z):L[ue[0]]=[z]}if(V[K]||(V[K]={"@language":{},"@type":{},"@any":{}}),V=V[K],B(w,V["@any"],"@none"),H.reverse)B(w,V["@type"],"@reverse");else if(H["@type"]==="@none")B(w,V["@any"],"@none"),B(w,V["@language"],"@none"),B(w,V["@type"],"@none");else if("@type"in H)B(w,V["@type"],H["@type"]);else if("@language"in H&&"@direction"in H){const z=H["@language"],U=H["@direction"];z&&U?B(w,V["@language"],`${z}_${U}`.toLowerCase()):z?B(w,V["@language"],z.toLowerCase()):U?B(w,V["@language"],`_${U}`):B(w,V["@language"],"@null")}else"@language"in H?B(w,V["@language"],(H["@language"]||"@null").toLowerCase()):"@direction"in H?H["@direction"]?B(w,V["@language"],`_${H["@direction"]}`):B(w,V["@language"],"@none"):Z?(B(w,V["@language"],`_${Z}`),B(w,V["@language"],"@none"),B(w,V["@type"],"@none")):(B(w,V["@language"],T),B(w,V["@language"],"@none"),B(w,V["@type"],"@none"))}}for(const w in L)A(L,w,1);return D}function A(q,D,L){const te=q[D],T=q[D]={};let Z,k;for(const Y of te)Z=Y.iri,L>=Z.length?k="":k=Z[L],k in T?T[k].push(Y):T[k]=[Y];for(const Y in T)Y!==""&&A(T,Y,L+1)}function B(q,D,L){D.hasOwnProperty(L)||(D[L]=q)}function R(){const q={};return q.mappings=r.clone(this.mappings),q.clone=this.clone,q.inverse=null,q.getInverse=this.getInverse,q.protected=r.clone(this.protected),this.previousContext&&(q.previousContext=this.previousContext.clone()),q.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(q["@base"]=this["@base"]),"@language"in this&&(q["@language"]=this["@language"]),"@vocab"in this&&(q["@vocab"]=this["@vocab"]),q}function F(){return this.previousContext?this.previousContext.clone():this}},v.getContextValue=(m,h,g)=>{if(h===null)return g==="@context"?void 0:null;if(m.mappings.has(h)){const N=m.mappings.get(h);if(s(g))return N;if(N.hasOwnProperty(g))return N[g]}if(g==="@language"&&g in m||g==="@direction"&&g in m)return m[g];if(g!=="@context")return null},v.processingMode=(m,h)=>h.toString()>="1.1"?!m.processingMode||m.processingMode>="json-ld-"+h.toString():m.processingMode==="json-ld-1.0",v.isKeyword=m=>{if(!i(m)||m[0]!=="@")return!1;switch(m){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1};function S(m,h){if(!(m&&typeof m=="object")||!(h&&typeof h=="object"))return m===h;const g=Array.isArray(m);if(g!==Array.isArray(h))return!1;if(g){if(m.length!==h.length)return!1;for(let A=0;A<m.length;++A)if(!S(m[A],h[A]))return!1;return!0}const N=Object.keys(m),C=Object.keys(h);if(N.length!==C.length)return!1;for(const A in m){let B=m[A],R=h[A];if(A==="@container"&&Array.isArray(B)&&Array.isArray(R)&&(B=B.slice().sort(),R=R.slice().sort()),!S(B,R))return!1}return!0}return Ls}var Os,tu;function Wf(){if(tu)return Os;tu=1;const r=pt(),{isArray:e,isObject:t,isEmptyObject:n,isString:i,isUndefined:s}=dt(),{isList:a,isValue:o,isGraph:u,isSubject:l}=Pt(),{expandIri:c,getContextValue:d,isKeyword:b,process:y,processingMode:_}=hr(),{isAbsolute:E}=Jt(),{REGEX_BCP47:v,REGEX_KEYWORD:x,addValue:S,asArray:m,getValues:h,validateTypeValue:g}=ht(),{handleEvent:N}=Dn(),C={};Os=C,C.expand=async({activeCtx:D,activeProperty:L=null,element:te,options:T={},insideList:Z=!1,insideIndex:k=!1,typeScopedContext:Y=null})=>{if(te==null)return null;if(L==="@default"&&(T=Object.assign({},T,{isFrame:!1})),!e(te)&&!t(te))return!Z&&(L===null||c(D,L,{vocab:!0},T)==="@graph")?(T.eventHandler&&N({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:te}},options:T}),null):R({activeCtx:D,activeProperty:L,value:te,options:T});if(e(te)){let z=[];const U=d(D,L,"@container")||[];Z=Z||U.includes("@list");for(let ee=0;ee<te.length;++ee){let re=await C.expand({activeCtx:D,activeProperty:L,element:te[ee],options:T,insideIndex:k,typeScopedContext:Y});Z&&e(re)&&(re={"@list":re}),re!==null&&(e(re)?z=z.concat(re):z.push(re))}return z}const w=c(D,L,{vocab:!0},T),H=d(D,L,"@context");Y=Y||(D.previousContext?D:null);let K=Object.keys(te).sort(),Q=!k;if(Q&&Y&&K.length<=2&&!K.includes("@context"))for(const z of K){const U=c(Y,z,{vocab:!0},T);if(U==="@value"){Q=!1,D=Y;break}if(U==="@id"&&K.length===1){Q=!1;break}}Q&&(D=D.revertToPreviousContext()),s(H)||(D=await y({activeCtx:D,localCtx:H,propagate:!0,overrideProtected:!0,options:T})),"@context"in te&&(D=await y({activeCtx:D,localCtx:te["@context"],options:T})),Y=D;let ue=null;for(const z of K)if(c(D,z,{vocab:!0},T)==="@type"){ue=ue||z;const ee=te[z],re=Array.isArray(ee)?ee.length>1?ee.slice().sort():ee:[ee];for(const fe of re){const ge=d(Y,fe,"@context");s(ge)||(D=await y({activeCtx:D,localCtx:ge,options:T,propagate:!1}))}}let V={};await B({activeCtx:D,activeProperty:L,expandedActiveProperty:w,element:te,expandedParent:V,options:T,insideList:Z,typeKey:ue,typeScopedContext:Y}),K=Object.keys(V);let G=K.length;if("@value"in V){if("@type"in V&&("@language"in V||"@direction"in V))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:V});let z=G-1;if("@type"in V&&(z-=1),"@index"in V&&(z-=1),"@language"in V&&(z-=1),"@direction"in V&&(z-=1),z!==0)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:V});const U=V["@value"]===null?[]:m(V["@value"]),ee=h(V,"@type");if(!(_(D,1.1)&&ee.includes("@json")&&ee.length===1))if(U.length===0)T.eventHandler&&N({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:V}},options:T}),V=null;else{if(!U.every(re=>i(re)||n(re))&&"@language"in V)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:V});if(!ee.every(re=>E(re)&&!(i(re)&&re.indexOf("_:")===0)||n(re)))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:V})}}else if("@type"in V&&!e(V["@type"]))V["@type"]=[V["@type"]];else if("@set"in V||"@list"in V){if(G>1&&!(G===2&&"@index"in V))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:V});"@set"in V&&(V=V["@set"],K=Object.keys(V),G=K.length)}else G===1&&"@language"in V&&(T.eventHandler&&N({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:V}},options:T}),V=null);return t(V)&&!T.keepFreeFloatingNodes&&!Z&&(L===null||w==="@graph"||(d(D,L,"@container")||[]).includes("@graph"))&&(V=A({value:V,count:G,options:T})),V};function A({value:D,count:L,options:te}){if(L===0||"@value"in D||"@list"in D||L===1&&"@id"in D){if(te.eventHandler){let T,Z;L===0?(T="empty object",Z="Dropping empty object."):"@value"in D?(T="object with only @value",Z="Dropping object with only @value."):"@list"in D?(T="object with only @list",Z="Dropping object with only @list."):L===1&&"@id"in D&&(T="object with only @id",Z="Dropping object with only @id."),N({event:{type:["JsonLdEvent"],code:T,level:"warning",message:Z,details:{value:D}},options:te})}return null}return D}async function B({activeCtx:D,activeProperty:L,expandedActiveProperty:te,element:T,expandedParent:Z,options:k={},insideList:Y,typeKey:w,typeScopedContext:H}){const K=Object.keys(T).sort(),Q=[];let ue;const V=T[w]&&c(D,e(T[w])?T[w][0]:T[w],{vocab:!0},{...k,typeExpansion:!0})==="@json";for(const G of K){let z=T[G],U;if(G==="@context")continue;const ee=c(D,G,{vocab:!0},k);if(ee===null||!(E(ee)||b(ee))){k.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:G,expandedProperty:ee}},options:k});continue}if(b(ee)){if(te==="@reverse")throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:z});if(ee in Z&&ee!=="@included"&&ee!=="@type")throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:ee})}if(ee==="@id"){if(!i(z)){if(!k.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:z});if(t(z)){if(!n(z))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else if(e(z)){if(!z.every(j=>i(j)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}else throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:z})}S(Z,"@id",m(z).map(j=>{if(i(j)){const W=c(D,j,{base:!0},k);return k.eventHandler&&(W===null?N(j===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:j}},options:k}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:j}},options:k}):E(W)||N({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:j,expandedId:W}},options:k})),W}return j}),{propertyIsArray:k.isFrame});continue}if(ee==="@type"){t(z)&&(z=Object.fromEntries(Object.entries(z).map(([j,W])=>[c(H,j,{vocab:!0}),m(W).map(se=>c(H,se,{base:!0,vocab:!0},{...k,typeExpansion:!0}))]))),g(z,k.isFrame),S(Z,"@type",m(z).map(j=>{if(i(j)){const W=c(H,j,{base:!0,vocab:!0},{...k,typeExpansion:!0});return W!=="@json"&&!E(W)&&k.eventHandler&&N({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:j}},options:k}),W}return j}),{propertyIsArray:!!k.isFrame});continue}if(ee==="@included"&&_(D,1.1)){const j=m(await C.expand({activeCtx:D,activeProperty:L,element:z,options:k}));if(!j.every(W=>l(W)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:z});S(Z,"@included",j,{propertyIsArray:!0});continue}if(ee==="@graph"&&!(t(z)||e(z)))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:z});if(ee==="@value"){ue=z,V&&_(D,1.1)?Z["@value"]=z:S(Z,"@value",z,{propertyIsArray:k.isFrame});continue}if(ee==="@language"){if(z===null)continue;if(!i(z)&&!k.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:z});z=m(z).map(j=>i(j)?j.toLowerCase():j);for(const j of z)i(j)&&!j.match(v)&&k.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:j}},options:k});S(Z,"@language",z,{propertyIsArray:k.isFrame});continue}if(ee==="@direction"){if(!i(z)&&!k.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:z});z=m(z);for(const j of z)if(i(j)&&j!=="ltr"&&j!=="rtl")throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:z});S(Z,"@direction",z,{propertyIsArray:k.isFrame});continue}if(ee==="@index"){if(!i(z))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:z});S(Z,"@index",z);continue}if(ee==="@reverse"){if(!t(z))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:z});if(U=await C.expand({activeCtx:D,activeProperty:"@reverse",element:z,options:k}),"@reverse"in U)for(const W in U["@reverse"])S(Z,W,U["@reverse"][W],{propertyIsArray:!0});let j=Z["@reverse"]||null;for(const W in U){if(W==="@reverse")continue;j===null&&(j=Z["@reverse"]={}),S(j,W,[],{propertyIsArray:!0});const se=U[W];for(let he=0;he<se.length;++he){const pe=se[he];if(o(pe)||a(pe))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:U});S(j,W,pe,{propertyIsArray:!0})}}continue}if(ee==="@nest"){Q.push(G);continue}let re=D;const fe=d(D,G,"@context");s(fe)||(re=await y({activeCtx:D,localCtx:fe,propagate:!0,overrideProtected:!0,options:k}));const ge=d(D,G,"@container")||[];if(ge.includes("@language")&&t(z)){const j=d(re,G,"@direction");U=F(re,z,j,k)}else if(ge.includes("@index")&&t(z)){const j=ge.includes("@graph"),W=d(re,G,"@index")||"@index",se=W!=="@index"&&c(D,W,{vocab:!0},k);U=await q({activeCtx:re,options:k,activeProperty:G,value:z,asGraph:j,indexKey:W,propertyIndex:se})}else if(ge.includes("@id")&&t(z)){const j=ge.includes("@graph");U=await q({activeCtx:re,options:k,activeProperty:G,value:z,asGraph:j,indexKey:"@id"})}else if(ge.includes("@type")&&t(z))U=await q({activeCtx:re.revertToPreviousContext(),options:k,activeProperty:G,value:z,asGraph:!1,indexKey:"@type"});else{const j=ee==="@list";if(j||ee==="@set"){let W=L;j&&te==="@graph"&&(W=null),U=await C.expand({activeCtx:re,activeProperty:W,element:z,options:k,insideList:j})}else d(D,G,"@type")==="@json"?U={"@type":"@json","@value":z}:U=await C.expand({activeCtx:re,activeProperty:G,element:z,options:k,insideList:!1})}if(!(U===null&&ee!=="@value")){if(ee!=="@list"&&!a(U)&&ge.includes("@list")&&(U={"@list":m(U)}),ge.includes("@graph")&&!ge.some(j=>j==="@id"||j==="@index")){if(U=m(U),k.isFrame||(U=U.filter(j=>{const W=Object.keys(j).length;return A({value:j,count:W,options:k})!==null})),U.length===0)continue;U=U.map(j=>({"@graph":m(j)}))}if(re.mappings.has(G)&&re.mappings.get(G).reverse){const j=Z["@reverse"]=Z["@reverse"]||{};U=m(U);for(let W=0;W<U.length;++W){const se=U[W];if(o(se)||a(se))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:U});S(j,ee,se,{propertyIsArray:!0})}continue}S(Z,ee,U,{propertyIsArray:!0})}}if("@value"in Z&&!(Z["@type"]==="@json"&&_(D,1.1))){if((t(ue)||e(ue))&&!k.isFrame)throw new r('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:ue})}for(const G of Q){const z=e(T[G])?T[G]:[T[G]];for(const U of z){if(!t(U)||Object.keys(U).some(ee=>c(D,ee,{vocab:!0},k)==="@value"))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:U});await B({activeCtx:D,activeProperty:L,expandedActiveProperty:te,element:U,expandedParent:Z,options:k,insideList:Y,typeScopedContext:H,typeKey:w})}}}function R({activeCtx:D,activeProperty:L,value:te,options:T}){if(te==null)return null;const Z=c(D,L,{vocab:!0},T);if(Z==="@id")return c(D,te,{base:!0},T);if(Z==="@type")return c(D,te,{vocab:!0,base:!0},{...T,typeExpansion:!0});const k=d(D,L,"@type");if((k==="@id"||Z==="@graph")&&i(te)){const w=c(D,te,{base:!0},T);return w===null&&te.match(x)&&T.eventHandler&&N({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:L}},options:T}),{"@id":w}}if(k==="@vocab"&&i(te))return{"@id":c(D,te,{vocab:!0,base:!0},T)};if(b(Z))return te;const Y={};if(k&&!["@id","@vocab","@none"].includes(k))Y["@type"]=k;else if(i(te)){const w=d(D,L,"@language");w!==null&&(Y["@language"]=w);const H=d(D,L,"@direction");H!==null&&(Y["@direction"]=H)}return["boolean","number","string"].includes(typeof te)||(te=te.toString()),Y["@value"]=te,Y}function F(D,L,te,T){const Z=[],k=Object.keys(L).sort();for(const Y of k){const w=c(D,Y,{vocab:!0},T);let H=L[Y];e(H)||(H=[H]);for(const K of H){if(K===null)continue;if(!i(K))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:L});const Q={"@value":K};w!=="@none"&&(Y.match(v)||T.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:Y}},options:T}),Q["@language"]=Y.toLowerCase()),te&&(Q["@direction"]=te),Z.push(Q)}}return Z}async function q({activeCtx:D,options:L,activeProperty:te,value:T,asGraph:Z,indexKey:k,propertyIndex:Y}){const w=[],H=Object.keys(T).sort(),K=k==="@type";for(let Q of H){if(K){const G=d(D,Q,"@context");s(G)||(D=await y({activeCtx:D,localCtx:G,propagate:!1,options:L}))}let ue=T[Q];e(ue)||(ue=[ue]),ue=await C.expand({activeCtx:D,activeProperty:te,element:ue,options:L,insideList:!1,insideIndex:!0});let V;Y?Q==="@none"?V="@none":V=R({activeCtx:D,activeProperty:k,value:Q,options:L}):V=c(D,Q,{vocab:!0},L),k==="@id"?Q=c(D,Q,{base:!0},L):K&&(Q=V);for(let G of ue){if(Z&&!u(G)&&(G={"@graph":[G]}),k==="@type")V==="@none"||(G["@type"]?G["@type"]=[Q].concat(G["@type"]):G["@type"]=[Q]);else{if(o(G)&&!["@language","@type","@index"].includes(k))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${k}".`,"jsonld.SyntaxError",{code:"invalid value object",value:G});Y?V!=="@none"&&S(G,Y,V,{propertyIsArray:!0,prependValue:!0}):V!=="@none"&&!(k in G)&&(G[k]=Q)}w.push(G)}}return w}return Os}var Cs,ru;function _i(){if(ru)return Cs;ru=1;const{isKeyword:r}=hr(),e=Pt(),t=dt(),n=ht(),i=pt(),s={};return Cs=s,s.createMergedNodeMap=(a,o)=>{o=o||{};const u=o.issuer||new n.IdentifierIssuer("_:b"),l={"@default":{}};return s.createNodeMap(a,l,"@default",u),s.mergeNodeMaps(l)},s.createNodeMap=(a,o,u,l,c,d)=>{if(t.isArray(a)){for(const E of a)s.createNodeMap(E,o,u,l,void 0,d);return}if(!t.isObject(a)){d&&d.push(a);return}if(e.isValue(a)){if("@type"in a){let E=a["@type"];E.indexOf("_:")===0&&(a["@type"]=E=l.getId(E))}d&&d.push(a);return}else if(d&&e.isList(a)){const E=[];s.createNodeMap(a["@list"],o,u,l,c,E),d.push({"@list":E});return}if("@type"in a){const E=a["@type"];for(const v of E)v.indexOf("_:")===0&&l.getId(v)}t.isUndefined(c)&&(c=e.isBlankNode(a)?l.getId(a["@id"]):a["@id"]),d&&d.push({"@id":c});const b=o[u],y=b[c]=b[c]||{};y["@id"]=c;const _=Object.keys(a).sort();for(let E of _){if(E==="@id")continue;if(E==="@reverse"){const x={"@id":c},S=a["@reverse"];for(const m in S){const h=S[m];for(const g of h){let N=g["@id"];e.isBlankNode(g)&&(N=l.getId(N)),s.createNodeMap(g,o,u,l,N),n.addValue(b[N],m,x,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(E==="@graph"){c in o||(o[c]={}),s.createNodeMap(a[E],o,c,l);continue}if(E==="@included"){s.createNodeMap(a[E],o,u,l);continue}if(E!=="@type"&&r(E)){if(E==="@index"&&E in y&&(a[E]!==y[E]||a[E]["@id"]!==y[E]["@id"]))throw new i("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:y});y[E]=a[E];continue}const v=a[E];if(E.indexOf("_:")===0&&(E=l.getId(E)),v.length===0){n.addValue(y,E,[],{propertyIsArray:!0});continue}for(let x of v)if(E==="@type"&&(x=x.indexOf("_:")===0?l.getId(x):x),e.isSubject(x)||e.isSubjectReference(x)){if("@id"in x&&!x["@id"])continue;const S=e.isBlankNode(x)?l.getId(x["@id"]):x["@id"];n.addValue(y,E,{"@id":S},{propertyIsArray:!0,allowDuplicate:!1}),s.createNodeMap(x,o,u,l,S)}else if(e.isValue(x))n.addValue(y,E,x,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(x)){const S=[];s.createNodeMap(x["@list"],o,u,l,c,S),x={"@list":S},n.addValue(y,E,x,{propertyIsArray:!0,allowDuplicate:!1})}else s.createNodeMap(x,o,u,l,c),n.addValue(y,E,x,{propertyIsArray:!0,allowDuplicate:!1})}},s.mergeNodeMapGraphs=a=>{const o={};for(const u of Object.keys(a).sort())for(const l of Object.keys(a[u]).sort()){const c=a[u][l];l in o||(o[l]={"@id":l});const d=o[l];for(const b of Object.keys(c).sort())if(r(b)&&b!=="@type")d[b]=n.clone(c[b]);else for(const y of c[b])n.addValue(d,b,n.clone(y),{propertyIsArray:!0,allowDuplicate:!1})}return o},s.mergeNodeMaps=a=>{const o=a["@default"],u=Object.keys(a).sort();for(const l of u){if(l==="@default")continue;const c=a[l];let d=o[l];d?"@graph"in d||(d["@graph"]=[]):o[l]=d={"@id":l,"@graph":[]};const b=d["@graph"];for(const y of Object.keys(c).sort()){const _=c[y];e.isSubjectReference(_)||b.push(_)}}return o},Cs}var js,nu;function zf(){if(nu)return js;nu=1;const{isSubjectReference:r}=Pt(),{createMergedNodeMap:e}=_i(),t={};return js=t,t.flatten=n=>{const i=e(n),s=[],a=Object.keys(i).sort();for(let o=0;o<a.length;++o){const u=i[a[o]];r(u)||s.push(u)}return s},js}var $s,iu;function Qf(){if(iu)return $s;iu=1;const r=pt(),e=Pt(),t=dt(),{REGEX_BCP47:n,addValue:i}=ht(),{handleEvent:s}=Dn(),{RDF_LIST:a,RDF_FIRST:o,RDF_REST:u,RDF_NIL:l,RDF_TYPE:c,RDF_JSON_LITERAL:d,XSD_BOOLEAN:b,XSD_DOUBLE:y,XSD_INTEGER:_,XSD_STRING:E}=Ga(),v={};$s=v,v.fromRDF=async(S,m)=>{const{useRdfType:h=!1,useNativeTypes:g=!1,rdfDirection:N=null}=m,C={},A={"@default":C},B={};if(N){if(N==="compound-literal")throw new r("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:N});if(N!=="i18n-datatype")throw new r("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:N})}for(const q of S){const D=q.graph.termType==="DefaultGraph"?"@default":q.graph.value;D in A||(A[D]={}),D!=="@default"&&!(D in C)&&(C[D]={"@id":D});const L=A[D],te=q.subject.value,T=q.predicate.value,Z=q.object;te in L||(L[te]={"@id":te});const k=L[te],Y=Z.termType.endsWith("Node");if(Y&&!(Z.value in L)&&(L[Z.value]={"@id":Z.value}),T===c&&!h&&Y){i(k,"@type",Z.value,{propertyIsArray:!0});continue}const w=x(Z,g,N,m);if(i(k,T,w,{propertyIsArray:!0}),Y)if(Z.value===l){const H=L[Z.value];"usages"in H||(H.usages=[]),H.usages.push({node:k,property:T,value:w})}else Z.value in B?B[Z.value]=!1:B[Z.value]={node:k,property:T,value:w}}for(const q in A){const D=A[q];if(!(l in D))continue;const L=D[l];if(L.usages){for(let te of L.usages){let T=te.node,Z=te.property,k=te.value;const Y=[],w=[];let H=Object.keys(T).length;for(;Z===u&&t.isObject(B[T["@id"]])&&t.isArray(T[o])&&T[o].length===1&&t.isArray(T[u])&&T[u].length===1&&(H===3||H===4&&t.isArray(T["@type"])&&T["@type"].length===1&&T["@type"][0]===a)&&(Y.push(T[o][0]),w.push(T["@id"]),te=B[T["@id"]],T=te.node,Z=te.property,k=te.value,H=Object.keys(T).length,!!e.isBlankNode(T)););delete k["@id"],k["@list"]=Y.reverse();for(const K of w)delete D[K]}delete L.usages}}const R=[],F=Object.keys(C).sort();for(const q of F){const D=C[q];if(q in A){const L=D["@graph"]=[],te=A[q],T=Object.keys(te).sort();for(const Z of T){const k=te[Z];e.isSubjectReference(k)||L.push(k)}}e.isSubjectReference(D)||R.push(D)}return R};function x(S,m,h,g){if(S.termType.endsWith("Node"))return{"@id":S.value};const N={"@value":S.value};if(S.language)S.language.match(n)||g.eventHandler&&s({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:S.language}},options:g}),N["@language"]=S.language;else{let C=S.datatype.value;if(C||(C=E),C===d){C="@json";try{N["@value"]=JSON.parse(N["@value"])}catch(A){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:N["@value"],cause:A})}}if(m){if(C===b)N["@value"]==="true"?N["@value"]=!0:N["@value"]==="false"&&(N["@value"]=!1);else if(t.isNumeric(N["@value"]))if(C===_){const A=parseInt(N["@value"],10);A.toFixed(0)===N["@value"]&&(N["@value"]=A)}else C===y&&(N["@value"]=parseFloat(N["@value"]));[b,_,y,E].includes(C)||(N["@type"]=C)}else if(h==="i18n-datatype"&&C.startsWith("https://www.w3.org/ns/i18n#")){const[,A,B]=C.split(/[#_]/);A.length>0&&(N["@language"]=A,A.match(n)||g.eventHandler&&s({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:A}},options:g})),N["@direction"]=B}else C!==E&&(N["@type"]=C)}return N}return $s}var Fs,su;function Xf(){return su||(su=1,Fs=function r(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((t,n,i)=>{const s=i===0?"":",",a=n===void 0||typeof n=="symbol"?null:n;return t+s+r(a)},"")+"]":"{"+Object.keys(e).sort().reduce((t,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return t;const s=t.length===0?"":",";return t+s+r(n)+":"+r(e[n])},"")+"}"}),Fs}var ks,au;function Jf(){if(au)return ks;au=1;const{createNodeMap:r}=_i(),{isKeyword:e}=hr(),t=Pt(),n=Xf(),i=pt(),s=dt(),a=ht(),{handleEvent:o}=Dn(),{RDF_FIRST:u,RDF_REST:l,RDF_NIL:c,RDF_TYPE:d,RDF_JSON_LITERAL:b,RDF_LANGSTRING:y,XSD_BOOLEAN:_,XSD_DOUBLE:E,XSD_INTEGER:v,XSD_STRING:x}=Ga(),{isAbsolute:S}=Jt(),m={};ks=m,m.toRDF=(C,A)=>{const B=new a.IdentifierIssuer("_:b"),R={"@default":{}};r(C,R,"@default",B);const F=[],q=Object.keys(R).sort();for(const D of q){let L;if(D==="@default")L={termType:"DefaultGraph",value:""};else if(S(D))D.startsWith("_:")?L={termType:"BlankNode"}:L={termType:"NamedNode"},L.value=D;else{A.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:D}},options:A});continue}h(F,R[D],L,B,A)}return F};function h(C,A,B,R,F){const q=Object.keys(A).sort();for(const D of q){const L=A[D],te=Object.keys(L).sort();for(let T of te){const Z=L[T];if(T==="@type")T=d;else if(e(T))continue;for(const k of Z){const Y={termType:D.startsWith("_:")?"BlankNode":"NamedNode",value:D};if(!S(D)){F.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:D}},options:F});continue}const w={termType:T.startsWith("_:")?"BlankNode":"NamedNode",value:T};if(!S(T)){F.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:T}},options:F});continue}if(w.termType==="BlankNode"&&!F.produceGeneralizedRdf){F.eventHandler&&o({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:R.getOldIds().find(K=>R.getId(K)===T)}},options:F});continue}const H=N(k,R,C,B,F.rdfDirection,F);H&&C.push({subject:Y,predicate:w,object:H,graph:B})}}}}function g(C,A,B,R,F,q){const D={termType:"NamedNode",value:u},L={termType:"NamedNode",value:l},te={termType:"NamedNode",value:c},T=C.pop(),Z=T?{termType:"BlankNode",value:A.getId()}:te;let k=Z;for(const Y of C){const w=N(Y,A,B,R,F,q),H={termType:"BlankNode",value:A.getId()};B.push({subject:k,predicate:D,object:w,graph:R}),B.push({subject:k,predicate:L,object:H,graph:R}),k=H}if(T){const Y=N(T,A,B,R,F,q);B.push({subject:k,predicate:D,object:Y,graph:R}),B.push({subject:k,predicate:L,object:te,graph:R})}return Z}function N(C,A,B,R,F,q){const D={};if(t.isValue(C)){D.termType="Literal",D.value=void 0,D.datatype={termType:"NamedNode"};let L=C["@value"];const te=C["@type"]||null;if(te==="@json")D.value=n(L),D.datatype.value=b;else if(s.isBoolean(L))D.value=L.toString(),D.datatype.value=te||_;else if(s.isDouble(L)||te===E)s.isDouble(L)||(L=parseFloat(L)),D.value=L.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),D.datatype.value=te||E;else if(s.isNumber(L))D.value=L.toFixed(0),D.datatype.value=te||v;else if("@direction"in C&&F==="i18n-datatype"){const T=(C["@language"]||"").toLowerCase(),Z=C["@direction"],k=`https://www.w3.org/ns/i18n#${T}_${Z}`;D.datatype.value=k,D.value=L}else{if("@direction"in C&&F==="compound-literal")throw new i("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:F});if("@direction"in C&&F)throw new i("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:F});"@language"in C?("@direction"in C&&!F&&q.eventHandler&&o({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:D.value}},options:q}),D.value=L,D.datatype.value=te||y,D.language=C["@language"]):("@direction"in C&&!F&&q.eventHandler&&o({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:D.value}},options:q}),D.value=L,D.datatype.value=te||x)}}else if(t.isList(C)){const L=g(C["@list"],A,B,R,F,q);D.termType=L.termType,D.value=L.value}else{const L=s.isObject(C)?C["@id"]:C;D.termType=L.startsWith("_:")?"BlankNode":"NamedNode",D.value=L}return D.termType==="NamedNode"&&!S(D.value)?(q.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:D.value}},options:q}),null):D}return ks}var Ps,ou;function Kf(){if(ou)return Ps;ou=1;const{isKeyword:r}=hr(),e=Pt(),t=dt(),n=ht(),i=Jt(),s=pt(),{createNodeMap:a,mergeNodeMapGraphs:o}=_i(),u={};Ps=u,u.frameMergedOrDefault=(h,g,N)=>{const C={options:N,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},A=new n.IdentifierIssuer("_:b");a(h,C.graphMap,"@default",A),N.merged&&(C.graphMap["@merged"]=o(C.graphMap),C.graph="@merged"),C.subjects=C.graphMap[C.graph];const B=[];u.frame(C,Object.keys(C.subjects).sort(),g,B),N.pruneBlankNodeIdentifiers&&(N.bnodesToClear=Object.keys(C.bnodeMap).filter(R=>C.bnodeMap[R].length===1));// remove @preserve from results
|
|
356
|
-
return
|
|
354
|
+
*/var _a,Ah;function L_(){if(Ah)return _a;Ah=1;const n=Xs(),e=Uf();return _a=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new n("sha1")}modifyFirstDegreeComponent(r,o,a){return o.termType!=="BlankNode"?o:a==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:o.value===r?"_:a":"_:z"}}getRelatedPredicate(r){return r.predicate.value}createHashToRelated(r,o){const a=new Map,l=this.blankNodeInfo.get(r).quads;for(const u of l){let f,d;if(u.subject.termType==="BlankNode"&&u.subject.value!==r)d=u.subject.value,f="p";else if(u.object.termType==="BlankNode"&&u.object.value!==r)d=u.object.value,f="r";else continue;const g=this.hashRelatedBlankNode(d,u,o,f),_=a.get(g);_?_.push(d):a.set(g,[d])}return a}},_a}const I_={},A_=Object.freeze(Object.defineProperty({__proto__:null,default:I_},Symbol.toStringTag,{value:"Module"})),N_=tg(A_);var Nh;function R_(){return Nh||(Nh=1,(function(n){const e=zf(),i=T_(),r=Uf(),o=L_();let a;try{a=N_}catch{}function l(u){return Array.isArray(u)?u:n.NQuads.legacyDatasetToQuads(u)}n.NQuads=Zl(),n.IdentifierIssuer=Gl(),n._rdfCanonizeNative=function(u){return u&&(a=u),a},n.canonize=async function(u,f){const d=l(u);if(f.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((g,_)=>a.canonize(d,f,(h,m)=>h?_(h):g(m)))}if(f.algorithm==="URDNA2015")return new e(f).main(d);if(f.algorithm==="URGNA2012"){if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(f).main(d)}throw"algorithm"in f?new Error("Invalid RDF Dataset Canonicalization algorithm: "+f.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},n._canonizeSync=function(u,f){const d=l(u);if(f.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(d,f)}if(f.algorithm==="URDNA2015")return new r(f).main(d);if(f.algorithm==="URGNA2012"){if(f.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(f).main(d)}throw"algorithm"in f?new Error("Invalid RDF Dataset Canonicalization algorithm: "+f.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}})(la)),la}var ya,Rh;function Xl(){return Rh||(Rh=1,ya=R_()),ya}var va,Ph;function qt(){if(Ph)return va;Ph=1;const n={};return va=n,n.isArray=Array.isArray,n.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]",n.isDouble=e=>n.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21),n.isEmptyObject=e=>n.isObject(e)&&Object.keys(e).length===0,n.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]",n.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),n.isObject=e=>Object.prototype.toString.call(e)==="[object Object]",n.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]",n.isUndefined=e=>typeof e>"u",va}var ba,Ch;function Ni(){if(Ch)return ba;Ch=1;const n=qt(),e={};return ba=e,e.isSubject=i=>n.isObject(i)&&!("@value"in i||"@set"in i||"@list"in i)?Object.keys(i).length>1||!("@id"in i):!1,e.isSubjectReference=i=>n.isObject(i)&&Object.keys(i).length===1&&"@id"in i,e.isValue=i=>n.isObject(i)&&"@value"in i,e.isList=i=>n.isObject(i)&&"@list"in i,e.isGraph=i=>n.isObject(i)&&"@graph"in i&&Object.keys(i).filter(r=>r!=="@id"&&r!=="@index").length===1,e.isSimpleGraph=i=>e.isGraph(i)&&!("@id"in i),e.isBlankNode=i=>{if(n.isObject(i)){if("@id"in i){const r=i["@id"];return!n.isString(r)||r.indexOf("_:")===0}return Object.keys(i).length===0||!("@value"in i||"@set"in i||"@list"in i)}return!1},ba}var wa,Dh;function Zt(){return Dh||(Dh=1,wa=class extends Error{constructor(e="An unspecified JSON-LD error occurred.",i="jsonld.Error",r={}){super(e),this.name=i,this.message=e,this.details=r}}),wa}var xa,kh;function Wt(){if(kh)return xa;kh=1;const n=Ni(),e=qt(),i=Xl().IdentifierIssuer,r=Zt(),o=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,u=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,f=/^@[a-zA-Z]+$/,d={headers:{accept:"application/ld+json, application/json"}},g={};xa=g,g.IdentifierIssuer=i,g.REGEX_BCP47=o,g.REGEX_KEYWORD=f,g.clone=function(h){if(h&&typeof h=="object"){let m;if(e.isArray(h)){m=[];for(let b=0;b<h.length;++b)m[b]=g.clone(h[b])}else if(h instanceof Map){m=new Map;for(const[b,T]of h)m.set(b,g.clone(T))}else if(h instanceof Set){m=new Set;for(const b of h)m.add(g.clone(b))}else if(e.isObject(h)){m={};for(const b in h)m[b]=g.clone(h[b])}else m=h.toString();return m}return h},g.asArray=function(h){return Array.isArray(h)?h:[h]},g.buildHeaders=(h={})=>{if(Object.keys(h).some(b=>b.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+d.headers.accept+'" is supported.');return Object.assign({Accept:d.headers.accept},h)},g.parseLinkHeader=h=>{const m={},b=h.match(a);for(let T=0;T<b.length;++T){let A=b[T].match(l);if(!A)continue;const N={target:A[1]},R=A[2];for(;A=u.exec(R);)N[A[1]]=A[2]===void 0?A[3]:A[2];const S=N.rel||"";Array.isArray(m[S])?m[S].push(N):m.hasOwnProperty(S)?m[S]=[m[S],N]:m[S]=N}return m},g.validateTypeValue=(h,m)=>{if(!e.isString(h)&&!(e.isArray(h)&&h.every(b=>e.isString(b)))){if(m&&e.isObject(h))switch(Object.keys(h).length){case 0:return;case 1:if("@default"in h&&g.asArray(h["@default"]).every(b=>e.isString(b)))return}throw new r('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:h})}},g.hasProperty=(h,m)=>{if(h.hasOwnProperty(m)){const b=h[m];return!e.isArray(b)||b.length>0}return!1},g.hasValue=(h,m,b)=>{if(g.hasProperty(h,m)){let T=h[m];const A=n.isList(T);if(e.isArray(T)||A){A&&(T=T["@list"]);for(let N=0;N<T.length;++N)if(g.compareValues(b,T[N]))return!0}else if(!e.isArray(b))return g.compareValues(b,T)}return!1},g.addValue=(h,m,b,T)=>{if(T=T||{},"propertyIsArray"in T||(T.propertyIsArray=!1),"valueIsArray"in T||(T.valueIsArray=!1),"allowDuplicate"in T||(T.allowDuplicate=!0),"prependValue"in T||(T.prependValue=!1),T.valueIsArray)h[m]=b;else if(e.isArray(b)){b.length===0&&T.propertyIsArray&&!h.hasOwnProperty(m)&&(h[m]=[]),T.prependValue&&(b=b.concat(h[m]),h[m]=[]);for(let A=0;A<b.length;++A)g.addValue(h,m,b[A],T)}else if(h.hasOwnProperty(m)){const A=!T.allowDuplicate&&g.hasValue(h,m,b);!e.isArray(h[m])&&(!A||T.propertyIsArray)&&(h[m]=[h[m]]),A||(T.prependValue?h[m].unshift(b):h[m].push(b))}else h[m]=T.propertyIsArray?[b]:b},g.getValues=(h,m)=>[].concat(h[m]||[]),g.removeProperty=(h,m)=>{delete h[m]},g.removeValue=(h,m,b,T)=>{T=T||{},"propertyIsArray"in T||(T.propertyIsArray=!1);const A=g.getValues(h,m).filter(N=>!g.compareValues(N,b));A.length===0?g.removeProperty(h,m):A.length===1&&!T.propertyIsArray?h[m]=A[0]:h[m]=A},g.relabelBlankNodes=(h,m)=>{m=m||{};const b=m.issuer||new i("_:b");return _(b,h)},g.compareValues=(h,m)=>h===m||n.isValue(h)&&n.isValue(m)&&h["@value"]===m["@value"]&&h["@type"]===m["@type"]&&h["@language"]===m["@language"]&&h["@index"]===m["@index"]?!0:e.isObject(h)&&"@id"in h&&e.isObject(m)&&"@id"in m?h["@id"]===m["@id"]:!1,g.compareShortestLeast=(h,m)=>h.length<m.length?-1:m.length<h.length?1:h===m?0:h<m?-1:1;function _(h,m){if(e.isArray(m))for(let b=0;b<m.length;++b)m[b]=_(h,m[b]);else if(n.isList(m))m["@list"]=_(h,m["@list"]);else if(e.isObject(m)){n.isBlankNode(m)&&(m["@id"]=h.getId(m["@id"]));const b=Object.keys(m).sort();for(let T=0;T<b.length;++T){const A=b[T];A!=="@id"&&(m[A]=_(h,m[A]))}}return m}return xa}var Ea,Mh;function Jl(){if(Mh)return Ea;Mh=1;const n="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return Ea={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:n,RDF_LIST:n+"List",RDF_FIRST:n+"first",RDF_REST:n+"rest",RDF_NIL:n+"nil",RDF_TYPE:n+"type",RDF_PLAIN_LITERAL:n+"PlainLiteral",RDF_XML_LITERAL:n+"XMLLiteral",RDF_JSON_LITERAL:n+"JSON",RDF_OBJECT:n+"object",RDF_LANGSTRING:n+"langString",XSD:e,XSD_BOOLEAN:e+"boolean",XSD_DOUBLE:e+"double",XSD_INTEGER:e+"integer",XSD_STRING:e+"string"},Ea}var Sa,Oh;function Hf(){return Oh||(Oh=1,Sa=class{constructor(){this._requests={}}wrapLoader(e){const i=this;return i._loader=e,function(){return i.add.apply(i,arguments)}}async add(e){let i=this._requests[e];if(i)return Promise.resolve(i);i=this._requests[e]=this._loader(e);try{return await i}finally{delete this._requests[e]}}}),Sa}var Ta,Fh;function Vi(){if(Fh)return Ta;Fh=1;const n=qt(),e={};Ta=e,e.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.parse=(r,o)=>{const a={},l=e.parsers[o||"full"],u=l.regex.exec(r);let f=l.keys.length;for(;f--;)a[l.keys[f]]=u[f]===void 0?null:u[f];return(a.scheme==="https"&&a.port==="443"||a.scheme==="http"&&a.port==="80")&&(a.href=a.href.replace(":"+a.port,""),a.authority=a.authority.replace(":"+a.port,""),a.port=null),a.normalizedPath=e.removeDotSegments(a.path),a},e.prependBase=(r,o)=>{if(r===null||e.isAbsolute(o))return o;(!r||n.isString(r))&&(r=e.parse(r||""));const a=e.parse(o),l={protocol:r.protocol||""};if(a.authority!==null)l.authority=a.authority,l.path=a.path,l.query=a.query;else if(l.authority=r.authority,a.path==="")l.path=r.path,a.query!==null?l.query=a.query:l.query=r.query;else{if(a.path.indexOf("/")===0)l.path=a.path;else{let f=r.path;f=f.substr(0,f.lastIndexOf("/")+1),(f.length>0||r.authority)&&f.substr(-1)!=="/"&&(f+="/"),f+=a.path,l.path=f}l.query=a.query}a.path!==""&&(l.path=e.removeDotSegments(l.path));let u=l.protocol;return l.authority!==null&&(u+="//"+l.authority),u+=l.path,l.query!==null&&(u+="?"+l.query),a.fragment!==null&&(u+="#"+a.fragment),u===""&&(u="./"),u},e.removeBase=(r,o)=>{if(r===null)return o;(!r||n.isString(r))&&(r=e.parse(r||""));let a="";if(r.href!==""?a+=(r.protocol||"")+"//"+(r.authority||""):o.indexOf("//")&&(a+="//"),o.indexOf(a)!==0)return o;const l=e.parse(o.substr(a.length)),u=r.normalizedPath.split("/"),f=l.normalizedPath.split("/"),d=l.fragment||l.query?0:1;for(;u.length>0&&f.length>d&&u[0]===f[0];)u.shift(),f.shift();let g="";if(u.length>0){u.pop();for(let _=0;_<u.length;++_)g+="../"}return g+=f.join("/"),l.query!==null&&(g+="?"+l.query),l.fragment!==null&&(g+="#"+l.fragment),g===""&&(g="./"),g},e.removeDotSegments=r=>{if(r.length===0)return"";const o=r.split("/"),a=[];for(;o.length>0;){const l=o.shift(),u=o.length===0;if(l==="."){u&&a.push("");continue}if(l===".."){a.pop(),u&&a.push("");continue}a.push(l)}return r[0]==="/"&&a.length>0&&a[0]!==""&&a.unshift(""),a.length===1&&a[0]===""?"/":a.join("/")};const i=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return e.isAbsolute=r=>n.isString(r)&&i.test(r),e.isRelative=r=>n.isString(r),Ta}var La,jh;function P_(){if(jh)return La;jh=1;const{parseLinkHeader:n,buildHeaders:e}=Wt(),{LINK_HEADER_CONTEXT:i}=Jl(),r=Zt(),o=Hf(),{prependBase:a}=Vi(),l=/(^|(\r\n))link:/i;La=({secure:f,headers:d={},xhr:g}={headers:{}})=>{return d=e(d),new o().wrapLoader(h);async function h(m){if(m.indexOf("http:")!==0&&m.indexOf("https:")!==0)throw new r('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:m});if(f&&m.indexOf("https")!==0)throw new r(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:m});let b;try{b=await u(g,m,d)}catch(S){throw new r("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:m,cause:S})}if(b.status>=400)throw new r("URL could not be dereferenced: "+b.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:m,httpStatusCode:b.status});let T={contextUrl:null,documentUrl:m,document:b.response},A=null;const N=b.getResponseHeader("Content-Type");let R;if(l.test(b.getAllResponseHeaders())&&(R=b.getResponseHeader("Link")),R&&N!=="application/ld+json"){const S=n(R),y=S[i];if(Array.isArray(y))throw new r("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:m});y&&(T.contextUrl=y.target),A=S.alternate,A&&A.type=="application/ld+json"&&!(N||"").match(/^application\/(\w*\+)?json$/)&&(T=await h(a(m,A.target)))}return T}};function u(f,d,g){f=f||XMLHttpRequest;const _=new f;return new Promise((h,m)=>{_.onload=()=>h(_),_.onerror=b=>m(b),_.open("GET",d,!0);for(const b in g)_.setRequestHeader(b,g[b]);_.send()})}return La}var Ia,$h;function C_(){if($h)return Ia;$h=1;const n=P_(),e={};return Ia=e,e.setupDocumentLoaders=function(i){typeof XMLHttpRequest<"u"&&(i.documentLoaders.xhr=n,i.useDocumentLoader("xhr"))},e.setupGlobals=function(i){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:i.JsonLdProcessor})},Ia}var Aa,Bh;function D_(){return Bh||(Bh=1,Aa=function(n){n.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Aa}var Na,qh;function k_(){if(qh)return Na;qh=1,Na=n,n.Node=o,n.create=n;function n(a){var l=this;if(l instanceof n||(l=new n),l.tail=null,l.head=null,l.length=0,a&&typeof a.forEach=="function")a.forEach(function(d){l.push(d)});else if(arguments.length>0)for(var u=0,f=arguments.length;u<f;u++)l.push(arguments[u]);return l}n.prototype.removeNode=function(a){if(a.list!==this)throw new Error("removing node which does not belong to this list");var l=a.next,u=a.prev;return l&&(l.prev=u),u&&(u.next=l),a===this.head&&(this.head=l),a===this.tail&&(this.tail=u),a.list.length--,a.next=null,a.prev=null,a.list=null,l},n.prototype.unshiftNode=function(a){if(a!==this.head){a.list&&a.list.removeNode(a);var l=this.head;a.list=this,a.next=l,l&&(l.prev=a),this.head=a,this.tail||(this.tail=a),this.length++}},n.prototype.pushNode=function(a){if(a!==this.tail){a.list&&a.list.removeNode(a);var l=this.tail;a.list=this,a.prev=l,l&&(l.next=a),this.tail=a,this.head||(this.head=a),this.length++}},n.prototype.push=function(){for(var a=0,l=arguments.length;a<l;a++)i(this,arguments[a]);return this.length},n.prototype.unshift=function(){for(var a=0,l=arguments.length;a<l;a++)r(this,arguments[a]);return this.length},n.prototype.pop=function(){if(this.tail){var a=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,a}},n.prototype.shift=function(){if(this.head){var a=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,a}},n.prototype.forEach=function(a,l){l=l||this;for(var u=this.head,f=0;u!==null;f++)a.call(l,u.value,f,this),u=u.next},n.prototype.forEachReverse=function(a,l){l=l||this;for(var u=this.tail,f=this.length-1;u!==null;f--)a.call(l,u.value,f,this),u=u.prev},n.prototype.get=function(a){for(var l=0,u=this.head;u!==null&&l<a;l++)u=u.next;if(l===a&&u!==null)return u.value},n.prototype.getReverse=function(a){for(var l=0,u=this.tail;u!==null&&l<a;l++)u=u.prev;if(l===a&&u!==null)return u.value},n.prototype.map=function(a,l){l=l||this;for(var u=new n,f=this.head;f!==null;)u.push(a.call(l,f.value,this)),f=f.next;return u},n.prototype.mapReverse=function(a,l){l=l||this;for(var u=new n,f=this.tail;f!==null;)u.push(a.call(l,f.value,this)),f=f.prev;return u},n.prototype.reduce=function(a,l){var u,f=this.head;if(arguments.length>1)u=l;else if(this.head)f=this.head.next,u=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var d=0;f!==null;d++)u=a(u,f.value,d),f=f.next;return u},n.prototype.reduceReverse=function(a,l){var u,f=this.tail;if(arguments.length>1)u=l;else if(this.tail)f=this.tail.prev,u=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var d=this.length-1;f!==null;d--)u=a(u,f.value,d),f=f.prev;return u},n.prototype.toArray=function(){for(var a=new Array(this.length),l=0,u=this.head;u!==null;l++)a[l]=u.value,u=u.next;return a},n.prototype.toArrayReverse=function(){for(var a=new Array(this.length),l=0,u=this.tail;u!==null;l++)a[l]=u.value,u=u.prev;return a},n.prototype.slice=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new n;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=0,d=this.head;d!==null&&f<a;f++)d=d.next;for(;d!==null&&f<l;f++,d=d.next)u.push(d.value);return u},n.prototype.sliceReverse=function(a,l){l=l||this.length,l<0&&(l+=this.length),a=a||0,a<0&&(a+=this.length);var u=new n;if(l<a||l<0)return u;a<0&&(a=0),l>this.length&&(l=this.length);for(var f=this.length,d=this.tail;d!==null&&f>l;f--)d=d.prev;for(;d!==null&&f>a;f--,d=d.prev)u.push(d.value);return u},n.prototype.splice=function(a,l,...u){a>this.length&&(a=this.length-1),a<0&&(a=this.length+a);for(var f=0,d=this.head;d!==null&&f<a;f++)d=d.next;for(var g=[],f=0;d&&f<l;f++)g.push(d.value),d=this.removeNode(d);d===null&&(d=this.tail),d!==this.head&&d!==this.tail&&(d=d.prev);for(var f=0;f<u.length;f++)d=e(this,d,u[f]);return g},n.prototype.reverse=function(){for(var a=this.head,l=this.tail,u=a;u!==null;u=u.prev){var f=u.prev;u.prev=u.next,u.next=f}return this.head=l,this.tail=a,this};function e(a,l,u){var f=l===a.head?new o(u,null,l,a):new o(u,l,l.next,a);return f.next===null&&(a.tail=f),f.prev===null&&(a.head=f),a.length++,f}function i(a,l){a.tail=new o(l,a.tail,null,a),a.head||(a.head=a.tail),a.length++}function r(a,l){a.head=new o(l,null,a.head,a),a.tail||(a.tail=a.head),a.length++}function o(a,l,u,f){if(!(this instanceof o))return new o(a,l,u,f);this.list=f,this.value=a,l?(l.next=this,this.prev=l):this.prev=null,u?(u.prev=this,this.next=u):this.next=null}try{D_()(n)}catch{}return Na}var Ra,zh;function Vf(){if(zh)return Ra;zh=1;const n=k_(),e=Symbol("max"),i=Symbol("length"),r=Symbol("lengthCalculator"),o=Symbol("allowStale"),a=Symbol("maxAge"),l=Symbol("dispose"),u=Symbol("noDisposeOnSet"),f=Symbol("lruList"),d=Symbol("cache"),g=Symbol("updateAgeOnGet"),_=()=>1;class h{constructor(y){if(typeof y=="number"&&(y={max:y}),y||(y={}),y.max&&(typeof y.max!="number"||y.max<0))throw new TypeError("max must be a non-negative number");this[e]=y.max||1/0;const x=y.length||_;if(this[r]=typeof x!="function"?_:x,this[o]=y.stale||!1,y.maxAge&&typeof y.maxAge!="number")throw new TypeError("maxAge must be a number");this[a]=y.maxAge||0,this[l]=y.dispose,this[u]=y.noDisposeOnSet||!1,this[g]=y.updateAgeOnGet||!1,this.reset()}set max(y){if(typeof y!="number"||y<0)throw new TypeError("max must be a non-negative number");this[e]=y||1/0,T(this)}get max(){return this[e]}set allowStale(y){this[o]=!!y}get allowStale(){return this[o]}set maxAge(y){if(typeof y!="number")throw new TypeError("maxAge must be a non-negative number");this[a]=y,T(this)}get maxAge(){return this[a]}set lengthCalculator(y){typeof y!="function"&&(y=_),y!==this[r]&&(this[r]=y,this[i]=0,this[f].forEach(x=>{x.length=this[r](x.value,x.key),this[i]+=x.length})),T(this)}get lengthCalculator(){return this[r]}get length(){return this[i]}get itemCount(){return this[f].length}rforEach(y,x){x=x||this;for(let P=this[f].tail;P!==null;){const B=P.prev;R(this,y,P,x),P=B}}forEach(y,x){x=x||this;for(let P=this[f].head;P!==null;){const B=P.next;R(this,y,P,x),P=B}}keys(){return this[f].toArray().map(y=>y.key)}values(){return this[f].toArray().map(y=>y.value)}reset(){this[l]&&this[f]&&this[f].length&&this[f].forEach(y=>this[l](y.key,y.value)),this[d]=new Map,this[f]=new n,this[i]=0}dump(){return this[f].map(y=>b(this,y)?!1:{k:y.key,v:y.value,e:y.now+(y.maxAge||0)}).toArray().filter(y=>y)}dumpLru(){return this[f]}set(y,x,P){if(P=P||this[a],P&&typeof P!="number")throw new TypeError("maxAge must be a number");const B=P?Date.now():0,O=this[r](x,y);if(this[d].has(y)){if(O>this[e])return A(this,this[d].get(y)),!1;const q=this[d].get(y).value;return this[l]&&(this[u]||this[l](y,q.value)),q.now=B,q.maxAge=P,q.value=x,this[i]+=O-q.length,q.length=O,this.get(y),T(this),!0}const J=new N(y,x,O,B,P);return J.length>this[e]?(this[l]&&this[l](y,x),!1):(this[i]+=J.length,this[f].unshift(J),this[d].set(y,this[f].head),T(this),!0)}has(y){if(!this[d].has(y))return!1;const x=this[d].get(y).value;return!b(this,x)}get(y){return m(this,y,!0)}peek(y){return m(this,y,!1)}pop(){const y=this[f].tail;return y?(A(this,y),y.value):null}del(y){A(this,this[d].get(y))}load(y){this.reset();const x=Date.now();for(let P=y.length-1;P>=0;P--){const B=y[P],O=B.e||0;if(O===0)this.set(B.k,B.v);else{const J=O-x;J>0&&this.set(B.k,B.v,J)}}}prune(){this[d].forEach((y,x)=>m(this,x,!1))}}const m=(S,y,x)=>{const P=S[d].get(y);if(P){const B=P.value;if(b(S,B)){if(A(S,P),!S[o])return}else x&&(S[g]&&(P.value.now=Date.now()),S[f].unshiftNode(P));return B.value}},b=(S,y)=>{if(!y||!y.maxAge&&!S[a])return!1;const x=Date.now()-y.now;return y.maxAge?x>y.maxAge:S[a]&&x>S[a]},T=S=>{if(S[i]>S[e])for(let y=S[f].tail;S[i]>S[e]&&y!==null;){const x=y.prev;A(S,y),y=x}},A=(S,y)=>{if(y){const x=y.value;S[l]&&S[l](x.key,x.value),S[i]-=x.length,S[d].delete(x.key),S[f].removeNode(y)}};class N{constructor(y,x,P,B,O){this.key=y,this.value=x,this.length=P,this.now=B,this.maxAge=O||0}}const R=(S,y,x,P)=>{let B=x.value;b(S,B)&&(A(S,x),S[o]||(B=void 0)),B&&y.call(P,B.value,B.key,S)};return Ra=h,Ra}var Pa,Uh;function M_(){if(Uh)return Pa;Uh=1;const n=Vf(),e=10;return Pa=class{constructor({document:r}){this.document=r,this.cache=new n({max:e})}getProcessed(r){return this.cache.get(r)}setProcessed(r,o){this.cache.set(r,o)}},Pa}var Ca,Hh;function O_(){if(Hh)return Ca;Hh=1;const{isArray:n,isObject:e,isString:i}=qt(),{asArray:r}=Wt(),{prependBase:o}=Vi(),a=Zt(),l=M_(),u=10;Ca=class{constructor({sharedCache:_}){this.perOpCache=new Map,this.sharedCache=_}async resolve({activeCtx:_,context:h,documentLoader:m,base:b,cycles:T=new Set}){h&&e(h)&&h["@context"]&&(h=h["@context"]),h=r(h);const A=[];for(const N of h){if(i(N)){let y=this._get(N);y||(y=await this._resolveRemoteContext({activeCtx:_,url:N,documentLoader:m,base:b,cycles:T})),n(y)?A.push(...y):A.push(y);continue}if(N===null){A.push(new l({document:null}));continue}e(N)||f(h);const R=JSON.stringify(N);let S=this._get(R);S||(S=new l({document:N}),this._cacheResolvedContext({key:R,resolved:S,tag:"static"})),A.push(S)}return A}_get(_){let h=this.perOpCache.get(_);if(!h){const m=this.sharedCache.get(_);m&&(h=m.get("static"),h&&this.perOpCache.set(_,h))}return h}_cacheResolvedContext({key:_,resolved:h,tag:m}){if(this.perOpCache.set(_,h),m!==void 0){let b=this.sharedCache.get(_);b||(b=new Map,this.sharedCache.set(_,b)),b.set(m,h)}return h}async _resolveRemoteContext({activeCtx:_,url:h,documentLoader:m,base:b,cycles:T}){h=o(b,h);const{context:A,remoteDoc:N}=await this._fetchContext({activeCtx:_,url:h,documentLoader:m,cycles:T});b=N.documentUrl||h,d({context:A,base:b});const R=await this.resolve({activeCtx:_,context:A,documentLoader:m,base:b,cycles:T});return this._cacheResolvedContext({key:h,resolved:R,tag:N.tag}),R}async _fetchContext({activeCtx:_,url:h,documentLoader:m,cycles:b}){if(b.size>u)throw new a("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:_.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:u});if(b.has(h))throw new a("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:_.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:h});b.add(h);let T,A;try{A=await m(h),T=A.document||null,i(T)&&(T=JSON.parse(T))}catch(N){throw new a(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${h}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:h,cause:N})}if(!e(T))throw new a(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${h}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:h});return"@context"in T?T={"@context":T["@context"]}:T={"@context":{}},A.contextUrl&&(n(T["@context"])||(T["@context"]=[T["@context"]]),T["@context"].push(A.contextUrl)),{context:T,remoteDoc:A}}};function f(g){throw new a("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:g})}function d({context:g,base:_}){if(!g)return;const h=g["@context"];if(i(h)){g["@context"]=o(_,h);return}if(n(h)){for(let m=0;m<h.length;++m){const b=h[m];if(i(b)){h[m]=o(_,b);continue}e(b)&&d({context:{"@context":b},base:_})}return}if(e(h))for(const m in h)d({context:h[m],base:_})}return Ca}var Da,Vh;function F_(){return Vh||(Vh=1,Da=Xl().NQuads),Da}var ka,Wh;function Wr(){if(Wh)return ka;Wh=1;const n=Zt(),{isArray:e}=qt(),{asArray:i}=Wt(),r={};ka=r,r.defaultEventHandler=null,r.setupEventHandler=({options:l={}})=>{const u=[].concat(l.safe?r.safeEventHandler:[],l.eventHandler?i(l.eventHandler):[],r.defaultEventHandler?r.defaultEventHandler:[]);return u.length===0?null:u},r.handleEvent=({event:l,options:u})=>{o({event:l,handlers:u.eventHandler})};function o({event:l,handlers:u}){let f=!0;for(let d=0;f&&d<u.length;++d){f=!1;const g=u[d];if(e(g))f=o({event:l,handlers:g});else if(typeof g=="function")g({event:l,next:()=>{f=!0}});else if(typeof g=="object")l.code in g?g[l.code]({event:l,next:()=>{f=!0}}):f=!0;else throw new n("Invalid event handler.","jsonld.InvalidEventHandler",{event:l})}return f}const a=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);return r.safeEventHandler=function({event:u,next:f}){if(u.level==="warning"&&a.has(u.code))throw new n("Safe mode validation error.","jsonld.ValidationError",{event:u});f()},r.logEventHandler=function({event:u,next:f}){console.log(`EVENT: ${u.message}`,{event:u}),f()},r.logWarningEventHandler=function({event:u,next:f}){u.level==="warning"&&console.warn(`WARNING: ${u.message}`,{event:u}),f()},r.unhandledEventHandler=function({event:u}){throw new n("No handler for event.","jsonld.UnhandledEvent",{event:u})},r.setDefaultEventHandler=function({eventHandler:l}={}){r.defaultEventHandler=l?i(l):null},ka}var Ma,Gh;function mn(){if(Gh)return Ma;Gh=1;const n=Wt(),e=Zt(),{isArray:i,isObject:r,isString:o,isUndefined:a}=qt(),{isAbsolute:l,isRelative:u,prependBase:f}=Vi(),{handleEvent:d}=Wr(),{REGEX_BCP47:g,REGEX_KEYWORD:_,asArray:h,compareShortestLeast:m}=Wt(),b=new Map,T=1e4,A={};Ma=A,A.process=async({activeCtx:S,localCtx:y,options:x,propagate:P=!0,overrideProtected:B=!1,cycles:O=new Set})=>{if(r(y)&&"@context"in y&&i(y["@context"])&&(y=y["@context"]),h(y).length===0)return S;const k=[],q=[({event:ue,next:D})=>{k.push(ue),D()}];x.eventHandler&&q.push(x.eventHandler);const X=x;x={...x,eventHandler:q};const F=await x.contextResolver.resolve({activeCtx:S,context:y,documentLoader:x.documentLoader,base:x.base});r(F[0].document)&&typeof F[0].document["@propagate"]=="boolean"&&(P=F[0].document["@propagate"]);let $=S;!P&&!$.previousContext&&($=$.clone(),$.previousContext=S);for(const ue of F){let{document:D}=ue;if(S=$,D===null){if(!B&&Object.keys(S.protected).length!==0)throw new e("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});$=S=A.getInitialContext(x).clone();continue}const se=ue.getProcessed(S);if(se){if(X.eventHandler)for(const ae of se.events)d({event:ae,options:X});$=S=se.context;continue}if(r(D)&&"@context"in D&&(D=D["@context"]),!r(D))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:D});$=$.clone();const j=new Map;if("@version"in D){if(D["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+D["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:D});if(S.processingMode&&S.processingMode==="json-ld-1.0")throw new e("@version: "+D["@version"]+" not compatible with "+S.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:D});$.processingMode="json-ld-1.1",$["@version"]=D["@version"],j.set("@version",!0)}if($.processingMode=$.processingMode||S.processingMode,"@base"in D){let ae=D["@base"];if(!(ae===null||l(ae)))if(u(ae))ae=f($["@base"],ae);else throw new e('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:D});$["@base"]=ae,j.set("@base",!0)}if("@vocab"in D){const ae=D["@vocab"];if(ae===null)delete $["@vocab"];else if(o(ae)){if(!l(ae)&&A.processingMode($,1))throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:D});{const I=N($,ae,{vocab:!0,base:!0},void 0,void 0,x);l(I)||x.eventHandler&&d({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:I}},options:x}),$["@vocab"]=I}}else throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:D});j.set("@vocab",!0)}if("@language"in D){const ae=D["@language"];if(ae===null)delete $["@language"];else if(o(ae))ae.match(g)||x.eventHandler&&d({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ae}},options:x}),$["@language"]=ae.toLowerCase();else throw new e('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:D});j.set("@language",!0)}if("@direction"in D){const ae=D["@direction"];if(S.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:D});if(ae===null)delete $["@direction"];else{if(ae!=="ltr"&&ae!=="rtl")throw new e('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:D});$["@direction"]=ae}j.set("@direction",!0)}if("@propagate"in D){const ae=D["@propagate"];if(S.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:D});if(typeof ae!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:y});j.set("@propagate",!0)}if("@import"in D){const ae=D["@import"];if(S.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+S.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:D});if(!o(ae))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:y});const I=await x.contextResolver.resolve({activeCtx:S,context:ae,documentLoader:x.documentLoader,base:x.base});if(I.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:y});const Z=I[0].getProcessed(S);if(Z)D=Z;else{const ne=I[0].document;if("@import"in ne)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:y});for(const ee in ne)D.hasOwnProperty(ee)||(D[ee]=ne[ee]);I[0].setProcessed(S,D)}j.set("@import",!0)}j.set("@protected",D["@protected"]||!1);for(const ae in D)if(A.createTermDefinition({activeCtx:$,localCtx:D,term:ae,defined:j,options:x,overrideProtected:B}),r(D[ae])&&"@context"in D[ae]){const I=D[ae]["@context"];let Z=!0;if(o(I)){const ne=f(x.base,I);O.has(ne)?Z=!1:O.add(ne)}if(Z)try{await A.process({activeCtx:$.clone(),localCtx:D[ae]["@context"],overrideProtected:!0,options:x,cycles:O})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:D[ae]["@context"],term:ae})}}ue.setProcessed(S,{context:$,events:k})}return $},A.createTermDefinition=({activeCtx:S,localCtx:y,term:x,defined:P,options:B,overrideProtected:O=!1})=>{if(P.has(x)){if(P.get(x))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:y,term:x})}P.set(x,!1);let J;if(y.hasOwnProperty(x)&&(J=y[x]),x==="@type"&&r(J)&&(J["@container"]||"@set")==="@set"&&A.processingMode(S,1.1)){const D=["@container","@id","@protected"],se=Object.keys(J);if(se.length===0||se.some(j=>!D.includes(j)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:x})}else{if(A.isKeyword(x))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:y,term:x});if(x.match(_)){B.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:x}},options:B});return}else if(x==="")throw new e("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:y})}const k=S.mappings.get(x);S.mappings.has(x)&&S.mappings.delete(x);let q=!1;if((o(J)||J===null)&&(q=!0,J={"@id":J}),!r(J))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:y});const X={};S.mappings.set(x,X),X.reverse=!1;const F=["@container","@id","@language","@reverse","@type"];A.processingMode(S,1.1)&&F.push("@context","@direction","@index","@nest","@prefix","@protected");for(const D in J)if(!F.includes(D))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+D,"jsonld.SyntaxError",{code:"invalid term definition",context:y});const $=x.indexOf(":");if(X._termHasColon=$>0,"@reverse"in J){if("@id"in J)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});if("@nest"in J)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});const D=J["@reverse"];if(!o(D))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(D.match(_)){B.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:D}},options:B}),k?S.mappings.set(x,k):S.mappings.delete(x);return}const se=N(S,D,{vocab:!0,base:!1},y,P,B);if(!l(se))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});X["@id"]=se,X.reverse=!0}else if("@id"in J){let D=J["@id"];if(D&&!o(D))throw new e("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(D===null)X["@id"]=null;else if(!A.isKeyword(D)&&D.match(_)){B.eventHandler&&d({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:D}},options:B}),k?S.mappings.set(x,k):S.mappings.delete(x);return}else if(D!==x){if(D=N(S,D,{vocab:!0,base:!1},y,P,B),!l(D)&&!A.isKeyword(D))throw new e("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y});if(x.match(/(?::[^:])|\//)){const se=new Map(P).set(x,!0);if(N(S,x,{vocab:!0,base:!1},y,se,B)!==D)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y})}X["@id"]=D,X._prefix=q&&!X._termHasColon&&D.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in X))if(X._termHasColon){const D=x.substr(0,$);if(y.hasOwnProperty(D)&&A.createTermDefinition({activeCtx:S,localCtx:y,term:D,defined:P,options:B}),S.mappings.has(D)){const se=x.substr($+1);X["@id"]=S.mappings.get(D)["@id"]+se}else X["@id"]=x}else if(x==="@type")X["@id"]=x;else{if(!("@vocab"in S))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:y,term:x});X["@id"]=S["@vocab"]+x}if((J["@protected"]===!0||P.get("@protected")===!0&&J["@protected"]!==!1)&&(S.protected[x]=!0,X.protected=!0),P.set(x,!0),"@type"in J){let D=J["@type"];if(!o(D))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(D==="@json"||D==="@none"){if(A.processingMode(S,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${D}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else if(D!=="@id"&&D!=="@vocab"){if(D=N(S,D,{vocab:!0,base:!1},y,P,B),!l(D))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:y});if(D.indexOf("_:")===0)throw new e("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}X["@type"]=D}if("@container"in J){const D=o(J["@container"])?[J["@container"]]:J["@container"]||[],se=["@list","@set","@index","@language"];let j=!0;const ae=D.includes("@set");if(A.processingMode(S,1.1)){if(se.push("@graph","@id","@type"),D.includes("@list")){if(D.length!==1)throw new e("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:y})}else if(D.includes("@graph")){if(D.some(I=>I!=="@graph"&&I!=="@id"&&I!=="@index"&&I!=="@set"))throw new e("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:y})}else j&=D.length<=(ae?2:1);if(D.includes("@type")&&(X["@type"]=X["@type"]||"@id",!["@id","@vocab"].includes(X["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:y})}else j&=!i(J["@container"]),j&=D.length<=1;if(j&=D.every(I=>se.includes(I)),j&=!(ae&&D.includes("@list")),!j)throw new e("Invalid JSON-LD syntax; @context @container value must be one of the following: "+se.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:y});if(X.reverse&&!D.every(I=>["@index","@set"].includes(I)))throw new e("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:y});X["@container"]=D}if("@index"in J){if(!("@container"in J)||!X["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${J["@index"]}" on term "${x}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});if(!o(J["@index"])||J["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${J["@index"]}" on term "${x}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:y});X["@index"]=J["@index"]}if("@context"in J&&(X["@context"]=J["@context"]),"@language"in J&&!("@type"in J)){let D=J["@language"];if(D!==null&&!o(D))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:y});D!==null&&(D=D.toLowerCase()),X["@language"]=D}if("@prefix"in J){if(x.match(/:|\//))throw new e("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(A.isKeyword(X["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:y});if(typeof J["@prefix"]=="boolean")X._prefix=J["@prefix"]===!0;else throw new e("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:y})}if("@direction"in J){const D=J["@direction"];if(D!==null&&D!=="ltr"&&D!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:y});X["@direction"]=D}if("@nest"in J){const D=J["@nest"];if(!o(D)||D!=="@nest"&&D.indexOf("@")===0)throw new e("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:y});X["@nest"]=D}// disallow aliasing @context and @preserve
|
|
355
|
+
const ue=X["@id"];if(ue==="@context"||ue==="@preserve")throw new e("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:y});if(k&&k.protected&&!O&&(S.protected[x]=!0,X.protected=!0,!R(k,X)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:y,term:x})},A.expandIri=(S,y,x,P)=>N(S,y,x,void 0,void 0,P);function N(S,y,x,P,B,O){if(y===null||!o(y)||A.isKeyword(y))return y;if(y.match(_))return null;if(P&&P.hasOwnProperty(y)&&B.get(y)!==!0&&A.createTermDefinition({activeCtx:S,localCtx:P,term:y,defined:B,options:O}),x=x||{},x.vocab){const k=S.mappings.get(y);if(k===null)return null;if(r(k)&&"@id"in k)return k["@id"]}const J=y.indexOf(":");if(J>0){const k=y.substr(0,J),q=y.substr(J+1);if(k==="_"||q.indexOf("//")===0)return y;P&&P.hasOwnProperty(k)&&A.createTermDefinition({activeCtx:S,localCtx:P,term:k,defined:B,options:O});const X=S.mappings.get(k);if(X&&X._prefix)return X["@id"]+q;if(l(y))return y}if(x.vocab&&"@vocab"in S)y=S["@vocab"]+y;else if(x.base){let k,q;"@base"in S?S["@base"]?(q=f(O.base,S["@base"]),k=f(q,y)):(q=S["@base"],k=y):(q=O.base,k=f(O.base,y)),y=k}return y}A.getInitialContext=S=>{const y=JSON.stringify({processingMode:S.processingMode}),x=b.get(y);if(x)return x;const P={processingMode:S.processingMode,mappings:new Map,inverse:null,getInverse:B,clone:k,revertToPreviousContext:q,protected:{}};return b.size===T&&b.clear(),b.set(y,P),P;function B(){const X=this;if(X.inverse)return X.inverse;const F=X.inverse={},$=X.fastCurieMap={},ue={},D=(X["@language"]||"@none").toLowerCase(),se=X["@direction"],j=X.mappings,ae=[...j.keys()].sort(m);for(const I of ae){const Z=j.get(I);if(Z===null)continue;let ne=Z["@container"]||"@none";if(ne=[].concat(ne).sort().join(""),Z["@id"]===null)continue;const ee=h(Z["@id"]);for(const _e of ee){let G=F[_e];const W=A.isKeyword(_e);if(G)!W&&!Z._termHasColon&&ue[_e].push(I);else if(F[_e]=G={},!W&&!Z._termHasColon){ue[_e]=[I];const Y={iri:_e,terms:ue[_e]};_e[0]in $?$[_e[0]].push(Y):$[_e[0]]=[Y]}if(G[ne]||(G[ne]={"@language":{},"@type":{},"@any":{}}),G=G[ne],J(I,G["@any"],"@none"),Z.reverse)J(I,G["@type"],"@reverse");else if(Z["@type"]==="@none")J(I,G["@any"],"@none"),J(I,G["@language"],"@none"),J(I,G["@type"],"@none");else if("@type"in Z)J(I,G["@type"],Z["@type"]);else if("@language"in Z&&"@direction"in Z){const Y=Z["@language"],K=Z["@direction"];Y&&K?J(I,G["@language"],`${Y}_${K}`.toLowerCase()):Y?J(I,G["@language"],Y.toLowerCase()):K?J(I,G["@language"],`_${K}`):J(I,G["@language"],"@null")}else"@language"in Z?J(I,G["@language"],(Z["@language"]||"@null").toLowerCase()):"@direction"in Z?Z["@direction"]?J(I,G["@language"],`_${Z["@direction"]}`):J(I,G["@language"],"@none"):se?(J(I,G["@language"],`_${se}`),J(I,G["@language"],"@none"),J(I,G["@type"],"@none")):(J(I,G["@language"],D),J(I,G["@language"],"@none"),J(I,G["@type"],"@none"))}}for(const I in $)O($,I,1);return F}function O(X,F,$){const ue=X[F],D=X[F]={};let se,j;for(const ae of ue)se=ae.iri,$>=se.length?j="":j=se[$],j in D?D[j].push(ae):D[j]=[ae];for(const ae in D)ae!==""&&O(D,ae,$+1)}function J(X,F,$){F.hasOwnProperty($)||(F[$]=X)}function k(){const X={};return X.mappings=n.clone(this.mappings),X.clone=this.clone,X.inverse=null,X.getInverse=this.getInverse,X.protected=n.clone(this.protected),this.previousContext&&(X.previousContext=this.previousContext.clone()),X.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(X["@base"]=this["@base"]),"@language"in this&&(X["@language"]=this["@language"]),"@vocab"in this&&(X["@vocab"]=this["@vocab"]),X}function q(){return this.previousContext?this.previousContext.clone():this}},A.getContextValue=(S,y,x)=>{if(y===null)return x==="@context"?void 0:null;if(S.mappings.has(y)){const P=S.mappings.get(y);if(a(x))return P;if(P.hasOwnProperty(x))return P[x]}if(x==="@language"&&x in S||x==="@direction"&&x in S)return S[x];if(x!=="@context")return null},A.processingMode=(S,y)=>y.toString()>="1.1"?!S.processingMode||S.processingMode>="json-ld-"+y.toString():S.processingMode==="json-ld-1.0",A.isKeyword=S=>{if(!o(S)||S[0]!=="@")return!1;switch(S){case"@base":case"@container":case"@context":case"@default":case"@direction":case"@embed":case"@explicit":case"@graph":case"@id":case"@included":case"@index":case"@json":case"@language":case"@list":case"@nest":case"@none":case"@omitDefault":case"@prefix":case"@preserve":case"@protected":case"@requireAll":case"@reverse":case"@set":case"@type":case"@value":case"@version":case"@vocab":return!0}return!1};function R(S,y){if(!(S&&typeof S=="object")||!(y&&typeof y=="object"))return S===y;const x=Array.isArray(S);if(x!==Array.isArray(y))return!1;if(x){if(S.length!==y.length)return!1;for(let O=0;O<S.length;++O)if(!R(S[O],y[O]))return!1;return!0}const P=Object.keys(S),B=Object.keys(y);if(P.length!==B.length)return!1;for(const O in S){let J=S[O],k=y[O];if(O==="@container"&&Array.isArray(J)&&Array.isArray(k)&&(J=J.slice().sort(),k=k.slice().sort()),!R(J,k))return!1}return!0}return Ma}var Oa,Zh;function j_(){if(Zh)return Oa;Zh=1;const n=Zt(),{isArray:e,isObject:i,isEmptyObject:r,isString:o,isUndefined:a}=qt(),{isList:l,isValue:u,isGraph:f,isSubject:d}=Ni(),{expandIri:g,getContextValue:_,isKeyword:h,process:m,processingMode:b}=mn(),{isAbsolute:T}=Vi(),{REGEX_BCP47:A,REGEX_KEYWORD:N,addValue:R,asArray:S,getValues:y,validateTypeValue:x}=Wt(),{handleEvent:P}=Wr(),B={};Oa=B,B.expand=async({activeCtx:F,activeProperty:$=null,element:ue,options:D={},insideList:se=!1,insideIndex:j=!1,typeScopedContext:ae=null})=>{if(ue==null)return null;if($==="@default"&&(D=Object.assign({},D,{isFrame:!1})),!e(ue)&&!i(ue))return!se&&($===null||g(F,$,{vocab:!0},D)==="@graph")?(D.eventHandler&&P({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:ue}},options:D}),null):k({activeCtx:F,activeProperty:$,value:ue,options:D});if(e(ue)){let Y=[];const K=_(F,$,"@container")||[];se=se||K.includes("@list");for(let oe=0;oe<ue.length;++oe){let ce=await B.expand({activeCtx:F,activeProperty:$,element:ue[oe],options:D,insideIndex:j,typeScopedContext:ae});se&&e(ce)&&(ce={"@list":ce}),ce!==null&&(e(ce)?Y=Y.concat(ce):Y.push(ce))}return Y}const I=g(F,$,{vocab:!0},D),Z=_(F,$,"@context");ae=ae||(F.previousContext?F:null);let ne=Object.keys(ue).sort(),ee=!j;if(ee&&ae&&ne.length<=2&&!ne.includes("@context"))for(const Y of ne){const K=g(ae,Y,{vocab:!0},D);if(K==="@value"){ee=!1,F=ae;break}if(K==="@id"&&ne.length===1){ee=!1;break}}ee&&(F=F.revertToPreviousContext()),a(Z)||(F=await m({activeCtx:F,localCtx:Z,propagate:!0,overrideProtected:!0,options:D})),"@context"in ue&&(F=await m({activeCtx:F,localCtx:ue["@context"],options:D})),ae=F;let _e=null;for(const Y of ne)if(g(F,Y,{vocab:!0},D)==="@type"){_e=_e||Y;const oe=ue[Y],ce=Array.isArray(oe)?oe.length>1?oe.slice().sort():oe:[oe];for(const Ee of ce){const Te=_(ae,Ee,"@context");a(Te)||(F=await m({activeCtx:F,localCtx:Te,options:D,propagate:!1}))}}let G={};await J({activeCtx:F,activeProperty:$,expandedActiveProperty:I,element:ue,expandedParent:G,options:D,insideList:se,typeKey:_e,typeScopedContext:ae}),ne=Object.keys(G);let W=ne.length;if("@value"in G){if("@type"in G&&("@language"in G||"@direction"in G))throw new n('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:G});let Y=W-1;if("@type"in G&&(Y-=1),"@index"in G&&(Y-=1),"@language"in G&&(Y-=1),"@direction"in G&&(Y-=1),Y!==0)throw new n('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:G});const K=G["@value"]===null?[]:S(G["@value"]),oe=y(G,"@type");if(!(b(F,1.1)&&oe.includes("@json")&&oe.length===1))if(K.length===0)D.eventHandler&&P({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:G}},options:D}),G=null;else{if(!K.every(ce=>o(ce)||r(ce))&&"@language"in G)throw new n("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:G});if(!oe.every(ce=>T(ce)&&!(o(ce)&&ce.indexOf("_:")===0)||r(ce)))throw new n('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:G})}}else if("@type"in G&&!e(G["@type"]))G["@type"]=[G["@type"]];else if("@set"in G||"@list"in G){if(W>1&&!(W===2&&"@index"in G))throw new n('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:G});"@set"in G&&(G=G["@set"],ne=Object.keys(G),W=ne.length)}else W===1&&"@language"in G&&(D.eventHandler&&P({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:G}},options:D}),G=null);return i(G)&&!D.keepFreeFloatingNodes&&!se&&($===null||I==="@graph"||(_(F,$,"@container")||[]).includes("@graph"))&&(G=O({value:G,count:W,options:D})),G};function O({value:F,count:$,options:ue}){if($===0||"@value"in F||"@list"in F||$===1&&"@id"in F){if(ue.eventHandler){let D,se;$===0?(D="empty object",se="Dropping empty object."):"@value"in F?(D="object with only @value",se="Dropping object with only @value."):"@list"in F?(D="object with only @list",se="Dropping object with only @list."):$===1&&"@id"in F&&(D="object with only @id",se="Dropping object with only @id."),P({event:{type:["JsonLdEvent"],code:D,level:"warning",message:se,details:{value:F}},options:ue})}return null}return F}async function J({activeCtx:F,activeProperty:$,expandedActiveProperty:ue,element:D,expandedParent:se,options:j={},insideList:ae,typeKey:I,typeScopedContext:Z}){const ne=Object.keys(D).sort(),ee=[];let _e;const G=D[I]&&g(F,e(D[I])?D[I][0]:D[I],{vocab:!0},{...j,typeExpansion:!0})==="@json";for(const W of ne){let Y=D[W],K;if(W==="@context")continue;const oe=g(F,W,{vocab:!0},j);if(oe===null||!(T(oe)||h(oe))){j.eventHandler&&P({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:W,expandedProperty:oe}},options:j});continue}if(h(oe)){if(ue==="@reverse")throw new n("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:Y});if(oe in se&&oe!=="@included"&&oe!=="@type")throw new n("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:oe})}if(oe==="@id"){if(!o(Y)){if(!j.isFrame)throw new n('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:Y});if(i(Y)){if(!r(Y))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Y})}else if(e(Y)){if(!Y.every(z=>o(z)))throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Y})}else throw new n('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:Y})}R(se,"@id",S(Y).map(z=>{if(o(z)){const te=g(F,z,{base:!0},j);return j.eventHandler&&(te===null?P(z===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:z}},options:j}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:z}},options:j}):T(te)||P({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:z,expandedId:te}},options:j})),te}return z}),{propertyIsArray:j.isFrame});continue}if(oe==="@type"){i(Y)&&(Y=Object.fromEntries(Object.entries(Y).map(([z,te])=>[g(Z,z,{vocab:!0}),S(te).map(fe=>g(Z,fe,{base:!0,vocab:!0},{...j,typeExpansion:!0}))]))),x(Y,j.isFrame),R(se,"@type",S(Y).map(z=>{if(o(z)){const te=g(Z,z,{base:!0,vocab:!0},{...j,typeExpansion:!0});return te!=="@json"&&!T(te)&&j.eventHandler&&P({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:z}},options:j}),te}return z}),{propertyIsArray:!!j.isFrame});continue}if(oe==="@included"&&b(F,1.1)){const z=S(await B.expand({activeCtx:F,activeProperty:$,element:Y,options:j}));if(!z.every(te=>d(te)))throw new n("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:Y});R(se,"@included",z,{propertyIsArray:!0});continue}if(oe==="@graph"&&!(i(Y)||e(Y)))throw new n('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:Y});if(oe==="@value"){_e=Y,G&&b(F,1.1)?se["@value"]=Y:R(se,"@value",Y,{propertyIsArray:j.isFrame});continue}if(oe==="@language"){if(Y===null)continue;if(!o(Y)&&!j.isFrame)throw new n('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:Y});Y=S(Y).map(z=>o(z)?z.toLowerCase():z);for(const z of Y)o(z)&&!z.match(A)&&j.eventHandler&&P({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:z}},options:j});R(se,"@language",Y,{propertyIsArray:j.isFrame});continue}if(oe==="@direction"){if(!o(Y)&&!j.isFrame)throw new n('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:Y});Y=S(Y);for(const z of Y)if(o(z)&&z!=="ltr"&&z!=="rtl")throw new n('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:Y});R(se,"@direction",Y,{propertyIsArray:j.isFrame});continue}if(oe==="@index"){if(!o(Y))throw new n('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:Y});R(se,"@index",Y);continue}if(oe==="@reverse"){if(!i(Y))throw new n('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:Y});if(K=await B.expand({activeCtx:F,activeProperty:"@reverse",element:Y,options:j}),"@reverse"in K)for(const te in K["@reverse"])R(se,te,K["@reverse"][te],{propertyIsArray:!0});let z=se["@reverse"]||null;for(const te in K){if(te==="@reverse")continue;z===null&&(z=se["@reverse"]={}),R(z,te,[],{propertyIsArray:!0});const fe=K[te];for(let we=0;we<fe.length;++we){const Se=fe[we];if(u(Se)||l(Se))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});R(z,te,Se,{propertyIsArray:!0})}}continue}if(oe==="@nest"){ee.push(W);continue}let ce=F;const Ee=_(F,W,"@context");a(Ee)||(ce=await m({activeCtx:F,localCtx:Ee,propagate:!0,overrideProtected:!0,options:j}));const Te=_(F,W,"@container")||[];if(Te.includes("@language")&&i(Y)){const z=_(ce,W,"@direction");K=q(ce,Y,z,j)}else if(Te.includes("@index")&&i(Y)){const z=Te.includes("@graph"),te=_(ce,W,"@index")||"@index",fe=te!=="@index"&&g(F,te,{vocab:!0},j);K=await X({activeCtx:ce,options:j,activeProperty:W,value:Y,asGraph:z,indexKey:te,propertyIndex:fe})}else if(Te.includes("@id")&&i(Y)){const z=Te.includes("@graph");K=await X({activeCtx:ce,options:j,activeProperty:W,value:Y,asGraph:z,indexKey:"@id"})}else if(Te.includes("@type")&&i(Y))K=await X({activeCtx:ce.revertToPreviousContext(),options:j,activeProperty:W,value:Y,asGraph:!1,indexKey:"@type"});else{const z=oe==="@list";if(z||oe==="@set"){let te=$;z&&ue==="@graph"&&(te=null),K=await B.expand({activeCtx:ce,activeProperty:te,element:Y,options:j,insideList:z})}else _(F,W,"@type")==="@json"?K={"@type":"@json","@value":Y}:K=await B.expand({activeCtx:ce,activeProperty:W,element:Y,options:j,insideList:!1})}if(!(K===null&&oe!=="@value")){if(oe!=="@list"&&!l(K)&&Te.includes("@list")&&(K={"@list":S(K)}),Te.includes("@graph")&&!Te.some(z=>z==="@id"||z==="@index")){if(K=S(K),j.isFrame||(K=K.filter(z=>{const te=Object.keys(z).length;return O({value:z,count:te,options:j})!==null})),K.length===0)continue;K=K.map(z=>({"@graph":S(z)}))}if(ce.mappings.has(W)&&ce.mappings.get(W).reverse){const z=se["@reverse"]=se["@reverse"]||{};K=S(K);for(let te=0;te<K.length;++te){const fe=K[te];if(u(fe)||l(fe))throw new n('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:K});R(z,oe,fe,{propertyIsArray:!0})}continue}R(se,oe,K,{propertyIsArray:!0})}}if("@value"in se&&!(se["@type"]==="@json"&&b(F,1.1))){if((i(_e)||e(_e))&&!j.isFrame)throw new n('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:_e})}for(const W of ee){const Y=e(D[W])?D[W]:[D[W]];for(const K of Y){if(!i(K)||Object.keys(K).some(oe=>g(F,oe,{vocab:!0},j)==="@value"))throw new n("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:K});await J({activeCtx:F,activeProperty:$,expandedActiveProperty:ue,element:K,expandedParent:se,options:j,insideList:ae,typeScopedContext:Z,typeKey:I})}}}function k({activeCtx:F,activeProperty:$,value:ue,options:D}){if(ue==null)return null;const se=g(F,$,{vocab:!0},D);if(se==="@id")return g(F,ue,{base:!0},D);if(se==="@type")return g(F,ue,{vocab:!0,base:!0},{...D,typeExpansion:!0});const j=_(F,$,"@type");if((j==="@id"||se==="@graph")&&o(ue)){const I=g(F,ue,{base:!0},D);return I===null&&ue.match(N)&&D.eventHandler&&P({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:$}},options:D}),{"@id":I}}if(j==="@vocab"&&o(ue))return{"@id":g(F,ue,{vocab:!0,base:!0},D)};if(h(se))return ue;const ae={};if(j&&!["@id","@vocab","@none"].includes(j))ae["@type"]=j;else if(o(ue)){const I=_(F,$,"@language");I!==null&&(ae["@language"]=I);const Z=_(F,$,"@direction");Z!==null&&(ae["@direction"]=Z)}return["boolean","number","string"].includes(typeof ue)||(ue=ue.toString()),ae["@value"]=ue,ae}function q(F,$,ue,D){const se=[],j=Object.keys($).sort();for(const ae of j){const I=g(F,ae,{vocab:!0},D);let Z=$[ae];e(Z)||(Z=[Z]);for(const ne of Z){if(ne===null)continue;if(!o(ne))throw new n("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:$});const ee={"@value":ne};I!=="@none"&&(ae.match(A)||D.eventHandler&&P({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:ae}},options:D}),ee["@language"]=ae.toLowerCase()),ue&&(ee["@direction"]=ue),se.push(ee)}}return se}async function X({activeCtx:F,options:$,activeProperty:ue,value:D,asGraph:se,indexKey:j,propertyIndex:ae}){const I=[],Z=Object.keys(D).sort(),ne=j==="@type";for(let ee of Z){if(ne){const W=_(F,ee,"@context");a(W)||(F=await m({activeCtx:F,localCtx:W,propagate:!1,options:$}))}let _e=D[ee];e(_e)||(_e=[_e]),_e=await B.expand({activeCtx:F,activeProperty:ue,element:_e,options:$,insideList:!1,insideIndex:!0});let G;ae?ee==="@none"?G="@none":G=k({activeCtx:F,activeProperty:j,value:ee,options:$}):G=g(F,ee,{vocab:!0},$),j==="@id"?ee=g(F,ee,{base:!0},$):ne&&(ee=G);for(let W of _e){if(se&&!f(W)&&(W={"@graph":[W]}),j==="@type")G==="@none"||(W["@type"]?W["@type"]=[ee].concat(W["@type"]):W["@type"]=[ee]);else{if(u(W)&&!["@language","@type","@index"].includes(j))throw new n(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${j}".`,"jsonld.SyntaxError",{code:"invalid value object",value:W});ae?G!=="@none"&&R(W,ae,G,{propertyIsArray:!0,prependValue:!0}):G!=="@none"&&!(j in W)&&(W[j]=ee)}I.push(W)}}return I}return Oa}var Fa,Xh;function Js(){if(Xh)return Fa;Xh=1;const{isKeyword:n}=mn(),e=Ni(),i=qt(),r=Wt(),o=Zt(),a={};return Fa=a,a.createMergedNodeMap=(l,u)=>{u=u||{};const f=u.issuer||new r.IdentifierIssuer("_:b"),d={"@default":{}};return a.createNodeMap(l,d,"@default",f),a.mergeNodeMaps(d)},a.createNodeMap=(l,u,f,d,g,_)=>{if(i.isArray(l)){for(const T of l)a.createNodeMap(T,u,f,d,void 0,_);return}if(!i.isObject(l)){_&&_.push(l);return}if(e.isValue(l)){if("@type"in l){let T=l["@type"];T.indexOf("_:")===0&&(l["@type"]=T=d.getId(T))}_&&_.push(l);return}else if(_&&e.isList(l)){const T=[];a.createNodeMap(l["@list"],u,f,d,g,T),_.push({"@list":T});return}if("@type"in l){const T=l["@type"];for(const A of T)A.indexOf("_:")===0&&d.getId(A)}i.isUndefined(g)&&(g=e.isBlankNode(l)?d.getId(l["@id"]):l["@id"]),_&&_.push({"@id":g});const h=u[f],m=h[g]=h[g]||{};m["@id"]=g;const b=Object.keys(l).sort();for(let T of b){if(T==="@id")continue;if(T==="@reverse"){const N={"@id":g},R=l["@reverse"];for(const S in R){const y=R[S];for(const x of y){let P=x["@id"];e.isBlankNode(x)&&(P=d.getId(P)),a.createNodeMap(x,u,f,d,P),r.addValue(h[P],S,N,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(T==="@graph"){g in u||(u[g]={}),a.createNodeMap(l[T],u,g,d);continue}if(T==="@included"){a.createNodeMap(l[T],u,f,d);continue}if(T!=="@type"&&n(T)){if(T==="@index"&&T in m&&(l[T]!==m[T]||l[T]["@id"]!==m[T]["@id"]))throw new o("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:m});m[T]=l[T];continue}const A=l[T];if(T.indexOf("_:")===0&&(T=d.getId(T)),A.length===0){r.addValue(m,T,[],{propertyIsArray:!0});continue}for(let N of A)if(T==="@type"&&(N=N.indexOf("_:")===0?d.getId(N):N),e.isSubject(N)||e.isSubjectReference(N)){if("@id"in N&&!N["@id"])continue;const R=e.isBlankNode(N)?d.getId(N["@id"]):N["@id"];r.addValue(m,T,{"@id":R},{propertyIsArray:!0,allowDuplicate:!1}),a.createNodeMap(N,u,f,d,R)}else if(e.isValue(N))r.addValue(m,T,N,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(N)){const R=[];a.createNodeMap(N["@list"],u,f,d,g,R),N={"@list":R},r.addValue(m,T,N,{propertyIsArray:!0,allowDuplicate:!1})}else a.createNodeMap(N,u,f,d,g),r.addValue(m,T,N,{propertyIsArray:!0,allowDuplicate:!1})}},a.mergeNodeMapGraphs=l=>{const u={};for(const f of Object.keys(l).sort())for(const d of Object.keys(l[f]).sort()){const g=l[f][d];d in u||(u[d]={"@id":d});const _=u[d];for(const h of Object.keys(g).sort())if(n(h)&&h!=="@type")_[h]=r.clone(g[h]);else for(const m of g[h])r.addValue(_,h,r.clone(m),{propertyIsArray:!0,allowDuplicate:!1})}return u},a.mergeNodeMaps=l=>{const u=l["@default"],f=Object.keys(l).sort();for(const d of f){if(d==="@default")continue;const g=l[d];let _=u[d];_?"@graph"in _||(_["@graph"]=[]):u[d]=_={"@id":d,"@graph":[]};const h=_["@graph"];for(const m of Object.keys(g).sort()){const b=g[m];e.isSubjectReference(b)||h.push(b)}}return u},Fa}var ja,Jh;function $_(){if(Jh)return ja;Jh=1;const{isSubjectReference:n}=Ni(),{createMergedNodeMap:e}=Js(),i={};return ja=i,i.flatten=r=>{const o=e(r),a=[],l=Object.keys(o).sort();for(let u=0;u<l.length;++u){const f=o[l[u]];n(f)||a.push(f)}return a},ja}var $a,Qh;function B_(){if(Qh)return $a;Qh=1;const n=Zt(),e=Ni(),i=qt(),{REGEX_BCP47:r,addValue:o}=Wt(),{handleEvent:a}=Wr(),{RDF_LIST:l,RDF_FIRST:u,RDF_REST:f,RDF_NIL:d,RDF_TYPE:g,RDF_JSON_LITERAL:_,XSD_BOOLEAN:h,XSD_DOUBLE:m,XSD_INTEGER:b,XSD_STRING:T}=Jl(),A={};$a=A,A.fromRDF=async(R,S)=>{const{useRdfType:y=!1,useNativeTypes:x=!1,rdfDirection:P=null}=S,B={},O={"@default":B},J={};if(P){if(P==="compound-literal")throw new n("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:P});if(P!=="i18n-datatype")throw new n("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:P})}for(const X of R){const F=X.graph.termType==="DefaultGraph"?"@default":X.graph.value;F in O||(O[F]={}),F!=="@default"&&!(F in B)&&(B[F]={"@id":F});const $=O[F],ue=X.subject.value,D=X.predicate.value,se=X.object;ue in $||($[ue]={"@id":ue});const j=$[ue],ae=se.termType.endsWith("Node");if(ae&&!(se.value in $)&&($[se.value]={"@id":se.value}),D===g&&!y&&ae){o(j,"@type",se.value,{propertyIsArray:!0});continue}const I=N(se,x,P,S);if(o(j,D,I,{propertyIsArray:!0}),ae)if(se.value===d){const Z=$[se.value];"usages"in Z||(Z.usages=[]),Z.usages.push({node:j,property:D,value:I})}else se.value in J?J[se.value]=!1:J[se.value]={node:j,property:D,value:I}}for(const X in O){const F=O[X];if(!(d in F))continue;const $=F[d];if($.usages){for(let ue of $.usages){let D=ue.node,se=ue.property,j=ue.value;const ae=[],I=[];let Z=Object.keys(D).length;for(;se===f&&i.isObject(J[D["@id"]])&&i.isArray(D[u])&&D[u].length===1&&i.isArray(D[f])&&D[f].length===1&&(Z===3||Z===4&&i.isArray(D["@type"])&&D["@type"].length===1&&D["@type"][0]===l)&&(ae.push(D[u][0]),I.push(D["@id"]),ue=J[D["@id"]],D=ue.node,se=ue.property,j=ue.value,Z=Object.keys(D).length,!!e.isBlankNode(D)););delete j["@id"],j["@list"]=ae.reverse();for(const ne of I)delete F[ne]}delete $.usages}}const k=[],q=Object.keys(B).sort();for(const X of q){const F=B[X];if(X in O){const $=F["@graph"]=[],ue=O[X],D=Object.keys(ue).sort();for(const se of D){const j=ue[se];e.isSubjectReference(j)||$.push(j)}}e.isSubjectReference(F)||k.push(F)}return k};function N(R,S,y,x){if(R.termType.endsWith("Node"))return{"@id":R.value};const P={"@value":R.value};if(R.language)R.language.match(r)||x.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:R.language}},options:x}),P["@language"]=R.language;else{let B=R.datatype.value;if(B||(B=T),B===_){B="@json";try{P["@value"]=JSON.parse(P["@value"])}catch(O){throw new n("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:P["@value"],cause:O})}}if(S){if(B===h)P["@value"]==="true"?P["@value"]=!0:P["@value"]==="false"&&(P["@value"]=!1);else if(i.isNumeric(P["@value"]))if(B===b){const O=parseInt(P["@value"],10);O.toFixed(0)===P["@value"]&&(P["@value"]=O)}else B===m&&(P["@value"]=parseFloat(P["@value"]));[h,b,m,T].includes(B)||(P["@type"]=B)}else if(y==="i18n-datatype"&&B.startsWith("https://www.w3.org/ns/i18n#")){const[,O,J]=B.split(/[#_]/);O.length>0&&(P["@language"]=O,O.match(r)||x.eventHandler&&a({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:O}},options:x})),P["@direction"]=J}else B!==T&&(P["@type"]=B)}return P}return $a}var Ba,Kh;function q_(){return Kh||(Kh=1,Ba=function n(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((i,r,o)=>{const a=o===0?"":",",l=r===void 0||typeof r=="symbol"?null:r;return i+a+n(l)},"")+"]":"{"+Object.keys(e).sort().reduce((i,r,o)=>{if(e[r]===void 0||typeof e[r]=="symbol")return i;const a=i.length===0?"":",";return i+a+n(r)+":"+n(e[r])},"")+"}"}),Ba}var qa,Yh;function z_(){if(Yh)return qa;Yh=1;const{createNodeMap:n}=Js(),{isKeyword:e}=mn(),i=Ni(),r=q_(),o=Zt(),a=qt(),l=Wt(),{handleEvent:u}=Wr(),{RDF_FIRST:f,RDF_REST:d,RDF_NIL:g,RDF_TYPE:_,RDF_JSON_LITERAL:h,RDF_LANGSTRING:m,XSD_BOOLEAN:b,XSD_DOUBLE:T,XSD_INTEGER:A,XSD_STRING:N}=Jl(),{isAbsolute:R}=Vi(),S={};qa=S,S.toRDF=(B,O)=>{const J=new l.IdentifierIssuer("_:b"),k={"@default":{}};n(B,k,"@default",J);const q=[],X=Object.keys(k).sort();for(const F of X){let $;if(F==="@default")$={termType:"DefaultGraph",value:""};else if(R(F))F.startsWith("_:")?$={termType:"BlankNode"}:$={termType:"NamedNode"},$.value=F;else{O.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:F}},options:O});continue}y(q,k[F],$,J,O)}return q};function y(B,O,J,k,q){const X=Object.keys(O).sort();for(const F of X){const $=O[F],ue=Object.keys($).sort();for(let D of ue){const se=$[D];if(D==="@type")D=_;else if(e(D))continue;for(const j of se){const ae={termType:F.startsWith("_:")?"BlankNode":"NamedNode",value:F};if(!R(F)){q.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:F}},options:q});continue}const I={termType:D.startsWith("_:")?"BlankNode":"NamedNode",value:D};if(!R(D)){q.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:D}},options:q});continue}if(I.termType==="BlankNode"&&!q.produceGeneralizedRdf){q.eventHandler&&u({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:k.getOldIds().find(ne=>k.getId(ne)===D)}},options:q});continue}const Z=P(j,k,B,J,q.rdfDirection,q);Z&&B.push({subject:ae,predicate:I,object:Z,graph:J})}}}}function x(B,O,J,k,q,X){const F={termType:"NamedNode",value:f},$={termType:"NamedNode",value:d},ue={termType:"NamedNode",value:g},D=B.pop(),se=D?{termType:"BlankNode",value:O.getId()}:ue;let j=se;for(const ae of B){const I=P(ae,O,J,k,q,X),Z={termType:"BlankNode",value:O.getId()};J.push({subject:j,predicate:F,object:I,graph:k}),J.push({subject:j,predicate:$,object:Z,graph:k}),j=Z}if(D){const ae=P(D,O,J,k,q,X);J.push({subject:j,predicate:F,object:ae,graph:k}),J.push({subject:j,predicate:$,object:ue,graph:k})}return se}function P(B,O,J,k,q,X){const F={};if(i.isValue(B)){F.termType="Literal",F.value=void 0,F.datatype={termType:"NamedNode"};let $=B["@value"];const ue=B["@type"]||null;if(ue==="@json")F.value=r($),F.datatype.value=h;else if(a.isBoolean($))F.value=$.toString(),F.datatype.value=ue||b;else if(a.isDouble($)||ue===T)a.isDouble($)||($=parseFloat($)),F.value=$.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),F.datatype.value=ue||T;else if(a.isNumber($))F.value=$.toFixed(0),F.datatype.value=ue||A;else if("@direction"in B&&q==="i18n-datatype"){const D=(B["@language"]||"").toLowerCase(),se=B["@direction"],j=`https://www.w3.org/ns/i18n#${D}_${se}`;F.datatype.value=j,F.value=$}else{if("@direction"in B&&q==="compound-literal")throw new o("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:q});if("@direction"in B&&q)throw new o("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:q});"@language"in B?("@direction"in B&&!q&&X.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:X}),F.value=$,F.datatype.value=ue||m,F.language=B["@language"]):("@direction"in B&&!q&&X.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:F.value}},options:X}),F.value=$,F.datatype.value=ue||N)}}else if(i.isList(B)){const $=x(B["@list"],O,J,k,q,X);F.termType=$.termType,F.value=$.value}else{const $=a.isObject(B)?B["@id"]:B;F.termType=$.startsWith("_:")?"BlankNode":"NamedNode",F.value=$}return F.termType==="NamedNode"&&!R(F.value)?(X.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:F.value}},options:X}),null):F}return qa}var za,ed;function U_(){if(ed)return za;ed=1;const{isKeyword:n}=mn(),e=Ni(),i=qt(),r=Wt(),o=Vi(),a=Zt(),{createNodeMap:l,mergeNodeMapGraphs:u}=Js(),f={};za=f,f.frameMergedOrDefault=(y,x,P)=>{const B={options:P,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},O=new r.IdentifierIssuer("_:b");l(y,B.graphMap,"@default",O),P.merged&&(B.graphMap["@merged"]=u(B.graphMap),B.graph="@merged"),B.subjects=B.graphMap[B.graph];const J=[];f.frame(B,Object.keys(B.subjects).sort(),x,J),P.pruneBlankNodeIdentifiers&&(P.bnodesToClear=Object.keys(B.bnodeMap).filter(k=>B.bnodeMap[k].length===1));// remove @preserve from results
|
|
356
|
+
return P.link={},A(J,P)},f.frame=(y,x,P,B,O=null)=>{h(P),P=P[0];const J=y.options,k={embed:_(P,J,"embed"),explicit:_(P,J,"explicit"),requireAll:_(P,J,"requireAll")};y.link.hasOwnProperty(y.graph)||(y.link[y.graph]={});const q=y.link[y.graph],X=m(y,x,P,k),F=Object.keys(X).sort();for(const $ of F){const ue=X[$];if(O===null?y.uniqueEmbeds={[y.graph]:{}}:y.uniqueEmbeds[y.graph]=y.uniqueEmbeds[y.graph]||{},k.embed==="@link"&&$ in q){N(B,O,q[$]);continue}const D={"@id":$};if($.indexOf("_:")===0&&r.addValue(y.bnodeMap,$,D,{propertyIsArray:!0}),q[$]=D,(k.embed==="@first"||k.embed==="@last")&&y.is11)throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:P});if(!(!y.embedded&&y.uniqueEmbeds[y.graph].hasOwnProperty($))){if(y.embedded&&(k.embed==="@never"||g(ue,y.graph,y.subjectStack))){N(B,O,D);continue}if(y.embedded&&(k.embed=="@first"||k.embed=="@once")&&y.uniqueEmbeds[y.graph].hasOwnProperty($)){N(B,O,D);continue}if(k.embed==="@last"&&$ in y.uniqueEmbeds[y.graph]&&T(y,$),y.uniqueEmbeds[y.graph][$]={parent:B,property:O},y.subjectStack.push({subject:ue,graph:y.graph}),$ in y.graphMap){let se=!1,j=null;"@graph"in P?(j=P["@graph"][0],se=!($==="@merged"||$==="@default"),i.isObject(j)||(j={})):(se=y.graph!=="@merged",j={}),se&&f.frame({...y,graph:$,embedded:!1},Object.keys(y.graphMap[$]).sort(),[j],D,"@graph")}"@included"in P&&f.frame({...y,embedded:!1},x,P["@included"],D,"@included");for(const se of Object.keys(ue).sort()){if(n(se)){if(D[se]=r.clone(ue[se]),se==="@type")for(const j of ue["@type"])j.indexOf("_:")===0&&r.addValue(y.bnodeMap,j,D,{propertyIsArray:!0});continue}if(!(k.explicit&&!(se in P)))for(const j of ue[se]){const ae=se in P?P[se]:d(k);if(e.isList(j)){const I=P[se]&&P[se][0]&&P[se][0]["@list"]?P[se][0]["@list"]:d(k),Z={"@list":[]};N(D,se,Z);const ne=j["@list"];for(const ee of ne)e.isSubjectReference(ee)?f.frame({...y,embedded:!0},[ee["@id"]],I,Z,"@list"):N(Z,"@list",r.clone(ee))}else e.isSubjectReference(j)?f.frame({...y,embedded:!0},[j["@id"]],ae,D,se):S(ae[0],j)&&N(D,se,r.clone(j))}}for(const se of Object.keys(P).sort()){if(se==="@type"){if(!i.isObject(P[se][0])||!("@default"in P[se][0]))continue}else if(n(se))continue;const j=P[se][0]||{};if(!_(j,J,"omitDefault")&&!(se in D)){let I="@null";"@default"in j&&(I=r.clone(j["@default"])),i.isArray(I)||(I=[I]),D[se]=[{"@preserve":I}]}}for(const se of Object.keys(P["@reverse"]||{}).sort()){const j=P["@reverse"][se];for(const ae of Object.keys(y.subjects))r.getValues(y.subjects[ae],se).some(Z=>Z["@id"]===$)&&(D["@reverse"]=D["@reverse"]||{},r.addValue(D["@reverse"],se,[],{propertyIsArray:!0}),f.frame({...y,embedded:!0},[ae],j,D["@reverse"][se],O))}N(B,O,D),y.subjectStack.pop()}}},f.cleanupNull=(y,x)=>{if(i.isArray(y))return y.map(B=>f.cleanupNull(B,x)).filter(B=>B);if(y==="@null")return null;if(i.isObject(y)){if("@id"in y){const P=y["@id"];if(x.link.hasOwnProperty(P)){const B=x.link[P].indexOf(y);if(B!==-1)return x.link[P][B];x.link[P].push(y)}else x.link[P]=[y]}for(const P in y)y[P]=f.cleanupNull(y[P],x)}return y};function d(y){const x={};for(const P in y)y[P]!==void 0&&(x["@"+P]=[y[P]]);return[x]}function g(y,x,P){for(let B=P.length-1;B>=0;--B){const O=P[B];if(O.graph===x&&O.subject["@id"]===y["@id"])return!0}return!1}function _(y,x,P){const B="@"+P;let O=B in y?y[B][0]:x[P];if(P==="embed"){if(O===!0)O="@once";else if(O===!1)O="@never";else if(O!=="@always"&&O!=="@never"&&O!=="@link"&&O!=="@first"&&O!=="@last"&&O!=="@once")throw new a("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:y})}return O}function h(y){if(!i.isArray(y)||y.length!==1||!i.isObject(y[0]))throw new a("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:y});if("@id"in y[0]){for(const x of r.asArray(y[0]["@id"]))if(!(i.isObject(x)||o.isAbsolute(x))||i.isString(x)&&x.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}if("@type"in y[0]){for(const x of r.asArray(y[0]["@type"]))if(!(i.isObject(x)||o.isAbsolute(x)||x==="@json")||i.isString(x)&&x.indexOf("_:")===0)throw new a("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:y})}}function m(y,x,P,B){const O={};for(const J of x){const k=y.graphMap[y.graph][J];b(y,k,P,B)&&(O[J]=k)}return O}function b(y,x,P,B){let O=!0,J=!1;for(const k in P){let q=!1;const X=r.getValues(x,k),F=r.getValues(P,k).length===0;if(k==="@id"){if(i.isEmptyObject(P["@id"][0]||{})?q=!0:P["@id"].length>=0&&(q=P["@id"].includes(X[0])),!B.requireAll)return q}else if(k==="@type"){if(O=!1,F){if(X.length>0)return!1;q=!0}else if(P["@type"].length===1&&i.isEmptyObject(P["@type"][0]))q=X.length>0;else for(const $ of P["@type"])i.isObject($)&&"@default"in $?q=!0:q=q||X.some(ue=>ue===$);if(!B.requireAll)return q}else{if(n(k))continue;{const $=r.getValues(P,k)[0];let ue=!1;if($&&(h([$]),ue="@default"in $),O=!1,X.length===0&&ue)continue;if(X.length>0&&F)return!1;if($===void 0){if(X.length>0)return!1;q=!0}else if(e.isList($)){const D=$["@list"][0];if(e.isList(X[0])){const se=X[0]["@list"];e.isValue(D)?q=se.some(j=>S(D,j)):(e.isSubject(D)||e.isSubjectReference(D))&&(q=se.some(j=>R(y,D,j,B)))}}else e.isValue($)?q=X.some(D=>S($,D)):e.isSubjectReference($)?q=X.some(D=>R(y,$,D,B)):i.isObject($)?q=X.length>0:q=!1}}if(!q&&B.requireAll)return!1;J=J||q}return O||J}function T(y,x){const P=y.uniqueEmbeds[y.graph],B=P[x],O=B.parent,J=B.property,k={"@id":x};if(i.isArray(O)){for(let X=0;X<O.length;++X)if(r.compareValues(O[X],k)){O[X]=k;break}}else{const X=i.isArray(O[J]);r.removeValue(O,J,k,{propertyIsArray:X}),r.addValue(O,J,k,{propertyIsArray:X})}const q=X=>{const F=Object.keys(P);for(const $ of F)$ in P&&i.isObject(P[$].parent)&&P[$].parent["@id"]===X&&(delete P[$],q($))};q(x)}/**
|
|
357
357
|
* Removes the @preserve keywords from expanded result of framing.
|
|
358
358
|
*
|
|
359
359
|
* @param input the framed, framed output.
|
|
360
360
|
* @param options the framing options used.
|
|
361
361
|
*
|
|
362
362
|
* @return the resulting output.
|
|
363
|
-
*/function
|
|
364
|
-
if("@preserve"in h)return h["@preserve"][0];if(e.isValue(h))return h;if(e.isList(h))return h["@list"]=v(h["@list"],g),h;if("@id"in h){const N=h["@id"];if(g.link.hasOwnProperty(N)){const C=g.link[N].indexOf(h);if(C!==-1)return g.link[N][C];g.link[N].push(h)}else g.link[N]=[h]}for(const N in h){if(N==="@id"&&g.bnodesToClear.includes(h[N])){delete h["@id"];continue}h[N]=v(h[N],g)}}return h}function x(h,g,N){t.isObject(h)?n.addValue(h,g,N,{propertyIsArray:!0}):h.push(N)}function S(h,g,N,C){if(!("@id"in N))return!1;const A=h.subjects[N["@id"]];return A&&_(h,A,g,C)}function m(h,g){const N=g["@value"],C=g["@type"],A=g["@language"],B=h["@value"]?t.isArray(h["@value"])?h["@value"]:[h["@value"]]:[],R=h["@type"]?t.isArray(h["@type"])?h["@type"]:[h["@type"]]:[],F=h["@language"]?t.isArray(h["@language"])?h["@language"]:[h["@language"]]:[];return B.length===0&&R.length===0&&F.length===0?!0:!(!(B.includes(N)||t.isEmptyObject(B[0]))||!(!C&&R.length===0||R.includes(C)||C&&t.isEmptyObject(R[0]))||!(!A&&F.length===0||F.includes(A)||A&&t.isEmptyObject(F[0])))}return Ps}var Ms,lu;function Yf(){if(lu)return Ms;lu=1;const r=pt(),{isArray:e,isObject:t,isString:n,isUndefined:i}=dt(),{isList:s,isValue:a,isGraph:o,isSimpleGraph:u,isSubjectReference:l}=Pt(),{expandIri:c,getContextValue:d,isKeyword:b,process:y,processingMode:_}=hr(),{removeBase:E,prependBase:v}=Jt(),{REGEX_KEYWORD:x,addValue:S,asArray:m,compareShortestLeast:h}=ht(),g={};Ms=g,g.compact=async({activeCtx:A,activeProperty:B=null,element:R,options:F={}})=>{if(e(R)){let D=[];for(let L=0;L<R.length;++L){const te=await g.compact({activeCtx:A,activeProperty:B,element:R[L],options:F});te!==null&&D.push(te)}return F.compactArrays&&D.length===1&&(d(A,B,"@container")||[]).length===0&&(D=D[0]),D}const q=d(A,B,"@context");if(i(q)||(A=await y({activeCtx:A,localCtx:q,propagate:!0,overrideProtected:!0,options:F})),t(R)){if(F.link&&"@id"in R&&F.link.hasOwnProperty(R["@id"])){const w=F.link[R["@id"]];for(let H=0;H<w.length;++H)if(w[H].expanded===R)return w[H].compacted}if(a(R)||l(R)){const w=g.compactValue({activeCtx:A,activeProperty:B,value:R,options:F});return F.link&&l(R)&&(F.link.hasOwnProperty(R["@id"])||(F.link[R["@id"]]=[]),F.link[R["@id"]].push({expanded:R,compacted:w})),w}if(s(R)&&(d(A,B,"@container")||[]).includes("@list"))return g.compact({activeCtx:A,activeProperty:B,element:R["@list"],options:F});const D=B==="@reverse",L={},te=A;!a(R)&&!l(R)&&(A=A.revertToPreviousContext());const T=d(te,B,"@context");i(T)||(A=await y({activeCtx:A,localCtx:T,propagate:!0,overrideProtected:!0,options:F})),F.link&&"@id"in R&&(F.link.hasOwnProperty(R["@id"])||(F.link[R["@id"]]=[]),F.link[R["@id"]].push({expanded:R,compacted:L}));let Z=R["@type"]||[];Z.length>1&&(Z=Array.from(Z).sort());const k=A;for(const w of Z){const H=g.compactIri({activeCtx:k,iri:w,relativeTo:{vocab:!0}}),K=d(te,H,"@context");i(K)||(A=await y({activeCtx:A,localCtx:K,options:F,propagate:!1}))}const Y=Object.keys(R).sort();for(const w of Y){const H=R[w];if(w==="@id"){let K=m(H).map(ue=>g.compactIri({activeCtx:A,iri:ue,relativeTo:{vocab:!1},base:F.base}));K.length===1&&(K=K[0]);const Q=g.compactIri({activeCtx:A,iri:"@id",relativeTo:{vocab:!0}});L[Q]=K;continue}if(w==="@type"){let K=m(H).map(z=>g.compactIri({activeCtx:te,iri:z,relativeTo:{vocab:!0}}));K.length===1&&(K=K[0]);const Q=g.compactIri({activeCtx:A,iri:"@type",relativeTo:{vocab:!0}}),G=(d(A,Q,"@container")||[]).includes("@set")&&_(A,1.1)||e(K)&&H.length===0;S(L,Q,K,{propertyIsArray:G});continue}if(w==="@reverse"){const K=await g.compact({activeCtx:A,activeProperty:"@reverse",element:H,options:F});for(const Q in K)if(A.mappings.has(Q)&&A.mappings.get(Q).reverse){const ue=K[Q],G=(d(A,Q,"@container")||[]).includes("@set")||!F.compactArrays;S(L,Q,ue,{propertyIsArray:G}),delete K[Q]}if(Object.keys(K).length>0){const Q=g.compactIri({activeCtx:A,iri:w,relativeTo:{vocab:!0}});S(L,Q,K)}continue}if(w==="@preserve"){const K=await g.compact({activeCtx:A,activeProperty:B,element:H,options:F});e(K)&&K.length===0||S(L,w,K);continue}if(w==="@index"){if((d(A,B,"@container")||[]).includes("@index"))continue;const Q=g.compactIri({activeCtx:A,iri:w,relativeTo:{vocab:!0}});S(L,Q,H);continue}if(w!=="@graph"&&w!=="@list"&&w!=="@included"&&b(w)){const K=g.compactIri({activeCtx:A,iri:w,relativeTo:{vocab:!0}});S(L,K,H);continue}if(!e(H))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(H.length===0){const K=g.compactIri({activeCtx:A,iri:w,value:H,relativeTo:{vocab:!0},reverse:D}),Q=A.mappings.has(K)?A.mappings.get(K)["@nest"]:null;let ue=L;Q&&(C(A,Q,F),t(L[Q])||(L[Q]={}),ue=L[Q]),S(ue,K,H,{propertyIsArray:!0})}for(const K of H){const Q=g.compactIri({activeCtx:A,iri:w,value:K,relativeTo:{vocab:!0},reverse:D}),ue=A.mappings.has(Q)?A.mappings.get(Q)["@nest"]:null;let V=L;ue&&(C(A,ue,F),t(L[ue])||(L[ue]={}),V=L[ue]);const G=d(A,Q,"@container")||[],z=o(K),U=s(K);let ee;U?ee=K["@list"]:z&&(ee=K["@graph"]);let re=await g.compact({activeCtx:A,activeProperty:Q,element:U||z?ee:K,options:F});if(U)if(e(re)||(re=[re]),!G.includes("@list"))re={[g.compactIri({activeCtx:A,iri:"@list",relativeTo:{vocab:!0}})]:re},"@index"in K&&(re[g.compactIri({activeCtx:A,iri:"@index",relativeTo:{vocab:!0}})]=K["@index"]);else{S(V,Q,re,{valueIsArray:!0,allowDuplicate:!0});continue}if(z)if(G.includes("@graph")&&(G.includes("@id")||G.includes("@index")&&u(K))){let fe;V.hasOwnProperty(Q)?fe=V[Q]:V[Q]=fe={};const ge=(G.includes("@id")?K["@id"]:K["@index"])||g.compactIri({activeCtx:A,iri:"@none",relativeTo:{vocab:!0}});S(fe,ge,re,{propertyIsArray:!F.compactArrays||G.includes("@set")})}else G.includes("@graph")&&u(K)?(e(re)&&re.length>1&&(re={"@included":re}),S(V,Q,re,{propertyIsArray:!F.compactArrays||G.includes("@set")})):(e(re)&&re.length===1&&F.compactArrays&&(re=re[0]),re={[g.compactIri({activeCtx:A,iri:"@graph",relativeTo:{vocab:!0}})]:re},"@id"in K&&(re[g.compactIri({activeCtx:A,iri:"@id",relativeTo:{vocab:!0}})]=K["@id"]),"@index"in K&&(re[g.compactIri({activeCtx:A,iri:"@index",relativeTo:{vocab:!0}})]=K["@index"]),S(V,Q,re,{propertyIsArray:!F.compactArrays||G.includes("@set")}));else if(G.includes("@language")||G.includes("@index")||G.includes("@id")||G.includes("@type")){let fe;V.hasOwnProperty(Q)?fe=V[Q]:V[Q]=fe={};let ge;if(G.includes("@language"))a(re)&&(re=re["@value"]),ge=K["@language"];else if(G.includes("@index")){const j=d(A,Q,"@index")||"@index",W=g.compactIri({activeCtx:A,iri:j,relativeTo:{vocab:!0}});if(j==="@index")ge=K["@index"],delete re[W];else{let se;if([ge,...se]=m(re[j]||[]),!n(ge))ge=null;else switch(se.length){case 0:delete re[j];break;case 1:re[j]=se[0];break;default:re[j]=se;break}}}else if(G.includes("@id")){const j=g.compactIri({activeCtx:A,iri:"@id",relativeTo:{vocab:!0}});ge=re[j],delete re[j]}else if(G.includes("@type")){const j=g.compactIri({activeCtx:A,iri:"@type",relativeTo:{vocab:!0}});let W;switch([ge,...W]=m(re[j]||[]),W.length){case 0:delete re[j];break;case 1:re[j]=W[0];break;default:re[j]=W;break}Object.keys(re).length===1&&"@id"in K&&(re=await g.compact({activeCtx:A,activeProperty:Q,element:{"@id":K["@id"]},options:F}))}ge||(ge=g.compactIri({activeCtx:A,iri:"@none",relativeTo:{vocab:!0}})),S(fe,ge,re,{propertyIsArray:G.includes("@set")})}else{const fe=!F.compactArrays||G.includes("@set")||G.includes("@list")||e(re)&&re.length===0||w==="@list"||w==="@graph";S(V,Q,re,{propertyIsArray:fe})}}}return L}return R},g.compactIri=({activeCtx:A,iri:B,value:R=null,relativeTo:F={vocab:!1},reverse:q=!1,base:D=null})=>{if(B===null)return B;A.isPropertyTermScoped&&A.previousContext&&(A=A.previousContext);const L=A.getInverse();if(b(B)&&B in L&&"@none"in L[B]&&"@type"in L[B]["@none"]&&"@none"in L[B]["@none"]["@type"])return L[B]["@none"]["@type"]["@none"];if(F.vocab&&B in L){const Y=A["@language"]||"@none",w=[];t(R)&&"@index"in R&&!("@graph"in R)&&w.push("@index","@index@set"),t(R)&&"@preserve"in R&&(R=R["@preserve"][0]),o(R)?("@index"in R&&w.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R&&w.push("@graph@id","@graph@id@set"),w.push("@graph","@graph@set","@set"),"@index"in R||w.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R||w.push("@graph@id","@graph@id@set")):t(R)&&!a(R)&&w.push("@id","@id@set","@type","@set@type");let H="@language",K="@null";if(q)H="@type",K="@reverse",w.push("@set");else if(s(R)){"@index"in R||w.push("@list");const ue=R["@list"];if(ue.length===0)H="@any",K="@none";else{let V=ue.length===0?Y:null,G=null;for(let z=0;z<ue.length;++z){const U=ue[z];let ee="@none",re="@none";if(a(U))if("@direction"in U){const fe=(U["@language"]||"").toLowerCase(),ge=U["@direction"];ee=`${fe}_${ge}`}else"@language"in U?ee=U["@language"].toLowerCase():"@type"in U?re=U["@type"]:ee="@null";else re="@id";if(V===null?V=ee:ee!==V&&a(U)&&(V="@none"),G===null?G=re:re!==G&&(G="@none"),V==="@none"&&G==="@none")break}V=V||"@none",G=G||"@none",G!=="@none"?(H="@type",K=G):K=V}}else{if(a(R))if("@language"in R&&!("@index"in R)){w.push("@language","@language@set"),K=R["@language"];const ue=R["@direction"];ue&&(K=`${K}_${ue}`)}else"@direction"in R&&!("@index"in R)?K=`_${R["@direction"]}`:"@type"in R&&(H="@type",K=R["@type"]);else H="@type",K="@id";w.push("@set")}w.push("@none"),t(R)&&!("@index"in R)&&w.push("@index","@index@set"),a(R)&&Object.keys(R).length===1&&w.push("@language","@language@set");const Q=N(A,B,R,w,H,K);if(Q!==null)return Q}if(F.vocab&&"@vocab"in A){const Y=A["@vocab"];if(B.indexOf(Y)===0&&B!==Y){const w=B.substr(Y.length);if(!A.mappings.has(w))return w}}let te=null;const T=[];let Z=A.fastCurieMap;const k=B.length-1;for(let Y=0;Y<k&&B[Y]in Z;++Y)Z=Z[B[Y]],""in Z&&T.push(Z[""][0]);for(let Y=T.length-1;Y>=0;--Y){const w=T[Y],H=w.terms;for(const K of H){const Q=K+":"+B.substr(w.iri.length);A.mappings.get(K)._prefix&&(!A.mappings.has(Q)||R===null&&A.mappings.get(Q)["@id"]===B)&&(te===null||h(Q,te)<0)&&(te=Q)}}if(te!==null)return te;for(const[Y,w]of A.mappings)if(w&&w._prefix&&B.startsWith(Y+":"))throw new r(`Absolute IRI "${B}" confused with prefix "${Y}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:A});if(!F.vocab)if("@base"in A)if(A["@base"]){const Y=E(v(D,A["@base"]),B);return x.test(Y)?`./${Y}`:Y}else return B;else return E(D,B);return B},g.compactValue=({activeCtx:A,activeProperty:B,value:R,options:F})=>{if(a(R)){const te=d(A,B,"@type"),T=d(A,B,"@language"),Z=d(A,B,"@direction"),k=d(A,B,"@container")||[],Y="@index"in R&&!k.includes("@index");if(!Y&&te!=="@none"&&(R["@type"]===te||"@language"in R&&R["@language"]===T&&"@direction"in R&&R["@direction"]===Z||"@language"in R&&R["@language"]===T||"@direction"in R&&R["@direction"]===Z))return R["@value"];const w=Object.keys(R).length,H=w===1||w===2&&"@index"in R&&!Y,K="@language"in A,Q=n(R["@value"]),ue=A.mappings.has(B)&&A.mappings.get(B)["@language"]===null;if(H&&te!=="@none"&&(!K||!Q||ue))return R["@value"];const V={};return Y&&(V[g.compactIri({activeCtx:A,iri:"@index",relativeTo:{vocab:!0}})]=R["@index"]),"@type"in R?V[g.compactIri({activeCtx:A,iri:"@type",relativeTo:{vocab:!0}})]=g.compactIri({activeCtx:A,iri:R["@type"],relativeTo:{vocab:!0}}):"@language"in R&&(V[g.compactIri({activeCtx:A,iri:"@language",relativeTo:{vocab:!0}})]=R["@language"]),"@direction"in R&&(V[g.compactIri({activeCtx:A,iri:"@direction",relativeTo:{vocab:!0}})]=R["@direction"]),V[g.compactIri({activeCtx:A,iri:"@value",relativeTo:{vocab:!0}})]=R["@value"],V}const q=c(A,B,{vocab:!0},F),D=d(A,B,"@type"),L=g.compactIri({activeCtx:A,iri:R["@id"],relativeTo:{vocab:D==="@vocab"},base:F.base});return D==="@id"||D==="@vocab"||q==="@graph"?L:{[g.compactIri({activeCtx:A,iri:"@id",relativeTo:{vocab:!0}})]:L}};function N(A,B,R,F,q,D){D===null&&(D="@null");const L=[];if((D==="@id"||D==="@reverse")&&t(R)&&"@id"in R){D==="@reverse"&&L.push("@reverse");const T=g.compactIri({activeCtx:A,iri:R["@id"],relativeTo:{vocab:!0}});A.mappings.has(T)&&A.mappings.get(T)&&A.mappings.get(T)["@id"]===R["@id"]?L.push.apply(L,["@vocab","@id"]):L.push.apply(L,["@id","@vocab"])}else{L.push(D);const T=L.find(Z=>Z.includes("_"));T&&L.push(T.replace(/^[^_]+_/,"_"))}L.push("@none");const te=A.inverse[B];for(const T of F){if(!(T in te))continue;const Z=te[T][q];for(const k of L)if(k in Z)return Z[k]}return null}function C(A,B,R){if(c(A,B,{vocab:!0},R)!=="@nest")throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}return Ms}var Bs,uu;function Zf(){return uu||(uu=1,Bs=r=>{class e{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(e,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(e.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:e}),e.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):r.compact(t,n)},e.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):r.expand(t)},e.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):r.flatten(t)},e}),Bs}/**
|
|
363
|
+
*/function A(y,x){if(i.isArray(y))return y.map(P=>A(P,x));if(i.isObject(y)){// remove @preserve
|
|
364
|
+
if("@preserve"in y)return y["@preserve"][0];if(e.isValue(y))return y;if(e.isList(y))return y["@list"]=A(y["@list"],x),y;if("@id"in y){const P=y["@id"];if(x.link.hasOwnProperty(P)){const B=x.link[P].indexOf(y);if(B!==-1)return x.link[P][B];x.link[P].push(y)}else x.link[P]=[y]}for(const P in y){if(P==="@id"&&x.bnodesToClear.includes(y[P])){delete y["@id"];continue}y[P]=A(y[P],x)}}return y}function N(y,x,P){i.isObject(y)?r.addValue(y,x,P,{propertyIsArray:!0}):y.push(P)}function R(y,x,P,B){if(!("@id"in P))return!1;const O=y.subjects[P["@id"]];return O&&b(y,O,x,B)}function S(y,x){const P=x["@value"],B=x["@type"],O=x["@language"],J=y["@value"]?i.isArray(y["@value"])?y["@value"]:[y["@value"]]:[],k=y["@type"]?i.isArray(y["@type"])?y["@type"]:[y["@type"]]:[],q=y["@language"]?i.isArray(y["@language"])?y["@language"]:[y["@language"]]:[];return J.length===0&&k.length===0&&q.length===0?!0:!(!(J.includes(P)||i.isEmptyObject(J[0]))||!(!B&&k.length===0||k.includes(B)||B&&i.isEmptyObject(k[0]))||!(!O&&q.length===0||q.includes(O)||O&&i.isEmptyObject(q[0])))}return za}var Ua,td;function H_(){if(td)return Ua;td=1;const n=Zt(),{isArray:e,isObject:i,isString:r,isUndefined:o}=qt(),{isList:a,isValue:l,isGraph:u,isSimpleGraph:f,isSubjectReference:d}=Ni(),{expandIri:g,getContextValue:_,isKeyword:h,process:m,processingMode:b}=mn(),{removeBase:T,prependBase:A}=Vi(),{REGEX_KEYWORD:N,addValue:R,asArray:S,compareShortestLeast:y}=Wt(),x={};Ua=x,x.compact=async({activeCtx:O,activeProperty:J=null,element:k,options:q={}})=>{if(e(k)){let F=[];for(let $=0;$<k.length;++$){const ue=await x.compact({activeCtx:O,activeProperty:J,element:k[$],options:q});ue!==null&&F.push(ue)}return q.compactArrays&&F.length===1&&(_(O,J,"@container")||[]).length===0&&(F=F[0]),F}const X=_(O,J,"@context");if(o(X)||(O=await m({activeCtx:O,localCtx:X,propagate:!0,overrideProtected:!0,options:q})),i(k)){if(q.link&&"@id"in k&&q.link.hasOwnProperty(k["@id"])){const I=q.link[k["@id"]];for(let Z=0;Z<I.length;++Z)if(I[Z].expanded===k)return I[Z].compacted}if(l(k)||d(k)){const I=x.compactValue({activeCtx:O,activeProperty:J,value:k,options:q});return q.link&&d(k)&&(q.link.hasOwnProperty(k["@id"])||(q.link[k["@id"]]=[]),q.link[k["@id"]].push({expanded:k,compacted:I})),I}if(a(k)&&(_(O,J,"@container")||[]).includes("@list"))return x.compact({activeCtx:O,activeProperty:J,element:k["@list"],options:q});const F=J==="@reverse",$={},ue=O;!l(k)&&!d(k)&&(O=O.revertToPreviousContext());const D=_(ue,J,"@context");o(D)||(O=await m({activeCtx:O,localCtx:D,propagate:!0,overrideProtected:!0,options:q})),q.link&&"@id"in k&&(q.link.hasOwnProperty(k["@id"])||(q.link[k["@id"]]=[]),q.link[k["@id"]].push({expanded:k,compacted:$}));let se=k["@type"]||[];se.length>1&&(se=Array.from(se).sort());const j=O;for(const I of se){const Z=x.compactIri({activeCtx:j,iri:I,relativeTo:{vocab:!0}}),ne=_(ue,Z,"@context");o(ne)||(O=await m({activeCtx:O,localCtx:ne,options:q,propagate:!1}))}const ae=Object.keys(k).sort();for(const I of ae){const Z=k[I];if(I==="@id"){let ne=S(Z).map(_e=>x.compactIri({activeCtx:O,iri:_e,relativeTo:{vocab:!1},base:q.base}));ne.length===1&&(ne=ne[0]);const ee=x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}});$[ee]=ne;continue}if(I==="@type"){let ne=S(Z).map(Y=>x.compactIri({activeCtx:ue,iri:Y,relativeTo:{vocab:!0}}));ne.length===1&&(ne=ne[0]);const ee=x.compactIri({activeCtx:O,iri:"@type",relativeTo:{vocab:!0}}),W=(_(O,ee,"@container")||[]).includes("@set")&&b(O,1.1)||e(ne)&&Z.length===0;R($,ee,ne,{propertyIsArray:W});continue}if(I==="@reverse"){const ne=await x.compact({activeCtx:O,activeProperty:"@reverse",element:Z,options:q});for(const ee in ne)if(O.mappings.has(ee)&&O.mappings.get(ee).reverse){const _e=ne[ee],W=(_(O,ee,"@container")||[]).includes("@set")||!q.compactArrays;R($,ee,_e,{propertyIsArray:W}),delete ne[ee]}if(Object.keys(ne).length>0){const ee=x.compactIri({activeCtx:O,iri:I,relativeTo:{vocab:!0}});R($,ee,ne)}continue}if(I==="@preserve"){const ne=await x.compact({activeCtx:O,activeProperty:J,element:Z,options:q});e(ne)&&ne.length===0||R($,I,ne);continue}if(I==="@index"){if((_(O,J,"@container")||[]).includes("@index"))continue;const ee=x.compactIri({activeCtx:O,iri:I,relativeTo:{vocab:!0}});R($,ee,Z);continue}if(I!=="@graph"&&I!=="@list"&&I!=="@included"&&h(I)){const ne=x.compactIri({activeCtx:O,iri:I,relativeTo:{vocab:!0}});R($,ne,Z);continue}if(!e(Z))throw new n("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(Z.length===0){const ne=x.compactIri({activeCtx:O,iri:I,value:Z,relativeTo:{vocab:!0},reverse:F}),ee=O.mappings.has(ne)?O.mappings.get(ne)["@nest"]:null;let _e=$;ee&&(B(O,ee,q),i($[ee])||($[ee]={}),_e=$[ee]),R(_e,ne,Z,{propertyIsArray:!0})}for(const ne of Z){const ee=x.compactIri({activeCtx:O,iri:I,value:ne,relativeTo:{vocab:!0},reverse:F}),_e=O.mappings.has(ee)?O.mappings.get(ee)["@nest"]:null;let G=$;_e&&(B(O,_e,q),i($[_e])||($[_e]={}),G=$[_e]);const W=_(O,ee,"@container")||[],Y=u(ne),K=a(ne);let oe;K?oe=ne["@list"]:Y&&(oe=ne["@graph"]);let ce=await x.compact({activeCtx:O,activeProperty:ee,element:K||Y?oe:ne,options:q});if(K)if(e(ce)||(ce=[ce]),!W.includes("@list"))ce={[x.compactIri({activeCtx:O,iri:"@list",relativeTo:{vocab:!0}})]:ce},"@index"in ne&&(ce[x.compactIri({activeCtx:O,iri:"@index",relativeTo:{vocab:!0}})]=ne["@index"]);else{R(G,ee,ce,{valueIsArray:!0,allowDuplicate:!0});continue}if(Y)if(W.includes("@graph")&&(W.includes("@id")||W.includes("@index")&&f(ne))){let Ee;G.hasOwnProperty(ee)?Ee=G[ee]:G[ee]=Ee={};const Te=(W.includes("@id")?ne["@id"]:ne["@index"])||x.compactIri({activeCtx:O,iri:"@none",relativeTo:{vocab:!0}});R(Ee,Te,ce,{propertyIsArray:!q.compactArrays||W.includes("@set")})}else W.includes("@graph")&&f(ne)?(e(ce)&&ce.length>1&&(ce={"@included":ce}),R(G,ee,ce,{propertyIsArray:!q.compactArrays||W.includes("@set")})):(e(ce)&&ce.length===1&&q.compactArrays&&(ce=ce[0]),ce={[x.compactIri({activeCtx:O,iri:"@graph",relativeTo:{vocab:!0}})]:ce},"@id"in ne&&(ce[x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}})]=ne["@id"]),"@index"in ne&&(ce[x.compactIri({activeCtx:O,iri:"@index",relativeTo:{vocab:!0}})]=ne["@index"]),R(G,ee,ce,{propertyIsArray:!q.compactArrays||W.includes("@set")}));else if(W.includes("@language")||W.includes("@index")||W.includes("@id")||W.includes("@type")){let Ee;G.hasOwnProperty(ee)?Ee=G[ee]:G[ee]=Ee={};let Te;if(W.includes("@language"))l(ce)&&(ce=ce["@value"]),Te=ne["@language"];else if(W.includes("@index")){const z=_(O,ee,"@index")||"@index",te=x.compactIri({activeCtx:O,iri:z,relativeTo:{vocab:!0}});if(z==="@index")Te=ne["@index"],delete ce[te];else{let fe;if([Te,...fe]=S(ce[z]||[]),!r(Te))Te=null;else switch(fe.length){case 0:delete ce[z];break;case 1:ce[z]=fe[0];break;default:ce[z]=fe;break}}}else if(W.includes("@id")){const z=x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}});Te=ce[z],delete ce[z]}else if(W.includes("@type")){const z=x.compactIri({activeCtx:O,iri:"@type",relativeTo:{vocab:!0}});let te;switch([Te,...te]=S(ce[z]||[]),te.length){case 0:delete ce[z];break;case 1:ce[z]=te[0];break;default:ce[z]=te;break}Object.keys(ce).length===1&&"@id"in ne&&(ce=await x.compact({activeCtx:O,activeProperty:ee,element:{"@id":ne["@id"]},options:q}))}Te||(Te=x.compactIri({activeCtx:O,iri:"@none",relativeTo:{vocab:!0}})),R(Ee,Te,ce,{propertyIsArray:W.includes("@set")})}else{const Ee=!q.compactArrays||W.includes("@set")||W.includes("@list")||e(ce)&&ce.length===0||I==="@list"||I==="@graph";R(G,ee,ce,{propertyIsArray:Ee})}}}return $}return k},x.compactIri=({activeCtx:O,iri:J,value:k=null,relativeTo:q={vocab:!1},reverse:X=!1,base:F=null})=>{if(J===null)return J;O.isPropertyTermScoped&&O.previousContext&&(O=O.previousContext);const $=O.getInverse();if(h(J)&&J in $&&"@none"in $[J]&&"@type"in $[J]["@none"]&&"@none"in $[J]["@none"]["@type"])return $[J]["@none"]["@type"]["@none"];if(q.vocab&&J in $){const ae=O["@language"]||"@none",I=[];i(k)&&"@index"in k&&!("@graph"in k)&&I.push("@index","@index@set"),i(k)&&"@preserve"in k&&(k=k["@preserve"][0]),u(k)?("@index"in k&&I.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in k&&I.push("@graph@id","@graph@id@set"),I.push("@graph","@graph@set","@set"),"@index"in k||I.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in k||I.push("@graph@id","@graph@id@set")):i(k)&&!l(k)&&I.push("@id","@id@set","@type","@set@type");let Z="@language",ne="@null";if(X)Z="@type",ne="@reverse",I.push("@set");else if(a(k)){"@index"in k||I.push("@list");const _e=k["@list"];if(_e.length===0)Z="@any",ne="@none";else{let G=_e.length===0?ae:null,W=null;for(let Y=0;Y<_e.length;++Y){const K=_e[Y];let oe="@none",ce="@none";if(l(K))if("@direction"in K){const Ee=(K["@language"]||"").toLowerCase(),Te=K["@direction"];oe=`${Ee}_${Te}`}else"@language"in K?oe=K["@language"].toLowerCase():"@type"in K?ce=K["@type"]:oe="@null";else ce="@id";if(G===null?G=oe:oe!==G&&l(K)&&(G="@none"),W===null?W=ce:ce!==W&&(W="@none"),G==="@none"&&W==="@none")break}G=G||"@none",W=W||"@none",W!=="@none"?(Z="@type",ne=W):ne=G}}else{if(l(k))if("@language"in k&&!("@index"in k)){I.push("@language","@language@set"),ne=k["@language"];const _e=k["@direction"];_e&&(ne=`${ne}_${_e}`)}else"@direction"in k&&!("@index"in k)?ne=`_${k["@direction"]}`:"@type"in k&&(Z="@type",ne=k["@type"]);else Z="@type",ne="@id";I.push("@set")}I.push("@none"),i(k)&&!("@index"in k)&&I.push("@index","@index@set"),l(k)&&Object.keys(k).length===1&&I.push("@language","@language@set");const ee=P(O,J,k,I,Z,ne);if(ee!==null)return ee}if(q.vocab&&"@vocab"in O){const ae=O["@vocab"];if(J.indexOf(ae)===0&&J!==ae){const I=J.substr(ae.length);if(!O.mappings.has(I))return I}}let ue=null;const D=[];let se=O.fastCurieMap;const j=J.length-1;for(let ae=0;ae<j&&J[ae]in se;++ae)se=se[J[ae]],""in se&&D.push(se[""][0]);for(let ae=D.length-1;ae>=0;--ae){const I=D[ae],Z=I.terms;for(const ne of Z){const ee=ne+":"+J.substr(I.iri.length);O.mappings.get(ne)._prefix&&(!O.mappings.has(ee)||k===null&&O.mappings.get(ee)["@id"]===J)&&(ue===null||y(ee,ue)<0)&&(ue=ee)}}if(ue!==null)return ue;for(const[ae,I]of O.mappings)if(I&&I._prefix&&J.startsWith(ae+":"))throw new n(`Absolute IRI "${J}" confused with prefix "${ae}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:O});if(!q.vocab)if("@base"in O)if(O["@base"]){const ae=T(A(F,O["@base"]),J);return N.test(ae)?`./${ae}`:ae}else return J;else return T(F,J);return J},x.compactValue=({activeCtx:O,activeProperty:J,value:k,options:q})=>{if(l(k)){const ue=_(O,J,"@type"),D=_(O,J,"@language"),se=_(O,J,"@direction"),j=_(O,J,"@container")||[],ae="@index"in k&&!j.includes("@index");if(!ae&&ue!=="@none"&&(k["@type"]===ue||"@language"in k&&k["@language"]===D&&"@direction"in k&&k["@direction"]===se||"@language"in k&&k["@language"]===D||"@direction"in k&&k["@direction"]===se))return k["@value"];const I=Object.keys(k).length,Z=I===1||I===2&&"@index"in k&&!ae,ne="@language"in O,ee=r(k["@value"]),_e=O.mappings.has(J)&&O.mappings.get(J)["@language"]===null;if(Z&&ue!=="@none"&&(!ne||!ee||_e))return k["@value"];const G={};return ae&&(G[x.compactIri({activeCtx:O,iri:"@index",relativeTo:{vocab:!0}})]=k["@index"]),"@type"in k?G[x.compactIri({activeCtx:O,iri:"@type",relativeTo:{vocab:!0}})]=x.compactIri({activeCtx:O,iri:k["@type"],relativeTo:{vocab:!0}}):"@language"in k&&(G[x.compactIri({activeCtx:O,iri:"@language",relativeTo:{vocab:!0}})]=k["@language"]),"@direction"in k&&(G[x.compactIri({activeCtx:O,iri:"@direction",relativeTo:{vocab:!0}})]=k["@direction"]),G[x.compactIri({activeCtx:O,iri:"@value",relativeTo:{vocab:!0}})]=k["@value"],G}const X=g(O,J,{vocab:!0},q),F=_(O,J,"@type"),$=x.compactIri({activeCtx:O,iri:k["@id"],relativeTo:{vocab:F==="@vocab"},base:q.base});return F==="@id"||F==="@vocab"||X==="@graph"?$:{[x.compactIri({activeCtx:O,iri:"@id",relativeTo:{vocab:!0}})]:$}};function P(O,J,k,q,X,F){F===null&&(F="@null");const $=[];if((F==="@id"||F==="@reverse")&&i(k)&&"@id"in k){F==="@reverse"&&$.push("@reverse");const D=x.compactIri({activeCtx:O,iri:k["@id"],relativeTo:{vocab:!0}});O.mappings.has(D)&&O.mappings.get(D)&&O.mappings.get(D)["@id"]===k["@id"]?$.push.apply($,["@vocab","@id"]):$.push.apply($,["@id","@vocab"])}else{$.push(F);const D=$.find(se=>se.includes("_"));D&&$.push(D.replace(/^[^_]+_/,"_"))}$.push("@none");const ue=O.inverse[J];for(const D of q){if(!(D in ue))continue;const se=ue[D][X];for(const j of $)if(j in se)return se[j]}return null}function B(O,J,k){if(g(O,J,{vocab:!0},k)!=="@nest")throw new n("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}return Ua}var Ha,id;function V_(){return id||(id=1,Ha=n=>{class e{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(e,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(e.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:e}),e.compact=function(i,r){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):n.compact(i,r)},e.expand=function(i){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):n.expand(i)},e.flatten=function(i){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):n.flatten(i)},e}),Ha}/**
|
|
365
365
|
* A JavaScript implementation of the JSON-LD API.
|
|
366
366
|
*
|
|
367
367
|
* @author Dave Longley
|
|
@@ -395,18 +395,21 @@ if("@preserve"in h)return h["@preserve"][0];if(e.isValue(h))return h;if(e.isList
|
|
|
395
395
|
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
396
396
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
397
397
|
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
398
|
-
*/var qs,cu;function ep(){if(cu)return qs;cu=1;const r=Va(),e=Bf(),t=ht(),n=Vf(),i=t.IdentifierIssuer,s=pt(),a=Qc(),o=Gf(),{expand:u}=Wf(),{flatten:l}=zf(),{fromRDF:c}=Qf(),{toRDF:d}=Jf(),{frameMergedOrDefault:b,cleanupNull:y}=Kf(),{isArray:_,isObject:E,isString:v}=dt(),{isSubjectReference:x}=Pt(),{expandIri:S,getInitialContext:m,process:h,processingMode:g}=hr(),{compact:N,compactIri:C}=Yf(),{createNodeMap:A,createMergedNodeMap:B,mergeNodeMaps:R}=_i(),{logEventHandler:F,logWarningEventHandler:q,safeEventHandler:D,setDefaultEventHandler:L,setupEventHandler:te,strictEventHandler:T,unhandledEventHandler:Z}=Dn(),k=function(w){const H={},Q=new a({max:100});w.compact=async function(V,G,z){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(G===null)throw new s("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(V===null)return null;z=ue(z,{base:v(V)?V:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new i("_:b"),contextResolver:new n({sharedCache:Q})}),z.link&&(z.skipExpansion=!0),z.compactToRelative||delete z.base;let U;z.skipExpansion?U=V:U=await w.expand(V,z);const ee=await w.processContext(m(z),G,z);let re=await N({activeCtx:ee,element:U,options:z});z.compactArrays&&!z.graph&&_(re)?re.length===1?re=re[0]:re.length===0&&(re={}):z.graph&&E(re)&&(re=[re]),E(G)&&"@context"in G&&(G=G["@context"]),G=t.clone(G),_(G)||(G=[G]);const fe=G;G=[];for(let j=0;j<fe.length;++j)(!E(fe[j])||Object.keys(fe[j]).length>0)&&G.push(fe[j]);const ge=G.length>0;if(G.length===1&&(G=G[0]),_(re)){const j=C({activeCtx:ee,iri:"@graph",relativeTo:{vocab:!0}}),W=re;re={},ge&&(re["@context"]=G),re[j]=W}else if(E(re)&&ge){const j=re;re={"@context":G};for(const W in j)re[W]=j[W]}return re},w.expand=async function(V,G){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");G=ue(G,{keepFreeFloatingNodes:!1,contextResolver:new n({sharedCache:Q})});const z={},U=[];if("expandContext"in G){const ge=t.clone(G.expandContext);E(ge)&&"@context"in ge?z.expandContext=ge:z.expandContext={"@context":ge},U.push(z.expandContext)}let ee;if(!v(V))z.input=t.clone(V);else{const ge=await w.get(V,G);ee=ge.documentUrl,z.input=ge.document,ge.contextUrl&&(z.remoteContext={"@context":ge.contextUrl},U.push(z.remoteContext))}"base"in G||(G.base=ee||"");let re=m(G);for(const ge of U)re=await h({activeCtx:re,localCtx:ge,options:G});let fe=await u({activeCtx:re,element:z.input,options:G});return E(fe)&&"@graph"in fe&&Object.keys(fe).length===1?fe=fe["@graph"]:fe===null&&(fe=[]),_(fe)||(fe=[fe]),fe},w.flatten=async function(V,G,z){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof G=="function"?G=null:G=G||null,z=ue(z,{base:v(V)?V:"",contextResolver:new n({sharedCache:Q})});const U=await w.expand(V,z),ee=l(U);return G===null?ee:(z.graph=!0,z.skipExpansion=!0,await w.compact(ee,G,z))},w.frame=async function(V,G,z){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(z=ue(z,{base:v(V)?V:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new n({sharedCache:Q})}),v(G)){const he=await w.get(G,z);if(G=he.document,he.contextUrl){let pe=G["@context"];pe?_(pe)?pe.push(he.contextUrl):pe=[pe,he.contextUrl]:pe=he.contextUrl,G["@context"]=pe}}const U=G?G["@context"]||{}:{},ee=await w.processContext(m(z),U,z);z.hasOwnProperty("omitGraph")||(z.omitGraph=g(ee,1.1)),z.hasOwnProperty("pruneBlankNodeIdentifiers")||(z.pruneBlankNodeIdentifiers=g(ee,1.1));const re=await w.expand(V,z),fe={...z};fe.isFrame=!0,fe.keepFreeFloatingNodes=!0;const ge=await w.expand(G,fe),j=Object.keys(G).map(he=>S(ee,he,{vocab:!0}));fe.merged=!j.includes("@graph"),fe.is11=g(ee,1.1);const W=b(re,ge,fe);fe.graph=!z.omitGraph,fe.skipExpansion=!0,fe.link={},fe.framing=!0;let se=await w.compact(W,U,fe);return fe.link={},se=y(se,fe),se},w.link=async function(V,G,z){const U={};return G&&(U["@context"]=G),U["@embed"]="@link",w.frame(V,U,z)},w.normalize=w.canonize=async function(V,G){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if(G=ue(G,{base:v(V)?V:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new n({sharedCache:Q})}),"inputFormat"in G){if(G.inputFormat!=="application/n-quads"&&G.inputFormat!=="application/nquads")throw new s("Unknown canonicalization input format.","jsonld.CanonizeError");const ee=o.parse(V);return r.canonize(ee,G)}const z={...G};delete z.format,z.produceGeneralizedRdf=!1;const U=await w.toRDF(V,z);return r.canonize(U,G)},w.fromRDF=async function(V,G){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");G=ue(G,{format:v(V)?"application/n-quads":void 0});const{format:z}=G;let{rdfParser:U}=G;if(z){if(U=U||H[z],!U)throw new s("Unknown input format.","jsonld.UnknownFormat",{format:z})}else U=()=>V;const ee=await U(V);return c(ee,G)},w.toRDF=async function(V,G){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");G=ue(G,{base:v(V)?V:"",skipExpansion:!1,contextResolver:new n({sharedCache:Q})});let z;G.skipExpansion?z=V:z=await w.expand(V,G);const U=d(z,G);if(G.format){if(G.format==="application/n-quads"||G.format==="application/nquads")return o.serialize(U);throw new s("Unknown output format.","jsonld.UnknownFormat",{format:G.format})}return U},w.createNodeMap=async function(V,G){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");G=ue(G,{base:v(V)?V:"",contextResolver:new n({sharedCache:Q})});const z=await w.expand(V,G);return B(z,G)},w.merge=async function(V,G,z){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!_(V))throw new TypeError('Could not merge, "docs" must be an array.');typeof G=="function"?G=null:G=G||null,z=ue(z,{contextResolver:new n({sharedCache:Q})});const U=await Promise.all(V.map(he=>{const pe={...z};return w.expand(he,pe)}));let ee=!0;"mergeNodes"in z&&(ee=z.mergeNodes);const re=z.issuer||new i("_:b"),fe={"@default":{}};for(let he=0;he<U.length;++he){const pe=t.relabelBlankNodes(U[he],{issuer:new i("_:b"+he+"-")}),me=ee||he===0?fe:{"@default":{}};if(A(pe,me,"@default",re),me!==fe)for(const J in me){const ce=me[J];if(!(J in fe)){fe[J]=ce;continue}const ye=fe[J];for(const le in ce)le in ye||(ye[le]=ce[le])}}const ge=R(fe),j=[],W=Object.keys(ge).sort();for(let he=0;he<W.length;++he){const pe=ge[W[he]];x(pe)||j.push(pe)}return G===null?j:(z.graph=!0,z.skipExpansion=!0,await w.compact(j,G,z))},Object.defineProperty(w,"documentLoader",{get:()=>w._documentLoader,set:V=>w._documentLoader=V}),w.documentLoader=async V=>{throw new s("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:V})},w.get=async function(V,G){let z;typeof G.documentLoader=="function"?z=G.documentLoader:z=w.documentLoader;const U=await z(V);try{if(!U.document)throw new s("No remote document found at the given URL.","jsonld.NullRemoteDocument");v(U.document)&&(U.document=JSON.parse(U.document))}catch(ee){throw new s("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:ee,remoteDoc:U})}return U},w.processContext=async function(V,G,z){return z=ue(z,{base:"",contextResolver:new n({sharedCache:Q})}),G===null?m(z):(G=t.clone(G),E(G)&&"@context"in G||(G={"@context":G}),h({activeCtx:V,localCtx:G,options:z}))},w.getContextValue=hr().getContextValue,w.documentLoaders={},w.useDocumentLoader=function(V){if(!(V in w.documentLoaders))throw new s('Unknown document loader type: "'+V+'"',"jsonld.UnknownDocumentLoader",{type:V});w.documentLoader=w.documentLoaders[V].apply(w,Array.prototype.slice.call(arguments,1))},w.registerRDFParser=function(V,G){H[V]=G},w.unregisterRDFParser=function(V){delete H[V]},w.registerRDFParser("application/n-quads",o.parse),w.registerRDFParser("application/nquads",o.parse),w.url=Jt(),w.logEventHandler=F,w.logWarningEventHandler=q,w.safeEventHandler=D,w.setDefaultEventHandler=L,w.strictEventHandler=T,w.unhandledEventHandler=Z,w.util=t,Object.assign(w,t),w.promises=w,w.RequestQueue=zc(),w.JsonLdProcessor=Zf()(w),e.setupGlobals(w),e.setupDocumentLoaders(w);function ue(V,{documentLoader:G=w.documentLoader,...z}){if(V&&"compactionMap"in V)throw new s('"compactionMap" not supported.',"jsonld.OptionsError");if(V&&"expansionMap"in V)throw new s('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:G},z,V,{eventHandler:te({options:V})})}return w},Y=function(){return k(function(){return Y()})};return k(Y),qs=Y,qs}var tp=ep();const Us={},Hs={};class rp{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}async loadGraphs(){this.loadedExternalUrls=[],this.loadedClasses=[],this.config.prefixes={};const e=[],t=new et;if(e.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",t,yn)),e.push(this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",t,Lt)),await Promise.all(e),t.countQuads(null,null,null,yn)===0&&this.config.attributes.valuesSubject){const n=[...t.getObjects(this.config.attributes.valuesSubject,ca,Lt)],i=[];for(const s of n){const a=this.toURL(s.value);a&&this.loadedExternalUrls.indexOf(a)<0&&(this.loadedExternalUrls.push(a),i.push(this.importRDF(this.fetchRDF(a),t,yn)))}try{await Promise.allSettled(i)}catch(s){console.warn(s)}}this.config.store=t}async importRDF(e,t,n){const i=async s=>{const a=[];await new Promise((o,u)=>{const l=du(s)==="xml"?new Lf.RdfXmlParser:new jd;l.on("data",c=>{if(t.add(new ui(c.subject,c.predicate,c.object,n)),this.config.attributes.ignoreOwlImports===null&&Ta.equals(c.predicate)){const d=this.toURL(c.object.value);d&&this.loadedExternalUrls.indexOf(d)<0&&(this.loadedExternalUrls.push(d),a.push(this.importRDF(this.fetchRDF(d),t,Ne.namedNode(d))))}if(this.config.classInstanceProvider&&(Aa.equals(c.predicate)||Rr.equals(c.predicate))){const d=c.object.value;if(this.loadedClasses.indexOf(d)<0){let b;d in Hs?b=Hs[d]:(b=this.config.classInstanceProvider(d),Hs[d]=b),this.loadedClasses.push(d),a.push(this.importRDF(b,t,n))}}}).on("error",c=>{console.warn("failed parsing graph",n,c.message),u(c)}).on("prefix",(c,d)=>{c&&(this.config.prefixes[c]=d)}).on("end",()=>{o(null)}),l.write(s),l.end()});try{await Promise.allSettled(a)}catch(o){console.warn(o)}};if(e instanceof Promise&&(e=await e),e){if(du(e)==="json")try{e=await tp.toRDF(JSON.parse(e),{format:"application/n-quads"})}catch(s){console.error(s)}await i(e)}}toURL(e){if(ha(e))return e;if(this.config.prefixes){const t=e.split(":");if(t.length===2){const n=this.config.prefixes[t[0]];if(n&&(e=e.replace(`${t[0]}:`,n),ha(e)))return e}}return null}async fetchRDF(e){if(e in Us)return Us[e];let t=e;this.config.attributes.proxy&&(t=this.config.attributes.proxy+encodeURIComponent(e));const n=fetch(t,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(i=>i.text());return Us[e]=n,n}}function du(r){return/^\s*\{/.test(r)?"json":/^\s*<\?xml/.test(r)?"xml":"ttl"}class Vs{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.proxy=null,this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class hu{constructor(e,t){this.attributes=new Vs,this.loader=new rp(this),this.prefixes={},this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new et,this.theme=e,this.form=t,this.languages=[...new Set(navigator.languages.flatMap(n=>n.length>2?[n.toLocaleLowerCase(),n.substring(0,2)]:n)),""]}updateAttributes(e){const t=new Vs;if(Object.keys(t).forEach(n=>{const i=e.dataset[n];i!==void 0&&(t[n]=i)}),this.editMode=t.view===null,this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const n=this.languages.indexOf(t.language);n>-1&&this.languages.splice(n,1),this.languages.unshift(t.language)}t.valuesGraph&&(this.valuesGraphId=Ne.namedNode(t.valuesGraph))}static dataAttributes(){const e=new Vs;return Object.keys(e).map(t=>(t=t.replace(/[A-Z]/g,n=>"-"+n.toLowerCase()),"data-"+t))}get store(){return this._store}set store(e){this._store=e,this.lists=Wd(e,{ignoreErrors:!0}),this.groups=[],e.forSubjects(t=>{this.groups.push(t.id)},tt,`${xe}PropertyGroup`,null)}}function np(r){return"_:"+r.value}function ip(r,e){return[...r].map(t=>e(t)).join(`
|
|
398
|
+
*/var Va,nd;function W_(){if(nd)return Va;nd=1;const n=Xl(),e=C_(),i=Wt(),r=O_(),o=i.IdentifierIssuer,a=Zt(),l=Vf(),u=F_(),{expand:f}=j_(),{flatten:d}=$_(),{fromRDF:g}=B_(),{toRDF:_}=z_(),{frameMergedOrDefault:h,cleanupNull:m}=U_(),{isArray:b,isObject:T,isString:A}=qt(),{isSubjectReference:N}=Ni(),{expandIri:R,getInitialContext:S,process:y,processingMode:x}=mn(),{compact:P,compactIri:B}=H_(),{createNodeMap:O,createMergedNodeMap:J,mergeNodeMaps:k}=Js(),{logEventHandler:q,logWarningEventHandler:X,safeEventHandler:F,setDefaultEventHandler:$,setupEventHandler:ue,strictEventHandler:D,unhandledEventHandler:se}=Wr(),j=function(I){const Z={},ee=new l({max:100});I.compact=async function(G,W,Y){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(W===null)throw new a("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(G===null)return null;Y=_e(Y,{base:A(G)?G:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new o("_:b"),contextResolver:new r({sharedCache:ee})}),Y.link&&(Y.skipExpansion=!0),Y.compactToRelative||delete Y.base;let K;Y.skipExpansion?K=G:K=await I.expand(G,Y);const oe=await I.processContext(S(Y),W,Y);let ce=await P({activeCtx:oe,element:K,options:Y});Y.compactArrays&&!Y.graph&&b(ce)?ce.length===1?ce=ce[0]:ce.length===0&&(ce={}):Y.graph&&T(ce)&&(ce=[ce]),T(W)&&"@context"in W&&(W=W["@context"]),W=i.clone(W),b(W)||(W=[W]);const Ee=W;W=[];for(let z=0;z<Ee.length;++z)(!T(Ee[z])||Object.keys(Ee[z]).length>0)&&W.push(Ee[z]);const Te=W.length>0;if(W.length===1&&(W=W[0]),b(ce)){const z=B({activeCtx:oe,iri:"@graph",relativeTo:{vocab:!0}}),te=ce;ce={},Te&&(ce["@context"]=W),ce[z]=te}else if(T(ce)&&Te){const z=ce;ce={"@context":W};for(const te in z)ce[te]=z[te]}return ce},I.expand=async function(G,W){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");W=_e(W,{keepFreeFloatingNodes:!1,contextResolver:new r({sharedCache:ee})});const Y={},K=[];if("expandContext"in W){const Te=i.clone(W.expandContext);T(Te)&&"@context"in Te?Y.expandContext=Te:Y.expandContext={"@context":Te},K.push(Y.expandContext)}let oe;if(!A(G))Y.input=i.clone(G);else{const Te=await I.get(G,W);oe=Te.documentUrl,Y.input=Te.document,Te.contextUrl&&(Y.remoteContext={"@context":Te.contextUrl},K.push(Y.remoteContext))}"base"in W||(W.base=oe||"");let ce=S(W);for(const Te of K)ce=await y({activeCtx:ce,localCtx:Te,options:W});let Ee=await f({activeCtx:ce,element:Y.input,options:W});return T(Ee)&&"@graph"in Ee&&Object.keys(Ee).length===1?Ee=Ee["@graph"]:Ee===null&&(Ee=[]),b(Ee)||(Ee=[Ee]),Ee},I.flatten=async function(G,W,Y){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof W=="function"?W=null:W=W||null,Y=_e(Y,{base:A(G)?G:"",contextResolver:new r({sharedCache:ee})});const K=await I.expand(G,Y),oe=d(K);return W===null?oe:(Y.graph=!0,Y.skipExpansion=!0,await I.compact(oe,W,Y))},I.frame=async function(G,W,Y){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(Y=_e(Y,{base:A(G)?G:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new r({sharedCache:ee})}),A(W)){const we=await I.get(W,Y);if(W=we.document,we.contextUrl){let Se=W["@context"];Se?b(Se)?Se.push(we.contextUrl):Se=[Se,we.contextUrl]:Se=we.contextUrl,W["@context"]=Se}}const K=W?W["@context"]||{}:{},oe=await I.processContext(S(Y),K,Y);Y.hasOwnProperty("omitGraph")||(Y.omitGraph=x(oe,1.1)),Y.hasOwnProperty("pruneBlankNodeIdentifiers")||(Y.pruneBlankNodeIdentifiers=x(oe,1.1));const ce=await I.expand(G,Y),Ee={...Y};Ee.isFrame=!0,Ee.keepFreeFloatingNodes=!0;const Te=await I.expand(W,Ee),z=Object.keys(W).map(we=>R(oe,we,{vocab:!0}));Ee.merged=!z.includes("@graph"),Ee.is11=x(oe,1.1);const te=h(ce,Te,Ee);Ee.graph=!Y.omitGraph,Ee.skipExpansion=!0,Ee.link={},Ee.framing=!0;let fe=await I.compact(te,K,Ee);return Ee.link={},fe=m(fe,Ee),fe},I.link=async function(G,W,Y){const K={};return W&&(K["@context"]=W),K["@embed"]="@link",I.frame(G,K,Y)},I.normalize=I.canonize=async function(G,W){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if(W=_e(W,{base:A(G)?G:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new r({sharedCache:ee})}),"inputFormat"in W){if(W.inputFormat!=="application/n-quads"&&W.inputFormat!=="application/nquads")throw new a("Unknown canonicalization input format.","jsonld.CanonizeError");const oe=u.parse(G);return n.canonize(oe,W)}const Y={...W};delete Y.format,Y.produceGeneralizedRdf=!1;const K=await I.toRDF(G,Y);return n.canonize(K,W)},I.fromRDF=async function(G,W){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");W=_e(W,{format:A(G)?"application/n-quads":void 0});const{format:Y}=W;let{rdfParser:K}=W;if(Y){if(K=K||Z[Y],!K)throw new a("Unknown input format.","jsonld.UnknownFormat",{format:Y})}else K=()=>G;const oe=await K(G);return g(oe,W)},I.toRDF=async function(G,W){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");W=_e(W,{base:A(G)?G:"",skipExpansion:!1,contextResolver:new r({sharedCache:ee})});let Y;W.skipExpansion?Y=G:Y=await I.expand(G,W);const K=_(Y,W);if(W.format){if(W.format==="application/n-quads"||W.format==="application/nquads")return u.serialize(K);throw new a("Unknown output format.","jsonld.UnknownFormat",{format:W.format})}return K},I.createNodeMap=async function(G,W){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");W=_e(W,{base:A(G)?G:"",contextResolver:new r({sharedCache:ee})});const Y=await I.expand(G,W);return J(Y,W)},I.merge=async function(G,W,Y){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!b(G))throw new TypeError('Could not merge, "docs" must be an array.');typeof W=="function"?W=null:W=W||null,Y=_e(Y,{contextResolver:new r({sharedCache:ee})});const K=await Promise.all(G.map(we=>{const Se={...Y};return I.expand(we,Se)}));let oe=!0;"mergeNodes"in Y&&(oe=Y.mergeNodes);const ce=Y.issuer||new o("_:b"),Ee={"@default":{}};for(let we=0;we<K.length;++we){const Se=i.relabelBlankNodes(K[we],{issuer:new o("_:b"+we+"-")}),Ie=oe||we===0?Ee:{"@default":{}};if(O(Se,Ie,"@default",ce),Ie!==Ee)for(const re in Ie){const ve=Ie[re];if(!(re in Ee)){Ee[re]=ve;continue}const Ne=Ee[re];for(const xe in ve)xe in Ne||(Ne[xe]=ve[xe])}}const Te=k(Ee),z=[],te=Object.keys(Te).sort();for(let we=0;we<te.length;++we){const Se=Te[te[we]];N(Se)||z.push(Se)}return W===null?z:(Y.graph=!0,Y.skipExpansion=!0,await I.compact(z,W,Y))},Object.defineProperty(I,"documentLoader",{get:()=>I._documentLoader,set:G=>I._documentLoader=G}),I.documentLoader=async G=>{throw new a("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:G})},I.get=async function(G,W){let Y;typeof W.documentLoader=="function"?Y=W.documentLoader:Y=I.documentLoader;const K=await Y(G);try{if(!K.document)throw new a("No remote document found at the given URL.","jsonld.NullRemoteDocument");A(K.document)&&(K.document=JSON.parse(K.document))}catch(oe){throw new a("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:oe,remoteDoc:K})}return K},I.processContext=async function(G,W,Y){return Y=_e(Y,{base:"",contextResolver:new r({sharedCache:ee})}),W===null?S(Y):(W=i.clone(W),T(W)&&"@context"in W||(W={"@context":W}),y({activeCtx:G,localCtx:W,options:Y}))},I.getContextValue=mn().getContextValue,I.documentLoaders={},I.useDocumentLoader=function(G){if(!(G in I.documentLoaders))throw new a('Unknown document loader type: "'+G+'"',"jsonld.UnknownDocumentLoader",{type:G});I.documentLoader=I.documentLoaders[G].apply(I,Array.prototype.slice.call(arguments,1))},I.registerRDFParser=function(G,W){Z[G]=W},I.unregisterRDFParser=function(G){delete Z[G]},I.registerRDFParser("application/n-quads",u.parse),I.registerRDFParser("application/nquads",u.parse),I.url=Vi(),I.logEventHandler=q,I.logWarningEventHandler=X,I.safeEventHandler=F,I.setDefaultEventHandler=$,I.strictEventHandler=D,I.unhandledEventHandler=se,I.util=i,Object.assign(I,i),I.promises=I,I.RequestQueue=Hf(),I.JsonLdProcessor=V_()(I),e.setupGlobals(I),e.setupDocumentLoaders(I);function _e(G,{documentLoader:W=I.documentLoader,...Y}){if(G&&"compactionMap"in G)throw new a('"compactionMap" not supported.',"jsonld.OptionsError");if(G&&"expansionMap"in G)throw new a('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:W},Y,G,{eventHandler:ue({options:G})})}return I},ae=function(){return j(function(){return ae()})};return j(ae),Va=ae,Va}var G_=W_();const Wa={},Ga={};class Z_{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}async loadGraphs(){this.loadedExternalUrls=[],this.loadedClasses=[],this.config.prefixes={};const e=[],i=new Lt;if(e.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",i,Dr)),e.push(this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",i,xi)),await Promise.all(e),i.countQuads(null,null,null,Dr)===0&&this.config.attributes.valuesSubject){const r=[...i.getObjects(this.config.attributes.valuesSubject,gl,xi)],o=[];for(const a of r){const l=this.toURL(a.value);l&&this.loadedExternalUrls.indexOf(l)<0&&(this.loadedExternalUrls.push(l),o.push(this.importRDF(this.fetchRDF(l),i,Dr)))}try{await Promise.allSettled(o)}catch(a){console.warn(a)}}this.config.store=i}async importRDF(e,i,r){const o=async a=>{const l=[];await new Promise((u,f)=>{const d=rd(a)==="xml"?new E_.RdfXmlParser:new Ig;d.on("data",g=>{if(i.add(new Bs(g.subject,g.predicate,g.object,r)),this.config.attributes.ignoreOwlImports===null&&Dl.equals(g.predicate)){const _=this.toURL(g.object.value);_&&this.loadedExternalUrls.indexOf(_)<0&&(this.loadedExternalUrls.push(_),l.push(this.importRDF(this.fetchRDF(_),i,ze.namedNode(_))))}if(this.config.classInstanceProvider&&(kl.equals(g.predicate)||Mn.equals(g.predicate))){const _=g.object.value;if(this.loadedClasses.indexOf(_)<0){let h;_ in Ga?h=Ga[_]:(h=this.config.classInstanceProvider(_),Ga[_]=h),this.loadedClasses.push(_),l.push(this.importRDF(h,i,r))}}}).on("error",g=>{console.warn("failed parsing graph",r,g.message),f(g)}).on("prefix",(g,_)=>{g&&(this.config.prefixes[g]=_)}).on("end",()=>{u(null)}),d.write(a),d.end()});try{await Promise.allSettled(l)}catch(u){console.warn(u)}};if(e instanceof Promise&&(e=await e),e){if(rd(e)==="json")try{e=await G_.toRDF(JSON.parse(e),{format:"application/n-quads"})}catch(a){console.error(a)}await o(e)}}toURL(e){if(_l(e))return e;if(this.config.prefixes){const i=e.split(":");if(i.length===2){const r=this.config.prefixes[i[0]];if(r&&(e=e.replace(`${i[0]}:`,r),_l(e)))return e}}return null}async fetchRDF(e){if(e in Wa)return Wa[e];let i=e;this.config.attributes.proxy&&(i=this.config.attributes.proxy+encodeURIComponent(e));const r=fetch(i,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(o=>o.text());return Wa[e]=r,r}}function rd(n){return/^\s*\{/.test(n)?"json":/^\s*<\?xml/.test(n)?"xml":"ttl"}class Za{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.proxy=null,this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class sd{constructor(e,i){this.attributes=new Za,this.loader=new Z_(this),this.prefixes={},this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new Lt,this.theme=e,this.form=i,this.languages=[...new Set(navigator.languages.flatMap(r=>r.length>2?[r.toLocaleLowerCase(),r.substring(0,2)]:r)),""]}updateAttributes(e){const i=new Za;if(Object.keys(i).forEach(r=>{const o=e.dataset[r];o!==void 0&&(i[r]=o)}),this.editMode=i.view===null,this.attributes=i,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),i.language){const r=this.languages.indexOf(i.language);r>-1&&this.languages.splice(r,1),this.languages.unshift(i.language)}i.valuesGraph&&(this.valuesGraphId=ze.namedNode(i.valuesGraph))}static dataAttributes(){const e=new Za;return Object.keys(e).map(i=>(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase()),"data-"+i))}get store(){return this._store}set store(e){this._store=e,this.lists=$g(e,{ignoreErrors:!0}),this.groups=[],e.forSubjects(i=>{this.groups.push(i.id)},It,`${je}PropertyGroup`,null)}}function X_(n){return"_:"+n.value}function J_(n,e){return[...n].map(i=>e(i)).join(`
|
|
399
399
|
`)+`
|
|
400
|
-
`}function sp(){return""}function Xc(r){return"<"+r.value+">"}const ap=/["\\\\\n\r]/,op=/["\\\\\n\r]/g,lp={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function up(r){return lp[r]}function cp(r){return ap.test(r)?r.replace(op,up):r}function dp(r){const e=cp(r.value);return r.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+e+'"':r.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+e+'"@'+r.language:'"'+e+'"^^'+Xc(r.datatype)}function hp(r,e){const t=e(r.subject),n=e(r.predicate),i=e(r.object),s=e(r.graph);return`${t} ${n} ${i} ${s?s+" ":""}.`}function fp(r){return"?"+r.value}function ot(r){if(!r)return null;if(r.termType==="BlankNode")return np(r);if(r.termType==="DefaultGraph")return sp();if(r.termType==="Literal")return dp(r);if(r.termType==="NamedNode")return Xc(r);if(r.termType==="Quad"||r.subject&&r.predicate&&r.object&&r.graph)return hp(r,ot);if(r.termType==="Variable")return fp(r);if(r[Symbol.iterator])return ip(r,ot);throw new Error(`unknown termType ${r.termType}`)}class Fr{constructor(e){if(this.index=new Map,e)for(const[t,n]of e)this.set(t,n)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(ot(e))}*entries(){for(const[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}get(e){const t=this.index.get(ot(e));return t&&t.value}has(e){return this.index.has(ot(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const n=ot(e);return this.index.set(n,{term:e,value:t}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}class fu{constructor({dataset:e,end:t,quad:n,start:i}){this.dataset=e,this.end=t,this.quad=n,this.start=i}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}}function pu(r){try{return ot(r)}catch{return null}}class ft{constructor(e){if(this.index=new Map,e)for(const t of e)this.add(t)}get size(){return this.index.size}add(e){const t=ot(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(pu(e)):!1}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return e?this.index.has(pu(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}class Jc{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Jc.prototype.termType="BlankNode";class Wa{equals(e){return!!e&&e.termType===this.termType}}Wa.prototype.termType="DefaultGraph";Wa.prototype.value="";function gu(r,e){if(!e)return null;if(e.termType==="BlankNode")return r.blankNode(e.value);if(e.termType==="DefaultGraph")return r.defaultGraph();if(e.termType==="Literal")return r.literal(e.value,e.language||r.namedNode(e.datatype.value));if(e.termType==="NamedNode")return r.namedNode(e.value);if(e.termType==="Quad"){const t=r.fromTerm(e.subject),n=r.fromTerm(e.predicate),i=r.fromTerm(e.object),s=r.fromTerm(e.graph);return r.quad(t,n,i,s)}if(e.termType==="Variable")return r.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}class ti{constructor(e,t,n,i=""){this.value=e,this.language=t,this.datatype=n,this.direction=i}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)&&(e.direction||"")===this.direction}}ti.prototype.termType="Literal";class Ln{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Ln.prototype.termType="NamedNode";class za{constructor(e,t,n,i){this.subject=e,this.predicate=t,this.object=n,this.graph=i}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}za.prototype.termType="Quad";za.prototype.value="";class Kc{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Kc.prototype.termType="Variable";const pp=new Ln("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),mu=new Ln("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),gp=new Ln("http://www.w3.org/2001/XMLSchema#string");class Yc{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new Wa}}namedNode(e){return new Ln(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new Jc(e)}literal(e,t){return typeof t=="string"?new ti(e,t,mu):typeof t?.language=="string"?new ti(e,t.language,t.direction?pp:mu,t.direction):new ti(e,"",t||gp)}variable(e){return new Kc(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,n,i=this.defaultGraph()){return new za(e,t,n,i)}fromTerm(e){return gu(this,e)}fromQuad(e){return gu(this,e)}}Yc.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const Qa=new Yc,mp={apply:(r,e,t)=>r(t[0]),get:(r,e)=>r(e)};function gt(r,{factory:e=Qa}={}){const t=(n="")=>e.namedNode(`${r}${n.raw||n}`);return typeof Proxy>"u"?t:new Proxy(t,mp)}gt("http://www.w3.org/2001/XMLSchema#");const St=gt("http://www.w3.org/1999/02/22-rdf-syntax-ns#");gt("http://www.w3.org/2000/01/rdf-schema#");class Fe{static add({ptr:e,start:t,end:n,subjects:i=[null],predicates:s=[null],objects:a=[null],graphs:o,callback:u}={}){if(!e.factory)throw new Error("add operation requires a factory");let l=()=>{};u&&(l=c=>{u(new fu({dataset:e.dataset,start:t,end:n,quad:c}))});for(const c of i)for(const d of s)for(const b of a)for(const y of o){const _={subject:c,predicate:d,object:b,graph:y};_[t]=e.term;const E=e.factory.quad(_.subject,_.predicate,_.object,_.graph);e.dataset.add(E),l(E)}return e}static addList({ptr:e,predicates:t,items:n,graphs:i}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const s of t)for(const a of i){const o=n.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,s,o[0]||St.nil,a));for(let u=0;u<o.length;u++)e.dataset.add(e.factory.quad(o[u],St.first,n[u],a)),e.dataset.add(e.factory.quad(o[u],St.rest,o[u+1]||St.nil,a))}return e}static delete({ptr:e,start:t,subjects:n=[null],predicates:i=[null],objects:s=[null]}){for(const a of n)for(const o of i)for(const u of s){const l={subject:a,predicate:o,object:u};l[t]=e.term;const c=e.dataset.match(l.subject,l.predicate,l.object);for(const d of c)e.dataset.delete(d)}return e}static deleteList({ptr:e,predicates:t}){const n=[];for(const i of t)for(const s of e.dataset.match(e.term,i)){let a=s.object;for(n.push(s);!St.nil.equals(a);){a=n[n.length-1].object;const o=e.dataset.match(a);if(o.size===0)break;for(const u of o)n.push(u)}}for(const i of n)e.dataset.delete(i);return e}static execute({ptr:e,operation:t="traverse",quantifier:n,start:i,end:s,subjects:a,predicates:o,objects:u,graphs:l,items:c,callback:d}={}){if(t==="add")return Fe.add({ptr:e,start:i,end:s,subjects:a,predicates:o,objects:u,graphs:l,callback:d});if(t==="addList")return Fe.addList({ptr:e,predicates:o,items:c,graphs:l});if(t==="delete")return Fe.delete({ptr:e,start:i,subjects:a,predicates:o,objects:u});if(t==="deleteList")return Fe.deleteList({ptr:e,predicates:o});if(t==="isList")return Fe.isList({ptr:e});if(t==="list")return Fe.list({ptr:e});if(t==="traverse")return Fe.traverse({ptr:e,quantifier:n,start:i,end:s,subjects:a,predicates:o,objects:u,graphs:l});throw new Error(`unknown operation ${t}`)}static isList({ptr:e}){return e.isAny()?!1:!!(St.nil.equals(e.term)||Fe.traverse({ptr:e,predicates:[St.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(St.nil);){const t=e.out([St.first]);if(t.length!==1)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const n=e.out([St.rest]);if(n.length!==1)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield t[0],e=n[0]}}}}static traverse({ptr:e,quantifier:t="one",start:n="subject",end:i="object",subjects:s=[null],predicates:a=[null],objects:o=[null],graphs:u=[null],callback:l}){if(t==="one")return Fe.traverseOne({ptr:e,start:n,end:i,subjects:s,predicates:a,objects:o,graphs:u,callback:l});if(t==="oneOrMore"){const c=Fe.traverse({ptr:e,end:i,start:n,subjects:s,predicates:a,objects:o,graphs:u,callback:l});return Fe.traverseMore({ptrs:c,end:i,start:n,subjects:s,predicates:a,objects:o,graphs:u,callback:l})}if(t==="zeroOrMore")return Fe.traverseMore({ptrs:[e],end:i,start:n,subjects:s,predicates:a,objects:o,graphs:u,callback:l});if(t==="zeroOrOne")return[e,...Fe.traverse({ptr:e,end:i,start:n,subjects:s,predicates:a,objects:o,graphs:u,callback:l})];throw new Error(`unknown quantifier ${t}`)}static traverseMore({ptrs:e,end:t,start:n,subjects:i,predicates:s,objects:a,graphs:o,callback:u}={}){let l=[...e],c,d;do{c=[];for(const b of e)c=[...c,...Fe.traverseOne({ptr:b,end:t,start:n,subjects:i,predicates:s,objects:a,graphs:o,callback:u})];d&&(c=c.filter(b=>!d.has(b.term))),e=c,l=[...l,...c],d=new ft(l.map(b=>b.term))}while(c.length>0);return l}static traverseOne({ptr:e,start:t,end:n,subjects:i,predicates:s,objects:a,graphs:o,callback:u=(l,c)=>c.extend(l)}={}){const l=[];for(const c of i)for(const d of s)for(const b of a)for(const y of o){const _={subject:c,predicate:d,object:b,graph:y};_[t]=e.term;for(const E of e.dataset.match(_.subject,_.predicate,_.object,_.graph))l.push(u(new fu({dataset:e.dataset,end:n,quad:E,start:t}),e))}return l}}function yu(r,e){return e?t=>e(r.extend(t)):()=>{}}class bu{constructor({dataset:e,edges:t=[],factory:n,graph:i,term:s}){if(!e&&t.length===0)throw new Error("dataset or edges is required");if(t.length===0&&typeof s>"u")throw new Error("edges or term must be given");if(t.length>0&&s)throw new Error("edges or term must be given");this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=n,this._graph=i,t.length===0&&(this._term=s)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph=="object"?this._graph:this.edge&&this.edge.graph}get length(){return this._term!==void 0?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term!==void 0?this._term:this.edge.term}get value(){const e=this.term;return e===null?void 0:e.value}addIn(e,t,n){return Fe.add({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:yu(this,n)})}addList(e,t){return Fe.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,n){return Fe.add({ptr:this,start:"subject",end:"object",predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:yu(this,n)})}deleteIn(e,t){return Fe.delete({ptr:this,start:"object",subjects:t,predicates:e})}deleteList(e){return Fe.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return Fe.delete({ptr:this,start:"subject",predicates:e,objects:t})}execute({operation:e,quantifier:t,start:n,end:i,subjects:s,predicates:a,objects:o,graphs:u,items:l,callback:c}){return Fe.execute({ptr:this,operation:e,quantifier:t,start:n,end:i,subjects:s,predicates:a,objects:o,graphs:u,items:l,callback:c})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return Fe.traverse({ptr:this,start:"object",end:"object",subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return Fe.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return Fe.traverse({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Fe.isList({ptr:this})}list(){return Fe.list({ptr:this})}*nodes(){for(let e=0;e<this.length;e++)this._term!==void 0?yield{dataset:this.dataset,term:this._term}:this.edges.length>e?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term})}out(e,t){return Fe.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}*quads(){for(const{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}}function _u(r,e){return r?r.equals(e):r===e}function yp(r,e){return!(r.dataset!==e.dataset||!_u(r.graph,e.graph)||!_u(r.term,e.term))}function wu(r,e){return e?t=>e(new r.constructor({factory:r.factory,ptrs:[t]})):()=>{}}class oi{constructor({dataset:e,factory:t,ptrs:n,terms:i,graphs:s}){if(this.factory=t,n)this.ptrs=[...n];else{this.ptrs=[];for(const a of i||[null])for(const o of s||[null])this.ptrs.push(new bu({dataset:e,factory:t,graph:o,term:a}))}}get dataset(){const e=new Set(this.datasets);return e.size!==1?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){const e=new ft(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){const e=this.term;return e?.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,n){const i=wu(this,n);for(const s of this.ptrs)s.addIn(e,t,i);return this}addList(e,t){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const n of this.ptrs)n.addList(e,t);return this}addOut(e,t,n){const i=wu(this,n);for(const s of this.ptrs)s.addOut(e,t,i);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(const n of this.ptrs)n.deleteIn(e,t);return this}deleteList(e){for(const t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(const n of this.ptrs)n.deleteOut(e,t);return this}distinct(){const e=this.ptrs.reduce((t,n)=>(t.some(i=>yp(i,n))||t.push(n.trim()),t),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap(t=>t.execute(e))})}executeAll(e){let t=this;for(const n of e)t=t.execute(n);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map(t=>t.ptrs[0])})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasIn(e,t))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasOut(e,t))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.in(e,t))})}isAny(){return this.ptrs.length>0&&this.ptrs.some(e=>e.isAny())}isList(){return this.ptrs.length!==1?!1:this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list(),t=this;return(function*(){for(const n of e)yield t.clone({ptrs:[n]})})()}map(e){return[...this].map(e)}node(e){const t=this.dataset,n=[...e].map(i=>new bu({dataset:t,factory:this.factory,term:i}));return this.clone({ptrs:n})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.out(e,t))})}*quads(){for(const{edges:e}of this.ptrs)for(const{quad:t}of e)yield t}trim(){return this.clone({ptrs:this.ptrs.map(e=>e.trim())})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}gt("http://www.w3.org/2002/07/owl#");const fr=gt("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),bp=gt("http://www.w3.org/2000/01/rdf-schema#"),ae=gt("http://www.w3.org/ns/shacl#"),ya=gt("https://schemas.link/shacl-next#"),Xa=gt("http://www.w3.org/2001/XMLSchema#");function _p(r){return r?`{${[...r.quads()].map(e=>ot(e)).join(" ")}}`:"{}"}function wp(r){return r?`{${r.map(e=>_p(e)).join(" ")}}`:"{}"}var Gs,vu;function vp(){if(vu)return Gs;vu=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return Gs=e,Gs}var Ws,xu;function xp(){if(xu)return Ws;xu=1;var r=vp(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return Ws=t,Ws}var zs,Eu;function Ep(){if(Eu)return zs;Eu=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return zs=r,zs}var Qs,Su;function Sp(){if(Su)return Qs;Su=1;var r=typeof Sr=="object"&&Sr&&Sr.Object===Object&&Sr;return Qs=r,Qs}var Xs,Iu;function Ip(){if(Iu)return Xs;Iu=1;var r=Sp(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return Xs=t,Xs}var Js,Nu;function Zc(){if(Nu)return Js;Nu=1;var r=Ip(),e=r.Symbol;return Js=e,Js}var Ks,Ru;function Np(){if(Ru)return Ks;Ru=1;var r=Zc(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,i=r?r.toStringTag:void 0;function s(a){var o=t.call(a,i),u=a[i];try{a[i]=void 0;var l=!0}catch{}var c=n.call(a);return l&&(o?a[i]=u:delete a[i]),c}return Ks=s,Ks}var Ys,Tu;function Rp(){if(Tu)return Ys;Tu=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return Ys=t,Ys}var Zs,Au;function Tp(){if(Au)return Zs;Au=1;var r=Zc(),e=Np(),t=Rp(),n="[object Null]",i="[object Undefined]",s=r?r.toStringTag:void 0;function a(o){return o==null?o===void 0?i:n:s&&s in Object(o)?e(o):t(o)}return Zs=a,Zs}var ea,Du;function Ap(){if(Du)return ea;Du=1;function r(e){return e!=null&&typeof e=="object"}return ea=r,ea}var ta,Lu;function Dp(){if(Lu)return ta;Lu=1;var r=Tp(),e=Ap(),t="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&r(i)==t}return ta=n,ta}var ra,Ou;function Lp(){if(Ou)return ra;Ou=1;var r=xp(),e=Ep(),t=Dp(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;function u(l){if(typeof l=="number")return l;if(t(l))return n;if(e(l)){var c=typeof l.valueOf=="function"?l.valueOf():l;l=e(c)?c+"":c}if(typeof l!="string")return l===0?l:+l;l=r(l);var d=s.test(l);return d||a.test(l)?o(l.slice(2),d?2:8):i.test(l)?n:+l}return ra=u,ra}var na,Cu;function Op(){if(Cu)return na;Cu=1;var r=Lp(),e=1/0,t=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=r(i),i===e||i===-e){var s=i<0?-1:1;return s*t}return i===i?i:0}return na=n,na}var ia,ju;function Cp(){if(ju)return ia;ju=1;var r=Op();function e(t){var n=r(t),i=n%1;return n===n?i?n-i:n:0}return ia=e,ia}var sa,$u;function jp(){if($u)return sa;$u=1;var r=Cp(),e="Expected a function";function t(n,i){var s;if(typeof i!="function")throw new TypeError(e);return n=r(n),function(){return--n>0&&(s=i.apply(this,arguments)),n<=1&&(i=void 0),s}}return sa=t,sa}var aa,Fu;function $p(){if(Fu)return aa;Fu=1;var r=jp();function e(t){return r(2,t)}return aa=e,aa}var Fp=$p();const bt=od(Fp);let ku=class{constructor({details:e,factory:t,options:n,results:i=[]}={}){this.details=e,this.factory=t,this.options=n,this.results=i,this._conforms=bt(()=>!this.results.some(s=>s.severity.equals(ae.Info)||s.severity.equals(ae.Violation)||s.severity.equals(ae.Warning))),this._ptr=bt(()=>this.build())}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new oi({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([fr.type],[ae.ValidationReport]).addOut([ae.conforms],[this.factory.literal(this.conforms.toString(),Xa.boolean)]);for(const t of this.results)e.addOut([ae.result],[this.factory.blankNode()],n=>{t.build(n,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function kp(r,e){return Object.entries(e).reduce((t,[n,i])=>(i&&i.termType&&(i=ot(i)),t.replace(`{$${n}}`,i).replace(`{?${n}}`,i)),r)}let Pp=class{constructor({args:e={},constraintComponent:t,factory:n,focusNode:i,message:s=[],path:a,results:o=[],severity:u,shape:l,source:c=[],value:d,valuePaths:b=[]}={}){this.args=e,this.constraintComponent=t,this.factory=n,this.focusNode=i,this.path=a||l.path,this.results=o,this.severity=u,this.shape=l,this.source=c,this.value=d,this.valuePaths=b,this._message=bt(()=>(this.shape.message.length>0&&(s=this.shape.message),s.length===0&&(s=this.shape.ptr.node([this.constraintComponent]).out([ae.message]).terms),s.map(y=>n.literal(kp(y.value,e),y.language||null))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([fr.type],[ae.ValidationResult]).addOut([ae.focusNode],this.focusNode.terms).addOut([ae.resultSeverity],[this.severity]).addOut([ae.sourceConstraint],this.source).addOut([ae.sourceConstraintComponent],[this.constraintComponent]).addOut([ae.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([ae.resultMessage],this.message);const n=i=>{if(i.quantifier==="one")return i.predicates.length>1?e.node([this.factory.blankNode()]).addList([ae.alternativePath],i.predicates):i.start==="object"?e.node([this.factory.blankNode()]).addOut([ae.inversePath],[i.predicates[0]]):e.node([i.predicates[0]]);if(i.quantifier==="oneOrMore")return e.node([this.factory.blankNode()]).addOut([ae.oneOrMorePath],[i.predicates[0]]);if(i.quantifier==="zeroOrMore")return e.node([this.factory.blankNode()]).addOut([ae.zeroOrMorePath],[i.predicates[0]]);if(i.quantifier==="zeroOrOne")return e.node([this.factory.blankNode()]).addOut([ae.zeroOrOnePath],[i.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([ae.resultPath],n(this.path[0]).terms):e.addList([ae.resultPath],this.path.map(i=>n(i).term))),typeof this.value<"u"&&e.addOut([ae.value],this.value.terms),t)for(const i of this.results)e.addOut([ae.detail],[this.factory.blankNode()],s=>{i.build(s,{details:t})})}coverage(){return[...this.valuePaths.flatMap(e=>[...e.quads()]),...this.results.flatMap(e=>e.coverage())]}};class Ja{constructor({factory:e,focusNode:t,options:n={debug:!1,details:!1},processed:i=new Set,report:s=new ku({factory:e,options:n}),results:a=new Map,shape:o,value:u,valueOrNode:l,valuePaths:c,values:d}={}){this.factory=e,this.focusNode=t,this.options=n,this.processed=i,this.report=s,this.results=a,this.shape=o,this.value=u,this.valuePaths=c,this.valueOrNode=l,this.values=d}create({child:e,focusNode:t=this.focusNode,shape:n=this.shape,value:i=this.value,valueOrNode:s=this.valueOrNode,valuePaths:a=this.valuePaths,values:o=this.values}={}){return new Ja({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new ku({factory:this.factory,options:this.options}):this.report,results:this.results,shape:n,value:i,valueOrNode:s,valuePaths:a,values:o})}id({shape:e=this.shape}={}){return`${ot(e.ptr.term)} - ${ot(this.focusNode.term)} - ${wp(this.valuePaths)}`}result(e){const t=new Pp({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),n=this.id();this.results.has(n)?this.results.get(n).add(t):this.results.set(n,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:ya.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:ya.Trace,constraintComponent:e,...t})}test(e,t,n){e?this.debug(t,n):this.violation(t,n)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||ae.Violation,...t})}}function Mp(){return{generic:Bp()}}function Bp(){return r=>{r.trace(ya.TraversalConstraintComponent,{args:{},message:[r.factory.literal("Traversal")],value:r.valueOrNode})}}class qp{constructor(e){this.validations=new Fr(e)}compile(e){const t=e.validator.options.coverage;if(e.deactivated)return[];let n=!1;const i=new Set;for(const s of e.ptr.execute({start:"subject",end:"predicate"})){const a=this.validations.get(s.term);a&&(i.add(a),s.term.equals(ae.property)&&(n=!0))}return t&&e.isPropertyShape&&!n&&i.add(Mp),[...i].map(s=>s(e)).filter(Boolean)}}var ir={},sr={},an={},on={},Pu;function Or(){if(Pu)return on;Pu=1,Object.defineProperty(on,"__esModule",{value:!0}),on.Translator=void 0;let r=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,n,i){for(const s of n)this.supportedRdfDatatypes.push(s),this.fromRdfHandlers[s.value]=t;for(const s of i){let a=this.toRdfHandlers[s];a||(this.toRdfHandlers[s]=a=[]),a.push(t)}}fromRdf(t,n){const i=this.fromRdfHandlers[t.datatype.value];return i?i.fromRdf(t,n):t.value}toRdf(t,n){const i=this.toRdfHandlers[typeof t];if(i)for(const s of i){const a=s.toRdf(t,n);if(a)return a}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}};return on.Translator=r,on}var Mu;function Up(){if(Mu)return an;Mu=1,Object.defineProperty(an,"__esModule",{value:!0}),an.TypeHandlerBoolean=void 0;const r=Or();let e=class ed{fromRdf(n,i){switch(n.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return i&&r.Translator.incorrectRdfDataType(n),!1}toRdf(n,{datatype:i,dataFactory:s}){return s.literal(n?"true":"false",i||s.namedNode(ed.TYPE))}};return an.TypeHandlerBoolean=e,e.TYPE="http://www.w3.org/2001/XMLSchema#boolean",an}var ln={},Bu;function Hp(){if(Bu)return ln;Bu=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.TypeHandlerDate=void 0;const r=Or();let e=class ba{fromRdf(n,i){switch(i&&!n.value.match(ba.VALIDATORS[n.datatype.value.substr(33,n.datatype.value.length)])&&r.Translator.incorrectRdfDataType(n),n.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(n.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const s=n.value.split("-");return new Date(0,parseInt(s[0],10)-1,parseInt(s[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(n.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(n.value+"-01");default:return new Date(n.value)}}toRdf(n,{datatype:i,dataFactory:s}){if(i=i||s.namedNode(ba.TYPES[0]),!(n instanceof Date))return null;const a=n;let o;switch(i.value){case"http://www.w3.org/2001/XMLSchema#gDay":o=String(a.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":o=a.getUTCMonth()+1+"-"+a.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":o=String(a.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":o=a.getUTCFullYear()+"-"+(a.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":o=a.toISOString().replace(/T.*$/,"");break;default:o=a.toISOString()}return s.literal(o,i)}};return ln.TypeHandlerDate=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],e.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/},ln}var un={},qu;function Vp(){if(qu)return un;qu=1,Object.defineProperty(un,"__esModule",{value:!0}),un.TypeHandlerNumberDouble=void 0;const r=Or();let e=class td{fromRdf(n,i){const s=parseFloat(n.value);return i&&isNaN(s)&&r.Translator.incorrectRdfDataType(n),s}toRdf(n,{datatype:i,dataFactory:s}){return i=i||s.namedNode(td.TYPES[0]),isNaN(n)?s.literal("NaN",i):isFinite(n)?n%1===0?null:s.literal(n.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),i):s.literal(n>0?"INF":"-INF",i)}};return un.TypeHandlerNumberDouble=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],un}var cn={},Uu;function Gp(){if(Uu)return cn;Uu=1,Object.defineProperty(cn,"__esModule",{value:!0}),cn.TypeHandlerNumberInteger=void 0;const r=Or();let e=class gn{fromRdf(n,i){const s=parseInt(n.value,10);return i&&(isNaN(s)||n.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(n),s}toRdf(n,{datatype:i,dataFactory:s}){return s.literal(String(n),i||(n<=gn.MAX_INT&&n>=gn.MIN_INT?s.namedNode(gn.TYPES[0]):s.namedNode(gn.TYPES[1])))}};return cn.TypeHandlerNumberInteger=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],e.MAX_INT=2147483647,e.MIN_INT=-2147483648,cn}var dn={},Hu;function Wp(){if(Hu)return dn;Hu=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.TypeHandlerString=void 0;let r=class{fromRdf(t){return t.value}toRdf(t,{datatype:n,dataFactory:i}){return i.literal(t,n)}};return dn.TypeHandlerString=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"],dn}var Vu;function Gu(){return Vu||(Vu=1,(function(r){var e=sr&&sr.__createBinding||(Object.create?(function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}):(function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]})),t=sr&&sr.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(r,"__esModule",{value:!0}),t(Up(),r),t(Hp(),r),t(Vp(),r),t(Gp(),r),t(Wp(),r)})(sr)),sr}var oa={},Wu;function zp(){return Wu||(Wu=1,Object.defineProperty(oa,"__esModule",{value:!0})),oa}var zu;function Qp(){return zu||(zu=1,(function(r){var e=ir&&ir.__createBinding||(Object.create?(function(y,_,E,v){v===void 0&&(v=E);var x=Object.getOwnPropertyDescriptor(_,E);(!x||("get"in x?!_.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return _[E]}}),Object.defineProperty(y,v,x)}):(function(y,_,E,v){v===void 0&&(v=E),y[v]=_[E]})),t=ir&&ir.__exportStar||function(y,_){for(var E in y)E!=="default"&&!Object.prototype.hasOwnProperty.call(_,E)&&e(_,y,E)};Object.defineProperty(r,"__esModule",{value:!0}),r.fromRdf=u,r.toRdf=l,r.getTermRaw=c,r.getSupportedRdfDatatypes=d,r.getSupportedJavaScriptPrimitives=b;const n=Uc(),i=Gu(),s=Or();t(Gu(),r),t(zp(),r),t(Or(),r);const a=new n.DataFactory,o=new s.Translator;o.registerHandler(new i.TypeHandlerString,i.TypeHandlerString.TYPES.map(y=>a.namedNode(y)),["string"]),o.registerHandler(new i.TypeHandlerBoolean,[i.TypeHandlerBoolean.TYPE].map(y=>a.namedNode(y)),["boolean"]),o.registerHandler(new i.TypeHandlerNumberDouble,i.TypeHandlerNumberDouble.TYPES.map(y=>a.namedNode(y)),["number"]),o.registerHandler(new i.TypeHandlerNumberInteger,i.TypeHandlerNumberInteger.TYPES.map(y=>a.namedNode(y)),["number"]),o.registerHandler(new i.TypeHandlerDate,i.TypeHandlerDate.TYPES.map(y=>a.namedNode(y)),["object"]);function u(y,_){return o.fromRdf(y,_)}function l(y,_){return _&&"namedNode"in _&&(_={dataFactory:_}),_=_||{},_&&!_.dataFactory&&(_.dataFactory=a),o.toRdf(y,_)}function c(y,_){return y.termType==="Literal"?u(y,_):y.value}function d(){return o.getSupportedRdfDatatypes()}function b(){return o.getSupportedJavaScriptPrimitives()}})(ir)),ir}var Nn=Qp();function Qu(r){if(r.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[r.term]};const e=r.out([ae.alternativePath]);if(e.ptrs.length===1&&e.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...e.list()].map(a=>a.term)};const t=r.out([ae.inversePath]);if(t.term)return{quantifier:"one",start:"object",end:"subject",predicates:[t.term]};const n=r.out([ae.oneOrMorePath]);if(n.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[n.term]};const i=r.out([ae.zeroOrMorePath]);if(i.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[i.term]};const s=r.out([ae.zeroOrOnePath]);if(s.term)return{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[s.term]}}function Xp(r){return r.terms.length===0?null:r.ptrs[0].isList()?[...r.list()].map(e=>Qu(e)):[Qu(r)]}class Jp{constructor(e){this.shape=e,this._compiled=bt(()=>this.shape.validator.registry.compile(e))}get compiled(){return this._compiled()}async validate(e){return e.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const n of this.compiled)n.node&&await n.node(t),n.generic&&await n.generic(t)}async validateProperty(e){let t;this.shape.isSparqlShape?t=e.focusNode:t=e.focusNode.executeAll(this.shape.path);const n=t.node(new ft(t.terms)),i=[...t].reduce((a,o)=>{const u=o.term,l=t.node([u]);return a.has(u)||a.set(u,{value:l,valuePaths:[]}),a.get(u).valuePaths.push(o),a},new Fr).values(),s=e.create({shape:this.shape,values:n});for(const a of this.compiled)a.property&&await a.property(s);for(const{value:a,valuePaths:o}of i){const u=e.create({shape:this.shape,value:a,valueOrNode:a,valuePaths:o});for(const l of this.compiled)l.generic&&await l.generic(u)}}}function _a(r){const e=new ft,n=new oi({dataset:r.dataset,terms:r.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[bp.subClassOf]});for(const i of n.ptrs)for(const{term:s}of i.nodes())e.add(s);return e}class Kp{constructor(e){this.targetClass=new ft([..._a(e.hasOut([fr.type],[ae.NodeShape])),..._a(e.out([ae.targetClass]))]),this.targetNode=e.out([ae.targetNode]).terms,this.targetObjectsOf=e.out([ae.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([ae.targetSubjectsOf]).terms}resolve(e){const t=e.focusNode.node([null]),n=[...e.focusNode.hasOut([fr.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...t.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],i=e.focusNode.clone({ptrs:n});return i.node([...new ft(i.terms)])}}class Yp{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=bt(()=>{const n=this.ptr.out([ae.deactivated]).term;return n&&Nn.fromRdf(n)}),this._message=bt(()=>this.ptr.out([ae.message]).terms),this._path=bt(()=>Xp(this.ptr.out([ae.path]))),this._severity=bt(()=>this.ptr.out([ae.severity]).term),this._shapeValidator=bt(()=>new Jp(this)),this._sparql=bt(()=>this.ptr.out([ae.sparql])),this._targetResolver=bt(()=>new Kp(this.ptr))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!this.path}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(const n of e.results.get(t))e.report.results.push(n);return e}return e.processed.add(t),this.shapeValidator.validate(e)}}function Zp(r){const e=parseInt(r.ptr.out([ae.maxCount]).value);return{property:eg(e)}}function eg(r){return e=>{e.test(e.values.terms.length<=r,ae.MaxCountConstraintComponent,{args:{maxCount:r},message:[e.factory.literal("More than {$maxCount} values")]})}}function tg(r){const e=parseInt(r.ptr.out([ae.minCount]).value);return{property:rg(e)}}function rg(r){return e=>{e.test(e.values.terms.length>=r,ae.MinCountConstraintComponent,{args:{minCount:r},message:[e.factory.literal("Less than {$minCount} values")]})}}async function ng(r,e){for(const t of r)if(!await e(t))return!1;return!0}async function ig(r,e){return(await Promise.all(r.map(t=>e(t)))).filter(Boolean)}async function wi(r,e){return Promise.all(r.map(e))}async function sg(r,e){for(const t of r)if(await e(t))return!0;return!1}function ag(r){const e=[...r.ptr.out([ae.and])].flatMap(t=>[...t.list()]).map(t=>r.validator.shape(t));return{generic:og(e)}}function og(r){return async e=>{const t=await wi(r,async i=>(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),n=t.every(i=>i.conforms);e.test(n,ae.AndConstraintComponent,{results:t.flatMap(i=>i.results),value:e.valueOrNode})}}function lg(r){const e=r.validator.shape(r.ptr.out([ae.not]));return{generic:ug(e)}}function ug(r){return async e=>{const t=(await r.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,n=!t.conforms;e.test(n,ae.NotConstraintComponent,{args:{not:r.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:t.results,value:e.valueOrNode})}}function cg(r){const e=[...r.ptr.out([ae.or])].flatMap(t=>[...t.list()]).map(t=>r.validator.shape(t));return{generic:dg(e)}}function dg(r){return async e=>{let t=[],n;if(e.options.debug||e.options.details){const i=await wi(r,async s=>(await s.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report);t=i.flatMap(s=>s.results),n=i.some(s=>s.conforms)}else n=await sg(r,async i=>(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms);e.test(n,ae.OrConstraintComponent,{results:t,value:e.valueOrNode})}}function hg(r){const e=[...r.ptr.out([ae.xone])].flatMap(t=>[...t.list()]).map(t=>r.validator.shape(t));return{generic:fg(e)}}function fg(r){return async e=>{const t=await wi(r,async i=>(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),n=t.filter(i=>i.conforms).length===1;e.test(n,ae.XoneConstraintComponent,{results:t.flatMap(i=>i.results),value:e.valueOrNode})}}function pg(r){if(!Nn.fromRdf(r.ptr.out([ae.closed]).term))return null;const t=r.ptr.out([ae.property]).map(s=>r.validator.shape(s)),n=new ft(t.filter(s=>!s.deactivated).map(s=>s.path[0].predicates[0])),i=new ft([...r.ptr.out([ae.ignoredProperties]).list()||[]].map(s=>s.term));return{node:gg(n,i)}}function gg(r,e){return t=>{const n=t.focusNode.execute({start:"subject",end:"predicate"}).filter(i=>e.has(i.term)?!1:!r.has(i.term));if(n.ptrs.length>0)for(const i of n)t.violation(ae.ClosedConstraintComponent,{message:[t.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[i.term]}],value:t.focusNode.node([[...i.quads()][0].object])});else t.debug(ae.ClosedConstraintComponent)}}function mg(r){const e=r.ptr.out([ae.hasValue]).term;return{node:yg(e),property:bg(e)}}function yg(r){return e=>{e.test(r.equals(e.valueOrNode.term),ae.HasValueConstraintComponent,{args:{hasValue:r},message:[e.factory.literal("Value must be {$hasValue}")]})}}function bg(r){return e=>{const t=[...e.values].some(n=>r.equals(n.term));e.test(t,ae.HasValueConstraintComponent,{args:{hasValue:r},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function _g(r){const e=new ft([...r.ptr.out([ae.in]).list()].map(t=>t.term));return{generic:wg(e)}}function wg(r){return e=>{e.test(r.has(e.valueOrNode.term),ae.InConstraintComponent,{args:{in:[...r].map(t=>t.value).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})}}function kr(r,e){if(!r||r.termType!=="Literal"||!e||e.termType!=="Literal"||Xu(r)!==Xu(e))return null;const t=Nn.fromRdf(r),n=Nn.fromRdf(e);return typeof t!=typeof n?null:typeof t=="string"?t.localeCompare(n):t-n}function Xu(r){const e=/^.*(((\+|-)\d{2}:\d{2})|Z)$/;return Xa.dateTime.equals(r.datatype)&&e.test(r.value)}function vg(r){const e=r.ptr.out([ae.disjoint]).term;return{generic:xg(e)}}function xg(r){return e=>{const t=e.focusNode.dataset.match(e.focusNode.term,r,e.valueOrNode.term);e.test(t.size===0,ae.DisjointConstraintComponent,{args:{disjoint:r},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})}}function Eg(r){const e=r.ptr.out([ae.equals]).term;return{node:Sg(e),property:Ig(e)}}function Sg(r){return e=>{const t=e.focusNode.out([r]),n=t.filter(s=>!s.term.equals(e.focusNode.term)),i=t.terms.length!==0&&n.terms.length===0;e.test(i,ae.EqualsConstraintComponent,{args:{equals:r},message:[e.factory.literal("Must have same values as {$equals}")],value:n.terms[0]&&e.focusNode.node([n.terms[0]])||e.focusNode})}}function Ig(r){return e=>{const t=new ft(e.focusNode.out([r]).terms),n=new ft(e.values.terms),i=[...n].filter(o=>!t.has(o)),s=[...t].filter(o=>!n.has(o)),a=[...i,...s];for(const o of a)e.violation(ae.EqualsConstraintComponent,{args:{equals:r},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([o])});a.length===0&&e.debug(ae.EqualsConstraintComponent,{args:{equals:r},message:[e.factory.literal("Must have same values as {$equals}")]})}}function Ng(r){const e=r.ptr.out([ae.lessThan]).term;return{property:Rg(e)}}function Rg(r){return e=>{const t=e.focusNode.out([r]).terms;for(const n of e.values)for(const i of t){const s=kr(n.term,i);s===null||s>=0?e.violation(ae.LessThanConstraintComponent,{args:{lessThan:r},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:n}):e.debug(ae.LessThanConstraintComponent,{args:{lessThan:r},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:n})}}}function Tg(r){const e=r.ptr.out([ae.lessThanOrEquals]).term;return{property:Ag(e)}}function Ag(r){return e=>{const t=e.focusNode.out([r]).terms;for(const n of e.values)for(const i of t){const s=kr(n.term,i);s===null||s>0?e.violation(ae.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:r},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n}):e.debug(ae.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:r},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n})}}}function Dg(r){const e=r.ptr.out([ae.maxExclusive]).term;return{generic:Lg(e)}}function Lg(r){return e=>{const t=kr(e.valueOrNode.term,r);e.test(t!==null&&t<0,ae.MaxExclusiveConstraintComponent,{args:{maxExclusive:r},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})}}function Og(r){const e=r.ptr.out([ae.maxInclusive]).term;return{generic:Cg(e)}}function Cg(r){return e=>{const t=kr(e.valueOrNode.term,r);e.test(t!==null&&t<=0,ae.MaxInclusiveConstraintComponent,{args:{maxInclusive:r},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})}}function jg(r){const e=r.ptr.out([ae.minExclusive]).term;return{generic:$g(e)}}function $g(r){return e=>{const t=kr(e.valueOrNode.term,r);e.test(t!==null&&t>0,ae.MinExclusiveConstraintComponent,{args:{minExclusive:r},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})}}function Fg(r){const e=r.ptr.out([ae.minInclusive]).term;return{generic:kg(e)}}function kg(r){return e=>{const t=kr(e.valueOrNode.term,r);e.test(t!==null&&t>=0,ae.MinInclusiveConstraintComponent,{args:{minInclusive:r},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})}}function Pg(r){const e=[...r.ptr.out([ae.node])].map(t=>r.validator.shape(t));return{generic:Mg(e)}}function Mg(r){return async e=>{for(const t of r){const n=await t.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(n.report.conforms,ae.NodeConstraintComponent,{args:{node:t.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:n.report.results,value:e.valueOrNode})}}}function Bg(r){const e=[...r.ptr.out([ae.property])].map(t=>r.validator.shape(t));return{generic:qg(e)}}function qg(r){return async e=>{const t=e.create({focusNode:e.valueOrNode});for(const n of r)await n.validate(t)}}function Ug(r){const e=r.validator.shape(r.ptr.out([ae.qualifiedValueShape])),t=r.ptr.out([ae.qualifiedValueShapesDisjoint]).term,n=t?Nn.fromRdf(t):!1,i=r.ptr.out([ae.qualifiedMaxCount]).term,s=i?parseInt(i.value):null,a=r.ptr.out([ae.qualifiedMinCount]).term,o=a?parseInt(a.value):null;return{property:Hg(e,n,s,o)}}function Hg(r,e,t,n){return async i=>{const s=[];let a=[];e&&(a=new Set(i.shape.ptr.in([ae.property]).out([ae.property]).out([ae.qualifiedValueShape]).filter(u=>!u.term.equals(r.ptr.term)).map(u=>i.shape.validator.shape(u))));const o=(await ig(i.values,async u=>{const l=(await r.validate(i.create({child:!0,focusNode:u}))).report;if(s.push(l.results),!l.conforms)return!1;if(a.length===0)return!0;if(i.options.debug||i.options.details){const c=await wi([...a],async d=>(await d.validate(i.create({child:!0,focusNode:u}))).report);return s.push(c.flatMap(d=>d.results)),!c.every(d=>d.conforms)}else return!await ng([...a],async c=>(await c.validate(i.create({child:!0,focusNode:u}))).report.conforms)})).length;t!==null&&i.test(o<=t,ae.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:t,qualifiedValueShape:r.ptr.term,qualifiedValueShapesDisjoint:e},message:[i.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:s.flat()}),n!==null&&i.test(o>=n,ae.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:n,qualifiedValueShape:r.ptr.term,qualifiedValueShapesDisjoint:e},message:[i.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:s.flat()})}}function Vg(r,e){return e?e.slice(0,r.length)===r:!1}function Gg(r){const e=[...new Set([...r.ptr.out([ae.languageIn]).list()].map(t=>t.value))];return{generic:Wg(e)}}function Wg(r){return e=>{const t=r.some(n=>Vg(n,e.valueOrNode.term.language));e.test(t,ae.LanguageInConstraintComponent,{args:{languageIn:r.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})}}function zg(r){const e=parseInt(r.ptr.out([ae.maxLength]).value);return{generic:Qg(e)}}function Qg(r){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length<=r;e.test(t,ae.MaxLengthConstraintComponent,{args:{maxLength:r},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})}}function Xg(r){const e=parseInt(r.ptr.out([ae.minLength]).value);return{generic:Jg(e)}}function Jg(r){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length>=r;e.test(t,ae.MinLengthConstraintComponent,{args:{minLength:r},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})}}function Kg(r){const e=r.ptr.out([ae.pattern]).value,t=r.ptr.out([ae.flags]).value,n=new RegExp(e,t);return{generic:Yg(e,t,n)}}function Yg(r,e,t){return n=>{n.test(t.test(n.valueOrNode.term.value),ae.PatternConstraintComponent,{args:{flags:e,pattern:r},message:[n.factory.literal('Value does not match pattern "{$pattern}"')],value:n.valueOrNode})}}function Zg(r){const e=r.ptr.out([ae.uniqueLang]).term;return e.value==="true"&&Xa.boolean.equals(e.datatype)?{property:em()}:null}function em(){return r=>{const t=Object.entries(r.values.terms.reduce((n,i)=>(i.language&&(n[i.language]=(n[i.language]||0)+1),n),{})).filter(([,n])=>n>1);for(const[n]of t)r.violation(ae.UniqueLangConstraintComponent,{args:{lang:n},message:[r.factory.literal('Language "{?lang}" used more than once')]});t.length===0&&r.debug(ae.UniqueLangConstraintComponent)}}const ri=gt("http://www.w3.org/ns/shacl#"),rd=gt("https://schemas.link/shacl-next#");class Cr{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(ri.Info)||e.severity.equals(ri.Violation)||e.severity.equals(ri.Warning))}}function tm(r,e){return Object.entries(e).reduce((t,[n,i])=>(i&&i.termType&&(i=ot(i)),t.replace(`{$${n}}`,i).replace(`{?${n}}`,i)),r)}class li{constructor({args:e={},factory:t,message:n=[],severity:i=ri.Violation}={}){this.severity=i,this.message=n.map(s=>t.literal(tm(s.value,e),s.language||null))}}class Ka{constructor({factory:e=Qa}={}){this.factory=e}clone({factory:e}={}){return new Ka({factory:e||this.factory})}validate(){return new Cr}validateSimple(){return!0}}class Pr extends Ka{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const n of Array.isArray(e)?e:[e])n&&this.datatypes.push(this.factory.fromTerm(n))}clone({factory:e}={}){return new Pr({datatypes:this.datatypes,factory:e||this.factory})}}class rm{constructor({factory:e=Qa,validations:t}={}){if(this.factory=e,this.validations=new Fr,t)for(const n of Object.values(t)){const i=n.clone({factory:this.factory});for(const s of i.datatypes)this.validations.set(s,i)}}validate(e){const t=this.validations.get(e.datatype);return t?t.validate(e):new Cr}validateSimple(e){const t=this.validations.get(e.datatype);return t?t.validateSimple(e):!0}}class Pe extends Pr{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new Pe(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map(n=>{let i;n.test(e.value)&&(i=rd.Debug);const s={pattern:this.factory.literal(n.toString()),this:e};return new li({args:s,factory:this.factory,message:this.message,severity:i})});return new Cr({results:t})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}}const nm=/^([-+]?[0-9]+)$/;class st extends Pe{constructor(e=null,t=null,n,{factory:i}={}){super(nm,n,{factory:i}),this.maxInclusive=null,this.minInclusive=null,typeof t=="string"&&(this.maxInclusive=BigInt(t)),typeof e=="string"&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){return new st(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!rd.Debug.equals(t[0].severity))return new Cr({results:t});const n=BigInt(e.value);if(this.minInclusive!==null&&n<this.minInclusive){const i=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,s=[this.factory.literal(i)];t.push(new li({factory:this.factory,message:s}))}if(this.maxInclusive!==null&&n>this.maxInclusive){const i=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,s=[this.factory.literal(i)];t.push(new li({factory:this.factory,message:s}))}return new Cr({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(this.minInclusive!==null&&t<this.minInclusive||this.maxInclusive!==null&&t>this.maxInclusive)}}class Ya extends Pr{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.values=new Set(e)}clone({factory:e}={}){return new Ya(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const t=[];if(!this.values.has(e.value)){const n=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,i=[this.factory.literal(n)];t.push(new li({factory:this.factory,message:i}))}return new Cr({results:t})}validateSimple(e){return this.values.has(e.value)}}const Te={xsd:gt("http://www.w3.org/2001/XMLSchema#")},im=new Pr({datatypes:Te.xsd.anySimpleType}),sm=new Pr({datatypes:Te.xsd.anyAtomicType}),vi=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,am=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,nd=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,Za=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,id=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,om=/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,lm=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,um=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,cm=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,dm=/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,hm=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,fm=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,pm=/^(([0-9a-fA-F]{2})*)$/,gm=/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,mm=new Pe(vi,Te.xsd.string),ym=new Ya(["1","true","0","false"],Te.xsd.boolean),bm=new Pe(am,Te.xsd.decimal),_m=new Pe(nd,Te.xsd.float),wm=new Pe(nd,Te.xsd.double),vm=new Pe(Za,Te.xsd.duration),xm=new Pe(id,Te.xsd.dateTime),Em=new Pe(om,Te.xsd.time),Sm=new Pe(lm,Te.xsd.date),Im=new Pe(um,Te.xsd.gYearMonth),Nm=new Pe(cm,Te.xsd.gYear),Rm=new Pe(dm,Te.xsd.gMonthDay),Tm=new Pe(hm,Te.xsd.gDay),Am=new Pe(fm,Te.xsd.gMonth),Dm=new Pe(pm,Te.xsd.hexBinary),Lm=new Pe(gm,Te.xsd.base64Binary),Om=new Pe(vi,Te.xsd.anyURI),sd=/^([^\u000d\u000a\u0009]*)$/,Cm=/^([^ ]+( [^ ]+)*)*$/,jm=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,$m=/^([^DT]*)$/,Fm=/^([^YM]*[DT].*)$/,km=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,Pm=new Pe([vi,sd],Te.xsd.normalizedString),Mm=new Pe([vi,sd,Cm],Te.xsd.token),Bm=new Pe(jm,Te.xsd.language),qm=new st(null,null,Te.xsd.integer),Um=new st(null,"0",Te.xsd.nonPositiveInteger),Hm=new st(null,"-1",Te.xsd.negativeInteger),Vm=new st("-9223372036854775808","9223372036854775807",Te.xsd.long),Gm=new st("-2147483648","2147483647",Te.xsd.int),Wm=new st("-32768","32767",Te.xsd.short),zm=new st("-128","127",Te.xsd.byte),Qm=new st("0",null,Te.xsd.nonNegativeInteger),Xm=new st("0","18446744073709551615",Te.xsd.unsignedLong),Jm=new st("0","4294967295",Te.xsd.unsignedInt),Km=new st("0","65535",Te.xsd.unsignedShort),Ym=new st("0","255",Te.xsd.unsignedByte),Zm=new st("1",null,Te.xsd.positiveInteger),ey=new Pe([Za,$m],Te.xsd.yearMonthDuration),ty=new Pe([Za,Fm],Te.xsd.dayTimeDuration),ry=new Pe([id,km],Te.xsd.dateTimeStamp),ny=Object.freeze(Object.defineProperty({__proto__:null,anyAtomicType:sm,anySimpleType:im,anyURI:Om,base64Binary:Lm,boolean:ym,byte:zm,date:Sm,dateTime:xm,dateTimeStamp:ry,dayTimeDuration:ty,decimal:bm,double:wm,duration:vm,float:_m,gDay:Tm,gMonth:Am,gMonthDay:Rm,gYear:Nm,gYearMonth:Im,hexBinary:Dm,int:Gm,integer:qm,language:Bm,long:Vm,negativeInteger:Hm,nonNegativeInteger:Qm,nonPositiveInteger:Um,normalizedString:Pm,positiveInteger:Zm,short:Wm,string:mm,time:Em,token:Mm,unsignedByte:Ym,unsignedInt:Jm,unsignedLong:Xm,unsignedShort:Km,yearMonthDuration:ey},Symbol.toStringTag,{value:"Module"}));class iy extends rm{constructor({factory:e}={}){super({factory:e,validations:{...ny}})}}const sy=new Fr([[ae.BlankNode,new Set(["BlankNode"])],[ae.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[ae.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[ae.IRI,new Set(["NamedNode"])],[ae.IRIOrLiteral,new Set(["NamedNode","Literal"])],[ae.Literal,new Set(["Literal"])]]);function ay(r){const e=r.ptr.out([ae.class]).map(t=>_a(t));return{generic:oy(e)}}function oy(r){return e=>{const t=new ft(e.valueOrNode.out([fr.type]).terms);for(const n of r){const i=[...t].some(s=>n.has(s));e.test(i,ae.ClassConstraintComponent,{value:e.valueOrNode})}}}function ly(r){const e=r.ptr.out([ae.datatype]).term,t=new iy;return{generic:uy(e,t)}}function uy(r,e){return t=>{const n=r.equals(t.valueOrNode.term.datatype)&&e.validateSimple(t.valueOrNode.term);t.test(n,ae.DatatypeConstraintComponent,{args:{datatype:r},message:[t.factory.literal("Value does not have datatype {$datatype}")],value:t.valueOrNode})}}function cy(r){const e=r.ptr.out([ae.nodeKind]).term,t=sy.get(e);return{generic:dy(e,t)}}function dy(r,e){return t=>{t.test(e.has(t.valueOrNode.term.termType),ae.NodeKindConstraintComponent,{args:{nodeKind:r},message:[t.factory.literal("Value does not have node kind {$nodeKind}")],value:t.valueOrNode})}}const hy=new Fr([[ae.maxCount,Zp],[ae.minCount,tg],[ae.and,ag],[ae.not,lg],[ae.or,cg],[ae.xone,hg],[ae.closed,pg],[ae.hasValue,mg],[ae.in,_g],[ae.disjoint,vg],[ae.equals,Eg],[ae.lessThan,Ng],[ae.lessThanOrEquals,Tg],[ae.maxExclusive,Dg],[ae.maxInclusive,Og],[ae.minExclusive,jg],[ae.minInclusive,Fg],[ae.node,Pg],[ae.property,Bg],[ae.qualifiedValueShape,Ug],[ae.languageIn,Gg],[ae.maxLength,zg],[ae.minLength,Xg],[ae.pattern,Kg],[ae.uniqueLang,Zg],[ae.class,ay],[ae.datatype,ly],[ae.nodeKind,cy]]);class fy{constructor(e,{factory:t,...n}){if(this.factory=t,this.options=n,this.registry=new qp(hy),this.shapesPtr=new oi({dataset:e,factory:t}),this.shapes=new Fr,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[s,a]of this.options.validations)this.registry.validations.set(s,a);const i=[...this.shapesPtr.hasOut([ae.targetClass]),...this.shapesPtr.hasOut([ae.targetNode]),...this.shapesPtr.hasOut([ae.targetObjectsOf]),...this.shapesPtr.hasOut([ae.targetSubjectsOf]),...this.shapesPtr.hasOut([fr.type],[ae.NodeShape]),...this.shapesPtr.hasOut([fr.type],[ae.PropertyShape])];for(const s of i)this.shape(s)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new Yp(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const n=new oi({...e,factory:this.factory}),i=new Ja({factory:this.factory,focusNode:n,options:this.options,validator:this});t?t=t.map(s=>this.shape(this.shapesPtr.node(s.terms))):t=this.shapes.values();for(const s of t){const a=i.create({shape:s});let o;n.isAny()?o=s.resolveTargets(a):o=n;for(const u of o)await s.validate(a.create({focusNode:u}))}return i.report}}const py=`
|
|
400
|
+
`}function Q_(){return""}function Wf(n){return"<"+n.value+">"}const K_=/["\\\\\n\r]/,Y_=/["\\\\\n\r]/g,ey={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function ty(n){return ey[n]}function iy(n){return K_.test(n)?n.replace(Y_,ty):n}function ny(n){const e=iy(n.value);return n.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+e+'"':n.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+e+'"@'+n.language:'"'+e+'"^^'+Wf(n.datatype)}function ry(n,e){const i=e(n.subject),r=e(n.predicate),o=e(n.object),a=e(n.graph);return`${i} ${r} ${o} ${a?a+" ":""}.`}function sy(n){return"?"+n.value}function Ft(n){if(!n)return null;if(n.termType==="BlankNode")return X_(n);if(n.termType==="DefaultGraph")return Q_();if(n.termType==="Literal")return ny(n);if(n.termType==="NamedNode")return Wf(n);if(n.termType==="Quad"||n.subject&&n.predicate&&n.object&&n.graph)return ry(n,Ft);if(n.termType==="Variable")return sy(n);if(n[Symbol.iterator])return J_(n,Ft);throw new Error(`unknown termType ${n.termType}`)}class Hn{constructor(e){if(this.index=new Map,e)for(const[i,r]of e)this.set(i,r)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(Ft(e))}*entries(){for(const[,{term:e,value:i}]of this.index)yield[e,i]}forEach(e,i){for(const r of this.entries())e.call(i,r[1],r[0],this)}get(e){const i=this.index.get(Ft(e));return i&&i.value}has(e){return this.index.has(Ft(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,i){const r=Ft(e);return this.index.set(r,{term:e,value:i}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}class od{constructor({dataset:e,end:i,quad:r,start:o}){this.dataset=e,this.end=i,this.quad=r,this.start=o}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}}function ad(n){try{return Ft(n)}catch{return null}}class Gt{constructor(e){if(this.index=new Map,e)for(const i of e)this.add(i)}get size(){return this.index.size}add(e){const i=Ft(e);return this.index.has(i)||this.index.set(i,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(ad(e)):!1}entries(){return this.values().entries()}forEach(e,i){return this.values().forEach(e,i)}has(e){return e?this.index.has(ad(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}class Gf{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Gf.prototype.termType="BlankNode";class Ql{equals(e){return!!e&&e.termType===this.termType}}Ql.prototype.termType="DefaultGraph";Ql.prototype.value="";function ld(n,e){if(!e)return null;if(e.termType==="BlankNode")return n.blankNode(e.value);if(e.termType==="DefaultGraph")return n.defaultGraph();if(e.termType==="Literal")return n.literal(e.value,e.language||n.namedNode(e.datatype.value));if(e.termType==="NamedNode")return n.namedNode(e.value);if(e.termType==="Quad"){const i=n.fromTerm(e.subject),r=n.fromTerm(e.predicate),o=n.fromTerm(e.object),a=n.fromTerm(e.graph);return n.quad(i,r,o,a)}if(e.termType==="Variable")return n.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}class Ps{constructor(e,i,r,o=""){this.value=e,this.language=i,this.datatype=r,this.direction=o}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)&&(e.direction||"")===this.direction}}Ps.prototype.termType="Literal";class Gr{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Gr.prototype.termType="NamedNode";class Kl{constructor(e,i,r,o){this.subject=e,this.predicate=i,this.object=r,this.graph=o}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}Kl.prototype.termType="Quad";Kl.prototype.value="";class Zf{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Zf.prototype.termType="Variable";const oy=new Gr("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),ud=new Gr("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),ay=new Gr("http://www.w3.org/2001/XMLSchema#string");class Xf{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new Ql}}namedNode(e){return new Gr(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new Gf(e)}literal(e,i){return typeof i=="string"?new Ps(e,i,ud):typeof i?.language=="string"?new Ps(e,i.language,i.direction?oy:ud,i.direction):new Ps(e,"",i||ay)}variable(e){return new Zf(e)}defaultGraph(){return this._data.defaultGraph}quad(e,i,r,o=this.defaultGraph()){return new Kl(e,i,r,o)}fromTerm(e){return ld(this,e)}fromQuad(e){return ld(this,e)}}Xf.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const Yl=new Xf,ly={apply:(n,e,i)=>n(i[0]),get:(n,e)=>n(e)};function Xt(n,{factory:e=Yl}={}){const i=(r="")=>e.namedNode(`${n}${r.raw||r}`);return typeof Proxy>"u"?i:new Proxy(i,ly)}Xt("http://www.w3.org/2001/XMLSchema#");const di=Xt("http://www.w3.org/1999/02/22-rdf-syntax-ns#");Xt("http://www.w3.org/2000/01/rdf-schema#");class it{static add({ptr:e,start:i,end:r,subjects:o=[null],predicates:a=[null],objects:l=[null],graphs:u,callback:f}={}){if(!e.factory)throw new Error("add operation requires a factory");let d=()=>{};f&&(d=g=>{f(new od({dataset:e.dataset,start:i,end:r,quad:g}))});for(const g of o)for(const _ of a)for(const h of l)for(const m of u){const b={subject:g,predicate:_,object:h,graph:m};b[i]=e.term;const T=e.factory.quad(b.subject,b.predicate,b.object,b.graph);e.dataset.add(T),d(T)}return e}static addList({ptr:e,predicates:i,items:r,graphs:o}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const a of i)for(const l of o){const u=r.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,a,u[0]||di.nil,l));for(let f=0;f<u.length;f++)e.dataset.add(e.factory.quad(u[f],di.first,r[f],l)),e.dataset.add(e.factory.quad(u[f],di.rest,u[f+1]||di.nil,l))}return e}static delete({ptr:e,start:i,subjects:r=[null],predicates:o=[null],objects:a=[null]}){for(const l of r)for(const u of o)for(const f of a){const d={subject:l,predicate:u,object:f};d[i]=e.term;const g=e.dataset.match(d.subject,d.predicate,d.object);for(const _ of g)e.dataset.delete(_)}return e}static deleteList({ptr:e,predicates:i}){const r=[];for(const o of i)for(const a of e.dataset.match(e.term,o)){let l=a.object;for(r.push(a);!di.nil.equals(l);){l=r[r.length-1].object;const u=e.dataset.match(l);if(u.size===0)break;for(const f of u)r.push(f)}}for(const o of r)e.dataset.delete(o);return e}static execute({ptr:e,operation:i="traverse",quantifier:r,start:o,end:a,subjects:l,predicates:u,objects:f,graphs:d,items:g,callback:_}={}){if(i==="add")return it.add({ptr:e,start:o,end:a,subjects:l,predicates:u,objects:f,graphs:d,callback:_});if(i==="addList")return it.addList({ptr:e,predicates:u,items:g,graphs:d});if(i==="delete")return it.delete({ptr:e,start:o,subjects:l,predicates:u,objects:f});if(i==="deleteList")return it.deleteList({ptr:e,predicates:u});if(i==="isList")return it.isList({ptr:e});if(i==="list")return it.list({ptr:e});if(i==="traverse")return it.traverse({ptr:e,quantifier:r,start:o,end:a,subjects:l,predicates:u,objects:f,graphs:d});throw new Error(`unknown operation ${i}`)}static isList({ptr:e}){return e.isAny()?!1:!!(di.nil.equals(e.term)||it.traverse({ptr:e,predicates:[di.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(di.nil);){const i=e.out([di.first]);if(i.length!==1)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const r=e.out([di.rest]);if(r.length!==1)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield i[0],e=r[0]}}}}static traverse({ptr:e,quantifier:i="one",start:r="subject",end:o="object",subjects:a=[null],predicates:l=[null],objects:u=[null],graphs:f=[null],callback:d}){if(i==="one")return it.traverseOne({ptr:e,start:r,end:o,subjects:a,predicates:l,objects:u,graphs:f,callback:d});if(i==="oneOrMore"){const g=it.traverse({ptr:e,end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:d});return it.traverseMore({ptrs:g,end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:d})}if(i==="zeroOrMore")return it.traverseMore({ptrs:[e],end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:d});if(i==="zeroOrOne")return[e,...it.traverse({ptr:e,end:o,start:r,subjects:a,predicates:l,objects:u,graphs:f,callback:d})];throw new Error(`unknown quantifier ${i}`)}static traverseMore({ptrs:e,end:i,start:r,subjects:o,predicates:a,objects:l,graphs:u,callback:f}={}){let d=[...e],g,_;do{g=[];for(const h of e)g=[...g,...it.traverseOne({ptr:h,end:i,start:r,subjects:o,predicates:a,objects:l,graphs:u,callback:f})];_&&(g=g.filter(h=>!_.has(h.term))),e=g,d=[...d,...g],_=new Gt(d.map(h=>h.term))}while(g.length>0);return d}static traverseOne({ptr:e,start:i,end:r,subjects:o,predicates:a,objects:l,graphs:u,callback:f=(d,g)=>g.extend(d)}={}){const d=[];for(const g of o)for(const _ of a)for(const h of l)for(const m of u){const b={subject:g,predicate:_,object:h,graph:m};b[i]=e.term;for(const T of e.dataset.match(b.subject,b.predicate,b.object,b.graph))d.push(f(new od({dataset:e.dataset,end:r,quad:T,start:i}),e))}return d}}function cd(n,e){return e?i=>e(n.extend(i)):()=>{}}class hd{constructor({dataset:e,edges:i=[],factory:r,graph:o,term:a}){if(!e&&i.length===0)throw new Error("dataset or edges is required");if(i.length===0&&typeof a>"u")throw new Error("edges or term must be given");if(i.length>0&&a)throw new Error("edges or term must be given");this.dataset=e||i[i.length-1].dataset,this.edges=i,this.factory=r,this._graph=o,i.length===0&&(this._term=a)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph=="object"?this._graph:this.edge&&this.edge.graph}get length(){return this._term!==void 0?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term!==void 0?this._term:this.edge.term}get value(){const e=this.term;return e===null?void 0:e.value}addIn(e,i,r){return it.add({ptr:this,start:"object",end:"subject",subjects:i,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:cd(this,r)})}addList(e,i){return it.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:i})}addOut(e,i,r){return it.add({ptr:this,start:"subject",end:"object",predicates:e,objects:i,graphs:[this.graph||this.factory.defaultGraph()],callback:cd(this,r)})}deleteIn(e,i){return it.delete({ptr:this,start:"object",subjects:i,predicates:e})}deleteList(e){return it.deleteList({ptr:this,predicates:e})}deleteOut(e,i){return it.delete({ptr:this,start:"subject",predicates:e,objects:i})}execute({operation:e,quantifier:i,start:r,end:o,subjects:a,predicates:l,objects:u,graphs:f,items:d,callback:g}){return it.execute({ptr:this,operation:e,quantifier:i,start:r,end:o,subjects:a,predicates:l,objects:u,graphs:f,items:d,callback:g})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,i){return it.traverse({ptr:this,start:"object",end:"object",subjects:i,predicates:e,graphs:[this.graph]})}hasOut(e,i){return it.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:i,graphs:[this.graph]})}in(e,i){return it.traverse({ptr:this,start:"object",end:"subject",subjects:i,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return it.isList({ptr:this})}list(){return it.list({ptr:this})}*nodes(){for(let e=0;e<this.length;e++)this._term!==void 0?yield{dataset:this.dataset,term:this._term}:this.edges.length>e?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term})}out(e,i){return it.traverse({ptr:this,predicates:e,objects:i,graphs:[this.graph]})}*quads(){for(const{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}}function dd(n,e){return n?n.equals(e):n===e}function uy(n,e){return!(n.dataset!==e.dataset||!dd(n.graph,e.graph)||!dd(n.term,e.term))}function fd(n,e){return e?i=>e(new n.constructor({factory:n.factory,ptrs:[i]})):()=>{}}class js{constructor({dataset:e,factory:i,ptrs:r,terms:o,graphs:a}){if(this.factory=i,r)this.ptrs=[...r];else{this.ptrs=[];for(const l of o||[null])for(const u of a||[null])this.ptrs.push(new hd({dataset:e,factory:i,graph:u,term:l}))}}get dataset(){const e=new Set(this.datasets);return e.size!==1?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){const e=new Gt(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){const e=this.term;return e?.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,i,r){const o=fd(this,r);for(const a of this.ptrs)a.addIn(e,i,o);return this}addList(e,i){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const r of this.ptrs)r.addList(e,i);return this}addOut(e,i,r){const o=fd(this,r);for(const a of this.ptrs)a.addOut(e,i,o);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,i){for(const r of this.ptrs)r.deleteIn(e,i);return this}deleteList(e){for(const i of this.ptrs)i.deleteList(e);return this}deleteOut(e,i){for(const r of this.ptrs)r.deleteOut(e,i);return this}distinct(){const e=this.ptrs.reduce((i,r)=>(i.some(o=>uy(o,r))||i.push(r.trim()),i),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap(i=>i.execute(e))})}executeAll(e){let i=this;for(const r of e)i=i.execute(r);return i}filter(e){return this.clone({ptrs:[...this].filter(e).map(i=>i.ptrs[0])})}hasIn(e,i){return this.clone({ptrs:this.ptrs.flatMap(r=>r.hasIn(e,i))})}hasOut(e,i){return this.clone({ptrs:this.ptrs.flatMap(r=>r.hasOut(e,i))})}in(e,i){return this.clone({ptrs:this.ptrs.flatMap(r=>r.in(e,i))})}isAny(){return this.ptrs.length>0&&this.ptrs.some(e=>e.isAny())}isList(){return this.ptrs.length!==1?!1:this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list(),i=this;return(function*(){for(const r of e)yield i.clone({ptrs:[r]})})()}map(e){return[...this].map(e)}node(e){const i=this.dataset,r=[...e].map(o=>new hd({dataset:i,factory:this.factory,term:o}));return this.clone({ptrs:r})}out(e,i){return this.clone({ptrs:this.ptrs.flatMap(r=>r.out(e,i))})}*quads(){for(const{edges:e}of this.ptrs)for(const{quad:i}of e)yield i}trim(){return this.clone({ptrs:this.ptrs.map(e=>e.trim())})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}Xt("http://www.w3.org/2002/07/owl#");const _n=Xt("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),cy=Xt("http://www.w3.org/2000/01/rdf-schema#"),me=Xt("http://www.w3.org/ns/shacl#"),xl=Xt("https://schemas.link/shacl-next#"),eu=Xt("http://www.w3.org/2001/XMLSchema#");function hy(n){return n?`{${[...n.quads()].map(e=>Ft(e)).join(" ")}}`:"{}"}function dy(n){return n?`{${n.map(e=>hy(e)).join(" ")}}`:"{}"}var Xa,pd;function fy(){if(pd)return Xa;pd=1;var n=/\s/;function e(i){for(var r=i.length;r--&&n.test(i.charAt(r)););return r}return Xa=e,Xa}var Ja,gd;function py(){if(gd)return Ja;gd=1;var n=fy(),e=/^\s+/;function i(r){return r&&r.slice(0,n(r)+1).replace(e,"")}return Ja=i,Ja}var Qa,md;function gy(){if(md)return Qa;md=1;function n(e){var i=typeof e;return e!=null&&(i=="object"||i=="function")}return Qa=n,Qa}var Ka,_d;function my(){if(_d)return Ka;_d=1;var n=typeof Cn=="object"&&Cn&&Cn.Object===Object&&Cn;return Ka=n,Ka}var Ya,yd;function _y(){if(yd)return Ya;yd=1;var n=my(),e=typeof self=="object"&&self&&self.Object===Object&&self,i=n||e||Function("return this")();return Ya=i,Ya}var el,vd;function Jf(){if(vd)return el;vd=1;var n=_y(),e=n.Symbol;return el=e,el}var tl,bd;function yy(){if(bd)return tl;bd=1;var n=Jf(),e=Object.prototype,i=e.hasOwnProperty,r=e.toString,o=n?n.toStringTag:void 0;function a(l){var u=i.call(l,o),f=l[o];try{l[o]=void 0;var d=!0}catch{}var g=r.call(l);return d&&(u?l[o]=f:delete l[o]),g}return tl=a,tl}var il,wd;function vy(){if(wd)return il;wd=1;var n=Object.prototype,e=n.toString;function i(r){return e.call(r)}return il=i,il}var nl,xd;function by(){if(xd)return nl;xd=1;var n=Jf(),e=yy(),i=vy(),r="[object Null]",o="[object Undefined]",a=n?n.toStringTag:void 0;function l(u){return u==null?u===void 0?o:r:a&&a in Object(u)?e(u):i(u)}return nl=l,nl}var rl,Ed;function wy(){if(Ed)return rl;Ed=1;function n(e){return e!=null&&typeof e=="object"}return rl=n,rl}var sl,Sd;function xy(){if(Sd)return sl;Sd=1;var n=by(),e=wy(),i="[object Symbol]";function r(o){return typeof o=="symbol"||e(o)&&n(o)==i}return sl=r,sl}var ol,Td;function Ey(){if(Td)return ol;Td=1;var n=py(),e=gy(),i=xy(),r=NaN,o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function f(d){if(typeof d=="number")return d;if(i(d))return r;if(e(d)){var g=typeof d.valueOf=="function"?d.valueOf():d;d=e(g)?g+"":g}if(typeof d!="string")return d===0?d:+d;d=n(d);var _=a.test(d);return _||l.test(d)?u(d.slice(2),_?2:8):o.test(d)?r:+d}return ol=f,ol}var al,Ld;function Sy(){if(Ld)return al;Ld=1;var n=Ey(),e=1/0,i=17976931348623157e292;function r(o){if(!o)return o===0?o:0;if(o=n(o),o===e||o===-e){var a=o<0?-1:1;return a*i}return o===o?o:0}return al=r,al}var ll,Id;function Ty(){if(Id)return ll;Id=1;var n=Sy();function e(i){var r=n(i),o=r%1;return r===r?o?r-o:r:0}return ll=e,ll}var ul,Ad;function Ly(){if(Ad)return ul;Ad=1;var n=Ty(),e="Expected a function";function i(r,o){var a;if(typeof o!="function")throw new TypeError(e);return r=n(r),function(){return--r>0&&(a=o.apply(this,arguments)),r<=1&&(o=void 0),a}}return ul=i,ul}var cl,Nd;function Iy(){if(Nd)return cl;Nd=1;var n=Ly();function e(i){return n(2,i)}return cl=e,cl}var Ay=Iy();const ti=eg(Ay);let Rd=class{constructor({details:e,factory:i,options:r,results:o=[]}={}){this.details=e,this.factory=i,this.options=r,this.results=o,this._conforms=ti(()=>!this.results.some(a=>a.severity.equals(me.Info)||a.severity.equals(me.Violation)||a.severity.equals(me.Warning))),this._ptr=ti(()=>this.build())}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new js({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([_n.type],[me.ValidationReport]).addOut([me.conforms],[this.factory.literal(this.conforms.toString(),eu.boolean)]);for(const i of this.results)e.addOut([me.result],[this.factory.blankNode()],r=>{i.build(r,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function Ny(n,e){return Object.entries(e).reduce((i,[r,o])=>(o&&o.termType&&(o=Ft(o)),i.replace(`{$${r}}`,o).replace(`{?${r}}`,o)),n)}let Ry=class{constructor({args:e={},constraintComponent:i,factory:r,focusNode:o,message:a=[],path:l,results:u=[],severity:f,shape:d,source:g=[],value:_,valuePaths:h=[]}={}){this.args=e,this.constraintComponent=i,this.factory=r,this.focusNode=o,this.path=l||d.path,this.results=u,this.severity=f,this.shape=d,this.source=g,this.value=_,this.valuePaths=h,this._message=ti(()=>(this.shape.message.length>0&&(a=this.shape.message),a.length===0&&(a=this.shape.ptr.node([this.constraintComponent]).out([me.message]).terms),a.map(m=>r.literal(Ny(m.value,e),m.language||null))))}get message(){return this._message()}build(e,{details:i}={}){e.addOut([_n.type],[me.ValidationResult]).addOut([me.focusNode],this.focusNode.terms).addOut([me.resultSeverity],[this.severity]).addOut([me.sourceConstraint],this.source).addOut([me.sourceConstraintComponent],[this.constraintComponent]).addOut([me.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([me.resultMessage],this.message);const r=o=>{if(o.quantifier==="one")return o.predicates.length>1?e.node([this.factory.blankNode()]).addList([me.alternativePath],o.predicates):o.start==="object"?e.node([this.factory.blankNode()]).addOut([me.inversePath],[o.predicates[0]]):e.node([o.predicates[0]]);if(o.quantifier==="oneOrMore")return e.node([this.factory.blankNode()]).addOut([me.oneOrMorePath],[o.predicates[0]]);if(o.quantifier==="zeroOrMore")return e.node([this.factory.blankNode()]).addOut([me.zeroOrMorePath],[o.predicates[0]]);if(o.quantifier==="zeroOrOne")return e.node([this.factory.blankNode()]).addOut([me.zeroOrOnePath],[o.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([me.resultPath],r(this.path[0]).terms):e.addList([me.resultPath],this.path.map(o=>r(o).term))),typeof this.value<"u"&&e.addOut([me.value],this.value.terms),i)for(const o of this.results)e.addOut([me.detail],[this.factory.blankNode()],a=>{o.build(a,{details:i})})}coverage(){return[...this.valuePaths.flatMap(e=>[...e.quads()]),...this.results.flatMap(e=>e.coverage())]}};class tu{constructor({factory:e,focusNode:i,options:r={debug:!1,details:!1},processed:o=new Set,report:a=new Rd({factory:e,options:r}),results:l=new Map,shape:u,value:f,valueOrNode:d,valuePaths:g,values:_}={}){this.factory=e,this.focusNode=i,this.options=r,this.processed=o,this.report=a,this.results=l,this.shape=u,this.value=f,this.valuePaths=g,this.valueOrNode=d,this.values=_}create({child:e,focusNode:i=this.focusNode,shape:r=this.shape,value:o=this.value,valueOrNode:a=this.valueOrNode,valuePaths:l=this.valuePaths,values:u=this.values}={}){return new tu({factory:this.factory,focusNode:i,options:this.options,processed:this.processed,report:e?new Rd({factory:this.factory,options:this.options}):this.report,results:this.results,shape:r,value:o,valueOrNode:a,valuePaths:l,values:u})}id({shape:e=this.shape}={}){return`${Ft(e.ptr.term)} - ${Ft(this.focusNode.term)} - ${dy(this.valuePaths)}`}result(e){const i=new Ry({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),r=this.id();this.results.has(r)?this.results.get(r).add(i):this.results.set(r,new Set([i])),this.report.results.push(i)}debug(e,i){this.options.debug&&this.result({severity:xl.Debug,constraintComponent:e,...i})}trace(e,i){this.options.trace&&this.result({severity:xl.Trace,constraintComponent:e,...i})}test(e,i,r){e?this.debug(i,r):this.violation(i,r)}violation(e,i){this.result({constraintComponent:e,severity:this.shape.severity||me.Violation,...i})}}function Py(){return{generic:Cy()}}function Cy(){return n=>{n.trace(xl.TraversalConstraintComponent,{args:{},message:[n.factory.literal("Traversal")],value:n.valueOrNode})}}class Dy{constructor(e){this.validations=new Hn(e)}compile(e){const i=e.validator.options.coverage;if(e.deactivated)return[];let r=!1;const o=new Set;for(const a of e.ptr.execute({start:"subject",end:"predicate"})){const l=this.validations.get(a.term);l&&(o.add(l),a.term.equals(me.property)&&(r=!0))}return i&&e.isPropertyShape&&!r&&o.add(Py),[...o].map(a=>a(e)).filter(Boolean)}}var ln={},un={},wr={},xr={},Pd;function Bn(){if(Pd)return xr;Pd=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.Translator=void 0;let n=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(i){throw new Error(`Invalid RDF ${i.datatype.value} value: '${i.value}'`)}registerHandler(i,r,o){for(const a of r)this.supportedRdfDatatypes.push(a),this.fromRdfHandlers[a.value]=i;for(const a of o){let l=this.toRdfHandlers[a];l||(this.toRdfHandlers[a]=l=[]),l.push(i)}}fromRdf(i,r){const o=this.fromRdfHandlers[i.datatype.value];return o?o.fromRdf(i,r):i.value}toRdf(i,r){const o=this.toRdfHandlers[typeof i];if(o)for(const a of o){const l=a.toRdf(i,r);if(l)return l}throw new Error(`Invalid JavaScript value: '${i}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}};return xr.Translator=n,xr}var Cd;function ky(){if(Cd)return wr;Cd=1,Object.defineProperty(wr,"__esModule",{value:!0}),wr.TypeHandlerBoolean=void 0;const n=Bn();let e=class Qf{fromRdf(r,o){switch(r.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return o&&n.Translator.incorrectRdfDataType(r),!1}toRdf(r,{datatype:o,dataFactory:a}){return a.literal(r?"true":"false",o||a.namedNode(Qf.TYPE))}};return wr.TypeHandlerBoolean=e,e.TYPE="http://www.w3.org/2001/XMLSchema#boolean",wr}var Er={},Dd;function My(){if(Dd)return Er;Dd=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.TypeHandlerDate=void 0;const n=Bn();let e=class El{fromRdf(r,o){switch(o&&!r.value.match(El.VALIDATORS[r.datatype.value.substr(33,r.datatype.value.length)])&&n.Translator.incorrectRdfDataType(r),r.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(r.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const a=r.value.split("-");return new Date(0,parseInt(a[0],10)-1,parseInt(a[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(r.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(r.value+"-01");default:return new Date(r.value)}}toRdf(r,{datatype:o,dataFactory:a}){if(o=o||a.namedNode(El.TYPES[0]),!(r instanceof Date))return null;const l=r;let u;switch(o.value){case"http://www.w3.org/2001/XMLSchema#gDay":u=String(l.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":u=l.getUTCMonth()+1+"-"+l.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":u=String(l.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":u=l.getUTCFullYear()+"-"+(l.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":u=l.toISOString().replace(/T.*$/,"");break;default:u=l.toISOString()}return a.literal(u,o)}};return Er.TypeHandlerDate=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],e.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/},Er}var Sr={},kd;function Oy(){if(kd)return Sr;kd=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.TypeHandlerNumberDouble=void 0;const n=Bn();let e=class Kf{fromRdf(r,o){const a=parseFloat(r.value);return o&&isNaN(a)&&n.Translator.incorrectRdfDataType(r),a}toRdf(r,{datatype:o,dataFactory:a}){return o=o||a.namedNode(Kf.TYPES[0]),isNaN(r)?a.literal("NaN",o):isFinite(r)?r%1===0?null:a.literal(r.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),o):a.literal(r>0?"INF":"-INF",o)}};return Sr.TypeHandlerNumberDouble=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],Sr}var Tr={},Md;function Fy(){if(Md)return Tr;Md=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.TypeHandlerNumberInteger=void 0;const n=Bn();let e=class Rr{fromRdf(r,o){const a=parseInt(r.value,10);return o&&(isNaN(a)||r.value.indexOf(".")>=0)&&n.Translator.incorrectRdfDataType(r),a}toRdf(r,{datatype:o,dataFactory:a}){return a.literal(String(r),o||(r<=Rr.MAX_INT&&r>=Rr.MIN_INT?a.namedNode(Rr.TYPES[0]):a.namedNode(Rr.TYPES[1])))}};return Tr.TypeHandlerNumberInteger=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],e.MAX_INT=2147483647,e.MIN_INT=-2147483648,Tr}var Lr={},Od;function jy(){if(Od)return Lr;Od=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.TypeHandlerString=void 0;let n=class{fromRdf(i){return i.value}toRdf(i,{datatype:r,dataFactory:o}){return o.literal(i,r)}};return Lr.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"],Lr}var Fd;function jd(){return Fd||(Fd=1,(function(n){var e=un&&un.__createBinding||(Object.create?(function(r,o,a,l){l===void 0&&(l=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(r,l,u)}):(function(r,o,a,l){l===void 0&&(l=a),r[l]=o[a]})),i=un&&un.__exportStar||function(r,o){for(var a in r)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,r,a)};Object.defineProperty(n,"__esModule",{value:!0}),i(ky(),n),i(My(),n),i(Oy(),n),i(Fy(),n),i(jy(),n)})(un)),un}var hl={},$d;function $y(){return $d||($d=1,Object.defineProperty(hl,"__esModule",{value:!0})),hl}var Bd;function By(){return Bd||(Bd=1,(function(n){var e=ln&&ln.__createBinding||(Object.create?(function(m,b,T,A){A===void 0&&(A=T);var N=Object.getOwnPropertyDescriptor(b,T);(!N||("get"in N?!b.__esModule:N.writable||N.configurable))&&(N={enumerable:!0,get:function(){return b[T]}}),Object.defineProperty(m,A,N)}):(function(m,b,T,A){A===void 0&&(A=T),m[A]=b[T]})),i=ln&&ln.__exportStar||function(m,b){for(var T in m)T!=="default"&&!Object.prototype.hasOwnProperty.call(b,T)&&e(b,m,T)};Object.defineProperty(n,"__esModule",{value:!0}),n.fromRdf=f,n.toRdf=d,n.getTermRaw=g,n.getSupportedRdfDatatypes=_,n.getSupportedJavaScriptPrimitives=h;const r=$f(),o=jd(),a=Bn();i(jd(),n),i($y(),n),i(Bn(),n);const l=new r.DataFactory,u=new a.Translator;u.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map(m=>l.namedNode(m)),["string"]),u.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map(m=>l.namedNode(m)),["boolean"]),u.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map(m=>l.namedNode(m)),["number"]),u.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map(m=>l.namedNode(m)),["number"]),u.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map(m=>l.namedNode(m)),["object"]);function f(m,b){return u.fromRdf(m,b)}function d(m,b){return b&&"namedNode"in b&&(b={dataFactory:b}),b=b||{},b&&!b.dataFactory&&(b.dataFactory=l),u.toRdf(m,b)}function g(m,b){return m.termType==="Literal"?f(m,b):m.value}function _(){return u.getSupportedRdfDatatypes()}function h(){return u.getSupportedJavaScriptPrimitives()}})(ln)),ln}var zr=By();function qd(n){if(n.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[n.term]};const e=n.out([me.alternativePath]);if(e.ptrs.length===1&&e.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...e.list()].map(l=>l.term)};const i=n.out([me.inversePath]);if(i.term)return{quantifier:"one",start:"object",end:"subject",predicates:[i.term]};const r=n.out([me.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const o=n.out([me.zeroOrMorePath]);if(o.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[o.term]};const a=n.out([me.zeroOrOnePath]);if(a.term)return{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[a.term]}}function qy(n){return n.terms.length===0?null:n.ptrs[0].isList()?[...n.list()].map(e=>qd(e)):[qd(n)]}class zy{constructor(e){this.shape=e,this._compiled=ti(()=>this.shape.validator.registry.compile(e))}get compiled(){return this._compiled()}async validate(e){return e.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const i=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const r of this.compiled)r.node&&await r.node(i),r.generic&&await r.generic(i)}async validateProperty(e){let i;this.shape.isSparqlShape?i=e.focusNode:i=e.focusNode.executeAll(this.shape.path);const r=i.node(new Gt(i.terms)),o=[...i].reduce((l,u)=>{const f=u.term,d=i.node([f]);return l.has(f)||l.set(f,{value:d,valuePaths:[]}),l.get(f).valuePaths.push(u),l},new Hn).values(),a=e.create({shape:this.shape,values:r});for(const l of this.compiled)l.property&&await l.property(a);for(const{value:l,valuePaths:u}of o){const f=e.create({shape:this.shape,value:l,valueOrNode:l,valuePaths:u});for(const d of this.compiled)d.generic&&await d.generic(f)}}}function Sl(n){const e=new Gt,r=new js({dataset:n.dataset,terms:n.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[cy.subClassOf]});for(const o of r.ptrs)for(const{term:a}of o.nodes())e.add(a);return e}class Uy{constructor(e){this.targetClass=new Gt([...Sl(e.hasOut([_n.type],[me.NodeShape])),...Sl(e.out([me.targetClass]))]),this.targetNode=e.out([me.targetNode]).terms,this.targetObjectsOf=e.out([me.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([me.targetSubjectsOf]).terms}resolve(e){const i=e.focusNode.node([null]),r=[...e.focusNode.hasOut([_n.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...i.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...i.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],o=e.focusNode.clone({ptrs:r});return o.node([...new Gt(o.terms)])}}class Hy{constructor(e,{validator:i}){this.ptr=e,this.validator=i,this._deactivated=ti(()=>{const r=this.ptr.out([me.deactivated]).term;return r&&zr.fromRdf(r)}),this._message=ti(()=>this.ptr.out([me.message]).terms),this._path=ti(()=>qy(this.ptr.out([me.path]))),this._severity=ti(()=>this.ptr.out([me.severity]).term),this._shapeValidator=ti(()=>new zy(this)),this._sparql=ti(()=>this.ptr.out([me.sparql])),this._targetResolver=ti(()=>new Uy(this.ptr))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!this.path}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const i=e.id({shape:this});if(e.processed.has(i)){if(e.results.has(i))for(const r of e.results.get(i))e.report.results.push(r);return e}return e.processed.add(i),this.shapeValidator.validate(e)}}function Vy(n){const e=parseInt(n.ptr.out([me.maxCount]).value);return{property:Wy(e)}}function Wy(n){return e=>{e.test(e.values.terms.length<=n,me.MaxCountConstraintComponent,{args:{maxCount:n},message:[e.factory.literal("More than {$maxCount} values")]})}}function Gy(n){const e=parseInt(n.ptr.out([me.minCount]).value);return{property:Zy(e)}}function Zy(n){return e=>{e.test(e.values.terms.length>=n,me.MinCountConstraintComponent,{args:{minCount:n},message:[e.factory.literal("Less than {$minCount} values")]})}}async function Xy(n,e){for(const i of n)if(!await e(i))return!1;return!0}async function Jy(n,e){return(await Promise.all(n.map(i=>e(i)))).filter(Boolean)}async function Qs(n,e){return Promise.all(n.map(e))}async function Qy(n,e){for(const i of n)if(await e(i))return!0;return!1}function Ky(n){const e=[...n.ptr.out([me.and])].flatMap(i=>[...i.list()]).map(i=>n.validator.shape(i));return{generic:Yy(e)}}function Yy(n){return async e=>{const i=await Qs(n,async o=>(await o.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),r=i.every(o=>o.conforms);e.test(r,me.AndConstraintComponent,{results:i.flatMap(o=>o.results),value:e.valueOrNode})}}function ev(n){const e=n.validator.shape(n.ptr.out([me.not]));return{generic:tv(e)}}function tv(n){return async e=>{const i=(await n.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,r=!i.conforms;e.test(r,me.NotConstraintComponent,{args:{not:n.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:i.results,value:e.valueOrNode})}}function iv(n){const e=[...n.ptr.out([me.or])].flatMap(i=>[...i.list()]).map(i=>n.validator.shape(i));return{generic:nv(e)}}function nv(n){return async e=>{let i=[],r;if(e.options.debug||e.options.details){const o=await Qs(n,async a=>(await a.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report);i=o.flatMap(a=>a.results),r=o.some(a=>a.conforms)}else r=await Qy(n,async o=>(await o.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms);e.test(r,me.OrConstraintComponent,{results:i,value:e.valueOrNode})}}function rv(n){const e=[...n.ptr.out([me.xone])].flatMap(i=>[...i.list()]).map(i=>n.validator.shape(i));return{generic:sv(e)}}function sv(n){return async e=>{const i=await Qs(n,async o=>(await o.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),r=i.filter(o=>o.conforms).length===1;e.test(r,me.XoneConstraintComponent,{results:i.flatMap(o=>o.results),value:e.valueOrNode})}}function ov(n){if(!zr.fromRdf(n.ptr.out([me.closed]).term))return null;const i=n.ptr.out([me.property]).map(a=>n.validator.shape(a)),r=new Gt(i.filter(a=>!a.deactivated).map(a=>a.path[0].predicates[0])),o=new Gt([...n.ptr.out([me.ignoredProperties]).list()||[]].map(a=>a.term));return{node:av(r,o)}}function av(n,e){return i=>{const r=i.focusNode.execute({start:"subject",end:"predicate"}).filter(o=>e.has(o.term)?!1:!n.has(o.term));if(r.ptrs.length>0)for(const o of r)i.violation(me.ClosedConstraintComponent,{message:[i.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[o.term]}],value:i.focusNode.node([[...o.quads()][0].object])});else i.debug(me.ClosedConstraintComponent)}}function lv(n){const e=n.ptr.out([me.hasValue]).term;return{node:uv(e),property:cv(e)}}function uv(n){return e=>{e.test(n.equals(e.valueOrNode.term),me.HasValueConstraintComponent,{args:{hasValue:n},message:[e.factory.literal("Value must be {$hasValue}")]})}}function cv(n){return e=>{const i=[...e.values].some(r=>n.equals(r.term));e.test(i,me.HasValueConstraintComponent,{args:{hasValue:n},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function hv(n){const e=new Gt([...n.ptr.out([me.in]).list()].map(i=>i.term));return{generic:dv(e)}}function dv(n){return e=>{e.test(n.has(e.valueOrNode.term),me.InConstraintComponent,{args:{in:[...n].map(i=>i.value).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})}}function Vn(n,e){if(!n||n.termType!=="Literal"||!e||e.termType!=="Literal"||zd(n)!==zd(e))return null;const i=zr.fromRdf(n),r=zr.fromRdf(e);return typeof i!=typeof r?null:typeof i=="string"?i.localeCompare(r):i-r}function zd(n){const e=/^.*(((\+|-)\d{2}:\d{2})|Z)$/;return eu.dateTime.equals(n.datatype)&&e.test(n.value)}function fv(n){const e=n.ptr.out([me.disjoint]).term;return{generic:pv(e)}}function pv(n){return e=>{const i=e.focusNode.dataset.match(e.focusNode.term,n,e.valueOrNode.term);e.test(i.size===0,me.DisjointConstraintComponent,{args:{disjoint:n},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})}}function gv(n){const e=n.ptr.out([me.equals]).term;return{node:mv(e),property:_v(e)}}function mv(n){return e=>{const i=e.focusNode.out([n]),r=i.filter(a=>!a.term.equals(e.focusNode.term)),o=i.terms.length!==0&&r.terms.length===0;e.test(o,me.EqualsConstraintComponent,{args:{equals:n},message:[e.factory.literal("Must have same values as {$equals}")],value:r.terms[0]&&e.focusNode.node([r.terms[0]])||e.focusNode})}}function _v(n){return e=>{const i=new Gt(e.focusNode.out([n]).terms),r=new Gt(e.values.terms),o=[...r].filter(u=>!i.has(u)),a=[...i].filter(u=>!r.has(u)),l=[...o,...a];for(const u of l)e.violation(me.EqualsConstraintComponent,{args:{equals:n},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([u])});l.length===0&&e.debug(me.EqualsConstraintComponent,{args:{equals:n},message:[e.factory.literal("Must have same values as {$equals}")]})}}function yv(n){const e=n.ptr.out([me.lessThan]).term;return{property:vv(e)}}function vv(n){return e=>{const i=e.focusNode.out([n]).terms;for(const r of e.values)for(const o of i){const a=Vn(r.term,o);a===null||a>=0?e.violation(me.LessThanConstraintComponent,{args:{lessThan:n},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r}):e.debug(me.LessThanConstraintComponent,{args:{lessThan:n},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r})}}}function bv(n){const e=n.ptr.out([me.lessThanOrEquals]).term;return{property:wv(e)}}function wv(n){return e=>{const i=e.focusNode.out([n]).terms;for(const r of e.values)for(const o of i){const a=Vn(r.term,o);a===null||a>0?e.violation(me.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:n},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r}):e.debug(me.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:n},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r})}}}function xv(n){const e=n.ptr.out([me.maxExclusive]).term;return{generic:Ev(e)}}function Ev(n){return e=>{const i=Vn(e.valueOrNode.term,n);e.test(i!==null&&i<0,me.MaxExclusiveConstraintComponent,{args:{maxExclusive:n},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})}}function Sv(n){const e=n.ptr.out([me.maxInclusive]).term;return{generic:Tv(e)}}function Tv(n){return e=>{const i=Vn(e.valueOrNode.term,n);e.test(i!==null&&i<=0,me.MaxInclusiveConstraintComponent,{args:{maxInclusive:n},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})}}function Lv(n){const e=n.ptr.out([me.minExclusive]).term;return{generic:Iv(e)}}function Iv(n){return e=>{const i=Vn(e.valueOrNode.term,n);e.test(i!==null&&i>0,me.MinExclusiveConstraintComponent,{args:{minExclusive:n},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})}}function Av(n){const e=n.ptr.out([me.minInclusive]).term;return{generic:Nv(e)}}function Nv(n){return e=>{const i=Vn(e.valueOrNode.term,n);e.test(i!==null&&i>=0,me.MinInclusiveConstraintComponent,{args:{minInclusive:n},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})}}function Rv(n){const e=[...n.ptr.out([me.node])].map(i=>n.validator.shape(i));return{generic:Pv(e)}}function Pv(n){return async e=>{for(const i of n){const r=await i.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(r.report.conforms,me.NodeConstraintComponent,{args:{node:i.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:r.report.results,value:e.valueOrNode})}}}function Cv(n){const e=[...n.ptr.out([me.property])].map(i=>n.validator.shape(i));return{generic:Dv(e)}}function Dv(n){return async e=>{const i=e.create({focusNode:e.valueOrNode});for(const r of n)await r.validate(i)}}function kv(n){const e=n.validator.shape(n.ptr.out([me.qualifiedValueShape])),i=n.ptr.out([me.qualifiedValueShapesDisjoint]).term,r=i?zr.fromRdf(i):!1,o=n.ptr.out([me.qualifiedMaxCount]).term,a=o?parseInt(o.value):null,l=n.ptr.out([me.qualifiedMinCount]).term,u=l?parseInt(l.value):null;return{property:Mv(e,r,a,u)}}function Mv(n,e,i,r){return async o=>{const a=[];let l=[];e&&(l=new Set(o.shape.ptr.in([me.property]).out([me.property]).out([me.qualifiedValueShape]).filter(f=>!f.term.equals(n.ptr.term)).map(f=>o.shape.validator.shape(f))));const u=(await Jy(o.values,async f=>{const d=(await n.validate(o.create({child:!0,focusNode:f}))).report;if(a.push(d.results),!d.conforms)return!1;if(l.length===0)return!0;if(o.options.debug||o.options.details){const g=await Qs([...l],async _=>(await _.validate(o.create({child:!0,focusNode:f}))).report);return a.push(g.flatMap(_=>_.results)),!g.every(_=>_.conforms)}else return!await Xy([...l],async g=>(await g.validate(o.create({child:!0,focusNode:f}))).report.conforms)})).length;i!==null&&o.test(u<=i,me.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:i,qualifiedValueShape:n.ptr.term,qualifiedValueShapesDisjoint:e},message:[o.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:a.flat()}),r!==null&&o.test(u>=r,me.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:n.ptr.term,qualifiedValueShapesDisjoint:e},message:[o.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:a.flat()})}}function Ov(n,e){return e?e.slice(0,n.length)===n:!1}function Fv(n){const e=[...new Set([...n.ptr.out([me.languageIn]).list()].map(i=>i.value))];return{generic:jv(e)}}function jv(n){return e=>{const i=n.some(r=>Ov(r,e.valueOrNode.term.language));e.test(i,me.LanguageInConstraintComponent,{args:{languageIn:n.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})}}function $v(n){const e=parseInt(n.ptr.out([me.maxLength]).value);return{generic:Bv(e)}}function Bv(n){return e=>{const i=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length<=n;e.test(i,me.MaxLengthConstraintComponent,{args:{maxLength:n},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})}}function qv(n){const e=parseInt(n.ptr.out([me.minLength]).value);return{generic:zv(e)}}function zv(n){return e=>{const i=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length>=n;e.test(i,me.MinLengthConstraintComponent,{args:{minLength:n},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})}}function Uv(n){const e=n.ptr.out([me.pattern]).value,i=n.ptr.out([me.flags]).value,r=new RegExp(e,i);return{generic:Hv(e,i,r)}}function Hv(n,e,i){return r=>{r.test(i.test(r.valueOrNode.term.value),me.PatternConstraintComponent,{args:{flags:e,pattern:n},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}function Vv(n){const e=n.ptr.out([me.uniqueLang]).term;return e.value==="true"&&eu.boolean.equals(e.datatype)?{property:Wv()}:null}function Wv(){return n=>{const i=Object.entries(n.values.terms.reduce((r,o)=>(o.language&&(r[o.language]=(r[o.language]||0)+1),r),{})).filter(([,r])=>r>1);for(const[r]of i)n.violation(me.UniqueLangConstraintComponent,{args:{lang:r},message:[n.factory.literal('Language "{?lang}" used more than once')]});i.length===0&&n.debug(me.UniqueLangConstraintComponent)}}const Cs=Xt("http://www.w3.org/ns/shacl#"),Yf=Xt("https://schemas.link/shacl-next#");class qn{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(Cs.Info)||e.severity.equals(Cs.Violation)||e.severity.equals(Cs.Warning))}}function Gv(n,e){return Object.entries(e).reduce((i,[r,o])=>(o&&o.termType&&(o=Ft(o)),i.replace(`{$${r}}`,o).replace(`{?${r}}`,o)),n)}class $s{constructor({args:e={},factory:i,message:r=[],severity:o=Cs.Violation}={}){this.severity=o,this.message=r.map(a=>i.literal(Gv(a.value,e),a.language||null))}}class iu{constructor({factory:e=Yl}={}){this.factory=e}clone({factory:e}={}){return new iu({factory:e||this.factory})}validate(){return new qn}validateSimple(){return!0}}class Wn extends iu{constructor({datatypes:e,factory:i}={}){super({factory:i}),this.datatypes=[];for(const r of Array.isArray(e)?e:[e])r&&this.datatypes.push(this.factory.fromTerm(r))}clone({factory:e}={}){return new Wn({datatypes:this.datatypes,factory:e||this.factory})}}class Zv{constructor({factory:e=Yl,validations:i}={}){if(this.factory=e,this.validations=new Hn,i)for(const r of Object.values(i)){const o=r.clone({factory:this.factory});for(const a of o.datatypes)this.validations.set(a,o)}}validate(e){const i=this.validations.get(e.datatype);return i?i.validate(e):new qn}validateSimple(e){const i=this.validations.get(e.datatype);return i?i.validateSimple(e):!0}}class at extends Wn{constructor(e,i,{factory:r}={}){super({datatypes:i,factory:r}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new at(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const i=this.patterns.map(r=>{let o;r.test(e.value)&&(o=Yf.Debug);const a={pattern:this.factory.literal(r.toString()),this:e};return new $s({args:a,factory:this.factory,message:this.message,severity:o})});return new qn({results:i})}validateSimple(e){return this.patterns.every(i=>i.test(e.value))}}const Xv=/^([-+]?[0-9]+)$/;class Dt extends at{constructor(e=null,i=null,r,{factory:o}={}){super(Xv,r,{factory:o}),this.maxInclusive=null,this.minInclusive=null,typeof i=="string"&&(this.maxInclusive=BigInt(i)),typeof e=="string"&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){return new Dt(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const i=super.validate(e).results;if(!Yf.Debug.equals(i[0].severity))return new qn({results:i});const r=BigInt(e.value);if(this.minInclusive!==null&&r<this.minInclusive){const o=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,a=[this.factory.literal(o)];i.push(new $s({factory:this.factory,message:a}))}if(this.maxInclusive!==null&&r>this.maxInclusive){const o=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,a=[this.factory.literal(o)];i.push(new $s({factory:this.factory,message:a}))}return new qn({results:i})}validateSimple(e){if(!super.validateSimple(e))return!1;const i=BigInt(e.value);return!(this.minInclusive!==null&&i<this.minInclusive||this.maxInclusive!==null&&i>this.maxInclusive)}}class nu extends Wn{constructor(e,i,{factory:r}={}){super({datatypes:i,factory:r}),this.values=new Set(e)}clone({factory:e}={}){return new nu(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const i=[];if(!this.values.has(e.value)){const r=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,o=[this.factory.literal(r)];i.push(new $s({factory:this.factory,message:o}))}return new qn({results:i})}validateSimple(e){return this.values.has(e.value)}}const Ve={xsd:Xt("http://www.w3.org/2001/XMLSchema#")},Jv=new Wn({datatypes:Ve.xsd.anySimpleType}),Qv=new Wn({datatypes:Ve.xsd.anyAtomicType}),Ks=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,Kv=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,ep=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,ru=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,tp=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Yv=/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,eb=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,tb=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,ib=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,nb=/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,rb=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,sb=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,ob=/^(([0-9a-fA-F]{2})*)$/,ab=/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,lb=new at(Ks,Ve.xsd.string),ub=new nu(["1","true","0","false"],Ve.xsd.boolean),cb=new at(Kv,Ve.xsd.decimal),hb=new at(ep,Ve.xsd.float),db=new at(ep,Ve.xsd.double),fb=new at(ru,Ve.xsd.duration),pb=new at(tp,Ve.xsd.dateTime),gb=new at(Yv,Ve.xsd.time),mb=new at(eb,Ve.xsd.date),_b=new at(tb,Ve.xsd.gYearMonth),yb=new at(ib,Ve.xsd.gYear),vb=new at(nb,Ve.xsd.gMonthDay),bb=new at(rb,Ve.xsd.gDay),wb=new at(sb,Ve.xsd.gMonth),xb=new at(ob,Ve.xsd.hexBinary),Eb=new at(ab,Ve.xsd.base64Binary),Sb=new at(Ks,Ve.xsd.anyURI),ip=/^([^\u000d\u000a\u0009]*)$/,Tb=/^([^ ]+( [^ ]+)*)*$/,Lb=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Ib=/^([^DT]*)$/,Ab=/^([^YM]*[DT].*)$/,Nb=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,Rb=new at([Ks,ip],Ve.xsd.normalizedString),Pb=new at([Ks,ip,Tb],Ve.xsd.token),Cb=new at(Lb,Ve.xsd.language),Db=new Dt(null,null,Ve.xsd.integer),kb=new Dt(null,"0",Ve.xsd.nonPositiveInteger),Mb=new Dt(null,"-1",Ve.xsd.negativeInteger),Ob=new Dt("-9223372036854775808","9223372036854775807",Ve.xsd.long),Fb=new Dt("-2147483648","2147483647",Ve.xsd.int),jb=new Dt("-32768","32767",Ve.xsd.short),$b=new Dt("-128","127",Ve.xsd.byte),Bb=new Dt("0",null,Ve.xsd.nonNegativeInteger),qb=new Dt("0","18446744073709551615",Ve.xsd.unsignedLong),zb=new Dt("0","4294967295",Ve.xsd.unsignedInt),Ub=new Dt("0","65535",Ve.xsd.unsignedShort),Hb=new Dt("0","255",Ve.xsd.unsignedByte),Vb=new Dt("1",null,Ve.xsd.positiveInteger),Wb=new at([ru,Ib],Ve.xsd.yearMonthDuration),Gb=new at([ru,Ab],Ve.xsd.dayTimeDuration),Zb=new at([tp,Nb],Ve.xsd.dateTimeStamp),Xb=Object.freeze(Object.defineProperty({__proto__:null,anyAtomicType:Qv,anySimpleType:Jv,anyURI:Sb,base64Binary:Eb,boolean:ub,byte:$b,date:mb,dateTime:pb,dateTimeStamp:Zb,dayTimeDuration:Gb,decimal:cb,double:db,duration:fb,float:hb,gDay:bb,gMonth:wb,gMonthDay:vb,gYear:yb,gYearMonth:_b,hexBinary:xb,int:Fb,integer:Db,language:Cb,long:Ob,negativeInteger:Mb,nonNegativeInteger:Bb,nonPositiveInteger:kb,normalizedString:Rb,positiveInteger:Vb,short:jb,string:lb,time:gb,token:Pb,unsignedByte:Hb,unsignedInt:zb,unsignedLong:qb,unsignedShort:Ub,yearMonthDuration:Wb},Symbol.toStringTag,{value:"Module"}));class Jb extends Zv{constructor({factory:e}={}){super({factory:e,validations:{...Xb}})}}const Qb=new Hn([[me.BlankNode,new Set(["BlankNode"])],[me.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[me.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[me.IRI,new Set(["NamedNode"])],[me.IRIOrLiteral,new Set(["NamedNode","Literal"])],[me.Literal,new Set(["Literal"])]]);function Kb(n){const e=n.ptr.out([me.class]).map(i=>Sl(i));return{generic:Yb(e)}}function Yb(n){return e=>{const i=new Gt(e.valueOrNode.out([_n.type]).terms);for(const r of n){const o=[...i].some(a=>r.has(a));e.test(o,me.ClassConstraintComponent,{value:e.valueOrNode})}}}function ew(n){const e=n.ptr.out([me.datatype]).term,i=new Jb;return{generic:tw(e,i)}}function tw(n,e){return i=>{const r=n.equals(i.valueOrNode.term.datatype)&&e.validateSimple(i.valueOrNode.term);i.test(r,me.DatatypeConstraintComponent,{args:{datatype:n},message:[i.factory.literal("Value does not have datatype {$datatype}")],value:i.valueOrNode})}}function iw(n){const e=n.ptr.out([me.nodeKind]).term,i=Qb.get(e);return{generic:nw(e,i)}}function nw(n,e){return i=>{i.test(e.has(i.valueOrNode.term.termType),me.NodeKindConstraintComponent,{args:{nodeKind:n},message:[i.factory.literal("Value does not have node kind {$nodeKind}")],value:i.valueOrNode})}}const rw=new Hn([[me.maxCount,Vy],[me.minCount,Gy],[me.and,Ky],[me.not,ev],[me.or,iv],[me.xone,rv],[me.closed,ov],[me.hasValue,lv],[me.in,hv],[me.disjoint,fv],[me.equals,gv],[me.lessThan,yv],[me.lessThanOrEquals,bv],[me.maxExclusive,xv],[me.maxInclusive,Sv],[me.minExclusive,Lv],[me.minInclusive,Av],[me.node,Rv],[me.property,Cv],[me.qualifiedValueShape,kv],[me.languageIn,Fv],[me.maxLength,$v],[me.minLength,qv],[me.pattern,Uv],[me.uniqueLang,Vv],[me.class,Kb],[me.datatype,ew],[me.nodeKind,iw]]);class sw{constructor(e,{factory:i,...r}){if(this.factory=i,this.options=r,this.registry=new Dy(rw),this.shapesPtr=new js({dataset:e,factory:i}),this.shapes=new Hn,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[a,l]of this.options.validations)this.registry.validations.set(a,l);const o=[...this.shapesPtr.hasOut([me.targetClass]),...this.shapesPtr.hasOut([me.targetNode]),...this.shapesPtr.hasOut([me.targetObjectsOf]),...this.shapesPtr.hasOut([me.targetSubjectsOf]),...this.shapesPtr.hasOut([_n.type],[me.NodeShape]),...this.shapesPtr.hasOut([_n.type],[me.PropertyShape])];for(const a of o)this.shape(a)}shape(e){if(!e.term)return null;let i=this.shapes.get(e.term);return i||(i=new Hy(e,{validator:this}),this.shapes.set(e.term,i)),i}async validate(e,i){const r=new js({...e,factory:this.factory}),o=new tu({factory:this.factory,focusNode:r,options:this.options,validator:this});i?i=i.map(a=>this.shape(this.shapesPtr.node(a.terms))):i=this.shapes.values();for(const a of i){const l=o.create({shape:a});let u;r.isAny()?u=a.resolveTargets(l):u=r;for(const f of u)await a.validate(l.create({focusNode:f}))}return o.report}}const ow=`
|
|
401
401
|
.editor:not([type='checkbox']) { border: 1px solid #DDD; }
|
|
402
402
|
.property-instance label { display: inline-flex; word-break: break-word; line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }
|
|
403
403
|
.property-instance:not(:first-child) > label:not(.persistent) { visibility: hidden; max-height: 0; }
|
|
404
404
|
.mode-edit .property-instance label { width: var(--label-width); }
|
|
405
|
-
`;class
|
|
406
|
-
:scope shacl-node[data-node-id='${
|
|
407
|
-
:scope shacl-node[data-node-id='${
|
|
408
|
-
:scope shacl-node[data-node-id='${
|
|
409
|
-
:scope shacl-node[data-node-id='${
|
|
410
|
-
:scope [data-node-id='${
|
|
411
|
-
:scope [data-node-id='${
|
|
412
|
-
`;else
|
|
405
|
+
`;class aw extends Vg{constructor(e){super(e||ow),this.idCtr=0}createDefaultTemplate(e,i,r,o,a){o.id=`e${this.idCtr++}`,o.classList.add("editor"),a?.datatype?o.shaclDatatype=a.datatype:i instanceof ii&&(o.shaclDatatype=i.datatype),a?.minCount!==void 0&&(o.dataset.minCount=String(a.minCount)),a?.class&&(o.dataset.class=a.class.value),a?.nodeKind?o.dataset.nodeKind=a.nodeKind.value:i instanceof kn&&(o.dataset.nodeKind=je+"IRI"),(a?.hasValue||a?.readonly)&&(o.disabled=!0),o.value=i?.value||a?.defaultValue?.value||"";const l=document.createElement("label");l.htmlFor=o.id,l.innerText=e,a?.description&&l.setAttribute("title",a.description.value);const u=a?.description?a.description.value:a?.pattern?a.pattern:null;u&&o.setAttribute("placeholder",u),r&&(o.setAttribute("required","true"),l.classList.add("required"));const f=document.createElement("div");return f.appendChild(l),f.appendChild(o),f}createDateEditor(e,i,r,o){const a=new ft;o.datatype?.value===qi+"dateTime"?(a.type="datetime-local",a.setAttribute("step","1")):a.type="date",a.clearable=!0,a.dense=!0,a.classList.add("pr-0");const l=this.createDefaultTemplate(e,null,r,a,o);if(i)try{let u=new Date(i.value).toISOString();o.datatype?.value===qi+"dateTime"?u=u.slice(0,19):u=u.slice(0,10),a.value=u}catch(u){console.error(u,i)}return l}createTextEditor(e,i,r,o){let a;return o.singleLine===!1?(a=new pn,a.resize="auto"):a=new ft,a.dense=!0,o.pattern&&(a.pattern=o.pattern),o.minLength&&(a.minLength=o.minLength),o.maxLength&&(a.maxLength=o.maxLength),this.createDefaultTemplate(e,i,r,a,o)}createLangStringEditor(e,i,r,o){const a=this.createTextEditor(e,i,r,o),l=a.querySelector(":scope .editor");let u;if(o.languageIn?.length){u=document.createElement("select");for(const f of o.languageIn){const d=document.createElement("option");d.innerText=f.value,u.appendChild(d)}}else u=document.createElement("input"),u.maxLength=5,u.size=5,u.placeholder="lang?";return u.title="Language of the text",u.classList.add("lang-chooser"),u.slot="suffix",u.addEventListener("change",f=>{f.stopPropagation(),l&&(l.dataset.lang=u.value,l.dispatchEvent(new Event("change",{bubbles:!0})))}),i instanceof ii&&(u.value=i.language),l.dataset.lang=u.value,l.appendChild(u),a}createBooleanEditor(e,i,r,o){const a=document.createElement("input");a.type="checkbox",a.classList.add("ml-0");const l=this.createDefaultTemplate(e,null,r,a,o);return a.removeAttribute("required"),l.querySelector(":scope label")?.classList.remove("required"),i instanceof ii&&(a.checked=i.value==="true"),l}createFileEditor(e,i,r,o){const a=document.createElement("input");return a.type="file",a.addEventListener("change",l=>{if(a.files?.length){l.stopPropagation();const u=new FileReader;u.readAsDataURL(a.files[0]),u.onload=()=>{a.binaryData=btoa(u.result),a.parentElement?.dispatchEvent(new Event("change",{bubbles:!0}))}}else a.binaryData=void 0}),this.createDefaultTemplate(e,i,r,a,o)}createNumberEditor(e,i,r,o){const a=new ft;a.type="number",a.clearable=!0,a.dense=!0,a.classList.add("pr-0");const l=o.minInclusive!==void 0?o.minInclusive:o.minExclusive!==void 0?o.minExclusive+1:void 0,u=o.maxInclusive!==void 0?o.maxInclusive:o.maxExclusive!==void 0?o.maxExclusive-1:void 0;return l!==void 0&&(a.min=String(l)),u!==void 0&&(a.max=String(u)),o.datatype?.value!==qi+"integer"&&(a.step="0.1"),this.createDefaultTemplate(e,i,r,a,o)}createListEditor(e,i,r,o,a){const l=new vt;l.clearable=!0,l.dense=!0;const u=this.createDefaultTemplate(e,null,r,l,a),f=document.createElement("ul");let d=!0;const g=(_,h)=>{const m=document.createElement("li");if(typeof _.value=="string"?(m.dataset.value=_.value,m.innerText=_.label?_.label:_.value):(m.dataset.value=_.value.id,_.value instanceof kn&&(m.dataset.value="<"+m.dataset.value+">"),m.innerText=_.label?_.label:_.value.value),h.appendChild(m),_.children?.length){d=!1;const b=document.createElement("ul");m.appendChild(b);for(const T of _.children)g(T,b)}};for(const _ of o)g(_,f);return d||(l.collapse=!0),l.appendChild(f),i&&(l.value=i.id,i instanceof kn&&(l.value="<"+l.value+">")),u}createButton(e,i){const r=document.createElement("rokit-button");return r.innerHTML=e,r}}class lw extends HTMLElement{constructor(){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new sd(new aw,this.form),this.form.addEventListener("change",e=>{e.stopPropagation(),this.config.editMode&&this.validate(!0).then(i=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:i.conforms,report:i}}))}).catch(i=>{console.warn(i)})})}static get observedAttributes(){return sd.dataAttributes()}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.setAttribute("loading",""),this.form.replaceChildren(document.createTextNode(this.config.attributes.loading)),this.initDebounceTimeout=setTimeout(async()=>{try{await this.config.loader.loadGraphs(),this.form.replaceChildren(),this.config.renderedNodes.clear();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach(r=>{this.form.classList.remove(r)}),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const i=[this.config.theme.stylesheet];for(const r of Qg())r.stylesheet&&i.push(r.stylesheet);if(this.shadowRoot.adoptedStyleSheets=i,this.shape=new zi(e,this.config,this.config.attributes.valuesSubject?ze.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(this.config.attributes.submitButton!==null){const r=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);r.addEventListener("click",o=>{o.preventDefault(),this.form.reportValidity()&&this.validate().then(a=>{if(a?.conforms)this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0}));else{let l=this.form.querySelector(":scope .invalid > .editor");l?l.focus():this.form.querySelector(":scope .invalid")?.scrollIntoView()}})}),this.form.appendChild(r)}this.config.attributes.valuesSubject&&this.removeFromDataGraph(ze.namedNode(this.config.attributes.valuesSubject)),await this.validate(!0)}}else if(this.config.store.countQuads(null,null,null,Dr)>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const i=document.createElement("div");i.innerText=String(e),this.form.replaceChildren(i)}this.removeAttribute("loading")},200)}serialize(e="text/turtle",i=this.toRDF()){const r=i.getQuads(null,null,null,null);return Gg(r,e,this.config.prefixes)}toRDF(e=new Lt){return this.shape?.toRDF(e),e}registerPlugin(e){Jg(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}async validate(e=!1){for(const i of this.form.querySelectorAll(":scope .validation-error"))i.remove();for(const i of this.form.querySelectorAll(":scope .property-instance"))i.classList.remove("invalid"),i.querySelector(":scope > .editor")?.value?i.classList.add("valid"):i.classList.remove("valid");this.config.store.deleteGraph(this.config.valuesGraphId||""),this.shape&&(this.shape.toRDF(this.config.store),this.config.store.add(new Bs(this.shape.shaclSubject,ze.namedNode(je+"targetNode"),this.shape.nodeId,this.config.valuesGraphId)));try{const i=this.config.store,r=await new sw(i,{details:!0,factory:ze}).validate({dataset:i});for(const o of r.results)if(o.focusNode?.ptrs?.length)for(const a of o.focusNode.ptrs){const l=a._term;if(o.path?.length){const u=o.path[0].predicates[0];let f=this.form.querySelectorAll(`
|
|
406
|
+
:scope shacl-node[data-node-id='${l.id}'] > shacl-property > .property-instance[data-path='${u.id}'] > .editor,
|
|
407
|
+
:scope shacl-node[data-node-id='${l.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${u.id}'] > .editor,
|
|
408
|
+
:scope shacl-node[data-node-id='${l.id}'] > .shacl-group > shacl-property > .property-instance[data-path='${u.id}'] > .editor,
|
|
409
|
+
:scope shacl-node[data-node-id='${l.id}'] > .shacl-group > shacl-property > .shacl-group > .property-instance[data-path='${u.id}'] > .editor`);f.length===0&&(f=this.form.querySelectorAll(`
|
|
410
|
+
:scope [data-node-id='${l.id}'] > shacl-property > .property-instance[data-path='${u.id}'],
|
|
411
|
+
:scope [data-node-id='${l.id}'] > shacl-property > .shacl-group > .property-instance[data-path='${u.id}']`));for(const d of f)if(d.classList.contains("editor")){if(!e||d.value){let g=d.parentElement;g.classList.add("invalid"),g.classList.remove("valid"),g.appendChild(this.createValidationErrorDisplay(o));do g instanceof Pt&&(g.open=!0),g=g.parentElement;while(g)}}else e||(d.classList.add("invalid"),d.classList.remove("valid"),d.appendChild(this.createValidationErrorDisplay(o,"node")))}else e||this.form.querySelector(`:scope [data-node-id='${l.id}']`)?.prepend(this.createValidationErrorDisplay(o,"node"))}return r}catch(i){return console.error(i),!1}}createValidationErrorDisplay(e,i){const r=document.createElement("span");if(r.classList.add("validation-error"),i&&r.classList.add(i),e)if(e.message?.length>0)for(const o of e.message)r.title+=o.value+`
|
|
412
|
+
`;else r.title=e.sourceConstraintComponent?.value;return r}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=ze.namedNode(this.config.attributes.shapeSubject),this.config.store.getQuads(e,It,vs,null).length===0){console.warn(`shapes graph does not contain requested root shape ${this.config.attributes.shapeSubject}`);return}}else if(this.config.attributes.valuesSubject&&this.config.store.countQuads(null,null,null,xi)>0){const i=ze.namedNode(this.config.attributes.valuesSubject),r=[...this.config.store.getQuads(i,It,null,xi),...this.config.store.getQuads(i,gl,null,xi)];if(r.length===0){console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${It.id} nor ${gl.id} statement`);return}for(const o of r)if(this.config.store.getQuads(o.object,It,vs,null).length>0){e=o.object;break}if(!e){const o=this.config.store.getQuads(null,Mn,r[0].object,null);if(o.length===0){console.error(`value subject '${this.config.attributes.valuesSubject}' has no shacl shape definition in the shapes graph`);return}if(o.length>1&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has multiple shacl shape definitions in the shapes graph, choosing the first found (${o[0].subject})`),this.config.store.getQuads(o[0].subject,It,vs,null).length===0){console.error(`value subject '${this.config.attributes.valuesSubject}' references a shape which is not a NodeShape (${o[0].subject})`);return}e=o[0].subject}}else{const i=this.config.store.getQuads(null,It,vs,null);if(i.length==0){console.warn("shapes graph does not contain any root shapes");return}i.length>1&&(console.warn("shapes graph contains",i.length,"root shapes. choosing first found which is",i[0].subject.value),console.info('hint: set the shape to use with attribute "data-shape-subject"')),e=i[0].subject}return e}removeFromDataGraph(e){this.config.attributes.valuesSubject;for(const i of this.config.store.getQuads(e,null,null,xi))this.config.store.delete(i),(i.object.termType==="NamedNode"||i.object.termType==="BlankNode")&&this.removeFromDataGraph(i.object)}}window.customElements.define("shacl-form",lw);var Pr={exports:{}};/* @preserve
|
|
413
|
+
* Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com
|
|
414
|
+
* (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade
|
|
415
|
+
*/var uw=Pr.exports,Ud;function su(){return Ud||(Ud=1,(function(n,e){(function(i,r){r(e)})(uw,(function(i){var r="1.9.4";function o(t){var s,c,p,E;for(c=1,p=arguments.length;c<p;c++){E=arguments[c];for(s in E)t[s]=E[s]}return t}var a=Object.create||(function(){function t(){}return function(s){return t.prototype=s,new t}})();function l(t,s){var c=Array.prototype.slice;if(t.bind)return t.bind.apply(t,c.call(arguments,1));var p=c.call(arguments,2);return function(){return t.apply(s,p.length?p.concat(c.call(arguments)):arguments)}}var u=0;function f(t){return"_leaflet_id"in t||(t._leaflet_id=++u),t._leaflet_id}function d(t,s,c){var p,E,C,ie;return ie=function(){p=!1,E&&(C.apply(c,E),E=!1)},C=function(){p?E=arguments:(t.apply(c,arguments),setTimeout(ie,s),p=!0)},C}function g(t,s,c){var p=s[1],E=s[0],C=p-E;return t===p&&c?t:((t-E)%C+C)%C+E}function _(){return!1}function h(t,s){if(s===!1)return t;var c=Math.pow(10,s===void 0?6:s);return Math.round(t*c)/c}function m(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function b(t){return m(t).split(/\s+/)}function T(t,s){Object.prototype.hasOwnProperty.call(t,"options")||(t.options=t.options?a(t.options):{});for(var c in s)t.options[c]=s[c];return t.options}function A(t,s,c){var p=[];for(var E in t)p.push(encodeURIComponent(c?E.toUpperCase():E)+"="+encodeURIComponent(t[E]));return(!s||s.indexOf("?")===-1?"?":"&")+p.join("&")}var N=/\{ *([\w_ -]+) *\}/g;function R(t,s){return t.replace(N,function(c,p){var E=s[p];if(E===void 0)throw new Error("No value provided for variable "+c);return typeof E=="function"&&(E=E(s)),E})}var S=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function y(t,s){for(var c=0;c<t.length;c++)if(t[c]===s)return c;return-1}var x="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=";function P(t){return window["webkit"+t]||window["moz"+t]||window["ms"+t]}var B=0;function O(t){var s=+new Date,c=Math.max(0,16-(s-B));return B=s+c,window.setTimeout(t,c)}var J=window.requestAnimationFrame||P("RequestAnimationFrame")||O,k=window.cancelAnimationFrame||P("CancelAnimationFrame")||P("CancelRequestAnimationFrame")||function(t){window.clearTimeout(t)};function q(t,s,c){if(c&&J===O)t.call(s);else return J.call(window,l(t,s))}function X(t){t&&k.call(window,t)}var F={__proto__:null,extend:o,create:a,bind:l,get lastId(){return u},stamp:f,throttle:d,wrapNum:g,falseFn:_,formatNum:h,trim:m,splitWords:b,setOptions:T,getParamString:A,template:R,isArray:S,indexOf:y,emptyImageUrl:x,requestFn:J,cancelFn:k,requestAnimFrame:q,cancelAnimFrame:X};function $(){}$.extend=function(t){var s=function(){T(this),this.initialize&&this.initialize.apply(this,arguments),this.callInitHooks()},c=s.__super__=this.prototype,p=a(c);p.constructor=s,s.prototype=p;for(var E in this)Object.prototype.hasOwnProperty.call(this,E)&&E!=="prototype"&&E!=="__super__"&&(s[E]=this[E]);return t.statics&&o(s,t.statics),t.includes&&(ue(t.includes),o.apply(null,[p].concat(t.includes))),o(p,t),delete p.statics,delete p.includes,p.options&&(p.options=c.options?a(c.options):{},o(p.options,t.options)),p._initHooks=[],p.callInitHooks=function(){if(!this._initHooksCalled){c.callInitHooks&&c.callInitHooks.call(this),this._initHooksCalled=!0;for(var C=0,ie=p._initHooks.length;C<ie;C++)p._initHooks[C].call(this)}},s},$.include=function(t){var s=this.prototype.options;return o(this.prototype,t),t.options&&(this.prototype.options=s,this.mergeOptions(t.options)),this},$.mergeOptions=function(t){return o(this.prototype.options,t),this},$.addInitHook=function(t){var s=Array.prototype.slice.call(arguments,1),c=typeof t=="function"?t:function(){this[t].apply(this,s)};return this.prototype._initHooks=this.prototype._initHooks||[],this.prototype._initHooks.push(c),this};function ue(t){if(!(typeof L>"u"||!L||!L.Mixin)){t=S(t)?t:[t];for(var s=0;s<t.length;s++)t[s]===L.Mixin.Events&&console.warn("Deprecated include of L.Mixin.Events: this property will be removed in future releases, please inherit from L.Evented instead.",new Error().stack)}}var D={on:function(t,s,c){if(typeof t=="object")for(var p in t)this._on(p,t[p],s);else{t=b(t);for(var E=0,C=t.length;E<C;E++)this._on(t[E],s,c)}return this},off:function(t,s,c){if(!arguments.length)delete this._events;else if(typeof t=="object")for(var p in t)this._off(p,t[p],s);else{t=b(t);for(var E=arguments.length===1,C=0,ie=t.length;C<ie;C++)E?this._off(t[C]):this._off(t[C],s,c)}return this},_on:function(t,s,c,p){if(typeof s!="function"){console.warn("wrong listener type: "+typeof s);return}if(this._listens(t,s,c)===!1){c===this&&(c=void 0);var E={fn:s,ctx:c};p&&(E.once=!0),this._events=this._events||{},this._events[t]=this._events[t]||[],this._events[t].push(E)}},_off:function(t,s,c){var p,E,C;if(this._events&&(p=this._events[t],!!p)){if(arguments.length===1){if(this._firingCount)for(E=0,C=p.length;E<C;E++)p[E].fn=_;delete this._events[t];return}if(typeof s!="function"){console.warn("wrong listener type: "+typeof s);return}var ie=this._listens(t,s,c);if(ie!==!1){var de=p[ie];this._firingCount&&(de.fn=_,this._events[t]=p=p.slice()),p.splice(ie,1)}}},fire:function(t,s,c){if(!this.listens(t,c))return this;var p=o({},s,{type:t,target:this,sourceTarget:s&&s.sourceTarget||this});if(this._events){var E=this._events[t];if(E){this._firingCount=this._firingCount+1||1;for(var C=0,ie=E.length;C<ie;C++){var de=E[C],ye=de.fn;de.once&&this.off(t,ye,de.ctx),ye.call(de.ctx||this,p)}this._firingCount--}}return c&&this._propagateEvent(p),this},listens:function(t,s,c,p){typeof t!="string"&&console.warn('"string" type argument expected');var E=s;typeof s!="function"&&(p=!!s,E=void 0,c=void 0);var C=this._events&&this._events[t];if(C&&C.length&&this._listens(t,E,c)!==!1)return!0;if(p){for(var ie in this._eventParents)if(this._eventParents[ie].listens(t,s,c,p))return!0}return!1},_listens:function(t,s,c){if(!this._events)return!1;var p=this._events[t]||[];if(!s)return!!p.length;c===this&&(c=void 0);for(var E=0,C=p.length;E<C;E++)if(p[E].fn===s&&p[E].ctx===c)return E;return!1},once:function(t,s,c){if(typeof t=="object")for(var p in t)this._on(p,t[p],s,!0);else{t=b(t);for(var E=0,C=t.length;E<C;E++)this._on(t[E],s,c,!0)}return this},addEventParent:function(t){return this._eventParents=this._eventParents||{},this._eventParents[f(t)]=t,this},removeEventParent:function(t){return this._eventParents&&delete this._eventParents[f(t)],this},_propagateEvent:function(t){for(var s in this._eventParents)this._eventParents[s].fire(t.type,o({layer:t.target,propagatedFrom:t.target},t),!0)}};D.addEventListener=D.on,D.removeEventListener=D.clearAllEventListeners=D.off,D.addOneTimeEventListener=D.once,D.fireEvent=D.fire,D.hasEventListeners=D.listens;var se=$.extend(D);function j(t,s,c){this.x=c?Math.round(t):t,this.y=c?Math.round(s):s}var ae=Math.trunc||function(t){return t>0?Math.floor(t):Math.ceil(t)};j.prototype={clone:function(){return new j(this.x,this.y)},add:function(t){return this.clone()._add(I(t))},_add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.clone()._subtract(I(t))},_subtract:function(t){return this.x-=t.x,this.y-=t.y,this},divideBy:function(t){return this.clone()._divideBy(t)},_divideBy:function(t){return this.x/=t,this.y/=t,this},multiplyBy:function(t){return this.clone()._multiplyBy(t)},_multiplyBy:function(t){return this.x*=t,this.y*=t,this},scaleBy:function(t){return new j(this.x*t.x,this.y*t.y)},unscaleBy:function(t){return new j(this.x/t.x,this.y/t.y)},round:function(){return this.clone()._round()},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},floor:function(){return this.clone()._floor()},_floor:function(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this},ceil:function(){return this.clone()._ceil()},_ceil:function(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this},trunc:function(){return this.clone()._trunc()},_trunc:function(){return this.x=ae(this.x),this.y=ae(this.y),this},distanceTo:function(t){t=I(t);var s=t.x-this.x,c=t.y-this.y;return Math.sqrt(s*s+c*c)},equals:function(t){return t=I(t),t.x===this.x&&t.y===this.y},contains:function(t){return t=I(t),Math.abs(t.x)<=Math.abs(this.x)&&Math.abs(t.y)<=Math.abs(this.y)},toString:function(){return"Point("+h(this.x)+", "+h(this.y)+")"}};function I(t,s,c){return t instanceof j?t:S(t)?new j(t[0],t[1]):t==null?t:typeof t=="object"&&"x"in t&&"y"in t?new j(t.x,t.y):new j(t,s,c)}function Z(t,s){if(t)for(var c=s?[t,s]:t,p=0,E=c.length;p<E;p++)this.extend(c[p])}Z.prototype={extend:function(t){var s,c;if(!t)return this;if(t instanceof j||typeof t[0]=="number"||"x"in t)s=c=I(t);else if(t=ne(t),s=t.min,c=t.max,!s||!c)return this;return!this.min&&!this.max?(this.min=s.clone(),this.max=c.clone()):(this.min.x=Math.min(s.x,this.min.x),this.max.x=Math.max(c.x,this.max.x),this.min.y=Math.min(s.y,this.min.y),this.max.y=Math.max(c.y,this.max.y)),this},getCenter:function(t){return I((this.min.x+this.max.x)/2,(this.min.y+this.max.y)/2,t)},getBottomLeft:function(){return I(this.min.x,this.max.y)},getTopRight:function(){return I(this.max.x,this.min.y)},getTopLeft:function(){return this.min},getBottomRight:function(){return this.max},getSize:function(){return this.max.subtract(this.min)},contains:function(t){var s,c;return typeof t[0]=="number"||t instanceof j?t=I(t):t=ne(t),t instanceof Z?(s=t.min,c=t.max):s=c=t,s.x>=this.min.x&&c.x<=this.max.x&&s.y>=this.min.y&&c.y<=this.max.y},intersects:function(t){t=ne(t);var s=this.min,c=this.max,p=t.min,E=t.max,C=E.x>=s.x&&p.x<=c.x,ie=E.y>=s.y&&p.y<=c.y;return C&&ie},overlaps:function(t){t=ne(t);var s=this.min,c=this.max,p=t.min,E=t.max,C=E.x>s.x&&p.x<c.x,ie=E.y>s.y&&p.y<c.y;return C&&ie},isValid:function(){return!!(this.min&&this.max)},pad:function(t){var s=this.min,c=this.max,p=Math.abs(s.x-c.x)*t,E=Math.abs(s.y-c.y)*t;return ne(I(s.x-p,s.y-E),I(c.x+p,c.y+E))},equals:function(t){return t?(t=ne(t),this.min.equals(t.getTopLeft())&&this.max.equals(t.getBottomRight())):!1}};function ne(t,s){return!t||t instanceof Z?t:new Z(t,s)}function ee(t,s){if(t)for(var c=s?[t,s]:t,p=0,E=c.length;p<E;p++)this.extend(c[p])}ee.prototype={extend:function(t){var s=this._southWest,c=this._northEast,p,E;if(t instanceof G)p=t,E=t;else if(t instanceof ee){if(p=t._southWest,E=t._northEast,!p||!E)return this}else return t?this.extend(W(t)||_e(t)):this;return!s&&!c?(this._southWest=new G(p.lat,p.lng),this._northEast=new G(E.lat,E.lng)):(s.lat=Math.min(p.lat,s.lat),s.lng=Math.min(p.lng,s.lng),c.lat=Math.max(E.lat,c.lat),c.lng=Math.max(E.lng,c.lng)),this},pad:function(t){var s=this._southWest,c=this._northEast,p=Math.abs(s.lat-c.lat)*t,E=Math.abs(s.lng-c.lng)*t;return new ee(new G(s.lat-p,s.lng-E),new G(c.lat+p,c.lng+E))},getCenter:function(){return new G((this._southWest.lat+this._northEast.lat)/2,(this._southWest.lng+this._northEast.lng)/2)},getSouthWest:function(){return this._southWest},getNorthEast:function(){return this._northEast},getNorthWest:function(){return new G(this.getNorth(),this.getWest())},getSouthEast:function(){return new G(this.getSouth(),this.getEast())},getWest:function(){return this._southWest.lng},getSouth:function(){return this._southWest.lat},getEast:function(){return this._northEast.lng},getNorth:function(){return this._northEast.lat},contains:function(t){typeof t[0]=="number"||t instanceof G||"lat"in t?t=W(t):t=_e(t);var s=this._southWest,c=this._northEast,p,E;return t instanceof ee?(p=t.getSouthWest(),E=t.getNorthEast()):p=E=t,p.lat>=s.lat&&E.lat<=c.lat&&p.lng>=s.lng&&E.lng<=c.lng},intersects:function(t){t=_e(t);var s=this._southWest,c=this._northEast,p=t.getSouthWest(),E=t.getNorthEast(),C=E.lat>=s.lat&&p.lat<=c.lat,ie=E.lng>=s.lng&&p.lng<=c.lng;return C&&ie},overlaps:function(t){t=_e(t);var s=this._southWest,c=this._northEast,p=t.getSouthWest(),E=t.getNorthEast(),C=E.lat>s.lat&&p.lat<c.lat,ie=E.lng>s.lng&&p.lng<c.lng;return C&&ie},toBBoxString:function(){return[this.getWest(),this.getSouth(),this.getEast(),this.getNorth()].join(",")},equals:function(t,s){return t?(t=_e(t),this._southWest.equals(t.getSouthWest(),s)&&this._northEast.equals(t.getNorthEast(),s)):!1},isValid:function(){return!!(this._southWest&&this._northEast)}};function _e(t,s){return t instanceof ee?t:new ee(t,s)}function G(t,s,c){if(isNaN(t)||isNaN(s))throw new Error("Invalid LatLng object: ("+t+", "+s+")");this.lat=+t,this.lng=+s,c!==void 0&&(this.alt=+c)}G.prototype={equals:function(t,s){if(!t)return!1;t=W(t);var c=Math.max(Math.abs(this.lat-t.lat),Math.abs(this.lng-t.lng));return c<=(s===void 0?1e-9:s)},toString:function(t){return"LatLng("+h(this.lat,t)+", "+h(this.lng,t)+")"},distanceTo:function(t){return K.distance(this,W(t))},wrap:function(){return K.wrapLatLng(this)},toBounds:function(t){var s=180*t/40075017,c=s/Math.cos(Math.PI/180*this.lat);return _e([this.lat-s,this.lng-c],[this.lat+s,this.lng+c])},clone:function(){return new G(this.lat,this.lng,this.alt)}};function W(t,s,c){return t instanceof G?t:S(t)&&typeof t[0]!="object"?t.length===3?new G(t[0],t[1],t[2]):t.length===2?new G(t[0],t[1]):null:t==null?t:typeof t=="object"&&"lat"in t?new G(t.lat,"lng"in t?t.lng:t.lon,t.alt):s===void 0?null:new G(t,s,c)}var Y={latLngToPoint:function(t,s){var c=this.projection.project(t),p=this.scale(s);return this.transformation._transform(c,p)},pointToLatLng:function(t,s){var c=this.scale(s),p=this.transformation.untransform(t,c);return this.projection.unproject(p)},project:function(t){return this.projection.project(t)},unproject:function(t){return this.projection.unproject(t)},scale:function(t){return 256*Math.pow(2,t)},zoom:function(t){return Math.log(t/256)/Math.LN2},getProjectedBounds:function(t){if(this.infinite)return null;var s=this.projection.bounds,c=this.scale(t),p=this.transformation.transform(s.min,c),E=this.transformation.transform(s.max,c);return new Z(p,E)},infinite:!1,wrapLatLng:function(t){var s=this.wrapLng?g(t.lng,this.wrapLng,!0):t.lng,c=this.wrapLat?g(t.lat,this.wrapLat,!0):t.lat,p=t.alt;return new G(c,s,p)},wrapLatLngBounds:function(t){var s=t.getCenter(),c=this.wrapLatLng(s),p=s.lat-c.lat,E=s.lng-c.lng;if(p===0&&E===0)return t;var C=t.getSouthWest(),ie=t.getNorthEast(),de=new G(C.lat-p,C.lng-E),ye=new G(ie.lat-p,ie.lng-E);return new ee(de,ye)}},K=o({},Y,{wrapLng:[-180,180],R:6371e3,distance:function(t,s){var c=Math.PI/180,p=t.lat*c,E=s.lat*c,C=Math.sin((s.lat-t.lat)*c/2),ie=Math.sin((s.lng-t.lng)*c/2),de=C*C+Math.cos(p)*Math.cos(E)*ie*ie,ye=2*Math.atan2(Math.sqrt(de),Math.sqrt(1-de));return this.R*ye}}),oe=6378137,ce={R:oe,MAX_LATITUDE:85.0511287798,project:function(t){var s=Math.PI/180,c=this.MAX_LATITUDE,p=Math.max(Math.min(c,t.lat),-c),E=Math.sin(p*s);return new j(this.R*t.lng*s,this.R*Math.log((1+E)/(1-E))/2)},unproject:function(t){var s=180/Math.PI;return new G((2*Math.atan(Math.exp(t.y/this.R))-Math.PI/2)*s,t.x*s/this.R)},bounds:(function(){var t=oe*Math.PI;return new Z([-t,-t],[t,t])})()};function Ee(t,s,c,p){if(S(t)){this._a=t[0],this._b=t[1],this._c=t[2],this._d=t[3];return}this._a=t,this._b=s,this._c=c,this._d=p}Ee.prototype={transform:function(t,s){return this._transform(t.clone(),s)},_transform:function(t,s){return s=s||1,t.x=s*(this._a*t.x+this._b),t.y=s*(this._c*t.y+this._d),t},untransform:function(t,s){return s=s||1,new j((t.x/s-this._b)/this._a,(t.y/s-this._d)/this._c)}};function Te(t,s,c,p){return new Ee(t,s,c,p)}var z=o({},K,{code:"EPSG:3857",projection:ce,transformation:(function(){var t=.5/(Math.PI*ce.R);return Te(t,.5,-t,.5)})()}),te=o({},z,{code:"EPSG:900913"});function fe(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function we(t,s){var c="",p,E,C,ie,de,ye;for(p=0,C=t.length;p<C;p++){for(de=t[p],E=0,ie=de.length;E<ie;E++)ye=de[E],c+=(E?"L":"M")+ye.x+" "+ye.y;c+=s?De.svg?"z":"x":""}return c||"M0 0"}var Se=document.documentElement.style,Ie="ActiveXObject"in window,re=Ie&&!document.addEventListener,ve="msLaunchUri"in navigator&&!("documentMode"in document),Ne=Nt("webkit"),xe=Nt("android"),ke=Nt("android 2")||Nt("android 3"),lt=parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1],10),We=xe&&Nt("Google")&<<537&&!("AudioNode"in window),nt=!!window.opera,M=!ve&&Nt("chrome"),v=Nt("gecko")&&!Ne&&!nt&&!Ie,w=!M&&Nt("safari"),H=Nt("phantom"),le="OTransition"in Se,pe=navigator.platform.indexOf("Win")===0,be=Ie&&"transition"in Se,Oe="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix&&!ke,Ye="MozPerspective"in Se,Je=!window.L_DISABLE_3D&&(be||Oe||Ye)&&!le&&!H,Ge=typeof orientation<"u"||Nt("mobile"),Ze=Ge&&Ne,Ot=Ge&&Oe,Jt=!window.PointerEvent&&window.MSPointerEvent,ot=!!(window.PointerEvent||Jt),ut="ontouchstart"in window||!!window.TouchEvent,vn=!window.L_NO_TOUCH&&(ut||ot),ai=Ge&&nt,Ri=Ge&&v,Wi=(window.devicePixelRatio||window.screen.deviceXDPI/window.screen.logicalXDPI)>1,U=(function(){var t=!1;try{var s=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("testPassiveEventSupport",_,s),window.removeEventListener("testPassiveEventSupport",_,s)}catch{}return t})(),Q=(function(){return!!document.createElement("canvas").getContext})(),Ae=!!(document.createElementNS&&fe("svg").createSVGRect),Re=!!Ae&&(function(){var t=document.createElement("div");return t.innerHTML="<svg/>",(t.firstChild&&t.firstChild.namespaceURI)==="http://www.w3.org/2000/svg"})(),Me=!Ae&&(function(){try{var t=document.createElement("div");t.innerHTML='<v:shape adj="1"/>';var s=t.firstChild;return s.style.behavior="url(#default#VML)",s&&typeof s.adj=="object"}catch{return!1}})(),mt=navigator.platform.indexOf("Mac")===0,bt=navigator.platform.indexOf("Linux")===0;function Nt(t){return navigator.userAgent.toLowerCase().indexOf(t)>=0}var De={ie:Ie,ielt9:re,edge:ve,webkit:Ne,android:xe,android23:ke,androidStock:We,opera:nt,chrome:M,gecko:v,safari:w,phantom:H,opera12:le,win:pe,ie3d:be,webkit3d:Oe,gecko3d:Ye,any3d:Je,mobile:Ge,mobileWebkit:Ze,mobileWebkit3d:Ot,msPointer:Jt,pointer:ot,touch:vn,touchNative:ut,mobileOpera:ai,mobileGecko:Ri,retina:Wi,passiveEvents:U,canvas:Q,svg:Ae,vml:Me,inlineSvg:Re,mac:mt,linux:bt},Gi=De.msPointer?"MSPointerDown":"pointerdown",zt=De.msPointer?"MSPointerMove":"pointermove",Pi=De.msPointer?"MSPointerUp":"pointerup",gi=De.msPointer?"MSPointerCancel":"pointercancel",li={touchstart:Gi,touchmove:zt,touchend:Pi,touchcancel:gi},Ci={touchstart:Ys,touchmove:Qt,touchend:Qt,touchcancel:Qt},rt={},V=!1;function he(t,s,c){return s==="touchstart"&&wt(),Ci[s]?(c=Ci[s].bind(this,c),t.addEventListener(li[s],c,!1),c):(console.warn("wrong event specified:",s),_)}function ge(t,s,c){if(!li[s]){console.warn("wrong event specified:",s);return}t.removeEventListener(li[s],c,!1)}function Ce(t){rt[t.pointerId]=t}function Ue(t){rt[t.pointerId]&&(rt[t.pointerId]=t)}function Qe(t){delete rt[t.pointerId]}function wt(){V||(document.addEventListener(Gi,Ce,!0),document.addEventListener(zt,Ue,!0),document.addEventListener(Pi,Qe,!0),document.addEventListener(gi,Qe,!0),V=!0)}function Qt(t,s){if(s.pointerType!==(s.MSPOINTER_TYPE_MOUSE||"mouse")){s.touches=[];for(var c in rt)s.touches.push(rt[c]);s.changedTouches=[s],t(s)}}function Ys(t,s){s.MSPOINTER_TYPE_TOUCH&&s.pointerType===s.MSPOINTER_TYPE_TOUCH&&Et(s),Qt(t,s)}function Di(t){var s={},c,p;for(p in t)c=t[p],s[p]=c&&c.bind?c.bind(t):c;return t=s,s.type="dblclick",s.detail=2,s.isTrusted=!1,s._simulated=!0,s}var Zi=200;function np(t,s){t.addEventListener("dblclick",s);var c=0,p;function E(C){if(C.detail!==1){p=C.detail;return}if(!(C.pointerType==="mouse"||C.sourceCapabilities&&!C.sourceCapabilities.firesTouchEvents)){var ie=cu(C);if(!(ie.some(function(ye){return ye instanceof HTMLLabelElement&&ye.attributes.for})&&!ie.some(function(ye){return ye instanceof HTMLInputElement||ye instanceof HTMLSelectElement}))){var de=Date.now();de-c<=Zi?(p++,p===2&&s(Di(C))):p=1,c=de}}}return t.addEventListener("click",E),{dblclick:s,simDblclick:E}}function rp(t,s){t.removeEventListener("dblclick",s.dblclick),t.removeEventListener("click",s.simDblclick)}var eo=Jr(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),Gn=Jr(["webkitTransition","transition","OTransition","MozTransition","msTransition"]),ou=Gn==="webkitTransition"||Gn==="OTransition"?Gn+"End":"transitionend";function au(t){return typeof t=="string"?document.getElementById(t):t}function Zn(t,s){var c=t.style[s]||t.currentStyle&&t.currentStyle[s];if((!c||c==="auto")&&document.defaultView){var p=document.defaultView.getComputedStyle(t,null);c=p?p[s]:null}return c==="auto"?null:c}function Ke(t,s,c){var p=document.createElement(t);return p.className=s||"",c&&c.appendChild(p),p}function ht(t){var s=t.parentNode;s&&s.removeChild(t)}function Zr(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function bn(t){var s=t.parentNode;s&&s.lastChild!==t&&s.appendChild(t)}function wn(t){var s=t.parentNode;s&&s.firstChild!==t&&s.insertBefore(t,s.firstChild)}function to(t,s){if(t.classList!==void 0)return t.classList.contains(s);var c=Xr(t);return c.length>0&&new RegExp("(^|\\s)"+s+"(\\s|$)").test(c)}function qe(t,s){if(t.classList!==void 0)for(var c=b(s),p=0,E=c.length;p<E;p++)t.classList.add(c[p]);else if(!to(t,s)){var C=Xr(t);io(t,(C?C+" ":"")+s)}}function pt(t,s){t.classList!==void 0?t.classList.remove(s):io(t,m((" "+Xr(t)+" ").replace(" "+s+" "," ")))}function io(t,s){t.className.baseVal===void 0?t.className=s:t.className.baseVal=s}function Xr(t){return t.correspondingElement&&(t=t.correspondingElement),t.className.baseVal===void 0?t.className:t.className.baseVal}function Ut(t,s){"opacity"in t.style?t.style.opacity=s:"filter"in t.style&&sp(t,s)}function sp(t,s){var c=!1,p="DXImageTransform.Microsoft.Alpha";try{c=t.filters.item(p)}catch{if(s===1)return}s=Math.round(s*100),c?(c.Enabled=s!==100,c.Opacity=s):t.style.filter+=" progid:"+p+"(opacity="+s+")"}function Jr(t){for(var s=document.documentElement.style,c=0;c<t.length;c++)if(t[c]in s)return t[c];return!1}function Xi(t,s,c){var p=s||new j(0,0);t.style[eo]=(De.ie3d?"translate("+p.x+"px,"+p.y+"px)":"translate3d("+p.x+"px,"+p.y+"px,0)")+(c?" scale("+c+")":"")}function _t(t,s){t._leaflet_pos=s,De.any3d?Xi(t,s):(t.style.left=s.x+"px",t.style.top=s.y+"px")}function Ji(t){return t._leaflet_pos||new j(0,0)}var Xn,Jn,no;if("onselectstart"in document)Xn=function(){Be(window,"selectstart",Et)},Jn=function(){st(window,"selectstart",Et)};else{var Qn=Jr(["userSelect","WebkitUserSelect","OUserSelect","MozUserSelect","msUserSelect"]);Xn=function(){if(Qn){var t=document.documentElement.style;no=t[Qn],t[Qn]="none"}},Jn=function(){Qn&&(document.documentElement.style[Qn]=no,no=void 0)}}function ro(){Be(window,"dragstart",Et)}function so(){st(window,"dragstart",Et)}var Qr,oo;function ao(t){for(;t.tabIndex===-1;)t=t.parentNode;t.style&&(Kr(),Qr=t,oo=t.style.outlineStyle,t.style.outlineStyle="none",Be(window,"keydown",Kr))}function Kr(){Qr&&(Qr.style.outlineStyle=oo,Qr=void 0,oo=void 0,st(window,"keydown",Kr))}function lu(t){do t=t.parentNode;while((!t.offsetWidth||!t.offsetHeight)&&t!==document.body);return t}function lo(t){var s=t.getBoundingClientRect();return{x:s.width/t.offsetWidth||1,y:s.height/t.offsetHeight||1,boundingClientRect:s}}var op={__proto__:null,TRANSFORM:eo,TRANSITION:Gn,TRANSITION_END:ou,get:au,getStyle:Zn,create:Ke,remove:ht,empty:Zr,toFront:bn,toBack:wn,hasClass:to,addClass:qe,removeClass:pt,setClass:io,getClass:Xr,setOpacity:Ut,testProp:Jr,setTransform:Xi,setPosition:_t,getPosition:Ji,get disableTextSelection(){return Xn},get enableTextSelection(){return Jn},disableImageDrag:ro,enableImageDrag:so,preventOutline:ao,restoreOutline:Kr,getSizedParentNode:lu,getScale:lo};function Be(t,s,c,p){if(s&&typeof s=="object")for(var E in s)co(t,E,s[E],c);else{s=b(s);for(var C=0,ie=s.length;C<ie;C++)co(t,s[C],c,p)}return this}var ui="_leaflet_events";function st(t,s,c,p){if(arguments.length===1)uu(t),delete t[ui];else if(s&&typeof s=="object")for(var E in s)ho(t,E,s[E],c);else if(s=b(s),arguments.length===2)uu(t,function(de){return y(s,de)!==-1});else for(var C=0,ie=s.length;C<ie;C++)ho(t,s[C],c,p);return this}function uu(t,s){for(var c in t[ui]){var p=c.split(/\d/)[0];(!s||s(p))&&ho(t,p,null,null,c)}}var uo={mouseenter:"mouseover",mouseleave:"mouseout",wheel:!("onwheel"in window)&&"mousewheel"};function co(t,s,c,p){var E=s+f(c)+(p?"_"+f(p):"");if(t[ui]&&t[ui][E])return this;var C=function(de){return c.call(p||t,de||window.event)},ie=C;!De.touchNative&&De.pointer&&s.indexOf("touch")===0?C=he(t,s,C):De.touch&&s==="dblclick"?C=np(t,C):"addEventListener"in t?s==="touchstart"||s==="touchmove"||s==="wheel"||s==="mousewheel"?t.addEventListener(uo[s]||s,C,De.passiveEvents?{passive:!1}:!1):s==="mouseenter"||s==="mouseleave"?(C=function(de){de=de||window.event,po(t,de)&&ie(de)},t.addEventListener(uo[s],C,!1)):t.addEventListener(s,ie,!1):t.attachEvent("on"+s,C),t[ui]=t[ui]||{},t[ui][E]=C}function ho(t,s,c,p,E){E=E||s+f(c)+(p?"_"+f(p):"");var C=t[ui]&&t[ui][E];if(!C)return this;!De.touchNative&&De.pointer&&s.indexOf("touch")===0?ge(t,s,C):De.touch&&s==="dblclick"?rp(t,C):"removeEventListener"in t?t.removeEventListener(uo[s]||s,C,!1):t.detachEvent("on"+s,C),t[ui][E]=null}function Qi(t){return t.stopPropagation?t.stopPropagation():t.originalEvent?t.originalEvent._stopped=!0:t.cancelBubble=!0,this}function fo(t){return co(t,"wheel",Qi),this}function Kn(t){return Be(t,"mousedown touchstart dblclick contextmenu",Qi),t._leaflet_disable_click=!0,this}function Et(t){return t.preventDefault?t.preventDefault():t.returnValue=!1,this}function Ki(t){return Et(t),Qi(t),this}function cu(t){if(t.composedPath)return t.composedPath();for(var s=[],c=t.target;c;)s.push(c),c=c.parentNode;return s}function hu(t,s){if(!s)return new j(t.clientX,t.clientY);var c=lo(s),p=c.boundingClientRect;return new j((t.clientX-p.left)/c.x-s.clientLeft,(t.clientY-p.top)/c.y-s.clientTop)}var ap=De.linux&&De.chrome?window.devicePixelRatio:De.mac?window.devicePixelRatio*3:window.devicePixelRatio>0?2*window.devicePixelRatio:1;function du(t){return De.edge?t.wheelDeltaY/2:t.deltaY&&t.deltaMode===0?-t.deltaY/ap:t.deltaY&&t.deltaMode===1?-t.deltaY*20:t.deltaY&&t.deltaMode===2?-t.deltaY*60:t.deltaX||t.deltaZ?0:t.wheelDelta?(t.wheelDeltaY||t.wheelDelta)/2:t.detail&&Math.abs(t.detail)<32765?-t.detail*20:t.detail?t.detail/-32765*60:0}function po(t,s){var c=s.relatedTarget;if(!c)return!0;try{for(;c&&c!==t;)c=c.parentNode}catch{return!1}return c!==t}var lp={__proto__:null,on:Be,off:st,stopPropagation:Qi,disableScrollPropagation:fo,disableClickPropagation:Kn,preventDefault:Et,stop:Ki,getPropagationPath:cu,getMousePosition:hu,getWheelDelta:du,isExternalTarget:po,addListener:Be,removeListener:st},fu=se.extend({run:function(t,s,c,p){this.stop(),this._el=t,this._inProgress=!0,this._duration=c||.25,this._easeOutPower=1/Math.max(p||.5,.2),this._startPos=Ji(t),this._offset=s.subtract(this._startPos),this._startTime=+new Date,this.fire("start"),this._animate()},stop:function(){this._inProgress&&(this._step(!0),this._complete())},_animate:function(){this._animId=q(this._animate,this),this._step()},_step:function(t){var s=+new Date-this._startTime,c=this._duration*1e3;s<c?this._runFrame(this._easeOut(s/c),t):(this._runFrame(1),this._complete())},_runFrame:function(t,s){var c=this._startPos.add(this._offset.multiplyBy(t));s&&c._round(),_t(this._el,c),this.fire("step")},_complete:function(){X(this._animId),this._inProgress=!1,this.fire("end")},_easeOut:function(t){return 1-Math.pow(1-t,this._easeOutPower)}}),Xe=se.extend({options:{crs:z,center:void 0,zoom:void 0,minZoom:void 0,maxZoom:void 0,layers:[],maxBounds:void 0,renderer:void 0,zoomAnimation:!0,zoomAnimationThreshold:4,fadeAnimation:!0,markerZoomAnimation:!0,transform3DLimit:8388608,zoomSnap:1,zoomDelta:1,trackResize:!0},initialize:function(t,s){s=T(this,s),this._handlers=[],this._layers={},this._zoomBoundLayers={},this._sizeChanged=!0,this._initContainer(t),this._initLayout(),this._onResize=l(this._onResize,this),this._initEvents(),s.maxBounds&&this.setMaxBounds(s.maxBounds),s.zoom!==void 0&&(this._zoom=this._limitZoom(s.zoom)),s.center&&s.zoom!==void 0&&this.setView(W(s.center),s.zoom,{reset:!0}),this.callInitHooks(),this._zoomAnimated=Gn&&De.any3d&&!De.mobileOpera&&this.options.zoomAnimation,this._zoomAnimated&&(this._createAnimProxy(),Be(this._proxy,ou,this._catchTransitionEnd,this)),this._addLayers(this.options.layers)},setView:function(t,s,c){if(s=s===void 0?this._zoom:this._limitZoom(s),t=this._limitCenter(W(t),s,this.options.maxBounds),c=c||{},this._stop(),this._loaded&&!c.reset&&c!==!0){c.animate!==void 0&&(c.zoom=o({animate:c.animate},c.zoom),c.pan=o({animate:c.animate,duration:c.duration},c.pan));var p=this._zoom!==s?this._tryAnimatedZoom&&this._tryAnimatedZoom(t,s,c.zoom):this._tryAnimatedPan(t,c.pan);if(p)return clearTimeout(this._sizeTimer),this}return this._resetView(t,s,c.pan&&c.pan.noMoveStart),this},setZoom:function(t,s){return this._loaded?this.setView(this.getCenter(),t,{zoom:s}):(this._zoom=t,this)},zoomIn:function(t,s){return t=t||(De.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom+t,s)},zoomOut:function(t,s){return t=t||(De.any3d?this.options.zoomDelta:1),this.setZoom(this._zoom-t,s)},setZoomAround:function(t,s,c){var p=this.getZoomScale(s),E=this.getSize().divideBy(2),C=t instanceof j?t:this.latLngToContainerPoint(t),ie=C.subtract(E).multiplyBy(1-1/p),de=this.containerPointToLatLng(E.add(ie));return this.setView(de,s,{zoom:c})},_getBoundsCenterZoom:function(t,s){s=s||{},t=t.getBounds?t.getBounds():_e(t);var c=I(s.paddingTopLeft||s.padding||[0,0]),p=I(s.paddingBottomRight||s.padding||[0,0]),E=this.getBoundsZoom(t,!1,c.add(p));if(E=typeof s.maxZoom=="number"?Math.min(s.maxZoom,E):E,E===1/0)return{center:t.getCenter(),zoom:E};var C=p.subtract(c).divideBy(2),ie=this.project(t.getSouthWest(),E),de=this.project(t.getNorthEast(),E),ye=this.unproject(ie.add(de).divideBy(2).add(C),E);return{center:ye,zoom:E}},fitBounds:function(t,s){if(t=_e(t),!t.isValid())throw new Error("Bounds are not valid.");var c=this._getBoundsCenterZoom(t,s);return this.setView(c.center,c.zoom,s)},fitWorld:function(t){return this.fitBounds([[-90,-180],[90,180]],t)},panTo:function(t,s){return this.setView(t,this._zoom,{pan:s})},panBy:function(t,s){if(t=I(t).round(),s=s||{},!t.x&&!t.y)return this.fire("moveend");if(s.animate!==!0&&!this.getSize().contains(t))return this._resetView(this.unproject(this.project(this.getCenter()).add(t)),this.getZoom()),this;if(this._panAnim||(this._panAnim=new fu,this._panAnim.on({step:this._onPanTransitionStep,end:this._onPanTransitionEnd},this)),s.noMoveStart||this.fire("movestart"),s.animate!==!1){qe(this._mapPane,"leaflet-pan-anim");var c=this._getMapPanePos().subtract(t).round();this._panAnim.run(this._mapPane,c,s.duration||.25,s.easeLinearity)}else this._rawPanBy(t),this.fire("move").fire("moveend");return this},flyTo:function(t,s,c){if(c=c||{},c.animate===!1||!De.any3d)return this.setView(t,s,c);this._stop();var p=this.project(this.getCenter()),E=this.project(t),C=this.getSize(),ie=this._zoom;t=W(t),s=s===void 0?ie:s;var de=Math.max(C.x,C.y),ye=de*this.getZoomScale(ie,s),Le=E.distanceTo(p)||1,Pe=1.42,Fe=Pe*Pe;function He(yt){var cs=yt?-1:1,Jp=yt?ye:de,Qp=ye*ye-de*de+cs*Fe*Fe*Le*Le,Kp=2*Jp*Fe*Le,To=Qp/Kp,Gu=Math.sqrt(To*To+1)-To,Yp=Gu<1e-9?-18:Math.log(Gu);return Yp}function Rt(yt){return(Math.exp(yt)-Math.exp(-yt))/2}function xt(yt){return(Math.exp(yt)+Math.exp(-yt))/2}function Vt(yt){return Rt(yt)/xt(yt)}var kt=He(0);function In(yt){return de*(xt(kt)/xt(kt+Pe*yt))}function Wp(yt){return de*(xt(kt)*Vt(kt+Pe*yt)-Rt(kt))/Fe}function Gp(yt){return 1-Math.pow(1-yt,1.5)}var Zp=Date.now(),Vu=(He(1)-kt)/Pe,Xp=c.duration?1e3*c.duration:1e3*Vu*.8;function Wu(){var yt=(Date.now()-Zp)/Xp,cs=Gp(yt)*Vu;yt<=1?(this._flyToFrame=q(Wu,this),this._move(this.unproject(p.add(E.subtract(p).multiplyBy(Wp(cs)/Le)),ie),this.getScaleZoom(de/In(cs),ie),{flyTo:!0})):this._move(t,s)._moveEnd(!0)}return this._moveStart(!0,c.noMoveStart),Wu.call(this),this},flyToBounds:function(t,s){var c=this._getBoundsCenterZoom(t,s);return this.flyTo(c.center,c.zoom,s)},setMaxBounds:function(t){return t=_e(t),this.listens("moveend",this._panInsideMaxBounds)&&this.off("moveend",this._panInsideMaxBounds),t.isValid()?(this.options.maxBounds=t,this._loaded&&this._panInsideMaxBounds(),this.on("moveend",this._panInsideMaxBounds)):(this.options.maxBounds=null,this)},setMinZoom:function(t){var s=this.options.minZoom;return this.options.minZoom=t,this._loaded&&s!==t&&(this.fire("zoomlevelschange"),this.getZoom()<this.options.minZoom)?this.setZoom(t):this},setMaxZoom:function(t){var s=this.options.maxZoom;return this.options.maxZoom=t,this._loaded&&s!==t&&(this.fire("zoomlevelschange"),this.getZoom()>this.options.maxZoom)?this.setZoom(t):this},panInsideBounds:function(t,s){this._enforcingBounds=!0;var c=this.getCenter(),p=this._limitCenter(c,this._zoom,_e(t));return c.equals(p)||this.panTo(p,s),this._enforcingBounds=!1,this},panInside:function(t,s){s=s||{};var c=I(s.paddingTopLeft||s.padding||[0,0]),p=I(s.paddingBottomRight||s.padding||[0,0]),E=this.project(this.getCenter()),C=this.project(t),ie=this.getPixelBounds(),de=ne([ie.min.add(c),ie.max.subtract(p)]),ye=de.getSize();if(!de.contains(C)){this._enforcingBounds=!0;var Le=C.subtract(de.getCenter()),Pe=de.extend(C).getSize().subtract(ye);E.x+=Le.x<0?-Pe.x:Pe.x,E.y+=Le.y<0?-Pe.y:Pe.y,this.panTo(this.unproject(E),s),this._enforcingBounds=!1}return this},invalidateSize:function(t){if(!this._loaded)return this;t=o({animate:!1,pan:!0},t===!0?{animate:!0}:t);var s=this.getSize();this._sizeChanged=!0,this._lastCenter=null;var c=this.getSize(),p=s.divideBy(2).round(),E=c.divideBy(2).round(),C=p.subtract(E);return!C.x&&!C.y?this:(t.animate&&t.pan?this.panBy(C):(t.pan&&this._rawPanBy(C),this.fire("move"),t.debounceMoveend?(clearTimeout(this._sizeTimer),this._sizeTimer=setTimeout(l(this.fire,this,"moveend"),200)):this.fire("moveend")),this.fire("resize",{oldSize:s,newSize:c}))},stop:function(){return this.setZoom(this._limitZoom(this._zoom)),this.options.zoomSnap||this.fire("viewreset"),this._stop()},locate:function(t){if(t=this._locateOptions=o({timeout:1e4,watch:!1},t),!("geolocation"in navigator))return this._handleGeolocationError({code:0,message:"Geolocation not supported."}),this;var s=l(this._handleGeolocationResponse,this),c=l(this._handleGeolocationError,this);return t.watch?this._locationWatchId=navigator.geolocation.watchPosition(s,c,t):navigator.geolocation.getCurrentPosition(s,c,t),this},stopLocate:function(){return navigator.geolocation&&navigator.geolocation.clearWatch&&navigator.geolocation.clearWatch(this._locationWatchId),this._locateOptions&&(this._locateOptions.setView=!1),this},_handleGeolocationError:function(t){if(this._container._leaflet_id){var s=t.code,c=t.message||(s===1?"permission denied":s===2?"position unavailable":"timeout");this._locateOptions.setView&&!this._loaded&&this.fitWorld(),this.fire("locationerror",{code:s,message:"Geolocation error: "+c+"."})}},_handleGeolocationResponse:function(t){if(this._container._leaflet_id){var s=t.coords.latitude,c=t.coords.longitude,p=new G(s,c),E=p.toBounds(t.coords.accuracy*2),C=this._locateOptions;if(C.setView){var ie=this.getBoundsZoom(E);this.setView(p,C.maxZoom?Math.min(ie,C.maxZoom):ie)}var de={latlng:p,bounds:E,timestamp:t.timestamp};for(var ye in t.coords)typeof t.coords[ye]=="number"&&(de[ye]=t.coords[ye]);this.fire("locationfound",de)}},addHandler:function(t,s){if(!s)return this;var c=this[t]=new s(this);return this._handlers.push(c),this.options[t]&&c.enable(),this},remove:function(){if(this._initEvents(!0),this.options.maxBounds&&this.off("moveend",this._panInsideMaxBounds),this._containerId!==this._container._leaflet_id)throw new Error("Map container is being reused by another instance");try{delete this._container._leaflet_id,delete this._containerId}catch{this._container._leaflet_id=void 0,this._containerId=void 0}this._locationWatchId!==void 0&&this.stopLocate(),this._stop(),ht(this._mapPane),this._clearControlPos&&this._clearControlPos(),this._resizeRequest&&(X(this._resizeRequest),this._resizeRequest=null),this._clearHandlers(),this._loaded&&this.fire("unload");var t;for(t in this._layers)this._layers[t].remove();for(t in this._panes)ht(this._panes[t]);return this._layers=[],this._panes=[],delete this._mapPane,delete this._renderer,this},createPane:function(t,s){var c="leaflet-pane"+(t?" leaflet-"+t.replace("Pane","")+"-pane":""),p=Ke("div",c,s||this._mapPane);return t&&(this._panes[t]=p),p},getCenter:function(){return this._checkIfLoaded(),this._lastCenter&&!this._moved()?this._lastCenter.clone():this.layerPointToLatLng(this._getCenterLayerPoint())},getZoom:function(){return this._zoom},getBounds:function(){var t=this.getPixelBounds(),s=this.unproject(t.getBottomLeft()),c=this.unproject(t.getTopRight());return new ee(s,c)},getMinZoom:function(){return this.options.minZoom===void 0?this._layersMinZoom||0:this.options.minZoom},getMaxZoom:function(){return this.options.maxZoom===void 0?this._layersMaxZoom===void 0?1/0:this._layersMaxZoom:this.options.maxZoom},getBoundsZoom:function(t,s,c){t=_e(t),c=I(c||[0,0]);var p=this.getZoom()||0,E=this.getMinZoom(),C=this.getMaxZoom(),ie=t.getNorthWest(),de=t.getSouthEast(),ye=this.getSize().subtract(c),Le=ne(this.project(de,p),this.project(ie,p)).getSize(),Pe=De.any3d?this.options.zoomSnap:1,Fe=ye.x/Le.x,He=ye.y/Le.y,Rt=s?Math.max(Fe,He):Math.min(Fe,He);return p=this.getScaleZoom(Rt,p),Pe&&(p=Math.round(p/(Pe/100))*(Pe/100),p=s?Math.ceil(p/Pe)*Pe:Math.floor(p/Pe)*Pe),Math.max(E,Math.min(C,p))},getSize:function(){return(!this._size||this._sizeChanged)&&(this._size=new j(this._container.clientWidth||0,this._container.clientHeight||0),this._sizeChanged=!1),this._size.clone()},getPixelBounds:function(t,s){var c=this._getTopLeftPoint(t,s);return new Z(c,c.add(this.getSize()))},getPixelOrigin:function(){return this._checkIfLoaded(),this._pixelOrigin},getPixelWorldBounds:function(t){return this.options.crs.getProjectedBounds(t===void 0?this.getZoom():t)},getPane:function(t){return typeof t=="string"?this._panes[t]:t},getPanes:function(){return this._panes},getContainer:function(){return this._container},getZoomScale:function(t,s){var c=this.options.crs;return s=s===void 0?this._zoom:s,c.scale(t)/c.scale(s)},getScaleZoom:function(t,s){var c=this.options.crs;s=s===void 0?this._zoom:s;var p=c.zoom(t*c.scale(s));return isNaN(p)?1/0:p},project:function(t,s){return s=s===void 0?this._zoom:s,this.options.crs.latLngToPoint(W(t),s)},unproject:function(t,s){return s=s===void 0?this._zoom:s,this.options.crs.pointToLatLng(I(t),s)},layerPointToLatLng:function(t){var s=I(t).add(this.getPixelOrigin());return this.unproject(s)},latLngToLayerPoint:function(t){var s=this.project(W(t))._round();return s._subtract(this.getPixelOrigin())},wrapLatLng:function(t){return this.options.crs.wrapLatLng(W(t))},wrapLatLngBounds:function(t){return this.options.crs.wrapLatLngBounds(_e(t))},distance:function(t,s){return this.options.crs.distance(W(t),W(s))},containerPointToLayerPoint:function(t){return I(t).subtract(this._getMapPanePos())},layerPointToContainerPoint:function(t){return I(t).add(this._getMapPanePos())},containerPointToLatLng:function(t){var s=this.containerPointToLayerPoint(I(t));return this.layerPointToLatLng(s)},latLngToContainerPoint:function(t){return this.layerPointToContainerPoint(this.latLngToLayerPoint(W(t)))},mouseEventToContainerPoint:function(t){return hu(t,this._container)},mouseEventToLayerPoint:function(t){return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))},mouseEventToLatLng:function(t){return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))},_initContainer:function(t){var s=this._container=au(t);if(s){if(s._leaflet_id)throw new Error("Map container is already initialized.")}else throw new Error("Map container not found.");Be(s,"scroll",this._onScroll,this),this._containerId=f(s)},_initLayout:function(){var t=this._container;this._fadeAnimated=this.options.fadeAnimation&&De.any3d,qe(t,"leaflet-container"+(De.touch?" leaflet-touch":"")+(De.retina?" leaflet-retina":"")+(De.ielt9?" leaflet-oldie":"")+(De.safari?" leaflet-safari":"")+(this._fadeAnimated?" leaflet-fade-anim":""));var s=Zn(t,"position");s!=="absolute"&&s!=="relative"&&s!=="fixed"&&s!=="sticky"&&(t.style.position="relative"),this._initPanes(),this._initControlPos&&this._initControlPos()},_initPanes:function(){var t=this._panes={};this._paneRenderers={},this._mapPane=this.createPane("mapPane",this._container),_t(this._mapPane,new j(0,0)),this.createPane("tilePane"),this.createPane("overlayPane"),this.createPane("shadowPane"),this.createPane("markerPane"),this.createPane("tooltipPane"),this.createPane("popupPane"),this.options.markerZoomAnimation||(qe(t.markerPane,"leaflet-zoom-hide"),qe(t.shadowPane,"leaflet-zoom-hide"))},_resetView:function(t,s,c){_t(this._mapPane,new j(0,0));var p=!this._loaded;this._loaded=!0,s=this._limitZoom(s),this.fire("viewprereset");var E=this._zoom!==s;this._moveStart(E,c)._move(t,s)._moveEnd(E),this.fire("viewreset"),p&&this.fire("load")},_moveStart:function(t,s){return t&&this.fire("zoomstart"),s||this.fire("movestart"),this},_move:function(t,s,c,p){s===void 0&&(s=this._zoom);var E=this._zoom!==s;return this._zoom=s,this._lastCenter=t,this._pixelOrigin=this._getNewPixelOrigin(t),p?c&&c.pinch&&this.fire("zoom",c):((E||c&&c.pinch)&&this.fire("zoom",c),this.fire("move",c)),this},_moveEnd:function(t){return t&&this.fire("zoomend"),this.fire("moveend")},_stop:function(){return X(this._flyToFrame),this._panAnim&&this._panAnim.stop(),this},_rawPanBy:function(t){_t(this._mapPane,this._getMapPanePos().subtract(t))},_getZoomSpan:function(){return this.getMaxZoom()-this.getMinZoom()},_panInsideMaxBounds:function(){this._enforcingBounds||this.panInsideBounds(this.options.maxBounds)},_checkIfLoaded:function(){if(!this._loaded)throw new Error("Set map center and zoom first.")},_initEvents:function(t){this._targets={},this._targets[f(this._container)]=this;var s=t?st:Be;s(this._container,"click dblclick mousedown mouseup mouseover mouseout mousemove contextmenu keypress keydown keyup",this._handleDOMEvent,this),this.options.trackResize&&s(window,"resize",this._onResize,this),De.any3d&&this.options.transform3DLimit&&(t?this.off:this.on).call(this,"moveend",this._onMoveEnd)},_onResize:function(){X(this._resizeRequest),this._resizeRequest=q(function(){this.invalidateSize({debounceMoveend:!0})},this)},_onScroll:function(){this._container.scrollTop=0,this._container.scrollLeft=0},_onMoveEnd:function(){var t=this._getMapPanePos();Math.max(Math.abs(t.x),Math.abs(t.y))>=this.options.transform3DLimit&&this._resetView(this.getCenter(),this.getZoom())},_findEventTargets:function(t,s){for(var c=[],p,E=s==="mouseout"||s==="mouseover",C=t.target||t.srcElement,ie=!1;C;){if(p=this._targets[f(C)],p&&(s==="click"||s==="preclick")&&this._draggableMoved(p)){ie=!0;break}if(p&&p.listens(s,!0)&&(E&&!po(C,t)||(c.push(p),E))||C===this._container)break;C=C.parentNode}return!c.length&&!ie&&!E&&this.listens(s,!0)&&(c=[this]),c},_isClickDisabled:function(t){for(;t&&t!==this._container;){if(t._leaflet_disable_click)return!0;t=t.parentNode}},_handleDOMEvent:function(t){var s=t.target||t.srcElement;if(!(!this._loaded||s._leaflet_disable_events||t.type==="click"&&this._isClickDisabled(s))){var c=t.type;c==="mousedown"&&ao(s),this._fireDOMEvent(t,c)}},_mouseEvents:["click","dblclick","mouseover","mouseout","contextmenu"],_fireDOMEvent:function(t,s,c){if(t.type==="click"){var p=o({},t);p.type="preclick",this._fireDOMEvent(p,p.type,c)}var E=this._findEventTargets(t,s);if(c){for(var C=[],ie=0;ie<c.length;ie++)c[ie].listens(s,!0)&&C.push(c[ie]);E=C.concat(E)}if(E.length){s==="contextmenu"&&Et(t);var de=E[0],ye={originalEvent:t};if(t.type!=="keypress"&&t.type!=="keydown"&&t.type!=="keyup"){var Le=de.getLatLng&&(!de._radius||de._radius<=10);ye.containerPoint=Le?this.latLngToContainerPoint(de.getLatLng()):this.mouseEventToContainerPoint(t),ye.layerPoint=this.containerPointToLayerPoint(ye.containerPoint),ye.latlng=Le?de.getLatLng():this.layerPointToLatLng(ye.layerPoint)}for(ie=0;ie<E.length;ie++)if(E[ie].fire(s,ye,!0),ye.originalEvent._stopped||E[ie].options.bubblingMouseEvents===!1&&y(this._mouseEvents,s)!==-1)return}},_draggableMoved:function(t){return t=t.dragging&&t.dragging.enabled()?t:this,t.dragging&&t.dragging.moved()||this.boxZoom&&this.boxZoom.moved()},_clearHandlers:function(){for(var t=0,s=this._handlers.length;t<s;t++)this._handlers[t].disable()},whenReady:function(t,s){return this._loaded?t.call(s||this,{target:this}):this.on("load",t,s),this},_getMapPanePos:function(){return Ji(this._mapPane)||new j(0,0)},_moved:function(){var t=this._getMapPanePos();return t&&!t.equals([0,0])},_getTopLeftPoint:function(t,s){var c=t&&s!==void 0?this._getNewPixelOrigin(t,s):this.getPixelOrigin();return c.subtract(this._getMapPanePos())},_getNewPixelOrigin:function(t,s){var c=this.getSize()._divideBy(2);return this.project(t,s)._subtract(c)._add(this._getMapPanePos())._round()},_latLngToNewLayerPoint:function(t,s,c){var p=this._getNewPixelOrigin(c,s);return this.project(t,s)._subtract(p)},_latLngBoundsToNewLayerBounds:function(t,s,c){var p=this._getNewPixelOrigin(c,s);return ne([this.project(t.getSouthWest(),s)._subtract(p),this.project(t.getNorthWest(),s)._subtract(p),this.project(t.getSouthEast(),s)._subtract(p),this.project(t.getNorthEast(),s)._subtract(p)])},_getCenterLayerPoint:function(){return this.containerPointToLayerPoint(this.getSize()._divideBy(2))},_getCenterOffset:function(t){return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())},_limitCenter:function(t,s,c){if(!c)return t;var p=this.project(t,s),E=this.getSize().divideBy(2),C=new Z(p.subtract(E),p.add(E)),ie=this._getBoundsOffset(C,c,s);return Math.abs(ie.x)<=1&&Math.abs(ie.y)<=1?t:this.unproject(p.add(ie),s)},_limitOffset:function(t,s){if(!s)return t;var c=this.getPixelBounds(),p=new Z(c.min.add(t),c.max.add(t));return t.add(this._getBoundsOffset(p,s))},_getBoundsOffset:function(t,s,c){var p=ne(this.project(s.getNorthEast(),c),this.project(s.getSouthWest(),c)),E=p.min.subtract(t.min),C=p.max.subtract(t.max),ie=this._rebound(E.x,-C.x),de=this._rebound(E.y,-C.y);return new j(ie,de)},_rebound:function(t,s){return t+s>0?Math.round(t-s)/2:Math.max(0,Math.ceil(t))-Math.max(0,Math.floor(s))},_limitZoom:function(t){var s=this.getMinZoom(),c=this.getMaxZoom(),p=De.any3d?this.options.zoomSnap:1;return p&&(t=Math.round(t/p)*p),Math.max(s,Math.min(c,t))},_onPanTransitionStep:function(){this.fire("move")},_onPanTransitionEnd:function(){pt(this._mapPane,"leaflet-pan-anim"),this.fire("moveend")},_tryAnimatedPan:function(t,s){var c=this._getCenterOffset(t)._trunc();return(s&&s.animate)!==!0&&!this.getSize().contains(c)?!1:(this.panBy(c,s),!0)},_createAnimProxy:function(){var t=this._proxy=Ke("div","leaflet-proxy leaflet-zoom-animated");this._panes.mapPane.appendChild(t),this.on("zoomanim",function(s){var c=eo,p=this._proxy.style[c];Xi(this._proxy,this.project(s.center,s.zoom),this.getZoomScale(s.zoom,1)),p===this._proxy.style[c]&&this._animatingZoom&&this._onZoomTransitionEnd()},this),this.on("load moveend",this._animMoveEnd,this),this._on("unload",this._destroyAnimProxy,this)},_destroyAnimProxy:function(){ht(this._proxy),this.off("load moveend",this._animMoveEnd,this),delete this._proxy},_animMoveEnd:function(){var t=this.getCenter(),s=this.getZoom();Xi(this._proxy,this.project(t,s),this.getZoomScale(s,1))},_catchTransitionEnd:function(t){this._animatingZoom&&t.propertyName.indexOf("transform")>=0&&this._onZoomTransitionEnd()},_nothingToAnimate:function(){return!this._container.getElementsByClassName("leaflet-zoom-animated").length},_tryAnimatedZoom:function(t,s,c){if(this._animatingZoom)return!0;if(c=c||{},!this._zoomAnimated||c.animate===!1||this._nothingToAnimate()||Math.abs(s-this._zoom)>this.options.zoomAnimationThreshold)return!1;var p=this.getZoomScale(s),E=this._getCenterOffset(t)._divideBy(1-1/p);return c.animate!==!0&&!this.getSize().contains(E)?!1:(q(function(){this._moveStart(!0,c.noMoveStart||!1)._animateZoom(t,s,!0)},this),!0)},_animateZoom:function(t,s,c,p){this._mapPane&&(c&&(this._animatingZoom=!0,this._animateToCenter=t,this._animateToZoom=s,qe(this._mapPane,"leaflet-zoom-anim")),this.fire("zoomanim",{center:t,zoom:s,noUpdate:p}),this._tempFireZoomEvent||(this._tempFireZoomEvent=this._zoom!==this._animateToZoom),this._move(this._animateToCenter,this._animateToZoom,void 0,!0),setTimeout(l(this._onZoomTransitionEnd,this),250))},_onZoomTransitionEnd:function(){this._animatingZoom&&(this._mapPane&&pt(this._mapPane,"leaflet-zoom-anim"),this._animatingZoom=!1,this._move(this._animateToCenter,this._animateToZoom,void 0,!0),this._tempFireZoomEvent&&this.fire("zoom"),delete this._tempFireZoomEvent,this.fire("move"),this._moveEnd(!0))}});function up(t,s){return new Xe(t,s)}var Kt=$.extend({options:{position:"topright"},initialize:function(t){T(this,t)},getPosition:function(){return this.options.position},setPosition:function(t){var s=this._map;return s&&s.removeControl(this),this.options.position=t,s&&s.addControl(this),this},getContainer:function(){return this._container},addTo:function(t){this.remove(),this._map=t;var s=this._container=this.onAdd(t),c=this.getPosition(),p=t._controlCorners[c];return qe(s,"leaflet-control"),c.indexOf("bottom")!==-1?p.insertBefore(s,p.firstChild):p.appendChild(s),this._map.on("unload",this.remove,this),this},remove:function(){return this._map?(ht(this._container),this.onRemove&&this.onRemove(this._map),this._map.off("unload",this.remove,this),this._map=null,this):this},_refocusOnMap:function(t){this._map&&t&&t.screenX>0&&t.screenY>0&&this._map.getContainer().focus()}}),Yn=function(t){return new Kt(t)};Xe.include({addControl:function(t){return t.addTo(this),this},removeControl:function(t){return t.remove(),this},_initControlPos:function(){var t=this._controlCorners={},s="leaflet-",c=this._controlContainer=Ke("div",s+"control-container",this._container);function p(E,C){var ie=s+E+" "+s+C;t[E+C]=Ke("div",ie,c)}p("top","left"),p("top","right"),p("bottom","left"),p("bottom","right")},_clearControlPos:function(){for(var t in this._controlCorners)ht(this._controlCorners[t]);ht(this._controlContainer),delete this._controlCorners,delete this._controlContainer}});var pu=Kt.extend({options:{collapsed:!0,position:"topright",autoZIndex:!0,hideSingleBase:!1,sortLayers:!1,sortFunction:function(t,s,c,p){return c<p?-1:p<c?1:0}},initialize:function(t,s,c){T(this,c),this._layerControlInputs=[],this._layers=[],this._lastZIndex=0,this._handlingClick=!1,this._preventClick=!1;for(var p in t)this._addLayer(t[p],p);for(p in s)this._addLayer(s[p],p,!0)},onAdd:function(t){this._initLayout(),this._update(),this._map=t,t.on("zoomend",this._checkDisabledLayers,this);for(var s=0;s<this._layers.length;s++)this._layers[s].layer.on("add remove",this._onLayerChange,this);return this._container},addTo:function(t){return Kt.prototype.addTo.call(this,t),this._expandIfNotCollapsed()},onRemove:function(){this._map.off("zoomend",this._checkDisabledLayers,this);for(var t=0;t<this._layers.length;t++)this._layers[t].layer.off("add remove",this._onLayerChange,this)},addBaseLayer:function(t,s){return this._addLayer(t,s),this._map?this._update():this},addOverlay:function(t,s){return this._addLayer(t,s,!0),this._map?this._update():this},removeLayer:function(t){t.off("add remove",this._onLayerChange,this);var s=this._getLayer(f(t));return s&&this._layers.splice(this._layers.indexOf(s),1),this._map?this._update():this},expand:function(){qe(this._container,"leaflet-control-layers-expanded"),this._section.style.height=null;var t=this._map.getSize().y-(this._container.offsetTop+50);return t<this._section.clientHeight?(qe(this._section,"leaflet-control-layers-scrollbar"),this._section.style.height=t+"px"):pt(this._section,"leaflet-control-layers-scrollbar"),this._checkDisabledLayers(),this},collapse:function(){return pt(this._container,"leaflet-control-layers-expanded"),this},_initLayout:function(){var t="leaflet-control-layers",s=this._container=Ke("div",t),c=this.options.collapsed;s.setAttribute("aria-haspopup",!0),Kn(s),fo(s);var p=this._section=Ke("section",t+"-list");c&&(this._map.on("click",this.collapse,this),Be(s,{mouseenter:this._expandSafely,mouseleave:this.collapse},this));var E=this._layersLink=Ke("a",t+"-toggle",s);E.href="#",E.title="Layers",E.setAttribute("role","button"),Be(E,{keydown:function(C){C.keyCode===13&&this._expandSafely()},click:function(C){Et(C),this._expandSafely()}},this),c||this.expand(),this._baseLayersList=Ke("div",t+"-base",p),this._separator=Ke("div",t+"-separator",p),this._overlaysList=Ke("div",t+"-overlays",p),s.appendChild(p)},_getLayer:function(t){for(var s=0;s<this._layers.length;s++)if(this._layers[s]&&f(this._layers[s].layer)===t)return this._layers[s]},_addLayer:function(t,s,c){this._map&&t.on("add remove",this._onLayerChange,this),this._layers.push({layer:t,name:s,overlay:c}),this.options.sortLayers&&this._layers.sort(l(function(p,E){return this.options.sortFunction(p.layer,E.layer,p.name,E.name)},this)),this.options.autoZIndex&&t.setZIndex&&(this._lastZIndex++,t.setZIndex(this._lastZIndex)),this._expandIfNotCollapsed()},_update:function(){if(!this._container)return this;Zr(this._baseLayersList),Zr(this._overlaysList),this._layerControlInputs=[];var t,s,c,p,E=0;for(c=0;c<this._layers.length;c++)p=this._layers[c],this._addItem(p),s=s||p.overlay,t=t||!p.overlay,E+=p.overlay?0:1;return this.options.hideSingleBase&&(t=t&&E>1,this._baseLayersList.style.display=t?"":"none"),this._separator.style.display=s&&t?"":"none",this},_onLayerChange:function(t){this._handlingClick||this._update();var s=this._getLayer(f(t.target)),c=s.overlay?t.type==="add"?"overlayadd":"overlayremove":t.type==="add"?"baselayerchange":null;c&&this._map.fire(c,s)},_createRadioElement:function(t,s){var c='<input type="radio" class="leaflet-control-layers-selector" name="'+t+'"'+(s?' checked="checked"':"")+"/>",p=document.createElement("div");return p.innerHTML=c,p.firstChild},_addItem:function(t){var s=document.createElement("label"),c=this._map.hasLayer(t.layer),p;t.overlay?(p=document.createElement("input"),p.type="checkbox",p.className="leaflet-control-layers-selector",p.defaultChecked=c):p=this._createRadioElement("leaflet-base-layers_"+f(this),c),this._layerControlInputs.push(p),p.layerId=f(t.layer),Be(p,"click",this._onInputClick,this);var E=document.createElement("span");E.innerHTML=" "+t.name;var C=document.createElement("span");s.appendChild(C),C.appendChild(p),C.appendChild(E);var ie=t.overlay?this._overlaysList:this._baseLayersList;return ie.appendChild(s),this._checkDisabledLayers(),s},_onInputClick:function(){if(!this._preventClick){var t=this._layerControlInputs,s,c,p=[],E=[];this._handlingClick=!0;for(var C=t.length-1;C>=0;C--)s=t[C],c=this._getLayer(s.layerId).layer,s.checked?p.push(c):s.checked||E.push(c);for(C=0;C<E.length;C++)this._map.hasLayer(E[C])&&this._map.removeLayer(E[C]);for(C=0;C<p.length;C++)this._map.hasLayer(p[C])||this._map.addLayer(p[C]);this._handlingClick=!1,this._refocusOnMap()}},_checkDisabledLayers:function(){for(var t=this._layerControlInputs,s,c,p=this._map.getZoom(),E=t.length-1;E>=0;E--)s=t[E],c=this._getLayer(s.layerId).layer,s.disabled=c.options.minZoom!==void 0&&p<c.options.minZoom||c.options.maxZoom!==void 0&&p>c.options.maxZoom},_expandIfNotCollapsed:function(){return this._map&&!this.options.collapsed&&this.expand(),this},_expandSafely:function(){var t=this._section;this._preventClick=!0,Be(t,"click",Et),this.expand();var s=this;setTimeout(function(){st(t,"click",Et),s._preventClick=!1})}}),cp=function(t,s,c){return new pu(t,s,c)},go=Kt.extend({options:{position:"topleft",zoomInText:'<span aria-hidden="true">+</span>',zoomInTitle:"Zoom in",zoomOutText:'<span aria-hidden="true">−</span>',zoomOutTitle:"Zoom out"},onAdd:function(t){var s="leaflet-control-zoom",c=Ke("div",s+" leaflet-bar"),p=this.options;return this._zoomInButton=this._createButton(p.zoomInText,p.zoomInTitle,s+"-in",c,this._zoomIn),this._zoomOutButton=this._createButton(p.zoomOutText,p.zoomOutTitle,s+"-out",c,this._zoomOut),this._updateDisabled(),t.on("zoomend zoomlevelschange",this._updateDisabled,this),c},onRemove:function(t){t.off("zoomend zoomlevelschange",this._updateDisabled,this)},disable:function(){return this._disabled=!0,this._updateDisabled(),this},enable:function(){return this._disabled=!1,this._updateDisabled(),this},_zoomIn:function(t){!this._disabled&&this._map._zoom<this._map.getMaxZoom()&&this._map.zoomIn(this._map.options.zoomDelta*(t.shiftKey?3:1))},_zoomOut:function(t){!this._disabled&&this._map._zoom>this._map.getMinZoom()&&this._map.zoomOut(this._map.options.zoomDelta*(t.shiftKey?3:1))},_createButton:function(t,s,c,p,E){var C=Ke("a",c,p);return C.innerHTML=t,C.href="#",C.title=s,C.setAttribute("role","button"),C.setAttribute("aria-label",s),Kn(C),Be(C,"click",Ki),Be(C,"click",E,this),Be(C,"click",this._refocusOnMap,this),C},_updateDisabled:function(){var t=this._map,s="leaflet-disabled";pt(this._zoomInButton,s),pt(this._zoomOutButton,s),this._zoomInButton.setAttribute("aria-disabled","false"),this._zoomOutButton.setAttribute("aria-disabled","false"),(this._disabled||t._zoom===t.getMinZoom())&&(qe(this._zoomOutButton,s),this._zoomOutButton.setAttribute("aria-disabled","true")),(this._disabled||t._zoom===t.getMaxZoom())&&(qe(this._zoomInButton,s),this._zoomInButton.setAttribute("aria-disabled","true"))}});Xe.mergeOptions({zoomControl:!0}),Xe.addInitHook(function(){this.options.zoomControl&&(this.zoomControl=new go,this.addControl(this.zoomControl))});var hp=function(t){return new go(t)},gu=Kt.extend({options:{position:"bottomleft",maxWidth:100,metric:!0,imperial:!0},onAdd:function(t){var s="leaflet-control-scale",c=Ke("div",s),p=this.options;return this._addScales(p,s+"-line",c),t.on(p.updateWhenIdle?"moveend":"move",this._update,this),t.whenReady(this._update,this),c},onRemove:function(t){t.off(this.options.updateWhenIdle?"moveend":"move",this._update,this)},_addScales:function(t,s,c){t.metric&&(this._mScale=Ke("div",s,c)),t.imperial&&(this._iScale=Ke("div",s,c))},_update:function(){var t=this._map,s=t.getSize().y/2,c=t.distance(t.containerPointToLatLng([0,s]),t.containerPointToLatLng([this.options.maxWidth,s]));this._updateScales(c)},_updateScales:function(t){this.options.metric&&t&&this._updateMetric(t),this.options.imperial&&t&&this._updateImperial(t)},_updateMetric:function(t){var s=this._getRoundNum(t),c=s<1e3?s+" m":s/1e3+" km";this._updateScale(this._mScale,c,s/t)},_updateImperial:function(t){var s=t*3.2808399,c,p,E;s>5280?(c=s/5280,p=this._getRoundNum(c),this._updateScale(this._iScale,p+" mi",p/c)):(E=this._getRoundNum(s),this._updateScale(this._iScale,E+" ft",E/s))},_updateScale:function(t,s,c){t.style.width=Math.round(this.options.maxWidth*c)+"px",t.innerHTML=s},_getRoundNum:function(t){var s=Math.pow(10,(Math.floor(t)+"").length-1),c=t/s;return c=c>=10?10:c>=5?5:c>=3?3:c>=2?2:1,s*c}}),dp=function(t){return new gu(t)},fp='<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="12" height="8" viewBox="0 0 12 8" class="leaflet-attribution-flag"><path fill="#4C7BE1" d="M0 0h12v4H0z"/><path fill="#FFD500" d="M0 4h12v3H0z"/><path fill="#E0BC00" d="M0 7h12v1H0z"/></svg>',mo=Kt.extend({options:{position:"bottomright",prefix:'<a href="https://leafletjs.com" title="A JavaScript library for interactive maps">'+(De.inlineSvg?fp+" ":"")+"Leaflet</a>"},initialize:function(t){T(this,t),this._attributions={}},onAdd:function(t){t.attributionControl=this,this._container=Ke("div","leaflet-control-attribution"),Kn(this._container);for(var s in t._layers)t._layers[s].getAttribution&&this.addAttribution(t._layers[s].getAttribution());return this._update(),t.on("layeradd",this._addAttribution,this),this._container},onRemove:function(t){t.off("layeradd",this._addAttribution,this)},_addAttribution:function(t){t.layer.getAttribution&&(this.addAttribution(t.layer.getAttribution()),t.layer.once("remove",function(){this.removeAttribution(t.layer.getAttribution())},this))},setPrefix:function(t){return this.options.prefix=t,this._update(),this},addAttribution:function(t){return t?(this._attributions[t]||(this._attributions[t]=0),this._attributions[t]++,this._update(),this):this},removeAttribution:function(t){return t?(this._attributions[t]&&(this._attributions[t]--,this._update()),this):this},_update:function(){if(this._map){var t=[];for(var s in this._attributions)this._attributions[s]&&t.push(s);var c=[];this.options.prefix&&c.push(this.options.prefix),t.length&&c.push(t.join(", ")),this._container.innerHTML=c.join(' <span aria-hidden="true">|</span> ')}}});Xe.mergeOptions({attributionControl:!0}),Xe.addInitHook(function(){this.options.attributionControl&&new mo().addTo(this)});var pp=function(t){return new mo(t)};Kt.Layers=pu,Kt.Zoom=go,Kt.Scale=gu,Kt.Attribution=mo,Yn.layers=cp,Yn.zoom=hp,Yn.scale=dp,Yn.attribution=pp;var ci=$.extend({initialize:function(t){this._map=t},enable:function(){return this._enabled?this:(this._enabled=!0,this.addHooks(),this)},disable:function(){return this._enabled?(this._enabled=!1,this.removeHooks(),this):this},enabled:function(){return!!this._enabled}});ci.addTo=function(t,s){return t.addHandler(s,this),this};var gp={Events:D},mu=De.touch?"touchstart mousedown":"mousedown",ki=se.extend({options:{clickTolerance:3},initialize:function(t,s,c,p){T(this,p),this._element=t,this._dragStartTarget=s||t,this._preventOutline=c},enable:function(){this._enabled||(Be(this._dragStartTarget,mu,this._onDown,this),this._enabled=!0)},disable:function(){this._enabled&&(ki._dragging===this&&this.finishDrag(!0),st(this._dragStartTarget,mu,this._onDown,this),this._enabled=!1,this._moved=!1)},_onDown:function(t){if(this._enabled&&(this._moved=!1,!to(this._element,"leaflet-zoom-anim"))){if(t.touches&&t.touches.length!==1){ki._dragging===this&&this.finishDrag();return}if(!(ki._dragging||t.shiftKey||t.which!==1&&t.button!==1&&!t.touches)&&(ki._dragging=this,this._preventOutline&&ao(this._element),ro(),Xn(),!this._moving)){this.fire("down");var s=t.touches?t.touches[0]:t,c=lu(this._element);this._startPoint=new j(s.clientX,s.clientY),this._startPos=Ji(this._element),this._parentScale=lo(c);var p=t.type==="mousedown";Be(document,p?"mousemove":"touchmove",this._onMove,this),Be(document,p?"mouseup":"touchend touchcancel",this._onUp,this)}}},_onMove:function(t){if(this._enabled){if(t.touches&&t.touches.length>1){this._moved=!0;return}var s=t.touches&&t.touches.length===1?t.touches[0]:t,c=new j(s.clientX,s.clientY)._subtract(this._startPoint);!c.x&&!c.y||Math.abs(c.x)+Math.abs(c.y)<this.options.clickTolerance||(c.x/=this._parentScale.x,c.y/=this._parentScale.y,Et(t),this._moved||(this.fire("dragstart"),this._moved=!0,qe(document.body,"leaflet-dragging"),this._lastTarget=t.target||t.srcElement,window.SVGElementInstance&&this._lastTarget instanceof window.SVGElementInstance&&(this._lastTarget=this._lastTarget.correspondingUseElement),qe(this._lastTarget,"leaflet-drag-target")),this._newPos=this._startPos.add(c),this._moving=!0,this._lastEvent=t,this._updatePosition())}},_updatePosition:function(){var t={originalEvent:this._lastEvent};this.fire("predrag",t),_t(this._element,this._newPos),this.fire("drag",t)},_onUp:function(){this._enabled&&this.finishDrag()},finishDrag:function(t){pt(document.body,"leaflet-dragging"),this._lastTarget&&(pt(this._lastTarget,"leaflet-drag-target"),this._lastTarget=null),st(document,"mousemove touchmove",this._onMove,this),st(document,"mouseup touchend touchcancel",this._onUp,this),so(),Jn();var s=this._moved&&this._moving;this._moving=!1,ki._dragging=!1,s&&this.fire("dragend",{noInertia:t,distance:this._newPos.distanceTo(this._startPos)})}});function _u(t,s,c){var p,E=[1,4,2,8],C,ie,de,ye,Le,Pe,Fe,He;for(C=0,Pe=t.length;C<Pe;C++)t[C]._code=Yi(t[C],s);for(de=0;de<4;de++){for(Fe=E[de],p=[],C=0,Pe=t.length,ie=Pe-1;C<Pe;ie=C++)ye=t[C],Le=t[ie],ye._code&Fe?Le._code&Fe||(He=Yr(Le,ye,Fe,s,c),He._code=Yi(He,s),p.push(He)):(Le._code&Fe&&(He=Yr(Le,ye,Fe,s,c),He._code=Yi(He,s),p.push(He)),p.push(ye));t=p}return t}function yu(t,s){var c,p,E,C,ie,de,ye,Le,Pe;if(!t||t.length===0)throw new Error("latlngs not passed");Ht(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var Fe=W([0,0]),He=_e(t),Rt=He.getNorthWest().distanceTo(He.getSouthWest())*He.getNorthEast().distanceTo(He.getNorthWest());Rt<1700&&(Fe=_o(t));var xt=t.length,Vt=[];for(c=0;c<xt;c++){var kt=W(t[c]);Vt.push(s.project(W([kt.lat-Fe.lat,kt.lng-Fe.lng])))}for(de=ye=Le=0,c=0,p=xt-1;c<xt;p=c++)E=Vt[c],C=Vt[p],ie=E.y*C.x-C.y*E.x,ye+=(E.x+C.x)*ie,Le+=(E.y+C.y)*ie,de+=ie*3;de===0?Pe=Vt[0]:Pe=[ye/de,Le/de];var In=s.unproject(I(Pe));return W([In.lat+Fe.lat,In.lng+Fe.lng])}function _o(t){for(var s=0,c=0,p=0,E=0;E<t.length;E++){var C=W(t[E]);s+=C.lat,c+=C.lng,p++}return W([s/p,c/p])}var mp={__proto__:null,clipPolygon:_u,polygonCenter:yu,centroid:_o};function vu(t,s){if(!s||!t.length)return t.slice();var c=s*s;return t=vp(t,c),t=yp(t,c),t}function bu(t,s,c){return Math.sqrt(er(t,s,c,!0))}function _p(t,s,c){return er(t,s,c)}function yp(t,s){var c=t.length,p=typeof Uint8Array<"u"?Uint8Array:Array,E=new p(c);E[0]=E[c-1]=1,yo(t,E,s,0,c-1);var C,ie=[];for(C=0;C<c;C++)E[C]&&ie.push(t[C]);return ie}function yo(t,s,c,p,E){var C=0,ie,de,ye;for(de=p+1;de<=E-1;de++)ye=er(t[de],t[p],t[E],!0),ye>C&&(ie=de,C=ye);C>c&&(s[ie]=1,yo(t,s,c,p,ie),yo(t,s,c,ie,E))}function vp(t,s){for(var c=[t[0]],p=1,E=0,C=t.length;p<C;p++)bp(t[p],t[E])>s&&(c.push(t[p]),E=p);return E<C-1&&c.push(t[C-1]),c}var wu;function xu(t,s,c,p,E){var C=p?wu:Yi(t,c),ie=Yi(s,c),de,ye,Le;for(wu=ie;;){if(!(C|ie))return[t,s];if(C&ie)return!1;de=C||ie,ye=Yr(t,s,de,c,E),Le=Yi(ye,c),de===C?(t=ye,C=Le):(s=ye,ie=Le)}}function Yr(t,s,c,p,E){var C=s.x-t.x,ie=s.y-t.y,de=p.min,ye=p.max,Le,Pe;return c&8?(Le=t.x+C*(ye.y-t.y)/ie,Pe=ye.y):c&4?(Le=t.x+C*(de.y-t.y)/ie,Pe=de.y):c&2?(Le=ye.x,Pe=t.y+ie*(ye.x-t.x)/C):c&1&&(Le=de.x,Pe=t.y+ie*(de.x-t.x)/C),new j(Le,Pe,E)}function Yi(t,s){var c=0;return t.x<s.min.x?c|=1:t.x>s.max.x&&(c|=2),t.y<s.min.y?c|=4:t.y>s.max.y&&(c|=8),c}function bp(t,s){var c=s.x-t.x,p=s.y-t.y;return c*c+p*p}function er(t,s,c,p){var E=s.x,C=s.y,ie=c.x-E,de=c.y-C,ye=ie*ie+de*de,Le;return ye>0&&(Le=((t.x-E)*ie+(t.y-C)*de)/ye,Le>1?(E=c.x,C=c.y):Le>0&&(E+=ie*Le,C+=de*Le)),ie=t.x-E,de=t.y-C,p?ie*ie+de*de:new j(E,C)}function Ht(t){return!S(t[0])||typeof t[0][0]!="object"&&typeof t[0][0]<"u"}function Eu(t){return console.warn("Deprecated use of _flat, please use L.LineUtil.isFlat instead."),Ht(t)}function Su(t,s){var c,p,E,C,ie,de,ye,Le;if(!t||t.length===0)throw new Error("latlngs not passed");Ht(t)||(console.warn("latlngs are not flat! Only the first ring will be used"),t=t[0]);var Pe=W([0,0]),Fe=_e(t),He=Fe.getNorthWest().distanceTo(Fe.getSouthWest())*Fe.getNorthEast().distanceTo(Fe.getNorthWest());He<1700&&(Pe=_o(t));var Rt=t.length,xt=[];for(c=0;c<Rt;c++){var Vt=W(t[c]);xt.push(s.project(W([Vt.lat-Pe.lat,Vt.lng-Pe.lng])))}for(c=0,p=0;c<Rt-1;c++)p+=xt[c].distanceTo(xt[c+1])/2;if(p===0)Le=xt[0];else for(c=0,C=0;c<Rt-1;c++)if(ie=xt[c],de=xt[c+1],E=ie.distanceTo(de),C+=E,C>p){ye=(C-p)/E,Le=[de.x-ye*(de.x-ie.x),de.y-ye*(de.y-ie.y)];break}var kt=s.unproject(I(Le));return W([kt.lat+Pe.lat,kt.lng+Pe.lng])}var wp={__proto__:null,simplify:vu,pointToSegmentDistance:bu,closestPointOnSegment:_p,clipSegment:xu,_getEdgeIntersection:Yr,_getBitCode:Yi,_sqClosestPointOnSegment:er,isFlat:Ht,_flat:Eu,polylineCenter:Su},vo={project:function(t){return new j(t.lng,t.lat)},unproject:function(t){return new G(t.y,t.x)},bounds:new Z([-180,-90],[180,90])},bo={R:6378137,R_MINOR:6356752314245179e-9,bounds:new Z([-2003750834279e-5,-1549657073972e-5],[2003750834279e-5,1876465623138e-5]),project:function(t){var s=Math.PI/180,c=this.R,p=t.lat*s,E=this.R_MINOR/c,C=Math.sqrt(1-E*E),ie=C*Math.sin(p),de=Math.tan(Math.PI/4-p/2)/Math.pow((1-ie)/(1+ie),C/2);return p=-c*Math.log(Math.max(de,1e-10)),new j(t.lng*s*c,p)},unproject:function(t){for(var s=180/Math.PI,c=this.R,p=this.R_MINOR/c,E=Math.sqrt(1-p*p),C=Math.exp(-t.y/c),ie=Math.PI/2-2*Math.atan(C),de=0,ye=.1,Le;de<15&&Math.abs(ye)>1e-7;de++)Le=E*Math.sin(ie),Le=Math.pow((1-Le)/(1+Le),E/2),ye=Math.PI/2-2*Math.atan(C*Le)-ie,ie+=ye;return new G(ie*s,t.x*s/c)}},xp={__proto__:null,LonLat:vo,Mercator:bo,SphericalMercator:ce},Ep=o({},K,{code:"EPSG:3395",projection:bo,transformation:(function(){var t=.5/(Math.PI*bo.R);return Te(t,.5,-t,.5)})()}),Tu=o({},K,{code:"EPSG:4326",projection:vo,transformation:Te(1/180,1,-1/180,.5)}),Sp=o({},Y,{projection:vo,transformation:Te(1,0,-1,0),scale:function(t){return Math.pow(2,t)},zoom:function(t){return Math.log(t)/Math.LN2},distance:function(t,s){var c=s.lng-t.lng,p=s.lat-t.lat;return Math.sqrt(c*c+p*p)},infinite:!0});Y.Earth=K,Y.EPSG3395=Ep,Y.EPSG3857=z,Y.EPSG900913=te,Y.EPSG4326=Tu,Y.Simple=Sp;var Yt=se.extend({options:{pane:"overlayPane",attribution:null,bubblingMouseEvents:!0},addTo:function(t){return t.addLayer(this),this},remove:function(){return this.removeFrom(this._map||this._mapToAdd)},removeFrom:function(t){return t&&t.removeLayer(this),this},getPane:function(t){return this._map.getPane(t?this.options[t]||t:this.options.pane)},addInteractiveTarget:function(t){return this._map._targets[f(t)]=this,this},removeInteractiveTarget:function(t){return delete this._map._targets[f(t)],this},getAttribution:function(){return this.options.attribution},_layerAdd:function(t){var s=t.target;if(s.hasLayer(this)){if(this._map=s,this._zoomAnimated=s._zoomAnimated,this.getEvents){var c=this.getEvents();s.on(c,this),this.once("remove",function(){s.off(c,this)},this)}this.onAdd(s),this.fire("add"),s.fire("layeradd",{layer:this})}}});Xe.include({addLayer:function(t){if(!t._layerAdd)throw new Error("The provided object is not a Layer.");var s=f(t);return this._layers[s]?this:(this._layers[s]=t,t._mapToAdd=this,t.beforeAdd&&t.beforeAdd(this),this.whenReady(t._layerAdd,t),this)},removeLayer:function(t){var s=f(t);return this._layers[s]?(this._loaded&&t.onRemove(this),delete this._layers[s],this._loaded&&(this.fire("layerremove",{layer:t}),t.fire("remove")),t._map=t._mapToAdd=null,this):this},hasLayer:function(t){return f(t)in this._layers},eachLayer:function(t,s){for(var c in this._layers)t.call(s,this._layers[c]);return this},_addLayers:function(t){t=t?S(t)?t:[t]:[];for(var s=0,c=t.length;s<c;s++)this.addLayer(t[s])},_addZoomLimit:function(t){(!isNaN(t.options.maxZoom)||!isNaN(t.options.minZoom))&&(this._zoomBoundLayers[f(t)]=t,this._updateZoomLevels())},_removeZoomLimit:function(t){var s=f(t);this._zoomBoundLayers[s]&&(delete this._zoomBoundLayers[s],this._updateZoomLevels())},_updateZoomLevels:function(){var t=1/0,s=-1/0,c=this._getZoomSpan();for(var p in this._zoomBoundLayers){var E=this._zoomBoundLayers[p].options;t=E.minZoom===void 0?t:Math.min(t,E.minZoom),s=E.maxZoom===void 0?s:Math.max(s,E.maxZoom)}this._layersMaxZoom=s===-1/0?void 0:s,this._layersMinZoom=t===1/0?void 0:t,c!==this._getZoomSpan()&&this.fire("zoomlevelschange"),this.options.maxZoom===void 0&&this._layersMaxZoom&&this.getZoom()>this._layersMaxZoom&&this.setZoom(this._layersMaxZoom),this.options.minZoom===void 0&&this._layersMinZoom&&this.getZoom()<this._layersMinZoom&&this.setZoom(this._layersMinZoom)}});var xn=Yt.extend({initialize:function(t,s){T(this,s),this._layers={};var c,p;if(t)for(c=0,p=t.length;c<p;c++)this.addLayer(t[c])},addLayer:function(t){var s=this.getLayerId(t);return this._layers[s]=t,this._map&&this._map.addLayer(t),this},removeLayer:function(t){var s=t in this._layers?t:this.getLayerId(t);return this._map&&this._layers[s]&&this._map.removeLayer(this._layers[s]),delete this._layers[s],this},hasLayer:function(t){var s=typeof t=="number"?t:this.getLayerId(t);return s in this._layers},clearLayers:function(){return this.eachLayer(this.removeLayer,this)},invoke:function(t){var s=Array.prototype.slice.call(arguments,1),c,p;for(c in this._layers)p=this._layers[c],p[t]&&p[t].apply(p,s);return this},onAdd:function(t){this.eachLayer(t.addLayer,t)},onRemove:function(t){this.eachLayer(t.removeLayer,t)},eachLayer:function(t,s){for(var c in this._layers)t.call(s,this._layers[c]);return this},getLayer:function(t){return this._layers[t]},getLayers:function(){var t=[];return this.eachLayer(t.push,t),t},setZIndex:function(t){return this.invoke("setZIndex",t)},getLayerId:function(t){return f(t)}}),Tp=function(t,s){return new xn(t,s)},mi=xn.extend({addLayer:function(t){return this.hasLayer(t)?this:(t.addEventParent(this),xn.prototype.addLayer.call(this,t),this.fire("layeradd",{layer:t}))},removeLayer:function(t){return this.hasLayer(t)?(t in this._layers&&(t=this._layers[t]),t.removeEventParent(this),xn.prototype.removeLayer.call(this,t),this.fire("layerremove",{layer:t})):this},setStyle:function(t){return this.invoke("setStyle",t)},bringToFront:function(){return this.invoke("bringToFront")},bringToBack:function(){return this.invoke("bringToBack")},getBounds:function(){var t=new ee;for(var s in this._layers){var c=this._layers[s];t.extend(c.getBounds?c.getBounds():c.getLatLng())}return t}}),Lp=function(t,s){return new mi(t,s)},En=$.extend({options:{popupAnchor:[0,0],tooltipAnchor:[0,0],crossOrigin:!1},initialize:function(t){T(this,t)},createIcon:function(t){return this._createIcon("icon",t)},createShadow:function(t){return this._createIcon("shadow",t)},_createIcon:function(t,s){var c=this._getIconUrl(t);if(!c){if(t==="icon")throw new Error("iconUrl not set in Icon options (see the docs).");return null}var p=this._createImg(c,s&&s.tagName==="IMG"?s:null);return this._setIconStyles(p,t),(this.options.crossOrigin||this.options.crossOrigin==="")&&(p.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),p},_setIconStyles:function(t,s){var c=this.options,p=c[s+"Size"];typeof p=="number"&&(p=[p,p]);var E=I(p),C=I(s==="shadow"&&c.shadowAnchor||c.iconAnchor||E&&E.divideBy(2,!0));t.className="leaflet-marker-"+s+" "+(c.className||""),C&&(t.style.marginLeft=-C.x+"px",t.style.marginTop=-C.y+"px"),E&&(t.style.width=E.x+"px",t.style.height=E.y+"px")},_createImg:function(t,s){return s=s||document.createElement("img"),s.src=t,s},_getIconUrl:function(t){return De.retina&&this.options[t+"RetinaUrl"]||this.options[t+"Url"]}});function Ip(t){return new En(t)}var tr=En.extend({options:{iconUrl:"marker-icon.png",iconRetinaUrl:"marker-icon-2x.png",shadowUrl:"marker-shadow.png",iconSize:[25,41],iconAnchor:[12,41],popupAnchor:[1,-34],tooltipAnchor:[16,-28],shadowSize:[41,41]},_getIconUrl:function(t){return typeof tr.imagePath!="string"&&(tr.imagePath=this._detectIconPath()),(this.options.imagePath||tr.imagePath)+En.prototype._getIconUrl.call(this,t)},_stripUrl:function(t){var s=function(c,p,E){var C=p.exec(c);return C&&C[E]};return t=s(t,/^url\((['"])?(.+)\1\)$/,2),t&&s(t,/^(.*)marker-icon\.png$/,1)},_detectIconPath:function(){var t=Ke("div","leaflet-default-icon-path",document.body),s=Zn(t,"background-image")||Zn(t,"backgroundImage");if(document.body.removeChild(t),s=this._stripUrl(s),s)return s;var c=document.querySelector('link[href$="leaflet.css"]');return c?c.href.substring(0,c.href.length-11-1):""}}),Lu=ci.extend({initialize:function(t){this._marker=t},addHooks:function(){var t=this._marker._icon;this._draggable||(this._draggable=new ki(t,t,!0)),this._draggable.on({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).enable(),qe(t,"leaflet-marker-draggable")},removeHooks:function(){this._draggable.off({dragstart:this._onDragStart,predrag:this._onPreDrag,drag:this._onDrag,dragend:this._onDragEnd},this).disable(),this._marker._icon&&pt(this._marker._icon,"leaflet-marker-draggable")},moved:function(){return this._draggable&&this._draggable._moved},_adjustPan:function(t){var s=this._marker,c=s._map,p=this._marker.options.autoPanSpeed,E=this._marker.options.autoPanPadding,C=Ji(s._icon),ie=c.getPixelBounds(),de=c.getPixelOrigin(),ye=ne(ie.min._subtract(de).add(E),ie.max._subtract(de).subtract(E));if(!ye.contains(C)){var Le=I((Math.max(ye.max.x,C.x)-ye.max.x)/(ie.max.x-ye.max.x)-(Math.min(ye.min.x,C.x)-ye.min.x)/(ie.min.x-ye.min.x),(Math.max(ye.max.y,C.y)-ye.max.y)/(ie.max.y-ye.max.y)-(Math.min(ye.min.y,C.y)-ye.min.y)/(ie.min.y-ye.min.y)).multiplyBy(p);c.panBy(Le,{animate:!1}),this._draggable._newPos._add(Le),this._draggable._startPos._add(Le),_t(s._icon,this._draggable._newPos),this._onDrag(t),this._panRequest=q(this._adjustPan.bind(this,t))}},_onDragStart:function(){this._oldLatLng=this._marker.getLatLng(),this._marker.closePopup&&this._marker.closePopup(),this._marker.fire("movestart").fire("dragstart")},_onPreDrag:function(t){this._marker.options.autoPan&&(X(this._panRequest),this._panRequest=q(this._adjustPan.bind(this,t)))},_onDrag:function(t){var s=this._marker,c=s._shadow,p=Ji(s._icon),E=s._map.layerPointToLatLng(p);c&&_t(c,p),s._latlng=E,t.latlng=E,t.oldLatLng=this._oldLatLng,s.fire("move",t).fire("drag",t)},_onDragEnd:function(t){X(this._panRequest),delete this._oldLatLng,this._marker.fire("moveend").fire("dragend",t)}}),es=Yt.extend({options:{icon:new tr,interactive:!0,keyboard:!0,title:"",alt:"Marker",zIndexOffset:0,opacity:1,riseOnHover:!1,riseOffset:250,pane:"markerPane",shadowPane:"shadowPane",bubblingMouseEvents:!1,autoPanOnFocus:!0,draggable:!1,autoPan:!1,autoPanPadding:[50,50],autoPanSpeed:10},initialize:function(t,s){T(this,s),this._latlng=W(t)},onAdd:function(t){this._zoomAnimated=this._zoomAnimated&&t.options.markerZoomAnimation,this._zoomAnimated&&t.on("zoomanim",this._animateZoom,this),this._initIcon(),this.update()},onRemove:function(t){this.dragging&&this.dragging.enabled()&&(this.options.draggable=!0,this.dragging.removeHooks()),delete this.dragging,this._zoomAnimated&&t.off("zoomanim",this._animateZoom,this),this._removeIcon(),this._removeShadow()},getEvents:function(){return{zoom:this.update,viewreset:this.update}},getLatLng:function(){return this._latlng},setLatLng:function(t){var s=this._latlng;return this._latlng=W(t),this.update(),this.fire("move",{oldLatLng:s,latlng:this._latlng})},setZIndexOffset:function(t){return this.options.zIndexOffset=t,this.update()},getIcon:function(){return this.options.icon},setIcon:function(t){return this.options.icon=t,this._map&&(this._initIcon(),this.update()),this._popup&&this.bindPopup(this._popup,this._popup.options),this},getElement:function(){return this._icon},update:function(){if(this._icon&&this._map){var t=this._map.latLngToLayerPoint(this._latlng).round();this._setPos(t)}return this},_initIcon:function(){var t=this.options,s="leaflet-zoom-"+(this._zoomAnimated?"animated":"hide"),c=t.icon.createIcon(this._icon),p=!1;c!==this._icon&&(this._icon&&this._removeIcon(),p=!0,t.title&&(c.title=t.title),c.tagName==="IMG"&&(c.alt=t.alt||"")),qe(c,s),t.keyboard&&(c.tabIndex="0",c.setAttribute("role","button")),this._icon=c,t.riseOnHover&&this.on({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&Be(c,"focus",this._panOnFocus,this);var E=t.icon.createShadow(this._shadow),C=!1;E!==this._shadow&&(this._removeShadow(),C=!0),E&&(qe(E,s),E.alt=""),this._shadow=E,t.opacity<1&&this._updateOpacity(),p&&this.getPane().appendChild(this._icon),this._initInteraction(),E&&C&&this.getPane(t.shadowPane).appendChild(this._shadow)},_removeIcon:function(){this.options.riseOnHover&&this.off({mouseover:this._bringToFront,mouseout:this._resetZIndex}),this.options.autoPanOnFocus&&st(this._icon,"focus",this._panOnFocus,this),ht(this._icon),this.removeInteractiveTarget(this._icon),this._icon=null},_removeShadow:function(){this._shadow&&ht(this._shadow),this._shadow=null},_setPos:function(t){this._icon&&_t(this._icon,t),this._shadow&&_t(this._shadow,t),this._zIndex=t.y+this.options.zIndexOffset,this._resetZIndex()},_updateZIndex:function(t){this._icon&&(this._icon.style.zIndex=this._zIndex+t)},_animateZoom:function(t){var s=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center).round();this._setPos(s)},_initInteraction:function(){if(this.options.interactive&&(qe(this._icon,"leaflet-interactive"),this.addInteractiveTarget(this._icon),Lu)){var t=this.options.draggable;this.dragging&&(t=this.dragging.enabled(),this.dragging.disable()),this.dragging=new Lu(this),t&&this.dragging.enable()}},setOpacity:function(t){return this.options.opacity=t,this._map&&this._updateOpacity(),this},_updateOpacity:function(){var t=this.options.opacity;this._icon&&Ut(this._icon,t),this._shadow&&Ut(this._shadow,t)},_bringToFront:function(){this._updateZIndex(this.options.riseOffset)},_resetZIndex:function(){this._updateZIndex(0)},_panOnFocus:function(){var t=this._map;if(t){var s=this.options.icon.options,c=s.iconSize?I(s.iconSize):I(0,0),p=s.iconAnchor?I(s.iconAnchor):I(0,0);t.panInside(this._latlng,{paddingTopLeft:p,paddingBottomRight:c.subtract(p)})}},_getPopupAnchor:function(){return this.options.icon.options.popupAnchor},_getTooltipAnchor:function(){return this.options.icon.options.tooltipAnchor}});function Ap(t,s){return new es(t,s)}var Mi=Yt.extend({options:{stroke:!0,color:"#3388ff",weight:3,opacity:1,lineCap:"round",lineJoin:"round",dashArray:null,dashOffset:null,fill:!1,fillColor:null,fillOpacity:.2,fillRule:"evenodd",interactive:!0,bubblingMouseEvents:!0},beforeAdd:function(t){this._renderer=t.getRenderer(this)},onAdd:function(){this._renderer._initPath(this),this._reset(),this._renderer._addPath(this)},onRemove:function(){this._renderer._removePath(this)},redraw:function(){return this._map&&this._renderer._updatePath(this),this},setStyle:function(t){return T(this,t),this._renderer&&(this._renderer._updateStyle(this),this.options.stroke&&t&&Object.prototype.hasOwnProperty.call(t,"weight")&&this._updateBounds()),this},bringToFront:function(){return this._renderer&&this._renderer._bringToFront(this),this},bringToBack:function(){return this._renderer&&this._renderer._bringToBack(this),this},getElement:function(){return this._path},_reset:function(){this._project(),this._update()},_clickTolerance:function(){return(this.options.stroke?this.options.weight/2:0)+(this._renderer.options.tolerance||0)}}),ts=Mi.extend({options:{fill:!0,radius:10},initialize:function(t,s){T(this,s),this._latlng=W(t),this._radius=this.options.radius},setLatLng:function(t){var s=this._latlng;return this._latlng=W(t),this.redraw(),this.fire("move",{oldLatLng:s,latlng:this._latlng})},getLatLng:function(){return this._latlng},setRadius:function(t){return this.options.radius=this._radius=t,this.redraw()},getRadius:function(){return this._radius},setStyle:function(t){var s=t&&t.radius||this._radius;return Mi.prototype.setStyle.call(this,t),this.setRadius(s),this},_project:function(){this._point=this._map.latLngToLayerPoint(this._latlng),this._updateBounds()},_updateBounds:function(){var t=this._radius,s=this._radiusY||t,c=this._clickTolerance(),p=[t+c,s+c];this._pxBounds=new Z(this._point.subtract(p),this._point.add(p))},_update:function(){this._map&&this._updatePath()},_updatePath:function(){this._renderer._updateCircle(this)},_empty:function(){return this._radius&&!this._renderer._bounds.intersects(this._pxBounds)},_containsPoint:function(t){return t.distanceTo(this._point)<=this._radius+this._clickTolerance()}});function Np(t,s){return new ts(t,s)}var wo=ts.extend({initialize:function(t,s,c){if(typeof s=="number"&&(s=o({},c,{radius:s})),T(this,s),this._latlng=W(t),isNaN(this.options.radius))throw new Error("Circle radius cannot be NaN");this._mRadius=this.options.radius},setRadius:function(t){return this._mRadius=t,this.redraw()},getRadius:function(){return this._mRadius},getBounds:function(){var t=[this._radius,this._radiusY||this._radius];return new ee(this._map.layerPointToLatLng(this._point.subtract(t)),this._map.layerPointToLatLng(this._point.add(t)))},setStyle:Mi.prototype.setStyle,_project:function(){var t=this._latlng.lng,s=this._latlng.lat,c=this._map,p=c.options.crs;if(p.distance===K.distance){var E=Math.PI/180,C=this._mRadius/K.R/E,ie=c.project([s+C,t]),de=c.project([s-C,t]),ye=ie.add(de).divideBy(2),Le=c.unproject(ye).lat,Pe=Math.acos((Math.cos(C*E)-Math.sin(s*E)*Math.sin(Le*E))/(Math.cos(s*E)*Math.cos(Le*E)))/E;(isNaN(Pe)||Pe===0)&&(Pe=C/Math.cos(Math.PI/180*s)),this._point=ye.subtract(c.getPixelOrigin()),this._radius=isNaN(Pe)?0:ye.x-c.project([Le,t-Pe]).x,this._radiusY=ye.y-ie.y}else{var Fe=p.unproject(p.project(this._latlng).subtract([this._mRadius,0]));this._point=c.latLngToLayerPoint(this._latlng),this._radius=this._point.x-c.latLngToLayerPoint(Fe).x}this._updateBounds()}});function Rp(t,s,c){return new wo(t,s,c)}var _i=Mi.extend({options:{smoothFactor:1,noClip:!1},initialize:function(t,s){T(this,s),this._setLatLngs(t)},getLatLngs:function(){return this._latlngs},setLatLngs:function(t){return this._setLatLngs(t),this.redraw()},isEmpty:function(){return!this._latlngs.length},closestLayerPoint:function(t){for(var s=1/0,c=null,p=er,E,C,ie=0,de=this._parts.length;ie<de;ie++)for(var ye=this._parts[ie],Le=1,Pe=ye.length;Le<Pe;Le++){E=ye[Le-1],C=ye[Le];var Fe=p(t,E,C,!0);Fe<s&&(s=Fe,c=p(t,E,C))}return c&&(c.distance=Math.sqrt(s)),c},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return Su(this._defaultShape(),this._map.options.crs)},getBounds:function(){return this._bounds},addLatLng:function(t,s){return s=s||this._defaultShape(),t=W(t),s.push(t),this._bounds.extend(t),this.redraw()},_setLatLngs:function(t){this._bounds=new ee,this._latlngs=this._convertLatLngs(t)},_defaultShape:function(){return Ht(this._latlngs)?this._latlngs:this._latlngs[0]},_convertLatLngs:function(t){for(var s=[],c=Ht(t),p=0,E=t.length;p<E;p++)c?(s[p]=W(t[p]),this._bounds.extend(s[p])):s[p]=this._convertLatLngs(t[p]);return s},_project:function(){var t=new Z;this._rings=[],this._projectLatlngs(this._latlngs,this._rings,t),this._bounds.isValid()&&t.isValid()&&(this._rawPxBounds=t,this._updateBounds())},_updateBounds:function(){var t=this._clickTolerance(),s=new j(t,t);this._rawPxBounds&&(this._pxBounds=new Z([this._rawPxBounds.min.subtract(s),this._rawPxBounds.max.add(s)]))},_projectLatlngs:function(t,s,c){var p=t[0]instanceof G,E=t.length,C,ie;if(p){for(ie=[],C=0;C<E;C++)ie[C]=this._map.latLngToLayerPoint(t[C]),c.extend(ie[C]);s.push(ie)}else for(C=0;C<E;C++)this._projectLatlngs(t[C],s,c)},_clipPoints:function(){var t=this._renderer._bounds;if(this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}var s=this._parts,c,p,E,C,ie,de,ye;for(c=0,E=0,C=this._rings.length;c<C;c++)for(ye=this._rings[c],p=0,ie=ye.length;p<ie-1;p++)de=xu(ye[p],ye[p+1],t,p,!0),de&&(s[E]=s[E]||[],s[E].push(de[0]),(de[1]!==ye[p+1]||p===ie-2)&&(s[E].push(de[1]),E++))}},_simplifyPoints:function(){for(var t=this._parts,s=this.options.smoothFactor,c=0,p=t.length;c<p;c++)t[c]=vu(t[c],s)},_update:function(){this._map&&(this._clipPoints(),this._simplifyPoints(),this._updatePath())},_updatePath:function(){this._renderer._updatePoly(this)},_containsPoint:function(t,s){var c,p,E,C,ie,de,ye=this._clickTolerance();if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(c=0,C=this._parts.length;c<C;c++)for(de=this._parts[c],p=0,ie=de.length,E=ie-1;p<ie;E=p++)if(!(!s&&p===0)&&bu(t,de[E],de[p])<=ye)return!0;return!1}});function Pp(t,s){return new _i(t,s)}_i._flat=Eu;var Sn=_i.extend({options:{fill:!0},isEmpty:function(){return!this._latlngs.length||!this._latlngs[0].length},getCenter:function(){if(!this._map)throw new Error("Must add layer to map before using getCenter()");return yu(this._defaultShape(),this._map.options.crs)},_convertLatLngs:function(t){var s=_i.prototype._convertLatLngs.call(this,t),c=s.length;return c>=2&&s[0]instanceof G&&s[0].equals(s[c-1])&&s.pop(),s},_setLatLngs:function(t){_i.prototype._setLatLngs.call(this,t),Ht(this._latlngs)&&(this._latlngs=[this._latlngs])},_defaultShape:function(){return Ht(this._latlngs[0])?this._latlngs[0]:this._latlngs[0][0]},_clipPoints:function(){var t=this._renderer._bounds,s=this.options.weight,c=new j(s,s);if(t=new Z(t.min.subtract(c),t.max.add(c)),this._parts=[],!(!this._pxBounds||!this._pxBounds.intersects(t))){if(this.options.noClip){this._parts=this._rings;return}for(var p=0,E=this._rings.length,C;p<E;p++)C=_u(this._rings[p],t,!0),C.length&&this._parts.push(C)}},_updatePath:function(){this._renderer._updatePoly(this,!0)},_containsPoint:function(t){var s=!1,c,p,E,C,ie,de,ye,Le;if(!this._pxBounds||!this._pxBounds.contains(t))return!1;for(C=0,ye=this._parts.length;C<ye;C++)for(c=this._parts[C],ie=0,Le=c.length,de=Le-1;ie<Le;de=ie++)p=c[ie],E=c[de],p.y>t.y!=E.y>t.y&&t.x<(E.x-p.x)*(t.y-p.y)/(E.y-p.y)+p.x&&(s=!s);return s||_i.prototype._containsPoint.call(this,t,!0)}});function Cp(t,s){return new Sn(t,s)}var yi=mi.extend({initialize:function(t,s){T(this,s),this._layers={},t&&this.addData(t)},addData:function(t){var s=S(t)?t:t.features,c,p,E;if(s){for(c=0,p=s.length;c<p;c++)E=s[c],(E.geometries||E.geometry||E.features||E.coordinates)&&this.addData(E);return this}var C=this.options;if(C.filter&&!C.filter(t))return this;var ie=is(t,C);return ie?(ie.feature=ss(t),ie.defaultOptions=ie.options,this.resetStyle(ie),C.onEachFeature&&C.onEachFeature(t,ie),this.addLayer(ie)):this},resetStyle:function(t){return t===void 0?this.eachLayer(this.resetStyle,this):(t.options=o({},t.defaultOptions),this._setLayerStyle(t,this.options.style),this)},setStyle:function(t){return this.eachLayer(function(s){this._setLayerStyle(s,t)},this)},_setLayerStyle:function(t,s){t.setStyle&&(typeof s=="function"&&(s=s(t.feature)),t.setStyle(s))}});function is(t,s){var c=t.type==="Feature"?t.geometry:t,p=c?c.coordinates:null,E=[],C=s&&s.pointToLayer,ie=s&&s.coordsToLatLng||xo,de,ye,Le,Pe;if(!p&&!c)return null;switch(c.type){case"Point":return de=ie(p),Iu(C,t,de,s);case"MultiPoint":for(Le=0,Pe=p.length;Le<Pe;Le++)de=ie(p[Le]),E.push(Iu(C,t,de,s));return new mi(E);case"LineString":case"MultiLineString":return ye=ns(p,c.type==="LineString"?0:1,ie),new _i(ye,s);case"Polygon":case"MultiPolygon":return ye=ns(p,c.type==="Polygon"?1:2,ie),new Sn(ye,s);case"GeometryCollection":for(Le=0,Pe=c.geometries.length;Le<Pe;Le++){var Fe=is({geometry:c.geometries[Le],type:"Feature",properties:t.properties},s);Fe&&E.push(Fe)}return new mi(E);case"FeatureCollection":for(Le=0,Pe=c.features.length;Le<Pe;Le++){var He=is(c.features[Le],s);He&&E.push(He)}return new mi(E);default:throw new Error("Invalid GeoJSON object.")}}function Iu(t,s,c,p){return t?t(s,c):new es(c,p&&p.markersInheritOptions&&p)}function xo(t){return new G(t[1],t[0],t[2])}function ns(t,s,c){for(var p=[],E=0,C=t.length,ie;E<C;E++)ie=s?ns(t[E],s-1,c):(c||xo)(t[E]),p.push(ie);return p}function Eo(t,s){return t=W(t),t.alt!==void 0?[h(t.lng,s),h(t.lat,s),h(t.alt,s)]:[h(t.lng,s),h(t.lat,s)]}function rs(t,s,c,p){for(var E=[],C=0,ie=t.length;C<ie;C++)E.push(s?rs(t[C],Ht(t[C])?0:s-1,c,p):Eo(t[C],p));return!s&&c&&E.length>0&&E.push(E[0].slice()),E}function Tn(t,s){return t.feature?o({},t.feature,{geometry:s}):ss(s)}function ss(t){return t.type==="Feature"||t.type==="FeatureCollection"?t:{type:"Feature",properties:{},geometry:t}}var So={toGeoJSON:function(t){return Tn(this,{type:"Point",coordinates:Eo(this.getLatLng(),t)})}};es.include(So),wo.include(So),ts.include(So),_i.include({toGeoJSON:function(t){var s=!Ht(this._latlngs),c=rs(this._latlngs,s?1:0,!1,t);return Tn(this,{type:(s?"Multi":"")+"LineString",coordinates:c})}}),Sn.include({toGeoJSON:function(t){var s=!Ht(this._latlngs),c=s&&!Ht(this._latlngs[0]),p=rs(this._latlngs,c?2:s?1:0,!0,t);return s||(p=[p]),Tn(this,{type:(c?"Multi":"")+"Polygon",coordinates:p})}}),xn.include({toMultiPoint:function(t){var s=[];return this.eachLayer(function(c){s.push(c.toGeoJSON(t).geometry.coordinates)}),Tn(this,{type:"MultiPoint",coordinates:s})},toGeoJSON:function(t){var s=this.feature&&this.feature.geometry&&this.feature.geometry.type;if(s==="MultiPoint")return this.toMultiPoint(t);var c=s==="GeometryCollection",p=[];return this.eachLayer(function(E){if(E.toGeoJSON){var C=E.toGeoJSON(t);if(c)p.push(C.geometry);else{var ie=ss(C);ie.type==="FeatureCollection"?p.push.apply(p,ie.features):p.push(ie)}}}),c?Tn(this,{geometries:p,type:"GeometryCollection"}):{type:"FeatureCollection",features:p}}});function Au(t,s){return new yi(t,s)}var Dp=Au,os=Yt.extend({options:{opacity:1,alt:"",interactive:!1,crossOrigin:!1,errorOverlayUrl:"",zIndex:1,className:""},initialize:function(t,s,c){this._url=t,this._bounds=_e(s),T(this,c)},onAdd:function(){this._image||(this._initImage(),this.options.opacity<1&&this._updateOpacity()),this.options.interactive&&(qe(this._image,"leaflet-interactive"),this.addInteractiveTarget(this._image)),this.getPane().appendChild(this._image),this._reset()},onRemove:function(){ht(this._image),this.options.interactive&&this.removeInteractiveTarget(this._image)},setOpacity:function(t){return this.options.opacity=t,this._image&&this._updateOpacity(),this},setStyle:function(t){return t.opacity&&this.setOpacity(t.opacity),this},bringToFront:function(){return this._map&&bn(this._image),this},bringToBack:function(){return this._map&&wn(this._image),this},setUrl:function(t){return this._url=t,this._image&&(this._image.src=t),this},setBounds:function(t){return this._bounds=_e(t),this._map&&this._reset(),this},getEvents:function(){var t={zoom:this._reset,viewreset:this._reset};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},getBounds:function(){return this._bounds},getElement:function(){return this._image},_initImage:function(){var t=this._url.tagName==="IMG",s=this._image=t?this._url:Ke("img");if(qe(s,"leaflet-image-layer"),this._zoomAnimated&&qe(s,"leaflet-zoom-animated"),this.options.className&&qe(s,this.options.className),s.onselectstart=_,s.onmousemove=_,s.onload=l(this.fire,this,"load"),s.onerror=l(this._overlayOnError,this,"error"),(this.options.crossOrigin||this.options.crossOrigin==="")&&(s.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),this.options.zIndex&&this._updateZIndex(),t){this._url=s.src;return}s.src=this._url,s.alt=this.options.alt},_animateZoom:function(t){var s=this._map.getZoomScale(t.zoom),c=this._map._latLngBoundsToNewLayerBounds(this._bounds,t.zoom,t.center).min;Xi(this._image,c,s)},_reset:function(){var t=this._image,s=new Z(this._map.latLngToLayerPoint(this._bounds.getNorthWest()),this._map.latLngToLayerPoint(this._bounds.getSouthEast())),c=s.getSize();_t(t,s.min),t.style.width=c.x+"px",t.style.height=c.y+"px"},_updateOpacity:function(){Ut(this._image,this.options.opacity)},_updateZIndex:function(){this._image&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._image.style.zIndex=this.options.zIndex)},_overlayOnError:function(){this.fire("error");var t=this.options.errorOverlayUrl;t&&this._url!==t&&(this._url=t,this._image.src=t)},getCenter:function(){return this._bounds.getCenter()}}),kp=function(t,s,c){return new os(t,s,c)},Nu=os.extend({options:{autoplay:!0,loop:!0,keepAspectRatio:!0,muted:!1,playsInline:!0},_initImage:function(){var t=this._url.tagName==="VIDEO",s=this._image=t?this._url:Ke("video");if(qe(s,"leaflet-image-layer"),this._zoomAnimated&&qe(s,"leaflet-zoom-animated"),this.options.className&&qe(s,this.options.className),s.onselectstart=_,s.onmousemove=_,s.onloadeddata=l(this.fire,this,"load"),t){for(var c=s.getElementsByTagName("source"),p=[],E=0;E<c.length;E++)p.push(c[E].src);this._url=c.length>0?p:[s.src];return}S(this._url)||(this._url=[this._url]),!this.options.keepAspectRatio&&Object.prototype.hasOwnProperty.call(s.style,"objectFit")&&(s.style.objectFit="fill"),s.autoplay=!!this.options.autoplay,s.loop=!!this.options.loop,s.muted=!!this.options.muted,s.playsInline=!!this.options.playsInline;for(var C=0;C<this._url.length;C++){var ie=Ke("source");ie.src=this._url[C],s.appendChild(ie)}}});function Mp(t,s,c){return new Nu(t,s,c)}var Ru=os.extend({_initImage:function(){var t=this._image=this._url;qe(t,"leaflet-image-layer"),this._zoomAnimated&&qe(t,"leaflet-zoom-animated"),this.options.className&&qe(t,this.options.className),t.onselectstart=_,t.onmousemove=_}});function Op(t,s,c){return new Ru(t,s,c)}var hi=Yt.extend({options:{interactive:!1,offset:[0,0],className:"",pane:void 0,content:""},initialize:function(t,s){t&&(t instanceof G||S(t))?(this._latlng=W(t),T(this,s)):(T(this,t),this._source=s),this.options.content&&(this._content=this.options.content)},openOn:function(t){return t=arguments.length?t:this._source._map,t.hasLayer(this)||t.addLayer(this),this},close:function(){return this._map&&this._map.removeLayer(this),this},toggle:function(t){return this._map?this.close():(arguments.length?this._source=t:t=this._source,this._prepareOpen(),this.openOn(t._map)),this},onAdd:function(t){this._zoomAnimated=t._zoomAnimated,this._container||this._initLayout(),t._fadeAnimated&&Ut(this._container,0),clearTimeout(this._removeTimeout),this.getPane().appendChild(this._container),this.update(),t._fadeAnimated&&Ut(this._container,1),this.bringToFront(),this.options.interactive&&(qe(this._container,"leaflet-interactive"),this.addInteractiveTarget(this._container))},onRemove:function(t){t._fadeAnimated?(Ut(this._container,0),this._removeTimeout=setTimeout(l(ht,void 0,this._container),200)):ht(this._container),this.options.interactive&&(pt(this._container,"leaflet-interactive"),this.removeInteractiveTarget(this._container))},getLatLng:function(){return this._latlng},setLatLng:function(t){return this._latlng=W(t),this._map&&(this._updatePosition(),this._adjustPan()),this},getContent:function(){return this._content},setContent:function(t){return this._content=t,this.update(),this},getElement:function(){return this._container},update:function(){this._map&&(this._container.style.visibility="hidden",this._updateContent(),this._updateLayout(),this._updatePosition(),this._container.style.visibility="",this._adjustPan())},getEvents:function(){var t={zoom:this._updatePosition,viewreset:this._updatePosition};return this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},isOpen:function(){return!!this._map&&this._map.hasLayer(this)},bringToFront:function(){return this._map&&bn(this._container),this},bringToBack:function(){return this._map&&wn(this._container),this},_prepareOpen:function(t){var s=this._source;if(!s._map)return!1;if(s instanceof mi){s=null;var c=this._source._layers;for(var p in c)if(c[p]._map){s=c[p];break}if(!s)return!1;this._source=s}if(!t)if(s.getCenter)t=s.getCenter();else if(s.getLatLng)t=s.getLatLng();else if(s.getBounds)t=s.getBounds().getCenter();else throw new Error("Unable to get source layer LatLng.");return this.setLatLng(t),this._map&&this.update(),!0},_updateContent:function(){if(this._content){var t=this._contentNode,s=typeof this._content=="function"?this._content(this._source||this):this._content;if(typeof s=="string")t.innerHTML=s;else{for(;t.hasChildNodes();)t.removeChild(t.firstChild);t.appendChild(s)}this.fire("contentupdate")}},_updatePosition:function(){if(this._map){var t=this._map.latLngToLayerPoint(this._latlng),s=I(this.options.offset),c=this._getAnchor();this._zoomAnimated?_t(this._container,t.add(c)):s=s.add(t).add(c);var p=this._containerBottom=-s.y,E=this._containerLeft=-Math.round(this._containerWidth/2)+s.x;this._container.style.bottom=p+"px",this._container.style.left=E+"px"}},_getAnchor:function(){return[0,0]}});Xe.include({_initOverlay:function(t,s,c,p){var E=s;return E instanceof t||(E=new t(p).setContent(s)),c&&E.setLatLng(c),E}}),Yt.include({_initOverlay:function(t,s,c,p){var E=c;return E instanceof t?(T(E,p),E._source=this):(E=s&&!p?s:new t(p,this),E.setContent(c)),E}});var as=hi.extend({options:{pane:"popupPane",offset:[0,7],maxWidth:300,minWidth:50,maxHeight:null,autoPan:!0,autoPanPaddingTopLeft:null,autoPanPaddingBottomRight:null,autoPanPadding:[5,5],keepInView:!1,closeButton:!0,autoClose:!0,closeOnEscapeKey:!0,className:""},openOn:function(t){return t=arguments.length?t:this._source._map,!t.hasLayer(this)&&t._popup&&t._popup.options.autoClose&&t.removeLayer(t._popup),t._popup=this,hi.prototype.openOn.call(this,t)},onAdd:function(t){hi.prototype.onAdd.call(this,t),t.fire("popupopen",{popup:this}),this._source&&(this._source.fire("popupopen",{popup:this},!0),this._source instanceof Mi||this._source.on("preclick",Qi))},onRemove:function(t){hi.prototype.onRemove.call(this,t),t.fire("popupclose",{popup:this}),this._source&&(this._source.fire("popupclose",{popup:this},!0),this._source instanceof Mi||this._source.off("preclick",Qi))},getEvents:function(){var t=hi.prototype.getEvents.call(this);return(this.options.closeOnClick!==void 0?this.options.closeOnClick:this._map.options.closePopupOnClick)&&(t.preclick=this.close),this.options.keepInView&&(t.moveend=this._adjustPan),t},_initLayout:function(){var t="leaflet-popup",s=this._container=Ke("div",t+" "+(this.options.className||"")+" leaflet-zoom-animated"),c=this._wrapper=Ke("div",t+"-content-wrapper",s);if(this._contentNode=Ke("div",t+"-content",c),Kn(s),fo(this._contentNode),Be(s,"contextmenu",Qi),this._tipContainer=Ke("div",t+"-tip-container",s),this._tip=Ke("div",t+"-tip",this._tipContainer),this.options.closeButton){var p=this._closeButton=Ke("a",t+"-close-button",s);p.setAttribute("role","button"),p.setAttribute("aria-label","Close popup"),p.href="#close",p.innerHTML='<span aria-hidden="true">×</span>',Be(p,"click",function(E){Et(E),this.close()},this)}},_updateLayout:function(){var t=this._contentNode,s=t.style;s.width="",s.whiteSpace="nowrap";var c=t.offsetWidth;c=Math.min(c,this.options.maxWidth),c=Math.max(c,this.options.minWidth),s.width=c+1+"px",s.whiteSpace="",s.height="";var p=t.offsetHeight,E=this.options.maxHeight,C="leaflet-popup-scrolled";E&&p>E?(s.height=E+"px",qe(t,C)):pt(t,C),this._containerWidth=this._container.offsetWidth},_animateZoom:function(t){var s=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center),c=this._getAnchor();_t(this._container,s.add(c))},_adjustPan:function(){if(this.options.autoPan){if(this._map._panAnim&&this._map._panAnim.stop(),this._autopanning){this._autopanning=!1;return}var t=this._map,s=parseInt(Zn(this._container,"marginBottom"),10)||0,c=this._container.offsetHeight+s,p=this._containerWidth,E=new j(this._containerLeft,-c-this._containerBottom);E._add(Ji(this._container));var C=t.layerPointToContainerPoint(E),ie=I(this.options.autoPanPadding),de=I(this.options.autoPanPaddingTopLeft||ie),ye=I(this.options.autoPanPaddingBottomRight||ie),Le=t.getSize(),Pe=0,Fe=0;C.x+p+ye.x>Le.x&&(Pe=C.x+p-Le.x+ye.x),C.x-Pe-de.x<0&&(Pe=C.x-de.x),C.y+c+ye.y>Le.y&&(Fe=C.y+c-Le.y+ye.y),C.y-Fe-de.y<0&&(Fe=C.y-de.y),(Pe||Fe)&&(this.options.keepInView&&(this._autopanning=!0),t.fire("autopanstart").panBy([Pe,Fe]))}},_getAnchor:function(){return I(this._source&&this._source._getPopupAnchor?this._source._getPopupAnchor():[0,0])}}),Fp=function(t,s){return new as(t,s)};Xe.mergeOptions({closePopupOnClick:!0}),Xe.include({openPopup:function(t,s,c){return this._initOverlay(as,t,s,c).openOn(this),this},closePopup:function(t){return t=arguments.length?t:this._popup,t&&t.close(),this}}),Yt.include({bindPopup:function(t,s){return this._popup=this._initOverlay(as,this._popup,t,s),this._popupHandlersAdded||(this.on({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!0),this},unbindPopup:function(){return this._popup&&(this.off({click:this._openPopup,keypress:this._onKeyPress,remove:this.closePopup,move:this._movePopup}),this._popupHandlersAdded=!1,this._popup=null),this},openPopup:function(t){return this._popup&&(this instanceof mi||(this._popup._source=this),this._popup._prepareOpen(t||this._latlng)&&this._popup.openOn(this._map)),this},closePopup:function(){return this._popup&&this._popup.close(),this},togglePopup:function(){return this._popup&&this._popup.toggle(this),this},isPopupOpen:function(){return this._popup?this._popup.isOpen():!1},setPopupContent:function(t){return this._popup&&this._popup.setContent(t),this},getPopup:function(){return this._popup},_openPopup:function(t){if(!(!this._popup||!this._map)){Ki(t);var s=t.layer||t.target;if(this._popup._source===s&&!(s instanceof Mi)){this._map.hasLayer(this._popup)?this.closePopup():this.openPopup(t.latlng);return}this._popup._source=s,this.openPopup(t.latlng)}},_movePopup:function(t){this._popup.setLatLng(t.latlng)},_onKeyPress:function(t){t.originalEvent.keyCode===13&&this._openPopup(t)}});var ls=hi.extend({options:{pane:"tooltipPane",offset:[0,0],direction:"auto",permanent:!1,sticky:!1,opacity:.9},onAdd:function(t){hi.prototype.onAdd.call(this,t),this.setOpacity(this.options.opacity),t.fire("tooltipopen",{tooltip:this}),this._source&&(this.addEventParent(this._source),this._source.fire("tooltipopen",{tooltip:this},!0))},onRemove:function(t){hi.prototype.onRemove.call(this,t),t.fire("tooltipclose",{tooltip:this}),this._source&&(this.removeEventParent(this._source),this._source.fire("tooltipclose",{tooltip:this},!0))},getEvents:function(){var t=hi.prototype.getEvents.call(this);return this.options.permanent||(t.preclick=this.close),t},_initLayout:function(){var t="leaflet-tooltip",s=t+" "+(this.options.className||"")+" leaflet-zoom-"+(this._zoomAnimated?"animated":"hide");this._contentNode=this._container=Ke("div",s),this._container.setAttribute("role","tooltip"),this._container.setAttribute("id","leaflet-tooltip-"+f(this))},_updateLayout:function(){},_adjustPan:function(){},_setPosition:function(t){var s,c,p=this._map,E=this._container,C=p.latLngToContainerPoint(p.getCenter()),ie=p.layerPointToContainerPoint(t),de=this.options.direction,ye=E.offsetWidth,Le=E.offsetHeight,Pe=I(this.options.offset),Fe=this._getAnchor();de==="top"?(s=ye/2,c=Le):de==="bottom"?(s=ye/2,c=0):de==="center"?(s=ye/2,c=Le/2):de==="right"?(s=0,c=Le/2):de==="left"?(s=ye,c=Le/2):ie.x<C.x?(de="right",s=0,c=Le/2):(de="left",s=ye+(Pe.x+Fe.x)*2,c=Le/2),t=t.subtract(I(s,c,!0)).add(Pe).add(Fe),pt(E,"leaflet-tooltip-right"),pt(E,"leaflet-tooltip-left"),pt(E,"leaflet-tooltip-top"),pt(E,"leaflet-tooltip-bottom"),qe(E,"leaflet-tooltip-"+de),_t(E,t)},_updatePosition:function(){var t=this._map.latLngToLayerPoint(this._latlng);this._setPosition(t)},setOpacity:function(t){this.options.opacity=t,this._container&&Ut(this._container,t)},_animateZoom:function(t){var s=this._map._latLngToNewLayerPoint(this._latlng,t.zoom,t.center);this._setPosition(s)},_getAnchor:function(){return I(this._source&&this._source._getTooltipAnchor&&!this.options.sticky?this._source._getTooltipAnchor():[0,0])}}),jp=function(t,s){return new ls(t,s)};Xe.include({openTooltip:function(t,s,c){return this._initOverlay(ls,t,s,c).openOn(this),this},closeTooltip:function(t){return t.close(),this}}),Yt.include({bindTooltip:function(t,s){return this._tooltip&&this.isTooltipOpen()&&this.unbindTooltip(),this._tooltip=this._initOverlay(ls,this._tooltip,t,s),this._initTooltipInteractions(),this._tooltip.options.permanent&&this._map&&this._map.hasLayer(this)&&this.openTooltip(),this},unbindTooltip:function(){return this._tooltip&&(this._initTooltipInteractions(!0),this.closeTooltip(),this._tooltip=null),this},_initTooltipInteractions:function(t){if(!(!t&&this._tooltipHandlersAdded)){var s=t?"off":"on",c={remove:this.closeTooltip,move:this._moveTooltip};this._tooltip.options.permanent?c.add=this._openTooltip:(c.mouseover=this._openTooltip,c.mouseout=this.closeTooltip,c.click=this._openTooltip,this._map?this._addFocusListeners():c.add=this._addFocusListeners),this._tooltip.options.sticky&&(c.mousemove=this._moveTooltip),this[s](c),this._tooltipHandlersAdded=!t}},openTooltip:function(t){return this._tooltip&&(this instanceof mi||(this._tooltip._source=this),this._tooltip._prepareOpen(t)&&(this._tooltip.openOn(this._map),this.getElement?this._setAriaDescribedByOnLayer(this):this.eachLayer&&this.eachLayer(this._setAriaDescribedByOnLayer,this))),this},closeTooltip:function(){if(this._tooltip)return this._tooltip.close()},toggleTooltip:function(){return this._tooltip&&this._tooltip.toggle(this),this},isTooltipOpen:function(){return this._tooltip.isOpen()},setTooltipContent:function(t){return this._tooltip&&this._tooltip.setContent(t),this},getTooltip:function(){return this._tooltip},_addFocusListeners:function(){this.getElement?this._addFocusListenersOnLayer(this):this.eachLayer&&this.eachLayer(this._addFocusListenersOnLayer,this)},_addFocusListenersOnLayer:function(t){var s=typeof t.getElement=="function"&&t.getElement();s&&(Be(s,"focus",function(){this._tooltip._source=t,this.openTooltip()},this),Be(s,"blur",this.closeTooltip,this))},_setAriaDescribedByOnLayer:function(t){var s=typeof t.getElement=="function"&&t.getElement();s&&s.setAttribute("aria-describedby",this._tooltip._container.id)},_openTooltip:function(t){if(!(!this._tooltip||!this._map)){if(this._map.dragging&&this._map.dragging.moving()&&!this._openOnceFlag){this._openOnceFlag=!0;var s=this;this._map.once("moveend",function(){s._openOnceFlag=!1,s._openTooltip(t)});return}this._tooltip._source=t.layer||t.target,this.openTooltip(this._tooltip.options.sticky?t.latlng:void 0)}},_moveTooltip:function(t){var s=t.latlng,c,p;this._tooltip.options.sticky&&t.originalEvent&&(c=this._map.mouseEventToContainerPoint(t.originalEvent),p=this._map.containerPointToLayerPoint(c),s=this._map.layerPointToLatLng(p)),this._tooltip.setLatLng(s)}});var Pu=En.extend({options:{iconSize:[12,12],html:!1,bgPos:null,className:"leaflet-div-icon"},createIcon:function(t){var s=t&&t.tagName==="DIV"?t:document.createElement("div"),c=this.options;if(c.html instanceof Element?(Zr(s),s.appendChild(c.html)):s.innerHTML=c.html!==!1?c.html:"",c.bgPos){var p=I(c.bgPos);s.style.backgroundPosition=-p.x+"px "+-p.y+"px"}return this._setIconStyles(s,"icon"),s},createShadow:function(){return null}});function $p(t){return new Pu(t)}En.Default=tr;var ir=Yt.extend({options:{tileSize:256,opacity:1,updateWhenIdle:De.mobile,updateWhenZooming:!0,updateInterval:200,zIndex:1,bounds:null,minZoom:0,maxZoom:void 0,maxNativeZoom:void 0,minNativeZoom:void 0,noWrap:!1,pane:"tilePane",className:"",keepBuffer:2},initialize:function(t){T(this,t)},onAdd:function(){this._initContainer(),this._levels={},this._tiles={},this._resetView()},beforeAdd:function(t){t._addZoomLimit(this)},onRemove:function(t){this._removeAllTiles(),ht(this._container),t._removeZoomLimit(this),this._container=null,this._tileZoom=void 0},bringToFront:function(){return this._map&&(bn(this._container),this._setAutoZIndex(Math.max)),this},bringToBack:function(){return this._map&&(wn(this._container),this._setAutoZIndex(Math.min)),this},getContainer:function(){return this._container},setOpacity:function(t){return this.options.opacity=t,this._updateOpacity(),this},setZIndex:function(t){return this.options.zIndex=t,this._updateZIndex(),this},isLoading:function(){return this._loading},redraw:function(){if(this._map){this._removeAllTiles();var t=this._clampZoom(this._map.getZoom());t!==this._tileZoom&&(this._tileZoom=t,this._updateLevels()),this._update()}return this},getEvents:function(){var t={viewprereset:this._invalidateAll,viewreset:this._resetView,zoom:this._resetView,moveend:this._onMoveEnd};return this.options.updateWhenIdle||(this._onMove||(this._onMove=d(this._onMoveEnd,this.options.updateInterval,this)),t.move=this._onMove),this._zoomAnimated&&(t.zoomanim=this._animateZoom),t},createTile:function(){return document.createElement("div")},getTileSize:function(){var t=this.options.tileSize;return t instanceof j?t:new j(t,t)},_updateZIndex:function(){this._container&&this.options.zIndex!==void 0&&this.options.zIndex!==null&&(this._container.style.zIndex=this.options.zIndex)},_setAutoZIndex:function(t){for(var s=this.getPane().children,c=-t(-1/0,1/0),p=0,E=s.length,C;p<E;p++)C=s[p].style.zIndex,s[p]!==this._container&&C&&(c=t(c,+C));isFinite(c)&&(this.options.zIndex=c+t(-1,1),this._updateZIndex())},_updateOpacity:function(){if(this._map&&!De.ielt9){Ut(this._container,this.options.opacity);var t=+new Date,s=!1,c=!1;for(var p in this._tiles){var E=this._tiles[p];if(!(!E.current||!E.loaded)){var C=Math.min(1,(t-E.loaded)/200);Ut(E.el,C),C<1?s=!0:(E.active?c=!0:this._onOpaqueTile(E),E.active=!0)}}c&&!this._noPrune&&this._pruneTiles(),s&&(X(this._fadeFrame),this._fadeFrame=q(this._updateOpacity,this))}},_onOpaqueTile:_,_initContainer:function(){this._container||(this._container=Ke("div","leaflet-layer "+(this.options.className||"")),this._updateZIndex(),this.options.opacity<1&&this._updateOpacity(),this.getPane().appendChild(this._container))},_updateLevels:function(){var t=this._tileZoom,s=this.options.maxZoom;if(t!==void 0){for(var c in this._levels)c=Number(c),this._levels[c].el.children.length||c===t?(this._levels[c].el.style.zIndex=s-Math.abs(t-c),this._onUpdateLevel(c)):(ht(this._levels[c].el),this._removeTilesAtZoom(c),this._onRemoveLevel(c),delete this._levels[c]);var p=this._levels[t],E=this._map;return p||(p=this._levels[t]={},p.el=Ke("div","leaflet-tile-container leaflet-zoom-animated",this._container),p.el.style.zIndex=s,p.origin=E.project(E.unproject(E.getPixelOrigin()),t).round(),p.zoom=t,this._setZoomTransform(p,E.getCenter(),E.getZoom()),_(p.el.offsetWidth),this._onCreateLevel(p)),this._level=p,p}},_onUpdateLevel:_,_onRemoveLevel:_,_onCreateLevel:_,_pruneTiles:function(){if(this._map){var t,s,c=this._map.getZoom();if(c>this.options.maxZoom||c<this.options.minZoom){this._removeAllTiles();return}for(t in this._tiles)s=this._tiles[t],s.retain=s.current;for(t in this._tiles)if(s=this._tiles[t],s.current&&!s.active){var p=s.coords;this._retainParent(p.x,p.y,p.z,p.z-5)||this._retainChildren(p.x,p.y,p.z,p.z+2)}for(t in this._tiles)this._tiles[t].retain||this._removeTile(t)}},_removeTilesAtZoom:function(t){for(var s in this._tiles)this._tiles[s].coords.z===t&&this._removeTile(s)},_removeAllTiles:function(){for(var t in this._tiles)this._removeTile(t)},_invalidateAll:function(){for(var t in this._levels)ht(this._levels[t].el),this._onRemoveLevel(Number(t)),delete this._levels[t];this._removeAllTiles(),this._tileZoom=void 0},_retainParent:function(t,s,c,p){var E=Math.floor(t/2),C=Math.floor(s/2),ie=c-1,de=new j(+E,+C);de.z=+ie;var ye=this._tileCoordsToKey(de),Le=this._tiles[ye];return Le&&Le.active?(Le.retain=!0,!0):(Le&&Le.loaded&&(Le.retain=!0),ie>p?this._retainParent(E,C,ie,p):!1)},_retainChildren:function(t,s,c,p){for(var E=2*t;E<2*t+2;E++)for(var C=2*s;C<2*s+2;C++){var ie=new j(E,C);ie.z=c+1;var de=this._tileCoordsToKey(ie),ye=this._tiles[de];if(ye&&ye.active){ye.retain=!0;continue}else ye&&ye.loaded&&(ye.retain=!0);c+1<p&&this._retainChildren(E,C,c+1,p)}},_resetView:function(t){var s=t&&(t.pinch||t.flyTo);this._setView(this._map.getCenter(),this._map.getZoom(),s,s)},_animateZoom:function(t){this._setView(t.center,t.zoom,!0,t.noUpdate)},_clampZoom:function(t){var s=this.options;return s.minNativeZoom!==void 0&&t<s.minNativeZoom?s.minNativeZoom:s.maxNativeZoom!==void 0&&s.maxNativeZoom<t?s.maxNativeZoom:t},_setView:function(t,s,c,p){var E=Math.round(s);this.options.maxZoom!==void 0&&E>this.options.maxZoom||this.options.minZoom!==void 0&&E<this.options.minZoom?E=void 0:E=this._clampZoom(E);var C=this.options.updateWhenZooming&&E!==this._tileZoom;(!p||C)&&(this._tileZoom=E,this._abortLoading&&this._abortLoading(),this._updateLevels(),this._resetGrid(),E!==void 0&&this._update(t),c||this._pruneTiles(),this._noPrune=!!c),this._setZoomTransforms(t,s)},_setZoomTransforms:function(t,s){for(var c in this._levels)this._setZoomTransform(this._levels[c],t,s)},_setZoomTransform:function(t,s,c){var p=this._map.getZoomScale(c,t.zoom),E=t.origin.multiplyBy(p).subtract(this._map._getNewPixelOrigin(s,c)).round();De.any3d?Xi(t.el,E,p):_t(t.el,E)},_resetGrid:function(){var t=this._map,s=t.options.crs,c=this._tileSize=this.getTileSize(),p=this._tileZoom,E=this._map.getPixelWorldBounds(this._tileZoom);E&&(this._globalTileRange=this._pxBoundsToTileRange(E)),this._wrapX=s.wrapLng&&!this.options.noWrap&&[Math.floor(t.project([0,s.wrapLng[0]],p).x/c.x),Math.ceil(t.project([0,s.wrapLng[1]],p).x/c.y)],this._wrapY=s.wrapLat&&!this.options.noWrap&&[Math.floor(t.project([s.wrapLat[0],0],p).y/c.x),Math.ceil(t.project([s.wrapLat[1],0],p).y/c.y)]},_onMoveEnd:function(){!this._map||this._map._animatingZoom||this._update()},_getTiledPixelBounds:function(t){var s=this._map,c=s._animatingZoom?Math.max(s._animateToZoom,s.getZoom()):s.getZoom(),p=s.getZoomScale(c,this._tileZoom),E=s.project(t,this._tileZoom).floor(),C=s.getSize().divideBy(p*2);return new Z(E.subtract(C),E.add(C))},_update:function(t){var s=this._map;if(s){var c=this._clampZoom(s.getZoom());if(t===void 0&&(t=s.getCenter()),this._tileZoom!==void 0){var p=this._getTiledPixelBounds(t),E=this._pxBoundsToTileRange(p),C=E.getCenter(),ie=[],de=this.options.keepBuffer,ye=new Z(E.getBottomLeft().subtract([de,-de]),E.getTopRight().add([de,-de]));if(!(isFinite(E.min.x)&&isFinite(E.min.y)&&isFinite(E.max.x)&&isFinite(E.max.y)))throw new Error("Attempted to load an infinite number of tiles");for(var Le in this._tiles){var Pe=this._tiles[Le].coords;(Pe.z!==this._tileZoom||!ye.contains(new j(Pe.x,Pe.y)))&&(this._tiles[Le].current=!1)}if(Math.abs(c-this._tileZoom)>1){this._setView(t,c);return}for(var Fe=E.min.y;Fe<=E.max.y;Fe++)for(var He=E.min.x;He<=E.max.x;He++){var Rt=new j(He,Fe);if(Rt.z=this._tileZoom,!!this._isValidTile(Rt)){var xt=this._tiles[this._tileCoordsToKey(Rt)];xt?xt.current=!0:ie.push(Rt)}}if(ie.sort(function(kt,In){return kt.distanceTo(C)-In.distanceTo(C)}),ie.length!==0){this._loading||(this._loading=!0,this.fire("loading"));var Vt=document.createDocumentFragment();for(He=0;He<ie.length;He++)this._addTile(ie[He],Vt);this._level.el.appendChild(Vt)}}}},_isValidTile:function(t){var s=this._map.options.crs;if(!s.infinite){var c=this._globalTileRange;if(!s.wrapLng&&(t.x<c.min.x||t.x>c.max.x)||!s.wrapLat&&(t.y<c.min.y||t.y>c.max.y))return!1}if(!this.options.bounds)return!0;var p=this._tileCoordsToBounds(t);return _e(this.options.bounds).overlaps(p)},_keyToBounds:function(t){return this._tileCoordsToBounds(this._keyToTileCoords(t))},_tileCoordsToNwSe:function(t){var s=this._map,c=this.getTileSize(),p=t.scaleBy(c),E=p.add(c),C=s.unproject(p,t.z),ie=s.unproject(E,t.z);return[C,ie]},_tileCoordsToBounds:function(t){var s=this._tileCoordsToNwSe(t),c=new ee(s[0],s[1]);return this.options.noWrap||(c=this._map.wrapLatLngBounds(c)),c},_tileCoordsToKey:function(t){return t.x+":"+t.y+":"+t.z},_keyToTileCoords:function(t){var s=t.split(":"),c=new j(+s[0],+s[1]);return c.z=+s[2],c},_removeTile:function(t){var s=this._tiles[t];s&&(ht(s.el),delete this._tiles[t],this.fire("tileunload",{tile:s.el,coords:this._keyToTileCoords(t)}))},_initTile:function(t){qe(t,"leaflet-tile");var s=this.getTileSize();t.style.width=s.x+"px",t.style.height=s.y+"px",t.onselectstart=_,t.onmousemove=_,De.ielt9&&this.options.opacity<1&&Ut(t,this.options.opacity)},_addTile:function(t,s){var c=this._getTilePos(t),p=this._tileCoordsToKey(t),E=this.createTile(this._wrapCoords(t),l(this._tileReady,this,t));this._initTile(E),this.createTile.length<2&&q(l(this._tileReady,this,t,null,E)),_t(E,c),this._tiles[p]={el:E,coords:t,current:!0},s.appendChild(E),this.fire("tileloadstart",{tile:E,coords:t})},_tileReady:function(t,s,c){s&&this.fire("tileerror",{error:s,tile:c,coords:t});var p=this._tileCoordsToKey(t);c=this._tiles[p],c&&(c.loaded=+new Date,this._map._fadeAnimated?(Ut(c.el,0),X(this._fadeFrame),this._fadeFrame=q(this._updateOpacity,this)):(c.active=!0,this._pruneTiles()),s||(qe(c.el,"leaflet-tile-loaded"),this.fire("tileload",{tile:c.el,coords:t})),this._noTilesToLoad()&&(this._loading=!1,this.fire("load"),De.ielt9||!this._map._fadeAnimated?q(this._pruneTiles,this):setTimeout(l(this._pruneTiles,this),250)))},_getTilePos:function(t){return t.scaleBy(this.getTileSize()).subtract(this._level.origin)},_wrapCoords:function(t){var s=new j(this._wrapX?g(t.x,this._wrapX):t.x,this._wrapY?g(t.y,this._wrapY):t.y);return s.z=t.z,s},_pxBoundsToTileRange:function(t){var s=this.getTileSize();return new Z(t.min.unscaleBy(s).floor(),t.max.unscaleBy(s).ceil().subtract([1,1]))},_noTilesToLoad:function(){for(var t in this._tiles)if(!this._tiles[t].loaded)return!1;return!0}});function Bp(t){return new ir(t)}var Ln=ir.extend({options:{minZoom:0,maxZoom:18,subdomains:"abc",errorTileUrl:"",zoomOffset:0,tms:!1,zoomReverse:!1,detectRetina:!1,crossOrigin:!1,referrerPolicy:!1},initialize:function(t,s){this._url=t,s=T(this,s),s.detectRetina&&De.retina&&s.maxZoom>0?(s.tileSize=Math.floor(s.tileSize/2),s.zoomReverse?(s.zoomOffset--,s.minZoom=Math.min(s.maxZoom,s.minZoom+1)):(s.zoomOffset++,s.maxZoom=Math.max(s.minZoom,s.maxZoom-1)),s.minZoom=Math.max(0,s.minZoom)):s.zoomReverse?s.minZoom=Math.min(s.maxZoom,s.minZoom):s.maxZoom=Math.max(s.minZoom,s.maxZoom),typeof s.subdomains=="string"&&(s.subdomains=s.subdomains.split("")),this.on("tileunload",this._onTileRemove)},setUrl:function(t,s){return this._url===t&&s===void 0&&(s=!0),this._url=t,s||this.redraw(),this},createTile:function(t,s){var c=document.createElement("img");return Be(c,"load",l(this._tileOnLoad,this,s,c)),Be(c,"error",l(this._tileOnError,this,s,c)),(this.options.crossOrigin||this.options.crossOrigin==="")&&(c.crossOrigin=this.options.crossOrigin===!0?"":this.options.crossOrigin),typeof this.options.referrerPolicy=="string"&&(c.referrerPolicy=this.options.referrerPolicy),c.alt="",c.src=this.getTileUrl(t),c},getTileUrl:function(t){var s={r:De.retina?"@2x":"",s:this._getSubdomain(t),x:t.x,y:t.y,z:this._getZoomForUrl()};if(this._map&&!this._map.options.crs.infinite){var c=this._globalTileRange.max.y-t.y;this.options.tms&&(s.y=c),s["-y"]=c}return R(this._url,o(s,this.options))},_tileOnLoad:function(t,s){De.ielt9?setTimeout(l(t,this,null,s),0):t(null,s)},_tileOnError:function(t,s,c){var p=this.options.errorTileUrl;p&&s.getAttribute("src")!==p&&(s.src=p),t(c,s)},_onTileRemove:function(t){t.tile.onload=null},_getZoomForUrl:function(){var t=this._tileZoom,s=this.options.maxZoom,c=this.options.zoomReverse,p=this.options.zoomOffset;return c&&(t=s-t),t+p},_getSubdomain:function(t){var s=Math.abs(t.x+t.y)%this.options.subdomains.length;return this.options.subdomains[s]},_abortLoading:function(){var t,s;for(t in this._tiles)if(this._tiles[t].coords.z!==this._tileZoom&&(s=this._tiles[t].el,s.onload=_,s.onerror=_,!s.complete)){s.src=x;var c=this._tiles[t].coords;ht(s),delete this._tiles[t],this.fire("tileabort",{tile:s,coords:c})}},_removeTile:function(t){var s=this._tiles[t];if(s)return s.el.setAttribute("src",x),ir.prototype._removeTile.call(this,t)},_tileReady:function(t,s,c){if(!(!this._map||c&&c.getAttribute("src")===x))return ir.prototype._tileReady.call(this,t,s,c)}});function Cu(t,s){return new Ln(t,s)}var Du=Ln.extend({defaultWmsParams:{service:"WMS",request:"GetMap",layers:"",styles:"",format:"image/jpeg",transparent:!1,version:"1.1.1"},options:{crs:null,uppercase:!1},initialize:function(t,s){this._url=t;var c=o({},this.defaultWmsParams);for(var p in s)p in this.options||(c[p]=s[p]);s=T(this,s);var E=s.detectRetina&&De.retina?2:1,C=this.getTileSize();c.width=C.x*E,c.height=C.y*E,this.wmsParams=c},onAdd:function(t){this._crs=this.options.crs||t.options.crs,this._wmsVersion=parseFloat(this.wmsParams.version);var s=this._wmsVersion>=1.3?"crs":"srs";this.wmsParams[s]=this._crs.code,Ln.prototype.onAdd.call(this,t)},getTileUrl:function(t){var s=this._tileCoordsToNwSe(t),c=this._crs,p=ne(c.project(s[0]),c.project(s[1])),E=p.min,C=p.max,ie=(this._wmsVersion>=1.3&&this._crs===Tu?[E.y,E.x,C.y,C.x]:[E.x,E.y,C.x,C.y]).join(","),de=Ln.prototype.getTileUrl.call(this,t);return de+A(this.wmsParams,de,this.options.uppercase)+(this.options.uppercase?"&BBOX=":"&bbox=")+ie},setParams:function(t,s){return o(this.wmsParams,t),s||this.redraw(),this}});function qp(t,s){return new Du(t,s)}Ln.WMS=Du,Cu.wms=qp;var vi=Yt.extend({options:{padding:.1},initialize:function(t){T(this,t),f(this),this._layers=this._layers||{}},onAdd:function(){this._container||(this._initContainer(),qe(this._container,"leaflet-zoom-animated")),this.getPane().appendChild(this._container),this._update(),this.on("update",this._updatePaths,this)},onRemove:function(){this.off("update",this._updatePaths,this),this._destroyContainer()},getEvents:function(){var t={viewreset:this._reset,zoom:this._onZoom,moveend:this._update,zoomend:this._onZoomEnd};return this._zoomAnimated&&(t.zoomanim=this._onAnimZoom),t},_onAnimZoom:function(t){this._updateTransform(t.center,t.zoom)},_onZoom:function(){this._updateTransform(this._map.getCenter(),this._map.getZoom())},_updateTransform:function(t,s){var c=this._map.getZoomScale(s,this._zoom),p=this._map.getSize().multiplyBy(.5+this.options.padding),E=this._map.project(this._center,s),C=p.multiplyBy(-c).add(E).subtract(this._map._getNewPixelOrigin(t,s));De.any3d?Xi(this._container,C,c):_t(this._container,C)},_reset:function(){this._update(),this._updateTransform(this._center,this._zoom);for(var t in this._layers)this._layers[t]._reset()},_onZoomEnd:function(){for(var t in this._layers)this._layers[t]._project()},_updatePaths:function(){for(var t in this._layers)this._layers[t]._update()},_update:function(){var t=this.options.padding,s=this._map.getSize(),c=this._map.containerPointToLayerPoint(s.multiplyBy(-t)).round();this._bounds=new Z(c,c.add(s.multiplyBy(1+t*2)).round()),this._center=this._map.getCenter(),this._zoom=this._map.getZoom()}}),ku=vi.extend({options:{tolerance:0},getEvents:function(){var t=vi.prototype.getEvents.call(this);return t.viewprereset=this._onViewPreReset,t},_onViewPreReset:function(){this._postponeUpdatePaths=!0},onAdd:function(){vi.prototype.onAdd.call(this),this._draw()},_initContainer:function(){var t=this._container=document.createElement("canvas");Be(t,"mousemove",this._onMouseMove,this),Be(t,"click dblclick mousedown mouseup contextmenu",this._onClick,this),Be(t,"mouseout",this._handleMouseOut,this),t._leaflet_disable_events=!0,this._ctx=t.getContext("2d")},_destroyContainer:function(){X(this._redrawRequest),delete this._ctx,ht(this._container),st(this._container),delete this._container},_updatePaths:function(){if(!this._postponeUpdatePaths){var t;this._redrawBounds=null;for(var s in this._layers)t=this._layers[s],t._update();this._redraw()}},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){vi.prototype._update.call(this);var t=this._bounds,s=this._container,c=t.getSize(),p=De.retina?2:1;_t(s,t.min),s.width=p*c.x,s.height=p*c.y,s.style.width=c.x+"px",s.style.height=c.y+"px",De.retina&&this._ctx.scale(2,2),this._ctx.translate(-t.min.x,-t.min.y),this.fire("update")}},_reset:function(){vi.prototype._reset.call(this),this._postponeUpdatePaths&&(this._postponeUpdatePaths=!1,this._updatePaths())},_initPath:function(t){this._updateDashArray(t),this._layers[f(t)]=t;var s=t._order={layer:t,prev:this._drawLast,next:null};this._drawLast&&(this._drawLast.next=s),this._drawLast=s,this._drawFirst=this._drawFirst||this._drawLast},_addPath:function(t){this._requestRedraw(t)},_removePath:function(t){var s=t._order,c=s.next,p=s.prev;c?c.prev=p:this._drawLast=p,p?p.next=c:this._drawFirst=c,delete t._order,delete this._layers[f(t)],this._requestRedraw(t)},_updatePath:function(t){this._extendRedrawBounds(t),t._project(),t._update(),this._requestRedraw(t)},_updateStyle:function(t){this._updateDashArray(t),this._requestRedraw(t)},_updateDashArray:function(t){if(typeof t.options.dashArray=="string"){var s=t.options.dashArray.split(/[, ]+/),c=[],p,E;for(E=0;E<s.length;E++){if(p=Number(s[E]),isNaN(p))return;c.push(p)}t.options._dashArray=c}else t.options._dashArray=t.options.dashArray},_requestRedraw:function(t){this._map&&(this._extendRedrawBounds(t),this._redrawRequest=this._redrawRequest||q(this._redraw,this))},_extendRedrawBounds:function(t){if(t._pxBounds){var s=(t.options.weight||0)+1;this._redrawBounds=this._redrawBounds||new Z,this._redrawBounds.extend(t._pxBounds.min.subtract([s,s])),this._redrawBounds.extend(t._pxBounds.max.add([s,s]))}},_redraw:function(){this._redrawRequest=null,this._redrawBounds&&(this._redrawBounds.min._floor(),this._redrawBounds.max._ceil()),this._clear(),this._draw(),this._redrawBounds=null},_clear:function(){var t=this._redrawBounds;if(t){var s=t.getSize();this._ctx.clearRect(t.min.x,t.min.y,s.x,s.y)}else this._ctx.save(),this._ctx.setTransform(1,0,0,1,0,0),this._ctx.clearRect(0,0,this._container.width,this._container.height),this._ctx.restore()},_draw:function(){var t,s=this._redrawBounds;if(this._ctx.save(),s){var c=s.getSize();this._ctx.beginPath(),this._ctx.rect(s.min.x,s.min.y,c.x,c.y),this._ctx.clip()}this._drawing=!0;for(var p=this._drawFirst;p;p=p.next)t=p.layer,(!s||t._pxBounds&&t._pxBounds.intersects(s))&&t._updatePath();this._drawing=!1,this._ctx.restore()},_updatePoly:function(t,s){if(this._drawing){var c,p,E,C,ie=t._parts,de=ie.length,ye=this._ctx;if(de){for(ye.beginPath(),c=0;c<de;c++){for(p=0,E=ie[c].length;p<E;p++)C=ie[c][p],ye[p?"lineTo":"moveTo"](C.x,C.y);s&&ye.closePath()}this._fillStroke(ye,t)}}},_updateCircle:function(t){if(!(!this._drawing||t._empty())){var s=t._point,c=this._ctx,p=Math.max(Math.round(t._radius),1),E=(Math.max(Math.round(t._radiusY),1)||p)/p;E!==1&&(c.save(),c.scale(1,E)),c.beginPath(),c.arc(s.x,s.y/E,p,0,Math.PI*2,!1),E!==1&&c.restore(),this._fillStroke(c,t)}},_fillStroke:function(t,s){var c=s.options;c.fill&&(t.globalAlpha=c.fillOpacity,t.fillStyle=c.fillColor||c.color,t.fill(c.fillRule||"evenodd")),c.stroke&&c.weight!==0&&(t.setLineDash&&t.setLineDash(s.options&&s.options._dashArray||[]),t.globalAlpha=c.opacity,t.lineWidth=c.weight,t.strokeStyle=c.color,t.lineCap=c.lineCap,t.lineJoin=c.lineJoin,t.stroke())},_onClick:function(t){for(var s=this._map.mouseEventToLayerPoint(t),c,p,E=this._drawFirst;E;E=E.next)c=E.layer,c.options.interactive&&c._containsPoint(s)&&(!(t.type==="click"||t.type==="preclick")||!this._map._draggableMoved(c))&&(p=c);this._fireEvent(p?[p]:!1,t)},_onMouseMove:function(t){if(!(!this._map||this._map.dragging.moving()||this._map._animatingZoom)){var s=this._map.mouseEventToLayerPoint(t);this._handleMouseHover(t,s)}},_handleMouseOut:function(t){var s=this._hoveredLayer;s&&(pt(this._container,"leaflet-interactive"),this._fireEvent([s],t,"mouseout"),this._hoveredLayer=null,this._mouseHoverThrottled=!1)},_handleMouseHover:function(t,s){if(!this._mouseHoverThrottled){for(var c,p,E=this._drawFirst;E;E=E.next)c=E.layer,c.options.interactive&&c._containsPoint(s)&&(p=c);p!==this._hoveredLayer&&(this._handleMouseOut(t),p&&(qe(this._container,"leaflet-interactive"),this._fireEvent([p],t,"mouseover"),this._hoveredLayer=p)),this._fireEvent(this._hoveredLayer?[this._hoveredLayer]:!1,t),this._mouseHoverThrottled=!0,setTimeout(l(function(){this._mouseHoverThrottled=!1},this),32)}},_fireEvent:function(t,s,c){this._map._fireDOMEvent(s,c||s.type,t)},_bringToFront:function(t){var s=t._order;if(s){var c=s.next,p=s.prev;if(c)c.prev=p;else return;p?p.next=c:c&&(this._drawFirst=c),s.prev=this._drawLast,this._drawLast.next=s,s.next=null,this._drawLast=s,this._requestRedraw(t)}},_bringToBack:function(t){var s=t._order;if(s){var c=s.next,p=s.prev;if(p)p.next=c;else return;c?c.prev=p:p&&(this._drawLast=p),s.prev=null,s.next=this._drawFirst,this._drawFirst.prev=s,this._drawFirst=s,this._requestRedraw(t)}}});function Mu(t){return De.canvas?new ku(t):null}var nr=(function(){try{return document.namespaces.add("lvml","urn:schemas-microsoft-com:vml"),function(t){return document.createElement("<lvml:"+t+' class="lvml">')}}catch{}return function(t){return document.createElement("<"+t+' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')}})(),zp={_initContainer:function(){this._container=Ke("div","leaflet-vml-container")},_update:function(){this._map._animatingZoom||(vi.prototype._update.call(this),this.fire("update"))},_initPath:function(t){var s=t._container=nr("shape");qe(s,"leaflet-vml-shape "+(this.options.className||"")),s.coordsize="1 1",t._path=nr("path"),s.appendChild(t._path),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){var s=t._container;this._container.appendChild(s),t.options.interactive&&t.addInteractiveTarget(s)},_removePath:function(t){var s=t._container;ht(s),t.removeInteractiveTarget(s),delete this._layers[f(t)]},_updateStyle:function(t){var s=t._stroke,c=t._fill,p=t.options,E=t._container;E.stroked=!!p.stroke,E.filled=!!p.fill,p.stroke?(s||(s=t._stroke=nr("stroke")),E.appendChild(s),s.weight=p.weight+"px",s.color=p.color,s.opacity=p.opacity,p.dashArray?s.dashStyle=S(p.dashArray)?p.dashArray.join(" "):p.dashArray.replace(/( *, *)/g," "):s.dashStyle="",s.endcap=p.lineCap.replace("butt","flat"),s.joinstyle=p.lineJoin):s&&(E.removeChild(s),t._stroke=null),p.fill?(c||(c=t._fill=nr("fill")),E.appendChild(c),c.color=p.fillColor||p.color,c.opacity=p.fillOpacity):c&&(E.removeChild(c),t._fill=null)},_updateCircle:function(t){var s=t._point.round(),c=Math.round(t._radius),p=Math.round(t._radiusY||c);this._setPath(t,t._empty()?"M0 0":"AL "+s.x+","+s.y+" "+c+","+p+" 0,"+65535*360)},_setPath:function(t,s){t._path.v=s},_bringToFront:function(t){bn(t._container)},_bringToBack:function(t){wn(t._container)}},us=De.vml?nr:fe,rr=vi.extend({_initContainer:function(){this._container=us("svg"),this._container.setAttribute("pointer-events","none"),this._rootGroup=us("g"),this._container.appendChild(this._rootGroup)},_destroyContainer:function(){ht(this._container),st(this._container),delete this._container,delete this._rootGroup,delete this._svgSize},_update:function(){if(!(this._map._animatingZoom&&this._bounds)){vi.prototype._update.call(this);var t=this._bounds,s=t.getSize(),c=this._container;(!this._svgSize||!this._svgSize.equals(s))&&(this._svgSize=s,c.setAttribute("width",s.x),c.setAttribute("height",s.y)),_t(c,t.min),c.setAttribute("viewBox",[t.min.x,t.min.y,s.x,s.y].join(" ")),this.fire("update")}},_initPath:function(t){var s=t._path=us("path");t.options.className&&qe(s,t.options.className),t.options.interactive&&qe(s,"leaflet-interactive"),this._updateStyle(t),this._layers[f(t)]=t},_addPath:function(t){this._rootGroup||this._initContainer(),this._rootGroup.appendChild(t._path),t.addInteractiveTarget(t._path)},_removePath:function(t){ht(t._path),t.removeInteractiveTarget(t._path),delete this._layers[f(t)]},_updatePath:function(t){t._project(),t._update()},_updateStyle:function(t){var s=t._path,c=t.options;s&&(c.stroke?(s.setAttribute("stroke",c.color),s.setAttribute("stroke-opacity",c.opacity),s.setAttribute("stroke-width",c.weight),s.setAttribute("stroke-linecap",c.lineCap),s.setAttribute("stroke-linejoin",c.lineJoin),c.dashArray?s.setAttribute("stroke-dasharray",c.dashArray):s.removeAttribute("stroke-dasharray"),c.dashOffset?s.setAttribute("stroke-dashoffset",c.dashOffset):s.removeAttribute("stroke-dashoffset")):s.setAttribute("stroke","none"),c.fill?(s.setAttribute("fill",c.fillColor||c.color),s.setAttribute("fill-opacity",c.fillOpacity),s.setAttribute("fill-rule",c.fillRule||"evenodd")):s.setAttribute("fill","none"))},_updatePoly:function(t,s){this._setPath(t,we(t._parts,s))},_updateCircle:function(t){var s=t._point,c=Math.max(Math.round(t._radius),1),p=Math.max(Math.round(t._radiusY),1)||c,E="a"+c+","+p+" 0 1,0 ",C=t._empty()?"M0 0":"M"+(s.x-c)+","+s.y+E+c*2+",0 "+E+-c*2+",0 ";this._setPath(t,C)},_setPath:function(t,s){t._path.setAttribute("d",s)},_bringToFront:function(t){bn(t._path)},_bringToBack:function(t){wn(t._path)}});De.vml&&rr.include(zp);function Ou(t){return De.svg||De.vml?new rr(t):null}Xe.include({getRenderer:function(t){var s=t.options.renderer||this._getPaneRenderer(t.options.pane)||this.options.renderer||this._renderer;return s||(s=this._renderer=this._createRenderer()),this.hasLayer(s)||this.addLayer(s),s},_getPaneRenderer:function(t){if(t==="overlayPane"||t===void 0)return!1;var s=this._paneRenderers[t];return s===void 0&&(s=this._createRenderer({pane:t}),this._paneRenderers[t]=s),s},_createRenderer:function(t){return this.options.preferCanvas&&Mu(t)||Ou(t)}});var Fu=Sn.extend({initialize:function(t,s){Sn.prototype.initialize.call(this,this._boundsToLatLngs(t),s)},setBounds:function(t){return this.setLatLngs(this._boundsToLatLngs(t))},_boundsToLatLngs:function(t){return t=_e(t),[t.getSouthWest(),t.getNorthWest(),t.getNorthEast(),t.getSouthEast()]}});function Up(t,s){return new Fu(t,s)}rr.create=us,rr.pointsToPath=we,yi.geometryToLayer=is,yi.coordsToLatLng=xo,yi.coordsToLatLngs=ns,yi.latLngToCoords=Eo,yi.latLngsToCoords=rs,yi.getFeature=Tn,yi.asFeature=ss,Xe.mergeOptions({boxZoom:!0});var ju=ci.extend({initialize:function(t){this._map=t,this._container=t._container,this._pane=t._panes.overlayPane,this._resetStateTimeout=0,t.on("unload",this._destroy,this)},addHooks:function(){Be(this._container,"mousedown",this._onMouseDown,this)},removeHooks:function(){st(this._container,"mousedown",this._onMouseDown,this)},moved:function(){return this._moved},_destroy:function(){ht(this._pane),delete this._pane},_resetState:function(){this._resetStateTimeout=0,this._moved=!1},_clearDeferredResetState:function(){this._resetStateTimeout!==0&&(clearTimeout(this._resetStateTimeout),this._resetStateTimeout=0)},_onMouseDown:function(t){if(!t.shiftKey||t.which!==1&&t.button!==1)return!1;this._clearDeferredResetState(),this._resetState(),Xn(),ro(),this._startPoint=this._map.mouseEventToContainerPoint(t),Be(document,{contextmenu:Ki,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseMove:function(t){this._moved||(this._moved=!0,this._box=Ke("div","leaflet-zoom-box",this._container),qe(this._container,"leaflet-crosshair"),this._map.fire("boxzoomstart")),this._point=this._map.mouseEventToContainerPoint(t);var s=new Z(this._point,this._startPoint),c=s.getSize();_t(this._box,s.min),this._box.style.width=c.x+"px",this._box.style.height=c.y+"px"},_finish:function(){this._moved&&(ht(this._box),pt(this._container,"leaflet-crosshair")),Jn(),so(),st(document,{contextmenu:Ki,mousemove:this._onMouseMove,mouseup:this._onMouseUp,keydown:this._onKeyDown},this)},_onMouseUp:function(t){if(!(t.which!==1&&t.button!==1)&&(this._finish(),!!this._moved)){this._clearDeferredResetState(),this._resetStateTimeout=setTimeout(l(this._resetState,this),0);var s=new ee(this._map.containerPointToLatLng(this._startPoint),this._map.containerPointToLatLng(this._point));this._map.fitBounds(s).fire("boxzoomend",{boxZoomBounds:s})}},_onKeyDown:function(t){t.keyCode===27&&(this._finish(),this._clearDeferredResetState(),this._resetState())}});Xe.addInitHook("addHandler","boxZoom",ju),Xe.mergeOptions({doubleClickZoom:!0});var $u=ci.extend({addHooks:function(){this._map.on("dblclick",this._onDoubleClick,this)},removeHooks:function(){this._map.off("dblclick",this._onDoubleClick,this)},_onDoubleClick:function(t){var s=this._map,c=s.getZoom(),p=s.options.zoomDelta,E=t.originalEvent.shiftKey?c-p:c+p;s.options.doubleClickZoom==="center"?s.setZoom(E):s.setZoomAround(t.containerPoint,E)}});Xe.addInitHook("addHandler","doubleClickZoom",$u),Xe.mergeOptions({dragging:!0,inertia:!0,inertiaDeceleration:3400,inertiaMaxSpeed:1/0,easeLinearity:.2,worldCopyJump:!1,maxBoundsViscosity:0});var Bu=ci.extend({addHooks:function(){if(!this._draggable){var t=this._map;this._draggable=new ki(t._mapPane,t._container),this._draggable.on({dragstart:this._onDragStart,drag:this._onDrag,dragend:this._onDragEnd},this),this._draggable.on("predrag",this._onPreDragLimit,this),t.options.worldCopyJump&&(this._draggable.on("predrag",this._onPreDragWrap,this),t.on("zoomend",this._onZoomEnd,this),t.whenReady(this._onZoomEnd,this))}qe(this._map._container,"leaflet-grab leaflet-touch-drag"),this._draggable.enable(),this._positions=[],this._times=[]},removeHooks:function(){pt(this._map._container,"leaflet-grab"),pt(this._map._container,"leaflet-touch-drag"),this._draggable.disable()},moved:function(){return this._draggable&&this._draggable._moved},moving:function(){return this._draggable&&this._draggable._moving},_onDragStart:function(){var t=this._map;if(t._stop(),this._map.options.maxBounds&&this._map.options.maxBoundsViscosity){var s=_e(this._map.options.maxBounds);this._offsetLimit=ne(this._map.latLngToContainerPoint(s.getNorthWest()).multiplyBy(-1),this._map.latLngToContainerPoint(s.getSouthEast()).multiplyBy(-1).add(this._map.getSize())),this._viscosity=Math.min(1,Math.max(0,this._map.options.maxBoundsViscosity))}else this._offsetLimit=null;t.fire("movestart").fire("dragstart"),t.options.inertia&&(this._positions=[],this._times=[])},_onDrag:function(t){if(this._map.options.inertia){var s=this._lastTime=+new Date,c=this._lastPos=this._draggable._absPos||this._draggable._newPos;this._positions.push(c),this._times.push(s),this._prunePositions(s)}this._map.fire("move",t).fire("drag",t)},_prunePositions:function(t){for(;this._positions.length>1&&t-this._times[0]>50;)this._positions.shift(),this._times.shift()},_onZoomEnd:function(){var t=this._map.getSize().divideBy(2),s=this._map.latLngToLayerPoint([0,0]);this._initialWorldOffset=s.subtract(t).x,this._worldWidth=this._map.getPixelWorldBounds().getSize().x},_viscousLimit:function(t,s){return t-(t-s)*this._viscosity},_onPreDragLimit:function(){if(!(!this._viscosity||!this._offsetLimit)){var t=this._draggable._newPos.subtract(this._draggable._startPos),s=this._offsetLimit;t.x<s.min.x&&(t.x=this._viscousLimit(t.x,s.min.x)),t.y<s.min.y&&(t.y=this._viscousLimit(t.y,s.min.y)),t.x>s.max.x&&(t.x=this._viscousLimit(t.x,s.max.x)),t.y>s.max.y&&(t.y=this._viscousLimit(t.y,s.max.y)),this._draggable._newPos=this._draggable._startPos.add(t)}},_onPreDragWrap:function(){var t=this._worldWidth,s=Math.round(t/2),c=this._initialWorldOffset,p=this._draggable._newPos.x,E=(p-s+c)%t+s-c,C=(p+s+c)%t-s-c,ie=Math.abs(E+c)<Math.abs(C+c)?E:C;this._draggable._absPos=this._draggable._newPos.clone(),this._draggable._newPos.x=ie},_onDragEnd:function(t){var s=this._map,c=s.options,p=!c.inertia||t.noInertia||this._times.length<2;if(s.fire("dragend",t),p)s.fire("moveend");else{this._prunePositions(+new Date);var E=this._lastPos.subtract(this._positions[0]),C=(this._lastTime-this._times[0])/1e3,ie=c.easeLinearity,de=E.multiplyBy(ie/C),ye=de.distanceTo([0,0]),Le=Math.min(c.inertiaMaxSpeed,ye),Pe=de.multiplyBy(Le/ye),Fe=Le/(c.inertiaDeceleration*ie),He=Pe.multiplyBy(-Fe/2).round();!He.x&&!He.y?s.fire("moveend"):(He=s._limitOffset(He,s.options.maxBounds),q(function(){s.panBy(He,{duration:Fe,easeLinearity:ie,noMoveStart:!0,animate:!0})}))}}});Xe.addInitHook("addHandler","dragging",Bu),Xe.mergeOptions({keyboard:!0,keyboardPanDelta:80});var qu=ci.extend({keyCodes:{left:[37],right:[39],down:[40],up:[38],zoomIn:[187,107,61,171],zoomOut:[189,109,54,173]},initialize:function(t){this._map=t,this._setPanDelta(t.options.keyboardPanDelta),this._setZoomDelta(t.options.zoomDelta)},addHooks:function(){var t=this._map._container;t.tabIndex<=0&&(t.tabIndex="0"),Be(t,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.on({focus:this._addHooks,blur:this._removeHooks},this)},removeHooks:function(){this._removeHooks(),st(this._map._container,{focus:this._onFocus,blur:this._onBlur,mousedown:this._onMouseDown},this),this._map.off({focus:this._addHooks,blur:this._removeHooks},this)},_onMouseDown:function(){if(!this._focused){var t=document.body,s=document.documentElement,c=t.scrollTop||s.scrollTop,p=t.scrollLeft||s.scrollLeft;this._map._container.focus(),window.scrollTo(p,c)}},_onFocus:function(){this._focused=!0,this._map.fire("focus")},_onBlur:function(){this._focused=!1,this._map.fire("blur")},_setPanDelta:function(t){var s=this._panKeys={},c=this.keyCodes,p,E;for(p=0,E=c.left.length;p<E;p++)s[c.left[p]]=[-1*t,0];for(p=0,E=c.right.length;p<E;p++)s[c.right[p]]=[t,0];for(p=0,E=c.down.length;p<E;p++)s[c.down[p]]=[0,t];for(p=0,E=c.up.length;p<E;p++)s[c.up[p]]=[0,-1*t]},_setZoomDelta:function(t){var s=this._zoomKeys={},c=this.keyCodes,p,E;for(p=0,E=c.zoomIn.length;p<E;p++)s[c.zoomIn[p]]=t;for(p=0,E=c.zoomOut.length;p<E;p++)s[c.zoomOut[p]]=-t},_addHooks:function(){Be(document,"keydown",this._onKeyDown,this)},_removeHooks:function(){st(document,"keydown",this._onKeyDown,this)},_onKeyDown:function(t){if(!(t.altKey||t.ctrlKey||t.metaKey)){var s=t.keyCode,c=this._map,p;if(s in this._panKeys){if(!c._panAnim||!c._panAnim._inProgress)if(p=this._panKeys[s],t.shiftKey&&(p=I(p).multiplyBy(3)),c.options.maxBounds&&(p=c._limitOffset(I(p),c.options.maxBounds)),c.options.worldCopyJump){var E=c.wrapLatLng(c.unproject(c.project(c.getCenter()).add(p)));c.panTo(E)}else c.panBy(p)}else if(s in this._zoomKeys)c.setZoom(c.getZoom()+(t.shiftKey?3:1)*this._zoomKeys[s]);else if(s===27&&c._popup&&c._popup.options.closeOnEscapeKey)c.closePopup();else return;Ki(t)}}});Xe.addInitHook("addHandler","keyboard",qu),Xe.mergeOptions({scrollWheelZoom:!0,wheelDebounceTime:40,wheelPxPerZoomLevel:60});var zu=ci.extend({addHooks:function(){Be(this._map._container,"wheel",this._onWheelScroll,this),this._delta=0},removeHooks:function(){st(this._map._container,"wheel",this._onWheelScroll,this)},_onWheelScroll:function(t){var s=du(t),c=this._map.options.wheelDebounceTime;this._delta+=s,this._lastMousePos=this._map.mouseEventToContainerPoint(t),this._startTime||(this._startTime=+new Date);var p=Math.max(c-(+new Date-this._startTime),0);clearTimeout(this._timer),this._timer=setTimeout(l(this._performZoom,this),p),Ki(t)},_performZoom:function(){var t=this._map,s=t.getZoom(),c=this._map.options.zoomSnap||0;t._stop();var p=this._delta/(this._map.options.wheelPxPerZoomLevel*4),E=4*Math.log(2/(1+Math.exp(-Math.abs(p))))/Math.LN2,C=c?Math.ceil(E/c)*c:E,ie=t._limitZoom(s+(this._delta>0?C:-C))-s;this._delta=0,this._startTime=null,ie&&(t.options.scrollWheelZoom==="center"?t.setZoom(s+ie):t.setZoomAround(this._lastMousePos,s+ie))}});Xe.addInitHook("addHandler","scrollWheelZoom",zu);var Hp=600;Xe.mergeOptions({tapHold:De.touchNative&&De.safari&&De.mobile,tapTolerance:15});var Uu=ci.extend({addHooks:function(){Be(this._map._container,"touchstart",this._onDown,this)},removeHooks:function(){st(this._map._container,"touchstart",this._onDown,this)},_onDown:function(t){if(clearTimeout(this._holdTimeout),t.touches.length===1){var s=t.touches[0];this._startPos=this._newPos=new j(s.clientX,s.clientY),this._holdTimeout=setTimeout(l(function(){this._cancel(),this._isTapValid()&&(Be(document,"touchend",Et),Be(document,"touchend touchcancel",this._cancelClickPrevent),this._simulateEvent("contextmenu",s))},this),Hp),Be(document,"touchend touchcancel contextmenu",this._cancel,this),Be(document,"touchmove",this._onMove,this)}},_cancelClickPrevent:function t(){st(document,"touchend",Et),st(document,"touchend touchcancel",t)},_cancel:function(){clearTimeout(this._holdTimeout),st(document,"touchend touchcancel contextmenu",this._cancel,this),st(document,"touchmove",this._onMove,this)},_onMove:function(t){var s=t.touches[0];this._newPos=new j(s.clientX,s.clientY)},_isTapValid:function(){return this._newPos.distanceTo(this._startPos)<=this._map.options.tapTolerance},_simulateEvent:function(t,s){var c=new MouseEvent(t,{bubbles:!0,cancelable:!0,view:window,screenX:s.screenX,screenY:s.screenY,clientX:s.clientX,clientY:s.clientY});c._simulated=!0,s.target.dispatchEvent(c)}});Xe.addInitHook("addHandler","tapHold",Uu),Xe.mergeOptions({touchZoom:De.touch,bounceAtZoomLimits:!0});var Hu=ci.extend({addHooks:function(){qe(this._map._container,"leaflet-touch-zoom"),Be(this._map._container,"touchstart",this._onTouchStart,this)},removeHooks:function(){pt(this._map._container,"leaflet-touch-zoom"),st(this._map._container,"touchstart",this._onTouchStart,this)},_onTouchStart:function(t){var s=this._map;if(!(!t.touches||t.touches.length!==2||s._animatingZoom||this._zooming)){var c=s.mouseEventToContainerPoint(t.touches[0]),p=s.mouseEventToContainerPoint(t.touches[1]);this._centerPoint=s.getSize()._divideBy(2),this._startLatLng=s.containerPointToLatLng(this._centerPoint),s.options.touchZoom!=="center"&&(this._pinchStartLatLng=s.containerPointToLatLng(c.add(p)._divideBy(2))),this._startDist=c.distanceTo(p),this._startZoom=s.getZoom(),this._moved=!1,this._zooming=!0,s._stop(),Be(document,"touchmove",this._onTouchMove,this),Be(document,"touchend touchcancel",this._onTouchEnd,this),Et(t)}},_onTouchMove:function(t){if(!(!t.touches||t.touches.length!==2||!this._zooming)){var s=this._map,c=s.mouseEventToContainerPoint(t.touches[0]),p=s.mouseEventToContainerPoint(t.touches[1]),E=c.distanceTo(p)/this._startDist;if(this._zoom=s.getScaleZoom(E,this._startZoom),!s.options.bounceAtZoomLimits&&(this._zoom<s.getMinZoom()&&E<1||this._zoom>s.getMaxZoom()&&E>1)&&(this._zoom=s._limitZoom(this._zoom)),s.options.touchZoom==="center"){if(this._center=this._startLatLng,E===1)return}else{var C=c._add(p)._divideBy(2)._subtract(this._centerPoint);if(E===1&&C.x===0&&C.y===0)return;this._center=s.unproject(s.project(this._pinchStartLatLng,this._zoom).subtract(C),this._zoom)}this._moved||(s._moveStart(!0,!1),this._moved=!0),X(this._animRequest);var ie=l(s._move,s,this._center,this._zoom,{pinch:!0,round:!1},void 0);this._animRequest=q(ie,this,!0),Et(t)}},_onTouchEnd:function(){if(!this._moved||!this._zooming){this._zooming=!1;return}this._zooming=!1,X(this._animRequest),st(document,"touchmove",this._onTouchMove,this),st(document,"touchend touchcancel",this._onTouchEnd,this),this._map.options.zoomAnimation?this._map._animateZoom(this._center,this._map._limitZoom(this._zoom),!0,this._map.options.zoomSnap):this._map._resetView(this._center,this._map._limitZoom(this._zoom))}});Xe.addInitHook("addHandler","touchZoom",Hu),Xe.BoxZoom=ju,Xe.DoubleClickZoom=$u,Xe.Drag=Bu,Xe.Keyboard=qu,Xe.ScrollWheelZoom=zu,Xe.TapHold=Uu,Xe.TouchZoom=Hu,i.Bounds=Z,i.Browser=De,i.CRS=Y,i.Canvas=ku,i.Circle=wo,i.CircleMarker=ts,i.Class=$,i.Control=Kt,i.DivIcon=Pu,i.DivOverlay=hi,i.DomEvent=lp,i.DomUtil=op,i.Draggable=ki,i.Evented=se,i.FeatureGroup=mi,i.GeoJSON=yi,i.GridLayer=ir,i.Handler=ci,i.Icon=En,i.ImageOverlay=os,i.LatLng=G,i.LatLngBounds=ee,i.Layer=Yt,i.LayerGroup=xn,i.LineUtil=wp,i.Map=Xe,i.Marker=es,i.Mixin=gp,i.Path=Mi,i.Point=j,i.PolyUtil=mp,i.Polygon=Sn,i.Polyline=_i,i.Popup=as,i.PosAnimation=fu,i.Projection=xp,i.Rectangle=Fu,i.Renderer=vi,i.SVG=rr,i.SVGOverlay=Ru,i.TileLayer=Ln,i.Tooltip=ls,i.Transformation=Ee,i.Util=F,i.VideoOverlay=Nu,i.bind=l,i.bounds=ne,i.canvas=Mu,i.circle=Rp,i.circleMarker=Np,i.control=Yn,i.divIcon=$p,i.extend=o,i.featureGroup=Lp,i.geoJSON=Au,i.geoJson=Dp,i.gridLayer=Bp,i.icon=Ip,i.imageOverlay=kp,i.latLng=W,i.latLngBounds=_e,i.layerGroup=Tp,i.map=up,i.marker=Ap,i.point=I,i.polygon=Cp,i.polyline=Pp,i.popup=Fp,i.rectangle=Up,i.setOptions=T,i.stamp=f,i.svg=Ou,i.svgOverlay=Op,i.tileLayer=Cu,i.tooltip=jp,i.transformation=Te,i.version=r,i.videoOverlay=Mp;var Vp=window.L;i.noConflict=function(){return window.L=Vp,this},window.L=i}))})(Pr,Pr.exports)),Pr.exports}var cw=su(),dl={exports:{}},Hd;function hw(){return Hd||(Hd=1,(function(n,e){((i,r)=>{n.exports=i(su()),typeof r<"u"&&r.L&&i(r.L)})(i=>{i.Editable=i.Evented.extend({statics:{FORWARD:1,BACKWARD:-1},options:{zIndex:1e3,polygonClass:i.Polygon,polylineClass:i.Polyline,markerClass:i.Marker,circleMarkerClass:i.CircleMarker,rectangleClass:i.Rectangle,circleClass:i.Circle,drawingCSSClass:"leaflet-editable-drawing",drawingCursor:"crosshair",editLayer:void 0,featuresLayer:void 0,polylineEditorClass:void 0,polygonEditorClass:void 0,markerEditorClass:void 0,circleMarkerEditorClass:void 0,rectangleEditorClass:void 0,circleEditorClass:void 0,lineGuideOptions:{},skipMiddleMarkers:!1},initialize:function(h,m){i.setOptions(this,m),this._lastZIndex=this.options.zIndex,this.map=h,this.editLayer=this.createEditLayer(),this.featuresLayer=this.createFeaturesLayer(),this.forwardLineGuide=this.createLineGuide(),this.backwardLineGuide=this.createLineGuide()},fireAndForward:function(h,m){m=m||{},m.editTools=this,this.fire(h,m),this.map.fire(h,m)},createLineGuide:function(){const h=i.extend({dashArray:"5,10",weight:1,interactive:!1},this.options.lineGuideOptions);return i.polyline([],h)},createVertexIcon:h=>i.Browser.mobile&&i.Browser.touch?new i.Editable.TouchVertexIcon(h):new i.Editable.VertexIcon(h),createEditLayer:function(){return this.options.editLayer||new i.LayerGroup().addTo(this.map)},createFeaturesLayer:function(){return this.options.featuresLayer||new i.LayerGroup().addTo(this.map)},moveForwardLineGuide:function(h){this.forwardLineGuide._latlngs.length&&(this.forwardLineGuide._latlngs[1]=h,this.forwardLineGuide._bounds.extend(h),this.forwardLineGuide.redraw())},moveBackwardLineGuide:function(h){this.backwardLineGuide._latlngs.length&&(this.backwardLineGuide._latlngs[1]=h,this.backwardLineGuide._bounds.extend(h),this.backwardLineGuide.redraw())},anchorForwardLineGuide:function(h){this.forwardLineGuide._latlngs[0]=h,this.forwardLineGuide._bounds.extend(h),this.forwardLineGuide.redraw()},anchorBackwardLineGuide:function(h){this.backwardLineGuide._latlngs[0]=h,this.backwardLineGuide._bounds.extend(h),this.backwardLineGuide.redraw()},attachForwardLineGuide:function(){this.editLayer.addLayer(this.forwardLineGuide)},attachBackwardLineGuide:function(){this.editLayer.addLayer(this.backwardLineGuide)},detachForwardLineGuide:function(){this.forwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.forwardLineGuide)},detachBackwardLineGuide:function(){this.backwardLineGuide.setLatLngs([]),this.editLayer.removeLayer(this.backwardLineGuide)},blockEvents:function(){this._oldTargets||(this._oldTargets=this.map._targets,this.map._targets={})},unblockEvents:function(){this._oldTargets&&(this.map._targets=i.extend(this.map._targets,this._oldTargets),delete this._oldTargets)},registerForDrawing:function(h){this._drawingEditor&&this.unregisterForDrawing(this._drawingEditor),this.blockEvents(),h.reset(),this._drawingEditor=h,this.map.on("mousemove touchmove",h.onDrawingMouseMove,h),this.map.on("mousedown",this.onMousedown,this),this.map.on("mouseup",this.onMouseup,this),i.DomUtil.addClass(this.map._container,this.options.drawingCSSClass),this.defaultMapCursor=this.map._container.style.cursor,this.map._container.style.cursor=this.options.drawingCursor},unregisterForDrawing:function(h){this.unblockEvents(),i.DomUtil.removeClass(this.map._container,this.options.drawingCSSClass),this.map._container.style.cursor=this.defaultMapCursor,h=h||this._drawingEditor,h&&(this.map.off("mousemove touchmove",h.onDrawingMouseMove,h),this.map.off("mousedown",this.onMousedown,this),this.map.off("mouseup",this.onMouseup,this),h===this._drawingEditor&&(delete this._drawingEditor,h._drawing&&h.cancelDrawing()))},onMousedown:function(h){h.originalEvent.which==1&&(this._mouseDown=h,this._drawingEditor.onDrawingMouseDown(h))},onMouseup:function(h){if(this._mouseDown){const m=this._drawingEditor,b=this._mouseDown;if(this._mouseDown=null,m.onDrawingMouseUp(h),this._drawingEditor!==m)return;const T=i.point(b.originalEvent.clientX,b.originalEvent.clientY),A=i.point(h.originalEvent.clientX,h.originalEvent.clientY).distanceTo(T);Math.abs(A)<9*(window.devicePixelRatio||1)&&this._drawingEditor.onDrawingClick(h)}},drawing:function(){return this._drawingEditor?.drawing()},stopDrawing:function(){this.unregisterForDrawing()},commitDrawing:function(h){this._drawingEditor&&this._drawingEditor.commitDrawing(h)},connectCreatedToMap:function(h){return this.featuresLayer.addLayer(h)},startPolyline:function(h,m){const b=this.createPolyline([],m);return b.enableEdit(this.map).newShape(h),b},startPolygon:function(h,m){const b=this.createPolygon([],m);return b.enableEdit(this.map).newShape(h),b},startMarker:function(h,m){h=h||this.map.getCenter().clone();const b=this.createMarker(h,m);return b.enableEdit(this.map).startDrawing(),b},startCircleMarker:function(h,m){h=h||this.map.getCenter().clone();const b=this.createCircleMarker(h,m);return b.enableEdit(this.map).startDrawing(),b},startRectangle:function(h,m){const b=h||i.latLng([0,0]),T=new i.LatLngBounds(b,b),A=this.createRectangle(T,m);return A.enableEdit(this.map).startDrawing(),A},startCircle:function(h,m){h=h||this.map.getCenter().clone();const b=this.createCircle(h,m);return b.enableEdit(this.map).startDrawing(),b},startHole:(h,m)=>{h.newHole(m)},createLayer:function(h,m,b){b=i.Util.extend({editOptions:{editTools:this}},b);const T=new h(m,b);return this.fireAndForward("editable:created",{layer:T}),T},createPolyline:function(h,m){return this.createLayer(m?.polylineClass||this.options.polylineClass,h,m)},createPolygon:function(h,m){return this.createLayer(m?.polygonClass||this.options.polygonClass,h,m)},createMarker:function(h,m){return this.createLayer(m?.markerClass||this.options.markerClass,h,m)},createCircleMarker:function(h,m){return this.createLayer(m?.circleMarkerClass||this.options.circleMarkerClass,h,m)},createRectangle:function(h,m){return this.createLayer(m?.rectangleClass||this.options.rectangleClass,h,m)},createCircle:function(h,m){return this.createLayer(m?.circleClass||this.options.circleClass,h,m)}}),i.extend(i.Editable,{makeCancellable:h=>{h.cancel=()=>{h._cancelled=!0}}}),i.Map.mergeOptions({editToolsClass:i.Editable,editable:!1,editOptions:{}}),i.Map.addInitHook(function(){this.whenReady(function(){this.options.editable&&(this.editTools=new this.options.editToolsClass(this,this.options.editOptions))})}),i.Editable.VertexIcon=i.DivIcon.extend({options:{iconSize:new i.Point(8,8)}}),i.Editable.TouchVertexIcon=i.Editable.VertexIcon.extend({options:{iconSize:new i.Point(20,20)}}),i.Editable.VertexMarker=i.Marker.extend({options:{draggable:!0,className:"leaflet-div-icon leaflet-vertex-icon"},initialize:function(h,m,b,T){this.latlng=h,this.latlngs=m,this.editor=b,i.Marker.prototype.initialize.call(this,h,T),this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.latlng.__vertex=this,this.connect(),this.setZIndexOffset(b.tools._lastZIndex+1)},connect:function(){this.editor.editLayer.addLayer(this)},onAdd:function(h){i.Marker.prototype.onAdd.call(this,h),this.on("drag",this.onDrag),this.on("dragstart",this.onDragStart),this.on("dragend",this.onDragEnd),this.on("mouseup",this.onMouseup),this.on("click",this.onClick),this.on("contextmenu",this.onContextMenu),this.on("mousedown touchstart",this.onMouseDown),this.on("mouseover",this.onMouseOver),this.on("mouseout",this.onMouseOut),this.addMiddleMarkers()},onRemove:function(h){this.middleMarker&&this.middleMarker.delete(),delete this.latlng.__vertex,this.off("drag",this.onDrag),this.off("dragstart",this.onDragStart),this.off("dragend",this.onDragEnd),this.off("mouseup",this.onMouseup),this.off("click",this.onClick),this.off("contextmenu",this.onContextMenu),this.off("mousedown touchstart",this.onMouseDown),this.off("mouseover",this.onMouseOver),this.off("mouseout",this.onMouseOut),i.Marker.prototype.onRemove.call(this,h)},onDrag:function(h){h.vertex=this,this.editor.onVertexMarkerDrag(h);const m=i.DomUtil.getPosition(this._icon),b=this._map.layerPointToLatLng(m);this.latlng.update(b),this._latlng=this.latlng,this.editor.refresh(),this.middleMarker&&this.middleMarker.updateLatLng();const T=this.getNext();T?.middleMarker&&T.middleMarker.updateLatLng()},onDragStart:function(h){h.vertex=this,this.editor.onVertexMarkerDragStart(h)},onDragEnd:function(h){h.vertex=this,this.editor.onVertexMarkerDragEnd(h)},onClick:function(h){h.vertex=this,this.editor.onVertexMarkerClick(h)},onMouseup:function(h){i.DomEvent.stop(h),h.vertex=this,this.editor.map.fire("mouseup",h)},onContextMenu:function(h){h.vertex=this,this.editor.onVertexMarkerContextMenu(h)},onMouseDown:function(h){h.vertex=this,this.editor.onVertexMarkerMouseDown(h)},onMouseOver:function(h){h.vertex=this,this.editor.onVertexMarkerMouseOver(h)},onMouseOut:function(h){h.vertex=this,this.editor.onVertexMarkerMouseOut(h)},delete:function(){const h=this.getNext();this.latlngs.splice(this.getIndex(),1),this.editor.editLayer.removeLayer(this),this.editor.onVertexDeleted({latlng:this.latlng,vertex:this}),this.latlngs.length||this.editor.deleteShape(this.latlngs),h&&h.resetMiddleMarker(),this.editor.refresh()},getIndex:function(){return this.latlngs.indexOf(this.latlng)},getLastIndex:function(){return this.latlngs.length-1},getPrevious:function(){if(this.latlngs.length<2)return;const h=this.getIndex();let m=h-1;h===0&&this.editor.CLOSED&&(m=this.getLastIndex());const b=this.latlngs[m];if(b)return b.__vertex},getNext:function(){if(this.latlngs.length<2)return;const h=this.getIndex();let m=h+1;h===this.getLastIndex()&&this.editor.CLOSED&&(m=0);const b=this.latlngs[m];if(b)return b.__vertex},addMiddleMarker:function(h){this.editor.hasMiddleMarkers()&&(h=h||this.getPrevious(),h&&!this.middleMarker&&(this.middleMarker=this.editor.addMiddleMarker(h,this,this.latlngs,this.editor)))},addMiddleMarkers:function(){if(!this.editor.hasMiddleMarkers())return;const h=this.getPrevious();h&&this.addMiddleMarker(h);const m=this.getNext();m&&m.resetMiddleMarker()},resetMiddleMarker:function(){this.middleMarker&&this.middleMarker.delete(),this.addMiddleMarker()},split:function(){this.editor.splitShape&&this.editor.splitShape(this.latlngs,this.getIndex())},continue:function(){if(!this.editor.continueBackward)return;const h=this.getIndex();h===0?this.editor.continueBackward(this.latlngs):h===this.getLastIndex()&&this.editor.continueForward(this.latlngs)}}),i.Editable.mergeOptions({vertexMarkerClass:i.Editable.VertexMarker}),i.Editable.MiddleMarker=i.Marker.extend({options:{opacity:.5,className:"leaflet-div-icon leaflet-middle-icon",draggable:!0},initialize:function(h,m,b,T,A){this.left=h,this.right=m,this.editor=T,this.latlngs=b,i.Marker.prototype.initialize.call(this,this.computeLatLng(),A),this._opacity=this.options.opacity,this.options.icon=this.editor.tools.createVertexIcon({className:this.options.className}),this.editor.editLayer.addLayer(this),this.setVisibility()},setVisibility:function(){const h=this._map.latLngToContainerPoint(this.left.latlng),m=this._map.latLngToContainerPoint(this.right.latlng),b=i.point(this.options.icon.options.iconSize);h.distanceTo(m)<b.x*3?this.hide():this.show()},show:function(){this.setOpacity(this._opacity)},hide:function(){this.setOpacity(0)},updateLatLng:function(){this.setLatLng(this.computeLatLng()),this.setVisibility()},computeLatLng:function(){const h=this.editor.map.latLngToContainerPoint(this.left.latlng),m=this.editor.map.latLngToContainerPoint(this.right.latlng),b=(h.y+m.y)/2,T=(h.x+m.x)/2;return this.editor.map.containerPointToLatLng([T,b])},onAdd:function(h){i.Marker.prototype.onAdd.call(this,h),i.DomEvent.on(this._icon,"mousedown touchstart",this.onMouseDown,this),h.on("zoomend",this.setVisibility,this)},onRemove:function(h){delete this.right.middleMarker,i.DomEvent.off(this._icon,"mousedown touchstart",this.onMouseDown,this),h.off("zoomend",this.setVisibility,this),i.Marker.prototype.onRemove.call(this,h)},onMouseDown:function(h){const m=i.DomUtil.getPosition(this._icon),b=this.editor.map.layerPointToLatLng(m);if(h={originalEvent:h,latlng:b},this.options.opacity===0||(i.Editable.makeCancellable(h),this.editor.onMiddleMarkerMouseDown(h),h._cancelled))return;this.latlngs.splice(this.index(),0,h.latlng),this.editor.refresh();const T=this._icon,A=this.editor.addVertexMarker(h.latlng,this.latlngs);this.editor.onNewVertex(A);const N=A._icon.parentNode;N.removeChild(A._icon),A._icon=T,N.appendChild(A._icon),A._initIcon(),A._initInteraction(),A.setOpacity(1),i.Draggable._dragging=!1,A.dragging._draggable._onDown(h.originalEvent),this.delete()},delete:function(){this.editor.editLayer.removeLayer(this)},index:function(){return this.latlngs.indexOf(this.right.latlng)}}),i.Editable.mergeOptions({middleMarkerClass:i.Editable.MiddleMarker}),i.Editable.BaseEditor=i.Handler.extend({initialize:function(h,m,b){i.setOptions(this,b),this.map=h,this.feature=m,this.feature.editor=this,this.editLayer=new i.LayerGroup,this.tools=this.options.editTools||h.editTools},addHooks:function(){this.isConnected()?this.onFeatureAdd():this.feature.once("add",this.onFeatureAdd,this),this.onEnable(),this.feature.on(this._getEvents(),this)},removeHooks:function(){this.feature.off(this._getEvents(),this),this.feature.dragging&&this.feature.dragging.disable(),this.editLayer.clearLayers(),this.tools.editLayer.removeLayer(this.editLayer),this.onDisable(),this._drawing&&this.cancelDrawing()},drawing:function(){return!!this._drawing},reset:()=>{},onFeatureAdd:function(){this.tools.editLayer.addLayer(this.editLayer),this.feature.dragging&&this.options.draggable!=!1&&this.feature.dragging.enable()},hasMiddleMarkers:function(){return!this.options.skipMiddleMarkers&&!this.tools.options.skipMiddleMarkers},fireAndForward:function(h,m){m=m||{},m.layer=this.feature,this.feature.fire(h,m),this.tools.fireAndForward(h,m)},onEnable:function(){this.fireAndForward("editable:enable")},onDisable:function(){this.fireAndForward("editable:disable")},onEditing:function(){this.fireAndForward("editable:editing")},onEdited:function(){this.fireAndForward("editable:edited")},onStartDrawing:function(){this.fireAndForward("editable:drawing:start")},onEndDrawing:function(){this.fireAndForward("editable:drawing:end")},onCancelDrawing:function(){this.fireAndForward("editable:drawing:cancel")},onCommitDrawing:function(h){this.fireAndForward("editable:drawing:commit",h),this.onEdited()},onDrawingMouseDown:function(h){this.fireAndForward("editable:drawing:mousedown",h)},onDrawingMouseUp:function(h){this.fireAndForward("editable:drawing:mouseup",h)},startDrawing:function(){this._drawing||(this._drawing=i.Editable.FORWARD),this.tools.registerForDrawing(this),this.onStartDrawing()},commitDrawing:function(h){this.onCommitDrawing(h),this.endDrawing()},cancelDrawing:function(){i.Draggable._dragging=!1,this.onCancelDrawing(),this.endDrawing()},endDrawing:function(){this._drawing=!1,this.tools.unregisterForDrawing(this),this.onEndDrawing()},onDrawingClick:function(h){this.drawing()&&(i.Editable.makeCancellable(h),this.fireAndForward("editable:drawing:click",h),!h._cancelled&&(this.isConnected()||this.connect(h),this.processDrawingClick(h)))},isConnected:function(){return this.map.hasLayer(this.feature)},connect:function(){this.tools.connectCreatedToMap(this.feature),this.tools.editLayer.addLayer(this.editLayer)},onMove:function(h){this.fireAndForward("editable:drawing:move",h)},onDrawingMouseMove:function(h){this.onMove(h)},_getEvents:function(){return{dragstart:this.onDragStart,drag:this.onDrag,dragend:this.onDragEnd,remove:this.disable}},onDragStart:function(h){this.onEditing(),this.fireAndForward("editable:dragstart",h)},onDrag:function(h){this.onMove(h),this.fireAndForward("editable:drag",h)},onDragEnd:function(h){this.fireAndForward("editable:dragend",h),this.onEdited()}}),i.Editable.MarkerEditor=i.Editable.BaseEditor.extend({onDrawingMouseMove:function(h){i.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,h),this._drawing&&this.feature.setLatLng(h.latlng)},processDrawingClick:function(h){this.fireAndForward("editable:drawing:clicked",h),this.commitDrawing(h)},connect:function(h){h&&(this.feature._latlng=h.latlng),i.Editable.BaseEditor.prototype.connect.call(this,h)}}),i.Editable.CircleMarkerEditor=i.Editable.BaseEditor.extend({onDrawingMouseMove:function(h){i.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,h),this._drawing&&this.feature.setLatLng(h.latlng)},processDrawingClick:function(h){this.fireAndForward("editable:drawing:clicked",h),this.commitDrawing(h)},connect:function(h){h&&(this.feature._latlng=h.latlng),i.Editable.BaseEditor.prototype.connect.call(this,h)}}),i.Editable.PathEditor=i.Editable.BaseEditor.extend({CLOSED:!1,MIN_VERTEX:2,addHooks:function(){return i.Editable.BaseEditor.prototype.addHooks.call(this),this.feature&&(this.initVertexMarkers(),this.map.on("moveend",this.onMoveEnd,this)),this},removeHooks:function(){i.Editable.BaseEditor.prototype.removeHooks.call(this),this.feature&&this.map.off("moveend",this.onMoveEnd,this)},onMoveEnd:function(){this.initVertexMarkers()},initVertexMarkers:function(h){if(this.enabled())if(h=h||this.getLatLngs(),_(h))this.addVertexMarkers(h);else for(const m of h)this.initVertexMarkers(m)},getLatLngs:function(){return this.feature.getLatLngs()},reset:function(){this.editLayer.clearLayers(),this.initVertexMarkers()},addVertexMarker:function(h,m){return h.__vertex?(h.__vertex.connect(),h.__vertex):new this.tools.options.vertexMarkerClass(h,m,this)},onNewVertex:function(h){this.fireAndForward("editable:vertex:new",{latlng:h.latlng,vertex:h})},addVertexMarkers:function(h){const m=this.map.getBounds();for(const b of h)m.contains(b)&&this.addVertexMarker(b,h)},refreshVertexMarkers:function(h){h=h||this.getDefaultLatLngs();for(const m of h)m.__vertex.update()},addMiddleMarker:function(h,m,b){return new this.tools.options.middleMarkerClass(h,m,b,this)},onVertexMarkerClick:function(h){if(i.Editable.makeCancellable(h),this.fireAndForward("editable:vertex:click",h),h._cancelled||this.tools.drawing()&&this.tools._drawingEditor!==this)return;const m=h.vertex.getIndex();let b;h.originalEvent.ctrlKey?this.onVertexMarkerCtrlClick(h):h.originalEvent.altKey?this.onVertexMarkerAltClick(h):h.originalEvent.shiftKey?this.onVertexMarkerShiftClick(h):h.originalEvent.metaKey?this.onVertexMarkerMetaKeyClick(h):m===h.vertex.getLastIndex()&&this._drawing===i.Editable.FORWARD?m>=this.MIN_VERTEX-1&&(b=!0):m===0&&this._drawing===i.Editable.BACKWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX||m===0&&this._drawing===i.Editable.FORWARD&&this._drawnLatLngs.length>=this.MIN_VERTEX&&this.CLOSED?b=!0:this.onVertexRawMarkerClick(h),this.fireAndForward("editable:vertex:clicked",h),b&&this.commitDrawing(h)},onVertexRawMarkerClick:function(h){this.fireAndForward("editable:vertex:rawclick",h),!h._cancelled&&this.vertexCanBeDeleted(h.vertex)&&h.vertex.delete()},vertexCanBeDeleted:function(h){return h.latlngs.length>this.MIN_VERTEX},onVertexDeleted:function(h){this.fireAndForward("editable:vertex:deleted",h),this.onEdited()},onVertexMarkerCtrlClick:function(h){this.fireAndForward("editable:vertex:ctrlclick",h)},onVertexMarkerShiftClick:function(h){this.fireAndForward("editable:vertex:shiftclick",h)},onVertexMarkerMetaKeyClick:function(h){this.fireAndForward("editable:vertex:metakeyclick",h)},onVertexMarkerAltClick:function(h){this.fireAndForward("editable:vertex:altclick",h)},onVertexMarkerContextMenu:function(h){this.fireAndForward("editable:vertex:contextmenu",h)},onVertexMarkerMouseDown:function(h){this.fireAndForward("editable:vertex:mousedown",h)},onVertexMarkerMouseOver:function(h){this.fireAndForward("editable:vertex:mouseover",h)},onVertexMarkerMouseOut:function(h){this.fireAndForward("editable:vertex:mouseout",h)},onMiddleMarkerMouseDown:function(h){this.fireAndForward("editable:middlemarker:mousedown",h)},onVertexMarkerDrag:function(h){this.onMove(h),this.feature._bounds&&this.extendBounds(h),this.fireAndForward("editable:vertex:drag",h)},onVertexMarkerDragStart:function(h){this.fireAndForward("editable:vertex:dragstart",h)},onVertexMarkerDragEnd:function(h){this.fireAndForward("editable:vertex:dragend",h),this.onEdited()},setDrawnLatLngs:function(h){this._drawnLatLngs=h||this.getDefaultLatLngs()},startDrawing:function(){this._drawnLatLngs||this.setDrawnLatLngs(),i.Editable.BaseEditor.prototype.startDrawing.call(this)},startDrawingForward:function(){this.startDrawing()},endDrawing:function(){this.tools.detachForwardLineGuide(),this.tools.detachBackwardLineGuide(),this._drawnLatLngs&&this._drawnLatLngs.length<this.MIN_VERTEX&&this.deleteShape(this._drawnLatLngs),i.Editable.BaseEditor.prototype.endDrawing.call(this),delete this._drawnLatLngs},addLatLng:function(h){this._drawing===i.Editable.FORWARD?this._drawnLatLngs.push(h):this._drawnLatLngs.unshift(h),this.feature._bounds.extend(h);const m=this.addVertexMarker(h,this._drawnLatLngs);this.onNewVertex(m),this.refresh()},newPointForward:function(h){this.addLatLng(h),this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(h)},newPointBackward:function(h){this.addLatLng(h),this.tools.anchorBackwardLineGuide(h)},push:function(h){if(!h)return console.error("L.Editable.PathEditor.push expect a valid latlng as parameter");this._drawing===i.Editable.FORWARD?this.newPointForward(h):this.newPointBackward(h)},removeLatLng:function(h){h.__vertex.delete(),this.refresh()},pop:function(){if(this._drawnLatLngs.length<=1)return;let h;return this._drawing===i.Editable.FORWARD?h=this._drawnLatLngs[this._drawnLatLngs.length-1]:h=this._drawnLatLngs[0],this.removeLatLng(h),this._drawing===i.Editable.FORWARD?this.tools.anchorForwardLineGuide(this._drawnLatLngs[this._drawnLatLngs.length-1]):this.tools.anchorForwardLineGuide(this._drawnLatLngs[0]),h},processDrawingClick:function(h){h.vertex&&h.vertex.editor===this||(this._drawing===i.Editable.FORWARD?this.newPointForward(h.latlng):this.newPointBackward(h.latlng),this.fireAndForward("editable:drawing:clicked",h))},onDrawingMouseMove:function(h){i.Editable.BaseEditor.prototype.onDrawingMouseMove.call(this,h),this._drawing&&(this.tools.moveForwardLineGuide(h.latlng),this.tools.moveBackwardLineGuide(h.latlng))},refresh:function(){this.feature.redraw(),this.onEditing()},newShape:function(h){const m=this.addNewEmptyShape();m&&(this.setDrawnLatLngs(m[0]||m),this.startDrawingForward(),this.fireAndForward("editable:shape:new",{shape:m}),h&&this.newPointForward(h))},deleteShape:function(h,m){const b={shape:h};if(i.Editable.makeCancellable(b),this.fireAndForward("editable:shape:delete",b),!b._cancelled)return h=this._deleteShape(h,m),this.ensureNotFlat&&this.ensureNotFlat(),this.feature.setLatLngs(this.getLatLngs()),this.refresh(),this.reset(),this.fireAndForward("editable:shape:deleted",{shape:h}),this.onEdited(),h},_deleteShape:function(h,m){if(m=m||this.getLatLngs(),!m.length)return;const b=(A,N)=>A.splice(0,Number.MAX_VALUE),T=(A,N)=>(A.splice(A.indexOf(N),1),A.length||this._deleteShape(A),N);if(m===h)return b(m);for(const A of m){if(A===h)return T(m,h);if(A.indexOf(h)!==-1)return T(A,h)}},deleteShapeAt:function(h){const m=this.feature.shapeAt(h);if(m)return this.deleteShape(m)},appendShape:function(h){this.insertShape(h)},prependShape:function(h){this.insertShape(h,0)},insertShape:function(h,m){this.ensureMulti(),h=this.formatShape(h),m===void 0&&(m=this.feature._latlngs.length),this.feature._latlngs.splice(m,0,h),this.feature.redraw(),this._enabled&&this.reset()},extendBounds:function(h){this.feature._bounds.extend(h.vertex.latlng)},onDragStart:function(h){this.editLayer.clearLayers(),i.Editable.BaseEditor.prototype.onDragStart.call(this,h)},onDragEnd:function(h){this.initVertexMarkers(),i.Editable.BaseEditor.prototype.onDragEnd.call(this,h)}}),i.Editable.PolylineEditor=i.Editable.PathEditor.extend({startDrawingBackward:function(){this._drawing=i.Editable.BACKWARD,this.startDrawing()},continueBackward:function(h){this.drawing()||(h=h||this.getDefaultLatLngs(),this.setDrawnLatLngs(h),h.length>0&&(this.tools.attachBackwardLineGuide(),this.tools.anchorBackwardLineGuide(h[0])),this.startDrawingBackward())},continueForward:function(h){this.drawing()||(h=h||this.getDefaultLatLngs(),this.setDrawnLatLngs(h),h.length>0&&(this.tools.attachForwardLineGuide(),this.tools.anchorForwardLineGuide(h[h.length-1])),this.startDrawingForward())},getDefaultLatLngs:function(h){return h=h||this.feature._latlngs,!h.length||h[0]instanceof i.LatLng?h:this.getDefaultLatLngs(h[0])},ensureMulti:function(){this.feature._latlngs.length&&_(this.feature._latlngs)&&(this.feature._latlngs=[this.feature._latlngs])},addNewEmptyShape:function(){if(this.feature._latlngs.length){const h=[];return this.appendShape(h),h}return this.feature._latlngs},formatShape:function(h){if(_(h))return h;if(h[0])return this.formatShape(h[0])},splitShape:function(h,m){if(!m||m>=h.length-1)return;this.ensureMulti();const b=this.feature._latlngs.indexOf(h);if(b===-1)return;const T=h.slice(0,m+1),A=h.slice(m);A[0]=i.latLng(A[0].lat,A[0].lng,A[0].alt),this.feature._latlngs.splice(b,1,T,A),this.refresh(),this.reset(),this.onEdited()}}),i.Editable.PolygonEditor=i.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:3,newPointForward:function(h){i.Editable.PathEditor.prototype.newPointForward.call(this,h),this.tools.backwardLineGuide._latlngs.length||this.tools.anchorBackwardLineGuide(h),this._drawnLatLngs.length===2&&this.tools.attachBackwardLineGuide()},addNewEmptyHole:function(h){this.ensureNotFlat();const m=this.feature.shapeAt(h);if(!m)return;const b=[];return m.push(b),b},newHole:function(h){const m=this.addNewEmptyHole(h);m&&(this.setDrawnLatLngs(m),this.startDrawingForward(),h&&this.newPointForward(h))},addNewEmptyShape:function(){if(this.feature._latlngs.length&&this.feature._latlngs[0].length){const h=[];return this.appendShape(h),h}return this.feature._latlngs},ensureMulti:function(){this.feature._latlngs.length&&_(this.feature._latlngs[0])&&(this.feature._latlngs=[this.feature._latlngs])},ensureNotFlat:function(){(!this.feature._latlngs.length||_(this.feature._latlngs))&&(this.feature._latlngs=[this.feature._latlngs])},vertexCanBeDeleted:function(h){const m=this.feature.parentShape(h.latlngs);return i.Util.indexOf(m,h.latlngs)>0?!0:i.Editable.PathEditor.prototype.vertexCanBeDeleted.call(this,h)},getDefaultLatLngs:function(){return this.feature._latlngs.length||this.feature._latlngs.push([]),this.feature._latlngs[0]},formatShape:h=>_(h)&&(!h[0]||h[0].length!==0)?[h]:h}),i.Editable.RectangleEditor=i.Editable.PathEditor.extend({CLOSED:!0,MIN_VERTEX:4,options:{skipMiddleMarkers:!0},extendBounds:function(h){const m=h.vertex.getIndex(),b=h.vertex.getNext(),T=h.vertex.getPrevious(),A=(m+2)%4,N=h.vertex.latlngs[A],R=new i.LatLngBounds(h.latlng,N);T.latlng.update([h.latlng.lat,N.lng]),b.latlng.update([N.lat,h.latlng.lng]),this.updateBounds(R),this.refreshVertexMarkers()},onDrawingMouseDown:function(h){i.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,h),this.connect();const m=this.getDefaultLatLngs();m.length===3&&m.push(h.latlng);const b=new i.LatLngBounds(h.latlng,h.latlng);this.updateBounds(b),this.updateLatLngs(b),this.refresh(),this.reset(),h.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(h.originalEvent),m[3].__vertex.dragging._draggable._onDown(h.originalEvent)},onDrawingMouseUp:function(h){this.commitDrawing(h),h.originalEvent._simulated=!1,i.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,h)},onDrawingMouseMove:function(h){h.originalEvent._simulated=!1,i.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,h)},getDefaultLatLngs:function(h){return h||this.feature._latlngs[0]},updateBounds:function(h){this.feature._bounds=h},updateLatLngs:function(h){const m=this.getDefaultLatLngs(),b=this.feature._boundsToLatLngs(h);for(let T=0;T<m.length;T++)m[T].update(b[T])}}),i.Editable.CircleEditor=i.Editable.PathEditor.extend({MIN_VERTEX:2,options:{skipMiddleMarkers:!0},initialize:function(h,m,b){i.Editable.PathEditor.prototype.initialize.call(this,h,m,b),this._resizeLatLng=this.computeResizeLatLng()},computeResizeLatLng:function(){const h=(this.feature._radius||this.feature._mRadius)*Math.cos(Math.PI/4),m=this.map.project(this.feature._latlng);return this.map.unproject([m.x+h,m.y-h])},updateResizeLatLng:function(){this._resizeLatLng.update(this.computeResizeLatLng()),this._resizeLatLng.__vertex.update()},getLatLngs:function(){return[this.feature._latlng,this._resizeLatLng]},getDefaultLatLngs:function(){return this.getLatLngs()},onVertexMarkerDrag:function(h){h.vertex.getIndex()===1?this.resize(h):this.updateResizeLatLng(h),i.Editable.PathEditor.prototype.onVertexMarkerDrag.call(this,h)},resize:function(h){let m;this.map.options.crs?m=this.map.options.crs.distance(this.feature._latlng,h.latlng):m=this.feature._latlng.distanceTo(h.latlng),this.feature.setRadius(m)},onDrawingMouseDown:function(h){i.Editable.PathEditor.prototype.onDrawingMouseDown.call(this,h),this._resizeLatLng.update(h.latlng),this.feature._latlng.update(h.latlng),this.connect(),h.originalEvent._simulated=!1,this.map.dragging._draggable._onUp(h.originalEvent),this._resizeLatLng.__vertex.dragging._draggable._onDown(h.originalEvent)},onDrawingMouseUp:function(h){this.commitDrawing(h),h.originalEvent._simulated=!1,i.Editable.PathEditor.prototype.onDrawingMouseUp.call(this,h)},onDrawingMouseMove:function(h){h.originalEvent._simulated=!1,i.Editable.PathEditor.prototype.onDrawingMouseMove.call(this,h)},onDrag:function(h){i.Editable.PathEditor.prototype.onDrag.call(this,h),this.feature.dragging.updateLatLng(this._resizeLatLng)}});const r={createEditor:function(h){h=h||this._map;const m=this.options.editOptions?.editTools||h.editTools;if(!m)throw Error("Unable to detect Editable instance.");const b=this.options.editorClass||this.getEditorClass(m);return new b(h,this,this.options.editOptions)},enableEdit:function(h){return this.editor||this.createEditor(h),this.editor.enable(),this.editor},editEnabled:function(){return this.editor?.enabled()},disableEdit:function(){this.editor&&(this.editor.disable(),delete this.editor)},toggleEdit:function(){this.editEnabled()?this.disableEdit():this.enableEdit()},_onEditableAdd:function(){this.editor&&this.enableEdit()}},o={getEditorClass:h=>h?.options?.polylineEditorClass||i.Editable.PolylineEditor,shapeAt:function(h,m){let b=null;if(m=m||this._latlngs,!m.length)return b;if(_(m)&&this.isInLatLngs(h,m))b=m;else for(const T of m)if(this.isInLatLngs(h,T))return T;return b},isInLatLngs:function(h,m){if(!m)return!1;let b,T,A,N=[],R;const S=this._clickTolerance();if(this._projectLatlngs(m,N,this._pxBounds),N=N[0],R=this._map.latLngToLayerPoint(h),!this._pxBounds.contains(R))return!1;for(b=1,A=N.length,T=0;b<A;T=b++)if(i.LineUtil.pointToSegmentDistance(R,N[T],N[b])<=S)return!0;return!1}},a={getEditorClass:h=>h?.options?.polygonEditorClass||i.Editable.PolygonEditor,shapeAt:function(h,m){let b=null;if(m=m||this._latlngs,!m.length)return b;if(_(m)&&this.isInLatLngs(h,m)&&(b=m),_(m[0])&&this.isInLatLngs(h,m[0]))b=m;else for(const T of m)if(this.isInLatLngs(h,T[0]))return T;return b},isInLatLngs:(h,m)=>{let b=!1,T,A,N,R,S;for(N=0,S=m.length,R=S-1;N<S;R=N++)T=m[N],A=m[R],T.lat>h.lat!=A.lat>h.lat&&h.lng<(A.lng-T.lng)*(h.lat-T.lat)/(A.lat-T.lat)+T.lng&&(b=!b);return b},parentShape:function(h,m){if(m=m||this._latlngs,!m)return;let b=i.Util.indexOf(m,h);if(b!==-1)return m;for(const T of m)if(b=i.Util.indexOf(T,h),b!==-1)return T}},l={getEditorClass:h=>h?.options?.markerEditorClass||i.Editable.MarkerEditor},u={getEditorClass:h=>h?.options?.circleMarkerEditorClass||i.Editable.CircleMarkerEditor},f={getEditorClass:h=>h?.options?.rectangleEditorClass||i.Editable.RectangleEditor},d={getEditorClass:h=>h?.options?.circleEditorClass||i.Editable.CircleEditor},g=function(){this.on("add",this._onEditableAdd)},_=i.LineUtil.isFlat||i.LineUtil._flat||i.Polyline._flat;i.Polyline&&(i.Polyline.include(r),i.Polyline.include(o),i.Polyline.addInitHook(g)),i.Polygon&&(i.Polygon.include(r),i.Polygon.include(a)),i.Marker&&(i.Marker.include(r),i.Marker.include(l),i.Marker.addInitHook(g)),i.CircleMarker&&(i.CircleMarker.include(r),i.CircleMarker.include(u),i.CircleMarker.addInitHook(g)),i.Rectangle&&(i.Rectangle.include(r),i.Rectangle.include(f)),i.Circle&&(i.Circle.include(r),i.Circle.include(d)),i.LatLng.prototype.update=function(h){h=i.latLng(h),this.lat=h.lat,this.lng=h.lng}},window)})(dl)),dl.exports}hw();var Ds={exports:{}},dw=Ds.exports,Vd;function fw(){return Vd||(Vd=1,(function(n){(function(e,i){n.exports?n.exports=i(su()):i(e.L)})(typeof self<"u"?self:dw,e=>{if(typeof document>"u")return console.warn('"window.document" is undefined; leaflet.fullscreen requires this object to access the DOM'),!1;const i=(()=>{const a=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"]],l=a[0],u={};for(const f of a)if(f[1]in document){for(let d=0;d<f.length;d++)u[l[d]]=f[d];return u}return!1})(),r={change:i.fullscreenchange,error:i.fullscreenerror},o={request(a,l){return new Promise((u,f)=>{const d=(function(){this.off("change",d),u()}).bind(this);this.on("change",d),a=a||document.documentElement;const g=a[i.requestFullscreen](l);g instanceof Promise&&g.then(d).catch(f)})},exit(){return new Promise((a,l)=>{if(!this.isFullscreen){a();return}const u=(function(){this.off("change",u),a()}).bind(this);this.on("change",u);const f=document[i.exitFullscreen]();f instanceof Promise&&f.then(u).catch(l)})},on(a,l){const u=r[a];u&&document.addEventListener(u,l,!1)},off(a,l){const u=r[a];u&&document.removeEventListener(u,l,!1)},nativeAPI:i};return Object.defineProperties(o,{isFullscreen:{get(){return!!document[i.fullscreenElement]}},isEnabled:{enumerable:!0,get(){return!!document[i.fullscreenEnabled]}}}),e.Control.FullScreen=e.Control.extend({options:{position:"topleft",title:"Full Screen",titleCancel:"Exit Full Screen",forceSeparateButton:!1,forcePseudoFullscreen:!1,fullscreenElement:!1},_screenfull:o,onAdd(a){let l="leaflet-control-zoom-fullscreen",u,f="";return a.zoomControl&&!this.options.forceSeparateButton?u=a.zoomControl._container:u=e.DomUtil.create("div","leaflet-bar"),this.options.content?f=this.options.content:l+=" leaflet-fullscreen-icon",this._createButton(this.options.title,l,f,u,this.toggleFullScreen,this),this._map.fullscreenControl=this,this._map.on("enterFullscreen exitFullscreen",this._toggleState,this),u},onRemove(){e.DomEvent.off(this.link,"click",e.DomEvent.stop).off(this.link,"click",this.toggleFullScreen,this),this._screenfull.isEnabled&&(e.DomEvent.off(this._container,this._screenfull.nativeAPI.fullscreenchange,e.DomEvent.stop).off(this._container,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,this),e.DomEvent.off(document,this._screenfull.nativeAPI.fullscreenchange,e.DomEvent.stop).off(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,this))},_createButton(a,l,u,f,d,g){return this.link=e.DomUtil.create("a",l,f),this.link.href="#",this.link.title=a,this.link.innerHTML=u,this.link.setAttribute("role","button"),this.link.setAttribute("aria-label",a),L.DomEvent.disableClickPropagation(f),e.DomEvent.on(this.link,"click",e.DomEvent.stop).on(this.link,"click",d,g),this._screenfull.isEnabled&&(e.DomEvent.on(f,this._screenfull.nativeAPI.fullscreenchange,e.DomEvent.stop).on(f,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,g),e.DomEvent.on(document,this._screenfull.nativeAPI.fullscreenchange,e.DomEvent.stop).on(document,this._screenfull.nativeAPI.fullscreenchange,this._handleFullscreenChange,g)),this.link},toggleFullScreen(){const a=this._map;a._exitFired=!1,a._isFullscreen?(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.exit().then(()=>a.invalidateSize()):(e.DomUtil.removeClass(this.options.fullscreenElement?this.options.fullscreenElement:a._container,"leaflet-pseudo-fullscreen"),a.invalidateSize()),a.fire("exitFullscreen"),a._exitFired=!0,a._isFullscreen=!1):(this._screenfull.isEnabled&&!this.options.forcePseudoFullscreen?this._screenfull.request(this.options.fullscreenElement?this.options.fullscreenElement:a._container).then(()=>a.invalidateSize()):(e.DomUtil.addClass(this.options.fullscreenElement?this.options.fullscreenElement:a._container,"leaflet-pseudo-fullscreen"),a.invalidateSize()),a.fire("enterFullscreen"),a._isFullscreen=!0)},_toggleState(){this.link.title=this._map._isFullscreen?this.options.title:this.options.titleCancel,this._map._isFullscreen?L.DomUtil.removeClass(this.link,"leaflet-fullscreen-on"):L.DomUtil.addClass(this.link,"leaflet-fullscreen-on")},_handleFullscreenChange(a){const l=this._map;a.target===l.getContainer()&&!this._screenfull.isFullscreen&&!l._exitFired&&(this._screenfull.exit().then(()=>l.invalidateSize()),l.fire("exitFullscreen"),l._exitFired=!0,l._isFullscreen=!1)}}),e.Map.include({toggleFullscreen(){this.fullscreenControl.toggleFullScreen()}}),e.Map.addInitHook(function(){this.options.fullscreenControl&&this.addControl(e.control.fullscreen(this.options.fullscreenControlOptions))}),e.control.fullscreen=function(a){return new e.Control.FullScreen(a)},{leaflet:e}})})(Ds)),Ds.exports}fw();cw.icon({iconUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAFgUlEQVR4Aa1XA5BjWRTN2oW17d3YaZtr2962HUzbDNpjszW24mRt28p47v7zq/bXZtrp/lWnXr337j3nPCe85NcypgSFdugCpW5YoDAMRaIMqRi6aKq5E3YqDQO3qAwjVWrD8Ncq/RBpykd8oZUb/kaJutow8r1aP9II0WmLKLIsJyv1w/kqw9Ch2MYdB++12Onxee/QMwvf4/Dk/Lfp/i4nxTXtOoQ4pW5Aj7wpici1A9erdAN2OH64x8OSP9j3Ft3b7aWkTg/Fm91siTra0f9on5sQr9INejH6CUUUpavjFNq1B+Oadhxmnfa8RfEmN8VNAsQhPqF55xHkMzz3jSmChWU6f7/XZKNH+9+hBLOHYozuKQPxyMPUKkrX/K0uWnfFaJGS1QPRtZsOPtr3NsW0uyh6NNCOkU3Yz+bXbT3I8G3xE5EXLXtCXbbqwCO9zPQYPRTZ5vIDXD7U+w7rFDEoUUf7ibHIR4y6bLVPXrz8JVZEql13trxwue/uDivd3fkWRbS6/IA2bID4uk0UpF1N8qLlbBlXs4Ee7HLTfV1j54APvODnSfOWBqtKVvjgLKzF5YdEk5ewRkGlK0i33Eofffc7HT56jD7/6U+qH3Cx7SBLNntH5YIPvODnyfIXZYRVDPqgHtLs5ABHD3YzLuespb7t79FY34DjMwrVrcTuwlT55YMPvOBnRrJ4VXTdNnYug5ucHLBjEpt30701A3Ts+HEa73u6dT3FNWwflY86eMHPk+Yu+i6pzUpRrW7SNDg5JHR4KapmM5Wv2E8Tfcb1HoqqHMHU+uWDD7zg54mz5/2BSnizi9T1Dg4QQXLToGNCkb6tb1NU+QAlGr1++eADrzhn/u8Q2YZhQVlZ5+CAOtqfbhmaUCS1ezNFVm2imDbPmPng5wmz+gwh+oHDce0eUtQ6OGDIyR0uUhUsoO3vfDmmgOezH0mZN59x7MBi++WDL1g/eEiU3avlidO671bkLfwbw5XV2P8Pzo0ydy4t2/0eu33xYSOMOD8hTf4CrBtGMSoXfPLchX+J0ruSePw3LZeK0juPJbYzrhkH0io7B3k164hiGvawhOKMLkrQLyVpZg8rHFW7E2uHOL888IBPlNZ1FPzstSJM694fWr6RwpvcJK60+0HCILTBzZLFNdtAzJaohze60T8qBzyh5ZuOg5e7uwQppofEmf2++DYvmySqGBuKaicF1blQjhuHdvCIMvp8whTTfZzI7RldpwtSzL+F1+wkdZ2TBOW2gIF88PBTzD/gpeREAMEbxnJcaJHNHrpzji0gQCS6hdkEeYt9DF/2qPcEC8RM28Hwmr3sdNyht00byAut2k3gufWNtgtOEOFGUwcXWNDbdNbpgBGxEvKkOQsxivJx33iow0Vw5S6SVTrpVq11ysA2Rp7gTfPfktc6zhtXBBC+adRLshf6sG2RfHPZ5EAc4sVZ83yCN00Fk/4kggu40ZTvIEm5g24qtU4KjBrx/BTTH8ifVASAG7gKrnWxJDcU7x8X6Ecczhm3o6YicvsLXWfh3Ch1W0k8x0nXF+0fFxgt4phz8QvypiwCCFKMqXCnqXExjq10beH+UUA7+nG6mdG/Pu0f3LgFcGrl2s0kNNjpmoJ9o4B29CMO8dMT4Q5ox8uitF6fqsrJOr8qnwNbRzv6hSnG5wP+64C7h9lp30hKNtKdWjtdkbuPA19nJ7Tz3zR/ibgARbhb4AlhavcBebmTHcFl2fvYEnW0ox9xMxKBS8btJ+KiEbq9zA4RthQXDhPa0T9TEe69gWupwc6uBUphquXgf+/FrIjweHQS4/pduMe5ERUMHUd9xv8ZR98CxkS4F2n3EUrUZ10EYNw7BWm9x1GiPssi3GgiGRDKWRYZfXlON+dfNbM+GgIwYdwAAAAASUVORK5CYII=",shadowUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACkAAAApCAQAAAACach9AAACMUlEQVR4Ae3ShY7jQBAE0Aoz/f9/HTMzhg1zrdKUrJbdx+Kd2nD8VNudfsL/Th///dyQN2TH6f3y/BGpC379rV+S+qqetBOxImNQXL8JCAr2V4iMQXHGNJxeCfZXhSRBcQMfvkOWUdtfzlLgAENmZDcmo2TVmt8OSM2eXxBp3DjHSMFutqS7SbmemzBiR+xpKCNUIRkdkkYxhAkyGoBvyQFEJEefwSmmvBfJuJ6aKqKWnAkvGZOaZXTUgFqYULWNSHUckZuR1HIIimUExutRxwzOLROIG4vKmCKQt364mIlhSyzAf1m9lHZHJZrlAOMMztRRiKimp/rpdJDc9Awry5xTZCte7FHtuS8wJgeYGrex28xNTd086Dik7vUMscQOa8y4DoGtCCSkAKlNwpgNtphjrC6MIHUkR6YWxxs6Sc5xqn222mmCRFzIt8lEdKx+ikCtg91qS2WpwVfBelJCiQJwvzixfI9cxZQWgiSJelKnwBElKYtDOb2MFbhmUigbReQBV0Cg4+qMXSxXSyGUn4UbF8l+7qdSGnTC0XLCmahIgUHLhLOhpVCtw4CzYXvLQWQbJNmxoCsOKAxSgBJno75avolkRw8iIAFcsdc02e9iyCd8tHwmeSSoKTowIgvscSGZUOA7PuCN5b2BX9mQM7S0wYhMNU74zgsPBj3HU7wguAfnxxjFQGBE6pwN+GjME9zHY7zGp8wVxMShYX9NXvEWD3HbwJf4giO4CFIQxXScH1/TM+04kkBiAAAAAElFTkSuQmCC",iconSize:[25,41],shadowSize:[41,41],iconAnchor:[12,41],shadowAnchor:[14,41],popupAnchor:[-3,-76]});
|