@ulb-darmstadt/shacl-form 3.2.1 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -4
- package/dist/assets/mode-Bjl1P7KJ.js +13 -0
- package/dist/assets/mode-C_BqcQqf.js +13 -0
- package/dist/assets/query-DOX-ExQB.js +91 -0
- package/dist/assets/query-Y4qLEXu3.js +568 -0
- package/dist/bundle.js +24 -19
- package/dist/config.d.ts +2 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constraints.d.ts +3 -1
- package/dist/editor.d.ts +9 -0
- package/dist/form.d.ts +8 -0
- package/dist/graph-loader.d.ts +2 -2
- package/dist/group.d.ts +4 -1
- package/dist/index.js +17 -11
- package/dist/linker.d.ts +8 -2
- package/dist/node.d.ts +2 -1
- package/dist/plugins/assets/property-template-DgV0sNnv.js +1 -0
- package/dist/plugins/file-upload.js +1 -1
- package/dist/plugins/leaflet.js +2 -2
- package/dist/property-template.d.ts +5 -1
- package/dist/property.d.ts +3 -1
- package/dist/query/index.d.ts +2 -1
- package/dist/serialize.d.ts +2 -3
- package/dist/sparql.js +2 -2
- package/dist/theme.d.ts +10 -0
- package/package.json +3 -2
- package/src/query/query-mode.md +6 -4
- package/dist/assets/mode-C0O1k7Tm.js +0 -13
- package/dist/assets/mode-KFvmvNiB.js +0 -13
- package/dist/assets/query-igazZxn_.js +0 -501
- package/dist/assets/query-rxkbsWqy.js +0 -84
- package/dist/plugins/assets/property-template-DahfpzrJ.js +0 -1
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},c=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},l=(n,r,a)=>(a=n==null?{}:e(i(n)),c(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n)),u=o((e=>{e.byteLength=c,e.toByteArray=u,e.fromByteArray=p;for(var t=[],n=[],r=typeof Uint8Array<`u`?Uint8Array:Array,i=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,a=0,o=i.length;a<o;++a)t[a]=i[a],n[i.charCodeAt(a)]=a;n[45]=62,n[95]=63;function s(e){var t=e.length;if(t%4>0)throw Error(`Invalid string. Length must be a multiple of 4`);var n=e.indexOf(`=`);n===-1&&(n=t);var r=n===t?0:4-n%4;return[n,r]}function c(e){var t=s(e),n=t[0],r=t[1];return(n+r)*3/4-r}function l(e,t,n){return(t+n)*3/4-n}function u(e){var t,i=s(e),a=i[0],o=i[1],c=new r(l(e,a,o)),u=0,d=o>0?a-4:a,f;for(f=0;f<d;f+=4)t=n[e.charCodeAt(f)]<<18|n[e.charCodeAt(f+1)]<<12|n[e.charCodeAt(f+2)]<<6|n[e.charCodeAt(f+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=t&255;return o===2&&(t=n[e.charCodeAt(f)]<<2|n[e.charCodeAt(f+1)]>>4,c[u++]=t&255),o===1&&(t=n[e.charCodeAt(f)]<<10|n[e.charCodeAt(f+1)]<<4|n[e.charCodeAt(f+2)]>>2,c[u++]=t>>8&255,c[u++]=t&255),c}function d(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[e&63]}function f(e,t,n){for(var r,i=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(e[a+2]&255),i.push(d(r));return i.join(``)}function p(e){for(var n,r=e.length,i=r%3,a=[],o=16383,s=0,c=r-i;s<c;s+=o)a.push(f(e,s,s+o>c?c:s+o));return i===1?(n=e[r-1],a.push(t[n>>2]+t[n<<4&63]+`==`)):i===2&&(n=(e[r-2]<<8)+e[r-1],a.push(t[n>>10]+t[n>>4&63]+t[n<<2&63]+`=`)),a.join(``)}})),d=o((e=>{e.read=function(e,t,n,r,i){var a,o,s=i*8-r-1,c=(1<<s)-1,l=c>>1,u=-7,d=n?i-1:0,f=n?-1:1,p=e[t+d];for(d+=f,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=a*256+e[t+d],d+=f,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=r;u>0;o=o*256+e[t+d],d+=f,u-=8);if(a===0)a=1-l;else if(a===c)return o?NaN:(p?-1:1)*(1/0);else o+=2**r,a-=l;return(p?-1:1)*o*2**(a-r)},e.write=function(e,t,n,r,i,a){var o,s,c,l=a*8-i-1,u=(1<<l)-1,d=u>>1,f=i===23?2**-24-2**-77:0,p=r?0:a-1,m=r?1:-1,h=+(t<0||t===0&&1/t<0);for(t=Math.abs(t),isNaN(t)||t===1/0?(s=+!!isNaN(t),o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=2**-o)<1&&(o--,c*=2),o+d>=1?t+=f/c:t+=f*2**(1-d),t*c>=2&&(o++,c/=2),o+d>=u?(s=0,o=u):o+d>=1?(s=(t*c-1)*2**i,o+=d):(s=t*2**(d-1)*2**i,o=0));i>=8;e[n+p]=s&255,p+=m,s/=256,i-=8);for(o=o<<i|s,l+=i;l>0;e[n+p]=o&255,p+=m,o/=256,l-=8);e[n+p-m]|=h*128}})),f=o((e=>{var t=u(),n=d(),r=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;var i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=a(),!s.TYPED_ARRAY_SUPPORT&&typeof console<`u`&&typeof console.error==`function`&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(e){if(e>i)throw RangeError(`The value "`+e+`" is invalid for option "size"`);let t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,n){if(typeof e==`number`){if(typeof t==`string`)throw TypeError(`The "string" argument must be of type string. Received type number`);return p(e)}return c(e,t,n)}s.poolSize=8192;function c(e,t,n){if(typeof e==`string`)return m(e,t);if(ArrayBuffer.isView(e))return g(e);if(e==null)throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e);if(ge(e,ArrayBuffer)||e&&ge(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(ge(e,SharedArrayBuffer)||e&&ge(e.buffer,SharedArrayBuffer)))return _(e,t,n);if(typeof e==`number`)throw TypeError(`The "value" argument must not be of type number. Received type number`);let r=e.valueOf&&e.valueOf();if(r!=null&&r!==e)return s.from(r,t,n);let i=v(e);if(i)return i;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]==`function`)return s.from(e[Symbol.toPrimitive](`string`),t,n);throw TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+typeof e)}s.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(e){if(typeof e!=`number`)throw TypeError(`"size" argument must be of type number`);if(e<0)throw RangeError(`The value "`+e+`" is invalid for option "size"`)}function f(e,t,n){return l(e),e<=0||t===void 0?o(e):typeof n==`string`?o(e).fill(t,n):o(e).fill(t)}s.alloc=function(e,t,n){return f(e,t,n)};function p(e){return l(e),o(e<0?0:y(e)|0)}s.allocUnsafe=function(e){return p(e)},s.allocUnsafeSlow=function(e){return p(e)};function m(e,t){if((typeof t!=`string`||t===``)&&(t=`utf8`),!s.isEncoding(t))throw TypeError(`Unknown encoding: `+t);let n=x(e,t)|0,r=o(n),i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}function h(e){let t=e.length<0?0:y(e.length)|0,n=o(t);for(let r=0;r<t;r+=1)n[r]=e[r]&255;return n}function g(e){if(ge(e,Uint8Array)){let t=new Uint8Array(e);return _(t.buffer,t.byteOffset,t.byteLength)}return h(e)}function _(e,t,n){if(t<0||e.byteLength<t)throw RangeError(`"offset" is outside of buffer bounds`);if(e.byteLength<t+(n||0))throw RangeError(`"length" is outside of buffer bounds`);let r;return r=t===void 0&&n===void 0?new Uint8Array(e):n===void 0?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,s.prototype),r}function v(e){if(s.isBuffer(e)){let t=y(e.length)|0,n=o(t);return n.length===0||e.copy(n,0,0,t),n}if(e.length!==void 0)return typeof e.length!=`number`||W(e.length)?o(0):h(e);if(e.type===`Buffer`&&Array.isArray(e.data))return h(e.data)}function y(e){if(e>=i)throw RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+i.toString(16)+` bytes`);return e|0}function b(e){return+e!=e&&(e=0),s.alloc(+e)}s.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==s.prototype},s.compare=function(e,t){if(ge(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),ge(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===t)return 0;let n=e.length,r=t.length;for(let i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:+(r<n)},s.isEncoding=function(e){switch(String(e).toLowerCase()){case`hex`:case`utf8`:case`utf-8`:case`ascii`:case`latin1`:case`binary`:case`base64`:case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return!0;default:return!1}},s.concat=function(e,t){if(!Array.isArray(e))throw TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return s.alloc(0);let n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;let r=s.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){let t=e[n];if(ge(t,Uint8Array))i+t.length>r.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else if(s.isBuffer(t))t.copy(r,i);else throw TypeError(`"list" argument must be an Array of Buffers`);i+=t.length}return r};function x(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||ge(e,ArrayBuffer))return e.byteLength;if(typeof e!=`string`)throw TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+typeof e);let n=e.length,r=arguments.length>2&&arguments[2]===!0;if(!r&&n===0)return 0;let i=!1;for(;;)switch(t){case`ascii`:case`latin1`:case`binary`:return n;case`utf8`:case`utf-8`:return fe(e).length;case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return n*2;case`hex`:return n>>>1;case`base64`:return he(e).length;default:if(i)return r?-1:fe(e).length;t=(``+t).toLowerCase(),i=!0}}s.byteLength=x;function S(e,t,n){let r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return``;for(e||=`utf8`;;)switch(e){case`hex`:return L(this,t,n);case`utf8`:case`utf-8`:return M(this,t,n);case`ascii`:return F(this,t,n);case`latin1`:case`binary`:return I(this,t,n);case`base64`:return j(this,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return R(this,t,n);default:if(r)throw TypeError(`Unknown encoding: `+e);e=(e+``).toLowerCase(),r=!0}}s.prototype._isBuffer=!0;function C(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}s.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError(`Buffer size must be a multiple of 16-bits`);for(let t=0;t<e;t+=2)C(this,t,t+1);return this},s.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError(`Buffer size must be a multiple of 32-bits`);for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},s.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError(`Buffer size must be a multiple of 64-bits`);for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},s.prototype.toString=function(){let e=this.length;return e===0?``:arguments.length===0?M(this,0,e):S.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw TypeError(`Argument must be a Buffer`);return this===e||s.compare(this,e)===0},s.prototype.inspect=function(){let t=``,n=e.INSPECT_MAX_BYTES;return t=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(t+=` ... `),`<Buffer `+t+`>`},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(e,t,n,r,i){if(ge(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+typeof e);if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),i===void 0&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw RangeError(`out of range index`);if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;let a=i-r,o=n-t,c=Math.min(a,o),l=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<c;++e)if(l[e]!==u[e]){a=l[e],o=u[e];break}return a<o?-1:+(o<a)};function w(e,t,n,r,i){if(e.length===0)return-1;if(typeof n==`string`?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,W(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0)if(i)n=0;else return-1;if(typeof t==`string`&&(t=s.from(t,r)),s.isBuffer(t))return t.length===0?-1:T(e,t,n,r,i);if(typeof t==`number`)return t&=255,typeof Uint8Array.prototype.indexOf==`function`?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):T(e,[t],n,r,i);throw TypeError(`val must be string, number or Buffer`)}function T(e,t,n,r,i){let a=1,o=e.length,s=t.length;if(r!==void 0&&(r=String(r).toLowerCase(),r===`ucs2`||r===`ucs-2`||r===`utf16le`||r===`utf-16le`)){if(e.length<2||t.length<2)return-1;a=2,o/=2,s/=2,n/=2}function c(e,t){return a===1?e[t]:e.readUInt16BE(t*a)}let l;if(i){let r=-1;for(l=n;l<o;l++)if(c(e,l)===c(t,r===-1?0:l-r)){if(r===-1&&(r=l),l-r+1===s)return r*a}else r!==-1&&(l-=l-r),r=-1}else for(n+s>o&&(n=o-s),l=n;l>=0;l--){let n=!0;for(let r=0;r<s;r++)if(c(e,l+r)!==c(t,r)){n=!1;break}if(n)return l}return-1}s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.indexOf=function(e,t,n){return w(this,e,t,n,!0)},s.prototype.lastIndexOf=function(e,t,n){return w(this,e,t,n,!1)};function E(e,t,n,r){n=Number(n)||0;let i=e.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;let a=t.length;r>a/2&&(r=a/2);let o;for(o=0;o<r;++o){let r=parseInt(t.substr(o*2,2),16);if(W(r))return o;e[n+o]=r}return o}function D(e,t,n,r){return U(fe(t,e.length-n),e,n,r)}function O(e,t,n,r){return U(pe(t),e,n,r)}function k(e,t,n,r){return U(he(t),e,n,r)}function A(e,t,n,r){return U(me(t,e.length-n),e,n,r)}s.prototype.write=function(e,t,n,r){if(t===void 0)r=`utf8`,n=this.length,t=0;else if(n===void 0&&typeof t==`string`)r=t,n=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(n)?(n>>>=0,r===void 0&&(r=`utf8`)):(r=n,n=void 0);else throw Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);let i=this.length-t;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw RangeError(`Attempt to write outside buffer bounds`);r||=`utf8`;let a=!1;for(;;)switch(r){case`hex`:return E(this,e,t,n);case`utf8`:case`utf-8`:return D(this,e,t,n);case`ascii`:case`latin1`:case`binary`:return O(this,e,t,n);case`base64`:return k(this,e,t,n);case`ucs2`:case`ucs-2`:case`utf16le`:case`utf-16le`:return A(this,e,t,n);default:if(a)throw TypeError(`Unknown encoding: `+r);r=(``+r).toLowerCase(),a=!0}},s.prototype.toJSON=function(){return{type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function j(e,n,r){return n===0&&r===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(n,r))}function M(e,t,n){n=Math.min(e.length,n);let r=[],i=t;for(;i<n;){let t=e[i],a=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,s,c;switch(o){case 1:t<128&&(a=t);break;case 2:n=e[i+1],(n&192)==128&&(c=(t&31)<<6|n&63,c>127&&(a=c));break;case 3:n=e[i+1],r=e[i+2],(n&192)==128&&(r&192)==128&&(c=(t&15)<<12|(n&63)<<6|r&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:n=e[i+1],r=e[i+2],s=e[i+3],(n&192)==128&&(r&192)==128&&(s&192)==128&&(c=(t&15)<<18|(n&63)<<12|(r&63)<<6|s&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,o=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|a&1023),r.push(a),i+=o}return P(r)}var N=4096;function P(e){let t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n=``,r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=N));return n}function F(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]&127);return r}function I(e,t,n){let r=``;n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function L(e,t,n){let r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);let i=``;for(let r=t;r<n;++r)i+=_e[e[r]];return i}function R(e,t,n){let r=e.slice(t,n),i=``;for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+r[e+1]*256);return i}s.prototype.slice=function(e,t){let n=this.length;e=~~e,t=t===void 0?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t<e&&(t=e);let r=this.subarray(e,t);return Object.setPrototypeOf(r,s.prototype),r};function z(e,t,n){if(e%1!=0||e<0)throw RangeError(`offset is not uint`);if(e+t>n)throw RangeError(`Trying to access beyond buffer length`)}s.prototype.readUintLE=s.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return r},s.prototype.readUintBE=s.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||z(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=ve(function(e){e>>>=0,ce(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&le(e,this.length-8);let r=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))}),s.prototype.readBigUInt64BE=ve(function(e){e>>>=0,ce(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&le(e,this.length-8);let r=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(i)}),s.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=this[e],i=1,a=0;for(;++a<t&&(i*=256);)r+=this[e+a]*i;return i*=128,r>=i&&(r-=2**(8*t)),r},s.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||z(e,t,this.length);let r=t,i=1,a=this[e+--r];for(;r>0&&(i*=256);)a+=this[e+--r]*i;return i*=128,a>=i&&(a-=2**(8*t)),a},s.prototype.readInt8=function(e,t){return e>>>=0,t||z(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||z(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},s.prototype.readInt16BE=function(e,t){e>>>=0,t||z(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||z(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=ve(function(e){e>>>=0,ce(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&le(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),s.prototype.readBigInt64BE=ve(function(e){e>>>=0,ce(e,`offset`);let t=this[e],n=this[e+7];(t===void 0||n===void 0)&&le(e,this.length-8);let r=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)}),s.prototype.readFloatLE=function(e,t){return e>>>=0,t||z(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||z(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||z(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||z(e,8,this.length),n.read(this,e,!1,52,8)};function B(e,t,n,r,i,a){if(!s.isBuffer(e))throw TypeError(`"buffer" argument must be a Buffer instance`);if(t>i||t<a)throw RangeError(`"value" argument is out of bounds`);if(n+r>e.length)throw RangeError(`Index out of range`)}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;B(this,e,t,n,r,0)}let i=1,a=0;for(this[t]=e&255;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){let r=2**(8*n)-1;B(this,e,t,n,r,0)}let i=n-1,a=1;for(this[t+i]=e&255;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,255,0),this[t]=e&255,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ee(e,t,n,r,i){se(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a,a>>=8,e[n++]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,n}function V(e,t,n,r,i){se(t,r,i,e,n,7);let a=Number(t&BigInt(4294967295));e[n+7]=a,a>>=8,e[n+6]=a,a>>=8,e[n+5]=a,a>>=8,e[n+4]=a;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=o,o>>=8,e[n+2]=o,o>>=8,e[n+1]=o,o>>=8,e[n]=o,n+8}s.prototype.writeBigUInt64LE=ve(function(e,t=0){return ee(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeBigUInt64BE=ve(function(e,t=0){return V(this,e,t,BigInt(0),BigInt(`0xffffffffffffffff`))}),s.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);B(this,e,t,n,r-1,-r)}let i=0,a=1,o=0;for(this[t]=e&255;++i<n&&(a*=256);)e<0&&o===0&&this[t+i-1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){let r=2**(8*n-1);B(this,e,t,n,r-1,-r)}let i=n-1,a=1,o=0;for(this[t+i]=e&255;--i>=0&&(a*=256);)e<0&&o===0&&this[t+i+1]!==0&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||B(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},s.prototype.writeBigInt64LE=ve(function(e,t=0){return ee(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))}),s.prototype.writeBigInt64BE=ve(function(e,t=0){return V(this,e,t,-BigInt(`0x8000000000000000`),BigInt(`0x7fffffffffffffff`))});function te(e,t,n,r,i,a){if(n+r>e.length||n<0)throw RangeError(`Index out of range`)}function H(e,t,r,i,a){return t=+t,r>>>=0,a||te(e,t,r,4,34028234663852886e22,-34028234663852886e22),n.write(e,t,r,i,23,4),r+4}s.prototype.writeFloatLE=function(e,t,n){return H(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return H(this,e,t,!1,n)};function ne(e,t,r,i,a){return t=+t,r>>>=0,a||te(e,t,r,8,17976931348623157e292,-17976931348623157e292),n.write(e,t,r,i,52,8),r+8}s.prototype.writeDoubleLE=function(e,t,n){return ne(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return ne(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,r){if(!s.isBuffer(e))throw TypeError(`argument should be a Buffer`);if(n||=0,!r&&r!==0&&(r=this.length),t>=e.length&&(t=e.length),t||=0,r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw RangeError(`targetStart out of bounds`);if(n<0||n>=this.length)throw RangeError(`Index out of range`);if(r<0)throw RangeError(`sourceEnd out of bounds`);r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);let i=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},s.prototype.fill=function(e,t,n,r){if(typeof e==`string`){if(typeof t==`string`?(r=t,t=0,n=this.length):typeof n==`string`&&(r=n,n=this.length),r!==void 0&&typeof r!=`string`)throw TypeError(`encoding must be a string`);if(typeof r==`string`&&!s.isEncoding(r))throw TypeError(`Unknown encoding: `+r);if(e.length===1){let t=e.charCodeAt(0);(r===`utf8`&&t<128||r===`latin1`)&&(e=t)}}else typeof e==`number`?e&=255:typeof e==`boolean`&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw RangeError(`Out of range index`);if(n<=t)return this;t>>>=0,n=n===void 0?this.length:n>>>0,e||=0;let i;if(typeof e==`number`)for(i=t;i<n;++i)this[i]=e;else{let a=s.isBuffer(e)?e:s.from(e,r),o=a.length;if(o===0)throw TypeError(`The value "`+e+`" is invalid for argument "value"`);for(i=0;i<n-t;++i)this[i+t]=a[i%o]}return this};var re={};function ie(e,t,n){re[e]=class extends n{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}ie(`ERR_BUFFER_OUT_OF_BOUNDS`,function(e){return e?`${e} is outside of buffer bounds`:`Attempt to access memory outside buffer bounds`},RangeError),ie(`ERR_INVALID_ARG_TYPE`,function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),ie(`ERR_OUT_OF_RANGE`,function(e,t,n){let r=`The value of "${e}" is out of range.`,i=n;return Number.isInteger(n)&&Math.abs(n)>2**32?i=ae(String(n)):typeof n==`bigint`&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=ae(i)),i+=`n`),r+=` It must be ${t}. Received ${i}`,r},RangeError);function ae(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function oe(e,t,n){ce(t,`offset`),(e[t]===void 0||e[t+n]===void 0)&&le(t,e.length-(n+1))}function se(e,t,n,r,i,a){if(e>n||e<t){let r=typeof t==`bigint`?`n`:``,i;throw i=a>3?t===0||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${(a+1)*8}${r}`:`>= -(2${r} ** ${(a+1)*8-1}${r}) and < 2 ** ${(a+1)*8-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new re.ERR_OUT_OF_RANGE(`value`,i,e)}oe(r,i,a)}function ce(e,t){if(typeof e!=`number`)throw new re.ERR_INVALID_ARG_TYPE(t,`number`,e)}function le(e,t,n){throw Math.floor(e)===e?t<0?new re.ERR_BUFFER_OUT_OF_BOUNDS:new re.ERR_OUT_OF_RANGE(n||`offset`,`>= ${+!!n} and <= ${t}`,e):(ce(e,n),new re.ERR_OUT_OF_RANGE(n||`offset`,`an integer`,e))}var ue=/[^+/0-9A-Za-z-_]/g;function de(e){if(e=e.split(`=`)[0],e=e.trim().replace(ue,``),e.length<2)return``;for(;e.length%4!=0;)e+=`=`;return e}function fe(e,t){t||=1/0;let n,r=e.length,i=null,a=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}else if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=(i-55296<<10|n-56320)+65536}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if(--t<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw Error(`Invalid code point`)}return a}function pe(e){let t=[];for(let n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function me(e,t){let n,r,i,a=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,a.push(i),a.push(r);return a}function he(e){return t.toByteArray(de(e))}function U(e,t,n,r){let i;for(i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function ge(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}function W(e){return e!==e}var _e=(function(){let e=`0123456789abcdef`,t=Array(256);for(let n=0;n<16;++n){let r=n*16;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t})();function ve(e){return typeof BigInt>`u`?ye:e}function ye(){throw Error(`BigInt not supported`)}})),p=`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,m=`http://www.w3.org/2001/XMLSchema#`,h=`http://www.w3.org/2000/10/swap/`,g={xsd:{decimal:`${m}decimal`,boolean:`${m}boolean`,double:`${m}double`,integer:`${m}integer`,string:`${m}string`},rdf:{type:`${p}type`,nil:`${p}nil`,first:`${p}first`,rest:`${p}rest`,langString:`${p}langString`},owl:{sameAs:`http://www.w3.org/2002/07/owl#sameAs`},r:{forSome:`${h}reify#forSome`,forAll:`${h}reify#forAll`},log:{implies:`${h}log#implies`,isImpliedBy:`${h}log#isImpliedBy`}},_=f(),{xsd:v}=g,y=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,b={"\\":`\\`,"'":`'`,'"':`"`,n:`
|
|
2
|
+
`,r:`\r`,t:` `,f:`\f`,b:`\b`,_:`_`,"~":`~`,".":`.`,"-":`-`,"!":`!`,$:`$`,"&":`&`,"(":`(`,")":`)`,"*":`*`,"+":`+`,",":`,`,";":`;`,"=":`=`,"/":`/`,"?":`?`,"#":`#`,"@":`@`,"%":`%`},x=/[\x00-\x20<>\\"\{\}\|\^\`]/,S={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},C=/$0^/,w=class{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||={},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(let e in this)!(e in S)&&this[e]instanceof RegExp&&(this[e]=C)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,r=n.length;for(;;){let e,o;for(;e=this._newline.exec(n);)this.comments&&(o=this._comment.exec(e[0]))&&i(`comment`,o[1],``,this._line,e[0].length),n=n.substr(e[0].length,n.length),r=n.length,this._line++;if(!e&&(e=this._whitespace.exec(n))&&(n=n.substr(e[0].length,n.length)),this._endOfFile.test(n))return t&&(this.comments&&(o=this._comment.exec(n))&&i(`comment`,o[1],``,this._line,n.length),n=null,i(`eof`,``,``,this._line,0)),this._input=n;let s=this._line,c=n[0],l=``,u=``,d=``,f=null,p=0,m=!1;switch(c){case`^`:if(n.length<3)break;if(n[1]===`^`){if(this._previousMarker=`^^`,n=n.substr(2),n[0]!==`<`){m=!0;break}}else{this._n3Mode&&(p=1,l=`^`);break}case`<`:if(f=this._unescapedIri.exec(n))l=`IRI`,u=f[1];else if(f=this._iri.exec(n)){if(u=this._unescape(f[1]),u===null||x.test(u))return a(this);l=`IRI`}else n.length>1&&n[1]===`<`?(l=`<<`,p=2):this._n3Mode&&n.length>1&&n[1]===`=`&&(p=2,this._isImpliedBy?(l=`abbreviation`,u=`<`):(l=`inverse`,u=`>`));break;case`>`:n.length>1&&n[1]===`>`&&(l=`>>`,p=2);break;case`_`:((f=this._blank.exec(n))||t&&(f=this._blank.exec(`${n} `)))&&(l=`blank`,d=`_`,u=f[1]);break;case`"`:if(f=this._simpleQuotedString.exec(n))u=f[1];else if({value:u,matchLength:p}=this._parseLiteral(n),u===null)return a(this);(f!==null||p!==0)&&(l=`literal`,this._literalClosingPos=0);break;case`'`:if(!this._lineMode){if(f=this._simpleApostropheString.exec(n))u=f[1];else if({value:u,matchLength:p}=this._parseLiteral(n),u===null)return a(this);(f!==null||p!==0)&&(l=`literal`,this._literalClosingPos=0)}break;case`?`:this._n3Mode&&(f=this._variable.exec(n))&&(l=`var`,u=f[0]);break;case`@`:this._previousMarker===`literal`&&(f=this._langcode.exec(n))?(l=`langcode`,u=f[1]):(f=this._keyword.exec(n))&&(l=f[0]);break;case`.`:if(n.length===1?t:n[1]<`0`||n[1]>`9`){l=`.`,p=1;break}case`0`:case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:case`+`:case`-`:(f=this._number.exec(n)||t&&(f=this._number.exec(`${n} `)))&&(l=`literal`,u=f[0],d=typeof f[1]==`string`?v.double:typeof f[2]==`string`?v.decimal:v.integer);break;case`B`:case`b`:case`p`:case`P`:case`G`:case`g`:(f=this._sparqlKeyword.exec(n))?l=f[0].toUpperCase():m=!0;break;case`f`:case`t`:(f=this._boolean.exec(n))?(l=`literal`,u=f[0],d=v.boolean):m=!0;break;case`a`:(f=this._shortPredicates.exec(n))?(l=`abbreviation`,u=`a`):m=!0;break;case`=`:this._n3Mode&&n.length>1&&(l=`abbreviation`,n[1]===`>`?(p=2,u=`>`):(p=1,u=`=`));break;case`!`:if(!this._n3Mode)break;case`,`:case`;`:case`[`:case`]`:case`(`:case`)`:case`}`:this._lineMode||(p=1,l=c);break;case`{`:!this._lineMode&&n.length>=2&&(n[1]===`|`?(l=`{|`,p=2):(l=c,p=1));break;case`|`:n.length>=2&&n[1]===`}`&&(l=`|}`,p=2);break;default:m=!0}if(m&&((this._previousMarker===`@prefix`||this._previousMarker===`PREFIX`)&&(f=this._prefix.exec(n))?(l=`prefix`,u=f[1]||``):((f=this._prefixed.exec(n))||t&&(f=this._prefixed.exec(`${n} `)))&&(l=`prefixed`,d=f[1]||``,u=this._unescape(f[2]))),this._previousMarker===`^^`)switch(l){case`prefixed`:l=`type`;break;case`IRI`:l=`typeIRI`;break;default:l=``}if(!l)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?a(this):this._input=n;let h=p||f[0].length,g=i(l,u,d,s,h);this.previousToken=g,this._previousMarker=l,n=n.substr(h,n.length)}function i(t,i,a,o,s){let c=n?r-n.length:r,l={type:t,value:i,prefix:a,line:o,start:c,end:c+s};return e(null,l),l}function a(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1,n=e.replace(y,(e,n,r,i)=>{if(typeof n==`string`)return String.fromCharCode(Number.parseInt(n,16));if(typeof r==`string`){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(e&1023))}return i in b?b[i]:(t=!0,``)});return t?null:n}_parseLiteral(e){if(e.length>=3){let t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length,r=Math.max(this._literalClosingPos,n);for(;(r=e.indexOf(t,r))>0;){let t=0;for(;e[r-t-1]===`\\`;)t++;if(t%2==0){let t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,a=r+n;if(n===1&&i!==0||n===3&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:a}}r++}this._literalClosingPos=e.length-n+1}return{value:``,matchLength:0}}_syntaxError(e){this._input=null;let t=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(``)?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{let e=[],t;if(this._tokenizeToEnd((n,r)=>n?t=n:e.push(r),!0),t)throw t;return e}else this._pendingBuffer=null,typeof e.setEncoding==`function`&&e.setEncoding(`utf8`),e.on(`data`,e=>{this._input!==null&&e.length!==0&&(this._pendingBuffer&&=(e=_.Buffer.concat([this._pendingBuffer,e]),null),e[e.length-1]&128?this._pendingBuffer=e:(this._input===void 0?this._input=this._readStartingBom(typeof e==`string`?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))}),e.on(`end`,()=>{typeof this._input==`string`&&this._tokenizeToEnd(t,!0)}),e.on(`error`,t)}},{rdf:T,xsd:E}=g,D,O=0,k={namedNode:R,blankNode:z,variable:ee,literal:B,defaultGraph:V,quad:te,triple:te,fromTerm:H,fromQuad:ne},A=class e{constructor(e){this.id=e}get value(){return this.id}equals(t){return t instanceof e?this.id===t.id:!!t&&this.termType===t.termType&&this.value===t.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}},j=class extends A{get termType(){return`NamedNode`}},M=class e extends A{get termType(){return`Literal`}get value(){return this.id.substring(1,this.id.lastIndexOf(`"`))}get language(){let e=this.id,t=e.lastIndexOf(`"`)+1;return t<e.length&&e[t++]===`@`?e.substr(t).toLowerCase():``}get datatype(){return new j(this.datatypeString)}get datatypeString(){let e=this.id,t=e.lastIndexOf(`"`)+1,n=t<e.length?e[t]:``;return n===`^`?e.substr(t+2):n===`@`?T.langString:E.string}equals(t){return t instanceof e?this.id===t.id:!!t&&!!t.datatype&&this.termType===t.termType&&this.value===t.value&&this.language===t.language&&this.datatype.value===t.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:`NamedNode`,value:this.datatypeString}}}},N=class extends A{constructor(e){super(`_:${e}`)}get termType(){return`BlankNode`}get value(){return this.id.substr(2)}},P=class extends A{constructor(e){super(`?${e}`)}get termType(){return`Variable`}get value(){return this.id.substr(1)}};D=new class extends A{constructor(){return super(``),D||this}get termType(){return`DefaultGraph`}equals(e){return this===e||!!e&&this.termType===e.termType}};function F(e,t,n){if(t||=k,!e)return t.defaultGraph();switch(e[0]){case`?`:return t.variable(e.substr(1));case`_`:return t.blankNode(e.substr(2));case`"`:if(t===k)return new M(e);if(e[e.length-1]===`"`)return t.literal(e.substr(1,e.length-2));let r=e.lastIndexOf(`"`,e.length-1);return t.literal(e.substr(1,r-1),e[r+1]===`@`?e.substr(r+2):t.namedNode(e.substr(r+3)));case`[`:e=JSON.parse(e);break;default:if(!n||!Array.isArray(e))return t.namedNode(e)}return t.quad(F(e[0],t,!0),F(e[1],t,!0),F(e[2],t,!0),e[3]&&F(e[3],t,!0))}function I(e,t){if(typeof e==`string`)return e;if(e instanceof A&&e.termType!==`Quad`)return e.id;if(!e)return D.id;switch(e.termType){case`NamedNode`:return e.value;case`BlankNode`:return`_:${e.value}`;case`Variable`:return`?${e.value}`;case`DefaultGraph`:return``;case`Literal`:return`"${e.value}"${e.language?`@${e.language}`:e.datatype&&e.datatype.value!==E.string?`^^${e.datatype.value}`:``}`;case`Quad`:let n=[I(e.subject,!0),I(e.predicate,!0),I(e.object,!0)];return e.graph&&e.graph.termType!==`DefaultGraph`&&n.push(I(e.graph,!0)),t?n:JSON.stringify(n);default:throw Error(`Unexpected termType: ${e.termType}`)}}var L=class extends A{constructor(e,t,n,r){super(``),this._subject=e,this._predicate=t,this._object=n,this._graph=r||D}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 R(e){return new j(e)}function z(e){return new N(e||`n3-${O++}`)}function B(e,t){if(typeof t==`string`)return new M(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:``;return n===``&&(typeof e==`boolean`?n=E.boolean:typeof e==`number`&&(Number.isFinite(e)?n=Number.isInteger(e)?E.integer:E.double:(n=E.double,Number.isNaN(e)||(e=e>0?`INF`:`-INF`)))),n===``||n===E.string?new M(`"${e}"`):new M(`"${e}"^^${n}`)}function ee(e){return new P(e)}function V(){return D}function te(e,t,n,r){return new L(e,t,n,r)}function H(e){if(e instanceof A)return e;switch(e.termType){case`NamedNode`:return R(e.value);case`BlankNode`:return z(e.value);case`Variable`:return ee(e.value);case`DefaultGraph`:return D;case`Literal`:return B(e.value,e.language||e.datatype);case`Quad`:return ne(e);default:throw Error(`Unexpected termType: ${e.termType}`)}}function ne(e){if(e instanceof L)return e;if(e.termType!==`Quad`)throw Error(`Unexpected termType: ${e.termType}`);return te(H(e.subject),H(e.predicate),H(e.object),H(e.graph))}var re=0,ie=class{constructor(e){this._contextStack=[],this._graph=null,e||={},this._setBase(e.baseIRI),e.factory&&oe(this,e.factory);let t=typeof e.format==`string`?e.format.match(/\w*$/)[0].toLowerCase():``,n=/turtle/.test(t),r=/trig/.test(t),i=/triple/.test(t),a=/quad/.test(t),o=this._n3Mode=/n3/.test(t),s=i||a;(this._supportsNamedGraphs=!(n||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||i||o),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=t===``||/star|\*$/.test(t),s&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix=typeof e.blankNodePrefix==`string`?e.blankNodePrefix.replace(/^(?!_:)/,`_:`):``,this._lexer=e.lexer||new w({lineMode:s,n3:o,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){re=0}_setBase(e){if(!e)this._base=``,this._basePath=``;else{let 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,r,i){let a=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:r,object:i,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){let 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?(delete this._prefixes._,this._callback(null,null,this._prefixes)):this._error(`Unclosed graph`,e);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`:let t=this._resolveIRI(e.value);if(t===null)return this._error(`Invalid IRI`,e);n=this._factory.namedNode(t);break;case`type`:case`prefixed`:let r=this._prefixes[e.prefix];if(r===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._factory.namedNode(r+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){let 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._error(`Expected predicate but got ;`,e):this._readPredicate;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._graph=this._subject,this._subject=null,this._readSubject):this._error(`Expected graph but got ${e.type}`,e)}_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);let t=this._predicate===null;return this._restoreContext(`blank`,e),this._object===null?this._predicate===null?t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank:this._readObject:this._getContextEndReader()}_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,r=this._readListItem,i=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()),r=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(r=this._readPredicate,this._subject===this.RDF_NIL)return r}else if(r=this._getContextEndReader(),this._object===this.RDF_NIL)return r;n=this.RDF_NIL;break;case`literal`:e.prefix.length===0?(this._literalValue=e.value,r=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),r=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()),i===null?o.predicate===null?o.subject=n:o.object=n:this._emit(i,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 r}_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`:let 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){let 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._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext(`formula`,e),this._object===null?this._readPredicate:this._getContextEndReader()):this._readPunctuation(e)}_readPunctuation(e){let t,n=this._graph,r=this._subject,i=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,i&&(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);let a=this._predicate,o=this._object;this._subject=this._factory.quad(r,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(r!==null){let e=this._predicate,t=this._object;i?this._emit(t,e,r,n):this._emit(r,e,t,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._readInTopContext:this._error(`Expected dot to follow quad`,e)}_readPrefix(e){return e.type===`prefix`?(this._prefix=e.value,this._readPrefixIRI):this._error(`Expected prefix to follow @prefix`,e)}_readPrefixIRI(e){if(e.type!==`IRI`)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);let t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){let 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._subject=this._factory.blankNode(),this._readGraph):this._error(`Invalid graph label`,e)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type===`.`?this._readInTopContext:this._error(`Expected declaration to end with a dot`,e)}_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:let t=this._contextStack,n=t.length&&t[t.length-1];if(n&&n.type===`item`){let t=this._subject;this._restoreContext(`item`,e),this._emit(this._subject,this.RDF_FIRST,t,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n,r=this._factory.blankNode();if((n=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){let t=this._factory.blankNode(),n,r;if((n=this._readEntity(e))!==void 0)return this._predicate===null?(r=this._subject,this._subject=t):(r=this._object,this._object=t),this._emit(t,n,r,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type===`>>`?this._readRDFStarTail(e):this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e)}_readRDFStarTail(e){if(e.type!==`>>`)return this._error(`Expected >> but got ${e.type}`,e);let 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(){let e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case`blank`:return this._readBlankNodeTail;case`list`:return this._readListItem;case`formula`:return this._readFormulaTail;case`<<`:return this._readRDFStarTailOrGraph}}_emit(e,t,n,r){this._callback(null,this._factory.quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){let n=Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=ae}_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;let t=e.length,n=``,r=-1,i=-1,a=0,o=`/`;for(;r<t;){switch(o){case`:`:if(i<0&&e[++r]===`/`&&e[++r]===`/`)for(;(i=r+1)<t&&e[i]!==`/`;)r=i;break;case`?`:case`#`:r=t;break;case`/`:if(e[r+1]===`.`)switch(o=e[++r+1],o){case`/`:n+=e.substring(a,r-1),a=r+1;break;case void 0:case`?`:case`#`:return n+e.substring(a,r)+e.substr(r+1);case`.`:if(o=e[++r+1],o===void 0||o===`/`||o===`?`||o===`#`){if(n+=e.substring(a,r-2),(a=n.lastIndexOf(`/`))>=i&&(n=n.substr(0,a)),o!==`/`)return`${n}/${e.substr(r+1)}`;a=r+1}}}o=e[++r]}return n+e.substring(a)}parse(e,t,n){let r,i,a;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(r=t.onQuad,i=t.onPrefix,a=t.onComment):(r=t,i=n),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${re++}_`,this._prefixCallback=i||ae,this._inversePredicate=!1,this._quantified=Object.create(null),!r){let t=[],n;if(this._callback=(e,r)=>{e?n=e:r&&t.push(r)},this._lexer.tokenize(e).every(e=>this._readCallback=this._readCallback(e)),n)throw n;return t}let o=(e,t)=>{e===null?this._readCallback&&=this._readCallback(t):(this._callback(e),this._callback=ae)};a&&(this._lexer.comments=!0,o=(e,t)=>{e===null?this._readCallback&&(t.type===`comment`?a(t.value):this._readCallback=this._readCallback(t)):(this._callback(e),this._callback=ae)}),this._callback=r,this._lexer.tokenize(e,o)}};function ae(){}function oe(e,t){e._factory=t,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=t.namedNode(g.rdf.first),e.RDF_REST=t.namedNode(g.rdf.rest),e.RDF_NIL=t.namedNode(g.rdf.nil),e.N3_FORALL=t.namedNode(g.r.forAll),e.N3_FORSOME=t.namedNode(g.r.forSome),e.ABBREVIATIONS={a:t.namedNode(g.rdf.type),"=":t.namedNode(g.owl.sameAs),">":t.namedNode(g.log.implies),"<":t.namedNode(g.log.isImpliedBy)},e.QUANTIFIERS_GRAPH=t.namedNode(`urn:n3:quantifiers`)}oe(ie.prototype,k);function se(e){return!!e&&e.termType===`DefaultGraph`}function ce(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,`\\$&`)}var le=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,ue=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,de=`./`,fe=`../`,pe=`?`,me=`#`,he=class e{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=Array(e.length+1)}static supports(e){return!le.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!e.supports(this.base))return this._baseMatcher=/.^/;let t=/^[^:]*:\/*/.exec(this.base)[0],n=[`^`,ce(t)],r=[],i=[],a=/[^/?#]*([/?#])/y,o,s=0,c=0,l=a.lastIndex=t.length;for(;!s&&!c&&(o=a.exec(this.base));)o[1]===me?c=a.lastIndex-1:(n.push(ce(o[0]),`(?:`),r.push(`)?`),o[1]===pe?(s=l=a.lastIndex,c=this.base.indexOf(me,s),this._pathReplacements[s]=pe):i.push(l=a.lastIndex));for(let e=0;e<i.length;e++)this._pathReplacements[i[e]]=fe.repeat(i.length-e-1);return this._pathReplacements[i[i.length-1]]=de,this._baseLength=c>0?c:this.base.length,n.push(ce(this.base.substring(l,this._baseLength)),s?`(?:#|$)`:`(?:[?#]|$)`),this._baseMatcher=new RegExp([...n,...r].join(``))}toRelative(e){let t=this._getBaseMatcher().exec(e);if(!t)return e;let n=t[0].length;if(n===this._baseLength&&n===e.length)return``;let r=this._pathReplacements[n];if(r){let t=e.substring(n);return r!==pe&&!ue.test(t)?e:r===de&&/^[^?#]/.test(t)?t:r+t}return e.substring(n-1)}},U=k.defaultGraph(),{rdf:ge,xsd:W}=g,_e=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ve=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,ye={"\\":`\\\\`,'"':`\\"`," ":`\\t`,"\n":`\\n`,"\r":`\\r`,"\b":`\\b`,"\f":`\\f`},be=class extends A{equals(e){return e===this}},xe=class{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!=`function`&&(t=e,e=null),t||={},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0||!!t.end;else{let e=``;this._outputStream={write(t,n,r){e+=t,r&&r()},end:t=>{t&&t(null,e)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=U,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new he(t.baseIRI)))}get _inDefaultGraph(){return U.equals(this._graph)}_write(e,t){this._outputStream.write(e,`utf8`,t)}_writeQuad(e,t,n,r,i){try{r.equals(this._graph)||(this._write((this._subject===null?``:this._inDefaultGraph?`.
|
|
3
|
+
`:`
|
|
4
|
+
}
|
|
5
|
+
`)+(U.equals(r)?``:`${this._encodeIriOrBlank(r)} {\n`)),this._graph=r,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,i):this._write(`;\n ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i):this._write(`${(this._subject===null?``:`.
|
|
6
|
+
`)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,i)}catch(e){i&&i(e)}}_writeQuadLine(e,t,n,r,i){delete this._prefixMatch,this._write(this.quadToString(e,t,n,r),i)}quadToString(e,t,n,r){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${r&&r.value?` ${this._encodeIriOrBlank(r)} .\n`:` .
|
|
7
|
+
`}`}quadsToString(e){let t=``;for(let n of e)t+=this.quadToString(n.subject,n.predicate,n.object,n.graph);return t}_encodeSubject(e){return e.termType===`Quad`?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if(e.termType!==`NamedNode`)return this._lists&&e.value in this._lists&&(e=this.list(this._lists[e.value])),`id`in e?e.id:`_:${e.value}`;let t=e.value;this._baseIri&&(t=this._baseIri.toRelative(t)),_e.test(t)&&(t=t.replace(ve,Se));let n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(_e.test(t)&&(t=t.replace(ve,Se)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===W.string)return`"${t}"`}else switch(e.datatype.value){case W.string:return`"${t}"`;case W.boolean:if(t===`true`||t===`false`)return t;break;case W.integer:if(/^[+-]?\d+$/.test(t))return t;break;case W.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case W.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t;break}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===ge.type?`a`:this._encodeIriOrBlank(e)}_encodeObject(e){switch(e.termType){case`Quad`:return this._encodeQuad(e);case`Literal`:return this._encodeLiteral(e);default:return this._encodeIriOrBlank(e)}}_encodeQuad({subject:e,predicate:t,object:n,graph:r}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${se(r)?``:` ${this._encodeIriOrBlank(r)}`}>>`}_blockedWrite(){throw Error(`Cannot write because the writer has been closed.`)}addQuad(e,t,n,r,i){n===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):typeof r==`function`?this._writeQuad(e,t,n,U,r):this._writeQuad(e,t,n,r||U,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,n){let r={};r[e]=t,this.addPrefixes(r,n)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let n=!1;for(let t in e){let r=e[t];typeof r!=`string`&&(r=r.value),n=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
8
|
+
`:`
|
|
9
|
+
}
|
|
10
|
+
`),this._subject=null,this._graph=``),this._prefixIRIs[r]=t+=`:`,this._write(`@prefix ${t} <${r}>.\n`)}if(n){let e=``,t=``;for(let n in this._prefixIRIs)e+=e?`|${n}`:n,t+=(t?`|`:``)+this._prefixIRIs[n];e=ce(e,/[\]\/\(\)\*\+\?\.\\\$]/g,`\\$&`),this._prefixRegex=RegExp(`^(?:${t})[^\/]*$|^(${e})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(n?`
|
|
11
|
+
`:``,t)}blank(e,t){let n=e,r,i;switch(e===void 0?n=[]:e.termType?n=[{predicate:e,object:t}]:`length`in e||(n=[e]),i=n.length){case 0:return new be(`[]`);case 1:if(r=n[0],!(r.object instanceof be))return new be(`[ ${this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)} ]`);default:let t=`[`;for(let a=0;a<i;a++)r=n[a],r.predicate.equals(e)?t+=`, ${this._encodeObject(r.object)}`:(t+=`${(a?`;
|
|
12
|
+
`:`
|
|
13
|
+
`)+this._encodePredicate(r.predicate)} ${this._encodeObject(r.object)}`,e=r.predicate);return new be(`${t}\n]`)}}list(e){let t=e&&e.length||0,n=Array(t);for(let r=0;r<t;r++)n[r]=this._encodeObject(e[r]);return new be(`(${n.join(` `)})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
14
|
+
`:`
|
|
15
|
+
}
|
|
16
|
+
`),this._subject=null),this._write=this._blockedWrite;let t=e&&((n,r)=>{t=null,e(n,r)});if(this._endStream)try{return this._outputStream.end(t)}catch{}t&&t()}};function Se(e){let t=ye[e];return t===void 0&&(e.length===1?(t=e.charCodeAt(0).toString(16),t=`\\u0000`.substr(0,6-t.length)+t):(t=((e.charCodeAt(0)-55296)*1024+e.charCodeAt(1)+9216).toString(16),t=`\\U00000000`.substr(0,10-t.length)+t)),t}var G=o(((e,t)=>{t.exports={AggregateError:class extends Error{constructor(e){if(!Array.isArray(e))throw TypeError(`Expected input to be an Array, got ${typeof e}`);let t=``;for(let n=0;n<e.length;n++)t+=` ${e[n].stack}\n`;super(t),this.name=`AggregateError`,this.errors=e}},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:2**53-1,NumberMIN_SAFE_INTEGER:-(2**53-1),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}})),Ce=o(((e,t)=>{t.exports={format(e,...t){return e.replace(/%([sdifj])/g,function(...[e,n]){let r=t.shift();return n===`f`?r.toFixed(6):n===`j`?JSON.stringify(r):n===`s`&&typeof r==`object`?`${r.constructor===Object?``:r.constructor.name} {}`.trim():r.toString()})},inspect(e){switch(typeof e){case`string`:if(e.includes(`'`)){if(!e.includes(`"`))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case`number`:return isNaN(e)?`NaN`:Object.is(e,-0)?String(e):e;case`bigint`:return`${String(e)}n`;case`boolean`:case`undefined`:return String(e);case`object`:return`{}`}}}})),we=o(((e,t)=>{var{format:n,inspect:r}=Ce(),{AggregateError:i}=G(),a=globalThis.AggregateError||i,o=Symbol(`kIsNodeError`),s=[`string`,`function`,`number`,`object`,`Function`,`Object`,`boolean`,`bigint`,`symbol`],c=/^([A-Z][a-z0-9]*)+$/,l=`__node_internal_`,u={};function d(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function f(e){let t=``,n=e.length,r=+(e[0]===`-`);for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function p(e,t,r){if(typeof t==`function`)return d(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);let i=(t.match(/%[dfijoOs]/g)||[]).length;return d(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),r.length===0?t:n(t,...r)}function m(e,t,n){n||=Error;class r extends n{constructor(...n){super(p(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(r.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),r.prototype.code=e,r.prototype[o]=!0,u[e]=r}function h(e){let t=l+e.name;return Object.defineProperty(e,"name",{value:t}),e}function g(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let n=new a([t,e],t.message);return n.code=t.code,n}return e||t}var _=class extends Error{constructor(e=`The operation was aborted`,t=void 0){if(t!==void 0&&typeof t!=`object`)throw new u.ERR_INVALID_ARG_TYPE(`options`,`Object`,t);super(e,t),this.code=`ABORT_ERR`,this.name=`AbortError`}};m(`ERR_ASSERTION`,`%s`,Error),m(`ERR_INVALID_ARG_TYPE`,(e,t,n)=>{d(typeof e==`string`,`'name' must be a string`),Array.isArray(t)||(t=[t]);let i=`The `;e.endsWith(` argument`)?i+=`${e} `:i+=`"${e}" ${e.includes(`.`)?`property`:`argument`} `,i+=`must be `;let a=[],o=[],l=[];for(let e of t)d(typeof e==`string`,`All expected entries have to be of type string`),s.includes(e)?a.push(e.toLowerCase()):c.test(e)?o.push(e):(d(e!==`object`,`The value "object" should be written as "Object"`),l.push(e));if(o.length>0){let e=a.indexOf(`object`);e!==-1&&(a.splice(a,e,1),o.push(`Object`))}if(a.length>0){switch(a.length){case 1:i+=`of type ${a[0]}`;break;case 2:i+=`one of type ${a[0]} or ${a[1]}`;break;default:{let e=a.pop();i+=`one of type ${a.join(`, `)}, or ${e}`}}(o.length>0||l.length>0)&&(i+=` or `)}if(o.length>0){switch(o.length){case 1:i+=`an instance of ${o[0]}`;break;case 2:i+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`an instance of ${o.join(`, `)}, or ${e}`}}l.length>0&&(i+=` or `)}switch(l.length){case 0:break;case 1:l[0].toLowerCase()!==l[0]&&(i+=`an `),i+=`${l[0]}`;break;case 2:i+=`one of ${l[0]} or ${l[1]}`;break;default:{let e=l.pop();i+=`one of ${l.join(`, `)}, or ${e}`}}if(n==null)i+=`. Received ${n}`;else if(typeof n==`function`&&n.name)i+=`. Received function ${n.name}`;else if(typeof n==`object`){var u;if((u=n.constructor)!=null&&u.name)i+=`. Received an instance of ${n.constructor.name}`;else{let e=r(n,{depth:-1});i+=`. Received ${e}`}}else{let e=r(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof n} (${e})`}return i},TypeError),m(`ERR_INVALID_ARG_VALUE`,(e,t,n=`is invalid`)=>{let i=r(t);return i.length>128&&(i=i.slice(0,128)+`...`),`The ${e.includes(`.`)?`property`:`argument`} '${e}' ${n}. Received ${i}`},TypeError),m(`ERR_INVALID_RETURN_VALUE`,(e,t,n)=>{var r;return`Expected ${e} to be returned from the "${t}" function but got ${n!=null&&(r=n.constructor)!=null&&r.name?`instance of ${n.constructor.name}`:`type ${typeof n}`}.`},TypeError),m(`ERR_MISSING_ARGS`,(...e)=>{d(e.length>0,`At least one arg needs to be specified`);let t,n=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(` or `),n){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(`, `)}, and ${n} arguments`}break}return`${t} must be specified`},TypeError),m(`ERR_OUT_OF_RANGE`,(e,t,n)=>{d(t,`Missing "range" argument`);let i;if(Number.isInteger(n)&&Math.abs(n)>2**32)i=f(String(n));else if(typeof n==`bigint`){i=String(n);let e=BigInt(2)**BigInt(32);(n>e||n<-e)&&(i=f(i)),i+=`n`}else i=r(n);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError),m(`ERR_MULTIPLE_CALLBACK`,`Callback called multiple times`,Error),m(`ERR_METHOD_NOT_IMPLEMENTED`,`The %s method is not implemented`,Error),m(`ERR_STREAM_ALREADY_FINISHED`,`Cannot call %s after a stream was finished`,Error),m(`ERR_STREAM_CANNOT_PIPE`,`Cannot pipe, not readable`,Error),m(`ERR_STREAM_DESTROYED`,`Cannot call %s after a stream was destroyed`,Error),m(`ERR_STREAM_NULL_VALUES`,`May not write null values to stream`,TypeError),m(`ERR_STREAM_PREMATURE_CLOSE`,`Premature close`,Error),m(`ERR_STREAM_PUSH_AFTER_EOF`,`stream.push() after EOF`,Error),m(`ERR_STREAM_UNSHIFT_AFTER_END_EVENT`,`stream.unshift() after end event`,Error),m(`ERR_STREAM_WRITE_AFTER_END`,`write after end`,Error),m(`ERR_UNKNOWN_ENCODING`,`Unknown encoding: %s`,TypeError),t.exports={AbortError:_,aggregateTwoErrors:h(g),hideStackFrames:h,codes:u}})),Te=o(((e,t)=>{var{AbortController:n,AbortSignal:r}=typeof self<`u`?self:typeof window<`u`?window:void 0;t.exports=n,t.exports.AbortSignal=r,t.exports.default=n})),Ee=o(((e,t)=>{var n=typeof Reflect==`object`?Reflect:null,r=n&&typeof n.apply==`function`?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)},i=n&&typeof n.ownKeys==`function`?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};function a(e){console&&console.warn&&console.warn(e)}var o=Number.isNaN||function(e){return e!==e};function s(){s.init.call(this)}t.exports=s,t.exports.once=y,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var c=10;function l(e){if(typeof e!=`function`)throw TypeError(`The "listener" argument must be of type Function. Received type `+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received `+e+`.`);c=e}}),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(e){if(typeof e!=`number`||e<0||o(e))throw RangeError(`The value of "n" is out of range. It must be a non-negative number. Received `+e+`.`);return this._maxListeners=e,this};function u(e){return e._maxListeners===void 0?s.defaultMaxListeners:e._maxListeners}s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i=e===`error`,a=this._events;if(a!==void 0)i&&=a.error===void 0;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var s=Error(`Unhandled error.`+(o?` (`+o.message+`)`:``));throw s.context=o,s}var c=a[e];if(c===void 0)return!1;if(typeof c==`function`)r(c,this,t);else for(var l=c.length,u=g(c,l),n=0;n<l;++n)r(u[n],this,t);return!0};function d(e,t,n,r){var i,o,s;if(l(n),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit(`newListener`,t,n.listener?n.listener:n),o=e._events),s=o[t]),s===void 0)s=o[t]=n,++e._eventsCount;else if(typeof s==`function`?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),i=u(e),i>0&&s.length>i&&!s.warned){s.warned=!0;var c=Error(`Possible EventEmitter memory leak detected. `+s.length+` `+String(t)+` listeners added. Use emitter.setMaxListeners() to increase limit`);c.name=`MaxListenersExceededWarning`,c.emitter=e,c.type=t,c.count=s.length,a(c)}return e}s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return d(this,e,t,!0)};function f(){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 p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=f.bind(r);return i.listener=n,r.wrapFn=i,i}s.prototype.once=function(e,t){return l(t),this.on(e,p(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return l(t),this.prependListener(e,p(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,a,o;if(l(t),r=this._events,r===void 0||(n=r[e],n===void 0))return this;if(n===t||n.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit(`removeListener`,e,n.listener||t));else if(typeof n!=`function`){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():_(n,i),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit(`removeListener`,e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n=this._events,r;if(n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(r=0;r<i.length;++r)a=i[r],a!==`removeListener`&&this.removeAllListeners(a);return this.removeAllListeners(`removeListener`),this._events=Object.create(null),this._eventsCount=0,this}if(t=n[e],typeof t==`function`)this.removeListener(e,t);else if(t!==void 0)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this};function m(e,t,n){var r=e._events;if(r===void 0)return[];var i=r[t];return i===void 0?[]:typeof i==`function`?n?[i.listener||i]:[i]:n?v(i):g(i,i.length)}s.prototype.listeners=function(e){return m(this,e,!0)},s.prototype.rawListeners=function(e){return m(this,e,!1)},s.listenerCount=function(e,t){return typeof e.listenerCount==`function`?e.listenerCount(t):h.call(e,t)},s.prototype.listenerCount=h;function h(e){var t=this._events;if(t!==void 0){var n=t[e];if(typeof n==`function`)return 1;if(n!==void 0)return n.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]};function g(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}function _(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function v(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function y(e,t){return new Promise(function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){typeof e.removeListener==`function`&&e.removeListener(`error`,i),n([].slice.call(arguments))}x(e,t,a,{once:!0}),t!==`error`&&b(e,i,{once:!0})})}function b(e,t,n){typeof e.on==`function`&&x(e,`error`,t,n)}function x(e,t,n,r){if(typeof e.on==`function`)r.once?e.once(t,n):e.on(t,n);else if(typeof e.addEventListener==`function`)e.addEventListener(t,function i(a){r.once&&e.removeEventListener(t,i),n(a)});else throw TypeError(`The "emitter" argument must be of type EventEmitter. Received type `+typeof e)}})),De=o(((e,t)=>{var n=f(),{format:r,inspect:i}=Ce(),{codes:{ERR_INVALID_ARG_TYPE:a}}=we(),{kResistStopPropagation:o,AggregateError:s,SymbolDispose:c}=G(),l=globalThis.AbortSignal||Te().AbortSignal,u=globalThis.AbortController||Te().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,p=globalThis.Blob||n.Blob,m=p===void 0?function(e){return!1}:function(e){return e instanceof p},h=(e,t)=>{if(e!==void 0&&(typeof e!=`object`||!e||!(`aborted`in e)))throw new a(t,`AbortSignal`,e)},g=(e,t)=>{if(typeof e!=`function`)throw new a(t,`Function`,e)};t.exports={AggregateError:s,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...n){t||(t=!0,e.apply(this,n))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},promisify(e){return new Promise((t,n)=>{e((e,...r)=>e?n(e):t(...r))})},debuglog(){return function(){}},format:r,inspect:i,types:{isAsyncFunction(e){return e instanceof d},isArrayBufferView(e){return ArrayBuffer.isView(e)}},isBlob:m,deprecate(e,t){return e},addAbortListener:Ee().addAbortListener||function(e,t){if(e===void 0)throw new a(`signal`,`AbortSignal`,e);h(e,`signal`),g(t,`listener`);let n;return e.aborted?queueMicrotask(()=>t()):(e.addEventListener(`abort`,t,{__proto__:null,once:!0,[o]:!0}),n=()=>{e.removeEventListener(`abort`,t)}),{__proto__:null,[c](){var e;(e=n)==null||e()}}},AbortSignalAny:l.any||function(e){if(e.length===1)return e[0];let t=new u,n=()=>t.abort();return e.forEach(e=>{h(e,`signals`),e.addEventListener(`abort`,n,{once:!0})}),t.signal.addEventListener(`abort`,()=>{e.forEach(e=>e.removeEventListener(`abort`,n))},{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for(`nodejs.util.promisify.custom`)})),Oe=o(((e,t)=>{var{ArrayIsArray:n,ArrayPrototypeIncludes:r,ArrayPrototypeJoin:i,ArrayPrototypeMap:a,NumberIsInteger:o,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:l,NumberParseInt:u,ObjectPrototypeHasOwnProperty:d,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:m,StringPrototypeTrim:h}=G(),{hideStackFrames:g,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:y,ERR_OUT_OF_RANGE:b,ERR_UNKNOWN_SIGNAL:x}}=we(),{normalizeEncoding:S}=De(),{isAsyncFunction:C,isArrayBufferView:w}=De().types,T={};function E(e){return e===(e|0)}function D(e){return e===e>>>0}var O=/^[0-7]+$/,k=`must be a 32-bit unsigned integer or an octal string`;function A(e,t,n){if(e===void 0&&(e=n),typeof e==`string`){if(f(O,e)===null)throw new y(t,e,k);e=u(e,8)}return N(e,t),e}var j=g((e,t,n=l,r=c)=>{if(typeof e!=`number`)throw new v(t,`number`,e);if(!o(e))throw new b(t,`an integer`,e);if(e<n||e>r)throw new b(t,`>= ${n} && <= ${r}`,e)}),M=g((e,t,n=-2147483648,r=2147483647)=>{if(typeof e!=`number`)throw new v(t,`number`,e);if(!o(e))throw new b(t,`an integer`,e);if(e<n||e>r)throw new b(t,`>= ${n} && <= ${r}`,e)}),N=g((e,t,n=!1)=>{if(typeof e!=`number`)throw new v(t,`number`,e);if(!o(e))throw new b(t,`an integer`,e);let r=+!!n,i=4294967295;if(e<r||e>i)throw new b(t,`>= ${r} && <= ${i}`,e)});function P(e,t){if(typeof e!=`string`)throw new v(t,`string`,e)}function F(e,t,n=void 0,r){if(typeof e!=`number`)throw new v(t,`number`,e);if(n!=null&&e<n||r!=null&&e>r||(n!=null||r!=null)&&s(e))throw new b(t,`${n==null?``:`>= ${n}`}${n!=null&&r!=null?` && `:``}${r==null?``:`<= ${r}`}`,e)}var I=g((e,t,n)=>{if(!r(n,e))throw new y(t,e,`must be one of: `+i(a(n,e=>typeof e==`string`?`'${e}'`:p(e)),`, `))});function L(e,t){if(typeof e!=`boolean`)throw new v(t,`boolean`,e)}function R(e,t,n){return e==null||!d(e,t)?n:e[t]}var z=g((e,t,r=null)=>{let i=R(r,`allowArray`,!1),a=R(r,`allowFunction`,!1);if(!R(r,`nullable`,!1)&&e===null||!i&&n(e)||typeof e!=`object`&&(!a||typeof e!=`function`))throw new v(t,`Object`,e)}),B=g((e,t)=>{if(e!=null&&typeof e!=`object`&&typeof e!=`function`)throw new v(t,`a dictionary`,e)}),ee=g((e,t,r=0)=>{if(!n(e))throw new v(t,`Array`,e);if(e.length<r)throw new y(t,e,`must be longer than ${r}`)});function V(e,t){ee(e,t);for(let n=0;n<e.length;n++)P(e[n],`${t}[${n}]`)}function te(e,t){ee(e,t);for(let n=0;n<e.length;n++)L(e[n],`${t}[${n}]`)}function H(e,t){ee(e,t);for(let n=0;n<e.length;n++){let r=e[n],i=`${t}[${n}]`;if(r==null)throw new v(i,`AbortSignal`,r);oe(r,i)}}function ne(e,t=`signal`){if(P(e,t),T[e]===void 0)throw T[m(e)]===void 0?new x(e):new x(e+` (signals must use all capital letters)`)}var re=g((e,t=`buffer`)=>{if(!w(e))throw new v(t,[`Buffer`,`TypedArray`,`DataView`],e)});function ie(e,t){let n=S(t),r=e.length;if(n===`hex`&&r%2!=0)throw new y(`encoding`,t,`is invalid for data of length ${r}`)}function ae(e,t=`Port`,n=!0){if(typeof e!=`number`&&typeof e!=`string`||typeof e==`string`&&h(e).length===0||+e!=e>>>0||e>65535||e===0&&!n)throw new _(t,e,n);return e|0}var oe=g((e,t)=>{if(e!==void 0&&(typeof e!=`object`||!e||!(`aborted`in e)))throw new v(t,`AbortSignal`,e)}),se=g((e,t)=>{if(typeof e!=`function`)throw new v(t,`Function`,e)}),ce=g((e,t)=>{if(typeof e!=`function`||C(e))throw new v(t,`Function`,e)}),le=g((e,t)=>{if(e!==void 0)throw new v(t,`undefined`,e)});function ue(e,t,n){if(!r(n,e))throw new v(t,`('${i(n,`|`)}')`,e)}var de=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function fe(e,t){if(e===void 0||!f(de,e))throw new y(t,e,`must be an array or string of format "</styles.css>; rel=preload; as=style"`)}function pe(e){if(typeof e==`string`)return fe(e,`hints`),e;if(n(e)){let t=e.length,n=``;if(t===0)return n;for(let r=0;r<t;r++){let i=e[r];fe(i,`hints`),n+=i,r!==t-1&&(n+=`, `)}return n}throw new y(`hints`,e,`must be an array or string of format "</styles.css>; rel=preload; as=style"`)}t.exports={isInt32:E,isUint32:D,parseFileMode:A,validateArray:ee,validateStringArray:V,validateBooleanArray:te,validateAbortSignalArray:H,validateBoolean:L,validateBuffer:re,validateDictionary:B,validateEncoding:ie,validateFunction:se,validateInt32:M,validateInteger:j,validateNumber:F,validateObject:z,validateOneOf:I,validatePlainFunction:ce,validatePort:ae,validateSignalName:ne,validateString:P,validateUint32:N,validateUndefined:le,validateUnion:ue,validateAbortSignal:oe,validateLinkHeaderValue:pe}})),ke=o(((e,t)=>{var n=t.exports={},r,i;function a(){throw Error(`setTimeout has not been defined`)}function o(){throw Error(`clearTimeout has not been defined`)}(function(){try{r=typeof setTimeout==`function`?setTimeout:a}catch{r=a}try{i=typeof clearTimeout==`function`?clearTimeout:o}catch{i=o}})();function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch{try{return r.call(null,e,0)}catch{return r.call(this,e,0)}}}function c(e){if(i===clearTimeout)return clearTimeout(e);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(e);try{return i(e)}catch{try{return i.call(null,e)}catch{return i.call(this,e)}}}var l=[],u=!1,d,f=-1;function p(){!u||!d||(u=!1,d.length?l=d.concat(l):f=-1,l.length&&m())}function m(){if(!u){var e=s(p);u=!0;for(var t=l.length;t;){for(d=l,l=[];++f<t;)d&&d[f].run();f=-1,t=l.length}d=null,u=!1,c(e)}}n.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new h(e,t)),l.length===1&&!u&&s(m)};function h(e,t){this.fun=e,this.array=t}h.prototype.run=function(){this.fun.apply(null,this.array)},n.title=`browser`,n.browser=!0,n.env={},n.argv=[],n.version=``,n.versions={};function g(){}n.on=g,n.addListener=g,n.once=g,n.off=g,n.removeListener=g,n.removeAllListeners=g,n.emit=g,n.prependListener=g,n.prependOnceListener=g,n.listeners=function(e){return[]},n.binding=function(e){throw Error(`process.binding is not supported`)},n.cwd=function(){return`/`},n.chdir=function(e){throw Error(`process.chdir is not supported`)},n.umask=function(){return 0}})),K=o(((e,t)=>{var{SymbolAsyncIterator:n,SymbolIterator:r,SymbolFor:i}=G(),a=i(`nodejs.stream.destroyed`),o=i(`nodejs.stream.errored`),s=i(`nodejs.stream.readable`),c=i(`nodejs.stream.writable`),l=i(`nodejs.stream.disturbed`),u=i(`nodejs.webstream.isClosedPromise`),d=i(`nodejs.webstream.controllerErrorFunction`);function f(e,t=!1){return!!(e&&typeof e.pipe==`function`&&typeof e.on==`function`&&(!t||typeof e.pause==`function`&&typeof e.resume==`function`)&&(!e._writableState||e._readableState?.readable!==!1)&&(!e._writableState||e._readableState))}function p(e){return!!(e&&typeof e.write==`function`&&typeof e.on==`function`&&(!e._readableState||e._writableState?.writable!==!1))}function m(e){return!!(e&&typeof e.pipe==`function`&&e._readableState&&typeof e.on==`function`&&typeof e.write==`function`)}function h(e){return e&&(e._readableState||e._writableState||typeof e.write==`function`&&typeof e.on==`function`||typeof e.pipe==`function`&&typeof e.on==`function`)}function g(e){return!!(e&&!h(e)&&typeof e.pipeThrough==`function`&&typeof e.getReader==`function`&&typeof e.cancel==`function`)}function _(e){return!!(e&&!h(e)&&typeof e.getWriter==`function`&&typeof e.abort==`function`)}function v(e){return!!(e&&!h(e)&&typeof e.readable==`object`&&typeof e.writable==`object`)}function y(e){return g(e)||_(e)||v(e)}function b(e,t){return e==null?!1:t===!0?typeof e[n]==`function`:t===!1?typeof e[r]==`function`:typeof e[n]==`function`||typeof e[r]==`function`}function x(e){if(!h(e))return null;let t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[a]||r!=null&&r.destroyed)}function S(e){if(!p(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended==`boolean`?t.ended:null}function C(e,t){if(!p(e))return null;if(e.writableFinished===!0)return!0;let n=e._writableState;return n!=null&&n.errored?!1:typeof n?.finished==`boolean`?!!(n.finished||t===!1&&n.ended===!0&&n.length===0):null}function w(e){if(!f(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended==`boolean`?t.ended:null}function T(e,t){if(!f(e))return null;let n=e._readableState;return n!=null&&n.errored?!1:typeof n?.endEmitted==`boolean`?!!(n.endEmitted||t===!1&&n.ended===!0&&n.length===0):null}function E(e){return e&&e[s]!=null?e[s]:typeof e?.readable==`boolean`?!x(e)&&f(e)&&e.readable&&!T(e):null}function D(e){return e&&e[c]!=null?e[c]:typeof e?.writable==`boolean`?!x(e)&&p(e)&&e.writable&&!S(e):null}function O(e,t){return h(e)?x(e)?!0:!(t?.readable!==!1&&E(e)||t?.writable!==!1&&D(e)):null}function k(e){return h(e)?e.writableErrored?e.writableErrored:e._writableState?.errored??null:null}function A(e){return h(e)?e.readableErrored?e.readableErrored:e._readableState?.errored??null:null}function j(e){if(!h(e))return null;if(typeof e.closed==`boolean`)return e.closed;let t=e._writableState,n=e._readableState;return typeof t?.closed==`boolean`||typeof n?.closed==`boolean`?t?.closed||n?.closed:typeof e._closed==`boolean`&&M(e)?e._closed:null}function M(e){return typeof e._closed==`boolean`&&typeof e._defaultKeepAlive==`boolean`&&typeof e._removedConnection==`boolean`&&typeof e._removedContLen==`boolean`}function N(e){return typeof e._sent100==`boolean`&&M(e)}function P(e){return typeof e._consuming==`boolean`&&typeof e._dumped==`boolean`&&e.req?.upgradeOrConnect===void 0}function F(e){if(!h(e))return null;let t=e._writableState,n=e._readableState,r=t||n;return!r&&N(e)||!!(r&&r.autoDestroy&&r.emitClose&&r.closed===!1)}function I(e){return!!(e&&(e[l]??(e.readableDidRead||e.readableAborted)))}function L(e){return!!(e&&(e[o]??e.readableErrored??e.writableErrored??e._readableState?.errorEmitted??e._writableState?.errorEmitted??e._readableState?.errored??e._writableState?.errored))}t.exports={isDestroyed:x,kIsDestroyed:a,isDisturbed:I,kIsDisturbed:l,isErrored:L,kIsErrored:o,isReadable:E,kIsReadable:s,kIsClosedPromise:u,kControllerErrorFunction:d,kIsWritable:c,isClosed:j,isDuplexNodeStream:m,isFinished:O,isIterable:b,isReadableNodeStream:f,isReadableStream:g,isReadableEnded:w,isReadableFinished:T,isReadableErrored:A,isNodeStream:h,isWebStream:y,isWritable:D,isWritableNodeStream:p,isWritableStream:_,isWritableEnded:S,isWritableFinished:C,isWritableErrored:k,isServerRequest:P,isServerResponse:N,willEmitClose:F,isTransformStream:v}})),Ae=o(((e,t)=>{var n=ke(),{AbortError:r,codes:i}=we(),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_PREMATURE_CLOSE:o}=i,{kEmptyObject:s,once:c}=De(),{validateAbortSignal:l,validateFunction:u,validateObject:d,validateBoolean:f}=Oe(),{Promise:p,PromisePrototypeThen:m,SymbolDispose:h}=G(),{isClosed:g,isReadable:_,isReadableNodeStream:v,isReadableStream:y,isReadableFinished:b,isReadableErrored:x,isWritable:S,isWritableNodeStream:C,isWritableStream:w,isWritableFinished:T,isWritableErrored:E,isNodeStream:D,willEmitClose:O,kIsClosedPromise:k}=K(),A;function j(e){return e.setHeader&&typeof e.abort==`function`}var M=()=>{};function N(e,t,i){if(arguments.length===2?(i=t,t=s):t==null?t=s:d(t,`options`),u(i,`callback`),l(t.signal,`options.signal`),i=c(i),y(e)||w(e))return P(e,t,i);if(!D(e))throw new a(`stream`,[`ReadableStream`,`WritableStream`,`Stream`],e);let f=t.readable??v(e),p=t.writable??C(e),m=e._writableState,k=e._readableState,N=()=>{e.writable||L()},F=O(e)&&v(e)===f&&C(e)===p,I=T(e,!1),L=()=>{I=!0,e.destroyed&&(F=!1),!(F&&(!e.readable||f))&&(!f||R)&&i.call(e)},R=b(e,!1),z=()=>{R=!0,e.destroyed&&(F=!1),!(F&&(!e.writable||p))&&(!p||I)&&i.call(e)},B=t=>{i.call(e,t)},ee=g(e),V=()=>{ee=!0;let t=E(e)||x(e);if(t&&typeof t!=`boolean`)return i.call(e,t);if(f&&!R&&v(e,!0)&&!b(e,!1)||p&&!I&&!T(e,!1))return i.call(e,new o);i.call(e)},te=()=>{ee=!0;let t=E(e)||x(e);if(t&&typeof t!=`boolean`)return i.call(e,t);i.call(e)},H=()=>{e.req.on(`finish`,L)};j(e)?(e.on(`complete`,L),F||e.on(`abort`,V),e.req?H():e.on(`request`,H)):p&&!m&&(e.on(`end`,N),e.on(`close`,N)),!F&&typeof e.aborted==`boolean`&&e.on(`aborted`,V),e.on(`end`,z),e.on(`finish`,L),t.error!==!1&&e.on(`error`,B),e.on(`close`,V),ee?n.nextTick(V):m!=null&&m.errorEmitted||k!=null&&k.errorEmitted?F||n.nextTick(te):(!f&&(!F||_(e))&&(I||S(e)===!1)||!p&&(!F||S(e))&&(R||_(e)===!1)||k&&e.req&&e.aborted)&&n.nextTick(te);let ne=()=>{i=M,e.removeListener(`aborted`,V),e.removeListener(`complete`,L),e.removeListener(`abort`,V),e.removeListener(`request`,H),e.req&&e.req.removeListener(`finish`,L),e.removeListener(`end`,N),e.removeListener(`close`,N),e.removeListener(`finish`,L),e.removeListener(`end`,z),e.removeListener(`error`,B),e.removeListener(`close`,V)};if(t.signal&&!ee){let a=()=>{let n=i;ne(),n.call(e,new r(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(a);else{A||=De().addAbortListener;let n=A(t.signal,a),r=i;i=c((...t)=>{n[h](),r.apply(e,t)})}}return ne}function P(e,t,i){let a=!1,o=M;if(t.signal)if(o=()=>{a=!0,i.call(e,new r(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(o);else{A||=De().addAbortListener;let n=A(t.signal,o),r=i;i=c((...t)=>{n[h](),r.apply(e,t)})}let s=(...t)=>{a||n.nextTick(()=>i.apply(e,t))};return m(e[k].promise,s,s),M}function F(e,t){var n;let r=!1;return t===null&&(t=s),(n=t)!=null&&n.cleanup&&(f(t.cleanup,`cleanup`),r=t.cleanup),new p((n,i)=>{let a=N(e,t,e=>{r&&a(),e?i(e):n()})})}t.exports=N,t.exports.finished=F})),q=o(((e,t)=>{var n=ke(),{aggregateTwoErrors:r,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:a}=we(),{Symbol:o}=G(),{kIsDestroyed:s,isDestroyed:c,isFinished:l,isServerRequest:u}=K(),d=o(`kDestroy`),f=o(`kConstruct`);function p(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function m(e,t){let n=this._readableState,i=this._writableState,a=i||n;return i!=null&&i.destroyed||n!=null&&n.destroyed?(typeof t==`function`&&t(),this):(p(e,i,n),i&&(i.destroyed=!0),n&&(n.destroyed=!0),a.constructed?h(this,e,t):this.once(d,function(n){h(this,r(n,e),t)}),this)}function h(e,t,r){let i=!1;function a(t){if(i)return;i=!0;let a=e._readableState,o=e._writableState;p(t,o,a),o&&(o.closed=!0),a&&(a.closed=!0),typeof r==`function`&&r(t),t?n.nextTick(g,e,t):n.nextTick(_,e)}try{e._destroy(t||null,a)}catch(e){a(e)}}function g(e,t){v(e,t),_(e)}function _(e){let t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(n!=null&&n.emitClose||t!=null&&t.emitClose)&&e.emit(`close`)}function v(e,t){let n=e._readableState,r=e._writableState;r!=null&&r.errorEmitted||n!=null&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit(`error`,t))}function y(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}function b(e,t,r){let i=e._readableState,a=e._writableState;if(a!=null&&a.destroyed||i!=null&&i.destroyed)return this;i!=null&&i.autoDestroy||a!=null&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(v,e,t):v(e,t))}function x(e,t){if(typeof e._construct!=`function`)return;let r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(f,t),!(e.listenerCount(f)>1)&&n.nextTick(S,e)}function S(e){let t=!1;function r(r){if(t){b(e,r??new i);return}t=!0;let a=e._readableState,o=e._writableState,s=o||a;a&&(a.constructed=!0),o&&(o.constructed=!0),s.destroyed?e.emit(d,r):r?b(e,r,!0):n.nextTick(C,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function C(e){e.emit(f)}function w(e){return e?.setHeader&&typeof e.abort==`function`}function T(e){e.emit(`close`)}function E(e,t){e.emit(`error`,t),n.nextTick(T,e)}function D(e,t){!e||c(e)||(!t&&!l(e)&&(t=new a),u(e)?(e.socket=null,e.destroy(t)):w(e)?e.abort():w(e.req)?e.req.abort():typeof e.destroy==`function`?e.destroy(t):typeof e.close==`function`?e.close():t?n.nextTick(E,e,t):n.nextTick(T,e),e.destroyed||(e[s]=!0))}t.exports={construct:x,destroyer:D,destroy:m,undestroy:y,errorOrDestroy:b}})),J=o(((e,t)=>{var{ArrayIsArray:n,ObjectSetPrototypeOf:r}=G(),{EventEmitter:i}=Ee();function a(e){i.call(this,e)}r(a.prototype,i.prototype),r(a,i),a.prototype.pipe=function(e,t){let n=this;function r(t){e.writable&&e.write(t)===!1&&n.pause&&n.pause()}n.on(`data`,r);function a(){n.readable&&n.resume&&n.resume()}e.on(`drain`,a),!e._isStdio&&(!t||t.end!==!1)&&(n.on(`end`,c),n.on(`close`,l));let s=!1;function c(){s||(s=!0,e.end())}function l(){s||(s=!0,typeof e.destroy==`function`&&e.destroy())}function u(e){d(),i.listenerCount(this,`error`)===0&&this.emit(`error`,e)}o(n,`error`,u),o(e,`error`,u);function d(){n.removeListener(`data`,r),e.removeListener(`drain`,a),n.removeListener(`end`,c),n.removeListener(`close`,l),n.removeListener(`error`,u),e.removeListener(`error`,u),n.removeListener(`end`,d),n.removeListener(`close`,d),e.removeListener(`close`,d)}return n.on(`end`,d),n.on(`close`,d),e.on(`close`,d),e.emit(`pipe`,n),e};function o(e,t,r){if(typeof e.prependListener==`function`)return e.prependListener(t,r);!e._events||!e._events[t]?e.on(t,r):n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]}t.exports={Stream:a,prependListener:o}})),je=o(((e,t)=>{var{SymbolDispose:n}=G(),{AbortError:r,codes:i}=we(),{isNodeStream:a,isWebStream:o,kControllerErrorFunction:s}=K(),c=Ae(),{ERR_INVALID_ARG_TYPE:l}=i,u,d=(e,t)=>{if(typeof e!=`object`||!(`aborted`in e))throw new l(t,`AbortSignal`,e)};t.exports.addAbortSignal=function(e,n){if(d(e,`signal`),!a(n)&&!o(n))throw new l(`stream`,[`ReadableStream`,`WritableStream`,`Stream`],n);return t.exports.addAbortSignalNoValidate(e,n)},t.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!=`object`||!(`aborted`in e))return t;let i=a(t)?()=>{t.destroy(new r(void 0,{cause:e.reason}))}:()=>{t[s](new r(void 0,{cause:e.reason}))};return e.aborted?i():(u||=De().addAbortListener,c(t,u(e,i)[n])),t}})),Me=o(((e,t)=>{var{StringPrototypeSlice:n,SymbolIterator:r,TypedArrayPrototypeSet:i,Uint8Array:a}=G(),{Buffer:o}=f(),{inspect:s}=De();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};this.length===0&&(this.tail=t),this.head=t,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return``;let t=this.head,n=``+t.data;for(;(t=t.next)!==null;)n+=e+t.data;return n}concat(e){if(this.length===0)return o.alloc(0);let t=o.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)i(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){let n=this.head.data;if(e<n.length){let t=n.slice(0,e);return this.head.data=n.slice(e),t}return e===n.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[r](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t=``,r=this.head,i=0;do{let a=r.data;if(e>a.length)t+=a,e-=a.length;else{e===a.length?(t+=a,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(a,0,e),this.head=r,r.data=n(a,e));break}++i}while((r=r.next)!==null);return this.length-=i,t}_getBuffer(e){let t=o.allocUnsafe(e),n=e,r=this.head,s=0;do{let o=r.data;if(e>o.length)i(t,o,n-e),e-=o.length;else{e===o.length?(i(t,o,n-e),++s,r.next?this.head=r.next:this.head=this.tail=null):(i(t,new a(o.buffer,o.byteOffset,e),n-e),this.head=r,r.data=o.slice(e));break}++s}while((r=r.next)!==null);return this.length-=s,t}[Symbol.for(`nodejs.util.inspect.custom`)](e,t){return s(this,{...t,depth:0,customInspect:!1})}}})),Ne=o(((e,t)=>{var{MathFloor:n,NumberIsInteger:r}=G(),{validateInteger:i}=Oe(),{ERR_INVALID_ARG_VALUE:a}=we().codes,o=16*1024,s=16;function c(e,t,n){return e.highWaterMark==null?t?e[n]:null:e.highWaterMark}function l(e){return e?s:o}function u(e,t){i(t,`value`,0),e?s=t:o=t}function d(e,t,i,o){let s=c(t,o,i);if(s!=null){if(!r(s)||s<0)throw new a(o?`options.${i}`:`options.highWaterMark`,s);return n(s)}return l(e.objectMode)}t.exports={getHighWaterMark:d,getDefaultHighWaterMark:l,setDefaultHighWaterMark:u}})),Pe=o(((e,t)=>{var n=f(),r=n.Buffer;function i(e,t){for(var n in e)t[n]=e[n]}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=a);function a(e,t,n){return r(e,t,n)}a.prototype=Object.create(r.prototype),i(r,a),a.from=function(e,t,n){if(typeof e==`number`)throw TypeError(`Argument must not be a number`);return r(e,t,n)},a.alloc=function(e,t,n){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);var i=r(e);return t===void 0?i.fill(0):typeof n==`string`?i.fill(t,n):i.fill(t),i},a.allocUnsafe=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return r(e)},a.allocUnsafeSlow=function(e){if(typeof e!=`number`)throw TypeError(`Argument must be a number`);return n.SlowBuffer(e)}})),Fe=o((e=>{var t=Pe().Buffer,n=t.isEncoding||function(e){switch(e=``+e,e&&e.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 r(e){if(!e)return`utf8`;for(var t;;)switch(e){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 e;default:if(t)return;e=(``+e).toLowerCase(),t=!0}}function i(e){var i=r(e);if(typeof i!=`string`&&(t.isEncoding===n||!n(e)))throw Error(`Unknown encoding: `+e);return i||e}e.StringDecoder=a;function a(e){this.encoding=i(e);var n;switch(this.encoding){case`utf16le`:this.text=f,this.end=p,n=4;break;case`utf8`:this.fillLast=l,n=4;break;case`base64`:this.text=m,this.end=h,n=3;break;default:this.write=g,this.end=_;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}a.prototype.write=function(e){if(e.length===0)return``;var t,n;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return``;n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||``},a.prototype.end=d,a.prototype.text=u,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e,t,n){var r=t.length-1;if(r<n)return 0;var i=o(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||i===-2?0:(i=o(t[r]),i>=0?(i>0&&(i===2?i=0:e.lastNeed=i-3),i):0))}function c(e,t,n){if((t[0]&192)!=128)return e.lastNeed=0,`�`;if(e.lastNeed>1&&t.length>1){if((t[1]&192)!=128)return e.lastNeed=1,`�`;if(e.lastNeed>2&&t.length>2&&(t[2]&192)!=128)return e.lastNeed=2,`�`}}function l(e){var t=this.lastTotal-this.lastNeed,n=c(this,e,t);if(n!==void 0)return n;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}function u(e,t){var n=s(this,e,t);if(!this.lastNeed)return e.toString(`utf8`,t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString(`utf8`,t,r)}function d(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+`�`:t}function f(e,t){if((e.length-t)%2==0){var n=e.toString(`utf16le`,t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString(`utf16le`,t,e.length-1)}function p(e){var t=e&&e.length?this.write(e):``;if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString(`utf16le`,0,n)}return t}function m(e,t){var n=(e.length-t)%3;return n===0?e.toString(`base64`,t):(this.lastNeed=3-n,this.lastTotal=3,n===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString(`base64`,t,e.length-n))}function h(e){var t=e&&e.length?this.write(e):``;return this.lastNeed?t+this.lastChar.toString(`base64`,0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function _(e){return e&&e.length?this.write(e):``}})),Ie=o(((e,t)=>{var n=ke(),{PromisePrototypeThen:r,SymbolAsyncIterator:i,SymbolIterator:a}=G(),{Buffer:o}=f(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:c}=we().codes;function l(e,t,l){let u;if(typeof t==`string`||t instanceof o)return new e({objectMode:!0,...l,read(){this.push(t),this.push(null)}});let d;if(t&&t[i])d=!0,u=t[i]();else if(t&&t[a])d=!1,u=t[a]();else throw new s(`iterable`,[`Iterable`],t);let f=new e({objectMode:!0,highWaterMark:1,...l}),p=!1;f._read=function(){p||(p=!0,h())},f._destroy=function(e,t){r(m(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))};async function m(e){let t=e!=null,n=typeof u.throw==`function`;if(t&&n){let{value:t,done:n}=await u.throw(e);if(await t,n)return}if(typeof u.return==`function`){let{value:e}=await u.return();await e}}async function h(){for(;;){try{let{value:e,done:t}=d?await u.next():u.next();if(t)f.push(null);else{let t=e&&typeof e.then==`function`?await e:e;if(t===null)throw p=!1,new c;if(f.push(t))continue;p=!1}}catch(e){f.destroy(e)}break}}return f}t.exports=l})),Le=o(((e,t)=>{var n=ke(),{ArrayPrototypeIndexOf:r,NumberIsInteger:i,NumberIsNaN:a,NumberParseInt:o,ObjectDefineProperties:s,ObjectKeys:c,ObjectSetPrototypeOf:l,Promise:u,SafeSet:d,SymbolAsyncDispose:p,SymbolAsyncIterator:m,Symbol:h}=G();t.exports=W,W.ReadableState=ge;var{EventEmitter:g}=Ee(),{Stream:_,prependListener:v}=J(),{Buffer:y}=f(),{addAbortSignal:b}=je(),x=Ae(),S=De().debuglog(`stream`,e=>{S=e}),C=Me(),w=q(),{getHighWaterMark:T,getDefaultHighWaterMark:E}=Ne(),{aggregateTwoErrors:D,codes:{ERR_INVALID_ARG_TYPE:O,ERR_METHOD_NOT_IMPLEMENTED:k,ERR_OUT_OF_RANGE:A,ERR_STREAM_PUSH_AFTER_EOF:j,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:M},AbortError:N}=we(),{validateObject:P}=Oe(),F=h(`kPaused`),{StringDecoder:I}=Fe(),L=Ie();l(W.prototype,_.prototype),l(W,_);var R=()=>{},{errorOrDestroy:z}=w,B=1,ee=2,V=4,te=8,H=16,ne=32,re=64,ie=128,ae=256,oe=512,se=1024,ce=2048,le=4096,ue=8192,de=16384,fe=32768,pe=65536,me=1<<17,he=1<<18;function U(e){return{enumerable:!1,get(){return(this.state&e)!==0},set(t){t?this.state|=e:this.state&=~e}}}s(ge.prototype,{objectMode:U(B),ended:U(ee),endEmitted:U(V),reading:U(te),constructed:U(H),sync:U(ne),needReadable:U(re),emittedReadable:U(ie),readableListening:U(ae),resumeScheduled:U(oe),errorEmitted:U(se),emitClose:U(ce),autoDestroy:U(le),destroyed:U(ue),closed:U(de),closeEmitted:U(fe),multiAwaitDrain:U(pe),readingMore:U(me),dataEmitted:U(he)});function ge(e,t,n){typeof n!=`boolean`&&(n=t instanceof Be()),this.state=6192,e&&e.objectMode&&(this.state|=B),n&&e&&e.readableObjectMode&&(this.state|=B),this.highWaterMark=e?T(this,e,`readableHighWaterMark`,n):E(!1),this.buffer=new C,this.length=0,this.pipes=[],this.flowing=null,this[F]=null,e&&e.emitClose===!1&&(this.state&=-2049),e&&e.autoDestroy===!1&&(this.state&=-4097),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||`utf8`,this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new I(e.encoding),this.encoding=e.encoding)}function W(e){if(!(this instanceof W))return new W(e);let t=this instanceof Be();this._readableState=new ge(e,this,t),e&&(typeof e.read==`function`&&(this._read=e.read),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.construct==`function`&&(this._construct=e.construct),e.signal&&!t&&b(e.signal,this)),_.call(this,e),w.construct(this,()=>{this._readableState.needReadable&&K(this,this._readableState)})}W.prototype.destroy=w.destroy,W.prototype._undestroy=w.undestroy,W.prototype._destroy=function(e,t){t(e)},W.prototype[g.captureRejectionSymbol]=function(e){this.destroy(e)},W.prototype[p]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new N,this.destroy(e)),new u((t,n)=>x(this,r=>r&&r!==e?n(r):t(null)))},W.prototype.push=function(e,t){return _e(this,e,t,!1)},W.prototype.unshift=function(e,t){return _e(this,e,t,!0)};function _e(e,t,n,r){S(`readableAddChunk`,t);let i=e._readableState,a;if((i.state&B)===0&&(typeof t==`string`?(n||=i.defaultEncoding,i.encoding!==n&&(r&&i.encoding?t=y.from(t,n).toString(i.encoding):(t=y.from(t,n),n=``))):t instanceof y?n=``:_._isUint8Array(t)?(t=_._uint8ArrayToBuffer(t),n=``):t!=null&&(a=new O(`chunk`,[`string`,`Buffer`,`Uint8Array`],t))),a)z(e,a);else if(t===null)i.state&=-9,Se(e,i);else if((i.state&B)!==0||t&&t.length>0)if(r)if((i.state&V)!==0)z(e,new M);else if(i.destroyed||i.errored)return!1;else ve(e,i,t,!0);else if(i.ended)z(e,new j);else if(i.destroyed||i.errored)return!1;else i.state&=-9,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||t.length!==0?ve(e,i,t,!1):K(e,i)):ve(e,i,t,!1);else r||(i.state&=-9,K(e,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function ve(e,t,n,r){t.flowing&&t.length===0&&!t.sync&&e.listenerCount(`data`)>0?((t.state&pe)===0?t.awaitDrainWriters=null:t.awaitDrainWriters.clear(),t.dataEmitted=!0,e.emit(`data`,n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),(t.state&re)!==0&&Ce(e)),K(e,t)}W.prototype.isPaused=function(){let e=this._readableState;return e[F]===!0||e.flowing===!1},W.prototype.setEncoding=function(e){let t=new I(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let n=this._readableState.buffer,r=``;for(let e of n)r+=t.write(e);return n.clear(),r!==``&&n.push(r),this._readableState.length=r.length,this};var ye=1073741824;function be(e){if(e>ye)throw new A(`size`,`<= 1GiB`,e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}function xe(e,t){return e<=0||t.length===0&&t.ended?0:(t.state&B)===0?a(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0:1}W.prototype.read=function(e){S(`read`,e),e===void 0?e=NaN:i(e)||(e=o(e,10));let t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=be(e)),e!==0&&(t.state&=-129),e===0&&t.needReadable&&((t.highWaterMark===0?t.length>0:t.length>=t.highWaterMark)||t.ended))return S(`read: emitReadable`,t.length,t.ended),t.length===0&&t.ended?qe(this):Ce(this),null;if(e=xe(e,t),e===0&&t.ended)return t.length===0&&qe(this),null;let r=(t.state&re)!==0;if(S(`need readable`,r),(t.length===0||t.length-e<t.highWaterMark)&&(r=!0,S(`length less than watermark`,r)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)r=!1,S(`reading, ended or constructing`,r);else if(r){S(`do read`),t.state|=40,t.length===0&&(t.state|=re);try{this._read(t.highWaterMark)}catch(e){z(this,e)}t.state&=-33,t.reading||(e=xe(n,t))}let a;return a=e>0?Ke(e,t):null,a===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&qe(this)),a!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit(`data`,a)),a};function Se(e,t){if(S(`onEofChunk`),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Ce(e):(t.needReadable=!1,t.emittedReadable=!0,Te(e))}}function Ce(e){let t=e._readableState;S(`emitReadable`,t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S(`emitReadable`,t.flowing),t.emittedReadable=!0,n.nextTick(Te,e))}function Te(e){let t=e._readableState;S(`emitReadable_`,t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit(`readable`),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Ue(e)}function K(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(Pe,e,t))}function Pe(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let n=t.length;if(S(`maybeReadMore read 0`),e.read(0),n===t.length)break}t.readingMore=!1}W.prototype._read=function(e){throw new k(`_read()`)},W.prototype.pipe=function(e,t){let r=this,i=this._readableState;i.pipes.length===1&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new d(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),S(`pipe count=%d opts=%j`,i.pipes.length,t);let a=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr?s:_;i.endEmitted?n.nextTick(a):r.once(`end`,a),e.on(`unpipe`,o);function o(e,t){S(`onunpipe`),e===r&&t&&t.hasUnpiped===!1&&(t.hasUnpiped=!0,u())}function s(){S(`onend`),e.end()}let c,l=!1;function u(){S(`cleanup`),e.removeListener(`close`,h),e.removeListener(`finish`,g),c&&e.removeListener(`drain`,c),e.removeListener(`error`,m),e.removeListener(`unpipe`,o),r.removeListener(`end`,s),r.removeListener(`end`,_),r.removeListener(`data`,p),l=!0,c&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&c()}function f(){l||(i.pipes.length===1&&i.pipes[0]===e?(S(`false write response, pause`,0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(S(`false write response, pause`,i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),c||(c=Le(r,e),e.on(`drain`,c))}r.on(`data`,p);function p(t){S(`ondata`);let n=e.write(t);S(`dest.write`,n),n===!1&&f()}function m(t){if(S(`onerror`,t),_(),e.removeListener(`error`,m),e.listenerCount(`error`)===0){let n=e._writableState||e._readableState;n&&!n.errorEmitted?z(e,t):e.emit(`error`,t)}}v(e,`error`,m);function h(){e.removeListener(`finish`,g),_()}e.once(`close`,h);function g(){S(`onfinish`),e.removeListener(`close`,h),_()}e.once(`finish`,g);function _(){S(`unpipe`),r.unpipe(e)}return e.emit(`pipe`,r),e.writableNeedDrain===!0?f():i.flowing||(S(`pipe resume`),r.resume()),e};function Le(e,t){return function(){let n=e._readableState;n.awaitDrainWriters===t?(S(`pipeOnDrain`,1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(S(`pipeOnDrain`,n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount(`data`)&&e.resume()}}W.prototype.unpipe=function(e){let t=this._readableState,n={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit(`unpipe`,this,{hasUnpiped:!1});return this}let i=r(t.pipes,e);return i===-1?this:(t.pipes.splice(i,1),t.pipes.length===0&&this.pause(),e.emit(`unpipe`,this,n),this)},W.prototype.on=function(e,t){let r=_.prototype.on.call(this,e,t),i=this._readableState;return e===`data`?(i.readableListening=this.listenerCount(`readable`)>0,i.flowing!==!1&&this.resume()):e===`readable`&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,S(`on readable`,i.length,i.reading),i.length?Ce(this):i.reading||n.nextTick(ze,this)),r},W.prototype.addListener=W.prototype.on,W.prototype.removeListener=function(e,t){let r=_.prototype.removeListener.call(this,e,t);return e===`readable`&&n.nextTick(Re,this),r},W.prototype.off=W.prototype.removeListener,W.prototype.removeAllListeners=function(e){let t=_.prototype.removeAllListeners.apply(this,arguments);return(e===`readable`||e===void 0)&&n.nextTick(Re,this),t};function Re(e){let t=e._readableState;t.readableListening=e.listenerCount(`readable`)>0,t.resumeScheduled&&t[F]===!1?t.flowing=!0:e.listenerCount(`data`)>0?e.resume():t.readableListening||(t.flowing=null)}function ze(e){S(`readable nexttick read 0`),e.read(0)}W.prototype.resume=function(){let e=this._readableState;return e.flowing||(S(`resume`),e.flowing=!e.readableListening,Ve(this,e)),e[F]=!1,this};function Ve(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(He,e,t))}function He(e,t){S(`resume`,t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit(`resume`),Ue(e),t.flowing&&!t.reading&&e.read(0)}W.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[F]=!0,this};function Ue(e){let t=e._readableState;for(S(`flow`,t.flowing);t.flowing&&e.read()!==null;);}W.prototype.wrap=function(e){let t=!1;e.on(`data`,n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on(`end`,()=>{this.push(null)}),e.on(`error`,e=>{z(this,e)}),e.on(`close`,()=>{this.destroy()}),e.on(`destroy`,()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let n=c(e);for(let t=1;t<n.length;t++){let r=n[t];this[r]===void 0&&typeof e[r]==`function`&&(this[r]=e[r].bind(e))}return this},W.prototype[m]=function(){return We(this)},W.prototype.iterator=function(e){return e!==void 0&&P(e,`options`),We(this,e)};function We(e,t){typeof e.read!=`function`&&(e=W.wrap(e,{objectMode:!0}));let n=Ge(e,t);return n.stream=e,n}async function*Ge(e,t){let n=R;function r(t){this===e?(n(),n=R):n=t}e.on(`readable`,r);let i,a=x(e,{writable:!1},e=>{i=e?D(i,e):null,n(),n=R});try{for(;;){let t=e.destroyed?null:e.read();if(t!==null)yield t;else if(i)throw i;else if(i===null)return;else await new u(r)}}catch(e){throw i=D(i,e),i}finally{(i||t?.destroyOnReturn!==!1)&&(i===void 0||e._readableState.autoDestroy)?w.destroyer(e,null):(e.off(`readable`,r),a())}}s(W.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},set(e){this._readableState&&(this._readableState.readable=!!e)}},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(e){this._readableState&&(this._readableState.flowing=e)}},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(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(ge.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[F]!==!1},set(e){this[F]=!!e}}}),W._fromList=Ke;function Ke(e,t){if(t.length===0)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(``):t.buffer.length===1?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function qe(e){let t=e._readableState;S(`endReadable`,t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(Je,t,e))}function Je(e,t){if(S(`endReadableNT`,e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit(`end`),t.writable&&t.allowHalfOpen===!1)n.nextTick(Ye,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||e.writable===!1))&&t.destroy()}}}function Ye(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}W.from=function(e,t){return L(W,e,t)};var Xe;function Ze(){return Xe===void 0&&(Xe={}),Xe}W.fromWeb=function(e,t){return Ze().newStreamReadableFromReadableStream(e,t)},W.toWeb=function(e,t){return Ze().newReadableStreamFromStreamReadable(e,t)},W.wrap=function(e,t){return new W({objectMode:e.readableObjectMode??e.objectMode??!0,...t,destroy(t,n){w.destroyer(e,t),n(t)}}).wrap(e)}})),Re=o(((e,t)=>{var n=ke(),{ArrayPrototypeSlice:r,Error:i,FunctionPrototypeSymbolHasInstance:a,ObjectDefineProperty:o,ObjectDefineProperties:s,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:l,Symbol:u,SymbolHasInstance:d}=G();t.exports=P,P.WritableState=M;var{EventEmitter:p}=Ee(),m=J().Stream,{Buffer:h}=f(),g=q(),{addAbortSignal:_}=je(),{getHighWaterMark:v,getDefaultHighWaterMark:y}=Ne(),{ERR_INVALID_ARG_TYPE:b,ERR_METHOD_NOT_IMPLEMENTED:x,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:w,ERR_STREAM_ALREADY_FINISHED:T,ERR_STREAM_NULL_VALUES:E,ERR_STREAM_WRITE_AFTER_END:D,ERR_UNKNOWN_ENCODING:O}=we().codes,{errorOrDestroy:k}=g;c(P.prototype,m.prototype),c(P,m);function A(){}var j=u(`kOnFinished`);function M(e,t,n){typeof n!=`boolean`&&(n=t instanceof Be()),this.objectMode=!!(e&&e.objectMode),n&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?v(this,e,`writableHighWaterMark`,n):y(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let r=!!(e&&e.decodeStrings===!1);this.decodeStrings=!r,this.defaultEncoding=e&&e.defaultEncoding||`utf8`,this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=z.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,N(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[j]=[]}function N(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}M.prototype.getBuffer=function(){return r(this.buffered,this.bufferedIndex)},o(M.prototype,`bufferedRequestCount`,{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function P(e){let t=this instanceof Be();if(!t&&!a(P,this))return new P(e);this._writableState=new M(e,this,t),e&&(typeof e.write==`function`&&(this._write=e.write),typeof e.writev==`function`&&(this._writev=e.writev),typeof e.destroy==`function`&&(this._destroy=e.destroy),typeof e.final==`function`&&(this._final=e.final),typeof e.construct==`function`&&(this._construct=e.construct),e.signal&&_(e.signal,this)),m.call(this,e),g.construct(this,()=>{let e=this._writableState;e.writing||te(this,e),ie(this,e)})}o(P,d,{__proto__:null,value:function(e){return a(this,e)?!0:this===P&&e&&e._writableState instanceof M}}),P.prototype.pipe=function(){k(this,new C)};function F(e,t,r,i){let a=e._writableState;if(typeof r==`function`)i=r,r=a.defaultEncoding;else{if(!r)r=a.defaultEncoding;else if(r!==`buffer`&&!h.isEncoding(r))throw new O(r);typeof i!=`function`&&(i=A)}if(t===null)throw new E;if(!a.objectMode)if(typeof t==`string`)a.decodeStrings!==!1&&(t=h.from(t,r),r=`buffer`);else if(t instanceof h)r=`buffer`;else if(m._isUint8Array(t))t=m._uint8ArrayToBuffer(t),r=`buffer`;else throw new b(`chunk`,[`string`,`Buffer`,`Uint8Array`],t);let o;return a.ending?o=new D:a.destroyed&&(o=new w(`write`)),o?(n.nextTick(i,o),k(e,o,!0),o):(a.pendingcb++,I(e,a,t,r,i))}P.prototype.write=function(e,t,n){return F(this,e,t,n)===!0},P.prototype.cork=function(){this._writableState.corked++},P.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||te(this,e))},P.prototype.setDefaultEncoding=function(e){if(typeof e==`string`&&(e=l(e)),!h.isEncoding(e))throw new O(e);return this._writableState.defaultEncoding=e,this};function I(e,t,n,r,i){let a=t.objectMode?1:n.length;t.length+=a;let o=t.length<t.highWaterMark;return o||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:n,encoding:r,callback:i}),t.allBuffers&&r!==`buffer`&&(t.allBuffers=!1),t.allNoop&&i!==A&&(t.allNoop=!1)):(t.writelen=a,t.writecb=i,t.writing=!0,t.sync=!0,e._write(n,r,t.onwrite),t.sync=!1),o&&!t.errored&&!t.destroyed}function L(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new w(`write`)):n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function R(e,t,n,r){--t.pendingcb,r(n),V(t),k(e,n)}function z(e,t){let r=e._writableState,i=r.sync,a=r.writecb;if(typeof a!=`function`){k(e,new S);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||=t,e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?n.nextTick(R,e,r,t,a):R(e,r,t,a)):(r.buffered.length>r.bufferedIndex&&te(e,r),i?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},n.nextTick(B,r.afterWriteTickInfo)):ee(e,r,1,a))}function B({stream:e,state:t,count:n,cb:r}){return t.afterWriteTickInfo=null,ee(e,t,n,r)}function ee(e,t,n,r){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit(`drain`));n-->0;)t.pendingcb--,r();t.destroyed&&V(t),ie(e,t)}function V(e){if(e.writing)return;for(let t=e.bufferedIndex;t<e.buffered.length;++t){let{chunk:n,callback:r}=e.buffered[t],i=e.objectMode?1:n.length;e.length-=i,r(e.errored??new w(`write`))}let t=e[j].splice(0);for(let n=0;n<t.length;n++)t[n](e.errored??new w(`end`));N(e)}function te(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:n,bufferedIndex:i,objectMode:a}=t,o=n.length-i;if(!o)return;let s=i;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let i=t.allNoop?A:e=>{for(let t=s;t<n.length;++t)n[t].callback(e)},a=t.allNoop&&s===0?n:r(n,s);a.allBuffers=t.allBuffers,L(e,t,!0,t.length,a,``,i),N(t)}else{do{let{chunk:r,encoding:i,callback:o}=n[s];n[s++]=null,L(e,t,!1,a?1:r.length,r,i,o)}while(s<n.length&&!t.writing);s===n.length?N(t):s>256?(n.splice(0,s),t.bufferedIndex=0):t.bufferedIndex=s}t.bufferProcessing=!1}P.prototype._write=function(e,t,n){if(this._writev)this._writev([{chunk:e,encoding:t}],n);else throw new x(`_write()`)},P.prototype._writev=null,P.prototype.end=function(e,t,r){let a=this._writableState;typeof e==`function`?(r=e,e=null,t=null):typeof t==`function`&&(r=t,t=null);let o;if(e!=null){let n=F(this,e,t);n instanceof i&&(o=n)}return a.corked&&(a.corked=1,this.uncork()),o||(!a.errored&&!a.ending?(a.ending=!0,ie(this,a,!0),a.ended=!0):a.finished?o=new T(`end`):a.destroyed&&(o=new w(`end`))),typeof r==`function`&&(o||a.finished?n.nextTick(r,o):a[j].push(r)),this};function H(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function ne(e,t){let r=!1;function i(i){if(r){k(e,i??S());return}if(r=!0,t.pendingcb--,i){let n=t[j].splice(0);for(let e=0;e<n.length;e++)n[e](i);k(e,i,t.sync)}else H(t)&&(t.prefinished=!0,e.emit(`prefinish`),t.pendingcb++,n.nextTick(ae,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}function re(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final==`function`&&!t.destroyed?(t.finalCalled=!0,ne(e,t)):(t.prefinished=!0,e.emit(`prefinish`)))}function ie(e,t,r){H(t)&&(re(e,t),t.pendingcb===0&&(r?(t.pendingcb++,n.nextTick((e,t)=>{H(t)?ae(e,t):t.pendingcb--},e,t)):H(t)&&(t.pendingcb++,ae(e,t))))}function ae(e,t){t.pendingcb--,t.finished=!0;let n=t[j].splice(0);for(let e=0;e<n.length;e++)n[e]();if(e.emit(`finish`),t.autoDestroy){let t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||t.readable===!1))&&e.destroy()}}s(P.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var oe=g.destroy;P.prototype.destroy=function(e,t){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[j].length)&&n.nextTick(V,r),oe.call(this,e,t),this},P.prototype._undestroy=g.undestroy,P.prototype._destroy=function(e,t){t(e)},P.prototype[p.captureRejectionSymbol]=function(e){this.destroy(e)};var se;function ce(){return se===void 0&&(se={}),se}P.fromWeb=function(e,t){return ce().newStreamWritableFromWritableStream(e,t)},P.toWeb=function(e){return ce().newWritableStreamFromStreamWritable(e)}})),ze=o(((e,t)=>{var n=ke(),r=f(),{isReadable:i,isWritable:a,isIterable:o,isNodeStream:s,isReadableNodeStream:c,isWritableNodeStream:l,isDuplexNodeStream:u,isReadableStream:d,isWritableStream:p}=K(),m=Ae(),{AbortError:h,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:_}}=we(),{destroyer:v}=q(),y=Be(),b=Le(),x=Re(),{createDeferredPromise:S}=De(),C=Ie(),w=globalThis.Blob||r.Blob,T=w===void 0?function(e){return!1}:function(e){return e instanceof w},E=globalThis.AbortController||Te().AbortController,{FunctionPrototypeCall:D}=G(),O=class extends y{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};t.exports=function e(t,r){if(u(t))return t;if(c(t))return A({readable:t});if(l(t))return A({writable:t});if(s(t))return A({writable:!1,readable:!1});if(d(t))return A({readable:b.fromWeb(t)});if(p(t))return A({writable:x.fromWeb(t)});if(typeof t==`function`){let{value:e,write:i,final:a,destroy:s}=k(t);if(o(e))return C(O,e,{objectMode:!0,write:i,final:a,destroy:s});let c=e?.then;if(typeof c==`function`){let t,r=D(c,e,e=>{if(e!=null)throw new _(`nully`,`body`,e)},e=>{v(t,e)});return t=new O({objectMode:!0,readable:!1,write:i,final(e){a(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new _(`Iterable, AsyncIterable or AsyncFunction`,r,e)}if(T(t))return e(t.arrayBuffer());if(o(t))return C(O,t,{objectMode:!0,writable:!1});if(d(t?.readable)&&p(t?.writable))return O.fromWeb(t);if(typeof t?.writable==`object`||typeof t?.readable==`object`)return A({readable:t!=null&&t.readable?c(t?.readable)?t?.readable:e(t.readable):void 0,writable:t!=null&&t.writable?l(t?.writable)?t?.writable:e(t.writable):void 0});let i=t?.then;if(typeof i==`function`){let e;return D(i,t,t=>{t!=null&&e.push(t),e.push(null)},t=>{v(e,t)}),e=new O({objectMode:!0,writable:!1,read(){}})}throw new g(r,[`Blob`,`ReadableStream`,`WritableStream`,`Stream`,`Iterable`,`AsyncIterable`,`Function`,`{ readable, writable } pair`,`Promise`],t)};function k(e){let{promise:t,resolve:r}=S(),i=new E,a=i.signal;return{value:e((async function*(){for(;;){let e=t;t=null;let{chunk:i,done:o,cb:s}=await e;if(n.nextTick(s),o)return;if(a.aborted)throw new h(void 0,{cause:a.reason});({promise:t,resolve:r}=S()),yield i}})(),{signal:a}),write(e,t,n){let i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){let t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}function A(e){let t=e.readable&&typeof e.readable.read!=`function`?b.wrap(e.readable):e.readable,n=e.writable,r=!!i(t),o=!!a(n),s,c,l,u,d;function f(e){let t=u;u=null,t?t(e):e&&d.destroy(e)}return d=new O({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(n!=null&&n.writableObjectMode),readable:r,writable:o}),o&&(m(n,e=>{o=!1,e&&v(t,e),f(e)}),d._write=function(e,t,r){n.write(e,t)?r():s=r},d._final=function(e){n.end(),c=e},n.on(`drain`,function(){if(s){let e=s;s=null,e()}}),n.on(`finish`,function(){if(c){let e=c;c=null,e()}})),r&&(m(t,e=>{r=!1,e&&v(t,e),f(e)}),t.on(`readable`,function(){if(l){let e=l;l=null,e()}}),t.on(`end`,function(){d.push(null)}),d._read=function(){for(;;){let e=t.read();if(e===null){l=d._read;return}if(!d.push(e))return}}),d._destroy=function(e,r){!e&&u!==null&&(e=new h),l=null,s=null,c=null,u===null?r(e):(u=r,v(n,e),v(t,e))},d}})),Be=o(((e,t)=>{var{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:r,ObjectKeys:i,ObjectSetPrototypeOf:a}=G();t.exports=c;var o=Le(),s=Re();a(c.prototype,o.prototype),a(c,o);{let e=i(s.prototype);for(let t=0;t<e.length;t++){let n=e[t];c.prototype[n]||(c.prototype[n]=s.prototype[n])}}function c(e){if(!(this instanceof c))return new c(e);o.call(this,e),s.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,e.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}n(c.prototype,{writable:{__proto__:null,...r(s.prototype,`writable`)},writableHighWaterMark:{__proto__:null,...r(s.prototype,`writableHighWaterMark`)},writableObjectMode:{__proto__:null,...r(s.prototype,`writableObjectMode`)},writableBuffer:{__proto__:null,...r(s.prototype,`writableBuffer`)},writableLength:{__proto__:null,...r(s.prototype,`writableLength`)},writableFinished:{__proto__:null,...r(s.prototype,`writableFinished`)},writableCorked:{__proto__:null,...r(s.prototype,`writableCorked`)},writableEnded:{__proto__:null,...r(s.prototype,`writableEnded`)},writableNeedDrain:{__proto__:null,...r(s.prototype,`writableNeedDrain`)},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}});var l;function u(){return l===void 0&&(l={}),l}c.fromWeb=function(e,t){return u().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return u().newReadableWritablePairFromDuplex(e)};var d;c.from=function(e){return d||=ze(),d(e,`body`)}})),Ve=o(((e,t)=>{var{ObjectSetPrototypeOf:n,Symbol:r}=G();t.exports=c;var{ERR_METHOD_NOT_IMPLEMENTED:i}=we().codes,a=Be(),{getHighWaterMark:o}=Ne();n(c.prototype,a.prototype),n(c,a);var s=r(`kCallback`);function c(e){if(!(this instanceof c))return new c(e);let t=e?o(this,e,`readableHighWaterMark`,!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),a.call(this,e),this._readableState.sync=!1,this[s]=null,e&&(typeof e.transform==`function`&&(this._transform=e.transform),typeof e.flush==`function`&&(this._flush=e.flush)),this.on(`prefinish`,u)}function l(e){typeof this._flush==`function`&&!this.destroyed?this._flush((t,n)=>{if(t){e?e(t):this.destroy(t);return}n!=null&&this.push(n),this.push(null),e&&e()}):(this.push(null),e&&e())}function u(){this._final!==l&&l.call(this)}c.prototype._final=l,c.prototype._transform=function(e,t,n){throw new i(`_transform()`)},c.prototype._write=function(e,t,n){let r=this._readableState,i=this._writableState,a=r.length;this._transform(e,t,(e,t)=>{if(e){n(e);return}t!=null&&this.push(t),i.ended||a===r.length||r.length<r.highWaterMark?n():this[s]=n})},c.prototype._read=function(){if(this[s]){let e=this[s];this[s]=null,e()}}})),He=o(((e,t)=>{var{ObjectSetPrototypeOf:n}=G();t.exports=i;var r=Ve();n(i.prototype,r.prototype),n(i,r);function i(e){if(!(this instanceof i))return new i(e);r.call(this,e)}i.prototype._transform=function(e,t,n){n(null,e)}})),Ue=o(((e,t)=>{var n=ke(),{ArrayIsArray:r,Promise:i,SymbolAsyncIterator:a,SymbolDispose:o}=G(),s=Ae(),{once:c}=De(),l=q(),u=Be(),{aggregateTwoErrors:d,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:h,ERR_STREAM_PREMATURE_CLOSE:g},AbortError:_}=we(),{validateFunction:v,validateAbortSignal:y}=Oe(),{isIterable:b,isReadable:x,isReadableNodeStream:S,isNodeStream:C,isTransformStream:w,isWebStream:T,isReadableStream:E,isReadableFinished:D}=K(),O=globalThis.AbortController||Te().AbortController,k,A,j;function M(e,t,n){let r=!1;return e.on(`close`,()=>{r=!0}),{destroy:t=>{r||(r=!0,l.destroyer(e,t||new h(`pipe`)))},cleanup:s(e,{readable:t,writable:n},e=>{r=!e})}}function N(e){return v(e[e.length-1],`streams[stream.length - 1]`),e.pop()}function P(e){if(b(e))return e;if(S(e))return F(e);throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`],e)}async function*F(e){A||=Le(),yield*A.prototype[a].call(e)}async function I(e,t,n,{end:r}){let a,o=null,c=e=>{if(e&&(a=e),o){let e=o;o=null,e()}},l=()=>new i((e,t)=>{a?t(a):o=()=>{a?t(a):e()}});t.on(`drain`,c);let u=s(t,{readable:!1},c);try{t.writableNeedDrain&&await l();for await(let n of e)t.write(n)||await l();r&&(t.end(),await l()),n()}catch(e){n(a===e?e:d(a,e))}finally{u(),t.off(`drain`,c)}}async function L(e,t,n,{end:r}){w(t)&&(t=t.writable);let i=t.getWriter();try{for await(let t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,r&&await i.close(),n()}catch(e){try{await i.abort(e),n(e)}catch(e){n(e)}}}function R(...e){return z(e,c(N(e)))}function z(e,t,i){if(e.length===1&&r(e[0])&&(e=e[0]),e.length<2)throw new m(`streams`);let a=new O,s=a.signal,c=i?.signal,l=[];y(c,`options.signal`);function d(){F(new _)}j||=De().addAbortListener;let h;c&&(h=j(c,d));let g,v,D=[],A=0;function N(e){F(e,--A===0)}function F(e,r){var i;if(e&&(!g||g.code===`ERR_STREAM_PREMATURE_CLOSE`)&&(g=e),!(!g&&!r)){for(;D.length;)D.shift()(g);(i=h)==null||i[o](),a.abort(),r&&(g||l.forEach(e=>e()),n.nextTick(t,g,v))}}let R;for(let t=0;t<e.length;t++){let r=e[t],a=t<e.length-1,o=t>0,c=a||i?.end!==!1,d=t===e.length-1;if(C(r)){if(c){let{destroy:e,cleanup:t}=M(r,a,o);D.push(e),x(r)&&d&&l.push(t)}function e(e){e&&e.name!==`AbortError`&&e.code!==`ERR_STREAM_PREMATURE_CLOSE`&&N(e)}r.on(`error`,e),x(r)&&d&&l.push(()=>{r.removeListener(`error`,e)})}if(t===0)if(typeof r==`function`){if(R=r({signal:s}),!b(R))throw new p(`Iterable, AsyncIterable or Stream`,`source`,R)}else R=b(r)||S(r)||w(r)?r:u.from(r);else if(typeof r==`function`)if(R=w(R)?P(R?.readable):P(R),R=r(R,{signal:s}),a){if(!b(R,!0))throw new p(`AsyncIterable`,`transform[${t-1}]`,R)}else{k||=He();let e=new k({objectMode:!0}),t=R?.then;if(typeof t==`function`)A++,t.call(R,t=>{v=t,t!=null&&e.write(t),c&&e.end(),n.nextTick(N)},t=>{e.destroy(t),n.nextTick(N,t)});else if(b(R,!0))A++,I(R,e,N,{end:c});else if(E(R)||w(R)){let t=R.readable||R;A++,I(t,e,N,{end:c})}else throw new p(`AsyncIterable or Promise`,`destination`,R);R=e;let{destroy:r,cleanup:i}=M(R,!1,!0);D.push(r),d&&l.push(i)}else if(C(r)){if(S(R)){A+=2;let e=B(R,r,N,{end:c});x(r)&&d&&l.push(e)}else if(w(R)||E(R)){let e=R.readable||R;A++,I(e,r,N,{end:c})}else if(b(R))A++,I(R,r,N,{end:c});else throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`,`ReadableStream`,`TransformStream`],R);R=r}else if(T(r)){if(S(R))A++,L(P(R),r,N,{end:c});else if(E(R)||b(R))A++,L(R,r,N,{end:c});else if(w(R))A++,L(R.readable,r,N,{end:c});else throw new f(`val`,[`Readable`,`Iterable`,`AsyncIterable`,`ReadableStream`,`TransformStream`],R);R=r}else R=u.from(r)}return(s!=null&&s.aborted||c!=null&&c.aborted)&&n.nextTick(d),R}function B(e,t,r,{end:i}){let a=!1;if(t.on(`close`,()=>{a||r(new g)}),e.pipe(t,{end:!1}),i){function r(){a=!0,t.end()}D(e)?n.nextTick(r):e.once(`end`,r)}else r();return s(e,{readable:!0,writable:!1},t=>{let n=e._readableState;t&&t.code===`ERR_STREAM_PREMATURE_CLOSE`&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once(`end`,r).once(`error`,r):r(t)}),s(t,{readable:!1,writable:!0},r)}t.exports={pipelineImpl:z,pipeline:R}})),We=o(((e,t)=>{var{pipeline:n}=Ue(),r=Be(),{destroyer:i}=q(),{isNodeStream:a,isReadable:o,isWritable:s,isWebStream:c,isTransformStream:l,isWritableStream:u,isReadableStream:d}=K(),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=we(),h=Ae();t.exports=function(...e){if(e.length===0)throw new m(`streams`);if(e.length===1)return r.from(e[0]);let t=[...e];if(typeof e[0]==`function`&&(e[0]=r.from(e[0])),typeof e[e.length-1]==`function`){let t=e.length-1;e[t]=r.from(e[t])}for(let n=0;n<e.length;++n)if(!(!a(e[n])&&!c(e[n]))){if(n<e.length-1&&!(o(e[n])||d(e[n])||l(e[n])))throw new p(`streams[${n}]`,t[n],`must be readable`);if(n>0&&!(s(e[n])||u(e[n])||l(e[n])))throw new p(`streams[${n}]`,t[n],`must be writable`)}let g,_,v,y,b;function x(e){let t=y;y=null,t?t(e):e?b.destroy(e):!T&&!w&&b.destroy()}let S=e[0],C=n(e,x),w=!!(s(S)||u(S)||l(S)),T=!!(o(C)||d(C)||l(C));if(b=new r({writableObjectMode:!!(S!=null&&S.writableObjectMode),readableObjectMode:!!(C!=null&&C.readableObjectMode),writable:w,readable:T}),w){if(a(S))b._write=function(e,t,n){S.write(e,t)?n():g=n},b._final=function(e){S.end(),_=e},S.on(`drain`,function(){if(g){let e=g;g=null,e()}});else if(c(S)){let e=(l(S)?S.writable:S).getWriter();b._write=async function(t,n,r){try{await e.ready,e.write(t).catch(()=>{}),r()}catch(e){r(e)}},b._final=async function(t){try{await e.ready,e.close().catch(()=>{}),_=t}catch(e){t(e)}}}h(l(C)?C.readable:C,()=>{if(_){let e=_;_=null,e()}})}if(T){if(a(C))C.on(`readable`,function(){if(v){let e=v;v=null,e()}}),C.on(`end`,function(){b.push(null)}),b._read=function(){for(;;){let e=C.read();if(e===null){v=b._read;return}if(!b.push(e))return}};else if(c(C)){let e=(l(C)?C.readable:C).getReader();b._read=async function(){for(;;)try{let{value:t,done:n}=await e.read();if(!b.push(t))return;if(n){b.push(null);return}}catch{return}}}}return b._destroy=function(e,t){!e&&y!==null&&(e=new f),v=null,g=null,_=null,y===null?t(e):(y=t,a(C)&&i(C,e))},b}})),Ge=o(((e,t)=>{var n=globalThis.AbortController||Te().AbortController,{codes:{ERR_INVALID_ARG_VALUE:r,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:a,ERR_OUT_OF_RANGE:o},AbortError:s}=we(),{validateAbortSignal:c,validateInteger:l,validateObject:u}=Oe(),d=G().Symbol(`kWeak`),f=G().Symbol(`kResistStopPropagation`),{finished:p}=Ae(),m=We(),{addAbortSignalNoValidate:h}=je(),{isWritable:g,isNodeStream:_}=K(),{deprecate:v}=De(),{ArrayPrototypePush:y,Boolean:b,MathFloor:x,Number:S,NumberIsNaN:C,Promise:w,PromiseReject:T,PromiseResolve:E,PromisePrototypeThen:D,Symbol:O}=G(),k=O(`kEmpty`),A=O(`kEof`);function j(e,t){if(t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),_(e)&&!g(e))throw new r(`stream`,e,`must be writable`);let n=m(this,e);return t!=null&&t.signal&&h(t.signal,n),n}function M(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`);let n=1;t?.concurrency!=null&&(n=x(t.concurrency));let r=n-1;return t?.highWaterMark!=null&&(r=x(t.highWaterMark)),l(n,`options.concurrency`,1),l(r,`options.highWaterMark`,0),r+=n,async function*(){let i=De().AbortSignalAny([t?.signal].filter(b)),a=this,o=[],c={signal:i},l,u,d=!1,f=0;function p(){d=!0,m()}function m(){--f,h()}function h(){u&&!d&&f<n&&o.length<r&&(u(),u=null)}async function g(){try{for await(let t of a){if(d)return;if(i.aborted)throw new s;try{if(t=e(t,c),t===k)continue;t=E(t)}catch(e){t=T(e)}f+=1,D(t,m,p),o.push(t),l&&=(l(),null),!d&&(o.length>=r||f>=n)&&await new w(e=>{u=e})}o.push(A)}catch(e){let t=T(e);D(t,m,p),o.push(t)}finally{d=!0,l&&=(l(),null)}}g();try{for(;;){for(;o.length>0;){let e=await o[0];if(e===A)return;if(i.aborted)throw new s;e!==k&&(yield e),o.shift(),h()}await new w(e=>{l=e})}}finally{d=!0,u&&=(u(),null)}}.call(this)}function N(e=void 0){return e!=null&&u(e,`options`),e?.signal!=null&&c(e.signal,`options.signal`),async function*(){let t=0;for await(let r of this){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)throw new s({cause:e.signal.reason});yield[t++,r]}}.call(this)}async function P(e,t=void 0){for await(let n of R.call(this,e,t))return!0;return!1}async function F(e,t=void 0){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);return!await P.call(this,async(...t)=>!await e(...t),t)}async function I(e,t){for await(let n of R.call(this,e,t))return n}async function L(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);async function n(t,n){return await e(t,n),k}for await(let e of M.call(this,n,t));}function R(e,t){if(typeof e!=`function`)throw new i(`fn`,[`Function`,`AsyncFunction`],e);async function n(t,n){return await e(t,n)?t:k}return M.call(this,n,t)}var z=class extends a{constructor(){super(`reduce`),this.message=`Reduce of an empty stream requires an initial value`}};async function B(e,t,r){var a;if(typeof e!=`function`)throw new i(`reducer`,[`Function`,`AsyncFunction`],e);r!=null&&u(r,`options`),r?.signal!=null&&c(r.signal,`options.signal`);let o=arguments.length>1;if(r!=null&&(a=r.signal)!=null&&a.aborted){let e=new s(void 0,{cause:r.signal.reason});throw this.once(`error`,()=>{}),await p(this.destroy(e)),e}let l=new n,m=l.signal;if(r!=null&&r.signal){let e={once:!0,[d]:this,[f]:!0};r.signal.addEventListener(`abort`,()=>l.abort(),e)}let h=!1;try{for await(let n of this){var g;if(h=!0,r!=null&&(g=r.signal)!=null&&g.aborted)throw new s;o?t=await e(t,n,{signal:m}):(t=n,o=!0)}if(!h&&!o)throw new z}finally{l.abort()}return t}async function ee(e){e!=null&&u(e,`options`),e?.signal!=null&&c(e.signal,`options.signal`);let t=[];for await(let r of this){var n;if(e!=null&&(n=e.signal)!=null&&n.aborted)throw new s(void 0,{cause:e.signal.reason});y(t,r)}return t}function V(e,t){let n=M.call(this,e,t);return async function*(){for await(let e of n)yield*e}.call(this)}function te(e){if(e=S(e),C(e))return 0;if(e<0)throw new o(`number`,`>= 0`,e);return e}function H(e,t=void 0){return t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),e=te(e),async function*(){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)throw new s;for await(let n of this){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)throw new s;e--<=0&&(yield n)}}.call(this)}function ne(e,t=void 0){return t!=null&&u(t,`options`),t?.signal!=null&&c(t.signal,`options.signal`),e=te(e),async function*(){var n;if(t!=null&&(n=t.signal)!=null&&n.aborted)throw new s;for await(let n of this){var r;if(t!=null&&(r=t.signal)!=null&&r.aborted)throw new s;if(e-->0&&(yield n),e<=0)return}}.call(this)}t.exports.streamReturningOperators={asIndexedPairs:v(N,`readable.asIndexedPairs will be removed in a future version.`),drop:H,filter:R,flatMap:V,map:M,take:ne,compose:j},t.exports.promiseReturningOperators={every:F,forEach:L,reduce:B,toArray:ee,some:P,find:I}})),Ke=o(((e,t)=>{var{ArrayPrototypePop:n,Promise:r}=G(),{isIterable:i,isNodeStream:a,isWebStream:o}=K(),{pipelineImpl:s}=Ue(),{finished:c}=Ae();qe();function l(...e){return new r((t,r)=>{let c,l,u=e[e.length-1];if(u&&typeof u==`object`&&!a(u)&&!i(u)&&!o(u)){let t=n(e);c=t.signal,l=t.end}s(e,(e,n)=>{e?r(e):t(n)},{signal:c,end:l})})}t.exports={finished:c,pipeline:l}})),qe=o(((e,t)=>{var{Buffer:n}=f(),{ObjectDefineProperty:r,ObjectKeys:i,ReflectApply:a}=G(),{promisify:{custom:o}}=De(),{streamReturningOperators:s,promiseReturningOperators:c}=Ge(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:l}}=we(),u=We(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:p}=Ne(),{pipeline:m}=Ue(),{destroyer:h}=q(),g=Ae(),_=Ke(),v=K(),y=t.exports=J().Stream;y.isDestroyed=v.isDestroyed,y.isDisturbed=v.isDisturbed,y.isErrored=v.isErrored,y.isReadable=v.isReadable,y.isWritable=v.isWritable,y.Readable=Le();for(let e of i(s)){let t=s[e];function n(...e){if(new.target)throw l();return y.Readable.from(a(t,this,e))}r(n,`name`,{__proto__:null,value:t.name}),r(n,`length`,{__proto__:null,value:t.length}),r(y.Readable.prototype,e,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}for(let e of i(c)){let t=c[e];function n(...e){if(new.target)throw l();return a(t,this,e)}r(n,`name`,{__proto__:null,value:t.name}),r(n,`length`,{__proto__:null,value:t.length}),r(y.Readable.prototype,e,{__proto__:null,value:n,enumerable:!1,configurable:!0,writable:!0})}y.Writable=Re(),y.Duplex=Be(),y.Transform=Ve(),y.PassThrough=He(),y.pipeline=m;var{addAbortSignal:b}=je();y.addAbortSignal=b,y.finished=g,y.destroy=h,y.compose=u,y.setDefaultHighWaterMark=d,y.getDefaultHighWaterMark=p,r(y,`promises`,{__proto__:null,configurable:!0,enumerable:!0,get(){return _}}),r(m,o,{__proto__:null,enumerable:!0,get(){return _.pipeline}}),r(g,o,{__proto__:null,enumerable:!0,get(){return _.finished}}),y.Stream=y,y._isUint8Array=function(e){return e instanceof Uint8Array},y._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}})),Je=o(((e,t)=>{var n=qe(),r=Ke(),i=n.Readable.destroy;t.exports=n.Readable,t.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,t.exports._isUint8Array=n._isUint8Array,t.exports.isDisturbed=n.isDisturbed,t.exports.isErrored=n.isErrored,t.exports.isReadable=n.isReadable,t.exports.Readable=n.Readable,t.exports.Writable=n.Writable,t.exports.Duplex=n.Duplex,t.exports.Transform=n.Transform,t.exports.PassThrough=n.PassThrough,t.exports.addAbortSignal=n.addAbortSignal,t.exports.finished=n.finished,t.exports.destroy=n.destroy,t.exports.destroy=i,t.exports.pipeline=n.pipeline,t.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get(){return r}}),t.exports.Stream=n.Stream,t.exports.default=t.exports})),Ye=Je(),Xe=Symbol(`iter`);function Ze(e,t,n=4){if(n===0)return Object.assign(e,t);for(let r in t)e[r]=Ze(e[r]||Object.create(null),t[r],n-1);return e}function Qe(e,t,n=4){let r=!1;for(let i in e)if(i in t){let a=n===0?null:Qe(e[i],t[i],n-1);if(a!==!1)r||=Object.create(null),r[i]=a;else if(n===3)return!1}return r}function $e(e,t,n=4){let r=!1;for(let i in e)if(!(i in t))r||=Object.create(null),r[i]=n===0?null:Ze({},e[i],n-1);else if(n!==0){let a=$e(e[i],t[i],n-1);if(a!==!1)r||=Object.create(null),r[i]=a;else if(n===3)return!1}return r}var et=class{constructor(e={}){this._id=1,this._ids=Object.create(null),this._ids[``]=1,this._entities=Object.create(null),this._entities[1]=``,this._blankNodeIndex=0,this._factory=e.factory||k}_termFromId(e){if(e[0]===`.`){let 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 F(e,this._factory)}_termToNumericId(e){if(e.termType===`Quad`){let t=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),r=this._termToNumericId(e.object),i;return t&&n&&r&&(se(e.graph)||(i=this._termToNumericId(e.graph)))&&this._ids[i?`.${t}.${n}.${r}.${i}`:`.${t}.${n}.${r}`]}return this._ids[I(e)]}_termToNewNumericId(e){let t=e&&e.termType===`Quad`?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${se(e.graph)?``:`.${this._termToNewNumericId(e.graph)}`}`:I(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))}},tt=class e{constructor(e,t){this._size=0,this._graphs=Object.create(null),!t&&e&&!e[0]&&typeof e.match!=`function`&&(t=e,e=null),t||={},this._factory=t.factory||k,this._entityIndex=t.entityIndex||new et({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;let t=this._graphs,n,r;for(let i in t)for(let a in n=t[i].subjects)for(let t in r=n[a])e+=Object.keys(r[t]).length;return this._size=e}_addToIndex(e,t,n,r){let i=e[t]||(e[t]={}),a=i[n]||(i[n]={}),o=r in a;return o||(a[r]=null),!o}_removeFromIndex(e,t,n,r){let i=e[t],a=i[n];delete a[r];for(let e in a)return;delete i[n];for(let e in i)return;delete e[t]}*_findInIndex(e,t,n,r,i,a,o,s){let c,l,u,d=this._entities,f=this._termFromId(d[s]),p={subject:null,predicate:null,object:null};t&&((c=e,e={})[t]=c[t]);for(let t in e)if(l=e[t]){p[i]=this._termFromId(d[t]),n&&((c=l,l={})[n]=c[n]);for(let e in l)if(u=l[e]){p[a]=this._termFromId(d[e]);let t=r?r in u?[r]:[]:Object.keys(u);for(let e=0;e<t.length;e++)p[o]=this._termFromId(d[t[e]]),yield this._factory.quad(p.subject,p.predicate,p.object,f)}}}_loop(e,t){for(let n in e)t(n)}_loopByKey0(e,t,n){let r,i;if(r=e[t])for(i in r)n(i)}_loopByKey1(e,t,n){let r,i;for(r in e)i=e[r],i[t]&&n(r)}_loopBy2Keys(e,t,n,r){let i,a,o;if((i=e[t])&&(a=i[n]))for(o in a)r(o)}_countInIndex(e,t,n,r){let i=0,a,o,s;t&&((a=e,e={})[t]=a[t]);for(let t in e)if(o=e[t]){n&&((a=o,o={})[n]=a[n]);for(let e in o)(s=o[e])&&(r?r in s&&i++:i+=Object.keys(s).length)}return i}_getGraphs(e){return e=e===``?1:e&&(this._termToNumericId(e)||-1),typeof e==`number`?{[e]:this._graphs[e]}:this._graphs}_uniqueEntities(e){let 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,r){t||(r=e.graph,n=e.object,t=e.predicate,e=e.subject),r=r?this._termToNewNumericId(r):1;let i=this._graphs[r];return i||(i=this._graphs[r]={subjects:{},predicates:{},objects:{}},Object.freeze(i)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),n=this._termToNewNumericId(n),this._addToIndex(i.subjects,e,t,n)?(this._addToIndex(i.predicates,t,n,e),this._addToIndex(i.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,r){return e&&e.subject&&({subject:e,predicate:t,object:n,graph:r}=e),!this.readQuads(e,t,n,r).next().done}import(e){return e.on(`data`,e=>{this.addQuad(e)}),e}removeQuad(e,t,n,r){t||({subject:e,predicate:t,object:n,graph:r}=e),r=r?this._termToNumericId(r):1;let i=this._graphs,a,o,s;if(!(e&&=this._termToNumericId(e))||!(t&&=this._termToNumericId(t))||!(n&&=this._termToNumericId(n))||!(a=i[r])||!(o=a.subjects[e])||!(s=o[t])||!(n in s))return!1;for(e in 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--,a.subjects)return!0;return delete i[r],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on(`data`,e=>{this.removeQuad(e)}),e}removeMatches(e,t,n,r){let i=new Ye.Readable({objectMode:!0}),a=this.readQuads(e,t,n,r);return i._read=e=>{for(;--e>=0;){let{done:e,value:t}=a.next();if(e){i.push(null);return}i.push(t)}},this.remove(i)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,r){return[...this.readQuads(e,t,n,r)]}*readQuads(e,t,n,r){let i=this._getGraphs(r),a,o,s,c;if(!(e&&!(o=this._termToNumericId(e))||t&&!(s=this._termToNumericId(t))||n&&!(c=this._termToNumericId(n))))for(let e in i)(a=i[e])&&(o?c?yield*this._findInIndex(a.objects,c,o,s,`object`,`subject`,`predicate`,e):yield*this._findInIndex(a.subjects,o,s,null,`subject`,`predicate`,`object`,e):s?yield*this._findInIndex(a.predicates,s,c,null,`predicate`,`object`,`subject`,e):c?yield*this._findInIndex(a.objects,c,null,null,`object`,`subject`,`predicate`,e):yield*this._findInIndex(a.subjects,null,null,null,`subject`,`predicate`,`object`,e))}match(e,t,n,r){return new rt(this,e,t,n,r,{entityIndex:this._entityIndex})}countQuads(e,t,n,r){let i=this._getGraphs(r),a=0,o,s,c,l;if(e&&!(s=this._termToNumericId(e))||t&&!(c=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n)))return 0;for(let r in i)(o=i[r])&&(e?n?a+=this._countInIndex(o.objects,l,s,c):a+=this._countInIndex(o.subjects,s,c,l):t?a+=this._countInIndex(o.predicates,c,l,s):a+=this._countInIndex(o.objects,l,s,c));return a}forEach(e,t,n,r,i){this.some(t=>(e(t,this),!1),t,n,r,i)}every(e,t,n,r,i){return!this.some(t=>!e(t,this),t,n,r,i)}some(e,t,n,r,i){for(let a of this.readQuads(t,n,r,i))if(e(a,this))return!0;return!1}getSubjects(e,t,n){let r=[];return this.forSubjects(e=>{r.push(e)},e,t,n),r}forSubjects(e,t,n,r){let i=this._getGraphs(r),a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(s=this._termToNumericId(n))))for(r in i)(a=i[r])&&(o?s?this._loopBy2Keys(a.predicates,o,s,e):this._loopByKey1(a.subjects,o,e):s?this._loopByKey0(a.objects,s,e):this._loop(a.subjects,e))}getPredicates(e,t,n){let r=[];return this.forPredicates(e=>{r.push(e)},e,t,n),r}forPredicates(e,t,n,r){let i=this._getGraphs(r),a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(s=this._termToNumericId(n))))for(r in i)(a=i[r])&&(o?s?this._loopBy2Keys(a.objects,s,o,e):this._loopByKey0(a.subjects,o,e):s?this._loopByKey1(a.predicates,s,e):this._loop(a.predicates,e))}getObjects(e,t,n){let r=[];return this.forObjects(e=>{r.push(e)},e,t,n),r}forObjects(e,t,n,r){let i=this._getGraphs(r),a,o,s;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(s=this._termToNumericId(n))))for(r in i)(a=i[r])&&(o?s?this._loopBy2Keys(a.subjects,o,s,e):this._loopByKey1(a.objects,o,e):s?this._loopByKey0(a.predicates,s,e):this._loop(a.objects,e))}getGraphs(e,t,n){let r=[];return this.forGraphs(e=>{r.push(e)},e,t,n),r}forGraphs(e,t,n,r){for(let i in this._graphs)this.some(t=>(e(t.graph),!0),t,n,r,this._termFromId(this._entities[i]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){let n={},r=t?(()=>!0):((e,t)=>{throw Error(`${e.value} ${t}`)}),i=this.getQuads(null,g.rdf.rest,g.rdf.nil,null),a=e?[...i]:[];return i.forEach(t=>{let i=[],o=!1,s,c,l=t.graph,u=t.subject;for(;u&&!o;){let e=this.getQuads(null,null,u,null),t=this.getQuads(u,null,null,null),n,d=null,f=null,p=null;for(let i=0;i<t.length&&!o;i++)n=t[i],n.graph.equals(l)?s?o=r(u,`has non-list arcs out`):n.predicate.value===g.rdf.first?d?o=r(u,`has multiple rdf:first arcs`):a.push(d=n):n.predicate.value===g.rdf.rest?f?o=r(u,`has multiple rdf:rest arcs`):a.push(f=n):e.length?o=r(u,`can't be subject and object`):(s=n,c=`subject`):o=r(u,`not confined to single graph`);for(let t=0;t<e.length&&!o;++t)n=e[t],s?o=r(u,`can't have coreferences`):n.predicate.value===g.rdf.rest?p?o=r(u,`has incoming rdf:rest arcs`):p=n:(s=n,c=`object`);d?i.unshift(d.object):o=r(u,`has no list head`),u=p&&p.subject}o?e=!1:s&&(n[s[c].value]=i)}),e&&this.removeQuads(a),n}addAll(t){if(t instanceof rt&&(t=t.filtered),Array.isArray(t))this.addQuads(t);else if(t instanceof e&&t._entityIndex===this._entityIndex)t._size!==0&&(this._graphs=Ze(this._graphs,t._graphs),this._size=null);else for(let e of t)this.add(e);return this}contains(t){if(t instanceof rt&&(t=t.filtered),t===this)return!0;if(!(t instanceof e)||this._entityIndex!==t._entityIndex)return t.every(e=>this.has(e));let n=this._graphs,r=t._graphs,i,a,o,s,c;for(let e in r){if(!(i=n[e]))return!1;i=i.subjects;for(let t in a=r[e].subjects){if(!(o=i[t]))return!1;for(let e in s=a[t]){if(!(c=o[e]))return!1;for(let t in s[e])if(!(t in c))return!1}}}return!0}deleteMatches(e,t,n,r){for(let i of this.match(e,t,n,r))this.removeQuad(i);return this}difference(t){if(t&&t instanceof rt&&(t=t.filtered),t===this)return new e({entityIndex:this._entityIndex});if(t instanceof e&&t._entityIndex===this._entityIndex){let n=new e({entityIndex:this._entityIndex}),r=$e(this._graphs,t._graphs);return r&&(n._graphs=r,n._size=null),n}return this.filter(e=>!t.has(e))}equals(e){return e instanceof rt&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(t){let n=new e({entityIndex:this._entityIndex});for(let e of this)t(e,this)&&n.add(e);return n}intersection(t){if(t instanceof rt&&(t=t.filtered),t===this){let t=new e({entityIndex:this._entityIndex});return t._graphs=Ze(Object.create(null),this._graphs),t._size=this._size,t}else if(t instanceof e&&this._entityIndex===t._entityIndex){let n=new e({entityIndex:this._entityIndex}),r=Qe(t._graphs,this._graphs);return r&&(n._graphs=r,n._size=null),n}return this.filter(e=>t.has(e))}map(t){let n=new e({entityIndex:this._entityIndex});for(let e of this)n.add(t(e,this));return n}reduce(e,t){let n=this.readQuads(),r=t===void 0?n.next().value:t;for(let t of n)r=e(r,t,this);return r}toArray(){return this.getQuads()}toCanonical(){throw Error(`not implemented`)}toStream(){return this.match()}toString(){return new xe().quadsToString(this)}union(t){let n=new e({entityIndex:this._entityIndex});return n._graphs=Ze(Object.create(null),this._graphs),n._size=this._size,n.addAll(t),n}*[Symbol.iterator](){yield*this.readQuads()}};function nt(e,t,n=0){let r=t[n];if(r&&!(r in e))return!1;let i=!1;for(let a in r?{[r]:e[r]}:e){let r=n===2?null:nt(e[a],t,n+1);r!==!1&&(i||=Object.create(null),i[a]=r)}return i}var rt=class e extends Ye.Readable{constructor(e,t,n,r,i,a){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:n,object:r,graph:i,options:a})}get filtered(){if(!this._filtered){let{n3Store:e,graph:t,object:n,predicate:r,subject:i}=this,a=this._filtered=new tt({factory:e._factory,entityIndex:this.options.entityIndex}),o,s,c;if(i&&!(o=a._termToNumericId(i))||r&&!(s=a._termToNumericId(r))||n&&!(c=a._termToNumericId(n)))return a;let l=e._getGraphs(t);for(let e in l){let t,n,r,i;(i=l[e])&&(!o&&s?(n=nt(i.predicates,[s,c,o]))&&(t=nt(i.subjects,[o,s,c]),r=nt(i.objects,[c,o,s])):c?(r=nt(i.objects,[c,o,s]))&&(t=nt(i.subjects,[o,s,c]),n=nt(i.predicates,[s,c,o])):(t=nt(i.subjects,[o,s,c]))&&(n=nt(i.predicates,[s,c,o]),r=nt(i.objects,[c,o,s])),t&&(a._graphs[e]={subjects:t,predicates:n,objects:r}))}a._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[Xe]&&(this[Xe]=this[Symbol.iterator]());let t=this[Xe];for(;--e>=0;){let{done:e,value:n}=t.next();if(e){this.push(null);return}this.push(n)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,n,r){return this.filtered.deleteMatches(e,t,n,r)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,n,r,i){return this.filtered.every(e,t,n,r,i)}filter(e){return this.filtered.filter(e)}forEach(e,t,n,r,i){return this.filtered.forEach(e,t,n,r,i)}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,r,i){return this.filtered.some(e,t,n,r,i)}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 xe().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(t,n,r,i){return new e(this.filtered,t,n,r,i,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}},it=class extends Ye.Transform{constructor(e){super({decodeStrings:!0}),this._readableState.objectMode=!0;let t=new ie(e),n,r,i={onQuad:(e,t)=>{e&&this.emit(`error`,e)||t&&this.push(t)},onPrefix:(e,t)=>{this.emit(`prefix`,e,t)}};e&&e.comments&&(i.onComment=e=>{this.emit(`comment`,e)}),t.parse({on:(e,t)=>{switch(e){case`data`:n=t;break;case`end`:r=t;break}}},i),this._transform=(e,t,r)=>{n(e),r()},this._flush=e=>{r(),e()}}import(e){return e.on(`data`,e=>{this.write(e)}),e.on(`end`,()=>{this.end()}),e.on(`error`,e=>{this.emit(`error`,e)}),this}},Y=`http://www.w3.org/ns/shacl#`,at=`http://datashapes.org/dash#`,ot=`http://www.w3.org/2001/XMLSchema#`,st=`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,ct=`http://www.w3.org/2000/01/rdf-schema#`,lt=`http://www.w3.org/ns/oa#`,ut=`http://purl.org/dc/terms/`,dt=k.namedNode(`loaded-shapes`),ft=k.namedNode(`loaded-data`),pt=k.namedNode(`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`),mt=k.namedNode(`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`),ht=k.namedNode(`http://purl.org/dc/terms/conformsTo`),gt=k.namedNode(`http://www.w3.org/2000/01/rdf-schema#subClassOf`),_t=k.namedNode(`http://www.w3.org/2002/07/owl#imports`),vt=k.namedNode(`http://www.w3.org/2004/02/skos/core#broader`),yt=k.namedNode(`http://www.w3.org/2004/02/skos/core#narrower`),bt=k.namedNode(`http://www.w3.org/ns/shacl#NodeShape`),xt=k.namedNode(`http://www.w3.org/ns/shacl#IRI`),St=k.namedNode(`http://www.w3.org/ns/shacl#property`),Ct=k.namedNode(`http://www.w3.org/ns/shacl#class`),wt=k.namedNode(`http://www.w3.org/ns/shacl#node`),Tt=k.namedNode(`http://www.w3.org/ns/shacl#message`),Et=k.namedNode(`http://www.w3.org/ns/shacl#targetClass`),Dt=k.namedNode(`http://www.w3.org/ns/shacl#nodeKind`),Ot=k.namedNode(`http://www.w3.org/2001/XMLSchema#string`),kt=k.namedNode(`http://www.w3.org/2001/XMLSchema#boolean`),At=new Set([`http://www.w3.org/2001/XMLSchema#integer`,`http://www.w3.org/2001/XMLSchema#int`,`http://www.w3.org/2001/XMLSchema#short`,`http://www.w3.org/2001/XMLSchema#byte`,`http://www.w3.org/2001/XMLSchema#unsignedInt`,`http://www.w3.org/2001/XMLSchema#unsignedShort`,`http://www.w3.org/2001/XMLSchema#unsignedByte`,`http://www.w3.org/2001/XMLSchema#long`,`http://www.w3.org/2001/XMLSchema#unsignedLong`,`http://www.w3.org/2001/XMLSchema#float`,`http://www.w3.org/2001/XMLSchema#double`,`http://www.w3.org/2001/XMLSchema#decimal`,`http://www.w3.org/2001/XMLSchema#date`,`http://www.w3.org/2001/XMLSchema#dateTime`]),jt=new Set([`http://www.w3.org/2001/XMLSchema#integer`,`http://www.w3.org/2001/XMLSchema#int`,`http://www.w3.org/2001/XMLSchema#short`,`http://www.w3.org/2001/XMLSchema#byte`,`http://www.w3.org/2001/XMLSchema#unsignedInt`,`http://www.w3.org/2001/XMLSchema#unsignedShort`,`http://www.w3.org/2001/XMLSchema#unsignedByte`,`http://www.w3.org/2001/XMLSchema#long`,`http://www.w3.org/2001/XMLSchema#unsignedLong`,`http://www.w3.org/2001/XMLSchema#float`,`http://www.w3.org/2001/XMLSchema#double`,`http://www.w3.org/2001/XMLSchema#decimal`]),Mt=new Set([`http://www.w3.org/2001/XMLSchema#float`,`http://www.w3.org/2001/XMLSchema#double`,`http://www.w3.org/2001/XMLSchema#decimal`]);function Nt(e,t,n=Y,r){let i=``,a=Pt(e,t,n,r);return a&&(i=a.value),i}function Pt(e,t,n=Y,r){let i,a=n+t;if(r?.length){for(let t of r)for(let n of e)if(n.predicate.value===a){if(n.object.id.endsWith(`@${t}`))return n.object;n.object.id.indexOf(`@`)<0?i=n.object:i||=n.object}}else for(let t of e)if(t.predicate.value===a)return t.object;return i}function Ft(e){e.querySelector(`.editor`)?.focus()}function It(e,t){return Nt(e,`prefLabel`,`http://www.w3.org/2004/02/skos/core#`,t)||Nt(e,`label`,`http://www.w3.org/2000/01/rdf-schema#`,t)||Nt(e,`title`,`http://purl.org/dc/terms/`,t)||Nt(e,`name`,`http://xmlns.com/foaf/0.1/`,t)}function Lt(e,t,n){let r=[];for(let i of e)r.push({value:i,label:It(t.getQuads(i,null,null,null),n),children:[]});return r}function Rt(e,t){for(let n in t){let r=t[n];e.startsWith(r)&&(e=e.slice(r.length))}return e}function zt(e,t,n=new Map){n.set(dt.id,dt),n.set(ft.id,ft);let r=e.config.valuesGraphId??k.defaultGraph();n.set(r.id,r);for(let r of e.owlImports)Bt(r,t,n);return e.parent&&zt(e.parent,t,n),[...n.values()]}function Bt(e,t,n){if(!n.has(e.id)){n.set(e.id,e);for(let r of t.getObjects(null,_t,e))r.termType===`NamedNode`&&Bt(r,t,n)}}function Vt(e,t,n,r){return r.flatMap(r=>e.getSubjects(t,n,r))}function Ht(e,t,n,r){return r.flatMap(r=>e.getObjects(t,n,r))}function Ut(e,t){if(t.in){let e=t.config.lists[t.in];return Lt(e?.length?e:[],t.config.store,t.config.languages)}else{let n=zt(t,t.config.store),r=Vt(t.config.store,pt,e,n),i=new Map,a=new Map;for(let e of r)i.set(e.id,{value:e,label:It(t.config.store.getQuads(e,null,null,null),t.config.languages),children:[]});for(let e of r){for(let r of Ht(t.config.store,e,vt,n))i.has(r.id)&&a.set(e.id,r.id);for(let r of Ht(t.config.store,e,yt,n))i.has(r.id)&&a.set(r.id,e.id);for(let r of Ht(t.config.store,e,gt,n))i.has(r.id)&&a.set(e.id,r.id)}for(let[e,t]of a.entries())i.get(t)?.children?.push(i.get(e));let o=[];for(let[e,t]of i.entries())a.has(e)||o.push(t);for(let r of Vt(t.config.store,gt,e,n))o.push(...Ut(r,t));return o}}function Wt(e){let t;try{t=new URL(e)}catch{return!1}return t.protocol===`http:`||t.protocol===`https:`}function Gt(e,t,n){if(t===void 0)return n;if(n===void 0)return t;let r=e.indexOf(t.language);if(r<0)return n;let i=e.indexOf(n.language);return i<0||i>r?t:n}function Kt(e,t){let n;for(let r of t)n=Gt(e,n,r);return n?n.value:``}var qt=/^(-?\d{4,}-\d{2}-\d{2})(Z|[+-]\d{2}:\d{2})?$/,Jt=/^(-?\d{4,}-\d{2}-\d{2})T(\d{2}:\d{2})(?::(\d{2})(\.\d+)?)?(Z|[+-]\d{2}:\d{2})?$/,Yt=/^(-?\d{4,}-\d{2}-\d{2}T\d{2}:\d{2})(?::(\d{2})(\.\d+)?)?$/;function Xt(e){let t=e.match(qt);if(!t){let t=e.match(Jt);return t?{value:t[1],suffix:t[5]||``}:void 0}return{value:t[1],suffix:t[2]||``}}function Zt(e){let t=e.match(Jt);if(!t){let t=e.match(qt);return t?{value:`${t[1]}T00:00:00`,suffix:t[2]||``}:void 0}return{value:`${t[1]}T${t[2]}:${t[3]||`00`}`,suffix:t[5]||``}}function Qt(e,t=``){let n=e.match(qt);return n?`${n[1]}${t}`:e}function $t(e,t=``){let n=e.match(Yt);return n?`${n[1]}:${n[2]||`00`}${n[3]||``}${t}`:e}function en(e){let t=new Set;for(let n of e.getObjects(null,Ct,dt))t.add(n.value);for(let n of e.getObjects(null,Et,dt))t.add(n.value);return t}function tn(e,t){return e instanceof Set?[...t].filter(t=>!e.has(t)):[...t].filter(t=>!e.includes(t))}function nn(e,{remove:t=!1,ignoreErrors:n=!1}={}){let r={},i=n?()=>!0:(e,t)=>{throw Error(`${e.value} ${t}`)},a=e.getQuads(null,st+`rest`,st+`nil`,null),o=t?[...a]:[];return a.forEach(n=>{let a=[],s=!1,c,l,u=n.graph,d=n.subject;for(;d&&!s;){let t=e.getQuads(null,null,d,null),n=e.getQuads(d,null,null,null).filter(e=>!e.predicate.equals(pt)),r,f=null,p=null,m=null;for(let e=0;e<n.length&&!s;e++)r=n[e],r.graph.equals(u)?c?s=i(d,`has non-list arcs out`):r.predicate.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#first`?f?s=i(d,`has multiple rdf:first arcs`):o.push(f=r):r.predicate.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#rest`?p?s=i(d,`has multiple rdf:rest arcs`):o.push(p=r):t.length?s=i(d,`can't be subject and object`):(c=r,l=`subject`):s=i(d,`not confined to single graph`);for(let e=0;e<t.length&&!s;++e)r=t[e],c?s=i(d,`can't have coreferences`):r.predicate.value===`http://www.w3.org/1999/02/22-rdf-syntax-ns#rest`?m?s=i(d,`has incoming rdf:rest arcs`):m=r:(c=r,l=`object`);f?a.unshift(f.object):s=i(d,`has no list head`),d=m&&m.subject}s?t=!1:c&&(r[c[l].value]=a)}),t&&e.removeQuads(o),r}var rn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.removeDotSegmentsOfPath=e.removeDotSegments=e.resolve=void 0;function t(e,t){t||=``;let i=t.indexOf(`#`);if(i>0&&(t=t.substr(0,i)),!e.length){if(t.indexOf(`:`)<0)throw Error(`Found invalid baseIRI '${t}' for value '${e}'`);return t}if(e.startsWith(`?`)){let n=t.indexOf(`?`);return n>0&&(t=t.substr(0,n)),t+e}if(e.startsWith(`#`))return t+e;if(!t.length){let t=e.indexOf(`:`);if(t<0)throw Error(`Found invalid relative IRI '${e}' for a missing baseIRI`);return r(e,t)}let a=e.indexOf(`:`);if(a>=0)return r(e,a);let o=t.indexOf(`:`);if(o<0)throw Error(`Found invalid baseIRI '${t}' for value '${e}'`);let s=t.substr(0,o+1);if(e.indexOf(`//`)===0)return s+r(e,a);let c;if(t.indexOf(`//`,o)===o+1){if(c=t.indexOf(`/`,o+3),c<0)return t.length>o+3?t+`/`+r(e,a):s+r(e,a)}else if(c=t.indexOf(`/`,o+1),c<0)return s+r(e,a);if(e.indexOf(`/`)===0)return t.substr(0,c)+n(e);let l=t.substr(c),u=l.lastIndexOf(`/`);return u>=0&&u<l.length-1&&(l=l.substr(0,u+1),e[0]===`.`&&e[1]!==`.`&&e[1]!==`/`&&e[2]&&(e=e.substr(1))),e=l+e,e=n(e),t.substr(0,c)+e}e.resolve=t;function n(e){let t=[],n=0;for(;n<e.length;)switch(e[n]){case`/`:if(e[n+1]===`.`)if(e[n+2]===`.`){if(!i(e[n+3])){t.push([]),n++;break}t.pop(),e[n+3]||t.push([]),n+=3}else{if(!i(e[n+2])){t.push([]),n++;break}e[n+2]||t.push([]),n+=2}else t.push([]),n++;break;case`#`:case`?`:t.length||t.push([]),t[t.length-1].push(e.substr(n)),n=e.length;break;default:t.length||t.push([]),t[t.length-1].push(e[n]),n++;break}return`/`+t.map(e=>e.join(``)).join(`/`)}e.removeDotSegments=n;function r(e,t){let r=t+1;t>=0?e[t+1]===`/`&&e[t+2]===`/`&&(r=t+3):e[0]===`/`&&e[1]===`/`&&(r=2);let i=e.indexOf(`/`,r);return i<0?e:e.substr(0,i)+n(e.substr(i))}e.removeDotSegmentsOfPath=r;function i(e){return!e||e===`#`||e===`?`||e===`/`}})),an=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(rn(),e)})),on=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CHAR=`
|
|
17
|
+
\r --�𐀀-`,e.S=` \r
|
|
18
|
+
`,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=i&&e<=55295||e===n||e===r||e===t||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e===i||e===n||e===r||e===t}e.isS=o;function s(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=s;function c(e){return s(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=c})),sn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CHAR=`--�𐀀-`,e.RESTRICTED_CHAR=`-\b\v\f---`,e.S=` \r
|
|
19
|
+
`,e.NAME_START_CHAR=`:A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ-⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NAME_CHAR=`-`+e.NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.CHAR_RE=RegExp(`^[`+e.CHAR+`]$`,`u`),e.RESTRICTED_CHAR_RE=RegExp(`^[`+e.RESTRICTED_CHAR+`]$`,`u`),e.S_RE=RegExp(`^[`+e.S+`]+$`,`u`),e.NAME_START_CHAR_RE=RegExp(`^[`+e.NAME_START_CHAR+`]$`,`u`),e.NAME_CHAR_RE=RegExp(`^[`+e.NAME_CHAR+`]$`,`u`),e.NAME_RE=RegExp(`^[`+e.NAME_START_CHAR+`][`+e.NAME_CHAR+`]*$`,`u`),e.NMTOKEN_RE=RegExp(`^[`+e.NAME_CHAR+`]+$`,`u`);var t=9,n=10,r=13,i=32;e.S_LIST=[i,n,r,t];function a(e){return e>=1&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isChar=a;function o(e){return e>=1&&e<=8||e===11||e===12||e>=14&&e<=31||e>=127&&e<=132||e>=134&&e<=159}e.isRestrictedChar=o;function s(e){return e===9||e===10||e===13||e>31&&e<127||e===133||e>159&&e<=55295||e>=57344&&e<=65533||e>=65536&&e<=1114111}e.isCharAndNotRestricted=s;function c(e){return e===i||e===n||e===r||e===t}e.isS=c;function l(e){return e>=65&&e<=90||e>=97&&e<=122||e===58||e===95||e===8204||e===8205||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNameStartChar=l;function u(e){return l(e)||e>=48&&e<=57||e===45||e===46||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNameChar=u})),cn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NC_NAME_START_CHAR=`A-Z_a-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�𐀀-`,e.NC_NAME_CHAR=`-`+e.NC_NAME_START_CHAR+`.0-9·̀-ͯ‿-⁀`,e.NC_NAME_START_CHAR_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`]$`,`u`),e.NC_NAME_CHAR_RE=RegExp(`^[`+e.NC_NAME_CHAR+`]$`,`u`),e.NC_NAME_RE=RegExp(`^[`+e.NC_NAME_START_CHAR+`][`+e.NC_NAME_CHAR+`]*$`,`u`);function t(e){return e>=65&&e<=90||e===95||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}e.isNCNameStartChar=t;function n(e){return t(e)||e===45||e===46||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}e.isNCNameChar=n})),ln=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SaxesParser=e.EVENTS=void 0;var t=on(),n=sn(),r=cn(),i=t.isS,a=t.isChar,o=t.isNameStartChar,s=t.isNameChar,c=t.S_LIST,l=t.NAME_RE,u=n.isChar,d=r.isNCNameStartChar,f=r.isNCNameChar,p=r.NC_NAME_RE,m=`http://www.w3.org/XML/1998/namespace`,h=`http://www.w3.org/2000/xmlns/`,g={__proto__:null,xml:m,xmlns:h},_={__proto__:null,amp:`&`,gt:`>`,lt:`<`,quot:`"`,apos:`'`},v=-1,y=-2,b=0,x=1,S=2,C=3,w=4,T=5,E=6,D=7,O=8,k=9,A=10,j=11,M=12,N=13,P=14,F=15,I=16,L=17,R=18,z=19,B=20,ee=21,V=22,te=23,H=24,ne=25,re=26,ie=27,ae=28,oe=29,se=30,ce=31,le=32,ue=33,de=34,fe=35,pe=36,me=37,he=38,U=39,ge=40,W=41,_e=42,ve=43,ye=44,be=9,xe=10,Se=13,G=32,Ce=33,we=34,Te=38,Ee=39,De=45,Oe=47,ke=59,K=60,Ae=61,q=62,J=63,je=91,Me=93,Ne=133,Pe=8232,Fe=e=>e===we||e===Ee,Ie=[we,Ee],Le=[...Ie,je,q],Re=[...Ie,K,Me],ze=[Ae,J,...c],Be=[...c,q,Te,K];function Ve(e,t,n){switch(t){case`xml`:n!==m&&e.fail(`xml prefix must be bound to ${m}.`);break;case`xmlns`:n!==h&&e.fail(`xmlns prefix must be bound to ${h}.`);break;default:}switch(n){case h:e.fail(t===``?`the default namespace may not be set to ${n}.`:`may not assign a prefix (even "xmlns") to the URI \
|
|
20
|
+
${h}.`);break;case m:switch(t){case`xml`:break;case``:e.fail(`the default namespace may not be set to ${n}.`);break;default:e.fail(`may not assign the xml namespace to another prefix.`)}break;default:}}function He(e,t){for(let n of Object.keys(t))Ve(e,n,t[n])}var Ue=e=>p.test(e),We=e=>l.test(e),Ge=0,Ke=1,qe=2;e.EVENTS=[`xmldecl`,`text`,`processinginstruction`,`doctype`,`comment`,`opentagstart`,`attribute`,`opentag`,`closetag`,`cdata`,`error`,`end`,`ready`];var Je={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`};e.SaxesParser=class{get closed(){return this._closed}constructor(e){this.opt=e??{},this.fragmentOpt=!!this.opt.fragment;let t=this.xmlnsOpt=!!this.opt.xmlns;if(this.trackPosition=this.opt.position!==!1,this.fileName=this.opt.fileName,t){this.nameStartCheck=d,this.nameCheck=f,this.isName=Ue,this.processAttribs=this.processAttribsNS,this.pushAttrib=this.pushAttribNS,this.ns=Object.assign({__proto__:null},g);let e=this.opt.additionalNamespaces;e!=null&&(He(this,e),Object.assign(this.ns,e))}else this.nameStartCheck=o,this.nameCheck=s,this.isName=We,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 e;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=Ge,this.attribList=[];let{fragmentOpt:t}=this;this.state=t?N:b,this.reportedTextBeforeRoot=this.reportedTextAfterRoot=this.closedRoot=this.sawRoot=t,this.xmlDeclPossible=!t,this.xmlDeclExpects=[`version`],this.entityReturnState=void 0;let{defaultXMLVersion:n}=this.opt;if(n===void 0){if(this.opt.forceXMLVersion===!0)throw Error(`forceXMLVersion set but defaultXMLVersion is not set`);n=`1.0`}this.setXMLVersion(n),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(_),(e=this.readyHandler)==null||e.call(this)}get position(){return this.chunkPosition+this.i}get columnIndex(){return this.position-this.positionAtNewLine}on(e,t){this[Je[e]]=t}off(e){this[Je[e]]=void 0}makeError(e){let t=this.fileName??``;return this.trackPosition&&(t.length>0&&(t+=`:`),t+=`${this.line}:${this.column}`),t.length>0&&(t+=`: `),Error(t+e)}fail(e){let t=this.makeError(e),n=this.errorHandler;if(n===void 0)throw t;return n(t),this}write(e){if(this.closed)return this.fail(`cannot write after close; assign an onready handler.`);let t=!1;e===null?(t=!0,e=``):typeof e==`object`&&(e=e.toString()),this.carriedFromPrevious!==void 0&&(e=`${this.carriedFromPrevious}${e}`,this.carriedFromPrevious=void 0);let n=e.length,r=e.charCodeAt(n-1);!t&&(r===Se||r>=55296&&r<=56319)&&(this.carriedFromPrevious=e[n-1],n--,e=e.slice(0,n));let{stateTable:i}=this;for(this.chunk=e,this.i=0;this.i<n;)i[this.state].call(this);return this.chunkPosition+=n,t?this.end():this}close(){return this.write(null)}getCode10(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return v;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>=G||n===be)return n;switch(n){case xe:return this.line++,this.column=0,this.positionAtNewLine=this.position,xe;case Se:return e.charCodeAt(t+1)===xe&&(this.i=t+2),this.line++,this.column=0,this.positionAtNewLine=this.position,y;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCode11(){let{chunk:e,i:t}=this;if(this.prevI=t,this.i=t+1,t>=e.length)return v;let n=e.charCodeAt(t);if(this.column++,n<55296){if(n>31&&n<127||n>159&&n!==Pe||n===be)return n;switch(n){case xe:return this.line++,this.column=0,this.positionAtNewLine=this.position,xe;case Se:{let n=e.charCodeAt(t+1);(n===xe||n===Ne)&&(this.i=t+2)}case Ne:case Pe:return this.line++,this.column=0,this.positionAtNewLine=this.position,y;default:return this.fail(`disallowed character.`),n}}if(n>56319)return n>=57344&&n<=65533||this.fail(`disallowed character.`),n;let r=65536+(n-55296)*1024+(e.charCodeAt(t+1)-56320);return this.i=t+2,r>1114111&&this.fail(`disallowed character.`),r}getCodeNorm(){let e=this.getCode();return e===y?xe:e}unget(){this.i=this.prevI,this.column--}captureTo(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode(),i=r===y,a=i?xe:r;if(a===v||e.includes(a))return this.text+=n.slice(t,this.prevI),a;i&&(this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i)}}captureToChar(e){let{i:t}=this,{chunk:n}=this;for(;;){let r=this.getCode();switch(r){case y:this.text+=`${n.slice(t,this.prevI)}\n`,t=this.i,r=xe;break;case v:return this.text+=n.slice(t),!1;default:}if(r===e)return this.text+=n.slice(t,this.prevI),!0}}captureNameChars(){let{chunk:e,i:t}=this;for(;;){let n=this.getCode();if(n===v)return this.name+=e.slice(t),v;if(!s(n))return this.name+=e.slice(t,this.prevI),n===y?xe:n}}skipSpaces(){for(;;){let e=this.getCodeNorm();if(e===v||!i(e))return e}}setXMLVersion(e){this.currentXMLVersion=e,e===`1.0`?(this.isChar=a,this.getCode=this.getCode10):(this.isChar=u,this.getCode=this.getCode11)}sBegin(){this.chunk.charCodeAt(0)===65279&&(this.i++,this.column++),this.state=x}sBeginWhitespace(){let e=this.i,t=this.skipSpaces();switch(this.prevI!==e&&(this.xmlDeclPossible=!1),t){case K:if(this.state=F,this.text.length!==0)throw Error(`no-empty text at start`);break;case v:break;default:this.unget(),this.state=N,this.xmlDeclPossible=!1}}sDoctype(){var e;let t=this.captureTo(Le);switch(t){case q:(e=this.doctypeHandler)==null||e.call(this,this.text),this.text=``,this.state=N,this.doctype=!0;break;case v:break;default:this.text+=String.fromCodePoint(t),t===je?this.state=w:Fe(t)&&(this.state=C,this.q=t)}}sDoctypeQuote(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.q=null,this.state=S)}sDTD(){let e=this.captureTo(Re);e!==v&&(this.text+=String.fromCodePoint(e),e===Me?this.state=S:e===K?this.state=E:Fe(e)&&(this.state=T,this.q=e))}sDTDQuoted(){let e=this.q;this.captureToChar(e)&&(this.text+=String.fromCodePoint(e),this.state=w,this.q=null)}sDTDOpenWaka(){let e=this.getCodeNorm();switch(this.text+=String.fromCodePoint(e),e){case Ce:this.state=D,this.openWakaBang=``;break;case J:this.state=j;break;default:this.state=w}}sDTDOpenWakaBang(){let e=String.fromCodePoint(this.getCodeNorm()),t=this.openWakaBang+=e;this.text+=e,t!==`-`&&(this.state=t===`--`?O:w,this.openWakaBang=``)}sDTDComment(){this.captureToChar(De)&&(this.text+=`-`,this.state=k)}sDTDCommentEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),this.state=e===De?A:O}sDTDCommentEnded(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===q?this.state=w:(this.fail(`malformed comment.`),this.state=O)}sDTDPI(){this.captureToChar(J)&&(this.text+=`?`,this.state=M)}sDTDPIEnding(){let e=this.getCodeNorm();this.text+=String.fromCodePoint(e),e===q&&(this.state=w)}sText(){this.tags.length===0?this.handleTextOutsideRoot():this.handleTextInRoot()}sEntity(){let{i:e}=this,{chunk:t}=this;loop:for(;;)switch(this.getCode()){case y:this.entity+=`${t.slice(e,this.prevI)}\n`,e=this.i;break;case ke:{let{entityReturnState:n}=this,r=this.entity+t.slice(e,this.prevI);this.state=n;let i;r===``?(this.fail(`empty entity name.`),i=`&;`):(i=this.parseEntity(r),this.entity=``),(n!==N||this.textHandler!==void 0)&&(this.text+=i);break loop}case v:this.entity+=t.slice(e);break loop;default:}}sOpenWaka(){let e=this.getCode();if(o(e))this.state=de,this.unget(),this.xmlDeclPossible=!1;else switch(e){case Oe:this.state=ve,this.xmlDeclPossible=!1;break;case Ce:this.state=I,this.openWakaBang=``,this.xmlDeclPossible=!1;break;case J:this.state=te;break;default:this.fail(`disallowed character in tag name`),this.state=N,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=B,this.openWakaBang=``;break;case`--`:this.state=L,this.openWakaBang=``;break;case`DOCTYPE`:this.state=S,(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(De)&&(this.state=R)}sCommentEnding(){var e;let t=this.getCodeNorm();t===De?(this.state=z,(e=this.commentHandler)==null||e.call(this,this.text),this.text=``):(this.text+=`-${String.fromCodePoint(t)}`,this.state=L)}sCommentEnded(){let e=this.getCodeNorm();e===q?this.state=N:(this.fail(`malformed comment.`),this.text+=`--${String.fromCodePoint(e)}`,this.state=L)}sCData(){this.captureToChar(Me)&&(this.state=ee)}sCDataEnding(){let e=this.getCodeNorm();e===Me?this.state=V:(this.text+=`]${String.fromCodePoint(e)}`,this.state=B)}sCDataEnding2(){var e;let t=this.getCodeNorm();switch(t){case q:(e=this.cdataHandler)==null||e.call(this,this.text),this.text=``,this.state=N;break;case Me:this.text+=`]`;break;default:this.text+=`]]${String.fromCodePoint(t)}`,this.state=B}}sPIFirstChar(){let e=this.getCodeNorm();this.nameStartCheck(e)?(this.piTarget+=String.fromCodePoint(e),this.state=H):e===J||i(e)?(this.fail(`processing instruction without a target.`),this.state=e===J?re:ne):(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(e),this.state=H)}sPIRest(){let{chunk:e,i:t}=this;for(;;){let n=this.getCodeNorm();if(n===v){this.piTarget+=e.slice(t);return}if(!this.nameCheck(n)){this.piTarget+=e.slice(t,this.prevI);let r=n===J;r||i(n)?this.piTarget===`xml`?(this.xmlDeclPossible||this.fail(`an XML declaration must be at the start of the document.`),this.state=r?ue:ie):this.state=r?re:ne:(this.fail(`disallowed character in processing instruction name.`),this.piTarget+=String.fromCodePoint(n));break}}}sPIBody(){if(this.text.length===0){let e=this.getCodeNorm();e===J?this.state=re:i(e)||(this.text=String.fromCodePoint(e))}else this.captureToChar(J)&&(this.state=re)}sPIEnding(){var e;let t=this.getCodeNorm();if(t===q){let{piTarget:t}=this;t.toLowerCase()===`xml`&&this.fail(`the XML declaration must appear at the start of the document.`),(e=this.piHandler)==null||e.call(this,{target:t,body:this.text}),this.piTarget=this.text=``,this.state=N}else t===J?this.text+=`?`:(this.text+=`?${String.fromCodePoint(t)}`,this.state=ne);this.xmlDeclPossible=!1}sXMLDeclNameStart(){let e=this.skipSpaces();if(e===J){this.state=ue;return}e!==v&&(this.state=ae,this.name=String.fromCodePoint(e))}sXMLDeclName(){let e=this.captureTo(ze);if(e===J){this.state=ue,this.name+=this.text,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(i(e)||e===Ae){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=e===Ae?se:oe}}sXMLDeclEq(){let e=this.getCodeNorm();if(e===J){this.state=ue,this.fail(`XML declaration is incomplete.`);return}i(e)||(e!==Ae&&this.fail(`value required.`),this.state=se)}sXMLDeclValueStart(){let e=this.getCodeNorm();if(e===J){this.state=ue,this.fail(`XML declaration is incomplete.`);return}i(e)||(Fe(e)?this.q=e:(this.fail(`value must be quoted.`),this.q=G),this.state=ce)}sXMLDeclValue(){let e=this.captureTo([this.q,J]);if(e===J){this.state=ue,this.text=``,this.fail(`XML declaration is incomplete.`);return}if(e===v)return;let t=this.text;switch(this.text=``,this.name){case`version`:{this.xmlDeclExpects=[`encoding`,`standalone`];let e=t;this.xmlDecl.version=e,/^1\.[0-9]+$/.test(e)?this.opt.forceXMLVersion||this.setXMLVersion(e):this.fail(`version number must match /^1\\.[0-9]+$/.`);break}case`encoding`:/^[A-Za-z][A-Za-z0-9._-]*$/.test(t)||this.fail(`encoding value must match /^[A-Za-z0-9][A-Za-z0-9._-]*$/.`),this.xmlDeclExpects=[`standalone`],this.xmlDecl.encoding=t;break;case`standalone`:t!==`yes`&&t!==`no`&&this.fail(`standalone value must match "yes" or "no".`),this.xmlDeclExpects=[],this.xmlDecl.standalone=t;break;default:}this.name=``,this.state=le}sXMLDeclSeparator(){let e=this.getCodeNorm();if(e===J){this.state=ue;return}i(e)||(this.fail(`whitespace required.`),this.unget()),this.state=ie}sXMLDeclEnding(){var e;this.getCodeNorm()===q?(this.piTarget===`xml`?this.name!==`version`&&this.xmlDeclExpects.includes(`version`)&&this.fail(`XML declaration must contain a version.`):this.fail(`processing instructions are not allowed before root.`),(e=this.xmldeclHandler)==null||e.call(this,this.xmlDecl),this.name=``,this.piTarget=this.text=``,this.state=N):this.fail(`The character ? is disallowed anywhere in XML declarations.`),this.xmlDeclPossible=!1}sOpenTag(){var e;let t=this.captureNameChars();if(t===v)return;let n=this.tag={name:this.name,attributes:Object.create(null)};switch(this.name=``,this.xmlnsOpt&&(this.topNS=n.ns=Object.create(null)),(e=this.openTagStartHandler)==null||e.call(this,n),this.sawRoot=!0,!this.fragmentOpt&&this.closedRoot&&this.fail(`documents may contain only one root.`),t){case q:this.openTag();break;case Oe:this.state=fe;break;default:i(t)||this.fail(`disallowed character in tag name.`),this.state=pe}}sOpenTagSlash(){this.getCode()===q?this.openSelfClosingTag():(this.fail(`forward-slash in opening tag not followed by >.`),this.state=pe)}sAttrib(){let e=this.skipSpaces();e!==v&&(o(e)?(this.unget(),this.state=me):e===q?this.openTag():e===Oe?this.state=fe:this.fail(`disallowed character in attribute name.`))}sAttribName(){let e=this.captureNameChars();e===Ae?this.state=U:i(e)?this.state=he:e===q?(this.fail(`attribute without value.`),this.pushAttrib(this.name,this.name),this.name=this.text=``,this.openTag()):e!==v&&this.fail(`disallowed character in attribute name.`)}sAttribNameSawWhite(){let e=this.skipSpaces();switch(e){case v:return;case Ae:this.state=U;break;default:this.fail(`attribute without value.`),this.text=``,this.name=``,e===q?this.openTag():o(e)?(this.unget(),this.state=me):(this.fail(`disallowed character in attribute name.`),this.state=pe)}}sAttribValue(){let e=this.getCodeNorm();Fe(e)?(this.q=e,this.state=ge):i(e)||(this.fail(`unquoted attribute value.`),this.state=_e,this.unget())}sAttribValueQuoted(){let{q:e,chunk:t}=this,{i:n}=this;for(;;)switch(this.getCode()){case e:this.pushAttrib(this.name,this.text+t.slice(n,this.prevI)),this.name=this.text=``,this.q=null,this.state=W;return;case Te:this.text+=t.slice(n,this.prevI),this.state=P,this.entityReturnState=ge;return;case xe:case y:case be:this.text+=`${t.slice(n,this.prevI)} `,n=this.i;break;case K:this.text+=t.slice(n,this.prevI),this.fail(`disallowed character.`);return;case v:this.text+=t.slice(n);return;default:}}sAttribValueClosed(){let e=this.getCodeNorm();i(e)?this.state=pe:e===q?this.openTag():e===Oe?this.state=fe:o(e)?(this.fail(`no whitespace between attributes.`),this.unget(),this.state=me):this.fail(`disallowed character in attribute name.`)}sAttribValueUnquoted(){let e=this.captureTo(Be);switch(e){case Te:this.state=P,this.entityReturnState=_e;break;case K:this.fail(`disallowed character.`);break;case v:break;default:this.text.includes(`]]>`)&&this.fail(`the string "]]>" is disallowed in char data.`),this.pushAttrib(this.name,this.text),this.name=this.text=``,e===q?this.openTag():this.state=pe}}sCloseTag(){let e=this.captureNameChars();e===q?this.closeTag():i(e)?this.state=ye:e!==v&&this.fail(`disallowed character in closing tag.`)}sCloseTagSawWhite(){switch(this.skipSpaces()){case q:this.closeTag();break;case v:break;default:this.fail(`disallowed character in closing tag.`)}}handleTextInRoot(){let{i:e,forbiddenState:t}=this,{chunk:n,textHandler:r}=this;scanLoop:for(;;)switch(this.getCode()){case K:if(this.state=F,r!==void 0){let{text:t}=this,i=n.slice(e,this.prevI);t.length===0?i.length!==0&&r(i):(r(t+i),this.text=``)}t=Ge;break scanLoop;case Te:this.state=P,this.entityReturnState=N,r!==void 0&&(this.text+=n.slice(e,this.prevI)),t=Ge;break scanLoop;case Me:switch(t){case Ge:t=Ke;break;case Ke:t=qe;break;case qe:break;default:throw Error(`impossible state`)}break;case q:t===qe&&this.fail(`the string "]]>" is disallowed in char data.`),t=Ge;break;case y:r!==void 0&&(this.text+=`${n.slice(e,this.prevI)}\n`),e=this.i,t=Ge;break;case v:r!==void 0&&(this.text+=n.slice(e));break scanLoop;default:t=Ge}this.forbiddenState=t}handleTextOutsideRoot(){let{i:e}=this,{chunk:t,textHandler:n}=this,r=!1;outRootLoop:for(;;){let a=this.getCode();switch(a){case K:if(this.state=F,n!==void 0){let{text:r}=this,i=t.slice(e,this.prevI);r.length===0?i.length!==0&&n(i):(n(r+i),this.text=``)}break outRootLoop;case Te:this.state=P,this.entityReturnState=N,n!==void 0&&(this.text+=t.slice(e,this.prevI)),r=!0;break outRootLoop;case y:n!==void 0&&(this.text+=`${t.slice(e,this.prevI)}\n`),e=this.i;break;case v:n!==void 0&&(this.text+=t.slice(e));break outRootLoop;default:i(a)||(r=!0)}}r&&(!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(e,t){var n;let{prefix:r,local:i}=this.qname(e),a={name:e,prefix:r,local:i,value:t};if(this.attribList.push(a),(n=this.attributeHandler)==null||n.call(this,a),r===`xmlns`){let e=t.trim();this.currentXMLVersion===`1.0`&&e===``&&this.fail(`invalid attempt to undefine prefix in XML 1.0`),this.topNS[i]=e,Ve(this,i,e)}else if(e===`xmlns`){let e=t.trim();this.topNS[``]=e,Ve(this,``,e)}}pushAttribPlain(e,t){var n;let r={name:e,value:t};this.attribList.push(r),(n=this.attributeHandler)==null||n.call(this,r)}end(){var e,t;this.sawRoot||this.fail(`document must contain a root element.`);let{tags:n}=this;for(;n.length>0;){let e=n.pop();this.fail(`unclosed tag: ${e.name}`)}this.state!==b&&this.state!==N&&this.fail(`unexpected end.`);let{text:r}=this;return r.length!==0&&((e=this.textHandler)==null||e.call(this,r),this.text=``),this._closed=!0,(t=this.endHandler)==null||t.call(this),this._init(),this}resolve(e){var t;let n=this.topNS[e];if(n!==void 0)return n;let{tags:r}=this;for(let t=r.length-1;t>=0;t--)if(n=r[t].ns[e],n!==void 0)return n;return n=this.ns[e],n===void 0?(t=this.opt).resolvePrefix?.call(t,e):n}qname(e){let t=e.indexOf(`:`);if(t===-1)return{prefix:``,local:e};let n=e.slice(t+1),r=e.slice(0,t);return(r===``||n===``||n.includes(`:`))&&this.fail(`malformed name: ${e}.`),{prefix:r,local:n}}processAttribsNS(){let{attribList:e}=this,t=this.tag;{let{prefix:e,local:n}=this.qname(t.name);t.prefix=e,t.local=n;let r=t.uri=this.resolve(e)??``;e!==``&&(e===`xmlns`&&this.fail(`tags may not have "xmlns" as prefix.`),r===``&&(this.fail(`unbound namespace prefix: ${JSON.stringify(e)}.`),t.uri=e))}if(e.length===0)return;let{attributes:n}=t,r=new Set;for(let t of e){let{name:e,prefix:i,local:a}=t,o,s;i===``?(o=e===`xmlns`?h:``,s=e):(o=this.resolve(i),o===void 0&&(this.fail(`unbound namespace prefix: ${JSON.stringify(i)}.`),o=i),s=`{${o}}${a}`),r.has(s)&&this.fail(`duplicate attribute: ${s}.`),r.add(s),t.uri=o,n[e]=t}this.attribList=[]}processAttribsPlain(){let{attribList:e}=this,t=this.tag.attributes;for(let{name:n,value:r}of e)t[n]!==void 0&&this.fail(`duplicate attribute: ${n}.`),t[n]=r;this.attribList=[]}openTag(){var e;this.processAttribs();let{tags:t}=this,n=this.tag;n.isSelfClosing=!1,(e=this.openTagHandler)==null||e.call(this,n),t.push(n),this.state=N,this.name=``}openSelfClosingTag(){var e,t;this.processAttribs();let{tags:n}=this,r=this.tag;r.isSelfClosing=!0,(e=this.openTagHandler)==null||e.call(this,r),(t=this.closeTagHandler)==null||t.call(this,r),(this.tag=n[n.length-1]??null)===null&&(this.closedRoot=!0),this.state=N,this.name=``}closeTag(){let{tags:e,name:t}=this;if(this.state=N,this.name=``,t===``){this.fail(`weird empty close tag.`),this.text+=`</>`;return}let n=this.closeTagHandler,r=e.length;for(;r-->0;){let r=this.tag=e.pop();if(this.topNS=r.ns,n?.(r),r.name===t)break;this.fail(`unexpected close tag.`)}r===0?this.closedRoot=!0:r<0&&(this.fail(`unmatched closing tag: ${t}.`),this.text+=`</${t}>`)}parseEntity(e){if(e[0]!==`#`){let t=this.ENTITIES[e];return t===void 0?(this.fail(this.isName(e)?`undefined entity.`:`disallowed character in entity name.`),`&${e};`):t}let t=NaN;return e[1]===`x`&&/^#x[0-9a-f]+$/i.test(e)?t=parseInt(e.slice(2),16):/^#[0-9]+$/.test(e)&&(t=parseInt(e.slice(1),10)),this.isChar(t)?String.fromCodePoint(t):(this.fail(`malformed character entity.`),`&${e};`)}}})),un=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ParseError=void 0,e.ParseError=class extends Error{constructor(e,t){let n=e.saxParser;super(e.trackPosition?`Line ${n.line} column ${n.column+1}: ${t}`:t)}}})),dn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.BlankNode=void 0,e.BlankNode=class{constructor(e){this.termType=`BlankNode`,this.value=e}equals(e){return!!e&&e.termType===`BlankNode`&&e.value===this.value}}})),fn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DefaultGraph=void 0;var t=class{constructor(){this.termType=`DefaultGraph`,this.value=``}equals(e){return!!e&&e.termType===`DefaultGraph`}};e.DefaultGraph=t,t.INSTANCE=new t})),pn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.NamedNode=void 0,e.NamedNode=class{constructor(e){this.termType=`NamedNode`,this.value=e}equals(e){return!!e&&e.termType===`NamedNode`&&e.value===this.value}}})),mn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Literal=void 0;var t=pn(),n=class e{constructor(t,n){this.termType=`Literal`,this.value=t,typeof n==`string`?(this.language=n,this.datatype=e.RDF_LANGUAGE_STRING,this.direction=``):n?`termType`in n?(this.language=``,this.datatype=n,this.direction=``):(this.language=n.language,this.datatype=n.direction?e.RDF_DIRECTIONAL_LANGUAGE_STRING:e.RDF_LANGUAGE_STRING,this.direction=n.direction||``):(this.language=``,this.datatype=e.XSD_STRING,this.direction=``)}equals(e){return!!e&&e.termType===`Literal`&&e.value===this.value&&e.language===this.language&&(e.direction===this.direction||!e.direction&&this.direction===``)&&this.datatype.equals(e.datatype)}};e.Literal=n,n.RDF_LANGUAGE_STRING=new t.NamedNode(`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`),n.RDF_DIRECTIONAL_LANGUAGE_STRING=new t.NamedNode(`http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString`),n.XSD_STRING=new t.NamedNode(`http://www.w3.org/2001/XMLSchema#string`)})),hn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Quad=void 0,e.Quad=class{constructor(e,t,n,r){this.termType=`Quad`,this.value=``,this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&(e.termType===`Quad`||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}})),gn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.Variable=void 0,e.Variable=class{constructor(e){this.termType=`Variable`,this.value=e}equals(e){return!!e&&e.termType===`Variable`&&e.value===this.value}}})),_n=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DataFactory=void 0;var t=dn(),n=fn(),r=mn(),i=pn(),a=hn(),o=gn(),s=0;e.DataFactory=class{constructor(e){this.blankNodeCounter=0,e||={},this.blankNodePrefix=e.blankNodePrefix||`df_${s++}_`}namedNode(e){return new i.NamedNode(e)}blankNode(e){return new t.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new r.Literal(e,t)}variable(e){return new o.Variable(e)}defaultGraph(){return n.DefaultGraph.INSTANCE}quad(e,t,n,r){return new a.Quad(e,t,n,r||this.defaultGraph())}fromTerm(e){switch(e.termType){case`NamedNode`:return this.namedNode(e.value);case`BlankNode`:return this.blankNode(e.value);case`Literal`:return e.language?this.literal(e.value,e.language):e.datatype.equals(r.Literal.XSD_STRING)?this.literal(e.value):this.literal(e.value,this.fromTerm(e.datatype));case`Variable`:return this.variable(e.value);case`DefaultGraph`:return this.defaultGraph();case`Quad`:return this.quad(this.fromTerm(e.subject),this.fromTerm(e.predicate),this.fromTerm(e.object),this.fromTerm(e.graph))}}fromQuad(e){return this.fromTerm(e)}resetBlankNodeCounter(){this.blankNodeCounter=0}}})),vn=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(dn(),e),n(_n(),e),n(fn(),e),n(mn(),e),n(pn(),e),n(hn(),e),n(gn(),e)})),yn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateIri=e.IriValidationStrategy=void 0;function t(){let e=`[!$&'()*+,;=]`,t=`%[a-fA-F0-9]{2}`,n=`([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])`,r=`${n}\\.${n}\\.${n}\\.${n}`,i=`[a-fA-F0-9]{1,4}`,a=`(${i}:${i}|${r})`,o=`\\[(${`((${i}:){6}${a}|::(${i}:){5}${a}|(${i})?::(${i}:){4}${a}|((${i}:){0,1}${i})?::(${i}:){3}${a}|((${i}:){0,2}${i})?::(${i}:){2}${a}|((${i}:){0,3}${i})?::${i}:${a}|((${i}:){0,4}${i})?::${a}|((${i}:){0,5}${i})?::${i}|((${i}:){0,6}${i})?::)`}|${`v[a-fA-F0-9]+\\.(${e}|${e}|":)+`})\\]`,s=`[a-zA-Z0-9\\-._~\xA0-豈-﷏ﷰ-𐀀-𠀀-𰀀------------]`,c=`(${s}|${t}|${e}|[:@])*`,l=`(${c}|[\\/?])*`,u=`(${c}|[---]|[\\/?])*`,d=`(${c})+`,f=`(${c})*`,p=`${d}(\\/${f})*`,m=`\\/(${d}(\\/${f})*)?`,h=`(\\/${f})*`,g=`(${o}|${r}|${`(${s}|${t}|${e})*`})`,_=`^[a-zA-Z][a-zA-Z0-9+\\-.]*:${`(\\/\\/${`(${`(${s}|${t}|${e}|:)*`}@)?${g}(:[0-9]*)?`}${h}|${m}|${p}|)`}(\\?${u})?(#${l})?$`;return new RegExp(_,`u`)}var n=t(),r=/^[A-Za-z][\d+-.A-Za-z]*:[^\u0000-\u0020"<>\\^`{|}]*$/u,i;(function(e){e.Strict=`strict`,e.Pragmatic=`pragmatic`,e.None=`none`})(i=e.IriValidationStrategy||={});function a(e,t=i.Strict){switch(t){case i.Strict:return n.test(e)?void 0:Error(`Invalid IRI according to RFC 3987: '${e}'`);case i.Pragmatic:return r.test(e)?void 0:Error(`Invalid IRI according to RDF Turtle: '${e}'`);case i.None:return;default:return Error(`Not supported validation strategy "${t}"`)}}e.validateIri=a})),bn=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(yn(),e)})),xn=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ParseType=e.RdfXmlParser=void 0;var t=an(),n=ln(),r=Je(),i=un(),a=vn(),o=bn(),s=class e extends r.Transform{constructor(e){super({readableObjectMode:!0}),this.activeTagStack=[],this.nodeIds={},e&&(Object.assign(this,e),this.options=e),this.dataFactory||=new a.DataFactory,this.baseIRI||=``,this.defaultGraph||=this.dataFactory.defaultGraph(),this.validateUri!==!1&&(this.validateUri=!0),this.iriValidationStrategy||=this.validateUri?o.IriValidationStrategy.Pragmatic:o.IriValidationStrategy.None,this.parseUnsupportedVersions=!!e?.parseUnsupportedVersions,this.version=e?.version,this.saxParser=new n.SaxesParser({xmlns:!0,position:this.trackPosition}),this.attachSaxListeners()}import(t){let n=new r.PassThrough({readableObjectMode:!0});t.on(`error`,e=>i.emit(`error`,e)),t.on(`data`,e=>n.push(e)),t.on(`end`,()=>n.push(null));let i=n.pipe(new e(this.options));return i}_transform(e,t,n){if(this.version){let e=this.version;if(this.version=void 0,!this.isValidVersion(e))return n(this.newParseError(`Detected unsupported version as media type parameter: ${e}`))}try{this.saxParser.write(e)}catch(e){return n(e)}n()}newParseError(e){return new i.ParseError(this,e)}valueToUri(e,n){return this.uriToNamedNode((0,t.resolve)(e,n.baseIRI))}uriToNamedNode(e){let t=(0,o.validateIri)(e,this.iriValidationStrategy);if(t instanceof Error)throw this.newParseError(t.message);return this.dataFactory.namedNode(e)}validateNcname(t){if(!e.NCNAME_MATCHER.test(t))throw this.newParseError(`Not a valid NCName: ${t}`)}createLiteral(e,t){return this.dataFactory.literal(e,t.datatype?t.datatype:t.language?{language:t.language,direction:t.rdfVersion?t.direction:void 0}:void 0)}isValidVersion(t){return this.parseUnsupportedVersions||e.SUPPORTED_VERSIONS.includes(t)}attachSaxListeners(){this.saxParser.on(`error`,e=>this.emit(`error`,e)),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(e){let t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null,n=c.RESOURCE;if(t&&(t.hadChildren=!0,n=t.childrenParseType),t&&t.childrenStringTags){let n=e.name,r=``;for(let{key:e,value:n}of t.namespaces||[])r+=` ${e}="${n}"`;for(let t in e.attributes)r+=` ${t}="${e.attributes[t].value}"`;let i=`<${`${n}${r}`}>`;t.childrenStringTags.push(i);let a={childrenStringTags:t.childrenStringTags};a.childrenStringEmitClosingTag=`</${n}>`,this.activeTagStack.push(a);return}let r={};t?(r.language=t.language,r.direction=t.direction,r.baseIRI=t.baseIRI,r.childrenTripleTerms=t.childrenTripleTerms,r.rdfVersion=t.rdfVersion):r.baseIRI=this.baseIRI,this.activeTagStack.push(r),n===c.RESOURCE?this.onTagResource(e,r,t,!t):this.onTagProperty(e,r,t);for(let t in e.attributes){let n=e.attributes[t];n.prefix===`xmlns`&&(r.namespaces||=[],r.namespaces.push({key:`${n.prefix}:${n.local}`,value:n.value}))}t&&t.namespaces&&(r.namespaces=[...r.namespaces||[],...t.namespaces])}onTagResource(n,r,i,a){r.childrenParseType=c.PROPERTY;let o=!0;if(n.uri===e.RDF){if(!a&&e.FORBIDDEN_NODE_ELEMENTS.indexOf(n.local)>=0)throw this.newParseError(`Illegal node element name: ${n.local}`);switch(n.local){case`RDF`:r.childrenParseType=c.RESOURCE;case`Description`:o=!1}}let s=[],l=[],u=null,d=!1,f=!1,p=null;for(let a in n.attributes){let o=n.attributes[a];if(o.uri===e.RDF&&o.local===`version`){this.setVersion(r,o.value);continue}else if(i&&o.uri===e.RDF)switch(o.local){case`about`:if(u)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \
|
|
21
|
+
while ${o.value} and ${u} where found.`);u=o.value;continue;case`ID`:if(u)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \
|
|
22
|
+
while ${o.value} and ${u} where found.`);this.validateNcname(o.value),u=`#`+o.value,d=!0;continue;case`nodeID`:if(u)throw this.newParseError(`Only one of rdf:about, rdf:nodeID and rdf:ID can be present, \
|
|
23
|
+
while ${o.value} and ${u} where found.`);this.validateNcname(o.value),u=o.value,f=!0;continue;case`bagID`:throw this.newParseError(`rdf:bagID is not supported.`);case`type`:p=o.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(o.uri===e.XML){if(o.local===`lang`){r.language=o.value===``?null:o.value.toLowerCase();continue}else if(o.local===`base`){r.baseIRI=(0,t.resolve)(o.value,r.baseIRI);continue}}else if(o.uri===e.ITS&&o.local===`dir`){this.setDirection(r,o.value);continue}o.prefix!==`xml`&&o.prefix!==`xmlns`&&(o.prefix!==``||o.local!==`xmlns`)&&o.uri&&(s.push(this.uriToNamedNode(o.uri+o.local)),l.push(o.value))}if(u!==null&&(r.subject=f?this.dataFactory.blankNode(u):this.valueToUri(u,r),d&&this.claimNodeId(r.subject)),r.subject||=this.dataFactory.blankNode(),o){let t=this.uriToNamedNode(n.uri+n.local);this.emitTriple(r.subject,this.dataFactory.namedNode(e.RDF+`type`),t,i?i.reifiedStatementId:null,r.childrenTripleTerms,r.reifier)}if(i){if(i.predicate)if(i.childrenCollectionSubject){let t=this.dataFactory.blankNode(),n=this.dataFactory.namedNode(e.RDF+`rest`),a=i.childrenCollectionPredicate.equals(n);this.emitTriple(i.childrenCollectionSubject,i.childrenCollectionPredicate,t,a?null:i.reifiedStatementId,i.childrenTripleTerms,a?null:i.reifier),this.emitTriple(t,this.dataFactory.namedNode(e.RDF+`first`),r.subject,null,r.childrenTripleTerms),i.childrenCollectionSubject=t,i.childrenCollectionPredicate=n}else{i.childrenTagsToTripleTerms||(this.emitTriple(i.subject,i.predicate,r.subject,i.reifiedStatementId,i.childrenTripleTerms,i.reifier),i.predicateEmitted=!0);for(let e=0;e<i.predicateSubPredicates.length;e++)this.emitTriple(r.subject,i.predicateSubPredicates[e],i.predicateSubObjects[e],null,i.childrenTripleTerms,i.reifier);i.predicateSubPredicates=[],i.predicateSubObjects=[]}for(let e=0;e<s.length;e++){let t=this.createLiteral(l[e],r);this.emitTriple(r.subject,s[e],t,i.reifiedStatementId,i.childrenTripleTerms,i.reifier)}p&&this.emitTriple(r.subject,this.dataFactory.namedNode(e.RDF+`type`),this.uriToNamedNode(p),null,r.childrenTripleTerms,r.reifier)}}onTagProperty(t,n,r){if(n.childrenParseType=c.RESOURCE,n.subject=r.subject,t.uri===e.RDF&&t.local===`li`?(r.listItemCounter||=1,n.predicate=this.uriToNamedNode(t.uri+`_`+r.listItemCounter++)):n.predicate=this.uriToNamedNode(t.uri+t.local),t.uri===e.RDF&&e.FORBIDDEN_PROPERTY_ELEMENTS.indexOf(t.local)>=0)throw this.newParseError(`Illegal property element name: ${t.local}`);n.predicateSubPredicates=[],n.predicateSubObjects=[];let i=!1,a=!1,o=null,s=!0,l=[],u=[];for(let r in t.attributes){let d=t.attributes[r];if(d.uri===e.RDF&&d.local===`version`){this.setVersion(n,d.value);continue}else if(d.uri===e.RDF)switch(d.local){case`resource`:if(o)throw this.newParseError(`Found both rdf:resource (${d.value}) and rdf:nodeID (${o}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:resource (${d.value})`);n.hadChildren=!0,o=d.value,s=!1;continue;case`datatype`:if(a)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:datatype (${d.value}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${d.value})`);n.datatype=this.valueToUri(d.value,n);continue;case`nodeID`:if(a)throw this.newParseError(`Found both non-rdf:* property attributes and rdf:nodeID (${d.value}).`);if(n.hadChildren)throw this.newParseError(`Found both rdf:resource and rdf:nodeID (${d.value}).`);if(i)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID (${d.value})`);this.validateNcname(d.value),n.hadChildren=!0,o=d.value,s=!0;continue;case`bagID`:throw this.newParseError(`rdf:bagID is not supported.`);case`parseType`:if(a)throw this.newParseError(`rdf:parseType is not allowed when non-rdf:* property attributes are present`);if(n.datatype)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:datatype (${n.datatype.value})`);if(o)throw this.newParseError(`rdf:parseType is not allowed on property elements with rdf:nodeID or rdf:resource (${o})`);if(d.value===`Resource`){i=!0,n.childrenParseType=c.PROPERTY;let e=this.dataFactory.blankNode();this.emitTriple(n.subject,n.predicate,e,n.reifiedStatementId,n.childrenTripleTerms,n.reifier),n.subject=e,n.predicate=null}else d.value===`Collection`?(i=!0,n.hadChildren=!0,n.childrenCollectionSubject=n.subject,n.childrenCollectionPredicate=n.predicate,s=!1):d.value===`Literal`?(i=!0,n.childrenTagsToString=!0,n.childrenStringTags=[]):d.value===`Triple`&&(i=!0,n.childrenTagsToTripleTerms=!0,n.childrenTripleTerms=[]);continue;case`ID`:this.validateNcname(d.value),n.reifiedStatementId=this.valueToUri(`#`+d.value,n),this.claimNodeId(n.reifiedStatementId);continue;case`annotation`:n.reifier=this.dataFactory.namedNode(d.value);continue;case`annotationNodeID`:n.reifier=this.dataFactory.blankNode(d.value);continue}else if(d.uri===e.XML&&d.local===`lang`){n.language=d.value===``?null:d.value.toLowerCase();continue}else if(d.uri===e.ITS&&d.local===`dir`){this.setDirection(n,d.value);continue}else if(d.uri===e.ITS&&d.local===`version`)continue;if(d.prefix!==`xml`&&d.prefix!==`xmlns`&&(d.prefix!==``||d.local!==`xmlns`)&&d.uri){if(i||n.datatype)throw this.newParseError(`Found illegal rdf:* properties on property element with attribute: ${d.value}`);n.hadChildren=!0,a=!0,l.push(this.uriToNamedNode(d.uri+d.local)),u.push(this.createLiteral(d.value,n))}}if(o!==null){let e=n.subject;n.subject=s?this.dataFactory.blankNode(o):this.valueToUri(o,n),this.emitTriple(e,n.predicate,n.subject,n.reifiedStatementId,n.childrenTripleTerms,n.reifier);for(let e=0;e<l.length;e++)this.emitTriple(n.subject,l[e],u[e],null,n.childrenTripleTerms,n.reifier);n.predicateEmitted=!0}else s&&(n.predicateSubPredicates=l,n.predicateSubObjects=u,n.predicateEmitted=!1)}emitTriple(t,n,r,i,a,o){let s=this.dataFactory.quad(t,n,r,this.defaultGraph);a?a.push(s):this.push(s),o&&this.push(this.dataFactory.quad(o,this.dataFactory.namedNode(e.RDF+`reifies`),s)),i&&(this.push(this.dataFactory.quad(i,this.dataFactory.namedNode(e.RDF+`type`),this.dataFactory.namedNode(e.RDF+`Statement`),this.defaultGraph)),this.push(this.dataFactory.quad(i,this.dataFactory.namedNode(e.RDF+`subject`),t,this.defaultGraph)),this.push(this.dataFactory.quad(i,this.dataFactory.namedNode(e.RDF+`predicate`),n,this.defaultGraph)),this.push(this.dataFactory.quad(i,this.dataFactory.namedNode(e.RDF+`object`),r,this.defaultGraph)))}claimNodeId(e){if(!this.allowDuplicateRdfIds){if(this.nodeIds[e.value])throw this.newParseError(`Found multiple occurrences of rdf:ID='${e.value}'.`);this.nodeIds[e.value]=!0}}onText(e){let t=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;t&&(t.childrenStringTags?t.childrenStringTags.push(e):t.predicate&&(t.text=e))}onCloseTag(){let t=this.activeTagStack.pop(),n=this.activeTagStack.length?this.activeTagStack[this.activeTagStack.length-1]:null;if(t.childrenStringEmitClosingTag&&t.childrenStringTags.push(t.childrenStringEmitClosingTag),t.childrenTagsToString&&(t.datatype=this.dataFactory.namedNode(e.RDF+`XMLLiteral`),t.text=t.childrenStringTags.join(``),t.hadChildren=!1),t.childrenTagsToTripleTerms&&t.predicate&&t.rdfVersion){if(t.childrenTripleTerms.length!==1)throw this.newParseError(`Expected exactly one triple term in rdf:parseType="Triple" but got ${t.childrenTripleTerms.length}`);for(let e of t.childrenTripleTerms)this.emitTriple(t.subject,t.predicate,e,null,n.childrenTripleTerms,n.reifier);t.predicateEmitted=!0}if(t.childrenCollectionSubject)this.emitTriple(t.childrenCollectionSubject,t.childrenCollectionPredicate,this.dataFactory.namedNode(e.RDF+`nil`),null,t.childrenTripleTerms);else if(t.predicate){if(!t.hadChildren&&t.childrenParseType!==c.PROPERTY)this.emitTriple(t.subject,t.predicate,this.createLiteral(t.text||``,t),t.reifiedStatementId,t.childrenTripleTerms,t.reifier);else if(!t.predicateEmitted){let e=this.dataFactory.blankNode();this.emitTriple(t.subject,t.predicate,e,t.reifiedStatementId,t.childrenTripleTerms,t.reifier);for(let n=0;n<t.predicateSubPredicates.length;n++)this.emitTriple(e,t.predicateSubPredicates[n],t.predicateSubObjects[n],null,t.childrenTripleTerms)}}}onDoctype(e){e.replace(/<!ENTITY\s+([^\s]+)\s+["']([^"']+)["']\s*>/g,(e,t,n)=>(this.saxParser.ENTITIES[t]=n,``))}setDirection(e,t){if(t){if(t!==`ltr`&&t!==`rtl`)throw this.newParseError(`Base directions must either be 'ltr' or 'rtl', while '${t}' was found.`);e.direction=t}else delete e.direction}setVersion(e,t){if(e.rdfVersion=t,this.emit(`version`,t),!this.isValidVersion(t))throw this.newParseError(`Detected unsupported version: ${t}`)}};e.RdfXmlParser=s,s.MIME_TYPE=`application/rdf+xml`,s.RDF=`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,s.XML=`http://www.w3.org/XML/1998/namespace`,s.ITS=`http://www.w3.org/2005/11/its`,s.FORBIDDEN_NODE_ELEMENTS=[`RDF`,`ID`,`about`,`bagID`,`parseType`,`resource`,`nodeID`,`li`,`aboutEach`,`aboutEachPrefix`],s.FORBIDDEN_PROPERTY_ELEMENTS=[`Description`,`RDF`,`ID`,`about`,`bagID`,`parseType`,`resource`,`nodeID`,`aboutEach`,`aboutEachPrefix`],s.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,s.SUPPORTED_VERSIONS=[`1.2`,`1.2-basic`,`1.1`];var c;(function(e){e[e.RESOURCE=0]=`RESOURCE`,e[e.PROPERTY=1]=`PROPERTY`})(c||(e.ParseType=c={}))})),Sn=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(xn(),e)})),Cn=o(((e,t)=>{t.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){let{prefix:t,_existing:n,counter:r}=this;return new e(t,new Map(n),r)}getId(e){let t=e&&this._existing.get(e);if(t)return t;let 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()]}}})),wn=o((()=>{(function(e,t){if(e.setImmediate)return;var n=1,r={},i=!1,a=e.document,o;function s(e){typeof e!=`function`&&(e=Function(``+e));for(var t=Array(arguments.length-1),i=0;i<t.length;i++)t[i]=arguments[i+1];return r[n]={callback:e,args:t},o(n),n++}function c(e){delete r[e]}function l(e){var n=e.callback,r=e.args;switch(r.length){case 0:n();break;case 1:n(r[0]);break;case 2:n(r[0],r[1]);break;case 3:n(r[0],r[1],r[2]);break;default:n.apply(t,r);break}}function u(e){if(i)setTimeout(u,0,e);else{var t=r[e];if(t){i=!0;try{l(t)}finally{c(e),i=!1}}}}function d(){o=function(e){process.nextTick(function(){u(e)})}}function f(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage(``,`*`),e.onmessage=n,t}}function p(){var t=`setImmediate$`+Math.random()+`$`,n=function(n){n.source===e&&typeof n.data==`string`&&n.data.indexOf(t)===0&&u(+n.data.slice(t.length))};e.addEventListener?e.addEventListener(`message`,n,!1):e.attachEvent(`onmessage`,n),o=function(n){e.postMessage(t+n,`*`)}}function m(){var e=new MessageChannel;e.port1.onmessage=function(e){var t=e.data;u(t)},o=function(t){e.port2.postMessage(t)}}function h(){var e=a.documentElement;o=function(t){var n=a.createElement(`script`);n.onreadystatechange=function(){u(t),n.onreadystatechange=null,e.removeChild(n),n=null},e.appendChild(n)}}function g(){o=function(e){setTimeout(u,0,e)}}var _=Object.getPrototypeOf&&Object.getPrototypeOf(e);_=_&&_.setTimeout?_:e,{}.toString.call(e.process)===`[object process]`?d():f()?p():e.MessageChannel?m():a&&`onreadystatechange`in a.createElement(`script`)?h():g(),_.setImmediate=s,_.clearImmediate=c})(typeof self>`u`?typeof global>`u`?void 0:global:self)})),Tn=o((e=>{wn(),e.setImmediate=setImmediate,e.crypto=globalThis.crypto;var t=[];for(let e=0;e<=255;++e)t.push(e.toString(16).padStart(2,`0`));e.bufferToHex=function(e){let n=``,r=new Uint8Array(e);for(let e=0;e<r.length;++e)n+=t[r[e]];return n}})),En=o(((e,t)=>{var{bufferToHex:n,crypto:r}=Tn(),i=new Map([[`sha256`,`SHA-256`],[`SHA256`,`SHA-256`],[`SHA-256`,`SHA-256`],[`sha384`,`SHA-384`],[`SHA384`,`SHA-384`],[`SHA-384`,`SHA-384`],[`sha512`,`SHA-512`],[`SHA512`,`SHA-512`],[`SHA-512`,`SHA-512`]]);t.exports=class{constructor(e){if(!(r&&r.subtle))throw Error(`crypto.subtle not found.`);if(!i.has(e))throw Error(`Unsupported algorithm "${e}".`);this.algorithm=i.get(e),this._content=``}update(e){this._content+=e}async digest(){let e=new TextEncoder().encode(this._content);return n(await r.subtle.digest(this.algorithm,e))}}})),Dn=o(((e,t)=>{t.exports=class{constructor(e){this.current=e.sort(),this.done=!1,this.dir=new Map;for(let t=0;t<e.length;++t)this.dir.set(e[t],!0)}hasNext(){return!this.done}next(){let{current:e,dir:t}=this,n=e.slice(),r=null,i=0,a=e.length;for(let n=0;n<a;++n){let o=e[n],s=t.get(o);(r===null||o>r)&&(s&&n>0&&o>e[n-1]||!s&&n<a-1&&o>e[n+1])&&(r=o,i=n)}if(r===null)this.done=!0;else{let n=t.get(r)?i-1:i+1;e[i]=e[n],e[n]=r;for(let n of e)n>r&&t.set(n,!t.get(n))}return n}}})),On=o(((e,t)=>{var n=`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`,r=`http://www.w3.org/2001/XMLSchema#string`,i=`NamedNode`,a=`BlankNode`,o=`Literal`,s={};s.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,s.empty=RegExp(`^[ \\t]*$`),s.quad=RegExp('^[ \\t]*(?:(?:<((?:[^\0- <>"{}|^`\\\\]|\\\\u[0-9A-Fa-f]{4}|\\\\U[0-9A-Fa-f]{8})*)>)|_:((?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]+(?:<((?:[^\0- <>"{}|^`\\\\]|\\\\u[0-9A-Fa-f]{4}|\\\\U[0-9A-Fa-f]{8})*)>)[ \\t]+(?:(?:<((?:[^\0- <>"{}|^`\\\\]|\\\\u[0-9A-Fa-f]{4}|\\\\U[0-9A-Fa-f]{8})*)>)|_:((?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?)|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^(?:<((?:[^\0- <>"{}|^`\\\\]|\\\\u[0-9A-Fa-f]{4}|\\\\U[0-9A-Fa-f]{8})*)>))|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))[ \\t]*(?:\\.|(?:(?:(?:<((?:[^\0- <>"{}|^`\\\\]|\\\\u[0-9A-Fa-f]{4}|\\\\U[0-9A-Fa-f]{8})*)>)|_:((?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9])(?:(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀.])*(?:[A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_0-9-·̀-ͯ‿-⁀]))?))[ \\t]*\\.))[ \\t]*$'),t.exports=class e{static parse(e){let t=[],l={},u=e.split(s.eoln),d=0;for(let e of u){if(d++,s.empty.test(e))continue;let u=e.match(s.quad);if(u===null)throw Error(`N-Quads parse error on line `+d+`.`);let f={subject:null,predicate:null,object:null,graph:null};if(u[1]===void 0?f.subject={termType:a,value:u[2]}:f.subject={termType:i,value:v(u[1])},f.predicate={termType:i,value:v(u[3])},u[4]===void 0?u[5]===void 0?(f.object={termType:o,value:void 0,datatype:{termType:i}},u[7]===void 0?u[8]===void 0?f.object.datatype.value=r:(f.object.datatype.value=n,f.object.language=u[8]):f.object.datatype.value=v(u[7]),f.object.value=p(u[6])):f.object={termType:a,value:u[5]}:f.object={termType:i,value:v(u[4])},u[9]===void 0?u[10]===void 0?f.graph={termType:`DefaultGraph`,value:``}:f.graph={termType:a,value:u[10]}:f.graph={termType:i,value:v(u[9])},!(f.graph.value in l))l[f.graph.value]=[f],t.push(f);else{let e=!0,n=l[f.graph.value];for(let t of n)if(c(t,f)){e=!1;break}e&&(n.push(f),t.push(f))}}return t}static serialize(t){let n=[];for(let r of t)n.push(e.serializeQuad(r));return n.sort().join(``)}static serializeQuadComponents(e,t,o,s){let c=``;return e.termType===i?c+=`<${g(e.value)}>`:c+=`_:${e.value}`,t.termType===i?c+=` <${g(t.value)}> `:c+=` _:${t.value} `,o.termType===i?c+=`<${g(o.value)}>`:o.termType===a?c+=`_:${o.value}`:(c+=`"${d(o.value)}"`,o.datatype.value===n?o.language&&(c+=`@${o.language}`):o.datatype.value!==r&&(c+=`^^<${g(o.datatype.value)}>`)),s.termType===i?c+=` <${g(s.value)}>`:s.termType===a&&(c+=` _:${s.value}`),c+=` .
|
|
24
|
+
`,c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}};function c(e,t){return!(e.subject.termType===t.subject.termType&&e.object.termType===t.object.termType)||!(e.subject.value===t.subject.value&&e.predicate.value===t.predicate.value&&e.object.value===t.object.value)?!1:e.object.termType!==o||e.object.datatype.termType===t.object.datatype.termType&&e.object.language===t.object.language&&e.object.datatype.value===t.object.datatype.value}var l=/[\u0000-\u001F\u007F"\\]/g,u=[];for(let e=0;e<=127;++e)l.test(String.fromCharCode(e))&&(u[e]=`\\u`+e.toString(16).toUpperCase().padStart(4,`0`),l.lastIndex=0);u[`\b`.codePointAt(0)]=`\\b`,u[` `.codePointAt(0)]=`\\t`,u[`
|
|
25
|
+
`.codePointAt(0)]=`\\n`,u[`\f`.codePointAt(0)]=`\\f`,u[`\r`.codePointAt(0)]=`\\r`,u[`"`.codePointAt(0)]=`\\"`,u[`\\`.codePointAt(0)]=`\\\\`;function d(e){return l.test(e)?e.replace(l,function(e){return u[e.codePointAt(0)]}):e}var f=/(?:\\([btnfr"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function p(e){return f.test(e)?e.replace(f,function(e,t,n,r){if(t)switch(t){case`b`:return`\b`;case`t`:return` `;case`n`:return`
|
|
26
|
+
`;case`f`:return`\f`;case`r`:return`\r`;case`"`:return`"`;case`'`:return`'`;case`\\`:return`\\`}if(n)return String.fromCharCode(parseInt(n,16));if(r)return String.fromCodePoint(parseInt(r,16))}):e}var m=/[\u0000-\u0020<>"{}|^`\\]/g,h=[];for(let e=0;e<=127;++e)m.test(String.fromCharCode(e))&&(h[e]=`\\u`+e.toString(16).toUpperCase().padStart(4,`0`),m.lastIndex=0);function g(e){return m.test(e)?e.replace(m,function(e){return h[e.codePointAt(0)]}):e}var _=/(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function v(e){return _.test(e)?e.replace(_,function(e,t,n){if(t)return String.fromCharCode(parseInt(t,16));if(n)return String.fromCodePoint(parseInt(n,16))}):e}})),kn=o(((e,t)=>{var n=Cn(),r=En(),i=Dn(),a=On(),{setImmediate:o}=Tn();t.exports=class{constructor({createMessageDigest:e=null,messageDigestAlgorithm:t=`sha256`,canonicalIdMap:i=new Map,maxWorkFactor:a=1,maxDeepIterations:o=-1,signal:s=null}={}){this.name=`RDFC-1.0`,this.blankNodeInfo=new Map,this.canonicalIssuer=new n(`c14n`,i),this.createMessageDigest=e||(()=>new r(t)),this.maxWorkFactor=a,this.maxDeepIterations=o,this.remainingDeepIterations=0,this.signal=s,this.quads=null}async main(e){this.quads=e;for(let t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});let t=new Map,r=[...this.blankNodeInfo.keys()],i=0;for(let e of r)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});let o=[...t.keys()].sort(),c=[];for(let e of o){let n=t.get(e);if(n.length>1){c.push(n);continue}let r=n[0];this.canonicalIssuer.getId(r)}if(this.maxDeepIterations<0)if(this.maxWorkFactor===0)this.maxDeepIterations=0;else if(this.maxWorkFactor===1/0)this.maxDeepIterations=1/0;else{let e=c.reduce((e,t)=>e+t.length,0);this.maxDeepIterations=e**this.maxWorkFactor}this.maxDeepIterations>2**53-1&&(this.maxDeepIterations=1/0),this.remainingDeepIterations=this.maxDeepIterations;for(let e of c){let t=[];for(let r of e){if(this.canonicalIssuer.hasId(r))continue;let e=new n(`b`);e.getId(r);let i=await this.hashNDegreeQuads(r,e);t.push(i)}t.sort(s);for(let e of t){let t=e.issuer.getOldIds();for(let e of t)this.canonicalIssuer.getId(e)}}let l=[];for(let e of this.quads){let t=a.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));l.push(t)}return l.sort(),l.join(``)}async hashFirstDegreeQuads(e){let t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(let n of r)t.push(a.serializeQuadComponents(this.modifyFirstDegreeComponent(e,n.subject,`subject`),n.predicate,this.modifyFirstDegreeComponent(e,n.object,`object`),this.modifyFirstDegreeComponent(e,n.graph,`graph`)));t.sort();let i=this.createMessageDigest();for(let e of t)i.update(e);return n.hash=await i.digest(),n.hash}async hashRelatedBlankNode(e,t,n,r){let i=this.createMessageDigest();i.update(r),r!==`g`&&i.update(this.getRelatedPredicate(t));let a;return a=this.canonicalIssuer.hasId(e)?`_:`+this.canonicalIssuer.getId(e):n.hasId(e)?`_:`+n.getId(e):this.blankNodeInfo.get(e).hash,i.update(a),i.digest()}async hashNDegreeQuads(e,t){if(this.remainingDeepIterations===0)throw Error(`Maximum deep iterations exceeded (${this.maxDeepIterations}).`);this.remainingDeepIterations--;let n=this.createMessageDigest(),r=await this.createHashToRelated(e,t),a=[...r.keys()].sort();for(let e of a){n.update(e);let a=``,o,s=new i(r.get(e)),c=0;for(;s.hasNext();){let e=s.next();if(++c%3==0){if(this.signal&&this.signal.aborted)throw Error(`Abort signal received: "${this.signal.reason}".`);await this._yield()}let n=t.clone(),r=``,i=[],l=!1;for(let t of e)if(this.canonicalIssuer.hasId(t)?r+=`_:`+this.canonicalIssuer.getId(t):(n.hasId(t)||i.push(t),r+=`_:`+n.getId(t)),a.length!==0&&r>a){l=!0;break}if(!l){for(let e of i){let t=await this.hashNDegreeQuads(e,n);if(r+=`_:`+n.getId(e),r+=`<${t.hash}>`,n=t.issuer,a.length!==0&&r>a){l=!0;break}}l||(a.length===0||r<a)&&(a=r,o=n)}}n.update(a),t=o}return{hash:await n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return t.termType===`BlankNode`?{termType:`BlankNode`,value:t.value===e?`a`:`z`}:t}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){let n=new Map,r=this.blankNodeInfo.get(e).quads,i=0;for(let a of r)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:a,component:a.subject,position:`s`,id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.object,position:`o`,id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:a,component:a.graph,position:`g`,id:e,issuer:t,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){let n=await this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if(t.termType!==`BlankNode`)return;let n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}async _addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:a}){if(!(t.termType===`BlankNode`&&t.value!==r))return;let o=t.value,s=await this.hashRelatedBlankNode(o,e,i,n),c=a.get(s);c?c.push(o):a.set(s,[o])}_componentWithCanonicalId(e){return e.termType===`BlankNode`&&!e.value.startsWith(this.canonicalIssuer.prefix)?{termType:`BlankNode`,value:this.canonicalIssuer.getId(e.value)}:e}async _yield(){return new Promise(e=>o(e))}};function s(e,t){return e.hash<t.hash?-1:+(e.hash>t.hash)}})),An=o(((e,t)=>{var n=Cn(),r=En(),i=Dn(),a=On();t.exports=class{constructor({createMessageDigest:e=null,messageDigestAlgorithm:t=`sha256`,canonicalIdMap:i=new Map,maxWorkFactor:a=1,maxDeepIterations:o=-1,timeout:s=0}={}){this.name=`RDFC-1.0`,this.blankNodeInfo=new Map,this.canonicalIssuer=new n(`c14n`,i),this.createMessageDigest=e||(()=>new r(t)),this.maxWorkFactor=a,this.maxDeepIterations=o,this.remainingDeepIterations=0,this.timeout=s,s>0&&(this.startTime=Date.now()),this.quads=null}main(e){this.quads=e;for(let t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});let t=new Map,r=[...this.blankNodeInfo.keys()];for(let e of r)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});let i=[...t.keys()].sort(),s=[];for(let e of i){let n=t.get(e);if(n.length>1){s.push(n);continue}let r=n[0];this.canonicalIssuer.getId(r)}if(this.maxDeepIterations<0)if(this.maxWorkFactor===0)this.maxDeepIterations=0;else if(this.maxWorkFactor===1/0)this.maxDeepIterations=1/0;else{let e=s.reduce((e,t)=>e+t.length,0);this.maxDeepIterations=e**this.maxWorkFactor}this.maxDeepIterations>2**53-1&&(this.maxDeepIterations=1/0),this.remainingDeepIterations=this.maxDeepIterations;for(let e of s){let t=[];for(let r of e){if(this.canonicalIssuer.hasId(r))continue;let e=new n(`b`);e.getId(r);let i=this.hashNDegreeQuads(r,e);t.push(i)}t.sort(o);for(let e of t){let t=e.issuer.getOldIds();for(let e of t)this.canonicalIssuer.getId(e)}}let c=[];for(let e of this.quads){let t=a.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join(``)}hashFirstDegreeQuads(e){let t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(let n of r)t.push(a.serializeQuadComponents(this.modifyFirstDegreeComponent(e,n.subject,`subject`),n.predicate,this.modifyFirstDegreeComponent(e,n.object,`object`),this.modifyFirstDegreeComponent(e,n.graph,`graph`)));t.sort();let i=this.createMessageDigest();for(let e of t)i.update(e);return n.hash=i.digest(),n.hash}hashRelatedBlankNode(e,t,n,r){let i=this.createMessageDigest();i.update(r),r!==`g`&&i.update(this.getRelatedPredicate(t));let a;return a=this.canonicalIssuer.hasId(e)?`_:`+this.canonicalIssuer.getId(e):n.hasId(e)?`_:`+n.getId(e):this.blankNodeInfo.get(e).hash,i.update(a),i.digest()}hashNDegreeQuads(e,t){if(this.remainingDeepIterations===0)throw Error(`Maximum deep iterations exceeded (${this.maxDeepIterations}).`);this.remainingDeepIterations--;let n=this.createMessageDigest(),r=this.createHashToRelated(e,t),a=[...r.keys()].sort();for(let e of a){n.update(e);let a=``,o,s=new i(r.get(e)),c=0;for(;s.hasNext();){let e=s.next();if(++c%3==0&&this.timeout>0&&Date.now()-this.startTime>this.timeout)throw Error(`Canonize timeout.`);let n=t.clone(),r=``,i=[],l=!1;for(let t of e)if(this.canonicalIssuer.hasId(t)?r+=`_:`+this.canonicalIssuer.getId(t):(n.hasId(t)||i.push(t),r+=`_:`+n.getId(t)),a.length!==0&&r>a){l=!0;break}if(!l){for(let e of i){let t=this.hashNDegreeQuads(e,n);if(r+=`_:`+n.getId(e),r+=`<${t.hash}>`,n=t.issuer,a.length!==0&&r>a){l=!0;break}}l||(a.length===0||r<a)&&(a=r,o=n)}}n.update(a),t=o}return{hash:n.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return t.termType===`BlankNode`?{termType:`BlankNode`,value:t.value===e?`a`:`z`}:t}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){let n=new Map,r=this.blankNodeInfo.get(e).quads;for(let i of r)this._addRelatedBlankNodeHash({quad:i,component:i.subject,position:`s`,id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.object,position:`o`,id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:i,component:i.graph,position:`g`,id:e,issuer:t,hashToRelated:n});return n}_hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){let n=this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if(t.termType!==`BlankNode`)return;let n=t.value,r=this.blankNodeInfo.get(n);r?r.quads.add(e):this.blankNodeInfo.set(n,{quads:new Set([e]),hash:null})}_addRelatedBlankNodeHash({quad:e,component:t,position:n,id:r,issuer:i,hashToRelated:a}){if(!(t.termType===`BlankNode`&&t.value!==r))return;let o=t.value,s=this.hashRelatedBlankNode(o,e,i,n),c=a.get(s);c?c.push(o):a.set(s,[o])}_componentWithCanonicalId(e){return e.termType===`BlankNode`&&!e.value.startsWith(this.canonicalIssuer.prefix)?{termType:`BlankNode`,value:this.canonicalIssuer.getId(e.value)}:e}};function o(e,t){return e.hash<t.hash?-1:+(e.hash>t.hash)}})),jn=o((e=>{var t=kn(),n=An();function r(t,n){if(n.inputFormat){if(n.inputFormat===`application/n-quads`){if(typeof t!=`string`)throw Error(`N-Quads input must be a string.`);return e.NQuads.parse(t)}throw Error(`Unknown canonicalization input format: "${n.inputFormat}".`)}return t}function i(e){if(e.format&&e.format!==`application/n-quads`)throw Error(`Unknown canonicalization output format: "${e.format}".`)}function a(){globalThis.RDF_CANONIZE_TRACE_URDNA2015&&console.trace(`[rdf-canonize] URDNA2015 is deprecated, use RDFC-1.0`)}e.NQuads=On(),e.IdentifierIssuer=Cn(),e.canonize=async function(e,n={}){let o=r(e,n);if(i(n),!(`algorithm`in n))throw Error(`No RDF Dataset Canonicalization algorithm specified.`);if(n.algorithm===`RDFC-1.0`)return new t(n).main(o);if(n.algorithm===`URDNA2015`&&!n.rejectURDNA2015)return a(),new t(n).main(o);throw Error(`Invalid RDF Dataset Canonicalization algorithm: `+n.algorithm)},e._canonizeSync=function(e,t={}){let o=r(e,t);if(i(t),!(`algorithm`in t))throw Error(`No RDF Dataset Canonicalization algorithm specified.`);if(t.algorithm===`RDFC-1.0`)return new n(t).main(o);if(t.algorithm===`URDNA2015`&&!t.rejectURDNA2015)return a(),new n(t).main(o);throw Error(`Invalid RDF Dataset Canonicalization algorithm: `+t.algorithm)}})),Mn=o(((e,t)=>{t.exports=jn()})),Nn=o(((e,t)=>{var n={};t.exports=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=>e===void 0})),Pn=o(((e,t)=>{var n=Nn(),r={};t.exports=r,r.isSubject=e=>n.isObject(e)&&!(`@value`in e||`@set`in e||`@list`in e)?Object.keys(e).length>1||!(`@id`in e):!1,r.isSubjectReference=e=>n.isObject(e)&&Object.keys(e).length===1&&`@id`in e,r.isValue=e=>n.isObject(e)&&`@value`in e,r.isList=e=>n.isObject(e)&&`@list`in e,r.isGraph=e=>n.isObject(e)&&`@graph`in e&&Object.keys(e).filter(e=>e!==`@id`&&e!==`@index`).length===1,r.isSimpleGraph=e=>r.isGraph(e)&&!(`@id`in e),r.isBlankNode=e=>{if(n.isObject(e)){if(`@id`in e){let t=e[`@id`];return!n.isString(t)||t.indexOf(`_:`)===0}return Object.keys(e).length===0||!(`@value`in e||`@set`in e||`@list`in e)}return!1}})),Fn=o(((e,t)=>{t.exports=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}}})),In=o(((e,t)=>{var n=Pn(),r=Nn(),i=Mn().IdentifierIssuer,a=Fn(),o=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,c=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,l=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u=/^@[a-zA-Z]+$/,d={headers:{accept:`application/ld+json, application/json`}},f={};t.exports=f,f.IdentifierIssuer=i,f.REGEX_BCP47=o,f.REGEX_KEYWORD=u,f.clone=function(e){if(e&&typeof e==`object`){let t;if(r.isArray(e)){t=[];for(let n=0;n<e.length;++n)t[n]=f.clone(e[n])}else if(e instanceof Map){t=new Map;for(let[n,r]of e)t.set(n,f.clone(r))}else if(e instanceof Set){t=new Set;for(let n of e)t.add(f.clone(n))}else if(r.isObject(e)){t={};for(let n in e)t[n]=f.clone(e[n])}else t=e.toString();return t}return e},f.asArray=function(e){return Array.isArray(e)?e:[e]},f.buildHeaders=(e={})=>{if(Object.keys(e).some(e=>e.toLowerCase()===`accept`))throw RangeError(`Accept header may not be specified; only "`+d.headers.accept+`" is supported.`);return Object.assign({Accept:d.headers.accept},e)},f.parseLinkHeader=e=>{let t={},n=e.match(s);for(let e=0;e<n.length;++e){let r=n[e].match(c);if(!r)continue;let i={target:r[1]},a=r[2];for(;r=l.exec(a);)i[r[1]]=r[2]===void 0?r[3]:r[2];let o=i.rel||``;Array.isArray(t[o])?t[o].push(i):t.hasOwnProperty(o)?t[o]=[t[o],i]:t[o]=i}return t},f.validateTypeValue=(e,t)=>{if(!r.isString(e)&&!(r.isArray(e)&&e.every(e=>r.isString(e)))){if(t&&r.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if(`@default`in e&&f.asArray(e[`@default`]).every(e=>r.isString(e)))return}throw new a(`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:e})}},f.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){let n=e[t];return!r.isArray(n)||n.length>0}return!1},f.hasValue=(e,t,i)=>{if(f.hasProperty(e,t)){let a=e[t],o=n.isList(a);if(r.isArray(a)||o){o&&(a=a[`@list`]);for(let e=0;e<a.length;++e)if(f.compareValues(i,a[e]))return!0}else if(!r.isArray(i))return f.compareValues(i,a)}return!1},f.addValue=(e,t,n,i)=>{if(i||={},`propertyIsArray`in i||(i.propertyIsArray=!1),`valueIsArray`in i||(i.valueIsArray=!1),`allowDuplicate`in i||(i.allowDuplicate=!0),`prependValue`in i||(i.prependValue=!1),i.valueIsArray)e[t]=n;else if(r.isArray(n)){n.length===0&&i.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),i.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let r=0;r<n.length;++r)f.addValue(e,t,n[r],i)}else if(e.hasOwnProperty(t)){let a=!i.allowDuplicate&&f.hasValue(e,t,n);!r.isArray(e[t])&&(!a||i.propertyIsArray)&&(e[t]=[e[t]]),a||(i.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=i.propertyIsArray?[n]:n},f.getValues=(e,t)=>[].concat(e[t]||[]),f.removeProperty=(e,t)=>{delete e[t]},f.removeValue=(e,t,n,r)=>{r||={},`propertyIsArray`in r||(r.propertyIsArray=!1);let i=f.getValues(e,t).filter(e=>!f.compareValues(e,n));i.length===0?f.removeProperty(e,t):i.length===1&&!r.propertyIsArray?e[t]=i[0]:e[t]=i},f.relabelBlankNodes=(e,t)=>(t||={},p(t.issuer||new i(`_:b`),e)),f.compareValues=(e,t)=>e===t||n.isValue(e)&&n.isValue(t)&&e[`@value`]===t[`@value`]&&e[`@type`]===t[`@type`]&&e[`@language`]===t[`@language`]&&e[`@index`]===t[`@index`]?!0:r.isObject(e)&&`@id`in e&&r.isObject(t)&&`@id`in t?e[`@id`]===t[`@id`]:!1,f.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1;function p(e,t){if(r.isArray(t))for(let n=0;n<t.length;++n)t[n]=p(e,t[n]);else if(n.isList(t))t[`@list`]=p(e,t[`@list`]);else if(r.isObject(t)){n.isBlankNode(t)&&(t[`@id`]=e.getId(t[`@id`]));let r=Object.keys(t).sort();for(let n=0;n<r.length;++n){let i=r[n];i!==`@id`&&(t[i]=p(e,t[i]))}}return t}})),Ln=o(((e,t)=>{t.exports={LINK_HEADER_REL:`http://www.w3.org/ns/json-ld#context`,LINK_HEADER_CONTEXT:`http://www.w3.org/ns/json-ld#context`,RDF:`http://www.w3.org/1999/02/22-rdf-syntax-ns#`,RDF_LIST:`http://www.w3.org/1999/02/22-rdf-syntax-ns#List`,RDF_FIRST:`http://www.w3.org/1999/02/22-rdf-syntax-ns#first`,RDF_REST:`http://www.w3.org/1999/02/22-rdf-syntax-ns#rest`,RDF_NIL:`http://www.w3.org/1999/02/22-rdf-syntax-ns#nil`,RDF_TYPE:`http://www.w3.org/1999/02/22-rdf-syntax-ns#type`,RDF_PLAIN_LITERAL:`http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral`,RDF_XML_LITERAL:`http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral`,RDF_JSON_LITERAL:`http://www.w3.org/1999/02/22-rdf-syntax-ns#JSON`,RDF_OBJECT:`http://www.w3.org/1999/02/22-rdf-syntax-ns#object`,RDF_LANGSTRING:`http://www.w3.org/1999/02/22-rdf-syntax-ns#langString`,XSD:`http://www.w3.org/2001/XMLSchema#`,XSD_BOOLEAN:`http://www.w3.org/2001/XMLSchema#boolean`,XSD_DOUBLE:`http://www.w3.org/2001/XMLSchema#double`,XSD_INTEGER:`http://www.w3.org/2001/XMLSchema#integer`,XSD_STRING:`http://www.w3.org/2001/XMLSchema#string`}})),Rn=o(((e,t)=>{t.exports=class{constructor(){this._requests={}}wrapLoader(e){let 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]}}}})),zn=o(((e,t)=>{var n=Nn(),r={};t.exports=r,r.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},r.parse=(e,t)=>{let n={},i=r.parsers[t||`full`],a=i.regex.exec(e),o=i.keys.length;for(;o--;)n[i.keys[o]]=a[o]===void 0?null:a[o];return(n.scheme===`https`&&n.port===`443`||n.scheme===`http`&&n.port===`80`)&&(n.href=n.href.replace(`:`+n.port,``),n.authority=n.authority.replace(`:`+n.port,``),n.port=null),n.normalizedPath=r.removeDotSegments(n.path),n},r.prependBase=(e,t)=>{if(e===null||r.isAbsolute(t))return t;(!e||n.isString(e))&&(e=r.parse(e||``));let i=r.parse(t),a={protocol:e.protocol||``};if(i.authority!==null)a.authority=i.authority,a.path=i.path,a.query=i.query;else if(a.authority=e.authority,i.path===``)a.path=e.path,i.query===null?a.query=e.query:a.query=i.query;else{if(i.path.indexOf(`/`)===0)a.path=i.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf(`/`)+1),(t.length>0||e.authority)&&t.substr(-1)!==`/`&&(t+=`/`),t+=i.path,a.path=t}a.query=i.query}i.path!==``&&(a.path=r.removeDotSegments(a.path));let o=a.protocol;return a.authority!==null&&(o+=`//`+a.authority),o+=a.path,a.query!==null&&(o+=`?`+a.query),i.fragment!==null&&(o+=`#`+i.fragment),o===``&&(o=`./`),o},r.removeBase=(e,t)=>{if(e===null)return t;(!e||n.isString(e))&&(e=r.parse(e||``));let i=``;if(e.href===``?t.indexOf(`//`)&&(i+=`//`):i+=(e.protocol||``)+`//`+(e.authority||``),t.indexOf(i)!==0)return t;let a=r.parse(t.substr(i.length)),o=e.normalizedPath.split(`/`),s=a.normalizedPath.split(`/`),c=a.fragment||a.query?0:1;for(;o.length>0&&s.length>c&&o[0]===s[0];)o.shift(),s.shift();let l=``;if(o.length>0){o.pop();for(let e=0;e<o.length;++e)l+=`../`}return l+=s.join(`/`),a.query!==null&&(l+=`?`+a.query),a.fragment!==null&&(l+=`#`+a.fragment),l===``&&(l=`./`),l},r.removeDotSegments=e=>{if(e.length===0)return``;let t=e.split(`/`),n=[];for(;t.length>0;){let e=t.shift(),r=t.length===0;if(e===`.`){r&&n.push(``);continue}if(e===`..`){n.pop(),r&&n.push(``);continue}n.push(e)}return e[0]===`/`&&n.length>0&&n[0]!==``&&n.unshift(``),n.length===1&&n[0]===``?`/`:n.join(`/`)};var i=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;r.isAbsolute=e=>n.isString(e)&&i.test(e),r.isRelative=e=>n.isString(e)})),Bn=o(((e,t)=>{var{parseLinkHeader:n,buildHeaders:r}=In(),{LINK_HEADER_CONTEXT:i}=Ln(),a=Fn(),o=Rn(),{prependBase:s}=zn(),c=/(^|(\r\n))link:/i;t.exports=({secure:e,headers:t={},xhr:u}={headers:{}})=>{return t=r(t),new o().wrapLoader(d);async function d(r){if(r.indexOf(`http:`)!==0&&r.indexOf(`https:`)!==0)throw new a(`URL could not be dereferenced; only "http" and "https" URLs are supported.`,`jsonld.InvalidUrl`,{code:`loading document failed`,url:r});if(e&&r.indexOf(`https`)!==0)throw new a(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,`jsonld.InvalidUrl`,{code:`loading document failed`,url:r});let o;try{o=await l(u,r,t)}catch(e){throw new a(`URL could not be dereferenced, an error occurred.`,`jsonld.LoadDocumentError`,{code:`loading document failed`,url:r,cause:e})}if(o.status>=400)throw new a(`URL could not be dereferenced: `+o.statusText,`jsonld.LoadDocumentError`,{code:`loading document failed`,url:r,httpStatusCode:o.status});let f={contextUrl:null,documentUrl:r,document:o.response},p=null,m=o.getResponseHeader(`Content-Type`),h;if(c.test(o.getAllResponseHeaders())&&(h=o.getResponseHeader(`Link`)),h&&m!==`application/ld+json`){let e=n(h),t=e[i];if(Array.isArray(t))throw new a(`URL could not be dereferenced, it has more than one associated HTTP Link Header.`,`jsonld.InvalidUrl`,{code:`multiple context link headers`,url:r});t&&(f.contextUrl=t.target),p=e.alternate,p&&p.type==`application/ld+json`&&!(m||``).match(/^application\/(\w*\+)?json$/)&&(f=await d(s(r,p.target)))}return f}};function l(e,t,n){e||=XMLHttpRequest;let r=new e;return new Promise((e,i)=>{r.onload=()=>e(r),r.onerror=e=>i(e),r.open(`GET`,t,!0);for(let e in n)r.setRequestHeader(e,n[e]);r.send()})}})),Vn=o(((e,t)=>{var n=Bn(),r={};t.exports=r,r.setupDocumentLoaders=function(e){typeof XMLHttpRequest<`u`&&(e.documentLoaders.xhr=n,e.useDocumentLoader(`xhr`))},r.setupGlobals=function(e){globalThis.JsonLdProcessor===void 0&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}})),Hn=o(((e,t)=>{t.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}})),Un=o(((e,t)=>{t.exports=n,n.Node=o,n.create=n;function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&typeof e.forEach==`function`)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}n.prototype.removeNode=function(e){if(e.list!==this)throw Error(`removing node which does not belong to this list`);var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||=e,this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||=e,this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)i(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)a(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t||=this;for(var n=this.head,r=0;n!==null;r++)e.call(t,n.value,r,this),n=n.next},n.prototype.forEachReverse=function(e,t){t||=this;for(var n=this.tail,r=this.length-1;n!==null;r--)e.call(t,n.value,r,this),n=n.prev},n.prototype.get=function(e){for(var t=0,n=this.head;n!==null&&t<e;t++)n=n.next;if(t===e&&n!==null)return n.value},n.prototype.getReverse=function(e){for(var t=0,n=this.tail;n!==null&&t<e;t++)n=n.prev;if(t===e&&n!==null)return n.value},n.prototype.map=function(e,t){t||=this;for(var r=new n,i=this.head;i!==null;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t||=this;for(var r=new n,i=this.tail;i!==null;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else if(this.head)r=this.head.next,n=this.head.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=0;r!==null;i++)n=e(n,r.value,i),r=r.next;return n},n.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else if(this.tail)r=this.tail.prev,n=this.tail.value;else throw TypeError(`Reduce of empty list with no initial value`);for(var i=this.length-1;r!==null;i--)n=e(n,r.value,i),r=r.prev;return n},n.prototype.toArray=function(){for(var e=Array(this.length),t=0,n=this.head;n!==null;t++)e[t]=n.value,n=n.next;return e},n.prototype.toArrayReverse=function(){for(var e=Array(this.length),t=0,n=this.tail;n!==null;t++)e[t]=n.value,n=n.prev;return e},n.prototype.slice=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,a=this.head;a!==null&&i<e;i++)a=a.next;for(;a!==null&&i<t;i++,a=a.next)r.push(a.value);return r},n.prototype.sliceReverse=function(e,t){t||=this.length,t<0&&(t+=this.length),e||=0,e<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,a=this.tail;a!==null&&i>t;i--)a=a.prev;for(;a!==null&&i>e;i--,a=a.prev)r.push(a.value);return r},n.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var i=0,a=this.head;a!==null&&i<e;i++)a=a.next;for(var o=[],i=0;a&&i<t;i++)o.push(a.value),a=this.removeNode(a);a===null&&(a=this.tail),a!==this.head&&a!==this.tail&&(a=a.prev);for(var i=0;i<n.length;i++)a=r(this,a,n[i]);return o},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;n!==null;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};function r(e,t,n){var r=t===e.head?new o(n,null,t,e):new o(n,t,t.next,e);return r.next===null&&(e.tail=r),r.prev===null&&(e.head=r),e.length++,r}function i(e,t){e.tail=new o(t,e.tail,null,e),e.head||=e.tail,e.length++}function a(e,t){e.head=new o(t,null,e.head,e),e.tail||=e.head,e.length++}function o(e,t,n,r){if(!(this instanceof o))return new o(e,t,n,r);this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null}try{Hn()(n)}catch{}})),Wn=o(((e,t)=>{var n=Un(),r=Symbol(`max`),i=Symbol(`length`),a=Symbol(`lengthCalculator`),o=Symbol(`allowStale`),s=Symbol(`maxAge`),c=Symbol(`dispose`),l=Symbol(`noDisposeOnSet`),u=Symbol(`lruList`),d=Symbol(`cache`),f=Symbol(`updateAgeOnGet`),p=()=>1,m=class{constructor(e){if(typeof e==`number`&&(e={max:e}),e||={},e.max&&(typeof e.max!=`number`||e.max<0))throw TypeError(`max must be a non-negative number`);this[r]=e.max||1/0;let t=e.length||p;if(this[a]=typeof t==`function`?t:p,this[o]=e.stale||!1,e.maxAge&&typeof e.maxAge!=`number`)throw TypeError(`maxAge must be a number`);this[s]=e.maxAge||0,this[c]=e.dispose,this[l]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!=`number`||e<0)throw TypeError(`max must be a non-negative number`);this[r]=e||1/0,_(this)}get max(){return this[r]}set allowStale(e){this[o]=!!e}get allowStale(){return this[o]}set maxAge(e){if(typeof e!=`number`)throw TypeError(`maxAge must be a non-negative number`);this[s]=e,_(this)}get maxAge(){return this[s]}set lengthCalculator(e){typeof e!=`function`&&(e=p),e!==this[a]&&(this[a]=e,this[i]=0,this[u].forEach(e=>{e.length=this[a](e.value,e.key),this[i]+=e.length})),_(this)}get lengthCalculator(){return this[a]}get length(){return this[i]}get itemCount(){return this[u].length}rforEach(e,t){t||=this;for(let n=this[u].tail;n!==null;){let r=n.prev;b(this,e,n,t),n=r}}forEach(e,t){t||=this;for(let n=this[u].head;n!==null;){let r=n.next;b(this,e,n,t),n=r}}keys(){return this[u].toArray().map(e=>e.key)}values(){return this[u].toArray().map(e=>e.value)}reset(){this[c]&&this[u]&&this[u].length&&this[u].forEach(e=>this[c](e.key,e.value)),this[d]=new Map,this[u]=new n,this[i]=0}dump(){return this[u].map(e=>!g(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[u]}set(e,t,n){if(n||=this[s],n&&typeof n!=`number`)throw TypeError(`maxAge must be a number`);let o=n?Date.now():0,f=this[a](t,e);if(this[d].has(e)){if(f>this[r])return v(this,this[d].get(e)),!1;let a=this[d].get(e).value;return this[c]&&(this[l]||this[c](e,a.value)),a.now=o,a.maxAge=n,a.value=t,this[i]+=f-a.length,a.length=f,this.get(e),_(this),!0}let p=new y(e,t,f,o,n);return p.length>this[r]?(this[c]&&this[c](e,t),!1):(this[i]+=p.length,this[u].unshift(p),this[d].set(e,this[u].head),_(this),!0)}has(e){if(!this[d].has(e))return!1;let t=this[d].get(e).value;return!g(this,t)}get(e){return h(this,e,!0)}peek(e){return h(this,e,!1)}pop(){let e=this[u].tail;return e?(v(this,e),e.value):null}del(e){v(this,this[d].get(e))}load(e){this.reset();let t=Date.now();for(let n=e.length-1;n>=0;n--){let r=e[n],i=r.e||0;if(i===0)this.set(r.k,r.v);else{let e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[d].forEach((e,t)=>h(this,t,!1))}},h=(e,t,n)=>{let r=e[d].get(t);if(r){let t=r.value;if(g(e,t)){if(v(e,r),!e[o])return}else n&&(e[f]&&(r.value.now=Date.now()),e[u].unshiftNode(r));return t.value}},g=(e,t)=>{if(!t||!t.maxAge&&!e[s])return!1;let n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[s]&&n>e[s]},_=e=>{if(e[i]>e[r])for(let t=e[u].tail;e[i]>e[r]&&t!==null;){let n=t.prev;v(e,t),t=n}},v=(e,t)=>{if(t){let n=t.value;e[c]&&e[c](n.key,n.value),e[i]-=n.length,e[d].delete(n.key),e[u].removeNode(t)}},y=class{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}},b=(e,t,n,r)=>{let i=n.value;g(e,i)&&(v(e,n),e[o]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};t.exports=m})),Gn=o(((e,t)=>{var n=Wn(),r=10;t.exports=class{constructor({document:e}){this.document=e,this.cache=new n({max:r})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}})),Kn=o(((e,t)=>{var{isArray:n,isObject:r,isString:i}=Nn(),{asArray:a}=In(),{prependBase:o}=zn(),s=Fn(),c=Gn(),l=10;t.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:o,base:s,cycles:l=new Set}){t&&r(t)&&t[`@context`]&&(t=t[`@context`]),t=a(t);let d=[];for(let a of t){if(i(a)){let t=this._get(a);t||=await this._resolveRemoteContext({activeCtx:e,url:a,documentLoader:o,base:s,cycles:l}),n(t)?d.push(...t):d.push(t);continue}if(a===null){d.push(new c({document:null}));continue}r(a)||u(t);let f=JSON.stringify(a),p=this._get(f);p||(p=new c({document:a}),this._cacheResolvedContext({key:f,resolved:p,tag:`static`})),d.push(p)}return d}_get(e){let t=this.perOpCache.get(e);if(!t){let n=this.sharedCache.get(e);n&&(t=n.get(`static`),t&&this.perOpCache.set(e,t))}return t}_cacheResolvedContext({key:e,resolved:t,tag:n}){if(this.perOpCache.set(e,t),n!==void 0){let r=this.sharedCache.get(e);r||(r=new Map,this.sharedCache.set(e,r)),r.set(n,t)}return t}async _resolveRemoteContext({activeCtx:e,url:t,documentLoader:n,base:r,cycles:i}){t=o(r,t);let{context:a,remoteDoc:s}=await this._fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:i});r=s.documentUrl||t,d({context:a,base:r});let c=await this.resolve({activeCtx:e,context:a,documentLoader:n,base:r,cycles:i});return this._cacheResolvedContext({key:t,resolved:c,tag:s.tag}),c}async _fetchContext({activeCtx:e,url:t,documentLoader:a,cycles:o}){if(o.size>l)throw new s(`Maximum number of @context URLs exceeded.`,`jsonld.ContextUrlError`,{code:e.processingMode===`json-ld-1.0`?`loading remote context failed`:`context overflow`,max:l});if(o.has(t))throw new s(`Cyclical @context URLs detected.`,`jsonld.ContextUrlError`,{code:e.processingMode===`json-ld-1.0`?`recursive context inclusion`:`context overflow`,url:t});o.add(t);let c,u;try{u=await a(t),c=u.document||null,i(c)&&(c=JSON.parse(c))}catch(e){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: "${t}".`,`jsonld.InvalidUrl`,{code:`loading remote context failed`,url:t,cause:e})}if(!r(c))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: "${t}".`,`jsonld.InvalidUrl`,{code:`invalid remote context`,url:t});return c=`@context`in c?{"@context":c[`@context`]}:{"@context":{}},u.contextUrl&&(n(c[`@context`])||(c[`@context`]=[c[`@context`]]),c[`@context`].push(u.contextUrl)),{context:c,remoteDoc:u}}};function u(e){throw new s(`Invalid JSON-LD syntax; @context must be an object.`,`jsonld.SyntaxError`,{code:`invalid local context`,context:e})}function d({context:e,base:t}){if(!e)return;let a=e[`@context`];if(i(a)){e[`@context`]=o(t,a);return}if(n(a)){for(let e=0;e<a.length;++e){let n=a[e];if(i(n)){a[e]=o(t,n);continue}r(n)&&d({context:{"@context":n},base:t})}return}if(r(a))for(let e in a)d({context:a[e],base:t})}})),qn=o(((e,t)=>{t.exports=Mn().NQuads})),Jn=o(((e,t)=>{var n=Fn(),{isArray:r}=Nn(),{asArray:i}=In(),a={};t.exports=a,a.defaultEventHandler=null,a.setupEventHandler=({options:e={}})=>{let t=[].concat(e.safe?a.safeEventHandler:[],e.eventHandler?i(e.eventHandler):[],a.defaultEventHandler?a.defaultEventHandler:[]);return t.length===0?null:t},a.handleEvent=({event:e,options:t})=>{o({event:e,handlers:t.eventHandler})};function o({event:e,handlers:t}){let i=!0;for(let a=0;i&&a<t.length;++a){i=!1;let s=t[a];if(r(s))i=o({event:e,handlers:s});else if(typeof s==`function`)s({event:e,next:()=>{i=!0}});else if(typeof s==`object`)e.code in s?s[e.code]({event:e,next:()=>{i=!0}}):i=!0;else throw new n(`Invalid event handler.`,`jsonld.InvalidEventHandler`,{event:e})}return i}var 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`]);a.safeEventHandler=function({event:e,next:t}){if(e.level===`warning`&&s.has(e.code))throw new n(`Safe mode validation error.`,`jsonld.ValidationError`,{event:e});t()},a.logEventHandler=function({event:e,next:t}){console.log(`EVENT: ${e.message}`,{event:e}),t()},a.logWarningEventHandler=function({event:e,next:t}){e.level===`warning`&&console.warn(`WARNING: ${e.message}`,{event:e}),t()},a.unhandledEventHandler=function({event:e}){throw new n(`No handler for event.`,`jsonld.UnhandledEvent`,{event:e})},a.setDefaultEventHandler=function({eventHandler:e}={}){a.defaultEventHandler=e?i(e):null}})),Yn=o(((e,t)=>{var n=In(),r=Fn(),{isArray:i,isObject:a,isString:o,isUndefined:s}=Nn(),{isAbsolute:c,isRelative:l,prependBase:u}=zn(),{handleEvent:d}=Jn(),{REGEX_BCP47:f,REGEX_KEYWORD:p,asArray:m,compareShortestLeast:h}=In(),g=new Map,_=1e4,v={};t.exports=v,v.process=async({activeCtx:e,localCtx:t,options:n,propagate:s=!0,overrideProtected:p=!1,cycles:h=new Set})=>{if(a(t)&&`@context`in t&&i(t[`@context`])&&(t=t[`@context`]),m(t).length===0)return e;let g=[],_=[({event:e,next:t})=>{g.push(e),t()}];n.eventHandler&&_.push(n.eventHandler);let b=n;n={...n,eventHandler:_};let x=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});a(x[0].document)&&typeof x[0].document[`@propagate`]==`boolean`&&(s=x[0].document[`@propagate`]);let S=e;!s&&!S.previousContext&&(S=S.clone(),S.previousContext=e);for(let i of x){let{document:s}=i;if(e=S,s===null){if(!p&&Object.keys(e.protected).length!==0)throw new r(`Tried to nullify a context with protected terms outside of a term definition.`,`jsonld.SyntaxError`,{code:`invalid context nullification`});S=e=v.getInitialContext(n).clone();continue}let m=i.getProcessed(e);if(m){if(b.eventHandler)for(let e of m.events)d({event:e,options:b});S=e=m.context;continue}if(a(s)&&`@context`in s&&(s=s[`@context`]),!a(s))throw new r(`Invalid JSON-LD syntax; @context must be an object.`,`jsonld.SyntaxError`,{code:`invalid local context`,context:s});S=S.clone();let _=new Map;if(`@version`in s){if(s[`@version`]!==1.1)throw new r(`Unsupported JSON-LD version: `+s[`@version`],`jsonld.UnsupportedVersion`,{code:`invalid @version value`,context:s});if(e.processingMode&&e.processingMode===`json-ld-1.0`)throw new r(`@version: `+s[`@version`]+` not compatible with `+e.processingMode,`jsonld.ProcessingModeConflict`,{code:`processing mode conflict`,context:s});S.processingMode=`json-ld-1.1`,S[`@version`]=s[`@version`],_.set(`@version`,!0)}if(S.processingMode=S.processingMode||e.processingMode,`@base`in s){let e=s[`@base`];if(!(e===null||c(e)))if(l(e))e=u(S[`@base`],e);else throw new r(`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:s});S[`@base`]=e,_.set(`@base`,!0)}if(`@vocab`in s){let e=s[`@vocab`];if(e===null)delete S[`@vocab`];else if(!o(e))throw new r(`Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.`,`jsonld.SyntaxError`,{code:`invalid vocab mapping`,context:s});else if(!c(e)&&v.processingMode(S,1))throw new r(`Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.`,`jsonld.SyntaxError`,{code:`invalid vocab mapping`,context:s});else{let t=y(S,e,{vocab:!0,base:!0},void 0,void 0,n);c(t)||n.eventHandler&&d({event:{type:[`JsonLdEvent`],code:`relative @vocab reference`,level:`warning`,message:`Relative @vocab reference found.`,details:{vocab:t}},options:n}),S[`@vocab`]=t}_.set(`@vocab`,!0)}if(`@language`in s){let e=s[`@language`];if(e===null)delete S[`@language`];else if(o(e))e.match(f)||n.eventHandler&&d({event:{type:[`JsonLdEvent`],code:`invalid @language value`,level:`warning`,message:`@language value must be valid BCP47.`,details:{language:e}},options:n}),S[`@language`]=e.toLowerCase();else throw new r(`Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.`,`jsonld.SyntaxError`,{code:`invalid default language`,context:s});_.set(`@language`,!0)}if(`@direction`in s){let t=s[`@direction`];if(e.processingMode===`json-ld-1.0`)throw new r(`Invalid JSON-LD syntax; @direction not compatible with `+e.processingMode,`jsonld.SyntaxError`,{code:`invalid context member`,context:s});if(t===null)delete S[`@direction`];else if(t!==`ltr`&&t!==`rtl`)throw new r(`Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".`,`jsonld.SyntaxError`,{code:`invalid base direction`,context:s});else S[`@direction`]=t;_.set(`@direction`,!0)}if(`@propagate`in s){let n=s[`@propagate`];if(e.processingMode===`json-ld-1.0`)throw new r(`Invalid JSON-LD syntax; @propagate not compatible with `+e.processingMode,`jsonld.SyntaxError`,{code:`invalid context entry`,context:s});if(typeof n!=`boolean`)throw new r(`Invalid JSON-LD syntax; @propagate value must be a boolean.`,`jsonld.SyntaxError`,{code:`invalid @propagate value`,context:t});_.set(`@propagate`,!0)}if(`@import`in s){let i=s[`@import`];if(e.processingMode===`json-ld-1.0`)throw new r(`Invalid JSON-LD syntax; @import not compatible with `+e.processingMode,`jsonld.SyntaxError`,{code:`invalid context entry`,context:s});if(!o(i))throw new r(`Invalid JSON-LD syntax; @import must be a string.`,`jsonld.SyntaxError`,{code:`invalid @import value`,context:t});let a=await n.contextResolver.resolve({activeCtx:e,context:i,documentLoader:n.documentLoader,base:n.base});if(a.length!==1)throw new r(`Invalid JSON-LD syntax; @import must reference a single context.`,`jsonld.SyntaxError`,{code:`invalid remote context`,context:t});let c=a[0].getProcessed(e);if(c)s=c;else{let n=a[0].document;if(`@import`in n)throw new r(`Invalid JSON-LD syntax: imported context must not include @import.`,`jsonld.SyntaxError`,{code:`invalid context entry`,context:t});for(let e in n)s.hasOwnProperty(e)||(s[e]=n[e]);a[0].setProcessed(e,s)}_.set(`@import`,!0)}_.set(`@protected`,s[`@protected`]||!1);for(let e in s)if(v.createTermDefinition({activeCtx:S,localCtx:s,term:e,defined:_,options:n,overrideProtected:p}),a(s[e])&&`@context`in s[e]){let t=s[e][`@context`],i=!0;if(o(t)){let e=u(n.base,t);h.has(e)?i=!1:h.add(e)}if(i)try{await v.process({activeCtx:S.clone(),localCtx:s[e][`@context`],overrideProtected:!0,options:n,cycles:h})}catch{throw new r(`Invalid JSON-LD syntax; invalid scoped context.`,`jsonld.SyntaxError`,{code:`invalid scoped context`,context:s[e][`@context`],term:e})}}i.setProcessed(e,{context:S,events:g})}return S},v.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:s,options:l,overrideProtected:u=!1})=>{if(s.has(n)){if(s.get(n))return;throw new r(`Cyclical context definition detected.`,`jsonld.CyclicalContext`,{code:`cyclic IRI mapping`,context:t,term:n})}s.set(n,!1);let f;if(t.hasOwnProperty(n)&&(f=t[n]),n===`@type`&&a(f)&&(f[`@container`]||`@set`)===`@set`&&v.processingMode(e,1.1)){let e=[`@container`,`@id`,`@protected`],i=Object.keys(f);if(i.length===0||i.some(t=>!e.includes(t)))throw new r(`Invalid JSON-LD syntax; keywords cannot be overridden.`,`jsonld.SyntaxError`,{code:`keyword redefinition`,context:t,term:n})}else if(v.isKeyword(n))throw new r(`Invalid JSON-LD syntax; keywords cannot be overridden.`,`jsonld.SyntaxError`,{code:`keyword redefinition`,context:t,term:n});else if(n.match(p)){l.eventHandler&&d({event:{type:[`JsonLdEvent`],code:`reserved term`,level:`warning`,message:`Terms beginning with "@" are reserved for future use and dropped.`,details:{term:n}},options:l});return}else if(n===``)throw new r(`Invalid JSON-LD syntax; a term cannot be an empty string.`,`jsonld.SyntaxError`,{code:`invalid term definition`,context:t});let m=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let h=!1;if((o(f)||f===null)&&(h=!0,f={"@id":f}),!a(f))throw new r(`Invalid JSON-LD syntax; @context term values must be strings or objects.`,`jsonld.SyntaxError`,{code:`invalid term definition`,context:t});let g={};e.mappings.set(n,g),g.reverse=!1;let _=[`@container`,`@id`,`@language`,`@reverse`,`@type`];v.processingMode(e,1.1)&&_.push(`@context`,`@direction`,`@index`,`@nest`,`@prefix`,`@protected`);for(let e in f)if(!_.includes(e))throw new r(`Invalid JSON-LD syntax; a term definition must not contain `+e,`jsonld.SyntaxError`,{code:`invalid term definition`,context:t});let x=n.indexOf(`:`);if(g._termHasColon=x>0,`@reverse`in f){if(`@id`in f)throw new r(`Invalid JSON-LD syntax; a @reverse term definition must not contain @id.`,`jsonld.SyntaxError`,{code:`invalid reverse property`,context:t});if(`@nest`in f)throw new r(`Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.`,`jsonld.SyntaxError`,{code:`invalid reverse property`,context:t});let i=f[`@reverse`];if(!o(i))throw new r(`Invalid JSON-LD syntax; a @context @reverse value must be a string.`,`jsonld.SyntaxError`,{code:`invalid IRI mapping`,context:t});if(i.match(p)){l.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:i}},options:l}),m?e.mappings.set(n,m):e.mappings.delete(n);return}let a=y(e,i,{vocab:!0,base:!1},t,s,l);if(!c(a))throw new r(`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:t});g[`@id`]=a,g.reverse=!0}else if(`@id`in f){let i=f[`@id`];if(i&&!o(i))throw new r(`Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.`,`jsonld.SyntaxError`,{code:`invalid IRI mapping`,context:t});if(i===null)g[`@id`]=null;else if(!v.isKeyword(i)&&i.match(p)){l.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:i}},options:l}),m?e.mappings.set(n,m):e.mappings.delete(n);return}else if(i!==n){if(i=y(e,i,{vocab:!0,base:!1},t,s,l),!c(i)&&!v.isKeyword(i))throw new r(`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:t});if(n.match(/(?::[^:])|\//)&&y(e,n,{vocab:!0,base:!1},t,new Map(s).set(n,!0),l)!==i)throw new r(`Invalid JSON-LD syntax; term in form of IRI must expand to definition.`,`jsonld.SyntaxError`,{code:`invalid IRI mapping`,context:t});g[`@id`]=i,g._prefix=h&&!g._termHasColon&&i.match(/[:\/\?#\[\]@]$/)!==null}}if(!(`@id`in g))if(g._termHasColon){let r=n.substr(0,x);if(t.hasOwnProperty(r)&&v.createTermDefinition({activeCtx:e,localCtx:t,term:r,defined:s,options:l}),e.mappings.has(r)){let t=n.substr(x+1);g[`@id`]=e.mappings.get(r)[`@id`]+t}else g[`@id`]=n}else if(n===`@type`)g[`@id`]=n;else{if(!(`@vocab`in e))throw new r(`Invalid JSON-LD syntax; @context terms must define an @id.`,`jsonld.SyntaxError`,{code:`invalid IRI mapping`,context:t,term:n});g[`@id`]=e[`@vocab`]+n}if((f[`@protected`]===!0||s.get(`@protected`)===!0&&f[`@protected`]!==!1)&&(e.protected[n]=!0,g.protected=!0),s.set(n,!0),`@type`in f){let n=f[`@type`];if(!o(n))throw new r(`Invalid JSON-LD syntax; an @context @type value must be a string.`,`jsonld.SyntaxError`,{code:`invalid type mapping`,context:t});if(n===`@json`||n===`@none`){if(v.processingMode(e,1))throw new r(`Invalid JSON-LD syntax; an @context @type value must not be "${n}" in JSON-LD 1.0 mode.`,`jsonld.SyntaxError`,{code:`invalid type mapping`,context:t})}else if(n!==`@id`&&n!==`@vocab`){if(n=y(e,n,{vocab:!0,base:!1},t,s,l),!c(n))throw new r(`Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.`,`jsonld.SyntaxError`,{code:`invalid type mapping`,context:t});if(n.indexOf(`_:`)===0)throw new r(`Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.`,`jsonld.SyntaxError`,{code:`invalid type mapping`,context:t})}g[`@type`]=n}if(`@container`in f){let n=o(f[`@container`])?[f[`@container`]]:f[`@container`]||[],a=[`@list`,`@set`,`@index`,`@language`],s=!0,c=n.includes(`@set`);if(v.processingMode(e,1.1)){if(a.push(`@graph`,`@id`,`@type`),n.includes(`@list`)){if(n.length!==1)throw new r(`Invalid JSON-LD syntax; @context @container with @list must have no other values`,`jsonld.SyntaxError`,{code:`invalid container mapping`,context:t})}else if(n.includes(`@graph`)){if(n.some(e=>e!==`@graph`&&e!==`@id`&&e!==`@index`&&e!==`@set`))throw new r(`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:t})}else s&=n.length<=(c?2:1);if(n.includes(`@type`)&&(g[`@type`]=g[`@type`]||`@id`,![`@id`,`@vocab`].includes(g[`@type`])))throw new r(`Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.`,`jsonld.SyntaxError`,{code:`invalid type mapping`,context:t})}else s&=!i(f[`@container`]),s&=n.length<=1;if(s&=n.every(e=>a.includes(e)),s&=!(c&&n.includes(`@list`)),!s)throw new r(`Invalid JSON-LD syntax; @context @container value must be one of the following: `+a.join(`, `),`jsonld.SyntaxError`,{code:`invalid container mapping`,context:t});if(g.reverse&&!n.every(e=>[`@index`,`@set`].includes(e)))throw new r(`Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.`,`jsonld.SyntaxError`,{code:`invalid reverse property`,context:t});g[`@container`]=n}if(`@index`in f){if(!(`@container`in f)||!g[`@container`].includes(`@index`))throw new r(`Invalid JSON-LD syntax; @index without @index in @container: "${f[`@index`]}" on term "${n}".`,`jsonld.SyntaxError`,{code:`invalid term definition`,context:t});if(!o(f[`@index`])||f[`@index`].indexOf(`@`)===0)throw new r(`Invalid JSON-LD syntax; @index must expand to an IRI: "${f[`@index`]}" on term "${n}".`,`jsonld.SyntaxError`,{code:`invalid term definition`,context:t});g[`@index`]=f[`@index`]}if(`@context`in f&&(g[`@context`]=f[`@context`]),`@language`in f&&!(`@type`in f)){let e=f[`@language`];if(e!==null&&!o(e))throw new r(`Invalid JSON-LD syntax; @context @language value must be a string or null.`,`jsonld.SyntaxError`,{code:`invalid language mapping`,context:t});e!==null&&(e=e.toLowerCase()),g[`@language`]=e}if(`@prefix`in f){if(n.match(/:|\//))throw new r(`Invalid JSON-LD syntax; @context @prefix used on a compact IRI term`,`jsonld.SyntaxError`,{code:`invalid term definition`,context:t});if(v.isKeyword(g[`@id`]))throw new r(`Invalid JSON-LD syntax; keywords may not be used as prefixes`,`jsonld.SyntaxError`,{code:`invalid term definition`,context:t});if(typeof f[`@prefix`]==`boolean`)g._prefix=f[`@prefix`]===!0;else throw new r(`Invalid JSON-LD syntax; @context value for @prefix must be boolean`,`jsonld.SyntaxError`,{code:`invalid @prefix value`,context:t})}if(`@direction`in f){let e=f[`@direction`];if(e!==null&&e!==`ltr`&&e!==`rtl`)throw new r(`Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".`,`jsonld.SyntaxError`,{code:`invalid base direction`,context:t});g[`@direction`]=e}if(`@nest`in f){let e=f[`@nest`];if(!o(e)||e!==`@nest`&&e.indexOf(`@`)===0)throw new r(`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:t});g[`@nest`]=e}let S=g[`@id`];if(S===`@context`||S===`@preserve`)throw new r(`Invalid JSON-LD syntax; @context and @preserve cannot be aliased.`,`jsonld.SyntaxError`,{code:`invalid keyword alias`,context:t});if(m&&m.protected&&!u&&(e.protected[n]=!0,g.protected=!0,!b(m,g)))throw new r(`Invalid JSON-LD syntax; tried to redefine a protected term.`,`jsonld.SyntaxError`,{code:`protected term redefinition`,context:t,term:n})},v.expandIri=(e,t,n,r)=>y(e,t,n,void 0,void 0,r);function y(e,t,n,r,i,s){if(t===null||!o(t)||v.isKeyword(t))return t;if(t.match(p))return null;if(r&&r.hasOwnProperty(t)&&i.get(t)!==!0&&v.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:s}),n||={},n.vocab){let n=e.mappings.get(t);if(n===null)return null;if(a(n)&&`@id`in n)return n[`@id`]}let l=t.indexOf(`:`);if(l>0){let n=t.substr(0,l),a=t.substr(l+1);if(n===`_`||a.indexOf(`//`)===0)return t;r&&r.hasOwnProperty(n)&&v.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:s});let o=e.mappings.get(n);if(o&&o._prefix)return o[`@id`]+a;if(c(t))return t}if(n.vocab&&`@vocab`in e)t=e[`@vocab`]+t;else if(n.base){let n,r;`@base`in e?e[`@base`]?(r=u(s.base,e[`@base`]),n=u(r,t)):(r=e[`@base`],n=t):(r=s.base,n=u(s.base,t)),t=n}return t}v.getInitialContext=e=>{let t=JSON.stringify({processingMode:e.processingMode}),r=g.get(t);if(r)return r;let i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:a,clone:c,revertToPreviousContext:l,protected:{}};return g.size===_&&g.clear(),g.set(t,i),i;function a(){let e=this;if(e.inverse)return e.inverse;let t=e.inverse={},n=e.fastCurieMap={},r={},i=(e[`@language`]||`@none`).toLowerCase(),a=e[`@direction`],c=e.mappings,l=[...c.keys()].sort(h);for(let e of l){let o=c.get(e);if(o===null)continue;let l=o[`@container`]||`@none`;if(l=[].concat(l).sort().join(``),o[`@id`]===null)continue;let u=m(o[`@id`]);for(let c of u){let u=t[c],d=v.isKeyword(c);if(u)!d&&!o._termHasColon&&r[c].push(e);else if(t[c]=u={},!d&&!o._termHasColon){r[c]=[e];let t={iri:c,terms:r[c]};c[0]in n?n[c[0]].push(t):n[c[0]]=[t]}if(u[l]||(u[l]={"@language":{},"@type":{},"@any":{}}),u=u[l],s(e,u[`@any`],`@none`),o.reverse)s(e,u[`@type`],`@reverse`);else if(o[`@type`]===`@none`)s(e,u[`@any`],`@none`),s(e,u[`@language`],`@none`),s(e,u[`@type`],`@none`);else if(`@type`in o)s(e,u[`@type`],o[`@type`]);else if(`@language`in o&&`@direction`in o){let t=o[`@language`],n=o[`@direction`];t&&n?s(e,u[`@language`],`${t}_${n}`.toLowerCase()):t?s(e,u[`@language`],t.toLowerCase()):n?s(e,u[`@language`],`_${n}`):s(e,u[`@language`],`@null`)}else`@language`in o?s(e,u[`@language`],(o[`@language`]||`@null`).toLowerCase()):`@direction`in o?o[`@direction`]?s(e,u[`@language`],`_${o[`@direction`]}`):s(e,u[`@language`],`@none`):a?(s(e,u[`@language`],`_${a}`),s(e,u[`@language`],`@none`),s(e,u[`@type`],`@none`)):(s(e,u[`@language`],i),s(e,u[`@language`],`@none`),s(e,u[`@type`],`@none`))}}for(let e in n)o(n,e,1);return t}function o(e,t,n){let r=e[t],i=e[t]={},a,s;for(let e of r)a=e.iri,s=n>=a.length?``:a[n],s in i?i[s].push(e):i[s]=[e];for(let e in i)e!==``&&o(i,e,n+1)}function s(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}function c(){let e={};return e.mappings=n.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=n.clone(this.protected),this.previousContext&&(e.previousContext=this.previousContext.clone()),e.revertToPreviousContext=this.revertToPreviousContext,`@base`in this&&(e[`@base`]=this[`@base`]),`@language`in this&&(e[`@language`]=this[`@language`]),`@vocab`in this&&(e[`@vocab`]=this[`@vocab`]),e}function l(){return this.previousContext?this.previousContext.clone():this}},v.getContextValue=(e,t,n)=>{if(t===null)return n===`@context`?void 0:null;if(e.mappings.has(t)){let r=e.mappings.get(t);if(s(n))return r;if(r.hasOwnProperty(n))return r[n]}if(n===`@language`&&n in e||n===`@direction`&&n in e)return e[n];if(n!==`@context`)return null},v.processingMode=(e,t)=>t.toString()>=`1.1`?!e.processingMode||e.processingMode>=`json-ld-`+t.toString():e.processingMode===`json-ld-1.0`,v.isKeyword=e=>{if(!o(e)||e[0]!==`@`)return!1;switch(e){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 b(e,t){if(!(e&&typeof e==`object`)||!(t&&typeof t==`object`))return e===t;let n=Array.isArray(e);if(n!==Array.isArray(t))return!1;if(n){if(e.length!==t.length)return!1;for(let n=0;n<e.length;++n)if(!b(e[n],t[n]))return!1;return!0}let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(let n in e){let r=e[n],i=t[n];if(n===`@container`&&Array.isArray(r)&&Array.isArray(i)&&(r=r.slice().sort(),i=i.slice().sort()),!b(r,i))return!1}return!0}})),Xn=o(((e,t)=>{var n=Fn(),{isArray:r,isObject:i,isEmptyObject:a,isString:o,isUndefined:s}=Nn(),{isList:c,isValue:l,isGraph:u,isSubject:d}=Pn(),{expandIri:f,getContextValue:p,isKeyword:m,process:h,processingMode:g}=Yn(),{isAbsolute:_}=zn(),{REGEX_BCP47:v,REGEX_KEYWORD:y,addValue:b,asArray:x,getValues:S,validateTypeValue:C}=In(),{handleEvent:w}=Jn(),T={};t.exports=T,T.expand=async({activeCtx:e,activeProperty:t=null,element:c,options:l={},insideList:u=!1,insideIndex:d=!1,typeScopedContext:m=null})=>{if(c==null)return null;if(t===`@default`&&(l=Object.assign({},l,{isFrame:!1})),!r(c)&&!i(c))return!u&&(t===null||f(e,t,{vocab:!0},l)===`@graph`)?(l.eventHandler&&w({event:{type:[`JsonLdEvent`],code:`free-floating scalar`,level:`warning`,message:`Dropping free-floating scalar not in a list.`,details:{value:c}},options:l}),null):O({activeCtx:e,activeProperty:t,value:c,options:l});if(r(c)){let n=[],i=p(e,t,`@container`)||[];u||=i.includes(`@list`);for(let i=0;i<c.length;++i){let a=await T.expand({activeCtx:e,activeProperty:t,element:c[i],options:l,insideIndex:d,typeScopedContext:m});u&&r(a)&&(a={"@list":a}),a!==null&&(r(a)?n=n.concat(a):n.push(a))}return n}let v=f(e,t,{vocab:!0},l),y=p(e,t,`@context`);m||=e.previousContext?e:null;let b=Object.keys(c).sort(),C=!d;if(C&&m&&b.length<=2&&!b.includes(`@context`))for(let t of b){let n=f(m,t,{vocab:!0},l);if(n===`@value`){C=!1,e=m;break}if(n===`@id`&&b.length===1){C=!1;break}}C&&(e=e.revertToPreviousContext()),s(y)||(e=await h({activeCtx:e,localCtx:y,propagate:!0,overrideProtected:!0,options:l})),`@context`in c&&(e=await h({activeCtx:e,localCtx:c[`@context`],options:l})),m=e;let k=null;for(let t of b)if(f(e,t,{vocab:!0},l)===`@type`){k||=t;let n=c[t],r=Array.isArray(n)?n.length>1?n.slice().sort():n:[n];for(let t of r){let n=p(m,t,`@context`);s(n)||(e=await h({activeCtx:e,localCtx:n,options:l,propagate:!1}))}}let A={};await D({activeCtx:e,activeProperty:t,expandedActiveProperty:v,element:c,expandedParent:A,options:l,insideList:u,typeKey:k,typeScopedContext:m}),b=Object.keys(A);let j=b.length;if(`@value`in A){if(`@type`in A&&(`@language`in A||`@direction`in A))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:A});let t=j-1;if(`@type`in A&&--t,`@index`in A&&--t,`@language`in A&&--t,`@direction`in A&&--t,t!==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:A});let r=A[`@value`]===null?[]:x(A[`@value`]),i=S(A,`@type`);if(!(g(e,1.1)&&i.includes(`@json`)&&i.length===1)){if(r.length===0)l.eventHandler&&w({event:{type:[`JsonLdEvent`],code:`null @value value`,level:`warning`,message:`Dropping null @value value.`,details:{value:A}},options:l}),A=null;else if(!r.every(e=>o(e)||a(e))&&`@language`in A)throw new n(`Invalid JSON-LD syntax; only strings may be language-tagged.`,`jsonld.SyntaxError`,{code:`invalid language-tagged value`,element:A});else if(!i.every(e=>_(e)&&!(o(e)&&e.indexOf(`_:`)===0)||a(e)))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:A})}}else if(`@type`in A&&!r(A[`@type`]))A[`@type`]=[A[`@type`]];else if(`@set`in A||`@list`in A){if(j>1&&!(j===2&&`@index`in A))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:A});`@set`in A&&(A=A[`@set`],b=Object.keys(A),j=b.length)}else j===1&&`@language`in A&&(l.eventHandler&&w({event:{type:[`JsonLdEvent`],code:`object with only @language`,level:`warning`,message:`Dropping object with only @language.`,details:{value:A}},options:l}),A=null);return i(A)&&!l.keepFreeFloatingNodes&&!u&&(t===null||v===`@graph`||(p(e,t,`@container`)||[]).includes(`@graph`))&&(A=E({value:A,count:j,options:l})),A};function E({value:e,count:t,options:n}){if(t===0||`@value`in e||`@list`in e||t===1&&`@id`in e){if(n.eventHandler){let r,i;t===0?(r=`empty object`,i=`Dropping empty object.`):`@value`in e?(r=`object with only @value`,i=`Dropping object with only @value.`):`@list`in e?(r=`object with only @list`,i=`Dropping object with only @list.`):t===1&&`@id`in e&&(r=`object with only @id`,i=`Dropping object with only @id.`),w({event:{type:[`JsonLdEvent`],code:r,level:`warning`,message:i,details:{value:e}},options:n})}return null}return e}async function D({activeCtx:e,activeProperty:t,expandedActiveProperty:u,element:y,expandedParent:S,options:O={},insideList:j,typeKey:M,typeScopedContext:N}){let P=Object.keys(y).sort(),F=[],I,L=y[M]&&f(e,r(y[M])?y[M][0]:y[M],{vocab:!0},{...O,typeExpansion:!0})===`@json`;for(let D of P){let j=y[D],M;if(D===`@context`)continue;let P=f(e,D,{vocab:!0},O);if(P===null||!(_(P)||m(P))){O.eventHandler&&w({event:{type:[`JsonLdEvent`],code:`invalid property`,level:`warning`,message:`Dropping property that did not expand into an absolute IRI or keyword.`,details:{property:D,expandedProperty:P}},options:O});continue}if(m(P)){if(u===`@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:j});if(P in S&&P!==`@included`&&P!==`@type`)throw new n(`Invalid JSON-LD syntax; colliding keywords detected.`,`jsonld.SyntaxError`,{code:`colliding keywords`,keyword:P})}if(P===`@id`){if(!o(j)){if(!O.isFrame)throw new n(`Invalid JSON-LD syntax; "@id" value must a string.`,`jsonld.SyntaxError`,{code:`invalid @id value`,value:j});if(i(j)){if(!a(j))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:j})}else if(r(j)){if(!j.every(e=>o(e)))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:j})}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:j})}b(S,`@id`,x(j).map(t=>{if(o(t)){let n=f(e,t,{base:!0},O);return O.eventHandler&&(n===null?w(t===null?{event:{type:[`JsonLdEvent`],code:`null @id value`,level:`warning`,message:`Null @id found.`,details:{id:t}},options:O}:{event:{type:[`JsonLdEvent`],code:`reserved @id value`,level:`warning`,message:`Reserved @id found.`,details:{id:t}},options:O}):_(n)||w({event:{type:[`JsonLdEvent`],code:`relative @id reference`,level:`warning`,message:`Relative @id reference found.`,details:{id:t,expandedId:n}},options:O})),n}return t}),{propertyIsArray:O.isFrame});continue}if(P===`@type`){i(j)&&(j=Object.fromEntries(Object.entries(j).map(([e,t])=>[f(N,e,{vocab:!0}),x(t).map(e=>f(N,e,{base:!0,vocab:!0},{...O,typeExpansion:!0}))]))),C(j,O.isFrame),b(S,`@type`,x(j).map(e=>{if(o(e)){let t=f(N,e,{base:!0,vocab:!0},{...O,typeExpansion:!0});return t!==`@json`&&!_(t)&&O.eventHandler&&w({event:{type:[`JsonLdEvent`],code:`relative @type reference`,level:`warning`,message:`Relative @type reference found.`,details:{type:e}},options:O}),t}return e}),{propertyIsArray:!!O.isFrame});continue}if(P===`@included`&&g(e,1.1)){let r=x(await T.expand({activeCtx:e,activeProperty:t,element:j,options:O}));if(!r.every(e=>d(e)))throw new n(`Invalid JSON-LD syntax; values of @included must expand to node objects.`,`jsonld.SyntaxError`,{code:`invalid @included value`,value:j});b(S,`@included`,r,{propertyIsArray:!0});continue}if(P===`@graph`&&!(i(j)||r(j)))throw new n(`Invalid JSON-LD syntax; "@graph" value must not be an object or an array.`,`jsonld.SyntaxError`,{code:`invalid @graph value`,value:j});if(P===`@value`){I=j,L&&g(e,1.1)?S[`@value`]=j:b(S,`@value`,j,{propertyIsArray:O.isFrame});continue}if(P===`@language`){if(j===null)continue;if(!o(j)&&!O.isFrame)throw new n(`Invalid JSON-LD syntax; "@language" value must be a string.`,`jsonld.SyntaxError`,{code:`invalid language-tagged string`,value:j});j=x(j).map(e=>o(e)?e.toLowerCase():e);for(let e of j)o(e)&&!e.match(v)&&O.eventHandler&&w({event:{type:[`JsonLdEvent`],code:`invalid @language value`,level:`warning`,message:`@language value must be valid BCP47.`,details:{language:e}},options:O});b(S,`@language`,j,{propertyIsArray:O.isFrame});continue}if(P===`@direction`){if(!o(j)&&!O.isFrame)throw new n(`Invalid JSON-LD syntax; "@direction" value must be a string.`,`jsonld.SyntaxError`,{code:`invalid base direction`,value:j});j=x(j);for(let e of j)if(o(e)&&e!==`ltr`&&e!==`rtl`)throw new n(`Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".`,`jsonld.SyntaxError`,{code:`invalid base direction`,value:j});b(S,`@direction`,j,{propertyIsArray:O.isFrame});continue}if(P===`@index`){if(!o(j))throw new n(`Invalid JSON-LD syntax; "@index" value must be a string.`,`jsonld.SyntaxError`,{code:`invalid @index value`,value:j});b(S,`@index`,j);continue}if(P===`@reverse`){if(!i(j))throw new n(`Invalid JSON-LD syntax; "@reverse" value must be an object.`,`jsonld.SyntaxError`,{code:`invalid @reverse value`,value:j});if(M=await T.expand({activeCtx:e,activeProperty:`@reverse`,element:j,options:O}),`@reverse`in M)for(let e in M[`@reverse`])b(S,e,M[`@reverse`][e],{propertyIsArray:!0});let t=S[`@reverse`]||null;for(let e in M){if(e===`@reverse`)continue;t===null&&(t=S[`@reverse`]={}),b(t,e,[],{propertyIsArray:!0});let r=M[e];for(let i=0;i<r.length;++i){let a=r[i];if(l(a)||c(a))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:M});b(t,e,a,{propertyIsArray:!0})}}continue}if(P===`@nest`){F.push(D);continue}let R=e,z=p(e,D,`@context`);s(z)||(R=await h({activeCtx:e,localCtx:z,propagate:!0,overrideProtected:!0,options:O}));let B=p(e,D,`@container`)||[];if(B.includes(`@language`)&&i(j)){let e=p(R,D,`@direction`);M=k(R,j,e,O)}else if(B.includes(`@index`)&&i(j)){let t=B.includes(`@graph`),n=p(R,D,`@index`)||`@index`,r=n!==`@index`&&f(e,n,{vocab:!0},O);M=await A({activeCtx:R,options:O,activeProperty:D,value:j,asGraph:t,indexKey:n,propertyIndex:r})}else if(B.includes(`@id`)&&i(j)){let e=B.includes(`@graph`);M=await A({activeCtx:R,options:O,activeProperty:D,value:j,asGraph:e,indexKey:`@id`})}else if(B.includes(`@type`)&&i(j))M=await A({activeCtx:R.revertToPreviousContext(),options:O,activeProperty:D,value:j,asGraph:!1,indexKey:`@type`});else{let n=P===`@list`;if(n||P===`@set`){let e=t;n&&u===`@graph`&&(e=null),M=await T.expand({activeCtx:R,activeProperty:e,element:j,options:O,insideList:n})}else M=p(e,D,`@type`)===`@json`?{"@type":`@json`,"@value":j}:await T.expand({activeCtx:R,activeProperty:D,element:j,options:O,insideList:!1})}if(!(M===null&&P!==`@value`)){if(P!==`@list`&&!c(M)&&B.includes(`@list`)&&(M={"@list":x(M)}),B.includes(`@graph`)&&!B.some(e=>e===`@id`||e===`@index`)){if(M=x(M),O.isFrame||(M=M.filter(e=>{let t=Object.keys(e).length;return E({value:e,count:t,options:O})!==null})),M.length===0)continue;M=M.map(e=>({"@graph":x(e)}))}if(R.mappings.has(D)&&R.mappings.get(D).reverse){let e=S[`@reverse`]=S[`@reverse`]||{};M=x(M);for(let t=0;t<M.length;++t){let r=M[t];if(l(r)||c(r))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:M});b(e,P,r,{propertyIsArray:!0})}continue}b(S,P,M,{propertyIsArray:!0})}}if(`@value`in S&&!(S[`@type`]===`@json`&&g(e,1.1))&&(i(I)||r(I))&&!O.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:I});for(let a of F){let o=r(y[a])?y[a]:[y[a]];for(let r of o){if(!i(r)||Object.keys(r).some(t=>f(e,t,{vocab:!0},O)===`@value`))throw new n(`Invalid JSON-LD syntax; nested value must be a node object.`,`jsonld.SyntaxError`,{code:`invalid @nest value`,value:r});await D({activeCtx:e,activeProperty:t,expandedActiveProperty:u,element:r,expandedParent:S,options:O,insideList:j,typeScopedContext:N,typeKey:M})}}}function O({activeCtx:e,activeProperty:t,value:n,options:r}){if(n==null)return null;let i=f(e,t,{vocab:!0},r);if(i===`@id`)return f(e,n,{base:!0},r);if(i===`@type`)return f(e,n,{vocab:!0,base:!0},{...r,typeExpansion:!0});let a=p(e,t,`@type`);if((a===`@id`||i===`@graph`)&&o(n)){let i=f(e,n,{base:!0},r);return i===null&&n.match(y)&&r.eventHandler&&w({event:{type:[`JsonLdEvent`],code:`reserved @id value`,level:`warning`,message:`Reserved @id found.`,details:{id:t}},options:r}),{"@id":i}}if(a===`@vocab`&&o(n))return{"@id":f(e,n,{vocab:!0,base:!0},r)};if(m(i))return n;let s={};if(a&&![`@id`,`@vocab`,`@none`].includes(a))s[`@type`]=a;else if(o(n)){let n=p(e,t,`@language`);n!==null&&(s[`@language`]=n);let r=p(e,t,`@direction`);r!==null&&(s[`@direction`]=r)}return[`boolean`,`number`,`string`].includes(typeof n)||(n=n.toString()),s[`@value`]=n,s}function k(e,t,i,a){let s=[],c=Object.keys(t).sort();for(let l of c){let c=f(e,l,{vocab:!0},a),u=t[l];r(u)||(u=[u]);for(let e of u){if(e===null)continue;if(!o(e))throw new n(`Invalid JSON-LD syntax; language map values must be strings.`,`jsonld.SyntaxError`,{code:`invalid language map value`,languageMap:t});let r={"@value":e};c!==`@none`&&(l.match(v)||a.eventHandler&&w({event:{type:[`JsonLdEvent`],code:`invalid @language value`,level:`warning`,message:`@language value must be valid BCP47.`,details:{language:l}},options:a}),r[`@language`]=l.toLowerCase()),i&&(r[`@direction`]=i),s.push(r)}}return s}async function A({activeCtx:e,options:t,activeProperty:i,value:a,asGraph:o,indexKey:c,propertyIndex:d}){let m=[],g=Object.keys(a).sort(),_=c===`@type`;for(let v of g){if(_){let n=p(e,v,`@context`);s(n)||(e=await h({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let g=a[v];r(g)||(g=[g]),g=await T.expand({activeCtx:e,activeProperty:i,element:g,options:t,insideList:!1,insideIndex:!0});let y;y=d?v===`@none`?`@none`:O({activeCtx:e,activeProperty:c,value:v,options:t}):f(e,v,{vocab:!0},t),c===`@id`?v=f(e,v,{base:!0},t):_&&(v=y);for(let e of g){if(o&&!u(e)&&(e={"@graph":[e]}),c===`@type`)y===`@none`||(e[`@type`]?e[`@type`]=[v].concat(e[`@type`]):e[`@type`]=[v]);else if(l(e)&&![`@language`,`@type`,`@index`].includes(c))throw new n(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${c}".`,`jsonld.SyntaxError`,{code:`invalid value object`,value:e});else d?y!==`@none`&&b(e,d,y,{propertyIsArray:!0,prependValue:!0}):y!==`@none`&&!(c in e)&&(e[c]=v);m.push(e)}}return m}})),Zn=o(((e,t)=>{var{isKeyword:n}=Yn(),r=Pn(),i=Nn(),a=In(),o=Fn(),s={};t.exports=s,s.createMergedNodeMap=(e,t)=>{t||={};let n=t.issuer||new a.IdentifierIssuer(`_:b`),r={"@default":{}};return s.createNodeMap(e,r,`@default`,n),s.mergeNodeMaps(r)},s.createNodeMap=(e,t,c,l,u,d)=>{if(i.isArray(e)){for(let n of e)s.createNodeMap(n,t,c,l,void 0,d);return}if(!i.isObject(e)){d&&d.push(e);return}if(r.isValue(e)){if(`@type`in e){let t=e[`@type`];t.indexOf(`_:`)===0&&(e[`@type`]=t=l.getId(t))}d&&d.push(e);return}else if(d&&r.isList(e)){let n=[];s.createNodeMap(e[`@list`],t,c,l,u,n),d.push({"@list":n});return}if(`@type`in e){let t=e[`@type`];for(let e of t)e.indexOf(`_:`)===0&&l.getId(e)}i.isUndefined(u)&&(u=r.isBlankNode(e)?l.getId(e[`@id`]):e[`@id`]),d&&d.push({"@id":u});let f=t[c],p=f[u]=f[u]||{};p[`@id`]=u;let m=Object.keys(e).sort();for(let i of m){if(i===`@id`)continue;if(i===`@reverse`){let n={"@id":u},i=e[`@reverse`];for(let e in i){let o=i[e];for(let i of o){let o=i[`@id`];r.isBlankNode(i)&&(o=l.getId(o)),s.createNodeMap(i,t,c,l,o),a.addValue(f[o],e,n,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(i===`@graph`){u in t||(t[u]={}),s.createNodeMap(e[i],t,u,l);continue}if(i===`@included`){s.createNodeMap(e[i],t,c,l);continue}if(i!==`@type`&&n(i)){if(i===`@index`&&i in p&&(e[i]!==p[i]||e[i][`@id`]!==p[i][`@id`]))throw new o(`Invalid JSON-LD syntax; conflicting @index property detected.`,`jsonld.SyntaxError`,{code:`conflicting indexes`,subject:p});p[i]=e[i];continue}let d=e[i];if(i.indexOf(`_:`)===0&&(i=l.getId(i)),d.length===0){a.addValue(p,i,[],{propertyIsArray:!0});continue}for(let e of d)if(i===`@type`&&(e=e.indexOf(`_:`)===0?l.getId(e):e),r.isSubject(e)||r.isSubjectReference(e)){if(`@id`in e&&!e[`@id`])continue;let n=r.isBlankNode(e)?l.getId(e[`@id`]):e[`@id`];a.addValue(p,i,{"@id":n},{propertyIsArray:!0,allowDuplicate:!1}),s.createNodeMap(e,t,c,l,n)}else if(r.isValue(e))a.addValue(p,i,e,{propertyIsArray:!0,allowDuplicate:!1});else if(r.isList(e)){let n=[];s.createNodeMap(e[`@list`],t,c,l,u,n),e={"@list":n},a.addValue(p,i,e,{propertyIsArray:!0,allowDuplicate:!1})}else s.createNodeMap(e,t,c,l,u),a.addValue(p,i,e,{propertyIsArray:!0,allowDuplicate:!1})}},s.mergeNodeMapGraphs=e=>{let t={};for(let r of Object.keys(e).sort())for(let i of Object.keys(e[r]).sort()){let o=e[r][i];i in t||(t[i]={"@id":i});let s=t[i];for(let e of Object.keys(o).sort())if(n(e)&&e!==`@type`)s[e]=a.clone(o[e]);else for(let t of o[e])a.addValue(s,e,a.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},s.mergeNodeMaps=e=>{let t=e[`@default`],n=Object.keys(e).sort();for(let i of n){if(i===`@default`)continue;let n=e[i],a=t[i];a?`@graph`in a||(a[`@graph`]=[]):t[i]=a={"@id":i,"@graph":[]};let o=a[`@graph`];for(let e of Object.keys(n).sort()){let t=n[e];r.isSubjectReference(t)||o.push(t)}}return t}})),Qn=o(((e,t)=>{var{isSubjectReference:n}=Pn(),{createMergedNodeMap:r}=Zn(),i={};t.exports=i,i.flatten=e=>{let t=r(e),i=[],a=Object.keys(t).sort();for(let e=0;e<a.length;++e){let r=t[a[e]];n(r)||i.push(r)}return i}})),$n=o(((e,t)=>{var n=Fn(),r=Pn(),i=Nn(),{REGEX_BCP47:a,addValue:o}=In(),{handleEvent:s}=Jn(),{RDF_LIST:c,RDF_FIRST:l,RDF_REST:u,RDF_NIL:d,RDF_TYPE:f,RDF_JSON_LITERAL:p,XSD_BOOLEAN:m,XSD_DOUBLE:h,XSD_INTEGER:g,XSD_STRING:_}=Ln(),v={};t.exports=v,v.fromRDF=async(e,t)=>{let{useRdfType:a=!1,useNativeTypes:s=!1,rdfDirection:p=null}=t,m={},h={"@default":m},g={};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(let n of e){let e=n.graph.termType===`DefaultGraph`?`@default`:n.graph.value;e in h||(h[e]={}),e!==`@default`&&!(e in m)&&(m[e]={"@id":e});let r=h[e],i=b(n.subject),c=n.predicate.value,l=n.object;i in r||(r[i]={"@id":i});let u=r[i],_=b(l),v=!!_;if(v&&!(_ in r)&&(r[_]={"@id":_}),c===f&&!a&&v){o(u,`@type`,_,{propertyIsArray:!0});continue}let x=y(l,s,p,t);if(o(u,c,x,{propertyIsArray:!0}),v)if(_===d){let e=r[_];`usages`in e||(e.usages=[]),e.usages.push({node:u,property:c,value:x})}else _ in g?g[_]=!1:g[_]={node:u,property:c,value:x}}for(let e in h){let t=h[e];if(!(d in t))continue;let n=t[d];if(n.usages){for(let e of n.usages){let n=e.node,a=e.property,o=e.value,s=[],d=[],f=Object.keys(n).length;for(;a===u&&i.isObject(g[n[`@id`]])&&i.isArray(n[l])&&n[l].length===1&&i.isArray(n[u])&&n[u].length===1&&(f===3||f===4&&i.isArray(n[`@type`])&&n[`@type`].length===1&&n[`@type`][0]===c)&&(s.push(n[l][0]),d.push(n[`@id`]),e=g[n[`@id`]],n=e.node,a=e.property,o=e.value,f=Object.keys(n).length,r.isBlankNode(n)););delete o[`@id`],o[`@list`]=s.reverse();for(let e of d)delete t[e]}delete n.usages}}let _=[],v=Object.keys(m).sort();for(let e of v){let t=m[e];if(e in h){let n=t[`@graph`]=[],i=h[e],a=Object.keys(i).sort();for(let e of a){let t=i[e];r.isSubjectReference(t)||n.push(t)}}r.isSubjectReference(t)||_.push(t)}return _};function y(e,t,r,o){let c=b(e);if(c)return{"@id":c};let l={"@value":e.value};if(e.language)e.language.match(a)||o.eventHandler&&s({event:{type:[`JsonLdEvent`],code:`invalid @language value`,level:`warning`,message:`@language value must be valid BCP47.`,details:{language:e.language}},options:o}),l[`@language`]=e.language;else{let c=e.datatype.value;if(c||=_,c===p){c=`@json`;try{l[`@value`]=JSON.parse(l[`@value`])}catch(e){throw new n(`JSON literal could not be parsed.`,`jsonld.InvalidJsonLiteral`,{code:`invalid JSON literal`,value:l[`@value`],cause:e})}}if(t)if(c===m)l[`@value`]===`true`||l[`@value`]===`1`?l[`@value`]=!0:l[`@value`]===`false`||l[`@value`]===`0`?l[`@value`]=!1:l[`@type`]=c;else if(c===g)if(i.isNumeric(l[`@value`])){let e=parseInt(l[`@value`],10);e.toFixed(0)===l[`@value`]&&(l[`@value`]=e)}else l[`@type`]=c;else c===h&&i.isNumeric(l[`@value`])?l[`@value`]=parseFloat(l[`@value`]):l[`@type`]=c;else if(r===`i18n-datatype`&&c.startsWith(`https://www.w3.org/ns/i18n#`)){let[,e,t]=c.split(/[#_]/);e.length>0&&(l[`@language`]=e,e.match(a)||o.eventHandler&&s({event:{type:[`JsonLdEvent`],code:`invalid @language value`,level:`warning`,message:`@language value must be valid BCP47.`,details:{language:e}},options:o})),l[`@direction`]=t}else c!==_&&(l[`@type`]=c)}return l}function b(e){return e.termType===`NamedNode`?e.value:e.termType===`BlankNode`?`_:`+e.value:null}})),er=o(((e,t)=>{t.exports=function e(t){if(typeof t==`number`&&isNaN(t))throw Error(`NaN is not allowed`);if(typeof t==`number`&&!isFinite(t))throw Error(`Infinity is not allowed`);return typeof t!=`object`||!t?JSON.stringify(t):t.toJSON instanceof Function?e(t.toJSON()):Array.isArray(t)?`[${t.reduce((t,n,r)=>`${t}${r===0?``:`,`}${e(n===void 0||typeof n==`symbol`?null:n)}`,``)}]`:`{${Object.keys(t).sort().reduce((n,r)=>t[r]===void 0||typeof t[r]==`symbol`?n:`${n}${n.length===0?``:`,`}${e(r)}:${e(t[r])}`,``)}}`}})),tr=o(((e,t)=>{var{createNodeMap:n}=Zn(),{isKeyword:r}=Yn(),i=Pn(),a=er(),o=Fn(),s=Nn(),c=In(),{handleEvent:l}=Jn(),{RDF_FIRST:u,RDF_REST:d,RDF_NIL:f,RDF_TYPE:p,RDF_JSON_LITERAL:m,RDF_LANGSTRING:h,XSD_BOOLEAN:g,XSD_DOUBLE:_,XSD_INTEGER:v,XSD_STRING:y}=Ln(),{isAbsolute:b}=zn(),x={};t.exports=x,x.toRDF=(e,t)=>{let r=new c.IdentifierIssuer(`_:b`),i={"@default":{}};n(e,i,`@default`,r);let a=[],o=Object.keys(i).sort();for(let e of o){let n;if(e===`@default`)n={termType:`DefaultGraph`,value:``};else if(b(e))n=T(e);else{t.eventHandler&&l({event:{type:[`JsonLdEvent`],code:`relative graph reference`,level:`warning`,message:`Relative graph reference found.`,details:{graph:e}},options:t});continue}S(a,i[e],n,r,t)}return a};function S(e,t,n,i,a){let o=Object.keys(t).sort();for(let s of o){let o=t[s],c=Object.keys(o).sort();for(let t of c){let c=o[t];if(t===`@type`)t=p;else if(r(t))continue;for(let r of c){let o=T(s);if(!b(s)){a.eventHandler&&l({event:{type:[`JsonLdEvent`],code:`relative subject reference`,level:`warning`,message:`Relative subject reference found.`,details:{subject:s}},options:a});continue}let c=T(t);if(!b(t)){a.eventHandler&&l({event:{type:[`JsonLdEvent`],code:`relative predicate reference`,level:`warning`,message:`Relative predicate reference found.`,details:{predicate:t}},options:a});continue}if(c.termType===`BlankNode`&&!a.produceGeneralizedRdf){a.eventHandler&&l({event:{type:[`JsonLdEvent`],code:`blank node predicate`,level:`warning`,message:`Dropping blank node predicate.`,details:{property:i.getOldIds().find(e=>i.getId(e)===t)}},options:a});continue}let u=w(r,i,e,n,a.rdfDirection,a);u&&e.push({subject:o,predicate:c,object:u,graph:n})}}}}function C(e,t,n,r,i,a){let o={termType:`NamedNode`,value:u},s={termType:`NamedNode`,value:d},c={termType:`NamedNode`,value:f},l=e.pop(),p=l?{termType:`BlankNode`,value:t.getId().slice(2)}:c,m=p;for(let c of e){let e=w(c,t,n,r,i,a),l={termType:`BlankNode`,value:t.getId().slice(2)};n.push({subject:m,predicate:o,object:e,graph:r}),n.push({subject:m,predicate:s,object:l,graph:r}),m=l}if(l){let e=w(l,t,n,r,i,a);n.push({subject:m,predicate:o,object:e,graph:r}),n.push({subject:m,predicate:s,object:c,graph:r})}return p}function w(e,t,n,r,c,u){let d;if(i.isValue(e)){d={termType:`Literal`,value:void 0,datatype:{termType:`NamedNode`}};let t=e[`@value`],n=e[`@type`]||null;if(n===`@json`)d.value=a(t),d.datatype.value=m;else if(s.isBoolean(t))d.value=t.toString(),d.datatype.value=n||g;else if(s.isDouble(t)||n===_)s.isDouble(t)||(t=parseFloat(t)),d.value=t.toExponential(15).replace(/(\d)0*e\+?/,`$1E`),d.datatype.value=n||_;else if(s.isNumber(t))d.value=t.toFixed(0),d.datatype.value=n||v;else if(`@direction`in e&&c===`i18n-datatype`){let n=`https://www.w3.org/ns/i18n#${(e[`@language`]||``).toLowerCase()}_${e[`@direction`]}`;d.datatype.value=n,d.value=t}else if(`@direction`in e&&c===`compound-literal`)throw new o(`Unsupported rdfDirection value.`,`jsonld.InvalidRdfDirection`,{value:c});else if(`@direction`in e&&c)throw new o(`Unknown rdfDirection value.`,`jsonld.InvalidRdfDirection`,{value:c});else`@language`in e?(`@direction`in e&&!c&&u.eventHandler&&l({event:{type:[`JsonLdEvent`],code:`rdfDirection not set`,level:`warning`,message:`rdfDirection not set for @direction.`,details:{object:d.value}},options:u}),d.value=t,d.datatype.value=n||h,d.language=e[`@language`]):(`@direction`in e&&!c&&u.eventHandler&&l({event:{type:[`JsonLdEvent`],code:`rdfDirection not set`,level:`warning`,message:`rdfDirection not set for @direction.`,details:{object:d.value}},options:u}),d.value=t,d.datatype.value=n||y)}else if(i.isList(e)){let i=C(e[`@list`],t,n,r,c,u);d={termType:i.termType,value:i.value}}else d=T(s.isObject(e)?e[`@id`]:e);return d.termType===`NamedNode`&&!b(d.value)?(u.eventHandler&&l({event:{type:[`JsonLdEvent`],code:`relative object reference`,level:`warning`,message:`Relative object reference found.`,details:{object:d.value}},options:u}),null):d}function T(e){return e.startsWith(`_:`)?{termType:`BlankNode`,value:e.slice(2)}:{termType:`NamedNode`,value:e}}})),nr=o(((e,t)=>{var{isKeyword:n}=Yn(),r=Pn(),i=Nn(),a=In(),o=zn(),s=Fn(),{createNodeMap:c,mergeNodeMapGraphs:l}=Zn(),u={};t.exports=u,u.frameMergedOrDefault=(e,t,n)=>{let r={options:n,embedded:!1,graph:`@default`,graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new a.IdentifierIssuer(`_:b`);c(e,r.graphMap,`@default`,i),n.merged&&(r.graphMap[`@merged`]=l(r.graphMap),r.graph=`@merged`),r.subjects=r.graphMap[r.graph];let o=[];return u.frame(r,Object.keys(r.subjects).sort(),t,o),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter(e=>r.bnodeMap[e].length===1)),n.link={},v(o,n)},u.frame=(e,t,o,c,l=null)=>{m(o),o=o[0];let g=e.options,v={embed:p(o,g,`embed`),explicit:p(o,g,`explicit`),requireAll:p(o,g,`requireAll`)};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});let b=e.link[e.graph],S=h(e,t,o,v),C=Object.keys(S).sort();for(let m of C){let h=S[m];if(l===null?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},v.embed===`@link`&&m in b){y(c,l,b[m]);continue}let C={"@id":m};if(m.indexOf(`_:`)===0&&a.addValue(e.bnodeMap,m,C,{propertyIsArray:!0}),b[m]=C,(v.embed===`@first`||v.embed===`@last`)&&e.is11)throw new s(`Invalid JSON-LD syntax; invalid value of @embed.`,`jsonld.SyntaxError`,{code:`invalid @embed value`,frame:o});if(!(!e.embedded&&e.uniqueEmbeds[e.graph].hasOwnProperty(m))){if(e.embedded&&(v.embed===`@never`||f(h,e.graph,e.subjectStack))){y(c,l,C);continue}if(e.embedded&&(v.embed==`@first`||v.embed==`@once`)&&e.uniqueEmbeds[e.graph].hasOwnProperty(m)){y(c,l,C);continue}if(v.embed===`@last`&&m in e.uniqueEmbeds[e.graph]&&_(e,m),e.uniqueEmbeds[e.graph][m]={parent:c,property:l},e.subjectStack.push({subject:h,graph:e.graph}),m in e.graphMap){let t=!1,n=null;`@graph`in o?(n=o[`@graph`][0],t=!(m===`@merged`||m===`@default`),i.isObject(n)||(n={})):(t=e.graph!==`@merged`,n={}),t&&u.frame({...e,graph:m,embedded:!1},Object.keys(e.graphMap[m]).sort(),[n],C,`@graph`)}`@included`in o&&u.frame({...e,embedded:!1},t,o[`@included`],C,`@included`);for(let t of Object.keys(h).sort()){if(n(t)){if(C[t]=a.clone(h[t]),t===`@type`)for(let t of h[`@type`])t.indexOf(`_:`)===0&&a.addValue(e.bnodeMap,t,C,{propertyIsArray:!0});continue}if(!(v.explicit&&!(t in o)))for(let n of h[t]){let i=t in o?o[t]:d(v);if(r.isList(n)){let i=o[t]&&o[t][0]&&o[t][0][`@list`]?o[t][0][`@list`]:d(v),s={"@list":[]};y(C,t,s);let c=n[`@list`];for(let t of c)r.isSubjectReference(t)?u.frame({...e,embedded:!0},[t[`@id`]],i,s,`@list`):y(s,`@list`,a.clone(t))}else r.isSubjectReference(n)?u.frame({...e,embedded:!0},[n[`@id`]],i,C,t):x(i[0],n)&&y(C,t,a.clone(n))}}for(let e of Object.keys(o).sort()){if(e===`@type`){if(!i.isObject(o[e][0])||!(`@default`in o[e][0]))continue}else if(n(e))continue;let t=o[e][0]||{};if(!p(t,g,`omitDefault`)&&!(e in C)){let n=`@null`;`@default`in t&&(n=a.clone(t[`@default`])),i.isArray(n)||(n=[n]),C[e]=[{"@preserve":n}]}}for(let t of Object.keys(o[`@reverse`]||{}).sort()){let n=o[`@reverse`][t];for(let r of Object.keys(e.subjects))a.getValues(e.subjects[r],t).some(e=>e[`@id`]===m)&&(C[`@reverse`]=C[`@reverse`]||{},a.addValue(C[`@reverse`],t,[],{propertyIsArray:!0}),u.frame({...e,embedded:!0},[r],n,C[`@reverse`][t],l))}y(c,l,C),e.subjectStack.pop()}}},u.cleanupNull=(e,t)=>{if(i.isArray(e))return e.map(e=>u.cleanupNull(e,t)).filter(e=>e);if(e===`@null`)return null;if(i.isObject(e)){if(`@id`in e){let n=e[`@id`];if(t.link.hasOwnProperty(n)){let r=t.link[n].indexOf(e);if(r!==-1)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(let n in e)e[n]=u.cleanupNull(e[n],t)}return e};function d(e){let t={};for(let n in e)e[n]!==void 0&&(t[`@`+n]=[e[n]]);return[t]}function f(e,t,n){for(let r=n.length-1;r>=0;--r){let i=n[r];if(i.graph===t&&i.subject[`@id`]===e[`@id`])return!0}return!1}function p(e,t,n){let r=`@`+n,i=r in e?e[r][0]:t[n];if(n===`embed`){if(i===!0)i=`@once`;else if(i===!1)i=`@never`;else if(i!==`@always`&&i!==`@never`&&i!==`@link`&&i!==`@first`&&i!==`@last`&&i!==`@once`)throw new s(`Invalid JSON-LD syntax; invalid value of @embed.`,`jsonld.SyntaxError`,{code:`invalid @embed value`,frame:e})}return i}function m(e){if(!i.isArray(e)||e.length!==1||!i.isObject(e[0]))throw new s(`Invalid JSON-LD syntax; a JSON-LD frame must be a single object.`,`jsonld.SyntaxError`,{frame:e});if(`@id`in e[0]){for(let t of a.asArray(e[0][`@id`]))if(!(i.isObject(t)||o.isAbsolute(t))||i.isString(t)&&t.indexOf(`_:`)===0)throw new s(`Invalid JSON-LD syntax; invalid @id in frame.`,`jsonld.SyntaxError`,{code:`invalid frame`,frame:e})}if(`@type`in e[0]){for(let t of a.asArray(e[0][`@type`]))if(!(i.isObject(t)||o.isAbsolute(t)||t===`@json`)||i.isString(t)&&t.indexOf(`_:`)===0)throw new s(`Invalid JSON-LD syntax; invalid @type in frame.`,`jsonld.SyntaxError`,{code:`invalid frame`,frame:e})}}function h(e,t,n,r){let i={};for(let a of t){let t=e.graphMap[e.graph][a];g(e,t,n,r)&&(i[a]=t)}return i}function g(e,t,o,s){let c=!0,l=!1;for(let u in o){let d=!1,f=a.getValues(t,u),p=a.getValues(o,u).length===0;if(u===`@id`){if(i.isEmptyObject(o[`@id`][0]||{})?d=!0:o[`@id`].length>=0&&(d=o[`@id`].includes(f[0])),!s.requireAll)return d}else if(u===`@type`){if(c=!1,p){if(f.length>0)return!1;d=!0}else if(o[`@type`].length===1&&i.isEmptyObject(o[`@type`][0]))d=f.length>0;else for(let e of o[`@type`])i.isObject(e)&&`@default`in e?d=!0:d||=f.some(t=>t===e);if(!s.requireAll)return d}else if(n(u))continue;else{let t=a.getValues(o,u)[0],n=!1;if(t&&(m([t]),n=`@default`in t),c=!1,f.length===0&&n)continue;if(f.length>0&&p)return!1;if(t===void 0){if(f.length>0)return!1;d=!0}else if(r.isList(t)){let n=t[`@list`][0];if(r.isList(f[0])){let t=f[0][`@list`];r.isValue(n)?d=t.some(e=>x(n,e)):(r.isSubject(n)||r.isSubjectReference(n))&&(d=t.some(t=>b(e,n,t,s)))}}else d=r.isValue(t)?f.some(e=>x(t,e)):r.isSubjectReference(t)?f.some(n=>b(e,t,n,s)):i.isObject(t)?f.length>0:!1}if(!d&&s.requireAll)return!1;l||=d}return c||l}function _(e,t){let n=e.uniqueEmbeds[e.graph],r=n[t],o=r.parent,s=r.property,c={"@id":t};if(i.isArray(o)){for(let e=0;e<o.length;++e)if(a.compareValues(o[e],c)){o[e]=c;break}}else{let e=i.isArray(o[s]);a.removeValue(o,s,c,{propertyIsArray:e}),a.addValue(o,s,c,{propertyIsArray:e})}let l=e=>{let t=Object.keys(n);for(let r of t)r in n&&i.isObject(n[r].parent)&&n[r].parent[`@id`]===e&&(delete n[r],l(r))};l(t)}function v(e,t){if(i.isArray(e))return e.map(e=>v(e,t));if(i.isObject(e)){if(`@preserve`in e)return e[`@preserve`][0];if(r.isValue(e))return e;if(r.isList(e))return e[`@list`]=v(e[`@list`],t),e;if(`@id`in e){let n=e[`@id`];if(t.link.hasOwnProperty(n)){let r=t.link[n].indexOf(e);if(r!==-1)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(let n in e){if(n===`@id`&&t.bnodesToClear.includes(e[n])){delete e[`@id`];continue}e[n]=v(e[n],t)}}return e}function y(e,t,n){i.isObject(e)?a.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function b(e,t,n,r){if(!(`@id`in n))return!1;let i=e.subjects[n[`@id`]];return i&&g(e,i,t,r)}function x(e,t){let n=t[`@value`],r=t[`@type`],a=t[`@language`],o=e[`@value`]?i.isArray(e[`@value`])?e[`@value`]:[e[`@value`]]:[],s=e[`@type`]?i.isArray(e[`@type`])?e[`@type`]:[e[`@type`]]:[],c=e[`@language`]?i.isArray(e[`@language`])?e[`@language`]:[e[`@language`]]:[];return o.length===0&&s.length===0&&c.length===0||!(!(o.includes(n)||i.isEmptyObject(o[0]))||!(!r&&s.length===0||s.includes(r)||r&&i.isEmptyObject(s[0]))||!(!a&&c.length===0||c.includes(a)||a&&i.isEmptyObject(c[0])))}})),rr=o(((e,t)=>{var n=Fn(),{isArray:r,isObject:i,isString:a,isUndefined:o}=Nn(),{isList:s,isValue:c,isGraph:l,isSimpleGraph:u,isSubjectReference:d}=Pn(),{expandIri:f,getContextValue:p,isKeyword:m,process:h,processingMode:g}=Yn(),{removeBase:_,prependBase:v}=zn(),{REGEX_KEYWORD:y,addValue:b,asArray:x,compareShortestLeast:S}=In(),C={};t.exports=C,C.compact=async({activeCtx:e,activeProperty:t=null,element:f,options:_={}})=>{if(r(f)){let n=[];for(let r=0;r<f.length;++r){let i=await C.compact({activeCtx:e,activeProperty:t,element:f[r],options:_});i!==null&&n.push(i)}return _.compactArrays&&n.length===1&&(p(e,t,`@container`)||[]).length===0&&(n=n[0]),n}let v=p(e,t,`@context`);if(o(v)||(e=await h({activeCtx:e,localCtx:v,propagate:!0,overrideProtected:!0,options:_})),i(f)){if(_.link&&`@id`in f&&_.link.hasOwnProperty(f[`@id`])){let e=_.link[f[`@id`]];for(let t=0;t<e.length;++t)if(e[t].expanded===f)return e[t].compacted}if(c(f)||d(f)){let n=C.compactValue({activeCtx:e,activeProperty:t,value:f,options:_});return _.link&&d(f)&&(_.link.hasOwnProperty(f[`@id`])||(_.link[f[`@id`]]=[]),_.link[f[`@id`]].push({expanded:f,compacted:n})),n}if(s(f)&&(p(e,t,`@container`)||[]).includes(`@list`))return C.compact({activeCtx:e,activeProperty:t,element:f[`@list`],options:_});let v=t===`@reverse`,y={},S=e;!c(f)&&!d(f)&&(e=e.revertToPreviousContext());let w=p(S,t,`@context`);o(w)||(e=await h({activeCtx:e,localCtx:w,propagate:!0,overrideProtected:!0,options:_})),_.link&&`@id`in f&&(_.link.hasOwnProperty(f[`@id`])||(_.link[f[`@id`]]=[]),_.link[f[`@id`]].push({expanded:f,compacted:y}));let E=f[`@type`]||[];E.length>1&&(E=Array.from(E).sort());let D=e;for(let t of E){let n=p(S,C.compactIri({activeCtx:D,iri:t,relativeTo:{vocab:!0}}),`@context`);o(n)||(e=await h({activeCtx:e,localCtx:n,options:_,propagate:!1}))}let O=Object.keys(f).sort();for(let o of O){let d=f[o];if(o===`@id`){let t=x(d).map(t=>C.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:_.base}));t.length===1&&(t=t[0]);let n=C.compactIri({activeCtx:e,iri:`@id`,relativeTo:{vocab:!0}});y[n]=t;continue}if(o===`@type`){let t=x(d).map(e=>C.compactIri({activeCtx:S,iri:e,relativeTo:{vocab:!0}}));t.length===1&&(t=t[0]);let n=C.compactIri({activeCtx:e,iri:`@type`,relativeTo:{vocab:!0}}),i=(p(e,n,`@container`)||[]).includes(`@set`)&&g(e,1.1)||r(t)&&d.length===0;b(y,n,t,{propertyIsArray:i});continue}if(o===`@reverse`){let t=await C.compact({activeCtx:e,activeProperty:`@reverse`,element:d,options:_});for(let n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){let r=t[n];b(y,n,r,{propertyIsArray:(p(e,n,`@container`)||[]).includes(`@set`)||!_.compactArrays}),delete t[n]}Object.keys(t).length>0&&b(y,C.compactIri({activeCtx:e,iri:o,relativeTo:{vocab:!0}}),t);continue}if(o===`@preserve`){let n=await C.compact({activeCtx:e,activeProperty:t,element:d,options:_});r(n)&&n.length===0||b(y,o,n);continue}if(o===`@index`){if((p(e,t,`@container`)||[]).includes(`@index`))continue;b(y,C.compactIri({activeCtx:e,iri:o,relativeTo:{vocab:!0}}),d);continue}if(o!==`@graph`&&o!==`@list`&&o!==`@included`&&m(o)){b(y,C.compactIri({activeCtx:e,iri:o,relativeTo:{vocab:!0}}),d);continue}if(!r(d))throw new n(`JSON-LD expansion error; expanded value must be an array.`,`jsonld.SyntaxError`);if(d.length===0){let t=C.compactIri({activeCtx:e,iri:o,value:d,relativeTo:{vocab:!0},reverse:v}),n=e.mappings.has(t)?e.mappings.get(t)[`@nest`]:null,r=y;n&&(T(e,n,_),i(y[n])||(y[n]={}),r=y[n]),b(r,t,d,{propertyIsArray:!0})}for(let t of d){let n=C.compactIri({activeCtx:e,iri:o,value:t,relativeTo:{vocab:!0},reverse:v}),d=e.mappings.has(n)?e.mappings.get(n)[`@nest`]:null,f=y;d&&(T(e,d,_),i(y[d])||(y[d]={}),f=y[d]);let m=p(e,n,`@container`)||[],h=l(t),g=s(t),S;g?S=t[`@list`]:h&&(S=t[`@graph`]);let w=await C.compact({activeCtx:e,activeProperty:n,element:g||h?S:t,options:_});if(g)if(r(w)||(w=[w]),!m.includes(`@list`))w={[C.compactIri({activeCtx:e,iri:`@list`,relativeTo:{vocab:!0}})]:w},`@index`in t&&(w[C.compactIri({activeCtx:e,iri:`@index`,relativeTo:{vocab:!0}})]=t[`@index`]);else{b(f,n,w,{valueIsArray:!0,allowDuplicate:!0});continue}if(h)if(m.includes(`@graph`)&&(m.includes(`@id`)||m.includes(`@index`)&&u(t))){let r;f.hasOwnProperty(n)?r=f[n]:f[n]=r={};let i=(m.includes(`@id`)?t[`@id`]:t[`@index`])||C.compactIri({activeCtx:e,iri:`@none`,relativeTo:{vocab:!0}});b(r,i,w,{propertyIsArray:!_.compactArrays||m.includes(`@set`)})}else m.includes(`@graph`)&&u(t)?(r(w)&&w.length>1&&(w={"@included":w}),b(f,n,w,{propertyIsArray:!_.compactArrays||m.includes(`@set`)})):(r(w)&&w.length===1&&_.compactArrays&&(w=w[0]),w={[C.compactIri({activeCtx:e,iri:`@graph`,relativeTo:{vocab:!0}})]:w},`@id`in t&&(w[C.compactIri({activeCtx:e,iri:`@id`,relativeTo:{vocab:!0}})]=t[`@id`]),`@index`in t&&(w[C.compactIri({activeCtx:e,iri:`@index`,relativeTo:{vocab:!0}})]=t[`@index`]),b(f,n,w,{propertyIsArray:!_.compactArrays||m.includes(`@set`)}));else if(m.includes(`@language`)||m.includes(`@index`)||m.includes(`@id`)||m.includes(`@type`)){let r;f.hasOwnProperty(n)?r=f[n]:f[n]=r={};let i;if(m.includes(`@language`))c(w)&&(w=w[`@value`]),i=t[`@language`];else if(m.includes(`@index`)){let r=p(e,n,`@index`)||`@index`,o=C.compactIri({activeCtx:e,iri:r,relativeTo:{vocab:!0}});if(r===`@index`)i=t[`@index`],delete w[o];else{let e;if([i,...e]=x(w[r]||[]),!a(i))i=null;else switch(e.length){case 0:delete w[r];break;case 1:w[r]=e[0];break;default:w[r]=e;break}}}else if(m.includes(`@id`)){let t=C.compactIri({activeCtx:e,iri:`@id`,relativeTo:{vocab:!0}});i=w[t],delete w[t]}else if(m.includes(`@type`)){let r=C.compactIri({activeCtx:e,iri:`@type`,relativeTo:{vocab:!0}}),a;switch([i,...a]=x(w[r]||[]),a.length){case 0:delete w[r];break;case 1:w[r]=a[0];break;default:w[r]=a;break}Object.keys(w).length===1&&`@id`in t&&(w=await C.compact({activeCtx:e,activeProperty:n,element:{"@id":t[`@id`]},options:_}))}i||=C.compactIri({activeCtx:e,iri:`@none`,relativeTo:{vocab:!0}}),b(r,i,w,{propertyIsArray:m.includes(`@set`)})}else{let e=!_.compactArrays||m.includes(`@set`)||m.includes(`@list`)||r(w)&&w.length===0||o===`@list`||o===`@graph`;b(f,n,w,{propertyIsArray:e})}}}return y}return f},C.compactIri=({activeCtx:e,iri:t,value:r=null,relativeTo:a={vocab:!1},reverse:o=!1,base:u=null})=>{if(t===null)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);let d=e.getInverse();if(m(t)&&t in d&&`@none`in d[t]&&`@type`in d[t][`@none`]&&`@none`in d[t][`@none`][`@type`])return d[t][`@none`][`@type`][`@none`];if(a.vocab&&t in d){let n=e[`@language`]||`@none`,a=[];i(r)&&`@index`in r&&!(`@graph`in r)&&a.push(`@index`,`@index@set`),i(r)&&`@preserve`in r&&(r=r[`@preserve`][0]),l(r)?(`@index`in r&&a.push(`@graph@index`,`@graph@index@set`,`@index`,`@index@set`),`@id`in r&&a.push(`@graph@id`,`@graph@id@set`),a.push(`@graph`,`@graph@set`,`@set`),`@index`in r||a.push(`@graph@index`,`@graph@index@set`,`@index`,`@index@set`),`@id`in r||a.push(`@graph@id`,`@graph@id@set`)):i(r)&&!c(r)&&a.push(`@id`,`@id@set`,`@type`,`@set@type`);let u=`@language`,d=`@null`;if(o)u=`@type`,d=`@reverse`,a.push(`@set`);else if(s(r)){`@index`in r||a.push(`@list`);let e=r[`@list`];if(e.length===0)u=`@any`,d=`@none`;else{let t=e.length===0?n:null,r=null;for(let n=0;n<e.length;++n){let i=e[n],a=`@none`,o=`@none`;if(c(i)?`@direction`in i?a=`${(i[`@language`]||``).toLowerCase()}_${i[`@direction`]}`:`@language`in i?a=i[`@language`].toLowerCase():`@type`in i?o=i[`@type`]:a=`@null`:o=`@id`,t===null?t=a:a!==t&&c(i)&&(t=`@none`),r===null?r=o:o!==r&&(r=`@none`),t===`@none`&&r===`@none`)break}t||=`@none`,r||=`@none`,r===`@none`?d=t:(u=`@type`,d=r)}}else{if(c(r))if(`@language`in r&&!(`@index`in r)){a.push(`@language`,`@language@set`),d=r[`@language`];let e=r[`@direction`];e&&(d=`${d}_${e}`)}else`@direction`in r&&!(`@index`in r)?d=`_${r[`@direction`]}`:`@type`in r&&(u=`@type`,d=r[`@type`]);else u=`@type`,d=`@id`;a.push(`@set`)}a.push(`@none`),i(r)&&!(`@index`in r)&&a.push(`@index`,`@index@set`),c(r)&&Object.keys(r).length===1&&a.push(`@language`,`@language@set`);let f=w(e,t,r,a,u,d);if(f!==null)return f}if(a.vocab&&`@vocab`in e){let n=e[`@vocab`];if(t.indexOf(n)===0&&t!==n){let r=t.substr(n.length);if(!e.mappings.has(r))return r}}let f=null,p=[],h=e.fastCurieMap,g=t.length-1;for(let e=0;e<g&&t[e]in h;++e)h=h[t[e]],``in h&&p.push(h[``][0]);for(let n=p.length-1;n>=0;--n){let i=p[n],a=i.terms;for(let n of a){let a=n+`:`+t.substr(i.iri.length);e.mappings.get(n)._prefix&&(!e.mappings.has(a)||r===null&&e.mappings.get(a)[`@id`]===t)&&(f===null||S(a,f)<0)&&(f=a)}}if(f!==null)return f;for(let[r,i]of e.mappings)if(i&&i._prefix&&t.startsWith(r+`:`))throw new n(`Absolute IRI "${t}" confused with prefix "${r}".`,`jsonld.SyntaxError`,{code:`IRI confused with prefix`,context:e});if(!a.vocab)if(`@base`in e)if(e[`@base`]){let n=_(v(u,e[`@base`]),t);return y.test(n)?`./${n}`:n}else return t;else return _(u,t);return t},C.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(c(n)){let r=p(e,t,`@type`),i=p(e,t,`@language`),o=p(e,t,`@direction`),s=p(e,t,`@container`)||[],c=`@index`in n&&!s.includes(`@index`);if(!c&&r!==`@none`&&(n[`@type`]===r||`@language`in n&&n[`@language`]===i&&`@direction`in n&&n[`@direction`]===o||`@language`in n&&n[`@language`]===i||`@direction`in n&&n[`@direction`]===o))return n[`@value`];let l=Object.keys(n).length,u=l===1||l===2&&`@index`in n&&!c,d=`@language`in e,f=a(n[`@value`]),m=e.mappings.has(t)&&e.mappings.get(t)[`@language`]===null;if(u&&r!==`@none`&&(!d||!f||m))return n[`@value`];let h={};return c&&(h[C.compactIri({activeCtx:e,iri:`@index`,relativeTo:{vocab:!0}})]=n[`@index`]),`@type`in n?h[C.compactIri({activeCtx:e,iri:`@type`,relativeTo:{vocab:!0}})]=C.compactIri({activeCtx:e,iri:n[`@type`],relativeTo:{vocab:!0}}):`@language`in n&&(h[C.compactIri({activeCtx:e,iri:`@language`,relativeTo:{vocab:!0}})]=n[`@language`]),`@direction`in n&&(h[C.compactIri({activeCtx:e,iri:`@direction`,relativeTo:{vocab:!0}})]=n[`@direction`]),h[C.compactIri({activeCtx:e,iri:`@value`,relativeTo:{vocab:!0}})]=n[`@value`],h}let i=f(e,t,{vocab:!0},r),o=p(e,t,`@type`),s=C.compactIri({activeCtx:e,iri:n[`@id`],relativeTo:{vocab:o===`@vocab`},base:r.base});return o===`@id`||o===`@vocab`||i===`@graph`?s:{[C.compactIri({activeCtx:e,iri:`@id`,relativeTo:{vocab:!0}})]:s}};function w(e,t,n,r,a,o){o===null&&(o=`@null`);let s=[];if((o===`@id`||o===`@reverse`)&&i(n)&&`@id`in n){o===`@reverse`&&s.push(`@reverse`);let t=C.compactIri({activeCtx:e,iri:n[`@id`],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)[`@id`]===n[`@id`]?s.push.apply(s,[`@vocab`,`@id`]):s.push.apply(s,[`@id`,`@vocab`])}else{s.push(o);let e=s.find(e=>e.includes(`_`));e&&s.push(e.replace(/^[^_]+_/,`_`))}s.push(`@none`);let c=e.inverse[t];for(let e of r){if(!(e in c))continue;let t=c[e][a];for(let e of s)if(e in t)return t[e]}return null}function T(e,t,r){if(f(e,t,{vocab:!0},r)!==`@nest`)throw new n(`JSON-LD compact error; nested property must have an @nest value resolving to @nest.`,`jsonld.SyntaxError`,{code:`invalid @nest value`})}})),ir=o(((e,t)=>{t.exports=e=>{class t{toString(){return`[object JsonLdProcessor]`}}return Object.defineProperty(t,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(t.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:t}),t.compact=function(t,n){return arguments.length<2?Promise.reject(TypeError(`Could not compact, too few arguments.`)):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(TypeError(`Could not expand, too few arguments.`)):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(TypeError(`Could not flatten, too few arguments.`)):e.flatten(t)},t}})),ar=o(((e,t)=>{var n=Mn(),r=Vn(),i=In(),a=Kn(),o=i.IdentifierIssuer,s=Fn(),c=Wn(),l=qn(),{expand:u}=Xn(),{flatten:d}=Qn(),{fromRDF:f}=$n(),{toRDF:p}=tr(),{frameMergedOrDefault:m,cleanupNull:h}=nr(),{isArray:g,isObject:_,isString:v}=Nn(),{isSubjectReference:y}=Pn(),{expandIri:b,getInitialContext:x,process:S,processingMode:C}=Yn(),{compact:w,compactIri:T}=rr(),{createNodeMap:E,createMergedNodeMap:D,mergeNodeMaps:O}=Zn(),{logEventHandler:k,logWarningEventHandler:A,safeEventHandler:j,setDefaultEventHandler:M,setupEventHandler:N,strictEventHandler:P,unhandledEventHandler:F}=Jn(),I=function(e){let t={},I=new c({max:100});e.compact=async function(t,n,r){if(arguments.length<2)throw TypeError(`Could not compact, too few arguments.`);if(n===null)throw new s(`The compaction context must not be null.`,`jsonld.CompactError`,{code:`invalid local context`});if(t===null)return null;r=L(r,{base:v(t)?t:``,compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new o(`_:b`),contextResolver:new a({sharedCache:I})}),r.link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base;let c;c=r.skipExpansion?t:await e.expand(t,r);let l=await e.processContext(x(r),n,r),u=await w({activeCtx:l,element:c,options:r});r.compactArrays&&!r.graph&&g(u)?u.length===1?u=u[0]:u.length===0&&(u={}):r.graph&&_(u)&&(u=[u]),_(n)&&`@context`in n&&(n=n[`@context`]),n=i.clone(n),g(n)||(n=[n]);let d=n;n=[];for(let e=0;e<d.length;++e)(!_(d[e])||Object.keys(d[e]).length>0)&&n.push(d[e]);let f=n.length>0;if(n.length===1&&(n=n[0]),g(u)){let e=T({activeCtx:l,iri:`@graph`,relativeTo:{vocab:!0}}),t=u;u={},f&&(u[`@context`]=n),u[e]=t}else if(_(u)&&f){let e=u;u={"@context":n};for(let t in e)u[t]=e[t]}return u},e.expand=async function(t,n){if(arguments.length<1)throw TypeError(`Could not expand, too few arguments.`);n=L(n,{keepFreeFloatingNodes:!1,contextResolver:new a({sharedCache:I})});let r={},o=[];if(`expandContext`in n){let e=i.clone(n.expandContext);_(e)&&`@context`in e?r.expandContext=e:r.expandContext={"@context":e},o.push(r.expandContext)}let s;if(!v(t))r.input=i.clone(t);else{let i=await e.get(t,n);s=i.documentUrl,r.input=i.document,i.contextUrl&&(r.remoteContext={"@context":i.contextUrl},o.push(r.remoteContext))}`base`in n||(n.base=s||``);let c=x(n);for(let e of o)c=await S({activeCtx:c,localCtx:e,options:n});let l=await u({activeCtx:c,element:r.input,options:n});return _(l)&&`@graph`in l&&Object.keys(l).length===1?l=l[`@graph`]:l===null&&(l=[]),g(l)||(l=[l]),l},e.flatten=async function(t,n,r){if(arguments.length<1)return TypeError(`Could not flatten, too few arguments.`);typeof n==`function`?n=null:n||=null,r=L(r,{base:v(t)?t:``,contextResolver:new a({sharedCache:I})});let i=d(await e.expand(t,r));return n===null?i:(r.graph=!0,r.skipExpansion=!0,await e.compact(i,n,r))},e.frame=async function(t,n,r){if(arguments.length<2)throw TypeError(`Could not frame, too few arguments.`);if(r=L(r,{base:v(t)?t:``,embed:`@once`,explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new a({sharedCache:I})}),v(n)){let t=await e.get(n,r);if(n=t.document,t.contextUrl){let e=n[`@context`];e?g(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n[`@context`]=e}}let i=n&&n[`@context`]||{},o=await e.processContext(x(r),i,r);r.hasOwnProperty(`omitGraph`)||(r.omitGraph=C(o,1.1)),r.hasOwnProperty(`pruneBlankNodeIdentifiers`)||(r.pruneBlankNodeIdentifiers=C(o,1.1));let s=await e.expand(t,r),c={...r};c.isFrame=!0,c.keepFreeFloatingNodes=!0;let l=await e.expand(n,c);c.merged=!Object.keys(n).map(e=>b(o,e,{vocab:!0})).includes(`@graph`),c.is11=C(o,1.1);let u=m(s,l,c);c.graph=!r.omitGraph,c.skipExpansion=!0,c.link={},c.framing=!0;let d=await e.compact(u,i,c);return c.link={},d=h(d,c),d},e.link=async function(t,n,r){let i={};return n&&(i[`@context`]=n),i[`@embed`]=`@link`,e.frame(t,i,r)},e.normalize=e.canonize=async function(t,r){if(arguments.length<1)throw TypeError(`Could not canonize, too few arguments.`);r=L(r,{skipExpansion:!1,safe:!0,contextResolver:new a({sharedCache:I})});let i=Object.assign({},{algorithm:`RDFC-1.0`},r.canonizeOptions||null);if(`inputFormat`in r){if(r.inputFormat!==`application/n-quads`)throw new s(`Unknown canonicalization input format.`,`jsonld.CanonizeError`);let e=l.parse(t);return n.canonize(e,i)}let o={...r};delete o.format,delete o.canonizeOptions,o.produceGeneralizedRdf=!1;let c=await e.toRDF(t,o);return n.canonize(c,i)},e.fromRDF=async function(e,n){if(arguments.length<1)throw TypeError(`Could not convert from RDF, too few arguments.`);n=L(n,{format:v(e)?`application/n-quads`:void 0});let{format:r}=n,{rdfParser:i}=n;if(r){if(i||=t[r],!i)throw new s(`Unknown input format.`,`jsonld.UnknownFormat`,{format:r})}else i=()=>e;return f(await i(e),n)},e.toRDF=async function(t,n){if(arguments.length<1)throw TypeError(`Could not convert to RDF, too few arguments.`);n=L(n,{skipExpansion:!1,contextResolver:new a({sharedCache:I})});let r;r=n.skipExpansion?t:await e.expand(t,n);let i=p(r,n);if(n.format){if(n.format===`application/n-quads`)return l.serialize(i);throw new s(`Unknown output format.`,`jsonld.UnknownFormat`,{format:n.format})}return i},e.createNodeMap=async function(t,n){if(arguments.length<1)throw TypeError(`Could not create node map, too few arguments.`);return n=L(n,{base:v(t)?t:``,contextResolver:new a({sharedCache:I})}),D(await e.expand(t,n),n)},e.merge=async function(t,n,r){if(arguments.length<1)throw TypeError(`Could not merge, too few arguments.`);if(!g(t))throw TypeError(`Could not merge, "docs" must be an array.`);typeof n==`function`?n=null:n||=null,r=L(r,{contextResolver:new a({sharedCache:I})});let s=await Promise.all(t.map(t=>{let n={...r};return e.expand(t,n)})),c=!0;`mergeNodes`in r&&(c=r.mergeNodes);let l=r.issuer||new o(`_:b`),u={"@default":{}};for(let e=0;e<s.length;++e){let t=i.relabelBlankNodes(s[e],{issuer:new o(`_:b`+e+`-`)}),n=c||e===0?u:{"@default":{}};if(E(t,n,`@default`,l),n!==u)for(let e in n){let t=n[e];if(!(e in u)){u[e]=t;continue}let r=u[e];for(let e in t)e in r||(r[e]=t[e])}}let d=O(u),f=[],p=Object.keys(d).sort();for(let e=0;e<p.length;++e){let t=d[p[e]];y(t)||f.push(t)}return n===null?f:(r.graph=!0,r.skipExpansion=!0,await e.compact(f,n,r))},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new s(`Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.`,`jsonld.LoadDocumentError`,{code:`loading document failed`,url:e})},e.get=async function(t,n){let r;r=typeof n.documentLoader==`function`?n.documentLoader:e.documentLoader;let i=await r(t);try{if(!i.document)throw new s(`No remote document found at the given URL.`,`jsonld.NullRemoteDocument`);v(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new s(`Could not retrieve a JSON-LD document from the URL.`,`jsonld.LoadDocumentError`,{code:`loading document failed`,cause:e,remoteDoc:i})}return i},e.processContext=async function(e,t,n){return n=L(n,{base:``,contextResolver:new a({sharedCache:I})}),t===null?x(n):(t=i.clone(t),_(t)&&`@context`in t||(t={"@context":t}),S({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=Yn().getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new s(`Unknown document loader type: "`+t+`"`,`jsonld.UnknownDocumentLoader`,{type:t});e.documentLoader=e.documentLoaders[t].apply(e,Array.prototype.slice.call(arguments,1))},e.registerRDFParser=function(e,n){t[e]=n},e.unregisterRDFParser=function(e){delete t[e]},e.registerRDFParser(`application/n-quads`,l.parse),e.url=zn(),e.logEventHandler=k,e.logWarningEventHandler=A,e.safeEventHandler=j,e.setDefaultEventHandler=M,e.strictEventHandler=P,e.unhandledEventHandler=F,e.util=i,Object.assign(e,i),e.promises=e,e.RequestQueue=Rn(),e.JsonLdProcessor=ir()(e),r.setupGlobals(e),r.setupDocumentLoaders(e);function L(t,{documentLoader:n=e.documentLoader,...r}){if(t&&`compactionMap`in t)throw new s(`"compactionMap" not supported.`,`jsonld.OptionsError`);if(t&&`expansionMap`in t)throw new s(`"expansionMap" not supported.`,`jsonld.OptionsError`);return Object.assign({},{documentLoader:n},r,t,{eventHandler:N({options:t})})}return e},L=function(){return I(function(){return L()})};I(L),t.exports=L})),or=Sn(),sr=l(ar(),1),cr={},lr={};async function ur(e){return`rdf`in e?fr(e.rdf):e.rdfUrlResolver?fr(await e.rdfUrlResolver(e.url)):dr(e.url,e.proxy)}async function dr(e,t){return e in cr||(cr[e]=(async()=>{let n=e;t&&(n=t+encodeURIComponent(e));let r=await fetch(n,{headers:{Accept:`text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json`}});return r.ok?fr(await r.text()):(console.warn(`failed fetching RDF from`,e),[])})()),cr[e]}async function fr(e){if(!e.trim())return[];let t=pr(e);if(t===`json`)try{e=await sr.default.toRDF(JSON.parse(e),{format:`application/n-quads`})}catch(e){console.error(e)}let n=[];return await new Promise((r,i)=>{let a=t===`xml`?new or.RdfXmlParser:new it;a.on(`data`,e=>{n.push(k.quad(e.subject,e.predicate,e.object,e.graph))}).on(`error`,e=>{i(e)}).on(`prefix`,(e,t)=>{e&&(lr[e]=t)}).on(`end`,()=>{r(null)}),a.write(e),a.end()}),n}function pr(e){return/^\s*[\\[{]/.test(e)?`json`:/^\s*<\?xml/.test(e)?`xml`:`ttl`}var mr={[`${Y}name`]:(e,t)=>{let n=t;e.name=Gt(e.config.languages,e.name,n)},[`${Y}description`]:(e,t)=>{let n=t;e.description=Gt(e.config.languages,e.description,n)},[`${Y}path`]:(e,t)=>{if(t.termType===`NamedNode`){e.path=t.value;return}let n=e.config.store.getQuads(t,null,null,null),r=n.filter(e=>e.predicate.value===`${Y}alternativePath`);if(n.length!==1||r.length!==1){console.warn(`ignoring unsupported or malformed SHACL property path`,t.value);return}let i=e.config.lists[r[0].object.value];if(!i||i.length<2||i.some(e=>e.termType!==`NamedNode`)){console.warn(`ignoring sh:alternativePath without at least two predicate IRI members`,t.value);return}e.pathAlternatives=i.map(e=>e.value),e.path=e.pathAlternatives[0]},[`${Y}group`]:(e,t)=>{e.group=t.id},[`${Y}datatype`]:(e,t)=>{e.datatype=t},[`${Y}nodeKind`]:(e,t)=>{e.nodeKind=t},[`${Y}minCount`]:(e,t)=>{e.minCount=parseInt(t.value)},[`${Y}maxCount`]:(e,t)=>{e.maxCount=parseInt(t.value)},[`${Y}minLength`]:(e,t)=>{e.minLength=parseInt(t.value)},[`${Y}maxLength`]:(e,t)=>{e.maxLength=parseInt(t.value)},[`${Y}minInclusive`]:(e,t)=>{e.minInclusive=parseInt(t.value)},[`${Y}maxInclusive`]:(e,t)=>{e.maxInclusive=parseInt(t.value)},[`${Y}minExclusive`]:(e,t)=>{e.minExclusive=parseInt(t.value)},[`${Y}maxExclusive`]:(e,t)=>{e.maxExclusive=parseInt(t.value)},[`${Y}pattern`]:(e,t)=>{e.pattern=t.value},[`${Y}order`]:(e,t)=>{e.order=parseInt(t.value)},[`${at}singleLine`]:(e,t)=>{e.singleLine=t.value===`true`},[`${at}readonly`]:(e,t)=>{e.readonly=t.value===`true`},[`${lt}styleClass`]:(e,t)=>{e.cssClass=t.value},[`${Y}in`]:(e,t)=>{e.in=t.value},[`${Y}languageIn`]:(e,t)=>{e.languageIn=e.config.lists[t.value],e.datatype=mt},[`${Y}defaultValue`]:(e,t)=>{e.defaultValue=t},[`${Y}hasValue`]:(e,t)=>{e.hasValue=t},[`${Y}node`]:(e,t)=>{e.node=t,e.nodeShapes.add(e.config.getNodeTemplate(t,e))},[`${Y}and`]:(e,t)=>{e.and=t.value;let n=e.config.lists[e.and];if(n?.length)for(let t of n)e.nodeShapes.add(e.config.getNodeTemplate(t,e))},[`${Y}qualifiedValueShape`]:(e,t)=>{let n=e.config.getNodeTemplate(t,e);e.qualifiedValueShape=n,e.nodeShapes.add(n)},[`${Y}qualifiedMinCount`]:(e,t)=>{e.qualifiedMinCount=parseInt(t.value)},[`${Y}qualifiedMaxCount`]:(e,t)=>{e.qualifiedMaxCount=parseInt(t.value)},[_t.id]:(e,t)=>{e.owlImports.add(t)},[Ct.id]:(e,t)=>{e.class=t;let n=e.config.store.getSubjects(Et,t,null);n.length>0&&(e.node=n[0])},[`${Y}or`]:(e,t)=>{let n=e.config.lists[t.value];n?.length?e.or=n:console.error(`list for sh:or not found:`,t.value,`existing lists:`,e.config.lists)},[`${Y}xone`]:(e,t)=>{let n=e.config.lists[t.value];n?.length?e.xone=n:console.error(`list for sh:xone not found:`,t.value,`existing lists:`,e.config.lists)}},hr=class{constructor(e,t){this.label=``,this.nodeShapes=new Set,this.owlImports=new Set,this.id=e,this.parent=t,this.config=t.config,this.config.registerPropertyTemplate(this),yr(this,this.config.store.getQuads(e,null,null,null))}};function gr(e){return Math.max(e.minCount??0,e.qualifiedMinCount??0)}function _r(e){return Math.min(e.maxCount??2**53-1,e.qualifiedMaxCount??2**53-1)}function vr(e){let t=Object.assign({},e);return t.nodeShapes=new Set(e.nodeShapes),t.owlImports=new Set(e.owlImports),e.languageIn&&(t.languageIn=[...e.languageIn]),e.pathAlternatives&&(t.pathAlternatives=[...e.pathAlternatives]),e.pathAlternativeBranches&&(t.pathAlternativeBranches={...e.pathAlternativeBranches}),e.or&&(t.or=[...e.or]),e.xone&&(t.xone=[...e.xone]),t}function yr(e,t){for(let n of t)mr[n.predicate.id]?.call(e,e,n.object);return e.label=e.name?.value||It(t,e.config.languages),e.label||=e.pathAlternatives?e.pathAlternatives.map(e=>Rt(e,lr)).join(` / `):e.path?Rt(e.path,lr):`unknown`,e}function br(e,t,n=!1){let r=t,i=e,a=Cr(e),o=Cr(t),s=a&&wr(t),c=o&&wr(e);s&&(e.nodeShapes.clear(),e.node=void 0);for(let a in t)if(a!==`parent`&&a!==`config`&&a!==`id`){let o=r[a];if(o!==void 0&&o!==``){if(a===`label`)continue;if(a===`name`||a===`description`||a===`group`||a===`order`)(n||i[a]===void 0||i[a]===``)&&(i[a]=o);else if(a===`minCount`)e.minCount=Math.max(e.minCount??0,t.minCount);else if(a===`maxCount`)e.maxCount=Math.min(e.maxCount??2**53-1,t.maxCount);else if(a===`qualifiedMinCount`)e.qualifiedMinCount=Math.max(e.qualifiedMinCount??0,t.qualifiedMinCount);else if(a===`qualifiedMaxCount`)e.qualifiedMaxCount=Math.min(e.qualifiedMaxCount??2**53-1,t.qualifiedMaxCount);else if(a===`nodeShapes`&&c)continue;else if(a===`node`&&c)continue;else if(a===`pathAlternatives`)continue;else if(Array.isArray(o)){let e=i[a];Array.isArray(e)?e.push(...o):i[a]=[...o]}else if(o instanceof Set&&o.size){let e=i[a];i[a]=new Set([...e instanceof Set?e:[],...o])}else i[a]=o}}e.name&&(e.label=e.name.value)}function xr(e){return e.pathAlternatives?`alternative:${JSON.stringify(e.pathAlternatives)}`:e.path}function Sr(e){return e.pathAlternatives?[...e.pathAlternatives]:e.path}function Cr(e){return e.nodeShapes.size>0&&e.qualifiedValueShape===void 0&&e.name===void 0&&e.description===void 0&&!wr(e)}function wr(e){return e.in!==void 0||e.datatype!==void 0||e.languageIn!==void 0||e.class!==void 0||e.hasValue!==void 0||e.defaultValue!==void 0}var Tr=(function(){let e=typeof document<`u`&&document.createElement(`link`).relList;return e&&e.supports&&e.supports(`modulepreload`)?`modulepreload`:`preload`})(),Er=function(e){return`/`+e},Dr={},Or=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=Er(t,n),t=s(t),t in Dr)return;Dr[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Tr,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function kr(e,t,n,r,i){let a=document.createElement(`div`);a.classList.add(`shacl-or-constraint`),a.setAttribute(`part`,`constraint`);let o=[];if(t instanceof To){let r=[],i=!1;e.length&&(i=n.store.countQuads(e[0],St,null,null)>0);for(let a=0;a<e.length;a++)if(i){let i=n.store.getObjects(e[a],St,null),s=[],c=``;for(let e of i){let r=new Za(n.getPropertyTemplate(e,t.template),t);s.push(r),c+=(c.length>0?` / `:``)+r.template.label}r.push(s),o.push({label:c,value:a.toString()})}else{let i=e[a],s=new Za(n.getPropertyTemplate(i,t.template),t);r.push([s]),o.push({label:s.template.label,value:a.toString()})}let s=n.theme.createListEditor(`Please choose`,null,!1,o);s.setAttribute(`part`,`constraint-editor`);let c=s.querySelector(`.editor`);c.onchange=async()=>{if(c.value){let e=r[parseInt(c.value)];if(n.queryMode){let{activateNodeConstraintOption:t}=await Or(async()=>{let{activateNodeConstraintOption:e}=await import(`./mode-Bjl1P7KJ.js`);return{activateNodeConstraintOption:e}},[]);await t(e,a);return}let i;if(e.length){for(let n of e)await n.bindValues(t.nodeId,!1);i=e[0],a.replaceWith(e[0]),i.updateControls()}for(let t=1;t<e.length;t++)i.after(e[t]),i=e[t],i.updateControls()}},a.appendChild(s)}else{let s=[];for(let t=0;t<e.length;t++){let r=n.store.getQuads(e[t],null,null,null);if(r.length){s.push(r);let e=It(r,n.languages);for(let t of r)t.predicate.equals(wt)&&(e||=It(n.store.getQuads(t.object,null,null,null),n.languages));o.push({label:e||Rt(r[0].predicate.value,lr)+` = `+Rt(r[0].object.value,lr),value:(s.length-1).toString()})}}let c=n.theme.createListEditor(t.template.label+`?`,null,!1,o,t.template);c.setAttribute(`part`,`constraint-editor`);let l=c.querySelector(`.editor`);l.onchange=async()=>{if(l.value){let e=yr(vr(i??t.template),s[parseInt(l.value)]);if(e.or=void 0,e.xone=void 0,n.queryMode){let{activatePropertyConstraintOption:n}=await Or(async()=>{let{activatePropertyConstraintOption:e}=await import(`./mode-Bjl1P7KJ.js`);return{activatePropertyConstraintOption:e}},[]);await n(e,t,a);return}if(r||_r(t.template)>1){let n=await eo(e,void 0,!0,!1,t.parent);n.dataset.path=t.template.path,r&&(n.dataset.predicate=r),a.replaceWith(n),n.dispatchEvent(new Event(`change`,{bubbles:!0,cancelable:!0}));return}e.pathAlternatives=void 0;let o=new Za(e,t.parent);t.replaceWith(o),await o.updateControls()}},a.appendChild(c)}return a}function Ar(e,t,n,r=!1){let i=document.createElement(`div`);i.classList.add(`alternative-path-constraint`),i.setAttribute(`part`,`constraint`),i.dataset.path=e.template.path;let a=e.template.pathAlternatives.map((e,t)=>({label:Rt(e,lr),value:t.toString()})),o=e.template.config.theme.createListEditor(`${e.template.label}: path`,null,!1,a,e.template);o.setAttribute(`part`,`constraint-editor`);let s=o.querySelector(`.editor`);return s.onchange=async()=>{if(s.value===``)return;let r=e.template.pathAlternatives[parseInt(s.value)],a=await e.addPropertyInstance(t,n,!0,r,!1);a&&(i.replaceWith(a),a.dispatchEvent(new Event(`change`,{bubbles:!0,cancelable:!0})))},i.appendChild(o),to(i,e.template.label,e.template.config.theme.dense,e.template.config.hierarchyColorsStyleSheet!==void 0,r),i}function jr(e,t,n){if(t.termType===`Literal`){let r=t.datatype;for(let t of e){let e=n.store.getQuads(t,null,null,null);for(let t of e)if(t.predicate.value===`http://www.w3.org/ns/shacl#datatype`&&t.object.equals(r))return e}}else{let r=n.store.getObjects(t,pt,null);for(let t of e){let e=n.store.getQuads(t,null,null,null);for(let t of e)if(r.length>0){if(t.predicate.value===`http://www.w3.org/ns/shacl#node`){for(let i of r)if(n.store.getQuads(t.object,Et,i,null).length>0)return e}if(t.predicate.equals(Ct)){for(let n of r)if(t.object.equals(n))return e}}else if(t.predicate.equals(Dt)&&t.object.equals(xt))return e}}return console.error(`couldn't resolve sh:or/sh:xone on property for value`,t),[]}function Mr(e,t,n){for(let r of e){let e=!1,i=n.store.getObjects(r,St,null);for(let r of i){let i=n.store.getObjects(r,`${Y}path`,null);for(let r of i)if(e=n.store.countQuads(t,r,null,null)>0,e)break}if(e)return i}return console.error(`couldn't resolve sh:or/sh:xone on node for value`,t),[]}var Nr=`:host {
|
|
27
|
+
--shacl-font-family: inherit;
|
|
28
|
+
--shacl-font-size: 14px;
|
|
29
|
+
--shacl-text-color: #333;
|
|
30
|
+
--shacl-muted-color: #555;
|
|
31
|
+
--shacl-border-color: #DDD;
|
|
32
|
+
--shacl-bg: #FFF;
|
|
33
|
+
--shacl-row-alt-bg: #F8F8F8;
|
|
34
|
+
--shacl-error-color: #C00;
|
|
35
|
+
--shacl-label-width: 8em;
|
|
36
|
+
}
|
|
37
|
+
form { display:block; --label-width: var(--shacl-label-width, 8em); --caret-size: 10px; font-family: var(--shacl-font-family); font-size: var(--shacl-font-size); color: var(--shacl-text-color); background-color: var(--shacl-bg); }
|
|
38
|
+
form.mode-edit { padding-left: 1em; }
|
|
39
|
+
form, form * { box-sizing: border-box; }
|
|
40
|
+
shacl-node, .collapsible::part(content) { display: flex; flex-direction: column; width: 100%; position: relative; }
|
|
41
|
+
shacl-node .remove-button { margin-top: 1px; }
|
|
42
|
+
shacl-node .add-button-wrapper { display: flex; width: 100%; justify-content: flex-end; gap: 20px; padding-right: 24px; color: var(--shacl-muted-color); font-size: 14px; }
|
|
43
|
+
shacl-node .add-button::part(button)::before { content: '+ ' }
|
|
44
|
+
shacl-node .link-button::part(button)::before { content: '🔗 '; font-size: 10px; }
|
|
45
|
+
shacl-node h1 { font-size: 16px; border-bottom: 1px solid #AAA; margin-top: 4px; color: var(--shacl-muted-color); }
|
|
46
|
+
shacl-property:not(:has(>.collapsible)), shacl-property>.collapsible::part(content) { display: flex; flex-direction: column; align-items: end; position: relative; }
|
|
47
|
+
shacl-property:not(.may-add) > .add-button-wrapper, shacl-property:not(.may-add) > .collapsible > .add-button-wrapper { display: none; }
|
|
48
|
+
shacl-property:not(.may-remove) > .property-instance > .remove-button-wrapper > .remove-button:not(.persistent) { visibility: hidden; }
|
|
49
|
+
shacl-property:not(.may-remove) > .collapsible > .property-instance > .remove-button-wrapper > .remove-button:not(.persistent) { visibility: hidden; }
|
|
50
|
+
shacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button-wrapper > .remove-button:not(.persistent),
|
|
51
|
+
shacl-property:not(.may-remove) > .alternative-path-constraint > .remove-button-wrapper > .remove-button:not(.persistent),
|
|
52
|
+
shacl-property:not(.may-remove) > .collapsible > .alternative-path-constraint > .remove-button-wrapper > .remove-button:not(.persistent) { visibility: hidden; }
|
|
53
|
+
.mode-view .shacl-group:not(:has(shacl-property)) { display: none; }
|
|
54
|
+
.property-instance, .shacl-or-constraint, .alternative-path-constraint { display: flex; align-items: center; padding: 4px 0; width: 100%; position: relative; }
|
|
55
|
+
.shacl-or-constraint > div, .alternative-path-constraint > div { display: flex; align-items: flex-start; }
|
|
56
|
+
.shacl-or-constraint > div:first-child, .alternative-path-constraint > div:first-child { flex-grow: 1 }
|
|
57
|
+
.shacl-or-constraint label, .alternative-path-constraint label { display: inline-block; word-break: break-word; width: var(--label-width); line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }
|
|
58
|
+
.property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; }
|
|
59
|
+
.property-instance.linked label:after, label.linked:after { content: '\\1F517'; font-size: 0.6em; position: absolute; top: 3px; right: 3px; }
|
|
60
|
+
.mode-edit .property-instance label.required::before, .add-button-wrapper.required > .add-button::before, .add-button-wrapper.required > .link-button::before { color: var(--shacl-error-color); content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; }
|
|
61
|
+
.mode-edit .add-button-wrapper.required > .add-button::before, .add-button-wrapper.required > .link-button::before { left: -0.5em; }
|
|
62
|
+
.property-instance.valid::before { content: ''; position: absolute; left: calc(var(--label-width) - 1em); top: 50%; transform: translateY(-50%); width: 0.9em; height: 0.9em; background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1024 1024" fill="green" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M866.133333 258.133333L362.666667 761.6l-204.8-204.8L98.133333 618.666667 362.666667 881.066667l563.2-563.2z"/></svg>'); }
|
|
63
|
+
.editor:not([type='checkbox']) { flex-grow: 1; }
|
|
64
|
+
textarea.editor { resize: vertical; }
|
|
65
|
+
.lang-chooser { border: 0; background-color: #e9e9ed; padding: 2px 4px; align-self: flex-start; }
|
|
66
|
+
.validation-error { position: absolute; left: calc(var(--label-width) - 1em); top: 50%; transform: translateY(-50%); color: var(--shacl-error-color); cursor: help; }
|
|
67
|
+
.validation-error::before { content: '\\26a0' }
|
|
68
|
+
.validation-error.node { left: -1em; top: calc(4px + 0.45em); transform: none; }
|
|
69
|
+
.property-instance:has(> .editor:is(textarea, rokit-textarea)).valid::before,
|
|
70
|
+
.property-instance:has(> .editor:is(textarea, rokit-textarea)) > .validation-error {
|
|
71
|
+
top: calc(4px + 0.45em);
|
|
72
|
+
transform: none;
|
|
73
|
+
}
|
|
74
|
+
.invalid > .editor { border-color: red !important; }
|
|
75
|
+
.ml-0 { margin-left: 0 !important; }
|
|
76
|
+
.pr-0 { padding-right: 0 !important; }
|
|
77
|
+
.mode-view .property-instance:not(:first-child) > label { visibility: hidden; }
|
|
78
|
+
.mode-view .property-instance label { width: var(--label-width); }
|
|
79
|
+
|
|
80
|
+
.d-flex { display: flex; }
|
|
81
|
+
.lang { opacity: 0.65; font-size: 0.6em; }
|
|
82
|
+
a, a:visited { color: inherit; }
|
|
83
|
+
h3 { margin-top: 0; }
|
|
84
|
+
|
|
85
|
+
.fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; }
|
|
86
|
+
.fadeOut { animation-direction: reverse; animation-timing-function: ease-out;}
|
|
87
|
+
@keyframes fadeIn {
|
|
88
|
+
0% { opacity: 0; transform: scaleY(0.8); }
|
|
89
|
+
100% { opacity: 1; transform: scaleY(1); }
|
|
90
|
+
}
|
|
91
|
+
.collapsible::part(label) { font-weight: 600; }
|
|
92
|
+
.collapsible > .property-instance:nth-child(even) { background-color: var(--shacl-row-alt-bg); }
|
|
93
|
+
.collapsible > .property-instance > shacl-node > h1 { display: none; }
|
|
94
|
+
.ref-link { cursor: pointer; }
|
|
95
|
+
.ref-link:hover { text-decoration: underline; }
|
|
96
|
+
.node-id-display { color: var(--shacl-muted-color); font-size: 11px; }
|
|
97
|
+
/* hierarchy colors */
|
|
98
|
+
.colorize { --hierarchy-color-width: 3px; padding: 0 1px 0 calc(1px + var(--hierarchy-color-width)); align-self: stretch; position: relative; }
|
|
99
|
+
.colorize::before {
|
|
100
|
+
content: '';
|
|
101
|
+
position: absolute;
|
|
102
|
+
width: var(--hierarchy-color-width);
|
|
103
|
+
top: 0; bottom: 0; left: 0;
|
|
104
|
+
--index: mod(var(--hierarchy-level), var(--hierarchy-colors-length));
|
|
105
|
+
background: linear-gradient(var(--hierarchy-colors)) no-repeat 0 calc(var(--index) * 100% / (var(--hierarchy-colors-length) - 1)) / 100% calc(1px * infinity);
|
|
106
|
+
}
|
|
107
|
+
.property-instance:not(:has(shacl-node)) > .colorize::before { background: 0; }
|
|
108
|
+
.colorize:not(:has(.remove-button)) { padding-left: calc(8px + var(--hierarchy-color-width)); }
|
|
109
|
+
.mode-view .property-instance > .colorize { order: -1; }
|
|
110
|
+
.link-option { padding: 10px; }
|
|
111
|
+
.link-option:hover { background-color: #F5F5F5; cursor: pointer; }
|
|
112
|
+
rokit-dialog.link-chooser::part(dialog) { min-height: min(434px, 90vh); width: min(90vw, 600px); }
|
|
113
|
+
rokit-select::part(facet-count) { color: var(--shacl-muted-color); }
|
|
114
|
+
rokit-select::part(facet-count)::after { content: attr(data-count); color: inherit; display: inline-block; font-family: monospace; margin-left: 7px; font-size: 12px; }
|
|
115
|
+
`,Pr=class{constructor(e){this.dense=!0;let t=Nr;e&&(t+=`
|
|
116
|
+
`+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t)}apply(e){}setDense(e){this.dense=e}createViewer(e,t,n){let r=document.createElement(`div`),i=document.createElement(`label`);i.textContent=`${e}:`,n.description&&i.setAttribute(`title`,n.description.value),r.appendChild(i);let a=t.value,o=null;if(t instanceof j){let e=n.config.store.getQuads(a,null,null,null);if(e.length){let t=It(e,n.config.languages);t&&(a=t)}}else t instanceof M&&(t.language?(o=document.createElement(`span`),o.classList.add(`lang`),o.innerText=`@${t.language}`):t.datatype.value===`http://www.w3.org/2001/XMLSchema#date`?a=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`http://www.w3.org/2001/XMLSchema#dateTime`&&(a=new Date(Date.parse(t.value)).toLocaleString()));let s;return Wt(t.value)?(s=document.createElement(`a`),s.setAttribute(`href`,t.value)):s=document.createElement(`div`),s.classList.add(`d-flex`),s.innerText=a,o&&s.appendChild(o),r.appendChild(s),r}};function Fr(e,t,n){if(n){let n=gr(e)>0;if(e.class&&!e.hasValue)return e.config.theme.createListEditor(e.label,t,n,Ut(e.class,e),e);if(e.in){let r=e.config.lists[e.in];if(r?.length){let i=Lt(r,e.config.store,e.config.languages);return e.config.theme.createListEditor(e.label,t,n,i,e)}else console.error(`list not found:`,e.in,`existing lists:`,e.config.lists)}if(e.datatype?.equals(mt)||e.languageIn?.length||e.datatype===void 0&&t instanceof M&&t.language)return e.config.theme.createLangStringEditor(e.label,t,n,e);switch(e.datatype?.value.replace(ot,``)){case`integer`:case`float`:case`double`:case`decimal`:return e.config.theme.createNumberEditor(e.label,t,n,e);case`date`:case`dateTime`:return e.config.theme.createDateEditor(e.label,t,n,e);case`boolean`:return e.config.theme.createBooleanEditor(e.label,t,n,e);case`base64Binary`:return e.config.theme.createFileEditor(e.label,t,n,e)}return e.config.theme.createTextEditor(e.label,t,n,e)}else return t?e.config.theme.createViewer(e.label,t,e):document.createElement(`div`)}function Ir(e,t){e.rdfTerm=t??void 0,e.rdfTermState=t?Ur(e):void 0}function Lr(e,t){e.rdfTerms=new Map;for(let n of t)e.rdfTerms.set(Rr(n),n)}function Rr(e){return I(e)}function zr(e){let t=e.rdfTerms?.get(e.value);if(t)return t;if(!(!e.rdfTerm||!Wr(e.rdfTermState,Ur(e))))return e.rdfTerm}function Br(e){let t=zr(e);if(t)return t;let n=e.shaclDatatype,r=e.dataset.value||e.value;if((e.type===`file`||e.getAttribute(`type`)===`file`)&&e.binaryData)r=e.binaryData;else if(e.type===`checkbox`||e.getAttribute(`type`)===`checkbox`)return e.checked||parseInt(e.dataset.minCount||`0`)>0?k.literal(e.checked?`true`:`false`,n):void 0;if(!r)return;let i=e.dataset.nodeKind,a=Vr(r);if(e.dataset.link)return k.fromTerm(JSON.parse(e.dataset.link));if(e.dataset.class)return a instanceof j||a instanceof N?a:k.namedNode(r);if(i===`http://www.w3.org/ns/shacl#IRI`)return a instanceof j?a:k.namedNode(r);if(i===`http://www.w3.org/ns/shacl#BlankNode`)return a instanceof N?a:k.blankNode(r);if(i===`http://www.w3.org/ns/shacl#BlankNodeOrIRI`)return a instanceof j||a instanceof N?a:k.namedNode(r);if(a instanceof j||a instanceof N||a instanceof M&&!e.dataset.lang&&(!n||n instanceof j&&Ot.equals(n)))return a;if(e.dataset.lang)n=e.dataset.lang;else if(n instanceof j&&Mt.has(n.value)){let e=Hr(r);if(e===void 0)return;r=e}else e.type===`number`?r=parseFloat(r):e.type===`datetime-local`?r=$t(r,e.dataset.xsdTemporalSuffix):e.type===`date`&&n instanceof j&&n.value===`http://www.w3.org/2001/XMLSchema#date`&&(r=Qt(r,e.dataset.xsdTemporalSuffix));return k.literal(r,n)}function Vr(e){let t=e;if(e.startsWith(`<`)&&e.endsWith(`>`))t=e.slice(1,-1);else if(!e.startsWith(`_:`)&&!e.startsWith(`"`))return;let n=F(t,k);return n instanceof j||n instanceof N||n instanceof M?n:void 0}function Hr(e){let t=e.replace(`,`,`.`);return/^[-+]?(?:[0-9]+(?:\.[0-9]*)?|\.[0-9]+)(?:[eE][-+]?[0-9]+)?$/.test(t)?t:void 0}function Ur(e){return{value:e.value,language:e.dataset.lang,checked:e.checked,binaryData:e.binaryData}}function Wr(e,t){return e?.value===t.value&&e.language===t.language&&e.checked===t.checked&&e.binaryData===t.binaryData}function Gr(e,t,n){if(t===`application/ld+json`)return Kr(e);{let r=new xe({format:t,prefixes:n});r.addQuads(e);let i=``;return r.end((e,t)=>{e&&console.error(e),i=t}),i}}function Kr(e){let t=[];for(let n of e){let e={"@id":n.subject.id};if(n.predicate===pt)e[`@type`]=n.object.id;else{let t=n.object.value;n.object instanceof M?n.object.language?t={"@language":n.object.language,"@value":n.object.value}:n.object.datatype&&n.object.datatype.value!==`http://www.w3.org/2001/XMLSchema##string`&&(t={"@type":n.object.datatype.value,"@value":n.object.value}):t={"@id":n.object.id},e[n.predicate.value]=t}t.push(e)}return JSON.stringify(t)}var qr={};function Jr(e){e.predicate===void 0&&e.datatype===void 0?console.warn(`not registering plugin because it does neither define "predicate" nor "datatype"`,e):qr[`${e.predicate}^${e.datatype}`]=e}function Yr(){return Object.entries(qr).map(e=>e[1])}function Xr(e,t){let n=qr[`${e}^${t}`];return n||(n=qr[`${e}^undefined`],n)?n:qr[`undefined^${t}`]}var Zr=class{constructor(e,t){this.predicate=e.predicate,this.datatype=e.datatype,t&&(this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t))}createViewer(e,t){return e.config.theme.createViewer(e.label,t,e)}},Qr=globalThis,$r=Qr.ShadowRoot&&(Qr.ShadyCSS===void 0||Qr.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,ei=Symbol(),ti=new WeakMap,ni=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==ei)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if($r&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=ti.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ti.set(t,e))}return e}toString(){return this.cssText}},ri=e=>new ni(typeof e==`string`?e:e+``,void 0,ei),ii=(e,...t)=>new ni(e.length===1?e[0]:t.reduce((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1],e[0]),e,ei),ai=(e,t)=>{if($r)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let n of t){let t=document.createElement(`style`),r=Qr.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},oi=$r?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return ri(t)})(e):e,{is:si,defineProperty:ci,getOwnPropertyDescriptor:li,getOwnPropertyNames:ui,getOwnPropertySymbols:di,getPrototypeOf:fi}=Object,pi=globalThis,mi=pi.trustedTypes,hi=mi?mi.emptyScript:``,gi=pi.reactiveElementPolyfillSupport,_i=(e,t)=>e,vi={toAttribute(e,t){switch(t){case Boolean:e=e?hi:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},yi=(e,t)=>!si(e,t),bi={attribute:!0,type:String,converter:vi,reflect:!1,useDefault:!1,hasChanged:yi};Symbol.metadata??=Symbol(`metadata`),pi.litPropertyMetadata??=new WeakMap;var xi=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,t=bi){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&ci(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=li(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??bi}static _$Ei(){if(this.hasOwnProperty(_i(`elementProperties`)))return;let e=fi(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(_i(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(_i(`properties`))){let e=this.properties,t=[...ui(e),...di(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(oi(e))}else e!==void 0&&t.push(oi(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n: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_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ai(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,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?vi:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?vi:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n,r=!1,i){if(e!==void 0){let a=this.constructor;if(!1===r&&(i=this[e]),n??=a.getPropertyOptions(e),!((n.hasChanged??yi)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let 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(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.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(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}};xi.elementStyles=[],xi.shadowRootOptions={mode:`open`},xi[_i(`elementProperties`)]=new Map,xi[_i(`finalized`)]=new Map,gi?.({ReactiveElement:xi}),(pi.reactiveElementVersions??=[]).push(`2.1.2`);var Si=globalThis,Ci=e=>e,wi=Si.trustedTypes,Ti=wi?wi.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,Ei=`$lit$`,Di=`lit$${Math.random().toFixed(9).slice(2)}$`,Oi=`?`+Di,ki=`<${Oi}>`,Ai=document,ji=()=>Ai.createComment(``),Mi=e=>e===null||typeof e!=`object`&&typeof e!=`function`,Ni=Array.isArray,Pi=e=>Ni(e)||typeof e?.[Symbol.iterator]==`function`,Fi=`[
|
|
117
|
+
\f\r]`,Ii=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Li=/-->/g,Ri=/>/g,zi=RegExp(`>|${Fi}(?:([^\\s"'>=/]+)(${Fi}*=${Fi}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),Bi=/'/g,Vi=/"/g,Hi=/^(?:script|style|textarea|title)$/i,Ui=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),Wi=Symbol.for(`lit-noChange`),X=Symbol.for(`lit-nothing`),Gi=new WeakMap,Ki=Ai.createTreeWalker(Ai,129);function qi(e,t){if(!Ni(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return Ti===void 0?t:Ti.createHTML(t)}var Ji=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=Ii;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===Ii?c[1]===`!--`?o=Li:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=zi):(Hi.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=zi):o=Ri:o===zi?c[0]===`>`?(o=i??Ii,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?zi:c[3]===`"`?Vi:Bi):o===Vi||o===Bi?o=zi:o===Li||o===Ri?o=Ii:(o=zi,i=void 0);let d=o===zi&&e[t+1].startsWith(`/>`)?` `:``;a+=o===Ii?n+ki:l>=0?(r.push(s),n.slice(0,l)+Ei+n.slice(l)+Di+d):n+Di+(l===-2?t:d)}return[qi(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},Yi=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=Ji(t,n);if(this.el=e.createElement(l,r),Ki.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=Ki.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(Ei)){let t=u[o++],n=i.getAttribute(e).split(Di),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?ea:r[1]===`?`?ta:r[1]===`@`?na:$i}),i.removeAttribute(e)}else e.startsWith(Di)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Hi.test(i.tagName)){let e=i.textContent.split(Di),t=e.length-1;if(t>0){i.textContent=wi?wi.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],ji()),Ki.nextNode(),c.push({type:2,index:++a});i.append(e[t],ji())}}}else if(i.nodeType===8)if(i.data===Oi)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(Di,e+1))!==-1;)c.push({type:7,index:a}),e+=Di.length-1}a++}}static createElement(e,t){let n=Ai.createElement(`template`);return n.innerHTML=e,n}};function Xi(e,t,n=e,r){if(t===Wi)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=Mi(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=Xi(e,i._$AS(e,t.values),i,r)),t}var Zi=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??Ai).importNode(t,!0);Ki.currentNode=r;let i=Ki.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Qi(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new ra(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=Ki.nextNode(),a++)}return Ki.currentNode=Ai,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Qi=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=X,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Xi(this,e,t),Mi(e)?e===X||e==null||e===``?(this._$AH!==X&&this._$AR(),this._$AH=X):e!==this._$AH&&e!==Wi&&this._(e):e._$litType$===void 0?e.nodeType===void 0?Pi(e)?this.k(e):this._(e):this.T(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!==X&&Mi(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ai.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Yi.createElement(qi(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Zi(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Gi.get(e.strings);return t===void 0&&Gi.set(e.strings,t=new Yi(e)),t}k(t){Ni(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(ji()),this.O(ji()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=Ci(e).nextSibling;Ci(e).remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},$i=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=X,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=X}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=Xi(this,e,t,0),a=!Mi(e)||e!==this._$AH&&e!==Wi,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=Xi(this,r[n+o],t,o),s===Wi&&(s=this._$AH[o]),a||=!Mi(s)||s!==this._$AH[o],s===X?e=X:e!==X&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===X?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},ea=class extends $i{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===X?void 0:e}},ta=class extends $i{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==X)}},na=class extends $i{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=Xi(this,e,t,0)??X)===Wi)return;let n=this._$AH,r=e===X&&n!==X||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==X&&(n===X||r);r&&this.element.removeEventListener(this.name,this,n),i&&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)}},ra=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Xi(this,e)}},ia=Si.litHtmlPolyfillSupport;ia?.(Yi,Qi),(Si.litHtmlVersions??=[]).push(`3.3.2`);var aa=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Qi(t.insertBefore(ji(),e),e,void 0,n??{})}return i._$AI(e),i},oa=globalThis,sa=class extends xi{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=aa(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return Wi}};sa._$litElement$=!0,sa.finalized=!0,oa.litElementHydrateSupport?.({LitElement:sa});var ca=oa.litElementPolyfillSupport;ca?.({LitElement:sa}),(oa.litElementVersions??=[]).push(`4.2.2`);var la=e=>(t,n)=>{n===void 0?customElements.define(e,t):n.addInitializer(()=>{customElements.define(e,t)})},ua={attribute:!0,type:String,converter:vi,reflect:!1,hasChanged:yi},da=(e=ua,t,n)=>{let{kind:r,metadata:i}=n,a=globalThis.litPropertyMetadata.get(i);if(a===void 0&&globalThis.litPropertyMetadata.set(i,a=new Map),r===`setter`&&((e=Object.create(e)).wrapped=!0),a.set(n.name,e),r===`accessor`){let{name:r}=n;return{set(n){let i=t.get.call(this);t.set.call(this,n),this.requestUpdate(r,i,e,!0,n)},init(t){return t!==void 0&&this.C(r,void 0,e,t),t}}}if(r===`setter`){let{name:r}=n;return function(n){let i=this[r];t.call(this,n),this.requestUpdate(r,i,e,!0,n)}}throw Error(`Unsupported decorator location: `+r)};function Z(e){return(t,n)=>typeof n==`object`?da(e,t,n):((e,t,n)=>{let r=t.hasOwnProperty(n);return t.constructor.createProperty(n,e),r?Object.getOwnPropertyDescriptor(t,n):void 0})(e,t,n)}function fa(e){return Z({...e,state:!0,attribute:!1})}var pa=(e,t,n)=>(n.configurable=!0,n.enumerable=!0,Reflect.decorate&&typeof t!=`object`&&Object.defineProperty(e,t,n),n);function ma(e,t){return(n,r,i)=>{let a=t=>t.renderRoot?.querySelector(e)??null;if(t){let{get:e,set:t}=typeof r==`object`?n:i??(()=>{let e=Symbol();return{get(){return this[e]},set(t){this[e]=t}}})();return pa(n,r,{get(){let n=e.call(this);return n===void 0&&(n=a(this),(n!==null||this.hasUpdated)&&t.call(this,n)),n}})}return pa(n,r,{get(){return a(this)}})}}function Q(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var ha=class extends sa{constructor(...e){super(...e),this.dense=!1}static{this.shadowRootOptions={...sa.shadowRootOptions,delegatesFocus:!0}}static{this.styles=[ii`
|
|
118
|
+
:host {
|
|
119
|
+
--rokit-primary-color-inner: var(--rokit-primary-color, #008877);
|
|
120
|
+
--rokit-primary-color-transparent-inner: color-mix(in srgb, var(--rokit-primary-color-inner) 40%, transparent);
|
|
121
|
+
--rokit-error-color-inner: var(--rokit-error-color, #F03333);
|
|
122
|
+
--rokit-background-color-inner: var(--rokit-background-color, #FFF);
|
|
123
|
+
--rokit-light-background-color-inner: var(--rokit-light-background-color, color-mix(in srgb, var(--rokit-background-color-inner) 97%, currentColor));
|
|
124
|
+
--rokit-light-background-darker-color-inner: var(--rokit-light-background-darker-color, color-mix(in srgb, var(--rokit-light-background-color-inner) 80%, currentColor));
|
|
125
|
+
--rokit-shadow-color-inner: var(--rokit-shadow-color, color-mix(in srgb, currentColor 40%, transparent));
|
|
126
|
+
--rokit-list-indent-inner: var(--rokit-list-indent, 1em);
|
|
127
|
+
--rokit-list-max-height-inner: var(--rokit-list-max-height, 300);
|
|
128
|
+
--rokit-caret-size-inner: var(--rokit-caret-size, 0.5em);
|
|
129
|
+
--rokit-transition-duration-inner: var(--rokit-transition-duration, 0.2s);
|
|
130
|
+
display: inline-flex;
|
|
131
|
+
font-size: 16px;
|
|
132
|
+
position: relative;
|
|
133
|
+
}
|
|
134
|
+
:host(.loading)::part(loader):before {
|
|
135
|
+
content: '';
|
|
136
|
+
width: 0.7em;
|
|
137
|
+
height: 0.7em;
|
|
138
|
+
border: 0.15em solid;
|
|
139
|
+
border-bottom-color: transparent;
|
|
140
|
+
border-radius: 50%;
|
|
141
|
+
animation: rotation-animation 0.8s linear infinite;
|
|
142
|
+
}
|
|
143
|
+
:host([dense]) { font-size: 14px; }
|
|
144
|
+
@keyframes rotation-animation {
|
|
145
|
+
0% { transform: rotate(0deg); }
|
|
146
|
+
100% { transform: rotate(360deg); }
|
|
147
|
+
}
|
|
148
|
+
`]}};Q([Z({type:Boolean,reflect:!0})],ha.prototype,`dense`,void 0);var ga=class extends ha{static{this.formAssociated=!0}static{this.styles=[...ha.styles,ii`
|
|
149
|
+
:host { align-items: center; padding: 6px 8px; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); box-sizing: border-box; }
|
|
150
|
+
:host(:focus) { border-color: var(--rokit-primary-color-inner); }
|
|
151
|
+
:host(.invalid) { border-color: var(--rokit-error-color-inner); }
|
|
152
|
+
`]}#e;constructor(){super(),this.value=``,this.clearable=!1,this.required=!1,this.disabled=!1,this.#e=this.attachInternals()}checkValidity(){return this.#e.checkValidity()}reportValidity(){let e=this.#e.reportValidity();return this.classList.toggle(`invalid`,!e),e}get validity(){return this.#e.validity}get validationMessage(){return this.#e.validationMessage}setCustomValidity(e,t){e?this.#e.setValidity({customError:!0},e,t):this.#e.setValidity({}),this.classList.toggle(`invalid`,!this.#e.validity.valid)}updateValidity(e,t,n){this.#e.setValidity(e,t,n),this.classList.toggle(`invalid`,!this.#e.validity.valid)}setFormValue(e,t){this.#e.setFormValue(e,t)}};Q([Z()],ga.prototype,`name`,void 0),Q([Z()],ga.prototype,`value`,void 0),Q([Z({type:Boolean})],ga.prototype,`clearable`,void 0),Q([Z({type:Boolean,reflect:!0})],ga.prototype,`required`,void 0),Q([Z({type:Boolean,reflect:!0})],ga.prototype,`disabled`,void 0),Q([Z()],ga.prototype,`label`,void 0),Q([Z()],ga.prototype,`placeholder`,void 0);function _a(e){let t=e.trim();if(t.endsWith(`ms`)){let e=Number(t.slice(0,-2));return Number.isFinite(e)?e:0}if(t.endsWith(`s`)){let e=Number(t.slice(0,-1));return Number.isFinite(e)?e*1e3:0}return 0}var va=class extends ha{static{this.styles=[...ha.styles,ii`
|
|
153
|
+
:host { display: inline-flex; align-items: center; }
|
|
154
|
+
:host([disabled]) { pointer-events: none; opacity: 0.5; }
|
|
155
|
+
:host([rounded]) .button { border-radius: 200px; }
|
|
156
|
+
:host([primary]) .button { color: white; background-color: var(--rokit-primary-color-inner); border-color: var(--rokit-primary-color-transparent-inner); }
|
|
157
|
+
:host([primary][text]) .button { color: var(--rokit-primary-color-inner); }
|
|
158
|
+
:host([primary]:not([text])) .button:hover { filter: brightness(115%); }
|
|
159
|
+
:host([text]) .button { background-color: inherit; border-color: transparent; }
|
|
160
|
+
:host([icon]) .button {
|
|
161
|
+
width: 2em;
|
|
162
|
+
height: 2em;
|
|
163
|
+
padding: 0;
|
|
164
|
+
line-height: 1;
|
|
165
|
+
border-radius: 50%;
|
|
166
|
+
border-color: transparent;
|
|
167
|
+
background-color: inherit;
|
|
168
|
+
}
|
|
169
|
+
:host([icon]) .button:hover, :host([text]) .button:hover { background-color: transparent; backdrop-filter: invert(20%) }
|
|
170
|
+
.icon {
|
|
171
|
+
flex: 0 0 auto;
|
|
172
|
+
display: inline-flex;
|
|
173
|
+
align-items: center;
|
|
174
|
+
justify-content: center;
|
|
175
|
+
width: 1em;
|
|
176
|
+
height: 1em;
|
|
177
|
+
line-height: 0;
|
|
178
|
+
vertical-align: middle;
|
|
179
|
+
position: relative;
|
|
180
|
+
top: var(--rokit-button-icon-offset-y, 0);
|
|
181
|
+
}
|
|
182
|
+
.clear-icon {
|
|
183
|
+
position: relative;
|
|
184
|
+
width: 0.9em;
|
|
185
|
+
height: 0.9em;
|
|
186
|
+
}
|
|
187
|
+
.clear-icon:before,
|
|
188
|
+
.clear-icon:after {
|
|
189
|
+
content: '';
|
|
190
|
+
position: absolute;
|
|
191
|
+
top: 50%;
|
|
192
|
+
left: 50%;
|
|
193
|
+
width: 100%;
|
|
194
|
+
height: 2px;
|
|
195
|
+
border-radius: 999px;
|
|
196
|
+
background-color: currentColor;
|
|
197
|
+
}
|
|
198
|
+
.clear-icon:before { transform: translate(-50%, -50%) rotate(45deg); }
|
|
199
|
+
.clear-icon:after { transform: translate(-50%, -50%) rotate(-45deg); }
|
|
200
|
+
.caret-icon {
|
|
201
|
+
display: block;
|
|
202
|
+
width: var(--rokit-caret-size-inner);
|
|
203
|
+
height: var(--rokit-caret-size-inner);
|
|
204
|
+
box-sizing: border-box;
|
|
205
|
+
border-color: currentColor;
|
|
206
|
+
border-style: none solid solid none;
|
|
207
|
+
border-width: calc(0.2 * var(--rokit-caret-size-inner));
|
|
208
|
+
transform: translate(0, -0.15em) rotate(45deg);
|
|
209
|
+
transition: transform var(--rokit-transition-duration-inner) ease-out;
|
|
210
|
+
}
|
|
211
|
+
:host(.caret.down) .caret-icon { transform: translate(0, 0.15em) rotate(225deg); }
|
|
212
|
+
:host(.caret.right) .caret-icon { transform: translate(-0.15em, 0) rotate(-45deg); }
|
|
213
|
+
.button {
|
|
214
|
+
display: inline-flex;
|
|
215
|
+
flex-grow: 1;
|
|
216
|
+
gap: 0.5em;
|
|
217
|
+
align-items: center;
|
|
218
|
+
justify-content: center;
|
|
219
|
+
box-sizing: border-box;
|
|
220
|
+
text-decoration: none;
|
|
221
|
+
appearance: none;
|
|
222
|
+
-webkit-appearance: none;
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
white-space: nowrap;
|
|
225
|
+
overflow: hidden;
|
|
226
|
+
margin: 0;
|
|
227
|
+
line-height: 1.2em;
|
|
228
|
+
font-family: inherit;
|
|
229
|
+
font-size: inherit;
|
|
230
|
+
font-weight: 500;
|
|
231
|
+
color: inherit;
|
|
232
|
+
padding: 0.4em 0.6em;
|
|
233
|
+
background-color: var(--rokit-light-background-color-inner);
|
|
234
|
+
border: 1px solid var(--rokit-light-background-darker-color-inner);
|
|
235
|
+
border-radius: 3px;
|
|
236
|
+
}
|
|
237
|
+
.button:hover { filter: brightness(102%); }
|
|
238
|
+
`]}constructor(){super(),this.icon=!1,this.disabled=!1,this.href=``,this.addEventListener(`keydown`,e=>{!this.disabled&&(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),e.stopPropagation(),this.click())})}renderContent(){return this.classList.contains(`clear`)?Ui`<span part="icon clear-icon" class="icon clear-icon" aria-hidden="true"></span>`:this.classList.contains(`caret`)?Ui`<span part="icon caret-icon" class="icon caret-icon" aria-hidden="true"></span>`:Ui`<slot></slot>`}render(){return this.href?Ui`<a
|
|
239
|
+
part="button loader"
|
|
240
|
+
class="button"
|
|
241
|
+
href="${this.disabled?X:this.href}"
|
|
242
|
+
aria-disabled="${this.disabled?`true`:`false`}"
|
|
243
|
+
tabindex="${this.disabled?`-1`:`0`}"
|
|
244
|
+
@click="${e=>{this.disabled&&(e.preventDefault(),e.stopPropagation())}}"
|
|
245
|
+
>${this.renderContent()}</a>`:Ui`<button part="button loader" class="button" type="button" ?disabled="${this.disabled}" @click="${e=>{this.disabled&&(e.preventDefault(),e.stopPropagation())}}">${this.renderContent()}</button>`}};Q([Z({type:Boolean,reflect:!0})],va.prototype,`icon`,void 0),Q([Z({type:Boolean,reflect:!0})],va.prototype,`disabled`,void 0),Q([Z()],va.prototype,`href`,void 0),va=Q([la(`rokit-button`)],va);var ya=class extends ha{constructor(...e){super(...e),this.open=!1,this.disabled=!1,this.headerInactive=!1,this.transitioning=!1,this.closedBeforeTransition=!1,this.#t=new MutationObserver(()=>this.updateContentHeight()),this.#n=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.updateContentHeight()}),this.onMouseDown=(()=>{this.closedBeforeTransition=!this.open&&!this.transitioning}).bind(this),this.onClickToggles=(()=>{this.toggle(this.closedBeforeTransition,!0)}).bind(this),this.onClickOpens=(()=>{this.toggle(!0,!0)}).bind(this),this.onHeaderKeyDown=(e=>{if(!this.disabled&&(e.key===` `||e.key===`Enter`)){if(e.composedPath().some(e=>e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement))return;e.preventDefault(),this.headerInactive?this.toggle(!0,!0):this.toggle(!this.open,!0)}}).bind(this),this.onToggleClick=(e=>{e.stopPropagation(),this.toggle(!this.open,!0)}).bind(this)}static{this.styles=[...ha.styles,ii`
|
|
246
|
+
:host { display: flex; flex-direction: column; align-items: stretch; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); }
|
|
247
|
+
:host header { cursor: pointer; }
|
|
248
|
+
:host([dense]) header { padding: 2px 4px; }
|
|
249
|
+
:host([maxheight]) #content { overflow:auto }
|
|
250
|
+
:host(:not([open])) #content { max-height: 0 !important; }
|
|
251
|
+
:host(:not([open])) #content, :host(.transitioning) #content { overflow: hidden !important; }
|
|
252
|
+
:host([open]) #content, :host(.transitioning) #content { padding-top: 4px; }
|
|
253
|
+
header { display: flex; align-items: center; padding: 6px 8px; background-color: var(--rokit-light-background-color-inner); user-select: none; }
|
|
254
|
+
.label { flex-grow: 1; overflow: hidden; }
|
|
255
|
+
#content { display: flex; transition: max-height var(--rokit-transition-duration-inner) ease-in-out; position: relative; scrollbar-width: thin; }
|
|
256
|
+
#toggle { margin-left: 3px; }
|
|
257
|
+
`]}#e;#t;#n;firstUpdated(){this.transitionDuration=_a(getComputedStyle(this).getPropertyValue(`--rokit-transition-duration-inner`)),this.#n.observe(this),this.#i(),this.#a()}disconnectedCallback(){super.disconnectedCallback(),this.#t.disconnect(),this.#n.disconnect(),this.#r(),this.#e!==void 0&&clearTimeout(this.#e)}updated(e){e.has(`transitioning`)&&this.classList.toggle(`transitioning`,this.transitioning),(e.has(`disabled`)||e.has(`headerInactive`))&&(this.toggleButton.disabled=this.disabled,this.#i()),(e.has(`disabled`)||e.has(`headerInactive`)||e.has(`open`))&&this.#a(),e.has(`open`)&&!this.transitioning&&!this.disabled&&this.toggle(this.open)}#r(){this.header.removeEventListener(`mousedown`,this.onMouseDown),this.header.removeEventListener(`click`,this.onClickToggles),this.header.removeEventListener(`click`,this.onClickOpens),this.header.removeEventListener(`keydown`,this.onHeaderKeyDown),this.toggleButton.removeEventListener(`mousedown`,this.onMouseDown),this.toggleButton.removeEventListener(`click`,this.onToggleClick)}#i(){this.#r(),!this.disabled&&(this.toggleButton.addEventListener(`mousedown`,this.onMouseDown),this.toggleButton.addEventListener(`click`,this.onToggleClick),this.headerInactive?(this.header.addEventListener(`click`,this.onClickOpens),this.header.addEventListener(`keydown`,this.onHeaderKeyDown)):(this.header.addEventListener(`mousedown`,this.onMouseDown),this.header.addEventListener(`click`,this.onClickToggles),this.header.addEventListener(`keydown`,this.onHeaderKeyDown)))}#a(){this.header.tabIndex=this.disabled?-1:0,this.header.setAttribute(`role`,(this.headerInactive,`button`)),this.header.setAttribute(`aria-disabled`,String(this.disabled)),this.header.setAttribute(`aria-expanded`,String(this.open)),this.header.setAttribute(`aria-controls`,`content`)}updateContentHeight(){setTimeout(()=>{this.content.style.maxHeight=(this.maxHeight===void 0?this.content.scrollHeight:Math.min(this.maxHeight,this.content.scrollHeight))+`px`,this.classList.toggle(`has-content`,this.content.style.maxHeight!==`0px`)})}onSlotChange(){let e=this.shadowRoot.querySelector(`#content > slot`).assignedElements({flatten:!0});this.#t.disconnect();for(let t of e)this.#t.observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0});this.updateContentHeight()}toggle(e=!this.open,t=!1){this.disabled||(this.transitioning=this.open!==e,this.open=e,this.toggleButton.classList.toggle(`down`,e),this.#e!==void 0&&clearTimeout(this.#e),this.#e=window.setTimeout(()=>{this.transitioning=!1,this.open&&t&&this.content.scrollIntoView({block:`nearest`})},this.transitionDuration))}render(){return Ui`
|
|
258
|
+
<header part="header">
|
|
259
|
+
<slot name="prefix" part="prefix"></slot>
|
|
260
|
+
<span class="label"><slot name="label" part="label">${this.label}</slot></span>
|
|
261
|
+
<slot name="pre-suffix" part="suffix"></slot>
|
|
262
|
+
<rokit-button id="toggle" part="toggle" class="caret" icon ?dense="${this.dense}" title="${this.open?`Collapse`:`Expand`}"></rokit-button>
|
|
263
|
+
<slot name="suffix" part="suffix loader"></slot>
|
|
264
|
+
</header>
|
|
265
|
+
<div id="content" part="content" ?hidden="${!this.open&&!this.transitioning}">
|
|
266
|
+
<slot @slotchange=${this.onSlotChange}></slot>
|
|
267
|
+
</div>
|
|
268
|
+
`}};Q([Z({type:Boolean,reflect:!0})],ya.prototype,`open`,void 0),Q([Z()],ya.prototype,`label`,void 0),Q([Z({reflect:!0})],ya.prototype,`maxHeight`,void 0),Q([Z({type:Boolean})],ya.prototype,`disabled`,void 0),Q([Z({type:Boolean})],ya.prototype,`headerInactive`,void 0),Q([ma(`#content`)],ya.prototype,`content`,void 0),Q([ma(`#toggle`)],ya.prototype,`toggleButton`,void 0),Q([ma(`header`)],ya.prototype,`header`,void 0),Q([fa()],ya.prototype,`transitioning`,void 0),ya=Q([la(`rokit-collapsible`)],ya);var $=class extends ga{static{this.styles=[...ga.styles,ii`
|
|
269
|
+
:host { background-color: var(--rokit-light-background-color-inner); user-select: none; flex-wrap: wrap; }
|
|
270
|
+
:host([dense]) { padding: 2px 4px; }
|
|
271
|
+
:host(.has-focus:not([readonly])) label, :host(.has-value) label, :host([sticky]) label { font-size: 0.75em; top: 0.5em; font-weight: 600; }
|
|
272
|
+
:host(.has-focus) label { color: var(--rokit-primary-color-inner); }
|
|
273
|
+
.wrapper { display: flex; position: relative; flex-grow: 1; align-items: center; }
|
|
274
|
+
label { position: absolute; top: 50%; transform: translate(0, -50%); transition-property: top, font-size; transition-duration: var(--rokit-transition-duration-inner); max-width: 100%; overflow: hidden; pointer-events: none; white-space: nowrap; }
|
|
275
|
+
#input { height: 1.3em; border: 0; outline: 0; flex-grow: 1; font-size: 1em; background: none; padding: 0; color: currentColor; font-family: inherit; text-overflow: ellipsis; }
|
|
276
|
+
#input[type='file'] { padding-bottom: 3px; }
|
|
277
|
+
#input[readonly] { caret-color: transparent; }
|
|
278
|
+
#input[readonly]::placeholder { color: transparent; }
|
|
279
|
+
:host(.has-label) #input { margin-top: 0.9em; }
|
|
280
|
+
:host(.has-label:not(.has-focus):not(.has-value):not([sticky])) #input { clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
|
|
281
|
+
:host(:not(.has-value)) .clear { visibility: hidden; }
|
|
282
|
+
.supporting-text { width: 100%; font-size: 0.8em; }
|
|
283
|
+
`]}#e;#t;#n;#r;#i;#a;#o;#s;#c;constructor(){super(),this.type=`text`,this.readonly=!1,this.sticky=!1,this.minWidth=80,this.autoGrowLabelWidth=!1,this.#e=``,this.#t=!0,this.#r=document.createElement(`input`),this.#i=e=>{e.code===`Escape`&&this.blur()},this.#a=()=>{this.classList.add(`has-focus`)},this.#o=()=>{this.inputElement&&(this.inputElement.scrollLeft=0),this.classList.remove(`has-focus`)},this.#s=()=>{this.value=this.inputElement.value,this.updateInputValidity(),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0}))},this.#c=()=>{this.value=this.inputElement.value,this.updateInputValidity(),this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))},this.addEventListener(`keydown`,this.#i),this.addEventListener(`focusin`,this.#a),this.addEventListener(`focusout`,this.#o)}firstUpdated(){this.#e=this.value,this.inputElement.addEventListener(`input`,this.#s),this.inputElement.addEventListener(`change`,this.#c),this.autoGrowLabelWidth&&(this.#n=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.updateMinWidth()}),this.#n.observe(this))}disconnectedCallback(){this.inputElement?.removeEventListener(`input`,this.#s),this.inputElement?.removeEventListener(`change`,this.#c),this.#n?.disconnect(),this.#n=void 0,this.removeEventListener(`keydown`,this.#i),this.removeEventListener(`focusin`,this.#a),this.removeEventListener(`focusout`,this.#o),super.disconnectedCallback()}updateMinWidth(){let e=this.shadowRoot.querySelector(`.wrapper`);if(e){let t=this.shadowRoot?.querySelector(`label`)?.scrollWidth||0,n=this.minWidth>t?this.minWidth:t;e.style.minWidth=n>0?n+`px`:``}}updateInputValidity(){if(this.pattern&&this.inputElement.willValidate&&(this.#r.pattern=this.pattern,this.#r.value=this.inputElement.value,this.#r.validity.patternMismatch)){this.updateValidity({patternMismatch:!0},this.#r.validationMessage,this.inputElement);return}this.updateValidity(this.inputElement.validity,this.inputElement.validationMessage,this.inputElement)}updated(e){e.has(`label`)&&(this.classList.toggle(`has-label`,this.label!==void 0&&this.label!==``),this.autoGrowLabelWidth&&this.updateMinWidth()),e.has(`disabled`)&&(this.inputElement.disabled=this.disabled,this.disabled&&this.matches(`:focus-within`)&&this.blur()),e.has(`readonly`)&&(this.inputElement.readOnly=this.readonly),e.has(`required`)&&(this.inputElement.required=this.required),e.has(`min`)&&(this.inputElement.min=this.min||``),e.has(`max`)&&(this.inputElement.max=this.max||``),e.has(`step`)&&(this.inputElement.step=this.step||``),e.has(`placeholder`)&&(this.inputElement.placeholder=this.placeholder||``),e.has(`pattern`)&&(this.pattern===void 0?this.inputElement.removeAttribute(`pattern`):this.inputElement.pattern=this.pattern),e.has(`minLength`)&&(this.inputElement.minLength=this.minLength===void 0?-1:this.minLength),e.has(`maxLength`)&&(this.inputElement.maxLength=this.maxLength===void 0?-1:this.maxLength);let t=e.has(`value`)&&this.#t&&this.required&&this.value===``;e.has(`value`)&&(this.type!==`file`&&this.inputElement.value!==this.value&&(this.inputElement.value=this.value),this.classList.toggle(`has-value`,this.value!==``),this.setFormValue(this.value),t&&(this.updateInputValidity(),this.classList.remove(`invalid`)),this.#t=!1,this.value!==this.#e&&(this.#e=this.value)),[`type`,`value`,`required`,`disabled`,`readonly`,`pattern`,`minLength`,`maxLength`,`min`,`max`,`step`].some(t=>e.has(t))&&!t&&this.updateInputValidity()}clear(){this.readonly||(this.inputElement.value=``,this.value=``,this.setFormValue(this.value),this.updateInputValidity(),this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,composed:!0})),this.blur())}renderInput(){return Ui`<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 Ui`
|
|
284
|
+
<slot name="prefix" part="prefix"></slot>
|
|
285
|
+
<div class="wrapper">
|
|
286
|
+
<label for="input" part="label">${this.label}</label>
|
|
287
|
+
${this.renderInput()}
|
|
288
|
+
${this.clearable?Ui`
|
|
289
|
+
<rokit-button class="clear" icon ?dense="${this.dense}" @mousedown="${e=>{e.preventDefault()}}" @click="${e=>{e.stopPropagation(),this.clear()}}" title="Clear"></rokit-button>
|
|
290
|
+
`:X}
|
|
291
|
+
</div>
|
|
292
|
+
<slot name="suffix" part="suffix loader"></slot>
|
|
293
|
+
<div class="supporting-text" part="supportingText">
|
|
294
|
+
<slot name="supportingText">${this.supportingText}</slot>
|
|
295
|
+
</div>
|
|
296
|
+
`}};Q([Z()],$.prototype,`type`,void 0),Q([Z({type:Boolean,reflect:!0})],$.prototype,`readonly`,void 0),Q([Z({type:Boolean,reflect:!0})],$.prototype,`sticky`,void 0),Q([Z()],$.prototype,`pattern`,void 0),Q([Z()],$.prototype,`minLength`,void 0),Q([Z()],$.prototype,`maxLength`,void 0),Q([Z()],$.prototype,`min`,void 0),Q([Z()],$.prototype,`max`,void 0),Q([Z()],$.prototype,`step`,void 0),Q([Z()],$.prototype,`minWidth`,void 0),Q([Z({type:Boolean})],$.prototype,`autoGrowLabelWidth`,void 0),Q([Z()],$.prototype,`supportingText`,void 0),Q([ma(`#input`)],$.prototype,`inputElement`,void 0),$=Q([la(`rokit-input`)],$);var ba=class extends ga{static{this.styles=[...ga.styles,ii`
|
|
297
|
+
:host {
|
|
298
|
+
background-color: var(--rokit-light-background-color-inner);
|
|
299
|
+
user-select: none;
|
|
300
|
+
padding: 0;
|
|
301
|
+
--rokit-select-overlay-shadow-above: 0 -4px 10px var(--rokit-shadow-color-inner);
|
|
302
|
+
--rokit-select-overlay-shadow-below: 0 4px 10px var(--rokit-shadow-color-inner);
|
|
303
|
+
}
|
|
304
|
+
:host([dense]) {
|
|
305
|
+
li > div { padding: 6px 4px; }
|
|
306
|
+
li.large > div, li.header > div { padding-top: 6px; padding-bottom: 6px; }
|
|
307
|
+
}
|
|
308
|
+
#input { padding: 0; background-color: inherit; --rokit-button-icon-offset-y: 1px; }
|
|
309
|
+
rokit-collapsible, #input { display: flex; flex-grow: 1; border: 0; max-width: 100%; }
|
|
310
|
+
rokit-collapsible::part(content) { display: flex; flex-direction: column; padding-top: 0; outline: 0; background-color: var(--rokit-background-color-inner); border-color: var(--rokit-light-background-color-inner); border-width: 0 2px 0 2px; border-style: solid; }
|
|
311
|
+
rokit-collapsible::part(header) { background-color: inherit !important; }
|
|
312
|
+
:host(:not([fixedOpen])) {
|
|
313
|
+
rokit-collapsible::part(content) {
|
|
314
|
+
position: fixed;
|
|
315
|
+
z-index: 1000;
|
|
316
|
+
inset: auto;
|
|
317
|
+
top: var(--rokit-select-overlay-top, auto);
|
|
318
|
+
right: var(--rokit-select-overlay-right, auto);
|
|
319
|
+
bottom: var(--rokit-select-overlay-bottom, auto);
|
|
320
|
+
left: var(--rokit-select-overlay-left, auto);
|
|
321
|
+
width: var(--rokit-select-overlay-width, auto);
|
|
322
|
+
max-height: var(--rokit-select-overlay-max-height, none);
|
|
323
|
+
margin: 0;
|
|
324
|
+
padding: 0;
|
|
325
|
+
box-sizing: border-box;
|
|
326
|
+
visibility: var(--rokit-select-overlay-visibility, hidden);
|
|
327
|
+
}
|
|
328
|
+
rokit-collapsible[open].has-content::part(content), rokit-collapsible.has-content.transitioning::part(content) { box-shadow: var(--rokit-select-overlay-shadow, var(--rokit-select-overlay-shadow-below)); clip-path: var(--rokit-select-overlay-shadow-clip, inset(0 -14px -14px 0)); }
|
|
329
|
+
}
|
|
330
|
+
#list-container { outline: 0; }
|
|
331
|
+
#list-container-slot, ::slotted(ul) { display: none !important; }
|
|
332
|
+
ul { list-style-type: none; margin: 0; padding: 0; width: 100%; box-sizing: border-box; }
|
|
333
|
+
li > div, #noresult { display: flex; align-items:center; line-height: 1em; padding: 8px; white-space: nowrap; transition: all calc(0.5 * var(--rokit-transition-duration-inner)); }
|
|
334
|
+
li:not([disabled]):not(.divider) { cursor: pointer }
|
|
335
|
+
li:not([disabled]):not(.divider) > div:hover { background-color: var(--rokit-light-background-color-inner); }
|
|
336
|
+
li.active > div { color: var(--rokit-primary-color-inner); background-color: var(--rokit-light-background-color-inner); }
|
|
337
|
+
li.divider { border-top: 1px solid var(--rokit-light-background-darker-color-inner); height: 0; padding: 0; }
|
|
338
|
+
li.divider, li.header { pointer-events: none; }
|
|
339
|
+
li.header > div { font-size: 0.7rem; font-weight: bold; padding-top: 8px; }
|
|
340
|
+
li.large > div { padding-top: 10px; padding-bottom: 10px; }
|
|
341
|
+
.hidden { display: none !important; }
|
|
342
|
+
:host([collapse]) li > div { padding-left: 0; }
|
|
343
|
+
:host([collapse]) .toggle-node { position: absolute }
|
|
344
|
+
:host([collapse]) li > div > div { padding-left: 1.8em; }
|
|
345
|
+
:host([collapse]) ul:not(.open) { display: none; }
|
|
346
|
+
:host([collapse]) li:not(.open) > div > .toggle-node::part(caret-icon) { transform: translate(0, 0) rotate(-45deg); }
|
|
347
|
+
`]}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f(e){return this.clearable&&e.composedPath().some(e=>e instanceof va&&e.classList.contains(`clear`))}#p;#m;#h;#g;#_;#v;constructor(){super(),this.emptyMessage=`Nothing to select`,this.collapsibleOrientationLeft=`0`,this.collapsibleOrientationRight=`0`,this.collapsibleWidth=``,this.autoGrowLabelWidth=!1,this.fixedOpen=!1,this.collapse=!1,this.filterableThreshold=15,this.itemCount=0,this.selectedItem=null,this.#e=``,this.#t=``,this.#n=0,this.#r=!1,this.#i=!1,this.#o=()=>{let e=this.collapsible?.content;if(!e?.matches(`:popover-open`))return;let t=this.getBoundingClientRect(),n=document.documentElement.clientWidth,r=document.documentElement.clientHeight,i=this.collapsibleWidth||`${t.width}px`;this.style.setProperty(`--rokit-select-overlay-width`,i);let a=e.getBoundingClientRect().width,o=e.offsetWidth-e.clientWidth,s=Math.max(a,this.listContainer.scrollWidth+o),c=n-t.left-14,l=t.right-14,u=s>c&&l>c,d=Math.min(u?l:c,s);this.style.setProperty(`--rokit-select-overlay-width`,`${d}px`);let f=u?t.right-d:t.left;this.style.setProperty(`--rokit-select-overlay-left`,`${f}px`),this.style.setProperty(`--rokit-select-overlay-right`,`auto`);let p=Math.max(0,Math.min(d,t.left-f)),m=Math.max(p,Math.min(d,t.right-f)),h=`polygon(-14px -14px, ${p}px -14px, ${p}px 0, ${m}px 0, ${m}px -14px, calc(100% + 14px) -14px, calc(100% + 14px) calc(100% + 14px), -14px calc(100% + 14px))`,g=`polygon(-14px -14px, calc(100% + 14px) -14px, calc(100% + 14px) calc(100% + 14px), ${m}px calc(100% + 14px), ${m}px 100%, ${p}px 100%, ${p}px calc(100% + 14px), -14px calc(100% + 14px))`,_=this.collapsible.maxHeight??e.scrollHeight,v=Math.min(_,e.scrollHeight),y=Math.max(0,r-t.bottom-1-14),b=Math.max(0,t.top-1-14);y<v&&b>y?(this.style.setProperty(`--rokit-select-overlay-shadow`,`var(--rokit-select-overlay-shadow-above)`),this.style.setProperty(`--rokit-select-overlay-shadow-clip`,g),this.style.setProperty(`--rokit-select-overlay-top`,`auto`),this.style.setProperty(`--rokit-select-overlay-bottom`,`${r-t.top+1}px`),this.style.setProperty(`--rokit-select-overlay-max-height`,`${Math.min(_,b)}px`)):(this.style.setProperty(`--rokit-select-overlay-shadow`,`var(--rokit-select-overlay-shadow-below)`),this.style.setProperty(`--rokit-select-overlay-shadow-clip`,h),this.style.setProperty(`--rokit-select-overlay-top`,`${t.bottom+1}px`),this.style.setProperty(`--rokit-select-overlay-bottom`,`auto`),this.style.setProperty(`--rokit-select-overlay-max-height`,`${Math.min(_,y)}px`))},this.#s=new MutationObserver(()=>this.onSlotChange()),this.#c=()=>{this.#r||this.openList()},this.#l=e=>{let t=e.relatedTarget;t&&(this.contains(t)||this.shadowRoot?.contains(t))||(this.checkInputValue(),this.closeList(!1,!0))},this.#u=()=>{this.#r||this.openList(!1)},this.#d=()=>{queueMicrotask(()=>{let e=this.input?.inputElement,t=e&&this.input.shadowRoot?.activeElement!==e;!this.validity.valid&&this.matches(`:focus-within`)&&t&&(this.input.inputElement.focus(),this.input.reportValidity())})},this.#p=e=>{this.#f(e)&&(this.#r=!0)},this.#m=()=>{this.#r=!0},this.#h=e=>{e.stopPropagation(),this.collapsible.open?this.closeList(!1):this.openList(!1)},this.#g=e=>{if(this.#f(e)){this.input.inputElement.focus(),this.selectItem(null),this.closeList(!1),window.setTimeout(()=>{this.#r=!1});return}!this.collapsible.open&&!this.fixedOpen&&this.openList(!1)},this.#_=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),this.openList(),this.highlightNextItem();break;case`ArrowUp`:e.preventDefault(),this.openList(),this.highlightPreviousItem(!0);break;case`Enter`:{let t=this.activeItem();if(t){e.preventDefault(),this.selectItem(t,!0,!0);break}let n=this.findItem(this.input.value);n?(e.preventDefault(),this.selectItem(n,!0,!0)):this.checkInputValue();break}case`Escape`:this.collapsible.open&&(e.preventDefault(),this.restoreSelection(),this.closeList(!1));break;case`Tab`:this.checkInputValue(),this.closeList(!1);break}},this.#v=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),this.highlightNextItem();break;case`ArrowUp`:e.preventDefault(),this.highlightPreviousItem();break;case`Home`:e.preventDefault(),this.highlightFirstItem();break;case`End`:e.preventDefault(),this.highlightLastItem();break;case`Enter`:{e.preventDefault();let t=this.activeItem();t&&this.selectItem(t,!0,!0);break}case`ArrowRight`:if(this.collapse){let t=this.activeItem();t&&(e.preventDefault(),this.toggleNestedList(t,!0))}break;case`ArrowLeft`:if(this.collapse){let t=this.activeItem();t&&(e.preventDefault(),this.toggleNestedList(t,!1))}break;case`Escape`:e.preventDefault(),this.restoreSelection(),this.closeList(!1),this.input.inputElement.focus();break;case`Tab`:this.checkInputValue(),this.closeList(!1);break}},this.addEventListener(`focusin`,this.#c),this.addEventListener(`focusout`,this.#l),this.addEventListener(`input`,this.#u),this.addEventListener(`invalid`,this.#d)}disconnectedCallback(){this.#x(),this.#s.disconnect(),this.input?.removeEventListener(`mousedown`,this.#p,!0),this.input?.removeEventListener(`click`,this.#g,!0),this.collapsible?.toggleButton?.removeEventListener(`mousedown`,this.#m,!0),this.collapsible?.toggleButton?.removeEventListener(`click`,this.#h,!0),this.collapsible?.content?.removeEventListener(`keydown`,this.#v),this.removeEventListener(`focusin`,this.#c),this.removeEventListener(`focusout`,this.#l),this.removeEventListener(`input`,this.#u),this.removeEventListener(`invalid`,this.#d),super.disconnectedCallback()}#y(){let e=this.collapsible?.content;e&&(this.fixedOpen?(this.#x(),e.removeAttribute(`popover`),this.listContainer.hidden=!1):(e.setAttribute(`popover`,`manual`),e.matches(`:popover-open`)||(this.listContainer.hidden=!0)))}#b(){let e=this.collapsible.content;this.fixedOpen||!this.isConnected||!e.hasAttribute(`popover`)||(this.#a!==void 0&&(window.clearTimeout(this.#a),this.#a=void 0),this.listContainer.hidden=!1,this.style.setProperty(`--rokit-select-overlay-visibility`,`visible`),e.matches(`:popover-open`)||e.showPopover(),this.#o(),this.#i||=(window.addEventListener(`resize`,this.#o),window.addEventListener(`scroll`,this.#o,!0),!0))}#x(){this.#a!==void 0&&(window.clearTimeout(this.#a),this.#a=void 0);let e=this.collapsible?.content;this.listContainer&&(this.listContainer.hidden=!0),this.style.setProperty(`--rokit-select-overlay-visibility`,`hidden`),e?.matches(`:popover-open`)&&e.hidePopover();for(let e of[`--rokit-select-overlay-top`,`--rokit-select-overlay-right`,`--rokit-select-overlay-bottom`,`--rokit-select-overlay-left`,`--rokit-select-overlay-width`,`--rokit-select-overlay-max-height`,`--rokit-select-overlay-shadow`,`--rokit-select-overlay-shadow-clip`])this.style.removeProperty(e);this.#i&&=(window.removeEventListener(`resize`,this.#o),window.removeEventListener(`scroll`,this.#o,!0),!1)}firstUpdated(){this.#e=this.value,this.#t=getComputedStyle(this).getPropertyValue(`--rokit-list-indent-inner`),this.input.addEventListener(`mousedown`,this.#p,!0),this.input.addEventListener(`click`,this.#g,!0),this.collapsible.updateComplete.then(()=>{this.collapsible.toggleButton.addEventListener(`mousedown`,this.#m,!0),this.collapsible.toggleButton.addEventListener(`click`,this.#h,!0),this.collapsible.content.addEventListener(`keydown`,this.#v),this.#y()}),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?getComputedStyle(this).getPropertyValue(`--rokit-list-max-height-inner`):this.collapsibleMaxHeight),this.collapsible.content.style.width=this.collapsibleWidth,this.collapsible.content.style.left=this.collapsibleOrientationLeft,this.collapsible.content.style.right=this.collapsibleOrientationRight}),this.syncInputAccessibilityState()}updated(e){e.has(`value`)&&this.value!==(this.selectedItem?this.itemValue(this.selectedItem):``)&&(this.selectedItem=this.findItem(this.value),this.syncSelectionState(String(e.get(`value`)??``),!1),this.filter(``)),e.has(`disabled`)&&(this.input.disabled=this.disabled,this.collapsible.disabled=this.disabled||this.fixedOpen),(e.has(`required`)||e.has(`disabled`))&&this.syncSelectionState(this.value,!1),e.has(`supportingText`)&&(this.input.supportingText=this.supportingText),e.has(`filterableThreshold`)&&this.applyFilterability(),this.collapsible?.toggleButton&&(this.collapsible.toggleButton.style.display=this.listContainer.childElementCount===0?`none`:``),e.has(`fixedOpen`)&&(this.collapsible.open=this.fixedOpen,this.collapsible.disabled=this.fixedOpen,this.#y()),e.has(`label`)&&(this.input.label=this.label),e.has(`placeholder`)&&(this.input.placeholder=this.placeholder===void 0?`Type to filter list...`:this.placeholder),this.syncInputAccessibilityState()}checkInputValue(e=!0){let t=this.input.value.trim();if(t){if(this.selectedItem&&(this.itemText(this.selectedItem)===t||this.itemValue(this.selectedItem)===t))return;let e=this.findItem(t);if(e){this.selectItem(e);return}}e&&(t===``?(this.#e=``,this.selectItem(null,!1)):this.restoreSelection())}filter(e){e=e.toLowerCase();let t=!1;for(let n of this.listContainer.querySelectorAll(`li`))if(n.id!==`noresult`){let r=e!==``&&this.itemText(n).toLowerCase().indexOf(e)===-1&&(!n.dataset.value||n.dataset.value.toLowerCase().indexOf(e)===-1);n.classList.toggle(`hidden`,r),this.collapse&&(n.classList.remove(`open`),n.querySelector(`ul`)?.classList.remove(`open`)),r||(t=!0)}for(let n of this.visibleItems())for(let r=n.parentElement?.closest(`li`);r;r=r.parentElement?.closest(`li`))r.classList.remove(`hidden`),t=!0,e&&this.collapse&&(r.classList.add(`open`),r.querySelector(`:scope > ul`)?.classList.add(`open`));this.listContainer.querySelector(`#noresult`)?.classList.toggle(`hidden`,t),this.highlightItem(e?this.visibleItems()[0]??null:this.selectedItem??null,!1)}selectItem(e,t=!0,n=!1){this.isSelectableItem(e)||(e=null);let r=this.value;this.selectedItem=e,this.value=e?this.itemValue(e):``,this.syncSelectionState(r),this.filter(``),this.highlightItem(e,!1),t&&(this.#e=this.value),n&&(this.#r=!0,this.closeList(!1),window.setTimeout(()=>{this.fixedOpen||(this.collapsible?.toggle(!1),this.syncInputAccessibilityState()),this.#r=!1}))}findItem(e){let t=null;if(e){for(let n of this.listContainer.querySelectorAll(`li`))if(this.isSelectableItem(n)){if(n.dataset.value===e)return n;this.itemText(n)===e&&(t=n)}}return t}highlightItem(e,t=!0){if(this.listContainer.querySelector(`li.active`)?.classList.remove(`active`),e&&this.isSelectableItem(e)&&!e.classList.contains(`hidden`)){if(t&&this.listContainer.focus(),e.classList.add(`active`),this.listContainer.setAttribute(`aria-activedescendant`,e.id),this.collapse)for(let t=e.closest(`ul`);t;t=t.parentElement.closest(`ul`))t.classList.add(`open`),t.closest(`li`)?.classList.add(`open`);this.collapsible.open&&e.scrollIntoView({block:`nearest`});return}this.listContainer.removeAttribute(`aria-activedescendant`)}highlightNextItem(){let e=this.visibleItems(),t=this.activeItem();if(!e.length){this.highlightItem(null);return}if(!t){this.highlightItem(e[0]);return}let n=e.indexOf(t);this.highlightItem(e[Math.min(e.length-1,n+1)]||e[0])}highlightPreviousItem(e=!1){let t=this.visibleItems(),n=this.activeItem();if(!t.length){this.highlightItem(null);return}if(!n){this.highlightItem(e?t[t.length-1]:t[0]);return}let r=t.indexOf(n);this.highlightItem(t[Math.max(0,r-1)]||t[0])}highlightFirstItem(){this.highlightItem(this.visibleItems()[0]||null)}highlightLastItem(){let e=this.visibleItems();this.highlightItem(e[e.length-1]??null)}itemValue(e){return e.dataset.value||this.itemText(e)||``}itemText(e){return e.querySelector(`div > div`)?.innerText||``}elementText(e){let t=``;for(let n of e.childNodes)n.nodeType==3&&(t+=n.nodeValue?.trim());return t}onSlotChange(){this.listContainer.replaceChildren(),this.itemCount=0,this.#n=0;let e=null,t=this.shadowRoot.querySelector(`#list-container-slot`).assignedElements();if(t?.length===1&&(e=Array.prototype.slice.call(t[0].querySelectorAll(`:scope > li`)),this.copyItems(e,this.listContainer),this.#s.disconnect(),this.#s.observe(t[0],{subtree:!0,childList:!0,characterData:!0,attributes:!0})),this.emptyMessage){let t=document.createElement(`li`);t.id=`noresult`,t.setAttribute(`disabled`,``),t.innerText=this.emptyMessage,this.listContainer.appendChild(t),e&&e.length>0&&t.classList.add(`hidden`)}this.value=this.value||this.#e,this.selectItem(this.findItem(this.value)),this.applyFilterability()}copyItems(e,t,n=0){if(this.sort!==void 0){let t=this.sort||`asc`;e=e.sort((e,n)=>t===`desc`?(this.elementText(n)||this.itemValue(n)).localeCompare(this.elementText(e)||this.itemValue(e)):(this.elementText(e)||this.itemValue(e)).localeCompare(this.elementText(n)||this.itemValue(n)))}let r=``;n>0&&(r=`calc(0.3em + ${n}*${this.#t})`);for(let i of e){let e=i.cloneNode();e.replaceChildren(),e.id=i.id||`${this.id||`rokit-select`}-option-${this.#n++}`;let a=document.createElement(`div`);r&&(a.style.paddingLeft=r);let o=document.createElement(`div`);a.appendChild(o);for(let e of i.childNodes)if(e.nodeName!==`UL`){let t=e.cloneNode(!0);t.nodeType===3&&t.nodeValue&&(t.nodeValue=t.nodeValue.trim()),o.appendChild(t)}e.appendChild(a),e.title=e.title||this.itemText(e),e.setAttribute(`role`,i.classList.contains(`divider`)||i.classList.contains(`header`)?`presentation`:`option`),e.setAttribute(`aria-disabled`,String(i.getAttribute(`disabled`)!==null));let s=i.querySelector(`ul`);if(s?.childElementCount){let t=document.createElement(`ul`);if(t.setAttribute(`role`,`group`),e.appendChild(t),this.copyItems(Array.prototype.slice.call(s.children),t,n+1),this.collapse){let t=new va;t.dense=!0,t.icon=!0,t.classList.add(`toggle-node`,`caret`),t.title=`Toggle nested options`,t.addEventListener(`mousedown`,e=>{e.preventDefault(),e.stopPropagation()}),t.addEventListener(`click`,t=>{t.stopPropagation(),this.toggleNestedList(e)}),a.prepend(t)}else t.classList.add(`open`)}t.appendChild(e),this.itemCount++}}activeItem(){return this.listContainer.querySelector(`li.active`)}visibleItems(){return Array.from(this.listContainer.querySelectorAll(`ul.open > li:not(.hidden)`)).filter(e=>this.isSelectableItem(e))}isSelectableItem(e){return!!e&&e.id!==`noresult`&&e.getAttribute(`disabled`)===null&&!e.classList.contains(`divider`)&&!e.classList.contains(`header`)}restoreSelection(){let e=this.selectedItem||this.findItem(this.#e);this.selectItem(e,!1)}openList(e=!this.input?.value){this.disabled||this.fixedOpen||(this.collapsible?.toggle(!0),this.collapsible.updateComplete.then(()=>{this.collapsible.open&&this.#b()}),e&&this.highlightItem(this.selectedItem??null,!1),this.syncInputAccessibilityState())}closeList(e=!0,t=!1){this.fixedOpen||(e&&this.checkInputValue(),this.filter(``),t&&this.collapsible.content.matches(`:popover-open`)?(this.collapsible.toggle(!1),this.#a=window.setTimeout(()=>{this.#a=void 0,this.#x()},this.collapsible.transitionDuration)):(this.#x(),this.collapsible?.toggle(!1)),this.syncInputAccessibilityState())}inputShouldBeReadonly(){return this.filterableThreshold<0||this.itemCount<this.filterableThreshold}applyFilterability(){let e=this.inputShouldBeReadonly();this.input.readonly=e,this.collapsible.headerInactive=!e}toggleNestedList(e,t=!e.classList.contains(`open`)){e.classList.toggle(`open`,t),e.querySelector(`:scope > ul`)?.classList.toggle(`open`,t),this.collapsible.updateContentHeight(),this.highlightItem(e,!1)}syncInputAccessibilityState(){this.input?.inputElement&&(this.input.inputElement.setAttribute(`role`,`combobox`),this.input.inputElement.setAttribute(`aria-expanded`,String(this.fixedOpen||this.collapsible?.open)),this.input.inputElement.setAttribute(`aria-controls`,`list-container`),this.input.inputElement.setAttribute(`aria-autocomplete`,this.input.readonly?`none`:`list`),this.listContainer?.setAttribute(`role`,`listbox`))}syncSelectionAccessibilityState(){for(let e of this.listContainer.querySelectorAll(`li[role="option"]`))e.setAttribute(`aria-selected`,String(e===this.selectedItem))}syncSelectionState(e,t=e!==this.value){this.input.value=this.selectedItem?this.itemText(this.selectedItem):this.value,this.title||(this.input.title=this.input.value),this.classList.toggle(`has-value`,this.value!==``),this.setFormValue(this.value);let n=!this.disabled&&this.required&&this.value===``,r=n?`Please select a value`:void 0;this.input.setCustomValidity(r),this.input.updateComplete.then(()=>{let e=!this.disabled&&this.required&&this.value===``;this.input.inputElement.setAttribute(`aria-invalid`,String(e)),this.input.setCustomValidity(e?`Please select a value`:void 0,this.input.inputElement)}),n?this.updateValidity({valueMissing:!0},r,this.listContainer):this.updateValidity(),t&&this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0})),this.syncSelectionAccessibilityState()}render(){return Ui`
|
|
348
|
+
<rokit-collapsible ?dense="${this.dense}" part="collapsible" ?headerInactive="${!this.inputShouldBeReadonly()}">
|
|
349
|
+
<slot name="prefix" part="prefix" slot="prefix"></slot>
|
|
350
|
+
<slot name="suffix" part="suffix loader" slot="suffix"></slot>
|
|
351
|
+
<rokit-input id="input" slot="label" exportparts="supportingText"
|
|
352
|
+
?clearable="${this.clearable}"
|
|
353
|
+
?dense="${this.dense}"
|
|
354
|
+
@change="${()=>{this.checkInputValue(this.input.inputElement.value===``||!this.collapsible.open)}}"
|
|
355
|
+
@input="${()=>{this.filter(this.input.inputElement.value)}}"
|
|
356
|
+
?autoGrowLabelWidth="${this.autoGrowLabelWidth}"
|
|
357
|
+
@keydown="${this.#_}"
|
|
358
|
+
></rokit-input>
|
|
359
|
+
<ul id="list-container" tabindex="-1" part="list" class="open"
|
|
360
|
+
@mousedown="${e=>{e.preventDefault()}}"
|
|
361
|
+
@click="${e=>{let t=e.target.closest(`li`);this.isSelectableItem(t)&&this.selectItem(t,!0,!0)}}">
|
|
362
|
+
</ul>
|
|
363
|
+
<slot id="list-container-slot" @slotchange=${this.onSlotChange}></slot>
|
|
364
|
+
</rokit-collapsible>
|
|
365
|
+
`}};Q([Z()],ba.prototype,`emptyMessage`,void 0),Q([Z()],ba.prototype,`sort`,void 0),Q([Z()],ba.prototype,`collapsibleMaxHeight`,void 0),Q([Z()],ba.prototype,`collapsibleOrientationLeft`,void 0),Q([Z()],ba.prototype,`collapsibleOrientationRight`,void 0),Q([Z()],ba.prototype,`collapsibleWidth`,void 0),Q([Z({type:Boolean})],ba.prototype,`autoGrowLabelWidth`,void 0),Q([Z({type:Boolean,reflect:!0})],ba.prototype,`fixedOpen`,void 0),Q([Z()],ba.prototype,`inputMinWidth`,void 0),Q([Z({type:Boolean,reflect:!0})],ba.prototype,`collapse`,void 0),Q([Z()],ba.prototype,`filterableThreshold`,void 0),Q([Z()],ba.prototype,`supportingText`,void 0),Q([ma(`rokit-collapsible`)],ba.prototype,`collapsible`,void 0),Q([ma(`#input`)],ba.prototype,`input`,void 0),Q([ma(`#list-container`)],ba.prototype,`listContainer`,void 0),ba=Q([la(`rokit-select`)],ba);var xa=class extends ${constructor(...e){super(...e),this.resize=`none`,this.rows=3,this.#t=()=>this.autoResize()}static{this.styles=[...$.styles,ii`
|
|
366
|
+
:host, .wrapper { align-items: flex-start; }
|
|
367
|
+
#input { height: initial; }
|
|
368
|
+
#content { display: none; }
|
|
369
|
+
`]}#e;#t;firstUpdated(){super.firstUpdated(),this.applyDimensions(),this.applyResizeBehavior()}updated(e){super.updated(e),(e.has(`rows`)||e.has(`cols`))&&this.applyDimensions(),e.has(`resize`)&&this.applyResizeBehavior(),this.resize===`auto`&&e.has(`value`)&&this.autoResize()}disconnectedCallback(){this.textareaElement?.removeEventListener(`input`,this.#t),this.#e?.disconnect(),this.#e=void 0,super.disconnectedCallback()}applyDimensions(){this.textareaElement.rows=this.rows,this.textareaElement.cols=this.cols===void 0?20:this.cols}applyResizeBehavior(){if(this.textareaElement.removeEventListener(`input`,this.#t),this.#e?.disconnect(),this.#e=void 0,this.resize===`auto`){this.textareaElement.style.resize=`none`,this.textareaElement.addEventListener(`input`,this.#t),this.#e=new IntersectionObserver(e=>{e.length&&e[0].isIntersecting&&this.autoResize()}),this.#e.observe(this),this.autoResize();return}this.textareaElement.style.resize=this.resize,this.textareaElement.style.height=``}autoResize(){this.textareaElement.style.height=``,this.textareaElement.style.height=this.textareaElement.scrollHeight+`px`}onSlotChange(){let e=this.shadowRoot.querySelector(`#content`).assignedNodes().map(e=>e.textContent).join(``);e.trim()!==``&&(this.value=e)}renderInput(){return Ui`
|
|
370
|
+
<textarea id="input" part="input" autocomplete="off" name="${this.name}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.value}"></textarea>
|
|
371
|
+
<slot id="content" @slotchange=${this.onSlotChange}></slot>
|
|
372
|
+
`}};Q([Z()],xa.prototype,`resize`,void 0),Q([Z({type:Number})],xa.prototype,`rows`,void 0),Q([Z({type:Number})],xa.prototype,`cols`,void 0),Q([ma(`#input`)],xa.prototype,`textareaElement`,void 0),xa=Q([la(`rokit-textarea`)],xa);var Sa=18,Ca=class extends ${constructor(...e){super(...e),this.labelFormatter=e=>String(Math.round(e*1e3)/1e3),this.#e=[0,1],this.#t=[this.#e[0],this.#e[1]],this.#r=`start`,this.#i=null,this.#a=``,this.onPointerDown=e=>{if(this.disabled||!e.isPrimary&&e.pointerType!==`touch`||e.pointerType!==`touch`&&e.button!==0)return;e.preventDefault(),this.#a=this.value,this.sliderElement.focus(),this.sliderElement.setPointerCapture(e.pointerId),this.#i=e.pointerId;let t=e.target instanceof Ta,n=t?e.target:this.chooseKnob(e.clientX-this.track.getBoundingClientRect().left);this.#o=n,this.setActiveKnob(n),n.classList.add(`focus`),t||this.updateFromClientX(e.clientX)},this.onPointerMove=e=>{this.#i===e.pointerId&&this.updateFromClientX(e.clientX)},this.onPointerEnd=e=>{if(this.#i!==e.pointerId)return;let t=this.#o;this.#i=null,this.#o=void 0,this.sliderElement.hasPointerCapture(e.pointerId)&&this.sliderElement.releasePointerCapture(e.pointerId),t?.classList.remove(`focus`),this.value!==this.#a&&this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0}))},this.onSliderKeyDown=e=>{if(this.disabled)return;let t=this.currentKnob(),n=this.currentStep(),r;switch(e.key){case`ArrowLeft`:case`ArrowDown`:e.preventDefault(),r=t.value-n;break;case`ArrowRight`:case`ArrowUp`:e.preventDefault(),r=t.value+n;break;case`Home`:e.preventDefault(),r=this.#e[0];break;case`End`:e.preventDefault(),r=this.#e[1];break}r!==void 0&&this.updateKnobValue(t,r,!0)}}static{this.styles=[...$.styles,ii`
|
|
373
|
+
:host(.has-label:not(:focus):not(.has-value):not([sticky])) #slider > * { visibility: hidden; }
|
|
374
|
+
:host(.has-label) .wrapper { padding-top: 1em; }
|
|
375
|
+
:host([sticky]) #slider { margin-top: ${26.5}px; }
|
|
376
|
+
#input { display: none; }
|
|
377
|
+
#slider { display: flex; position: relative; align-items: center; width: 100%; height: ${Sa}px; padding: 0 ${Sa/2}px; outline: 0; }
|
|
378
|
+
:host(:not([sticky])) #slider:not(:focus):not(:hover) rokit-slider-knob::part(label) { color: transparent; background-color: transparent; border-color: transparent; top: 0; }
|
|
379
|
+
#track { height: 2px; flex-grow: 1; background-color: #CCC; }
|
|
380
|
+
#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; }
|
|
381
|
+
`]}#e;#t;#n;#r;#i;#a;#o;#s;firstUpdated(){super.firstUpdated(),this.#s=new ResizeObserver(()=>{this.updateKnobPositions()}),this.#s.observe(this.sliderElement)}disconnectedCallback(){this.#s?.disconnect(),this.#s=void 0,this.#i=null,this.#o=void 0,super.disconnectedCallback()}updated(e){if(super.updated(e),e.has(`min`)&&(this.#e[0]=parseFloat(this.min||`0`),this.#e[1]=Math.max(this.#e[0],this.#e[1])),e.has(`max`)&&(this.#e[1]=parseFloat(this.max||`1`),this.#e[0]=Math.min(this.#e[0],this.#e[1])),e.has(`step`)){let e=this.step?parseFloat(this.step):void 0;this.#n=e&&Number.isFinite(e)&&e>0?e:void 0}(e.has(`value`)||e.has(`min`)||e.has(`max`)||e.has(`step`)||e.has(`range`))&&this.syncValuesFromProperty(),this.updateKnobPositions(),this.syncAccessibilityState()}updateValidity(e,t){super.updateValidity(e,t,this.sliderElement)}syncValuesFromProperty(){if(this.value!==void 0&&this.value!==``)if(this.range!==void 0)try{let e=JSON.parse(this.value);if(Array.isArray(e)&&e.length===2&&Number.isFinite(e[0])&&Number.isFinite(e[1])){let t=this.applyBaseConstraints(Number(e[0])),n=this.applyBaseConstraints(Number(e[1])),r=Math.min(t,n),i=Math.max(t,n);this.#t=[r,i]}else this.#t=[this.#e[0],this.#e[1]]}catch{this.#t=[this.#e[0],this.#e[1]]}else{let e=parseFloat(this.value);this.#t=[this.applyBaseConstraints(Number.isFinite(e)?e:this.#e[0])]}else this.#t=this.range===void 0?[this.#e[0]]:[this.#e[0],this.#e[1]]}chooseKnob(e){if(!this.endKnob)return this.startKnob;let t=Math.abs(e-this.startKnob.offsetLeft)<Math.abs(e-this.endKnob.offsetLeft)?this.startKnob:this.endKnob;return this.startKnob.value===this.endKnob.value&&(t.id===`start`&&t.value===this.#e[0]?t=this.endKnob:t.id===`end`&&t.value===this.#e[1]&&(t=this.startKnob)),t}toScreenSpace(e){let t=this.track.offsetWidth,n=this.#e[1]-this.#e[0];return t<=0||n<=0?0:(e-this.#e[0])/n*t}toValueSpace(e){let t=this.track.offsetWidth,n=this.#e[1]-this.#e[0];return t<=0||n<=0?this.#e[0]:e/t*n+this.#e[0]}applyBaseConstraints(e){let t=Math.min(Math.max(e,this.#e[0]),this.#e[1]);return this.#n&&(t=this.#e[0]+Math.round((t-this.#e[0])/this.#n)*this.#n),t}applyConstraints(e,t,n){let r=this.applyBaseConstraints(e);if(this.endKnob){let e=n??(t===`start`?this.#t[1]:this.#t[0]);r=t===`start`?Math.min(r,e):Math.max(r,e)}return r}currentStep(){if(this.#n)return this.#n;let e=this.#e[1]-this.#e[0];return e>0?Math.max(e/100,1):1}updateKnob(e,t){e.id===`start`?this.#t[0]=t:this.#t[1]=t,e.value=t,e.offset=this.toScreenSpace(t),e.label=this.labelFormatter(t),this.endKnob&&(e.id===`start`?this.track.style.borderLeftWidth=e.offset+`px`:this.track.style.borderRightWidth=this.track.offsetWidth-e.offset+`px`)}updateKnobPositions(){this.updateKnob(this.startKnob,this.#t[0]),this.endKnob&&this.updateKnob(this.endKnob,this.#t[1])}setActiveKnob(e){this.#r=e.id===`end`?`end`:`start`}currentKnob(){return this.#r===`end`&&this.endKnob?this.endKnob:this.startKnob}syncAccessibilityState(){let e=this.range!==void 0&&!!this.endKnob;this.sliderElement.setAttribute(`role`,e?`group`:`slider`),this.sliderElement.setAttribute(`aria-label`,this.label||`Slider`),e?(this.sliderElement.removeAttribute(`aria-valuemin`),this.sliderElement.removeAttribute(`aria-valuemax`),this.sliderElement.removeAttribute(`aria-valuenow`),this.sliderElement.removeAttribute(`aria-valuetext`)):(this.sliderElement.setAttribute(`aria-valuemin`,String(this.#e[0])),this.sliderElement.setAttribute(`aria-valuemax`,String(this.#e[1])),this.sliderElement.setAttribute(`aria-valuenow`,String(this.#t[0])),this.sliderElement.setAttribute(`aria-valuetext`,this.labelFormatter(this.#t[0]))),this.startKnob.configureAccessibility(`Minimum value`,this.#e[0],this.#e[1],this.#t[0],this.labelFormatter(this.#t[0])),this.endKnob?.configureAccessibility(`Maximum value`,this.#e[0],this.#e[1],this.#t[1],this.labelFormatter(this.#t[1]))}commitInternalValue(e=!1){let t=this.range===void 0?String(this.#t[0]):JSON.stringify([this.#t[0],this.#t[1]]),n=this.value!==t;return n&&(this.value=t,this.dispatchEvent(new Event(`input`,{bubbles:!0,composed:!0}))),e&&n&&this.dispatchEvent(new Event(`change`,{bubbles:!0,composed:!0})),n}updateKnobValue(e,t,n=!1){this.setActiveKnob(e),this.updateKnob(e,this.applyConstraints(t,e.id===`end`?`end`:`start`)),this.commitInternalValue(n)}updateFromClientX(e){if(!this.#o)return;let t=e-this.track.getBoundingClientRect().left;this.updateKnobValue(this.#o,this.toValueSpace(t))}renderInput(){return Ui`
|
|
382
|
+
${super.renderInput()}
|
|
383
|
+
<div
|
|
384
|
+
id="slider"
|
|
385
|
+
part="slider"
|
|
386
|
+
tabindex="0"
|
|
387
|
+
?range="${this.range!==void 0}"
|
|
388
|
+
@pointerdown="${this.onPointerDown}"
|
|
389
|
+
@pointermove="${this.onPointerMove}"
|
|
390
|
+
@pointerup="${this.onPointerEnd}"
|
|
391
|
+
@pointercancel="${this.onPointerEnd}"
|
|
392
|
+
@keydown="${this.onSliderKeyDown}"
|
|
393
|
+
>
|
|
394
|
+
<div id="track"></div>
|
|
395
|
+
<rokit-slider-knob id="start"></rokit-slider-knob>
|
|
396
|
+
${this.range===void 0?X:Ui`
|
|
397
|
+
<rokit-slider-knob id="end"></rokit-slider-knob>
|
|
398
|
+
`}
|
|
399
|
+
</div>
|
|
400
|
+
`}};Q([Z()],Ca.prototype,`range`,void 0),Q([Z()],Ca.prototype,`labelFormatter`,void 0),Q([ma(`#slider`)],Ca.prototype,`sliderElement`,void 0),Q([ma(`#track`)],Ca.prototype,`track`,void 0),Q([ma(`#start`)],Ca.prototype,`startKnob`,void 0),Q([ma(`#end`)],Ca.prototype,`endKnob`,void 0),Ca=Q([la(`rokit-slider`)],Ca);function wa(e,t){let n=new Date(0);n.setUTCSeconds(e);let r=n.toISOString();return t&&(r=r.slice(0,10)),r}var Ta=class extends sa{constructor(...e){super(...e),this.offset=0,this.label=``,this.value=0}static{this.styles=[ii`
|
|
401
|
+
:host { position: absolute; width: ${Sa}px; height: ${Sa}px; border-radius: ${Sa}px; background-color: var(--rokit-primary-color-inner); }
|
|
402
|
+
:host(.focus), :host(:hover) { box-shadow: 0 0 0 ${Sa/2}px var(--rokit-primary-color-transparent-inner); z-index: 1; }
|
|
403
|
+
label {
|
|
404
|
+
position: absolute;
|
|
405
|
+
top: calc(-2em - ${Sa/4}px);
|
|
406
|
+
left: 50%;
|
|
407
|
+
transform: translate(-50%, 0);
|
|
408
|
+
white-space: nowrap;
|
|
409
|
+
font-size: 0.75em;
|
|
410
|
+
font-weight: 500;
|
|
411
|
+
transition-property: top color background-color;
|
|
412
|
+
transition-duration: var(--rokit-transition-duration-inner);
|
|
413
|
+
pointer-events: none;
|
|
414
|
+
color: white;
|
|
415
|
+
background-color: var(--rokit-primary-color-inner);
|
|
416
|
+
padding: 0 4px;
|
|
417
|
+
border-radius: 3px;
|
|
418
|
+
}
|
|
419
|
+
label:after {
|
|
420
|
+
content: '';
|
|
421
|
+
width: 10px;
|
|
422
|
+
height: 10px;
|
|
423
|
+
position: absolute;
|
|
424
|
+
left: 50%;
|
|
425
|
+
bottom: -4px;
|
|
426
|
+
transform: translate(-50%, 0);
|
|
427
|
+
background-color: inherit;
|
|
428
|
+
clip-path: polygon(50% 50%, 100% 50%, 50% 100%, 0 50%);
|
|
429
|
+
}
|
|
430
|
+
`]}configureAccessibility(e,t,n,r,i){this.setAttribute(`role`,`slider`),this.setAttribute(`aria-label`,e),this.setAttribute(`aria-valuemin`,String(t)),this.setAttribute(`aria-valuemax`,String(n)),this.setAttribute(`aria-valuenow`,String(r)),this.setAttribute(`aria-valuetext`,i)}updated(e){e.has(`offset`)&&(this.style.left=this.offset+`px`)}render(){return Ui`<label part="label">${this.label}</label>`}};Q([Z()],Ta.prototype,`offset`,void 0),Q([Z()],Ta.prototype,`label`,void 0),Ta=Q([la(`rokit-slider-knob`)],Ta);var Ea=class extends ha{constructor(...e){super(...e),this.open=!1,this.closable=!1,this.title=``,this.previousBodyOverflow=``,this.layoutLocked=!1,this.onDialogCancel=e=>{if(!this.closable){e.preventDefault();return}this.open=!1},this.onDialogClose=()=>{this.unlockLayout(),this.open=!1,this.dispatchEvent(new Event(`close`))}}static{this.styles=[...ha.styles,ii`
|
|
431
|
+
dialog[open] { display: flex; flex-direction: column; width: 100%; max-width: 90vw; max-height: 90vh; margin: auto; outline: 0; border: 0; border-radius: 1em; padding: 0; }
|
|
432
|
+
dialog::backdrop { background-color: #0007; }
|
|
433
|
+
header { display: flex; align-items: center; padding: 14px; }
|
|
434
|
+
.title { font-weight: 600; flex-grow: 1; text-align: center; }
|
|
435
|
+
.clear { justify-self: flex-end; }
|
|
436
|
+
main { flex-grow: 1; overflow: auto; display: flex; flex-direction: column; padding: 0 16px 14px 16px; }
|
|
437
|
+
`]}lockLayout(){this.layoutLocked||(this.layoutLocked=!0,this.previousBodyOverflow=document.body.style.overflow,document.body.classList.add(`dialog-open`),document.body.style.overflow=`hidden`)}unlockLayout(){this.layoutLocked&&(this.layoutLocked=!1,document.body.classList.remove(`dialog-open`),document.body.style.overflow=this.previousBodyOverflow,this.previousBodyOverflow=``)}firstUpdated(){this.dialogElement.addEventListener(`close`,this.onDialogClose),this.dialogElement.addEventListener(`cancel`,this.onDialogCancel)}disconnectedCallback(){this.dialogElement?.removeEventListener(`close`,this.onDialogClose),this.dialogElement?.removeEventListener(`cancel`,this.onDialogCancel),this.dialogElement?.open&&this.dialogElement.close(),this.unlockLayout(),super.disconnectedCallback()}updated(e){if(e.has(`open`)){if(this.open){if(this.lockLayout(),!this.dialogElement.open)try{this.dialogElement.showModal()}catch{this.unlockLayout(),this.open=!1}return}this.unlockLayout(),this.dialogElement.open&&this.dialogElement.close()}}render(){return Ui`
|
|
438
|
+
<dialog id="dialog" part="dialog">
|
|
439
|
+
<header>
|
|
440
|
+
<div class="title" part="title">
|
|
441
|
+
<slot name="header">${this.title}</slot>
|
|
442
|
+
</div>
|
|
443
|
+
${this.closable?Ui`
|
|
444
|
+
<rokit-button class="clear" icon ?dense="${this.dense}" @click="${()=>{this.open=!1}}" title="Close"></rokit-button>
|
|
445
|
+
`:X}
|
|
446
|
+
</header>
|
|
447
|
+
<main part="main">
|
|
448
|
+
<slot></slot>
|
|
449
|
+
</main>
|
|
450
|
+
</dialog>
|
|
451
|
+
`}};Q([Z({type:Boolean,reflect:!0})],Ea.prototype,`open`,void 0),Q([Z({type:Boolean})],Ea.prototype,`closable`,void 0),Q([Z()],Ea.prototype,`title`,void 0),Q([ma(`#dialog`)],Ea.prototype,`dialogElement`,void 0),Ea=Q([la(`rokit-dialog`)],Ea);var Da=class extends ha{static{this.styles=[...ha.styles,ii`
|
|
452
|
+
:host { display: flex; background-color: var(--rokit-primary-color-transparent-inner); color: var(--rokit-primary-color-inner); }
|
|
453
|
+
.bar { height: 3px; background-color: var(--rokit-primary-color-inner); }
|
|
454
|
+
.bar.indeterminate { width: 100%; --c: no-repeat linear-gradient(currentColor 0 0); background: var(--c), var(--c); background-size: 60% 100%; animation: indeterminate 3s infinite; }
|
|
455
|
+
@keyframes indeterminate {
|
|
456
|
+
0% { background-position:-150% 0,-150% 0 }
|
|
457
|
+
66% { background-position: 250% 0,-150% 0 }
|
|
458
|
+
100% { background-position: 250% 0, 250% 0 }
|
|
459
|
+
}
|
|
460
|
+
`]}updated(e){if(e.has(`percent`)){let e=Number(this.percent);if(Number.isFinite(e)){let t=Math.min(100,Math.max(0,e));this.bar.style.width=`${t}%`}else this.bar.style.width=``}}render(){let e=Number.isFinite(Number(this.percent));return Ui`
|
|
461
|
+
<div
|
|
462
|
+
part="bar"
|
|
463
|
+
class="bar ${e?``:`indeterminate`}"
|
|
464
|
+
role="progressbar"
|
|
465
|
+
aria-valuemin="${e?`0`:X}"
|
|
466
|
+
aria-valuemax="${e?`100`:X}"
|
|
467
|
+
aria-valuenow="${e?String(Math.min(100,Math.max(0,Number(this.percent)))):X}"
|
|
468
|
+
></div>
|
|
469
|
+
`}};Q([Z({type:Number})],Da.prototype,`percent`,void 0),Q([ma(`.bar`)],Da.prototype,`bar`,void 0),Da=Q([la(`rokit-progressbar`)],Da);var Oa=`RokitSnackbarEvent`,ka=`0.2s`,Aa=_a(ka),ja=3e3,Ma=class extends sa{static{this.styles=ii`
|
|
470
|
+
:host { display: flex; justify-content: center; width: 100%; position: fixed; bottom: 10px; pointer-events: none; }
|
|
471
|
+
:host(.left) { right: auto; left: 10px; width: auto; }
|
|
472
|
+
:host(.right) { right: 10px; left: auto; width: auto; }
|
|
473
|
+
:host(.top) { top: 10px; bottom: auto; }
|
|
474
|
+
:host(.top) .snackbar { flex-direction: column-reverse; }
|
|
475
|
+
.snackbar { display: flex; flex-direction: column; width: 300px; }
|
|
476
|
+
.message { max-height: 0; margin-bottom: 0; overflow: hidden; background-color: #333; color: #FFF; border-radius: 4px; transition: all ${ri(ka)} ease-in-out; font-weight: 500; pointer-events: auto; }
|
|
477
|
+
.message.error { background-color: #C22; }
|
|
478
|
+
.message.success { background-color: #0a8f0a; }
|
|
479
|
+
.message:not(.closable) .text { text-align: center; }
|
|
480
|
+
.inner { display: flex; padding: 10px; }
|
|
481
|
+
.text { flex-grow: 1; word-break: break-all; }
|
|
482
|
+
.text a { color: inherit; }
|
|
483
|
+
`}constructor(){super(),this.listener=e=>{e.stopImmediatePropagation(),Na(e.detail,this)},this.container=document.createElement(`div`),this.container.classList.add(`snackbar`),this.container.setAttribute(`part`,`snackbar`),this.container.setAttribute(`aria-live`,`polite`),this.container.setAttribute(`aria-atomic`,`true`)}connectedCallback(){super.connectedCallback(),this.shadowRoot.appendChild(this.container),document.addEventListener(Oa,this.listener)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(Oa,this.listener)}};Ma=Q([la(`rokit-snackbar`)],Ma);function Na(e,t){t||(t=document.querySelector(`rokit-snackbar`)||void 0,t||(t=new Ma,document.body.appendChild(t)));let n=document.createElement(`div`);n.classList.add(`message`),n.setAttribute(`role`,`status`);let r=document.createElement(`div`);r.classList.add(`inner`);let i=document.createElement(`div`);if(i.classList.add(`text`),i.innerHTML=e.message,r.appendChild(i),n.appendChild(r),e.closable===void 0?e.ttl===0:e.closable){n.classList.add(`closable`);let e=new va;e.setAttribute(`icon`,``),e.setAttribute(`dense`,``),e.classList.add(`clear`),e.title=`Dismiss`,e.addEventListener(`click`,()=>{a(n)}),r.append(e)}e.cssStyle&&(n.style.cssText=e.cssStyle),e.cssClass&&n.classList.add(e.cssClass),t.container.appendChild(n),setTimeout(()=>{n.style.maxHeight=n.scrollHeight+`px`,n.style.marginBottom=`10px`}),e.ttl!==0&&setTimeout(()=>{a(n)},e.ttl||ja);let a=e=>{e.style.maxHeight=``,e.style.marginBottom=``,setTimeout(()=>{e.remove()},Aa)}}var Pa=class extends ha{constructor(...e){super(...e),this.pos=`50%`,this.minPos=10,this.maxPos=90,this.dir=`horizontal`,this.sep=`4px`,this.dragging=!1,this.hideIndicators=!1,this.storageKey=``,this._restoredKey=``,this._positionAdjusted=!1,this._boundsAdjusted=!1,this._activePointerId=null,this.posFromPointer=e=>{let t=this.getBoundingClientRect(),n=this.dir===`horizontal`?e.clientX-t.left:e.clientY-t.top,r=this.dir===`horizontal`?t.width:t.height,i=r>0?n/r*100:50;return`${Math.min(this.maxPos,Math.max(this.minPos,i))}%`},this.startDrag=e=>{e.button==0&&(this.dragging=!0,this._activePointerId=e.pointerId,e.currentTarget.setPointerCapture(e.pointerId),this.pos=this.posFromPointer(e))},this.drag=e=>{this.dragging&&this._activePointerId==e.pointerId&&(this.pos=this.posFromPointer(e))},this.endDrag=e=>{this._activePointerId==e.pointerId&&(this.dragging=!1,this._activePointerId=null)},this.onKeyDown=e=>{let t=e.shiftKey?10:1;switch(e.key){case`ArrowLeft`:this.dir===`horizontal`&&(e.preventDefault(),this.updatePosFromNumber(this.currentPos()-t));break;case`ArrowRight`:this.dir===`horizontal`&&(e.preventDefault(),this.updatePosFromNumber(this.currentPos()+t));break;case`ArrowUp`:this.dir===`vertical`&&(e.preventDefault(),this.updatePosFromNumber(this.currentPos()-t));break;case`ArrowDown`:this.dir===`vertical`&&(e.preventDefault(),this.updatePosFromNumber(this.currentPos()+t));break;case`Home`:e.preventDefault(),this.updatePosFromNumber(this.minPos);break;case`End`:e.preventDefault(),this.updatePosFromNumber(this.maxPos);break}}}static{this.styles=[...ha.styles,ii`
|
|
484
|
+
:host { display: grid; }
|
|
485
|
+
:host([dragging]) { user-select: none; }
|
|
486
|
+
:host([dragging][dir="horizontal"]) { cursor: col-resize; }
|
|
487
|
+
:host([dragging][dir="vertical"]) { cursor: row-resize; }
|
|
488
|
+
:host([dir="horizontal"]) {
|
|
489
|
+
#separator { cursor: col-resize; }
|
|
490
|
+
}
|
|
491
|
+
:host([dir="vertical"]) {
|
|
492
|
+
#separator { cursor: row-resize; }
|
|
493
|
+
}
|
|
494
|
+
#separator {
|
|
495
|
+
position: relative;
|
|
496
|
+
z-index: 1;
|
|
497
|
+
background-color: var(--rokit-light-background-darker-color-inner);
|
|
498
|
+
}
|
|
499
|
+
.separator-indicator {
|
|
500
|
+
position: absolute;
|
|
501
|
+
top: 50%;
|
|
502
|
+
left: 50%;
|
|
503
|
+
display: flex;
|
|
504
|
+
align-items: center;
|
|
505
|
+
justify-content: center;
|
|
506
|
+
gap: 2px;
|
|
507
|
+
box-sizing: border-box;
|
|
508
|
+
border: 1px solid var(--rokit-light-background-darker-color-inner);
|
|
509
|
+
border-radius: 5px;
|
|
510
|
+
background-color: var(--rokit-light-background-color-inner);
|
|
511
|
+
box-shadow: 0 1px 3px color-mix(in srgb, var(--rokit-shadow-color-inner) 50%, transparent);
|
|
512
|
+
transform: translate(-50%, -50%);
|
|
513
|
+
transition: box-shadow var(--rokit-transition-duration-inner), background-color var(--rokit-transition-duration-inner);
|
|
514
|
+
z-index: 1;
|
|
515
|
+
}
|
|
516
|
+
.separator-arrow {
|
|
517
|
+
width: 7px;
|
|
518
|
+
height: 7px;
|
|
519
|
+
flex: none;
|
|
520
|
+
fill: var(--rokit-shadow-color-inner);
|
|
521
|
+
pointer-events: none;
|
|
522
|
+
}
|
|
523
|
+
:host([dir="horizontal"]) .separator-indicator {
|
|
524
|
+
width: 9px;
|
|
525
|
+
height: 28px;
|
|
526
|
+
flex-direction: column;
|
|
527
|
+
}
|
|
528
|
+
:host([dir="horizontal"]) .separator-arrow:last-child { transform: translateX(1px); }
|
|
529
|
+
:host([dir="vertical"]) .separator-indicator {
|
|
530
|
+
width: 28px;
|
|
531
|
+
height: 9px;
|
|
532
|
+
}
|
|
533
|
+
:host([dir="vertical"]) .separator-arrow { transform: translateY(-1px); }
|
|
534
|
+
:host([dir="vertical"]) .separator-arrow:last-child { transform: translateY(0); }
|
|
535
|
+
:host([hideindicators]) .separator-indicator { display: none; }
|
|
536
|
+
#separator:hover .separator-indicator,
|
|
537
|
+
#separator:focus-visible .separator-indicator,
|
|
538
|
+
:host([dragging]) .separator-indicator {
|
|
539
|
+
background-color: var(--rokit-light-background-darker-color-inner);
|
|
540
|
+
box-shadow: 0 2px 6px color-mix(in srgb, var(--rokit-shadow-color-inner) 65%, transparent);
|
|
541
|
+
}
|
|
542
|
+
`]}effectiveStorageKey(){return this.storageKey||`rokit-splitpane:${this.id||`default`}`}willUpdate(e){this._positionAdjusted=!1,this._boundsAdjusted=!1;let t=this.effectiveStorageKey();if(t!==this._restoredKey){try{let e=localStorage.getItem(t);e&&e!==this.pos&&(this.pos=e,this._positionAdjusted=!0)}catch{}this._restoredKey=t}let n=this.minPos,r=this.maxPos;e.has(`minPos`)&&(this.minPos=Math.max(0,Math.min(100,this.minPos))),e.has(`maxPos`)&&(this.maxPos=Math.max(0,Math.min(100,this.maxPos))),this.minPos>this.maxPos&&([this.minPos,this.maxPos]=[this.maxPos,this.minPos]),this._boundsAdjusted=n!==this.minPos||r!==this.maxPos}updated(e){if(e.has(`pos`)||e.has(`dir`)||this._positionAdjusted){this.dir===`horizontal`?(this.style.gridTemplateColumns=this.template(),this.style.gridTemplateRows=``):(this.style.gridTemplateRows=this.template(),this.style.gridTemplateColumns=``);try{localStorage.setItem(this.effectiveStorageKey(),this.pos)}catch{}}this.separator&&(e.has(`pos`)||e.has(`minPos`)||e.has(`maxPos`)||e.has(`dir`)||this._positionAdjusted||this._boundsAdjusted)&&(this.separator.setAttribute(`aria-valuemin`,String(this.minPos)),this.separator.setAttribute(`aria-valuemax`,String(this.maxPos)),this.separator.setAttribute(`aria-valuenow`,String(this.currentPos())))}template(){return`${this.pos} ${this.sep} 1fr`}currentPos(){let e=Number.parseFloat(this.pos);return Number.isFinite(e)?Math.min(this.maxPos,Math.max(this.minPos,e)):50}updatePosFromNumber(e){let t=Math.min(this.maxPos,Math.max(this.minPos,e));this.pos=`${t}%`}render(){return Ui`
|
|
543
|
+
<div><slot name="pane1"></slot></div>
|
|
544
|
+
<div
|
|
545
|
+
id="separator"
|
|
546
|
+
part="separator"
|
|
547
|
+
role="separator"
|
|
548
|
+
tabindex="0"
|
|
549
|
+
aria-orientation="${this.dir}"
|
|
550
|
+
aria-valuemin="${this.minPos}"
|
|
551
|
+
aria-valuemax="${this.maxPos}"
|
|
552
|
+
aria-valuenow="${this.currentPos()}"
|
|
553
|
+
@pointerdown="${this.startDrag}"
|
|
554
|
+
@pointermove="${this.drag}"
|
|
555
|
+
@pointerup="${this.endDrag}"
|
|
556
|
+
@pointercancel="${this.endDrag}"
|
|
557
|
+
@keydown="${this.onKeyDown}">
|
|
558
|
+
<span class="separator-indicator" aria-hidden="true">
|
|
559
|
+
<svg class="separator-arrow" viewBox="0 0 8 8">
|
|
560
|
+
<path d="${this.dir===`horizontal`?`M7 1 1 4l6 3Z`:`M1 7l3-6 3 6Z`}"></path>
|
|
561
|
+
</svg>
|
|
562
|
+
<svg class="separator-arrow" viewBox="0 0 8 8">
|
|
563
|
+
<path d="${this.dir===`horizontal`?`M1 1l6 3-6 3Z`:`M1 1l3 6 3-6Z`}"></path>
|
|
564
|
+
</svg>
|
|
565
|
+
</span>
|
|
566
|
+
</div>
|
|
567
|
+
<div><slot name="pane2"></slot></div>
|
|
568
|
+
`}};Q([Z()],Pa.prototype,`pos`,void 0),Q([Z()],Pa.prototype,`minPos`,void 0),Q([Z()],Pa.prototype,`maxPos`,void 0),Q([Z({reflect:!0})],Pa.prototype,`dir`,void 0),Q([Z()],Pa.prototype,`sep`,void 0),Q([Z({reflect:!0,type:Boolean})],Pa.prototype,`dragging`,void 0),Q([Z({reflect:!0,type:Boolean})],Pa.prototype,`hideIndicators`,void 0),Q([Z()],Pa.prototype,`storageKey`,void 0),Q([ma(`#separator`)],Pa.prototype,`separator`,void 0),Pa=Q([la(`rokit-splitpane`)],Pa);function Fa(e){let t=new Set;for(let n of e.getQuads(null,ht,null,ft))n.subject.termType===`NamedNode`&&t.add(n.subject.value);if(t.size===1)return t.values().next().value}function Ia(e,t){let n=k.namedNode(t);for(let t of e.getObjects(n,ht,ft))if(t.termType===`NamedNode`&&e.getQuads(t,pt,bt,null).length>0)return t}async function La(e,t){let n={store:new tt,importedUrls:[],atts:e},r=[];if(e.shapes?r.push(Ra(ur({rdf:e.shapes}),n,dt)):e.shapesUrl&&r.push(Ra(ur({url:e.shapesUrl,proxy:n.atts.proxy,rdfUrlResolver:n.atts.rdfUrlResolver}),n,dt)),e.values?r.push(Ra(ur({rdf:e.values}),n,ft,t)):e.valuesUrl&&r.push(Ra(ur({url:e.valuesUrl,proxy:n.atts.proxy,rdfUrlResolver:n.atts.rdfUrlResolver}),n,ft,t)),await Promise.all(r),e.classInstanceProvider)try{let t=en(n.store),r=await e.classInstanceProvider(t);r&&await Ra(ur({rdf:r}),n,dt)}catch(e){console.error(`failed loading class instances`,e)}if(e.valuesSubject||=Fa(n.store)||null,e.valuesSubject&&n.store.countQuads(null,null,null,dt)===0){let t=[...n.store.getObjects(e.valuesSubject,pt,ft),...n.store.getObjects(e.valuesSubject,ht,ft)],r=[];for(let e of t){let t=za(e.value);!t&&e.value.startsWith(`urn:`)&&n.atts.proxy&&(t=e.value),t&&n.importedUrls.indexOf(t)<0&&(n.importedUrls.push(t),r.push(Ra(ur({url:t,proxy:n.atts.proxy,rdfUrlResolver:n.atts.rdfUrlResolver}),n,dt)))}try{await Promise.allSettled(r)}catch(e){console.warn(e)}}return n.store}async function Ra(e,t,n,r){let i=await e,a=[];for(let e of i){r?.add(e);let i=n;if(t.atts.valuesSubject&&ft.equals(n)&&e.graph.id&&e.graph.id!==t.atts.valuesSubject&&(i=e.graph),t.store.add(k.quad(e.subject,e.predicate,e.object,i)),t.atts.loadOwlImports&&_t.equals(e.predicate)){let n=za(e.object.value);n&&t.importedUrls.indexOf(n)<0&&(t.importedUrls.push(n),a.push(Ra(ur({url:n,proxy:t.atts.proxy,rdfUrlResolver:t.atts.rdfUrlResolver}),t,k.namedNode(n))))}}await Promise.allSettled(a)}function za(e){if(Wt(e))return e;let t=e.split(`:`);if(t.length===2){let n=lr[t[0]];if(n&&(e=e.replace(`${t[0]}:`,n),Wt(e)))return e}return null}async function Ba(e){if(e.template.nodeShapes.size===0)return;let t=e.template.config.resourceLinkProvider;if((!t||t&&!t.lazyLoad)&&(await Ga(e.template),Ha(e).length===0))return;let n=e.template.config.theme.createButton(e.template.label,!1);n.title=`Link existing `+e.template.label,n.classList.add(`link-button`),n.setAttribute(`text`,``);let r=n.getAttribute(`part`);return n.setAttribute(`part`,`${r?r+` `:``}link-button`),n.addEventListener(`click`,async()=>{t?.lazyLoad&&(n.classList.add(`loading`),await Ga(e.template),n.classList.remove(`loading`));let r=Ha(e);if(r.length===0)n.innerText=`No linkable resources found`,n.setAttribute(`disabled`,``),setTimeout(()=>n.remove(),2e3);else{let t=e.template.config.form.querySelector(`#dialog`);t||(t=new Ea,t.classList.add(`link-chooser`),t.closable=!0,e.template.config.form.appendChild(t)),t.title=`Link existing `+e.template.label,Va(t,e,r),t.open=!0}}),n}function Va(e,t,n){let r=document.createElement(`div`);for(let i of n){let n=document.createElement(`div`);n.classList.add(`link-option`),n.title=`Link this resource`,n.innerText=i.label||i.value.value,n.addEventListener(`click`,async()=>{await Ua(i,t),e.open=!1}),r.appendChild(n)}e.replaceChildren(r)}function Ha(e){let t=e.template.config,n=Wa(e.template),r=new Set(Array.from(e.querySelectorAll(`:scope > .property-instance > shacl-node, :scope > .collapsible > .property-instance > shacl-node`)).map(e=>e.nodeId.id)),i=new Map;for(let a of t.form.querySelectorAll(`shacl-node:not([part~="linked-node"])`)){if(!n.has(a.template.id.value)||r.has(a.nodeId.id))continue;let o=new tt;a.toRDF(o),i.set(a.nodeId.id,{value:a.nodeId,label:It([...o.getQuads(a.nodeId,null,null,null),...t.store.getQuads(a.nodeId,null,null,null)],t.languages)||t.providedResourceLabels[a.nodeId.value],template:e.template})}if(t.resourceLinkProvider)for(let a of n)for(let n of t.providedConformingResourceIds[a]??[]){let a=k.namedNode(n);!r.has(a.id)&&!i.has(a.id)&&i.set(a.id,{value:a,label:t.providedResourceLabels[n]||It(t.store.getQuads(a,null,null,null),t.languages),template:e.template})}return[...i.values()]}async function Ua(e,t){let n=e.value.value;if(e.value.termType===`NamedNode`&&e.template.config.providedResources[n]?.length>0){let t={store:e.template.config.store,importedUrls:[],atts:{loadOwlImports:!1}};await Ra(ur({rdf:e.template.config.providedResources[n]}),t,dt),e.template.config.providedResources[n]=``}let r=await eo(e.template,e.value,!0,!0);t.container.insertBefore(r,t.querySelector(`:scope > .add-button-wrapper`)),await t.updateControls()}function Wa(e){return new Set(Array.from(e.nodeShapes,e=>e.id.value))}async function Ga(e){let t=e.config.resourceLinkProvider;if(!t)return;let n=Wa(e);if(n.size===0)return;let r=tn(Object.keys(e.config.providedConformingResourceIds),n);if(r.length!==0)try{let n=await t.listConformingResources(r,e);if(n){for(let t of Object.keys(n)){let r=new Set(n[t]);e.config.providedConformingResourceIds[t]=r,await Ka(r,!1,e.config)}for(let t of r)e.config.providedConformingResourceIds[t]||(e.config.providedConformingResourceIds[t]=new Set)}}catch(e){console.error(`failed loading conforming resources`,e)}}async function Ka(e,t,n){if(n.resourceLinkProvider&&e.size>0){let r=[];for(let t of e)n.providedResources[t]||r.push(t);if(r.length===0)return[];try{let e=await n.resourceLinkProvider.loadResources(r);if(e){let r={store:n.store,importedUrls:[],atts:{loadOwlImports:!1}};for(let i of e){n.providedResources[i.resourceId]=i.resourceRDF;let e=await ur({rdf:i.resourceRDF});n.providedResourceLabels[i.resourceId]=It(e.filter(e=>e.subject.value===i.resourceId),n.languages),t&&await Ra(Promise.resolve(e),r,dt)}return e}for(let e of r)n.providedResources[e]||(n.providedResources[e]=``)}catch(e){console.error(`failed loading resources`,e)}}return[]}async function qa(e){let t=new Set;for(let n of e.store.getQuads(null,null,null,ft))Ja(n.object,e.store)&&t.add(n.object.value);await Ka(t,!0,e)}function Ja(e,t){return e.termType===`NamedNode`&&t.countQuads(e,null,null,null)===0}var Ya=`:scope > .add-button-wrapper, :scope > .collapsible > .add-button-wrapper`,Xa=`:scope > .property-instance, :scope > .shacl-or-constraint, :scope > .alternative-path-constraint, :scope > shacl-node, :scope > .collapsible > .property-instance, :scope > .collapsible > .alternative-path-constraint`,Za=class extends HTMLElement{constructor(e,t){if(super(),this.template=e,this.parent=t,this.container=this,this.setAttribute(`part`,`property`),this.template.nodeShapes.size&&this.template.config.attributes.collapse!==null&&(this.template.maxCount===void 0||this.template.maxCount>1)){let t=new ya;t.classList.add(`collapsible`,`shacl-group`),t.open=e.config.attributes.collapse===`open`,t.label=this.template.label,t.setAttribute(`part`,`collapsible`),this.container=t,this.appendChild(this.container)}this.template.cssClass&&this.classList.add(this.template.cssClass),e.config.editMode&&!t.linked&&this.addEventListener(`change`,async()=>{await this.updateControls()})}async bindValues(e,t){if(this.template.path){let n=!1;if(e){let r=(this.template.pathAlternatives??[this.template.path]).flatMap(t=>this.template.config.store.getQuads(e,t,null,this.parent.linked?null:ft));t&&(r=await this.filterValidValues(r,e));for(let e of r)this.parent.linked||this.template.config.store.delete(e),await this.addPropertyInstance(e.object,!ft.equals(e.graph)||this.template.config.providedResources[e.object.value]!==void 0,this.template.config.providedResources[e.object.value]!==void 0,e.predicate.value),this.template.hasValue&&e.object.equals(this.template.hasValue)&&(n=!0)}this.template.config.editMode&&this.template.hasValue&&!n&&!this.parent.linked&&await this.addPropertyInstance(this.template.hasValue)}}async initializeQuery(){let{initializeQueryProperty:e}=await Or(async()=>{let{initializeQueryProperty:e}=await import(`./mode-Bjl1P7KJ.js`);return{initializeQueryProperty:e}},[]);await e(this)}async addPropertyInstance(e,t,n=!1,r,i=!0){let a;if(this.template.pathAlternatives&&!r)this.template.config.editMode&&(a=Ar(this,e,t,n));else{let i=r?this.template.pathAlternativeBranches?.[r]:void 0,o=r&&(r!==this.template.path||i)?vr(this.template):this.template;if(r&&(o.path=r),i&&(br(o,i,!0),o.label=i.name?.value||i.label||o.label),o.or?.length||o.xone?.length){let t=o.or?.length?o.or:o.xone,i=!1;if(e){let n=jr(t,e,o.config);n.length&&(a=await eo(yr(vr(o),n),e,!this.parent.linked,this.parent.linked,this.parent),i=!0)}!i&&o.config.editMode&&(a=kr(t,this,o.config,r,o),to(a,``,o.config.theme.dense,o.config.hierarchyColorsStyleSheet!==void 0,n))}else a=await eo(o,e,n,t||this.parent.linked,this.parent)}return a&&(a.dataset.path=this.template.path,r&&(a.dataset.predicate=r),i&&this.container.insertBefore(a,this.querySelector(Ya))),a}async updateControls(){this.template.config.editMode&&!this.parent.linked&&!this.querySelector(Ya)&&this.container.appendChild(await this.createAddControls());let e=gr(this.template),t=this.template.nodeShapes.size===0,n=this.querySelector(`:scope > .add-button-wrapper > .link-button, :scope > .collapsible > .add-button-wrapper > .link-button`)===null,r=t||!this.hasRecursiveNodeShape(),i=this.instanceCount();i===0&&r&&(t||n&&e>0)&&(await this.addPropertyInstance(),i=1),t||this.querySelector(Ya)?.classList.toggle(`required`,i<e);let a;a=e>0?i>e:!t||i>1;let o=i<_r(this.template);this.classList.toggle(`may-remove`,a),this.classList.toggle(`may-add`,o)}instanceCount(){return this.querySelectorAll(Xa).length}refreshClassInstances(){if(!(!this.template.class||this.template.hasValue||!this.template.config.editMode))for(let e of this.querySelectorAll(`:scope > .property-instance, :scope > .collapsible > .property-instance`)){let t=e.querySelector(`:scope > .editor`);if(!t||t.dataset.class!==this.template.class.value)continue;let n=Br(t),r=Ut(this.template.class,this.template);n&&!Qa(r,n)&&r.push({value:n,children:[]});let i=$a(r);if(t.dataset.classInstances===i)continue;let a=this.template.config.theme.createListEditor(this.template.label,n??null,gr(this.template)>0,r,this.template).querySelector(`.editor`);a.dataset.classInstances=i,t.replaceWith(a)}}hasRecursiveNodeShape(){let e=new Set;this.parent.ancestorShapeIds.forEach(t=>e.add(t)),e.add(this.parent.template.id.value);for(let t of this.template.nodeShapes)if(e.has(t.id.value))return!0;return!1}toRDF(e,t){for(let n of this.querySelectorAll(`:scope > .property-instance, :scope > .collapsible > .property-instance`)){let r=k.namedNode(n.dataset.predicate??this.template.path);if(n.firstChild instanceof To){let i=n.firstChild.toRDF(e);e.addQuad(t,r,i,this.template.config.valuesGraphId)}else if(this.template.config.editMode)for(let i of n.querySelectorAll(`:scope > .editor`)){let n=Br(i);n&&e.addQuad(t,r,n,this.template.config.valuesGraphId)}else{let i=Br(n);i&&e.addQuad(t,r,i,this.template.config.valuesGraphId)}}}async filterValidValues(e,t){let n=this.template.id,r=[t];if(this.template.qualifiedValueShape){n=this.template.qualifiedValueShape.id,r=[];for(let t of e)r.push(t.object)}let i=await this.template.config.validator.validate({dataset:this.template.config.store,terms:r},[{terms:[n]}]),a=new Set;for(let e of i.results){let t=this.template.qualifiedValueShape?e.focusNode:e.value;t?.ptrs?.length&&a.add(t.ptrs[0]._term.id)}return e.filter(e=>!a.has(e.object.id))}async createAddControls(){let e=document.createElement(`div`);e.classList.add(`add-button-wrapper`),e.setAttribute(`part`,`add-controls`);let t=await Ba(this);t&&e.appendChild(t);let n=this.template.config.theme.createButton(this.template.label,!1);n.title=`Add `+this.template.label,n.classList.add(`add-button`),n.setAttribute(`text`,``);let r=n.getAttribute(`part`);return n.setAttribute(`part`,`${r?r+` `:``}add-button`),n.addEventListener(`click`,async()=>{let e=await this.addPropertyInstance();e&&(e.classList.add(`fadeIn`),await this.updateControls(),this.template.nodeShapes.size&&this.dispatchEvent(new Event(`change`,{bubbles:!0,cancelable:!0})),setTimeout(()=>{Ft(e),e.classList.remove(`fadeIn`)},200))}),e.appendChild(n),e}};function Qa(e,t){return e.some(e=>typeof e.value!=`string`&&e.value.equals(t)||Qa(e.children??[],t))}function $a(e){return JSON.stringify(e.map(e=>[typeof e.value==`string`?e.value:`${e.value.termType}:${e.value.value}`,e.label,$a(e.children??[])]))}async function eo(e,t,n=!1,r=!1,i){let a;if(e.nodeShapes.size){a=document.createElement(`div`),a.classList.add(`property-instance`),a.setAttribute(`part`,`property-instance`);let n=new Set(i?.ancestorShapeIds??[]);i&&n.add(i.template.id.value);for(let i of e.nodeShapes){let o=new To(i,t,e.nodeKind,e.label,r,n);a.appendChild(o),await o.ready}}else{let n=Xr(e.path,e.datatype?.value);a=n?e.config.editMode&&!r?n.createEditor(e,t):n.createViewer(e,t):Fr(e,t||null,e.config.editMode&&!r),a.childNodes.length>0&&(a.classList.add(`property-instance`),a.setAttribute(`part`,`property-instance`)),r&&a.classList.add(`linked`)}return e.config.editMode&&(!r||n)?to(a,e.label,e.config.theme.dense,e.config.hierarchyColorsStyleSheet!==void 0,n):e.config.hierarchyColorsStyleSheet!==void 0&&a.appendChild(no(!0)),t&&!e.config.editMode&&Ir(a,t),a.dataset.path=e.path,a}function to(e,t,n,r,i=!1){let a=no(r),o=new va;o.classList.add(`remove-button`,`clear`),o.title=`Remove `+t,o.dense=n,o.icon=!0;let s=o.getAttribute(`part`);o.setAttribute(`part`,`${s?s+` `:``}remove-button`),o.addEventListener(`click`,()=>{e.classList.remove(`fadeIn`),e.classList.add(`fadeOut`),setTimeout(()=>{let t=e.parentElement;e.remove(),t?.dispatchEvent(new Event(`change`,{bubbles:!0,cancelable:!0}))},200)}),i&&o.classList.add(`persistent`),a.appendChild(o),e.appendChild(a)}function no(e){let t=document.createElement(`div`);return t.className=`remove-button-wrapper`,t.setAttribute(`part`,`remove-controls`),e&&t.classList.add(`colorize`),t}window.customElements.define(`shacl-property`,Za);function ro(e,t){let n=e,r=t.store.getQuads(e,null,null,null),i=Nt(r,`label`,ct,t.languages);i&&(n=i);let a;if(t.attributes.collapse!==null)a=new ya,a.classList.add(`collapsible`),a.open=t.attributes.collapse===`open`,a.label=n,a.setAttribute(`part`,`group collapsible`);else{a=document.createElement(`div`);let e=document.createElement(`h1`);e.innerText=n,e.setAttribute(`part`,`group-title`),a.appendChild(e),a.setAttribute(`part`,`group`)}a.dataset.subject=e,a.classList.add(`shacl-group`);let o=parseInt(Nt(r,`order`)??``)||0;return{element:a,order:o}}var io=[];for(let e=0;e<256;++e)io.push((e+256).toString(16).slice(1));function ao(e,t=0){return(io[e[t+0]]+io[e[t+1]]+io[e[t+2]]+io[e[t+3]]+`-`+io[e[t+4]]+io[e[t+5]]+`-`+io[e[t+6]]+io[e[t+7]]+`-`+io[e[t+8]]+io[e[t+9]]+`-`+io[e[t+10]]+io[e[t+11]]+io[e[t+12]]+io[e[t+13]]+io[e[t+14]]+io[e[t+15]]).toLowerCase()}var oo,so=new Uint8Array(16);function co(){if(!oo){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);oo=crypto.getRandomValues.bind(crypto)}return oo(so)}var lo={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function uo(e,t,n){e||={};let r=e.random??e.rng?.()??co();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return ao(r)}function fo(e,t,n){return lo.randomUUID&&!t&&!e?lo.randomUUID():uo(e,t,n)}var po={[`${Y}node`]:(e,t)=>{e.extendedShapes.add(new mo(t,e.config,e))},[`${Y}and`]:(e,t)=>{for(let n of e.config.lists[t.value])e.extendedShapes.add(new mo(n,e.config,e))},[`${Y}property`]:(e,t)=>{let n=e.config.getPropertyTemplate(t,e),r=xr(n);if(r){let t=e.properties[r];if(t||(t=[],e.properties[r]=t),n.qualifiedValueShape)t.push(n);else{let i;for(let t=0;t<e.properties[r].length&&!i;t++)e.properties[r][t].qualifiedValueShape||(i=e.properties[r][t]);i?br(i,n):t.push(n)}}},[`${Y}nodeKind`]:(e,t)=>{e.nodeKind=t},[`${Y}targetClass`]:(e,t)=>{e.targetClass=t},[`${Y}or`]:(e,t)=>{e.or=e.config.lists[t.value]},[`${Y}xone`]:(e,t)=>{e.xone=e.config.lists[t.value]},[_t.id]:(e,t)=>{e.owlImports.add(t)},[`${ut}title`]:(e,t)=>{let n=t;e.label=Gt(e.config.languages,e.label,n)},[`${ct}label`]:(e,t)=>{let n=t;e.label=Gt(e.config.languages,e.label,n)}},mo=class{constructor(e,t,n){this.extendedShapes=new Set,this.properties={},this.owlImports=new Set,this.merged=!1,this.id=e,this.config=t,this.parent=n,t.registerNodeTemplate(this),ho(this,this.config.store.getQuads(e,null,null,null))}};function ho(e,t){for(let n of t)po[n.predicate.id]?.call(e,e,n.object);return go(e),e}function go(e){let t=Object.values(e.properties).flat().filter(e=>e.pathAlternatives?.length),n=new Set;for(let r of t){let t={};r.pathAlternatives.every(n=>{let r=e.properties[n];return r?.length!==1||_o(r[0])?!1:(t[n]=r[0],!0)})&&(r.pathAlternativeBranches=t,r.pathAlternatives.forEach(e=>n.add(e)))}for(let t of n)delete e.properties[t]}function _o(e){return e.minCount!==void 0||e.maxCount!==void 0||e.qualifiedMinCount!==void 0||e.qualifiedMaxCount!==void 0||e.qualifiedValueShape!==void 0}function vo(e){if(!e.merged){e.merged=!0;for(let t of Object.values(e.properties))for(let n of t){let[t,r]=wo(e,xr(n)),i=t.some(e=>e.qualifiedValueShape!==void 0),a=yo(t),o=i?a:r;if(t.length>1&&o){let e=t[t.length-1];for(let n=t.length-2;n>=0;n--){let r=t[n],i=a?e.qualifiedValueShape:void 0;delete r.parent.properties[xr(r)],br(e,r,!0),i&&e.nodeShapes.delete(i)}xo(e)}}}}function yo(e){if(e.length<2)return!1;for(let t=0;t<e.length-1;t++){let n=e[t],r=e[t+1];if(!n.qualifiedValueShape||!r.qualifiedValueShape||!bo(n.parent,r.parent)||!bo(n.qualifiedValueShape,r.qualifiedValueShape))return!1}return!0}function bo(e,t){let n=[...e.extendedShapes],r=new Set;for(;n.length;){let e=n.pop();if(e.id.equals(t.id))return!0;r.has(e)||(r.add(e),n.push(...e.extendedShapes))}return!1}function xo(e){for(let t of[`xone`,`or`]){let n=e[t];if(!n?.length)continue;let r=n.filter(t=>So(t,e));r.length>0&&r.length<n.length&&(r.length===1?(e[t]=void 0,yr(e,e.config.store.getQuads(r[0],null,null,null))):e[t]=r)}}function So(e,t){let n=t.config.store.getQuads(e,null,null,null);return Co(n,`http://www.w3.org/ns/shacl#datatype`,t.datatype)&&Co(n,Ct.id,t.class)&&Co(n,`http://www.w3.org/ns/shacl#nodeKind`,t.nodeKind)}function Co(e,t,n){if(!n)return!0;let r=!1;for(let i of e)if(i.predicate.value===t&&(r=!0,i.object.equals(n)))return!0;return!r}function wo(e,t,n=new Set,r=[],i=!1){if(!n.has(e.id.value)){n.add(e.id.value);let a=e.properties[t];if(a?.length===1){r.push(a[0]),i||=a[0].maxCount===1;for(let e of a[0].nodeShapes){let[a,o]=wo(e,t,n,r,i);i||=o}}for(let a of e.extendedShapes){let[e,o]=wo(a,t,n,r,i);i||=o}}return[r,i]}var To=class e extends HTMLElement{constructor(t,n,r,i,a,o=new Set,s){super(),this.template=t,this.linked=a??!1,this.ancestorShapeIds=o,this.queryContext=s,this.setAttribute(`part`,`node`);let c=n;c||=(!r&&t.nodeKind&&(r=t.nodeKind),r===void 0&&t.config.attributes.valuesNamespace||r?.value===`http://www.w3.org/ns/shacl#IRI`?k.namedNode(t.config.attributes.valuesNamespace+fo()):k.blankNode(fo())),this.nodeId=c;let l=JSON.stringify([t.id,this.nodeId]);if(n&&t.config.renderedNodes.has(l)){i||=`Link`;let e=document.createElement(`label`);e.innerText=i,e.classList.add(`linked`),this.appendChild(e);let t=this.getAttribute(`part`);this.setAttribute(`part`,`${t?t+` `:``}linked-node`),this.dataset.nodeId=this.nodeId.id;let r=document.createElement(`a`),a=n.termType===`BlankNode`?`_:`+n.value:n.value,o=Array.from(this.template.config.form.querySelectorAll(`shacl-node:not([part~="linked-node"])`)).find(e=>e.nodeId.equals(n)),s=new tt;o?.toRDF(s),r.innerText=It([...s.getQuads(n,null,null,null),...this.template.config.store.getQuads(n,null,null,null)],this.template.config.languages)||a,r.classList.add(`ref-link`),r.onclick=()=>{this.template.config.form.querySelector(`shacl-node[data-node-id='${a}']:not([part~='linked-node'])`)?.scrollIntoView()},this.appendChild(r),this.style.flexDirection=`row`,this.ready=Promise.resolve()}else{t.config.renderedNodes.add(l);let r=this.ancestorShapeIds,o=this.template.id.value,s=this.queryContext;if(this.dataset.nodeId=this.nodeId.id,this.template.config.attributes.showNodeIds!==null){let e=document.createElement(`div`);e.innerText=`id: ${this.nodeId.id}`,e.classList.add(`node-id-display`),this.appendChild(e)}vo(t),this.ready=(async()=>{let c=new Set(r);c.add(o);for(let[e,r]of Object.entries(t.properties))for(let e of r)await this.addPropertyInstance(e,n,r.length>1);for(let r of t.extendedShapes){let t=new e(r,n,void 0,void 0,a,c,s);this.prepend(t),await t.ready}if(t.or?.length&&await this.tryResolve(t.or,n,t.config),t.xone?.length&&await this.tryResolve(t.xone,n,t.config),i){let e=document.createElement(`h1`);e.innerText=i,e.setAttribute(`part`,`node-title`),this.prepend(e)}})()}}toRDF(e,t,n=``){if(t||=this.nodeId,!this.linked){for(let 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.template.targetClass&&e.addQuad(t,pt,this.template.targetClass,this.template.config.valuesGraphId),n&&e.addQuad(t,k.namedNode(n),this.template.id,this.template.config.valuesGraphId)}return t}async addPropertyInstance(e,t,n){let r=null;if(e.group)if(e.config.groups.indexOf(e.group)>-1){let t=this.querySelector(`:scope > .shacl-group[data-subject='${e.group}']`);if(!t){let n=ro(e.group,e.config);t=n.element,Do(this,t,n.order)}r=t}else console.warn(`ignoring unknown group reference`,e.group,`existing groups:`,e.config.groups);let i=new Za(e,this);e.config.queryMode?await i.initializeQuery():await i.bindValues(t,n),(e.config.editMode||e.config.queryMode||i.instanceCount()>0)&&(Do(r||this,i,e.order),e.config.queryMode||await i.updateControls())}async tryResolve(e,t,n){let r=!1;if(t){let i=Mr(e,t,n);if(i.length){for(let e of i)await this.addPropertyInstance(n.getPropertyTemplate(e,this.template),t);r=!0}}r||this.appendChild(kr(e,this,n))}},Eo=new WeakMap;function Do(e,t,n=0){Eo.set(t,n);let r=Array.from(e.children).find(e=>e!==t&&(Eo.get(e)??0)>n);e.insertBefore(t,r??null)}window.customElements.define(`shacl-node`,To);function Oo(e){return e.datatype!==void 0&&At.has(e.datatype)}export{jt as $,Or as A,lr as B,Gr as C,Pr as D,Rr as E,yr as F,Kt as G,vn as H,Sr as I,Zt as J,Ut as K,dr as L,gr as M,vr as N,Fr as O,mr as P,Mt as Q,ur as R,Jr as S,Lr as T,Lt as U,cr as V,nn as W,ft as X,Xt as Y,ht as Z,va as _,l as _t,Za as a,bt as at,Xr as b,Ia as c,dt as ct,La as d,N as dt,Y as et,xa as f,k as ft,ya as g,s as gt,$ as h,o as ht,vo as i,xt as it,hr as j,kr as k,Fa as l,kt as lt,ba as m,j as mt,To as n,mt as nt,no as o,Tt as ot,wa as p,M as pt,It as q,mo as r,pt as rt,qa as s,Et as st,Oo as t,ot as tt,Ra as u,tt as ut,Ca as v,Ir as w,Yr as x,Zr as y,fr as z};
|