@ulb-darmstadt/shacl-form 1.7.3 → 1.8.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 +13 -3
- package/dist/config.d.ts +4 -5
- package/dist/constants.d.ts +15 -12
- package/dist/constraints.d.ts +5 -4
- package/dist/exports.d.ts +2 -1
- package/dist/form-bootstrap.d.ts +1 -1
- package/dist/form-bootstrap.js +361 -2
- package/dist/form-default.d.ts +1 -1
- package/dist/form-default.js +350 -2
- package/dist/form-material.d.ts +1 -1
- package/dist/form-material.js +670 -2
- package/dist/form.d.ts +3 -2
- package/dist/node-template.d.ts +17 -0
- package/dist/node.d.ts +5 -1
- package/dist/plugins/leaflet.d.ts +2 -4
- package/dist/plugins/leaflet.js +720 -2
- package/dist/plugins/mapbox.d.ts +2 -2
- package/dist/plugins/mapbox.js +2764 -2
- package/dist/property-template.d.ts +2 -1
- package/dist/property.d.ts +6 -2
- package/dist/theme.d.ts +2 -2
- package/dist/themes/default.d.ts +3 -3
- package/dist/themes/material.d.ts +2 -3
- package/package.json +26 -14
- package/src/config.ts +11 -10
- package/src/constants.ts +4 -1
- package/src/constraints.ts +75 -31
- package/src/exports.ts +2 -1
- package/src/form.ts +32 -17
- package/src/group.ts +1 -1
- package/src/loader.ts +12 -13
- package/src/node-template.ts +82 -0
- package/src/node.ts +88 -63
- package/src/plugins/leaflet.ts +2 -2
- package/src/plugins/mapbox.ts +4 -4
- package/src/property-template.ts +19 -8
- package/src/property.ts +168 -63
- package/src/serialize.ts +14 -1
- package/src/styles.css +8 -10
- package/src/theme.ts +5 -5
- package/src/themes/bootstrap.ts +1 -1
- package/src/themes/default.css +2 -2
- package/src/themes/default.ts +12 -3
- package/src/themes/material.ts +12 -3
- package/src/util.ts +12 -14
- package/dist/form-bootstrap.js.LICENSE.txt +0 -69
- package/dist/form-default.js.LICENSE.txt +0 -69
- package/dist/form-material.js.LICENSE.txt +0 -69
- package/dist/plugins/file-upload.js +0 -1
- package/dist/plugins/fixed-list.js +0 -1
- package/dist/plugins/leaflet.js.LICENSE.txt +0 -4
- package/dist/plugins/mapbox.js.LICENSE.txt +0 -10
package/dist/form-default.js
CHANGED
|
@@ -1,2 +1,350 @@
|
|
|
1
|
-
|
|
2
|
-
var e={92:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerBoolean=void 0;const r=n(103);class i{fromRdf(e,t){switch(e.value){case"true":case"1":return!0;case"false":case"0":return!1}return t&&r.Translator.incorrectRdfDataType(e),!1}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e?"true":"false",t||n.namedNode(i.TYPE))}}t.TypeHandlerBoolean=i,i.TYPE="http://www.w3.org/2001/XMLSchema#boolean"},103:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Translator=void 0,t.Translator=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(e){throw new Error(`Invalid RDF ${e.datatype.value} value: '${e.value}'`)}registerHandler(e,t,n){for(const n of t)this.supportedRdfDatatypes.push(n),this.fromRdfHandlers[n.value]=e;for(const t of n){let n=this.toRdfHandlers[t];n||(this.toRdfHandlers[t]=n=[]),n.push(e)}}fromRdf(e,t){const n=this.fromRdfHandlers[e.datatype.value];return n?n.fromRdf(e,t):e.value}toRdf(e,t){const n=this.toRdfHandlers[typeof e];if(n)for(const r of n){const n=r.toRdf(e,t);if(n)return n}throw new Error(`Invalid JavaScript value: '${e}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}}},251:(e,t)=>{t.read=function(e,t,n,r,i){var s,o,a=8*i-r-1,l=(1<<a)-1,c=l>>1,u=-7,d=n?i-1:0,h=n?-1:1,f=e[t+d];for(d+=h,s=f&(1<<-u)-1,f>>=-u,u+=a;u>0;s=256*s+e[t+d],d+=h,u-=8);for(o=s&(1<<-u)-1,s>>=-u,u+=r;u>0;o=256*o+e[t+d],d+=h,u-=8);if(0===s)s=1-c;else{if(s===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),s-=c}return(f?-1:1)*o*Math.pow(2,s-r)},t.write=function(e,t,n,r,i,s){var o,a,l,c=8*s-i-1,u=(1<<c)-1,d=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,o=u):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),(t+=o+d>=1?h/l:h*Math.pow(2,1-d))*l>=2&&(o++,l/=2),o+d>=u?(a=0,o=u):o+d>=1?(a=(t*l-1)*Math.pow(2,i),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+f]=255&a,f+=p,a/=256,i-=8);for(o=o<<i|a,c+=i;c>0;e[n+f]=255&o,f+=p,o/=256,c-=8);e[n+f-p]|=128*g}},259:e=>{e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},277:(e,t,n)=>{const{ArrayIsArray:r,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:s,ArrayPrototypeMap:o,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:d,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:f,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:y}=n(4134),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:x}}=n(6371),{normalizeEncoding:S}=n(7760),{isAsyncFunction:j,isArrayBufferView:I}=n(7760).types,E={},N=/^[0-7]+$/,T=m(((e,t,n=u,r=c)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(e<n||e>r)throw new _(t,`>= ${n} && <= ${r}`,e)})),R=m(((e,t,n=-2147483648,r=2147483647)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new _(t,"an integer",e);if(e<n||e>r)throw new _(t,`>= ${n} && <= ${r}`,e)})),O=m(((e,t,n=!1)=>{if("number"!=typeof e)throw new v(t,"number",e);if(!a(e))throw new _(t,"an integer",e);const r=n?1:0,i=4294967295;if(e<r||e>i)throw new _(t,`>= ${r} && <= ${i}`,e)}));function k(e,t){if("string"!=typeof e)throw new v(t,"string",e)}const L=m(((e,t,n)=>{if(!i(n,e)){const r=s(o(n,(e=>"string"==typeof e?`'${e}'`:p(e))),", ");throw new w(t,e,"must be one of: "+r)}}));function A(e,t){if("boolean"!=typeof e)throw new v(t,"boolean",e)}function C(e,t,n){return null!=e&&h(e,t)?e[t]:n}const D=m(((e,t,n=null)=>{const i=C(n,"allowArray",!1),s=C(n,"allowFunction",!1);if(!C(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!=typeof e&&(!s||"function"!=typeof e))throw new v(t,"Object",e)})),M=m(((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new v(t,"a dictionary",e)})),P=m(((e,t,n=0)=>{if(!r(e))throw new v(t,"Array",e);if(e.length<n)throw new w(t,e,`must be longer than ${n}`)})),$=m(((e,t="buffer")=>{if(!I(e))throw new v(t,["Buffer","TypedArray","DataView"],e)})),B=m(((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new v(t,"AbortSignal",e)})),F=m(((e,t)=>{if("function"!=typeof e)throw new v(t,"Function",e)})),q=m(((e,t)=>{if("function"!=typeof e||j(e))throw new v(t,"Function",e)})),U=m(((e,t)=>{if(void 0!==e)throw new v(t,"undefined",e)})),G=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(e,t){if(void 0===e||!f(G,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,n){if(void 0===e&&(e=n),"string"==typeof e){if(null===f(N,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=d(e,8)}return O(e,t),e},validateArray:P,validateStringArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++)k(e[n],`${t}[${n}]`)},validateBooleanArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++)A(e[n],`${t}[${n}]`)},validateAbortSignalArray:function(e,t){P(e,t);for(let n=0;n<e.length;n++){const r=e[n],i=`${t}[${n}]`;if(null==r)throw new v(i,"AbortSignal",r);B(r,i)}},validateBoolean:A,validateBuffer:$,validateDictionary:M,validateEncoding:function(e,t){const n=S(t),r=e.length;if("hex"===n&&r%2!=0)throw new w("encoding",t,`is invalid for data of length ${r}`)},validateFunction:F,validateInt32:R,validateInteger:T,validateNumber:function(e,t,n=void 0,r){if("number"!=typeof e)throw new v(t,"number",e);if(null!=n&&e<n||null!=r&&e>r||(null!=n||null!=r)&&l(e))throw new _(t,`${null!=n?`>= ${n}`:""}${null!=n&&null!=r?" && ":""}${null!=r?`<= ${r}`:""}`,e)},validateObject:D,validateOneOf:L,validatePlainFunction:q,validatePort:function(e,t="Port",n=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===y(e).length||+e!==+e>>>0||e>65535||0===e&&!n)throw new b(t,e,n);return 0|e},validateSignalName:function(e,t="signal"){if(k(e,t),void 0===E[e]){if(void 0!==E[g(e)])throw new x(e+" (signals must use all capital letters)");throw new x(e)}},validateString:k,validateUint32:O,validateUndefined:U,validateUnion:function(e,t,n){if(!i(n,e))throw new v(t,`('${s(n,"|")}')`,e)},validateAbortSignal:B,validateLinkHeaderValue:function(e){if("string"==typeof e)return H(e,"hints"),e;if(r(e)){const t=e.length;let n="";if(0===t)return n;for(let r=0;r<t;r++){const i=e[r];H(i,"hints"),n+=i,r!==t-1&&(n+=", ")}return n}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},345:(e,t,n)=>{const{StringPrototypeSlice:r,SymbolIterator:i,TypedArrayPrototypeSet:s,Uint8Array:o}=n(4134),{Buffer:a}=n(8287),{inspect:l}=n(7760);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?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(0===this.length)return"";let t=this.head,n=""+t.data;for(;null!==(t=t.next);)n+=e+t.data;return n}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let n=this.head,r=0;for(;n;)s(t,n.data,r),r+=n.data.length,n=n.next;return t}consume(e,t){const n=this.head.data;if(e<n.length){const 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}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{const s=n.data;if(!(e>s.length)){e===s.length?(t+=s,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(s,0,e),this.head=n,n.data=r(s,e));break}t+=s,e-=s.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){const t=a.allocUnsafe(e),n=e;let r=this.head,i=0;do{const a=r.data;if(!(e>a.length)){e===a.length?(s(t,a,n-e),++i,r.next?this.head=r.next:this.head=this.tail=null):(s(t,new o(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}s(t,a,n-e),e-=a.length,++i}while(null!==(r=r.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},346:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},378:(e,t,n)=>{const r=n(3751),i=n(2438);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const i of r){let r,s;if("BlankNode"===i.subject.termType&&i.subject.value!==e)s=i.subject.value,r="p";else{if("BlankNode"!==i.object.termType||i.object.value===e)continue;s=i.object.value,r="r"}const o=this.hashRelatedBlankNode(s,i,t,r),a=n.get(o);a?a.push(s):n.set(o,[s])}return n}}},458:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Literal=void 0;const r=n(3476);class i{constructor(e,t){this.termType="Literal",this.value=e,"string"==typeof t?(this.language=t,this.datatype=i.RDF_LANGUAGE_STRING,this.direction=""):t?"termType"in t?(this.language="",this.datatype=t,this.direction=""):(this.language=t.language,this.datatype=t.direction?i.RDF_DIRECTIONAL_LANGUAGE_STRING:i.RDF_LANGUAGE_STRING,this.direction=t.direction||""):(this.language="",this.datatype=i.XSD_STRING,this.direction="")}equals(e){return!!e&&"Literal"===e.termType&&e.value===this.value&&e.language===this.language&&(e.direction===this.direction||!e.direction&&""===this.direction)&&this.datatype.equals(e.datatype)}}t.Literal=i,i.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),i.RDF_DIRECTIONAL_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),i.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string")},470:(e,t,n)=>{const r=n(7382),i={};e.exports=i,i.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*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},i.parse=(e,t)=>{const n={},r=i.parsers[t||"full"],s=r.regex.exec(e);let o=r.keys.length;for(;o--;)n[r.keys[o]]=void 0===s[o]?null:s[o];return("https"===n.scheme&&"443"===n.port||"http"===n.scheme&&"80"===n.port)&&(n.href=n.href.replace(":"+n.port,""),n.authority=n.authority.replace(":"+n.port,""),n.port=null),n.normalizedPath=i.removeDotSegments(n.path),n},i.prependBase=(e,t)=>{if(null===e)return t;if(i.isAbsolute(t))return t;e&&!r.isString(e)||(e=i.parse(e||""));const n=i.parse(t),s={protocol:e.protocol||""};if(null!==n.authority)s.authority=n.authority,s.path=n.path,s.query=n.query;else if(s.authority=e.authority,""===n.path)s.path=e.path,null!==n.query?s.query=n.query:s.query=e.query;else{if(0===n.path.indexOf("/"))s.path=n.path;else{let t=e.path;t=t.substr(0,t.lastIndexOf("/")+1),(t.length>0||e.authority)&&"/"!==t.substr(-1)&&(t+="/"),t+=n.path,s.path=t}s.query=n.query}""!==n.path&&(s.path=i.removeDotSegments(s.path));let o=s.protocol;return null!==s.authority&&(o+="//"+s.authority),o+=s.path,null!==s.query&&(o+="?"+s.query),null!==n.fragment&&(o+="#"+n.fragment),""===o&&(o="./"),o},i.removeBase=(e,t)=>{if(null===e)return t;e&&!r.isString(e)||(e=i.parse(e||""));let n="";if(""!==e.href?n+=(e.protocol||"")+"//"+(e.authority||""):t.indexOf("//")&&(n+="//"),0!==t.indexOf(n))return t;const s=i.parse(t.substr(n.length)),o=e.normalizedPath.split("/"),a=s.normalizedPath.split("/"),l=s.fragment||s.query?0:1;for(;o.length>0&&a.length>l&&o[0]===a[0];)o.shift(),a.shift();let c="";if(o.length>0){o.pop();for(let e=0;e<o.length;++e)c+="../"}return c+=a.join("/"),null!==s.query&&(c+="?"+s.query),null!==s.fragment&&(c+="#"+s.fragment),""===c&&(c="./"),c},i.removeDotSegments=e=>{if(0===e.length)return"";const t=e.split("/"),n=[];for(;t.length>0;){const e=t.shift(),r=0===t.length;"."!==e?".."!==e?n.push(e):(n.pop(),r&&n.push("")):r&&n.push("")}return"/"===e[0]&&n.length>0&&""!==n[0]&&n.unshift(""),1===n.length&&""===n[0]?"/":n.join("/")};const s=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;i.isAbsolute=e=>r.isString(e)&&s.test(e),i.isRelative=e=>r.isString(e)},659:(e,t,n)=>{var r=n(1873),i=Object.prototype,s=i.hasOwnProperty,o=i.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=s.call(e,a),n=e[a];try{e[a]=void 0;var r=!0}catch(e){}var i=o.call(e);return r&&(t?e[a]=n:delete e[a]),i}},701:(e,t,n)=>{const r=n(6957),i={};e.exports=i,i.setupDocumentLoaders=function(e){"undefined"!=typeof XMLHttpRequest&&(e.documentLoaders.xhr=r,e.useDocumentLoader("xhr"))},i.setupGlobals=function(e){void 0===globalThis.JsonLdProcessor&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:e.JsonLdProcessor})}},823:(e,t,n)=>{const r=globalThis.AbortController||n(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:s,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:a},AbortError:l}=n(6371),{validateAbortSignal:c,validateInteger:u,validateObject:d}=n(277),h=n(4134).Symbol("kWeak"),f=n(4134).Symbol("kResistStopPropagation"),{finished:p}=n(6238),g=n(7830),{addAbortSignalNoValidate:y}=n(4147),{isWritable:m,isNodeStream:b}=n(6115),{deprecate:v}=n(7760),{ArrayPrototypePush:w,Boolean:_,MathFloor:x,Number:S,NumberIsNaN:j,Promise:I,PromiseReject:E,PromiseResolve:N,PromisePrototypeThen:T,Symbol:R}=n(4134),O=R("kEmpty"),k=R("kEof");function L(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let r=1;null!=(null==t?void 0:t.concurrency)&&(r=x(t.concurrency));let i=r-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=x(t.highWaterMark)),u(r,"options.concurrency",1),u(i,"options.highWaterMark",0),i+=r,async function*(){const s=n(7760).AbortSignalAny([null==t?void 0:t.signal].filter(_)),o=this,a=[],c={signal:s};let u,d,h=!1,f=0;function p(){h=!0,g()}function g(){f-=1,y()}function y(){d&&!h&&f<r&&a.length<i&&(d(),d=null)}!async function(){try{for await(let t of o){if(h)return;if(s.aborted)throw new l;try{if(t=e(t,c),t===O)continue;t=N(t)}catch(e){t=E(e)}f+=1,T(t,g,p),a.push(t),u&&(u(),u=null),!h&&(a.length>=i||f>=r)&&await new I((e=>{d=e}))}a.push(k)}catch(e){const t=E(e);T(t,g,p),a.push(t)}finally{h=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===k)return;if(s.aborted)throw new l;e!==O&&(yield e),a.shift(),y()}await new I((e=>{u=e}))}}finally{h=!0,d&&(d(),d=null)}}.call(this)}async function A(e,t=void 0){for await(const n of C.call(this,e,t))return!0;return!1}function C(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);return L.call(this,(async function(t,n){return await e(t,n)?t:O}),t)}class D extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function M(e){if(e=S(e),j(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:v((function(e=void 0){return null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const r of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l({cause:e.signal.reason});yield[t++,r]}}.call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;e--<=0&&(yield n)}}.call(this)},filter:C,flatMap:function(e,t){const n=L.call(this,e,t);return async function*(){for await(const e of n)yield*e}.call(this)},map:L,take:function(e,t=void 0){return null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=M(e),async function*(){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;for await(const n of this){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;if(e-- >0&&(yield n),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&d(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),b(e)&&!m(e))throw new i("stream",e,"must be writable");const n=g(this,e);return null!=t&&t.signal&&y(t.signal,n),n}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);return!await A.call(this,(async(...t)=>!await e(...t)),t)},forEach:async function(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);for await(const n of L.call(this,(async function(t,n){return await e(t,n),O}),t));},reduce:async function(e,t,n){var i;if("function"!=typeof e)throw new s("reducer",["Function","AsyncFunction"],e);null!=n&&d(n,"options"),null!=(null==n?void 0:n.signal)&&c(n.signal,"options.signal");let o=arguments.length>1;if(null!=n&&null!==(i=n.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:n.signal.reason});throw this.once("error",(()=>{})),await p(this.destroy(e)),e}const a=new r,u=a.signal;if(null!=n&&n.signal){const e={once:!0,[h]:this,[f]:!0};n.signal.addEventListener("abort",(()=>a.abort()),e)}let g=!1;try{for await(const r of this){var y;if(g=!0,null!=n&&null!==(y=n.signal)&&void 0!==y&&y.aborted)throw new l;o?t=await e(t,r,{signal:u}):(t=r,o=!0)}if(!g&&!o)throw new D}finally{a.abort()}return t},toArray:async function(e){null!=e&&d(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const r of this){var n;if(null!=e&&null!==(n=e.signal)&&void 0!==n&&n.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,r)}return t},some:A,find:async function(e,t){for await(const n of C.call(this,e,t))return n}}},989:(e,t,n)=>{e.exports=n(4005)},1058:(e,t,n)=>{const r=n(2207),{isArray:i,isObject:s,isString:o,isUndefined:a}=n(7382),{isList:l,isValue:c,isGraph:u,isSimpleGraph:d,isSubjectReference:h}=n(3978),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:m}=n(1972),{removeBase:b,prependBase:v}=n(470),{REGEX_KEYWORD:w,addValue:_,asArray:x,compareShortestLeast:S}=n(9263),j={};function I(e,t,n){if("@nest"!==f(e,t,{vocab:!0},n))throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}e.exports=j,j.compact=async({activeCtx:e,activeProperty:t=null,element:n,options:f={}})=>{if(i(n)){let r=[];for(let i=0;i<n.length;++i){const s=await j.compact({activeCtx:e,activeProperty:t,element:n[i],options:f});null!==s&&r.push(s)}return f.compactArrays&&1===r.length&&0===(p(e,t,"@container")||[]).length&&(r=r[0]),r}const b=p(e,t,"@context");if(a(b)||(e=await y({activeCtx:e,localCtx:b,propagate:!0,overrideProtected:!0,options:f})),s(n)){if(f.link&&"@id"in n&&f.link.hasOwnProperty(n["@id"])){const e=f.link[n["@id"]];for(let t=0;t<e.length;++t)if(e[t].expanded===n)return e[t].compacted}if(c(n)||h(n)){const r=j.compactValue({activeCtx:e,activeProperty:t,value:n,options:f});return f.link&&h(n)&&(f.link.hasOwnProperty(n["@id"])||(f.link[n["@id"]]=[]),f.link[n["@id"]].push({expanded:n,compacted:r})),r}if(l(n)&&(p(e,t,"@container")||[]).includes("@list"))return j.compact({activeCtx:e,activeProperty:t,element:n["@list"],options:f});const b="@reverse"===t,v={},w=e;c(n)||h(n)||(e=e.revertToPreviousContext());const S=p(w,t,"@context");a(S)||(e=await y({activeCtx:e,localCtx:S,propagate:!0,overrideProtected:!0,options:f})),f.link&&"@id"in n&&(f.link.hasOwnProperty(n["@id"])||(f.link[n["@id"]]=[]),f.link[n["@id"]].push({expanded:n,compacted:v}));let E=n["@type"]||[];E.length>1&&(E=Array.from(E).sort());const N=e;for(const t of E){const n=j.compactIri({activeCtx:N,iri:t,relativeTo:{vocab:!0}}),r=p(w,n,"@context");a(r)||(e=await y({activeCtx:e,localCtx:r,options:f,propagate:!1}))}const T=Object.keys(n).sort();for(const a of T){const h=n[a];if("@id"!==a)if("@type"!==a)if("@reverse"!==a)if("@preserve"!==a)if("@index"!==a)if("@graph"!==a&&"@list"!==a&&"@included"!==a&&g(a)){const t=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});_(v,t,h)}else{if(!i(h))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(0===h.length){const t=j.compactIri({activeCtx:e,iri:a,value:h,relativeTo:{vocab:!0},reverse:b}),n=e.mappings.has(t)?e.mappings.get(t)["@nest"]:null;let r=v;n&&(I(e,n,f),s(v[n])||(v[n]={}),r=v[n]),_(r,t,h,{propertyIsArray:!0})}for(const t of h){const n=j.compactIri({activeCtx:e,iri:a,value:t,relativeTo:{vocab:!0},reverse:b}),r=e.mappings.has(n)?e.mappings.get(n)["@nest"]:null;let h=v;r&&(I(e,r,f),s(v[r])||(v[r]={}),h=v[r]);const g=p(e,n,"@container")||[],y=u(t),m=l(t);let w;m?w=t["@list"]:y&&(w=t["@graph"]);let S=await j.compact({activeCtx:e,activeProperty:n,element:m||y?w:t,options:f});if(m){if(i(S)||(S=[S]),g.includes("@list")){_(h,n,S,{valueIsArray:!0,allowDuplicate:!0});continue}S={[j.compactIri({activeCtx:e,iri:"@list",relativeTo:{vocab:!0}})]:S},"@index"in t&&(S[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"])}if(y)if(g.includes("@graph")&&(g.includes("@id")||g.includes("@index")&&d(t))){let r;h.hasOwnProperty(n)?r=h[n]:h[n]=r={};const i=(g.includes("@id")?t["@id"]:t["@index"])||j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}});_(r,i,S,{propertyIsArray:!f.compactArrays||g.includes("@set")})}else g.includes("@graph")&&d(t)?(i(S)&&S.length>1&&(S={"@included":S}),_(h,n,S,{propertyIsArray:!f.compactArrays||g.includes("@set")})):(i(S)&&1===S.length&&f.compactArrays&&(S=S[0]),S={[j.compactIri({activeCtx:e,iri:"@graph",relativeTo:{vocab:!0}})]:S},"@id"in t&&(S[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t["@id"]),"@index"in t&&(S[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=t["@index"]),_(h,n,S,{propertyIsArray:!f.compactArrays||g.includes("@set")}));else if(g.includes("@language")||g.includes("@index")||g.includes("@id")||g.includes("@type")){let r,i;if(h.hasOwnProperty(n)?r=h[n]:h[n]=r={},g.includes("@language"))c(S)&&(S=S["@value"]),i=t["@language"];else if(g.includes("@index")){const r=p(e,n,"@index")||"@index",s=j.compactIri({activeCtx:e,iri:r,relativeTo:{vocab:!0}});if("@index"===r)i=t["@index"],delete S[s];else{let e;if([i,...e]=x(S[r]||[]),o(i))switch(e.length){case 0:delete S[r];break;case 1:S[r]=e[0];break;default:S[r]=e}else i=null}}else if(g.includes("@id")){const t=j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}});i=S[t],delete S[t]}else if(g.includes("@type")){const r=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}});let s;switch([i,...s]=x(S[r]||[]),s.length){case 0:delete S[r];break;case 1:S[r]=s[0];break;default:S[r]=s}1===Object.keys(S).length&&"@id"in t&&(S=await j.compact({activeCtx:e,activeProperty:n,element:{"@id":t["@id"]},options:f}))}i||(i=j.compactIri({activeCtx:e,iri:"@none",relativeTo:{vocab:!0}})),_(r,i,S,{propertyIsArray:g.includes("@set")})}else{const e=!f.compactArrays||g.includes("@set")||g.includes("@list")||i(S)&&0===S.length||"@list"===a||"@graph"===a;_(h,n,S,{propertyIsArray:e})}}}else{if((p(e,t,"@container")||[]).includes("@index"))continue;const n=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});_(v,n,h)}else{const n=await j.compact({activeCtx:e,activeProperty:t,element:h,options:f});i(n)&&0===n.length||_(v,a,n)}else{const t=await j.compact({activeCtx:e,activeProperty:"@reverse",element:h,options:f});for(const n in t)if(e.mappings.has(n)&&e.mappings.get(n).reverse){const r=t[n],i=(p(e,n,"@container")||[]).includes("@set")||!f.compactArrays;_(v,n,r,{propertyIsArray:i}),delete t[n]}if(Object.keys(t).length>0){const n=j.compactIri({activeCtx:e,iri:a,relativeTo:{vocab:!0}});_(v,n,t)}}else{let t=x(h).map((e=>j.compactIri({activeCtx:w,iri:e,relativeTo:{vocab:!0}})));1===t.length&&(t=t[0]);const n=j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}}),r=(p(e,n,"@container")||[]).includes("@set")&&m(e,1.1)||i(t)&&0===h.length;_(v,n,t,{propertyIsArray:r})}else{let t=x(h).map((t=>j.compactIri({activeCtx:e,iri:t,relativeTo:{vocab:!1},base:f.base})));1===t.length&&(t=t[0]),v[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]=t}}return v}return n},j.compactIri=({activeCtx:e,iri:t,value:n=null,relativeTo:i={vocab:!1},reverse:o=!1,base:a=null})=>{if(null===t)return t;e.isPropertyTermScoped&&e.previousContext&&(e=e.previousContext);const d=e.getInverse();if(g(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(i.vocab&&t in d){const r=e["@language"]||"@none",i=[];s(n)&&"@index"in n&&!("@graph"in n)&&i.push("@index","@index@set"),s(n)&&"@preserve"in n&&(n=n["@preserve"][0]),u(n)?("@index"in n&&i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n&&i.push("@graph@id","@graph@id@set"),i.push("@graph","@graph@set","@set"),"@index"in n||i.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in n||i.push("@graph@id","@graph@id@set")):s(n)&&!c(n)&&i.push("@id","@id@set","@type","@set@type");let a="@language",d="@null";if(o)a="@type",d="@reverse",i.push("@set");else if(l(n)){"@index"in n||i.push("@list");const e=n["@list"];if(0===e.length)a="@any",d="@none";else{let t=0===e.length?r:null,n=null;for(let r=0;r<e.length;++r){const i=e[r];let s="@none",o="@none";if(c(i)?"@direction"in i?s=`${(i["@language"]||"").toLowerCase()}_${i["@direction"]}`:"@language"in i?s=i["@language"].toLowerCase():"@type"in i?o=i["@type"]:s="@null":o="@id",null===t?t=s:s!==t&&c(i)&&(t="@none"),null===n?n=o:o!==n&&(n="@none"),"@none"===t&&"@none"===n)break}t=t||"@none",n=n||"@none","@none"!==n?(a="@type",d=n):d=t}}else{if(c(n))if("@language"in n&&!("@index"in n)){i.push("@language","@language@set"),d=n["@language"];const e=n["@direction"];e&&(d=`${d}_${e}`)}else"@direction"in n&&!("@index"in n)?d=`_${n["@direction"]}`:"@type"in n&&(a="@type",d=n["@type"]);else a="@type",d="@id";i.push("@set")}i.push("@none"),s(n)&&!("@index"in n)&&i.push("@index","@index@set"),c(n)&&1===Object.keys(n).length&&i.push("@language","@language@set");const h=function(e,t,n,r,i,o){null===o&&(o="@null");const a=[];if(("@id"===o||"@reverse"===o)&&s(n)&&"@id"in n){"@reverse"===o&&a.push("@reverse");const t=j.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:!0}});e.mappings.has(t)&&e.mappings.get(t)&&e.mappings.get(t)["@id"]===n["@id"]?a.push.apply(a,["@vocab","@id"]):a.push.apply(a,["@id","@vocab"])}else{a.push(o);const e=a.find((e=>e.includes("_")));e&&a.push(e.replace(/^[^_]+_/,"_"))}a.push("@none");const l=e.inverse[t];for(const e of r){if(!(e in l))continue;const t=l[e][i];for(const e of a)if(e in t)return t[e]}return null}(e,t,n,i,a,d);if(null!==h)return h}if(i.vocab&&"@vocab"in e){const n=e["@vocab"];if(0===t.indexOf(n)&&t!==n){const r=t.substr(n.length);if(!e.mappings.has(r))return r}}let h=null;const f=[];let p=e.fastCurieMap;const y=t.length-1;for(let e=0;e<y&&t[e]in p;++e)p=p[t[e]],""in p&&f.push(p[""][0]);for(let r=f.length-1;r>=0;--r){const i=f[r],s=i.terms;for(const r of s){const s=r+":"+t.substr(i.iri.length);e.mappings.get(r)._prefix&&(!e.mappings.has(s)||null===n&&e.mappings.get(s)["@id"]===t)&&(null===h||S(s,h)<0)&&(h=s)}}if(null!==h)return h;for(const[n,i]of e.mappings)if(i&&i._prefix&&t.startsWith(n+":"))throw new r(`Absolute IRI "${t}" confused with prefix "${n}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:e});if(!i.vocab){if("@base"in e){if(e["@base"]){const n=b(v(a,e["@base"]),t);return w.test(n)?`./${n}`:n}return t}return b(a,t)}return t},j.compactValue=({activeCtx:e,activeProperty:t,value:n,options:r})=>{if(c(n)){const r=p(e,t,"@type"),i=p(e,t,"@language"),s=p(e,t,"@direction"),a=p(e,t,"@container")||[],l="@index"in n&&!a.includes("@index");if(!l&&"@none"!==r){if(n["@type"]===r)return n["@value"];if("@language"in n&&n["@language"]===i&&"@direction"in n&&n["@direction"]===s)return n["@value"];if("@language"in n&&n["@language"]===i)return n["@value"];if("@direction"in n&&n["@direction"]===s)return n["@value"]}const c=Object.keys(n).length,u=1===c||2===c&&"@index"in n&&!l,d="@language"in e,h=o(n["@value"]),f=e.mappings.has(t)&&null===e.mappings.get(t)["@language"];if(u&&"@none"!==r&&(!d||!h||f))return n["@value"];const g={};return l&&(g[j.compactIri({activeCtx:e,iri:"@index",relativeTo:{vocab:!0}})]=n["@index"]),"@type"in n?g[j.compactIri({activeCtx:e,iri:"@type",relativeTo:{vocab:!0}})]=j.compactIri({activeCtx:e,iri:n["@type"],relativeTo:{vocab:!0}}):"@language"in n&&(g[j.compactIri({activeCtx:e,iri:"@language",relativeTo:{vocab:!0}})]=n["@language"]),"@direction"in n&&(g[j.compactIri({activeCtx:e,iri:"@direction",relativeTo:{vocab:!0}})]=n["@direction"]),g[j.compactIri({activeCtx:e,iri:"@value",relativeTo:{vocab:!0}})]=n["@value"],g}const i=f(e,t,{vocab:!0},r),s=p(e,t,"@type"),a=j.compactIri({activeCtx:e,iri:n["@id"],relativeTo:{vocab:"@vocab"===s},base:r.base});return"@id"===s||"@vocab"===s||"@graph"===i?a:{[j.compactIri({activeCtx:e,iri:"@id",relativeTo:{vocab:!0}})]:a}}},1227:e=>{const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",n="http://www.w3.org/2001/XMLSchema#string",r="NamedNode",i="BlankNode",s="Literal",o="DefaultGraph",a={};(()=>{const e="(?:<([^:]+:[^>]*)>)",t="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�_",n=t+"0-9-·̀-ͯ‿-⁀",r="(_:(?:["+t+"0-9])(?:(?:["+n+".])*(?:["+n+"]))?)",i="[ \\t]+",s="[ \\t]*",o="(?:"+e+"|"+r+")"+i,l=e+i,c="(?:"+e+"|"+r+'|(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"(?:(?:\\^\\^'+e+")|(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*)))?))"+s,u="(?:\\.|(?:(?:"+e+"|"+r+")"+s+"\\.))";a.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,a.empty=new RegExp("^"+s+"$"),a.quad=new RegExp("^"+s+o+l+c+u+s+"$")})(),e.exports=class e{static parse(e){const l=[],u={},d=e.split(a.eoln);let h=0;for(const e of d){if(h++,a.empty.test(e))continue;const d=e.match(a.quad);if(null===d)throw new Error("N-Quads parse error on line "+h+".");const g={subject:null,predicate:null,object:null,graph:null};if(void 0!==d[1]?g.subject={termType:r,value:d[1]}:g.subject={termType:i,value:d[2]},g.predicate={termType:r,value:d[3]},void 0!==d[4]?g.object={termType:r,value:d[4]}:void 0!==d[5]?g.object={termType:i,value:d[5]}:(g.object={termType:s,value:void 0,datatype:{termType:r}},void 0!==d[7]?g.object.datatype.value=d[7]:void 0!==d[8]?(g.object.datatype.value=t,g.object.language=d[8]):g.object.datatype.value=n,g.object.value=d[6].replace(c,(function(e,t,n,r){if(t)switch(t){case"t":return"\t";case"b":return"\b";case"n":return"\n";case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(n)return String.fromCharCode(parseInt(n,16));if(r)throw new Error("Unsupported U escape")}))),void 0!==d[9]?g.graph={termType:r,value:d[9]}:void 0!==d[10]?g.graph={termType:i,value:d[10]}:g.graph={termType:o,value:""},g.graph.value in u){let e=!0;const t=u[g.graph.value];for(const n of t)if(p=g,(f=n).subject.termType===p.subject.termType&&f.object.termType===p.object.termType&&f.subject.value===p.subject.value&&f.predicate.value===p.predicate.value&&f.object.value===p.object.value&&(f.object.termType!==s||f.object.datatype.termType===p.object.datatype.termType&&f.object.language===p.object.language&&f.object.datatype.value===p.object.datatype.value)){e=!1;break}e&&(t.push(g),l.push(g))}else u[g.graph.value]=[g],l.push(g)}var f,p;return l}static serialize(t){Array.isArray(t)||(t=e.legacyDatasetToQuads(t));const n=[];for(const r of t)n.push(e.serializeQuad(r));return n.sort().join("")}static serializeQuadComponents(e,s,o,a){let c="";return e.termType===r?c+=`<${e.value}>`:c+=`${e.value}`,c+=` <${s.value}> `,o.termType===r?c+=`<${o.value}>`:o.termType===i?c+=o.value:(c+=`"${function(e){return e.replace(l,(function(e){switch(e){case'"':return'\\"';case"\\":return"\\\\";case"\n":return"\\n";case"\r":return"\\r"}}))}(o.value)}"`,o.datatype.value===t?o.language&&(c+=`@${o.language}`):o.datatype.value!==n&&(c+=`^^<${o.datatype.value}>`)),a.termType===r?c+=` <${a.value}>`:a.termType===i&&(c+=` ${a.value}`),c+=" .\n",c}static serializeQuad(t){return e.serializeQuadComponents(t.subject,t.predicate,t.object,t.graph)}static legacyDatasetToQuads(e){const a=[],l={"blank node":i,IRI:r,literal:s};for(const c in e)e[c].forEach((e=>{const u={};for(const i in e){const o=e[i],a={termType:l[o.type],value:o.value};a.termType===s&&(a.datatype={termType:r},"datatype"in o&&(a.datatype.value=o.datatype),"language"in o?("datatype"in o||(a.datatype.value=t),a.language=o.language):"datatype"in o||(a.datatype.value=n)),u[i]=a}u.graph="@default"===c?{termType:o,value:""}:{termType:c.startsWith("_:")?i:r,value:c},a.push(u)}));return a}};const l=/["\\\n\r]/g,c=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g},1489:(e,t,n)=>{var r=n(7400);e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},1800:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},1873:(e,t,n)=>{var r=n(9325).Symbol;e.exports=r},1972:(e,t,n)=>{const r=n(9263),i=n(2207),{isArray:s,isObject:o,isString:a,isUndefined:l}=n(7382),{isAbsolute:c,isRelative:u,prependBase:d}=n(470),{handleEvent:h}=n(2246),{REGEX_BCP47:f,REGEX_KEYWORD:p,asArray:g,compareShortestLeast:y}=n(9263),m=new Map,b={};function v(e,t,n,r,i,s){if(null===t||!a(t)||b.isKeyword(t))return t;if(t.match(p))return null;if(r&&r.hasOwnProperty(t)&&!0!==i.get(t)&&b.createTermDefinition({activeCtx:e,localCtx:r,term:t,defined:i,options:s}),(n=n||{}).vocab){const n=e.mappings.get(t);if(null===n)return null;if(o(n)&&"@id"in n)return n["@id"]}const l=t.indexOf(":");if(l>0){const n=t.substr(0,l),o=t.substr(l+1);if("_"===n||0===o.indexOf("//"))return t;r&&r.hasOwnProperty(n)&&b.createTermDefinition({activeCtx:e,localCtx:r,term:n,defined:i,options:s});const a=e.mappings.get(n);if(a&&a._prefix)return a["@id"]+o;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=d(s.base,e["@base"]),n=d(r,t)):(r=e["@base"],n=t):(r=s.base,n=d(s.base,t)),t=n}return t}function w(e,t){if(!e||"object"!=typeof e||!t||"object"!=typeof t)return e===t;const 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(!w(e[n],t[n]))return!1;return!0}const r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(const n in e){let r=e[n],i=t[n];if("@container"===n&&Array.isArray(r)&&Array.isArray(i)&&(r=r.slice().sort(),i=i.slice().sort()),!w(r,i))return!1}return!0}e.exports=b,b.process=async({activeCtx:e,localCtx:t,options:n,propagate:r=!0,overrideProtected:l=!1,cycles:p=new Set})=>{if(o(t)&&"@context"in t&&s(t["@context"])&&(t=t["@context"]),0===g(t).length)return e;const y=[],m=[({event:e,next:t})=>{y.push(e),t()}];n.eventHandler&&m.push(n.eventHandler);const w=n;n={...n,eventHandler:m};const _=await n.contextResolver.resolve({activeCtx:e,context:t,documentLoader:n.documentLoader,base:n.base});o(_[0].document)&&"boolean"==typeof _[0].document["@propagate"]&&(r=_[0].document["@propagate"]);let x=e;r||x.previousContext||(x=x.clone(),x.previousContext=e);for(const r of _){let{document:s}=r;if(e=x,null===s){if(!l&&0!==Object.keys(e.protected).length)throw new i("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});x=e=b.getInitialContext(n).clone();continue}const g=r.getProcessed(e);if(g){if(w.eventHandler)for(const e of g.events)h({event:e,options:w});x=e=g.context;continue}if(o(s)&&"@context"in s&&(s=s["@context"]),!o(s))throw new i("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:s});x=x.clone();const m=new Map;if("@version"in s){if(1.1!==s["@version"])throw new i("Unsupported JSON-LD version: "+s["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:s});if(e.processingMode&&"json-ld-1.0"===e.processingMode)throw new i("@version: "+s["@version"]+" not compatible with "+e.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:s});x.processingMode="json-ld-1.1",x["@version"]=s["@version"],m.set("@version",!0)}if(x.processingMode=x.processingMode||e.processingMode,"@base"in s){let e=s["@base"];if(null===e||c(e));else{if(!u(e))throw new i('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});e=d(x["@base"],e)}x["@base"]=e,m.set("@base",!0)}if("@vocab"in s){const e=s["@vocab"];if(null===e)delete x["@vocab"];else{if(!a(e))throw new i('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});if(!c(e)&&b.processingMode(x,1))throw new i('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:s});{const t=v(x,e,{vocab:!0,base:!0},void 0,void 0,n);c(t)||n.eventHandler&&h({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:t}},options:n}),x["@vocab"]=t}}m.set("@vocab",!0)}if("@language"in s){const e=s["@language"];if(null===e)delete x["@language"];else{if(!a(e))throw new i('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});e.match(f)||n.eventHandler&&h({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:n}),x["@language"]=e.toLowerCase()}m.set("@language",!0)}if("@direction"in s){const t=s["@direction"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @direction not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:s});if(null===t)delete x["@direction"];else{if("ltr"!==t&&"rtl"!==t)throw new i('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});x["@direction"]=t}m.set("@direction",!0)}if("@propagate"in s){const n=s["@propagate"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @propagate not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:s});if("boolean"!=typeof n)throw new i("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:t});m.set("@propagate",!0)}if("@import"in s){const r=s["@import"];if("json-ld-1.0"===e.processingMode)throw new i("Invalid JSON-LD syntax; @import not compatible with "+e.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:s});if(!a(r))throw new i("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:t});const o=await n.contextResolver.resolve({activeCtx:e,context:r,documentLoader:n.documentLoader,base:n.base});if(1!==o.length)throw new i("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:t});const l=o[0].getProcessed(e);if(l)s=l;else{const n=o[0].document;if("@import"in n)throw new i("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:t});for(const e in n)s.hasOwnProperty(e)||(s[e]=n[e]);o[0].setProcessed(e,s)}m.set("@import",!0)}m.set("@protected",s["@protected"]||!1);for(const e in s)if(b.createTermDefinition({activeCtx:x,localCtx:s,term:e,defined:m,options:n,overrideProtected:l}),o(s[e])&&"@context"in s[e]){const t=s[e]["@context"];let r=!0;if(a(t)){const e=d(n.base,t);p.has(e)?r=!1:p.add(e)}if(r)try{await b.process({activeCtx:x.clone(),localCtx:s[e]["@context"],overrideProtected:!0,options:n,cycles:p})}catch(t){throw new i("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:s[e]["@context"],term:e})}}r.setProcessed(e,{context:x,events:y})}return x},b.createTermDefinition=({activeCtx:e,localCtx:t,term:n,defined:r,options:l,overrideProtected:u=!1})=>{if(r.has(n)){if(r.get(n))return;throw new i("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:t,term:n})}let d;if(r.set(n,!1),t.hasOwnProperty(n)&&(d=t[n]),"@type"===n&&o(d)&&"@set"===(d["@container"]||"@set")&&b.processingMode(e,1.1)){const e=["@container","@id","@protected"],r=Object.keys(d);if(0===r.length||r.some((t=>!e.includes(t))))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n})}else{if(b.isKeyword(n))throw new i("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:t,term:n});if(n.match(p))return void(l.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:n}},options:l}));if(""===n)throw new i("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:t})}const f=e.mappings.get(n);e.mappings.has(n)&&e.mappings.delete(n);let g=!1;if((a(d)||null===d)&&(g=!0,d={"@id":d}),!o(d))throw new i("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:t});const y={};e.mappings.set(n,y),y.reverse=!1;const m=["@container","@id","@language","@reverse","@type"];b.processingMode(e,1.1)&&m.push("@context","@direction","@index","@nest","@prefix","@protected");for(const e in d)if(!m.includes(e))throw new i("Invalid JSON-LD syntax; a term definition must not contain "+e,"jsonld.SyntaxError",{code:"invalid term definition",context:t});const _=n.indexOf(":");if(y._termHasColon=_>0,"@reverse"in d){if("@id"in d)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});if("@nest"in d)throw new i("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:t});const s=d["@reverse"];if(!a(s))throw new i("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});if(s.match(p))return l.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:s}},options:l}),void(f?e.mappings.set(n,f):e.mappings.delete(n));const o=v(e,s,{vocab:!0,base:!1},t,r,l);if(!c(o))throw new i("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});y["@id"]=o,y.reverse=!0}else if("@id"in d){let s=d["@id"];if(s&&!a(s))throw new i("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(null===s)y["@id"]=null;else{if(!b.isKeyword(s)&&s.match(p))return l.eventHandler&&h({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:s}},options:l}),void(f?e.mappings.set(n,f):e.mappings.delete(n));if(s!==n){if(s=v(e,s,{vocab:!0,base:!1},t,r,l),!c(s)&&!b.isKeyword(s))throw new i("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(/(?::[^:])|\//)&&v(e,n,{vocab:!0,base:!1},t,new Map(r).set(n,!0),l)!==s)throw new i("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t});y["@id"]=s,y._prefix=g&&!y._termHasColon&&null!==s.match(/[:\/\?#\[\]@]$/)}}}if(!("@id"in y))if(y._termHasColon){const i=n.substr(0,_);if(t.hasOwnProperty(i)&&b.createTermDefinition({activeCtx:e,localCtx:t,term:i,defined:r,options:l}),e.mappings.has(i)){const t=n.substr(_+1);y["@id"]=e.mappings.get(i)["@id"]+t}else y["@id"]=n}else if("@type"===n)y["@id"]=n;else{if(!("@vocab"in e))throw new i("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:t,term:n});y["@id"]=e["@vocab"]+n}if((!0===d["@protected"]||!0===r.get("@protected")&&!1!==d["@protected"])&&(e.protected[n]=!0,y.protected=!0),r.set(n,!0),"@type"in d){let n=d["@type"];if(!a(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if("@json"===n||"@none"===n){if(b.processingMode(e,1))throw new i(`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("@id"!==n&&"@vocab"!==n){if(n=v(e,n,{vocab:!0,base:!1},t,r,l),!c(n))throw new i("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:t});if(0===n.indexOf("_:"))throw new i("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})}y["@type"]=n}if("@container"in d){const n=a(d["@container"])?[d["@container"]]:d["@container"]||[],r=["@list","@set","@index","@language"];let o=!0;const l=n.includes("@set");if(b.processingMode(e,1.1)){if(r.push("@graph","@id","@type"),n.includes("@list")){if(1!==n.length)throw new i("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=>"@graph"!==e&&"@id"!==e&&"@index"!==e&&"@set"!==e)))throw new i("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 o&=n.length<=(l?2:1);if(n.includes("@type")&&(y["@type"]=y["@type"]||"@id",!["@id","@vocab"].includes(y["@type"])))throw new i("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:t})}else o&=!s(d["@container"]),o&=n.length<=1;if(o&=n.every((e=>r.includes(e))),o&=!(l&&n.includes("@list")),!o)throw new i("Invalid JSON-LD syntax; @context @container value must be one of the following: "+r.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:t});if(y.reverse&&!n.every((e=>["@index","@set"].includes(e))))throw new i("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});y["@container"]=n}if("@index"in d){if(!("@container"in d)||!y["@container"].includes("@index"))throw new i(`Invalid JSON-LD syntax; @index without @index in @container: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});if(!a(d["@index"])||0===d["@index"].indexOf("@"))throw new i(`Invalid JSON-LD syntax; @index must expand to an IRI: "${d["@index"]}" on term "${n}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:t});y["@index"]=d["@index"]}if("@context"in d&&(y["@context"]=d["@context"]),"@language"in d&&!("@type"in d)){let e=d["@language"];if(null!==e&&!a(e))throw new i("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:t});null!==e&&(e=e.toLowerCase()),y["@language"]=e}if("@prefix"in d){if(n.match(/:|\//))throw new i("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:t});if(b.isKeyword(y["@id"]))throw new i("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:t});if("boolean"!=typeof d["@prefix"])throw new i("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:t});y._prefix=!0===d["@prefix"]}if("@direction"in d){const e=d["@direction"];if(null!==e&&"ltr"!==e&&"rtl"!==e)throw new i('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:t});y["@direction"]=e}if("@nest"in d){const e=d["@nest"];if(!a(e)||"@nest"!==e&&0===e.indexOf("@"))throw new i("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});y["@nest"]=e}const x=y["@id"];if("@context"===x||"@preserve"===x)throw new i("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:t});if(f&&f.protected&&!u&&(e.protected[n]=!0,y.protected=!0,!w(f,y)))throw new i("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:t,term:n})},b.expandIri=(e,t,n,r)=>v(e,t,n,void 0,void 0,r),b.getInitialContext=e=>{const t=JSON.stringify({processingMode:e.processingMode}),n=m.get(t);if(n)return n;const i={processingMode:e.processingMode,mappings:new Map,inverse:null,getInverse:function(){const e=this;if(e.inverse)return e.inverse;const t=e.inverse={},n=e.fastCurieMap={},r={},i=(e["@language"]||"@none").toLowerCase(),a=e["@direction"],l=e.mappings,c=[...l.keys()].sort(y);for(const e of c){const s=l.get(e);if(null===s)continue;let c=s["@container"]||"@none";if(c=[].concat(c).sort().join(""),null===s["@id"])continue;const u=g(s["@id"]);for(const l of u){let u=t[l];const d=b.isKeyword(l);if(u)d||s._termHasColon||r[l].push(e);else if(t[l]=u={},!d&&!s._termHasColon){r[l]=[e];const t={iri:l,terms:r[l]};l[0]in n?n[l[0]].push(t):n[l[0]]=[t]}if(u[c]||(u[c]={"@language":{},"@type":{},"@any":{}}),u=u[c],o(e,u["@any"],"@none"),s.reverse)o(e,u["@type"],"@reverse");else if("@none"===s["@type"])o(e,u["@any"],"@none"),o(e,u["@language"],"@none"),o(e,u["@type"],"@none");else if("@type"in s)o(e,u["@type"],s["@type"]);else if("@language"in s&&"@direction"in s){const t=s["@language"],n=s["@direction"];o(e,u["@language"],t&&n?`${t}_${n}`.toLowerCase():t?t.toLowerCase():n?`_${n}`:"@null")}else"@language"in s?o(e,u["@language"],(s["@language"]||"@null").toLowerCase()):"@direction"in s?s["@direction"]?o(e,u["@language"],`_${s["@direction"]}`):o(e,u["@language"],"@none"):a?(o(e,u["@language"],`_${a}`),o(e,u["@language"],"@none"),o(e,u["@type"],"@none")):(o(e,u["@language"],i),o(e,u["@language"],"@none"),o(e,u["@type"],"@none"))}}for(const e in n)s(n,e,1);return t},clone:function(){const e={};return e.mappings=r.clone(this.mappings),e.clone=this.clone,e.inverse=null,e.getInverse=this.getInverse,e.protected=r.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},revertToPreviousContext:function(){return this.previousContext?this.previousContext.clone():this},protected:{}};return 1e4===m.size&&m.clear(),m.set(t,i),i;function s(e,t,n){const r=e[t],i=e[t]={};let o,a;for(const e of r)o=e.iri,a=n>=o.length?"":o[n],a in i?i[a].push(e):i[a]=[e];for(const e in i)""!==e&&s(i,e,n+1)}function o(e,t,n){t.hasOwnProperty(n)||(t[n]=e)}},b.getContextValue=(e,t,n)=>{if(null===t){if("@context"===n)return;return null}if(e.mappings.has(t)){const r=e.mappings.get(t);if(l(n))return r;if(r.hasOwnProperty(n))return r[n]}return"@language"===n&&n in e||"@direction"===n&&n in e?e[n]:"@context"!==n?null:void 0},b.processingMode=(e,t)=>t.toString()>="1.1"?!e.processingMode||e.processingMode>="json-ld-"+t.toString():"json-ld-1.0"===e.processingMode,b.isKeyword=e=>{if(!a(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}},2177:(e,t,n)=>{var r=n(1489);e.exports=function(e,t){var n;if("function"!=typeof t)throw new TypeError("Expected a function");return e=r(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}},2207:e=>{e.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}}},2246:(e,t,n)=>{const r=n(2207),{isArray:i}=n(7382),{asArray:s}=n(9263),o={};function a({event:e,handlers:t}){let n=!0;for(let s=0;n&&s<t.length;++s){n=!1;const o=t[s];if(i(o))n=a({event:e,handlers:o});else if("function"==typeof o)o({event:e,next:()=>{n=!0}});else{if("object"!=typeof o)throw new r("Invalid event handler.","jsonld.InvalidEventHandler",{event:e});e.code in o?o[e.code]({event:e,next:()=>{n=!0}}):n=!0}}return n}e.exports=o,o.defaultEventHandler=null,o.setupEventHandler=({options:e={}})=>{const t=[].concat(e.safe?o.safeEventHandler:[],e.eventHandler?s(e.eventHandler):[],o.defaultEventHandler?o.defaultEventHandler:[]);return 0===t.length?null:t},o.handleEvent=({event:e,options:t})=>{a({event:e,handlers:t.eventHandler})};const l=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"]);o.safeEventHandler=function({event:e,next:t}){if("warning"===e.level&&l.has(e.code))throw new r("Safe mode validation error.","jsonld.ValidationError",{event:e});t()},o.logEventHandler=function({event:e,next:t}){console.log(`EVENT: ${e.message}`,{event:e}),t()},o.logWarningEventHandler=function({event:e,next:t}){"warning"===e.level&&console.warn(`WARNING: ${e.message}`,{event:e}),t()},o.unhandledEventHandler=function({event:e}){throw new r("No handler for event.","jsonld.UnhandledEvent",{event:e})},o.setDefaultEventHandler=function({eventHandler:e}={}){o.defaultEventHandler=e?s(e):null}},2341:e=>{e.exports=function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,n,r)=>t+(0===r?"":",")+e(void 0===n||"symbol"==typeof n?null:n)),"")+"]":"{"+Object.keys(t).sort().reduce(((n,r,i)=>void 0===t[r]||"symbol"==typeof t[r]?n:n+(0===n.length?"":",")+e(r)+":"+e(t[r])),"")+"}"}},2406:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberDouble=void 0;const r=n(103);class i{fromRdf(e,t){const n=parseFloat(e.value);return t&&isNaN(n)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return t=t||n.namedNode(i.TYPES[0]),isNaN(e)?n.literal("NaN",t):isFinite(e)?e%1==0?null:n.literal(e.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),t):n.literal(e>0?"INF":"-INF",t)}}t.TypeHandlerNumberDouble=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"]},2438:(e,t,n)=>{const r=n(2985),i=n(3751),s=n(9925),o=n(1227);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=()=>new i("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];for(const e of n)this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const i=[...t.keys()].sort(),s=[];for(const e of i){const n=t.get(e);if(n.length>1){s.push(n);continue}const r=n[0];this.canonicalIssuer.getId(r)}for(const e of s){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new r("_:b");e.getId(n);const i=this.hashNDegreeQuads(n,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const l=[];for(const e of this.quads){const t=o.serializeQuadComponents(this._componentWithCanonicalId({component:e.subject}),e.predicate,this._componentWithCanonicalId({component:e.object}),this._componentWithCanonicalId({component:e.graph}));l.push(t)}return l.sort(),l.join("")}hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const n of r){const r={subject:null,predicate:n.predicate,object:null,graph:null};r.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),r.object=this.modifyFirstDegreeComponent(e,n.object,"object"),r.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(o.serializeQuad(r))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=i.digest(),n.hash}hashRelatedBlankNode(e,t,n,r){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const s=this.createMessageDigest();return s.update(r),"g"!==r&&s.update(this.getRelatedPredicate(t)),s.update(i),s.digest()}hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const r=this.createMessageDigest(),i=this.createHashToRelated(e,t),o=[...i.keys()].sort();for(const e of o){r.update(e);let n,o="";const a=new s(i.get(e));for(;a.hasNext();){const e=a.next();let r=t.clone(),i="";const s=[];let l=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(r.hasId(t)||s.push(t),i+=r.getId(t)),0!==o.length&&i>o){l=!0;break}if(!l){for(const e of s){const t=this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==o.length&&i>o){l=!0;break}}l||(0===o.length||i<o)&&(o=i,n=r)}}r.update(o),t=n}return{hash:r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;for(const 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}){const n=this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const 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:s}){if("BlankNode"!==t.termType||t.value===r)return;const o=t.value,a=this.hashRelatedBlankNode(o,e,i,n),l=s.get(a);l?l.push(o):s.set(a,[o])}_componentWithCanonicalId({component:e}){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}}},2552:(e,t,n)=>{var r=n(1873),i=n(659),s=n(9350),o=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":o&&o in Object(e)?i(e):s(e)}},2791:function(e,t,n){!function(e){if(!e.setImmediate){var t,n,r,i,s,o=1,a={},l=!1,c=e.document,u=Object.getPrototypeOf&&Object.getPrototypeOf(e);u=u&&u.setTimeout?u:e,"[object process]"==={}.toString.call(e.process)?t=function(e){process.nextTick((function(){h(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(i="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(i)&&h(+t.data.slice(i.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),t=function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((r=new MessageChannel).port1.onmessage=function(e){h(e.data)},t=function(e){r.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(n=c.documentElement,t=function(e){var t=c.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,n.removeChild(t),t=null},n.appendChild(t)}):t=function(e){setTimeout(h,0,e)},u.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var n=new Array(arguments.length-1),r=0;r<n.length;r++)n[r]=arguments[r+1];var i={callback:e,args:n};return a[o]=i,t(o),o++},u.clearImmediate=d}function d(e){delete a[e]}function h(e){if(l)setTimeout(h,0,e);else{var t=a[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{d(e),l=!1}}}}}("undefined"==typeof self?void 0===n.g?this:n.g:self)},2946:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Quad=void 0,t.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&&("Quad"===e.termType||!e.termType)&&this.subject.equals(e.subject)&&this.predicate.equals(e.predicate)&&this.object.equals(e.object)&&this.graph.equals(e.graph)}}},2985:e=>{e.exports=class e{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:t,_existing:n,counter:r}=this;return new e(t,new Map(n),r)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}},3067:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BlankNode=void 0,t.BlankNode=class{constructor(e){this.termType="BlankNode",this.value=e}equals(e){return!!e&&"BlankNode"===e.termType&&e.value===this.value}}},3095:(e,t,n)=>{const{ArrayPrototypePop:r,Promise:i}=n(4134),{isIterable:s,isNodeStream:o,isWebStream:a}=n(6115),{pipelineImpl:l}=n(7758),{finished:c}=n(6238);n(5506),e.exports={finished:c,pipeline:function(...e){return new i(((t,n)=>{let i,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!o(u)&&!s(u)&&!a(u)){const t=r(e);i=t.signal,c=t.end}l(e,((e,r)=>{e?n(e):t(r)}),{signal:i,end:c})}))}}},3141:(e,t,n)=>{var r=n(5003).Buffer,i=r.isEncoding||function(e){switch((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 s(e){var t;switch(this.encoding=function(e){var t=function(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}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=d,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}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 a(e){var t=this.lastTotal-this.lastNeed,n=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(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 c(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 u(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?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 d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.StringDecoder=s,s.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))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||""},s.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},s.prototype.text=function(e,t){var n=function(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||-2===i?0:(i=o(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n||-2===i?0:(i=o(t[r]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(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)},s.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}},3370:(e,t,n)=>{const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:s,ObjectSetPrototypeOf:o}=n(4134);e.exports=c;const a=n(7576),l=n(8584);o(c.prototype,a.prototype),o(c,a);{const e=s(l.prototype);for(let t=0;t<e.length;t++){const n=e[t];c.prototype[n]||(c.prototype[n]=l.prototype[n])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let u,d;function h(){return void 0===u&&(u={}),u}r(c.prototype,{writable:{__proto__:null,...i(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(l.prototype,"writableLength")},writableFinished:{__proto__:null,...i(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return d||(d=n(6706)),d(e,"body")}},3476:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NamedNode=void 0,t.NamedNode=class{constructor(e){this.termType="NamedNode",this.value=e}equals(e){return!!e&&"NamedNode"===e.termType&&e.value===this.value}}},3513:(e,t,n)=>{const r=n(2985),i=n(3751),s=n(9925),o=n(1227);function a(e,t){return e.hash<t.hash?-1:e.hash>t.hash?1:0}e.exports=class{constructor({createMessageDigest:e=()=>new i("sha256"),canonicalIdMap:t=new Map,maxDeepIterations:n=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",t),this.createMessageDigest=e,this.maxDeepIterations=n,this.quads=null,this.deepIterations=null}async main(e){this.deepIterations=new Map,this.quads=e;for(const t of e)this._addBlankNodeQuadInfo({quad:t,component:t.subject}),this._addBlankNodeQuadInfo({quad:t,component:t.object}),this._addBlankNodeQuadInfo({quad:t,component:t.graph});const t=new Map,n=[...this.blankNodeInfo.keys()];let i=0;for(const e of n)++i%100==0&&await this._yield(),await this._hashAndTrackBlankNode({id:e,hashToBlankNodes:t});const s=[...t.keys()].sort(),l=[];for(const e of s){const n=t.get(e);if(n.length>1){l.push(n);continue}const r=n[0];this.canonicalIssuer.getId(r)}for(const e of l){const t=[];for(const n of e){if(this.canonicalIssuer.hasId(n))continue;const e=new r("_:b");e.getId(n);const i=await this.hashNDegreeQuads(n,e);t.push(i)}t.sort(a);for(const e of t){const t=e.issuer.getOldIds();for(const e of t)this.canonicalIssuer.getId(e)}}const c=[];for(const e of this.quads){const t=o.serializeQuadComponents(this._componentWithCanonicalId(e.subject),e.predicate,this._componentWithCanonicalId(e.object),this._componentWithCanonicalId(e.graph));c.push(t)}return c.sort(),c.join("")}async hashFirstDegreeQuads(e){const t=[],n=this.blankNodeInfo.get(e),r=n.quads;for(const n of r){const r={subject:null,predicate:n.predicate,object:null,graph:null};r.subject=this.modifyFirstDegreeComponent(e,n.subject,"subject"),r.object=this.modifyFirstDegreeComponent(e,n.object,"object"),r.graph=this.modifyFirstDegreeComponent(e,n.graph,"graph"),t.push(o.serializeQuad(r))}t.sort();const i=this.createMessageDigest();for(const e of t)i.update(e);return n.hash=await i.digest(),n.hash}async hashRelatedBlankNode(e,t,n,r){let i;i=this.canonicalIssuer.hasId(e)?this.canonicalIssuer.getId(e):n.hasId(e)?n.getId(e):this.blankNodeInfo.get(e).hash;const s=this.createMessageDigest();return s.update(r),"g"!==r&&s.update(this.getRelatedPredicate(t)),s.update(i),s.digest()}async hashNDegreeQuads(e,t){const n=this.deepIterations.get(e)||0;if(n>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(e,n+1);const r=this.createMessageDigest(),i=await this.createHashToRelated(e,t),o=[...i.keys()].sort();for(const e of o){r.update(e);let n,o="";const a=new s(i.get(e));let l=0;for(;a.hasNext();){const e=a.next();++l%3==0&&await this._yield();let r=t.clone(),i="";const s=[];let c=!1;for(const t of e)if(this.canonicalIssuer.hasId(t)?i+=this.canonicalIssuer.getId(t):(r.hasId(t)||s.push(t),i+=r.getId(t)),0!==o.length&&i>o){c=!0;break}if(!c){for(const e of s){const t=await this.hashNDegreeQuads(e,r);if(i+=r.getId(e),i+=`<${t.hash}>`,r=t.issuer,0!==o.length&&i>o){c=!0;break}}c||(0===o.length||i<o)&&(o=i,n=r)}}r.update(o),t=n}return{hash:await r.digest(),issuer:t}}modifyFirstDegreeComponent(e,t){return"BlankNode"!==t.termType?t:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return`<${e.predicate.value}>`}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let i=0;for(const s of r)++i%100==0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:s,component:s.subject,position:"s",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:s,component:s.object,position:"o",id:e,issuer:t,hashToRelated:n}),this._addRelatedBlankNodeHash({quad:s,component:s.graph,position:"g",id:e,issuer:t,hashToRelated:n})]);return n}async _hashAndTrackBlankNode({id:e,hashToBlankNodes:t}){const n=await this.hashFirstDegreeQuads(e),r=t.get(n);r?r.push(e):t.set(n,[e])}_addBlankNodeQuadInfo({quad:e,component:t}){if("BlankNode"!==t.termType)return;const 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:s}){if("BlankNode"!==t.termType||t.value===r)return;const o=t.value,a=await this.hashRelatedBlankNode(o,e,i,n),l=s.get(a);l?l.push(o):s.set(a,[o])}_componentWithCanonicalId(e){return"BlankNode"!==e.termType||e.value.startsWith(this.canonicalIssuer.prefix)?e:{termType:"BlankNode",value:this.canonicalIssuer.getId(e.value)}}async _yield(){return new Promise((e=>setImmediate(e)))}}},3617:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(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){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(3067),t),i(n(8339),t),i(n(4878),t),i(n(458),t),i(n(3476),t),i(n(2946),t),i(n(7265),t)},3743:e=>{e.exports=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}},3751:(e,t,n)=>{n(2791);const r=self.crypto||self.msCrypto;e.exports=class{constructor(e){if(!r||!r.subtle)throw new Error("crypto.subtle not found.");if("sha256"===e)this.algorithm={name:"SHA-256"};else{if("sha1"!==e)throw new Error(`Unsupported algorithm "${e}".`);this.algorithm={name:"SHA-1"}}this._content=""}update(e){this._content+=e}async digest(){const e=(new TextEncoder).encode(this._content),t=new Uint8Array(await r.subtle.digest(this.algorithm,e));let n="";for(let e=0;e<t.length;++e)n+=t[e].toString(16).padStart(2,"0");return n}}},3805:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},3845:(e,t,n)=>{const r=n(3751),i=n(3513);e.exports=class extends i{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(e,t,n){return"BlankNode"!==t.termType?t:"graph"===n?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:t.value===e?"_:a":"_:z"}}getRelatedPredicate(e){return e.predicate.value}async createHashToRelated(e,t){const n=new Map,r=this.blankNodeInfo.get(e).quads;let i=0;for(const s of r){let r,o;if("BlankNode"===s.subject.termType&&s.subject.value!==e)o=s.subject.value,r="p";else{if("BlankNode"!==s.object.termType||s.object.value===e)continue;o=s.object.value,r="r"}++i%100==0&&await this._yield();const a=await this.hashRelatedBlankNode(o,s,t,r),l=n.get(a);l?l.push(o):n.set(a,[o])}return n}}},3947:(e,t,n)=>{const r=n(2207),i=n(3978),s=n(7382),{REGEX_BCP47:o,addValue:a}=n(9263),{handleEvent:l}=n(2246),{RDF_LIST:c,RDF_FIRST:u,RDF_REST:d,RDF_NIL:h,RDF_TYPE:f,RDF_JSON_LITERAL:p,XSD_BOOLEAN:g,XSD_DOUBLE:y,XSD_INTEGER:m,XSD_STRING:b}=n(9378),v={};function w(e,t,n,i){if(e.termType.endsWith("Node"))return{"@id":e.value};const a={"@value":e.value};if(e.language)e.language.match(o)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e.language}},options:i}),a["@language"]=e.language;else{let c=e.datatype.value;if(c||(c=b),c===p){c="@json";try{a["@value"]=JSON.parse(a["@value"])}catch(e){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:a["@value"],cause:e})}}if(t){if(c===g)"true"===a["@value"]?a["@value"]=!0:"false"===a["@value"]&&(a["@value"]=!1);else if(s.isNumeric(a["@value"]))if(c===m){const e=parseInt(a["@value"],10);e.toFixed(0)===a["@value"]&&(a["@value"]=e)}else c===y&&(a["@value"]=parseFloat(a["@value"]));[g,m,y,b].includes(c)||(a["@type"]=c)}else if("i18n-datatype"===n&&c.startsWith("https://www.w3.org/ns/i18n#")){const[,e,t]=c.split(/[#_]/);e.length>0&&(a["@language"]=e,e.match(o)||i.eventHandler&&l({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:i})),a["@direction"]=t}else c!==b&&(a["@type"]=c)}return a}e.exports=v,v.fromRDF=async(e,t)=>{const{useRdfType:n=!1,useNativeTypes:o=!1,rdfDirection:l=null}=t,p={},g={"@default":p},y={};if(l){if("compound-literal"===l)throw new r("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:l});if("i18n-datatype"!==l)throw new r("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:l})}for(const r of e){const e="DefaultGraph"===r.graph.termType?"@default":r.graph.value;e in g||(g[e]={}),"@default"===e||e in p||(p[e]={"@id":e});const i=g[e],s=r.subject.value,c=r.predicate.value,u=r.object;s in i||(i[s]={"@id":s});const d=i[s],m=u.termType.endsWith("Node");if(m&&!(u.value in i)&&(i[u.value]={"@id":u.value}),c===f&&!n&&m){a(d,"@type",u.value,{propertyIsArray:!0});continue}const b=w(u,o,l,t);if(a(d,c,b,{propertyIsArray:!0}),m)if(u.value===h){const e=i[u.value];"usages"in e||(e.usages=[]),e.usages.push({node:d,property:c,value:b})}else u.value in y?y[u.value]=!1:y[u.value]={node:d,property:c,value:b}}for(const e in g){const t=g[e];if(!(h in t))continue;const n=t[h];if(n.usages){for(let e of n.usages){let n=e.node,r=e.property,o=e.value;const a=[],l=[];let h=Object.keys(n).length;for(;r===d&&s.isObject(y[n["@id"]])&&s.isArray(n[u])&&1===n[u].length&&s.isArray(n[d])&&1===n[d].length&&(3===h||4===h&&s.isArray(n["@type"])&&1===n["@type"].length&&n["@type"][0]===c)&&(a.push(n[u][0]),l.push(n["@id"]),e=y[n["@id"]],n=e.node,r=e.property,o=e.value,h=Object.keys(n).length,i.isBlankNode(n)););delete o["@id"],o["@list"]=a.reverse();for(const e of l)delete t[e]}delete n.usages}}const m=[],b=Object.keys(p).sort();for(const e of b){const t=p[e];if(e in g){const n=t["@graph"]=[],r=g[e],s=Object.keys(r).sort();for(const e of s){const t=r[e];i.isSubjectReference(t)||n.push(t)}}i.isSubjectReference(t)||m.push(t)}return m}},3978:(e,t,n)=>{const r=n(7382),i={};e.exports=i,i.isSubject=e=>!(!r.isObject(e)||"@value"in e||"@set"in e||"@list"in e)&&(Object.keys(e).length>1||!("@id"in e)),i.isSubjectReference=e=>r.isObject(e)&&1===Object.keys(e).length&&"@id"in e,i.isValue=e=>r.isObject(e)&&"@value"in e,i.isList=e=>r.isObject(e)&&"@list"in e,i.isGraph=e=>r.isObject(e)&&"@graph"in e&&1===Object.keys(e).filter((e=>"@id"!==e&&"@index"!==e)).length,i.isSimpleGraph=e=>i.isGraph(e)&&!("@id"in e),i.isBlankNode=e=>{if(r.isObject(e)){if("@id"in e){const t=e["@id"];return!r.isString(t)||0===t.indexOf("_:")}return 0===Object.keys(e).length||!("@value"in e||"@set"in e||"@list"in e)}return!1}},4005:(e,t,n)=>{const r=n(3513),i=n(3845),s=n(2438),o=n(378);let a;try{a=n(7789)}catch(e){}function l(e){return Array.isArray(e)?e:t.NQuads.legacyDatasetToQuads(e)}t.NQuads=n(1227),t.IdentifierIssuer=n(2985),t._rdfCanonizeNative=function(e){return e&&(a=e),a},t.canonize=async function(e,t){const n=l(e);if(t.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise(((e,r)=>a.canonize(n,t,((t,n)=>t?r(t):e(n)))))}if("URDNA2015"===t.algorithm)return new r(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)},t._canonizeSync=function(e,t){const n=l(e);if(t.useNative){if(!a)throw new Error("rdf-canonize-native not available");if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return a.canonizeSync(n,t)}if("URDNA2015"===t.algorithm)return new s(t).main(n);if("URGNA2012"===t.algorithm){if(t.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new o(t).main(n)}if(!("algorithm"in t))throw new Error("No RDF Dataset Canonicalization algorithm specified.");throw new Error("Invalid RDF Dataset Canonicalization algorithm: "+t.algorithm)}},4019:(e,t,n)=>{const r=n(2207),{isArray:i,isObject:s,isEmptyObject:o,isString:a,isUndefined:l}=n(7382),{isList:c,isValue:u,isGraph:d,isSubject:h}=n(3978),{expandIri:f,getContextValue:p,isKeyword:g,process:y,processingMode:m}=n(1972),{isAbsolute:b}=n(470),{REGEX_BCP47:v,REGEX_KEYWORD:w,addValue:_,asArray:x,getValues:S,validateTypeValue:j}=n(9263),{handleEvent:I}=n(2246),E={};function N({value:e,count:t,options:n}){if(0===t||"@value"in e||"@list"in e||1===t&&"@id"in e){if(n.eventHandler){let r,i;0===t?(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."):1===t&&"@id"in e&&(r="object with only @id",i="Dropping object with only @id."),I({event:{type:["JsonLdEvent"],code:r,level:"warning",message:i,details:{value:e}},options:n})}return null}return e}async function T({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:d,expandedParent:w,options:S={},insideList:R,typeKey:L,typeScopedContext:A}){const C=Object.keys(d).sort(),D=[];let M;const P=d[L]&&"@json"===f(e,i(d[L])?d[L][0]:d[L],{vocab:!0},{...S,typeExpansion:!0});for(const T of C){let R,L=d[T];if("@context"===T)continue;const C=f(e,T,{vocab:!0},S);if(null===C||!b(C)&&!g(C)){S.eventHandler&&I({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:T,expandedProperty:C}},options:S});continue}if(g(C)){if("@reverse"===n)throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:L});if(C in w&&"@included"!==C&&"@type"!==C)throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:C})}if("@id"===C){if(!a(L)){if(!S.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(s(L)){if(!o(L))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}else{if(!i(L))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L});if(!L.every((e=>a(e))))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:L})}}_(w,"@id",x(L).map((t=>{if(a(t)){const n=f(e,t,{base:!0},S);return S.eventHandler&&(null===n?I(null===t?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:t}},options:S}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:S}):b(n)||I({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:t,expandedId:n}},options:S})),n}return t})),{propertyIsArray:S.isFrame});continue}if("@type"===C){s(L)&&(L=Object.fromEntries(Object.entries(L).map((([e,t])=>[f(A,e,{vocab:!0}),x(t).map((e=>f(A,e,{base:!0,vocab:!0},{...S,typeExpansion:!0})))])))),j(L,S.isFrame),_(w,"@type",x(L).map((e=>{if(a(e)){const t=f(A,e,{base:!0,vocab:!0},{...S,typeExpansion:!0});return"@json"===t||b(t)||S.eventHandler&&I({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:e}},options:S}),t}return e})),{propertyIsArray:!!S.isFrame});continue}if("@included"===C&&m(e,1.1)){const n=x(await E.expand({activeCtx:e,activeProperty:t,element:L,options:S}));if(!n.every((e=>h(e))))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:L});_(w,"@included",n,{propertyIsArray:!0});continue}if("@graph"===C&&!s(L)&&!i(L))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:L});if("@value"===C){M=L,P&&m(e,1.1)?w["@value"]=L:_(w,"@value",L,{propertyIsArray:S.isFrame});continue}if("@language"===C){if(null===L)continue;if(!a(L)&&!S.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:L});L=x(L).map((e=>a(e)?e.toLowerCase():e));for(const e of L)a(e)&&!e.match(v)&&S.eventHandler&&I({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:e}},options:S});_(w,"@language",L,{propertyIsArray:S.isFrame});continue}if("@direction"===C){if(!a(L)&&!S.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:L});L=x(L);for(const e of L)if(a(e)&&"ltr"!==e&&"rtl"!==e)throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:L});_(w,"@direction",L,{propertyIsArray:S.isFrame});continue}if("@index"===C){if(!a(L))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:L});_(w,"@index",L);continue}if("@reverse"===C){if(!s(L))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:L});if(R=await E.expand({activeCtx:e,activeProperty:"@reverse",element:L,options:S}),"@reverse"in R)for(const e in R["@reverse"])_(w,e,R["@reverse"][e],{propertyIsArray:!0});let t=w["@reverse"]||null;for(const e in R){if("@reverse"===e)continue;null===t&&(t=w["@reverse"]={}),_(t,e,[],{propertyIsArray:!0});const n=R[e];for(let i=0;i<n.length;++i){const s=n[i];if(u(s)||c(s))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});_(t,e,s,{propertyIsArray:!0})}}continue}if("@nest"===C){D.push(T);continue}let $=e;const B=p(e,T,"@context");l(B)||($=await y({activeCtx:e,localCtx:B,propagate:!0,overrideProtected:!0,options:S}));const F=p(e,T,"@container")||[];if(F.includes("@language")&&s(L))R=O($,L,p($,T,"@direction"),S);else if(F.includes("@index")&&s(L)){const t=F.includes("@graph"),n=p($,T,"@index")||"@index",r="@index"!==n&&f(e,n,{vocab:!0},S);R=await k({activeCtx:$,options:S,activeProperty:T,value:L,asGraph:t,indexKey:n,propertyIndex:r})}else if(F.includes("@id")&&s(L)){const e=F.includes("@graph");R=await k({activeCtx:$,options:S,activeProperty:T,value:L,asGraph:e,indexKey:"@id"})}else if(F.includes("@type")&&s(L))R=await k({activeCtx:$.revertToPreviousContext(),options:S,activeProperty:T,value:L,asGraph:!1,indexKey:"@type"});else{const r="@list"===C;if(r||"@set"===C){let e=t;r&&"@graph"===n&&(e=null),R=await E.expand({activeCtx:$,activeProperty:e,element:L,options:S,insideList:r})}else R="@json"===p(e,T,"@type")?{"@type":"@json","@value":L}:await E.expand({activeCtx:$,activeProperty:T,element:L,options:S,insideList:!1})}if(null!==R||"@value"===C){if("@list"!==C&&!c(R)&&F.includes("@list")&&(R={"@list":x(R)}),F.includes("@graph")&&!F.some((e=>"@id"===e||"@index"===e))){if(R=x(R),S.isFrame||(R=R.filter((e=>null!==N({value:e,count:Object.keys(e).length,options:S})))),0===R.length)continue;R=R.map((e=>({"@graph":x(e)})))}if($.mappings.has(T)&&$.mappings.get(T).reverse){const e=w["@reverse"]=w["@reverse"]||{};R=x(R);for(let t=0;t<R.length;++t){const n=R[t];if(u(n)||c(n))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:R});_(e,C,n,{propertyIsArray:!0})}}else _(w,C,R,{propertyIsArray:!0})}}if("@value"in w)if("@json"===w["@type"]&&m(e,1.1));else if((s(M)||i(M))&&!S.isFrame)throw new r('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:M});for(const o of D){const a=i(d[o])?d[o]:[d[o]];for(const i of a){if(!s(i)||Object.keys(i).some((t=>"@value"===f(e,t,{vocab:!0},S))))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:i});await T({activeCtx:e,activeProperty:t,expandedActiveProperty:n,element:i,expandedParent:w,options:S,insideList:R,typeScopedContext:A,typeKey:L})}}}function R({activeCtx:e,activeProperty:t,value:n,options:r}){if(null==n)return null;const i=f(e,t,{vocab:!0},r);if("@id"===i)return f(e,n,{base:!0},r);if("@type"===i)return f(e,n,{vocab:!0,base:!0},{...r,typeExpansion:!0});const s=p(e,t,"@type");if(("@id"===s||"@graph"===i)&&a(n)){const i=f(e,n,{base:!0},r);return null===i&&n.match(w)&&r.eventHandler&&I({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:t}},options:r}),{"@id":i}}if("@vocab"===s&&a(n))return{"@id":f(e,n,{vocab:!0,base:!0},r)};if(g(i))return n;const o={};if(s&&!["@id","@vocab","@none"].includes(s))o["@type"]=s;else if(a(n)){const n=p(e,t,"@language");null!==n&&(o["@language"]=n);const r=p(e,t,"@direction");null!==r&&(o["@direction"]=r)}return["boolean","number","string"].includes(typeof n)||(n=n.toString()),o["@value"]=n,o}function O(e,t,n,s){const o=[],l=Object.keys(t).sort();for(const c of l){const l=f(e,c,{vocab:!0},s);let u=t[c];i(u)||(u=[u]);for(const e of u){if(null===e)continue;if(!a(e))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:t});const i={"@value":e};"@none"!==l&&(c.match(v)||s.eventHandler&&I({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:c}},options:s}),i["@language"]=c.toLowerCase()),n&&(i["@direction"]=n),o.push(i)}}return o}async function k({activeCtx:e,options:t,activeProperty:n,value:s,asGraph:o,indexKey:a,propertyIndex:c}){const h=[],g=Object.keys(s).sort(),m="@type"===a;for(let b of g){if(m){const n=p(e,b,"@context");l(n)||(e=await y({activeCtx:e,localCtx:n,propagate:!1,options:t}))}let g,v=s[b];i(v)||(v=[v]),v=await E.expand({activeCtx:e,activeProperty:n,element:v,options:t,insideList:!1,insideIndex:!0}),g=c?"@none"===b?"@none":R({activeCtx:e,activeProperty:a,value:b,options:t}):f(e,b,{vocab:!0},t),"@id"===a?b=f(e,b,{base:!0},t):m&&(b=g);for(let e of v){if(o&&!d(e)&&(e={"@graph":[e]}),"@type"===a)"@none"===g||(e["@type"]?e["@type"]=[b].concat(e["@type"]):e["@type"]=[b]);else{if(u(e)&&!["@language","@type","@index"].includes(a))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${a}".`,"jsonld.SyntaxError",{code:"invalid value object",value:e});c?"@none"!==g&&_(e,c,g,{propertyIsArray:!0,prependValue:!0}):"@none"===g||a in e||(e[a]=b)}h.push(e)}}return h}e.exports=E,E.expand=async({activeCtx:e,activeProperty:t=null,element:n,options:c={},insideList:u=!1,insideIndex:d=!1,typeScopedContext:h=null})=>{if(null==n)return null;if("@default"===t&&(c=Object.assign({},c,{isFrame:!1})),!i(n)&&!s(n))return u||null!==t&&"@graph"!==f(e,t,{vocab:!0},c)?R({activeCtx:e,activeProperty:t,value:n,options:c}):(c.eventHandler&&I({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:n}},options:c}),null);if(i(n)){let r=[];const s=p(e,t,"@container")||[];u=u||s.includes("@list");for(let s=0;s<n.length;++s){let o=await E.expand({activeCtx:e,activeProperty:t,element:n[s],options:c,insideIndex:d,typeScopedContext:h});u&&i(o)&&(o={"@list":o}),null!==o&&(i(o)?r=r.concat(o):r.push(o))}return r}const g=f(e,t,{vocab:!0},c),v=p(e,t,"@context");h=h||(e.previousContext?e:null);let w=Object.keys(n).sort(),_=!d;if(_&&h&&w.length<=2&&!w.includes("@context"))for(const t of w){const n=f(h,t,{vocab:!0},c);if("@value"===n){_=!1,e=h;break}if("@id"===n&&1===w.length){_=!1;break}}_&&(e=e.revertToPreviousContext()),l(v)||(e=await y({activeCtx:e,localCtx:v,propagate:!0,overrideProtected:!0,options:c})),"@context"in n&&(e=await y({activeCtx:e,localCtx:n["@context"],options:c})),h=e;let j=null;for(const t of w)if("@type"===f(e,t,{vocab:!0},c)){j=j||t;const r=n[t],i=Array.isArray(r)?r.length>1?r.slice().sort():r:[r];for(const t of i){const n=p(h,t,"@context");l(n)||(e=await y({activeCtx:e,localCtx:n,options:c,propagate:!1}))}}let O={};await T({activeCtx:e,activeProperty:t,expandedActiveProperty:g,element:n,expandedParent:O,options:c,insideList:u,typeKey:j,typeScopedContext:h}),w=Object.keys(O);let k=w.length;if("@value"in O){if("@type"in O&&("@language"in O||"@direction"in O))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:O});let t=k-1;if("@type"in O&&(t-=1),"@index"in O&&(t-=1),"@language"in O&&(t-=1),"@direction"in O&&(t-=1),0!==t)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:O});const n=null===O["@value"]?[]:x(O["@value"]),i=S(O,"@type");if(m(e,1.1)&&i.includes("@json")&&1===i.length);else if(0===n.length)c.eventHandler&&I({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:O}},options:c}),O=null;else{if(!n.every((e=>a(e)||o(e)))&&"@language"in O)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:O});if(!i.every((e=>b(e)&&!(a(e)&&0===e.indexOf("_:"))||o(e))))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:O})}}else if("@type"in O&&!i(O["@type"]))O["@type"]=[O["@type"]];else if("@set"in O||"@list"in O){if(k>1&&(2!==k||!("@index"in O)))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:O});"@set"in O&&(O=O["@set"],w=Object.keys(O),k=w.length)}else 1===k&&"@language"in O&&(c.eventHandler&&I({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:O}},options:c}),O=null);return!s(O)||c.keepFreeFloatingNodes||u||null!==t&&"@graph"!==g&&!(p(e,t,"@container")||[]).includes("@graph")||(O=N({value:O,count:k,options:c})),O}},4128:(e,t,n)=>{var r=n(1800),i=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(i,""):e}},4134:e=>{e.exports={ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,n)=>e.slice(t,n),Error,FunctionPrototypeCall:(e,t,...n)=>e.call(t,...n),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,n)=>Object.defineProperty(e,t,n),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,n)=>e.then(t,n),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,n)=>e.slice(t,n),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>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)=>e.set(t,n),Boolean,Uint8Array}},4147:(e,t,n)=>{const{SymbolDispose:r}=n(4134),{AbortError:i,codes:s}=n(6371),{isNodeStream:o,isWebStream:a,kControllerErrorFunction:l}=n(6115),c=n(6238),{ERR_INVALID_ARG_TYPE:u}=s;let d;e.exports.addAbortSignal=function(t,n){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!o(n)&&!a(n))throw new u("stream",["ReadableStream","WritableStream","Stream"],n);return e.exports.addAbortSignalNoValidate(t,n)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const s=o(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[l](new i(void 0,{cause:e.reason}))};if(e.aborted)s();else{d=d||n(7760).addAbortListener;const i=d(e,s);c(t,i[r])}return t}},4191:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerString=void 0;class n{fromRdf(e){return e.value}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(e,t)}}t.TypeHandlerString=n,n.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"]},4259:(e,t,n)=>{const{ArrayIsArray:r,ObjectSetPrototypeOf:i}=n(4134),{EventEmitter:s}=n(7007);function o(e){s.call(this,e)}function a(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}i(o.prototype,s.prototype),i(o,s),o.prototype.pipe=function(e,t){const n=this;function r(t){e.writable&&!1===e.write(t)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),e.on("drain",i),e._isStdio||t&&!1===t.end||(n.on("end",l),n.on("close",c));let o=!1;function l(){o||(o=!0,e.end())}function c(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){d(),0===s.listenerCount(this,"error")&&this.emit("error",e)}function d(){n.removeListener("data",r),e.removeListener("drain",i),n.removeListener("end",l),n.removeListener("close",c),n.removeListener("error",u),e.removeListener("error",u),n.removeListener("end",d),n.removeListener("close",d),e.removeListener("close",d)}return a(n,"error",u),a(e,"error",u),n.on("end",d),n.on("close",d),e.on("close",d),e.emit("pipe",n),e},e.exports={Stream:o,prependListener:a}},4394:(e,t,n)=>{var r=n(2552),i=n(346);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==r(e)}},4802:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(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){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),i(n(92),t),i(n(7258),t),i(n(2406),t),i(n(6925),t),i(n(4191),t)},4840:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},4841:(e,t,n)=>{const r=n(989),i=n(701),s=n(9263),o=n(7034),a=s.IdentifierIssuer,l=n(2207),c=n(9749),u=n(8229),{expand:d}=n(4019),{flatten:h}=n(5229),{fromRDF:f}=n(3947),{toRDF:p}=n(9180),{frameMergedOrDefault:g,cleanupNull:y}=n(7946),{isArray:m,isObject:b,isString:v}=n(7382),{isSubjectReference:w}=n(3978),{expandIri:_,getInitialContext:x,process:S,processingMode:j}=n(1972),{compact:I,compactIri:E}=n(1058),{createNodeMap:N,createMergedNodeMap:T,mergeNodeMaps:R}=n(9233),{logEventHandler:O,logWarningEventHandler:k,safeEventHandler:L,setDefaultEventHandler:A,setupEventHandler:C,strictEventHandler:D,unhandledEventHandler:M}=n(2246),P=function(e){const t={},P=new c({max:100});function $(t,{documentLoader:n=e.documentLoader,...r}){if(t&&"compactionMap"in t)throw new l('"compactionMap" not supported.',"jsonld.OptionsError");if(t&&"expansionMap"in t)throw new l('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:n},r,t,{eventHandler:C({options:t})})}return e.compact=async function(t,n,r){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(null===n)throw new l("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(null===t)return null;let i;(r=$(r,{base:v(t)?t:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new a("_:b"),contextResolver:new o({sharedCache:P})})).link&&(r.skipExpansion=!0),r.compactToRelative||delete r.base,i=r.skipExpansion?t:await e.expand(t,r);const c=await e.processContext(x(r),n,r);let u=await I({activeCtx:c,element:i,options:r});r.compactArrays&&!r.graph&&m(u)?1===u.length?u=u[0]:0===u.length&&(u={}):r.graph&&b(u)&&(u=[u]),b(n)&&"@context"in n&&(n=n["@context"]),n=s.clone(n),m(n)||(n=[n]);const d=n;n=[];for(let e=0;e<d.length;++e)(!b(d[e])||Object.keys(d[e]).length>0)&&n.push(d[e]);const h=n.length>0;if(1===n.length&&(n=n[0]),m(u)){const e=E({activeCtx:c,iri:"@graph",relativeTo:{vocab:!0}}),t=u;u={},h&&(u["@context"]=n),u[e]=t}else if(b(u)&&h){const e=u;u={"@context":n};for(const t in e)u[t]=e[t]}return u},e.expand=async function(t,n){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");const r={},i=[];if("expandContext"in(n=$(n,{keepFreeFloatingNodes:!1,contextResolver:new o({sharedCache:P})}))){const e=s.clone(n.expandContext);b(e)&&"@context"in e?r.expandContext=e:r.expandContext={"@context":e},i.push(r.expandContext)}let a;if(v(t)){const s=await e.get(t,n);a=s.documentUrl,r.input=s.document,s.contextUrl&&(r.remoteContext={"@context":s.contextUrl},i.push(r.remoteContext))}else r.input=s.clone(t);"base"in n||(n.base=a||"");let l=x(n);for(const e of i)l=await S({activeCtx:l,localCtx:e,options:n});let c=await d({activeCtx:l,element:r.input,options:n});return b(c)&&"@graph"in c&&1===Object.keys(c).length?c=c["@graph"]:null===c&&(c=[]),m(c)||(c=[c]),c},e.flatten=async function(t,n,r){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");n="function"==typeof n?null:n||null,r=$(r,{base:v(t)?t:"",contextResolver:new o({sharedCache:P})});const i=await e.expand(t,r),s=h(i);return null===n?s:(r.graph=!0,r.skipExpansion=!0,await e.compact(s,n,r))},e.frame=async function(t,n,r){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(r=$(r,{base:v(t)?t:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new o({sharedCache:P})}),v(n)){const t=await e.get(n,r);if(n=t.document,t.contextUrl){let e=n["@context"];e?m(e)?e.push(t.contextUrl):e=[e,t.contextUrl]:e=t.contextUrl,n["@context"]=e}}const i=n&&n["@context"]||{},s=await e.processContext(x(r),i,r);r.hasOwnProperty("omitGraph")||(r.omitGraph=j(s,1.1)),r.hasOwnProperty("pruneBlankNodeIdentifiers")||(r.pruneBlankNodeIdentifiers=j(s,1.1));const a=await e.expand(t,r),l={...r};l.isFrame=!0,l.keepFreeFloatingNodes=!0;const c=await e.expand(n,l),u=Object.keys(n).map((e=>_(s,e,{vocab:!0})));l.merged=!u.includes("@graph"),l.is11=j(s,1.1);const d=g(a,c,l);l.graph=!r.omitGraph,l.skipExpansion=!0,l.link={},l.framing=!0;let h=await e.compact(d,i,l);return l.link={},h=y(h,l),h},e.link=async function(t,n,r){const i={};return n&&(i["@context"]=n),i["@embed"]="@link",e.frame(t,i,r)},e.normalize=e.canonize=async function(t,n){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if("inputFormat"in(n=$(n,{base:v(t)?t:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new o({sharedCache:P})}))){if("application/n-quads"!==n.inputFormat&&"application/nquads"!==n.inputFormat)throw new l("Unknown canonicalization input format.","jsonld.CanonizeError");const e=u.parse(t);return r.canonize(e,n)}const i={...n};delete i.format,i.produceGeneralizedRdf=!1;const s=await e.toRDF(t,i);return r.canonize(s,n)},e.fromRDF=async function(e,n){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");n=$(n,{format:v(e)?"application/n-quads":void 0});const{format:r}=n;let{rdfParser:i}=n;if(r){if(i=i||t[r],!i)throw new l("Unknown input format.","jsonld.UnknownFormat",{format:r})}else i=()=>e;const s=await i(e);return f(s,n)},e.toRDF=async function(t,n){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");let r;r=(n=$(n,{base:v(t)?t:"",skipExpansion:!1,contextResolver:new o({sharedCache:P})})).skipExpansion?t:await e.expand(t,n);const i=p(r,n);if(n.format){if("application/n-quads"===n.format||"application/nquads"===n.format)return u.serialize(i);throw new l("Unknown output format.","jsonld.UnknownFormat",{format:n.format})}return i},e.createNodeMap=async function(t,n){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");n=$(n,{base:v(t)?t:"",contextResolver:new o({sharedCache:P})});const r=await e.expand(t,n);return T(r,n)},e.merge=async function(t,n,r){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(t))throw new TypeError('Could not merge, "docs" must be an array.');n="function"==typeof n?null:n||null,r=$(r,{contextResolver:new o({sharedCache:P})});const i=await Promise.all(t.map((t=>{const n={...r};return e.expand(t,n)})));let l=!0;"mergeNodes"in r&&(l=r.mergeNodes);const c=r.issuer||new a("_:b"),u={"@default":{}};for(let e=0;e<i.length;++e){const t=s.relabelBlankNodes(i[e],{issuer:new a("_:b"+e+"-")}),n=l||0===e?u:{"@default":{}};if(N(t,n,"@default",c),n!==u)for(const e in n){const t=n[e];if(!(e in u)){u[e]=t;continue}const r=u[e];for(const e in t)e in r||(r[e]=t[e])}}const d=R(u),h=[],f=Object.keys(d).sort();for(let e=0;e<f.length;++e){const t=d[f[e]];w(t)||h.push(t)}return null===n?h:(r.graph=!0,r.skipExpansion=!0,await e.compact(h,n,r))},Object.defineProperty(e,"documentLoader",{get:()=>e._documentLoader,set:t=>e._documentLoader=t}),e.documentLoader=async e=>{throw new l("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="function"==typeof n.documentLoader?n.documentLoader:e.documentLoader;const i=await r(t);try{if(!i.document)throw new l("No remote document found at the given URL.","jsonld.NullRemoteDocument");v(i.document)&&(i.document=JSON.parse(i.document))}catch(e){throw new l("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=$(n,{base:"",contextResolver:new o({sharedCache:P})}),null===t?x(n):(t=s.clone(t),b(t)&&"@context"in t||(t={"@context":t}),S({activeCtx:e,localCtx:t,options:n}))},e.getContextValue=n(1972).getContextValue,e.documentLoaders={},e.useDocumentLoader=function(t){if(!(t in e.documentLoaders))throw new l('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",u.parse),e.registerRDFParser("application/nquads",u.parse),e.url=n(470),e.logEventHandler=O,e.logWarningEventHandler=k,e.safeEventHandler=L,e.setDefaultEventHandler=A,e.strictEventHandler=D,e.unhandledEventHandler=M,e.util=s,Object.assign(e,s),e.promises=e,e.RequestQueue=n(3743),e.JsonLdProcessor=n(5445)(e),i.setupGlobals(e),i.setupDocumentLoaders(e),e},$=function(){return P((function(){return $()}))};P($),e.exports=$},4878:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DefaultGraph=void 0;class n{constructor(){this.termType="DefaultGraph",this.value=""}equals(e){return!!e&&"DefaultGraph"===e.termType}}t.DefaultGraph=n,n.INSTANCE=new n},5001:(e,t,n)=>{const{ObjectSetPrototypeOf:r,Symbol:i}=n(4134);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:s}=n(6371).codes,o=n(3370),{getHighWaterMark:a}=n(5291);r(c.prototype,o.prototype),r(c,o);const l=i("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush(((t,n)=>{t?e?e(t):this.destroy(t):(null!=n&&this.push(n),this.push(null),e&&e())}))}function d(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,n){throw new s("_transform()")},c.prototype._write=function(e,t,n){const r=this._readableState,i=this._writableState,s=r.length;this._transform(e,t,((e,t)=>{e?n(e):(null!=t&&this.push(t),i.ended||s===r.length||r.length<r.highWaterMark?n():this[l]=n)}))},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},5003:(e,t,n)=>{var r=n(8287),i=r.Buffer;function s(e,t){for(var n in e)t[n]=e[n]}function o(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=r:(s(r,t),t.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},o.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},5229:(e,t,n)=>{const{isSubjectReference:r}=n(3978),{createMergedNodeMap:i}=n(9233),s={};e.exports=s,s.flatten=e=>{const t=i(e),n=[],s=Object.keys(t).sort();for(let e=0;e<s.length;++e){const i=t[s[e]];r(i)||n.push(i)}return n}},5291:(e,t,n)=>{const{MathFloor:r,NumberIsInteger:i}=n(4134),{validateInteger:s}=n(277),{ERR_INVALID_ARG_VALUE:o}=n(6371).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,n,s){const a=function(e,t,n){return null!=e.highWaterMark?e.highWaterMark:t?e[n]:null}(t,s,n);if(null!=a){if(!i(a)||a<0)throw new o(s?`options.${n}`:"options.highWaterMark",a);return r(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){s(t,"value",0),e?l=t:a=t}}},5445:e=>{e.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(new TypeError("Could not compact, too few arguments.")):e.compact(t,n)},t.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):e.expand(t)},t.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):e.flatten(t)},t}},5448:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},5506:(e,t,n)=>{const{Buffer:r}=n(8287),{ObjectDefineProperty:i,ObjectKeys:s,ReflectApply:o}=n(4134),{promisify:{custom:a}}=n(7760),{streamReturningOperators:l,promiseReturningOperators:c}=n(823),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=n(6371),d=n(7830),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:f}=n(5291),{pipeline:p}=n(7758),{destroyer:g}=n(5896),y=n(6238),m=n(3095),b=n(6115),v=e.exports=n(4259).Stream;v.isDestroyed=b.isDestroyed,v.isDisturbed=b.isDisturbed,v.isErrored=b.isErrored,v.isReadable=b.isReadable,v.isWritable=b.isWritable,v.Readable=n(7576);for(const _ of s(l)){const x=l[_];function S(...e){if(new.target)throw u();return v.Readable.from(o(x,this,e))}i(S,"name",{__proto__:null,value:x.name}),i(S,"length",{__proto__:null,value:x.length}),i(v.Readable.prototype,_,{__proto__:null,value:S,enumerable:!1,configurable:!0,writable:!0})}for(const j of s(c)){const I=c[j];function E(...e){if(new.target)throw u();return o(I,this,e)}i(E,"name",{__proto__:null,value:I.name}),i(E,"length",{__proto__:null,value:I.length}),i(v.Readable.prototype,j,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}v.Writable=n(8584),v.Duplex=n(3370),v.Transform=n(5001),v.PassThrough=n(6524),v.pipeline=p;const{addAbortSignal:w}=n(4147);v.addAbortSignal=w,v.finished=y,v.destroy=g,v.compose=d,v.setDefaultHighWaterMark=h,v.getDefaultHighWaterMark=f,i(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>m}),i(p,a,{__proto__:null,enumerable:!0,get:()=>m.pipeline}),i(y,a,{__proto__:null,enumerable:!0,get:()=>m.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}},5568:e=>{const{AbortController:t,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=n,e.exports.default=t},5606:e=>{var t,n,r=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch(e){n=s}}();var a,l=[],c=!1,u=-1;function d(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=o(d);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}r.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];l.push(new f(e,t)),1!==l.length||c||o(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=p,r.addListener=p,r.once=p,r.off=p,r.removeListener=p,r.removeAllListeners=p,r.emit=p,r.prependListener=p,r.prependOnceListener=p,r.listeners=function(e){return[]},r.binding=function(e){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(e){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},5896:(e,t,n)=>{const r=n(5606),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:s},AbortError:o}=n(6371),{Symbol:a}=n(4134),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:d}=n(6115),h=a("kDestroy"),f=a("kConstruct");function p(e,t,n){e&&(e.stack,t&&!t.errored&&(t.errored=e),n&&!n.errored&&(n.errored=e))}function g(e,t,n){let i=!1;function s(t){if(i)return;i=!0;const s=e._readableState,o=e._writableState;p(t,o,s),o&&(o.closed=!0),s&&(s.closed=!0),"function"==typeof n&&n(t),t?r.nextTick(y,e,t):r.nextTick(m,e)}try{e._destroy(t||null,s)}catch(t){s(t)}}function y(e,t){b(e,t),m(e)}function m(e){const t=e._readableState,n=e._writableState;n&&(n.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=n&&n.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function b(e,t){const n=e._readableState,r=e._writableState;null!=r&&r.errorEmitted||null!=n&&n.errorEmitted||(r&&(r.errorEmitted=!0),n&&(n.errorEmitted=!0),e.emit("error",t))}function v(e,t,n){const i=e._readableState,s=e._writableState;if(null!=s&&s.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=s&&s.autoDestroy?e.destroy(t):t&&(t.stack,s&&!s.errored&&(s.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(b,e,t):b(e,t))}function w(e){let t=!1;function n(n){if(t)return void v(e,null!=n?n:new s);t=!0;const i=e._readableState,o=e._writableState,a=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(h,n):n?v(e,n,!0):r.nextTick(_,e)}try{e._construct((e=>{r.nextTick(n,e)}))}catch(e){r.nextTick(n,e)}}function _(e){e.emit(f)}function x(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function S(e){e.emit("close")}function j(e,t){e.emit("error",t),r.nextTick(S,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(f,t),e.listenerCount(f)>1||r.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new o),d(e)?(e.socket=null,e.destroy(t)):x(e)?e.abort():x(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(j,e,t):r.nextTick(S,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const n=this._readableState,r=this._writableState,s=r||n;return null!=r&&r.destroyed||null!=n&&n.destroyed?("function"==typeof t&&t(),this):(p(e,r,n),r&&(r.destroyed=!0),n&&(n.destroyed=!0),s.constructed?g(this,e,t):this.once(h,(function(n){g(this,i(n,e),t)})),this)},undestroy:function(){const 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=!1===e.readable,e.endEmitted=!1===e.readable),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=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:v}},6115:(e,t,n)=>{const{SymbolAsyncIterator:r,SymbolIterator:i,SymbolFor:s}=n(4134),o=s("nodejs.stream.destroyed"),a=s("nodejs.stream.errored"),l=s("nodejs.stream.readable"),c=s("nodejs.stream.writable"),u=s("nodejs.stream.disturbed"),d=s("nodejs.webstream.isClosedPromise"),h=s("nodejs.webstream.controllerErrorFunction");function f(e,t=!1){var n;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(n=e._readableState)||void 0===n?void 0:n.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function y(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function m(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function v(e){if(!g(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!!(e.destroyed||e[o]||null!=r&&r.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function _(e,t){if(!f(e))return null;const n=e._readableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===t&&!0===n.ended&&0===n.length))}function x(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!v(e)&&f(e)&&e.readable&&!_(e)}function S(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!v(e)&&p(e)&&e.writable&&!w(e)}function j(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function I(e){return"boolean"==typeof e._sent100&&j(e)}e.exports={isDestroyed:v,kIsDestroyed:o,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,n,r,i,s,o,l,c,u,d;return!(!e||!(null!==(t=null!==(n=null!==(r=null!==(i=null!==(s=null!==(o=e[a])&&void 0!==o?o:e.readableErrored)&&void 0!==s?s:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==r?r:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==n?n:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(d=e._writableState)||void 0===d?void 0:d.errored))},kIsErrored:a,isReadable:x,kIsReadable:l,kIsClosedPromise:d,kControllerErrorFunction:h,kIsWritable:c,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,n=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==n?void 0:n.closed)?(null==t?void 0:t.closed)||(null==n?void 0:n.closed):"boolean"==typeof e._closed&&j(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!(!v(e)&&(!1!==(null==t?void 0:t.readable)&&x(e)||!1!==(null==t?void 0:t.writable)&&S(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[r]:!1===t?"function"==typeof e[i]:"function"==typeof e[r]||"function"==typeof e[i])},isReadableNodeStream:f,isReadableStream:y,isReadableEnded:function(e){if(!f(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:_,isReadableErrored:function(e){var t,n;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(n=e._readableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return y(e)||m(e)||b(e)},isWritable:S,isWritableNodeStream:p,isWritableStream:m,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const n=e._writableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.finished)?null:!!(n.finished||!1===t&&!0===n.ended&&0===n.length))},isWritableErrored:function(e){var t,n;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(n=e._writableState)||void 0===n?void 0:n.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:I,willEmitClose:function(e){if(!g(e))return null;const t=e._writableState,n=e._readableState,r=t||n;return!r&&I(e)||!!(r&&r.autoDestroy&&r.emitClose&&!1===r.closed)},isTransformStream:b}},6238:(e,t,n)=>{const r=n(5606),{AbortError:i,codes:s}=n(6371),{ERR_INVALID_ARG_TYPE:o,ERR_STREAM_PREMATURE_CLOSE:a}=s,{kEmptyObject:l,once:c}=n(7760),{validateAbortSignal:u,validateFunction:d,validateObject:h,validateBoolean:f}=n(277),{Promise:p,PromisePrototypeThen:g,SymbolDispose:y}=n(4134),{isClosed:m,isReadable:b,isReadableNodeStream:v,isReadableStream:w,isReadableFinished:_,isReadableErrored:x,isWritable:S,isWritableNodeStream:j,isWritableStream:I,isWritableFinished:E,isWritableErrored:N,isNodeStream:T,willEmitClose:R,kIsClosedPromise:O}=n(6115);let k;const L=()=>{};function A(e,t,s){var f,p;if(2===arguments.length?(s=t,t=l):null==t?t=l:h(t,"options"),d(s,"callback"),u(t.signal,"options.signal"),s=c(s),w(e)||I(e))return function(e,t,s){let o=!1,a=L;if(t.signal)if(a=()=>{o=!0,s.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)r.nextTick(a);else{k=k||n(7760).addAbortListener;const r=k(t.signal,a),i=s;s=c(((...t)=>{r[y](),i.apply(e,t)}))}const l=(...t)=>{o||r.nextTick((()=>s.apply(e,t)))};return g(e[O].promise,l,l),L}(e,t,s);if(!T(e))throw new o("stream",["ReadableStream","WritableStream","Stream"],e);const A=null!==(f=t.readable)&&void 0!==f?f:v(e),C=null!==(p=t.writable)&&void 0!==p?p:j(e),D=e._writableState,M=e._readableState,P=()=>{e.writable||F()};let $=R(e)&&v(e)===A&&j(e)===C,B=E(e,!1);const F=()=>{B=!0,e.destroyed&&($=!1),(!$||e.readable&&!A)&&(A&&!q||s.call(e))};let q=_(e,!1);const U=()=>{q=!0,e.destroyed&&($=!1),(!$||e.writable&&!C)&&(C&&!B||s.call(e))},G=t=>{s.call(e,t)};let H=m(e);const V=()=>{H=!0;const t=N(e)||x(e);return t&&"boolean"!=typeof t?s.call(e,t):A&&!q&&v(e,!0)&&!_(e,!1)?s.call(e,new a):!C||B||E(e,!1)?void s.call(e):s.call(e,new a)},z=()=>{H=!0;const t=N(e)||x(e);if(t&&"boolean"!=typeof t)return s.call(e,t);s.call(e)},W=()=>{e.req.on("finish",F)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?C&&!D&&(e.on("end",P),e.on("close",P)):(e.on("complete",F),$||e.on("abort",V),e.req?W():e.on("request",W)),$||"boolean"!=typeof e.aborted||e.on("aborted",V),e.on("end",U),e.on("finish",F),!1!==t.error&&e.on("error",G),e.on("close",V),H?r.nextTick(V):null!=D&&D.errorEmitted||null!=M&&M.errorEmitted?$||r.nextTick(z):(A||$&&!b(e)||!B&&!1!==S(e))&&(C||$&&!S(e)||!q&&!1!==b(e))?M&&e.req&&e.aborted&&r.nextTick(z):r.nextTick(z);const J=()=>{s=L,e.removeListener("aborted",V),e.removeListener("complete",F),e.removeListener("abort",V),e.removeListener("request",W),e.req&&e.req.removeListener("finish",F),e.removeListener("end",P),e.removeListener("close",P),e.removeListener("finish",F),e.removeListener("end",U),e.removeListener("error",G),e.removeListener("close",V)};if(t.signal&&!H){const o=()=>{const n=s;J(),n.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)r.nextTick(o);else{k=k||n(7760).addAbortListener;const r=k(t.signal,o),i=s;s=c(((...t)=>{r[y](),i.apply(e,t)}))}}return J}e.exports=A,e.exports.finished=function(e,t){var n;let r=!1;return null===t&&(t=l),null!==(n=t)&&void 0!==n&&n.cleanup&&(f(t.cleanup,"cleanup"),r=t.cleanup),new p(((n,i)=>{const s=A(e,t,(e=>{r&&s(),e?i(e):n()}))}))}},6371:(e,t,n)=>{const{format:r,inspect:i,AggregateError:s}=n(7760),o=globalThis.AggregateError||s,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function d(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function f(e,t,n){n||(n=Error);class i extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return d(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);const i=(t.match(/%[dfijoOs]/g)||[]).length;return d(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.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}}),i.prototype.code=e,i.prototype[a]=!0,u[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class g extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}f("ERR_ASSERTION","%s",Error),f("ERR_INVALID_ARG_TYPE",((e,t,n)=>{d("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let r="The ";e.endsWith(" argument")?r+=`${e} `:r+=`"${e}" ${e.includes(".")?"property":"argument"} `,r+="must be ";const s=[],o=[],a=[];for(const e of t)d("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?s.push(e.toLowerCase()):c.test(e)?o.push(e):(d("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(o.length>0){const e=s.indexOf("object");-1!==e&&(s.splice(s,e,1),o.push("Object"))}if(s.length>0){switch(s.length){case 1:r+=`of type ${s[0]}`;break;case 2:r+=`one of type ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();r+=`one of type ${s.join(", ")}, or ${e}`}}(o.length>0||a.length>0)&&(r+=" or ")}if(o.length>0){switch(o.length){case 1:r+=`an instance of ${o[0]}`;break;case 2:r+=`an instance of ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();r+=`an instance of ${o.join(", ")}, or ${e}`}}a.length>0&&(r+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(r+="an "),r+=`${a[0]}`;break;case 2:r+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();r+=`one of ${a.join(", ")}, or ${e}`}}if(null==n)r+=`. Received ${n}`;else if("function"==typeof n&&n.name)r+=`. Received function ${n.name}`;else if("object"==typeof n){var u;null!==(u=n.constructor)&&void 0!==u&&u.name?r+=`. Received an instance of ${n.constructor.name}`:r+=`. Received ${i(n,{depth:-1})}`}else{let e=i(n,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),r+=`. Received type ${typeof n} (${e})`}return r}),TypeError),f("ERR_INVALID_ARG_VALUE",((e,t,n="is invalid")=>{let r=i(t);return r.length>128&&(r=r.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${n}. Received ${r}`}),TypeError),f("ERR_INVALID_RETURN_VALUE",((e,t,n)=>{var r;return`Expected ${e} to be returned from the "${t}" function but got ${null!=n&&null!==(r=n.constructor)&&void 0!==r&&r.name?`instance of ${n.constructor.name}`:"type "+typeof n}.`}),TypeError),f("ERR_MISSING_ARGS",((...e)=>{let t;d(e.length>0,"At least one arg needs to be specified");const 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:{const n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}}return`${t} must be specified`}),TypeError),f("ERR_OUT_OF_RANGE",((e,t,n)=>{let r;return d(t,'Missing "range" argument'),Number.isInteger(n)&&Math.abs(n)>2**32?r=h(String(n)):"bigint"==typeof n?(r=String(n),(n>2n**32n||n<-(2n**32n))&&(r=h(r)),r+="n"):r=i(n),`The value of "${e}" is out of range. It must be ${t}. Received ${r}`}),RangeError),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),f("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),f("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),f("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),f("ERR_STREAM_WRITE_AFTER_END","write after end",Error),f("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:g,aggregateTwoErrors:p((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const n=new o([t,e],t.message);return n.code=t.code,n}return e||t})),hideStackFrames:p,codes:u}},6524:(e,t,n)=>{const{ObjectSetPrototypeOf:r}=n(4134);e.exports=s;const i=n(5001);function s(e){if(!(this instanceof s))return new s(e);i.call(this,e)}r(s.prototype,i.prototype),r(s,i),s.prototype._transform=function(e,t,n){n(null,e)}},6532:(e,t,n)=>{const r=n(5606),{PromisePrototypeThen:i,SymbolAsyncIterator:s,SymbolIterator:o}=n(4134),{Buffer:a}=n(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=n(6371).codes;e.exports=function(e,t,n){let u,d;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...n,read(){this.push(t),this.push(null)}});if(t&&t[s])d=!0,u=t[s]();else{if(!t||!t[o])throw new l("iterable",["Iterable"],t);d=!1,u=t[o]()}const h=new e({objectMode:!0,highWaterMark:1,...n});let f=!1;return h._read=function(){f||(f=!0,async function(){for(;;){try{const{value:e,done:t}=d?await u.next():u.next();if(t)h.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw f=!1,new c;if(h.push(t))continue;f=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){i(async function(e){const t=null!=e,n="function"==typeof u.throw;if(t&&n){const{value:t,done:n}=await u.throw(e);if(await t,n)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),(()=>r.nextTick(t,e)),(n=>r.nextTick(t,n||e)))},h}},6706:(e,t,n)=>{const r=n(5606),i=n(8287),{isReadable:s,isWritable:o,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:d,isReadableStream:h,isWritableStream:f}=n(6115),p=n(6238),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:m}}=n(6371),{destroyer:b}=n(5896),v=n(3370),w=n(7576),_=n(8584),{createDeferredPromise:x}=n(7760),S=n(6532),j=globalThis.Blob||i.Blob,I=void 0!==j?function(e){return e instanceof j}:function(e){return!1},E=globalThis.AbortController||n(5568).AbortController,{FunctionPrototypeCall:N}=n(4134);class T extends v{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function R(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,n=e.writable;let r,i,a,l,c,u=!!s(t),d=!!o(n);function h(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new T({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==n||!n.writableObjectMode),readable:u,writable:d}),d&&(p(n,(e=>{d=!1,e&&b(t,e),h(e)})),c._write=function(e,t,i){n.write(e,t)?i():r=i},c._final=function(e){n.end(),i=e},n.on("drain",(function(){if(r){const e=r;r=null,e()}})),n.on("finish",(function(){if(i){const e=i;i=null,e()}}))),u&&(p(t,(e=>{u=!1,e&&b(t,e),h(e)})),t.on("readable",(function(){if(a){const e=a;a=null,e()}})),t.on("end",(function(){c.push(null)})),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,s){e||null===l||(e=new g),a=null,r=null,i=null,null===l?s(e):(l=s,b(n,e),b(t,e))},c}e.exports=function e(t,n){if(d(t))return t;if(c(t))return R({readable:t});if(u(t))return R({writable:t});if(l(t))return R({writable:!1,readable:!1});if(h(t))return R({readable:w.fromWeb(t)});if(f(t))return R({writable:_.fromWeb(t)});if("function"==typeof t){const{value:e,write:i,final:s,destroy:o}=function(e){let{promise:t,resolve:n}=x();const i=new E,s=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:o,cb:a}=await e;if(r.nextTick(a),o)return;if(s.aborted)throw new g(void 0,{cause:s.reason});({promise:t,resolve:n}=x()),yield i}}(),{signal:s}),write(e,t,r){const i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){const t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(a(e))return S(T,e,{objectMode:!0,write:i,final:s,destroy:o});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const n=N(l,e,(e=>{if(null!=e)throw new m("nully","body",e)}),(e=>{b(t,e)}));return t=new T({objectMode:!0,readable:!1,write:i,final(e){s((async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}}))},destroy:o})}throw new m("Iterable, AsyncIterable or AsyncFunction",n,e)}if(I(t))return e(t.arrayBuffer());if(a(t))return S(T,t,{objectMode:!0,writable:!1});if(h(null==t?void 0:t.readable)&&f(null==t?void 0:t.writable))return T.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return R({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return N(i,t,(t=>{null!=t&&e.push(t),e.push(null)}),(t=>{b(e,t)})),e=new T({objectMode:!0,writable:!1,read(){}})}throw new y(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},6925:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerNumberInteger=void 0;const r=n(103);class i{fromRdf(e,t){const n=parseInt(e.value,10);return t&&(isNaN(n)||e.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(e),n}toRdf(e,{datatype:t,dataFactory:n}){return n.literal(String(e),t||(e<=i.MAX_INT&&e>=i.MIN_INT?n.namedNode(i.TYPES[0]):n.namedNode(i.TYPES[1])))}}t.TypeHandlerNumberInteger=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],i.MAX_INT=2147483647,i.MIN_INT=-2147483648},6957:(e,t,n)=>{const{parseLinkHeader:r,buildHeaders:i}=n(9263),{LINK_HEADER_CONTEXT:s}=n(9378),o=n(2207),a=n(3743),{prependBase:l}=n(470),c=/(^|(\r\n))link:/i;e.exports=({secure:e,headers:t={},xhr:n}={headers:{}})=>(t=i(t),(new a).wrapLoader((async function i(a){if(0!==a.indexOf("http:")&&0!==a.indexOf("https:"))throw new o('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:a});if(e&&0!==a.indexOf("https"))throw new o('URL could not be dereferenced; secure mode is enabled and the URL\'s scheme is not "https".',"jsonld.InvalidUrl",{code:"loading document failed",url:a});let u;try{u=await function(e,t,n){const r=new(e=e||XMLHttpRequest);return new Promise(((e,i)=>{r.onload=()=>e(r),r.onerror=e=>i(e),r.open("GET",t,!0);for(const e in n)r.setRequestHeader(e,n[e]);r.send()}))}(n,a,t)}catch(e){throw new o("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:a,cause:e})}if(u.status>=400)throw new o("URL could not be dereferenced: "+u.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:a,httpStatusCode:u.status});let d={contextUrl:null,documentUrl:a,document:u.response},h=null;const f=u.getResponseHeader("Content-Type");let p;if(c.test(u.getAllResponseHeaders())&&(p=u.getResponseHeader("Link")),p&&"application/ld+json"!==f){const e=r(p),t=e[s];if(Array.isArray(t))throw new o("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:a});t&&(d.contextUrl=t.target),h=e.alternate,h&&"application/ld+json"==h.type&&!(f||"").match(/^application\/(\w*\+)?json$/)&&(d=await i(l(a,h.target)))}return d})))},7007:e=>{var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,s),r(n)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}g(e,t,s,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,n,r){var i,s,o,c;if(a(n),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),s=e._events),o=s[t]),void 0===o)o=s[t]=n,++e._eventsCount;else if("function"==typeof o?o=s[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=l(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=u.bind(r);return i.listener=n,r.wrapFn=i,i}function h(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}function g(e,t,n,r){if("function"==typeof e.on)r.once?e.once(t,n):e.on(t,n);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(s){r.once&&e.removeEventListener(t,i),n(s)}))}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),s.init=function(){void 0!==this._events&&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("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,s=this._events;if(void 0!==s)i=i&&void 0===s.error;else if(!i)return!1;if(i){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var c=l.length,u=p(l,c);for(n=0;n<c;++n)r(u[n],this,t)}return!0},s.prototype.addListener=function(e,t){return c(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return c(this,e,t,!0)},s.prototype.once=function(e,t){return a(t),this.on(e,d(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,d(this,e,t)),this},s.prototype.removeListener=function(e,t){var n,r,i,s,o;if(a(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,s=n.length-1;s>=0;s--)if(n[s]===t||n[s].listener===t){o=n[s].listener,i=s;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,o||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var i,s=Object.keys(n);for(r=0;r<s.length;++r)"removeListener"!==(i=s[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7034:(e,t,n)=>{const{isArray:r,isObject:i,isString:s}=n(7382),{asArray:o}=n(9263),{prependBase:a}=n(470),l=n(2207),c=n(7532);function u(e){throw new l("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;const n=e["@context"];if(s(n))e["@context"]=a(t,n);else if(r(n))for(let e=0;e<n.length;++e){const r=n[e];s(r)?n[e]=a(t,r):i(r)&&d({context:{"@context":r},base:t})}else if(i(n))for(const e in n)d({context:n[e],base:t})}e.exports=class{constructor({sharedCache:e}){this.perOpCache=new Map,this.sharedCache=e}async resolve({activeCtx:e,context:t,documentLoader:n,base:a,cycles:l=new Set}){t&&i(t)&&t["@context"]&&(t=t["@context"]),t=o(t);const d=[];for(const o of t){if(s(o)){let t=this._get(o);t||(t=await this._resolveRemoteContext({activeCtx:e,url:o,documentLoader:n,base:a,cycles:l})),r(t)?d.push(...t):d.push(t);continue}if(null===o){d.push(new c({document:null}));continue}i(o)||u(t);const h=JSON.stringify(o);let f=this._get(h);f||(f=new c({document:o}),this._cacheResolvedContext({key:h,resolved:f,tag:"static"})),d.push(f)}return d}_get(e){let t=this.perOpCache.get(e);if(!t){const 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),void 0!==n){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=a(r,t);const{context:s,remoteDoc:o}=await this._fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:i});d({context:s,base:r=o.documentUrl||t});const l=await this.resolve({activeCtx:e,context:s,documentLoader:n,base:r,cycles:i});return this._cacheResolvedContext({key:t,resolved:l,tag:o.tag}),l}async _fetchContext({activeCtx:e,url:t,documentLoader:n,cycles:o}){if(o.size>10)throw new l("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"loading remote context failed":"context overflow",max:10});if(o.has(t))throw new l("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:"json-ld-1.0"===e.processingMode?"recursive context inclusion":"context overflow",url:t});let a,c;o.add(t);try{c=await n(t),a=c.document||null,s(a)&&(a=JSON.parse(a))}catch(e){throw new l(`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(!i(a))throw new l(`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 a="@context"in a?{"@context":a["@context"]}:{"@context":{}},c.contextUrl&&(r(a["@context"])||(a["@context"]=[a["@context"]]),a["@context"].push(c.contextUrl)),{context:a,remoteDoc:c}}}},7258:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TypeHandlerDate=void 0;const r=n(103);class i{fromRdf(e,t){switch(t&&!e.value.match(i.VALIDATORS[e.datatype.value.substr(33,e.datatype.value.length)])&&r.Translator.incorrectRdfDataType(e),e.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(e.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const t=e.value.split("-");return new Date(0,parseInt(t[0],10)-1,parseInt(t[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(e.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(e.value+"-01");default:return new Date(e.value)}}toRdf(e,{datatype:t,dataFactory:n}){if(t=t||n.namedNode(i.TYPES[0]),!(e instanceof Date))return null;const r=e;let s;switch(t.value){case"http://www.w3.org/2001/XMLSchema#gDay":s=String(r.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":s=r.getUTCMonth()+1+"-"+r.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":s=String(r.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":s=r.getUTCFullYear()+"-"+(r.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":s=r.toISOString().replace(/T.*$/,"");break;default:s=r.toISOString()}return n.literal(s,t)}}t.TypeHandlerDate=i,i.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],i.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/}},7265:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Variable=void 0,t.Variable=class{constructor(e){this.termType="Variable",this.value=e}equals(e){return!!e&&"Variable"===e.termType&&e.value===this.value}}},7382:e=>{const t={};e.exports=t,t.isArray=Array.isArray,t.isBoolean=e=>"boolean"==typeof e||"[object Boolean]"===Object.prototype.toString.call(e),t.isDouble=e=>t.isNumber(e)&&(-1!==String(e).indexOf(".")||Math.abs(e)>=1e21),t.isEmptyObject=e=>t.isObject(e)&&0===Object.keys(e).length,t.isNumber=e=>"number"==typeof e||"[object Number]"===Object.prototype.toString.call(e),t.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),t.isObject=e=>"[object Object]"===Object.prototype.toString.call(e),t.isString=e=>"string"==typeof e||"[object String]"===Object.prototype.toString.call(e),t.isUndefined=e=>void 0===e},7400:(e,t,n)=>{var r=n(9374),i=1/0;e.exports=function(e){return e?(e=r(e))===i||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},7526:(e,t)=>{t.byteLength=function(e){var t=a(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,s=a(e),o=s[0],l=s[1],c=new i(function(e,t,n){return 3*(t+n)/4-n}(0,o,l)),u=0,d=l>0?o-4:o;for(n=0;n<d;n+=4)t=r[e.charCodeAt(n)]<<18|r[e.charCodeAt(n+1)]<<12|r[e.charCodeAt(n+2)]<<6|r[e.charCodeAt(n+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,c[u++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,s=[],o=16383,a=0,c=r-i;a<c;a+=o)s.push(l(e,a,a+o>c?c:a+o));return 1===i?(t=e[r-1],s.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],s.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),s.join("")};for(var n=[],r=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)n[o]=s[o],r[s.charCodeAt(o)]=o;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function l(e,t,r){for(var i,s,o=[],a=t;a<r;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(n[(s=i)>>18&63]+n[s>>12&63]+n[s>>6&63]+n[63&s]);return o.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},7532:(e,t,n)=>{const r=n(9749);e.exports=class{constructor({document:e}){this.document=e,this.cache=new r({max:10})}getProcessed(e){return this.cache.get(e)}setProcessed(e,t){this.cache.set(e,t)}}},7576:(e,t,n)=>{const r=n(5606),{ArrayPrototypeIndexOf:i,NumberIsInteger:s,NumberIsNaN:o,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:d,SafeSet:h,SymbolAsyncDispose:f,SymbolAsyncIterator:p,Symbol:g}=n(4134);e.exports=W,W.ReadableState=z;const{EventEmitter:y}=n(7007),{Stream:m,prependListener:b}=n(4259),{Buffer:v}=n(8287),{addAbortSignal:w}=n(4147),_=n(6238);let x=n(7760).debuglog("stream",(e=>{x=e}));const S=n(345),j=n(5896),{getHighWaterMark:I,getDefaultHighWaterMark:E}=n(5291),{aggregateTwoErrors:N,codes:{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:O,ERR_STREAM_PUSH_AFTER_EOF:k,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:L},AbortError:A}=n(6371),{validateObject:C}=n(277),D=g("kPaused"),{StringDecoder:M}=n(3141),P=n(6532);u(W.prototype,m.prototype),u(W,m);const $=()=>{},{errorOrDestroy:B}=j,F=1,q=16,U=32,G=2048,H=4096;function V(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function z(e,t,r){"boolean"!=typeof r&&(r=t instanceof n(3370)),this.state=G|H|q|U,e&&e.objectMode&&(this.state|=F),r&&e&&e.readableObjectMode&&(this.state|=F),this.highWaterMark=e?I(this,e,"readableHighWaterMark",r):E(!1),this.buffer=new S,this.length=0,this.pipes=[],this.flowing=null,this[D]=null,e&&!1===e.emitClose&&(this.state&=~G),e&&!1===e.autoDestroy&&(this.state&=~H),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new M(e.encoding),this.encoding=e.encoding)}function W(e){if(!(this instanceof W))return new W(e);const t=this instanceof n(3370);this._readableState=new z(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),m.call(this,e),j.construct(this,(()=>{this._readableState.needReadable&&Z(this,this._readableState)}))}function J(e,t,n,r){x("readableAddChunk",t);const i=e._readableState;let s;if(0===(i.state&F)&&("string"==typeof t?(n=n||i.defaultEncoding,i.encoding!==n&&(r&&i.encoding?t=v.from(t,n).toString(i.encoding):(t=v.from(t,n),n=""))):t instanceof v?n="":m._isUint8Array(t)?(t=m._uint8ArrayToBuffer(t),n=""):null!=t&&(s=new T("chunk",["string","Buffer","Uint8Array"],t))),s)B(e,s);else if(null===t)i.state&=-9,function(e,t){if(x("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?K(e):(t.needReadable=!1,t.emittedReadable=!0,Y(e))}}(e,i);else if(0!==(i.state&F)||t&&t.length>0)if(r)if(4&i.state)B(e,new L);else{if(i.destroyed||i.errored)return!1;Q(e,i,t,!0)}else if(i.ended)B(e,new k);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?Q(e,i,t,!1):Z(e,i)):Q(e,i,t,!1)}else r||(i.state&=-9,Z(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function Q(e,t,n,r){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",n)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),64&t.state&&K(e)),Z(e,t)}function X(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&F)?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function K(e){const t=e._readableState;x("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(x("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(Y,e))}function Y(e){const t=e._readableState;x("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,ie(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const n=t.length;if(x("maybeReadMore read 0"),e.read(0),n===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[D]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function ne(e){x("readable nexttick read 0"),e.read(0)}function re(e,t){x("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ie(e),t.flowing&&!t.reading&&e.read(0)}function ie(e){const t=e._readableState;for(x("flow",t.flowing);t.flowing&&null!==e.read(););}function se(e,t){"function"!=typeof e.read&&(e=W.wrap(e,{objectMode:!0}));const n=async function*(e,t){let n,r=$;function i(t){this===e?(r(),r=$):r=t}e.on("readable",i);const s=_(e,{writable:!1},(e=>{n=e?N(n,e):null,r(),r=$}));try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(n)throw n;if(null===n)return;await new d(i)}}}catch(e){throw n=N(n,e),n}finally{!n&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==n&&!e._readableState.autoDestroy?(e.off("readable",i),s()):j.destroyer(e,null)}}(e,t);return n.stream=e,n}function oe(e,t){if(0===t.length)return null;let n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):n=t.buffer.consume(e,t.decoder),n}function ae(e){const t=e._readableState;x("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(le,t,e))}function le(e,t){if(x("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function de(){return void 0===ue&&(ue={}),ue}l(z.prototype,{objectMode:V(F),ended:V(2),endEmitted:V(4),reading:V(8),constructed:V(q),sync:V(U),needReadable:V(64),emittedReadable:V(128),readableListening:V(256),resumeScheduled:V(512),errorEmitted:V(1024),emitClose:V(G),autoDestroy:V(H),destroyed:V(8192),closed:V(16384),closeEmitted:V(32768),multiAwaitDrain:V(65536),readingMore:V(1<<17),dataEmitted:V(1<<18)}),W.prototype.destroy=j.destroy,W.prototype._undestroy=j.undestroy,W.prototype._destroy=function(e,t){t(e)},W.prototype[y.captureRejectionSymbol]=function(e){this.destroy(e)},W.prototype[f]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new A,this.destroy(e)),new d(((t,n)=>_(this,(r=>r&&r!==e?n(r):t(null)))))},W.prototype.push=function(e,t){return J(this,e,t,!1)},W.prototype.unshift=function(e,t){return J(this,e,t,!0)},W.prototype.isPaused=function(){const e=this._readableState;return!0===e[D]||!1===e.flowing},W.prototype.setEncoding=function(e){const t=new M(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const n=this._readableState.buffer;let r="";for(const e of n)r+=t.write(e);return n.clear(),""!==r&&n.push(r),this._readableState.length=r.length,this},W.prototype.read=function(e){x("read",e),void 0===e?e=NaN:s(e)||(e=a(e,10));const t=this._readableState,n=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new O("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return x("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):K(this),null;if(0===(e=X(e,t))&&t.ended)return 0===t.length&&ae(this),null;let r,i=!!(64&t.state);if(x("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,x("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,x("reading, ended or constructing",i);else if(i){x("do read"),t.state|=8|U,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){B(this,e)}t.state&=~U,t.reading||(e=X(n,t))}return r=e>0?oe(e,t):null,null===r?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&ae(this)),null===r||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",r)),r},W.prototype._read=function(e){throw new R("_read()")},W.prototype.pipe=function(e,t){const n=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),x("pipe count=%d opts=%j",i.pipes.length,t);const s=t&&!1===t.end||e===r.stdout||e===r.stderr?g:o;function o(){x("onend"),e.end()}let a;i.endEmitted?r.nextTick(s):n.once("end",s),e.on("unpipe",(function t(r,s){x("onunpipe"),r===n&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,x("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",d),e.removeListener("unpipe",t),n.removeListener("end",o),n.removeListener("end",g),n.removeListener("data",u),l=!0,a&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())}));let l=!1;function c(){l||(1===i.pipes.length&&i.pipes[0]===e?(x("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(x("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),n.pause()),a||(a=function(e,t){return function(){const n=e._readableState;n.awaitDrainWriters===t?(x("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(x("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),n.awaitDrainWriters&&0!==n.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(n,e),e.on("drain",a))}function u(t){x("ondata");const n=e.write(t);x("dest.write",n),!1===n&&c()}function d(t){if(x("onerror",t),g(),e.removeListener("error",d),0===e.listenerCount("error")){const n=e._writableState||e._readableState;n&&!n.errorEmitted?B(e,t):e.emit("error",t)}}function f(){e.removeListener("finish",p),g()}function p(){x("onfinish"),e.removeListener("close",f),g()}function g(){x("unpipe"),n.unpipe(e)}return n.on("data",u),b(e,"error",d),e.once("close",f),e.once("finish",p),e.emit("pipe",n),!0===e.writableNeedDrain?c():i.flowing||(x("pipe resume"),n.resume()),e},W.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const n=i(t.pipes,e);return-1===n||(t.pipes.splice(n,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},W.prototype.on=function(e,t){const n=m.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,x("on readable",i.length,i.reading),i.length?K(this):i.reading||r.nextTick(ne,this))),n},W.prototype.addListener=W.prototype.on,W.prototype.removeListener=function(e,t){const n=m.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(te,this),n},W.prototype.off=W.prototype.removeListener,W.prototype.removeAllListeners=function(e){const t=m.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(te,this),t},W.prototype.resume=function(){const e=this._readableState;return e.flowing||(x("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(re,e,t))}(this,e)),e[D]=!1,this},W.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[D]=!0,this},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=>{B(this,e)})),e.on("close",(()=>{this.destroy()})),e.on("destroy",(()=>{this.destroy()})),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const n=c(e);for(let t=1;t<n.length;t++){const r=n[t];void 0===this[r]&&"function"==typeof e[r]&&(this[r]=e[r].bind(e))}return this},W.prototype[p]=function(){return se(this)},W.prototype.iterator=function(e){return void 0!==e&&C(e,"options"),se(this,e)},l(W.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||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!(!1===this._readableState.readable||!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}},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}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(z.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[D]},set(e){this[D]=!!e}}}),W._fromList=oe,W.from=function(e,t){return P(W,e,t)},W.fromWeb=function(e,t){return de().newStreamReadableFromReadableStream(e,t)},W.toWeb=function(e,t){return de().newReadableStreamFromStreamReadable(e,t)},W.wrap=function(e,t){var n,r;return new W({objectMode:null===(n=null!==(r=e.readableObjectMode)&&void 0!==r?r:e.objectMode)||void 0===n||n,...t,destroy(t,n){j.destroyer(e,t),n(t)}}).wrap(e)}},7758:(e,t,n)=>{const r=n(5606),{ArrayIsArray:i,Promise:s,SymbolAsyncIterator:o,SymbolDispose:a}=n(4134),l=n(6238),{once:c}=n(7760),u=n(5896),d=n(3370),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:f,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:y,ERR_STREAM_PREMATURE_CLOSE:m},AbortError:b}=n(6371),{validateFunction:v,validateAbortSignal:w}=n(277),{isIterable:_,isReadable:x,isReadableNodeStream:S,isNodeStream:j,isTransformStream:I,isWebStream:E,isReadableStream:N,isReadableFinished:T}=n(6115),R=globalThis.AbortController||n(5568).AbortController;let O,k,L;function A(e,t,n){let r=!1;return e.on("close",(()=>{r=!0})),{destroy:t=>{r||(r=!0,u.destroyer(e,t||new y("pipe")))},cleanup:l(e,{readable:t,writable:n},(e=>{r=!e}))}}function C(e){if(_(e))return e;if(S(e))return async function*(e){k||(k=n(7576)),yield*k.prototype[o].call(e)}(e);throw new f("val",["Readable","Iterable","AsyncIterable"],e)}async function D(e,t,n,{end:r}){let i,o=null;const a=e=>{if(e&&(i=e),o){const e=o;o=null,e()}},c=()=>new s(((e,t)=>{i?t(i):o=()=>{i?t(i):e()}}));t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const n of e)t.write(n)||await c();r&&(t.end(),await c()),n()}catch(e){n(i!==e?h(i,e):e)}finally{u(),t.off("drain",a)}}async function M(e,t,n,{end:r}){I(t)&&(t=t.writable);const i=t.getWriter();try{for await(const 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 P(e,t,s){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new g("streams");const o=new R,l=o.signal,c=null==s?void 0:s.signal,u=[];function h(){F(new b)}let y,m,v;w(c,"options.signal"),L=L||n(7760).addAbortListener,c&&(y=L(c,h));const T=[];let k,P=0;function B(e){F(e,0===--P)}function F(e,n){var i;if(!e||m&&"ERR_STREAM_PREMATURE_CLOSE"!==m.code||(m=e),m||n){for(;T.length;)T.shift()(m);null===(i=y)||void 0===i||i[a](),o.abort(),n&&(m||u.forEach((e=>e())),r.nextTick(t,m,v))}}for(let G=0;G<e.length;G++){const H=e[G],V=G<e.length-1,z=G>0,W=V||!1!==(null==s?void 0:s.end),J=G===e.length-1;if(j(H)){if(W){const{destroy:X,cleanup:K}=A(H,V,z);T.push(X),x(H)&&J&&u.push(K)}function Q(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&B(e)}H.on("error",Q),x(H)&&J&&u.push((()=>{H.removeListener("error",Q)}))}if(0===G)if("function"==typeof H){if(k=H({signal:l}),!_(k))throw new p("Iterable, AsyncIterable or Stream","source",k)}else k=_(H)||S(H)||I(H)?H:d.from(H);else if("function"==typeof H){var q;if(k=I(k)?C(null===(q=k)||void 0===q?void 0:q.readable):C(k),k=H(k,{signal:l}),V){if(!_(k,!0))throw new p("AsyncIterable",`transform[${G-1}]`,k)}else{var U;O||(O=n(6524));const Y=new O({objectMode:!0}),Z=null===(U=k)||void 0===U?void 0:U.then;if("function"==typeof Z)P++,Z.call(k,(e=>{v=e,null!=e&&Y.write(e),W&&Y.end(),r.nextTick(B)}),(e=>{Y.destroy(e),r.nextTick(B,e)}));else if(_(k,!0))P++,D(k,Y,B,{end:W});else{if(!N(k)&&!I(k))throw new p("AsyncIterable or Promise","destination",k);{const ne=k.readable||k;P++,D(ne,Y,B,{end:W})}}k=Y;const{destroy:ee,cleanup:te}=A(k,!1,!0);T.push(ee),J&&u.push(te)}}else if(j(H)){if(S(k)){P+=2;const re=$(k,H,B,{end:W});x(H)&&J&&u.push(re)}else if(I(k)||N(k)){const ie=k.readable||k;P++,D(ie,H,B,{end:W})}else{if(!_(k))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],k);P++,D(k,H,B,{end:W})}k=H}else if(E(H)){if(S(k))P++,M(C(k),H,B,{end:W});else if(N(k)||_(k))P++,M(k,H,B,{end:W});else{if(!I(k))throw new f("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],k);P++,M(k.readable,H,B,{end:W})}k=H}else k=d.from(H)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&r.nextTick(h),k}function $(e,t,n,{end:i}){let s=!1;if(t.on("close",(()=>{s||n(new m)})),e.pipe(t,{end:!1}),i){function o(){s=!0,t.end()}T(e)?r.nextTick(o):e.once("end",o)}else n();return l(e,{readable:!0,writable:!1},(t=>{const r=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&r&&r.ended&&!r.errored&&!r.errorEmitted?e.once("end",n).once("error",n):n(t)})),l(t,{readable:!1,writable:!0},n)}e.exports={pipelineImpl:P,pipeline:function(...e){return P(e,c(function(e){return v(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},7760:(e,t,n)=>{const r=n(8287),{kResistStopPropagation:i,SymbolDispose:s}=n(4134),o=globalThis.AbortSignal||n(5568).AbortSignal,a=globalThis.AbortController||n(5568).AbortController,l=Object.getPrototypeOf((async function(){})).constructor,c=globalThis.Blob||r.Blob,u=void 0!==c?function(e){return e instanceof c}:function(e){return!1},d=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)};class h extends Error{constructor(e){if(!Array.isArray(e))throw new 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}}e.exports={AggregateError:h,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=>new Promise(((t,n)=>{e(((e,...r)=>e?n(e):t(...r)))})),debuglog:()=>function(){},format:(e,...t)=>e.replace(/%([sdifj])/g,(function(...[e,n]){const r=t.shift();return"f"===n?r.toFixed(6):"j"===n?JSON.stringify(r):"s"===n&&"object"==typeof r?`${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"{}"}},types:{isAsyncFunction:e=>e instanceof l,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:u,deprecate:(e,t)=>e,addAbortListener:n(7007).addAbortListener||function(e,t){if(void 0===e)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);let n;return d(e,"signal"),(e=>{if("function"!=typeof e)throw new ERR_INVALID_ARG_TYPE("listener","Function",e)})(t),e.aborted?queueMicrotask((()=>t())):(e.addEventListener("abort",t,{__proto__:null,once:!0,[i]:!0}),n=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[s](){var e;null===(e=n)||void 0===e||e()}}},AbortSignalAny:o.any||function(e){if(1===e.length)return e[0];const t=new a,n=()=>t.abort();return e.forEach((e=>{d(e,"signals"),e.addEventListener("abort",n,{once:!0})})),t.signal.addEventListener("abort",(()=>{e.forEach((e=>e.removeEventListener("abort",n)))}),{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},7789:()=>{},7830:(e,t,n)=>{const{pipeline:r}=n(7758),i=n(3370),{destroyer:s}=n(5896),{isNodeStream:o,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:d,isReadableStream:h}=n(6115),{AbortError:f,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=n(6371),y=n(6238);e.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let n=0;n<e.length;++n)if(o(e[n])||c(e[n])){if(n<e.length-1&&!(a(e[n])||h(e[n])||u(e[n])))throw new p(`streams[${n}]`,t[n],"must be readable");if(n>0&&!(l(e[n])||d(e[n])||u(e[n])))throw new p(`streams[${n}]`,t[n],"must be writable")}let n,m,b,v,w;const _=e[0],x=r(e,(function(e){const t=v;v=null,t?t(e):e?w.destroy(e):j||S||w.destroy()})),S=!!(l(_)||d(_)||u(_)),j=!!(a(x)||h(x)||u(x));if(w=new i({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==x||!x.readableObjectMode),writable:S,readable:j}),S){if(o(_))w._write=function(e,t,r){_.write(e,t)?r():n=r},w._final=function(e){_.end(),m=e},_.on("drain",(function(){if(n){const e=n;n=null,e()}}));else if(c(_)){const e=(u(_)?_.writable:_).getWriter();w._write=async function(t,n,r){try{await e.ready,e.write(t).catch((()=>{})),r()}catch(e){r(e)}},w._final=async function(t){try{await e.ready,e.close().catch((()=>{})),m=t}catch(e){t(e)}}}const e=u(x)?x.readable:x;y(e,(()=>{if(m){const e=m;m=null,e()}}))}if(j)if(o(x))x.on("readable",(function(){if(b){const e=b;b=null,e()}})),x.on("end",(function(){w.push(null)})),w._read=function(){for(;;){const e=x.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(c(x)){const e=(u(x)?x.readable:x).getReader();w._read=async function(){for(;;)try{const{value:t,done:n}=await e.read();if(!w.push(t))return;if(n)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===v||(e=new f),b=null,n=null,m=null,null===v?t(e):(v=t,o(x)&&s(x,e))},w}},7946:(e,t,n)=>{const{isKeyword:r}=n(1972),i=n(3978),s=n(7382),o=n(9263),a=n(470),l=n(2207),{createNodeMap:c,mergeNodeMapGraphs:u}=n(9233),d={};function h(e){const t={};for(const n in e)void 0!==e[n]&&(t["@"+n]=[e[n]]);return[t]}function f(e,t,n){for(let r=n.length-1;r>=0;--r){const i=n[r];if(i.graph===t&&i.subject["@id"]===e["@id"])return!0}return!1}function p(e,t,n){const r="@"+n;let i=r in e?e[r][0]:t[n];if("embed"===n)if(!0===i)i="@once";else if(!1===i)i="@never";else if("@always"!==i&&"@never"!==i&&"@link"!==i&&"@first"!==i&&"@last"!==i&&"@once"!==i)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:e});return i}function g(e){if(!s.isArray(e)||1!==e.length||!s.isObject(e[0]))throw new l("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:e});if("@id"in e[0])for(const t of o.asArray(e[0]["@id"]))if(!s.isObject(t)&&!a.isAbsolute(t)||s.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e});if("@type"in e[0])for(const t of o.asArray(e[0]["@type"]))if(!s.isObject(t)&&!a.isAbsolute(t)&&"@json"!==t||s.isString(t)&&0===t.indexOf("_:"))throw new l("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:e})}function y(e,t,n,a){let l=!0,c=!1;for(const u in n){let d=!1;const h=o.getValues(t,u),f=0===o.getValues(n,u).length;if("@id"===u){if(s.isEmptyObject(n["@id"][0]||{})?d=!0:n["@id"].length>=0&&(d=n["@id"].includes(h[0])),!a.requireAll)return d}else if("@type"===u){if(l=!1,f){if(h.length>0)return!1;d=!0}else if(1===n["@type"].length&&s.isEmptyObject(n["@type"][0]))d=h.length>0;else for(const e of n["@type"])d=!(!s.isObject(e)||!("@default"in e))||d||h.some((t=>t===e));if(!a.requireAll)return d}else{if(r(u))continue;{const t=o.getValues(n,u)[0];let r=!1;if(t&&(g([t]),r="@default"in t),l=!1,0===h.length&&r)continue;if(h.length>0&&f)return!1;if(void 0===t){if(h.length>0)return!1;d=!0}else if(i.isList(t)){const n=t["@list"][0];if(i.isList(h[0])){const t=h[0]["@list"];i.isValue(n)?d=t.some((e=>_(n,e))):(i.isSubject(n)||i.isSubjectReference(n))&&(d=t.some((t=>w(e,n,t,a))))}}else d=i.isValue(t)?h.some((e=>_(t,e))):i.isSubjectReference(t)?h.some((n=>w(e,t,n,a))):!!s.isObject(t)&&h.length>0}}if(!d&&a.requireAll)return!1;c=c||d}return l||c}function m(e,t){const n=e.uniqueEmbeds[e.graph],r=n[t],i=r.parent,a=r.property,l={"@id":t};if(s.isArray(i)){for(let e=0;e<i.length;++e)if(o.compareValues(i[e],l)){i[e]=l;break}}else{const e=s.isArray(i[a]);o.removeValue(i,a,l,{propertyIsArray:e}),o.addValue(i,a,l,{propertyIsArray:e})}const c=e=>{const t=Object.keys(n);for(const r of t)r in n&&s.isObject(n[r].parent)&&n[r].parent["@id"]===e&&(delete n[r],c(r))};c(t)}function b(e,t){if(s.isArray(e))return e.map((e=>b(e,t)));if(s.isObject(e)){if("@preserve"in e)return e["@preserve"][0];if(i.isValue(e))return e;if(i.isList(e))return e["@list"]=b(e["@list"],t),e;if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)"@id"===n&&t.bnodesToClear.includes(e[n])?delete e["@id"]:e[n]=b(e[n],t)}return e}function v(e,t,n){s.isObject(e)?o.addValue(e,t,n,{propertyIsArray:!0}):e.push(n)}function w(e,t,n,r){if(!("@id"in n))return!1;const i=e.subjects[n["@id"]];return i&&y(e,i,t,r)}function _(e,t){const n=t["@value"],r=t["@type"],i=t["@language"],o=e["@value"]?s.isArray(e["@value"])?e["@value"]:[e["@value"]]:[],a=e["@type"]?s.isArray(e["@type"])?e["@type"]:[e["@type"]]:[],l=e["@language"]?s.isArray(e["@language"])?e["@language"]:[e["@language"]]:[];return 0===o.length&&0===a.length&&0===l.length||!(!o.includes(n)&&!s.isEmptyObject(o[0]))&&!!(!r&&0===a.length||a.includes(r)||r&&s.isEmptyObject(a[0]))&&!!(!i&&0===l.length||l.includes(i)||i&&s.isEmptyObject(l[0]))}e.exports=d,d.frameMergedOrDefault=(e,t,n)=>{const r={options:n,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},i=new o.IdentifierIssuer("_:b");c(e,r.graphMap,"@default",i),n.merged&&(r.graphMap["@merged"]=u(r.graphMap),r.graph="@merged"),r.subjects=r.graphMap[r.graph];const s=[];return d.frame(r,Object.keys(r.subjects).sort(),t,s),n.pruneBlankNodeIdentifiers&&(n.bnodesToClear=Object.keys(r.bnodeMap).filter((e=>1===r.bnodeMap[e].length))),n.link={},b(s,n)},d.frame=(e,t,n,a,c=null)=>{g(n),n=n[0];const u=e.options,b={embed:p(n,u,"embed"),explicit:p(n,u,"explicit"),requireAll:p(n,u,"requireAll")};e.link.hasOwnProperty(e.graph)||(e.link[e.graph]={});const w=e.link[e.graph],x=function(e,t,n,r){const i={};for(const s of t){const t=e.graphMap[e.graph][s];y(e,t,n,r)&&(i[s]=t)}return i}(e,t,n,b),S=Object.keys(x).sort();for(const g of S){const y=x[g];if(null===c?e.uniqueEmbeds={[e.graph]:{}}:e.uniqueEmbeds[e.graph]=e.uniqueEmbeds[e.graph]||{},"@link"===b.embed&&g in w){v(a,c,w[g]);continue}const S={"@id":g};if(0===g.indexOf("_:")&&o.addValue(e.bnodeMap,g,S,{propertyIsArray:!0}),w[g]=S,("@first"===b.embed||"@last"===b.embed)&&e.is11)throw new l("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:n});if(e.embedded||!e.uniqueEmbeds[e.graph].hasOwnProperty(g))if(!e.embedded||"@never"!==b.embed&&!f(y,e.graph,e.subjectStack))if(!e.embedded||"@first"!=b.embed&&"@once"!=b.embed||!e.uniqueEmbeds[e.graph].hasOwnProperty(g)){if("@last"===b.embed&&g in e.uniqueEmbeds[e.graph]&&m(e,g),e.uniqueEmbeds[e.graph][g]={parent:a,property:c},e.subjectStack.push({subject:y,graph:e.graph}),g in e.graphMap){let t=!1,r=null;"@graph"in n?(r=n["@graph"][0],t=!("@merged"===g||"@default"===g),s.isObject(r)||(r={})):(t="@merged"!==e.graph,r={}),t&&d.frame({...e,graph:g,embedded:!1},Object.keys(e.graphMap[g]).sort(),[r],S,"@graph")}"@included"in n&&d.frame({...e,embedded:!1},t,n["@included"],S,"@included");for(const t of Object.keys(y).sort())if(r(t)){if(S[t]=o.clone(y[t]),"@type"===t)for(const t of y["@type"])0===t.indexOf("_:")&&o.addValue(e.bnodeMap,t,S,{propertyIsArray:!0})}else if(!b.explicit||t in n)for(const r of y[t]){const s=t in n?n[t]:h(b);if(i.isList(r)){const s=n[t]&&n[t][0]&&n[t][0]["@list"]?n[t][0]["@list"]:h(b),a={"@list":[]};v(S,t,a);const l=r["@list"];for(const t of l)i.isSubjectReference(t)?d.frame({...e,embedded:!0},[t["@id"]],s,a,"@list"):v(a,"@list",o.clone(t))}else i.isSubjectReference(r)?d.frame({...e,embedded:!0},[r["@id"]],s,S,t):_(s[0],r)&&v(S,t,o.clone(r))}for(const e of Object.keys(n).sort()){if("@type"===e){if(!s.isObject(n[e][0])||!("@default"in n[e][0]))continue}else if(r(e))continue;const t=n[e][0]||{};if(!p(t,u,"omitDefault")&&!(e in S)){let n="@null";"@default"in t&&(n=o.clone(t["@default"])),s.isArray(n)||(n=[n]),S[e]=[{"@preserve":n}]}}for(const t of Object.keys(n["@reverse"]||{}).sort()){const r=n["@reverse"][t];for(const n of Object.keys(e.subjects))o.getValues(e.subjects[n],t).some((e=>e["@id"]===g))&&(S["@reverse"]=S["@reverse"]||{},o.addValue(S["@reverse"],t,[],{propertyIsArray:!0}),d.frame({...e,embedded:!0},[n],r,S["@reverse"][t],c))}v(a,c,S),e.subjectStack.pop()}else v(a,c,S);else v(a,c,S)}},d.cleanupNull=(e,t)=>{if(s.isArray(e))return e.map((e=>d.cleanupNull(e,t))).filter((e=>e));if("@null"===e)return null;if(s.isObject(e)){if("@id"in e){const n=e["@id"];if(t.link.hasOwnProperty(n)){const r=t.link[n].indexOf(e);if(-1!==r)return t.link[n][r];t.link[n].push(e)}else t.link[n]=[e]}for(const n in e)e[n]=d.cleanupNull(e[n],t)}return e}},8059:(e,t,n)=>{var r=n(2177);e.exports=function(e){return r(2,e)}},8229:(e,t,n)=>{e.exports=n(989).NQuads},8287:(e,t,n)=>{const r=n(7526),i=n(251),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function a(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,n)}function c(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=a(n);const i=r.write(e,t);return i!==n&&(r=r.slice(0,i)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return f(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return f(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return l.from(r,t,n);const i=function(e){if(l.isBuffer(e)){const t=0|p(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||X(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),n=a(t);for(let r=0;r<t;r+=1)n[r]=255&e[r];return n}function f(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');let r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),Object.setPrototypeOf(r,l.prototype),r}function p(e){if(e>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(i)return r?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,n);case"utf8":case"utf-8":return E(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return R(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),X(n=+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)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,i){let s,o=1,a=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,a/=2,l/=2,n/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let r=-1;for(s=n;s<a;s++)if(c(e,s)===c(t,-1===r?0:s-r)){if(-1===r&&(r=s),s-r+1===l)return r*o}else-1!==r&&(s-=s-r),r=-1}else for(n+l>a&&(n=a-l),s=n;s>=0;s--){let n=!0;for(let r=0;r<l;r++)if(c(e,s+r)!==c(t,r)){n=!1;break}if(n)return s}return-1}function w(e,t,n,r){n=Number(n)||0;const i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;const s=t.length;let o;for(r>s/2&&(r=s/2),o=0;o<r;++o){const r=parseInt(t.substr(2*o,2),16);if(X(r))return o;e[n+o]=r}return o}function _(e,t,n,r){return J(z(t,e.length-n),e,n,r)}function x(e,t,n,r){return J(function(e){const t=[];for(let n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return J(W(t),e,n,r)}function j(e,t,n,r){return J(function(e,t){let n,r,i;const s=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=e.charCodeAt(o),r=n>>8,i=n%256,s.push(i),s.push(r);return s}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function E(e,t,n){n=Math.min(e.length,n);const r=[];let i=t;for(;i<n;){const t=e[i];let s=null,o=t>239?4:t>223?3:t>191?2:1;if(i+o<=n){let n,r,a,l;switch(o){case 1:t<128&&(s=t);break;case 2:n=e[i+1],128==(192&n)&&(l=(31&t)<<6|63&n,l>127&&(s=l));break;case 3:n=e[i+1],r=e[i+2],128==(192&n)&&128==(192&r)&&(l=(15&t)<<12|(63&n)<<6|63&r,l>2047&&(l<55296||l>57343)&&(s=l));break;case 4:n=e[i+1],r=e[i+2],a=e[i+3],128==(192&n)&&128==(192&r)&&128==(192&a)&&(l=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&a,l>65535&&l<1114112&&(s=l))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=o}return function(e){const 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}(r)}t.kMaxLength=o,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,n){return c(e,t,n)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,n){return function(e,t,n){return u(e),e<=0?a(e):void 0!==t?"string"==typeof n?a(e).fill(t,n):a(e).fill(t):a(e)}(e,t,n)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new 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,s=Math.min(n,r);i<s;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.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}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;const r=l.allocUnsafe(t);let i=0;for(n=0;n<e.length;++n){let t=e[n];if(Q(t,Uint8Array))i+t.length>r.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(r,i)):Uint8Array.prototype.set.call(r,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,i)}i+=t.length}return r},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)m(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):y.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const n=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,n).replace(/(.{2})/g,"$1 ").trim(),this.length>n&&(e+=" ... "),"<Buffer "+e+">"},s&&(l.prototype[s]=l.prototype.inspect),l.prototype.compare=function(e,t,n,r,i){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;let s=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0);const a=Math.min(s,o),c=this.slice(r,i),u=e.slice(t,n);for(let e=0;e<a;++e)if(c[e]!==u[e]){s=c[e],o=u[e];break}return s<o?-1:o<s?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return b(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return b(this,e,t,n,!1)},l.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let s=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return _(this,e,t,n);case"ascii":case"latin1":case"binary":return x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,n);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function T(e,t,n){let r="";n=Math.min(e.length,n);for(let i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function R(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 O(e,t,n){const 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+=K[e[r]];return i}function k(e,t,n){const r=e.slice(t,n);let i="";for(let e=0;e<r.length-1;e+=2)i+=String.fromCharCode(r[e]+256*r[e+1]);return i}function L(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,n,r,i,s){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function C(e,t,n,r,i){U(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s,s>>=8,e[n++]=s;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 D(e,t,n,r,i){U(t,r,i,e,n,7);let s=Number(t&BigInt(4294967295));e[n+7]=s,s>>=8,e[n+6]=s,s>>=8,e[n+5]=s,s>>=8,e[n+4]=s;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}function M(e,t,n,r,i,s){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function P(e,t,n,r,s){return t=+t,n>>>=0,s||M(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function $(e,t,n,r,s){return t=+t,n>>>=0,s||M(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);const r=this.subarray(e,t);return Object.setPrototypeOf(r,l.prototype),r},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,s=0;for(;++s<t&&(i*=256);)r+=this[e+s]*i;return r},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e+--t],i=1;for(;t>0&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(i)<<BigInt(32))})),l.prototype.readBigUInt64BE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<<BigInt(32))+BigInt(i)})),l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=this[e],i=1,s=0;for(;++s<t&&(i*=256);)r+=this[e+s]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||L(e,t,this.length);let r=t,i=1,s=this[e+--r];for(;r>0&&(i*=256);)s+=this[e+--r]*i;return i*=128,s>=i&&(s-=Math.pow(2,8*t)),s},l.prototype.readInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)})),l.prototype.readBigInt64BE=Y((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+n)})),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);let i=1,s=0;for(this[t]=255&e;++s<n&&(i*=256);)this[t+s]=e/i&255;return t+n},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||A(this,e,t,n,Math.pow(2,8*n)-1,0);let i=n-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+n},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=Y((function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeBigUInt64BE=Y((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}let i=0,s=1,o=0;for(this[t]=255&e;++i<n&&(s*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);A(this,e,t,n,r-1,-r)}let i=n-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s|0)-o&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||A(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]=255&e,t+4},l.prototype.writeBigInt64LE=Y((function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeBigInt64BE=Y((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),l.prototype.writeFloatLE=function(e,t,n){return P(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return P(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return $(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return $(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);const i=r-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),t),i},l.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){const t=e.charCodeAt(0);("utf8"===r&&t<128||"latin1"===r)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;let i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{const s=l.isBuffer(e)?e:l.from(e,r),o=s.length;if(0===o)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=s[i%o]}return this};const B={};function F(e,t,n){B[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}`}}}function q(e){let t="",n=e.length;const r="-"===e[0]?1:0;for(;n>=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function U(e,t,n,r,i,s){if(e>n||e<t){const r="bigint"==typeof t?"n":"";let i;throw i=s>3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(s+1)}${r}`:`>= -(2${r} ** ${8*(s+1)-1}${r}) and < 2 ** ${8*(s+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new B.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,n){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,i,s)}function G(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,n){if(Math.floor(e)!==e)throw G(e,n),new B.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("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=q(String(n)):"bigint"==typeof n&&(i=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(i=q(i)),i+="n"),r+=` It must be ${t}. Received ${i}`,r}),RangeError);const V=/[^+/0-9A-Za-z-_]/g;function z(e,t){let n;t=t||1/0;const r=e.length;let i=null;const s=[];for(let o=0;o<r;++o){if(n=e.charCodeAt(o),n>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&s.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&s.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;s.push(n)}else if(n<2048){if((t-=2)<0)break;s.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;s.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return s}function W(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(V,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(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 Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function X(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let i=0;i<16;++i)t[r+i]=e[n]+e[i]}return t}();function Y(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},8339:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DataFactory=void 0;const r=n(3067),i=n(4878),s=n(458),o=n(3476),a=n(2946),l=n(7265);let c=0;t.DataFactory=class{constructor(e){this.blankNodeCounter=0,e=e||{},this.blankNodePrefix=e.blankNodePrefix||`df_${c++}_`}namedNode(e){return new o.NamedNode(e)}blankNode(e){return new r.BlankNode(e||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(e,t){return new s.Literal(e,t)}variable(e){return new l.Variable(e)}defaultGraph(){return i.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(s.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}}},8584:(e,t,n)=>{const r=n(5606),{ArrayPrototypeSlice:i,Error:s,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:d,SymbolHasInstance:h}=n(4134);e.exports=C,C.WritableState=L;const{EventEmitter:f}=n(7007),p=n(4259).Stream,{Buffer:g}=n(8287),y=n(5896),{addAbortSignal:m}=n(4147),{getHighWaterMark:b,getDefaultHighWaterMark:v}=n(5291),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:_,ERR_MULTIPLE_CALLBACK:x,ERR_STREAM_CANNOT_PIPE:S,ERR_STREAM_DESTROYED:j,ERR_STREAM_ALREADY_FINISHED:I,ERR_STREAM_NULL_VALUES:E,ERR_STREAM_WRITE_AFTER_END:N,ERR_UNKNOWN_ENCODING:T}=n(6371).codes,{errorOrDestroy:R}=y;function O(){}c(C.prototype,p.prototype),c(C,p);const k=d("kOnFinished");function L(e,t,r){"boolean"!=typeof r&&(r=t instanceof n(3370)),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?b(this,e,"writableHighWaterMark",r):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=$.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,A(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[k]=[]}function A(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function C(e){const t=this instanceof n(3370);if(!t&&!o(C,this))return new C(e);this._writableState=new L(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&m(e.signal,this)),p.call(this,e),y.construct(this,(()=>{const e=this._writableState;e.writing||U(this,e),H(this,e)}))}function D(e,t,n,i){const s=e._writableState;if("function"==typeof n)i=n,n=s.defaultEncoding;else{if(n){if("buffer"!==n&&!g.isEncoding(n))throw new T(n)}else n=s.defaultEncoding;"function"!=typeof i&&(i=O)}if(null===t)throw new E;if(!s.objectMode)if("string"==typeof t)!1!==s.decodeStrings&&(t=g.from(t,n),n="buffer");else if(t instanceof g)n="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),n="buffer"}let o;return s.ending?o=new N:s.destroyed&&(o=new j("write")),o?(r.nextTick(i,o),R(e,o,!0),o):(s.pendingcb++,function(e,t,n,r,i){const s=t.objectMode?1:n.length;t.length+=s;const 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&&"buffer"!==r&&(t.allBuffers=!1),t.allNoop&&i!==O&&(t.allNoop=!1)):(t.writelen=s,t.writecb=i,t.writing=!0,t.sync=!0,e._write(n,r,t.onwrite),t.sync=!1),o&&!t.errored&&!t.destroyed}(e,s,t,n,i))}function M(e,t,n,r,i,s,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new j("write")):n?e._writev(i,t.onwrite):e._write(i,s,t.onwrite),t.sync=!1}function P(e,t,n,r){--t.pendingcb,r(n),q(t),R(e,n)}function $(e,t){const n=e._writableState,i=n.sync,s=n.writecb;"function"==typeof s?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?r.nextTick(P,e,n,t,s):P(e,n,t,s)):(n.buffered.length>n.bufferedIndex&&U(e,n),i?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===s?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:s,stream:e,state:n},r.nextTick(B,n.afterWriteTickInfo)):F(e,n,1,s))):R(e,new x)}function B({stream:e,state:t,count:n,cb:r}){return t.afterWriteTickInfo=null,F(e,t,n,r)}function F(e,t,n,r){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));n-- >0;)t.pendingcb--,r();t.destroyed&&q(t),H(e,t)}function q(e){if(e.writing)return;for(let n=e.bufferedIndex;n<e.buffered.length;++n){var t;const{chunk:r,callback:i}=e.buffered[n],s=e.objectMode?1:r.length;e.length-=s,i(null!==(t=e.errored)&&void 0!==t?t:new j("write"))}const n=e[k].splice(0);for(let t=0;t<n.length;t++){var r;n[t](null!==(r=e.errored)&&void 0!==r?r:new j("end"))}A(e)}function U(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:n,bufferedIndex:r,objectMode:s}=t,o=n.length-r;if(!o)return;let a=r;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;const r=t.allNoop?O:e=>{for(let t=a;t<n.length;++t)n[t].callback(e)},s=t.allNoop&&0===a?n:i(n,a);s.allBuffers=t.allBuffers,M(e,t,!0,t.length,s,"",r),A(t)}else{do{const{chunk:r,encoding:i,callback:o}=n[a];n[a++]=null,M(e,t,!1,s?1:r.length,r,i,o)}while(a<n.length&&!t.writing);a===n.length?A(t):a>256?(n.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function G(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function H(e,t,n){G(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function i(i){if(n)R(e,null!=i?i:x());else if(n=!0,t.pendingcb--,i){const n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e](i);R(e,i,t.sync)}else G(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(V,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick(((e,t)=>{G(t)?V(e,t):t.pendingcb--}),e,t)):G(t)&&(t.pendingcb++,V(e,t))))}function V(e,t){t.pendingcb--,t.finished=!0;const n=t[k].splice(0);for(let e=0;e<n.length;e++)n[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}L.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},a(L.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(C,h,{__proto__:null,value:function(e){return!!o(this,e)||this===C&&e&&e._writableState instanceof L}}),C.prototype.pipe=function(){R(this,new S)},C.prototype.write=function(e,t,n){return!0===D(this,e,t,n)},C.prototype.cork=function(){this._writableState.corked++},C.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||U(this,e))},C.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!g.isEncoding(e))throw new T(e);return this._writableState.defaultEncoding=e,this},C.prototype._write=function(e,t,n){if(!this._writev)throw new _("_write()");this._writev([{chunk:e,encoding:t}],n)},C.prototype._writev=null,C.prototype.end=function(e,t,n){const i=this._writableState;let o;if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e){const n=D(this,e,t);n instanceof s&&(o=n)}return i.corked&&(i.corked=1,this.uncork()),o||(i.errored||i.ending?i.finished?o=new I("end"):i.destroyed&&(o=new j("end")):(i.ending=!0,H(this,i,!0),i.ended=!0)),"function"==typeof n&&(o||i.finished?r.nextTick(n,o):i[k].push(n)),this},l(C.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||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}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},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!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const z=y.destroy;let W;function J(){return void 0===W&&(W={}),W}C.prototype.destroy=function(e,t){const n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[k].length)&&r.nextTick(q,n),z.call(this,e,t),this},C.prototype._undestroy=y.undestroy,C.prototype._destroy=function(e,t){t(e)},C.prototype[f.captureRejectionSymbol]=function(e){this.destroy(e)},C.fromWeb=function(e,t){return J().newStreamWritableFromWritableStream(e,t)},C.toWeb=function(e){return J().newWritableStreamFromStreamWritable(e)}},8799:(e,t,n)=>{function r(e){var t=this;if(t instanceof r||(t=new r),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,i=arguments.length;n<i;n++)t.push(arguments[n]);return t}function i(e,t,n){var r=t===e.head?new a(n,null,t,e):new a(n,t,t.next,e);return null===r.next&&(e.tail=r),null===r.prev&&(e.head=r),e.length++,r}function s(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function o(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,n,r){if(!(this instanceof a))return new a(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}e.exports=r,r.Node=a,r.create=r,r.prototype.removeNode=function(e){if(e.list!==this)throw new 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},r.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||(this.tail=e),this.length++}},r.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||(this.head=e),this.length++}},r.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},r.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},r.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}},r.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}},r.prototype.forEach=function(e,t){t=t||this;for(var n=this.head,r=0;null!==n;r++)e.call(t,n.value,r,this),n=n.next},r.prototype.forEachReverse=function(e,t){t=t||this;for(var n=this.tail,r=this.length-1;null!==n;r--)e.call(t,n.value,r,this),n=n.prev},r.prototype.get=function(e){for(var t=0,n=this.head;null!==n&&t<e;t++)n=n.next;if(t===e&&null!==n)return n.value},r.prototype.getReverse=function(e){for(var t=0,n=this.tail;null!==n&&t<e;t++)n=n.prev;if(t===e&&null!==n)return n.value},r.prototype.map=function(e,t){t=t||this;for(var n=new r,i=this.head;null!==i;)n.push(e.call(t,i.value,this)),i=i.next;return n},r.prototype.mapReverse=function(e,t){t=t||this;for(var n=new r,i=this.tail;null!==i;)n.push(e.call(t,i.value,this)),i=i.prev;return n},r.prototype.reduce=function(e,t){var n,r=this.head;if(arguments.length>1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var i=0;null!==r;i++)n=e(n,r.value,i),r=r.next;return n},r.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var i=this.length-1;null!==r;i--)n=e(n,r.value,i),r=r.prev;return n},r.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},r.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},r.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,s=this.head;null!==s&&i<e;i++)s=s.next;for(;null!==s&&i<t;i++,s=s.next)n.push(s.value);return n},r.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new r;if(t<e||t<0)return n;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,s=this.tail;null!==s&&i>t;i--)s=s.prev;for(;null!==s&&i>e;i--,s=s.prev)n.push(s.value);return n},r.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,s=this.head;null!==s&&r<e;r++)s=s.next;var o=[];for(r=0;s&&r<t;r++)o.push(s.value),s=this.removeNode(s);for(null===s&&(s=this.tail),s!==this.head&&s!==this.tail&&(s=s.prev),r=0;r<n.length;r++)s=i(this,s,n[r]);return o},r.prototype.reverse=function(){for(var e=this.head,t=this.tail,n=e;null!==n;n=n.prev){var r=n.prev;n.prev=n.next,n.next=r}return this.head=t,this.tail=e,this};try{n(259)(r)}catch(e){}},9180:(e,t,n)=>{const{createNodeMap:r}=n(9233),{isKeyword:i}=n(1972),s=n(3978),o=n(2341),a=n(2207),l=n(7382),c=n(9263),{handleEvent:u}=n(2246),{RDF_FIRST:d,RDF_REST:h,RDF_NIL:f,RDF_TYPE:p,RDF_JSON_LITERAL:g,RDF_LANGSTRING:y,XSD_BOOLEAN:m,XSD_DOUBLE:b,XSD_INTEGER:v,XSD_STRING:w}=n(9378),{isAbsolute:_}=n(470),x={};function S(e,t,n,r,s){const o=Object.keys(t).sort();for(const a of o){const o=t[a],l=Object.keys(o).sort();for(let t of l){const l=o[t];if("@type"===t)t=p;else if(i(t))continue;for(const i of l){const o={termType:a.startsWith("_:")?"BlankNode":"NamedNode",value:a};if(!_(a)){s.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:a}},options:s});continue}const l={termType:t.startsWith("_:")?"BlankNode":"NamedNode",value:t};if(!_(t)){s.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:t}},options:s});continue}if("BlankNode"===l.termType&&!s.produceGeneralizedRdf){s.eventHandler&&u({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:r.getOldIds().find((e=>r.getId(e)===t))}},options:s});continue}const c=j(i,r,e,n,s.rdfDirection,s);c&&e.push({subject:o,predicate:l,object:c,graph:n})}}}}function j(e,t,n,r,i,c){const p={};if(s.isValue(e)){p.termType="Literal",p.value=void 0,p.datatype={termType:"NamedNode"};let t=e["@value"];const n=e["@type"]||null;if("@json"===n)p.value=o(t),p.datatype.value=g;else if(l.isBoolean(t))p.value=t.toString(),p.datatype.value=n||m;else if(l.isDouble(t)||n===b)l.isDouble(t)||(t=parseFloat(t)),p.value=t.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),p.datatype.value=n||b;else if(l.isNumber(t))p.value=t.toFixed(0),p.datatype.value=n||v;else if("@direction"in e&&"i18n-datatype"===i){const n=`https://www.w3.org/ns/i18n#${(e["@language"]||"").toLowerCase()}_${e["@direction"]}`;p.datatype.value=n,p.value=t}else{if("@direction"in e&&"compound-literal"===i)throw new a("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});if("@direction"in e&&i)throw new a("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:i});"@language"in e?("@direction"in e&&!i&&c.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:p.value}},options:c}),p.value=t,p.datatype.value=n||y,p.language=e["@language"]):("@direction"in e&&!i&&c.eventHandler&&u({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:p.value}},options:c}),p.value=t,p.datatype.value=n||w)}}else if(s.isList(e)){const s=function(e,t,n,r,i,s){const o={termType:"NamedNode",value:d},a={termType:"NamedNode",value:h},l={termType:"NamedNode",value:f},c=e.pop(),u=c?{termType:"BlankNode",value:t.getId()}:l;let p=u;for(const l of e){const e=j(l,t,n,r,i,s),c={termType:"BlankNode",value:t.getId()};n.push({subject:p,predicate:o,object:e,graph:r}),n.push({subject:p,predicate:a,object:c,graph:r}),p=c}if(c){const e=j(c,t,n,r,i,s);n.push({subject:p,predicate:o,object:e,graph:r}),n.push({subject:p,predicate:a,object:l,graph:r})}return u}(e["@list"],t,n,r,i,c);p.termType=s.termType,p.value=s.value}else{const t=l.isObject(e)?e["@id"]:e;p.termType=t.startsWith("_:")?"BlankNode":"NamedNode",p.value=t}return"NamedNode"!==p.termType||_(p.value)?p:(c.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:p.value}},options:c}),null)}e.exports=x,x.toRDF=(e,t)=>{const n=new c.IdentifierIssuer("_:b"),i={"@default":{}};r(e,i,"@default",n);const s=[],o=Object.keys(i).sort();for(const e of o){let r;if("@default"===e)r={termType:"DefaultGraph",value:""};else{if(!_(e)){t.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:e}},options:t});continue}r=e.startsWith("_:")?{termType:"BlankNode"}:{termType:"NamedNode"},r.value=e}S(s,i[e],r,n,t)}return s}},9198:(e,t,n)=>{const r=n(5506),i=n(3095),s=r.Readable.destroy;e.exports=r.Readable,e.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,e.exports._isUint8Array=r._isUint8Array,e.exports.isDisturbed=r.isDisturbed,e.exports.isErrored=r.isErrored,e.exports.isReadable=r.isReadable,e.exports.Readable=r.Readable,e.exports.Writable=r.Writable,e.exports.Duplex=r.Duplex,e.exports.Transform=r.Transform,e.exports.PassThrough=r.PassThrough,e.exports.addAbortSignal=r.addAbortSignal,e.exports.finished=r.finished,e.exports.destroy=r.destroy,e.exports.destroy=s,e.exports.pipeline=r.pipeline,e.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=r.Stream,e.exports.default=e.exports},9233:(e,t,n)=>{const{isKeyword:r}=n(1972),i=n(3978),s=n(7382),o=n(9263),a=n(2207),l={};e.exports=l,l.createMergedNodeMap=(e,t)=>{const n=(t=t||{}).issuer||new o.IdentifierIssuer("_:b"),r={"@default":{}};return l.createNodeMap(e,r,"@default",n),l.mergeNodeMaps(r)},l.createNodeMap=(e,t,n,c,u,d)=>{if(s.isArray(e)){for(const r of e)l.createNodeMap(r,t,n,c,void 0,d);return}if(!s.isObject(e))return void(d&&d.push(e));if(i.isValue(e)){if("@type"in e){let t=e["@type"];0===t.indexOf("_:")&&(e["@type"]=t=c.getId(t))}return void(d&&d.push(e))}if(d&&i.isList(e)){const r=[];return l.createNodeMap(e["@list"],t,n,c,u,r),void d.push({"@list":r})}if("@type"in e){const t=e["@type"];for(const e of t)0===e.indexOf("_:")&&c.getId(e)}s.isUndefined(u)&&(u=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"]),d&&d.push({"@id":u});const h=t[n],f=h[u]=h[u]||{};f["@id"]=u;const p=Object.keys(e).sort();for(let s of p){if("@id"===s)continue;if("@reverse"===s){const r={"@id":u},s=e["@reverse"];for(const e in s){const a=s[e];for(const s of a){let a=s["@id"];i.isBlankNode(s)&&(a=c.getId(a)),l.createNodeMap(s,t,n,c,a),o.addValue(h[a],e,r,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if("@graph"===s){u in t||(t[u]={}),l.createNodeMap(e[s],t,u,c);continue}if("@included"===s){l.createNodeMap(e[s],t,n,c);continue}if("@type"!==s&&r(s)){if("@index"===s&&s in f&&(e[s]!==f[s]||e[s]["@id"]!==f[s]["@id"]))throw new a("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:f});f[s]=e[s];continue}const d=e[s];if(0===s.indexOf("_:")&&(s=c.getId(s)),0!==d.length)for(let e of d)if("@type"===s&&(e=0===e.indexOf("_:")?c.getId(e):e),i.isSubject(e)||i.isSubjectReference(e)){if("@id"in e&&!e["@id"])continue;const r=i.isBlankNode(e)?c.getId(e["@id"]):e["@id"];o.addValue(f,s,{"@id":r},{propertyIsArray:!0,allowDuplicate:!1}),l.createNodeMap(e,t,n,c,r)}else if(i.isValue(e))o.addValue(f,s,e,{propertyIsArray:!0,allowDuplicate:!1});else if(i.isList(e)){const r=[];l.createNodeMap(e["@list"],t,n,c,u,r),e={"@list":r},o.addValue(f,s,e,{propertyIsArray:!0,allowDuplicate:!1})}else l.createNodeMap(e,t,n,c,u),o.addValue(f,s,e,{propertyIsArray:!0,allowDuplicate:!1});else o.addValue(f,s,[],{propertyIsArray:!0})}},l.mergeNodeMapGraphs=e=>{const t={};for(const n of Object.keys(e).sort())for(const i of Object.keys(e[n]).sort()){const s=e[n][i];i in t||(t[i]={"@id":i});const a=t[i];for(const e of Object.keys(s).sort())if(r(e)&&"@type"!==e)a[e]=o.clone(s[e]);else for(const t of s[e])o.addValue(a,e,o.clone(t),{propertyIsArray:!0,allowDuplicate:!1})}return t},l.mergeNodeMaps=e=>{const t=e["@default"],n=Object.keys(e).sort();for(const r of n){if("@default"===r)continue;const n=e[r];let s=t[r];s?"@graph"in s||(s["@graph"]=[]):t[r]=s={"@id":r,"@graph":[]};const o=s["@graph"];for(const e of Object.keys(n).sort()){const t=n[e];i.isSubjectReference(t)||o.push(t)}}return t}},9263:(e,t,n)=>{const r=n(3978),i=n(7382),s=n(989).IdentifierIssuer,o=n(2207),a=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,l=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,c=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,u="application/ld+json, application/json",d={};function h(e,t){if(i.isArray(t))for(let n=0;n<t.length;++n)t[n]=h(e,t[n]);else if(r.isList(t))t["@list"]=h(e,t["@list"]);else if(i.isObject(t)){r.isBlankNode(t)&&(t["@id"]=e.getId(t["@id"]));const n=Object.keys(t).sort();for(let r=0;r<n.length;++r){const i=n[r];"@id"!==i&&(t[i]=h(e,t[i]))}}return t}e.exports=d,d.IdentifierIssuer=s,d.REGEX_BCP47=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,d.REGEX_KEYWORD=/^@[a-zA-Z]+$/,d.clone=function(e){if(e&&"object"==typeof e){let t;if(i.isArray(e)){t=[];for(let n=0;n<e.length;++n)t[n]=d.clone(e[n])}else if(e instanceof Map){t=new Map;for(const[n,r]of e)t.set(n,d.clone(r))}else if(e instanceof Set){t=new Set;for(const n of e)t.add(d.clone(n))}else if(i.isObject(e)){t={};for(const n in e)t[n]=d.clone(e[n])}else t=e.toString();return t}return e},d.asArray=function(e){return Array.isArray(e)?e:[e]},d.buildHeaders=(e={})=>{if(Object.keys(e).some((e=>"accept"===e.toLowerCase())))throw new RangeError('Accept header may not be specified; only "'+u+'" is supported.');return Object.assign({Accept:u},e)},d.parseLinkHeader=e=>{const t={},n=e.match(a);for(let e=0;e<n.length;++e){let r=n[e].match(l);if(!r)continue;const i={target:r[1]},s=r[2];for(;r=c.exec(s);)i[r[1]]=void 0===r[2]?r[3]:r[2];const o=i.rel||"";Array.isArray(t[o])?t[o].push(i):t.hasOwnProperty(o)?t[o]=[t[o],i]:t[o]=i}return t},d.validateTypeValue=(e,t)=>{if(!(i.isString(e)||i.isArray(e)&&e.every((e=>i.isString(e))))){if(t&&i.isObject(e))switch(Object.keys(e).length){case 0:return;case 1:if("@default"in e&&d.asArray(e["@default"]).every((e=>i.isString(e))))return}throw new o('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})}},d.hasProperty=(e,t)=>{if(e.hasOwnProperty(t)){const n=e[t];return!i.isArray(n)||n.length>0}return!1},d.hasValue=(e,t,n)=>{if(d.hasProperty(e,t)){let s=e[t];const o=r.isList(s);if(i.isArray(s)||o){o&&(s=s["@list"]);for(let e=0;e<s.length;++e)if(d.compareValues(n,s[e]))return!0}else if(!i.isArray(n))return d.compareValues(n,s)}return!1},d.addValue=(e,t,n,r)=>{if("propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1),"valueIsArray"in r||(r.valueIsArray=!1),"allowDuplicate"in r||(r.allowDuplicate=!0),"prependValue"in r||(r.prependValue=!1),r.valueIsArray)e[t]=n;else if(i.isArray(n)){0===n.length&&r.propertyIsArray&&!e.hasOwnProperty(t)&&(e[t]=[]),r.prependValue&&(n=n.concat(e[t]),e[t]=[]);for(let i=0;i<n.length;++i)d.addValue(e,t,n[i],r)}else if(e.hasOwnProperty(t)){const s=!r.allowDuplicate&&d.hasValue(e,t,n);i.isArray(e[t])||s&&!r.propertyIsArray||(e[t]=[e[t]]),s||(r.prependValue?e[t].unshift(n):e[t].push(n))}else e[t]=r.propertyIsArray?[n]:n},d.getValues=(e,t)=>[].concat(e[t]||[]),d.removeProperty=(e,t)=>{delete e[t]},d.removeValue=(e,t,n,r)=>{"propertyIsArray"in(r=r||{})||(r.propertyIsArray=!1);const i=d.getValues(e,t).filter((e=>!d.compareValues(e,n)));0===i.length?d.removeProperty(e,t):1!==i.length||r.propertyIsArray?e[t]=i:e[t]=i[0]},d.relabelBlankNodes=(e,t)=>h((t=t||{}).issuer||new s("_:b"),e),d.compareValues=(e,t)=>e===t||!(!r.isValue(e)||!r.isValue(t)||e["@value"]!==t["@value"]||e["@type"]!==t["@type"]||e["@language"]!==t["@language"]||e["@index"]!==t["@index"])||!!(i.isObject(e)&&"@id"in e&&i.isObject(t)&&"@id"in t)&&e["@id"]===t["@id"],d.compareShortestLeast=(e,t)=>e.length<t.length?-1:t.length<e.length?1:e===t?0:e<t?-1:1},9325:(e,t,n)=>{var r=n(4840),i="object"==typeof self&&self&&self.Object===Object&&self,s=r||i||Function("return this")();e.exports=s},9349:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(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){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.fromRdf=u,t.toRdf=function(e,t){return t&&"namedNode"in t&&(t={dataFactory:t}),(t=t||{})&&!t.dataFactory&&(t.dataFactory=l),c.toRdf(e,t)},t.getTermRaw=function(e,t){return"Literal"===e.termType?u(e,t):e.value},t.getSupportedRdfDatatypes=function(){return c.getSupportedRdfDatatypes()},t.getSupportedJavaScriptPrimitives=function(){return c.getSupportedJavaScriptPrimitives()};const s=n(3617),o=n(4802),a=n(103);i(n(4802),t),i(n(5448),t),i(n(103),t);const l=new s.DataFactory,c=new a.Translator;function u(e,t){return c.fromRdf(e,t)}c.registerHandler(new o.TypeHandlerString,o.TypeHandlerString.TYPES.map((e=>l.namedNode(e))),["string"]),c.registerHandler(new o.TypeHandlerBoolean,[o.TypeHandlerBoolean.TYPE].map((e=>l.namedNode(e))),["boolean"]),c.registerHandler(new o.TypeHandlerNumberDouble,o.TypeHandlerNumberDouble.TYPES.map((e=>l.namedNode(e))),["number"]),c.registerHandler(new o.TypeHandlerNumberInteger,o.TypeHandlerNumberInteger.TYPES.map((e=>l.namedNode(e))),["number"]),c.registerHandler(new o.TypeHandlerDate,o.TypeHandlerDate.TYPES.map((e=>l.namedNode(e))),["object"])},9350:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},9374:(e,t,n)=>{var r=n(4128),i=n(3805),s=n(4394),o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,l=/^0o[0-7]+$/i,c=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(s(e))return NaN;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=a.test(e);return n||l.test(e)?c(e.slice(2),n?2:8):o.test(e)?NaN:+e}},9378:e=>{const t="http://www.w3.org/1999/02/22-rdf-syntax-ns#",n="http://www.w3.org/2001/XMLSchema#";e.exports={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:t,RDF_LIST:t+"List",RDF_FIRST:t+"first",RDF_REST:t+"rest",RDF_NIL:t+"nil",RDF_TYPE:t+"type",RDF_PLAIN_LITERAL:t+"PlainLiteral",RDF_XML_LITERAL:t+"XMLLiteral",RDF_JSON_LITERAL:t+"JSON",RDF_OBJECT:t+"object",RDF_LANGSTRING:t+"langString",XSD:n,XSD_BOOLEAN:n+"boolean",XSD_DOUBLE:n+"double",XSD_INTEGER:n+"integer",XSD_STRING:n+"string"}},9749:(e,t,n)=>{const r=n(8799),i=Symbol("max"),s=Symbol("length"),o=Symbol("lengthCalculator"),a=Symbol("allowStale"),l=Symbol("maxAge"),c=Symbol("dispose"),u=Symbol("noDisposeOnSet"),d=Symbol("lruList"),h=Symbol("cache"),f=Symbol("updateAgeOnGet"),p=()=>1,g=(e,t,n)=>{const r=e[h].get(t);if(r){const t=r.value;if(y(e,t)){if(b(e,r),!e[a])return}else n&&(e[f]&&(r.value.now=Date.now()),e[d].unshiftNode(r));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[l])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[l]&&n>e[l]},m=e=>{if(e[s]>e[i])for(let t=e[d].tail;e[s]>e[i]&&null!==t;){const n=t.prev;b(e,t),t=n}},b=(e,t)=>{if(t){const n=t.value;e[c]&&e[c](n.key,n.value),e[s]-=n.length,e[h].delete(n.key),e[d].removeNode(t)}};class v{constructor(e,t,n,r,i){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=i||0}}const w=(e,t,n,r)=>{let i=n.value;y(e,i)&&(b(e,n),e[a]||(i=void 0)),i&&t.call(r,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||p;if(this[o]="function"!=typeof t?p:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[l]=e.maxAge||0,this[c]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[f]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,m(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[l]=e,m(this)}get maxAge(){return this[l]}set lengthCalculator(e){"function"!=typeof e&&(e=p),e!==this[o]&&(this[o]=e,this[s]=0,this[d].forEach((e=>{e.length=this[o](e.value,e.key),this[s]+=e.length}))),m(this)}get lengthCalculator(){return this[o]}get length(){return this[s]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let n=this[d].tail;null!==n;){const r=n.prev;w(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[d].head;null!==n;){const r=n.next;w(this,e,n,t),n=r}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){this[c]&&this[d]&&this[d].length&&this[d].forEach((e=>this[c](e.key,e.value))),this[h]=new Map,this[d]=new r,this[s]=0}dump(){return this[d].map((e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,n){if((n=n||this[l])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,a=this[o](t,e);if(this[h].has(e)){if(a>this[i])return b(this,this[h].get(e)),!1;const o=this[h].get(e).value;return this[c]&&(this[u]||this[c](e,o.value)),o.now=r,o.maxAge=n,o.value=t,this[s]+=a-o.length,o.length=a,this.get(e),m(this),!0}const f=new v(e,t,a,r,n);return f.length>this[i]?(this[c]&&this[c](e,t),!1):(this[s]+=f.length,this[d].unshift(f),this[h].set(e,this[d].head),m(this),!0)}has(e){if(!this[h].has(e))return!1;const t=this[h].get(e).value;return!y(this,t)}get(e){return g(this,e,!0)}peek(e){return g(this,e,!1)}pop(){const e=this[d].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[h].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],i=r.e||0;if(0===i)this.set(r.k,r.v);else{const e=i-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[h].forEach(((e,t)=>g(this,t,!1)))}}},9925:e=>{e.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(){const{current:e,dir:t}=this,n=e.slice();let r=null,i=0;const s=e.length;for(let n=0;n<s;++n){const o=e[n],a=t.get(o);(null===r||o>r)&&(a&&n>0&&o>e[n-1]||!a&&n<s-1&&o>e[n+1])&&(r=o,i=n)}if(null===r)this.done=!0;else{const n=t.get(r)?i-1:i+1;e[i]=e[n],e[n]=r;for(const n of e)n>r&&t.set(n,!t.get(n))}return n}}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var s=t[r]={exports:{}};return e[r].call(s.exports,s,s.exports,n),s.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{anyAtomicType:()=>Un,anySimpleType:()=>qn,anyURI:()=>cr,base64Binary:()=>lr,boolean:()=>Jn,byte:()=>wr,date:()=>tr,dateTime:()=>Zn,dateTimeStamp:()=>Rr,dayTimeDuration:()=>Tr,decimal:()=>Qn,double:()=>Kn,duration:()=>Yn,float:()=>Xn,gDay:()=>sr,gMonth:()=>or,gMonthDay:()=>ir,gYear:()=>rr,gYearMonth:()=>nr,hexBinary:()=>ar,int:()=>br,integer:()=>pr,language:()=>fr,long:()=>mr,negativeInteger:()=>yr,nonNegativeInteger:()=>_r,nonPositiveInteger:()=>gr,normalizedString:()=>dr,positiveInteger:()=>Er,short:()=>vr,string:()=>Wn,time:()=>er,token:()=>hr,unsignedByte:()=>Ir,unsignedInt:()=>Sr,unsignedLong:()=>xr,unsignedShort:()=>jr,yearMonthDuration:()=>Nr});const i="http://www.w3.org/1999/02/22-rdf-syntax-ns#",s="http://www.w3.org/2001/XMLSchema#",o="http://www.w3.org/2000/10/swap/",a={xsd:{decimal:`${s}decimal`,boolean:`${s}boolean`,double:`${s}double`,integer:`${s}integer`,string:`${s}string`},rdf:{type:`${i}type`,nil:`${i}nil`,first:`${i}first`,rest:`${i}rest`,langString:`${i}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${o}reify#forSome`,forAll:`${o}reify#forAll`},log:{implies:`${o}log#implies`,isImpliedBy:`${o}log#isImpliedBy`}},{rdf:l,xsd:c}=a;let u,d=0;const h={namedNode:x,blankNode:S,variable:I,literal:j,defaultGraph:function(){return u},quad:E,triple:E,fromTerm:N,fromQuad:T},f=h;class p{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof p?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}class g extends p{get termType(){return"NamedNode"}}class y extends p{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&"@"===e[t++]?e.substr(t).toLowerCase():""}get datatype(){return new g(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,n=t<e.length?e[t]:"";return"^"===n?e.substr(t+2):"@"!==n?c.string:l.langString}equals(e){return e instanceof y?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}}class m extends p{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}}class b extends p{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}}function v(e,t,n){if(t=t||h,!e)return t.defaultGraph();switch(e[0]){case"?":return t.variable(e.substr(1));case"_":return t.blankNode(e.substr(2));case'"':if(t===h)return new y(e);if('"'===e[e.length-1])return t.literal(e.substr(1,e.length-2));const 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(v(e[0],t,!0),v(e[1],t,!0),v(e[2],t,!0),e[3]&&v(e[3],t,!0))}function w(e,t){if("string"==typeof e)return e;if(e instanceof p&&"Quad"!==e.termType)return e.id;if(!e)return u.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!==c.string?`^^${e.datatype.value}`:""}`;case"Quad":const n=[w(e.subject,!0),w(e.predicate,!0),w(e.object,!0)];return e.graph&&"DefaultGraph"!==e.graph.termType&&n.push(w(e.graph,!0)),t?n:JSON.stringify(n);default:throw new Error(`Unexpected termType: ${e.termType}`)}}u=new class extends p{constructor(){return super(""),u||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};class _ extends p{constructor(e,t,n,r){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=r||u}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 x(e){return new g(e)}function S(e){return new m(e||"n3-"+d++)}function j(e,t){if("string"==typeof t)return new y(`"${e}"@${t.toLowerCase()}`);let n=t?t.value:"";return""===n&&("boolean"==typeof e?n=c.boolean:"number"==typeof e&&(Number.isFinite(e)?n=Number.isInteger(e)?c.integer:c.double:(n=c.double,Number.isNaN(e)||(e=e>0?"INF":"-INF")))),""===n||n===c.string?new y(`"${e}"`):new y(`"${e}"^^${n}`)}function I(e){return new b(e)}function E(e,t,n,r){return new _(e,t,n,r)}function N(e){if(e instanceof p)return e;switch(e.termType){case"NamedNode":return x(e.value);case"BlankNode":return S(e.value);case"Variable":return I(e.value);case"DefaultGraph":return u;case"Literal":return j(e.value,e.language||e.datatype);case"Quad":return T(e);default:throw new Error(`Unexpected termType: ${e.termType}`)}}function T(e){if(e instanceof _)return e;if("Quad"!==e.termType)throw new Error(`Unexpected termType: ${e.termType}`);return E(N(e.subject),N(e.predicate),N(e.object),N(e.graph))}const R="http://www.w3.org/ns/shacl#",O="http://datashapes.org/dash#",k="http://www.w3.org/2001/XMLSchema#",L="http://www.w3.org/1999/02/22-rdf-syntax-ns#",A="http://www.w3.org/2000/01/rdf-schema#",C="http://www.w3.org/2004/02/skos/core#",D="http://www.w3.org/2002/07/owl#",M=f.namedNode("shapes"),P=f.namedNode(L+"type"),$=f.namedNode("http://purl.org/dc/terms/conformsTo"),B=f.namedNode(A+"subClassOf"),F=f.namedNode(C+"broader"),q=f.namedNode(D+"imports"),U=f.namedNode(D+"NamedIndividual"),G=f.namedNode(R+"NodeShape"),H=f.namedNode(R+"IRI"),V=f.namedNode(R+"class"),z=f.namedNode(R+"targetClass"),W=f.namedNode(R+"nodeKind");function J(e,t,n=R,r){let i="";const s=function(e,t,n=R,r){let i;const s=n+t;if(null==r?void 0:r.length){for(const t of r)for(const n of e)if(n.predicate.value===s){if(n.object.id.endsWith(`@${t}`))return n.object;n.object.id.indexOf("@")<0?i=n.object:i||(i=n.object)}}else for(const t of e)if(t.predicate.value===s)return t.object;return i}(e,t,n,r);return s&&(i=s.value),i}function Q(e,t){return J(e,"prefLabel",C,t)||J(e,"label",A,t)}function X(e,t,n,r){const i=[];for(const s of e)i.push({value:s,label:Q(t.getQuads(s,null,null,null),n),indent:r});return i}function K(e,t){for(const n in t)e=e.replace(t[n],"");return e}function Y(e,t,n,r,i=new Set){for(const s of t.owlImports)i.has(s.id)||(i.add(s.id),r.push(...n.getSubjects(P,e,s)));t.parent&&Y(e,t.parent,n,r,i)}function Z(e,t,n=0){let r;if(t.shaclIn){const e=t.config.lists[t.shaclIn];r=(null==e?void 0:e.length)?e:[]}else r=t.config.shapesGraph.getSubjects(P,e,M),r.push(...t.config.dataGraph.getSubjects(P,e,null)),Y(e,t,t.config.shapesGraph,r);const i=X(r,t.config.shapesGraph,t.config.languages,n);if(void 0===t.shaclIn){for(const r of t.config.shapesGraph.getSubjects(B,e,null))i.push(...Z(r,t,n+1));if(t.config.shapesGraph.getQuads(e,P,U,null).length>0){i.push(...X([e],t.config.shapesGraph,t.config.languages,n));for(const r of t.config.shapesGraph.getSubjects(F,e,null))i.push(...Z(r,t,n+1))}}return i}function ee(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol}function te(e,t,n){if(void 0===t)return n;if(void 0===n)return t;const r=e.indexOf(t.language);if(r<0)return n;const i=e.indexOf(n.language);return i<0||i>r?t:n}function ne(e,t,n){const r=document.createElement("div");r.classList.add("shacl-or-constraint");const i=[];if(i.push({label:"--- please choose ---",value:""}),t instanceof Ae){const s=[];for(let r=0;r<e.length;r++){const o=new je(e[r],t,n);s.push(o),i.push({label:o.template.label,value:r.toString()})}const o=n.theme.createListEditor("Please choose",null,!1,i),a=o.querySelector(".editor");a.onchange=()=>{a.value&&r.replaceWith(s[parseInt(a.value)])},r.appendChild(o)}else{const s=[];for(let t=0;t<e.length;t++){const r=n.shapesGraph.getQuads(e[t],null,null,null);r.length&&(s.push(r),i.push({label:Q(r,n.languages)||K(r[0].predicate.value,n.prefixes)+" = "+K(r[0].object.value,n.prefixes),value:t.toString()}))}const o=n.theme.createListEditor(t.template.label+"?",null,!1,i,t.template),a=o.querySelector(".editor");a.onchange=()=>{a.value&&r.replaceWith(Ie(t.template.clone().merge(s[parseInt(a.value)]),void 0,!0))},r.appendChild(o)}return r}const re={[`${R}name`]:(e,t)=>{const n=t;e.name=te(e.config.languages,e.name,n)},[`${R}description`]:(e,t)=>{const n=t;e.description=te(e.config.languages,e.description,n)},[`${R}path`]:(e,t)=>{e.path=t.value},[`${R}node`]:(e,t)=>{e.node=t},[`${R}datatype`]:(e,t)=>{e.datatype=t},[`${R}nodeKind`]:(e,t)=>{e.nodeKind=t},[`${R}minCount`]:(e,t)=>{e.minCount=parseInt(t.value)},[`${R}maxCount`]:(e,t)=>{e.maxCount=parseInt(t.value)},[`${R}minLength`]:(e,t)=>{e.minLength=parseInt(t.value)},[`${R}maxLength`]:(e,t)=>{e.maxLength=parseInt(t.value)},[`${R}minInclusive`]:(e,t)=>{e.minInclusive=parseInt(t.value)},[`${R}maxInclusive`]:(e,t)=>{e.maxInclusive=parseInt(t.value)},[`${R}minExclusive`]:(e,t)=>{e.minExclusive=parseInt(t.value)},[`${R}maxExclusive`]:(e,t)=>{e.maxExclusive=parseInt(t.value)},[`${R}pattern`]:(e,t)=>{e.pattern=t.value},[`${R}order`]:(e,t)=>{e.order=parseInt(t.value)},[`${O}singleLine`]:(e,t)=>{e.singleLine="true"===t.value},[`${O}readonly`]:(e,t)=>{e.readonly="true"===t.value},"http://www.w3.org/ns/oa#styleClass":(e,t)=>{e.cssClass=t.value},[`${R}and`]:(e,t)=>{e.shaclAnd=t.value},[`${R}in`]:(e,t)=>{e.shaclIn=t.value},[`${R}languageIn`]:(e,t)=>{e.languageIn=e.config.lists[t.value],e.datatype=f.namedNode(L+"langString")},[`${R}defaultValue`]:(e,t)=>{e.defaultValue=t},[`${R}hasValue`]:(e,t)=>{e.hasValue=t},[`${R}qualifiedValueShape`]:(e,t)=>{e.qualifiedValueShape=t},[`${R}qualifiedMinCount`]:(e,t)=>{e.minCount=parseInt(t.value)},[`${R}qualifiedMaxCount`]:(e,t)=>{e.maxCount=parseInt(t.value)},[q.id]:(e,t)=>{e.owlImports.push(t)},[V.id]:(e,t)=>{e.class=t;const n=e.config.shapesGraph.getSubjects(z,t,null);n.length>0&&(e.node=n[0])},[`${R}or`]:(e,t)=>{const n=e.config.lists[t.value];(null==n?void 0:n.length)?e.shaclOr=n:console.error("list not found:",t.value,"existing lists:",e.config.lists)}};class ie{constructor(e,t,n){this.label="",this.owlImports=[],this.parent=t,this.config=n,this.merge(e),this.qualifiedValueShape&&this.merge(n.shapesGraph.getQuads(this.qualifiedValueShape,null,null,null))}merge(e){var t,n;for(const n of e)null===(t=re[n.predicate.id])||void 0===t||t.call(this,this,n.object);if(this.label=(null===(n=this.name)||void 0===n?void 0:n.value)||Q(e,this.config.languages),this.label||this.shaclAnd||(this.label=this.path?K(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.extendedShapes=[],this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const e=this.config.lists[this.shaclAnd];if(null==e?void 0:e.length)for(const t of e)this.extendedShapes.push(t)}return this}clone(){const e=Object.assign({},this);return e.owlImports=[...this.owlImports],this.languageIn&&(e.languageIn=[...this.languageIn]),this.shaclOr&&(e.shaclOr=[...this.shaclOr]),e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}class se{constructor(e){let t="form { box-sizing: border-box; display:block; --label-width: 8em; --caret-size: 10px; }\nform.mode-edit { padding-left: 1em; }\nform *, form ::after, form ::before { box-sizing: inherit; }\nshacl-node, .shacl-group { display: flex; flex-direction: column; width: 100%; position: relative; }\nshacl-node .control-button { text-decoration: none; cursor: pointer; border: 1px solid transparent; border-radius: 4px; padding: 2px 4px; }\nshacl-node .control-button:hover { border-color: inherit; }\nshacl-node .remove-button { margin-left: 4px; }\nshacl-node .add-button { font-size: 0.8rem; color: #555; margin: 4px 24px 0 0; }\nshacl-node .add-button:before { content: '+'; margin-right: 0.2em; }\nshacl-node .add-button:hover { color: inherit; }\nshacl-node h1 { font-size: 1.1rem; border-bottom: 1px solid; margin-top: 4px; color: #555; }\nshacl-property { display: flex; flex-direction: column; align-items: end; position: relative; }\nshacl-property:not(.may-add) > .add-button { display: none; }\nshacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }\nshacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; }\n.shacl-group { margin-bottom: 1em; padding-bottom: 1em; }\n.mode-view .shacl-group:not(:has(shacl-property)) { display: none; }\n.property-instance, .shacl-or-constraint { display: flex; align-items: flex-start; padding: 4px 0; width: 100%; position: relative; }\n.shacl-or-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; }\n.property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; }\n.mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; }\n.property-instance.valid::before { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: green; content: '\\2713'; }\n.editor:not([type='checkbox']), .shacl-or-constraint select { flex-grow: 1; }\n.shacl-or-constraint select { border: 1px solid #DDD; padding: 2px 4px; }\nselect { overflow: hidden; text-overflow: ellipsis; }\ntextarea.editor { resize: vertical; }\n.lang-chooser { position: absolute; top: 5px; right: 24px; border: 0; background-color: #e9e9ed; padding: 2px 4px; max-width: 40px; width: 40px; box-sizing: content-box; }\n.lang-chooser+.editor { padding-right: 55px; }\n.validation-error { position: absolute; left: calc(var(--label-width) - 1em); top: 6px; color: red; cursor: help; }\n.validation-error::before { content: '\\26a0' }\n.validation-error.node { left: -1em; }\n.invalid > .editor { border-color: red !important; }\n.ml-0 { margin-left: 0 !important; }\n.pr-0 { padding-right: 0 !important; }\n.mode-view .property-instance:not(:first-child) > label { visibility: hidden; }\n.mode-view .property-instance label { width: var(--label-width); }\n\n.d-flex { display: flex; }\n.lang { opacity: 0.65; font-size: 0.6em; }\na, a:visited { color: inherit; }\n\n.fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; }\n.fadeOut { animation-direction: reverse; animation-timing-function: ease-out;}\n@keyframes fadeIn {\n 0% { opacity: 0; transform: scaleY(0.8); }\n 100% { opacity: 1; transform: scaleY(1); }\n}\n \n.collapsible > .activator { display: flex; justify-content: space-between; align-items: center; cursor: pointer; width: 100%; border: 0; padding: 8px 0; transition: 0.2s; }\n.collapsible > .activator:hover, .collapsible.open > .activator { background-color: #F5F5F5; }\n.collapsible > .activator::after { content:''; width: var(--caret-size); height: var(--caret-size); border-style: none solid solid none; border-width: calc(0.3 * var(--caret-size)); transform: rotate(45deg); transition: transform .15s ease-out; margin-right: calc(0.5 * var(--caret-size)); }\n.collapsible.open > .activator::after { transform: rotate(225deg); }\n.collapsible > *:not(.activator) { transition: all 0.2s ease-out; opacity: 1; }\n.collapsible:not(.open) > *:not(.activator) { max-height: 0; padding: 0; opacity: 0; overflow: hidden; }\n.collapsible > .property-instance > shacl-node > h1 { display: none; }\n.collapsible.open > .property-instance:nth-child(odd) { background-color: #F5F5F5; }\n.ref-link { cursor: pointer; }\n.ref-link:hover { text-decoration: underline; }\n.node-id-display { color: #999; font-size: 11px; }";e&&(t+="\n"+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t)}apply(e){}createViewer(e,t,n){const r=document.createElement("div"),i=document.createElement("label");i.innerHTML=e+":",n.description&&i.setAttribute("title",n.description.value),r.appendChild(i);let s,o=t.value,a=null;if(t instanceof g){const e=n.config.shapesGraph.getQuads(o,null,null,null);if(e.length){const t=Q(e,n.config.languages);t&&(o=t)}}else t instanceof y&&(t.language?(a=document.createElement("span"),a.classList.add("lang"),a.innerText=`@${t.language}`):t.datatype.value===`${k}date`?o=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${k}dateTime`&&(o=new Date(Date.parse(t.value)).toLocaleString()));return ee(t.value)?(s=document.createElement("a"),s.setAttribute("href",t.value)):s=document.createElement("div"),s.classList.add("d-flex"),s.innerText=o,a&&s.appendChild(a),r.appendChild(s),r}}function oe(e){return!!e&&"DefaultGraph"===e.termType}function ae(e){return e.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const le=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,ce=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/;class ue{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!le.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!ue.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",ae(e)],n=[],r=[],i=/[^/?#]*([/?#])/y;let s,o=0,a=0,l=i.lastIndex=e.length;for(;!o&&!a&&(s=i.exec(this.base));)"#"===s[1]?a=i.lastIndex-1:(t.push(ae(s[0]),"(?:"),n.push(")?"),"?"!==s[1]?r.push(l=i.lastIndex):(o=l=i.lastIndex,a=this.base.indexOf("#",o),this._pathReplacements[o]="?"));for(let e=0;e<r.length;e++)this._pathReplacements[r[e]]="../".repeat(r.length-e-1);return this._pathReplacements[r[r.length-1]]="./",this._baseLength=a>0?a:this.base.length,t.push(ae(this.base.substring(l,this._baseLength)),o?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...n].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const n=t[0].length;if(n===this._baseLength&&n===e.length)return"";const r=this._pathReplacements[n];if(r){const t=e.substring(n);return"?"===r||ce.test(t)?"./"===r&&/^[^?#]/.test(t)?t:r+t:e}return e.substring(n-1)}}const de=f.defaultGraph(),{rdf:he,xsd:fe}=a,pe=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,ge=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,ye={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class me extends p{equals(e){return e===this}}class be{constructor(e,t){if(this._prefixRegex=/$0^/,e&&"function"!=typeof e.write&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=void 0===t.end||!!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=de,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new ue(t.baseIRI)))}get _inDefaultGraph(){return de.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((null===this._subject?"":this._inDefaultGraph?".\n":"\n}\n")+(de.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(`${(null===this._subject?"":".\n")+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`:" .\n"}`}quadsToString(e){let t="";for(const n of e)t+=this.quadToString(n.subject,n.predicate,n.object,n.graph);return t}_encodeSubject(e){return"Quad"===e.termType?this._encodeQuad(e):this._encodeIriOrBlank(e)}_encodeIriOrBlank(e){if("NamedNode"!==e.termType)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)),pe.test(t)&&(t=t.replace(ge,ve));const n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(pe.test(t)&&(t=t.replace(ge,ve)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===fe.string)return`"${t}"`}else switch(e.datatype.value){case fe.string:return`"${t}"`;case fe.boolean:if("true"===t||"false"===t)return t;break;case fe.integer:if(/^[+-]?\d+$/.test(t))return t;break;case fe.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case fe.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===he.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)}${oe(r)?"":` ${this._encodeIriOrBlank(r)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,r,i){void 0===n?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):"function"==typeof r?this._writeQuad(e,t,n,de,r):this._writeQuad(e,t,n,r||de,i)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,n){const 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];"string"!=typeof r&&(r=r.value),n=!0,null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),this._subject=null,this._graph=""),this._prefixIRIs[r]=t+=":",this._write(`@prefix ${t} <${r}>.\n`)}if(n){let e="",t="";for(const n in this._prefixIRIs)e+=e?`|${n}`:n,t+=(t?"|":"")+this._prefixIRIs[n];e=ae(e),this._prefixRegex=new RegExp(`^(?:${t})[^/]*$|^(${e})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(n?"\n":"",t)}blank(e,t){let n,r,i=e;switch(void 0===e?i=[]:e.termType?i=[{predicate:e,object:t}]:"length"in e||(i=[e]),r=i.length){case 0:return new me("[]");case 1:if(n=i[0],!(n.object instanceof me))return new me(`[ ${this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)} ]`);default:let t="[";for(let s=0;s<r;s++)n=i[s],n.predicate.equals(e)?t+=`, ${this._encodeObject(n.object)}`:(t+=`${(s?";\n ":"\n ")+this._encodePredicate(n.predicate)} ${this._encodeObject(n.object)}`,e=n.predicate);return new me(`${t}\n]`)}}list(e){const t=e&&e.length||0,n=new Array(t);for(let r=0;r<t;r++)n[r]=this._encodeObject(e[r]);return new me(`(${n.join(" ")})`)}end(e){null!==this._subject&&(this._write(this._inDefaultGraph?".\n":"\n}\n"),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(e){}t&&t()}}function ve(e){let t=ye[e];return void 0===t&&(1===e.length?(t=e.charCodeAt(0).toString(16),t="\\u0000".substr(0,6-t.length)+t):(t=(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)+9216).toString(16),t="\\U00000000".substr(0,10-t.length)+t)),t}function we(e){let t=e.shaclDatatype,n=e.value;return n?e.dataset.class||e.dataset.nodeKind===R+"IRI"?f.namedNode(n):(e.dataset.lang?t=e.dataset.lang:"number"===e.type?n=parseFloat(n):"file"===e.type&&e.binaryData?n=e.binaryData:"datetime-local"===e.type&&(n=new Date(n).toISOString().slice(0,19)),f.literal(n,t)):"checkbox"!==e.type&&"checkbox"!==e.getAttribute("type")||!(e.checked||parseInt(e.dataset.minCount||"0")>0)?void 0:f.literal(e.checked?"true":"false",t)}const _e={};function xe(e){void 0===e.predicate&&void 0===e.datatype?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',e):_e[`${e.predicate}^${e.datatype}`]=e}class Se{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)}}class je extends HTMLElement{constructor(e,t,n,r){var i;if(super(),this.template=new ie(n.shapesGraph.getQuads(e,null,null,null),t,n),void 0!==this.template.order&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),n.editMode&&(this.addButton=document.createElement("a"),this.addButton.innerText=this.template.label,this.addButton.title="Add "+this.template.label,this.addButton.classList.add("control-button","add-button"),this.addButton.addEventListener("click",(e=>{const t=this.addPropertyInstance();t.classList.add("fadeIn"),this.updateControls(),function(e){var t;null===(t=e.querySelector("input,select,textarea"))||void 0===t||t.focus()}(t),setTimeout((()=>{t.classList.remove("fadeIn")}),200)})),this.appendChild(this.addButton)),this.template.path){const e=r?n.dataGraph.getQuads(r,this.template.path,null,null):[];let t=!1;for(const r of e){if(this.template.node){const e=n.shapesGraph.getObjects(this.template.node,z,null);if(e.length>0){let t=!1;for(let i=0;i<e.length&&!t;i++)n.dataGraph.getQuads(r.object,P,e[i],null).length>0&&(t=!0);if(!t)continue}}this.addPropertyInstance(r.object),this.template.hasValue&&r.object.equals(this.template.hasValue)&&(t=!0)}n.editMode&&this.template.hasValue&&!t&&this.addPropertyInstance(this.template.hasValue)}if(n.editMode&&(this.addEventListener("change",(()=>{this.updateControls()})),this.updateControls()),(null===(i=this.template.extendedShapes)||void 0===i?void 0:i.length)&&null!==this.template.config.attributes.collapse&&(!this.template.maxCount||this.template.maxCount>1)&&(n.editMode||this.childElementCount>0)){const e=this;e.classList.add("collapsible"),"open"===this.template.config.attributes.collapse&&e.classList.add("open");const t=document.createElement("h1");t.classList.add("activator"),t.innerText=this.template.label,t.addEventListener("click",(()=>{e.classList.toggle("open")})),this.prepend(t)}}addPropertyInstance(e){var t;let n;return(null===(t=this.template.shaclOr)||void 0===t?void 0:t.length)?e?n=Ie(function(e,t){if(!e.shaclOr)return console.warn("can't resolve sh:or because template has no options",e),e;if(t instanceof y){const n=t.datatype;for(const t of e.shaclOr){const r=e.config.shapesGraph.getQuads(t,null,null,null);for(const t of r)if(t.predicate.value===`${R}datatype`&&t.object.equals(n))return e.clone().merge(r)}}else{let n=e.config.dataGraph.getObjects(t,P,null);n.push(...e.config.shapesGraph.getObjects(t,P,null));for(const t of e.shaclOr){const r=e.config.shapesGraph.getQuads(t,null,null,null);for(const t of r)if(n.length>0){if(t.predicate.value===`${R}node`)for(const i of n)if(e.config.shapesGraph.getQuads(t.object,z,i,null).length>0)return e.clone().merge(r);if(t.predicate.equals(V))for(const i of n)if(t.object.equals(i))return e.clone().merge(r)}else if(t.predicate.equals(W)&&t.object.equals(H))return e.clone().merge(r)}}return console.error("couldn't resolve sh:or for value",t),e}(this.template,e),e,!0):(n=ne(this.template.shaclOr,this,this.template.config),Ee(n,"")):n=Ie(this.template,e),this.template.config.editMode?this.insertBefore(n,this.addButton):this.appendChild(n),n}updateControls(){var e;let t,n=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;0===n&&(!(null===(e=this.template.extendedShapes)||void 0===e?void 0:e.length)||void 0!==this.template.minCount&&this.template.minCount>0)&&(this.addPropertyInstance(),n=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length),t=void 0!==this.template.minCount?n>this.template.minCount:this.template.extendedShapes&&this.template.extendedShapes.length>0||n>1;const r=void 0===this.template.maxCount||n<this.template.maxCount;this.classList.toggle("may-remove",t),this.classList.toggle("may-add",r)}toRDF(e,t){for(const n of this.querySelectorAll(":scope > .property-instance")){const r=f.namedNode(n.dataset.path);if(n.firstChild instanceof Ae){const i=n.firstChild.toRDF(e);e.addQuad(t,r,i,this.template.config.valuesGraph)}else for(const i of n.querySelectorAll(":scope > .editor")){const n=we(i);n&&e.addQuad(t,r,n,this.template.config.valuesGraph)}}}}function Ie(e,t,n=!1){var r,i;let s;if(null===(r=e.extendedShapes)||void 0===r?void 0:r.length){s=document.createElement("div"),s.classList.add("property-instance");for(const n of e.extendedShapes)s.appendChild(new Ae(n,e.config,t,e.parent,e.nodeKind,e.label))}else{const n=function(e,t){let n=_e[`${e}^${t}`];return n||(n=_e[`${e}^undefined`],n||_e[`undefined^${t}`])}(e.path,null===(i=e.datatype)||void 0===i?void 0:i.value);s=n?e.config.editMode?n.createEditor(e,t):n.createViewer(e,t):function(e,t){var n,r,i;if(e.config.editMode){const s=void 0!==e.minCount&&e.minCount>0;if(e.class)return e.config.theme.createListEditor(e.label,t,s,Z(e.class,e),e);if(e.shaclIn){const n=e.config.lists[e.shaclIn];if(null==n?void 0:n.length){const r=X(n,e.config.shapesGraph,e.config.languages);return e.config.theme.createListEditor(e.label,t,s,r,e)}console.error("list not found:",e.shaclIn,"existing lists:",e.config.lists)}if((null===(n=e.datatype)||void 0===n?void 0:n.value)===`${L}langString`||(null===(r=e.languageIn)||void 0===r?void 0:r.length))return e.config.theme.createLangStringEditor(e.label,t,s,e);switch(null===(i=e.datatype)||void 0===i?void 0:i.value.replace(k,"")){case"integer":case"float":case"double":case"decimal":return e.config.theme.createNumberEditor(e.label,t,s,e);case"date":case"dateTime":return e.config.theme.createDateEditor(e.label,t,s,e);case"boolean":return e.config.theme.createBooleanEditor(e.label,t,s,e);case"base64Binary":return e.config.theme.createFileEditor(e.label,t,s,e)}return e.config.theme.createTextEditor(e.label,t,s,e)}{if(t)return e.config.theme.createViewer(e.label,t,e);const n=document.createElement("div");return n.innerHTML="No value",n}}(e,t||null),s.classList.add("property-instance")}return e.config.editMode&&Ee(s,e.label,n),s.dataset.path=e.path,s}function Ee(e,t,n=!1){const r=document.createElement("a");r.innerText="×",r.classList.add("control-button","btn","remove-button"),r.title="Remove "+t,r.addEventListener("click",(t=>{e.classList.remove("fadeIn"),e.classList.add("fadeOut"),setTimeout((()=>{const t=e.parentElement;e.remove(),null==t||t.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),200)})),n&&r.classList.add("persistent"),e.appendChild(r)}function Ne(e,t){const n=document.createElement("div");n.dataset.subject=e,n.classList.add("shacl-group");let r=e;const i=t.shapesGraph.getQuads(e,null,null,null),s=J(i,"label",A,t.languages);s&&(r=s);const o=J(i,"order");o&&(n.style.order=o);const a=document.createElement("h1");return a.innerText=r,n.appendChild(a),null!==t.attributes.collapse&&(n.classList.add("collapsible"),"open"===t.attributes.collapse&&n.classList.add("open"),a.classList.add("activator"),a.addEventListener("click",(()=>{n.classList.toggle("open")}))),n}window.customElements.define("shacl-property",je);const Te={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Re;const Oe=new Uint8Array(16),ke=[];for(let e=0;e<256;++e)ke.push((e+256).toString(16).slice(1));const Le=function(e,t,n){if(Te.randomUUID&&!t&&!e)return Te.randomUUID();const r=(e=e||{}).random??e.rng?.()??function(){if(!Re){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Re=crypto.getRandomValues.bind(crypto)}return Re(Oe)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");if(r[6]=15&r[6]|64,r[8]=63&r[8]|128,t){if((n=n||0)<0||n+16>t.length)throw new 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 function(e,t=0){return(ke[e[t+0]]+ke[e[t+1]]+ke[e[t+2]]+ke[e[t+3]]+"-"+ke[e[t+4]]+ke[e[t+5]]+"-"+ke[e[t+6]]+ke[e[t+7]]+"-"+ke[e[t+8]]+ke[e[t+9]]+"-"+ke[e[t+10]]+ke[e[t+11]]+ke[e[t+12]]+ke[e[t+13]]+ke[e[t+14]]+ke[e[t+15]]).toLowerCase()}(r)};class Ae extends HTMLElement{constructor(e,t,n,r,i,s){super(),this.owlImports=[],this.parent=r,this.config=t,this.shaclSubject=e;let o=n;if(!o){if(!i){const n=t.shapesGraph.getObjects(e,`${R}nodeKind`,null);n.length&&(i=n[0])}o=void 0===i&&t.attributes.valuesNamespace||(null==i?void 0:i.id)===`${R}IRI`?f.namedNode(t.attributes.valuesNamespace+Le()):f.blankNode(Le())}this.nodeId=o;const a=JSON.stringify([e,n]);if(n&&t.renderedNodes.has(a)){if(s&&null===t.attributes.collapse){const e=document.createElement("label");e.innerText=s,this.appendChild(e)}const e=document.createElement("a");e.innerText=n.id,e.classList.add("ref-link"),e.onclick=()=>{var e;null===(e=this.config.form.querySelector(`shacl-node[data-node-id='${this.nodeId.id}']`))||void 0===e||e.scrollIntoView()},this.appendChild(e),this.style.flexDirection="row"}else{n&&t.renderedNodes.add(a),this.dataset.nodeId=this.nodeId.id;const r=t.shapesGraph.getQuads(e,null,null,null);let i;if(null!==this.config.attributes.showNodeIds){const e=document.createElement("div");e.innerText=`id: ${this.nodeId.id}`,e.classList.add("node-id-display"),this.appendChild(e)}for(const e of r)switch(e.predicate.id){case`${R}property`:let r=this;const s=t.shapesGraph.getQuads(e.object,`${R}group`,null,null);if(s.length>0){const e=s[0].object.value;if(t.groups.indexOf(e)>-1){let n=this.querySelector(`:scope > .shacl-group[data-subject='${e}']`);n||(n=Ne(e,t),this.appendChild(n)),r=n}else console.warn("ignoring unknown group reference",s[0],"existing groups:",t.groups)}setTimeout((()=>{const i=new je(e.object,this,t,n);i.childElementCount>0&&r.appendChild(i)}));break;case`${R}and`:if(i=t.lists[e.object.value],null==i?void 0:i.length)for(const e of i)this.prepend(new Ae(e,t,n,this));else console.error("list not found:",e.object.value,"existing lists:",t.lists);break;case`${R}node`:this.prepend(new Ae(e.object,t,n,this));break;case`${R}targetClass`:this.targetClass=e.object;break;case q.id:this.owlImports.push(e.object);break;case`${R}or`:i=t.lists[e.object.value],(null==i?void 0:i.length)?this.appendChild(ne(i,this,t)):console.error("list not found:",e.object.value,"existing lists:",t.lists)}if(s){const e=document.createElement("h1");e.innerText=s,this.prepend(e)}}}toRDF(e,t){t||(t=this.nodeId);for(const n of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))n.toRDF(e,t);return this.targetClass&&e.addQuad(t,P,this.targetClass,this.config.valuesGraph),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,f.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraph),t}}window.customElements.define("shacl-node",Ae);var Ce=n(9198);const De=Symbol("iter");function Me(e,t,n=4){if(0===n)return Object.assign(e,t);for(const r in t)e[r]=Me(e[r]||Object.create(null),t[r],n-1);return e}function Pe(e,t,n=4){let r=!1;for(const i in e)if(i in t){const s=0===n?null:Pe(e[i],t[i],n-1);if(!1!==s)r=r||Object.create(null),r[i]=s;else if(3===n)return!1}return r}function $e(e,t,n=4){let r=!1;for(const i in e)if(i in t){if(0!==n){const s=$e(e[i],t[i],n-1);if(!1!==s)r=r||Object.create(null),r[i]=s;else if(3===n)return!1}}else r=r||Object.create(null),r[i]=0===n?null:Me({},e[i],n-1);return r}class Be{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||f}_termFromId(e){if("."===e[0]){const t=this._entities,n=e.split(".");return this._factory.quad(this._termFromId(t[n[1]]),this._termFromId(t[n[2]]),this._termFromId(t[n[3]]),n[4]&&this._termFromId(t[n[4]]))}return v(e,this._factory)}_termToNumericId(e){if("Quad"===e.termType){const t=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),r=this._termToNumericId(e.object);let i;return t&&n&&r&&(oe(e.graph)||(i=this._termToNumericId(e.graph)))&&this._ids[i?`.${t}.${n}.${r}.${i}`:`.${t}.${n}.${r}`]}return this._ids[w(e)]}_termToNewNumericId(e){const t=e&&"Quad"===e.termType?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${oe(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:w(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+n++;else do{t="_:b"+this._blankNodeIndex++}while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class Fe{constructor(e,t){this._size=0,this._graphs=Object.create(null),t||!e||e[0]||"function"==typeof e.match||(t=e,e=null),t=t||{},this._factory=t.factory||f,this._entityIndex=t.entityIndex||new Be({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(null!==e)return e;e=0;const t=this._graphs;let n,r;for(const i in t)for(const s in n=t[i].subjects)for(const t in r=n[s])e+=Object.keys(r[t]).length;return this._size=e}_addToIndex(e,t,n,r){const i=e[t]||(e[t]={}),s=i[n]||(i[n]={}),o=r in s;return o||(s[r]=null),!o}_removeFromIndex(e,t,n,r){const i=e[t],s=i[n];delete s[r];for(const e in s)return;delete i[n];for(const e in i)return;delete e[t]}*_findInIndex(e,t,n,r,i,s,o,a){let l,c,u;const d=this._entities,h=this._termFromId(d[a]),f={subject:null,predicate:null,object:null};t&&((l=e,e={})[t]=l[t]);for(const t in e)if(c=e[t]){f[i]=this._termFromId(d[t]),n&&((l=c,c={})[n]=l[n]);for(const e in c)if(u=c[e]){f[s]=this._termFromId(d[e]);const t=r?r in u?[r]:[]:Object.keys(u);for(let e=0;e<t.length;e++)f[o]=this._termFromId(d[t[e]]),yield this._factory.quad(f.subject,f.predicate,f.object,h)}}}_loop(e,t){for(const 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,s,o;if((i=e[t])&&(s=i[n]))for(o in s)r(o)}_countInIndex(e,t,n,r){let i,s,o,a=0;t&&((i=e,e={})[t]=i[t]);for(const t in e)if(s=e[t]){n&&((i=s,s={})[n]=i[n]);for(const e in s)(o=s[e])&&(r?r in o&&a++:a+=Object.keys(o).length)}return a}_getGraphs(e){return"number"!=typeof(e=""===e?1:e&&(this._termToNumericId(e)||-1))?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const t=Object.create(null);return n=>{n in t||(t[n]=!0,e(this._termFromId(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,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)}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;const i=this._graphs;let s,o,a;if(!((e=e&&this._termToNumericId(e))&&(t=t&&this._termToNumericId(t))&&(n=n&&this._termToNumericId(n))&&(s=i[r])&&(o=s.subjects[e])&&(a=o[t])&&n in a))return!1;for(e in this._removeFromIndex(s.subjects,e,t,n),this._removeFromIndex(s.predicates,t,n,e),this._removeFromIndex(s.objects,n,e,t),null!==this._size&&this._size--,s.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){const i=new Ce.Readable({objectMode:!0}),s=this.readQuads(e,t,n,r);return i._read=e=>{for(;--e>=0;){const{done:e,value:t}=s.next();if(e)return void i.push(null);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){const i=this._getGraphs(r);let s,o,a,l;if(!(e&&!(o=this._termToNumericId(e))||t&&!(a=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(const e in i)(s=i[e])&&(o?l?yield*this._findInIndex(s.objects,l,o,a,"object","subject","predicate",e):yield*this._findInIndex(s.subjects,o,a,null,"subject","predicate","object",e):a?yield*this._findInIndex(s.predicates,a,l,null,"predicate","object","subject",e):l?yield*this._findInIndex(s.objects,l,null,null,"object","subject","predicate",e):yield*this._findInIndex(s.subjects,null,null,null,"subject","predicate","object",e))}match(e,t,n,r){return new Ue(this,e,t,n,r,{entityIndex:this._entityIndex})}countQuads(e,t,n,r){const i=this._getGraphs(r);let s,o,a,l,c=0;if(e&&!(o=this._termToNumericId(e))||t&&!(a=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n)))return 0;for(const r in i)(s=i[r])&&(c+=e?n?this._countInIndex(s.objects,l,o,a):this._countInIndex(s.subjects,o,a,l):t?this._countInIndex(s.predicates,a,l,o):this._countInIndex(s.objects,l,o,a));return c}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(const s of this.readQuads(t,n,r,i))if(e(s,this))return!0;return!1}getSubjects(e,t,n){const r=[];return this.forSubjects((e=>{r.push(e)}),e,t,n),r}forSubjects(e,t,n,r){const i=this._getGraphs(r);let s,o,a;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(a=this._termToNumericId(n))))for(r in i)(s=i[r])&&(o?a?this._loopBy2Keys(s.predicates,o,a,e):this._loopByKey1(s.subjects,o,e):a?this._loopByKey0(s.objects,a,e):this._loop(s.subjects,e))}getPredicates(e,t,n){const r=[];return this.forPredicates((e=>{r.push(e)}),e,t,n),r}forPredicates(e,t,n,r){const i=this._getGraphs(r);let s,o,a;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(a=this._termToNumericId(n))))for(r in i)(s=i[r])&&(o?a?this._loopBy2Keys(s.objects,a,o,e):this._loopByKey0(s.subjects,o,e):a?this._loopByKey1(s.predicates,a,e):this._loop(s.predicates,e))}getObjects(e,t,n){const r=[];return this.forObjects((e=>{r.push(e)}),e,t,n),r}forObjects(e,t,n,r){const i=this._getGraphs(r);let s,o,a;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(a=this._termToNumericId(n))))for(r in i)(s=i[r])&&(o?a?this._loopBy2Keys(s.subjects,o,a,e):this._loopByKey1(s.objects,o,e):a?this._loopByKey0(s.predicates,a,e):this._loop(s.objects,e))}getGraphs(e,t,n){const r=[];return this.forGraphs((e=>{r.push(e)}),e,t,n),r}forGraphs(e,t,n,r){for(const 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}={}){const n={},r=t?()=>!0:(e,t)=>{throw new Error(`${e.value} ${t}`)},i=this.getQuads(null,a.rdf.rest,a.rdf.nil,null),s=e?[...i]:[];return i.forEach((t=>{const i=[];let o,l,c=!1;const u=t.graph;let d=t.subject;for(;d&&!c;){const e=this.getQuads(null,null,d,null),t=this.getQuads(d,null,null,null);let n,h=null,f=null,p=null;for(let i=0;i<t.length&&!c;i++)n=t[i],n.graph.equals(u)?o?c=r(d,"has non-list arcs out"):n.predicate.value===a.rdf.first?h?c=r(d,"has multiple rdf:first arcs"):s.push(h=n):n.predicate.value===a.rdf.rest?f?c=r(d,"has multiple rdf:rest arcs"):s.push(f=n):e.length?c=r(d,"can't be subject and object"):(o=n,l="subject"):c=r(d,"not confined to single graph");for(let t=0;t<e.length&&!c;++t)n=e[t],o?c=r(d,"can't have coreferences"):n.predicate.value===a.rdf.rest?p?c=r(d,"has incoming rdf:rest arcs"):p=n:(o=n,l="object");h?i.unshift(h.object):c=r(d,"has no list head"),d=p&&p.subject}c?e=!1:o&&(n[o[l].value]=i)})),e&&this.removeQuads(s),n}addAll(e){if(e instanceof Ue&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof Fe&&e._entityIndex===this._entityIndex)0!==e._size&&(this._graphs=Me(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof Ue&&(e=e.filtered),e===this)return!0;if(!(e instanceof Fe)||this._entityIndex!==e._entityIndex)return e.every((e=>this.has(e)));const t=this._graphs,n=e._graphs;let r,i,s,o,a;for(const e in n){if(!(r=t[e]))return!1;r=r.subjects;for(const t in i=n[e].subjects){if(!(s=r[t]))return!1;for(const e in o=i[t]){if(!(a=s[e]))return!1;for(const t in o[e])if(!(t in a))return!1}}}return!0}deleteMatches(e,t,n,r){for(const i of this.match(e,t,n,r))this.removeQuad(i);return this}difference(e){if(e&&e instanceof Ue&&(e=e.filtered),e===this)return new Fe({entityIndex:this._entityIndex});if(e instanceof Fe&&e._entityIndex===this._entityIndex){const t=new Fe({entityIndex:this._entityIndex}),n=$e(this._graphs,e._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter((t=>!e.has(t)))}equals(e){return e instanceof Ue&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new Fe({entityIndex:this._entityIndex});for(const n of this)e(n,this)&&t.add(n);return t}intersection(e){if(e instanceof Ue&&(e=e.filtered),e===this){const e=new Fe({entityIndex:this._entityIndex});return e._graphs=Me(Object.create(null),this._graphs),e._size=this._size,e}if(e instanceof Fe&&this._entityIndex===e._entityIndex){const t=new Fe({entityIndex:this._entityIndex}),n=Pe(e._graphs,this._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter((t=>e.has(t)))}map(e){const t=new Fe({entityIndex:this._entityIndex});for(const n of this)t.add(e(n,this));return t}reduce(e,t){const n=this.readQuads();let r=void 0===t?n.next().value:t;for(const t of n)r=e(r,t,this);return r}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return(new be).quadsToString(this)}union(e){const t=new Fe({entityIndex:this._entityIndex});return t._graphs=Me(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function qe(e,t,n=0){const r=t[n];if(r&&!(r in e))return!1;let i=!1;for(const s in r?{[r]:e[r]}:e){const r=2===n?null:qe(e[s],t,n+1);!1!==r&&(i=i||Object.create(null),i[s]=r)}return i}class Ue extends Ce.Readable{constructor(e,t,n,r,i,s){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:n,object:r,graph:i,options:s})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:n,predicate:r,subject:i}=this,s=this._filtered=new Fe({factory:e._factory,entityIndex:this.options.entityIndex});let o,a,l;if(i&&!(o=s._termToNumericId(i))||r&&!(a=s._termToNumericId(r))||n&&!(l=s._termToNumericId(n)))return s;const c=e._getGraphs(t);for(const e in c){let t,n,r,i;(i=c[e])&&(!o&&a?(n=qe(i.predicates,[a,l,o]))&&(t=qe(i.subjects,[o,a,l]),r=qe(i.objects,[l,o,a])):l?(r=qe(i.objects,[l,o,a]))&&(t=qe(i.subjects,[o,a,l]),n=qe(i.predicates,[a,l,o])):(t=qe(i.subjects,[o,a,l]))&&(n=qe(i.predicates,[a,l,o]),r=qe(i.objects,[l,o,a])),t&&(s._graphs[e]={subjects:t,predicates:n,objects:r}))}s._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[De]&&(this[De]=this[Symbol.iterator]());const t=this[De];for(;--e>=0;){const{done:e,value:n}=t.next();if(e)return void this.push(null);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 be).quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,n,r){return new Ue(this.filtered,e,t,n,r,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}var Ge=n(8287);const{xsd:He}=a,Ve=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,ze={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},We=/[\x00-\x20<>\\"\{\}\|\^\`]/,Je={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},Qe=/$0^/;class Xe{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const e in this)!(e in Je)&&this[e]instanceof RegExp&&(this[e]=Qe)}else this._n3Mode=!1!==e.n3;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;const a=this._line,l=n[0];let c="",u="",d="",h=null,f=0,p=!1;switch(l){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(f=1,c="^");break}if(this._previousMarker="^^",n=n.substr(2),"<"!==n[0]){p=!0;break}case"<":if(h=this._unescapedIri.exec(n))c="IRI",u=h[1];else if(h=this._iri.exec(n)){if(u=this._unescape(h[1]),null===u||We.test(u))return s(this);c="IRI"}else n.length>1&&"<"===n[1]?(c="<<",f=2):this._n3Mode&&n.length>1&&"="===n[1]&&(f=2,this._isImpliedBy?(c="abbreviation",u="<"):(c="inverse",u=">"));break;case">":n.length>1&&">"===n[1]&&(c=">>",f=2);break;case"_":((h=this._blank.exec(n))||t&&(h=this._blank.exec(`${n} `)))&&(c="blank",d="_",u=h[1]);break;case'"':if(h=this._simpleQuotedString.exec(n))u=h[1];else if(({value:u,matchLength:f}=this._parseLiteral(n)),null===u)return s(this);null===h&&0===f||(c="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(h=this._simpleApostropheString.exec(n))u=h[1];else if(({value:u,matchLength:f}=this._parseLiteral(n)),null===u)return s(this);null===h&&0===f||(c="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(h=this._variable.exec(n))&&(c="var",u=h[0]);break;case"@":"literal"===this._previousMarker&&(h=this._langcode.exec(n))?(c="langcode",u=h[1]):(h=this._keyword.exec(n))&&(c=h[0]);break;case".":if(1===n.length?t:n[1]<"0"||n[1]>"9"){c=".",f=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(h=this._number.exec(n)||t&&(h=this._number.exec(`${n} `)))&&(c="literal",u=h[0],d="string"==typeof h[1]?He.double:"string"==typeof h[2]?He.decimal:He.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(h=this._sparqlKeyword.exec(n))?c=h[0].toUpperCase():p=!0;break;case"f":case"t":(h=this._boolean.exec(n))?(c="literal",u=h[0],d=He.boolean):p=!0;break;case"a":(h=this._shortPredicates.exec(n))?(c="abbreviation",u="a"):p=!0;break;case"=":this._n3Mode&&n.length>1&&(c="abbreviation",">"!==n[1]?(f=1,u="="):(f=2,u=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(f=1,c=l);break;case"{":!this._lineMode&&n.length>=2&&("|"===n[1]?(c="{|",f=2):(c=l,f=1));break;case"|":n.length>=2&&"}"===n[1]&&(c="|}",f=2);break;default:p=!0}if(p&&("@prefix"!==this._previousMarker&&"PREFIX"!==this._previousMarker||!(h=this._prefix.exec(n))?((h=this._prefixed.exec(n))||t&&(h=this._prefixed.exec(`${n} `)))&&(c="prefixed",d=h[1]||"",u=this._unescape(h[2])):(c="prefix",u=h[1]||"")),"^^"===this._previousMarker)switch(c){case"prefixed":c="type";break;case"IRI":c="typeIRI";break;default:c=""}if(!c)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?s(this):this._input=n;const g=f||h[0].length,y=i(c,u,d,a,g);this.previousToken=y,this._previousMarker=c,n=n.substr(g,n.length)}function i(t,i,s,o,a){const l=n?r-n.length:r,c={type:t,value:i,prefix:s,line:o,start:l,end:l+a};return e(null,c),c}function s(t){e(t._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(Ve,((e,n,r,i)=>{if("string"==typeof n)return String.fromCharCode(Number.parseInt(n,16));if("string"==typeof r){let e=Number.parseInt(r,16);return e<=65535?String.fromCharCode(Number.parseInt(r,16)):String.fromCharCode(55296+((e-=65536)>>10),56320+(1023&e))}return i in ze?ze[i]:(t=!0,"")}));return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let 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){const t=e.substring(n,r),i=t.split(/\r\n|\r|\n/).length-1,s=r+n;if(1===n&&0!==i||3===n&&this._lineMode)break;return this._line+=i,{value:this._unescape(t),matchLength:s}}r++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\ufeff")?e.substr(1):e}tokenize(e,t){if(this._line=1,"string"==typeof e){if(this._input=this._readStartingBom(e),"function"!=typeof t){const e=[];let t;if(this._tokenizeToEnd(((n,r)=>n?t=n:e.push(r)),!0),t)throw t;return e}queueMicrotask((()=>this._tokenizeToEnd(t,!0)))}else this._pendingBuffer=null,"function"==typeof e.setEncoding&&e.setEncoding("utf8"),e.on("data",(e=>{null!==this._input&&0!==e.length&&(this._pendingBuffer&&(e=Ge.Buffer.concat([this._pendingBuffer,e]),this._pendingBuffer=null),128&e[e.length-1]?this._pendingBuffer=e:(void 0===this._input?this._input=this._readStartingBom("string"==typeof e?e:e.toString()):this._input+=e,this._tokenizeToEnd(t,!1)))})),e.on("end",(()=>{"string"==typeof this._input&&this._tokenizeToEnd(t,!0)})),e.on("error",t)}}let Ke=0;class Ye{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&et(this,e.factory);const t="string"==typeof e.format?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),r=/trig/.test(t),i=/triple/.test(t),s=/quad/.test(t),o=this._n3Mode=/n3/.test(t),a=i||s;(this._supportsNamedGraphs=!(n||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||r||i||o),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=""===t||/star|\*$/.test(t),a&&(this._resolveRelativeIRI=e=>null),this._blankNodePrefix="string"!=typeof e.blankNodePrefix?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new Xe({lineMode:a,n3:o,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Ke=0}_setBase(e){if(e){const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}else this._base="",this._basePath=""}_saveContext(e,t,n,r,i){const s=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:r,object:i,graph:t,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return null!==this._graph?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case"IRI":case"typeIRI":const t=this._resolveIRI(e.value);if(null===t)return this._error("Invalid IRI",e);n=this._factory.namedNode(t);break;case"type":case"prefixed":const r=this._prefixes[e.prefix];if(void 0===r)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(0===e.prefix.length)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(void 0===(this._subject=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return null===this._predicate?this._error(`Unexpected ${t}`,e):(this._subject=null,"]"===t?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return null!==this._predicate?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if(void 0===(this._predicate=this._readEntity(e)))return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(0===e.prefix.length)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(void 0===(this._object=this._readEntity(e)))return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return"{"===e.type?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return"{"!==e.type?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return"]"===e.type?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if("]"!==e.type)return this._readBlankNodePunctuation(e);null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=null===this._predicate;return this._restoreContext("blank",e),null!==this._object?this._getContextEndReader():null!==this._predicate?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,r=this._readListItem;const i=this._subject,s=this._contextStack,o=s[s.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),0!==s.length&&"list"===s[s.length-1].type&&this._emit(this._subject,this._predicate,this._object,this._graph),null===this._predicate){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":0===e.prefix.length?(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(void 0===(t=this._readEntity(e)))return}if(null===n&&(this._subject=n=this._factory.blankNode()),null===i?null===o.predicate?o.subject=n:o.object=n:this._emit(i,this.RDF_REST,n,this._graph),null!==t){if(this._n3Mode&&("IRI"===e.type||"prefixed"===e.type))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":const n=this._readEntity(e);if(void 0===n)return;t=this._factory.literal(this._literalValue,n),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),null===n.token?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return"}"!==e.type?this._readPunctuation(e):(null!==this._subject&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),null===this._object?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const r=this._subject,i=this._inversePredicate;switch(e.type){case"}":if(null===this._graph)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);const s=this._predicate,o=this._object;this._subject=this._factory.quad(r,s,o,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if("Quad"!==this._subject.termType)return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&null===this._graph&&void 0!==(n=this._readEntity(e))){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(null!==r){const 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._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return"prefix"!==e.type?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if("IRI"!==e.type)return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t="IRI"===e.type&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return"]"!==e.type?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):"."!==e.type?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if(void 0!==(t=this._readEntity(e,!0)))break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(null===this._subject?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return","===e.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&"item"===n.type){const 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;const r=this._factory.blankNode();if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(t=this._subject,this._subject=r):(t=this._object,this._object=r),this._emit(t,n,r,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let n,r;if(void 0!==(n=this._readEntity(e)))return null===this._predicate?(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._supportsQuads&&null===this._graph&&void 0!==(this._graph=this._readEntity(e))?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(">>"!==e.type)return this._error(`Expected >> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),null===this._subject?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,r){this._callback(null,this._factory.quad(e,t,n,r||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=Ze}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let n="",r=-1,i=-1,s=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[1+ ++r],o){case"/":n+=e.substring(s,r-1),s=r+1;break;case void 0:case"?":case"#":return n+e.substring(s,r)+e.substr(r+1);case".":if(o=e[1+ ++r],void 0===o||"/"===o||"?"===o||"#"===o){if(n+=e.substring(s,r-2),(s=n.lastIndexOf("/"))>=i&&(n=n.substr(0,s)),"/"!==o)return`${n}/${e.substr(r+1)}`;s=r+1}}}o=e[++r]}return n+e.substring(s)}parse(e,t,n){let r,i,s;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(r=t.onQuad,i=t.onPrefix,s=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${Ke++}_`,this._prefixCallback=i||Ze,this._inversePredicate=!1,this._quantified=Object.create(null),!r){const t=[];let 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)=>{null!==e?(this._callback(e),this._callback=Ze):this._readCallback&&(this._readCallback=this._readCallback(t))};s&&(this._lexer.comments=!0,o=(e,t)=>{null!==e?(this._callback(e),this._callback=Ze):this._readCallback&&("comment"===t.type?s(t.value):this._readCallback=this._readCallback(t))}),this._callback=r,this._lexer.tokenize(e,o)}}function Ze(){}function et(e,t){e._factory=t,e.DEFAULTGRAPH=t.defaultGraph(),e.RDF_FIRST=t.namedNode(a.rdf.first),e.RDF_REST=t.namedNode(a.rdf.rest),e.RDF_NIL=t.namedNode(a.rdf.nil),e.N3_FORALL=t.namedNode(a.r.forAll),e.N3_FORSOME=t.namedNode(a.r.forSome),e.ABBREVIATIONS={a:t.namedNode(a.rdf.type),"=":t.namedNode(a.owl.sameAs),">":t.namedNode(a.log.implies),"<":t.namedNode(a.log.isImpliedBy)},e.QUANTIFIERS_GRAPH=t.namedNode("urn:n3:quantifiers")}et(Ye.prototype,f);var tt=n(4841),nt=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};const rt={},it={};let st;class ot{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}loadGraphs(){return nt(this,void 0,void 0,(function*(){this.loadedExternalUrls=[],this.loadedClasses=[];let e=st;const t=new Fe;this.config.prefixes={};const n=[this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",t,void 0,new Ye({blankNodePrefix:""}))];if(e||(e=new Fe,n.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",e,M))),yield Promise.all(n),!st&&0==(null==e?void 0:e.size)&&this.config.attributes.valuesSubject){const n=[...t.getObjects(this.config.attributes.valuesSubject,P,null),...t.getObjects(this.config.attributes.valuesSubject,$,null)],r=[];for(const t of n){const n=this.toURL(t.value);n&&this.loadedExternalUrls.indexOf(n)<0&&(this.loadedExternalUrls.push(n),r.push(this.importRDF(this.fetchRDF(n),e,M)))}try{yield Promise.allSettled(r)}catch(e){console.warn(e)}}this.config.shapesGraph=e,this.config.dataGraph=t}))}importRDF(e,t,n,r){return nt(this,void 0,void 0,(function*(){const i=r||new Ye,s=e=>nt(this,void 0,void 0,(function*(){const s=[];yield new Promise(((o,a)=>{i.parse(e,((e,i,l)=>{if(e)return console.warn("failed parsing graph",n,e.message),a(e);if(i){if(t.add(new _(i.subject,i.predicate,i.object,n)),null===this.config.attributes.ignoreOwlImports&&q.equals(i.predicate)){const e=this.toURL(i.object.value);e&&this.loadedExternalUrls.indexOf(e)<0&&(this.loadedExternalUrls.push(e),s.push(this.importRDF(this.fetchRDF(e),t,f.namedNode(e),r)))}if(this.config.classInstanceProvider&&V.equals(i.predicate)){const e=i.object.value;if(this.loadedClasses.indexOf(e)<0){let i;e in it?i=it[e]:(i=this.config.classInstanceProvider(e),it[e]=i),this.loadedClasses.push(e),s.push(this.importRDF(i,t,n,r))}}}else l&&this.config.registerPrefixes(l),o(null)}))}));try{yield Promise.allSettled(s)}catch(e){console.warn(e)}}));if(e instanceof Promise&&(e=yield e),e){try{e=yield(0,tt.toRDF)(JSON.parse(e),{format:"application/n-quads"})}catch(e){}yield s(e)}}))}fetchRDF(e){return nt(this,void 0,void 0,(function*(){if(e in rt)return rt[e];const t=fetch(e,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then((e=>e.text()));return rt[e]=t,t}))}toURL(e){if(ee(e))return e;if(this.config.prefixes){const t=e.split(":");if(2===t.length){const n=this.config.prefixes[t[0]];if(n&&ee(e=e.replace(`${t[0]}:`,n)))return e}}return null}}function at(e){st=e}class lt{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class ct{constructor(e,t){this.attributes=new lt,this.loader=new ot(this),this.prefixes={},this.editMode=!0,this.dataGraph=new Fe,this.lists={},this.groups=[],this.renderedNodes=new Set,this._shapesGraph=new Fe,this.theme=e,this.form=t,this.languages=[...new Set(navigator.languages.flatMap((e=>e.length>2?[e.toLocaleLowerCase(),e.substring(0,2)]:e))),""]}updateAttributes(e){const t=new lt;if(Object.keys(t).forEach((n=>{const r=e.dataset[n];void 0!==r&&(t[n]=r)})),this.editMode=null===t.view,this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const e=this.languages.indexOf(t.language);e>-1&&this.languages.splice(e,1),this.languages.unshift(t.language)}this.valuesGraph=t.valuesGraph?f.namedNode(t.valuesGraph):void 0}static dataAttributes(){const e=new lt;return Object.keys(e).map((e=>"data-"+e.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))))}get shapesGraph(){return this._shapesGraph}set shapesGraph(e){this._shapesGraph=e,this.lists=e.extractLists(),this.groups=[],e.forSubjects((e=>{this.groups.push(e.id)}),P,`${R}PropertyGroup`,null)}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}const ut=function(e){return"<"+e.value+">"},dt=/["\\\\\n\r]/,ht=/["\\\\\n\r]/g,ft={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function pt(e){return ft[e]}const gt=function e(t){if(!t)return null;if("BlankNode"===t.termType)return function(e){return"_:"+e.value}(t);if("DefaultGraph"===t.termType)return"";if("Literal"===t.termType)return function(e){const t=(n=e.value,dt.test(n)?n.replace(ht,pt):n);var n;return"http://www.w3.org/2001/XMLSchema#string"===e.datatype.value?'"'+t+'"':"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"===e.datatype.value?'"'+t+'"@'+e.language:'"'+t+'"^^'+ut(e.datatype)}(t);if("NamedNode"===t.termType)return ut(t);if("Quad"===t.termType||t.subject&&t.predicate&&t.object&&t.graph)return function(e,t){const n=t(e.subject),r=t(e.predicate),i=t(e.object),s=t(e.graph);return`${n} ${r} ${i} ${s?s+" ":""}.`}(t,e);if("Variable"===t.termType)return function(e){return"?"+e.value}(t);if(t[Symbol.iterator])return function(e,t){return[...e].map((e=>t(e))).join("\n")+"\n"}(t,e);throw new Error(`unknown termType ${t.termType}`)};class yt{constructor(e){if(this.index=new Map,e)for(const[t,n]of e)this.set(t,n)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(gt(e))}*entries(){for(const[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}get(e){const t=this.index.get(gt(e));return t&&t.value}has(e){return this.index.has(gt(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const n=gt(e);return this.index.set(n,{term:e,value:t}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}const mt=yt;function bt(e){try{return gt(e)}catch(e){return null}}class vt{constructor(e){if(this.index=new Map,e)for(const t of e)this.add(t)}get size(){return this.index.size}add(e){const t=gt(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return!!e&&this.index.delete(bt(e))}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return!!e&&this.index.has(bt(e))}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}const wt=vt,_t=class{constructor({dataset:e,end:t,quad:n,start:r}){this.dataset=e,this.end=t,this.quad=n,this.start=r}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}};class xt{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}xt.prototype.termType="BlankNode";const St=xt;class jt{equals(e){return!!e&&e.termType===this.termType}}jt.prototype.termType="DefaultGraph",jt.prototype.value="";const It=jt,Et=function(e,t){if(!t)return null;if("BlankNode"===t.termType)return e.blankNode(t.value);if("DefaultGraph"===t.termType)return e.defaultGraph();if("Literal"===t.termType)return e.literal(t.value,t.language||e.namedNode(t.datatype.value));if("NamedNode"===t.termType)return e.namedNode(t.value);if("Quad"===t.termType){const n=e.fromTerm(t.subject),r=e.fromTerm(t.predicate),i=e.fromTerm(t.object),s=e.fromTerm(t.graph);return e.quad(n,r,i,s)}if("Variable"===t.termType)return e.variable(t.value);throw new Error(`unknown termType ${t.termType}`)};class Nt{constructor(e,t,n){this.value=e,this.language=t,this.datatype=n}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)}}Nt.prototype.termType="Literal";const Tt=Nt;class Rt{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}Rt.prototype.termType="NamedNode";const Ot=Rt;class kt{constructor(e,t,n,r){this.subject=e,this.predicate=t,this.object=n,this.graph=r}equals(e){return!!e&&("Quad"===e.termType||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}}kt.prototype.termType="Quad",kt.prototype.value="";const Lt=kt;class At{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}}At.prototype.termType="Variable";const Ct=At,Dt=new Ot("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),Mt=new Ot("http://www.w3.org/2001/XMLSchema#string");class Pt{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new It}}namedNode(e){return new Ot(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new St(e)}literal(e,t){return"string"==typeof t?new Tt(e,t,Dt):new Tt(e,"",t||Mt)}variable(e){return new Ct(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,n,r=this.defaultGraph()){return new Lt(e,t,n,r)}fromTerm(e){return Et(this,e)}fromQuad(e){return Et(this,e)}}Pt.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const $t=new Pt,Bt={apply:(e,t,n)=>e(n[0]),get:(e,t)=>e(t)},Ft=function(e,{factory:t=$t}={}){const n=(n="")=>t.namedNode(`${e}${n.raw||n}`);return"undefined"==typeof Proxy?n:new Proxy(n,Bt)},qt=(Ft("http://www.w3.org/2001/XMLSchema#"),Ft("http://www.w3.org/1999/02/22-rdf-syntax-ns#"));Ft("http://www.w3.org/2000/01/rdf-schema#");class Ut{static add({ptr:e,start:t,end:n,subjects:r=[null],predicates:i=[null],objects:s=[null],graphs:o,callback:a}={}){if(!e.factory)throw new Error("add operation requires a factory");let l=()=>{};a&&(l=r=>{a(new _t({dataset:e.dataset,start:t,end:n,quad:r}))});for(const n of r)for(const r of i)for(const i of s)for(const s of o){const o={subject:n,predicate:r,object:i,graph:s};o[t]=e.term;const a=e.factory.quad(o.subject,o.predicate,o.object,o.graph);e.dataset.add(a),l(a)}return e}static addList({ptr:e,predicates:t,items:n,graphs:r}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const i of t)for(const t of r){const r=n.map((()=>e.factory.blankNode()));e.dataset.add(e.factory.quad(e.term,i,r[0]||qt.nil,t));for(let i=0;i<r.length;i++)e.dataset.add(e.factory.quad(r[i],qt.first,n[i],t)),e.dataset.add(e.factory.quad(r[i],qt.rest,r[i+1]||qt.nil,t))}return e}static delete({ptr:e,start:t,subjects:n=[null],predicates:r=[null],objects:i=[null]}){for(const s of n)for(const n of r)for(const r of i){const i={subject:s,predicate:n,object:r};i[t]=e.term;const o=e.dataset.match(i.subject,i.predicate,i.object);for(const t of o)e.dataset.delete(t)}return e}static deleteList({ptr:e,predicates:t}){const n=[];for(const r of t)for(const t of e.dataset.match(e.term,r)){let r=t.object;for(n.push(t);!qt.nil.equals(r);){r=n[n.length-1].object;const t=e.dataset.match(r);if(0===t.size)break;for(const e of t)n.push(e)}}for(const t of n)e.dataset.delete(t);return e}static execute({ptr:e,operation:t="traverse",quantifier:n,start:r,end:i,subjects:s,predicates:o,objects:a,graphs:l,items:c,callback:u}={}){if("add"===t)return Ut.add({ptr:e,start:r,end:i,subjects:s,predicates:o,objects:a,graphs:l,callback:u});if("addList"===t)return Ut.addList({ptr:e,predicates:o,items:c,graphs:l});if("delete"===t)return Ut.delete({ptr:e,start:r,subjects:s,predicates:o,objects:a});if("deleteList"===t)return Ut.deleteList({ptr:e,predicates:o});if("isList"===t)return Ut.isList({ptr:e});if("list"===t)return Ut.list({ptr:e});if("traverse"===t)return Ut.traverse({ptr:e,quantifier:n,start:r,end:i,subjects:s,predicates:o,objects:a,graphs:l});throw new Error(`unknown operation ${t}`)}static isList({ptr:e}){return!e.isAny()&&(!!qt.nil.equals(e.term)||1===Ut.traverse({ptr:e,predicates:[qt.first]}).length)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(qt.nil);){const t=e.out([qt.first]);if(1!==t.length)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const n=e.out([qt.rest]);if(1!==n.length)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield t[0],e=n[0]}}}}static traverse({ptr:e,quantifier:t="one",start:n="subject",end:r="object",subjects:i=[null],predicates:s=[null],objects:o=[null],graphs:a=[null],callback:l}){if("one"===t)return Ut.traverseOne({ptr:e,start:n,end:r,subjects:i,predicates:s,objects:o,graphs:a,callback:l});if("oneOrMore"===t){const t=Ut.traverse({ptr:e,end:r,start:n,subjects:i,predicates:s,objects:o,graphs:a,callback:l});return Ut.traverseMore({ptrs:t,end:r,start:n,subjects:i,predicates:s,objects:o,graphs:a,callback:l})}if("zeroOrMore"===t)return Ut.traverseMore({ptrs:[e],end:r,start:n,subjects:i,predicates:s,objects:o,graphs:a,callback:l});if("zeroOrOne"===t)return[e,...Ut.traverse({ptr:e,end:r,start:n,subjects:i,predicates:s,objects:o,graphs:a,callback:l})];throw new Error(`unknown quantifier ${t}`)}static traverseMore({ptrs:e,end:t,start:n,subjects:r,predicates:i,objects:s,graphs:o,callback:a}={}){let l,c,u=[...e];do{l=[];for(const c of e)l=[...l,...Ut.traverseOne({ptr:c,end:t,start:n,subjects:r,predicates:i,objects:s,graphs:o,callback:a})];c&&(l=l.filter((e=>!c.has(e.term)))),e=l,u=[...u,...l],c=new wt(u.map((e=>e.term)))}while(l.length>0);return u}static traverseOne({ptr:e,start:t,end:n,subjects:r,predicates:i,objects:s,graphs:o,callback:a=(e,t)=>t.extend(e)}={}){const l=[];for(const c of r)for(const r of i)for(const i of s)for(const s of o){const o={subject:c,predicate:r,object:i,graph:s};o[t]=e.term;for(const r of e.dataset.match(o.subject,o.predicate,o.object,o.graph))l.push(a(new _t({dataset:e.dataset,end:n,quad:r,start:t}),e))}return l}}const Gt=Ut;function Ht(e,t){return t?n=>t(e.extend(n)):()=>{}}const Vt=class{constructor({dataset:e,edges:t=[],factory:n,graph:r,term:i}){if(!e&&0===t.length)throw new Error("dataset or edges is required");if(0===t.length&&void 0===i)throw new Error("edges or term must be given");if(t.length>0&&i)throw new Error("edges or term must be given");this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=n,this._graph=r,0===t.length&&(this._term=i)}get edge(){return this.edges[this.edges.length-1]}get graph(){return"object"==typeof this._graph?this._graph:this.edge&&this.edge.graph}get length(){return void 0!==this._term?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return void 0!==this._term?this._term:this.edge.term}get value(){const e=this.term;return null===e?void 0:e.value}addIn(e,t,n){return Gt.add({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:Ht(this,n)})}addList(e,t){return Gt.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,n){return Gt.add({ptr:this,start:"subject",end:"object",predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:Ht(this,n)})}deleteIn(e,t){return Gt.delete({ptr:this,start:"object",subjects:t,predicates:e})}deleteList(e){return Gt.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return Gt.delete({ptr:this,start:"subject",predicates:e,objects:t})}execute({operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:s,objects:o,graphs:a,items:l,callback:c}){return Gt.execute({ptr:this,operation:e,quantifier:t,start:n,end:r,subjects:i,predicates:s,objects:o,graphs:a,items:l,callback:c})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return Gt.traverse({ptr:this,start:"object",end:"object",subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return Gt.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return Gt.traverse({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Gt.isList({ptr:this})}list(){return Gt.list({ptr:this})}nodes(){const e=this,t=e=>void 0!==this._term?{dataset:this.dataset,term:this._term}:this.edges.length>e?{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e?{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term}:void 0;return{*[Symbol.iterator](){for(let n=0;n<e.length;n++)yield t(n)}}}out(e,t){return Gt.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}quads(){const e=this;return{*[Symbol.iterator](){for(const t of e.edges)yield t.quad}}}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}},zt=function(e,t){return e?e.equals(t):e===t};function Wt(e,t){return t?n=>t(new e.constructor({factory:e.factory,ptrs:[n]})):()=>{}}class Jt{constructor({dataset:e,factory:t,ptrs:n,terms:r,graphs:i}){if(this.factory=t,n)this.ptrs=[...n];else{this.ptrs=[];for(const n of r||[null])for(const r of i||[null])this.ptrs.push(new Vt({dataset:e,factory:t,graph:r,term:n}))}}get dataset(){const e=new Set(this.datasets);return 1!==e.size?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map((e=>e.dataset))}get term(){const e=new wt(this.terms);if(1===e.size)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map((e=>e.term))}get value(){const e=this.term;return null==e?void 0:e.value}get values(){return this.ptrs.map((e=>e.value))}addIn(e,t,n){const r=Wt(this,n);for(const n of this.ptrs)n.addIn(e,t,r);return this}addList(e,t){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const n of this.ptrs)n.addList(e,t);return this}addOut(e,t,n){const r=Wt(this,n);for(const n of this.ptrs)n.addOut(e,t,r);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(const n of this.ptrs)n.deleteIn(e,t);return this}deleteList(e){for(const t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(const n of this.ptrs)n.deleteOut(e,t);return this}distinct(){const e=this.ptrs.reduce(((e,t)=>(e.some((e=>{return r=t,(n=e).dataset===r.dataset&&!!zt(n.graph,r.graph)&&!!zt(n.term,r.term);var n,r}))||e.push(t.trim()),e)),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap((t=>t.execute(e)))})}executeAll(e){let t=this;for(const n of e)t=t.execute(n);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map((e=>e.ptrs[0]))})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.hasIn(e,t)))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.hasOut(e,t)))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.in(e,t)))})}isAny(){return this.ptrs.length>0&&this.ptrs.some((e=>e.isAny()))}isList(){return 1===this.ptrs.length&&this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list()[Symbol.iterator](),t=()=>{const{done:t,value:n}=e.next();return t?{done:!0}:{done:!1,value:this.clone({ptrs:[n]})}};return{[Symbol.iterator]:()=>({next:t})}}map(e){return[...this].map(e)}node(e){const t=this.dataset,n=[...e].map((e=>new Vt({dataset:t,factory:this.factory,term:e})));return this.clone({ptrs:n})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap((n=>n.out(e,t)))})}quads(){const e=this;return{*[Symbol.iterator](){for(const t of e.ptrs)for(const e of t.edges)yield e.quad}}}trim(){return this.clone({ptrs:this.ptrs.map((e=>e.trim()))})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}const Qt=Jt;Ft("http://www.w3.org/2002/07/owl#");const Xt=Ft("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),Kt=Ft("http://www.w3.org/2000/01/rdf-schema#"),Yt=Ft("http://www.w3.org/ns/shacl#"),Zt=Ft("https://schemas.link/shacl-next#"),en=Ft("http://www.w3.org/2001/XMLSchema#");var tn=n(8059);const nn=class{constructor({details:e,factory:t,options:n,results:r=[]}={}){this.details=e,this.factory=t,this.options=n,this.results=r,this._conforms=tn((()=>!this.results.some((e=>e.severity.equals(Yt.Info)||e.severity.equals(Yt.Violation)||e.severity.equals(Yt.Warning))))),this._ptr=tn((()=>this.build()))}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new Qt({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([Xt.type],[Yt.ValidationReport]).addOut([Yt.conforms],[this.factory.literal(this.conforms.toString(),en.boolean)]);for(const t of this.results)e.addOut([Yt.result],[this.factory.blankNode()],(e=>{t.build(e,this.options)}));return e}coverage(){return this.results.flatMap((e=>e.coverage()))}},rn=class{constructor({args:e={},constraintComponent:t,factory:n,focusNode:r,message:i=[],path:s,results:o=[],severity:a,shape:l,source:c=[],value:u,valuePaths:d=[]}={}){this.args=e,this.constraintComponent=t,this.factory=n,this.focusNode=r,this.path=s||l.path,this.results=o,this.severity=a,this.shape=l,this.source=c,this.value=u,this.valuePaths=d,this._message=tn((()=>(this.shape.message.length>0&&(i=this.shape.message),0===i.length&&(i=this.shape.ptr.node([this.constraintComponent]).out([Yt.message]).terms),i.map((t=>n.literal(function(e,t){return Object.entries(t).reduce(((e,[t,n])=>(n&&n.termType&&(n=gt(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n))),e)}(t.value,e),t.language||null))))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([Xt.type],[Yt.ValidationResult]).addOut([Yt.focusNode],this.focusNode.terms).addOut([Yt.resultSeverity],[this.severity]).addOut([Yt.sourceConstraint],this.source).addOut([Yt.sourceConstraintComponent],[this.constraintComponent]).addOut([Yt.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([Yt.resultMessage],this.message);const n=t=>"one"===t.quantifier?t.predicates.length>1?e.node([this.factory.blankNode()]).addList([Yt.alternativePath],t.predicates):"object"===t.start?e.node([this.factory.blankNode()]).addOut([Yt.inversePath],[t.predicates[0]]):e.node([t.predicates[0]]):"oneOrMore"===t.quantifier?e.node([this.factory.blankNode()]).addOut([Yt.oneOrMorePath],[t.predicates[0]]):"zeroOrMore"===t.quantifier?e.node([this.factory.blankNode()]).addOut([Yt.zeroOrMorePath],[t.predicates[0]]):"zeroOrOne"===t.quantifier?e.node([this.factory.blankNode()]).addOut([Yt.zeroOrOnePath],[t.predicates[0]]):void 0;if(this.path&&(1===this.path.length?e.addOut([Yt.resultPath],n(this.path[0]).terms):e.addList([Yt.resultPath],this.path.map((e=>n(e).term)))),void 0!==this.value&&e.addOut([Yt.value],this.value.terms),t)for(const n of this.results)e.addOut([Yt.detail],[this.factory.blankNode()],(e=>{n.build(e,{details:t})}))}coverage(){return[...this.valuePaths.flatMap((e=>[...e.quads()])),...this.results.flatMap((e=>e.coverage()))]}};class sn{constructor({factory:e,focusNode:t,options:n={debug:!1,details:!1},processed:r=new Set,report:i=new nn({factory:e,options:n}),results:s=new Map,shape:o,value:a,valueOrNode:l,valuePaths:c,values:u}={}){this.factory=e,this.focusNode=t,this.options=n,this.processed=r,this.report=i,this.results=s,this.shape=o,this.value=a,this.valuePaths=c,this.valueOrNode=l,this.values=u}create({child:e,focusNode:t=this.focusNode,shape:n=this.shape,value:r=this.value,valueOrNode:i=this.valueOrNode,valuePaths:s=this.valuePaths,values:o=this.values}={}){return new sn({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new nn({factory:this.factory,options:this.options}):this.report,results:this.results,shape:n,value:r,valueOrNode:i,valuePaths:s,values:o})}id({shape:e=this.shape}={}){return`${gt(e.ptr.term)} - ${gt(this.focusNode.term)} - ${t=this.valuePaths,t?`{${t.map((e=>function(e){return e?`{${[...e.quads()].map((e=>gt(e))).join(" ")}}`:"{}"}(e))).join(" ")}}`:"{}"}`;var t}result(e){const t=new rn({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),n=this.id();this.results.has(n)?this.results.get(n).add(t):this.results.set(n,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:Zt.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:Zt.Trace,constraintComponent:e,...t})}test(e,t,n){e?this.debug(t,n):this.violation(t,n)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||Yt.Violation,...t})}}const on=sn;function an(){return{generic:e=>{e.trace(Zt.TraversalConstraintComponent,{args:{},message:[e.factory.literal("Traversal")],value:e.valueOrNode})}}}const ln=class{constructor(e){this.validations=new mt(e)}compile(e){const t=e.validator.options.coverage;if(e.deactivated)return[];let n=!1;const r=new Set;for(const t of e.ptr.execute({start:"subject",end:"predicate"})){const e=this.validations.get(t.term);e&&(r.add(e),t.term.equals(Yt.property)&&(n=!0))}return t&&e.isPropertyShape&&!n&&r.add(an),[...r].map((t=>t(e))).filter(Boolean)}};var cn=n(9349);function un(e){if("BlankNode"!==e.term.termType)return{quantifier:"one",start:"subject",end:"object",predicates:[e.term]};const t=e.out([Yt.alternativePath]);if(1===t.ptrs.length&&t.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...t.list()].map((e=>e.term))};const n=e.out([Yt.inversePath]);if(n.term)return{quantifier:"one",start:"object",end:"subject",predicates:[n.term]};const r=e.out([Yt.oneOrMorePath]);if(r.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[r.term]};const i=e.out([Yt.zeroOrMorePath]);if(i.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[i.term]};const s=e.out([Yt.zeroOrOnePath]);return s.term?{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[s.term]}:void 0}const dn=class{constructor(e){this.shape=e,this._compiled=tn((()=>this.shape.validator.registry.compile(e)))}get compiled(){return this._compiled()}async validate(e){return 0===e.focusNode.dataset.size||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const e of this.compiled)e.node&&await e.node(t),e.generic&&await e.generic(t)}async validateProperty(e){let t;t=this.shape.isSparqlShape?e.focusNode:e.focusNode.executeAll(this.shape.path);const n=t.node(new wt(t.terms)),r=[...t].reduce(((e,n)=>{const r=n.term,i=t.node([r]);return e.has(r)||e.set(r,{value:i,valuePaths:[]}),e.get(r).valuePaths.push(n),e}),new mt).values(),i=e.create({shape:this.shape,values:n});for(const e of this.compiled)e.property&&await e.property(i);for(const{value:t,valuePaths:n}of r){const r=e.create({shape:this.shape,value:t,valueOrNode:t,valuePaths:n});for(const e of this.compiled)e.generic&&await e.generic(r)}}},hn=function(e){const t=new wt,n=new Qt({dataset:e.dataset,terms:e.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[Kt.subClassOf]});for(const e of n.ptrs)for(const{term:n}of e.nodes())t.add(n);return t},fn=class{constructor(e){this.targetClass=new wt([...hn(e.hasOut([Xt.type],[Yt.NodeShape])),...hn(e.out([Yt.targetClass]))]),this.targetNode=e.out([Yt.targetNode]).terms,this.targetObjectsOf=e.out([Yt.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([Yt.targetSubjectsOf]).terms}resolve(e){const t=e.focusNode.node([null]),n=[...e.focusNode.hasOut([Xt.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...t.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],r=e.focusNode.clone({ptrs:n});return r.node([...new wt(r.terms)])}},pn=class{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=tn((()=>{const e=this.ptr.out([Yt.deactivated]).term;return e&&(0,cn.fromRdf)(e)})),this._message=tn((()=>this.ptr.out([Yt.message]).terms)),this._path=tn((()=>function(e){return 0===e.terms.length?null:e.ptrs[0].isList()?[...e.list()].map((e=>un(e))):[un(e)]}(this.ptr.out([Yt.path])))),this._severity=tn((()=>this.ptr.out([Yt.severity]).term)),this._shapeValidator=tn((()=>new dn(this))),this._sparql=tn((()=>this.ptr.out([Yt.sparql]))),this._targetResolver=tn((()=>new fn(this.ptr)))}get deactivated(){return this._deactivated()}get isPropertyShape(){return Boolean(this.path)}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(const n of e.results.get(t))e.report.results.push(n);return e}return e.processed.add(t),this.shapeValidator.validate(e)}};async function gn(e,t){return Promise.all(e.map(t))}function yn(e){return t=>{t.test(e.equals(t.valueOrNode.term),Yt.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal("Value must be {$hasValue}")]})}}function mn(e){return t=>{const n=[...t.values].some((t=>e.equals(t.term)));t.test(n,Yt.HasValueConstraintComponent,{args:{hasValue:e},message:[t.factory.literal("Missing expected value {$hasValue}")]})}}function bn(e){return en.dateTime.equals(e.datatype)&&/^.*(((\+|-)\d{2}:\d{2})|Z)$/.test(e.value)}const vn=function(e,t){if(!e||"Literal"!==e.termType)return null;if(!t||"Literal"!==t.termType)return null;if(bn(e)!==bn(t))return null;const n=(0,cn.fromRdf)(e),r=(0,cn.fromRdf)(t);return typeof n!=typeof r?null:"string"==typeof n?n.localeCompare(r):n-r};function wn(e){return t=>{const n=t.focusNode.out([e]),r=n.filter((e=>!e.term.equals(t.focusNode.term))),i=0!==n.terms.length&&0===r.terms.length;t.test(i,Yt.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")],value:r.terms[0]&&t.focusNode.node([r.terms[0]])||t.focusNode})}}function _n(e){return t=>{const n=new wt(t.focusNode.out([e]).terms),r=new wt(t.values.terms),i=[...[...r].filter((e=>!n.has(e))),...[...n].filter((e=>!r.has(e)))];for(const n of i)t.violation(Yt.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")],value:t.focusNode.node([n])});0===i.length&&t.debug(Yt.EqualsConstraintComponent,{args:{equals:e},message:[t.factory.literal("Must have same values as {$equals}")]})}}function xn(e,t,n,r){return async i=>{const s=[];let o=[];t&&(o=new Set(i.shape.ptr.in([Yt.property]).out([Yt.property]).out([Yt.qualifiedValueShape]).filter((t=>!t.term.equals(e.ptr.term))).map((e=>i.shape.validator.shape(e)))));const a=(await async function(t){return(await Promise.all(t.map((t=>(async t=>{const n=(await e.validate(i.create({child:!0,focusNode:t}))).report;if(s.push(n.results),!n.conforms)return!1;if(0===o.length)return!0;if(i.options.debug||i.options.details){const e=await gn([...o],(async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report));return s.push(e.flatMap((e=>e.results))),!e.every((e=>e.conforms))}return!await async function(e,t){for(const n of e)if(!await t(n))return!1;return!0}([...o],(async e=>(await e.validate(i.create({child:!0,focusNode:t}))).report.conforms))})(t))))).filter(Boolean)}(i.values)).length;null!==n&&i.test(a<=n,Yt.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:n,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:s.flat()}),null!==r&&i.test(a>=r,Yt.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:r,qualifiedValueShape:e.ptr.term,qualifiedValueShapesDisjoint:t},message:[i.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:s.flat()})}}function Sn(e,t,n){return r=>{r.test(n.test(r.valueOrNode.term.value),Yt.PatternConstraintComponent,{args:{flags:t,pattern:e},message:[r.factory.literal('Value does not match pattern "{$pattern}"')],value:r.valueOrNode})}}const jn=Ft("http://www.w3.org/ns/shacl#"),In=Ft("https://schemas.link/shacl-next#"),En=class{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some((e=>e.severity.equals(jn.Info)||e.severity.equals(jn.Violation)||e.severity.equals(jn.Warning)))}},Nn=class{constructor({args:e={},factory:t,message:n=[],severity:r=jn.Violation}={}){this.severity=r,this.message=n.map((n=>t.literal(function(e,t){return Object.entries(t).reduce(((e,[t,n])=>(n&&n.termType&&(n=gt(n)),e.replace(`{$${t}}`,n).replace(`{?${t}}`,n))),e)}(n.value,e),n.language||null)))}};class Tn{constructor({factory:e=$t}={}){this.factory=e}clone({factory:e}={}){return new Tn({factory:e||this.factory})}validate(){return new En}validateSimple(){return!0}}const Rn=Tn;class On extends Rn{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const t of Array.isArray(e)?e:[e])t&&this.datatypes.push(this.factory.fromTerm(t))}clone({factory:e}={}){return new On({datatypes:this.datatypes,factory:e||this.factory})}}const kn=On,Ln=class{constructor({factory:e=$t,validations:t}={}){if(this.factory=e,this.validations=new mt,t)for(const e of Object.values(t)){const t=e.clone({factory:this.factory});for(const e of t.datatypes)this.validations.set(e,t)}}validate(e){const t=this.validations.get(e.datatype);return t?t.validate(e):new En}validateSimple(e){const t=this.validations.get(e.datatype);return!t||t.validateSimple(e)}};class An extends kn{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new An(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map((t=>{let n;t.test(e.value)&&(n=In.Debug);const r={pattern:this.factory.literal(t.toString()),this:e};return new Nn({args:r,factory:this.factory,message:this.message,severity:n})}));return new En({results:t})}validateSimple(e){return this.patterns.every((t=>t.test(e.value)))}}const Cn=An,Dn=/^([-+]?[0-9]+)$/;class Mn extends Cn{constructor(e=null,t=null,n,{factory:r}={}){super(Dn,n,{factory:r}),this.maxInclusive=null,this.minInclusive=null,"string"==typeof t&&(this.maxInclusive=BigInt(t)),"string"==typeof e&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){return new Mn(this.minInclusive?.toString(),this.maxInclusive?.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!In.Debug.equals(t[0].severity))return new En({results:t});const n=BigInt(e.value);if(null!==this.minInclusive&&n<this.minInclusive){const n=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Nn({factory:this.factory,message:r}))}if(null!==this.maxInclusive&&n>this.maxInclusive){const n=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,r=[this.factory.literal(n)];t.push(new Nn({factory:this.factory,message:r}))}return new En({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(null!==this.minInclusive&&t<this.minInclusive||null!==this.maxInclusive&&t>this.maxInclusive)}}const Pn=Mn;class $n extends kn{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.values=new Set(e)}clone({factory:e}={}){return new $n(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const t=[];if(!this.values.has(e.value)){const n=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,r=[this.factory.literal(n)];t.push(new Nn({factory:this.factory,message:r}))}return new En({results:t})}validateSimple(e){return this.values.has(e.value)}}const Bn=$n,Fn={xsd:Ft("http://www.w3.org/2001/XMLSchema#")},qn=new kn({datatypes:Fn.xsd.anySimpleType}),Un=new kn({datatypes:Fn.xsd.anyAtomicType}),Gn=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,Hn=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,Vn=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,zn=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Wn=new Cn(Gn,Fn.xsd.string),Jn=new Bn(["1","true","0","false"],Fn.xsd.boolean),Qn=new Cn(/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,Fn.xsd.decimal),Xn=new Cn(Hn,Fn.xsd.float),Kn=new Cn(Hn,Fn.xsd.double),Yn=new Cn(Vn,Fn.xsd.duration),Zn=new Cn(zn,Fn.xsd.dateTime),er=new Cn(/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.time),tr=new Cn(/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.date),nr=new Cn(/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gYearMonth),rr=new Cn(/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gYear),ir=new Cn(/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gMonthDay),sr=new Cn(/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gDay),or=new Cn(/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,Fn.xsd.gMonth),ar=new Cn(/^(([0-9a-fA-F]{2})*)$/,Fn.xsd.hexBinary),lr=new Cn(/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,Fn.xsd.base64Binary),cr=new Cn(Gn,Fn.xsd.anyURI),ur=/^([^\u000d\u000a\u0009]*)$/,dr=new Cn([Gn,ur],Fn.xsd.normalizedString),hr=new Cn([Gn,ur,/^([^ ]+( [^ ]+)*)*$/],Fn.xsd.token),fr=new Cn(/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Fn.xsd.language),pr=new Pn(null,null,Fn.xsd.integer),gr=new Pn(null,"0",Fn.xsd.nonPositiveInteger),yr=new Pn(null,"-1",Fn.xsd.negativeInteger),mr=new Pn("-9223372036854775808","9223372036854775807",Fn.xsd.long),br=new Pn("-2147483648","2147483647",Fn.xsd.int),vr=new Pn("-32768","32767",Fn.xsd.short),wr=new Pn("-128","127",Fn.xsd.byte),_r=new Pn("0",null,Fn.xsd.nonNegativeInteger),xr=new Pn("0","18446744073709551615",Fn.xsd.unsignedLong),Sr=new Pn("0","4294967295",Fn.xsd.unsignedInt),jr=new Pn("0","65535",Fn.xsd.unsignedShort),Ir=new Pn("0","255",Fn.xsd.unsignedByte),Er=new Pn("1",null,Fn.xsd.positiveInteger),Nr=new Cn([Vn,/^([^DT]*)$/],Fn.xsd.yearMonthDuration),Tr=new Cn([Vn,/^([^YM]*[DT].*)$/],Fn.xsd.dayTimeDuration),Rr=new Cn([zn,/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/],Fn.xsd.dateTimeStamp),Or=class extends Ln{constructor({factory:e}={}){super({factory:e,validations:{...r}})}},kr=new mt([[Yt.BlankNode,new Set(["BlankNode"])],[Yt.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[Yt.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[Yt.IRI,new Set(["NamedNode"])],[Yt.IRIOrLiteral,new Set(["NamedNode","Literal"])],[Yt.Literal,new Set(["Literal"])]]);function Lr(e,t){return n=>{n.test(t.has(n.valueOrNode.term.termType),Yt.NodeKindConstraintComponent,{args:{nodeKind:e},message:[n.factory.literal("Value does not have node kind {$nodeKind}")],value:n.valueOrNode})}}const Ar=new mt([[Yt.maxCount,function(e){return{property:(t=parseInt(e.ptr.out([Yt.maxCount]).value),e=>{e.test(e.values.terms.length<=t,Yt.MaxCountConstraintComponent,{args:{maxCount:t},message:[e.factory.literal("More than {$maxCount} values")]})})};var t}],[Yt.minCount,function(e){return{property:(t=parseInt(e.ptr.out([Yt.minCount]).value),e=>{e.test(e.values.terms.length>=t,Yt.MinCountConstraintComponent,{args:{minCount:t},message:[e.factory.literal("Less than {$minCount} values")]})})};var t}],[Yt.and,function(e){return{generic:(t=[...e.ptr.out([Yt.and])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{const n=await gn(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report)),r=n.every((e=>e.conforms));e.test(r,Yt.AndConstraintComponent,{results:n.flatMap((e=>e.results)),value:e.valueOrNode})})};var t}],[Yt.not,function(e){return{generic:(t=e.validator.shape(e.ptr.out([Yt.not])),async e=>{const n=(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,r=!n.conforms;e.test(r,Yt.NotConstraintComponent,{args:{not:t.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:n.results,value:e.valueOrNode})})};var t}],[Yt.or,function(e){return{generic:(t=[...e.ptr.out([Yt.or])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{let n,r=[];if(e.options.debug||e.options.details){const i=await gn(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report));r=i.flatMap((e=>e.results)),n=i.some((e=>e.conforms))}else n=await async function(e,t){for(const n of e)if(await t(n))return!0;return!1}(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms));e.test(n,Yt.OrConstraintComponent,{results:r,value:e.valueOrNode})})};var t}],[Yt.xone,function(e){return{generic:(t=[...e.ptr.out([Yt.xone])].flatMap((e=>[...e.list()])).map((t=>e.validator.shape(t))),async e=>{const n=await gn(t,(async t=>(await t.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report)),r=1===n.filter((e=>e.conforms)).length;e.test(r,Yt.XoneConstraintComponent,{results:n.flatMap((e=>e.results)),value:e.valueOrNode})})};var t}],[Yt.closed,function(e){if(!(0,cn.fromRdf)(e.ptr.out([Yt.closed]).term))return null;const t=e.ptr.out([Yt.property]).map((t=>e.validator.shape(t)));return{node:(n=new wt(t.filter((e=>!e.deactivated)).map((e=>e.path[0].predicates[0]))),r=new wt([...e.ptr.out([Yt.ignoredProperties]).list()||[]].map((e=>e.term))),e=>{const t=e.focusNode.execute({start:"subject",end:"predicate"}).filter((e=>!r.has(e.term)&&!n.has(e.term)));if(t.ptrs.length>0)for(const n of t)e.violation(Yt.ClosedConstraintComponent,{message:[e.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[n.term]}],value:e.focusNode.node([[...n.quads()][0].object])});else e.debug(Yt.ClosedConstraintComponent)})};var n,r}],[Yt.hasValue,function(e){const t=e.ptr.out([Yt.hasValue]).term;return{node:yn(t),property:mn(t)}}],[Yt.in,function(e){return{generic:(t=new wt([...e.ptr.out([Yt.in]).list()].map((e=>e.term))),e=>{e.test(t.has(e.valueOrNode.term),Yt.InConstraintComponent,{args:{in:[...t].map((e=>e.value)).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})})};var t}],[Yt.disjoint,function(e){return{generic:(t=e.ptr.out([Yt.disjoint]).term,e=>{const n=e.focusNode.dataset.match(e.focusNode.term,t,e.valueOrNode.term);e.test(0===n.size,Yt.DisjointConstraintComponent,{args:{disjoint:t},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})})};var t}],[Yt.equals,function(e){const t=e.ptr.out([Yt.equals]).term;return{node:wn(t),property:_n(t)}}],[Yt.lessThan,function(e){return{property:(t=e.ptr.out([Yt.lessThan]).term,e=>{const n=e.focusNode.out([t]).terms;for(const r of e.values)for(const i of n){const n=vn(r.term,i);null===n||n>=0?e.violation(Yt.LessThanConstraintComponent,{args:{lessThan:t},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r}):e.debug(Yt.LessThanConstraintComponent,{args:{lessThan:t},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:r})}})};var t}],[Yt.lessThanOrEquals,function(e){return{property:(t=e.ptr.out([Yt.lessThanOrEquals]).term,e=>{const n=e.focusNode.out([t]).terms;for(const r of e.values)for(const i of n){const n=vn(r.term,i);null===n||n>0?e.violation(Yt.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:t},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r}):e.debug(Yt.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:t},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:r})}})};var t}],[Yt.maxExclusive,function(e){return{generic:(t=e.ptr.out([Yt.maxExclusive]).term,e=>{const n=vn(e.valueOrNode.term,t);e.test(null!==n&&n<0,Yt.MaxExclusiveConstraintComponent,{args:{maxExclusive:t},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})})};var t}],[Yt.maxInclusive,function(e){return{generic:(t=e.ptr.out([Yt.maxInclusive]).term,e=>{const n=vn(e.valueOrNode.term,t);e.test(null!==n&&n<=0,Yt.MaxInclusiveConstraintComponent,{args:{maxInclusive:t},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})})};var t}],[Yt.minExclusive,function(e){return{generic:(t=e.ptr.out([Yt.minExclusive]).term,e=>{const n=vn(e.valueOrNode.term,t);e.test(null!==n&&n>0,Yt.MinExclusiveConstraintComponent,{args:{minExclusive:t},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})})};var t}],[Yt.minInclusive,function(e){return{generic:(t=e.ptr.out([Yt.minInclusive]).term,e=>{const n=vn(e.valueOrNode.term,t);e.test(null!==n&&n>=0,Yt.MinInclusiveConstraintComponent,{args:{minInclusive:t},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})})};var t}],[Yt.node,function(e){return{generic:(t=[...e.ptr.out([Yt.node])].map((t=>e.validator.shape(t))),async e=>{for(const n of t){const t=await n.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(t.report.conforms,Yt.NodeConstraintComponent,{args:{node:n.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:t.report.results,value:e.valueOrNode})}})};var t}],[Yt.property,function(e){return{generic:(t=[...e.ptr.out([Yt.property])].map((t=>e.validator.shape(t))),async e=>{const n=e.create({focusNode:e.valueOrNode});for(const e of t)await e.validate(n)})};var t}],[Yt.qualifiedValueShape,function(e){const t=e.validator.shape(e.ptr.out([Yt.qualifiedValueShape])),n=e.ptr.out([Yt.qualifiedValueShapesDisjoint]).term,r=!!n&&(0,cn.fromRdf)(n),i=e.ptr.out([Yt.qualifiedMaxCount]).term,s=i?parseInt(i.value):null,o=e.ptr.out([Yt.qualifiedMinCount]).term;return{property:xn(t,r,s,o?parseInt(o.value):null)}}],[Yt.languageIn,function(e){return{generic:(t=[...new Set([...e.ptr.out([Yt.languageIn]).list()].map((e=>e.value)))],e=>{const n=t.some((t=>function(e,t){return!!t&&t.slice(0,e.length)===e}(t,e.valueOrNode.term.language)));e.test(n,Yt.LanguageInConstraintComponent,{args:{languageIn:t.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})})};var t}],[Yt.maxLength,function(e){return{generic:(t=parseInt(e.ptr.out([Yt.maxLength]).value),e=>{const n="BlankNode"!==e.valueOrNode.term.termType&&e.valueOrNode.value.length<=t;e.test(n,Yt.MaxLengthConstraintComponent,{args:{maxLength:t},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})})};var t}],[Yt.minLength,function(e){return{generic:(t=parseInt(e.ptr.out([Yt.minLength]).value),e=>{const n="BlankNode"!==e.valueOrNode.term.termType&&e.valueOrNode.value.length>=t;e.test(n,Yt.MinLengthConstraintComponent,{args:{minLength:t},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})})};var t}],[Yt.pattern,function(e){const t=e.ptr.out([Yt.pattern]).value,n=e.ptr.out([Yt.flags]).value;return{generic:Sn(t,n,new RegExp(t,n))}}],[Yt.uniqueLang,function(e){const t=e.ptr.out([Yt.uniqueLang]).term;return"true"===t.value&&en.boolean.equals(t.datatype)?{property:e=>{const t=Object.entries(e.values.terms.reduce(((e,t)=>(t.language&&(e[t.language]=(e[t.language]||0)+1),e)),{})),n=t.filter((([,e])=>e>1));for(const[t]of n)e.violation(Yt.UniqueLangConstraintComponent,{args:{lang:t},message:[e.factory.literal('Language "{?lang}" used more than once')]});0===n.length&&e.debug(Yt.UniqueLangConstraintComponent)}}:null}],[Yt.class,function(e){return{generic:(t=e.ptr.out([Yt.class]).map((e=>hn(e))),e=>{const n=new wt(e.valueOrNode.out([Xt.type]).terms);for(const r of t){const t=[...n].some((e=>r.has(e)));e.test(t,Yt.ClassConstraintComponent,{value:e.valueOrNode})}})};var t}],[Yt.datatype,function(e){return{generic:(t=e.ptr.out([Yt.datatype]).term,n=new Or,e=>{const r=t.equals(e.valueOrNode.term.datatype)&&n.validateSimple(e.valueOrNode.term);e.test(r,Yt.DatatypeConstraintComponent,{args:{datatype:t},message:[e.factory.literal("Value does not have datatype {$datatype}")],value:e.valueOrNode})})};var t,n}],[Yt.nodeKind,function(e){const t=e.ptr.out([Yt.nodeKind]).term;return{generic:Lr(t,kr.get(t))}}]]),Cr=class{constructor(e,{factory:t,...n}){if(this.factory=t,this.options=n,this.registry=new ln(Ar),this.shapesPtr=new Qt({dataset:e,factory:t}),this.shapes=new mt,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[e,t]of this.options.validations)this.registry.validations.set(e,t);const r=[...this.shapesPtr.hasOut([Yt.targetClass]),...this.shapesPtr.hasOut([Yt.targetNode]),...this.shapesPtr.hasOut([Yt.targetObjectsOf]),...this.shapesPtr.hasOut([Yt.targetSubjectsOf]),...this.shapesPtr.hasOut([Xt.type],[Yt.NodeShape]),...this.shapesPtr.hasOut([Xt.type],[Yt.PropertyShape])];for(const e of r)this.shape(e)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new pn(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const n=new Qt({...e,factory:this.factory}),r=new on({factory:this.factory,focusNode:n,options:this.options,validator:this});t=t?t.map((e=>this.shape(this.shapesPtr.node(e.terms)))):this.shapes.values();for(const e of t){const t=r.create({shape:e});let i;i=n.isAny()?e.resolveTargets(t):n;for(const n of i)await e.validate(t.create({focusNode:n}))}return r.report}};var Dr=function(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{l(r.next(e))}catch(e){s(e)}}function a(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,a)}l((r=r.apply(e,t||[])).next())}))};class Mr extends HTMLElement{static get observedAttributes(){return ct.dataAttributes()}constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new ct(e,this.form),this.form.addEventListener("change",(e=>{e.stopPropagation(),this.config.editMode&&this.validate(!0).then((e=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:e.conforms,report:e}}))})).catch((e=>{console.warn(e)}))}))}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.initDebounceTimeout=setTimeout((()=>Dr(this,void 0,void 0,(function*(){this.form.replaceChildren(document.createTextNode(this.config.attributes.loading));try{yield this.config.loader.loadGraphs(),this.form.replaceChildren(),this.config.renderedNodes.clear();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach((e=>{this.form.classList.remove(e)})),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const t=[this.config.theme.stylesheet];for(const e of Object.entries(_e).map((e=>e[1])))e.stylesheet&&t.push(e.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new Ae(e,this.config,this.config.attributes.valuesSubject?f.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(null!==this.config.attributes.submitButton){const e=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);e.addEventListener("click",(e=>{e.preventDefault(),this.form.reportValidity()&&this.validate().then((e=>{var t;(null==e?void 0:e.conforms)?this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})):null===(t=this.form.querySelector(":scope .invalid > .editor"))||void 0===t||t.focus()}))})),this.form.appendChild(e)}yield this.validate(!0)}}else if(this.config.shapesGraph.size>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const t=document.createElement("div");t.innerText=String(e),this.form.replaceChildren(t)}}))),200)}serialize(e="text/turtle",t=this.toRDF()){return function(e,t,n){if("application/ld+json"===t)return function(e){const t=[];for(const n of e){const e={"@id":n.subject.id};if(n.predicate===P)e["@type"]=n.object.id;else{let t=n.object.value;n.object instanceof y?n.object.language?t={"@language":n.object.language,"@value":n.object.value}:n.object.datatype&&n.object.datatype.value!==`${k}#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)}(e);{const r=new be({format:t,prefixes:n});r.addQuads(e);let i="";return r.end(((e,t)=>{e&&console.error(e),i=t})),i}}(t.getQuads(null,null,null,null),e,this.config.prefixes)}toRDF(e=new Fe){var t;return null===(t=this.shape)||void 0===t||t.toRDF(e),e}registerPlugin(e){xe(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setSharedShapesGraph(e){at(e),this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}validate(){return Dr(this,arguments,void 0,(function*(e=!1){var t,n,r,i,s,o;for(const e of this.form.querySelectorAll(":scope .validation-error"))e.remove();for(const e of this.form.querySelectorAll(":scope .property-instance"))e.classList.remove("invalid"),(null===(t=e.querySelector(":scope > .editor"))||void 0===t?void 0:t.value)?e.classList.add("valid"):e.classList.remove("valid");this.config.shapesGraph.deleteGraph(""),null===(n=this.shape)||void 0===n||n.toRDF(this.config.shapesGraph),this.shape&&this.config.shapesGraph.add(new _(this.shape.shaclSubject,f.namedNode(R+"targetNode"),this.shape.nodeId,void 0));try{const t=this.config.shapesGraph,n=yield new Cr(t,{details:!0,factory:f}).validate({dataset:t});for(const t of n.results)if(null===(i=null===(r=t.focusNode)||void 0===r?void 0:r.ptrs)||void 0===i?void 0:i.length)for(const n of t.focusNode.ptrs){const r=n._term;if(null===(s=t.path)||void 0===s?void 0:s.length){const n=t.path[0].predicates[0];let i=this.form.querySelectorAll(`:scope [data-node-id='${r.id}'] [data-path='${n.id}'] > .editor`);0===i.length&&(i=this.form.querySelectorAll(`:scope [data-node-id='${r.id}'] [data-path='${n.id}']`));for(const n of i)if(n.classList.contains("editor")){if(!e||n.value){let e=n.parentElement;e.classList.add("invalid"),e.classList.remove("valid"),e.appendChild(this.createValidationErrorDisplay(t));do{e.classList.contains("collapsible")&&e.classList.add("open"),e=e.parentElement}while(e)}}else e||(n.classList.add("invalid"),n.classList.remove("valid"),n.appendChild(this.createValidationErrorDisplay(t,"node")))}else e||null===(o=this.form.querySelector(`:scope [data-node-id='${r.id}']`))||void 0===o||o.prepend(this.createValidationErrorDisplay(t,"node"))}return n}catch(e){return console.error(e),!1}}))}createValidationErrorDisplay(e,t){var n,r;const i=document.createElement("span");if(i.classList.add("validation-error"),t&&i.classList.add(t),e)if((null===(n=e.message)||void 0===n?void 0:n.length)>0)for(const t of e.message)i.title+=t.value+"\n";else i.title=null===(r=e.sourceConstraintComponent)||void 0===r?void 0:r.value;return i}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=f.namedNode(this.config.attributes.shapeSubject),0===this.config.shapesGraph.getQuads(e,P,G,null).length)return void console.warn(`shapes graph does not contain requested root shape ${this.config.attributes.shapeSubject}`)}else if(this.config.attributes.valuesSubject&&this.config.dataGraph.size>0){const t=f.namedNode(this.config.attributes.valuesSubject),n=[...this.config.dataGraph.getQuads(t,P,null,null),...this.config.dataGraph.getQuads(t,$,null,null)];if(0===n.length)return void console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${P.id} nor ${$.id} statement`);for(const t of n)if(this.config.shapesGraph.getQuads(t.object,P,G,null).length>0){e=t.object;break}if(!e){const t=this.config.shapesGraph.getQuads(null,z,n[0].object,null);if(0===t.length)return void console.error(`value subject '${this.config.attributes.valuesSubject}' has no shacl shape definition in the shapes graph`);if(t.length>1&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has multiple shacl shape definitions in the shapes graph, choosing the first found (${t[0].subject})`),0===this.config.shapesGraph.getQuads(t[0].subject,P,G,null).length)return void console.error(`value subject '${this.config.attributes.valuesSubject}' references a shape which is not a NodeShape (${t[0].subject})`);e=t[0].subject}}else{const t=this.config.shapesGraph.getQuads(null,P,G,null);if(0==t.length)return void console.warn("shapes graph does not contain any root shapes");t.length>1&&(console.warn("shapes graph contains",t.length,"root shapes. choosing first found which is",t[0].subject.value),console.info('hint: set the shape to use with attribute "data-shape-subject"')),e=t[0].subject}return e}}class Pr extends se{constructor(e){super(e||".editor:not([type='checkbox']) { border: 1px solid #DDD; padding: 2px 4px; }\n.property-instance label { display: inline-block; word-break: break-word; line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }\n.property-instance:not(:first-child) > label { visibility: hidden; max-height: 0; }\n.mode-edit .property-instance label { width: var(--label-width); }\n"),this.idCtr=0}createDefaultTemplate(e,t,n,r,i){var s;r.id="e"+this.idCtr++,r.classList.add("editor"),(null==i?void 0:i.datatype)&&(r.shaclDatatype=i.datatype),void 0!==(null==i?void 0:i.minCount)&&(r.dataset.minCount=String(i.minCount)),(null==i?void 0:i.class)&&(r.dataset.class=i.class.value),(null==i?void 0:i.nodeKind)&&(r.dataset.nodeKind=i.nodeKind.value),((null==i?void 0:i.hasValue)||(null==i?void 0:i.readonly))&&(r.disabled=!0),r.value=(null==t?void 0:t.value)||(null===(s=null==i?void 0:i.defaultValue)||void 0===s?void 0:s.value)||"";const o=document.createElement("label");o.htmlFor=r.id,o.innerText=e,(null==i?void 0:i.description)&&o.setAttribute("title",i.description.value);const a=(null==i?void 0:i.description)?i.description.value:(null==i?void 0:i.pattern)?i.pattern:null;a&&r.setAttribute("placeholder",a),n&&(r.setAttribute("required","true"),o.classList.add("required"));const l=document.createElement("div");return l.appendChild(o),l.appendChild(r),l}createDateEditor(e,t,n,r){var i,s;const o=document.createElement("input");(null===(i=r.datatype)||void 0===i?void 0:i.value)===k+"dateTime"?(o.type="datetime-local",o.setAttribute("step","1")):o.type="date",o.classList.add("pr-0");const a=this.createDefaultTemplate(e,null,n,o,r);if(t)try{let e=new Date(t.value).toISOString();e=(null===(s=r.datatype)||void 0===s?void 0:s.value)===k+"dateTime"?e.slice(0,19):e.slice(0,10),o.value=e}catch(e){console.error(e,t)}return a}createTextEditor(e,t,n,r){let i;return!1===r.singleLine?(i=document.createElement("textarea"),i.rows=5):(i=document.createElement("input"),i.type="text",r.pattern&&(i.pattern=r.pattern)),r.minLength&&(i.minLength=r.minLength),r.maxLength&&(i.maxLength=r.maxLength),this.createDefaultTemplate(e,t,n,i,r)}createLangStringEditor(e,t,n,r){var i;const s=this.createTextEditor(e,t,n,r),o=s.querySelector(":scope .editor");let a;if(null===(i=r.languageIn)||void 0===i?void 0:i.length){a=document.createElement("select");for(const e of r.languageIn){const t=document.createElement("option");t.innerText=e.value,a.appendChild(t)}}else a=document.createElement("input"),a.maxLength=5,a.placeholder="lang?";return a.title="Language of the text",a.classList.add("lang-chooser"),a.addEventListener("change",(e=>{e.stopPropagation(),o&&(o.dataset.lang=a.value,o.dispatchEvent(new Event("change",{bubbles:!0})))})),t instanceof y&&(a.value=t.language),o.dataset.lang=a.value,o.after(a),s}createBooleanEditor(e,t,n,r){var i;const s=document.createElement("input");s.type="checkbox",s.classList.add("ml-0");const o=this.createDefaultTemplate(e,null,n,s,r);return s.removeAttribute("required"),null===(i=o.querySelector(":scope label"))||void 0===i||i.classList.remove("required"),t instanceof y&&(s.checked="true"===t.value),o}createFileEditor(e,t,n,r){const i=document.createElement("input");return i.type="file",i.addEventListener("change",(e=>{var t;if(null===(t=i.files)||void 0===t?void 0:t.length){e.stopPropagation();const t=new FileReader;t.readAsDataURL(i.files[0]),t.onload=()=>{var e;i.binaryData=btoa(t.result),null===(e=i.parentElement)||void 0===e||e.dispatchEvent(new Event("change",{bubbles:!0}))}}else i.binaryData=void 0})),this.createDefaultTemplate(e,t,n,i,r)}createNumberEditor(e,t,n,r){var i;const s=document.createElement("input");s.type="number",s.classList.add("pr-0");const o=void 0!==r.minInclusive?r.minInclusive:void 0!==r.minExclusive?r.minExclusive+1:void 0,a=void 0!==r.maxInclusive?r.maxInclusive:void 0!==r.maxExclusive?r.maxExclusive-1:void 0;return void 0!==o&&(s.min=String(o)),void 0!==a&&(s.max=String(a)),(null===(i=r.datatype)||void 0===i?void 0:i.value)!==k+"integer"&&(s.step="0.1"),this.createDefaultTemplate(e,t,n,s,r)}createListEditor(e,t,n,r,i){const s=document.createElement("select"),o=this.createDefaultTemplate(e,null,n,s,i);let a=!0;for(const e of r){const n=document.createElement("option"),r="string"==typeof e.value?e.value:e.value.value;if(n.innerHTML=e.label?e.label:r,n.value=r,e.indent)for(let t=0;t<e.indent;t++)n.innerHTML="  "+n.innerHTML;t&&t.value===r&&(n.selected=!0),""===r&&(a=!1),s.appendChild(n)}if(a){const e=document.createElement("option");e.value="",t||(e.selected=!0),s.prepend(e)}return t&&(s.value=t.value),o}createButton(e,t){const n=document.createElement("button");return n.type="button",n.innerHTML=e,n}}class $r extends Mr{constructor(){super(new Pr)}}window.customElements.define("shacl-form",$r);export{ct as Config,ot as Loader,Se as Plugin,$r as ShaclForm,ie as ShaclPropertyTemplate,se as Theme,Q as findLabel,xe as registerPlugin,at as setSharedShapesGraph};
|
|
1
|
+
var Zt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ic(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Rc(r){if(Object.prototype.hasOwnProperty.call(r,"__esModule"))return r;var e=r.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(r).forEach(function(n){var i=Object.getOwnPropertyDescriptor(r,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return r[n]}})}),t}var Wn={},pr={},Ta;function Nc(){if(Ta)return pr;Ta=1,pr.byteLength=o,pr.toByteArray=u,pr.fromByteArray=b;for(var r=[],e=[],t=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,s=n.length;i<s;++i)r[i]=n[i],e[n.charCodeAt(i)]=i;e[45]=62,e[95]=63;function a(g){var m=g.length;if(m%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var _=g.indexOf("=");_===-1&&(_=m);var x=_===m?0:4-_%4;return[_,x]}function o(g){var m=a(g),_=m[0],x=m[1];return(_+x)*3/4-x}function l(g,m,_){return(m+_)*3/4-_}function u(g){var m,_=a(g),x=_[0],S=_[1],I=new t(l(g,x,S)),w=0,d=S>0?x-4:x,p;for(p=0;p<d;p+=4)m=e[g.charCodeAt(p)]<<18|e[g.charCodeAt(p+1)]<<12|e[g.charCodeAt(p+2)]<<6|e[g.charCodeAt(p+3)],I[w++]=m>>16&255,I[w++]=m>>8&255,I[w++]=m&255;return S===2&&(m=e[g.charCodeAt(p)]<<2|e[g.charCodeAt(p+1)]>>4,I[w++]=m&255),S===1&&(m=e[g.charCodeAt(p)]<<10|e[g.charCodeAt(p+1)]<<4|e[g.charCodeAt(p+2)]>>2,I[w++]=m>>8&255,I[w++]=m&255),I}function h(g){return r[g>>18&63]+r[g>>12&63]+r[g>>6&63]+r[g&63]}function y(g,m,_){for(var x,S=[],I=m;I<_;I+=3)x=(g[I]<<16&16711680)+(g[I+1]<<8&65280)+(g[I+2]&255),S.push(h(x));return S.join("")}function b(g){for(var m,_=g.length,x=_%3,S=[],I=16383,w=0,d=_-x;w<d;w+=I)S.push(y(g,w,w+I>d?d:w+I));return x===1?(m=g[_-1],S.push(r[m>>2]+r[m<<4&63]+"==")):x===2&&(m=(g[_-2]<<8)+g[_-1],S.push(r[m>>10]+r[m>>4&63]+r[m<<2&63]+"=")),S.join("")}return pr}var tn={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Aa;function Tc(){return Aa||(Aa=1,tn.read=function(r,e,t,n,i){var s,a,o=i*8-n-1,l=(1<<o)-1,u=l>>1,h=-7,y=t?i-1:0,b=t?-1:1,g=r[e+y];for(y+=b,s=g&(1<<-h)-1,g>>=-h,h+=o;h>0;s=s*256+r[e+y],y+=b,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=n;h>0;a=a*256+r[e+y],y+=b,h-=8);if(s===0)s=1-u;else{if(s===l)return a?NaN:(g?-1:1)*(1/0);a=a+Math.pow(2,n),s=s-u}return(g?-1:1)*a*Math.pow(2,s-n)},tn.write=function(r,e,t,n,i,s){var a,o,l,u=s*8-i-1,h=(1<<u)-1,y=h>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,m=n?1:-1,_=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+y>=1?e+=b/l:e+=b*Math.pow(2,1-y),e*l>=2&&(a++,l/=2),a+y>=h?(o=0,a=h):a+y>=1?(o=(e*l-1)*Math.pow(2,i),a=a+y):(o=e*Math.pow(2,y-1)*Math.pow(2,i),a=0));i>=8;r[t+g]=o&255,g+=m,o/=256,i-=8);for(a=a<<i|o,u+=i;u>0;r[t+g]=a&255,g+=m,a/=256,u-=8);r[t+g-m]|=_*128}),tn}/*!
|
|
2
|
+
* The buffer module from node.js, for the browser.
|
|
3
|
+
*
|
|
4
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
+
* @license MIT
|
|
6
|
+
*/var La;function bt(){return La||(La=1,function(r){const e=Nc(),t=Tc(),n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=o,r.SlowBuffer=I,r.INSPECT_MAX_BYTES=50;const i=2147483647;r.kMaxLength=i,o.TYPED_ARRAY_SUPPORT=s(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function s(){try{const E=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(E,c),E.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function a(E){if(E>i)throw new RangeError('The value "'+E+'" is invalid for option "size"');const c=new Uint8Array(E);return Object.setPrototypeOf(c,o.prototype),c}function o(E,c,f){if(typeof E=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(E)}return l(E,c,f)}o.poolSize=8192;function l(E,c,f){if(typeof E=="string")return b(E,c);if(ArrayBuffer.isView(E))return m(E);if(E==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E);if(se(E,ArrayBuffer)||E&&se(E.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(se(E,SharedArrayBuffer)||E&&se(E.buffer,SharedArrayBuffer)))return _(E,c,f);if(typeof E=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const k=E.valueOf&&E.valueOf();if(k!=null&&k!==E)return o.from(k,c,f);const J=x(E);if(J)return J;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof E[Symbol.toPrimitive]=="function")return o.from(E[Symbol.toPrimitive]("string"),c,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof E)}o.from=function(E,c,f){return l(E,c,f)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function u(E){if(typeof E!="number")throw new TypeError('"size" argument must be of type number');if(E<0)throw new RangeError('The value "'+E+'" is invalid for option "size"')}function h(E,c,f){return u(E),E<=0?a(E):c!==void 0?typeof f=="string"?a(E).fill(c,f):a(E).fill(c):a(E)}o.alloc=function(E,c,f){return h(E,c,f)};function y(E){return u(E),a(E<0?0:S(E)|0)}o.allocUnsafe=function(E){return y(E)},o.allocUnsafeSlow=function(E){return y(E)};function b(E,c){if((typeof c!="string"||c==="")&&(c="utf8"),!o.isEncoding(c))throw new TypeError("Unknown encoding: "+c);const f=w(E,c)|0;let k=a(f);const J=k.write(E,c);return J!==f&&(k=k.slice(0,J)),k}function g(E){const c=E.length<0?0:S(E.length)|0,f=a(c);for(let k=0;k<c;k+=1)f[k]=E[k]&255;return f}function m(E){if(se(E,Uint8Array)){const c=new Uint8Array(E);return _(c.buffer,c.byteOffset,c.byteLength)}return g(E)}function _(E,c,f){if(c<0||E.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(E.byteLength<c+(f||0))throw new RangeError('"length" is outside of buffer bounds');let k;return c===void 0&&f===void 0?k=new Uint8Array(E):f===void 0?k=new Uint8Array(E,c):k=new Uint8Array(E,c,f),Object.setPrototypeOf(k,o.prototype),k}function x(E){if(o.isBuffer(E)){const c=S(E.length)|0,f=a(c);return f.length===0||E.copy(f,0,0,c),f}if(E.length!==void 0)return typeof E.length!="number"||Ee(E.length)?a(0):g(E);if(E.type==="Buffer"&&Array.isArray(E.data))return g(E.data)}function S(E){if(E>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return E|0}function I(E){return+E!=E&&(E=0),o.alloc(+E)}o.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==o.prototype},o.compare=function(c,f){if(se(c,Uint8Array)&&(c=o.from(c,c.offset,c.byteLength)),se(f,Uint8Array)&&(f=o.from(f,f.offset,f.byteLength)),!o.isBuffer(c)||!o.isBuffer(f))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===f)return 0;let k=c.length,J=f.length;for(let ie=0,oe=Math.min(k,J);ie<oe;++ie)if(c[ie]!==f[ie]){k=c[ie],J=f[ie];break}return k<J?-1:J<k?1:0},o.isEncoding=function(c){switch(String(c).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(c,f){if(!Array.isArray(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return o.alloc(0);let k;if(f===void 0)for(f=0,k=0;k<c.length;++k)f+=c[k].length;const J=o.allocUnsafe(f);let ie=0;for(k=0;k<c.length;++k){let oe=c[k];if(se(oe,Uint8Array))ie+oe.length>J.length?(o.isBuffer(oe)||(oe=o.from(oe)),oe.copy(J,ie)):Uint8Array.prototype.set.call(J,oe,ie);else if(o.isBuffer(oe))oe.copy(J,ie);else throw new TypeError('"list" argument must be an Array of Buffers');ie+=oe.length}return J};function w(E,c){if(o.isBuffer(E))return E.length;if(ArrayBuffer.isView(E)||se(E,ArrayBuffer))return E.byteLength;if(typeof E!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof E);const f=E.length,k=arguments.length>2&&arguments[2]===!0;if(!k&&f===0)return 0;let J=!1;for(;;)switch(c){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return de(E).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return le(E).length;default:if(J)return k?-1:de(E).length;c=(""+c).toLowerCase(),J=!0}}o.byteLength=w;function d(E,c,f){let k=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,c>>>=0,f<=c))return"";for(E||(E="utf8");;)switch(E){case"hex":return K(this,c,f);case"utf8":case"utf-8":return j(this,c,f);case"ascii":return ee(this,c,f);case"latin1":case"binary":return P(this,c,f);case"base64":return A(this,c,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,c,f);default:if(k)throw new TypeError("Unknown encoding: "+E);E=(E+"").toLowerCase(),k=!0}}o.prototype._isBuffer=!0;function p(E,c,f){const k=E[c];E[c]=E[f],E[f]=k}o.prototype.swap16=function(){const c=this.length;if(c%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let f=0;f<c;f+=2)p(this,f,f+1);return this},o.prototype.swap32=function(){const c=this.length;if(c%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let f=0;f<c;f+=4)p(this,f,f+3),p(this,f+1,f+2);return this},o.prototype.swap64=function(){const c=this.length;if(c%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let f=0;f<c;f+=8)p(this,f,f+7),p(this,f+1,f+6),p(this,f+2,f+5),p(this,f+3,f+4);return this},o.prototype.toString=function(){const c=this.length;return c===0?"":arguments.length===0?j(this,0,c):d.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(c){if(!o.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:o.compare(this,c)===0},o.prototype.inspect=function(){let c="";const f=r.INSPECT_MAX_BYTES;return c=this.toString("hex",0,f).replace(/(.{2})/g,"$1 ").trim(),this.length>f&&(c+=" ... "),"<Buffer "+c+">"},n&&(o.prototype[n]=o.prototype.inspect),o.prototype.compare=function(c,f,k,J,ie){if(se(c,Uint8Array)&&(c=o.from(c,c.offset,c.byteLength)),!o.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof c);if(f===void 0&&(f=0),k===void 0&&(k=c?c.length:0),J===void 0&&(J=0),ie===void 0&&(ie=this.length),f<0||k>c.length||J<0||ie>this.length)throw new RangeError("out of range index");if(J>=ie&&f>=k)return 0;if(J>=ie)return-1;if(f>=k)return 1;if(f>>>=0,k>>>=0,J>>>=0,ie>>>=0,this===c)return 0;let oe=ie-J,we=k-f;const Le=Math.min(oe,we),Te=this.slice(J,ie),je=c.slice(f,k);for(let Ie=0;Ie<Le;++Ie)if(Te[Ie]!==je[Ie]){oe=Te[Ie],we=je[Ie];break}return oe<we?-1:we<oe?1:0};function N(E,c,f,k,J){if(E.length===0)return-1;if(typeof f=="string"?(k=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,Ee(f)&&(f=J?0:E.length-1),f<0&&(f=E.length+f),f>=E.length){if(J)return-1;f=E.length-1}else if(f<0)if(J)f=0;else return-1;if(typeof c=="string"&&(c=o.from(c,k)),o.isBuffer(c))return c.length===0?-1:D(E,c,f,k,J);if(typeof c=="number")return c=c&255,typeof Uint8Array.prototype.indexOf=="function"?J?Uint8Array.prototype.indexOf.call(E,c,f):Uint8Array.prototype.lastIndexOf.call(E,c,f):D(E,[c],f,k,J);throw new TypeError("val must be string, number or Buffer")}function D(E,c,f,k,J){let ie=1,oe=E.length,we=c.length;if(k!==void 0&&(k=String(k).toLowerCase(),k==="ucs2"||k==="ucs-2"||k==="utf16le"||k==="utf-16le")){if(E.length<2||c.length<2)return-1;ie=2,oe/=2,we/=2,f/=2}function Le(je,Ie){return ie===1?je[Ie]:je.readUInt16BE(Ie*ie)}let Te;if(J){let je=-1;for(Te=f;Te<oe;Te++)if(Le(E,Te)===Le(c,je===-1?0:Te-je)){if(je===-1&&(je=Te),Te-je+1===we)return je*ie}else je!==-1&&(Te-=Te-je),je=-1}else for(f+we>oe&&(f=oe-we),Te=f;Te>=0;Te--){let je=!0;for(let Ie=0;Ie<we;Ie++)if(Le(E,Te+Ie)!==Le(c,Ie)){je=!1;break}if(je)return Te}return-1}o.prototype.includes=function(c,f,k){return this.indexOf(c,f,k)!==-1},o.prototype.indexOf=function(c,f,k){return N(this,c,f,k,!0)},o.prototype.lastIndexOf=function(c,f,k){return N(this,c,f,k,!1)};function T(E,c,f,k){f=Number(f)||0;const J=E.length-f;k?(k=Number(k),k>J&&(k=J)):k=J;const ie=c.length;k>ie/2&&(k=ie/2);let oe;for(oe=0;oe<k;++oe){const we=parseInt(c.substr(oe*2,2),16);if(Ee(we))return oe;E[f+oe]=we}return oe}function q(E,c,f,k){return he(de(c,E.length-f),E,f,k)}function R(E,c,f,k){return he(pe(c),E,f,k)}function M(E,c,f,k){return he(le(c),E,f,k)}function B(E,c,f,k){return he(X(c,E.length-f),E,f,k)}o.prototype.write=function(c,f,k,J){if(f===void 0)J="utf8",k=this.length,f=0;else if(k===void 0&&typeof f=="string")J=f,k=this.length,f=0;else if(isFinite(f))f=f>>>0,isFinite(k)?(k=k>>>0,J===void 0&&(J="utf8")):(J=k,k=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ie=this.length-f;if((k===void 0||k>ie)&&(k=ie),c.length>0&&(k<0||f<0)||f>this.length)throw new RangeError("Attempt to write outside buffer bounds");J||(J="utf8");let oe=!1;for(;;)switch(J){case"hex":return T(this,c,f,k);case"utf8":case"utf-8":return q(this,c,f,k);case"ascii":case"latin1":case"binary":return R(this,c,f,k);case"base64":return M(this,c,f,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,c,f,k);default:if(oe)throw new TypeError("Unknown encoding: "+J);J=(""+J).toLowerCase(),oe=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(E,c,f){return c===0&&f===E.length?e.fromByteArray(E):e.fromByteArray(E.slice(c,f))}function j(E,c,f){f=Math.min(E.length,f);const k=[];let J=c;for(;J<f;){const ie=E[J];let oe=null,we=ie>239?4:ie>223?3:ie>191?2:1;if(J+we<=f){let Le,Te,je,Ie;switch(we){case 1:ie<128&&(oe=ie);break;case 2:Le=E[J+1],(Le&192)===128&&(Ie=(ie&31)<<6|Le&63,Ie>127&&(oe=Ie));break;case 3:Le=E[J+1],Te=E[J+2],(Le&192)===128&&(Te&192)===128&&(Ie=(ie&15)<<12|(Le&63)<<6|Te&63,Ie>2047&&(Ie<55296||Ie>57343)&&(oe=Ie));break;case 4:Le=E[J+1],Te=E[J+2],je=E[J+3],(Le&192)===128&&(Te&192)===128&&(je&192)===128&&(Ie=(ie&15)<<18|(Le&63)<<12|(Te&63)<<6|je&63,Ie>65535&&Ie<1114112&&(oe=Ie))}}oe===null?(oe=65533,we=1):oe>65535&&(oe-=65536,k.push(oe>>>10&1023|55296),oe=56320|oe&1023),k.push(oe),J+=we}return L(k)}const Y=4096;function L(E){const c=E.length;if(c<=Y)return String.fromCharCode.apply(String,E);let f="",k=0;for(;k<c;)f+=String.fromCharCode.apply(String,E.slice(k,k+=Y));return f}function ee(E,c,f){let k="";f=Math.min(E.length,f);for(let J=c;J<f;++J)k+=String.fromCharCode(E[J]&127);return k}function P(E,c,f){let k="";f=Math.min(E.length,f);for(let J=c;J<f;++J)k+=String.fromCharCode(E[J]);return k}function K(E,c,f){const k=E.length;(!c||c<0)&&(c=0),(!f||f<0||f>k)&&(f=k);let J="";for(let ie=c;ie<f;++ie)J+=Be[E[ie]];return J}function v(E,c,f){const k=E.slice(c,f);let J="";for(let ie=0;ie<k.length-1;ie+=2)J+=String.fromCharCode(k[ie]+k[ie+1]*256);return J}o.prototype.slice=function(c,f){const k=this.length;c=~~c,f=f===void 0?k:~~f,c<0?(c+=k,c<0&&(c=0)):c>k&&(c=k),f<0?(f+=k,f<0&&(f=0)):f>k&&(f=k),f<c&&(f=c);const J=this.subarray(c,f);return Object.setPrototypeOf(J,o.prototype),J};function U(E,c,f){if(E%1!==0||E<0)throw new RangeError("offset is not uint");if(E+c>f)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(c,f,k){c=c>>>0,f=f>>>0,k||U(c,f,this.length);let J=this[c],ie=1,oe=0;for(;++oe<f&&(ie*=256);)J+=this[c+oe]*ie;return J},o.prototype.readUintBE=o.prototype.readUIntBE=function(c,f,k){c=c>>>0,f=f>>>0,k||U(c,f,this.length);let J=this[c+--f],ie=1;for(;f>0&&(ie*=256);)J+=this[c+--f]*ie;return J},o.prototype.readUint8=o.prototype.readUInt8=function(c,f){return c=c>>>0,f||U(c,1,this.length),this[c]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(c,f){return c=c>>>0,f||U(c,2,this.length),this[c]|this[c+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(c,f){return c=c>>>0,f||U(c,2,this.length),this[c]<<8|this[c+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(c,f){return c=c>>>0,f||U(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(c,f){return c=c>>>0,f||U(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},o.prototype.readBigUInt64LE=ve(function(c){c=c>>>0,O(c,"offset");const f=this[c],k=this[c+7];(f===void 0||k===void 0)&&G(c,this.length-8);const J=f+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24,ie=this[++c]+this[++c]*2**8+this[++c]*2**16+k*2**24;return BigInt(J)+(BigInt(ie)<<BigInt(32))}),o.prototype.readBigUInt64BE=ve(function(c){c=c>>>0,O(c,"offset");const f=this[c],k=this[c+7];(f===void 0||k===void 0)&&G(c,this.length-8);const J=f*2**24+this[++c]*2**16+this[++c]*2**8+this[++c],ie=this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+k;return(BigInt(J)<<BigInt(32))+BigInt(ie)}),o.prototype.readIntLE=function(c,f,k){c=c>>>0,f=f>>>0,k||U(c,f,this.length);let J=this[c],ie=1,oe=0;for(;++oe<f&&(ie*=256);)J+=this[c+oe]*ie;return ie*=128,J>=ie&&(J-=Math.pow(2,8*f)),J},o.prototype.readIntBE=function(c,f,k){c=c>>>0,f=f>>>0,k||U(c,f,this.length);let J=f,ie=1,oe=this[c+--J];for(;J>0&&(ie*=256);)oe+=this[c+--J]*ie;return ie*=128,oe>=ie&&(oe-=Math.pow(2,8*f)),oe},o.prototype.readInt8=function(c,f){return c=c>>>0,f||U(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},o.prototype.readInt16LE=function(c,f){c=c>>>0,f||U(c,2,this.length);const k=this[c]|this[c+1]<<8;return k&32768?k|4294901760:k},o.prototype.readInt16BE=function(c,f){c=c>>>0,f||U(c,2,this.length);const k=this[c+1]|this[c]<<8;return k&32768?k|4294901760:k},o.prototype.readInt32LE=function(c,f){return c=c>>>0,f||U(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},o.prototype.readInt32BE=function(c,f){return c=c>>>0,f||U(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},o.prototype.readBigInt64LE=ve(function(c){c=c>>>0,O(c,"offset");const f=this[c],k=this[c+7];(f===void 0||k===void 0)&&G(c,this.length-8);const J=this[c+4]+this[c+5]*2**8+this[c+6]*2**16+(k<<24);return(BigInt(J)<<BigInt(32))+BigInt(f+this[++c]*2**8+this[++c]*2**16+this[++c]*2**24)}),o.prototype.readBigInt64BE=ve(function(c){c=c>>>0,O(c,"offset");const f=this[c],k=this[c+7];(f===void 0||k===void 0)&&G(c,this.length-8);const J=(f<<24)+this[++c]*2**16+this[++c]*2**8+this[++c];return(BigInt(J)<<BigInt(32))+BigInt(this[++c]*2**24+this[++c]*2**16+this[++c]*2**8+k)}),o.prototype.readFloatLE=function(c,f){return c=c>>>0,f||U(c,4,this.length),t.read(this,c,!0,23,4)},o.prototype.readFloatBE=function(c,f){return c=c>>>0,f||U(c,4,this.length),t.read(this,c,!1,23,4)},o.prototype.readDoubleLE=function(c,f){return c=c>>>0,f||U(c,8,this.length),t.read(this,c,!0,52,8)},o.prototype.readDoubleBE=function(c,f){return c=c>>>0,f||U(c,8,this.length),t.read(this,c,!1,52,8)};function Q(E,c,f,k,J,ie){if(!o.isBuffer(E))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>J||c<ie)throw new RangeError('"value" argument is out of bounds');if(f+k>E.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(c,f,k,J){if(c=+c,f=f>>>0,k=k>>>0,!J){const we=Math.pow(2,8*k)-1;Q(this,c,f,k,we,0)}let ie=1,oe=0;for(this[f]=c&255;++oe<k&&(ie*=256);)this[f+oe]=c/ie&255;return f+k},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(c,f,k,J){if(c=+c,f=f>>>0,k=k>>>0,!J){const we=Math.pow(2,8*k)-1;Q(this,c,f,k,we,0)}let ie=k-1,oe=1;for(this[f+ie]=c&255;--ie>=0&&(oe*=256);)this[f+ie]=c/oe&255;return f+k},o.prototype.writeUint8=o.prototype.writeUInt8=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,1,255,0),this[f]=c&255,f+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,2,65535,0),this[f]=c&255,this[f+1]=c>>>8,f+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,2,65535,0),this[f]=c>>>8,this[f+1]=c&255,f+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,4,4294967295,0),this[f+3]=c>>>24,this[f+2]=c>>>16,this[f+1]=c>>>8,this[f]=c&255,f+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,4,4294967295,0),this[f]=c>>>24,this[f+1]=c>>>16,this[f+2]=c>>>8,this[f+3]=c&255,f+4};function z(E,c,f,k,J){fe(c,k,J,E,f,7);let ie=Number(c&BigInt(4294967295));E[f++]=ie,ie=ie>>8,E[f++]=ie,ie=ie>>8,E[f++]=ie,ie=ie>>8,E[f++]=ie;let oe=Number(c>>BigInt(32)&BigInt(4294967295));return E[f++]=oe,oe=oe>>8,E[f++]=oe,oe=oe>>8,E[f++]=oe,oe=oe>>8,E[f++]=oe,f}function ae(E,c,f,k,J){fe(c,k,J,E,f,7);let ie=Number(c&BigInt(4294967295));E[f+7]=ie,ie=ie>>8,E[f+6]=ie,ie=ie>>8,E[f+5]=ie,ie=ie>>8,E[f+4]=ie;let oe=Number(c>>BigInt(32)&BigInt(4294967295));return E[f+3]=oe,oe=oe>>8,E[f+2]=oe,oe=oe>>8,E[f+1]=oe,oe=oe>>8,E[f]=oe,f+8}o.prototype.writeBigUInt64LE=ve(function(c,f=0){return z(this,c,f,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=ve(function(c,f=0){return ae(this,c,f,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(c,f,k,J){if(c=+c,f=f>>>0,!J){const Le=Math.pow(2,8*k-1);Q(this,c,f,k,Le-1,-Le)}let ie=0,oe=1,we=0;for(this[f]=c&255;++ie<k&&(oe*=256);)c<0&&we===0&&this[f+ie-1]!==0&&(we=1),this[f+ie]=(c/oe>>0)-we&255;return f+k},o.prototype.writeIntBE=function(c,f,k,J){if(c=+c,f=f>>>0,!J){const Le=Math.pow(2,8*k-1);Q(this,c,f,k,Le-1,-Le)}let ie=k-1,oe=1,we=0;for(this[f+ie]=c&255;--ie>=0&&(oe*=256);)c<0&&we===0&&this[f+ie+1]!==0&&(we=1),this[f+ie]=(c/oe>>0)-we&255;return f+k},o.prototype.writeInt8=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,1,127,-128),c<0&&(c=255+c+1),this[f]=c&255,f+1},o.prototype.writeInt16LE=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,2,32767,-32768),this[f]=c&255,this[f+1]=c>>>8,f+2},o.prototype.writeInt16BE=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,2,32767,-32768),this[f]=c>>>8,this[f+1]=c&255,f+2},o.prototype.writeInt32LE=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,4,2147483647,-2147483648),this[f]=c&255,this[f+1]=c>>>8,this[f+2]=c>>>16,this[f+3]=c>>>24,f+4},o.prototype.writeInt32BE=function(c,f,k){return c=+c,f=f>>>0,k||Q(this,c,f,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[f]=c>>>24,this[f+1]=c>>>16,this[f+2]=c>>>8,this[f+3]=c&255,f+4},o.prototype.writeBigInt64LE=ve(function(c,f=0){return z(this,c,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=ve(function(c,f=0){return ae(this,c,f,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function H(E,c,f,k,J,ie){if(f+k>E.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function V(E,c,f,k,J){return c=+c,f=f>>>0,J||H(E,c,f,4),t.write(E,c,f,k,23,4),f+4}o.prototype.writeFloatLE=function(c,f,k){return V(this,c,f,!0,k)},o.prototype.writeFloatBE=function(c,f,k){return V(this,c,f,!1,k)};function W(E,c,f,k,J){return c=+c,f=f>>>0,J||H(E,c,f,8),t.write(E,c,f,k,52,8),f+8}o.prototype.writeDoubleLE=function(c,f,k){return W(this,c,f,!0,k)},o.prototype.writeDoubleBE=function(c,f,k){return W(this,c,f,!1,k)},o.prototype.copy=function(c,f,k,J){if(!o.isBuffer(c))throw new TypeError("argument should be a Buffer");if(k||(k=0),!J&&J!==0&&(J=this.length),f>=c.length&&(f=c.length),f||(f=0),J>0&&J<k&&(J=k),J===k||c.length===0||this.length===0)return 0;if(f<0)throw new RangeError("targetStart out of bounds");if(k<0||k>=this.length)throw new RangeError("Index out of range");if(J<0)throw new RangeError("sourceEnd out of bounds");J>this.length&&(J=this.length),c.length-f<J-k&&(J=c.length-f+k);const ie=J-k;return this===c&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(f,k,J):Uint8Array.prototype.set.call(c,this.subarray(k,J),f),ie},o.prototype.fill=function(c,f,k,J){if(typeof c=="string"){if(typeof f=="string"?(J=f,f=0,k=this.length):typeof k=="string"&&(J=k,k=this.length),J!==void 0&&typeof J!="string")throw new TypeError("encoding must be a string");if(typeof J=="string"&&!o.isEncoding(J))throw new TypeError("Unknown encoding: "+J);if(c.length===1){const oe=c.charCodeAt(0);(J==="utf8"&&oe<128||J==="latin1")&&(c=oe)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(f<0||this.length<f||this.length<k)throw new RangeError("Out of range index");if(k<=f)return this;f=f>>>0,k=k===void 0?this.length:k>>>0,c||(c=0);let ie;if(typeof c=="number")for(ie=f;ie<k;++ie)this[ie]=c;else{const oe=o.isBuffer(c)?c:o.from(c,J),we=oe.length;if(we===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(ie=0;ie<k-f;++ie)this[ie+f]=oe[ie%we]}return this};const F={};function Z(E,c,f){F[E]=class extends f{constructor(){super(),Object.defineProperty(this,"message",{value:c.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${E}]`,this.stack,delete this.name}get code(){return E}set code(J){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:J,writable:!0})}toString(){return`${this.name} [${E}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(E){return E?`${E} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(E,c){return`The "${E}" argument must be of type number. Received type ${typeof c}`},TypeError),Z("ERR_OUT_OF_RANGE",function(E,c,f){let k=`The value of "${E}" is out of range.`,J=f;return Number.isInteger(f)&&Math.abs(f)>2**32?J=te(String(f)):typeof f=="bigint"&&(J=String(f),(f>BigInt(2)**BigInt(32)||f<-(BigInt(2)**BigInt(32)))&&(J=te(J)),J+="n"),k+=` It must be ${c}. Received ${J}`,k},RangeError);function te(E){let c="",f=E.length;const k=E[0]==="-"?1:0;for(;f>=k+4;f-=3)c=`_${E.slice(f-3,f)}${c}`;return`${E.slice(0,f)}${c}`}function ce(E,c,f){O(c,"offset"),(E[c]===void 0||E[c+f]===void 0)&&G(c,E.length-(f+1))}function fe(E,c,f,k,J,ie){if(E>f||E<c){const oe=typeof c=="bigint"?"n":"";let we;throw c===0||c===BigInt(0)?we=`>= 0${oe} and < 2${oe} ** ${(ie+1)*8}${oe}`:we=`>= -(2${oe} ** ${(ie+1)*8-1}${oe}) and < 2 ** ${(ie+1)*8-1}${oe}`,new F.ERR_OUT_OF_RANGE("value",we,E)}ce(k,J,ie)}function O(E,c){if(typeof E!="number")throw new F.ERR_INVALID_ARG_TYPE(c,"number",E)}function G(E,c,f){throw Math.floor(E)!==E?(O(E,f),new F.ERR_OUT_OF_RANGE("offset","an integer",E)):c<0?new F.ERR_BUFFER_OUT_OF_BOUNDS:new F.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${c}`,E)}const re=/[^+/0-9A-Za-z-_]/g;function ue(E){if(E=E.split("=")[0],E=E.trim().replace(re,""),E.length<2)return"";for(;E.length%4!==0;)E=E+"=";return E}function de(E,c){c=c||1/0;let f;const k=E.length;let J=null;const ie=[];for(let oe=0;oe<k;++oe){if(f=E.charCodeAt(oe),f>55295&&f<57344){if(!J){if(f>56319){(c-=3)>-1&&ie.push(239,191,189);continue}else if(oe+1===k){(c-=3)>-1&&ie.push(239,191,189);continue}J=f;continue}if(f<56320){(c-=3)>-1&&ie.push(239,191,189),J=f;continue}f=(J-55296<<10|f-56320)+65536}else J&&(c-=3)>-1&&ie.push(239,191,189);if(J=null,f<128){if((c-=1)<0)break;ie.push(f)}else if(f<2048){if((c-=2)<0)break;ie.push(f>>6|192,f&63|128)}else if(f<65536){if((c-=3)<0)break;ie.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((c-=4)<0)break;ie.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return ie}function pe(E){const c=[];for(let f=0;f<E.length;++f)c.push(E.charCodeAt(f)&255);return c}function X(E,c){let f,k,J;const ie=[];for(let oe=0;oe<E.length&&!((c-=2)<0);++oe)f=E.charCodeAt(oe),k=f>>8,J=f%256,ie.push(J),ie.push(k);return ie}function le(E){return e.toByteArray(ue(E))}function he(E,c,f,k){let J;for(J=0;J<k&&!(J+f>=c.length||J>=E.length);++J)c[J+f]=E[J];return J}function se(E,c){return E instanceof c||E!=null&&E.constructor!=null&&E.constructor.name!=null&&E.constructor.name===c.name}function Ee(E){return E!==E}const Be=function(){const E="0123456789abcdef",c=new Array(256);for(let f=0;f<16;++f){const k=f*16;for(let J=0;J<16;++J)c[k+J]=E[f]+E[J]}return c}();function ve(E){return typeof BigInt>"u"?He:E}function He(){throw new Error("BigInt not supported")}}(Wn)),Wn}var Ac=bt();const gr="http://www.w3.org/1999/02/22-rdf-syntax-ns#",yr="http://www.w3.org/2001/XMLSchema#",rn="http://www.w3.org/2000/10/swap/",Ce={xsd:{decimal:`${yr}decimal`,boolean:`${yr}boolean`,double:`${yr}double`,integer:`${yr}integer`,string:`${yr}string`},rdf:{type:`${gr}type`,nil:`${gr}nil`,first:`${gr}first`,rest:`${gr}rest`,langString:`${gr}langString`},owl:{sameAs:"http://www.w3.org/2002/07/owl#sameAs"},r:{forSome:`${rn}reify#forSome`,forAll:`${rn}reify#forAll`},log:{implies:`${rn}log#implies`,isImpliedBy:`${rn}log#isImpliedBy`}},{xsd:nn}=Ce,Lc=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g,ja={"\\":"\\","'":"'",'"':'"',n:`
|
|
7
|
+
`,r:"\r",t:" ",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},jc=/[\x00-\x20<>\\"\{\}\|\^\`]/,Oc={_iri:!0,_unescapedIri:!0,_simpleQuotedString:!0,_langcode:!0,_blank:!0,_newline:!0,_comment:!0,_whitespace:!0,_endOfFile:!0},$c=/$0^/;class kc{constructor(e){if(this._iri=/^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/,this._unescapedIri=/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/,this._simpleQuotedString=/^"([^"\\\r\n]*)"(?=[^"])/,this._simpleApostropheString=/^'([^'\\\r\n]*)'(?=[^'])/,this._langcode=/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,this._prefix=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/,this._prefixed=/^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/,this._variable=/^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/,this._blank=/^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/,this._number=/^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/,this._boolean=/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/,this._keyword=/^@[a-z]+(?=[\s#<:])/i,this._sparqlKeyword=/^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i,this._shortPredicates=/^a(?=[\s#()\[\]\{\}"'<>])/,this._newline=/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,this._comment=/#([^\n\r]*)/,this._whitespace=/^[ \t]+/,this._endOfFile=/^(?:#[^\n\r]*)?$/,e=e||{},this._isImpliedBy=e.isImpliedBy,this._lineMode=!!e.lineMode){this._n3Mode=!1;for(const t in this)!(t in Oc)&&this[t]instanceof RegExp&&(this[t]=$c)}else this._n3Mode=e.n3!==!1;this.comments=!!e.comments,this._literalClosingPos=0}_tokenizeToEnd(e,t){let n=this._input,i=n.length;for(;;){let o,l;for(;o=this._newline.exec(n);)this.comments&&(l=this._comment.exec(o[0]))&&s("comment",l[1],"",this._line,o[0].length),n=n.substr(o[0].length,n.length),i=n.length,this._line++;if(!o&&(o=this._whitespace.exec(n))&&(n=n.substr(o[0].length,n.length)),this._endOfFile.test(n))return t&&(this.comments&&(l=this._comment.exec(n))&&s("comment",l[1],"",this._line,n.length),n=null,s("eof","","",this._line,0)),this._input=n;const u=this._line,h=n[0];let y="",b="",g="",m=null,_=0,x=!1;switch(h){case"^":if(n.length<3)break;if(n[1]==="^"){if(this._previousMarker="^^",n=n.substr(2),n[0]!=="<"){x=!0;break}}else{this._n3Mode&&(_=1,y="^");break}case"<":if(m=this._unescapedIri.exec(n))y="IRI",b=m[1];else if(m=this._iri.exec(n)){if(b=this._unescape(m[1]),b===null||jc.test(b))return a(this);y="IRI"}else n.length>1&&n[1]==="<"?(y="<<",_=2):this._n3Mode&&n.length>1&&n[1]==="="&&(_=2,this._isImpliedBy?(y="abbreviation",b="<"):(y="inverse",b=">"));break;case">":n.length>1&&n[1]===">"&&(y=">>",_=2);break;case"_":((m=this._blank.exec(n))||t&&(m=this._blank.exec(`${n} `)))&&(y="blank",g="_",b=m[1]);break;case'"':if(m=this._simpleQuotedString.exec(n))b=m[1];else if({value:b,matchLength:_}=this._parseLiteral(n),b===null)return a(this);(m!==null||_!==0)&&(y="literal",this._literalClosingPos=0);break;case"'":if(!this._lineMode){if(m=this._simpleApostropheString.exec(n))b=m[1];else if({value:b,matchLength:_}=this._parseLiteral(n),b===null)return a(this);(m!==null||_!==0)&&(y="literal",this._literalClosingPos=0)}break;case"?":this._n3Mode&&(m=this._variable.exec(n))&&(y="var",b=m[0]);break;case"@":this._previousMarker==="literal"&&(m=this._langcode.exec(n))?(y="langcode",b=m[1]):(m=this._keyword.exec(n))&&(y=m[0]);break;case".":if(n.length===1?t:n[1]<"0"||n[1]>"9"){y=".",_=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(m=this._number.exec(n)||t&&(m=this._number.exec(`${n} `)))&&(y="literal",b=m[0],g=typeof m[1]=="string"?nn.double:typeof m[2]=="string"?nn.decimal:nn.integer);break;case"B":case"b":case"p":case"P":case"G":case"g":(m=this._sparqlKeyword.exec(n))?y=m[0].toUpperCase():x=!0;break;case"f":case"t":(m=this._boolean.exec(n))?(y="literal",b=m[0],g=nn.boolean):x=!0;break;case"a":(m=this._shortPredicates.exec(n))?(y="abbreviation",b="a"):x=!0;break;case"=":this._n3Mode&&n.length>1&&(y="abbreviation",n[1]!==">"?(_=1,b="="):(_=2,b=">"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"}":this._lineMode||(_=1,y=h);break;case"{":!this._lineMode&&n.length>=2&&(n[1]==="|"?(y="{|",_=2):(y=h,_=1));break;case"|":n.length>=2&&n[1]==="}"&&(y="|}",_=2);break;default:x=!0}if(x&&((this._previousMarker==="@prefix"||this._previousMarker==="PREFIX")&&(m=this._prefix.exec(n))?(y="prefix",b=m[1]||""):((m=this._prefixed.exec(n))||t&&(m=this._prefixed.exec(`${n} `)))&&(y="prefixed",g=m[1]||"",b=this._unescape(m[2]))),this._previousMarker==="^^")switch(y){case"prefixed":y="type";break;case"IRI":y="typeIRI";break;default:y=""}if(!y)return t||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?a(this):this._input=n;const S=_||m[0].length,I=s(y,b,g,u,S);this.previousToken=I,this._previousMarker=y,n=n.substr(S,n.length)}function s(o,l,u,h,y){const b=n?i-n.length:i,g=b+y,m={type:o,value:l,prefix:u,line:h,start:b,end:g};return e(null,m),m}function a(o){e(o._syntaxError(/^\S*/.exec(n)[0]))}}_unescape(e){let t=!1;const n=e.replace(Lc,(i,s,a,o)=>{if(typeof s=="string")return String.fromCharCode(Number.parseInt(s,16));if(typeof a=="string"){let l=Number.parseInt(a,16);return l<=65535?String.fromCharCode(Number.parseInt(a,16)):String.fromCharCode(55296+((l-=65536)>>10),56320+(l&1023))}return o in ja?ja[o]:(t=!0,"")});return t?null:n}_parseLiteral(e){if(e.length>=3){const t=e.match(/^(?:"""|"|'''|'|)/)[0],n=t.length;let i=Math.max(this._literalClosingPos,n);for(;(i=e.indexOf(t,i))>0;){let s=0;for(;e[i-s-1]==="\\";)s++;if(s%2===0){const a=e.substring(n,i),o=a.split(/\r\n|\r|\n/).length-1,l=i+n;if(n===1&&o!==0||n===3&&this._lineMode)break;return this._line+=o,{value:this._unescape(a),matchLength:l}}i++}this._literalClosingPos=e.length-n+1}return{value:"",matchLength:0}}_syntaxError(e){this._input=null;const t=new Error(`Unexpected "${e}" on line ${this._line}.`);return t.context={token:void 0,line:this._line,previousToken:this.previousToken},t}_readStartingBom(e){return e.startsWith("\uFEFF")?e.substr(1):e}tokenize(e,t){if(this._line=1,typeof e=="string")if(this._input=this._readStartingBom(e),typeof t=="function")queueMicrotask(()=>this._tokenizeToEnd(t,!0));else{const n=[];let i;if(this._tokenizeToEnd((s,a)=>s?i=s:n.push(a),!0),i)throw i;return n}else this._pendingBuffer=null,typeof e.setEncoding=="function"&&e.setEncoding("utf8"),e.on("data",n=>{this._input!==null&&n.length!==0&&(this._pendingBuffer&&(n=Ac.Buffer.concat([this._pendingBuffer,n]),this._pendingBuffer=null),n[n.length-1]&128?this._pendingBuffer=n:(typeof this._input>"u"?this._input=this._readStartingBom(typeof n=="string"?n:n.toString()):this._input+=n,this._tokenizeToEnd(t,!1)))}),e.on("end",()=>{typeof this._input=="string"&&this._tokenizeToEnd(t,!0)}),e.on("error",t)}}const{rdf:Dc,xsd:Mt}=Ce;let lr,Mc=0;const Se={namedNode:gu,blankNode:yu,variable:bu,literal:mu,defaultGraph:Bc,quad:Ls,triple:Ls,fromTerm:Mr,fromQuad:wu};class it{constructor(e){this.id=e}get value(){return this.id}equals(e){return e instanceof it?this.id===e.id:!!e&&this.termType===e.termType&&this.value===e.value}hashCode(){return 0}toJSON(){return{termType:this.termType,value:this.value}}}let Gs=class extends it{get termType(){return"NamedNode"}},lt=class pu extends it{get termType(){return"Literal"}get value(){return this.id.substring(1,this.id.lastIndexOf('"'))}get language(){const e=this.id;let t=e.lastIndexOf('"')+1;return t<e.length&&e[t++]==="@"?e.substr(t).toLowerCase():""}get datatype(){return new Gs(this.datatypeString)}get datatypeString(){const e=this.id,t=e.lastIndexOf('"')+1,n=t<e.length?e[t]:"";return n==="^"?e.substr(t+2):n!=="@"?Mt.string:Dc.langString}equals(e){return e instanceof pu?this.id===e.id:!!e&&!!e.datatype&&this.termType===e.termType&&this.value===e.value&&this.language===e.language&&this.datatype.value===e.datatype.value}toJSON(){return{termType:this.termType,value:this.value,language:this.language,datatype:{termType:"NamedNode",value:this.datatypeString}}}},Pc=class extends it{constructor(e){super(`_:${e}`)}get termType(){return"BlankNode"}get value(){return this.id.substr(2)}},Cc=class extends it{constructor(e){super(`?${e}`)}get termType(){return"Variable"}get value(){return this.id.substr(1)}},qc=class extends it{constructor(){return super(""),lr||this}get termType(){return"DefaultGraph"}equals(e){return this===e||!!e&&this.termType===e.termType}};lr=new qc;function Dr(r,e,t){if(e=e||Se,!r)return e.defaultGraph();switch(r[0]){case"?":return e.variable(r.substr(1));case"_":return e.blankNode(r.substr(2));case'"':if(e===Se)return new lt(r);if(r[r.length-1]==='"')return e.literal(r.substr(1,r.length-2));const n=r.lastIndexOf('"',r.length-1);return e.literal(r.substr(1,n-1),r[n+1]==="@"?r.substr(n+2):e.namedNode(r.substr(n+3)));case"[":r=JSON.parse(r);break;default:if(!t||!Array.isArray(r))return e.namedNode(r)}return e.quad(Dr(r[0],e,!0),Dr(r[1],e,!0),Dr(r[2],e,!0),r[3]&&Dr(r[3],e,!0))}function er(r,e){if(typeof r=="string")return r;if(r instanceof it&&r.termType!=="Quad")return r.id;if(!r)return lr.id;switch(r.termType){case"NamedNode":return r.value;case"BlankNode":return`_:${r.value}`;case"Variable":return`?${r.value}`;case"DefaultGraph":return"";case"Literal":return`"${r.value}"${r.language?`@${r.language}`:r.datatype&&r.datatype.value!==Mt.string?`^^${r.datatype.value}`:""}`;case"Quad":const t=[er(r.subject,!0),er(r.predicate,!0),er(r.object,!0)];return r.graph&&r.graph.termType!=="DefaultGraph"&&t.push(er(r.graph,!0)),e?t:JSON.stringify(t);default:throw new Error(`Unexpected termType: ${r.termType}`)}}let An=class extends it{constructor(e,t,n,i){super(""),this._subject=e,this._predicate=t,this._object=n,this._graph=i||lr}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 gu(r){return new Gs(r)}function yu(r){return new Pc(r||`n3-${Mc++}`)}function mu(r,e){if(typeof e=="string")return new lt(`"${r}"@${e.toLowerCase()}`);let t=e?e.value:"";return t===""&&(typeof r=="boolean"?t=Mt.boolean:typeof r=="number"&&(Number.isFinite(r)?t=Number.isInteger(r)?Mt.integer:Mt.double:(t=Mt.double,Number.isNaN(r)||(r=r>0?"INF":"-INF")))),t===""||t===Mt.string?new lt(`"${r}"`):new lt(`"${r}"^^${t}`)}function bu(r){return new Cc(r)}function Bc(){return lr}function Ls(r,e,t,n){return new An(r,e,t,n)}function Mr(r){if(r instanceof it)return r;switch(r.termType){case"NamedNode":return gu(r.value);case"BlankNode":return yu(r.value);case"Variable":return bu(r.value);case"DefaultGraph":return lr;case"Literal":return mu(r.value,r.language||r.datatype);case"Quad":return wu(r);default:throw new Error(`Unexpected termType: ${r.termType}`)}}function wu(r){if(r instanceof An)return r;if(r.termType!=="Quad")throw new Error(`Unexpected termType: ${r.termType}`);return Ls(Mr(r.subject),Mr(r.predicate),Mr(r.object),Mr(r.graph))}let Oa=0;class js{constructor(e){this._contextStack=[],this._graph=null,e=e||{},this._setBase(e.baseIRI),e.factory&&vu(this,e.factory);const t=typeof e.format=="string"?e.format.match(/\w*$/)[0].toLowerCase():"",n=/turtle/.test(t),i=/trig/.test(t),s=/triple/.test(t),a=/quad/.test(t),o=this._n3Mode=/n3/.test(t),l=s||a;(this._supportsNamedGraphs=!(n||o))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(n||i||s||o),this._isImpliedBy=e.isImpliedBy,this._supportsRDFStar=t===""||/star|\*$/.test(t),l&&(this._resolveRelativeIRI=u=>null),this._blankNodePrefix=typeof e.blankNodePrefix!="string"?"":e.blankNodePrefix.replace(/^(?!_:)/,"_:"),this._lexer=e.lexer||new kc({lineMode:l,n3:o,isImpliedBy:this._isImpliedBy}),this._explicitQuantifiers=!!e.explicitQuantifiers}static _resetBlankNodePrefix(){Oa=0}_setBase(e){if(!e)this._base="",this._basePath="";else{const t=e.indexOf("#");t>=0&&(e=e.substr(0,t)),this._base=e,this._basePath=e.indexOf("/")<0?e:e.replace(/[^\/?]*(?:\?.*)?$/,""),e=e.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i),this._baseRoot=e[0],this._baseScheme=e[1]}}_saveContext(e,t,n,i,s){const a=this._n3Mode;this._contextStack.push({type:e,subject:n,predicate:i,object:s,graph:t,inverse:a?this._inversePredicate:!1,blankPrefix:a?this._prefixes._:"",quantified:a?this._quantified:null}),a&&(this._inversePredicate=!1,this._prefixes._=this._graph?`${this._graph.value}.`:".",this._quantified=Object.create(this._quantified))}_restoreContext(e,t){const n=this._contextStack.pop();if(!n||n.type!==e)return this._error(`Unexpected ${t.type}`,t);this._subject=n.subject,this._predicate=n.predicate,this._object=n.object,this._graph=n.graph,this._n3Mode&&(this._inversePredicate=n.inverse,this._prefixes._=n.blankPrefix,this._quantified=n.quantified)}_readInTopContext(e){switch(e.type){case"eof":return this._graph!==null?this._error("Unclosed graph",e):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(e)}}_readEntity(e,t){let n;switch(e.type){case"IRI":case"typeIRI":const i=this._resolveIRI(e.value);if(i===null)return this._error("Invalid IRI",e);n=this._factory.namedNode(i);break;case"type":case"prefixed":const s=this._prefixes[e.prefix];if(s===void 0)return this._error(`Undefined prefix "${e.prefix}:"`,e);n=this._factory.namedNode(s+e.value);break;case"blank":n=this._factory.blankNode(this._prefixes[e.prefix]+e.value);break;case"var":n=this._factory.variable(e.value.substr(1));break;default:return this._error(`Expected entity but got ${e.type}`,e)}return!t&&this._n3Mode&&n.id in this._quantified&&(n=this._quantified[n.id]),n}_readSubject(e){switch(this._predicate=null,e.type){case"[":return this._saveContext("blank",this._graph,this._subject=this._factory.blankNode(),null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this.RDF_NIL,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph=this._factory.blankNode(),null,null),this._readSubject):this._error("Unexpected graph",e);case"}":return this._readPunctuation(e);case"@forSome":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORSOME,this._quantifier="blankNode",this._readQuantifierList):this._error('Unexpected "@forSome"',e);case"@forAll":return this._n3Mode?(this._subject=null,this._predicate=this.N3_FORALL,this._quantifier="variable",this._readQuantifierList):this._error('Unexpected "@forAll"',e);case"literal":if(!this._n3Mode)return this._error("Unexpected literal",e);if(e.prefix.length===0)return this._literalValue=e.value,this._completeSubjectLiteral;this._subject=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,null,null,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._subject=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph}_readPredicate(e){const t=e.type;switch(t){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=this.ABBREVIATIONS[e.value];break;case".":case"]":case"}":return this._predicate===null?this._error(`Unexpected ${t}`,e):(this._subject=null,t==="]"?this._readBlankNodeTail(e):this._readPunctuation(e));case";":return this._predicate!==null?this._readPredicate:this._error("Expected predicate but got ;",e);case"[":if(this._n3Mode)return this._saveContext("blank",this._graph,this._subject,this._subject=this._factory.blankNode(),null),this._readBlankNodeHead;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",e);default:if((this._predicate=this._readEntity(e))===void 0)return}return this._readObject}_readObject(e){switch(e.type){case"literal":if(e.prefix.length===0)return this._literalValue=e.value,this._readDataTypeOrLang;this._object=this._factory.literal(e.value,this._factory.namedNode(e.prefix));break;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject=this._factory.blankNode()),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,this.RDF_NIL),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);case"<<":return this._supportsRDFStar?(this._saveContext("<<",this._graph,this._subject,this._predicate,null),this._graph=null,this._readSubject):this._error("Unexpected RDF-star syntax",e);default:if((this._object=this._readEntity(e))===void 0)return;if(this._n3Mode)return this._getPathReader(this._getContextEndReader())}return this._getContextEndReader()}_readPredicateOrNamedGraph(e){return e.type==="{"?this._readGraph(e):this._readPredicate(e)}_readGraph(e){return e.type!=="{"?this._error(`Expected graph but got ${e.type}`,e):(this._graph=this._subject,this._subject=null,this._readSubject)}_readBlankNodeHead(e){return e.type==="]"?(this._subject=null,this._readBlankNodeTail(e)):(this._predicate=null,this._readPredicate(e))}_readBlankNodeTail(e){if(e.type!=="]")return this._readBlankNodePunctuation(e);this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph);const t=this._predicate===null;return this._restoreContext("blank",e),this._object!==null?this._getContextEndReader():this._predicate!==null?this._readObject:t?this._readPredicateOrNamedGraph:this._readPredicateAfterBlank}_readPredicateAfterBlank(e){switch(e.type){case".":case"}":return this._subject=null,this._readPunctuation(e);default:return this._readPredicate(e)}}_readListItem(e){let t=null,n=null,i=this._readListItem;const s=this._subject,a=this._contextStack,o=a[a.length-1];switch(e.type){case"[":this._saveContext("blank",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this._subject=t=this._factory.blankNode()),i=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,n=this._factory.blankNode(),this.RDF_FIRST,this.RDF_NIL),this._subject=null;break;case")":if(this._restoreContext("list",e),a.length!==0&&a[a.length-1].type==="list"&&this._emit(this._subject,this._predicate,this._object,this._graph),this._predicate===null){if(i=this._readPredicate,this._subject===this.RDF_NIL)return i}else if(i=this._getContextEndReader(),this._object===this.RDF_NIL)return i;n=this.RDF_NIL;break;case"literal":e.prefix.length===0?(this._literalValue=e.value,i=this._readListItemDataTypeOrLang):(t=this._factory.literal(e.value,this._factory.namedNode(e.prefix)),i=this._getContextEndReader());break;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph=this._factory.blankNode()),this._readSubject):this._error("Unexpected graph",e);default:if((t=this._readEntity(e))===void 0)return}if(n===null&&(this._subject=n=this._factory.blankNode()),s===null?o.predicate===null?o.subject=n:o.object=n:this._emit(s,this.RDF_REST,n,this._graph),t!==null){if(this._n3Mode&&(e.type==="IRI"||e.type==="prefixed"))return this._saveContext("item",this._graph,n,this.RDF_FIRST,t),this._subject=t,this._predicate=null,this._getPathReader(this._readListItem);this._emit(n,this.RDF_FIRST,t,this._graph)}return i}_readDataTypeOrLang(e){return this._completeObjectLiteral(e,!1)}_readListItemDataTypeOrLang(e){return this._completeObjectLiteral(e,!0)}_completeLiteral(e){let t=this._factory.literal(this._literalValue);switch(e.type){case"type":case"typeIRI":const n=this._readEntity(e);if(n===void 0)return;t=this._factory.literal(this._literalValue,n),e=null;break;case"langcode":t=this._factory.literal(this._literalValue,e.value),e=null;break}return{token:e,literal:t}}_completeSubjectLiteral(e){return this._subject=this._completeLiteral(e).literal,this._readPredicateOrNamedGraph}_completeObjectLiteral(e,t){const n=this._completeLiteral(e);if(n)return this._object=n.literal,t&&this._emit(this._subject,this.RDF_FIRST,this._object,this._graph),n.token===null?this._getContextEndReader():(this._readCallback=this._getContextEndReader(),this._readCallback(n.token))}_readFormulaTail(e){return e.type!=="}"?this._readPunctuation(e):(this._subject!==null&&this._emit(this._subject,this._predicate,this._object,this._graph),this._restoreContext("formula",e),this._object===null?this._readPredicate:this._getContextEndReader())}_readPunctuation(e){let t,n=this._graph;const i=this._subject,s=this._inversePredicate;switch(e.type){case"}":if(this._graph===null)return this._error("Unexpected graph closing",e);if(this._n3Mode)return this._readFormulaTail(e);this._graph=null;case".":this._subject=null,t=this._contextStack.length?this._readSubject:this._readInTopContext,s&&(this._inversePredicate=!1);break;case";":t=this._readPredicate;break;case",":t=this._readObject;break;case"{|":if(!this._supportsRDFStar)return this._error("Unexpected RDF-star syntax",e);const a=this._predicate,o=this._object;this._subject=this._factory.quad(i,a,o,this.DEFAULTGRAPH),t=this._readPredicate;break;case"|}":if(this._subject.termType!=="Quad")return this._error("Unexpected asserted triple closing",e);this._subject=null,t=this._readPunctuation;break;default:if(this._supportsQuads&&this._graph===null&&(n=this._readEntity(e))!==void 0){t=this._readQuadPunctuation;break}return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}if(i!==null){const a=this._predicate,o=this._object;s?this._emit(o,a,i,n):this._emit(i,a,o,n)}return t}_readBlankNodePunctuation(e){let t;switch(e.type){case";":t=this._readPredicate;break;case",":t=this._readObject;break;default:return this._error(`Expected punctuation to follow "${this._object.id}"`,e)}return this._emit(this._subject,this._predicate,this._object,this._graph),t}_readQuadPunctuation(e){return e.type!=="."?this._error("Expected dot to follow quad",e):this._readInTopContext}_readPrefix(e){return e.type!=="prefix"?this._error("Expected prefix to follow @prefix",e):(this._prefix=e.value,this._readPrefixIRI)}_readPrefixIRI(e){if(e.type!=="IRI")return this._error(`Expected IRI to follow prefix "${this._prefix}:"`,e);const t=this._readEntity(e);return this._prefixes[this._prefix]=t.value,this._prefixCallback(this._prefix,t),this._readDeclarationPunctuation}_readBaseIRI(e){const t=e.type==="IRI"&&this._resolveIRI(e.value);return t?(this._setBase(t),this._readDeclarationPunctuation):this._error("Expected valid IRI to follow base declaration",e)}_readNamedGraphLabel(e){switch(e.type){case"IRI":case"blank":case"prefixed":return this._readSubject(e),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",e)}}_readNamedGraphBlankLabel(e){return e.type!=="]"?this._error("Invalid graph label",e):(this._subject=this._factory.blankNode(),this._readGraph)}_readDeclarationPunctuation(e){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(e)):e.type!=="."?this._error("Expected declaration to end with a dot",e):this._readInTopContext}_readQuantifierList(e){let t;switch(e.type){case"IRI":case"prefixed":if((t=this._readEntity(e,!0))!==void 0)break;default:return this._error(`Unexpected ${e.type}`,e)}return this._explicitQuantifiers?(this._subject===null?this._emit(this._graph||this.DEFAULTGRAPH,this._predicate,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH):this._emit(this._subject,this.RDF_REST,this._subject=this._factory.blankNode(),this.QUANTIFIERS_GRAPH),this._emit(this._subject,this.RDF_FIRST,t,this.QUANTIFIERS_GRAPH)):this._quantified[t.id]=this._factory[this._quantifier](this._factory.blankNode().value),this._readQuantifierPunctuation}_readQuantifierPunctuation(e){return e.type===","?this._readQuantifierList:(this._explicitQuantifiers&&(this._emit(this._subject,this.RDF_REST,this.RDF_NIL,this.QUANTIFIERS_GRAPH),this._subject=null),this._readCallback=this._getContextEndReader(),this._readCallback(e))}_getPathReader(e){return this._afterPath=e,this._readPath}_readPath(e){switch(e.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:const t=this._contextStack,n=t.length&&t[t.length-1];if(n&&n.type==="item"){const i=this._subject;this._restoreContext("item",e),this._emit(this._subject,this.RDF_FIRST,i,this._graph)}return this._afterPath(e)}}_readForwardPath(e){let t,n;const i=this._factory.blankNode();if((n=this._readEntity(e))!==void 0)return this._predicate===null?(t=this._subject,this._subject=i):(t=this._object,this._object=i),this._emit(t,n,i,this._graph),this._readPath}_readBackwardPath(e){const t=this._factory.blankNode();let n,i;if((n=this._readEntity(e))!==void 0)return this._predicate===null?(i=this._subject,this._subject=t):(i=this._object,this._object=t),this._emit(t,n,i,this._graph),this._readPath}_readRDFStarTailOrGraph(e){return e.type!==">>"?this._supportsQuads&&this._graph===null&&(this._graph=this._readEntity(e))!==void 0?this._readRDFStarTail:this._error(`Expected >> to follow "${this._object.id}"`,e):this._readRDFStarTail(e)}_readRDFStarTail(e){if(e.type!==">>")return this._error(`Expected >> but got ${e.type}`,e);const t=this._factory.quad(this._subject,this._predicate,this._object,this._graph||this.DEFAULTGRAPH);return this._restoreContext("<<",e),this._subject===null?(this._subject=t,this._readPredicate):(this._object=t,this._getContextEndReader())}_getContextEndReader(){const e=this._contextStack;if(!e.length)return this._readPunctuation;switch(e[e.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail;case"<<":return this._readRDFStarTailOrGraph}}_emit(e,t,n,i){this._callback(null,this._factory.quad(e,t,n,i||this.DEFAULTGRAPH))}_error(e,t){const n=new Error(`${e} on line ${t.line}.`);n.context={token:t,line:t.line,previousToken:this._lexer.previousToken},this._callback(n),this._callback=sn}_resolveIRI(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)?e:this._resolveRelativeIRI(e)}_resolveRelativeIRI(e){if(!e.length)return this._base;switch(e[0]){case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return(e[1]==="/"?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return/^[^/:]*:/.test(e)?null:this._removeDotSegments(this._basePath+e)}}_removeDotSegments(e){if(!/(^|\/)\.\.?($|[/#?])/.test(e))return e;const t=e.length;let n="",i=-1,s=-1,a=0,o="/";for(;i<t;){switch(o){case":":if(s<0&&e[++i]==="/"&&e[++i]==="/")for(;(s=i+1)<t&&e[s]!=="/";)i=s;break;case"?":case"#":i=t;break;case"/":if(e[i+1]===".")switch(o=e[++i+1],o){case"/":n+=e.substring(a,i-1),a=i+1;break;case void 0:case"?":case"#":return n+e.substring(a,i)+e.substr(i+1);case".":if(o=e[++i+1],o===void 0||o==="/"||o==="?"||o==="#"){if(n+=e.substring(a,i-2),(a=n.lastIndexOf("/"))>=s&&(n=n.substr(0,a)),o!=="/")return`${n}/${e.substr(i+1)}`;a=i+1}}}o=e[++i]}return n+e.substring(a)}parse(e,t,n){let i,s,a;if(t&&(t.onQuad||t.onPrefix||t.onComment)?(i=t.onQuad,s=t.onPrefix,a=t.onComment):(i=t,s=n),this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix?this._blankNodePrefix.substr(2):`b${Oa++}_`,this._prefixCallback=s||sn,this._inversePredicate=!1,this._quantified=Object.create(null),!i){const l=[];let u;if(this._callback=(h,y)=>{h?u=h:y&&l.push(y)},this._lexer.tokenize(e).every(h=>this._readCallback=this._readCallback(h)),u)throw u;return l}let o=(l,u)=>{l!==null?(this._callback(l),this._callback=sn):this._readCallback&&(this._readCallback=this._readCallback(u))};a&&(this._lexer.comments=!0,o=(l,u)=>{l!==null?(this._callback(l),this._callback=sn):this._readCallback&&(u.type==="comment"?a(u.value):this._readCallback=this._readCallback(u))}),this._callback=i,this._lexer.tokenize(e,o)}}function sn(){}function vu(r,e){r._factory=e,r.DEFAULTGRAPH=e.defaultGraph(),r.RDF_FIRST=e.namedNode(Ce.rdf.first),r.RDF_REST=e.namedNode(Ce.rdf.rest),r.RDF_NIL=e.namedNode(Ce.rdf.nil),r.N3_FORALL=e.namedNode(Ce.r.forAll),r.N3_FORSOME=e.namedNode(Ce.r.forSome),r.ABBREVIATIONS={a:e.namedNode(Ce.rdf.type),"=":e.namedNode(Ce.owl.sameAs),">":e.namedNode(Ce.log.implies),"<":e.namedNode(Ce.log.isImpliedBy)},r.QUANTIFIERS_GRAPH=e.namedNode("urn:n3:quantifiers")}vu(js.prototype,Se);function Os(r){return!!r&&r.termType==="DefaultGraph"}function hn(r){return r.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&")}const Fc=/^:?[^:?#]*(?:[?#]|$)|^file:|^[^:]*:\/*[^?#]+?\/(?:\.\.?(?:\/|$)|\/)/i,Uc=/^(?:(?:[^/?#]{3,}|\.?[^/?#.]\.?)(?:\/[^/?#]{3,}|\.?[^/?#.]\.?)*\/?)?(?:[?#]|$)/,$a="./",Hc="../",zn="?",ka="#";class Ws{constructor(e){this.base=e,this._baseLength=0,this._baseMatcher=null,this._pathReplacements=new Array(e.length+1)}static supports(e){return!Fc.test(e)}_getBaseMatcher(){if(this._baseMatcher)return this._baseMatcher;if(!Ws.supports(this.base))return this._baseMatcher=/.^/;const e=/^[^:]*:\/*/.exec(this.base)[0],t=["^",hn(e)],n=[],i=[],s=/[^/?#]*([/?#])/y;let a,o=0,l=0,u=s.lastIndex=e.length;for(;!o&&!l&&(a=s.exec(this.base));)a[1]===ka?l=s.lastIndex-1:(t.push(hn(a[0]),"(?:"),n.push(")?"),a[1]!==zn?i.push(u=s.lastIndex):(o=u=s.lastIndex,l=this.base.indexOf(ka,o),this._pathReplacements[o]=zn));for(let h=0;h<i.length;h++)this._pathReplacements[i[h]]=Hc.repeat(i.length-h-1);return this._pathReplacements[i[i.length-1]]=$a,this._baseLength=l>0?l:this.base.length,t.push(hn(this.base.substring(u,this._baseLength)),o?"(?:#|$)":"(?:[?#]|$)"),this._baseMatcher=new RegExp([...t,...n].join(""))}toRelative(e){const t=this._getBaseMatcher().exec(e);if(!t)return e;const n=t[0].length;if(n===this._baseLength&&n===e.length)return"";const i=this._pathReplacements[n];if(i){const s=e.substring(n);return i!==zn&&!Uc.test(s)?e:i===$a&&/^[^?#]/.test(s)?s:i+s}return e.substring(n-1)}}const mr=Se.defaultGraph(),{rdf:Vc,xsd:Qt}=Ce,Da=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,Ma=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,Gc={"\\":"\\\\",'"':'\\"'," ":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};class br extends it{equals(e){return e===this}}class zs{constructor(e,t){if(this._prefixRegex=/$0^/,e&&typeof e.write!="function"&&(t=e,e=null),t=t||{},this._lists=t.lists,e)this._outputStream=e,this._endStream=t.end===void 0?!0:!!t.end;else{let n="";this._outputStream={write(i,s,a){n+=i,a&&a()},end:i=>{i&&i(null,n)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(t.format)?(this._lineMode=!0,this._writeQuad=this._writeQuadLine):(this._lineMode=!1,this._graph=mr,this._prefixIRIs=Object.create(null),t.prefixes&&this.addPrefixes(t.prefixes),t.baseIRI&&(this._baseIri=new Ws(t.baseIRI)))}get _inDefaultGraph(){return mr.equals(this._graph)}_write(e,t){this._outputStream.write(e,"utf8",t)}_writeQuad(e,t,n,i,s){try{i.equals(this._graph)||(this._write((this._subject===null?"":this._inDefaultGraph?`.
|
|
8
|
+
`:`
|
|
9
|
+
}
|
|
10
|
+
`)+(mr.equals(i)?"":`${this._encodeIriOrBlank(i)} {
|
|
11
|
+
`)),this._graph=i,this._subject=null),e.equals(this._subject)?t.equals(this._predicate)?this._write(`, ${this._encodeObject(n)}`,s):this._write(`;
|
|
12
|
+
${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,s):this._write(`${(this._subject===null?"":`.
|
|
13
|
+
`)+this._encodeSubject(this._subject=e)} ${this._encodePredicate(this._predicate=t)} ${this._encodeObject(n)}`,s)}catch(a){s&&s(a)}}_writeQuadLine(e,t,n,i,s){delete this._prefixMatch,this._write(this.quadToString(e,t,n,i),s)}quadToString(e,t,n,i){return`${this._encodeSubject(e)} ${this._encodeIriOrBlank(t)} ${this._encodeObject(n)}${i&&i.value?` ${this._encodeIriOrBlank(i)} .
|
|
14
|
+
`:` .
|
|
15
|
+
`}`}quadsToString(e){let t="";for(const 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)),Da.test(t)&&(t=t.replace(Ma,Pa));const n=this._prefixRegex.exec(t);return n?n[1]?this._prefixIRIs[n[1]]+n[2]:t:`<${t}>`}_encodeLiteral(e){let t=e.value;if(Da.test(t)&&(t=t.replace(Ma,Pa)),e.language)return`"${t}"@${e.language}`;if(this._lineMode){if(e.datatype.value===Qt.string)return`"${t}"`}else switch(e.datatype.value){case Qt.string:return`"${t}"`;case Qt.boolean:if(t==="true"||t==="false")return t;break;case Qt.integer:if(/^[+-]?\d+$/.test(t))return t;break;case Qt.decimal:if(/^[+-]?\d*\.\d+$/.test(t))return t;break;case Qt.double:if(/^[+-]?(?:\d+\.\d*|\.?\d+)[eE][+-]?\d+$/.test(t))return t;break}return`"${t}"^^${this._encodeIriOrBlank(e.datatype)}`}_encodePredicate(e){return e.value===Vc.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:i}){return`<<${this._encodeSubject(e)} ${this._encodePredicate(t)} ${this._encodeObject(n)}${Os(i)?"":` ${this._encodeIriOrBlank(i)}`}>>`}_blockedWrite(){throw new Error("Cannot write because the writer has been closed.")}addQuad(e,t,n,i,s){n===void 0?this._writeQuad(e.subject,e.predicate,e.object,e.graph,t):typeof i=="function"?this._writeQuad(e,t,n,mr,i):this._writeQuad(e,t,n,i||mr,s)}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}addPrefix(e,t,n){const i={};i[e]=t,this.addPrefixes(i,n)}addPrefixes(e,t){if(!this._prefixIRIs)return t&&t();let n=!1;for(let i in e){let s=e[i];typeof s!="string"&&(s=s.value),n=!0,this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
16
|
+
`:`
|
|
17
|
+
}
|
|
18
|
+
`),this._subject=null,this._graph=""),this._prefixIRIs[s]=i+=":",this._write(`@prefix ${i} <${s}>.
|
|
19
|
+
`)}if(n){let i="",s="";for(const a in this._prefixIRIs)i+=i?`|${a}`:a,s+=(s?"|":"")+this._prefixIRIs[a];i=hn(i),this._prefixRegex=new RegExp(`^(?:${s})[^/]*$|^(${i})([_a-zA-Z0-9][\\-_a-zA-Z0-9]*)$`)}this._write(n?`
|
|
20
|
+
`:"",t)}blank(e,t){let n=e,i,s;switch(e===void 0?n=[]:e.termType?n=[{predicate:e,object:t}]:"length"in e||(n=[e]),s=n.length){case 0:return new br("[]");case 1:if(i=n[0],!(i.object instanceof br))return new br(`[ ${this._encodePredicate(i.predicate)} ${this._encodeObject(i.object)} ]`);default:let a="[";for(let o=0;o<s;o++)i=n[o],i.predicate.equals(e)?a+=`, ${this._encodeObject(i.object)}`:(a+=`${(o?`;
|
|
21
|
+
`:`
|
|
22
|
+
`)+this._encodePredicate(i.predicate)} ${this._encodeObject(i.object)}`,e=i.predicate);return new br(`${a}
|
|
23
|
+
]`)}}list(e){const t=e&&e.length||0,n=new Array(t);for(let i=0;i<t;i++)n[i]=this._encodeObject(e[i]);return new br(`(${n.join(" ")})`)}end(e){this._subject!==null&&(this._write(this._inDefaultGraph?`.
|
|
24
|
+
`:`
|
|
25
|
+
}
|
|
26
|
+
`),this._subject=null),this._write=this._blockedWrite;let t=e&&((n,i)=>{t=null,e(n,i)});if(this._endStream)try{return this._outputStream.end(t)}catch{}t&&t()}}function Pa(r){let e=Gc[r];return e===void 0&&(r.length===1?(e=r.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var Jn={exports:{}},Qn={exports:{}},Xn,Ca;function $e(){if(Ca)return Xn;Ca=1;class r extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let n="";for(let i=0;i<t.length;i++)n+=` ${t[i].stack}
|
|
27
|
+
`;super(n),this.name="AggregateError",this.errors=t}}return Xn={AggregateError:r,ArrayIsArray(e){return Array.isArray(e)},ArrayPrototypeIncludes(e,t){return e.includes(t)},ArrayPrototypeIndexOf(e,t){return e.indexOf(t)},ArrayPrototypeJoin(e,t){return e.join(t)},ArrayPrototypeMap(e,t){return e.map(t)},ArrayPrototypePop(e,t){return e.pop(t)},ArrayPrototypePush(e,t){return e.push(t)},ArrayPrototypeSlice(e,t,n){return e.slice(t,n)},Error,FunctionPrototypeCall(e,t,...n){return e.call(t,...n)},FunctionPrototypeSymbolHasInstance(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty(e,t,n){return Object.defineProperty(e,t,n)},ObjectGetOwnPropertyDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys(e){return Object.keys(e)},ObjectSetPrototypeOf(e,t){return Object.setPrototypeOf(e,t)},Promise,PromisePrototypeCatch(e,t){return e.catch(t)},PromisePrototypeThen(e,t,n){return e.then(t,n)},PromiseReject(e){return Promise.reject(e)},PromiseResolve(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest(e,t){return e.test(t)},SafeSet:Set,String,StringPrototypeSlice(e,t,n){return e.slice(t,n)},StringPrototypeToLowerCase(e){return e.toLowerCase()},StringPrototypeToUpperCase(e){return e.toUpperCase()},StringPrototypeTrim(e){return e.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(e,t,n){return e.set(t,n)},Boolean,Uint8Array},Xn}var Kn={exports:{}},Yn,qa;function _u(){return qa||(qa=1,Yn={format(r,...e){return r.replace(/%([sdifj])/g,function(...[t,n]){const i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(r){switch(typeof r){case"string":if(r.includes("'"))if(r.includes('"')){if(!r.includes("`")&&!r.includes("${"))return`\`${r}\``}else return`"${r}"`;return`'${r}'`;case"number":return isNaN(r)?"NaN":Object.is(r,-0)?String(r):r;case"bigint":return`${String(r)}n`;case"boolean":case"undefined":return String(r);case"object":return"{}"}}}),Yn}var Zn,Ba;function Ve(){if(Ba)return Zn;Ba=1;const{format:r,inspect:e}=_u(),{AggregateError:t}=$e(),n=globalThis.AggregateError||t,i=Symbol("kIsNodeError"),s=["string","function","number","object","Function","Object","boolean","bigint","symbol"],a=/^([A-Z][a-z0-9]*)+$/,o="__node_internal_",l={};function u(x,S){if(!x)throw new l.ERR_INTERNAL_ASSERTION(S)}function h(x){let S="",I=x.length;const w=x[0]==="-"?1:0;for(;I>=w+4;I-=3)S=`_${x.slice(I-3,I)}${S}`;return`${x.slice(0,I)}${S}`}function y(x,S,I){if(typeof S=="function")return u(S.length<=I.length,`Code: ${x}; The provided arguments length (${I.length}) does not match the required ones (${S.length}).`),S(...I);const w=(S.match(/%[dfijoOs]/g)||[]).length;return u(w===I.length,`Code: ${x}; The provided arguments length (${I.length}) does not match the required ones (${w}).`),I.length===0?S:r(S,...I)}function b(x,S,I){I||(I=Error);class w extends I{constructor(...p){super(y(x,S,p))}toString(){return`${this.name} [${x}]: ${this.message}`}}Object.defineProperties(w.prototype,{name:{value:I.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${x}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),w.prototype.code=x,w.prototype[i]=!0,l[x]=w}function g(x){const S=o+x.name;return Object.defineProperty(x,"name",{value:S}),x}function m(x,S){if(x&&S&&x!==S){if(Array.isArray(S.errors))return S.errors.push(x),S;const I=new n([S,x],S.message);return I.code=S.code,I}return x||S}class _ extends Error{constructor(S="The operation was aborted",I=void 0){if(I!==void 0&&typeof I!="object")throw new l.ERR_INVALID_ARG_TYPE("options","Object",I);super(S,I),this.code="ABORT_ERR",this.name="AbortError"}}return b("ERR_ASSERTION","%s",Error),b("ERR_INVALID_ARG_TYPE",(x,S,I)=>{u(typeof x=="string","'name' must be a string"),Array.isArray(S)||(S=[S]);let w="The ";x.endsWith(" argument")?w+=`${x} `:w+=`"${x}" ${x.includes(".")?"property":"argument"} `,w+="must be ";const d=[],p=[],N=[];for(const T of S)u(typeof T=="string","All expected entries have to be of type string"),s.includes(T)?d.push(T.toLowerCase()):a.test(T)?p.push(T):(u(T!=="object",'The value "object" should be written as "Object"'),N.push(T));if(p.length>0){const T=d.indexOf("object");T!==-1&&(d.splice(d,T,1),p.push("Object"))}if(d.length>0){switch(d.length){case 1:w+=`of type ${d[0]}`;break;case 2:w+=`one of type ${d[0]} or ${d[1]}`;break;default:{const T=d.pop();w+=`one of type ${d.join(", ")}, or ${T}`}}(p.length>0||N.length>0)&&(w+=" or ")}if(p.length>0){switch(p.length){case 1:w+=`an instance of ${p[0]}`;break;case 2:w+=`an instance of ${p[0]} or ${p[1]}`;break;default:{const T=p.pop();w+=`an instance of ${p.join(", ")}, or ${T}`}}N.length>0&&(w+=" or ")}switch(N.length){case 0:break;case 1:N[0].toLowerCase()!==N[0]&&(w+="an "),w+=`${N[0]}`;break;case 2:w+=`one of ${N[0]} or ${N[1]}`;break;default:{const T=N.pop();w+=`one of ${N.join(", ")}, or ${T}`}}if(I==null)w+=`. Received ${I}`;else if(typeof I=="function"&&I.name)w+=`. Received function ${I.name}`;else if(typeof I=="object"){var D;if((D=I.constructor)!==null&&D!==void 0&&D.name)w+=`. Received an instance of ${I.constructor.name}`;else{const T=e(I,{depth:-1});w+=`. Received ${T}`}}else{let T=e(I,{colors:!1});T.length>25&&(T=`${T.slice(0,25)}...`),w+=`. Received type ${typeof I} (${T})`}return w},TypeError),b("ERR_INVALID_ARG_VALUE",(x,S,I="is invalid")=>{let w=e(S);return w.length>128&&(w=w.slice(0,128)+"..."),`The ${x.includes(".")?"property":"argument"} '${x}' ${I}. Received ${w}`},TypeError),b("ERR_INVALID_RETURN_VALUE",(x,S,I)=>{var w;const d=I!=null&&(w=I.constructor)!==null&&w!==void 0&&w.name?`instance of ${I.constructor.name}`:`type ${typeof I}`;return`Expected ${x} to be returned from the "${S}" function but got ${d}.`},TypeError),b("ERR_MISSING_ARGS",(...x)=>{u(x.length>0,"At least one arg needs to be specified");let S;const I=x.length;switch(x=(Array.isArray(x)?x:[x]).map(w=>`"${w}"`).join(" or "),I){case 1:S+=`The ${x[0]} argument`;break;case 2:S+=`The ${x[0]} and ${x[1]} arguments`;break;default:{const w=x.pop();S+=`The ${x.join(", ")}, and ${w} arguments`}break}return`${S} must be specified`},TypeError),b("ERR_OUT_OF_RANGE",(x,S,I)=>{u(S,'Missing "range" argument');let w;if(Number.isInteger(I)&&Math.abs(I)>2**32)w=h(String(I));else if(typeof I=="bigint"){w=String(I);const d=BigInt(2)**BigInt(32);(I>d||I<-d)&&(w=h(w)),w+="n"}else w=e(I);return`The value of "${x}" is out of range. It must be ${S}. Received ${w}`},RangeError),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),b("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),b("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),b("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),b("ERR_STREAM_WRITE_AFTER_END","write after end",Error),b("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),Zn={AbortError:_,aggregateTwoErrors:g(m),hideStackFrames:g,codes:l},Zn}var wr={exports:{}},Fa;function Wr(){if(Fa)return wr.exports;Fa=1;const{AbortController:r,AbortSignal:e}=typeof self<"u"?self:typeof window<"u"?window:void 0;return wr.exports=r,wr.exports.AbortSignal=e,wr.exports.default=r,wr.exports}var an={exports:{}},Ua;function Ln(){if(Ua)return an.exports;Ua=1;var r=typeof Reflect=="object"?Reflect:null,e=r&&typeof r.apply=="function"?r.apply:function(p,N,D){return Function.prototype.apply.call(p,N,D)},t;r&&typeof r.ownKeys=="function"?t=r.ownKeys:Object.getOwnPropertySymbols?t=function(p){return Object.getOwnPropertyNames(p).concat(Object.getOwnPropertySymbols(p))}:t=function(p){return Object.getOwnPropertyNames(p)};function n(d){console&&console.warn&&console.warn(d)}var i=Number.isNaN||function(p){return p!==p};function s(){s.init.call(this)}an.exports=s,an.exports.once=S,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function o(d){if(typeof d!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof d)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(d){if(typeof d!="number"||d<0||i(d))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+d+".");a=d}}),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(p){if(typeof p!="number"||p<0||i(p))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+p+".");return this._maxListeners=p,this};function l(d){return d._maxListeners===void 0?s.defaultMaxListeners:d._maxListeners}s.prototype.getMaxListeners=function(){return l(this)},s.prototype.emit=function(p){for(var N=[],D=1;D<arguments.length;D++)N.push(arguments[D]);var T=p==="error",q=this._events;if(q!==void 0)T=T&&q.error===void 0;else if(!T)return!1;if(T){var R;if(N.length>0&&(R=N[0]),R instanceof Error)throw R;var M=new Error("Unhandled error."+(R?" ("+R.message+")":""));throw M.context=R,M}var B=q[p];if(B===void 0)return!1;if(typeof B=="function")e(B,this,N);else for(var A=B.length,j=m(B,A),D=0;D<A;++D)e(j[D],this,N);return!0};function u(d,p,N,D){var T,q,R;if(o(N),q=d._events,q===void 0?(q=d._events=Object.create(null),d._eventsCount=0):(q.newListener!==void 0&&(d.emit("newListener",p,N.listener?N.listener:N),q=d._events),R=q[p]),R===void 0)R=q[p]=N,++d._eventsCount;else if(typeof R=="function"?R=q[p]=D?[N,R]:[R,N]:D?R.unshift(N):R.push(N),T=l(d),T>0&&R.length>T&&!R.warned){R.warned=!0;var M=new Error("Possible EventEmitter memory leak detected. "+R.length+" "+String(p)+" listeners added. Use emitter.setMaxListeners() to increase limit");M.name="MaxListenersExceededWarning",M.emitter=d,M.type=p,M.count=R.length,n(M)}return d}s.prototype.addListener=function(p,N){return u(this,p,N,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(p,N){return u(this,p,N,!0)};function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function y(d,p,N){var D={fired:!1,wrapFn:void 0,target:d,type:p,listener:N},T=h.bind(D);return T.listener=N,D.wrapFn=T,T}s.prototype.once=function(p,N){return o(N),this.on(p,y(this,p,N)),this},s.prototype.prependOnceListener=function(p,N){return o(N),this.prependListener(p,y(this,p,N)),this},s.prototype.removeListener=function(p,N){var D,T,q,R,M;if(o(N),T=this._events,T===void 0)return this;if(D=T[p],D===void 0)return this;if(D===N||D.listener===N)--this._eventsCount===0?this._events=Object.create(null):(delete T[p],T.removeListener&&this.emit("removeListener",p,D.listener||N));else if(typeof D!="function"){for(q=-1,R=D.length-1;R>=0;R--)if(D[R]===N||D[R].listener===N){M=D[R].listener,q=R;break}if(q<0)return this;q===0?D.shift():_(D,q),D.length===1&&(T[p]=D[0]),T.removeListener!==void 0&&this.emit("removeListener",p,M||N)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(p){var N,D,T;if(D=this._events,D===void 0)return this;if(D.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):D[p]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete D[p]),this;if(arguments.length===0){var q=Object.keys(D),R;for(T=0;T<q.length;++T)R=q[T],R!=="removeListener"&&this.removeAllListeners(R);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(N=D[p],typeof N=="function")this.removeListener(p,N);else if(N!==void 0)for(T=N.length-1;T>=0;T--)this.removeListener(p,N[T]);return this};function b(d,p,N){var D=d._events;if(D===void 0)return[];var T=D[p];return T===void 0?[]:typeof T=="function"?N?[T.listener||T]:[T]:N?x(T):m(T,T.length)}s.prototype.listeners=function(p){return b(this,p,!0)},s.prototype.rawListeners=function(p){return b(this,p,!1)},s.listenerCount=function(d,p){return typeof d.listenerCount=="function"?d.listenerCount(p):g.call(d,p)},s.prototype.listenerCount=g;function g(d){var p=this._events;if(p!==void 0){var N=p[d];if(typeof N=="function")return 1;if(N!==void 0)return N.length}return 0}s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]};function m(d,p){for(var N=new Array(p),D=0;D<p;++D)N[D]=d[D];return N}function _(d,p){for(;p+1<d.length;p++)d[p]=d[p+1];d.pop()}function x(d){for(var p=new Array(d.length),N=0;N<p.length;++N)p[N]=d[N].listener||d[N];return p}function S(d,p){return new Promise(function(N,D){function T(R){d.removeListener(p,q),D(R)}function q(){typeof d.removeListener=="function"&&d.removeListener("error",T),N([].slice.call(arguments))}w(d,p,q,{once:!0}),p!=="error"&&I(d,T,{once:!0})})}function I(d,p,N){typeof d.on=="function"&&w(d,"error",p,N)}function w(d,p,N,D){if(typeof d.on=="function")D.once?d.once(p,N):d.on(p,N);else if(typeof d.addEventListener=="function")d.addEventListener(p,function T(q){D.once&&d.removeEventListener(p,T),N(q)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof d)}return an.exports}var Ha;function ze(){return Ha||(Ha=1,function(r){const e=bt(),{format:t,inspect:n}=_u(),{codes:{ERR_INVALID_ARG_TYPE:i}}=Ve(),{kResistStopPropagation:s,AggregateError:a,SymbolDispose:o}=$e(),l=globalThis.AbortSignal||Wr().AbortSignal,u=globalThis.AbortController||Wr().AbortController,h=Object.getPrototypeOf(async function(){}).constructor,y=globalThis.Blob||e.Blob,b=typeof y<"u"?function(x){return x instanceof y}:function(x){return!1},g=(_,x)=>{if(_!==void 0&&(_===null||typeof _!="object"||!("aborted"in _)))throw new i(x,"AbortSignal",_)},m=(_,x)=>{if(typeof _!="function")throw new i(x,"Function",_)};r.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(_){let x=!1;return function(...S){x||(x=!0,_.apply(this,S))}},createDeferredPromise:function(){let _,x;return{promise:new Promise((I,w)=>{_=I,x=w}),resolve:_,reject:x}},promisify(_){return new Promise((x,S)=>{_((I,...w)=>I?S(I):x(...w))})},debuglog(){return function(){}},format:t,inspect:n,types:{isAsyncFunction(_){return _ instanceof h},isArrayBufferView(_){return ArrayBuffer.isView(_)}},isBlob:b,deprecate(_,x){return _},addAbortListener:Ln().addAbortListener||function(x,S){if(x===void 0)throw new i("signal","AbortSignal",x);g(x,"signal"),m(S,"listener");let I;return x.aborted?queueMicrotask(()=>S()):(x.addEventListener("abort",S,{__proto__:null,once:!0,[s]:!0}),I=()=>{x.removeEventListener("abort",S)}),{__proto__:null,[o](){var w;(w=I)===null||w===void 0||w()}}},AbortSignalAny:l.any||function(x){if(x.length===1)return x[0];const S=new u,I=()=>S.abort();return x.forEach(w=>{g(w,"signals"),w.addEventListener("abort",I,{once:!0})}),S.signal.addEventListener("abort",()=>{x.forEach(w=>w.removeEventListener("abort",I))},{once:!0}),S.signal}},r.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}(Kn)),Kn.exports}var on={},ei,Va;function Yr(){if(Va)return ei;Va=1;const{ArrayIsArray:r,ArrayPrototypeIncludes:e,ArrayPrototypeJoin:t,ArrayPrototypeMap:n,NumberIsInteger:i,NumberIsNaN:s,NumberMAX_SAFE_INTEGER:a,NumberMIN_SAFE_INTEGER:o,NumberParseInt:l,ObjectPrototypeHasOwnProperty:u,RegExpPrototypeExec:h,String:y,StringPrototypeToUpperCase:b,StringPrototypeTrim:g}=$e(),{hideStackFrames:m,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:x,ERR_INVALID_ARG_VALUE:S,ERR_OUT_OF_RANGE:I,ERR_UNKNOWN_SIGNAL:w}}=Ve(),{normalizeEncoding:d}=ze(),{isAsyncFunction:p,isArrayBufferView:N}=ze().types,D={};function T(X){return X===(X|0)}function q(X){return X===X>>>0}const R=/^[0-7]+$/,M="must be a 32-bit unsigned integer or an octal string";function B(X,le,he){if(typeof X>"u"&&(X=he),typeof X=="string"){if(h(R,X)===null)throw new S(le,X,M);X=l(X,8)}return Y(X,le),X}const A=m((X,le,he=o,se=a)=>{if(typeof X!="number")throw new x(le,"number",X);if(!i(X))throw new I(le,"an integer",X);if(X<he||X>se)throw new I(le,`>= ${he} && <= ${se}`,X)}),j=m((X,le,he=-2147483648,se=2147483647)=>{if(typeof X!="number")throw new x(le,"number",X);if(!i(X))throw new I(le,"an integer",X);if(X<he||X>se)throw new I(le,`>= ${he} && <= ${se}`,X)}),Y=m((X,le,he=!1)=>{if(typeof X!="number")throw new x(le,"number",X);if(!i(X))throw new I(le,"an integer",X);const se=he?1:0,Ee=4294967295;if(X<se||X>Ee)throw new I(le,`>= ${se} && <= ${Ee}`,X)});function L(X,le){if(typeof X!="string")throw new x(le,"string",X)}function ee(X,le,he=void 0,se){if(typeof X!="number")throw new x(le,"number",X);if(he!=null&&X<he||se!=null&&X>se||(he!=null||se!=null)&&s(X))throw new I(le,`${he!=null?`>= ${he}`:""}${he!=null&&se!=null?" && ":""}${se!=null?`<= ${se}`:""}`,X)}const P=m((X,le,he)=>{if(!e(he,X)){const Ee="must be one of: "+t(n(he,Be=>typeof Be=="string"?`'${Be}'`:y(Be)),", ");throw new S(le,X,Ee)}});function K(X,le){if(typeof X!="boolean")throw new x(le,"boolean",X)}function v(X,le,he){return X==null||!u(X,le)?he:X[le]}const U=m((X,le,he=null)=>{const se=v(he,"allowArray",!1),Ee=v(he,"allowFunction",!1);if(!v(he,"nullable",!1)&&X===null||!se&&r(X)||typeof X!="object"&&(!Ee||typeof X!="function"))throw new x(le,"Object",X)}),Q=m((X,le)=>{if(X!=null&&typeof X!="object"&&typeof X!="function")throw new x(le,"a dictionary",X)}),z=m((X,le,he=0)=>{if(!r(X))throw new x(le,"Array",X);if(X.length<he){const se=`must be longer than ${he}`;throw new S(le,X,se)}});function ae(X,le){z(X,le);for(let he=0;he<X.length;he++)L(X[he],`${le}[${he}]`)}function H(X,le){z(X,le);for(let he=0;he<X.length;he++)K(X[he],`${le}[${he}]`)}function V(X,le){z(X,le);for(let he=0;he<X.length;he++){const se=X[he],Ee=`${le}[${he}]`;if(se==null)throw new x(Ee,"AbortSignal",se);ce(se,Ee)}}function W(X,le="signal"){if(L(X,le),D[X]===void 0)throw D[b(X)]!==void 0?new w(X+" (signals must use all capital letters)"):new w(X)}const F=m((X,le="buffer")=>{if(!N(X))throw new x(le,["Buffer","TypedArray","DataView"],X)});function Z(X,le){const he=d(le),se=X.length;if(he==="hex"&&se%2!==0)throw new S("encoding",le,`is invalid for data of length ${se}`)}function te(X,le="Port",he=!0){if(typeof X!="number"&&typeof X!="string"||typeof X=="string"&&g(X).length===0||+X!==+X>>>0||X>65535||X===0&&!he)throw new _(le,X,he);return X|0}const ce=m((X,le)=>{if(X!==void 0&&(X===null||typeof X!="object"||!("aborted"in X)))throw new x(le,"AbortSignal",X)}),fe=m((X,le)=>{if(typeof X!="function")throw new x(le,"Function",X)}),O=m((X,le)=>{if(typeof X!="function"||p(X))throw new x(le,"Function",X)}),G=m((X,le)=>{if(X!==void 0)throw new x(le,"undefined",X)});function re(X,le,he){if(!e(he,X))throw new x(le,`('${t(he,"|")}')`,X)}const ue=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function de(X,le){if(typeof X>"u"||!h(ue,X))throw new S(le,X,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function pe(X){if(typeof X=="string")return de(X,"hints"),X;if(r(X)){const le=X.length;let he="";if(le===0)return he;for(let se=0;se<le;se++){const Ee=X[se];de(Ee,"hints"),he+=Ee,se!==le-1&&(he+=", ")}return he}throw new S("hints",X,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}return ei={isInt32:T,isUint32:q,parseFileMode:B,validateArray:z,validateStringArray:ae,validateBooleanArray:H,validateAbortSignalArray:V,validateBoolean:K,validateBuffer:F,validateDictionary:Q,validateEncoding:Z,validateFunction:fe,validateInt32:j,validateInteger:A,validateNumber:ee,validateObject:U,validateOneOf:P,validatePlainFunction:O,validatePort:te,validateSignalName:W,validateString:L,validateUint32:Y,validateUndefined:G,validateUnion:re,validateAbortSignal:ce,validateLinkHeaderValue:pe},ei}var ln={exports:{}},ti={exports:{}},Ga;function Vt(){if(Ga)return ti.exports;Ga=1;var r=ti.exports={},e,t;function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?e=setTimeout:e=n}catch{e=n}try{typeof clearTimeout=="function"?t=clearTimeout:t=i}catch{t=i}})();function s(_){if(e===setTimeout)return setTimeout(_,0);if((e===n||!e)&&setTimeout)return e=setTimeout,setTimeout(_,0);try{return e(_,0)}catch{try{return e.call(null,_,0)}catch{return e.call(this,_,0)}}}function a(_){if(t===clearTimeout)return clearTimeout(_);if((t===i||!t)&&clearTimeout)return t=clearTimeout,clearTimeout(_);try{return t(_)}catch{try{return t.call(null,_)}catch{return t.call(this,_)}}}var o=[],l=!1,u,h=-1;function y(){!l||!u||(l=!1,u.length?o=u.concat(o):h=-1,o.length&&b())}function b(){if(!l){var _=s(y);l=!0;for(var x=o.length;x;){for(u=o,o=[];++h<x;)u&&u[h].run();h=-1,x=o.length}u=null,l=!1,a(_)}}r.nextTick=function(_){var x=new Array(arguments.length-1);if(arguments.length>1)for(var S=1;S<arguments.length;S++)x[S-1]=arguments[S];o.push(new g(_,x)),o.length===1&&!l&&s(b)};function g(_,x){this.fun=_,this.array=x}g.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={};function m(){}return r.on=m,r.addListener=m,r.once=m,r.off=m,r.removeListener=m,r.removeAllListeners=m,r.emit=m,r.prependListener=m,r.prependOnceListener=m,r.listeners=function(_){return[]},r.binding=function(_){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(_){throw new Error("process.chdir is not supported")},r.umask=function(){return 0},ti.exports}var ri,Wa;function wt(){if(Wa)return ri;Wa=1;const{SymbolAsyncIterator:r,SymbolIterator:e,SymbolFor:t}=$e(),n=t("nodejs.stream.destroyed"),i=t("nodejs.stream.errored"),s=t("nodejs.stream.readable"),a=t("nodejs.stream.writable"),o=t("nodejs.stream.disturbed"),l=t("nodejs.webstream.isClosedPromise"),u=t("nodejs.webstream.controllerErrorFunction");function h(v,U=!1){var Q;return!!(v&&typeof v.pipe=="function"&&typeof v.on=="function"&&(!U||typeof v.pause=="function"&&typeof v.resume=="function")&&(!v._writableState||((Q=v._readableState)===null||Q===void 0?void 0:Q.readable)!==!1)&&(!v._writableState||v._readableState))}function y(v){var U;return!!(v&&typeof v.write=="function"&&typeof v.on=="function"&&(!v._readableState||((U=v._writableState)===null||U===void 0?void 0:U.writable)!==!1))}function b(v){return!!(v&&typeof v.pipe=="function"&&v._readableState&&typeof v.on=="function"&&typeof v.write=="function")}function g(v){return v&&(v._readableState||v._writableState||typeof v.write=="function"&&typeof v.on=="function"||typeof v.pipe=="function"&&typeof v.on=="function")}function m(v){return!!(v&&!g(v)&&typeof v.pipeThrough=="function"&&typeof v.getReader=="function"&&typeof v.cancel=="function")}function _(v){return!!(v&&!g(v)&&typeof v.getWriter=="function"&&typeof v.abort=="function")}function x(v){return!!(v&&!g(v)&&typeof v.readable=="object"&&typeof v.writable=="object")}function S(v){return m(v)||_(v)||x(v)}function I(v,U){return v==null?!1:U===!0?typeof v[r]=="function":U===!1?typeof v[e]=="function":typeof v[r]=="function"||typeof v[e]=="function"}function w(v){if(!g(v))return null;const U=v._writableState,Q=v._readableState,z=U||Q;return!!(v.destroyed||v[n]||z!=null&&z.destroyed)}function d(v){if(!y(v))return null;if(v.writableEnded===!0)return!0;const U=v._writableState;return U!=null&&U.errored?!1:typeof(U==null?void 0:U.ended)!="boolean"?null:U.ended}function p(v,U){if(!y(v))return null;if(v.writableFinished===!0)return!0;const Q=v._writableState;return Q!=null&&Q.errored?!1:typeof(Q==null?void 0:Q.finished)!="boolean"?null:!!(Q.finished||U===!1&&Q.ended===!0&&Q.length===0)}function N(v){if(!h(v))return null;if(v.readableEnded===!0)return!0;const U=v._readableState;return!U||U.errored?!1:typeof(U==null?void 0:U.ended)!="boolean"?null:U.ended}function D(v,U){if(!h(v))return null;const Q=v._readableState;return Q!=null&&Q.errored?!1:typeof(Q==null?void 0:Q.endEmitted)!="boolean"?null:!!(Q.endEmitted||U===!1&&Q.ended===!0&&Q.length===0)}function T(v){return v&&v[s]!=null?v[s]:typeof(v==null?void 0:v.readable)!="boolean"?null:w(v)?!1:h(v)&&v.readable&&!D(v)}function q(v){return v&&v[a]!=null?v[a]:typeof(v==null?void 0:v.writable)!="boolean"?null:w(v)?!1:y(v)&&v.writable&&!d(v)}function R(v,U){return g(v)?w(v)?!0:!((U==null?void 0:U.readable)!==!1&&T(v)||(U==null?void 0:U.writable)!==!1&&q(v)):null}function M(v){var U,Q;return g(v)?v.writableErrored?v.writableErrored:(U=(Q=v._writableState)===null||Q===void 0?void 0:Q.errored)!==null&&U!==void 0?U:null:null}function B(v){var U,Q;return g(v)?v.readableErrored?v.readableErrored:(U=(Q=v._readableState)===null||Q===void 0?void 0:Q.errored)!==null&&U!==void 0?U:null:null}function A(v){if(!g(v))return null;if(typeof v.closed=="boolean")return v.closed;const U=v._writableState,Q=v._readableState;return typeof(U==null?void 0:U.closed)=="boolean"||typeof(Q==null?void 0:Q.closed)=="boolean"?(U==null?void 0:U.closed)||(Q==null?void 0:Q.closed):typeof v._closed=="boolean"&&j(v)?v._closed:null}function j(v){return typeof v._closed=="boolean"&&typeof v._defaultKeepAlive=="boolean"&&typeof v._removedConnection=="boolean"&&typeof v._removedContLen=="boolean"}function Y(v){return typeof v._sent100=="boolean"&&j(v)}function L(v){var U;return typeof v._consuming=="boolean"&&typeof v._dumped=="boolean"&&((U=v.req)===null||U===void 0?void 0:U.upgradeOrConnect)===void 0}function ee(v){if(!g(v))return null;const U=v._writableState,Q=v._readableState,z=U||Q;return!z&&Y(v)||!!(z&&z.autoDestroy&&z.emitClose&&z.closed===!1)}function P(v){var U;return!!(v&&((U=v[o])!==null&&U!==void 0?U:v.readableDidRead||v.readableAborted))}function K(v){var U,Q,z,ae,H,V,W,F,Z,te;return!!(v&&((U=(Q=(z=(ae=(H=(V=v[i])!==null&&V!==void 0?V:v.readableErrored)!==null&&H!==void 0?H:v.writableErrored)!==null&&ae!==void 0?ae:(W=v._readableState)===null||W===void 0?void 0:W.errorEmitted)!==null&&z!==void 0?z:(F=v._writableState)===null||F===void 0?void 0:F.errorEmitted)!==null&&Q!==void 0?Q:(Z=v._readableState)===null||Z===void 0?void 0:Z.errored)!==null&&U!==void 0?U:!((te=v._writableState)===null||te===void 0)&&te.errored))}return ri={isDestroyed:w,kIsDestroyed:n,isDisturbed:P,kIsDisturbed:o,isErrored:K,kIsErrored:i,isReadable:T,kIsReadable:s,kIsClosedPromise:l,kControllerErrorFunction:u,kIsWritable:a,isClosed:A,isDuplexNodeStream:b,isFinished:R,isIterable:I,isReadableNodeStream:h,isReadableStream:m,isReadableEnded:N,isReadableFinished:D,isReadableErrored:B,isNodeStream:g,isWebStream:S,isWritable:q,isWritableNodeStream:y,isWritableStream:_,isWritableEnded:d,isWritableFinished:p,isWritableErrored:M,isServerRequest:L,isServerResponse:Y,willEmitClose:ee,isTransformStream:x},ri}var za;function Tt(){if(za)return ln.exports;za=1;const r=Vt(),{AbortError:e,codes:t}=Ve(),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_PREMATURE_CLOSE:i}=t,{kEmptyObject:s,once:a}=ze(),{validateAbortSignal:o,validateFunction:l,validateObject:u,validateBoolean:h}=Yr(),{Promise:y,PromisePrototypeThen:b,SymbolDispose:g}=$e(),{isClosed:m,isReadable:_,isReadableNodeStream:x,isReadableStream:S,isReadableFinished:I,isReadableErrored:w,isWritable:d,isWritableNodeStream:p,isWritableStream:N,isWritableFinished:D,isWritableErrored:T,isNodeStream:q,willEmitClose:R,kIsClosedPromise:M}=wt();let B;function A(P){return P.setHeader&&typeof P.abort=="function"}const j=()=>{};function Y(P,K,v){var U,Q;if(arguments.length===2?(v=K,K=s):K==null?K=s:u(K,"options"),l(v,"callback"),o(K.signal,"options.signal"),v=a(v),S(P)||N(P))return L(P,K,v);if(!q(P))throw new n("stream",["ReadableStream","WritableStream","Stream"],P);const z=(U=K.readable)!==null&&U!==void 0?U:x(P),ae=(Q=K.writable)!==null&&Q!==void 0?Q:p(P),H=P._writableState,V=P._readableState,W=()=>{P.writable||te()};let F=R(P)&&x(P)===z&&p(P)===ae,Z=D(P,!1);const te=()=>{Z=!0,P.destroyed&&(F=!1),!(F&&(!P.readable||z))&&(!z||ce)&&v.call(P)};let ce=I(P,!1);const fe=()=>{ce=!0,P.destroyed&&(F=!1),!(F&&(!P.writable||ae))&&(!ae||Z)&&v.call(P)},O=X=>{v.call(P,X)};let G=m(P);const re=()=>{G=!0;const X=T(P)||w(P);if(X&&typeof X!="boolean")return v.call(P,X);if(z&&!ce&&x(P,!0)&&!I(P,!1))return v.call(P,new i);if(ae&&!Z&&!D(P,!1))return v.call(P,new i);v.call(P)},ue=()=>{G=!0;const X=T(P)||w(P);if(X&&typeof X!="boolean")return v.call(P,X);v.call(P)},de=()=>{P.req.on("finish",te)};A(P)?(P.on("complete",te),F||P.on("abort",re),P.req?de():P.on("request",de)):ae&&!H&&(P.on("end",W),P.on("close",W)),!F&&typeof P.aborted=="boolean"&&P.on("aborted",re),P.on("end",fe),P.on("finish",te),K.error!==!1&&P.on("error",O),P.on("close",re),G?r.nextTick(re):H!=null&&H.errorEmitted||V!=null&&V.errorEmitted?F||r.nextTick(ue):(!z&&(!F||_(P))&&(Z||d(P)===!1)||!ae&&(!F||d(P))&&(ce||_(P)===!1)||V&&P.req&&P.aborted)&&r.nextTick(ue);const pe=()=>{v=j,P.removeListener("aborted",re),P.removeListener("complete",te),P.removeListener("abort",re),P.removeListener("request",de),P.req&&P.req.removeListener("finish",te),P.removeListener("end",W),P.removeListener("close",W),P.removeListener("finish",te),P.removeListener("end",fe),P.removeListener("error",O),P.removeListener("close",re)};if(K.signal&&!G){const X=()=>{const le=v;pe(),le.call(P,new e(void 0,{cause:K.signal.reason}))};if(K.signal.aborted)r.nextTick(X);else{B=B||ze().addAbortListener;const le=B(K.signal,X),he=v;v=a((...se)=>{le[g](),he.apply(P,se)})}}return pe}function L(P,K,v){let U=!1,Q=j;if(K.signal)if(Q=()=>{U=!0,v.call(P,new e(void 0,{cause:K.signal.reason}))},K.signal.aborted)r.nextTick(Q);else{B=B||ze().addAbortListener;const ae=B(K.signal,Q),H=v;v=a((...V)=>{ae[g](),H.apply(P,V)})}const z=(...ae)=>{U||r.nextTick(()=>v.apply(P,ae))};return b(P[M].promise,z,z),j}function ee(P,K){var v;let U=!1;return K===null&&(K=s),(v=K)!==null&&v!==void 0&&v.cleanup&&(h(K.cleanup,"cleanup"),U=K.cleanup),new y((Q,z)=>{const ae=Y(P,K,H=>{U&&ae(),H?z(H):Q()})})}return ln.exports=Y,ln.exports.finished=ee,ln.exports}var ni,Ja;function ur(){if(Ja)return ni;Ja=1;const r=Vt(),{aggregateTwoErrors:e,codes:{ERR_MULTIPLE_CALLBACK:t},AbortError:n}=Ve(),{Symbol:i}=$e(),{kIsDestroyed:s,isDestroyed:a,isFinished:o,isServerRequest:l}=wt(),u=i("kDestroy"),h=i("kConstruct");function y(R,M,B){R&&(R.stack,M&&!M.errored&&(M.errored=R),B&&!B.errored&&(B.errored=R))}function b(R,M){const B=this._readableState,A=this._writableState,j=A||B;return A!=null&&A.destroyed||B!=null&&B.destroyed?(typeof M=="function"&&M(),this):(y(R,A,B),A&&(A.destroyed=!0),B&&(B.destroyed=!0),j.constructed?g(this,R,M):this.once(u,function(Y){g(this,e(Y,R),M)}),this)}function g(R,M,B){let A=!1;function j(Y){if(A)return;A=!0;const L=R._readableState,ee=R._writableState;y(Y,ee,L),ee&&(ee.closed=!0),L&&(L.closed=!0),typeof B=="function"&&B(Y),Y?r.nextTick(m,R,Y):r.nextTick(_,R)}try{R._destroy(M||null,j)}catch(Y){j(Y)}}function m(R,M){x(R,M),_(R)}function _(R){const M=R._readableState,B=R._writableState;B&&(B.closeEmitted=!0),M&&(M.closeEmitted=!0),(B!=null&&B.emitClose||M!=null&&M.emitClose)&&R.emit("close")}function x(R,M){const B=R._readableState,A=R._writableState;A!=null&&A.errorEmitted||B!=null&&B.errorEmitted||(A&&(A.errorEmitted=!0),B&&(B.errorEmitted=!0),R.emit("error",M))}function S(){const R=this._readableState,M=this._writableState;R&&(R.constructed=!0,R.closed=!1,R.closeEmitted=!1,R.destroyed=!1,R.errored=null,R.errorEmitted=!1,R.reading=!1,R.ended=R.readable===!1,R.endEmitted=R.readable===!1),M&&(M.constructed=!0,M.destroyed=!1,M.closed=!1,M.closeEmitted=!1,M.errored=null,M.errorEmitted=!1,M.finalCalled=!1,M.prefinished=!1,M.ended=M.writable===!1,M.ending=M.writable===!1,M.finished=M.writable===!1)}function I(R,M,B){const A=R._readableState,j=R._writableState;if(j!=null&&j.destroyed||A!=null&&A.destroyed)return this;A!=null&&A.autoDestroy||j!=null&&j.autoDestroy?R.destroy(M):M&&(M.stack,j&&!j.errored&&(j.errored=M),A&&!A.errored&&(A.errored=M),B?r.nextTick(x,R,M):x(R,M))}function w(R,M){if(typeof R._construct!="function")return;const B=R._readableState,A=R._writableState;B&&(B.constructed=!1),A&&(A.constructed=!1),R.once(h,M),!(R.listenerCount(h)>1)&&r.nextTick(d,R)}function d(R){let M=!1;function B(A){if(M){I(R,A??new t);return}M=!0;const j=R._readableState,Y=R._writableState,L=Y||j;j&&(j.constructed=!0),Y&&(Y.constructed=!0),L.destroyed?R.emit(u,A):A?I(R,A,!0):r.nextTick(p,R)}try{R._construct(A=>{r.nextTick(B,A)})}catch(A){r.nextTick(B,A)}}function p(R){R.emit(h)}function N(R){return(R==null?void 0:R.setHeader)&&typeof R.abort=="function"}function D(R){R.emit("close")}function T(R,M){R.emit("error",M),r.nextTick(D,R)}function q(R,M){!R||a(R)||(!M&&!o(R)&&(M=new n),l(R)?(R.socket=null,R.destroy(M)):N(R)?R.abort():N(R.req)?R.req.abort():typeof R.destroy=="function"?R.destroy(M):typeof R.close=="function"?R.close():M?r.nextTick(T,R,M):r.nextTick(D,R),R.destroyed||(R[s]=!0))}return ni={construct:w,destroyer:q,destroy:b,undestroy:S,errorOrDestroy:I},ni}var ii,Qa;function Js(){if(Qa)return ii;Qa=1;const{ArrayIsArray:r,ObjectSetPrototypeOf:e}=$e(),{EventEmitter:t}=Ln();function n(s){t.call(this,s)}e(n.prototype,t.prototype),e(n,t),n.prototype.pipe=function(s,a){const o=this;function l(_){s.writable&&s.write(_)===!1&&o.pause&&o.pause()}o.on("data",l);function u(){o.readable&&o.resume&&o.resume()}s.on("drain",u),!s._isStdio&&(!a||a.end!==!1)&&(o.on("end",y),o.on("close",b));let h=!1;function y(){h||(h=!0,s.end())}function b(){h||(h=!0,typeof s.destroy=="function"&&s.destroy())}function g(_){m(),t.listenerCount(this,"error")===0&&this.emit("error",_)}i(o,"error",g),i(s,"error",g);function m(){o.removeListener("data",l),s.removeListener("drain",u),o.removeListener("end",y),o.removeListener("close",b),o.removeListener("error",g),s.removeListener("error",g),o.removeListener("end",m),o.removeListener("close",m),s.removeListener("close",m)}return o.on("end",m),o.on("close",m),s.on("close",m),s.emit("pipe",o),s};function i(s,a,o){if(typeof s.prependListener=="function")return s.prependListener(a,o);!s._events||!s._events[a]?s.on(a,o):r(s._events[a])?s._events[a].unshift(o):s._events[a]=[o,s._events[a]]}return ii={Stream:n,prependListener:i},ii}var si={exports:{}},Xa;function jn(){return Xa||(Xa=1,function(r){const{SymbolDispose:e}=$e(),{AbortError:t,codes:n}=Ve(),{isNodeStream:i,isWebStream:s,kControllerErrorFunction:a}=wt(),o=Tt(),{ERR_INVALID_ARG_TYPE:l}=n;let u;const h=(y,b)=>{if(typeof y!="object"||!("aborted"in y))throw new l(b,"AbortSignal",y)};r.exports.addAbortSignal=function(b,g){if(h(b,"signal"),!i(g)&&!s(g))throw new l("stream",["ReadableStream","WritableStream","Stream"],g);return r.exports.addAbortSignalNoValidate(b,g)},r.exports.addAbortSignalNoValidate=function(y,b){if(typeof y!="object"||!("aborted"in y))return b;const g=i(b)?()=>{b.destroy(new t(void 0,{cause:y.reason}))}:()=>{b[a](new t(void 0,{cause:y.reason}))};if(y.aborted)g();else{u=u||ze().addAbortListener;const m=u(y,g);o(b,m[e])}return b}}(si)),si.exports}var ai,Ka;function Wc(){if(Ka)return ai;Ka=1;const{StringPrototypeSlice:r,SymbolIterator:e,TypedArrayPrototypeSet:t,Uint8Array:n}=$e(),{Buffer:i}=bt(),{inspect:s}=ze();return ai=class{constructor(){this.head=null,this.tail=null,this.length=0}push(o){const l={data:o,next:null};this.length>0?this.tail.next=l:this.head=l,this.tail=l,++this.length}unshift(o){const l={data:o,next:this.head};this.length===0&&(this.tail=l),this.head=l,++this.length}shift(){if(this.length===0)return;const o=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,o}clear(){this.head=this.tail=null,this.length=0}join(o){if(this.length===0)return"";let l=this.head,u=""+l.data;for(;(l=l.next)!==null;)u+=o+l.data;return u}concat(o){if(this.length===0)return i.alloc(0);const l=i.allocUnsafe(o>>>0);let u=this.head,h=0;for(;u;)t(l,u.data,h),h+=u.data.length,u=u.next;return l}consume(o,l){const u=this.head.data;if(o<u.length){const h=u.slice(0,o);return this.head.data=u.slice(o),h}return o===u.length?this.shift():l?this._getString(o):this._getBuffer(o)}first(){return this.head.data}*[e](){for(let o=this.head;o;o=o.next)yield o.data}_getString(o){let l="",u=this.head,h=0;do{const y=u.data;if(o>y.length)l+=y,o-=y.length;else{o===y.length?(l+=y,++h,u.next?this.head=u.next:this.head=this.tail=null):(l+=r(y,0,o),this.head=u,u.data=r(y,o));break}++h}while((u=u.next)!==null);return this.length-=h,l}_getBuffer(o){const l=i.allocUnsafe(o),u=o;let h=this.head,y=0;do{const b=h.data;if(o>b.length)t(l,b,u-o),o-=b.length;else{o===b.length?(t(l,b,u-o),++y,h.next?this.head=h.next:this.head=this.tail=null):(t(l,new n(b.buffer,b.byteOffset,o),u-o),this.head=h,h.data=b.slice(o));break}++y}while((h=h.next)!==null);return this.length-=y,l}[Symbol.for("nodejs.util.inspect.custom")](o,l){return s(this,{...l,depth:0,customInspect:!1})}},ai}var oi,Ya;function On(){if(Ya)return oi;Ya=1;const{MathFloor:r,NumberIsInteger:e}=$e(),{validateInteger:t}=Yr(),{ERR_INVALID_ARG_VALUE:n}=Ve().codes;let i=16*1024,s=16;function a(h,y,b){return h.highWaterMark!=null?h.highWaterMark:y?h[b]:null}function o(h){return h?s:i}function l(h,y){t(y,"value",0),h?s=y:i=y}function u(h,y,b,g){const m=a(y,g,b);if(m!=null){if(!e(m)||m<0){const _=g?`options.${b}`:"options.highWaterMark";throw new n(_,m)}return r(m)}return o(h.objectMode)}return oi={getHighWaterMark:u,getDefaultHighWaterMark:o,setDefaultHighWaterMark:l},oi}var li={},un={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var Za;function zc(){return Za||(Za=1,function(r,e){var t=bt(),n=t.Buffer;function i(a,o){for(var l in a)o[l]=a[l]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?r.exports=t:(i(t,e),e.Buffer=s);function s(a,o,l){return n(a,o,l)}s.prototype=Object.create(n.prototype),i(n,s),s.from=function(a,o,l){if(typeof a=="number")throw new TypeError("Argument must not be a number");return n(a,o,l)},s.alloc=function(a,o,l){if(typeof a!="number")throw new TypeError("Argument must be a number");var u=n(a);return o!==void 0?typeof l=="string"?u.fill(o,l):u.fill(o):u.fill(0),u},s.allocUnsafe=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return n(a)},s.allocUnsafeSlow=function(a){if(typeof a!="number")throw new TypeError("Argument must be a number");return t.SlowBuffer(a)}}(un,un.exports)),un.exports}var eo;function Jc(){if(eo)return li;eo=1;var r=zc().Buffer,e=r.isEncoding||function(S){switch(S=""+S,S&&S.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function t(S){if(!S)return"utf8";for(var I;;)switch(S){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 S;default:if(I)return;S=(""+S).toLowerCase(),I=!0}}function n(S){var I=t(S);if(typeof I!="string"&&(r.isEncoding===e||!e(S)))throw new Error("Unknown encoding: "+S);return I||S}li.StringDecoder=i;function i(S){this.encoding=n(S);var I;switch(this.encoding){case"utf16le":this.text=y,this.end=b,I=4;break;case"utf8":this.fillLast=l,I=4;break;case"base64":this.text=g,this.end=m,I=3;break;default:this.write=_,this.end=x;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(I)}i.prototype.write=function(S){if(S.length===0)return"";var I,w;if(this.lastNeed){if(I=this.fillLast(S),I===void 0)return"";w=this.lastNeed,this.lastNeed=0}else w=0;return w<S.length?I?I+this.text(S,w):this.text(S,w):I||""},i.prototype.end=h,i.prototype.text=u,i.prototype.fillLast=function(S){if(this.lastNeed<=S.length)return S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,this.lastTotal-this.lastNeed,0,S.length),this.lastNeed-=S.length};function s(S){return S<=127?0:S>>5===6?2:S>>4===14?3:S>>3===30?4:S>>6===2?-1:-2}function a(S,I,w){var d=I.length-1;if(d<w)return 0;var p=s(I[d]);return p>=0?(p>0&&(S.lastNeed=p-1),p):--d<w||p===-2?0:(p=s(I[d]),p>=0?(p>0&&(S.lastNeed=p-2),p):--d<w||p===-2?0:(p=s(I[d]),p>=0?(p>0&&(p===2?p=0:S.lastNeed=p-3),p):0))}function o(S,I,w){if((I[0]&192)!==128)return S.lastNeed=0,"�";if(S.lastNeed>1&&I.length>1){if((I[1]&192)!==128)return S.lastNeed=1,"�";if(S.lastNeed>2&&I.length>2&&(I[2]&192)!==128)return S.lastNeed=2,"�"}}function l(S){var I=this.lastTotal-this.lastNeed,w=o(this,S);if(w!==void 0)return w;if(this.lastNeed<=S.length)return S.copy(this.lastChar,I,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);S.copy(this.lastChar,I,0,S.length),this.lastNeed-=S.length}function u(S,I){var w=a(this,S,I);if(!this.lastNeed)return S.toString("utf8",I);this.lastTotal=w;var d=S.length-(w-this.lastNeed);return S.copy(this.lastChar,0,d),S.toString("utf8",I,d)}function h(S){var I=S&&S.length?this.write(S):"";return this.lastNeed?I+"�":I}function y(S,I){if((S.length-I)%2===0){var w=S.toString("utf16le",I);if(w){var d=w.charCodeAt(w.length-1);if(d>=55296&&d<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1],w.slice(0,-1)}return w}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=S[S.length-1],S.toString("utf16le",I,S.length-1)}function b(S){var I=S&&S.length?this.write(S):"";if(this.lastNeed){var w=this.lastTotal-this.lastNeed;return I+this.lastChar.toString("utf16le",0,w)}return I}function g(S,I){var w=(S.length-I)%3;return w===0?S.toString("base64",I):(this.lastNeed=3-w,this.lastTotal=3,w===1?this.lastChar[0]=S[S.length-1]:(this.lastChar[0]=S[S.length-2],this.lastChar[1]=S[S.length-1]),S.toString("base64",I,S.length-w))}function m(S){var I=S&&S.length?this.write(S):"";return this.lastNeed?I+this.lastChar.toString("base64",0,3-this.lastNeed):I}function _(S){return S.toString(this.encoding)}function x(S){return S&&S.length?this.write(S):""}return li}var ui,to;function xu(){if(to)return ui;to=1;const r=Vt(),{PromisePrototypeThen:e,SymbolAsyncIterator:t,SymbolIterator:n}=$e(),{Buffer:i}=bt(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_NULL_VALUES:a}=Ve().codes;function o(l,u,h){let y;if(typeof u=="string"||u instanceof i)return new l({objectMode:!0,...h,read(){this.push(u),this.push(null)}});let b;if(u&&u[t])b=!0,y=u[t]();else if(u&&u[n])b=!1,y=u[n]();else throw new s("iterable",["Iterable"],u);const g=new l({objectMode:!0,highWaterMark:1,...h});let m=!1;g._read=function(){m||(m=!0,x())},g._destroy=function(S,I){e(_(S),()=>r.nextTick(I,S),w=>r.nextTick(I,w||S))};async function _(S){const I=S!=null,w=typeof y.throw=="function";if(I&&w){const{value:d,done:p}=await y.throw(S);if(await d,p)return}if(typeof y.return=="function"){const{value:d}=await y.return();await d}}async function x(){for(;;){try{const{value:S,done:I}=b?await y.next():y.next();if(I)g.push(null);else{const w=S&&typeof S.then=="function"?await S:S;if(w===null)throw m=!1,new a;if(g.push(w))continue;m=!1}}catch(S){g.destroy(S)}break}}return g}return ui=o,ui}var ci,ro;function $n(){if(ro)return ci;ro=1;const r=Vt(),{ArrayPrototypeIndexOf:e,NumberIsInteger:t,NumberIsNaN:n,NumberParseInt:i,ObjectDefineProperties:s,ObjectKeys:a,ObjectSetPrototypeOf:o,Promise:l,SafeSet:u,SymbolAsyncDispose:h,SymbolAsyncIterator:y,Symbol:b}=$e();ci=se,se.ReadableState=he;const{EventEmitter:g}=Ln(),{Stream:m,prependListener:_}=Js(),{Buffer:x}=bt(),{addAbortSignal:S}=jn(),I=Tt();let w=ze().debuglog("stream",$=>{w=$});const d=Wc(),p=ur(),{getHighWaterMark:N,getDefaultHighWaterMark:D}=On(),{aggregateTwoErrors:T,codes:{ERR_INVALID_ARG_TYPE:q,ERR_METHOD_NOT_IMPLEMENTED:R,ERR_OUT_OF_RANGE:M,ERR_STREAM_PUSH_AFTER_EOF:B,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:A},AbortError:j}=Ve(),{validateObject:Y}=Yr(),L=b("kPaused"),{StringDecoder:ee}=Jc(),P=xu();o(se.prototype,m.prototype),o(se,m);const K=()=>{},{errorOrDestroy:v}=p,U=1,Q=2,z=4,ae=8,H=16,V=32,W=64,F=128,Z=256,te=512,ce=1024,fe=2048,O=4096,G=8192,re=16384,ue=32768,de=65536,pe=1<<17,X=1<<18;function le($){return{enumerable:!1,get(){return(this.state&$)!==0},set(C){C?this.state|=$:this.state&=~$}}}s(he.prototype,{objectMode:le(U),ended:le(Q),endEmitted:le(z),reading:le(ae),constructed:le(H),sync:le(V),needReadable:le(W),emittedReadable:le(F),readableListening:le(Z),resumeScheduled:le(te),errorEmitted:le(ce),emitClose:le(fe),autoDestroy:le(O),destroyed:le(G),closed:le(re),closeEmitted:le(ue),multiAwaitDrain:le(de),readingMore:le(pe),dataEmitted:le(X)});function he($,C,ge){typeof ge!="boolean"&&(ge=C instanceof gt()),this.state=fe|O|H|V,$&&$.objectMode&&(this.state|=U),ge&&$&&$.readableObjectMode&&(this.state|=U),this.highWaterMark=$?N(this,$,"readableHighWaterMark",ge):D(!1),this.buffer=new d,this.length=0,this.pipes=[],this.flowing=null,this[L]=null,$&&$.emitClose===!1&&(this.state&=~fe),$&&$.autoDestroy===!1&&(this.state&=~O),this.errored=null,this.defaultEncoding=$&&$.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,$&&$.encoding&&(this.decoder=new ee($.encoding),this.encoding=$.encoding)}function se($){if(!(this instanceof se))return new se($);const C=this instanceof gt();this._readableState=new he($,this,C),$&&(typeof $.read=="function"&&(this._read=$.read),typeof $.destroy=="function"&&(this._destroy=$.destroy),typeof $.construct=="function"&&(this._construct=$.construct),$.signal&&!C&&S($.signal,this)),m.call(this,$),p.construct(this,()=>{this._readableState.needReadable&&J(this,this._readableState)})}se.prototype.destroy=p.destroy,se.prototype._undestroy=p.undestroy,se.prototype._destroy=function($,C){C($)},se.prototype[g.captureRejectionSymbol]=function($){this.destroy($)},se.prototype[h]=function(){let $;return this.destroyed||($=this.readableEnded?null:new j,this.destroy($)),new l((C,ge)=>I(this,ye=>ye&&ye!==$?ge(ye):C(null)))},se.prototype.push=function($,C){return Ee(this,$,C,!1)},se.prototype.unshift=function($,C){return Ee(this,$,C,!0)};function Ee($,C,ge,ye){w("readableAddChunk",C);const me=$._readableState;let Fe;if((me.state&U)===0&&(typeof C=="string"?(ge=ge||me.defaultEncoding,me.encoding!==ge&&(ye&&me.encoding?C=x.from(C,ge).toString(me.encoding):(C=x.from(C,ge),ge=""))):C instanceof x?ge="":m._isUint8Array(C)?(C=m._uint8ArrayToBuffer(C),ge=""):C!=null&&(Fe=new q("chunk",["string","Buffer","Uint8Array"],C))),Fe)v($,Fe);else if(C===null)me.state&=~ae,c($,me);else if((me.state&U)!==0||C&&C.length>0)if(ye)if((me.state&z)!==0)v($,new A);else{if(me.destroyed||me.errored)return!1;Be($,me,C,!0)}else if(me.ended)v($,new B);else{if(me.destroyed||me.errored)return!1;me.state&=~ae,me.decoder&&!ge?(C=me.decoder.write(C),me.objectMode||C.length!==0?Be($,me,C,!1):J($,me)):Be($,me,C,!1)}else ye||(me.state&=~ae,J($,me));return!me.ended&&(me.length<me.highWaterMark||me.length===0)}function Be($,C,ge,ye){C.flowing&&C.length===0&&!C.sync&&$.listenerCount("data")>0?((C.state&de)!==0?C.awaitDrainWriters.clear():C.awaitDrainWriters=null,C.dataEmitted=!0,$.emit("data",ge)):(C.length+=C.objectMode?1:ge.length,ye?C.buffer.unshift(ge):C.buffer.push(ge),(C.state&W)!==0&&f($)),J($,C)}se.prototype.isPaused=function(){const $=this._readableState;return $[L]===!0||$.flowing===!1},se.prototype.setEncoding=function($){const C=new ee($);this._readableState.decoder=C,this._readableState.encoding=this._readableState.decoder.encoding;const ge=this._readableState.buffer;let ye="";for(const me of ge)ye+=C.write(me);return ge.clear(),ye!==""&&ge.push(ye),this._readableState.length=ye.length,this};const ve=1073741824;function He($){if($>ve)throw new M("size","<= 1GiB",$);return $--,$|=$>>>1,$|=$>>>2,$|=$>>>4,$|=$>>>8,$|=$>>>16,$++,$}function E($,C){return $<=0||C.length===0&&C.ended?0:(C.state&U)!==0?1:n($)?C.flowing&&C.length?C.buffer.first().length:C.length:$<=C.length?$:C.ended?C.length:0}se.prototype.read=function($){w("read",$),$===void 0?$=NaN:t($)||($=i($,10));const C=this._readableState,ge=$;if($>C.highWaterMark&&(C.highWaterMark=He($)),$!==0&&(C.state&=~F),$===0&&C.needReadable&&((C.highWaterMark!==0?C.length>=C.highWaterMark:C.length>0)||C.ended))return w("read: emitReadable",C.length,C.ended),C.length===0&&C.ended?Fn(this):f(this),null;if($=E($,C),$===0&&C.ended)return C.length===0&&Fn(this),null;let ye=(C.state&W)!==0;if(w("need readable",ye),(C.length===0||C.length-$<C.highWaterMark)&&(ye=!0,w("length less than watermark",ye)),C.ended||C.reading||C.destroyed||C.errored||!C.constructed)ye=!1,w("reading, ended or constructing",ye);else if(ye){w("do read"),C.state|=ae|V,C.length===0&&(C.state|=W);try{this._read(C.highWaterMark)}catch(Fe){v(this,Fe)}C.state&=~V,C.reading||($=E(ge,C))}let me;return $>0?me=xa($,C):me=null,me===null?(C.needReadable=C.length<=C.highWaterMark,$=0):(C.length-=$,C.multiAwaitDrain?C.awaitDrainWriters.clear():C.awaitDrainWriters=null),C.length===0&&(C.ended||(C.needReadable=!0),ge!==$&&C.ended&&Fn(this)),me!==null&&!C.errorEmitted&&!C.closeEmitted&&(C.dataEmitted=!0,this.emit("data",me)),me};function c($,C){if(w("onEofChunk"),!C.ended){if(C.decoder){const ge=C.decoder.end();ge&&ge.length&&(C.buffer.push(ge),C.length+=C.objectMode?1:ge.length)}C.ended=!0,C.sync?f($):(C.needReadable=!1,C.emittedReadable=!0,k($))}}function f($){const C=$._readableState;w("emitReadable",C.needReadable,C.emittedReadable),C.needReadable=!1,C.emittedReadable||(w("emitReadable",C.flowing),C.emittedReadable=!0,r.nextTick(k,$))}function k($){const C=$._readableState;w("emitReadable_",C.destroyed,C.length,C.ended),!C.destroyed&&!C.errored&&(C.length||C.ended)&&($.emit("readable"),C.emittedReadable=!1),C.needReadable=!C.flowing&&!C.ended&&C.length<=C.highWaterMark,Ie($)}function J($,C){!C.readingMore&&C.constructed&&(C.readingMore=!0,r.nextTick(ie,$,C))}function ie($,C){for(;!C.reading&&!C.ended&&(C.length<C.highWaterMark||C.flowing&&C.length===0);){const ge=C.length;if(w("maybeReadMore read 0"),$.read(0),ge===C.length)break}C.readingMore=!1}se.prototype._read=function($){throw new R("_read()")},se.prototype.pipe=function($,C){const ge=this,ye=this._readableState;ye.pipes.length===1&&(ye.multiAwaitDrain||(ye.multiAwaitDrain=!0,ye.awaitDrainWriters=new u(ye.awaitDrainWriters?[ye.awaitDrainWriters]:[]))),ye.pipes.push($),w("pipe count=%d opts=%j",ye.pipes.length,C);const Fe=(!C||C.end!==!1)&&$!==r.stdout&&$!==r.stderr?Ea:hr;ye.endEmitted?r.nextTick(Fe):ge.once("end",Fe),$.on("unpipe",Ke);function Ke(jt,ht){w("onunpipe"),jt===ge&&ht&&ht.hasUnpiped===!1&&(ht.hasUnpiped=!0,Ec())}function Ea(){w("onend"),$.end()}let Lt,Ia=!1;function Ec(){w("cleanup"),$.removeListener("close",Vn),$.removeListener("finish",Gn),Lt&&$.removeListener("drain",Lt),$.removeListener("error",Hn),$.removeListener("unpipe",Ke),ge.removeListener("end",Ea),ge.removeListener("end",hr),ge.removeListener("data",Na),Ia=!0,Lt&&ye.awaitDrainWriters&&(!$._writableState||$._writableState.needDrain)&&Lt()}function Ra(){Ia||(ye.pipes.length===1&&ye.pipes[0]===$?(w("false write response, pause",0),ye.awaitDrainWriters=$,ye.multiAwaitDrain=!1):ye.pipes.length>1&&ye.pipes.includes($)&&(w("false write response, pause",ye.awaitDrainWriters.size),ye.awaitDrainWriters.add($)),ge.pause()),Lt||(Lt=oe(ge,$),$.on("drain",Lt))}ge.on("data",Na);function Na(jt){w("ondata");const ht=$.write(jt);w("dest.write",ht),ht===!1&&Ra()}function Hn(jt){if(w("onerror",jt),hr(),$.removeListener("error",Hn),$.listenerCount("error")===0){const ht=$._writableState||$._readableState;ht&&!ht.errorEmitted?v($,jt):$.emit("error",jt)}}_($,"error",Hn);function Vn(){$.removeListener("finish",Gn),hr()}$.once("close",Vn);function Gn(){w("onfinish"),$.removeListener("close",Vn),hr()}$.once("finish",Gn);function hr(){w("unpipe"),ge.unpipe($)}return $.emit("pipe",ge),$.writableNeedDrain===!0?Ra():ye.flowing||(w("pipe resume"),ge.resume()),$};function oe($,C){return function(){const ye=$._readableState;ye.awaitDrainWriters===C?(w("pipeOnDrain",1),ye.awaitDrainWriters=null):ye.multiAwaitDrain&&(w("pipeOnDrain",ye.awaitDrainWriters.size),ye.awaitDrainWriters.delete(C)),(!ye.awaitDrainWriters||ye.awaitDrainWriters.size===0)&&$.listenerCount("data")&&$.resume()}}se.prototype.unpipe=function($){const C=this._readableState,ge={hasUnpiped:!1};if(C.pipes.length===0)return this;if(!$){const me=C.pipes;C.pipes=[],this.pause();for(let Fe=0;Fe<me.length;Fe++)me[Fe].emit("unpipe",this,{hasUnpiped:!1});return this}const ye=e(C.pipes,$);return ye===-1?this:(C.pipes.splice(ye,1),C.pipes.length===0&&this.pause(),$.emit("unpipe",this,ge),this)},se.prototype.on=function($,C){const ge=m.prototype.on.call(this,$,C),ye=this._readableState;return $==="data"?(ye.readableListening=this.listenerCount("readable")>0,ye.flowing!==!1&&this.resume()):$==="readable"&&!ye.endEmitted&&!ye.readableListening&&(ye.readableListening=ye.needReadable=!0,ye.flowing=!1,ye.emittedReadable=!1,w("on readable",ye.length,ye.reading),ye.length?f(this):ye.reading||r.nextTick(Le,this)),ge},se.prototype.addListener=se.prototype.on,se.prototype.removeListener=function($,C){const ge=m.prototype.removeListener.call(this,$,C);return $==="readable"&&r.nextTick(we,this),ge},se.prototype.off=se.prototype.removeListener,se.prototype.removeAllListeners=function($){const C=m.prototype.removeAllListeners.apply(this,arguments);return($==="readable"||$===void 0)&&r.nextTick(we,this),C};function we($){const C=$._readableState;C.readableListening=$.listenerCount("readable")>0,C.resumeScheduled&&C[L]===!1?C.flowing=!0:$.listenerCount("data")>0?$.resume():C.readableListening||(C.flowing=null)}function Le($){w("readable nexttick read 0"),$.read(0)}se.prototype.resume=function(){const $=this._readableState;return $.flowing||(w("resume"),$.flowing=!$.readableListening,Te(this,$)),$[L]=!1,this};function Te($,C){C.resumeScheduled||(C.resumeScheduled=!0,r.nextTick(je,$,C))}function je($,C){w("resume",C.reading),C.reading||$.read(0),C.resumeScheduled=!1,$.emit("resume"),Ie($),C.flowing&&!C.reading&&$.read(0)}se.prototype.pause=function(){return w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(w("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[L]=!0,this};function Ie($){const C=$._readableState;for(w("flow",C.flowing);C.flowing&&$.read()!==null;);}se.prototype.wrap=function($){let C=!1;$.on("data",ye=>{!this.push(ye)&&$.pause&&(C=!0,$.pause())}),$.on("end",()=>{this.push(null)}),$.on("error",ye=>{v(this,ye)}),$.on("close",()=>{this.destroy()}),$.on("destroy",()=>{this.destroy()}),this._read=()=>{C&&$.resume&&(C=!1,$.resume())};const ge=a($);for(let ye=1;ye<ge.length;ye++){const me=ge[ye];this[me]===void 0&&typeof $[me]=="function"&&(this[me]=$[me].bind($))}return this},se.prototype[y]=function(){return _a(this)},se.prototype.iterator=function($){return $!==void 0&&Y($,"options"),_a(this,$)};function _a($,C){typeof $.read!="function"&&($=se.wrap($,{objectMode:!0}));const ge=_c($,C);return ge.stream=$,ge}async function*_c($,C){let ge=K;function ye(Ke){this===$?(ge(),ge=K):ge=Ke}$.on("readable",ye);let me;const Fe=I($,{writable:!1},Ke=>{me=Ke?T(me,Ke):null,ge(),ge=K});try{for(;;){const Ke=$.destroyed?null:$.read();if(Ke!==null)yield Ke;else{if(me)throw me;if(me===null)return;await new l(ye)}}}catch(Ke){throw me=T(me,Ke),me}finally{(me||(C==null?void 0:C.destroyOnReturn)!==!1)&&(me===void 0||$._readableState.autoDestroy)?p.destroyer($,null):($.off("readable",ye),Fe())}}s(se.prototype,{readable:{__proto__:null,get(){const $=this._readableState;return!!$&&$.readable!==!1&&!$.destroyed&&!$.errorEmitted&&!$.endEmitted},set($){this._readableState&&(this._readableState.readable=!!$)}},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($){this._readableState&&(this._readableState.flowing=$)}},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($){this._readableState&&(this._readableState.destroyed=$)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),s(he.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[L]!==!1},set($){this[L]=!!$}}}),se._fromList=xa;function xa($,C){if(C.length===0)return null;let ge;return C.objectMode?ge=C.buffer.shift():!$||$>=C.length?(C.decoder?ge=C.buffer.join(""):C.buffer.length===1?ge=C.buffer.first():ge=C.buffer.concat(C.length),C.buffer.clear()):ge=C.buffer.consume($,C.decoder),ge}function Fn($){const C=$._readableState;w("endReadable",C.endEmitted),C.endEmitted||(C.ended=!0,r.nextTick(xc,C,$))}function xc($,C){if(w("endReadableNT",$.endEmitted,$.length),!$.errored&&!$.closeEmitted&&!$.endEmitted&&$.length===0){if($.endEmitted=!0,C.emit("end"),C.writable&&C.allowHalfOpen===!1)r.nextTick(Sc,C);else if($.autoDestroy){const ge=C._writableState;(!ge||ge.autoDestroy&&(ge.finished||ge.writable===!1))&&C.destroy()}}}function Sc($){$.writable&&!$.writableEnded&&!$.destroyed&&$.end()}se.from=function($,C){return P(se,$,C)};let Un;function Sa(){return Un===void 0&&(Un={}),Un}return se.fromWeb=function($,C){return Sa().newStreamReadableFromReadableStream($,C)},se.toWeb=function($,C){return Sa().newReadableStreamFromStreamReadable($,C)},se.wrap=function($,C){var ge,ye;return new se({objectMode:(ge=(ye=$.readableObjectMode)!==null&&ye!==void 0?ye:$.objectMode)!==null&&ge!==void 0?ge:!0,...C,destroy(me,Fe){p.destroyer($,me),Fe(me)}}).wrap($)},ci}var di,no;function Qs(){if(no)return di;no=1;const r=Vt(),{ArrayPrototypeSlice:e,Error:t,FunctionPrototypeSymbolHasInstance:n,ObjectDefineProperty:i,ObjectDefineProperties:s,ObjectSetPrototypeOf:a,StringPrototypeToLowerCase:o,Symbol:l,SymbolHasInstance:u}=$e();di=Y,Y.WritableState=A;const{EventEmitter:h}=Ln(),y=Js().Stream,{Buffer:b}=bt(),g=ur(),{addAbortSignal:m}=jn(),{getHighWaterMark:_,getDefaultHighWaterMark:x}=On(),{ERR_INVALID_ARG_TYPE:S,ERR_METHOD_NOT_IMPLEMENTED:I,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:d,ERR_STREAM_DESTROYED:p,ERR_STREAM_ALREADY_FINISHED:N,ERR_STREAM_NULL_VALUES:D,ERR_STREAM_WRITE_AFTER_END:T,ERR_UNKNOWN_ENCODING:q}=Ve().codes,{errorOrDestroy:R}=g;a(Y.prototype,y.prototype),a(Y,y);function M(){}const B=l("kOnFinished");function A(O,G,re){typeof re!="boolean"&&(re=G instanceof gt()),this.objectMode=!!(O&&O.objectMode),re&&(this.objectMode=this.objectMode||!!(O&&O.writableObjectMode)),this.highWaterMark=O?_(this,O,"writableHighWaterMark",re):x(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const ue=!!(O&&O.decodeStrings===!1);this.decodeStrings=!ue,this.defaultEncoding=O&&O.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=v.bind(void 0,G),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,j(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!O||O.emitClose!==!1,this.autoDestroy=!O||O.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[B]=[]}function j(O){O.buffered=[],O.bufferedIndex=0,O.allBuffers=!0,O.allNoop=!0}A.prototype.getBuffer=function(){return e(this.buffered,this.bufferedIndex)},i(A.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Y(O){const G=this instanceof gt();if(!G&&!n(Y,this))return new Y(O);this._writableState=new A(O,this,G),O&&(typeof O.write=="function"&&(this._write=O.write),typeof O.writev=="function"&&(this._writev=O.writev),typeof O.destroy=="function"&&(this._destroy=O.destroy),typeof O.final=="function"&&(this._final=O.final),typeof O.construct=="function"&&(this._construct=O.construct),O.signal&&m(O.signal,this)),y.call(this,O),g.construct(this,()=>{const re=this._writableState;re.writing||ae(this,re),F(this,re)})}i(Y,u,{__proto__:null,value:function(O){return n(this,O)?!0:this!==Y?!1:O&&O._writableState instanceof A}}),Y.prototype.pipe=function(){R(this,new d)};function L(O,G,re,ue){const de=O._writableState;if(typeof re=="function")ue=re,re=de.defaultEncoding;else{if(!re)re=de.defaultEncoding;else if(re!=="buffer"&&!b.isEncoding(re))throw new q(re);typeof ue!="function"&&(ue=M)}if(G===null)throw new D;if(!de.objectMode)if(typeof G=="string")de.decodeStrings!==!1&&(G=b.from(G,re),re="buffer");else if(G instanceof b)re="buffer";else if(y._isUint8Array(G))G=y._uint8ArrayToBuffer(G),re="buffer";else throw new S("chunk",["string","Buffer","Uint8Array"],G);let pe;return de.ending?pe=new T:de.destroyed&&(pe=new p("write")),pe?(r.nextTick(ue,pe),R(O,pe,!0),pe):(de.pendingcb++,ee(O,de,G,re,ue))}Y.prototype.write=function(O,G,re){return L(this,O,G,re)===!0},Y.prototype.cork=function(){this._writableState.corked++},Y.prototype.uncork=function(){const O=this._writableState;O.corked&&(O.corked--,O.writing||ae(this,O))},Y.prototype.setDefaultEncoding=function(G){if(typeof G=="string"&&(G=o(G)),!b.isEncoding(G))throw new q(G);return this._writableState.defaultEncoding=G,this};function ee(O,G,re,ue,de){const pe=G.objectMode?1:re.length;G.length+=pe;const X=G.length<G.highWaterMark;return X||(G.needDrain=!0),G.writing||G.corked||G.errored||!G.constructed?(G.buffered.push({chunk:re,encoding:ue,callback:de}),G.allBuffers&&ue!=="buffer"&&(G.allBuffers=!1),G.allNoop&&de!==M&&(G.allNoop=!1)):(G.writelen=pe,G.writecb=de,G.writing=!0,G.sync=!0,O._write(re,ue,G.onwrite),G.sync=!1),X&&!G.errored&&!G.destroyed}function P(O,G,re,ue,de,pe,X){G.writelen=ue,G.writecb=X,G.writing=!0,G.sync=!0,G.destroyed?G.onwrite(new p("write")):re?O._writev(de,G.onwrite):O._write(de,pe,G.onwrite),G.sync=!1}function K(O,G,re,ue){--G.pendingcb,ue(re),z(G),R(O,re)}function v(O,G){const re=O._writableState,ue=re.sync,de=re.writecb;if(typeof de!="function"){R(O,new w);return}re.writing=!1,re.writecb=null,re.length-=re.writelen,re.writelen=0,G?(G.stack,re.errored||(re.errored=G),O._readableState&&!O._readableState.errored&&(O._readableState.errored=G),ue?r.nextTick(K,O,re,G,de):K(O,re,G,de)):(re.buffered.length>re.bufferedIndex&&ae(O,re),ue?re.afterWriteTickInfo!==null&&re.afterWriteTickInfo.cb===de?re.afterWriteTickInfo.count++:(re.afterWriteTickInfo={count:1,cb:de,stream:O,state:re},r.nextTick(U,re.afterWriteTickInfo)):Q(O,re,1,de))}function U({stream:O,state:G,count:re,cb:ue}){return G.afterWriteTickInfo=null,Q(O,G,re,ue)}function Q(O,G,re,ue){for(!G.ending&&!O.destroyed&&G.length===0&&G.needDrain&&(G.needDrain=!1,O.emit("drain"));re-- >0;)G.pendingcb--,ue();G.destroyed&&z(G),F(O,G)}function z(O){if(O.writing)return;for(let de=O.bufferedIndex;de<O.buffered.length;++de){var G;const{chunk:pe,callback:X}=O.buffered[de],le=O.objectMode?1:pe.length;O.length-=le,X((G=O.errored)!==null&&G!==void 0?G:new p("write"))}const re=O[B].splice(0);for(let de=0;de<re.length;de++){var ue;re[de]((ue=O.errored)!==null&&ue!==void 0?ue:new p("end"))}j(O)}function ae(O,G){if(G.corked||G.bufferProcessing||G.destroyed||!G.constructed)return;const{buffered:re,bufferedIndex:ue,objectMode:de}=G,pe=re.length-ue;if(!pe)return;let X=ue;if(G.bufferProcessing=!0,pe>1&&O._writev){G.pendingcb-=pe-1;const le=G.allNoop?M:se=>{for(let Ee=X;Ee<re.length;++Ee)re[Ee].callback(se)},he=G.allNoop&&X===0?re:e(re,X);he.allBuffers=G.allBuffers,P(O,G,!0,G.length,he,"",le),j(G)}else{do{const{chunk:le,encoding:he,callback:se}=re[X];re[X++]=null;const Ee=de?1:le.length;P(O,G,!1,Ee,le,he,se)}while(X<re.length&&!G.writing);X===re.length?j(G):X>256?(re.splice(0,X),G.bufferedIndex=0):G.bufferedIndex=X}G.bufferProcessing=!1}Y.prototype._write=function(O,G,re){if(this._writev)this._writev([{chunk:O,encoding:G}],re);else throw new I("_write()")},Y.prototype._writev=null,Y.prototype.end=function(O,G,re){const ue=this._writableState;typeof O=="function"?(re=O,O=null,G=null):typeof G=="function"&&(re=G,G=null);let de;if(O!=null){const pe=L(this,O,G);pe instanceof t&&(de=pe)}return ue.corked&&(ue.corked=1,this.uncork()),de||(!ue.errored&&!ue.ending?(ue.ending=!0,F(this,ue,!0),ue.ended=!0):ue.finished?de=new N("end"):ue.destroyed&&(de=new p("end"))),typeof re=="function"&&(de||ue.finished?r.nextTick(re,de):ue[B].push(re)),this};function H(O){return O.ending&&!O.destroyed&&O.constructed&&O.length===0&&!O.errored&&O.buffered.length===0&&!O.finished&&!O.writing&&!O.errorEmitted&&!O.closeEmitted}function V(O,G){let re=!1;function ue(de){if(re){R(O,de??w());return}if(re=!0,G.pendingcb--,de){const pe=G[B].splice(0);for(let X=0;X<pe.length;X++)pe[X](de);R(O,de,G.sync)}else H(G)&&(G.prefinished=!0,O.emit("prefinish"),G.pendingcb++,r.nextTick(Z,O,G))}G.sync=!0,G.pendingcb++;try{O._final(ue)}catch(de){ue(de)}G.sync=!1}function W(O,G){!G.prefinished&&!G.finalCalled&&(typeof O._final=="function"&&!G.destroyed?(G.finalCalled=!0,V(O,G)):(G.prefinished=!0,O.emit("prefinish")))}function F(O,G,re){H(G)&&(W(O,G),G.pendingcb===0&&(re?(G.pendingcb++,r.nextTick((ue,de)=>{H(de)?Z(ue,de):de.pendingcb--},O,G)):H(G)&&(G.pendingcb++,Z(O,G))))}function Z(O,G){G.pendingcb--,G.finished=!0;const re=G[B].splice(0);for(let ue=0;ue<re.length;ue++)re[ue]();if(O.emit("finish"),G.autoDestroy){const ue=O._readableState;(!ue||ue.autoDestroy&&(ue.endEmitted||ue.readable===!1))&&O.destroy()}}s(Y.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(O){this._writableState&&(this._writableState.destroyed=O)}},writable:{__proto__:null,get(){const O=this._writableState;return!!O&&O.writable!==!1&&!O.destroyed&&!O.errored&&!O.ending&&!O.ended},set(O){this._writableState&&(this._writableState.writable=!!O)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){const O=this._writableState;return O?!O.destroyed&&!O.ending&&O.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});const te=g.destroy;Y.prototype.destroy=function(O,G){const re=this._writableState;return!re.destroyed&&(re.bufferedIndex<re.buffered.length||re[B].length)&&r.nextTick(z,re),te.call(this,O,G),this},Y.prototype._undestroy=g.undestroy,Y.prototype._destroy=function(O,G){G(O)},Y.prototype[h.captureRejectionSymbol]=function(O){this.destroy(O)};let ce;function fe(){return ce===void 0&&(ce={}),ce}return Y.fromWeb=function(O,G){return fe().newStreamWritableFromWritableStream(O,G)},Y.toWeb=function(O){return fe().newWritableStreamFromStreamWritable(O)},di}var fi,io;function Qc(){if(io)return fi;io=1;const r=Vt(),e=bt(),{isReadable:t,isWritable:n,isIterable:i,isNodeStream:s,isReadableNodeStream:a,isWritableNodeStream:o,isDuplexNodeStream:l,isReadableStream:u,isWritableStream:h}=wt(),y=Tt(),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:m}}=Ve(),{destroyer:_}=ur(),x=gt(),S=$n(),I=Qs(),{createDeferredPromise:w}=ze(),d=xu(),p=globalThis.Blob||e.Blob,N=typeof p<"u"?function(A){return A instanceof p}:function(A){return!1},D=globalThis.AbortController||Wr().AbortController,{FunctionPrototypeCall:T}=$e();class q extends x{constructor(A){super(A),(A==null?void 0:A.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(A==null?void 0:A.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}fi=function B(A,j){if(l(A))return A;if(a(A))return M({readable:A});if(o(A))return M({writable:A});if(s(A))return M({writable:!1,readable:!1});if(u(A))return M({readable:S.fromWeb(A)});if(h(A))return M({writable:I.fromWeb(A)});if(typeof A=="function"){const{value:L,write:ee,final:P,destroy:K}=R(A);if(i(L))return d(q,L,{objectMode:!0,write:ee,final:P,destroy:K});const v=L==null?void 0:L.then;if(typeof v=="function"){let U;const Q=T(v,L,z=>{if(z!=null)throw new m("nully","body",z)},z=>{_(U,z)});return U=new q({objectMode:!0,readable:!1,write:ee,final(z){P(async()=>{try{await Q,r.nextTick(z,null)}catch(ae){r.nextTick(z,ae)}})},destroy:K})}throw new m("Iterable, AsyncIterable or AsyncFunction",j,L)}if(N(A))return B(A.arrayBuffer());if(i(A))return d(q,A,{objectMode:!0,writable:!1});if(u(A==null?void 0:A.readable)&&h(A==null?void 0:A.writable))return q.fromWeb(A);if(typeof(A==null?void 0:A.writable)=="object"||typeof(A==null?void 0:A.readable)=="object"){const L=A!=null&&A.readable?a(A==null?void 0:A.readable)?A==null?void 0:A.readable:B(A.readable):void 0,ee=A!=null&&A.writable?o(A==null?void 0:A.writable)?A==null?void 0:A.writable:B(A.writable):void 0;return M({readable:L,writable:ee})}const Y=A==null?void 0:A.then;if(typeof Y=="function"){let L;return T(Y,A,ee=>{ee!=null&&L.push(ee),L.push(null)},ee=>{_(L,ee)}),L=new q({objectMode:!0,writable:!1,read(){}})}throw new g(j,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],A)};function R(B){let{promise:A,resolve:j}=w();const Y=new D,L=Y.signal;return{value:B(async function*(){for(;;){const P=A;A=null;const{chunk:K,done:v,cb:U}=await P;if(r.nextTick(U),v)return;if(L.aborted)throw new b(void 0,{cause:L.reason});({promise:A,resolve:j}=w()),yield K}}(),{signal:L}),write(P,K,v){const U=j;j=null,U({chunk:P,done:!1,cb:v})},final(P){const K=j;j=null,K({done:!0,cb:P})},destroy(P,K){Y.abort(),K(P)}}}function M(B){const A=B.readable&&typeof B.readable.read!="function"?S.wrap(B.readable):B.readable,j=B.writable;let Y=!!t(A),L=!!n(j),ee,P,K,v,U;function Q(z){const ae=v;v=null,ae?ae(z):z&&U.destroy(z)}return U=new q({readableObjectMode:!!(A!=null&&A.readableObjectMode),writableObjectMode:!!(j!=null&&j.writableObjectMode),readable:Y,writable:L}),L&&(y(j,z=>{L=!1,z&&_(A,z),Q(z)}),U._write=function(z,ae,H){j.write(z,ae)?H():ee=H},U._final=function(z){j.end(),P=z},j.on("drain",function(){if(ee){const z=ee;ee=null,z()}}),j.on("finish",function(){if(P){const z=P;P=null,z()}})),Y&&(y(A,z=>{Y=!1,z&&_(A,z),Q(z)}),A.on("readable",function(){if(K){const z=K;K=null,z()}}),A.on("end",function(){U.push(null)}),U._read=function(){for(;;){const z=A.read();if(z===null){K=U._read;return}if(!U.push(z))return}}),U._destroy=function(z,ae){!z&&v!==null&&(z=new b),K=null,ee=null,P=null,v===null?ae(z):(v=ae,_(j,z),_(A,z))},U}return fi}var hi,so;function gt(){if(so)return hi;so=1;const{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:e,ObjectKeys:t,ObjectSetPrototypeOf:n}=$e();hi=a;const i=$n(),s=Qs();n(a.prototype,i.prototype),n(a,i);{const h=t(s.prototype);for(let y=0;y<h.length;y++){const b=h[y];a.prototype[b]||(a.prototype[b]=s.prototype[b])}}function a(h){if(!(this instanceof a))return new a(h);i.call(this,h),s.call(this,h),h?(this.allowHalfOpen=h.allowHalfOpen!==!1,h.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),h.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}r(a.prototype,{writable:{__proto__:null,...e(s.prototype,"writable")},writableHighWaterMark:{__proto__:null,...e(s.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...e(s.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...e(s.prototype,"writableBuffer")},writableLength:{__proto__:null,...e(s.prototype,"writableLength")},writableFinished:{__proto__:null,...e(s.prototype,"writableFinished")},writableCorked:{__proto__:null,...e(s.prototype,"writableCorked")},writableEnded:{__proto__:null,...e(s.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...e(s.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(h){this._readableState&&this._writableState&&(this._readableState.destroyed=h,this._writableState.destroyed=h)}}});let o;function l(){return o===void 0&&(o={}),o}a.fromWeb=function(h,y){return l().newStreamDuplexFromReadableWritablePair(h,y)},a.toWeb=function(h){return l().newReadableWritablePairFromDuplex(h)};let u;return a.from=function(h){return u||(u=Qc()),u(h,"body")},hi}var pi,ao;function Su(){if(ao)return pi;ao=1;const{ObjectSetPrototypeOf:r,Symbol:e}=$e();pi=a;const{ERR_METHOD_NOT_IMPLEMENTED:t}=Ve().codes,n=gt(),{getHighWaterMark:i}=On();r(a.prototype,n.prototype),r(a,n);const s=e("kCallback");function a(u){if(!(this instanceof a))return new a(u);const h=u?i(this,u,"readableHighWaterMark",!0):null;h===0&&(u={...u,highWaterMark:null,readableHighWaterMark:h,writableHighWaterMark:u.writableHighWaterMark||0}),n.call(this,u),this._readableState.sync=!1,this[s]=null,u&&(typeof u.transform=="function"&&(this._transform=u.transform),typeof u.flush=="function"&&(this._flush=u.flush)),this.on("prefinish",l)}function o(u){typeof this._flush=="function"&&!this.destroyed?this._flush((h,y)=>{if(h){u?u(h):this.destroy(h);return}y!=null&&this.push(y),this.push(null),u&&u()}):(this.push(null),u&&u())}function l(){this._final!==o&&o.call(this)}return a.prototype._final=o,a.prototype._transform=function(u,h,y){throw new t("_transform()")},a.prototype._write=function(u,h,y){const b=this._readableState,g=this._writableState,m=b.length;this._transform(u,h,(_,x)=>{if(_){y(_);return}x!=null&&this.push(x),g.ended||m===b.length||b.length<b.highWaterMark?y():this[s]=y})},a.prototype._read=function(){if(this[s]){const u=this[s];this[s]=null,u()}},pi}var gi,oo;function Eu(){if(oo)return gi;oo=1;const{ObjectSetPrototypeOf:r}=$e();gi=t;const e=Su();r(t.prototype,e.prototype),r(t,e);function t(n){if(!(this instanceof t))return new t(n);e.call(this,n)}return t.prototype._transform=function(n,i,s){s(null,n)},gi}var yi,lo;function Xs(){if(lo)return yi;lo=1;const r=Vt(),{ArrayIsArray:e,Promise:t,SymbolAsyncIterator:n,SymbolDispose:i}=$e(),s=Tt(),{once:a}=ze(),o=ur(),l=gt(),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:h,ERR_INVALID_RETURN_VALUE:y,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:g,ERR_STREAM_PREMATURE_CLOSE:m},AbortError:_}=Ve(),{validateFunction:x,validateAbortSignal:S}=Yr(),{isIterable:I,isReadable:w,isReadableNodeStream:d,isNodeStream:p,isTransformStream:N,isWebStream:D,isReadableStream:T,isReadableFinished:q}=wt(),R=globalThis.AbortController||Wr().AbortController;let M,B,A;function j(z,ae,H){let V=!1;z.on("close",()=>{V=!0});const W=s(z,{readable:ae,writable:H},F=>{V=!F});return{destroy:F=>{V||(V=!0,o.destroyer(z,F||new g("pipe")))},cleanup:W}}function Y(z){return x(z[z.length-1],"streams[stream.length - 1]"),z.pop()}function L(z){if(I(z))return z;if(d(z))return ee(z);throw new h("val",["Readable","Iterable","AsyncIterable"],z)}async function*ee(z){B||(B=$n()),yield*B.prototype[n].call(z)}async function P(z,ae,H,{end:V}){let W,F=null;const Z=fe=>{if(fe&&(W=fe),F){const O=F;F=null,O()}},te=()=>new t((fe,O)=>{W?O(W):F=()=>{W?O(W):fe()}});ae.on("drain",Z);const ce=s(ae,{readable:!1},Z);try{ae.writableNeedDrain&&await te();for await(const fe of z)ae.write(fe)||await te();V&&(ae.end(),await te()),H()}catch(fe){H(W!==fe?u(W,fe):fe)}finally{ce(),ae.off("drain",Z)}}async function K(z,ae,H,{end:V}){N(ae)&&(ae=ae.writable);const W=ae.getWriter();try{for await(const F of z)await W.ready,W.write(F).catch(()=>{});await W.ready,V&&await W.close(),H()}catch(F){try{await W.abort(F),H(F)}catch(Z){H(Z)}}}function v(...z){return U(z,a(Y(z)))}function U(z,ae,H){if(z.length===1&&e(z[0])&&(z=z[0]),z.length<2)throw new b("streams");const V=new R,W=V.signal,F=H==null?void 0:H.signal,Z=[];S(F,"options.signal");function te(){de(new _)}A=A||ze().addAbortListener;let ce;F&&(ce=A(F,te));let fe,O;const G=[];let re=0;function ue(he){de(he,--re===0)}function de(he,se){var Ee;if(he&&(!fe||fe.code==="ERR_STREAM_PREMATURE_CLOSE")&&(fe=he),!(!fe&&!se)){for(;G.length;)G.shift()(fe);(Ee=ce)===null||Ee===void 0||Ee[i](),V.abort(),se&&(fe||Z.forEach(Be=>Be()),r.nextTick(ae,fe,O))}}let pe;for(let he=0;he<z.length;he++){const se=z[he],Ee=he<z.length-1,Be=he>0,ve=Ee||(H==null?void 0:H.end)!==!1,He=he===z.length-1;if(p(se)){let E=function(c){c&&c.name!=="AbortError"&&c.code!=="ERR_STREAM_PREMATURE_CLOSE"&&ue(c)};if(ve){const{destroy:c,cleanup:f}=j(se,Ee,Be);G.push(c),w(se)&&He&&Z.push(f)}se.on("error",E),w(se)&&He&&Z.push(()=>{se.removeListener("error",E)})}if(he===0)if(typeof se=="function"){if(pe=se({signal:W}),!I(pe))throw new y("Iterable, AsyncIterable or Stream","source",pe)}else I(se)||d(se)||N(se)?pe=se:pe=l.from(se);else if(typeof se=="function"){if(N(pe)){var X;pe=L((X=pe)===null||X===void 0?void 0:X.readable)}else pe=L(pe);if(pe=se(pe,{signal:W}),Ee){if(!I(pe,!0))throw new y("AsyncIterable",`transform[${he-1}]`,pe)}else{var le;M||(M=Eu());const E=new M({objectMode:!0}),c=(le=pe)===null||le===void 0?void 0:le.then;if(typeof c=="function")re++,c.call(pe,J=>{O=J,J!=null&&E.write(J),ve&&E.end(),r.nextTick(ue)},J=>{E.destroy(J),r.nextTick(ue,J)});else if(I(pe,!0))re++,P(pe,E,ue,{end:ve});else if(T(pe)||N(pe)){const J=pe.readable||pe;re++,P(J,E,ue,{end:ve})}else throw new y("AsyncIterable or Promise","destination",pe);pe=E;const{destroy:f,cleanup:k}=j(pe,!1,!0);G.push(f),He&&Z.push(k)}}else if(p(se)){if(d(pe)){re+=2;const E=Q(pe,se,ue,{end:ve});w(se)&&He&&Z.push(E)}else if(N(pe)||T(pe)){const E=pe.readable||pe;re++,P(E,se,ue,{end:ve})}else if(I(pe))re++,P(pe,se,ue,{end:ve});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],pe);pe=se}else if(D(se)){if(d(pe))re++,K(L(pe),se,ue,{end:ve});else if(T(pe)||I(pe))re++,K(pe,se,ue,{end:ve});else if(N(pe))re++,K(pe.readable,se,ue,{end:ve});else throw new h("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],pe);pe=se}else pe=l.from(se)}return(W!=null&&W.aborted||F!=null&&F.aborted)&&r.nextTick(te),pe}function Q(z,ae,H,{end:V}){let W=!1;if(ae.on("close",()=>{W||H(new m)}),z.pipe(ae,{end:!1}),V){let F=function(){W=!0,ae.end()};q(z)?r.nextTick(F):z.once("end",F)}else H();return s(z,{readable:!0,writable:!1},F=>{const Z=z._readableState;F&&F.code==="ERR_STREAM_PREMATURE_CLOSE"&&Z&&Z.ended&&!Z.errored&&!Z.errorEmitted?z.once("end",H).once("error",H):H(F)}),s(ae,{readable:!1,writable:!0},H)}return yi={pipelineImpl:U,pipeline:v},yi}var mi,uo;function Iu(){if(uo)return mi;uo=1;const{pipeline:r}=Xs(),e=gt(),{destroyer:t}=ur(),{isNodeStream:n,isReadable:i,isWritable:s,isWebStream:a,isTransformStream:o,isWritableStream:l,isReadableStream:u}=wt(),{AbortError:h,codes:{ERR_INVALID_ARG_VALUE:y,ERR_MISSING_ARGS:b}}=Ve(),g=Tt();return mi=function(..._){if(_.length===0)throw new b("streams");if(_.length===1)return e.from(_[0]);const x=[..._];if(typeof _[0]=="function"&&(_[0]=e.from(_[0])),typeof _[_.length-1]=="function"){const M=_.length-1;_[M]=e.from(_[M])}for(let M=0;M<_.length;++M)if(!(!n(_[M])&&!a(_[M]))){if(M<_.length-1&&!(i(_[M])||u(_[M])||o(_[M])))throw new y(`streams[${M}]`,x[M],"must be readable");if(M>0&&!(s(_[M])||l(_[M])||o(_[M])))throw new y(`streams[${M}]`,x[M],"must be writable")}let S,I,w,d,p;function N(M){const B=d;d=null,B?B(M):M?p.destroy(M):!R&&!q&&p.destroy()}const D=_[0],T=r(_,N),q=!!(s(D)||l(D)||o(D)),R=!!(i(T)||u(T)||o(T));if(p=new e({writableObjectMode:!!(D!=null&&D.writableObjectMode),readableObjectMode:!!(T!=null&&T.readableObjectMode),writable:q,readable:R}),q){if(n(D))p._write=function(B,A,j){D.write(B,A)?j():S=j},p._final=function(B){D.end(),I=B},D.on("drain",function(){if(S){const B=S;S=null,B()}});else if(a(D)){const A=(o(D)?D.writable:D).getWriter();p._write=async function(j,Y,L){try{await A.ready,A.write(j).catch(()=>{}),L()}catch(ee){L(ee)}},p._final=async function(j){try{await A.ready,A.close().catch(()=>{}),I=j}catch(Y){j(Y)}}}const M=o(T)?T.readable:T;g(M,()=>{if(I){const B=I;I=null,B()}})}if(R){if(n(T))T.on("readable",function(){if(w){const M=w;w=null,M()}}),T.on("end",function(){p.push(null)}),p._read=function(){for(;;){const M=T.read();if(M===null){w=p._read;return}if(!p.push(M))return}};else if(a(T)){const B=(o(T)?T.readable:T).getReader();p._read=async function(){for(;;)try{const{value:A,done:j}=await B.read();if(!p.push(A))return;if(j){p.push(null);return}}catch{return}}}}return p._destroy=function(M,B){!M&&d!==null&&(M=new h),w=null,S=null,I=null,d===null?B(M):(d=B,n(T)&&t(T,M))},p},mi}var co;function Xc(){if(co)return on;co=1;const r=globalThis.AbortController||Wr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:e,ERR_INVALID_ARG_TYPE:t,ERR_MISSING_ARGS:n,ERR_OUT_OF_RANGE:i},AbortError:s}=Ve(),{validateAbortSignal:a,validateInteger:o,validateObject:l}=Yr(),u=$e().Symbol("kWeak"),h=$e().Symbol("kResistStopPropagation"),{finished:y}=Tt(),b=Iu(),{addAbortSignalNoValidate:g}=jn(),{isWritable:m,isNodeStream:_}=wt(),{deprecate:x}=ze(),{ArrayPrototypePush:S,Boolean:I,MathFloor:w,Number:d,NumberIsNaN:p,Promise:N,PromiseReject:D,PromiseResolve:T,PromisePrototypeThen:q,Symbol:R}=$e(),M=R("kEmpty"),B=R("kEof");function A(F,Z){if(Z!=null&&l(Z,"options"),(Z==null?void 0:Z.signal)!=null&&a(Z.signal,"options.signal"),_(F)&&!m(F))throw new e("stream",F,"must be writable");const te=b(this,F);return Z!=null&&Z.signal&&g(Z.signal,te),te}function j(F,Z){if(typeof F!="function")throw new t("fn",["Function","AsyncFunction"],F);Z!=null&&l(Z,"options"),(Z==null?void 0:Z.signal)!=null&&a(Z.signal,"options.signal");let te=1;(Z==null?void 0:Z.concurrency)!=null&&(te=w(Z.concurrency));let ce=te-1;return(Z==null?void 0:Z.highWaterMark)!=null&&(ce=w(Z.highWaterMark)),o(te,"options.concurrency",1),o(ce,"options.highWaterMark",0),ce+=te,(async function*(){const O=ze().AbortSignalAny([Z==null?void 0:Z.signal].filter(I)),G=this,re=[],ue={signal:O};let de,pe,X=!1,le=0;function he(){X=!0,se()}function se(){le-=1,Ee()}function Ee(){pe&&!X&&le<te&&re.length<ce&&(pe(),pe=null)}async function Be(){try{for await(let ve of G){if(X)return;if(O.aborted)throw new s;try{if(ve=F(ve,ue),ve===M)continue;ve=T(ve)}catch(He){ve=D(He)}le+=1,q(ve,se,he),re.push(ve),de&&(de(),de=null),!X&&(re.length>=ce||le>=te)&&await new N(He=>{pe=He})}re.push(B)}catch(ve){const He=D(ve);q(He,se,he),re.push(He)}finally{X=!0,de&&(de(),de=null)}}Be();try{for(;;){for(;re.length>0;){const ve=await re[0];if(ve===B)return;if(O.aborted)throw new s;ve!==M&&(yield ve),re.shift(),Ee()}await new N(ve=>{de=ve})}}finally{X=!0,pe&&(pe(),pe=null)}}).call(this)}function Y(F=void 0){return F!=null&&l(F,"options"),(F==null?void 0:F.signal)!=null&&a(F.signal,"options.signal"),(async function*(){let te=0;for await(const fe of this){var ce;if(F!=null&&(ce=F.signal)!==null&&ce!==void 0&&ce.aborted)throw new s({cause:F.signal.reason});yield[te++,fe]}}).call(this)}async function L(F,Z=void 0){for await(const te of v.call(this,F,Z))return!0;return!1}async function ee(F,Z=void 0){if(typeof F!="function")throw new t("fn",["Function","AsyncFunction"],F);return!await L.call(this,async(...te)=>!await F(...te),Z)}async function P(F,Z){for await(const te of v.call(this,F,Z))return te}async function K(F,Z){if(typeof F!="function")throw new t("fn",["Function","AsyncFunction"],F);async function te(ce,fe){return await F(ce,fe),M}for await(const ce of j.call(this,te,Z));}function v(F,Z){if(typeof F!="function")throw new t("fn",["Function","AsyncFunction"],F);async function te(ce,fe){return await F(ce,fe)?ce:M}return j.call(this,te,Z)}class U extends n{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function Q(F,Z,te){var ce;if(typeof F!="function")throw new t("reducer",["Function","AsyncFunction"],F);te!=null&&l(te,"options"),(te==null?void 0:te.signal)!=null&&a(te.signal,"options.signal");let fe=arguments.length>1;if(te!=null&&(ce=te.signal)!==null&&ce!==void 0&&ce.aborted){const de=new s(void 0,{cause:te.signal.reason});throw this.once("error",()=>{}),await y(this.destroy(de)),de}const O=new r,G=O.signal;if(te!=null&&te.signal){const de={once:!0,[u]:this,[h]:!0};te.signal.addEventListener("abort",()=>O.abort(),de)}let re=!1;try{for await(const de of this){var ue;if(re=!0,te!=null&&(ue=te.signal)!==null&&ue!==void 0&&ue.aborted)throw new s;fe?Z=await F(Z,de,{signal:G}):(Z=de,fe=!0)}if(!re&&!fe)throw new U}finally{O.abort()}return Z}async function z(F){F!=null&&l(F,"options"),(F==null?void 0:F.signal)!=null&&a(F.signal,"options.signal");const Z=[];for await(const ce of this){var te;if(F!=null&&(te=F.signal)!==null&&te!==void 0&&te.aborted)throw new s(void 0,{cause:F.signal.reason});S(Z,ce)}return Z}function ae(F,Z){const te=j.call(this,F,Z);return(async function*(){for await(const fe of te)yield*fe}).call(this)}function H(F){if(F=d(F),p(F))return 0;if(F<0)throw new i("number",">= 0",F);return F}function V(F,Z=void 0){return Z!=null&&l(Z,"options"),(Z==null?void 0:Z.signal)!=null&&a(Z.signal,"options.signal"),F=H(F),(async function*(){var ce;if(Z!=null&&(ce=Z.signal)!==null&&ce!==void 0&&ce.aborted)throw new s;for await(const O of this){var fe;if(Z!=null&&(fe=Z.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;F--<=0&&(yield O)}}).call(this)}function W(F,Z=void 0){return Z!=null&&l(Z,"options"),(Z==null?void 0:Z.signal)!=null&&a(Z.signal,"options.signal"),F=H(F),(async function*(){var ce;if(Z!=null&&(ce=Z.signal)!==null&&ce!==void 0&&ce.aborted)throw new s;for await(const O of this){var fe;if(Z!=null&&(fe=Z.signal)!==null&&fe!==void 0&&fe.aborted)throw new s;if(F-- >0&&(yield O),F<=0)return}}).call(this)}return on.streamReturningOperators={asIndexedPairs:x(Y,"readable.asIndexedPairs will be removed in a future version."),drop:V,filter:v,flatMap:ae,map:j,take:W,compose:A},on.promiseReturningOperators={every:ee,forEach:K,reduce:Q,toArray:z,some:L,find:P},on}var bi,fo;function Ru(){if(fo)return bi;fo=1;const{ArrayPrototypePop:r,Promise:e}=$e(),{isIterable:t,isNodeStream:n,isWebStream:i}=wt(),{pipelineImpl:s}=Xs(),{finished:a}=Tt();Nu();function o(...l){return new e((u,h)=>{let y,b;const g=l[l.length-1];if(g&&typeof g=="object"&&!n(g)&&!t(g)&&!i(g)){const m=r(l);y=m.signal,b=m.end}s(l,(m,_)=>{m?h(m):u(_)},{signal:y,end:b})})}return bi={finished:a,pipeline:o},bi}var ho;function Nu(){if(ho)return Qn.exports;ho=1;const{Buffer:r}=bt(),{ObjectDefineProperty:e,ObjectKeys:t,ReflectApply:n}=$e(),{promisify:{custom:i}}=ze(),{streamReturningOperators:s,promiseReturningOperators:a}=Xc(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:o}}=Ve(),l=Iu(),{setDefaultHighWaterMark:u,getDefaultHighWaterMark:h}=On(),{pipeline:y}=Xs(),{destroyer:b}=ur(),g=Tt(),m=Ru(),_=wt(),x=Qn.exports=Js().Stream;x.isDestroyed=_.isDestroyed,x.isDisturbed=_.isDisturbed,x.isErrored=_.isErrored,x.isReadable=_.isReadable,x.isWritable=_.isWritable,x.Readable=$n();for(const I of t(s)){let d=function(...p){if(new.target)throw o();return x.Readable.from(n(w,this,p))};const w=s[I];e(d,"name",{__proto__:null,value:w.name}),e(d,"length",{__proto__:null,value:w.length}),e(x.Readable.prototype,I,{__proto__:null,value:d,enumerable:!1,configurable:!0,writable:!0})}for(const I of t(a)){let d=function(...p){if(new.target)throw o();return n(w,this,p)};const w=a[I];e(d,"name",{__proto__:null,value:w.name}),e(d,"length",{__proto__:null,value:w.length}),e(x.Readable.prototype,I,{__proto__:null,value:d,enumerable:!1,configurable:!0,writable:!0})}x.Writable=Qs(),x.Duplex=gt(),x.Transform=Su(),x.PassThrough=Eu(),x.pipeline=y;const{addAbortSignal:S}=jn();return x.addAbortSignal=S,x.finished=g,x.destroy=b,x.compose=l,x.setDefaultHighWaterMark=u,x.getDefaultHighWaterMark=h,e(x,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return m}}),e(y,i,{__proto__:null,enumerable:!0,get(){return m.pipeline}}),e(g,i,{__proto__:null,enumerable:!0,get(){return m.finished}}),x.Stream=x,x._isUint8Array=function(w){return w instanceof Uint8Array},x._uint8ArrayToBuffer=function(w){return r.from(w.buffer,w.byteOffset,w.byteLength)},Qn.exports}var po;function Kc(){return po||(po=1,function(r){const e=Nu(),t=Ru(),n=e.Readable.destroy;r.exports=e.Readable,r.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,r.exports._isUint8Array=e._isUint8Array,r.exports.isDisturbed=e.isDisturbed,r.exports.isErrored=e.isErrored,r.exports.isReadable=e.isReadable,r.exports.Readable=e.Readable,r.exports.Writable=e.Writable,r.exports.Duplex=e.Duplex,r.exports.Transform=e.Transform,r.exports.PassThrough=e.PassThrough,r.exports.addAbortSignal=e.addAbortSignal,r.exports.finished=e.finished,r.exports.destroy=e.destroy,r.exports.destroy=n,r.exports.pipeline=e.pipeline,r.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get(){return t}}),r.exports.Stream=e.Stream,r.exports.default=r.exports}(Jn)),Jn.exports}var Tu=Kc();const wi=Symbol("iter");function Br(r,e,t=4){if(t===0)return Object.assign(r,e);for(const n in e)r[n]=Br(r[n]||Object.create(null),e[n],t-1);return r}function Au(r,e,t=4){let n=!1;for(const i in r)if(i in e){const s=t===0?null:Au(r[i],e[i],t-1);if(s!==!1)n=n||Object.create(null),n[i]=s;else if(t===3)return!1}return n}function Lu(r,e,t=4){let n=!1;for(const i in r)if(!(i in e))n=n||Object.create(null),n[i]=t===0?null:Br({},r[i],t-1);else if(t!==0){const s=Lu(r[i],e[i],t-1);if(s!==!1)n=n||Object.create(null),n[i]=s;else if(t===3)return!1}return n}class Yc{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||Se}_termFromId(e){if(e[0]==="."){const t=this._entities,n=e.split(".");return this._factory.quad(this._termFromId(t[n[1]]),this._termFromId(t[n[2]]),this._termFromId(t[n[3]]),n[4]&&this._termFromId(t[n[4]]))}return Dr(e,this._factory)}_termToNumericId(e){if(e.termType==="Quad"){const t=this._termToNumericId(e.subject),n=this._termToNumericId(e.predicate),i=this._termToNumericId(e.object);let s;return t&&n&&i&&(Os(e.graph)||(s=this._termToNumericId(e.graph)))&&this._ids[s?`.${t}.${n}.${i}.${s}`:`.${t}.${n}.${i}`]}return this._ids[er(e)]}_termToNewNumericId(e){const t=e&&e.termType==="Quad"?`.${this._termToNewNumericId(e.subject)}.${this._termToNewNumericId(e.predicate)}.${this._termToNewNumericId(e.object)}${Os(e.graph)?"":`.${this._termToNewNumericId(e.graph)}`}`:er(e);return this._ids[t]||(this._ids[this._entities[++this._id]=t]=this._id)}createBlankNode(e){let t,n;if(e)for(t=e=`_:${e}`,n=1;this._ids[t];)t=e+n++;else do t=`_:b${this._blankNodeIndex++}`;while(this._ids[t]);return this._ids[t]=++this._id,this._entities[this._id]=t,this._factory.blankNode(t.substr(2))}}class Ue{constructor(e,t){this._size=0,this._graphs=Object.create(null),!t&&e&&!e[0]&&typeof e.match!="function"&&(t=e,e=null),t=t||{},this._factory=t.factory||Se,this._entityIndex=t.entityIndex||new Yc({factory:this._factory}),this._entities=this._entityIndex._entities,this._termFromId=this._entityIndex._termFromId.bind(this._entityIndex),this._termToNumericId=this._entityIndex._termToNumericId.bind(this._entityIndex),this._termToNewNumericId=this._entityIndex._termToNewNumericId.bind(this._entityIndex),e&&this.addAll(e)}get size(){let e=this._size;if(e!==null)return e;e=0;const t=this._graphs;let n,i;for(const s in t)for(const a in n=t[s].subjects)for(const o in i=n[a])e+=Object.keys(i[o]).length;return this._size=e}_addToIndex(e,t,n,i){const s=e[t]||(e[t]={}),a=s[n]||(s[n]={}),o=i in a;return o||(a[i]=null),!o}_removeFromIndex(e,t,n,i){const s=e[t],a=s[n];delete a[i];for(const o in a)return;delete s[n];for(const o in s)return;delete e[t]}*_findInIndex(e,t,n,i,s,a,o,l){let u,h,y;const b=this._entities,g=this._termFromId(b[l]),m={subject:null,predicate:null,object:null};t&&((u=e,e={})[t]=u[t]);for(const _ in e)if(h=e[_]){m[s]=this._termFromId(b[_]),n&&((u=h,h={})[n]=u[n]);for(const x in h)if(y=h[x]){m[a]=this._termFromId(b[x]);const S=i?i in y?[i]:[]:Object.keys(y);for(let I=0;I<S.length;I++)m[o]=this._termFromId(b[S[I]]),yield this._factory.quad(m.subject,m.predicate,m.object,g)}}}_loop(e,t){for(const n in e)t(n)}_loopByKey0(e,t,n){let i,s;if(i=e[t])for(s in i)n(s)}_loopByKey1(e,t,n){let i,s;for(i in e)s=e[i],s[t]&&n(i)}_loopBy2Keys(e,t,n,i){let s,a,o;if((s=e[t])&&(a=s[n]))for(o in a)i(o)}_countInIndex(e,t,n,i){let s=0,a,o,l;t&&((a=e,e={})[t]=a[t]);for(const u in e)if(o=e[u]){n&&((a=o,o={})[n]=a[n]);for(const h in o)(l=o[h])&&(i?i in l&&s++:s+=Object.keys(l).length)}return s}_getGraphs(e){return e=e===""?1:e&&(this._termToNumericId(e)||-1),typeof e!="number"?this._graphs:{[e]:this._graphs[e]}}_uniqueEntities(e){const t=Object.create(null);return n=>{n in t||(t[n]=!0,e(this._termFromId(this._entities[n],this._factory)))}}add(e){return this.addQuad(e),this}addQuad(e,t,n,i){t||(i=e.graph,n=e.object,t=e.predicate,e=e.subject),i=i?this._termToNewNumericId(i):1;let s=this._graphs[i];return s||(s=this._graphs[i]={subjects:{},predicates:{},objects:{}},Object.freeze(s)),e=this._termToNewNumericId(e),t=this._termToNewNumericId(t),n=this._termToNewNumericId(n),this._addToIndex(s.subjects,e,t,n)?(this._addToIndex(s.predicates,t,n,e),this._addToIndex(s.objects,n,e,t),this._size=null,!0):!1}addQuads(e){for(let t=0;t<e.length;t++)this.addQuad(e[t])}delete(e){return this.removeQuad(e),this}has(e,t,n,i){return e&&e.subject&&({subject:e,predicate:t,object:n,graph:i}=e),!this.readQuads(e,t,n,i).next().done}import(e){return e.on("data",t=>{this.addQuad(t)}),e}removeQuad(e,t,n,i){t||({subject:e,predicate:t,object:n,graph:i}=e),i=i?this._termToNumericId(i):1;const s=this._graphs;let a,o,l;if(!(e=e&&this._termToNumericId(e))||!(t=t&&this._termToNumericId(t))||!(n=n&&this._termToNumericId(n))||!(a=s[i])||!(o=a.subjects[e])||!(l=o[t])||!(n in l))return!1;this._removeFromIndex(a.subjects,e,t,n),this._removeFromIndex(a.predicates,t,n,e),this._removeFromIndex(a.objects,n,e,t),this._size!==null&&this._size--;for(e in a.subjects)return!0;return delete s[i],!0}removeQuads(e){for(let t=0;t<e.length;t++)this.removeQuad(e[t])}remove(e){return e.on("data",t=>{this.removeQuad(t)}),e}removeMatches(e,t,n,i){const s=new Tu.Readable({objectMode:!0}),a=this.readQuads(e,t,n,i);return s._read=o=>{for(;--o>=0;){const{done:l,value:u}=a.next();if(l){s.push(null);return}s.push(u)}},this.remove(s)}deleteGraph(e){return this.removeMatches(null,null,null,e)}getQuads(e,t,n,i){return[...this.readQuads(e,t,n,i)]}*readQuads(e,t,n,i){const s=this._getGraphs(i);let a,o,l,u;if(!(e&&!(o=this._termToNumericId(e))||t&&!(l=this._termToNumericId(t))||n&&!(u=this._termToNumericId(n))))for(const h in s)(a=s[h])&&(o?u?yield*this._findInIndex(a.objects,u,o,l,"object","subject","predicate",h):yield*this._findInIndex(a.subjects,o,l,null,"subject","predicate","object",h):l?yield*this._findInIndex(a.predicates,l,u,null,"predicate","object","subject",h):u?yield*this._findInIndex(a.objects,u,null,null,"object","subject","predicate",h):yield*this._findInIndex(a.subjects,null,null,null,"subject","predicate","object",h))}match(e,t,n,i){return new St(this,e,t,n,i,{entityIndex:this._entityIndex})}countQuads(e,t,n,i){const s=this._getGraphs(i);let a=0,o,l,u,h;if(e&&!(l=this._termToNumericId(e))||t&&!(u=this._termToNumericId(t))||n&&!(h=this._termToNumericId(n)))return 0;for(const y in s)(o=s[y])&&(e?n?a+=this._countInIndex(o.objects,h,l,u):a+=this._countInIndex(o.subjects,l,u,h):t?a+=this._countInIndex(o.predicates,u,h,l):a+=this._countInIndex(o.objects,h,l,u));return a}forEach(e,t,n,i,s){this.some(a=>(e(a,this),!1),t,n,i,s)}every(e,t,n,i,s){return!this.some(a=>!e(a,this),t,n,i,s)}some(e,t,n,i,s){for(const a of this.readQuads(t,n,i,s))if(e(a,this))return!0;return!1}getSubjects(e,t,n){const i=[];return this.forSubjects(s=>{i.push(s)},e,t,n),i}forSubjects(e,t,n,i){const s=this._getGraphs(i);let a,o,l;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(i in s)(a=s[i])&&(o?l?this._loopBy2Keys(a.predicates,o,l,e):this._loopByKey1(a.subjects,o,e):l?this._loopByKey0(a.objects,l,e):this._loop(a.subjects,e))}getPredicates(e,t,n){const i=[];return this.forPredicates(s=>{i.push(s)},e,t,n),i}forPredicates(e,t,n,i){const s=this._getGraphs(i);let a,o,l;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(i in s)(a=s[i])&&(o?l?this._loopBy2Keys(a.objects,l,o,e):this._loopByKey0(a.subjects,o,e):l?this._loopByKey1(a.predicates,l,e):this._loop(a.predicates,e))}getObjects(e,t,n){const i=[];return this.forObjects(s=>{i.push(s)},e,t,n),i}forObjects(e,t,n,i){const s=this._getGraphs(i);let a,o,l;if(e=this._uniqueEntities(e),!(t&&!(o=this._termToNumericId(t))||n&&!(l=this._termToNumericId(n))))for(i in s)(a=s[i])&&(o?l?this._loopBy2Keys(a.subjects,o,l,e):this._loopByKey1(a.objects,o,e):l?this._loopByKey0(a.predicates,l,e):this._loop(a.objects,e))}getGraphs(e,t,n){const i=[];return this.forGraphs(s=>{i.push(s)},e,t,n),i}forGraphs(e,t,n,i){for(const s in this._graphs)this.some(a=>(e(a.graph),!0),t,n,i,this._termFromId(this._entities[s]))}createBlankNode(e){return this._entityIndex.createBlankNode(e)}extractLists({remove:e=!1,ignoreErrors:t=!1}={}){const n={},i=t?()=>!0:(o,l)=>{throw new Error(`${o.value} ${l}`)},s=this.getQuads(null,Ce.rdf.rest,Ce.rdf.nil,null),a=e?[...s]:[];return s.forEach(o=>{const l=[];let u=!1,h,y;const b=o.graph;let g=o.subject;for(;g&&!u;){const m=this.getQuads(null,null,g,null),_=this.getQuads(g,null,null,null);let x,S=null,I=null,w=null;for(let d=0;d<_.length&&!u;d++)x=_[d],x.graph.equals(b)?h?u=i(g,"has non-list arcs out"):x.predicate.value===Ce.rdf.first?S?u=i(g,"has multiple rdf:first arcs"):a.push(S=x):x.predicate.value===Ce.rdf.rest?I?u=i(g,"has multiple rdf:rest arcs"):a.push(I=x):m.length?u=i(g,"can't be subject and object"):(h=x,y="subject"):u=i(g,"not confined to single graph");for(let d=0;d<m.length&&!u;++d)x=m[d],h?u=i(g,"can't have coreferences"):x.predicate.value===Ce.rdf.rest?w?u=i(g,"has incoming rdf:rest arcs"):w=x:(h=x,y="object");S?l.unshift(S.object):u=i(g,"has no list head"),g=w&&w.subject}u?e=!1:h&&(n[h[y].value]=l)}),e&&this.removeQuads(a),n}addAll(e){if(e instanceof St&&(e=e.filtered),Array.isArray(e))this.addQuads(e);else if(e instanceof Ue&&e._entityIndex===this._entityIndex)e._size!==0&&(this._graphs=Br(this._graphs,e._graphs),this._size=null);else for(const t of e)this.add(t);return this}contains(e){if(e instanceof St&&(e=e.filtered),e===this)return!0;if(!(e instanceof Ue)||this._entityIndex!==e._entityIndex)return e.every(u=>this.has(u));const t=this._graphs,n=e._graphs;let i,s,a,o,l;for(const u in n){if(!(i=t[u]))return!1;i=i.subjects;for(const h in s=n[u].subjects){if(!(a=i[h]))return!1;for(const y in o=s[h]){if(!(l=a[y]))return!1;for(const b in o[y])if(!(b in l))return!1}}}return!0}deleteMatches(e,t,n,i){for(const s of this.match(e,t,n,i))this.removeQuad(s);return this}difference(e){if(e&&e instanceof St&&(e=e.filtered),e===this)return new Ue({entityIndex:this._entityIndex});if(e instanceof Ue&&e._entityIndex===this._entityIndex){const t=new Ue({entityIndex:this._entityIndex}),n=Lu(this._graphs,e._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter(t=>!e.has(t))}equals(e){return e instanceof St&&(e=e.filtered),e===this||this.size===e.size&&this.contains(e)}filter(e){const t=new Ue({entityIndex:this._entityIndex});for(const n of this)e(n,this)&&t.add(n);return t}intersection(e){if(e instanceof St&&(e=e.filtered),e===this){const t=new Ue({entityIndex:this._entityIndex});return t._graphs=Br(Object.create(null),this._graphs),t._size=this._size,t}else if(e instanceof Ue&&this._entityIndex===e._entityIndex){const t=new Ue({entityIndex:this._entityIndex}),n=Au(e._graphs,this._graphs);return n&&(t._graphs=n,t._size=null),t}return this.filter(t=>e.has(t))}map(e){const t=new Ue({entityIndex:this._entityIndex});for(const n of this)t.add(e(n,this));return t}reduce(e,t){const n=this.readQuads();let i=t===void 0?n.next().value:t;for(const s of n)i=e(i,s,this);return i}toArray(){return this.getQuads()}toCanonical(){throw new Error("not implemented")}toStream(){return this.match()}toString(){return new zs().quadsToString(this)}union(e){const t=new Ue({entityIndex:this._entityIndex});return t._graphs=Br(Object.create(null),this._graphs),t._size=this._size,t.addAll(e),t}*[Symbol.iterator](){yield*this.readQuads()}}function at(r,e,t=0){const n=e[t];if(n&&!(n in r))return!1;let i=!1;for(const s in n?{[n]:r[n]}:r){const a=t===2?null:at(r[s],e,t+1);a!==!1&&(i=i||Object.create(null),i[s]=a)}return i}class St extends Tu.Readable{constructor(e,t,n,i,s,a){super({objectMode:!0}),Object.assign(this,{n3Store:e,subject:t,predicate:n,object:i,graph:s,options:a})}get filtered(){if(!this._filtered){const{n3Store:e,graph:t,object:n,predicate:i,subject:s}=this,a=this._filtered=new Ue({factory:e._factory,entityIndex:this.options.entityIndex});let o,l,u;if(s&&!(o=a._termToNumericId(s))||i&&!(l=a._termToNumericId(i))||n&&!(u=a._termToNumericId(n)))return a;const h=e._getGraphs(t);for(const y in h){let b,g,m,_;(_=h[y])&&(!o&&l?(g=at(_.predicates,[l,u,o]))&&(b=at(_.subjects,[o,l,u]),m=at(_.objects,[u,o,l])):u?(m=at(_.objects,[u,o,l]))&&(b=at(_.subjects,[o,l,u]),g=at(_.predicates,[l,u,o])):(b=at(_.subjects,[o,l,u]))&&(g=at(_.predicates,[l,u,o]),m=at(_.objects,[u,o,l])),b&&(a._graphs[y]={subjects:b,predicates:g,objects:m}))}a._size=null}return this._filtered}get size(){return this.filtered.size}_read(e){e>0&&!this[wi]&&(this[wi]=this[Symbol.iterator]());const t=this[wi];for(;--e>=0;){const{done:n,value:i}=t.next();if(n){this.push(null);return}this.push(i)}}addAll(e){return this.filtered.addAll(e)}contains(e){return this.filtered.contains(e)}deleteMatches(e,t,n,i){return this.filtered.deleteMatches(e,t,n,i)}difference(e){return this.filtered.difference(e)}equals(e){return this.filtered.equals(e)}every(e,t,n,i,s){return this.filtered.every(e,t,n,i,s)}filter(e){return this.filtered.filter(e)}forEach(e,t,n,i,s){return this.filtered.forEach(e,t,n,i,s)}import(e){return this.filtered.import(e)}intersection(e){return this.filtered.intersection(e)}map(e){return this.filtered.map(e)}some(e,t,n,i,s){return this.filtered.some(e,t,n,i,s)}toCanonical(){return this.filtered.toCanonical()}toStream(){return this._filtered?this._filtered.toStream():this.n3Store.match(this.subject,this.predicate,this.object,this.graph)}union(e){return this._filtered?this._filtered.union(e):this.n3Store.match(this.subject,this.predicate,this.object,this.graph).addAll(e)}toArray(){return this._filtered?this._filtered.toArray():this.n3Store.getQuads(this.subject,this.predicate,this.object,this.graph)}reduce(e,t){return this.filtered.reduce(e,t)}toString(){return new zs().quadsToString(this)}add(e){return this.filtered.add(e)}delete(e){return this.filtered.delete(e)}has(e){return this.filtered.has(e)}match(e,t,n,i){return new St(this.filtered,e,t,n,i,this.options)}*[Symbol.iterator](){yield*this._filtered||this.n3Store.readQuads(this.subject,this.predicate,this.object,this.graph)}}const be="http://www.w3.org/ns/shacl#",go="http://datashapes.org/dash#",Ct="http://www.w3.org/2001/XMLSchema#",Ks="http://www.w3.org/1999/02/22-rdf-syntax-ns#",Ys="http://www.w3.org/2000/01/rdf-schema#",ju="http://www.w3.org/2004/02/skos/core#",Ou="http://www.w3.org/2002/07/owl#",Zc="http://www.w3.org/ns/oa#",ed="http://purl.org/dc/terms/",td="http://xmlns.com/foaf/0.1/",_n=Se.namedNode("loaded-shapes"),ot=Se.namedNode("loaded-data"),qe=Se.namedNode(Ks+"type"),$s=Se.namedNode(ed+"conformsTo"),rd=Se.namedNode(Ys+"subClassOf"),nd=Se.namedNode(ju+"broader"),Zs=Se.namedNode(Ou+"imports"),id=Se.namedNode(Ou+"NamedIndividual"),cn=Se.namedNode(be+"NodeShape"),sd=Se.namedNode(be+"IRI"),xn=Se.namedNode(be+"property"),ea=Se.namedNode(be+"class"),zr=Se.namedNode(be+"targetClass"),ad=Se.namedNode(be+"nodeKind");function Fr(r,e,t=be,n){let i="";const s=od(r,e,t,n);return s&&(i=s.value),i}function od(r,e,t=be,n){let i;const s=t+e;if(n!=null&&n.length){for(const a of n)for(const o of r)if(o.predicate.value===s){if(o.object.id.endsWith(`@${a}`))return o.object;o.object.id.indexOf("@")<0?i=o.object:i||(i=o.object)}}else for(const a of r)if(a.predicate.value===s)return a.object;return i}function ld(r){var e;(e=r.querySelector("input,select,textarea"))==null||e.focus()}function kn(r,e){return Fr(r,"prefLabel",ju,e)||Fr(r,"label",Ys,e)||Fr(r,"name",td,e)}function ks(r,e,t,n){const i=[];for(const s of r)i.push({value:s,label:kn(e.getQuads(s,null,null,null),t),indent:n});return i}function Ds(r,e){for(const t in e)r=r.replace(e[t],"");return r}function $u(r,e,t,n,i=new Set){for(const s of e.owlImports)i.has(s.id)||(i.add(s.id),n.push(...t.getSubjects(qe,r,s)));e.parent&&$u(r,e.parent,t,n,i)}function Sn(r,e,t=0){let n;if(e.shaclIn){const s=e.config.lists[e.shaclIn];n=s!=null&&s.length?s:[]}else n=e.config.store.getSubjects(qe,r,_n),n.push(...e.config.store.getSubjects(qe,r,ot)),$u(r,e,e.config.store,n);const i=ks(n,e.config.store,e.config.languages,t);if(e.shaclIn===void 0){for(const s of e.config.store.getSubjects(rd,r,null))i.push(...Sn(s,e,t+1));if(e.config.store.getQuads(r,qe,id,null).length>0){i.push(...ks([r],e.config.store,e.config.languages,t));for(const s of e.config.store.getSubjects(nd,r,null))i.push(...Sn(s,e,t+1))}}return i}function Ms(r){let e;try{e=new URL(r)}catch{return!1}return e.protocol==="http:"||e.protocol==="https:"}function yo(r,e,t){if(e===void 0)return t;if(t===void 0)return e;const n=r.indexOf(e.language);if(n<0)return t;const i=r.indexOf(t.language);return i<0||i>n?e:t}function ku(r,e,t){const n=document.createElement("div");n.classList.add("shacl-or-constraint");const i=[];if(i.push({label:"--- please choose ---",value:""}),e instanceof Nt){const s=[];let a=!1;r.length&&(a=t.store.countQuads(r[0],xn,null,null)>0);for(let u=0;u<r.length;u++)if(a){const h=t.store.getObjects(r[u],xn,null),y=[];let b="";for(const g of h){const m=new Rn(g,e,t);y.push(m),b+=(b.length>1?" / ":"")+m.template.label}s.push(y),i.push({label:b,value:u.toString()})}else{const h=new Rn(r[u],e,t);s.push([h]),i.push({label:h.template.label,value:u.toString()})}const o=t.theme.createListEditor("Please choose",null,!1,i),l=o.querySelector(".editor");l.onchange=()=>{if(l.value){const u=s[parseInt(l.value)];let h;u.length&&(h=u[0],n.replaceWith(u[0]));for(let y=1;y<u.length;y++)h.after(u[y]),h=u[y]}},n.appendChild(o)}else{const s=[];for(let l=0;l<r.length;l++){const u=t.store.getQuads(r[l],null,null,null);u.length&&(s.push(u),i.push({label:kn(u,t.languages)||Ds(u[0].predicate.value,t.prefixes)+" = "+Ds(u[0].object.value,t.prefixes),value:l.toString()}))}const a=t.theme.createListEditor(e.template.label+"?",null,!1,i,e.template),o=a.querySelector(".editor");o.onchange=()=>{o.value&&n.replaceWith(mn(e.template.clone().merge(s[parseInt(o.value)]),void 0,!0))},n.appendChild(a)}return n}function ud(r,e,t){if(e instanceof lt){const n=e.datatype;for(const i of r){const s=t.store.getQuads(i,null,null,null);for(const a of s)if(a.predicate.value===`${be}datatype`&&a.object.equals(n))return s}}else{const n=t.store.getObjects(e,qe,null);for(const i of r){const s=t.store.getQuads(i,null,null,null);for(const a of s)if(n.length>0){if(a.predicate.value===`${be}node`){for(const o of n)if(t.store.getQuads(a.object,zr,o,null).length>0)return s}if(a.predicate.equals(ea)){for(const o of n)if(a.object.equals(o))return s}}else if(a.predicate.equals(ad)&&a.object.equals(sd))return s}}return console.error("couldn't resolve sh:or/sh:xone on property for value",e),[]}function cd(r,e,t){for(const n of r){let i=!1;const s=t.store.getObjects(n,xn,null);for(const a of s){const o=t.store.getObjects(a,`${be}path`,null);for(const l of o)if(i=t.store.countQuads(e,l,null,null)>0,i)break}if(i)return s}return console.error("couldn't resolve sh:or/sh:xone on node for value",e),[]}const dd={[`${be}name`]:(r,e)=>{const t=e;r.name=yo(r.config.languages,r.name,t)},[`${be}description`]:(r,e)=>{const t=e;r.description=yo(r.config.languages,r.description,t)},[`${be}path`]:(r,e)=>{r.path=e.value},[`${be}node`]:(r,e)=>{r.node=e},[`${be}datatype`]:(r,e)=>{r.datatype=e},[`${be}nodeKind`]:(r,e)=>{r.nodeKind=e},[`${be}minCount`]:(r,e)=>{r.minCount=parseInt(e.value)},[`${be}maxCount`]:(r,e)=>{r.maxCount=parseInt(e.value)},[`${be}minLength`]:(r,e)=>{r.minLength=parseInt(e.value)},[`${be}maxLength`]:(r,e)=>{r.maxLength=parseInt(e.value)},[`${be}minInclusive`]:(r,e)=>{r.minInclusive=parseInt(e.value)},[`${be}maxInclusive`]:(r,e)=>{r.maxInclusive=parseInt(e.value)},[`${be}minExclusive`]:(r,e)=>{r.minExclusive=parseInt(e.value)},[`${be}maxExclusive`]:(r,e)=>{r.maxExclusive=parseInt(e.value)},[`${be}pattern`]:(r,e)=>{r.pattern=e.value},[`${be}order`]:(r,e)=>{r.order=parseInt(e.value)},[`${go}singleLine`]:(r,e)=>{r.singleLine=e.value==="true"},[`${go}readonly`]:(r,e)=>{r.readonly=e.value==="true"},[`${Zc}styleClass`]:(r,e)=>{r.cssClass=e.value},[`${be}and`]:(r,e)=>{r.shaclAnd=e.value},[`${be}in`]:(r,e)=>{r.shaclIn=e.value},[`${be}languageIn`]:(r,e)=>{r.languageIn=r.config.lists[e.value],r.datatype=Se.namedNode(Ks+"langString")},[`${be}defaultValue`]:(r,e)=>{r.defaultValue=e},[`${be}hasValue`]:(r,e)=>{r.hasValue=e},[`${be}qualifiedValueShape`]:(r,e)=>{r.qualifiedValueShape=e},[`${be}qualifiedMinCount`]:(r,e)=>{r.minCount=parseInt(e.value)},[`${be}qualifiedMaxCount`]:(r,e)=>{r.maxCount=parseInt(e.value)},[Zs.id]:(r,e)=>{r.owlImports.push(e)},[ea.id]:(r,e)=>{r.class=e;const t=r.config.store.getSubjects(zr,e,null);t.length>0&&(r.node=t[0])},[`${be}or`]:(r,e)=>{const t=r.config.lists[e.value];t!=null&&t.length?r.shaclOr=t:console.error("list for sh:or not found:",e.value,"existing lists:",r.config.lists)},[`${be}xone`]:(r,e)=>{const t=r.config.lists[e.value];t!=null&&t.length?r.shaclXone=t:console.error("list for sh:xone not found:",e.value,"existing lists:",r.config.lists)}};class fd{constructor(e,t,n){this.label="",this.owlImports=[],this.extendedShapes=[],this.parent=t,this.config=n,this.merge(e),this.qualifiedValueShape&&this.merge(n.store.getQuads(this.qualifiedValueShape,null,null,null))}merge(e){var t,n;for(const i of e)(t=dd[i.predicate.id])==null||t.call(this,this,i.object);if(this.label=((n=this.name)==null?void 0:n.value)||kn(e,this.config.languages),!this.label&&!this.shaclAnd&&(this.label=this.path?Ds(this.path,this.config.prefixes):"unknown"),(this.node||this.shaclAnd)&&(this.node&&this.extendedShapes.push(this.node),this.shaclAnd)){const i=this.config.lists[this.shaclAnd];if(i!=null&&i.length)for(const s of i)this.extendedShapes.push(s)}return this}clone(){const e=Object.assign({},this);return e.owlImports=[...this.owlImports],this.languageIn&&(e.languageIn=[...this.languageIn]),this.shaclOr&&(e.shaclOr=[...this.shaclOr]),this.shaclXone&&(e.shaclXone=[...this.shaclXone]),e.merge=this.merge.bind(e),e.clone=this.clone.bind(e),e}}const hd=`form { box-sizing: border-box; display:block; --label-width: 8em; --caret-size: 10px; }
|
|
28
|
+
form.mode-edit { padding-left: 1em; }
|
|
29
|
+
form *, form ::after, form ::before { box-sizing: inherit; }
|
|
30
|
+
shacl-node, .shacl-group { display: flex; flex-direction: column; width: 100%; position: relative; }
|
|
31
|
+
shacl-node .remove-button { margin-left: 4px; margin-top: 1px; }
|
|
32
|
+
shacl-node .add-button { color: #555; background-color: transparent; margin: 4px 24px 0 0; border: 0; }
|
|
33
|
+
shacl-node .add-button:hover { color:#222; }
|
|
34
|
+
shacl-node .add-button:focus { box-shadow: none; }
|
|
35
|
+
shacl-node h1 { font-size: 1.1rem; border-bottom: 1px solid; margin-top: 4px; color: #555; }
|
|
36
|
+
shacl-property { display: flex; flex-direction: column; align-items: end; position: relative; }
|
|
37
|
+
shacl-property:not(.may-add) > .add-button { display: none; }
|
|
38
|
+
shacl-property:not(.may-remove) > .property-instance > .remove-button:not(.persistent) { visibility: hidden; }
|
|
39
|
+
shacl-property:not(.may-remove) > .shacl-or-constraint > .remove-button:not(.persistent) { visibility: hidden; }
|
|
40
|
+
.mode-view .shacl-group:not(:has(shacl-property)) { display: none; }
|
|
41
|
+
.property-instance, .shacl-or-constraint { display: flex; align-items: flex-start; padding: 4px 0; width: 100%; position: relative; }
|
|
42
|
+
.shacl-or-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; }
|
|
43
|
+
.property-instance label[title] { cursor: help; text-decoration: underline dashed #AAA; }
|
|
44
|
+
.property-instance.linked label:after, label.linked:after { content: '\\1F517'; font-size: 0.6em; padding-left: 6px; }
|
|
45
|
+
.mode-edit .property-instance label.required::before { color: red; content: '\\2736'; font-size: 0.6rem; position: absolute; left: -1.4em; top: 0.15rem; }
|
|
46
|
+
.property-instance.valid::before { position: absolute; left: calc(var(--label-width) - 1em); top: 3px; color: green; content: '\\2713'; }
|
|
47
|
+
.editor:not([type='checkbox']), .shacl-or-constraint select { flex-grow: 1; }
|
|
48
|
+
.shacl-or-constraint select { border: 1px solid #DDD; padding: 2px 4px; }
|
|
49
|
+
select { overflow: hidden; text-overflow: ellipsis; }
|
|
50
|
+
textarea.editor { resize: vertical; }
|
|
51
|
+
.lang-chooser { position: absolute; top: 6px; right: 26px; border: 0; background-color: #e9e9ed; padding: 2px 4px; max-width: 40px; width: 40px; box-sizing: content-box; }
|
|
52
|
+
.lang-chooser+.editor { padding-right: 55px; }
|
|
53
|
+
.validation-error { position: absolute; left: calc(var(--label-width) - 1em); top: 3px; color: red; cursor: help; }
|
|
54
|
+
.validation-error::before { content: '\\26a0' }
|
|
55
|
+
.validation-error.node { left: -1em; }
|
|
56
|
+
.invalid > .editor { border-color: red !important; }
|
|
57
|
+
.ml-0 { margin-left: 0 !important; }
|
|
58
|
+
.pr-0 { padding-right: 0 !important; }
|
|
59
|
+
.mode-view .property-instance:not(:first-child) > label { visibility: hidden; }
|
|
60
|
+
.mode-view .property-instance label { width: var(--label-width); }
|
|
61
|
+
|
|
62
|
+
.d-flex { display: flex; }
|
|
63
|
+
.lang { opacity: 0.65; font-size: 0.6em; }
|
|
64
|
+
a, a:visited { color: inherit; }
|
|
65
|
+
|
|
66
|
+
.fadeIn, .fadeOut { animation: fadeIn 0.2s ease-out; }
|
|
67
|
+
.fadeOut { animation-direction: reverse; animation-timing-function: ease-out;}
|
|
68
|
+
@keyframes fadeIn {
|
|
69
|
+
0% { opacity: 0; transform: scaleY(0.8); }
|
|
70
|
+
100% { opacity: 1; transform: scaleY(1); }
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.collapsible > .activator { display: flex; justify-content: space-between; align-items: center; cursor: pointer; width: 100%; border: 0; padding: 8px 0; transition: 0.2s; }
|
|
74
|
+
.collapsible > .activator:hover, .collapsible.open > .activator { background-color: #F5F5F5; }
|
|
75
|
+
.collapsible > .activator::after { content:''; width: var(--caret-size); height: var(--caret-size); border-style: none solid solid none; border-width: calc(0.3 * var(--caret-size)); transform: rotate(45deg); transition: transform .15s ease-out; margin-right: calc(0.5 * var(--caret-size)); }
|
|
76
|
+
.collapsible.open > .activator::after { transform: rotate(225deg); }
|
|
77
|
+
.collapsible > *:not(.activator) { transition: all 0.2s ease-out; opacity: 1; }
|
|
78
|
+
.collapsible:not(.open) > *:not(.activator) { max-height: 0; padding: 0; opacity: 0; overflow: hidden; }
|
|
79
|
+
.collapsible > .property-instance > shacl-node > h1 { display: none; }
|
|
80
|
+
.collapsible.open > .property-instance:nth-child(odd) { background-color: #F5F5F5; }
|
|
81
|
+
.ref-link { cursor: pointer; }
|
|
82
|
+
.ref-link:hover { text-decoration: underline; }
|
|
83
|
+
.node-id-display { color: #999; font-size: 11px; }`;class pd{constructor(e){let t=hd;e&&(t+=`
|
|
84
|
+
`+e),this.stylesheet=new CSSStyleSheet,this.stylesheet.replaceSync(t)}apply(e){}createViewer(e,t,n){const i=document.createElement("div"),s=document.createElement("label");s.innerHTML=e+":",n.description&&s.setAttribute("title",n.description.value),i.appendChild(s);let a=t.value,o=null;if(t instanceof Gs){const u=n.config.store.getQuads(a,null,null,null);if(u.length){const h=kn(u,n.config.languages);h&&(a=h)}}else t instanceof lt&&(t.language?(o=document.createElement("span"),o.classList.add("lang"),o.innerText=`@${t.language}`):t.datatype.value===`${Ct}date`?a=new Date(Date.parse(t.value)).toDateString():t.datatype.value===`${Ct}dateTime`&&(a=new Date(Date.parse(t.value)).toLocaleString()));let l;return Ms(t.value)?(l=document.createElement("a"),l.setAttribute("href",t.value)):l=document.createElement("div"),l.classList.add("d-flex"),l.innerText=a,o&&l.appendChild(o),i.appendChild(l),i}}function gd(r,e,t){var n,i,s;if(t){const a=r.minCount!==void 0&&r.minCount>0;if(r.class)return r.config.theme.createListEditor(r.label,e,a,Sn(r.class,r),r);if(r.shaclIn){const o=r.config.lists[r.shaclIn];if(o!=null&&o.length){const l=ks(o,r.config.store,r.config.languages);return r.config.theme.createListEditor(r.label,e,a,l,r)}else console.error("list not found:",r.shaclIn,"existing lists:",r.config.lists)}if(((n=r.datatype)==null?void 0:n.value)===`${Ks}langString`||(i=r.languageIn)!=null&&i.length)return r.config.theme.createLangStringEditor(r.label,e,a,r);switch((s=r.datatype)==null?void 0:s.value.replace(Ct,"")){case"integer":case"float":case"double":case"decimal":return r.config.theme.createNumberEditor(r.label,e,a,r);case"date":case"dateTime":return r.config.theme.createDateEditor(r.label,e,a,r);case"boolean":return r.config.theme.createBooleanEditor(r.label,e,a,r);case"base64Binary":return r.config.theme.createFileEditor(r.label,e,a,r)}return r.config.theme.createTextEditor(r.label,e,a,r)}else{if(e)return r.config.theme.createViewer(r.label,e,r);const a=document.createElement("div");return a.innerHTML="No value",a}}function yd(r,e,t){if(e==="application/ld+json")return md(r);{const n=new zs({format:e,prefixes:t});n.addQuads(r);let i="";return n.end((s,a)=>{s&&console.error(s),i=a}),i}}function md(r){const e=[];for(const t of r){const n={"@id":t.subject.id};if(t.predicate===qe)n["@type"]=t.object.id;else{let i=t.object.value;t.object instanceof lt?t.object.language?i={"@language":t.object.language,"@value":t.object.value}:t.object.datatype&&t.object.datatype.value!==`${Ct}#string`&&(i={"@type":t.object.datatype.value,"@value":t.object.value}):i={"@id":t.object.id},n[t.predicate.value]=i}e.push(n)}return JSON.stringify(e)}function bd(r){let e=r.shaclDatatype,t=r.value;if(t){if(r.dataset.class||r.dataset.nodeKind===be+"IRI")return Se.namedNode(t);if(r.dataset.link)return JSON.parse(r.dataset.link);if(r.dataset.lang?e=r.dataset.lang:r.type==="number"?t=parseFloat(t):r.type==="file"&&r.binaryData?t=r.binaryData:r.type==="datetime-local"&&(t=new Date(t).toISOString().slice(0,19)),!e&&typeof t=="string"){const n=t.split("^^");n.length===2&&(n[0].startsWith('"')&&n[0].endsWith('"')||n[0].startsWith("'")&&n[0].endsWith("'"))&&n[1].split(":").length===2&&(t=n[0].substring(1,n[0].length-1),e=Se.namedNode(n[1]))}return Se.literal(t,e)}else if((r.type==="checkbox"||r.getAttribute("type")==="checkbox")&&(r.checked||parseInt(r.dataset.minCount||"0")>0))return Se.literal(r.checked?"true":"false",e)}const Ur={};function wd(r){r.predicate===void 0&&r.datatype===void 0?console.warn('not registering plugin because it does neither define "predicate" nor "datatype"',r):Ur[`${r.predicate}^${r.datatype}`]=r}function vd(){return Object.entries(Ur).map(r=>r[1])}function _d(r,e){let t=Ur[`${r}^${e}`];return t||(t=Ur[`${r}^undefined`],t)?t:Ur[`undefined^${e}`]}class wy{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)}}/**
|
|
85
|
+
* @license
|
|
86
|
+
* Copyright 2019 Google LLC
|
|
87
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
88
|
+
*/const pn=globalThis,ta=pn.ShadowRoot&&(pn.ShadyCSS===void 0||pn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ra=Symbol(),mo=new WeakMap;let Du=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==ra)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(ta&&e===void 0){const n=t!==void 0&&t.length===1;n&&(e=mo.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&mo.set(t,e))}return e}toString(){return this.cssText}};const xd=r=>new Du(typeof r=="string"?r:r+"",void 0,ra),vt=(r,...e)=>{const t=r.length===1?r[0]:e.reduce((n,i,s)=>n+(a=>{if(a._$cssResult$===!0)return a.cssText;if(typeof a=="number")return a;throw Error("Value passed to 'css' function must be a 'css' function result: "+a+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+r[s+1],r[0]);return new Du(t,r,ra)},Sd=(r,e)=>{if(ta)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const n=document.createElement("style"),i=pn.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}},bo=ta?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return xd(t)})(r):r;/**
|
|
89
|
+
* @license
|
|
90
|
+
* Copyright 2017 Google LLC
|
|
91
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
92
|
+
*/const{is:Ed,defineProperty:Id,getOwnPropertyDescriptor:Rd,getOwnPropertyNames:Nd,getOwnPropertySymbols:Td,getPrototypeOf:Ad}=Object,Rt=globalThis,wo=Rt.trustedTypes,Ld=wo?wo.emptyScript:"",vi=Rt.reactiveElementPolyfillSupport,Hr=(r,e)=>r,Ps={toAttribute(r,e){switch(e){case Boolean:r=r?Ld:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},Mu=(r,e)=>!Ed(r,e),vo={attribute:!0,type:String,converter:Ps,reflect:!1,useDefault:!1,hasChanged:Mu};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Rt.litPropertyMetadata??(Rt.litPropertyMetadata=new WeakMap);let Xt=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=vo){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){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&Id(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:s}=Rd(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){const o=i==null?void 0:i.call(this);s==null||s.call(this,a),this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??vo}static _$Ei(){if(this.hasOwnProperty(Hr("elementProperties")))return;const e=Ad(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Hr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Hr("properties"))){const t=this.properties,n=[...Nd(t),...Td(t)];for(const i of n)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(bo(i))}else e!==void 0&&t.push(bo(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?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(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Sd(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostConnected)==null?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostDisconnected)==null?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){var s;const n=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,n);if(i!==void 0&&n.reflect===!0){const a=(((s=n.converter)==null?void 0:s.toAttribute)!==void 0?n.converter:Ps).toAttribute(t,n.type);this._$Em=e,a==null?this.removeAttribute(i):this.setAttribute(i,a),this._$Em=null}}_$AK(e,t){var s,a;const n=this.constructor,i=n._$Eh.get(e);if(i!==void 0&&this._$Em!==i){const o=n.getPropertyOptions(i),l=typeof o.converter=="function"?{fromAttribute:o.converter}:((s=o.converter)==null?void 0:s.fromAttribute)!==void 0?o.converter:Ps;this._$Em=i,this[i]=l.fromAttribute(t,o.type)??((a=this._$Ej)==null?void 0:a.get(i))??null,this._$Em=null}}requestUpdate(e,t,n){var i;if(e!==void 0){const s=this.constructor,a=this[e];if(n??(n=s.getPropertyOptions(e)),!((n.hasChanged??Mu)(a,t)||n.useDefault&&n.reflect&&a===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(s._$Eu(e,n))))return;this.C(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:i,wrapped:s},a){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,a??t??this[e]),s!==!0||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,a]of this._$Ep)this[s]=a;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,a]of i){const{wrapped:o}=a,l=this[s];o!==!0||this._$AL.has(s)||l===void 0||this.C(s,void 0,a,l)}}let e=!1;const t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(n=this._$EO)==null||n.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(t)):this._$EM()}catch(i){throw e=!1,this._$EM(),i}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),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=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}};Xt.elementStyles=[],Xt.shadowRootOptions={mode:"open"},Xt[Hr("elementProperties")]=new Map,Xt[Hr("finalized")]=new Map,vi==null||vi({ReactiveElement:Xt}),(Rt.reactiveElementVersions??(Rt.reactiveElementVersions=[])).push("2.1.0");/**
|
|
93
|
+
* @license
|
|
94
|
+
* Copyright 2017 Google LLC
|
|
95
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
96
|
+
*/const Vr=globalThis,En=Vr.trustedTypes,_o=En?En.createPolicy("lit-html",{createHTML:r=>r}):void 0,Pu="$lit$",Et=`lit$${Math.random().toFixed(9).slice(2)}$`,Cu="?"+Et,jd=`<${Cu}>`,Ft=document,Jr=()=>Ft.createComment(""),Qr=r=>r===null||typeof r!="object"&&typeof r!="function",na=Array.isArray,Od=r=>na(r)||typeof(r==null?void 0:r[Symbol.iterator])=="function",_i=`[
|
|
97
|
+
\f\r]`,vr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xo=/-->/g,So=/>/g,Ot=RegExp(`>|${_i}(?:([^\\s"'>=/]+)(${_i}*=${_i}*(?:[^
|
|
98
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),Eo=/'/g,Io=/"/g,qu=/^(?:script|style|textarea|title)$/i,$d=r=>(e,...t)=>({_$litType$:r,strings:e,values:t}),ut=$d(1),tr=Symbol.for("lit-noChange"),ke=Symbol.for("lit-nothing"),Ro=new WeakMap,Pt=Ft.createTreeWalker(Ft,129);function Bu(r,e){if(!na(r)||!r.hasOwnProperty("raw"))throw Error("invalid template strings array");return _o!==void 0?_o.createHTML(e):e}const kd=(r,e)=>{const t=r.length-1,n=[];let i,s=e===2?"<svg>":e===3?"<math>":"",a=vr;for(let o=0;o<t;o++){const l=r[o];let u,h,y=-1,b=0;for(;b<l.length&&(a.lastIndex=b,h=a.exec(l),h!==null);)b=a.lastIndex,a===vr?h[1]==="!--"?a=xo:h[1]!==void 0?a=So:h[2]!==void 0?(qu.test(h[2])&&(i=RegExp("</"+h[2],"g")),a=Ot):h[3]!==void 0&&(a=Ot):a===Ot?h[0]===">"?(a=i??vr,y=-1):h[1]===void 0?y=-2:(y=a.lastIndex-h[2].length,u=h[1],a=h[3]===void 0?Ot:h[3]==='"'?Io:Eo):a===Io||a===Eo?a=Ot:a===xo||a===So?a=vr:(a=Ot,i=void 0);const g=a===Ot&&r[o+1].startsWith("/>")?" ":"";s+=a===vr?l+jd:y>=0?(n.push(u),l.slice(0,y)+Pu+l.slice(y)+Et+g):l+Et+(y===-2?o:g)}return[Bu(r,s+(r[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};let Cs=class Fu{constructor({strings:e,_$litType$:t},n){let i;this.parts=[];let s=0,a=0;const o=e.length-1,l=this.parts,[u,h]=kd(e,t);if(this.el=Fu.createElement(u,n),Pt.currentNode=this.el.content,t===2||t===3){const y=this.el.content.firstChild;y.replaceWith(...y.childNodes)}for(;(i=Pt.nextNode())!==null&&l.length<o;){if(i.nodeType===1){if(i.hasAttributes())for(const y of i.getAttributeNames())if(y.endsWith(Pu)){const b=h[a++],g=i.getAttribute(y).split(Et),m=/([.?@])?(.*)/.exec(b);l.push({type:1,index:s,name:m[2],strings:g,ctor:m[1]==="."?Md:m[1]==="?"?Pd:m[1]==="@"?Cd:Dn}),i.removeAttribute(y)}else y.startsWith(Et)&&(l.push({type:6,index:s}),i.removeAttribute(y));if(qu.test(i.tagName)){const y=i.textContent.split(Et),b=y.length-1;if(b>0){i.textContent=En?En.emptyScript:"";for(let g=0;g<b;g++)i.append(y[g],Jr()),Pt.nextNode(),l.push({type:2,index:++s});i.append(y[b],Jr())}}}else if(i.nodeType===8)if(i.data===Cu)l.push({type:2,index:s});else{let y=-1;for(;(y=i.data.indexOf(Et,y+1))!==-1;)l.push({type:7,index:s}),y+=Et.length-1}s++}}static createElement(e,t){const n=Ft.createElement("template");return n.innerHTML=e,n}};function rr(r,e,t=r,n){var a,o;if(e===tr)return e;let i=n!==void 0?(a=t._$Co)==null?void 0:a[n]:t._$Cl;const s=Qr(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((o=i==null?void 0:i._$AO)==null||o.call(i,!1),s===void 0?i=void 0:(i=new s(r),i._$AT(r,t,n)),n!==void 0?(t._$Co??(t._$Co=[]))[n]=i:t._$Cl=i),i!==void 0&&(e=rr(r,i._$AS(r,e.values),i,n)),e}let Dd=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){const{el:{content:t},parts:n}=this._$AD,i=((e==null?void 0:e.creationScope)??Ft).importNode(t,!0);Pt.currentNode=i;let s=Pt.nextNode(),a=0,o=0,l=n[0];for(;l!==void 0;){if(a===l.index){let u;l.type===2?u=new ia(s,s.nextSibling,this,e):l.type===1?u=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(u=new qd(s,this,e)),this._$AV.push(u),l=n[++o]}a!==(l==null?void 0:l.index)&&(s=Pt.nextNode(),a++)}return Pt.currentNode=Ft,i}p(e){let t=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,t),t+=n.strings.length-2):n._$AI(e[t])),t++}},ia=class Uu{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,t,n,i){this.type=2,this._$AH=ke,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=rr(this,e,t),Qr(e)?e===ke||e==null||e===""?(this._$AH!==ke&&this._$AR(),this._$AH=ke):e!==this._$AH&&e!==tr&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Od(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ke&&Qr(this._$AH)?this._$AA.nextSibling.data=e:this.T(Ft.createTextNode(e)),this._$AH=e}$(e){var s;const{values:t,_$litType$:n}=e,i=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=Cs.createElement(Bu(n.h,n.h[0]),this.options)),n);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(t);else{const a=new Dd(i,this),o=a.u(this.options);a.p(t),this.T(o),this._$AH=a}}_$AC(e){let t=Ro.get(e.strings);return t===void 0&&Ro.set(e.strings,t=new Cs(e)),t}k(e){na(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let n,i=0;for(const s of e)i===t.length?t.push(n=new Uu(this.O(Jr()),this.O(Jr()),this,this.options)):n=t[i],n._$AI(s),i++;i<t.length&&(this._$AR(n&&n._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,t);e&&e!==this._$AB;){const i=e.nextSibling;e.remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},Dn=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,i,s){this.type=1,this._$AH=ke,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=ke}_$AI(e,t=this,n,i){const s=this.strings;let a=!1;if(s===void 0)e=rr(this,e,t,0),a=!Qr(e)||e!==this._$AH&&e!==tr,a&&(this._$AH=e);else{const o=e;let l,u;for(e=s[0],l=0;l<s.length-1;l++)u=rr(this,o[n+l],t,l),u===tr&&(u=this._$AH[l]),a||(a=!Qr(u)||u!==this._$AH[l]),u===ke?e=ke:e!==ke&&(e+=(u??"")+s[l+1]),this._$AH[l]=u}a&&!i&&this.j(e)}j(e){e===ke?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}},Md=class extends Dn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ke?void 0:e}},Pd=class extends Dn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ke)}},Cd=class extends Dn{constructor(e,t,n,i,s){super(e,t,n,i,s),this.type=5}_$AI(e,t=this){if((e=rr(this,e,t,0)??ke)===tr)return;const n=this._$AH,i=e===ke&&n!==ke||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,s=e!==ke&&(n===ke||i);i&&this.element.removeEventListener(this.name,this,n),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}},qd=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){rr(this,e)}};const xi=Vr.litHtmlPolyfillSupport;xi==null||xi(Cs,ia),(Vr.litHtmlVersions??(Vr.litHtmlVersions=[])).push("3.3.0");const Bd=(r,e,t)=>{const n=(t==null?void 0:t.renderBefore)??e;let i=n._$litPart$;if(i===void 0){const s=(t==null?void 0:t.renderBefore)??null;n._$litPart$=i=new ia(e.insertBefore(Jr(),s),s,void 0,t??{})}return i._$AI(r),i};/**
|
|
99
|
+
* @license
|
|
100
|
+
* Copyright 2017 Google LLC
|
|
101
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
102
|
+
*/const qt=globalThis;class Bt extends Xt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t;const e=super.createRenderRoot();return(t=this.renderOptions).renderBefore??(t.renderBefore=e.firstChild),e}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Bd(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return tr}}var hu;Bt._$litElement$=!0,Bt.finalized=!0,(hu=qt.litElementHydrateSupport)==null||hu.call(qt,{LitElement:Bt});const Si=qt.litElementPolyfillSupport;Si==null||Si({LitElement:Bt});(qt.litElementVersions??(qt.litElementVersions=[])).push("4.2.0");var Hu=r=>{throw TypeError(r)},Vu=(r,e,t)=>e.has(r)||Hu("Cannot "+t),xt=(r,e,t)=>(Vu(r,e,"read from private field"),t?t.call(r):e.get(r)),Fd=(r,e,t)=>e.has(r)?Hu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Ud=(r,e,t,n)=>(Vu(r,e,"write to private field"),e.set(r,t),t);const Gt=r=>(e,t)=>{t!==void 0?t.addInitializer(()=>{customElements.define(r,e)}):customElements.define(r,e)},gn=globalThis,sa=gn.ShadowRoot&&(gn.ShadyCSS===void 0||gn.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Gu=Symbol(),No=new WeakMap;let Hd=class{constructor(r,e,t){if(this._$cssResult$=!0,t!==Gu)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=r,this.t=e}get styleSheet(){let r=this.o;const e=this.t;if(sa&&r===void 0){const t=e!==void 0&&e.length===1;t&&(r=No.get(e)),r===void 0&&((this.o=r=new CSSStyleSheet).replaceSync(this.cssText),t&&No.set(e,r))}return r}toString(){return this.cssText}};const Vd=r=>new Hd(typeof r=="string"?r:r+"",void 0,Gu),Gd=(r,e)=>{if(sa)r.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const t of e){const n=document.createElement("style"),i=gn.litNonce;i!==void 0&&n.setAttribute("nonce",i),n.textContent=t.cssText,r.appendChild(n)}},To=sa?r=>r:r=>r instanceof CSSStyleSheet?(e=>{let t="";for(const n of e.cssRules)t+=n.cssText;return Vd(t)})(r):r,{is:Wd,defineProperty:zd,getOwnPropertyDescriptor:Jd,getOwnPropertyNames:Qd,getOwnPropertySymbols:Xd,getPrototypeOf:Kd}=Object,nr=globalThis,Ao=nr.trustedTypes,Yd=Ao?Ao.emptyScript:"",Lo=nr.reactiveElementPolyfillSupport,Gr=(r,e)=>r,In={toAttribute(r,e){switch(e){case Boolean:r=r?Yd:null;break;case Object:case Array:r=r==null?r:JSON.stringify(r)}return r},fromAttribute(r,e){let t=r;switch(e){case Boolean:t=r!==null;break;case Number:t=r===null?null:Number(r);break;case Object:case Array:try{t=JSON.parse(r)}catch{t=null}}return t}},aa=(r,e)=>!Wd(r,e),jo={attribute:!0,type:String,converter:In,reflect:!1,hasChanged:aa};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),nr.litPropertyMetadata??(nr.litPropertyMetadata=new WeakMap);class _r extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=jo){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const n=Symbol(),i=this.getPropertyDescriptor(e,n,t);i!==void 0&&zd(this.prototype,e,i)}}static getPropertyDescriptor(e,t,n){const{get:i,set:s}=Jd(this.prototype,e)??{get(){return this[t]},set(a){this[t]=a}};return{get(){return i==null?void 0:i.call(this)},set(a){const o=i==null?void 0:i.call(this);s.call(this,a),this.requestUpdate(e,o,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??jo}static _$Ei(){if(this.hasOwnProperty(Gr("elementProperties")))return;const e=Kd(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(Gr("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(Gr("properties"))){const t=this.properties,n=[...Qd(t),...Xd(t)];for(const i of n)this.createProperty(i,t[i])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[n,i]of t)this.elementProperties.set(n,i)}this._$Eh=new Map;for(const[t,n]of this.elementProperties){const i=this._$Eu(t,n);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const i of n)t.unshift(To(i))}else e!==void 0&&t.push(To(e));return t}static _$Eu(e,t){const n=t.attribute;return n===!1?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(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return Gd(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostConnected)==null?void 0:n.call(t)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var n;return(n=t.hostDisconnected)==null?void 0:n.call(t)})}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$EC(e,t){var n;const i=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,i);if(s!==void 0&&i.reflect===!0){const a=(((n=i.converter)==null?void 0:n.toAttribute)!==void 0?i.converter:In).toAttribute(t,i.type);this._$Em=e,a==null?this.removeAttribute(s):this.setAttribute(s,a),this._$Em=null}}_$AK(e,t){var n;const i=this.constructor,s=i._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const a=i.getPropertyOptions(s),o=typeof a.converter=="function"?{fromAttribute:a.converter}:((n=a.converter)==null?void 0:n.fromAttribute)!==void 0?a.converter:In;this._$Em=s,this[s]=o.fromAttribute(t,a.type),this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){if(n??(n=this.constructor.getPropertyOptions(e)),!(n.hasChanged??aa)(this[e],t))return;this.P(e,t,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,n){this._$AL.has(e)||this._$AL.set(e,t),n.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,a]of this._$Ep)this[s]=a;this._$Ep=void 0}const i=this.constructor.elementProperties;if(i.size>0)for(const[s,a]of i)a.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],a)}let t=!1;const n=this._$AL;try{t=this.shouldUpdate(n),t?(this.willUpdate(n),(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdate)==null?void 0:s.call(i)}),this.update(n)):this._$EU()}catch(i){throw t=!1,this._$EU(),i}t&&this._$AE(n)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(n=>{var i;return(i=n.hostUpdated)==null?void 0:i.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach(t=>this._$EC(t,this[t]))),this._$EU()}updated(e){}firstUpdated(e){}}_r.elementStyles=[],_r.shadowRootOptions={mode:"open"},_r[Gr("elementProperties")]=new Map,_r[Gr("finalized")]=new Map,Lo==null||Lo({ReactiveElement:_r}),(nr.reactiveElementVersions??(nr.reactiveElementVersions=[])).push("2.0.4");const Zd={attribute:!0,type:String,converter:In,reflect:!1,hasChanged:aa},ef=(r=Zd,e,t)=>{const{kind:n,metadata:i}=t;let s=globalThis.litPropertyMetadata.get(i);if(s===void 0&&globalThis.litPropertyMetadata.set(i,s=new Map),s.set(t.name,r),n==="accessor"){const{name:a}=t;return{set(o){const l=e.get.call(this);e.set.call(this,o),this.requestUpdate(a,l,r)},init(o){return o!==void 0&&this.P(a,void 0,r),o}}}if(n==="setter"){const{name:a}=t;return function(o){const l=this[a];e.call(this,o),this.requestUpdate(a,l,r)}}throw Error("Unsupported decorator location: "+n)};function _e(r){return(e,t)=>typeof t=="object"?ef(r,e,t):((n,i,s)=>{const a=i.hasOwnProperty(s);return i.constructor.createProperty(s,a?{...n,wrapped:!0}:n),a?Object.getOwnPropertyDescriptor(i,s):void 0})(r,e,t)}function oa(r){return _e({...r,state:!0,attribute:!1})}const tf=(r,e,t)=>(t.configurable=!0,t.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(r,e,t),t);function ct(r,e){return(t,n,i)=>{const s=a=>{var o;return((o=a.renderRoot)==null?void 0:o.querySelector(r))??null};return tf(t,n,{get(){return s(this)}})}}var rf=Object.defineProperty,Wt=(r,e,t,n)=>{for(var i=void 0,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=a(e,t,i)||i);return i&&rf(e,t,i),i};const qs=class extends Bt{constructor(){super(...arguments),this.dense=!1}};qs.shadowRootOptions={...Bt.shadowRootOptions,delegatesFocus:!0},qs.styles=[vt`
|
|
103
|
+
:host {
|
|
104
|
+
color-scheme: light dark;
|
|
105
|
+
--rokit-primary-color-inner: var(--rokit-primary-color, #008877);
|
|
106
|
+
--rokit-primary-color-transparent-inner: color-mix(in srgb, var(--rokit-primary-color-inner) 20%, transparent);
|
|
107
|
+
--rokit-error-color-inner: var(--rokit-error-color, #F03333);
|
|
108
|
+
--rokit-background-color-inner: var(--rokit-background-color, #242424);
|
|
109
|
+
--rokit-light-background-color-inner: var(--rokit-light-background-color, color-mix(in srgb, var(--rokit-background-color-inner) 96%, currentColor));
|
|
110
|
+
--rokit-light-background-darker-color-inner: var(--rokit-light-background-darker-color, color-mix(in srgb, var(--rokit-light-background-color-inner) 80%, currentColor));
|
|
111
|
+
--rokit-shadow-color-inner: var(--rokit-shadow-color, color-mix(in srgb, currentColor 40%, transparent));
|
|
112
|
+
--rokit-list-indent-inner: var(--rokit-list-indent, 1em);
|
|
113
|
+
--rokit-list-max-height-inner: var(--rokit-list-max-height, 300);
|
|
114
|
+
--rokit-caret-size-inner: var(--rokit-caret-size, 0.5em);
|
|
115
|
+
--rokit-transition-duration-inner: var(--rokit-transition-duration, 0.2s);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
@media (prefers-color-scheme: light) {
|
|
119
|
+
:host {
|
|
120
|
+
--rokit-background-color-inner: var(--rokit-background-color, #FFF);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
`];let zt=qs;Wt([_e({type:Boolean,reflect:!0})],zt.prototype,"dense");var rt;const Bs=class extends zt{constructor(){super(),Fd(this,rt),this.value="",this.clearable=!1,this.required=!1,Ud(this,rt,this.attachInternals())}checkValidity(){return xt(this,rt).checkValidity()}reportValidity(){const e=xt(this,rt).reportValidity();return this.classList.toggle("invalid",!e),e}get validity(){return xt(this,rt).validity}get validationMessage(){return xt(this,rt).validationMessage}setCustomValidity(e,t){e?xt(this,rt).setValidity({customError:!0},e,t):xt(this,rt).setValidity(void 0)}updateValidity(e,t,n){xt(this,rt).setValidity(e,t,n)}setFormValue(e,t){xt(this,rt).setFormValue(e,t)}};rt=new WeakMap,Bs.formAssociated=!0,Bs.styles=[...zt.styles,vt`
|
|
124
|
+
:host { display: inline-flex; align-items: center; padding: 6px 8px; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); box-sizing: border-box; position: relative; }
|
|
125
|
+
:host(:focus) { border-color: var(--rokit-primary-color-inner); }
|
|
126
|
+
:host(.invalid) { border-color: var(--rokit-error-color-inner); }
|
|
127
|
+
`];let dt=Bs;Wt([_e()],dt.prototype,"name");Wt([_e()],dt.prototype,"value");Wt([_e({type:Boolean})],dt.prototype,"clearable");Wt([_e({type:Boolean})],dt.prototype,"required");Wt([_e()],dt.prototype,"label");Wt([_e()],dt.prototype,"placeholder");function nf(r){const e=parseFloat(r),t=r.match(/m?s/);let n=0;if(t)switch(t[0]){case"s":n=e*1e3;break;case"ms":n=e;break;default:n=0;break}return n}var sf=(r,e,t,n)=>{for(var i=e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=a(i)||i);return i};let Xr=class extends zt{render(){return ut`<a part="link"><slot><slot></a>`}};Xr.styles=[...zt.styles,vt`
|
|
128
|
+
:host a { display: flex; min-width: 1em; height: 1em; padding: 0.5em; cursor: pointer; border-radius: 1em; align-items: center; justify-content: center; }
|
|
129
|
+
:host a:hover { font-weight: 600; background-color: var(--rokit-light-background-darker-color-inner); }
|
|
130
|
+
:host([dense]) { font-size: 0.65em; }
|
|
131
|
+
:host(.clear) a:before { content: '\u2715'; }
|
|
132
|
+
:host(.caret) a:before { content:''; width: var(--rokit-caret-size-inner); height: var(--rokit-caret-size-inner); border-style: none solid solid none; border-width: calc(0.3 * var(--rokit-caret-size-inner)); transform: translate(0.15em, -0.15em) rotate(45deg); transition: transform var(--rokit-transition-duration-inner) ease-out; margin-right: calc(0.5 * var(--rokit-caret-size-inner)); }
|
|
133
|
+
:host(.caret.down) a:before { transform: translate(0.15em, 0.15em) rotate(225deg); }
|
|
134
|
+
:host(.caret.right) a:before { transform: translate(0em, 0em) rotate(-45deg); }
|
|
135
|
+
`];Xr=sf([Gt("rokit-button")],Xr);var af=Object.defineProperty,of=Object.getOwnPropertyDescriptor,Jt=(r,e,t,n)=>{for(var i=n>1?void 0:n?of(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&af(e,t,i),i};let yt=class extends zt{constructor(){super(...arguments),this.open=!1,this.transitioning=!1,this.closedBeforeTransition=!1}firstUpdated(){const r=this.shadowRoot.querySelector("header");r.addEventListener("mousedown",()=>{this.closedBeforeTransition=!this.open&&!this.transitioning}),r.addEventListener("click",()=>{this.toggle(this.closedBeforeTransition)}),this.transitionDuration=nf(getComputedStyle(this).getPropertyValue("--rokit-transition-duration-inner"))}updated(r){r.has("transitioning")&&this.classList.toggle("transitioning",this.transitioning)}updateContentHeight(){this.content.style.maxHeight=(this.maxHeight!==void 0?Math.min(this.maxHeight,this.content.scrollHeight):this.content.scrollHeight)+"px",this.classList.toggle("has-content",this.content.style.maxHeight!=="0px")}toggle(r=!this.open){this.open||this.updateContentHeight(),this.transitioning=!0,this.open=r,this.toggleButton.classList.toggle("down",r),setTimeout(()=>{this.transitioning=!1,this.open&&this.content.scrollIntoView({block:"nearest"})},this.transitionDuration)}render(){return ut`
|
|
136
|
+
<header part="header">
|
|
137
|
+
<slot name="prefix" part="prefix"></slot>
|
|
138
|
+
<span class="label"><slot name="label" part="label">${this.label}</slot></span>
|
|
139
|
+
<slot name="pre-suffix" part="suffix"></slot>
|
|
140
|
+
<rokit-button id="toggle" part="toggle" class="caret" ?dense="${this.dense}" title="${this.open?"Collapse":"Expand"}"></rokit-button>
|
|
141
|
+
<slot name="suffix" part="suffix"></slot>
|
|
142
|
+
</header>
|
|
143
|
+
<div id="content" part="content">
|
|
144
|
+
<slot @slotchange=${this.updateContentHeight}></slot>
|
|
145
|
+
</div>
|
|
146
|
+
`}};yt.styles=[...zt.styles,vt`
|
|
147
|
+
:host { display: flex; flex-direction: column; align-items: stretch; border-bottom: 2px solid var(--rokit-light-background-darker-color-inner); }
|
|
148
|
+
:host header { cursor: pointer; }
|
|
149
|
+
:host([dense]) header { padding: 2px 4px; }
|
|
150
|
+
:host([maxheight]) #content { overflow:auto }
|
|
151
|
+
:host(:not([open])) #content { max-height: 0 !important; }
|
|
152
|
+
:host(:not([open])) #content, :host(.transitioning) #content { overflow: hidden !important; }
|
|
153
|
+
header { display: flex; align-items: center; padding: 6px 8px; background-color: var(--rokit-light-background-color-inner); user-select: none; }
|
|
154
|
+
.label { flex-grow: 1; }
|
|
155
|
+
#content { display: flex; transition: max-height var(--rokit-transition-duration-inner) ease-in-out; position: relative; scrollbar-width: thin; }
|
|
156
|
+
#toggle { margin-left: 3px; }
|
|
157
|
+
`];Jt([_e({type:Boolean,reflect:!0})],yt.prototype,"open",2);Jt([_e()],yt.prototype,"label",2);Jt([_e({reflect:!0})],yt.prototype,"maxHeight",2);Jt([ct("#content")],yt.prototype,"content",2);Jt([ct("#toggle")],yt.prototype,"toggleButton",2);Jt([oa()],yt.prototype,"transitioning",2);yt=Jt([Gt("rokit-collapsible")],yt);var lf=Object.defineProperty,uf=Object.getOwnPropertyDescriptor,Wu=r=>{throw TypeError(r)},Qe=(r,e,t,n)=>{for(var i=n>1?void 0:n?uf(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&lf(e,t,i),i},zu=(r,e,t)=>e.has(r)||Wu("Cannot "+t),cf=(r,e,t)=>(zu(r,e,"read from private field"),e.get(r)),df=(r,e,t)=>e.has(r)?Wu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Oo=(r,e,t,n)=>(zu(r,e,"write to private field"),e.set(r,t),t),Pr;let De=class extends dt{constructor(){super(),this.type="text",this.disabled=!1,this.readonly=!1,this.sticky=!1,this.minWidth=80,df(this,Pr,""),this.addEventListener("keydown",r=>{r.code==="Escape"&&this.blur()}),this.addEventListener("focus",()=>{this.classList.add("has-focus")}),this.addEventListener("blur",()=>{this.inputElement.scrollLeft=0,this.classList.remove("has-focus")})}firstUpdated(){var r,e;Oo(this,Pr,this.value),this.inputElement.addEventListener("change",()=>{this.value=this.inputElement.value});const t=((e=(r=this.shadowRoot)==null?void 0:r.querySelector("label"))==null?void 0:e.scrollWidth)||0,n=this.shadowRoot.querySelector(".wrapper");n.style.minWidth=`${this.minWidth>t?this.minWidth:t}px`}updated(r){r.has("label")&&this.classList.toggle("has-label",this.label!==void 0),r.has("min")&&(this.inputElement.min=this.min||""),r.has("max")&&(this.inputElement.max=this.max||""),r.has("step")&&(this.inputElement.step=this.step||""),r.has("placeholder")&&(this.inputElement.placeholder=this.placeholder||""),r.has("pattern")&&(this.inputElement.pattern=this.pattern||""),r.has("minLength")&&(this.inputElement.minLength=this.minLength===void 0?-1:this.minLength),r.has("maxLength")&&(this.inputElement.maxLength=this.maxLength===void 0?-1:this.maxLength),r.has("value")&&(this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.updateValidity(this.inputElement.validity,this.inputElement.validationMessage,this.inputElement),this.value!==cf(this,Pr)&&(Oo(this,Pr,this.value),this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))))}clear(){this.inputElement.value="",this.value="",this.blur()}renderInput(){return ut`<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 ut`
|
|
158
|
+
<slot name="prefix" part="prefix"></slot>
|
|
159
|
+
<div class="wrapper">
|
|
160
|
+
<label for="input" part="label">${this.label}</label>
|
|
161
|
+
${this.renderInput()}
|
|
162
|
+
${this.clearable?ut`
|
|
163
|
+
<rokit-button class="clear" ?dense="${this.dense}" @click="${r=>{r.stopPropagation(),this.clear()}}" title="Clear"></rokit-button>
|
|
164
|
+
`:ke}
|
|
165
|
+
</div>
|
|
166
|
+
<slot name="suffix" part="suffix"></slot>
|
|
167
|
+
`}};Pr=new WeakMap;De.styles=[...dt.styles,vt`
|
|
168
|
+
:host { background-color: var(--rokit-light-background-color-inner); user-select: none; }
|
|
169
|
+
:host([dense]) { padding: 2px 4px; }
|
|
170
|
+
:host(.has-focus:not([readonly])) label, :host(.has-value) label, :host([sticky]) label { font-size: 0.75em; top: 0.5em; font-weight: 600; }
|
|
171
|
+
:host(.has-focus) label { color: var(--rokit-primary-color-inner); }
|
|
172
|
+
.wrapper { display: flex; position: relative; flex-grow: 1; align-items: center; }
|
|
173
|
+
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; }
|
|
174
|
+
#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; }
|
|
175
|
+
#input[type='file'] { padding-bottom: 3px; }
|
|
176
|
+
#input[readonly] { caret-color: transparent; }
|
|
177
|
+
#input[readonly]::placeholder { color: transparent; }
|
|
178
|
+
:host(.has-label) #input { margin-top: 0.9em; }
|
|
179
|
+
:host(.has-label:not(.has-focus):not(.has-value):not([sticky])) #input { clip-path: polygon(0 0, 0 0, 0 0, 0 0); }
|
|
180
|
+
:host(:not(.has-value)) .clear { visibility: hidden; }
|
|
181
|
+
`];Qe([_e()],De.prototype,"type",2);Qe([_e({type:Boolean})],De.prototype,"disabled",2);Qe([_e({type:Boolean,reflect:!0})],De.prototype,"readonly",2);Qe([_e({type:Boolean,reflect:!0})],De.prototype,"sticky",2);Qe([_e()],De.prototype,"pattern",2);Qe([_e()],De.prototype,"minLength",2);Qe([_e()],De.prototype,"maxLength",2);Qe([_e()],De.prototype,"min",2);Qe([_e()],De.prototype,"max",2);Qe([_e()],De.prototype,"step",2);Qe([_e()],De.prototype,"minWidth",2);Qe([ct("#input")],De.prototype,"inputElement",2);De=Qe([Gt("rokit-input")],De);var ff=Object.defineProperty,hf=Object.getOwnPropertyDescriptor,Ju=r=>{throw TypeError(r)},Ge=(r,e,t,n)=>{for(var i=n>1?void 0:n?hf(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&ff(e,t,i),i},Qu=(r,e,t)=>e.has(r)||Ju("Cannot "+t),$o=(r,e,t)=>(Qu(r,e,"read from private field"),t?t.call(r):e.get(r)),ko=(r,e,t)=>e.has(r)?Ju("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),dn=(r,e,t,n)=>(Qu(r,e,"write to private field"),e.set(r,t),t),Kt,yn;let Me=class extends dt{constructor(){super(),this.emptyMessage="Nothing to select",this.collapsibleOrientationLeft="0",this.collapsibleOrientationRight="0",this.collapsibleWidth="",this.collapse=!1,this.filterableThreshold=15,this.itemCount=0,ko(this,Kt,""),ko(this,yn,""),this.addEventListener("focus",()=>{this.collapsible.toggle(!0)}),this.addEventListener("blur",()=>{this.checkInputValue(),this.collapsible.toggle(!1)})}firstUpdated(){dn(this,Kt,this.value),dn(this,yn,getComputedStyle(this).getPropertyValue("--rokit-list-indent-inner")),this.input.placeholder=this.placeholder===void 0?"Type to filter list...":this.placeholder,this.input.label=this.label,this.inputMinWidth!==void 0&&(this.input.minWidth=this.inputMinWidth),setTimeout(()=>{this.collapsible.maxHeight=parseInt(this.collapsibleMaxHeight!==void 0?this.collapsibleMaxHeight:getComputedStyle(this).getPropertyValue("--rokit-list-max-height-inner")),this.collapsible.content.style.width=this.collapsibleWidth,this.collapsible.content.style.left=this.collapsibleOrientationLeft,this.collapsible.content.style.right=this.collapsibleOrientationRight})}updated(r){var e;if(r.has("selectedItem")){const t=this.value;this.value=this.selectedItem?this.itemValue(this.selectedItem):"",this.input.value=this.selectedItem?this.itemText(this.selectedItem):this.value,this.input.title=this.input.value,this.classList.toggle("has-value",this.value!==""),this.setFormValue(this.value),this.required&&this.value===""?this.updateValidity({valueMissing:!0},"Please select a value",this.listContainer):this.updateValidity(),t!==this.value&&this.dispatchEvent(new CustomEvent("change",{bubbles:!0}))}r.has("value")&&this.selectItem(this.findItem(this.value)),(r.has("filterableThreshold")||r.has("itemCount"))&&(this.input.readonly=this.filterableThreshold<0||this.itemCount<this.filterableThreshold),(e=this.collapsible)!=null&&e.toggleButton&&(this.collapsible.toggleButton.style.display=this.listContainer.childElementCount===0?"none":"")}checkInputValue(r=!0){if(this.input.value){const e=this.findItem(this.input.value);if(e){this.selectItem(e);return}}r&&(this.input.value="",this.input.title="",dn(this,Kt,""),this.selectItem(null,!1))}filter(r){var e,t,n;r=r.toLowerCase();let i=!0;for(const s of this.listContainer.querySelectorAll("li"))if(s.id!=="noresult"){const a=this.itemText(s).toLowerCase().indexOf(r)==-1;s.classList.toggle("hidden",a),this.collapse&&(s.classList.remove("open"),(e=s.querySelector("ul"))==null||e.classList.remove("open")),a||(i=!1)}for(const s of this.listContainer.querySelectorAll("li:has(li:not(.hidden))"))s.classList.remove("hidden"),r&&this.collapse&&(s.classList.add("open"),(t=s.querySelector("ul"))==null||t.classList.add("open")),i=!1;this.highlightItem(null),(n=this.listContainer.querySelector("#noresult"))==null||n.classList.toggle("hidden",!i)}selectItem(r,e=!0){(r==null?void 0:r.getAttribute("disabled"))!==null&&(r=null),this.selectedItem=r,this.filter(""),this.highlightItem(r,!1),e&&this.value&&dn(this,Kt,this.value),setTimeout(()=>this.blur())}findItem(r){if(r){for(const e of this.listContainer.querySelectorAll("li"))if(this.itemValue(e)===r||this.itemText(e)===r)return e}return null}highlightItem(r,e=!0){var t,n;if((t=this.listContainer.querySelector("li.active"))==null||t.classList.remove("active"),r){if(e&&this.listContainer.focus(),r.classList.add("active"),this.collapse)for(let i=r.closest("ul");i;i=i.parentElement.closest("ul"))i.classList.add("open"),(n=i.closest("li"))==null||n.classList.add("open");r.scrollIntoView({block:"nearest"})}}highlightNextItem(){const r=this.listContainer.querySelector("li.active");let e=r;const t=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");if(r){for(let n=0;n<t.length;n++)if(t[n]===r&&n<t.length-1){e=t[n+1];break}}else t.length>0&&(e=t[0]);this.highlightItem(e)}highlightPreviousItem(){const r=this.listContainer.querySelector("li.active");let e=null;if(r){const t=this.listContainer.querySelectorAll("ul.open > li:not([disabled]):not(.hidden):not(.divider)");for(let n=0;n<t.length;n++)if(t[n]===r&&n>0){e=t[n-1];break}}this.highlightItem(e),e||this.input.focus()}itemValue(r){return r.dataset.value||this.itemText(r)||""}itemText(r){var e;return((e=r.querySelector("div > div"))==null?void 0:e.innerText)||""}elementText(r){var e;let t="";for(const n of r.childNodes)n.nodeType==3&&(t+=(e=n.nodeValue)==null?void 0:e.trim());return t}onSlotChange(){this.listContainer.replaceChildren(),this.itemCount=0;let r=null;const e=this.shadowRoot.querySelector("#list-container-slot").assignedElements();if((e==null?void 0:e.length)===1&&(r=Array.prototype.slice.call(e[0].querySelectorAll(":scope > li")),this.copyItems(r,this.listContainer)),this.emptyMessage){const t=document.createElement("li");t.id="noresult",t.setAttribute("disabled",""),t.innerText=this.emptyMessage,this.listContainer.appendChild(t),r&&r.length>0&&t.classList.add("hidden")}this.value=this.value||$o(this,Kt),this.selectItem(this.findItem(this.value))}copyItems(r,e,t=0){if(this.sort!==void 0){const i=this.sort||"asc";r=r.sort((s,a)=>i==="desc"?(this.elementText(a)||this.itemValue(a)).localeCompare(this.elementText(s)||this.itemValue(s)):(this.elementText(s)||this.itemValue(s)).localeCompare(this.elementText(a)||this.itemValue(a)))}let n="";t>0&&(n=`calc(0.3em + ${t}*${$o(this,yn)})`);for(const i of r){const s=i.cloneNode();s.replaceChildren();const a=document.createElement("div");n&&(a.style.paddingLeft=n);const o=document.createElement("div");a.appendChild(o);for(const u of i.childNodes)if(u.nodeName!=="UL"){const h=u.cloneNode(!0);h.nodeType===3&&h.nodeValue&&(h.nodeValue=h.nodeValue.trim()),o.appendChild(h)}s.appendChild(a),s.title=s.title||this.itemText(s);const l=i.querySelector("ul");if(l!=null&&l.childElementCount){const u=document.createElement("ul");if(s.appendChild(u),this.copyItems(Array.prototype.slice.call(l.children),u,t+1),this.collapse){const h=new Xr;h.title="Open",h.dense=!0,h.classList.add("toggle-node","caret"),h.addEventListener("click",y=>{y.stopPropagation(),s.classList.toggle("open"),u.classList.toggle("open"),h.title=s.classList.contains("open")?"Close":"Open"}),a.prepend(h)}else u.classList.add("open")}e.appendChild(s),this.itemCount++}}render(){return ut`
|
|
182
|
+
<rokit-collapsible ?dense="${this.dense}" part="collapsible">
|
|
183
|
+
<slot name="prefix" part="prefix" slot="prefix"></slot>
|
|
184
|
+
<slot name="suffix" part="suffix" slot="suffix"></slot>
|
|
185
|
+
<rokit-input id="input" slot="label"
|
|
186
|
+
?clearable="${this.clearable}"
|
|
187
|
+
?dense="${this.dense}"
|
|
188
|
+
@change="${()=>{this.checkInputValue(this.input.inputElement.value===""||!this.collapsible.open)}}"
|
|
189
|
+
@input="${()=>{this.filter(this.input.inputElement.value)}}"
|
|
190
|
+
@click="${()=>{this.collapsible.toggle(!0)}}"
|
|
191
|
+
@keydown="${r=>{switch(r.code){case"ArrowDown":r.preventDefault(),this.highlightNextItem();break;case"Enter":{const e=this.findItem(this.input.value);e?this.selectItem(e):this.filter(this.input.value);break}}}}"
|
|
192
|
+
></rokit-input>
|
|
193
|
+
<ul id="list-container" tabindex="-1" part="list" class="open"
|
|
194
|
+
@mousedown="${r=>{r.preventDefault()}}"
|
|
195
|
+
@click="${r=>{const e=r.target.closest("li");e&&e.getAttribute("disabled")===null&&!e.classList.contains("divider")&&this.selectItem(e)}}"
|
|
196
|
+
@keydown="${r=>{var e,t;switch(r.code){case"Enter":this.selectItem(this.listContainer.querySelector("li.active"));break;case"ArrowDown":r.preventDefault(),this.highlightNextItem();break;case"ArrowUp":r.preventDefault(),this.highlightPreviousItem();break;case"ArrowRight":if(this.collapse){const n=this.listContainer.querySelector("li.active");n&&(r.preventDefault(),n.classList.add("open"),(e=n.querySelector("ul"))==null||e.classList.add("open"))}break;case"ArrowLeft":if(this.collapse){const n=this.listContainer.querySelector("li.active");n&&(r.preventDefault(),n.classList.remove("open"),(t=n.querySelector("ul"))==null||t.classList.remove("open"))}break;case"Escape":this.listContainer.blur();break}}}">
|
|
197
|
+
</ul>
|
|
198
|
+
<slot id="list-container-slot" @slotchange=${this.onSlotChange}></slot>
|
|
199
|
+
</rokit-collapsible>
|
|
200
|
+
`}};Kt=new WeakMap;yn=new WeakMap;Me.styles=[...dt.styles,vt`
|
|
201
|
+
:host { background-color: var(--rokit-light-background-color-inner); user-select: none; padding: 0; }
|
|
202
|
+
:host([dense]) li > div { padding: 4px 2px; }
|
|
203
|
+
:host([dense]) li.large > div, :host([dense]) li.header > div { padding-top: 6px; padding-bottom: 6px; }
|
|
204
|
+
#input { padding: 0; background-color: inherit; }
|
|
205
|
+
rokit-collapsible, #input { display: flex; flex-grow: 1; border: 0; }
|
|
206
|
+
rokit-collapsible::part(content) { display: flex; flex-direction: column; outline: 0; z-index: 1000; position: absolute; top: calc(100% + 2px); background-color: var(--rokit-background-color-inner); }
|
|
207
|
+
rokit-collapsible::part(header) { background-color: inherit !important; }
|
|
208
|
+
rokit-collapsible[open].has-content::part(content), rokit-collapsible.has-content.transitioning::part(content) { border: 2px solid var(--rokit-primary-color-transparent-inner); box-shadow: 0 0 10px var(--rokit-shadow-color-inner); clip-path: inset(0 -13px -13px 0); }
|
|
209
|
+
#list-container { outline: 0; }
|
|
210
|
+
#list-container-slot { display: none; }
|
|
211
|
+
ul { list-style-type: none; margin: 0; padding: 0; width: 100%; box-sizing: border-box; }
|
|
212
|
+
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)); }
|
|
213
|
+
li:not([disabled]):not(.divider) { cursor: pointer }
|
|
214
|
+
li:not([disabled]):not(.divider) > div:hover { background-color: var(--rokit-light-background-color-inner); }
|
|
215
|
+
li.active > div { color: var(--rokit-primary-color-inner); background-color: var(--rokit-light-background-color-inner); }
|
|
216
|
+
li.divider { border-top: 1px solid var(--rokit-light-background-darker-color-inner); height: 0; padding: 0; }
|
|
217
|
+
li.divider, li.header { pointer-events: none; }
|
|
218
|
+
li.header > div { font-size: 0.7rem; font-weight: bold; padding-top: 8px; }
|
|
219
|
+
li.large > div { padding-top: 10px; padding-bottom: 10px; }
|
|
220
|
+
.hidden { display: none !important; }
|
|
221
|
+
:host([collapse]) li > div { padding-left: 0; }
|
|
222
|
+
:host([collapse]) .toggle-node { position: absolute }
|
|
223
|
+
:host([collapse]) li > div > div { padding-left: 1.8em; }
|
|
224
|
+
:host([collapse]) ul:not(.open) { display: none; }
|
|
225
|
+
:host([collapse]) li:not(.open) > div > .toggle-node::part(link):before { transform: translate(0em, 0em) rotate(-45deg); }
|
|
226
|
+
`];Ge([_e()],Me.prototype,"emptyMessage",2);Ge([_e()],Me.prototype,"sort",2);Ge([_e()],Me.prototype,"collapsibleMaxHeight",2);Ge([_e()],Me.prototype,"collapsibleOrientationLeft",2);Ge([_e()],Me.prototype,"collapsibleOrientationRight",2);Ge([_e()],Me.prototype,"collapsibleWidth",2);Ge([_e()],Me.prototype,"inputMinWidth",2);Ge([_e({type:Boolean})],Me.prototype,"collapse",2);Ge([_e()],Me.prototype,"filterableThreshold",2);Ge([ct("rokit-collapsible")],Me.prototype,"collapsible",2);Ge([ct("#input")],Me.prototype,"input",2);Ge([ct("#list-container")],Me.prototype,"listContainer",2);Ge([oa()],Me.prototype,"selectedItem",2);Ge([oa()],Me.prototype,"itemCount",2);Me=Ge([Gt("rokit-select")],Me);var pf=Object.defineProperty,gf=Object.getOwnPropertyDescriptor,Mn=(r,e,t,n)=>{for(var i=n>1?void 0:n?gf(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&pf(e,t,i),i};let ir=class extends De{constructor(){super(...arguments),this.resize="none",this.rows=3}firstUpdated(){super.firstUpdated(),this.inputElement.rows=this.rows,this.cols!==void 0&&(this.inputElement.cols=this.cols),this.resize==="auto"?(this.inputElement.style.resize="none",this.inputElement.addEventListener("input",()=>this.autoResize())):this.inputElement.style.resize=this.resize}updated(r){super.updated(r),this.resize==="auto"&&r.has("value")&&this.autoResize()}autoResize(){this.inputElement.style.height="",this.inputElement.style.height=this.inputElement.scrollHeight+"px"}onSlotChange(){const r=this.shadowRoot.querySelector("#content").assignedNodes().map(e=>e.textContent).join("");r.trim()!==""&&(this.value=r)}renderInput(){return ut`
|
|
227
|
+
<textarea id="input" part="input" autocomplete="off" name="${this.name}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" ?required="${this.required}" .value="${this.value}"></textarea>
|
|
228
|
+
<slot id="content" @slotchange=${this.onSlotChange}></slot>
|
|
229
|
+
`}};ir.styles=[...De.styles,vt`
|
|
230
|
+
:host { align-items: last baseline; }
|
|
231
|
+
#input { height: initial; }
|
|
232
|
+
#content { display: none; }
|
|
233
|
+
.wrapper { align-items: flex-start; }
|
|
234
|
+
`];Mn([_e()],ir.prototype,"resize",2);Mn([_e()],ir.prototype,"rows",2);Mn([_e()],ir.prototype,"cols",2);ir=Mn([Gt("rokit-textarea")],ir);var yf=Object.defineProperty,mf=Object.getOwnPropertyDescriptor,Xu=r=>{throw TypeError(r)},ft=(r,e,t,n)=>{for(var i=n>1?void 0:n?mf(e,t):e,s=r.length-1,a;s>=0;s--)(a=r[s])&&(i=(n?a(e,t,i):a(i))||i);return n&&i&&yf(e,t,i),i},Ku=(r,e,t)=>e.has(r)||Xu("Cannot "+t),Re=(r,e,t)=>(Ku(r,e,"read from private field"),t?t.call(r):e.get(r)),Ei=(r,e,t)=>e.has(r)?Xu("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),fn=(r,e,t,n)=>(Ku(r,e,"write to private field"),e.set(r,t),t),Oe,pt,Yt;const It=18;let mt=class extends De{constructor(){super(...arguments),this.labelFormatter=r=>String(r),Ei(this,Oe,[0,1]),Ei(this,pt,[Re(this,Oe)[0],Re(this,Oe)[1]]),Ei(this,Yt)}firstUpdated(){super.firstUpdated(),this.sliderElement.addEventListener("mousedown",r=>this.onKnobDrag(r)),this.sliderElement.addEventListener("touchstart",r=>this.onKnobDrag(r)),new ResizeObserver(()=>{this.updateKnobPositions()}).observe(this.sliderElement)}updated(r){if(super.updated(r),r.has("min")&&(Re(this,Oe)[0]=parseFloat(this.min||"0"),Re(this,Oe)[1]=Math.max(Re(this,Oe)[0],Re(this,Oe)[1])),r.has("max")&&(Re(this,Oe)[1]=parseFloat(this.max||"1"),Re(this,Oe)[0]=Math.min(Re(this,Oe)[0],Re(this,Oe)[1])),r.has("step")&&fn(this,Yt,this.step?parseFloat(this.step):void 0),r.has("value")||r.has("min")||r.has("max"))if(this.value)if(this.range!==void 0){const e=JSON.parse(this.value);fn(this,pt,[this.applyConstraints(e[0]),this.applyConstraints(e[1])])}else fn(this,pt,[this.applyConstraints(parseFloat(this.value))]);else fn(this,pt,[Re(this,Oe)[0],Re(this,Oe)[1]]);this.updateKnobPositions()}updateValidity(r,e){super.updateValidity(r,e,this.sliderElement)}chooseKnob(r){if(!this.endKnob)return this.startKnob;let e=Math.abs(r-this.startKnob.offsetLeft)<Math.abs(r-this.endKnob.offsetLeft)?this.startKnob:this.endKnob;return this.startKnob.value===this.endKnob.value&&(e.id==="start"&&e.value===Re(this,Oe)[0]?e=this.endKnob:e.id==="end"&&e.value===Re(this,Oe)[1]&&(e=this.startKnob)),e}toScreenSpace(r){return(r-Re(this,Oe)[0])/(Re(this,Oe)[1]-Re(this,Oe)[0])*this.track.offsetWidth}toValueSpace(r){return r/this.track.offsetWidth*(Re(this,Oe)[1]-Re(this,Oe)[0])+Re(this,Oe)[0]}applyConstraints(r,e){let t=Math.min(Math.max(r,Re(this,Oe)[0]),Re(this,Oe)[1]);return Re(this,Yt)&&(t=Math.round(t/Re(this,Yt))*Re(this,Yt)),e!==void 0&&this.endKnob&&(t=e?Math.min(t,this.endKnob.value):Math.max(t,this.startKnob.value)),t}updateKnob(r,e){r.value=e,r.offset=this.toScreenSpace(e),r.label=this.labelFormatter(e),this.endKnob&&(r.id==="start"?this.track.style.borderLeftWidth=r.offset+"px":this.track.style.borderRightWidth=this.track.offsetWidth-r.offset+"px")}updateKnobPositions(){this.updateKnob(this.startKnob,Re(this,pt)[0]),this.endKnob&&this.updateKnob(this.endKnob,Re(this,pt)[1])}onKnobDrag(r){if(r.target instanceof sr||this.classList.contains("has-value")||this.classList.contains("has-focus")){let e;const t=i=>{let s=0;i.type==="touchmove"||i.type==="touchstart"?s=i.touches[0].clientX:s=i.clientX,s=s-this.track.getBoundingClientRect().left,e||(e=this.chooseKnob(s),e.classList.add("focus")),this.updateKnob(e,this.applyConstraints(this.toValueSpace(s),e.id==="start"))},n=()=>{document.removeEventListener("mousemove",t),document.removeEventListener("touchmove",t),document.removeEventListener("mouseup",n),document.removeEventListener("touchend",n),e&&(e.classList.remove("focus"),this.range!==void 0?e.id==="end"?this.value=JSON.stringify([Re(this,pt)[0],e.value]):this.value=JSON.stringify([e.value,Re(this,pt)[1]]):this.value=String(e.value)),e=void 0};this.sliderElement.focus(),document.addEventListener("mousemove",t),document.addEventListener("touchmove",t),document.addEventListener("mouseup",n),document.addEventListener("touchend",n),t(r)}}renderInput(){return ut`
|
|
235
|
+
${super.renderInput()}
|
|
236
|
+
<div id="slider" part="slider" tabindex="0" ?range="${this.range!==void 0}">
|
|
237
|
+
<div id="track"></div>
|
|
238
|
+
<rokit-slider-knob id="start"></rokit-slider-knob>
|
|
239
|
+
${this.range===void 0?ke:ut`
|
|
240
|
+
<rokit-slider-knob id="end"></rokit-slider-knob>
|
|
241
|
+
`}
|
|
242
|
+
</div>
|
|
243
|
+
`}};Oe=new WeakMap;pt=new WeakMap;Yt=new WeakMap;mt.styles=[...De.styles,vt`
|
|
244
|
+
:host(.has-label:not(:focus):not(.has-value):not([sticky])) #slider > * { visibility: hidden; }
|
|
245
|
+
:host(.has-label) .wrapper { padding-top: 1em; }
|
|
246
|
+
:host([sticky]) #slider { margin-top: ${.25*It+22}px; }
|
|
247
|
+
#input { display: none; }
|
|
248
|
+
#slider { display: flex; position: relative; align-items: center; width: 100%; height: ${It}px; padding: 0 ${It/2}px; outline: 0; }
|
|
249
|
+
:host(:not([sticky])) #slider:not(:focus) rokit-slider-knob::part(label) { color: transparent; background-color: transparent; border-color: transparent; top: 0; }
|
|
250
|
+
#track { height: 2px; flex-grow: 1; background-color: #CCC; }
|
|
251
|
+
#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; }
|
|
252
|
+
`];ft([_e()],mt.prototype,"range",2);ft([_e()],mt.prototype,"labelFormatter",2);ft([ct("#slider")],mt.prototype,"sliderElement",2);ft([ct("#track")],mt.prototype,"track",2);ft([ct("#start")],mt.prototype,"startKnob",2);ft([ct("#end")],mt.prototype,"endKnob",2);mt=ft([Gt("rokit-slider")],mt);let sr=class extends Bt{constructor(){super(...arguments),this.offset=0,this.label="",this.value=0}updated(r){r.has("offset")&&(this.style.left=this.offset+"px")}render(){return ut`<label part="label">${this.label}</label>`}};sr.styles=[vt`
|
|
253
|
+
:host { position: absolute; width: ${It}px; height: ${It}px; border-radius: ${It}px; background-color: var(--rokit-primary-color-inner); }
|
|
254
|
+
:host(.focus), :host(:hover) { box-shadow: 0 0 0 ${It/2}px var(--rokit-primary-color-transparent-inner); z-index: 1; }
|
|
255
|
+
label {
|
|
256
|
+
position: absolute;
|
|
257
|
+
top: calc(-2em - ${It/4}px);
|
|
258
|
+
left: 50%;
|
|
259
|
+
transform: translate(-50%, 0);
|
|
260
|
+
white-space: nowrap;
|
|
261
|
+
font-size: 0.75em;
|
|
262
|
+
font-weight: 500;
|
|
263
|
+
transition-property: top color background-color;
|
|
264
|
+
transition-duration: var(--rokit-transition-duration-inner);
|
|
265
|
+
pointer-events: none;
|
|
266
|
+
color: white;
|
|
267
|
+
background-color: var(--rokit-primary-color-inner);
|
|
268
|
+
padding: 0 4px;
|
|
269
|
+
border-radius: 3px;
|
|
270
|
+
}
|
|
271
|
+
label:after {
|
|
272
|
+
content: '';
|
|
273
|
+
width: 10px;
|
|
274
|
+
height: 10px;
|
|
275
|
+
position: absolute;
|
|
276
|
+
left: 50%;
|
|
277
|
+
bottom: -4px;
|
|
278
|
+
transform: translate(-50%, 0);
|
|
279
|
+
background-color: inherit;
|
|
280
|
+
clip-path: polygon(50% 50%, 100% 50%, 50% 100%, 0 50%);
|
|
281
|
+
}
|
|
282
|
+
`];ft([_e()],sr.prototype,"offset",2);ft([_e()],sr.prototype,"label",2);sr=ft([Gt("rokit-slider-knob")],sr);class Rn extends HTMLElement{constructor(e,t,n,i){if(super(),this.template=new fd(n.store.getQuads(e,null,null,null),t,n),this.template.order!==void 0&&(this.style.order=`${this.template.order}`),this.template.cssClass&&this.classList.add(this.template.cssClass),n.editMode&&!t.linked&&(this.addButton=this.createAddButton(),this.appendChild(this.addButton)),this.template.path){let s=[];i&&(t.linked?s=n.store.getQuads(i,this.template.path,null,null):s=n.store.getQuads(i,this.template.path,null,ot));let a=!1;for(const o of s)this.isValueValid(o.object)&&(this.addPropertyInstance(o.object),this.template.hasValue&&o.object.equals(this.template.hasValue)&&(a=!0));n.editMode&&this.template.hasValue&&!a&&!t.linked&&this.addPropertyInstance(this.template.hasValue)}if(n.editMode&&!t.linked&&(this.addEventListener("change",()=>{this.updateControls()}),this.updateControls()),this.template.extendedShapes.length&&this.template.config.attributes.collapse!==null&&(!this.template.maxCount||this.template.maxCount>1)&&(n.editMode&&!t.linked||this.childElementCount>0)){const s=this;s.classList.add("collapsible"),this.template.config.attributes.collapse==="open"&&s.classList.add("open");const a=document.createElement("h1");a.classList.add("activator"),a.innerText=this.template.label,a.addEventListener("click",()=>{s.classList.toggle("open")}),this.prepend(a)}}addPropertyInstance(e){var n,i,s;let t;if((n=this.template.shaclOr)!=null&&n.length||(i=this.template.shaclXone)!=null&&i.length){const a=(s=this.template.shaclOr)!=null&&s.length?this.template.shaclOr:this.template.shaclXone;let o=!1;if(e){const l=ud(a,e,this.template.config);l.length&&(t=mn(this.template.clone().merge(l),e,!0),o=!0)}o||(t=ku(a,this,this.template.config),Yu(t,""))}else{let a=!1;if(e){const o=this.getRdfClassToLinkOrCreate();o&&this.template.config.store.countQuads(e,qe,o,ot)===0&&(a=!0)}t=mn(this.template,e,void 0,a||this.template.parent.linked)}return this.addButton?this.insertBefore(t,this.addButton):this.appendChild(t),t}updateControls(){let e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length;e===0&&(!this.template.extendedShapes.length||this.template.minCount!==void 0&&this.template.minCount>0)&&(this.addPropertyInstance(),e=this.querySelectorAll(":scope > .property-instance, :scope > .shacl-or-constraint, :scope > shacl-node").length);let t;this.template.minCount!==void 0?t=e>this.template.minCount:t=this.template.extendedShapes.length>0||e>1;const n=this.template.maxCount===void 0||e<this.template.maxCount;this.classList.toggle("may-remove",t),this.classList.toggle("may-add",n)}toRDF(e,t){for(const n of this.querySelectorAll(":scope > .property-instance")){const i=Se.namedNode(n.dataset.path);if(n.firstChild instanceof Nt){const s=n.firstChild.toRDF(e);e.addQuad(t,i,s,this.template.config.valuesGraphId)}else for(const s of n.querySelectorAll(":scope > .editor")){const a=bd(s);a&&e.addQuad(t,i,a,this.template.config.valuesGraphId)}}}getRdfClassToLinkOrCreate(){if(this.template.class&&this.template.node)return this.template.class;for(const e of this.template.extendedShapes){const t=this.template.config.store.getObjects(e,zr,null);if(t.length>0)return t[0]}}isValueValid(e){if(!this.template.extendedShapes.length)return!0;for(const t of this.template.extendedShapes){const n=this.template.config.store.getObjects(t,zr,null);for(const i of n)if(this.template.config.store.countQuads(e,qe,i,null)>0)return!0}return!1}createAddButton(){const e=new Me;e.dense=!0,e.label="+ "+this.template.label,e.title="Add "+this.template.label,e.classList.add("add-button");let t=[],n=this.getRdfClassToLinkOrCreate();if(n&&(t=Sn(n,this.template)),t.length===0)e.emptyMessage="",e.inputMinWidth=0,e.addEventListener("click",i=>{e.blur();const s=this.addPropertyInstance();s.classList.add("fadeIn"),this.updateControls(),setTimeout(()=>{ld(s),s.classList.remove("fadeIn")},200)});else{const i=document.createElement("ul"),s=document.createElement("li");s.innerHTML="+ Create new "+this.template.label+"...",s.dataset.value="new",s.classList.add("large"),i.appendChild(s);const a=document.createElement("li");a.classList.add("divider"),i.appendChild(a);const o=document.createElement("li");o.classList.add("header"),o.innerText="Or link existing:",i.appendChild(o);for(const l of t){const u=document.createElement("li"),h=typeof l.value=="string"?l.value:l.value.value;u.innerText=l.label?l.label:h,u.dataset.value=JSON.stringify(l.value),i.appendChild(u)}e.appendChild(i),e.collapsibleWidth="250px",e.collapsibleOrientationLeft="",e.addEventListener("change",()=>{if(e.value==="new")this.addPropertyInstance();else{const l=JSON.parse(e.value);this.insertBefore(mn(this.template,l,!0,!0),e)}e.value=""})}return e}}function mn(r,e,t=!1,n=!1){var s;let i;if(r.extendedShapes.length){i=document.createElement("div"),i.classList.add("property-instance");for(const a of r.extendedShapes)i.appendChild(new Nt(a,r.config,e,r.parent,r.nodeKind,r.label,n))}else{const a=_d(r.path,(s=r.datatype)==null?void 0:s.value);a?r.config.editMode&&!n?i=a.createEditor(r,e):i=a.createViewer(r,e):i=gd(r,e||null,r.config.editMode&&!n),i.classList.add("property-instance"),n&&i.classList.add("linked")}return r.config.editMode&&Yu(i,r.label,t),i.dataset.path=r.path,i}function Yu(r,e,t=!1){const n=new Xr;n.classList.add("remove-button","clear"),n.title="Remove "+e,n.dense=!0,n.addEventListener("click",i=>{r.classList.remove("fadeIn"),r.classList.add("fadeOut"),setTimeout(()=>{const s=r.parentElement;r.remove(),s==null||s.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))},200)}),t&&n.classList.add("persistent"),r.appendChild(n)}window.customElements.define("shacl-property",Rn);function bf(r,e){const t=document.createElement("div");t.dataset.subject=r,t.classList.add("shacl-group");let n=r;const i=e.store.getQuads(r,null,null,null),s=Fr(i,"label",Ys,e.languages);s&&(n=s);const a=Fr(i,"order");a&&(t.style.order=a);const o=document.createElement("h1");return o.innerText=n,t.appendChild(o),e.attributes.collapse!==null&&(t.classList.add("collapsible"),e.attributes.collapse==="open"&&t.classList.add("open"),o.classList.add("activator"),o.addEventListener("click",()=>{t.classList.toggle("open")})),t}const Pe=[];for(let r=0;r<256;++r)Pe.push((r+256).toString(16).slice(1));function wf(r,e=0){return(Pe[r[e+0]]+Pe[r[e+1]]+Pe[r[e+2]]+Pe[r[e+3]]+"-"+Pe[r[e+4]]+Pe[r[e+5]]+"-"+Pe[r[e+6]]+Pe[r[e+7]]+"-"+Pe[r[e+8]]+Pe[r[e+9]]+"-"+Pe[r[e+10]]+Pe[r[e+11]]+Pe[r[e+12]]+Pe[r[e+13]]+Pe[r[e+14]]+Pe[r[e+15]]).toLowerCase()}let Ii;const vf=new Uint8Array(16);function _f(){if(!Ii){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Ii=crypto.getRandomValues.bind(crypto)}return Ii(vf)}const xf=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Do={randomUUID:xf};function Mo(r,e,t){var i;if(Do.randomUUID&&!r)return Do.randomUUID();r=r||{};const n=r.random??((i=r.rng)==null?void 0:i.call(r))??_f();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,wf(n)}class Nt extends HTMLElement{constructor(e,t,n,i,s,a,o){super(),this.owlImports=[],this.parent=i,this.config=t,this.shaclSubject=e,this.linked=o||!1;let l=n;if(!l){if(!s){const h=t.store.getObjects(e,`${be}nodeKind`,null);h.length&&(s=h[0])}s===void 0&&t.attributes.valuesNamespace||(s==null?void 0:s.value)===`${be}IRI`?l=Se.namedNode(t.attributes.valuesNamespace+Mo()):l=Se.blankNode(Mo())}this.nodeId=l;const u=JSON.stringify([e,n]);if(n&&t.renderedNodes.has(u)){a=a||"Link";const h=document.createElement("label");h.innerText=a,h.classList.add("linked"),this.appendChild(h);const y=document.createElement("a");let b=n.termType==="BlankNode"?"_:"+n.value:n.value;y.innerText=b,y.classList.add("ref-link"),y.onclick=()=>{var g;(g=this.config.form.querySelector(`shacl-node[data-node-id='${b}']`))==null||g.scrollIntoView()},this.appendChild(y),this.style.flexDirection="row"}else{if(n&&t.renderedNodes.add(u),this.dataset.nodeId=this.nodeId.id,this.config.attributes.showNodeIds!==null){const h=document.createElement("div");h.innerText=`id: ${this.nodeId.id}`,h.classList.add("node-id-display"),this.appendChild(h)}for(const h of t.store.getQuads(e,Zs,null,null))this.owlImports.push(h.object);for(const h of t.store.getQuads(e,null,null,null))switch(h.predicate.id){case xn.id:this.addPropertyInstance(h.object,t,n);break;case`${be}and`:const y=t.lists[h.object.value];if(y!=null&&y.length)for(const b of y)this.prepend(new Nt(b,t,n,this));else console.error("list not found:",h.object.value,"existing lists:",t.lists);break;case`${be}node`:this.prepend(new Nt(h.object,t,n,this));break;case`${be}targetClass`:this.targetClass=h.object;break;case`${be}or`:this.tryResolve(h.object,n,t);break;case`${be}xone`:this.tryResolve(h.object,n,t);break}if(a){const h=document.createElement("h1");h.innerText=a,this.prepend(h)}}}toRDF(e,t){if(t||(t=this.nodeId),!this.linked){for(const n of this.querySelectorAll(":scope > shacl-node, :scope > .shacl-group > shacl-node, :scope > shacl-property, :scope > .shacl-group > shacl-property"))n.toRDF(e,t);this.targetClass&&e.addQuad(t,qe,this.targetClass,this.config.valuesGraphId),this.config.attributes.generateNodeShapeReference&&!this.parent&&e.addQuad(t,Se.namedNode(this.config.attributes.generateNodeShapeReference),this.shaclSubject,this.config.valuesGraphId)}return t}addPropertyInstance(e,t,n){let i=this;const s=t.store.getQuads(e,`${be}group`,null,null);if(s.length>0){const o=s[0].object.value;if(t.groups.indexOf(o)>-1){let l=this.querySelector(`:scope > .shacl-group[data-subject='${o}']`);l||(l=bf(o,t),this.appendChild(l)),i=l}else console.warn("ignoring unknown group reference",s[0],"existing groups:",t.groups)}const a=new Rn(e,this,t,n);a.childElementCount>0&&i.appendChild(a)}tryResolve(e,t,n){const i=n.lists[e.value];if(i!=null&&i.length){let s=!1;if(t){const a=cd(i,t,n);if(a.length){for(const o of a)this.addPropertyInstance(o,n,t);s=!0}}s||this.appendChild(ku(i,this,n))}else console.error("list for sh:or/sh:xone not found:",e,"existing lists:",n.lists)}}window.customElements.define("shacl-node",Nt);var Ri={},Ni,Po;function la(){return Po||(Po=1,Ni=class Zu{constructor(e,t=new Map,n=0){this.prefix=e,this._existing=t,this.counter=n}clone(){const{prefix:e,_existing:t,counter:n}=this;return new Zu(e,new Map(t),n)}getId(e){const t=e&&this._existing.get(e);if(t)return t;const n=this.prefix+this.counter;return this.counter++,e&&this._existing.set(e,n),n}hasId(e){return this._existing.has(e)}getOldIds(){return[...this._existing.keys()]}}),Ni}var Ti={},Co;function Sf(){return Co||(Co=1,function(r,e){if(r.setImmediate)return;var t=1,n={},i=!1,s=r.document,a;function o(I){typeof I!="function"&&(I=new Function(""+I));for(var w=new Array(arguments.length-1),d=0;d<w.length;d++)w[d]=arguments[d+1];var p={callback:I,args:w};return n[t]=p,a(t),t++}function l(I){delete n[I]}function u(I){var w=I.callback,d=I.args;switch(d.length){case 0:w();break;case 1:w(d[0]);break;case 2:w(d[0],d[1]);break;case 3:w(d[0],d[1],d[2]);break;default:w.apply(e,d);break}}function h(I){if(i)setTimeout(h,0,I);else{var w=n[I];if(w){i=!0;try{u(w)}finally{l(I),i=!1}}}}function y(){a=function(I){process.nextTick(function(){h(I)})}}function b(){if(r.postMessage&&!r.importScripts){var I=!0,w=r.onmessage;return r.onmessage=function(){I=!1},r.postMessage("","*"),r.onmessage=w,I}}function g(){var I="setImmediate$"+Math.random()+"$",w=function(d){d.source===r&&typeof d.data=="string"&&d.data.indexOf(I)===0&&h(+d.data.slice(I.length))};r.addEventListener?r.addEventListener("message",w,!1):r.attachEvent("onmessage",w),a=function(d){r.postMessage(I+d,"*")}}function m(){var I=new MessageChannel;I.port1.onmessage=function(w){var d=w.data;h(d)},a=function(w){I.port2.postMessage(w)}}function _(){var I=s.documentElement;a=function(w){var d=s.createElement("script");d.onreadystatechange=function(){h(w),d.onreadystatechange=null,I.removeChild(d),d=null},I.appendChild(d)}}function x(){a=function(I){setTimeout(h,0,I)}}var S=Object.getPrototypeOf&&Object.getPrototypeOf(r);S=S&&S.setTimeout?S:r,{}.toString.call(r.process)==="[object process]"?y():b()?g():r.MessageChannel?m():s&&"onreadystatechange"in s.createElement("script")?_():x(),S.setImmediate=o,S.clearImmediate=l}(typeof self>"u"?typeof Zt>"u"?Ti:Zt:self)),Ti}/*!
|
|
283
|
+
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
284
|
+
*/var Ai,qo;function Pn(){if(qo)return Ai;qo=1,Sf();const r=self.crypto||self.msCrypto;return Ai=class{constructor(t){if(!(r&&r.subtle))throw new Error("crypto.subtle not found.");if(t==="sha256")this.algorithm={name:"SHA-256"};else if(t==="sha1")this.algorithm={name:"SHA-1"};else throw new Error(`Unsupported algorithm "${t}".`);this._content=""}update(t){this._content+=t}async digest(){const t=new TextEncoder().encode(this._content),n=new Uint8Array(await r.subtle.digest(this.algorithm,t));let i="";for(let s=0;s<n.length;++s)i+=n[s].toString(16).padStart(2,"0");return i}},Ai}/*!
|
|
285
|
+
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
286
|
+
*/var Li,Bo;function ec(){return Bo||(Bo=1,Li=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(){const{current:e,dir:t}=this,n=e.slice();let i=null,s=0;const a=e.length;for(let o=0;o<a;++o){const l=e[o],u=t.get(l);(i===null||l>i)&&(u&&o>0&&l>e[o-1]||!u&&o<a-1&&l>e[o+1])&&(i=l,s=o)}if(i===null)this.done=!0;else{const o=t.get(i)?s-1:s+1;e[s]=e[o],e[o]=i;for(const l of e)l>i&&t.set(l,!t.get(l))}return n}}),Li}/*!
|
|
287
|
+
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
288
|
+
*/var ji,Fo;function ua(){if(Fo)return ji;Fo=1;const e="http://www.w3.org/1999/02/22-rdf-syntax-ns#"+"langString",t="http://www.w3.org/2001/XMLSchema#string",n="NamedNode",i="BlankNode",s="Literal",a="DefaultGraph",o={};(()=>{const g="(?:<([^:]+:[^>]*)>)",_="A-Za-zÀ-ÖØ-öø-˿Ͱ-ͽͿ--⁰-Ⰰ-、-豈-﷏ﷰ-�"+"_",x=_+"0-9-·̀-ͯ‿-⁀",I="(_:(?:["+_+"0-9])(?:(?:["+x+".])*(?:["+x+"]))?)",w='"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"',d="(?:\\^\\^"+g+")",N="(?:"+w+"(?:"+d+"|"+"(?:@([a-zA-Z]+(?:-[a-zA-Z0-9]+)*))"+")?)",D="[ \\t]+",T="[ \\t]*",q="(?:"+g+"|"+I+")"+D,R=g+D,M="(?:"+g+"|"+I+"|"+N+")"+T,B="(?:\\.|(?:(?:"+g+"|"+I+")"+T+"\\.))";o.eoln=/(?:\r\n)|(?:\n)|(?:\r)/g,o.empty=new RegExp("^"+T+"$"),o.quad=new RegExp("^"+T+q+R+M+B+T+"$")})(),ji=class bn{static parse(m){const _=[],x={},S=m.split(o.eoln);let I=0;for(const w of S){if(I++,o.empty.test(w))continue;const d=w.match(o.quad);if(d===null)throw new Error("N-Quads parse error on line "+I+".");const p={subject:null,predicate:null,object:null,graph:null};if(d[1]!==void 0?p.subject={termType:n,value:d[1]}:p.subject={termType:i,value:d[2]},p.predicate={termType:n,value:d[3]},d[4]!==void 0?p.object={termType:n,value:d[4]}:d[5]!==void 0?p.object={termType:i,value:d[5]}:(p.object={termType:s,value:void 0,datatype:{termType:n}},d[7]!==void 0?p.object.datatype.value=d[7]:d[8]!==void 0?(p.object.datatype.value=e,p.object.language=d[8]):p.object.datatype.value=t,p.object.value=b(d[6])),d[9]!==void 0?p.graph={termType:n,value:d[9]}:d[10]!==void 0?p.graph={termType:i,value:d[10]}:p.graph={termType:a,value:""},!(p.graph.value in x))x[p.graph.value]=[p],_.push(p);else{let N=!0;const D=x[p.graph.value];for(const T of D)if(l(T,p)){N=!1;break}N&&(D.push(p),_.push(p))}}return _}static serialize(m){Array.isArray(m)||(m=bn.legacyDatasetToQuads(m));const _=[];for(const x of m)_.push(bn.serializeQuad(x));return _.sort().join("")}static serializeQuadComponents(m,_,x,S){let I="";return m.termType===n?I+=`<${m.value}>`:I+=`${m.value}`,I+=` <${_.value}> `,x.termType===n?I+=`<${x.value}>`:x.termType===i?I+=x.value:(I+=`"${h(x.value)}"`,x.datatype.value===e?x.language&&(I+=`@${x.language}`):x.datatype.value!==t&&(I+=`^^<${x.datatype.value}>`)),S.termType===n?I+=` <${S.value}>`:S.termType===i&&(I+=` ${S.value}`),I+=` .
|
|
289
|
+
`,I}static serializeQuad(m){return bn.serializeQuadComponents(m.subject,m.predicate,m.object,m.graph)}static legacyDatasetToQuads(m){const _=[],x={"blank node":i,IRI:n,literal:s};for(const S in m)m[S].forEach(w=>{const d={};for(const p in w){const N=w[p],D={termType:x[N.type],value:N.value};D.termType===s&&(D.datatype={termType:n},"datatype"in N&&(D.datatype.value=N.datatype),"language"in N?("datatype"in N||(D.datatype.value=e),D.language=N.language):"datatype"in N||(D.datatype.value=t)),d[p]=D}S==="@default"?d.graph={termType:a,value:""}:d.graph={termType:S.startsWith("_:")?i:n,value:S},_.push(d)});return _}};function l(g,m){return!(g.subject.termType===m.subject.termType&&g.object.termType===m.object.termType)||!(g.subject.value===m.subject.value&&g.predicate.value===m.predicate.value&&g.object.value===m.object.value)?!1:g.object.termType!==s?!0:g.object.datatype.termType===m.object.datatype.termType&&g.object.language===m.object.language&&g.object.datatype.value===m.object.datatype.value}const u=/["\\\n\r]/g;function h(g){return g.replace(u,function(m){switch(m){case'"':return'\\"';case"\\":return"\\\\";case`
|
|
290
|
+
`:return"\\n";case"\r":return"\\r"}})}const y=/(?:\\([tbnrf"'\\]))|(?:\\u([0-9A-Fa-f]{4}))|(?:\\U([0-9A-Fa-f]{8}))/g;function b(g){return g.replace(y,function(m,_,x,S){if(_)switch(_){case"t":return" ";case"b":return"\b";case"n":return`
|
|
291
|
+
`;case"r":return"\r";case"f":return"\f";case'"':return'"';case"'":return"'";case"\\":return"\\"}if(x)return String.fromCharCode(parseInt(x,16));if(S)throw new Error("Unsupported U escape")})}return ji}/*!
|
|
292
|
+
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
293
|
+
*/var Oi,Uo;function tc(){if(Uo)return Oi;Uo=1;const r=la(),e=Pn(),t=ec(),n=ua();Oi=class{constructor({createMessageDigest:a=()=>new e("sha256"),canonicalIdMap:o=new Map,maxDeepIterations:l=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",o),this.createMessageDigest=a,this.maxDeepIterations=l,this.quads=null,this.deepIterations=null}async main(a){this.deepIterations=new Map,this.quads=a;for(const g of a)this._addBlankNodeQuadInfo({quad:g,component:g.subject}),this._addBlankNodeQuadInfo({quad:g,component:g.object}),this._addBlankNodeQuadInfo({quad:g,component:g.graph});const o=new Map,l=[...this.blankNodeInfo.keys()];let u=0;for(const g of l)++u%100===0&&await this._yield(),await this._hashAndTrackBlankNode({id:g,hashToBlankNodes:o});const h=[...o.keys()].sort(),y=[];for(const g of h){const m=o.get(g);if(m.length>1){y.push(m);continue}const _=m[0];this.canonicalIssuer.getId(_)}for(const g of y){const m=[];for(const _ of g){if(this.canonicalIssuer.hasId(_))continue;const x=new r("_:b");x.getId(_);const S=await this.hashNDegreeQuads(_,x);m.push(S)}m.sort(i);for(const _ of m){const x=_.issuer.getOldIds();for(const S of x)this.canonicalIssuer.getId(S)}}const b=[];for(const g of this.quads){const m=n.serializeQuadComponents(this._componentWithCanonicalId(g.subject),g.predicate,this._componentWithCanonicalId(g.object),this._componentWithCanonicalId(g.graph));b.push(m)}return b.sort(),b.join("")}async hashFirstDegreeQuads(a){const o=[],l=this.blankNodeInfo.get(a),u=l.quads;for(const y of u){const b={subject:null,predicate:y.predicate,object:null,graph:null};b.subject=this.modifyFirstDegreeComponent(a,y.subject,"subject"),b.object=this.modifyFirstDegreeComponent(a,y.object,"object"),b.graph=this.modifyFirstDegreeComponent(a,y.graph,"graph"),o.push(n.serializeQuad(b))}o.sort();const h=this.createMessageDigest();for(const y of o)h.update(y);return l.hash=await h.digest(),l.hash}async hashRelatedBlankNode(a,o,l,u){let h;this.canonicalIssuer.hasId(a)?h=this.canonicalIssuer.getId(a):l.hasId(a)?h=l.getId(a):h=this.blankNodeInfo.get(a).hash;const y=this.createMessageDigest();return y.update(u),u!=="g"&&y.update(this.getRelatedPredicate(o)),y.update(h),y.digest()}async hashNDegreeQuads(a,o){const l=this.deepIterations.get(a)||0;if(l>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(a,l+1);const u=this.createMessageDigest(),h=await this.createHashToRelated(a,o),y=[...h.keys()].sort();for(const b of y){u.update(b);let g="",m;const _=new t(h.get(b));let x=0;for(;_.hasNext();){const S=_.next();++x%3===0&&await this._yield();let I=o.clone(),w="";const d=[];let p=!1;for(const N of S)if(this.canonicalIssuer.hasId(N)?w+=this.canonicalIssuer.getId(N):(I.hasId(N)||d.push(N),w+=I.getId(N)),g.length!==0&&w>g){p=!0;break}if(!p){for(const N of d){const D=await this.hashNDegreeQuads(N,I);if(w+=I.getId(N),w+=`<${D.hash}>`,I=D.issuer,g.length!==0&&w>g){p=!0;break}}p||(g.length===0||w<g)&&(g=w,m=I)}}u.update(g),o=m}return{hash:await u.digest(),issuer:o}}modifyFirstDegreeComponent(a,o){return o.termType!=="BlankNode"?o:{termType:"BlankNode",value:o.value===a?"_:a":"_:z"}}getRelatedPredicate(a){return`<${a.predicate.value}>`}async createHashToRelated(a,o){const l=new Map,u=this.blankNodeInfo.get(a).quads;let h=0;for(const y of u)++h%100===0&&await this._yield(),await Promise.all([this._addRelatedBlankNodeHash({quad:y,component:y.subject,position:"s",id:a,issuer:o,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:y,component:y.object,position:"o",id:a,issuer:o,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:y,component:y.graph,position:"g",id:a,issuer:o,hashToRelated:l})]);return l}async _hashAndTrackBlankNode({id:a,hashToBlankNodes:o}){const l=await this.hashFirstDegreeQuads(a),u=o.get(l);u?u.push(a):o.set(l,[a])}_addBlankNodeQuadInfo({quad:a,component:o}){if(o.termType!=="BlankNode")return;const l=o.value,u=this.blankNodeInfo.get(l);u?u.quads.add(a):this.blankNodeInfo.set(l,{quads:new Set([a]),hash:null})}async _addRelatedBlankNodeHash({quad:a,component:o,position:l,id:u,issuer:h,hashToRelated:y}){if(!(o.termType==="BlankNode"&&o.value!==u))return;const b=o.value,g=await this.hashRelatedBlankNode(b,a,h,l),m=y.get(g);m?m.push(b):y.set(g,[b])}_componentWithCanonicalId(a){return a.termType==="BlankNode"&&!a.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(a.value)}:a}async _yield(){return new Promise(a=>setImmediate(a))}};function i(s,a){return s.hash<a.hash?-1:s.hash>a.hash?1:0}return Oi}/*!
|
|
294
|
+
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
295
|
+
*/var $i,Ho;function Ef(){if(Ho)return $i;Ho=1;const r=Pn(),e=tc();return $i=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(n,i,s){return i.termType!=="BlankNode"?i:s==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:i.value===n?"_:a":"_:z"}}getRelatedPredicate(n){return n.predicate.value}async createHashToRelated(n,i){const s=new Map,a=this.blankNodeInfo.get(n).quads;let o=0;for(const l of a){let u,h;if(l.subject.termType==="BlankNode"&&l.subject.value!==n)h=l.subject.value,u="p";else if(l.object.termType==="BlankNode"&&l.object.value!==n)h=l.object.value,u="r";else continue;++o%100===0&&await this._yield();const y=await this.hashRelatedBlankNode(h,l,i,u),b=s.get(y);b?b.push(h):s.set(y,[h])}return s}},$i}/*!
|
|
296
|
+
* Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
|
|
297
|
+
*/var ki,Vo;function rc(){if(Vo)return ki;Vo=1;const r=la(),e=Pn(),t=ec(),n=ua();ki=class{constructor({createMessageDigest:a=()=>new e("sha256"),canonicalIdMap:o=new Map,maxDeepIterations:l=1/0}={}){this.name="URDNA2015",this.blankNodeInfo=new Map,this.canonicalIssuer=new r("_:c14n",o),this.createMessageDigest=a,this.maxDeepIterations=l,this.quads=null,this.deepIterations=null}main(a){this.deepIterations=new Map,this.quads=a;for(const b of a)this._addBlankNodeQuadInfo({quad:b,component:b.subject}),this._addBlankNodeQuadInfo({quad:b,component:b.object}),this._addBlankNodeQuadInfo({quad:b,component:b.graph});const o=new Map,l=[...this.blankNodeInfo.keys()];for(const b of l)this._hashAndTrackBlankNode({id:b,hashToBlankNodes:o});const u=[...o.keys()].sort(),h=[];for(const b of u){const g=o.get(b);if(g.length>1){h.push(g);continue}const m=g[0];this.canonicalIssuer.getId(m)}for(const b of h){const g=[];for(const m of b){if(this.canonicalIssuer.hasId(m))continue;const _=new r("_:b");_.getId(m);const x=this.hashNDegreeQuads(m,_);g.push(x)}g.sort(i);for(const m of g){const _=m.issuer.getOldIds();for(const x of _)this.canonicalIssuer.getId(x)}}const y=[];for(const b of this.quads){const g=n.serializeQuadComponents(this._componentWithCanonicalId({component:b.subject}),b.predicate,this._componentWithCanonicalId({component:b.object}),this._componentWithCanonicalId({component:b.graph}));y.push(g)}return y.sort(),y.join("")}hashFirstDegreeQuads(a){const o=[],l=this.blankNodeInfo.get(a),u=l.quads;for(const y of u){const b={subject:null,predicate:y.predicate,object:null,graph:null};b.subject=this.modifyFirstDegreeComponent(a,y.subject,"subject"),b.object=this.modifyFirstDegreeComponent(a,y.object,"object"),b.graph=this.modifyFirstDegreeComponent(a,y.graph,"graph"),o.push(n.serializeQuad(b))}o.sort();const h=this.createMessageDigest();for(const y of o)h.update(y);return l.hash=h.digest(),l.hash}hashRelatedBlankNode(a,o,l,u){let h;this.canonicalIssuer.hasId(a)?h=this.canonicalIssuer.getId(a):l.hasId(a)?h=l.getId(a):h=this.blankNodeInfo.get(a).hash;const y=this.createMessageDigest();return y.update(u),u!=="g"&&y.update(this.getRelatedPredicate(o)),y.update(h),y.digest()}hashNDegreeQuads(a,o){const l=this.deepIterations.get(a)||0;if(l>this.maxDeepIterations)throw new Error(`Maximum deep iterations (${this.maxDeepIterations}) exceeded.`);this.deepIterations.set(a,l+1);const u=this.createMessageDigest(),h=this.createHashToRelated(a,o),y=[...h.keys()].sort();for(const b of y){u.update(b);let g="",m;const _=new t(h.get(b));for(;_.hasNext();){const x=_.next();let S=o.clone(),I="";const w=[];let d=!1;for(const p of x)if(this.canonicalIssuer.hasId(p)?I+=this.canonicalIssuer.getId(p):(S.hasId(p)||w.push(p),I+=S.getId(p)),g.length!==0&&I>g){d=!0;break}if(!d){for(const p of w){const N=this.hashNDegreeQuads(p,S);if(I+=S.getId(p),I+=`<${N.hash}>`,S=N.issuer,g.length!==0&&I>g){d=!0;break}}d||(g.length===0||I<g)&&(g=I,m=S)}}u.update(g),o=m}return{hash:u.digest(),issuer:o}}modifyFirstDegreeComponent(a,o){return o.termType!=="BlankNode"?o:{termType:"BlankNode",value:o.value===a?"_:a":"_:z"}}getRelatedPredicate(a){return`<${a.predicate.value}>`}createHashToRelated(a,o){const l=new Map,u=this.blankNodeInfo.get(a).quads;for(const h of u)this._addRelatedBlankNodeHash({quad:h,component:h.subject,position:"s",id:a,issuer:o,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:h,component:h.object,position:"o",id:a,issuer:o,hashToRelated:l}),this._addRelatedBlankNodeHash({quad:h,component:h.graph,position:"g",id:a,issuer:o,hashToRelated:l});return l}_hashAndTrackBlankNode({id:a,hashToBlankNodes:o}){const l=this.hashFirstDegreeQuads(a),u=o.get(l);u?u.push(a):o.set(l,[a])}_addBlankNodeQuadInfo({quad:a,component:o}){if(o.termType!=="BlankNode")return;const l=o.value,u=this.blankNodeInfo.get(l);u?u.quads.add(a):this.blankNodeInfo.set(l,{quads:new Set([a]),hash:null})}_addRelatedBlankNodeHash({quad:a,component:o,position:l,id:u,issuer:h,hashToRelated:y}){if(!(o.termType==="BlankNode"&&o.value!==u))return;const b=o.value,g=this.hashRelatedBlankNode(b,a,h,l),m=y.get(g);m?m.push(b):y.set(g,[b])}_componentWithCanonicalId({component:a}){return a.termType==="BlankNode"&&!a.value.startsWith(this.canonicalIssuer.prefix)?{termType:"BlankNode",value:this.canonicalIssuer.getId(a.value)}:a}};function i(s,a){return s.hash<a.hash?-1:s.hash>a.hash?1:0}return ki}/*!
|
|
298
|
+
* Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
|
|
299
|
+
*/var Di,Go;function If(){if(Go)return Di;Go=1;const r=Pn(),e=rc();return Di=class extends e{constructor(){super(),this.name="URGNA2012",this.createMessageDigest=()=>new r("sha1")}modifyFirstDegreeComponent(n,i,s){return i.termType!=="BlankNode"?i:s==="graph"?{termType:"BlankNode",value:"_:g"}:{termType:"BlankNode",value:i.value===n?"_:a":"_:z"}}getRelatedPredicate(n){return n.predicate.value}createHashToRelated(n,i){const s=new Map,a=this.blankNodeInfo.get(n).quads;for(const o of a){let l,u;if(o.subject.termType==="BlankNode"&&o.subject.value!==n)u=o.subject.value,l="p";else if(o.object.termType==="BlankNode"&&o.object.value!==n)u=o.object.value,l="r";else continue;const h=this.hashRelatedBlankNode(u,o,i,l),y=s.get(h);y?y.push(u):s.set(h,[u])}return s}},Di}const Rf={},Nf=Object.freeze(Object.defineProperty({__proto__:null,default:Rf},Symbol.toStringTag,{value:"Module"})),Tf=Rc(Nf);var Wo;function Af(){return Wo||(Wo=1,function(r){const e=tc(),t=Ef(),n=rc(),i=If();let s;try{s=Tf}catch{}function a(o){return Array.isArray(o)?o:r.NQuads.legacyDatasetToQuads(o)}r.NQuads=ua(),r.IdentifierIssuer=la(),r._rdfCanonizeNative=function(o){return o&&(s=o),s},r.canonize=async function(o,l){const u=a(o);if(l.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return new Promise((h,y)=>s.canonize(u,l,(b,g)=>b?y(b):h(g)))}if(l.algorithm==="URDNA2015")return new e(l).main(u);if(l.algorithm==="URGNA2012"){if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new t(l).main(u)}throw"algorithm"in l?new Error("Invalid RDF Dataset Canonicalization algorithm: "+l.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")},r._canonizeSync=function(o,l){const u=a(o);if(l.useNative){if(!s)throw new Error("rdf-canonize-native not available");if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "useNative".');return s.canonizeSync(u,l)}if(l.algorithm==="URDNA2015")return new n(l).main(u);if(l.algorithm==="URGNA2012"){if(l.createMessageDigest)throw new Error('"createMessageDigest" cannot be used with "URGNA2012".');return new i(l).main(u)}throw"algorithm"in l?new Error("Invalid RDF Dataset Canonicalization algorithm: "+l.algorithm):new Error("No RDF Dataset Canonicalization algorithm specified.")}}(Ri)),Ri}var Mi,zo;function ca(){return zo||(zo=1,Mi=Af()),Mi}var Pi,Jo;function Xe(){if(Jo)return Pi;Jo=1;const r={};return Pi=r,r.isArray=Array.isArray,r.isBoolean=e=>typeof e=="boolean"||Object.prototype.toString.call(e)==="[object Boolean]",r.isDouble=e=>r.isNumber(e)&&(String(e).indexOf(".")!==-1||Math.abs(e)>=1e21),r.isEmptyObject=e=>r.isObject(e)&&Object.keys(e).length===0,r.isNumber=e=>typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]",r.isNumeric=e=>!isNaN(parseFloat(e))&&isFinite(e),r.isObject=e=>Object.prototype.toString.call(e)==="[object Object]",r.isString=e=>typeof e=="string"||Object.prototype.toString.call(e)==="[object String]",r.isUndefined=e=>typeof e>"u",Pi}var Ci,Qo;function _t(){if(Qo)return Ci;Qo=1;const r=Xe(),e={};return Ci=e,e.isSubject=t=>r.isObject(t)&&!("@value"in t||"@set"in t||"@list"in t)?Object.keys(t).length>1||!("@id"in t):!1,e.isSubjectReference=t=>r.isObject(t)&&Object.keys(t).length===1&&"@id"in t,e.isValue=t=>r.isObject(t)&&"@value"in t,e.isList=t=>r.isObject(t)&&"@list"in t,e.isGraph=t=>r.isObject(t)&&"@graph"in t&&Object.keys(t).filter(n=>n!=="@id"&&n!=="@index").length===1,e.isSimpleGraph=t=>e.isGraph(t)&&!("@id"in t),e.isBlankNode=t=>{if(r.isObject(t)){if("@id"in t){const n=t["@id"];return!r.isString(n)||n.indexOf("_:")===0}return Object.keys(t).length===0||!("@value"in t||"@set"in t||"@list"in t)}return!1},Ci}var qi,Xo;function et(){return Xo||(Xo=1,qi=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}}),qi}var Bi,Ko;function Ye(){if(Ko)return Bi;Ko=1;const r=_t(),e=Xe(),t=ca().IdentifierIssuer,n=et(),i=/^[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*$/,s=/(?:<[^>]*?>|"[^"]*?"|[^,])+/g,a=/\s*<([^>]*?)>\s*(?:;\s*(.*))?/,o=/(.*?)=(?:(?:"([^"]*?)")|([^"]*?))\s*(?:(?:;\s*)|$)/g,l=/^@[a-zA-Z]+$/,u={headers:{accept:"application/ld+json, application/json"}},h={};Bi=h,h.IdentifierIssuer=t,h.REGEX_BCP47=i,h.REGEX_KEYWORD=l,h.clone=function(b){if(b&&typeof b=="object"){let g;if(e.isArray(b)){g=[];for(let m=0;m<b.length;++m)g[m]=h.clone(b[m])}else if(b instanceof Map){g=new Map;for(const[m,_]of b)g.set(m,h.clone(_))}else if(b instanceof Set){g=new Set;for(const m of b)g.add(h.clone(m))}else if(e.isObject(b)){g={};for(const m in b)g[m]=h.clone(b[m])}else g=b.toString();return g}return b},h.asArray=function(b){return Array.isArray(b)?b:[b]},h.buildHeaders=(b={})=>{if(Object.keys(b).some(m=>m.toLowerCase()==="accept"))throw new RangeError('Accept header may not be specified; only "'+u.headers.accept+'" is supported.');return Object.assign({Accept:u.headers.accept},b)},h.parseLinkHeader=b=>{const g={},m=b.match(s);for(let _=0;_<m.length;++_){let x=m[_].match(a);if(!x)continue;const S={target:x[1]},I=x[2];for(;x=o.exec(I);)S[x[1]]=x[2]===void 0?x[3]:x[2];const w=S.rel||"";Array.isArray(g[w])?g[w].push(S):g.hasOwnProperty(w)?g[w]=[g[w],S]:g[w]=S}return g},h.validateTypeValue=(b,g)=>{if(!e.isString(b)&&!(e.isArray(b)&&b.every(m=>e.isString(m)))){if(g&&e.isObject(b))switch(Object.keys(b).length){case 0:return;case 1:if("@default"in b&&h.asArray(b["@default"]).every(m=>e.isString(m)))return}throw new n('Invalid JSON-LD syntax; "@type" value must a string, an array of strings, an empty object, or a default object.',"jsonld.SyntaxError",{code:"invalid type value",value:b})}},h.hasProperty=(b,g)=>{if(b.hasOwnProperty(g)){const m=b[g];return!e.isArray(m)||m.length>0}return!1},h.hasValue=(b,g,m)=>{if(h.hasProperty(b,g)){let _=b[g];const x=r.isList(_);if(e.isArray(_)||x){x&&(_=_["@list"]);for(let S=0;S<_.length;++S)if(h.compareValues(m,_[S]))return!0}else if(!e.isArray(m))return h.compareValues(m,_)}return!1},h.addValue=(b,g,m,_)=>{if(_=_||{},"propertyIsArray"in _||(_.propertyIsArray=!1),"valueIsArray"in _||(_.valueIsArray=!1),"allowDuplicate"in _||(_.allowDuplicate=!0),"prependValue"in _||(_.prependValue=!1),_.valueIsArray)b[g]=m;else if(e.isArray(m)){m.length===0&&_.propertyIsArray&&!b.hasOwnProperty(g)&&(b[g]=[]),_.prependValue&&(m=m.concat(b[g]),b[g]=[]);for(let x=0;x<m.length;++x)h.addValue(b,g,m[x],_)}else if(b.hasOwnProperty(g)){const x=!_.allowDuplicate&&h.hasValue(b,g,m);!e.isArray(b[g])&&(!x||_.propertyIsArray)&&(b[g]=[b[g]]),x||(_.prependValue?b[g].unshift(m):b[g].push(m))}else b[g]=_.propertyIsArray?[m]:m},h.getValues=(b,g)=>[].concat(b[g]||[]),h.removeProperty=(b,g)=>{delete b[g]},h.removeValue=(b,g,m,_)=>{_=_||{},"propertyIsArray"in _||(_.propertyIsArray=!1);const x=h.getValues(b,g).filter(S=>!h.compareValues(S,m));x.length===0?h.removeProperty(b,g):x.length===1&&!_.propertyIsArray?b[g]=x[0]:b[g]=x},h.relabelBlankNodes=(b,g)=>{g=g||{};const m=g.issuer||new t("_:b");return y(m,b)},h.compareValues=(b,g)=>b===g||r.isValue(b)&&r.isValue(g)&&b["@value"]===g["@value"]&&b["@type"]===g["@type"]&&b["@language"]===g["@language"]&&b["@index"]===g["@index"]?!0:e.isObject(b)&&"@id"in b&&e.isObject(g)&&"@id"in g?b["@id"]===g["@id"]:!1,h.compareShortestLeast=(b,g)=>b.length<g.length?-1:g.length<b.length?1:b===g?0:b<g?-1:1;function y(b,g){if(e.isArray(g))for(let m=0;m<g.length;++m)g[m]=y(b,g[m]);else if(r.isList(g))g["@list"]=y(b,g["@list"]);else if(e.isObject(g)){r.isBlankNode(g)&&(g["@id"]=b.getId(g["@id"]));const m=Object.keys(g).sort();for(let _=0;_<m.length;++_){const x=m[_];x!=="@id"&&(g[x]=y(b,g[x]))}}return g}return Bi}var Fi,Yo;function da(){if(Yo)return Fi;Yo=1;const r="http://www.w3.org/1999/02/22-rdf-syntax-ns#",e="http://www.w3.org/2001/XMLSchema#";return Fi={LINK_HEADER_REL:"http://www.w3.org/ns/json-ld#context",LINK_HEADER_CONTEXT:"http://www.w3.org/ns/json-ld#context",RDF:r,RDF_LIST:r+"List",RDF_FIRST:r+"first",RDF_REST:r+"rest",RDF_NIL:r+"nil",RDF_TYPE:r+"type",RDF_PLAIN_LITERAL:r+"PlainLiteral",RDF_XML_LITERAL:r+"XMLLiteral",RDF_JSON_LITERAL:r+"JSON",RDF_OBJECT:r+"object",RDF_LANGSTRING:r+"langString",XSD:e,XSD_BOOLEAN:e+"boolean",XSD_DOUBLE:e+"double",XSD_INTEGER:e+"integer",XSD_STRING:e+"string"},Fi}var Ui,Zo;function nc(){return Zo||(Zo=1,Ui=class{constructor(){this._requests={}}wrapLoader(e){const t=this;return t._loader=e,function(){return t.add.apply(t,arguments)}}async add(e){let t=this._requests[e];if(t)return Promise.resolve(t);t=this._requests[e]=this._loader(e);try{return await t}finally{delete this._requests[e]}}}),Ui}var Hi,el;function At(){if(el)return Hi;el=1;const r=Xe(),e={};Hi=e,e.parsers={simple:{keys:["href","scheme","authority","path","query","fragment"],regex:/^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/},full:{keys:["href","protocol","scheme","authority","auth","user","password","hostname","port","path","directory","file","query","fragment"],regex:/^(([a-zA-Z][a-zA-Z0-9+-.]*):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/}},e.parse=(n,i)=>{const s={},a=e.parsers[i||"full"],o=a.regex.exec(n);let l=a.keys.length;for(;l--;)s[a.keys[l]]=o[l]===void 0?null:o[l];return(s.scheme==="https"&&s.port==="443"||s.scheme==="http"&&s.port==="80")&&(s.href=s.href.replace(":"+s.port,""),s.authority=s.authority.replace(":"+s.port,""),s.port=null),s.normalizedPath=e.removeDotSegments(s.path),s},e.prependBase=(n,i)=>{if(n===null||e.isAbsolute(i))return i;(!n||r.isString(n))&&(n=e.parse(n||""));const s=e.parse(i),a={protocol:n.protocol||""};if(s.authority!==null)a.authority=s.authority,a.path=s.path,a.query=s.query;else if(a.authority=n.authority,s.path==="")a.path=n.path,s.query!==null?a.query=s.query:a.query=n.query;else{if(s.path.indexOf("/")===0)a.path=s.path;else{let l=n.path;l=l.substr(0,l.lastIndexOf("/")+1),(l.length>0||n.authority)&&l.substr(-1)!=="/"&&(l+="/"),l+=s.path,a.path=l}a.query=s.query}s.path!==""&&(a.path=e.removeDotSegments(a.path));let o=a.protocol;return a.authority!==null&&(o+="//"+a.authority),o+=a.path,a.query!==null&&(o+="?"+a.query),s.fragment!==null&&(o+="#"+s.fragment),o===""&&(o="./"),o},e.removeBase=(n,i)=>{if(n===null)return i;(!n||r.isString(n))&&(n=e.parse(n||""));let s="";if(n.href!==""?s+=(n.protocol||"")+"//"+(n.authority||""):i.indexOf("//")&&(s+="//"),i.indexOf(s)!==0)return i;const a=e.parse(i.substr(s.length)),o=n.normalizedPath.split("/"),l=a.normalizedPath.split("/"),u=a.fragment||a.query?0:1;for(;o.length>0&&l.length>u&&o[0]===l[0];)o.shift(),l.shift();let h="";if(o.length>0){o.pop();for(let y=0;y<o.length;++y)h+="../"}return h+=l.join("/"),a.query!==null&&(h+="?"+a.query),a.fragment!==null&&(h+="#"+a.fragment),h===""&&(h="./"),h},e.removeDotSegments=n=>{if(n.length===0)return"";const i=n.split("/"),s=[];for(;i.length>0;){const a=i.shift(),o=i.length===0;if(a==="."){o&&s.push("");continue}if(a===".."){s.pop(),o&&s.push("");continue}s.push(a)}return n[0]==="/"&&s.length>0&&s[0]!==""&&s.unshift(""),s.length===1&&s[0]===""?"/":s.join("/")};const t=/^([A-Za-z][A-Za-z0-9+-.]*|_):[^\s]*$/;return e.isAbsolute=n=>r.isString(n)&&t.test(n),e.isRelative=n=>r.isString(n),Hi}var Vi,tl;function Lf(){if(tl)return Vi;tl=1;const{parseLinkHeader:r,buildHeaders:e}=Ye(),{LINK_HEADER_CONTEXT:t}=da(),n=et(),i=nc(),{prependBase:s}=At(),a=/(^|(\r\n))link:/i;Vi=({secure:l,headers:u={},xhr:h}={headers:{}})=>{return u=e(u),new i().wrapLoader(b);async function b(g){if(g.indexOf("http:")!==0&&g.indexOf("https:")!==0)throw new n('URL could not be dereferenced; only "http" and "https" URLs are supported.',"jsonld.InvalidUrl",{code:"loading document failed",url:g});if(l&&g.indexOf("https")!==0)throw new n(`URL could not be dereferenced; secure mode is enabled and the URL's scheme is not "https".`,"jsonld.InvalidUrl",{code:"loading document failed",url:g});let m;try{m=await o(h,g,u)}catch(w){throw new n("URL could not be dereferenced, an error occurred.","jsonld.LoadDocumentError",{code:"loading document failed",url:g,cause:w})}if(m.status>=400)throw new n("URL could not be dereferenced: "+m.statusText,"jsonld.LoadDocumentError",{code:"loading document failed",url:g,httpStatusCode:m.status});let _={contextUrl:null,documentUrl:g,document:m.response},x=null;const S=m.getResponseHeader("Content-Type");let I;if(a.test(m.getAllResponseHeaders())&&(I=m.getResponseHeader("Link")),I&&S!=="application/ld+json"){const w=r(I),d=w[t];if(Array.isArray(d))throw new n("URL could not be dereferenced, it has more than one associated HTTP Link Header.","jsonld.InvalidUrl",{code:"multiple context link headers",url:g});d&&(_.contextUrl=d.target),x=w.alternate,x&&x.type=="application/ld+json"&&!(S||"").match(/^application\/(\w*\+)?json$/)&&(_=await b(s(g,x.target)))}return _}};function o(l,u,h){l=l||XMLHttpRequest;const y=new l;return new Promise((b,g)=>{y.onload=()=>b(y),y.onerror=m=>g(m),y.open("GET",u,!0);for(const m in h)y.setRequestHeader(m,h[m]);y.send()})}return Vi}var Gi,rl;function jf(){if(rl)return Gi;rl=1;const r=Lf(),e={};return Gi=e,e.setupDocumentLoaders=function(t){typeof XMLHttpRequest<"u"&&(t.documentLoaders.xhr=r,t.useDocumentLoader("xhr"))},e.setupGlobals=function(t){typeof globalThis.JsonLdProcessor>"u"&&Object.defineProperty(globalThis,"JsonLdProcessor",{writable:!0,enumerable:!1,configurable:!0,value:t.JsonLdProcessor})},Gi}var Wi,nl;function Of(){return nl||(nl=1,Wi=function(r){r.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}),Wi}var zi,il;function $f(){if(il)return zi;il=1,zi=r,r.Node=i,r.create=r;function r(s){var a=this;if(a instanceof r||(a=new r),a.tail=null,a.head=null,a.length=0,s&&typeof s.forEach=="function")s.forEach(function(u){a.push(u)});else if(arguments.length>0)for(var o=0,l=arguments.length;o<l;o++)a.push(arguments[o]);return a}r.prototype.removeNode=function(s){if(s.list!==this)throw new Error("removing node which does not belong to this list");var a=s.next,o=s.prev;return a&&(a.prev=o),o&&(o.next=a),s===this.head&&(this.head=a),s===this.tail&&(this.tail=o),s.list.length--,s.next=null,s.prev=null,s.list=null,a},r.prototype.unshiftNode=function(s){if(s!==this.head){s.list&&s.list.removeNode(s);var a=this.head;s.list=this,s.next=a,a&&(a.prev=s),this.head=s,this.tail||(this.tail=s),this.length++}},r.prototype.pushNode=function(s){if(s!==this.tail){s.list&&s.list.removeNode(s);var a=this.tail;s.list=this,s.prev=a,a&&(a.next=s),this.tail=s,this.head||(this.head=s),this.length++}},r.prototype.push=function(){for(var s=0,a=arguments.length;s<a;s++)t(this,arguments[s]);return this.length},r.prototype.unshift=function(){for(var s=0,a=arguments.length;s<a;s++)n(this,arguments[s]);return this.length},r.prototype.pop=function(){if(this.tail){var s=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,s}},r.prototype.shift=function(){if(this.head){var s=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,s}},r.prototype.forEach=function(s,a){a=a||this;for(var o=this.head,l=0;o!==null;l++)s.call(a,o.value,l,this),o=o.next},r.prototype.forEachReverse=function(s,a){a=a||this;for(var o=this.tail,l=this.length-1;o!==null;l--)s.call(a,o.value,l,this),o=o.prev},r.prototype.get=function(s){for(var a=0,o=this.head;o!==null&&a<s;a++)o=o.next;if(a===s&&o!==null)return o.value},r.prototype.getReverse=function(s){for(var a=0,o=this.tail;o!==null&&a<s;a++)o=o.prev;if(a===s&&o!==null)return o.value},r.prototype.map=function(s,a){a=a||this;for(var o=new r,l=this.head;l!==null;)o.push(s.call(a,l.value,this)),l=l.next;return o},r.prototype.mapReverse=function(s,a){a=a||this;for(var o=new r,l=this.tail;l!==null;)o.push(s.call(a,l.value,this)),l=l.prev;return o},r.prototype.reduce=function(s,a){var o,l=this.head;if(arguments.length>1)o=a;else if(this.head)l=this.head.next,o=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var u=0;l!==null;u++)o=s(o,l.value,u),l=l.next;return o},r.prototype.reduceReverse=function(s,a){var o,l=this.tail;if(arguments.length>1)o=a;else if(this.tail)l=this.tail.prev,o=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var u=this.length-1;l!==null;u--)o=s(o,l.value,u),l=l.prev;return o},r.prototype.toArray=function(){for(var s=new Array(this.length),a=0,o=this.head;o!==null;a++)s[a]=o.value,o=o.next;return s},r.prototype.toArrayReverse=function(){for(var s=new Array(this.length),a=0,o=this.tail;o!==null;a++)s[a]=o.value,o=o.prev;return s},r.prototype.slice=function(s,a){a=a||this.length,a<0&&(a+=this.length),s=s||0,s<0&&(s+=this.length);var o=new r;if(a<s||a<0)return o;s<0&&(s=0),a>this.length&&(a=this.length);for(var l=0,u=this.head;u!==null&&l<s;l++)u=u.next;for(;u!==null&&l<a;l++,u=u.next)o.push(u.value);return o},r.prototype.sliceReverse=function(s,a){a=a||this.length,a<0&&(a+=this.length),s=s||0,s<0&&(s+=this.length);var o=new r;if(a<s||a<0)return o;s<0&&(s=0),a>this.length&&(a=this.length);for(var l=this.length,u=this.tail;u!==null&&l>a;l--)u=u.prev;for(;u!==null&&l>s;l--,u=u.prev)o.push(u.value);return o},r.prototype.splice=function(s,a,...o){s>this.length&&(s=this.length-1),s<0&&(s=this.length+s);for(var l=0,u=this.head;u!==null&&l<s;l++)u=u.next;for(var h=[],l=0;u&&l<a;l++)h.push(u.value),u=this.removeNode(u);u===null&&(u=this.tail),u!==this.head&&u!==this.tail&&(u=u.prev);for(var l=0;l<o.length;l++)u=e(this,u,o[l]);return h},r.prototype.reverse=function(){for(var s=this.head,a=this.tail,o=s;o!==null;o=o.prev){var l=o.prev;o.prev=o.next,o.next=l}return this.head=a,this.tail=s,this};function e(s,a,o){var l=a===s.head?new i(o,null,a,s):new i(o,a,a.next,s);return l.next===null&&(s.tail=l),l.prev===null&&(s.head=l),s.length++,l}function t(s,a){s.tail=new i(a,s.tail,null,s),s.head||(s.head=s.tail),s.length++}function n(s,a){s.head=new i(a,null,s.head,s),s.tail||(s.tail=s.head),s.length++}function i(s,a,o,l){if(!(this instanceof i))return new i(s,a,o,l);this.list=l,this.value=s,a?(a.next=this,this.prev=a):this.prev=null,o?(o.prev=this,this.next=o):this.next=null}try{Of()(r)}catch{}return zi}var Ji,sl;function ic(){if(sl)return Ji;sl=1;const r=$f(),e=Symbol("max"),t=Symbol("length"),n=Symbol("lengthCalculator"),i=Symbol("allowStale"),s=Symbol("maxAge"),a=Symbol("dispose"),o=Symbol("noDisposeOnSet"),l=Symbol("lruList"),u=Symbol("cache"),h=Symbol("updateAgeOnGet"),y=()=>1;class b{constructor(d){if(typeof d=="number"&&(d={max:d}),d||(d={}),d.max&&(typeof d.max!="number"||d.max<0))throw new TypeError("max must be a non-negative number");this[e]=d.max||1/0;const p=d.length||y;if(this[n]=typeof p!="function"?y:p,this[i]=d.stale||!1,d.maxAge&&typeof d.maxAge!="number")throw new TypeError("maxAge must be a number");this[s]=d.maxAge||0,this[a]=d.dispose,this[o]=d.noDisposeOnSet||!1,this[h]=d.updateAgeOnGet||!1,this.reset()}set max(d){if(typeof d!="number"||d<0)throw new TypeError("max must be a non-negative number");this[e]=d||1/0,_(this)}get max(){return this[e]}set allowStale(d){this[i]=!!d}get allowStale(){return this[i]}set maxAge(d){if(typeof d!="number")throw new TypeError("maxAge must be a non-negative number");this[s]=d,_(this)}get maxAge(){return this[s]}set lengthCalculator(d){typeof d!="function"&&(d=y),d!==this[n]&&(this[n]=d,this[t]=0,this[l].forEach(p=>{p.length=this[n](p.value,p.key),this[t]+=p.length})),_(this)}get lengthCalculator(){return this[n]}get length(){return this[t]}get itemCount(){return this[l].length}rforEach(d,p){p=p||this;for(let N=this[l].tail;N!==null;){const D=N.prev;I(this,d,N,p),N=D}}forEach(d,p){p=p||this;for(let N=this[l].head;N!==null;){const D=N.next;I(this,d,N,p),N=D}}keys(){return this[l].toArray().map(d=>d.key)}values(){return this[l].toArray().map(d=>d.value)}reset(){this[a]&&this[l]&&this[l].length&&this[l].forEach(d=>this[a](d.key,d.value)),this[u]=new Map,this[l]=new r,this[t]=0}dump(){return this[l].map(d=>m(this,d)?!1:{k:d.key,v:d.value,e:d.now+(d.maxAge||0)}).toArray().filter(d=>d)}dumpLru(){return this[l]}set(d,p,N){if(N=N||this[s],N&&typeof N!="number")throw new TypeError("maxAge must be a number");const D=N?Date.now():0,T=this[n](p,d);if(this[u].has(d)){if(T>this[e])return x(this,this[u].get(d)),!1;const M=this[u].get(d).value;return this[a]&&(this[o]||this[a](d,M.value)),M.now=D,M.maxAge=N,M.value=p,this[t]+=T-M.length,M.length=T,this.get(d),_(this),!0}const q=new S(d,p,T,D,N);return q.length>this[e]?(this[a]&&this[a](d,p),!1):(this[t]+=q.length,this[l].unshift(q),this[u].set(d,this[l].head),_(this),!0)}has(d){if(!this[u].has(d))return!1;const p=this[u].get(d).value;return!m(this,p)}get(d){return g(this,d,!0)}peek(d){return g(this,d,!1)}pop(){const d=this[l].tail;return d?(x(this,d),d.value):null}del(d){x(this,this[u].get(d))}load(d){this.reset();const p=Date.now();for(let N=d.length-1;N>=0;N--){const D=d[N],T=D.e||0;if(T===0)this.set(D.k,D.v);else{const q=T-p;q>0&&this.set(D.k,D.v,q)}}}prune(){this[u].forEach((d,p)=>g(this,p,!1))}}const g=(w,d,p)=>{const N=w[u].get(d);if(N){const D=N.value;if(m(w,D)){if(x(w,N),!w[i])return}else p&&(w[h]&&(N.value.now=Date.now()),w[l].unshiftNode(N));return D.value}},m=(w,d)=>{if(!d||!d.maxAge&&!w[s])return!1;const p=Date.now()-d.now;return d.maxAge?p>d.maxAge:w[s]&&p>w[s]},_=w=>{if(w[t]>w[e])for(let d=w[l].tail;w[t]>w[e]&&d!==null;){const p=d.prev;x(w,d),d=p}},x=(w,d)=>{if(d){const p=d.value;w[a]&&w[a](p.key,p.value),w[t]-=p.length,w[u].delete(p.key),w[l].removeNode(d)}};class S{constructor(d,p,N,D,T){this.key=d,this.value=p,this.length=N,this.now=D,this.maxAge=T||0}}const I=(w,d,p,N)=>{let D=p.value;m(w,D)&&(x(w,p),w[i]||(D=void 0)),D&&d.call(N,D.value,D.key,w)};return Ji=b,Ji}var Qi,al;function kf(){if(al)return Qi;al=1;const r=ic(),e=10;return Qi=class{constructor({document:n}){this.document=n,this.cache=new r({max:e})}getProcessed(n){return this.cache.get(n)}setProcessed(n,i){this.cache.set(n,i)}},Qi}var Xi,ol;function Df(){if(ol)return Xi;ol=1;const{isArray:r,isObject:e,isString:t}=Xe(),{asArray:n}=Ye(),{prependBase:i}=At(),s=et(),a=kf(),o=10;Xi=class{constructor({sharedCache:y}){this.perOpCache=new Map,this.sharedCache=y}async resolve({activeCtx:y,context:b,documentLoader:g,base:m,cycles:_=new Set}){b&&e(b)&&b["@context"]&&(b=b["@context"]),b=n(b);const x=[];for(const S of b){if(t(S)){let d=this._get(S);d||(d=await this._resolveRemoteContext({activeCtx:y,url:S,documentLoader:g,base:m,cycles:_})),r(d)?x.push(...d):x.push(d);continue}if(S===null){x.push(new a({document:null}));continue}e(S)||l(b);const I=JSON.stringify(S);let w=this._get(I);w||(w=new a({document:S}),this._cacheResolvedContext({key:I,resolved:w,tag:"static"})),x.push(w)}return x}_get(y){let b=this.perOpCache.get(y);if(!b){const g=this.sharedCache.get(y);g&&(b=g.get("static"),b&&this.perOpCache.set(y,b))}return b}_cacheResolvedContext({key:y,resolved:b,tag:g}){if(this.perOpCache.set(y,b),g!==void 0){let m=this.sharedCache.get(y);m||(m=new Map,this.sharedCache.set(y,m)),m.set(g,b)}return b}async _resolveRemoteContext({activeCtx:y,url:b,documentLoader:g,base:m,cycles:_}){b=i(m,b);const{context:x,remoteDoc:S}=await this._fetchContext({activeCtx:y,url:b,documentLoader:g,cycles:_});m=S.documentUrl||b,u({context:x,base:m});const I=await this.resolve({activeCtx:y,context:x,documentLoader:g,base:m,cycles:_});return this._cacheResolvedContext({key:b,resolved:I,tag:S.tag}),I}async _fetchContext({activeCtx:y,url:b,documentLoader:g,cycles:m}){if(m.size>o)throw new s("Maximum number of @context URLs exceeded.","jsonld.ContextUrlError",{code:y.processingMode==="json-ld-1.0"?"loading remote context failed":"context overflow",max:o});if(m.has(b))throw new s("Cyclical @context URLs detected.","jsonld.ContextUrlError",{code:y.processingMode==="json-ld-1.0"?"recursive context inclusion":"context overflow",url:b});m.add(b);let _,x;try{x=await g(b),_=x.document||null,t(_)&&(_=JSON.parse(_))}catch(S){throw new s(`Dereferencing a URL did not result in a valid JSON-LD object. Possible causes are an inaccessible URL perhaps due to a same-origin policy (ensure the server uses CORS if you are using client-side JavaScript), too many redirects, a non-JSON response, or more than one HTTP Link Header was provided for a remote context. URL: "${b}".`,"jsonld.InvalidUrl",{code:"loading remote context failed",url:b,cause:S})}if(!e(_))throw new s(`Dereferencing a URL did not result in a JSON object. The response was valid JSON, but it was not a JSON object. URL: "${b}".`,"jsonld.InvalidUrl",{code:"invalid remote context",url:b});return"@context"in _?_={"@context":_["@context"]}:_={"@context":{}},x.contextUrl&&(r(_["@context"])||(_["@context"]=[_["@context"]]),_["@context"].push(x.contextUrl)),{context:_,remoteDoc:x}}};function l(h){throw new s("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:h})}function u({context:h,base:y}){if(!h)return;const b=h["@context"];if(t(b)){h["@context"]=i(y,b);return}if(r(b)){for(let g=0;g<b.length;++g){const m=b[g];if(t(m)){b[g]=i(y,m);continue}e(m)&&u({context:{"@context":m},base:y})}return}if(e(b))for(const g in b)u({context:b[g],base:y})}return Xi}var Ki,ll;function Mf(){return ll||(ll=1,Ki=ca().NQuads),Ki}var Yi,ul;function Zr(){if(ul)return Yi;ul=1;const r=et(),{isArray:e}=Xe(),{asArray:t}=Ye(),n={};Yi=n,n.defaultEventHandler=null,n.setupEventHandler=({options:a={}})=>{const o=[].concat(a.safe?n.safeEventHandler:[],a.eventHandler?t(a.eventHandler):[],n.defaultEventHandler?n.defaultEventHandler:[]);return o.length===0?null:o},n.handleEvent=({event:a,options:o})=>{i({event:a,handlers:o.eventHandler})};function i({event:a,handlers:o}){let l=!0;for(let u=0;l&&u<o.length;++u){l=!1;const h=o[u];if(e(h))l=i({event:a,handlers:h});else if(typeof h=="function")h({event:a,next:()=>{l=!0}});else if(typeof h=="object")a.code in h?h[a.code]({event:a,next:()=>{l=!0}}):l=!0;else throw new r("Invalid event handler.","jsonld.InvalidEventHandler",{event:a})}return l}const s=new Set(["empty object","free-floating scalar","invalid @language value","invalid property","null @id value","null @value value","object with only @id","object with only @language","object with only @list","object with only @value","relative @id reference","relative @type reference","relative @vocab reference","reserved @id value","reserved @reverse value","reserved term","blank node predicate","relative graph reference","relative object reference","relative predicate reference","relative subject reference","rdfDirection not set"]);return n.safeEventHandler=function({event:o,next:l}){if(o.level==="warning"&&s.has(o.code))throw new r("Safe mode validation error.","jsonld.ValidationError",{event:o});l()},n.logEventHandler=function({event:o,next:l}){console.log(`EVENT: ${o.message}`,{event:o}),l()},n.logWarningEventHandler=function({event:o,next:l}){o.level==="warning"&&console.warn(`WARNING: ${o.message}`,{event:o}),l()},n.unhandledEventHandler=function({event:o}){throw new r("No handler for event.","jsonld.UnhandledEvent",{event:o})},n.setDefaultEventHandler=function({eventHandler:a}={}){n.defaultEventHandler=a?t(a):null},Yi}var Zi,cl;function Ut(){if(cl)return Zi;cl=1;const r=Ye(),e=et(),{isArray:t,isObject:n,isString:i,isUndefined:s}=Xe(),{isAbsolute:a,isRelative:o,prependBase:l}=At(),{handleEvent:u}=Zr(),{REGEX_BCP47:h,REGEX_KEYWORD:y,asArray:b,compareShortestLeast:g}=Ye(),m=new Map,_=1e4,x={};Zi=x,x.process=async({activeCtx:w,localCtx:d,options:p,propagate:N=!0,overrideProtected:D=!1,cycles:T=new Set})=>{if(n(d)&&"@context"in d&&t(d["@context"])&&(d=d["@context"]),b(d).length===0)return w;const R=[],M=[({event:Y,next:L})=>{R.push(Y),L()}];p.eventHandler&&M.push(p.eventHandler);const B=p;p={...p,eventHandler:M};const A=await p.contextResolver.resolve({activeCtx:w,context:d,documentLoader:p.documentLoader,base:p.base});n(A[0].document)&&typeof A[0].document["@propagate"]=="boolean"&&(N=A[0].document["@propagate"]);let j=w;!N&&!j.previousContext&&(j=j.clone(),j.previousContext=w);for(const Y of A){let{document:L}=Y;if(w=j,L===null){if(!D&&Object.keys(w.protected).length!==0)throw new e("Tried to nullify a context with protected terms outside of a term definition.","jsonld.SyntaxError",{code:"invalid context nullification"});j=w=x.getInitialContext(p).clone();continue}const ee=Y.getProcessed(w);if(ee){if(B.eventHandler)for(const K of ee.events)u({event:K,options:B});j=w=ee.context;continue}if(n(L)&&"@context"in L&&(L=L["@context"]),!n(L))throw new e("Invalid JSON-LD syntax; @context must be an object.","jsonld.SyntaxError",{code:"invalid local context",context:L});j=j.clone();const P=new Map;if("@version"in L){if(L["@version"]!==1.1)throw new e("Unsupported JSON-LD version: "+L["@version"],"jsonld.UnsupportedVersion",{code:"invalid @version value",context:L});if(w.processingMode&&w.processingMode==="json-ld-1.0")throw new e("@version: "+L["@version"]+" not compatible with "+w.processingMode,"jsonld.ProcessingModeConflict",{code:"processing mode conflict",context:L});j.processingMode="json-ld-1.1",j["@version"]=L["@version"],P.set("@version",!0)}if(j.processingMode=j.processingMode||w.processingMode,"@base"in L){let K=L["@base"];if(!(K===null||a(K)))if(o(K))K=l(j["@base"],K);else throw new e('Invalid JSON-LD syntax; the value of "@base" in a @context must be an absolute IRI, a relative IRI, or null.',"jsonld.SyntaxError",{code:"invalid base IRI",context:L});j["@base"]=K,P.set("@base",!0)}if("@vocab"in L){const K=L["@vocab"];if(K===null)delete j["@vocab"];else if(i(K)){if(!a(K)&&x.processingMode(j,1))throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be an absolute IRI.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:L});{const v=S(j,K,{vocab:!0,base:!0},void 0,void 0,p);a(v)||p.eventHandler&&u({event:{type:["JsonLdEvent"],code:"relative @vocab reference",level:"warning",message:"Relative @vocab reference found.",details:{vocab:v}},options:p}),j["@vocab"]=v}}else throw new e('Invalid JSON-LD syntax; the value of "@vocab" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid vocab mapping",context:L});P.set("@vocab",!0)}if("@language"in L){const K=L["@language"];if(K===null)delete j["@language"];else if(i(K))K.match(h)||p.eventHandler&&u({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:K}},options:p}),j["@language"]=K.toLowerCase();else throw new e('Invalid JSON-LD syntax; the value of "@language" in a @context must be a string or null.',"jsonld.SyntaxError",{code:"invalid default language",context:L});P.set("@language",!0)}if("@direction"in L){const K=L["@direction"];if(w.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @direction not compatible with "+w.processingMode,"jsonld.SyntaxError",{code:"invalid context member",context:L});if(K===null)delete j["@direction"];else{if(K!=="ltr"&&K!=="rtl")throw new e('Invalid JSON-LD syntax; the value of "@direction" in a @context must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:L});j["@direction"]=K}P.set("@direction",!0)}if("@propagate"in L){const K=L["@propagate"];if(w.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @propagate not compatible with "+w.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:L});if(typeof K!="boolean")throw new e("Invalid JSON-LD syntax; @propagate value must be a boolean.","jsonld.SyntaxError",{code:"invalid @propagate value",context:d});P.set("@propagate",!0)}if("@import"in L){const K=L["@import"];if(w.processingMode==="json-ld-1.0")throw new e("Invalid JSON-LD syntax; @import not compatible with "+w.processingMode,"jsonld.SyntaxError",{code:"invalid context entry",context:L});if(!i(K))throw new e("Invalid JSON-LD syntax; @import must be a string.","jsonld.SyntaxError",{code:"invalid @import value",context:d});const v=await p.contextResolver.resolve({activeCtx:w,context:K,documentLoader:p.documentLoader,base:p.base});if(v.length!==1)throw new e("Invalid JSON-LD syntax; @import must reference a single context.","jsonld.SyntaxError",{code:"invalid remote context",context:d});const U=v[0].getProcessed(w);if(U)L=U;else{const Q=v[0].document;if("@import"in Q)throw new e("Invalid JSON-LD syntax: imported context must not include @import.","jsonld.SyntaxError",{code:"invalid context entry",context:d});for(const z in Q)L.hasOwnProperty(z)||(L[z]=Q[z]);v[0].setProcessed(w,L)}P.set("@import",!0)}P.set("@protected",L["@protected"]||!1);for(const K in L)if(x.createTermDefinition({activeCtx:j,localCtx:L,term:K,defined:P,options:p,overrideProtected:D}),n(L[K])&&"@context"in L[K]){const v=L[K]["@context"];let U=!0;if(i(v)){const Q=l(p.base,v);T.has(Q)?U=!1:T.add(Q)}if(U)try{await x.process({activeCtx:j.clone(),localCtx:L[K]["@context"],overrideProtected:!0,options:p,cycles:T})}catch{throw new e("Invalid JSON-LD syntax; invalid scoped context.","jsonld.SyntaxError",{code:"invalid scoped context",context:L[K]["@context"],term:K})}}Y.setProcessed(w,{context:j,events:R})}return j},x.createTermDefinition=({activeCtx:w,localCtx:d,term:p,defined:N,options:D,overrideProtected:T=!1})=>{if(N.has(p)){if(N.get(p))return;throw new e("Cyclical context definition detected.","jsonld.CyclicalContext",{code:"cyclic IRI mapping",context:d,term:p})}N.set(p,!1);let q;if(d.hasOwnProperty(p)&&(q=d[p]),p==="@type"&&n(q)&&(q["@container"]||"@set")==="@set"&&x.processingMode(w,1.1)){const L=["@container","@id","@protected"],ee=Object.keys(q);if(ee.length===0||ee.some(P=>!L.includes(P)))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:d,term:p})}else{if(x.isKeyword(p))throw new e("Invalid JSON-LD syntax; keywords cannot be overridden.","jsonld.SyntaxError",{code:"keyword redefinition",context:d,term:p});if(p.match(y)){D.eventHandler&&u({event:{type:["JsonLdEvent"],code:"reserved term",level:"warning",message:'Terms beginning with "@" are reserved for future use and dropped.',details:{term:p}},options:D});return}else if(p==="")throw new e("Invalid JSON-LD syntax; a term cannot be an empty string.","jsonld.SyntaxError",{code:"invalid term definition",context:d})}const R=w.mappings.get(p);w.mappings.has(p)&&w.mappings.delete(p);let M=!1;if((i(q)||q===null)&&(M=!0,q={"@id":q}),!n(q))throw new e("Invalid JSON-LD syntax; @context term values must be strings or objects.","jsonld.SyntaxError",{code:"invalid term definition",context:d});const B={};w.mappings.set(p,B),B.reverse=!1;const A=["@container","@id","@language","@reverse","@type"];x.processingMode(w,1.1)&&A.push("@context","@direction","@index","@nest","@prefix","@protected");for(const L in q)if(!A.includes(L))throw new e("Invalid JSON-LD syntax; a term definition must not contain "+L,"jsonld.SyntaxError",{code:"invalid term definition",context:d});const j=p.indexOf(":");if(B._termHasColon=j>0,"@reverse"in q){if("@id"in q)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @id.","jsonld.SyntaxError",{code:"invalid reverse property",context:d});if("@nest"in q)throw new e("Invalid JSON-LD syntax; a @reverse term definition must not contain @nest.","jsonld.SyntaxError",{code:"invalid reverse property",context:d});const L=q["@reverse"];if(!i(L))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:d});if(L.match(y)){D.eventHandler&&u({event:{type:["JsonLdEvent"],code:"reserved @reverse value",level:"warning",message:'@reverse values beginning with "@" are reserved for future use and dropped.',details:{reverse:L}},options:D}),R?w.mappings.set(p,R):w.mappings.delete(p);return}const ee=S(w,L,{vocab:!0,base:!1},d,N,D);if(!a(ee))throw new e("Invalid JSON-LD syntax; a @context @reverse value must be an absolute IRI or a blank node identifier.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:d});B["@id"]=ee,B.reverse=!0}else if("@id"in q){let L=q["@id"];if(L&&!i(L))throw new e("Invalid JSON-LD syntax; a @context @id value must be an array of strings or a string.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:d});if(L===null)B["@id"]=null;else if(!x.isKeyword(L)&&L.match(y)){D.eventHandler&&u({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:'@id values beginning with "@" are reserved for future use and dropped.',details:{id:L}},options:D}),R?w.mappings.set(p,R):w.mappings.delete(p);return}else if(L!==p){if(L=S(w,L,{vocab:!0,base:!1},d,N,D),!a(L)&&!x.isKeyword(L))throw new e("Invalid JSON-LD syntax; a @context @id value must be an absolute IRI, a blank node identifier, or a keyword.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:d});if(p.match(/(?::[^:])|\//)){const ee=new Map(N).set(p,!0);if(S(w,p,{vocab:!0,base:!1},d,ee,D)!==L)throw new e("Invalid JSON-LD syntax; term in form of IRI must expand to definition.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:d})}B["@id"]=L,B._prefix=M&&!B._termHasColon&&L.match(/[:\/\?#\[\]@]$/)!==null}}if(!("@id"in B))if(B._termHasColon){const L=p.substr(0,j);if(d.hasOwnProperty(L)&&x.createTermDefinition({activeCtx:w,localCtx:d,term:L,defined:N,options:D}),w.mappings.has(L)){const ee=p.substr(j+1);B["@id"]=w.mappings.get(L)["@id"]+ee}else B["@id"]=p}else if(p==="@type")B["@id"]=p;else{if(!("@vocab"in w))throw new e("Invalid JSON-LD syntax; @context terms must define an @id.","jsonld.SyntaxError",{code:"invalid IRI mapping",context:d,term:p});B["@id"]=w["@vocab"]+p}if((q["@protected"]===!0||N.get("@protected")===!0&&q["@protected"]!==!1)&&(w.protected[p]=!0,B.protected=!0),N.set(p,!0),"@type"in q){let L=q["@type"];if(!i(L))throw new e("Invalid JSON-LD syntax; an @context @type value must be a string.","jsonld.SyntaxError",{code:"invalid type mapping",context:d});if(L==="@json"||L==="@none"){if(x.processingMode(w,1))throw new e(`Invalid JSON-LD syntax; an @context @type value must not be "${L}" in JSON-LD 1.0 mode.`,"jsonld.SyntaxError",{code:"invalid type mapping",context:d})}else if(L!=="@id"&&L!=="@vocab"){if(L=S(w,L,{vocab:!0,base:!1},d,N,D),!a(L))throw new e("Invalid JSON-LD syntax; an @context @type value must be an absolute IRI.","jsonld.SyntaxError",{code:"invalid type mapping",context:d});if(L.indexOf("_:")===0)throw new e("Invalid JSON-LD syntax; an @context @type value must be an IRI, not a blank node identifier.","jsonld.SyntaxError",{code:"invalid type mapping",context:d})}B["@type"]=L}if("@container"in q){const L=i(q["@container"])?[q["@container"]]:q["@container"]||[],ee=["@list","@set","@index","@language"];let P=!0;const K=L.includes("@set");if(x.processingMode(w,1.1)){if(ee.push("@graph","@id","@type"),L.includes("@list")){if(L.length!==1)throw new e("Invalid JSON-LD syntax; @context @container with @list must have no other values","jsonld.SyntaxError",{code:"invalid container mapping",context:d})}else if(L.includes("@graph")){if(L.some(v=>v!=="@graph"&&v!=="@id"&&v!=="@index"&&v!=="@set"))throw new e("Invalid JSON-LD syntax; @context @container with @graph must have no other values other than @id, @index, and @set","jsonld.SyntaxError",{code:"invalid container mapping",context:d})}else P&=L.length<=(K?2:1);if(L.includes("@type")&&(B["@type"]=B["@type"]||"@id",!["@id","@vocab"].includes(B["@type"])))throw new e("Invalid JSON-LD syntax; container: @type requires @type to be @id or @vocab.","jsonld.SyntaxError",{code:"invalid type mapping",context:d})}else P&=!t(q["@container"]),P&=L.length<=1;if(P&=L.every(v=>ee.includes(v)),P&=!(K&&L.includes("@list")),!P)throw new e("Invalid JSON-LD syntax; @context @container value must be one of the following: "+ee.join(", "),"jsonld.SyntaxError",{code:"invalid container mapping",context:d});if(B.reverse&&!L.every(v=>["@index","@set"].includes(v)))throw new e("Invalid JSON-LD syntax; @context @container value for a @reverse type definition must be @index or @set.","jsonld.SyntaxError",{code:"invalid reverse property",context:d});B["@container"]=L}if("@index"in q){if(!("@container"in q)||!B["@container"].includes("@index"))throw new e(`Invalid JSON-LD syntax; @index without @index in @container: "${q["@index"]}" on term "${p}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:d});if(!i(q["@index"])||q["@index"].indexOf("@")===0)throw new e(`Invalid JSON-LD syntax; @index must expand to an IRI: "${q["@index"]}" on term "${p}".`,"jsonld.SyntaxError",{code:"invalid term definition",context:d});B["@index"]=q["@index"]}if("@context"in q&&(B["@context"]=q["@context"]),"@language"in q&&!("@type"in q)){let L=q["@language"];if(L!==null&&!i(L))throw new e("Invalid JSON-LD syntax; @context @language value must be a string or null.","jsonld.SyntaxError",{code:"invalid language mapping",context:d});L!==null&&(L=L.toLowerCase()),B["@language"]=L}if("@prefix"in q){if(p.match(/:|\//))throw new e("Invalid JSON-LD syntax; @context @prefix used on a compact IRI term","jsonld.SyntaxError",{code:"invalid term definition",context:d});if(x.isKeyword(B["@id"]))throw new e("Invalid JSON-LD syntax; keywords may not be used as prefixes","jsonld.SyntaxError",{code:"invalid term definition",context:d});if(typeof q["@prefix"]=="boolean")B._prefix=q["@prefix"]===!0;else throw new e("Invalid JSON-LD syntax; @context value for @prefix must be boolean","jsonld.SyntaxError",{code:"invalid @prefix value",context:d})}if("@direction"in q){const L=q["@direction"];if(L!==null&&L!=="ltr"&&L!=="rtl")throw new e('Invalid JSON-LD syntax; @direction value must be null, "ltr", or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",context:d});B["@direction"]=L}if("@nest"in q){const L=q["@nest"];if(!i(L)||L!=="@nest"&&L.indexOf("@")===0)throw new e("Invalid JSON-LD syntax; @context @nest value must be a string which is not a keyword other than @nest.","jsonld.SyntaxError",{code:"invalid @nest value",context:d});B["@nest"]=L}// disallow aliasing @context and @preserve
|
|
300
|
+
const Y=B["@id"];if(Y==="@context"||Y==="@preserve")throw new e("Invalid JSON-LD syntax; @context and @preserve cannot be aliased.","jsonld.SyntaxError",{code:"invalid keyword alias",context:d});if(R&&R.protected&&!T&&(w.protected[p]=!0,B.protected=!0,!I(R,B)))throw new e("Invalid JSON-LD syntax; tried to redefine a protected term.","jsonld.SyntaxError",{code:"protected term redefinition",context:d,term:p})},x.expandIri=(w,d,p,N)=>S(w,d,p,void 0,void 0,N);function S(w,d,p,N,D,T){if(d===null||!i(d)||x.isKeyword(d))return d;if(d.match(y))return null;if(N&&N.hasOwnProperty(d)&&D.get(d)!==!0&&x.createTermDefinition({activeCtx:w,localCtx:N,term:d,defined:D,options:T}),p=p||{},p.vocab){const R=w.mappings.get(d);if(R===null)return null;if(n(R)&&"@id"in R)return R["@id"]}const q=d.indexOf(":");if(q>0){const R=d.substr(0,q),M=d.substr(q+1);if(R==="_"||M.indexOf("//")===0)return d;N&&N.hasOwnProperty(R)&&x.createTermDefinition({activeCtx:w,localCtx:N,term:R,defined:D,options:T});const B=w.mappings.get(R);if(B&&B._prefix)return B["@id"]+M;if(a(d))return d}if(p.vocab&&"@vocab"in w)d=w["@vocab"]+d;else if(p.base){let R,M;"@base"in w?w["@base"]?(M=l(T.base,w["@base"]),R=l(M,d)):(M=w["@base"],R=d):(M=T.base,R=l(T.base,d)),d=R}return d}x.getInitialContext=w=>{const d=JSON.stringify({processingMode:w.processingMode}),p=m.get(d);if(p)return p;const N={processingMode:w.processingMode,mappings:new Map,inverse:null,getInverse:D,clone:R,revertToPreviousContext:M,protected:{}};return m.size===_&&m.clear(),m.set(d,N),N;function D(){const B=this;if(B.inverse)return B.inverse;const A=B.inverse={},j=B.fastCurieMap={},Y={},L=(B["@language"]||"@none").toLowerCase(),ee=B["@direction"],P=B.mappings,K=[...P.keys()].sort(g);for(const v of K){const U=P.get(v);if(U===null)continue;let Q=U["@container"]||"@none";if(Q=[].concat(Q).sort().join(""),U["@id"]===null)continue;const z=b(U["@id"]);for(const ae of z){let H=A[ae];const V=x.isKeyword(ae);if(H)!V&&!U._termHasColon&&Y[ae].push(v);else if(A[ae]=H={},!V&&!U._termHasColon){Y[ae]=[v];const W={iri:ae,terms:Y[ae]};ae[0]in j?j[ae[0]].push(W):j[ae[0]]=[W]}if(H[Q]||(H[Q]={"@language":{},"@type":{},"@any":{}}),H=H[Q],q(v,H["@any"],"@none"),U.reverse)q(v,H["@type"],"@reverse");else if(U["@type"]==="@none")q(v,H["@any"],"@none"),q(v,H["@language"],"@none"),q(v,H["@type"],"@none");else if("@type"in U)q(v,H["@type"],U["@type"]);else if("@language"in U&&"@direction"in U){const W=U["@language"],F=U["@direction"];W&&F?q(v,H["@language"],`${W}_${F}`.toLowerCase()):W?q(v,H["@language"],W.toLowerCase()):F?q(v,H["@language"],`_${F}`):q(v,H["@language"],"@null")}else"@language"in U?q(v,H["@language"],(U["@language"]||"@null").toLowerCase()):"@direction"in U?U["@direction"]?q(v,H["@language"],`_${U["@direction"]}`):q(v,H["@language"],"@none"):ee?(q(v,H["@language"],`_${ee}`),q(v,H["@language"],"@none"),q(v,H["@type"],"@none")):(q(v,H["@language"],L),q(v,H["@language"],"@none"),q(v,H["@type"],"@none"))}}for(const v in j)T(j,v,1);return A}function T(B,A,j){const Y=B[A],L=B[A]={};let ee,P;for(const K of Y)ee=K.iri,j>=ee.length?P="":P=ee[j],P in L?L[P].push(K):L[P]=[K];for(const K in L)K!==""&&T(L,K,j+1)}function q(B,A,j){A.hasOwnProperty(j)||(A[j]=B)}function R(){const B={};return B.mappings=r.clone(this.mappings),B.clone=this.clone,B.inverse=null,B.getInverse=this.getInverse,B.protected=r.clone(this.protected),this.previousContext&&(B.previousContext=this.previousContext.clone()),B.revertToPreviousContext=this.revertToPreviousContext,"@base"in this&&(B["@base"]=this["@base"]),"@language"in this&&(B["@language"]=this["@language"]),"@vocab"in this&&(B["@vocab"]=this["@vocab"]),B}function M(){return this.previousContext?this.previousContext.clone():this}},x.getContextValue=(w,d,p)=>{if(d===null)return p==="@context"?void 0:null;if(w.mappings.has(d)){const N=w.mappings.get(d);if(s(p))return N;if(N.hasOwnProperty(p))return N[p]}if(p==="@language"&&p in w||p==="@direction"&&p in w)return w[p];if(p!=="@context")return null},x.processingMode=(w,d)=>d.toString()>="1.1"?!w.processingMode||w.processingMode>="json-ld-"+d.toString():w.processingMode==="json-ld-1.0",x.isKeyword=w=>{if(!i(w)||w[0]!=="@")return!1;switch(w){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 I(w,d){if(!(w&&typeof w=="object")||!(d&&typeof d=="object"))return w===d;const p=Array.isArray(w);if(p!==Array.isArray(d))return!1;if(p){if(w.length!==d.length)return!1;for(let T=0;T<w.length;++T)if(!I(w[T],d[T]))return!1;return!0}const N=Object.keys(w),D=Object.keys(d);if(N.length!==D.length)return!1;for(const T in w){let q=w[T],R=d[T];if(T==="@container"&&Array.isArray(q)&&Array.isArray(R)&&(q=q.slice().sort(),R=R.slice().sort()),!I(q,R))return!1}return!0}return Zi}var es,dl;function Pf(){if(dl)return es;dl=1;const r=et(),{isArray:e,isObject:t,isEmptyObject:n,isString:i,isUndefined:s}=Xe(),{isList:a,isValue:o,isGraph:l,isSubject:u}=_t(),{expandIri:h,getContextValue:y,isKeyword:b,process:g,processingMode:m}=Ut(),{isAbsolute:_}=At(),{REGEX_BCP47:x,REGEX_KEYWORD:S,addValue:I,asArray:w,getValues:d,validateTypeValue:p}=Ye(),{handleEvent:N}=Zr(),D={};es=D,D.expand=async({activeCtx:A,activeProperty:j=null,element:Y,options:L={},insideList:ee=!1,insideIndex:P=!1,typeScopedContext:K=null})=>{if(Y==null)return null;if(j==="@default"&&(L=Object.assign({},L,{isFrame:!1})),!e(Y)&&!t(Y))return!ee&&(j===null||h(A,j,{vocab:!0},L)==="@graph")?(L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"free-floating scalar",level:"warning",message:"Dropping free-floating scalar not in a list.",details:{value:Y}},options:L}),null):R({activeCtx:A,activeProperty:j,value:Y,options:L});if(e(Y)){let W=[];const F=y(A,j,"@container")||[];ee=ee||F.includes("@list");for(let Z=0;Z<Y.length;++Z){let te=await D.expand({activeCtx:A,activeProperty:j,element:Y[Z],options:L,insideIndex:P,typeScopedContext:K});ee&&e(te)&&(te={"@list":te}),te!==null&&(e(te)?W=W.concat(te):W.push(te))}return W}const v=h(A,j,{vocab:!0},L),U=y(A,j,"@context");K=K||(A.previousContext?A:null);let Q=Object.keys(Y).sort(),z=!P;if(z&&K&&Q.length<=2&&!Q.includes("@context"))for(const W of Q){const F=h(K,W,{vocab:!0},L);if(F==="@value"){z=!1,A=K;break}if(F==="@id"&&Q.length===1){z=!1;break}}z&&(A=A.revertToPreviousContext()),s(U)||(A=await g({activeCtx:A,localCtx:U,propagate:!0,overrideProtected:!0,options:L})),"@context"in Y&&(A=await g({activeCtx:A,localCtx:Y["@context"],options:L})),K=A;let ae=null;for(const W of Q)if(h(A,W,{vocab:!0},L)==="@type"){ae=ae||W;const Z=Y[W],te=Array.isArray(Z)?Z.length>1?Z.slice().sort():Z:[Z];for(const ce of te){const fe=y(K,ce,"@context");s(fe)||(A=await g({activeCtx:A,localCtx:fe,options:L,propagate:!1}))}}let H={};await q({activeCtx:A,activeProperty:j,expandedActiveProperty:v,element:Y,expandedParent:H,options:L,insideList:ee,typeKey:ae,typeScopedContext:K}),Q=Object.keys(H);let V=Q.length;if("@value"in H){if("@type"in H&&("@language"in H||"@direction"in H))throw new r('Invalid JSON-LD syntax; an element containing "@value" may not contain both "@type" and either "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:H});let W=V-1;if("@type"in H&&(W-=1),"@index"in H&&(W-=1),"@language"in H&&(W-=1),"@direction"in H&&(W-=1),W!==0)throw new r('Invalid JSON-LD syntax; an element containing "@value" may only have an "@index" property and either "@type" or either or both "@language" or "@direction".',"jsonld.SyntaxError",{code:"invalid value object",element:H});const F=H["@value"]===null?[]:w(H["@value"]),Z=d(H,"@type");if(!(m(A,1.1)&&Z.includes("@json")&&Z.length===1))if(F.length===0)L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"null @value value",level:"warning",message:"Dropping null @value value.",details:{value:H}},options:L}),H=null;else{if(!F.every(te=>i(te)||n(te))&&"@language"in H)throw new r("Invalid JSON-LD syntax; only strings may be language-tagged.","jsonld.SyntaxError",{code:"invalid language-tagged value",element:H});if(!Z.every(te=>_(te)&&!(i(te)&&te.indexOf("_:")===0)||n(te)))throw new r('Invalid JSON-LD syntax; an element containing "@value" and "@type" must have an absolute IRI for the value of "@type".',"jsonld.SyntaxError",{code:"invalid typed value",element:H})}}else if("@type"in H&&!e(H["@type"]))H["@type"]=[H["@type"]];else if("@set"in H||"@list"in H){if(V>1&&!(V===2&&"@index"in H))throw new r('Invalid JSON-LD syntax; if an element has the property "@set" or "@list", then it can have at most one other property that is "@index".',"jsonld.SyntaxError",{code:"invalid set or list object",element:H});"@set"in H&&(H=H["@set"],Q=Object.keys(H),V=Q.length)}else V===1&&"@language"in H&&(L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"object with only @language",level:"warning",message:"Dropping object with only @language.",details:{value:H}},options:L}),H=null);return t(H)&&!L.keepFreeFloatingNodes&&!ee&&(j===null||v==="@graph"||(y(A,j,"@container")||[]).includes("@graph"))&&(H=T({value:H,count:V,options:L})),H};function T({value:A,count:j,options:Y}){if(j===0||"@value"in A||"@list"in A||j===1&&"@id"in A){if(Y.eventHandler){let L,ee;j===0?(L="empty object",ee="Dropping empty object."):"@value"in A?(L="object with only @value",ee="Dropping object with only @value."):"@list"in A?(L="object with only @list",ee="Dropping object with only @list."):j===1&&"@id"in A&&(L="object with only @id",ee="Dropping object with only @id."),N({event:{type:["JsonLdEvent"],code:L,level:"warning",message:ee,details:{value:A}},options:Y})}return null}return A}async function q({activeCtx:A,activeProperty:j,expandedActiveProperty:Y,element:L,expandedParent:ee,options:P={},insideList:K,typeKey:v,typeScopedContext:U}){const Q=Object.keys(L).sort(),z=[];let ae;const H=L[v]&&h(A,e(L[v])?L[v][0]:L[v],{vocab:!0},{...P,typeExpansion:!0})==="@json";for(const V of Q){let W=L[V],F;if(V==="@context")continue;const Z=h(A,V,{vocab:!0},P);if(Z===null||!(_(Z)||b(Z))){P.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid property",level:"warning",message:"Dropping property that did not expand into an absolute IRI or keyword.",details:{property:V,expandedProperty:Z}},options:P});continue}if(b(Z)){if(Y==="@reverse")throw new r("Invalid JSON-LD syntax; a keyword cannot be used as a @reverse property.","jsonld.SyntaxError",{code:"invalid reverse property map",value:W});if(Z in ee&&Z!=="@included"&&Z!=="@type")throw new r("Invalid JSON-LD syntax; colliding keywords detected.","jsonld.SyntaxError",{code:"colliding keywords",keyword:Z})}if(Z==="@id"){if(!i(W)){if(!P.isFrame)throw new r('Invalid JSON-LD syntax; "@id" value must a string.',"jsonld.SyntaxError",{code:"invalid @id value",value:W});if(t(W)){if(!n(W))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W})}else if(e(W)){if(!W.every(O=>i(O)))throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W})}else throw new r('Invalid JSON-LD syntax; "@id" value an empty object or array of strings, if framing',"jsonld.SyntaxError",{code:"invalid @id value",value:W})}I(ee,"@id",w(W).map(O=>{if(i(O)){const G=h(A,O,{base:!0},P);return P.eventHandler&&(G===null?N(O===null?{event:{type:["JsonLdEvent"],code:"null @id value",level:"warning",message:"Null @id found.",details:{id:O}},options:P}:{event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:O}},options:P}):_(G)||N({event:{type:["JsonLdEvent"],code:"relative @id reference",level:"warning",message:"Relative @id reference found.",details:{id:O,expandedId:G}},options:P})),G}return O}),{propertyIsArray:P.isFrame});continue}if(Z==="@type"){t(W)&&(W=Object.fromEntries(Object.entries(W).map(([O,G])=>[h(U,O,{vocab:!0}),w(G).map(re=>h(U,re,{base:!0,vocab:!0},{...P,typeExpansion:!0}))]))),p(W,P.isFrame),I(ee,"@type",w(W).map(O=>{if(i(O)){const G=h(U,O,{base:!0,vocab:!0},{...P,typeExpansion:!0});return G!=="@json"&&!_(G)&&P.eventHandler&&N({event:{type:["JsonLdEvent"],code:"relative @type reference",level:"warning",message:"Relative @type reference found.",details:{type:O}},options:P}),G}return O}),{propertyIsArray:!!P.isFrame});continue}if(Z==="@included"&&m(A,1.1)){const O=w(await D.expand({activeCtx:A,activeProperty:j,element:W,options:P}));if(!O.every(G=>u(G)))throw new r("Invalid JSON-LD syntax; values of @included must expand to node objects.","jsonld.SyntaxError",{code:"invalid @included value",value:W});I(ee,"@included",O,{propertyIsArray:!0});continue}if(Z==="@graph"&&!(t(W)||e(W)))throw new r('Invalid JSON-LD syntax; "@graph" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid @graph value",value:W});if(Z==="@value"){ae=W,H&&m(A,1.1)?ee["@value"]=W:I(ee,"@value",W,{propertyIsArray:P.isFrame});continue}if(Z==="@language"){if(W===null)continue;if(!i(W)&&!P.isFrame)throw new r('Invalid JSON-LD syntax; "@language" value must be a string.',"jsonld.SyntaxError",{code:"invalid language-tagged string",value:W});W=w(W).map(O=>i(O)?O.toLowerCase():O);for(const O of W)i(O)&&!O.match(x)&&P.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:O}},options:P});I(ee,"@language",W,{propertyIsArray:P.isFrame});continue}if(Z==="@direction"){if(!i(W)&&!P.isFrame)throw new r('Invalid JSON-LD syntax; "@direction" value must be a string.',"jsonld.SyntaxError",{code:"invalid base direction",value:W});W=w(W);for(const O of W)if(i(O)&&O!=="ltr"&&O!=="rtl")throw new r('Invalid JSON-LD syntax; "@direction" must be "ltr" or "rtl".',"jsonld.SyntaxError",{code:"invalid base direction",value:W});I(ee,"@direction",W,{propertyIsArray:P.isFrame});continue}if(Z==="@index"){if(!i(W))throw new r('Invalid JSON-LD syntax; "@index" value must be a string.',"jsonld.SyntaxError",{code:"invalid @index value",value:W});I(ee,"@index",W);continue}if(Z==="@reverse"){if(!t(W))throw new r('Invalid JSON-LD syntax; "@reverse" value must be an object.',"jsonld.SyntaxError",{code:"invalid @reverse value",value:W});if(F=await D.expand({activeCtx:A,activeProperty:"@reverse",element:W,options:P}),"@reverse"in F)for(const G in F["@reverse"])I(ee,G,F["@reverse"][G],{propertyIsArray:!0});let O=ee["@reverse"]||null;for(const G in F){if(G==="@reverse")continue;O===null&&(O=ee["@reverse"]={}),I(O,G,[],{propertyIsArray:!0});const re=F[G];for(let ue=0;ue<re.length;++ue){const de=re[ue];if(o(de)||a(de))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:F});I(O,G,de,{propertyIsArray:!0})}}continue}if(Z==="@nest"){z.push(V);continue}let te=A;const ce=y(A,V,"@context");s(ce)||(te=await g({activeCtx:A,localCtx:ce,propagate:!0,overrideProtected:!0,options:P}));const fe=y(A,V,"@container")||[];if(fe.includes("@language")&&t(W)){const O=y(te,V,"@direction");F=M(te,W,O,P)}else if(fe.includes("@index")&&t(W)){const O=fe.includes("@graph"),G=y(te,V,"@index")||"@index",re=G!=="@index"&&h(A,G,{vocab:!0},P);F=await B({activeCtx:te,options:P,activeProperty:V,value:W,asGraph:O,indexKey:G,propertyIndex:re})}else if(fe.includes("@id")&&t(W)){const O=fe.includes("@graph");F=await B({activeCtx:te,options:P,activeProperty:V,value:W,asGraph:O,indexKey:"@id"})}else if(fe.includes("@type")&&t(W))F=await B({activeCtx:te.revertToPreviousContext(),options:P,activeProperty:V,value:W,asGraph:!1,indexKey:"@type"});else{const O=Z==="@list";if(O||Z==="@set"){let G=j;O&&Y==="@graph"&&(G=null),F=await D.expand({activeCtx:te,activeProperty:G,element:W,options:P,insideList:O})}else y(A,V,"@type")==="@json"?F={"@type":"@json","@value":W}:F=await D.expand({activeCtx:te,activeProperty:V,element:W,options:P,insideList:!1})}if(!(F===null&&Z!=="@value")){if(Z!=="@list"&&!a(F)&&fe.includes("@list")&&(F={"@list":w(F)}),fe.includes("@graph")&&!fe.some(O=>O==="@id"||O==="@index")){if(F=w(F),P.isFrame||(F=F.filter(O=>{const G=Object.keys(O).length;return T({value:O,count:G,options:P})!==null})),F.length===0)continue;F=F.map(O=>({"@graph":w(O)}))}if(te.mappings.has(V)&&te.mappings.get(V).reverse){const O=ee["@reverse"]=ee["@reverse"]||{};F=w(F);for(let G=0;G<F.length;++G){const re=F[G];if(o(re)||a(re))throw new r('Invalid JSON-LD syntax; "@reverse" value must not be a @value or an @list.',"jsonld.SyntaxError",{code:"invalid reverse property value",value:F});I(O,Z,re,{propertyIsArray:!0})}continue}I(ee,Z,F,{propertyIsArray:!0})}}if("@value"in ee&&!(ee["@type"]==="@json"&&m(A,1.1))){if((t(ae)||e(ae))&&!P.isFrame)throw new r('Invalid JSON-LD syntax; "@value" value must not be an object or an array.',"jsonld.SyntaxError",{code:"invalid value object value",value:ae})}for(const V of z){const W=e(L[V])?L[V]:[L[V]];for(const F of W){if(!t(F)||Object.keys(F).some(Z=>h(A,Z,{vocab:!0},P)==="@value"))throw new r("Invalid JSON-LD syntax; nested value must be a node object.","jsonld.SyntaxError",{code:"invalid @nest value",value:F});await q({activeCtx:A,activeProperty:j,expandedActiveProperty:Y,element:F,expandedParent:ee,options:P,insideList:K,typeScopedContext:U,typeKey:v})}}}function R({activeCtx:A,activeProperty:j,value:Y,options:L}){if(Y==null)return null;const ee=h(A,j,{vocab:!0},L);if(ee==="@id")return h(A,Y,{base:!0},L);if(ee==="@type")return h(A,Y,{vocab:!0,base:!0},{...L,typeExpansion:!0});const P=y(A,j,"@type");if((P==="@id"||ee==="@graph")&&i(Y)){const v=h(A,Y,{base:!0},L);return v===null&&Y.match(S)&&L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"reserved @id value",level:"warning",message:"Reserved @id found.",details:{id:j}},options:L}),{"@id":v}}if(P==="@vocab"&&i(Y))return{"@id":h(A,Y,{vocab:!0,base:!0},L)};if(b(ee))return Y;const K={};if(P&&!["@id","@vocab","@none"].includes(P))K["@type"]=P;else if(i(Y)){const v=y(A,j,"@language");v!==null&&(K["@language"]=v);const U=y(A,j,"@direction");U!==null&&(K["@direction"]=U)}return["boolean","number","string"].includes(typeof Y)||(Y=Y.toString()),K["@value"]=Y,K}function M(A,j,Y,L){const ee=[],P=Object.keys(j).sort();for(const K of P){const v=h(A,K,{vocab:!0},L);let U=j[K];e(U)||(U=[U]);for(const Q of U){if(Q===null)continue;if(!i(Q))throw new r("Invalid JSON-LD syntax; language map values must be strings.","jsonld.SyntaxError",{code:"invalid language map value",languageMap:j});const z={"@value":Q};v!=="@none"&&(K.match(x)||L.eventHandler&&N({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:K}},options:L}),z["@language"]=K.toLowerCase()),Y&&(z["@direction"]=Y),ee.push(z)}}return ee}async function B({activeCtx:A,options:j,activeProperty:Y,value:L,asGraph:ee,indexKey:P,propertyIndex:K}){const v=[],U=Object.keys(L).sort(),Q=P==="@type";for(let z of U){if(Q){const V=y(A,z,"@context");s(V)||(A=await g({activeCtx:A,localCtx:V,propagate:!1,options:j}))}let ae=L[z];e(ae)||(ae=[ae]),ae=await D.expand({activeCtx:A,activeProperty:Y,element:ae,options:j,insideList:!1,insideIndex:!0});let H;K?z==="@none"?H="@none":H=R({activeCtx:A,activeProperty:P,value:z,options:j}):H=h(A,z,{vocab:!0},j),P==="@id"?z=h(A,z,{base:!0},j):Q&&(z=H);for(let V of ae){if(ee&&!l(V)&&(V={"@graph":[V]}),P==="@type")H==="@none"||(V["@type"]?V["@type"]=[z].concat(V["@type"]):V["@type"]=[z]);else{if(o(V)&&!["@language","@type","@index"].includes(P))throw new r(`Invalid JSON-LD syntax; Attempt to add illegal key to value object: "${P}".`,"jsonld.SyntaxError",{code:"invalid value object",value:V});K?H!=="@none"&&I(V,K,H,{propertyIsArray:!0,prependValue:!0}):H!=="@none"&&!(P in V)&&(V[P]=z)}v.push(V)}}return v}return es}var ts,fl;function Cn(){if(fl)return ts;fl=1;const{isKeyword:r}=Ut(),e=_t(),t=Xe(),n=Ye(),i=et(),s={};return ts=s,s.createMergedNodeMap=(a,o)=>{o=o||{};const l=o.issuer||new n.IdentifierIssuer("_:b"),u={"@default":{}};return s.createNodeMap(a,u,"@default",l),s.mergeNodeMaps(u)},s.createNodeMap=(a,o,l,u,h,y)=>{if(t.isArray(a)){for(const _ of a)s.createNodeMap(_,o,l,u,void 0,y);return}if(!t.isObject(a)){y&&y.push(a);return}if(e.isValue(a)){if("@type"in a){let _=a["@type"];_.indexOf("_:")===0&&(a["@type"]=_=u.getId(_))}y&&y.push(a);return}else if(y&&e.isList(a)){const _=[];s.createNodeMap(a["@list"],o,l,u,h,_),y.push({"@list":_});return}if("@type"in a){const _=a["@type"];for(const x of _)x.indexOf("_:")===0&&u.getId(x)}t.isUndefined(h)&&(h=e.isBlankNode(a)?u.getId(a["@id"]):a["@id"]),y&&y.push({"@id":h});const b=o[l],g=b[h]=b[h]||{};g["@id"]=h;const m=Object.keys(a).sort();for(let _ of m){if(_==="@id")continue;if(_==="@reverse"){const S={"@id":h},I=a["@reverse"];for(const w in I){const d=I[w];for(const p of d){let N=p["@id"];e.isBlankNode(p)&&(N=u.getId(N)),s.createNodeMap(p,o,l,u,N),n.addValue(b[N],w,S,{propertyIsArray:!0,allowDuplicate:!1})}}continue}if(_==="@graph"){h in o||(o[h]={}),s.createNodeMap(a[_],o,h,u);continue}if(_==="@included"){s.createNodeMap(a[_],o,l,u);continue}if(_!=="@type"&&r(_)){if(_==="@index"&&_ in g&&(a[_]!==g[_]||a[_]["@id"]!==g[_]["@id"]))throw new i("Invalid JSON-LD syntax; conflicting @index property detected.","jsonld.SyntaxError",{code:"conflicting indexes",subject:g});g[_]=a[_];continue}const x=a[_];if(_.indexOf("_:")===0&&(_=u.getId(_)),x.length===0){n.addValue(g,_,[],{propertyIsArray:!0});continue}for(let S of x)if(_==="@type"&&(S=S.indexOf("_:")===0?u.getId(S):S),e.isSubject(S)||e.isSubjectReference(S)){if("@id"in S&&!S["@id"])continue;const I=e.isBlankNode(S)?u.getId(S["@id"]):S["@id"];n.addValue(g,_,{"@id":I},{propertyIsArray:!0,allowDuplicate:!1}),s.createNodeMap(S,o,l,u,I)}else if(e.isValue(S))n.addValue(g,_,S,{propertyIsArray:!0,allowDuplicate:!1});else if(e.isList(S)){const I=[];s.createNodeMap(S["@list"],o,l,u,h,I),S={"@list":I},n.addValue(g,_,S,{propertyIsArray:!0,allowDuplicate:!1})}else s.createNodeMap(S,o,l,u,h),n.addValue(g,_,S,{propertyIsArray:!0,allowDuplicate:!1})}},s.mergeNodeMapGraphs=a=>{const o={};for(const l of Object.keys(a).sort())for(const u of Object.keys(a[l]).sort()){const h=a[l][u];u in o||(o[u]={"@id":u});const y=o[u];for(const b of Object.keys(h).sort())if(r(b)&&b!=="@type")y[b]=n.clone(h[b]);else for(const g of h[b])n.addValue(y,b,n.clone(g),{propertyIsArray:!0,allowDuplicate:!1})}return o},s.mergeNodeMaps=a=>{const o=a["@default"],l=Object.keys(a).sort();for(const u of l){if(u==="@default")continue;const h=a[u];let y=o[u];y?"@graph"in y||(y["@graph"]=[]):o[u]=y={"@id":u,"@graph":[]};const b=y["@graph"];for(const g of Object.keys(h).sort()){const m=h[g];e.isSubjectReference(m)||b.push(m)}}return o},ts}var rs,hl;function Cf(){if(hl)return rs;hl=1;const{isSubjectReference:r}=_t(),{createMergedNodeMap:e}=Cn(),t={};return rs=t,t.flatten=n=>{const i=e(n),s=[],a=Object.keys(i).sort();for(let o=0;o<a.length;++o){const l=i[a[o]];r(l)||s.push(l)}return s},rs}var ns,pl;function qf(){if(pl)return ns;pl=1;const r=et(),e=_t(),t=Xe(),{REGEX_BCP47:n,addValue:i}=Ye(),{handleEvent:s}=Zr(),{RDF_LIST:a,RDF_FIRST:o,RDF_REST:l,RDF_NIL:u,RDF_TYPE:h,RDF_JSON_LITERAL:y,XSD_BOOLEAN:b,XSD_DOUBLE:g,XSD_INTEGER:m,XSD_STRING:_}=da(),x={};ns=x,x.fromRDF=async(I,w)=>{const{useRdfType:d=!1,useNativeTypes:p=!1,rdfDirection:N=null}=w,D={},T={"@default":D},q={};if(N){if(N==="compound-literal")throw new r("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:N});if(N!=="i18n-datatype")throw new r("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:N})}for(const B of I){const A=B.graph.termType==="DefaultGraph"?"@default":B.graph.value;A in T||(T[A]={}),A!=="@default"&&!(A in D)&&(D[A]={"@id":A});const j=T[A],Y=B.subject.value,L=B.predicate.value,ee=B.object;Y in j||(j[Y]={"@id":Y});const P=j[Y],K=ee.termType.endsWith("Node");if(K&&!(ee.value in j)&&(j[ee.value]={"@id":ee.value}),L===h&&!d&&K){i(P,"@type",ee.value,{propertyIsArray:!0});continue}const v=S(ee,p,N,w);if(i(P,L,v,{propertyIsArray:!0}),K)if(ee.value===u){const U=j[ee.value];"usages"in U||(U.usages=[]),U.usages.push({node:P,property:L,value:v})}else ee.value in q?q[ee.value]=!1:q[ee.value]={node:P,property:L,value:v}}for(const B in T){const A=T[B];if(!(u in A))continue;const j=A[u];if(j.usages){for(let Y of j.usages){let L=Y.node,ee=Y.property,P=Y.value;const K=[],v=[];let U=Object.keys(L).length;for(;ee===l&&t.isObject(q[L["@id"]])&&t.isArray(L[o])&&L[o].length===1&&t.isArray(L[l])&&L[l].length===1&&(U===3||U===4&&t.isArray(L["@type"])&&L["@type"].length===1&&L["@type"][0]===a)&&(K.push(L[o][0]),v.push(L["@id"]),Y=q[L["@id"]],L=Y.node,ee=Y.property,P=Y.value,U=Object.keys(L).length,!!e.isBlankNode(L)););delete P["@id"],P["@list"]=K.reverse();for(const Q of v)delete A[Q]}delete j.usages}}const R=[],M=Object.keys(D).sort();for(const B of M){const A=D[B];if(B in T){const j=A["@graph"]=[],Y=T[B],L=Object.keys(Y).sort();for(const ee of L){const P=Y[ee];e.isSubjectReference(P)||j.push(P)}}e.isSubjectReference(A)||R.push(A)}return R};function S(I,w,d,p){if(I.termType.endsWith("Node"))return{"@id":I.value};const N={"@value":I.value};if(I.language)I.language.match(n)||p.eventHandler&&s({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:I.language}},options:p}),N["@language"]=I.language;else{let D=I.datatype.value;if(D||(D=_),D===y){D="@json";try{N["@value"]=JSON.parse(N["@value"])}catch(T){throw new r("JSON literal could not be parsed.","jsonld.InvalidJsonLiteral",{code:"invalid JSON literal",value:N["@value"],cause:T})}}if(w){if(D===b)N["@value"]==="true"?N["@value"]=!0:N["@value"]==="false"&&(N["@value"]=!1);else if(t.isNumeric(N["@value"]))if(D===m){const T=parseInt(N["@value"],10);T.toFixed(0)===N["@value"]&&(N["@value"]=T)}else D===g&&(N["@value"]=parseFloat(N["@value"]));[b,m,g,_].includes(D)||(N["@type"]=D)}else if(d==="i18n-datatype"&&D.startsWith("https://www.w3.org/ns/i18n#")){const[,T,q]=D.split(/[#_]/);T.length>0&&(N["@language"]=T,T.match(n)||p.eventHandler&&s({event:{type:["JsonLdEvent"],code:"invalid @language value",level:"warning",message:"@language value must be valid BCP47.",details:{language:T}},options:p})),N["@direction"]=q}else D!==_&&(N["@type"]=D)}return N}return ns}var is,gl;function Bf(){return gl||(gl=1,is=function r(e){return e===null||typeof e!="object"||e.toJSON!=null?JSON.stringify(e):Array.isArray(e)?"["+e.reduce((t,n,i)=>{const s=i===0?"":",",a=n===void 0||typeof n=="symbol"?null:n;return t+s+r(a)},"")+"]":"{"+Object.keys(e).sort().reduce((t,n,i)=>{if(e[n]===void 0||typeof e[n]=="symbol")return t;const s=t.length===0?"":",";return t+s+r(n)+":"+r(e[n])},"")+"}"}),is}var ss,yl;function Ff(){if(yl)return ss;yl=1;const{createNodeMap:r}=Cn(),{isKeyword:e}=Ut(),t=_t(),n=Bf(),i=et(),s=Xe(),a=Ye(),{handleEvent:o}=Zr(),{RDF_FIRST:l,RDF_REST:u,RDF_NIL:h,RDF_TYPE:y,RDF_JSON_LITERAL:b,RDF_LANGSTRING:g,XSD_BOOLEAN:m,XSD_DOUBLE:_,XSD_INTEGER:x,XSD_STRING:S}=da(),{isAbsolute:I}=At(),w={};ss=w,w.toRDF=(D,T)=>{const q=new a.IdentifierIssuer("_:b"),R={"@default":{}};r(D,R,"@default",q);const M=[],B=Object.keys(R).sort();for(const A of B){let j;if(A==="@default")j={termType:"DefaultGraph",value:""};else if(I(A))A.startsWith("_:")?j={termType:"BlankNode"}:j={termType:"NamedNode"},j.value=A;else{T.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative graph reference",level:"warning",message:"Relative graph reference found.",details:{graph:A}},options:T});continue}d(M,R[A],j,q,T)}return M};function d(D,T,q,R,M){const B=Object.keys(T).sort();for(const A of B){const j=T[A],Y=Object.keys(j).sort();for(let L of Y){const ee=j[L];if(L==="@type")L=y;else if(e(L))continue;for(const P of ee){const K={termType:A.startsWith("_:")?"BlankNode":"NamedNode",value:A};if(!I(A)){M.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative subject reference",level:"warning",message:"Relative subject reference found.",details:{subject:A}},options:M});continue}const v={termType:L.startsWith("_:")?"BlankNode":"NamedNode",value:L};if(!I(L)){M.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative predicate reference",level:"warning",message:"Relative predicate reference found.",details:{predicate:L}},options:M});continue}if(v.termType==="BlankNode"&&!M.produceGeneralizedRdf){M.eventHandler&&o({event:{type:["JsonLdEvent"],code:"blank node predicate",level:"warning",message:"Dropping blank node predicate.",details:{property:R.getOldIds().find(Q=>R.getId(Q)===L)}},options:M});continue}const U=N(P,R,D,q,M.rdfDirection,M);U&&D.push({subject:K,predicate:v,object:U,graph:q})}}}}function p(D,T,q,R,M,B){const A={termType:"NamedNode",value:l},j={termType:"NamedNode",value:u},Y={termType:"NamedNode",value:h},L=D.pop(),ee=L?{termType:"BlankNode",value:T.getId()}:Y;let P=ee;for(const K of D){const v=N(K,T,q,R,M,B),U={termType:"BlankNode",value:T.getId()};q.push({subject:P,predicate:A,object:v,graph:R}),q.push({subject:P,predicate:j,object:U,graph:R}),P=U}if(L){const K=N(L,T,q,R,M,B);q.push({subject:P,predicate:A,object:K,graph:R}),q.push({subject:P,predicate:j,object:Y,graph:R})}return ee}function N(D,T,q,R,M,B){const A={};if(t.isValue(D)){A.termType="Literal",A.value=void 0,A.datatype={termType:"NamedNode"};let j=D["@value"];const Y=D["@type"]||null;if(Y==="@json")A.value=n(j),A.datatype.value=b;else if(s.isBoolean(j))A.value=j.toString(),A.datatype.value=Y||m;else if(s.isDouble(j)||Y===_)s.isDouble(j)||(j=parseFloat(j)),A.value=j.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),A.datatype.value=Y||_;else if(s.isNumber(j))A.value=j.toFixed(0),A.datatype.value=Y||x;else if("@direction"in D&&M==="i18n-datatype"){const L=(D["@language"]||"").toLowerCase(),ee=D["@direction"],P=`https://www.w3.org/ns/i18n#${L}_${ee}`;A.datatype.value=P,A.value=j}else{if("@direction"in D&&M==="compound-literal")throw new i("Unsupported rdfDirection value.","jsonld.InvalidRdfDirection",{value:M});if("@direction"in D&&M)throw new i("Unknown rdfDirection value.","jsonld.InvalidRdfDirection",{value:M});"@language"in D?("@direction"in D&&!M&&B.eventHandler&&o({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:A.value}},options:B}),A.value=j,A.datatype.value=Y||g,A.language=D["@language"]):("@direction"in D&&!M&&B.eventHandler&&o({event:{type:["JsonLdEvent"],code:"rdfDirection not set",level:"warning",message:"rdfDirection not set for @direction.",details:{object:A.value}},options:B}),A.value=j,A.datatype.value=Y||S)}}else if(t.isList(D)){const j=p(D["@list"],T,q,R,M,B);A.termType=j.termType,A.value=j.value}else{const j=s.isObject(D)?D["@id"]:D;A.termType=j.startsWith("_:")?"BlankNode":"NamedNode",A.value=j}return A.termType==="NamedNode"&&!I(A.value)?(B.eventHandler&&o({event:{type:["JsonLdEvent"],code:"relative object reference",level:"warning",message:"Relative object reference found.",details:{object:A.value}},options:B}),null):A}return ss}var as,ml;function Uf(){if(ml)return as;ml=1;const{isKeyword:r}=Ut(),e=_t(),t=Xe(),n=Ye(),i=At(),s=et(),{createNodeMap:a,mergeNodeMapGraphs:o}=Cn(),l={};as=l,l.frameMergedOrDefault=(d,p,N)=>{const D={options:N,embedded:!1,graph:"@default",graphMap:{"@default":{}},subjectStack:[],link:{},bnodeMap:{}},T=new n.IdentifierIssuer("_:b");a(d,D.graphMap,"@default",T),N.merged&&(D.graphMap["@merged"]=o(D.graphMap),D.graph="@merged"),D.subjects=D.graphMap[D.graph];const q=[];l.frame(D,Object.keys(D.subjects).sort(),p,q),N.pruneBlankNodeIdentifiers&&(N.bnodesToClear=Object.keys(D.bnodeMap).filter(R=>D.bnodeMap[R].length===1));// remove @preserve from results
|
|
301
|
+
return N.link={},x(q,N)},l.frame=(d,p,N,D,T=null)=>{b(N),N=N[0];const q=d.options,R={embed:y(N,q,"embed"),explicit:y(N,q,"explicit"),requireAll:y(N,q,"requireAll")};d.link.hasOwnProperty(d.graph)||(d.link[d.graph]={});const M=d.link[d.graph],B=g(d,p,N,R),A=Object.keys(B).sort();for(const j of A){const Y=B[j];if(T===null?d.uniqueEmbeds={[d.graph]:{}}:d.uniqueEmbeds[d.graph]=d.uniqueEmbeds[d.graph]||{},R.embed==="@link"&&j in M){S(D,T,M[j]);continue}const L={"@id":j};if(j.indexOf("_:")===0&&n.addValue(d.bnodeMap,j,L,{propertyIsArray:!0}),M[j]=L,(R.embed==="@first"||R.embed==="@last")&&d.is11)throw new s("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:N});if(!(!d.embedded&&d.uniqueEmbeds[d.graph].hasOwnProperty(j))){if(d.embedded&&(R.embed==="@never"||h(Y,d.graph,d.subjectStack))){S(D,T,L);continue}if(d.embedded&&(R.embed=="@first"||R.embed=="@once")&&d.uniqueEmbeds[d.graph].hasOwnProperty(j)){S(D,T,L);continue}if(R.embed==="@last"&&j in d.uniqueEmbeds[d.graph]&&_(d,j),d.uniqueEmbeds[d.graph][j]={parent:D,property:T},d.subjectStack.push({subject:Y,graph:d.graph}),j in d.graphMap){let ee=!1,P=null;"@graph"in N?(P=N["@graph"][0],ee=!(j==="@merged"||j==="@default"),t.isObject(P)||(P={})):(ee=d.graph!=="@merged",P={}),ee&&l.frame({...d,graph:j,embedded:!1},Object.keys(d.graphMap[j]).sort(),[P],L,"@graph")}"@included"in N&&l.frame({...d,embedded:!1},p,N["@included"],L,"@included");for(const ee of Object.keys(Y).sort()){if(r(ee)){if(L[ee]=n.clone(Y[ee]),ee==="@type")for(const P of Y["@type"])P.indexOf("_:")===0&&n.addValue(d.bnodeMap,P,L,{propertyIsArray:!0});continue}if(!(R.explicit&&!(ee in N)))for(const P of Y[ee]){const K=ee in N?N[ee]:u(R);if(e.isList(P)){const v=N[ee]&&N[ee][0]&&N[ee][0]["@list"]?N[ee][0]["@list"]:u(R),U={"@list":[]};S(L,ee,U);const Q=P["@list"];for(const z of Q)e.isSubjectReference(z)?l.frame({...d,embedded:!0},[z["@id"]],v,U,"@list"):S(U,"@list",n.clone(z))}else e.isSubjectReference(P)?l.frame({...d,embedded:!0},[P["@id"]],K,L,ee):w(K[0],P)&&S(L,ee,n.clone(P))}}for(const ee of Object.keys(N).sort()){if(ee==="@type"){if(!t.isObject(N[ee][0])||!("@default"in N[ee][0]))continue}else if(r(ee))continue;const P=N[ee][0]||{};if(!y(P,q,"omitDefault")&&!(ee in L)){let v="@null";"@default"in P&&(v=n.clone(P["@default"])),t.isArray(v)||(v=[v]),L[ee]=[{"@preserve":v}]}}for(const ee of Object.keys(N["@reverse"]||{}).sort()){const P=N["@reverse"][ee];for(const K of Object.keys(d.subjects))n.getValues(d.subjects[K],ee).some(U=>U["@id"]===j)&&(L["@reverse"]=L["@reverse"]||{},n.addValue(L["@reverse"],ee,[],{propertyIsArray:!0}),l.frame({...d,embedded:!0},[K],P,L["@reverse"][ee],T))}S(D,T,L),d.subjectStack.pop()}}},l.cleanupNull=(d,p)=>{if(t.isArray(d))return d.map(D=>l.cleanupNull(D,p)).filter(D=>D);if(d==="@null")return null;if(t.isObject(d)){if("@id"in d){const N=d["@id"];if(p.link.hasOwnProperty(N)){const D=p.link[N].indexOf(d);if(D!==-1)return p.link[N][D];p.link[N].push(d)}else p.link[N]=[d]}for(const N in d)d[N]=l.cleanupNull(d[N],p)}return d};function u(d){const p={};for(const N in d)d[N]!==void 0&&(p["@"+N]=[d[N]]);return[p]}function h(d,p,N){for(let D=N.length-1;D>=0;--D){const T=N[D];if(T.graph===p&&T.subject["@id"]===d["@id"])return!0}return!1}function y(d,p,N){const D="@"+N;let T=D in d?d[D][0]:p[N];if(N==="embed"){if(T===!0)T="@once";else if(T===!1)T="@never";else if(T!=="@always"&&T!=="@never"&&T!=="@link"&&T!=="@first"&&T!=="@last"&&T!=="@once")throw new s("Invalid JSON-LD syntax; invalid value of @embed.","jsonld.SyntaxError",{code:"invalid @embed value",frame:d})}return T}function b(d){if(!t.isArray(d)||d.length!==1||!t.isObject(d[0]))throw new s("Invalid JSON-LD syntax; a JSON-LD frame must be a single object.","jsonld.SyntaxError",{frame:d});if("@id"in d[0]){for(const p of n.asArray(d[0]["@id"]))if(!(t.isObject(p)||i.isAbsolute(p))||t.isString(p)&&p.indexOf("_:")===0)throw new s("Invalid JSON-LD syntax; invalid @id in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:d})}if("@type"in d[0]){for(const p of n.asArray(d[0]["@type"]))if(!(t.isObject(p)||i.isAbsolute(p)||p==="@json")||t.isString(p)&&p.indexOf("_:")===0)throw new s("Invalid JSON-LD syntax; invalid @type in frame.","jsonld.SyntaxError",{code:"invalid frame",frame:d})}}function g(d,p,N,D){const T={};for(const q of p){const R=d.graphMap[d.graph][q];m(d,R,N,D)&&(T[q]=R)}return T}function m(d,p,N,D){let T=!0,q=!1;for(const R in N){let M=!1;const B=n.getValues(p,R),A=n.getValues(N,R).length===0;if(R==="@id"){if(t.isEmptyObject(N["@id"][0]||{})?M=!0:N["@id"].length>=0&&(M=N["@id"].includes(B[0])),!D.requireAll)return M}else if(R==="@type"){if(T=!1,A){if(B.length>0)return!1;M=!0}else if(N["@type"].length===1&&t.isEmptyObject(N["@type"][0]))M=B.length>0;else for(const j of N["@type"])t.isObject(j)&&"@default"in j?M=!0:M=M||B.some(Y=>Y===j);if(!D.requireAll)return M}else{if(r(R))continue;{const j=n.getValues(N,R)[0];let Y=!1;if(j&&(b([j]),Y="@default"in j),T=!1,B.length===0&&Y)continue;if(B.length>0&&A)return!1;if(j===void 0){if(B.length>0)return!1;M=!0}else if(e.isList(j)){const L=j["@list"][0];if(e.isList(B[0])){const ee=B[0]["@list"];e.isValue(L)?M=ee.some(P=>w(L,P)):(e.isSubject(L)||e.isSubjectReference(L))&&(M=ee.some(P=>I(d,L,P,D)))}}else e.isValue(j)?M=B.some(L=>w(j,L)):e.isSubjectReference(j)?M=B.some(L=>I(d,j,L,D)):t.isObject(j)?M=B.length>0:M=!1}}if(!M&&D.requireAll)return!1;q=q||M}return T||q}function _(d,p){const N=d.uniqueEmbeds[d.graph],D=N[p],T=D.parent,q=D.property,R={"@id":p};if(t.isArray(T)){for(let B=0;B<T.length;++B)if(n.compareValues(T[B],R)){T[B]=R;break}}else{const B=t.isArray(T[q]);n.removeValue(T,q,R,{propertyIsArray:B}),n.addValue(T,q,R,{propertyIsArray:B})}const M=B=>{const A=Object.keys(N);for(const j of A)j in N&&t.isObject(N[j].parent)&&N[j].parent["@id"]===B&&(delete N[j],M(j))};M(p)}/**
|
|
302
|
+
* Removes the @preserve keywords from expanded result of framing.
|
|
303
|
+
*
|
|
304
|
+
* @param input the framed, framed output.
|
|
305
|
+
* @param options the framing options used.
|
|
306
|
+
*
|
|
307
|
+
* @return the resulting output.
|
|
308
|
+
*/function x(d,p){if(t.isArray(d))return d.map(N=>x(N,p));if(t.isObject(d)){// remove @preserve
|
|
309
|
+
if("@preserve"in d)return d["@preserve"][0];if(e.isValue(d))return d;if(e.isList(d))return d["@list"]=x(d["@list"],p),d;if("@id"in d){const N=d["@id"];if(p.link.hasOwnProperty(N)){const D=p.link[N].indexOf(d);if(D!==-1)return p.link[N][D];p.link[N].push(d)}else p.link[N]=[d]}for(const N in d){if(N==="@id"&&p.bnodesToClear.includes(d[N])){delete d["@id"];continue}d[N]=x(d[N],p)}}return d}function S(d,p,N){t.isObject(d)?n.addValue(d,p,N,{propertyIsArray:!0}):d.push(N)}function I(d,p,N,D){if(!("@id"in N))return!1;const T=d.subjects[N["@id"]];return T&&m(d,T,p,D)}function w(d,p){const N=p["@value"],D=p["@type"],T=p["@language"],q=d["@value"]?t.isArray(d["@value"])?d["@value"]:[d["@value"]]:[],R=d["@type"]?t.isArray(d["@type"])?d["@type"]:[d["@type"]]:[],M=d["@language"]?t.isArray(d["@language"])?d["@language"]:[d["@language"]]:[];return q.length===0&&R.length===0&&M.length===0?!0:!(!(q.includes(N)||t.isEmptyObject(q[0]))||!(!D&&R.length===0||R.includes(D)||D&&t.isEmptyObject(R[0]))||!(!T&&M.length===0||M.includes(T)||T&&t.isEmptyObject(M[0])))}return as}var os,bl;function Hf(){if(bl)return os;bl=1;const r=et(),{isArray:e,isObject:t,isString:n,isUndefined:i}=Xe(),{isList:s,isValue:a,isGraph:o,isSimpleGraph:l,isSubjectReference:u}=_t(),{expandIri:h,getContextValue:y,isKeyword:b,process:g,processingMode:m}=Ut(),{removeBase:_,prependBase:x}=At(),{REGEX_KEYWORD:S,addValue:I,asArray:w,compareShortestLeast:d}=Ye(),p={};os=p,p.compact=async({activeCtx:T,activeProperty:q=null,element:R,options:M={}})=>{if(e(R)){let A=[];for(let j=0;j<R.length;++j){const Y=await p.compact({activeCtx:T,activeProperty:q,element:R[j],options:M});Y!==null&&A.push(Y)}return M.compactArrays&&A.length===1&&(y(T,q,"@container")||[]).length===0&&(A=A[0]),A}const B=y(T,q,"@context");if(i(B)||(T=await g({activeCtx:T,localCtx:B,propagate:!0,overrideProtected:!0,options:M})),t(R)){if(M.link&&"@id"in R&&M.link.hasOwnProperty(R["@id"])){const v=M.link[R["@id"]];for(let U=0;U<v.length;++U)if(v[U].expanded===R)return v[U].compacted}if(a(R)||u(R)){const v=p.compactValue({activeCtx:T,activeProperty:q,value:R,options:M});return M.link&&u(R)&&(M.link.hasOwnProperty(R["@id"])||(M.link[R["@id"]]=[]),M.link[R["@id"]].push({expanded:R,compacted:v})),v}if(s(R)&&(y(T,q,"@container")||[]).includes("@list"))return p.compact({activeCtx:T,activeProperty:q,element:R["@list"],options:M});const A=q==="@reverse",j={},Y=T;!a(R)&&!u(R)&&(T=T.revertToPreviousContext());const L=y(Y,q,"@context");i(L)||(T=await g({activeCtx:T,localCtx:L,propagate:!0,overrideProtected:!0,options:M})),M.link&&"@id"in R&&(M.link.hasOwnProperty(R["@id"])||(M.link[R["@id"]]=[]),M.link[R["@id"]].push({expanded:R,compacted:j}));let ee=R["@type"]||[];ee.length>1&&(ee=Array.from(ee).sort());const P=T;for(const v of ee){const U=p.compactIri({activeCtx:P,iri:v,relativeTo:{vocab:!0}}),Q=y(Y,U,"@context");i(Q)||(T=await g({activeCtx:T,localCtx:Q,options:M,propagate:!1}))}const K=Object.keys(R).sort();for(const v of K){const U=R[v];if(v==="@id"){let Q=w(U).map(ae=>p.compactIri({activeCtx:T,iri:ae,relativeTo:{vocab:!1},base:M.base}));Q.length===1&&(Q=Q[0]);const z=p.compactIri({activeCtx:T,iri:"@id",relativeTo:{vocab:!0}});j[z]=Q;continue}if(v==="@type"){let Q=w(U).map(W=>p.compactIri({activeCtx:Y,iri:W,relativeTo:{vocab:!0}}));Q.length===1&&(Q=Q[0]);const z=p.compactIri({activeCtx:T,iri:"@type",relativeTo:{vocab:!0}}),V=(y(T,z,"@container")||[]).includes("@set")&&m(T,1.1)||e(Q)&&U.length===0;I(j,z,Q,{propertyIsArray:V});continue}if(v==="@reverse"){const Q=await p.compact({activeCtx:T,activeProperty:"@reverse",element:U,options:M});for(const z in Q)if(T.mappings.has(z)&&T.mappings.get(z).reverse){const ae=Q[z],V=(y(T,z,"@container")||[]).includes("@set")||!M.compactArrays;I(j,z,ae,{propertyIsArray:V}),delete Q[z]}if(Object.keys(Q).length>0){const z=p.compactIri({activeCtx:T,iri:v,relativeTo:{vocab:!0}});I(j,z,Q)}continue}if(v==="@preserve"){const Q=await p.compact({activeCtx:T,activeProperty:q,element:U,options:M});e(Q)&&Q.length===0||I(j,v,Q);continue}if(v==="@index"){if((y(T,q,"@container")||[]).includes("@index"))continue;const z=p.compactIri({activeCtx:T,iri:v,relativeTo:{vocab:!0}});I(j,z,U);continue}if(v!=="@graph"&&v!=="@list"&&v!=="@included"&&b(v)){const Q=p.compactIri({activeCtx:T,iri:v,relativeTo:{vocab:!0}});I(j,Q,U);continue}if(!e(U))throw new r("JSON-LD expansion error; expanded value must be an array.","jsonld.SyntaxError");if(U.length===0){const Q=p.compactIri({activeCtx:T,iri:v,value:U,relativeTo:{vocab:!0},reverse:A}),z=T.mappings.has(Q)?T.mappings.get(Q)["@nest"]:null;let ae=j;z&&(D(T,z,M),t(j[z])||(j[z]={}),ae=j[z]),I(ae,Q,U,{propertyIsArray:!0})}for(const Q of U){const z=p.compactIri({activeCtx:T,iri:v,value:Q,relativeTo:{vocab:!0},reverse:A}),ae=T.mappings.has(z)?T.mappings.get(z)["@nest"]:null;let H=j;ae&&(D(T,ae,M),t(j[ae])||(j[ae]={}),H=j[ae]);const V=y(T,z,"@container")||[],W=o(Q),F=s(Q);let Z;F?Z=Q["@list"]:W&&(Z=Q["@graph"]);let te=await p.compact({activeCtx:T,activeProperty:z,element:F||W?Z:Q,options:M});if(F)if(e(te)||(te=[te]),!V.includes("@list"))te={[p.compactIri({activeCtx:T,iri:"@list",relativeTo:{vocab:!0}})]:te},"@index"in Q&&(te[p.compactIri({activeCtx:T,iri:"@index",relativeTo:{vocab:!0}})]=Q["@index"]);else{I(H,z,te,{valueIsArray:!0,allowDuplicate:!0});continue}if(W)if(V.includes("@graph")&&(V.includes("@id")||V.includes("@index")&&l(Q))){let ce;H.hasOwnProperty(z)?ce=H[z]:H[z]=ce={};const fe=(V.includes("@id")?Q["@id"]:Q["@index"])||p.compactIri({activeCtx:T,iri:"@none",relativeTo:{vocab:!0}});I(ce,fe,te,{propertyIsArray:!M.compactArrays||V.includes("@set")})}else V.includes("@graph")&&l(Q)?(e(te)&&te.length>1&&(te={"@included":te}),I(H,z,te,{propertyIsArray:!M.compactArrays||V.includes("@set")})):(e(te)&&te.length===1&&M.compactArrays&&(te=te[0]),te={[p.compactIri({activeCtx:T,iri:"@graph",relativeTo:{vocab:!0}})]:te},"@id"in Q&&(te[p.compactIri({activeCtx:T,iri:"@id",relativeTo:{vocab:!0}})]=Q["@id"]),"@index"in Q&&(te[p.compactIri({activeCtx:T,iri:"@index",relativeTo:{vocab:!0}})]=Q["@index"]),I(H,z,te,{propertyIsArray:!M.compactArrays||V.includes("@set")}));else if(V.includes("@language")||V.includes("@index")||V.includes("@id")||V.includes("@type")){let ce;H.hasOwnProperty(z)?ce=H[z]:H[z]=ce={};let fe;if(V.includes("@language"))a(te)&&(te=te["@value"]),fe=Q["@language"];else if(V.includes("@index")){const O=y(T,z,"@index")||"@index",G=p.compactIri({activeCtx:T,iri:O,relativeTo:{vocab:!0}});if(O==="@index")fe=Q["@index"],delete te[G];else{let re;if([fe,...re]=w(te[O]||[]),!n(fe))fe=null;else switch(re.length){case 0:delete te[O];break;case 1:te[O]=re[0];break;default:te[O]=re;break}}}else if(V.includes("@id")){const O=p.compactIri({activeCtx:T,iri:"@id",relativeTo:{vocab:!0}});fe=te[O],delete te[O]}else if(V.includes("@type")){const O=p.compactIri({activeCtx:T,iri:"@type",relativeTo:{vocab:!0}});let G;switch([fe,...G]=w(te[O]||[]),G.length){case 0:delete te[O];break;case 1:te[O]=G[0];break;default:te[O]=G;break}Object.keys(te).length===1&&"@id"in Q&&(te=await p.compact({activeCtx:T,activeProperty:z,element:{"@id":Q["@id"]},options:M}))}fe||(fe=p.compactIri({activeCtx:T,iri:"@none",relativeTo:{vocab:!0}})),I(ce,fe,te,{propertyIsArray:V.includes("@set")})}else{const ce=!M.compactArrays||V.includes("@set")||V.includes("@list")||e(te)&&te.length===0||v==="@list"||v==="@graph";I(H,z,te,{propertyIsArray:ce})}}}return j}return R},p.compactIri=({activeCtx:T,iri:q,value:R=null,relativeTo:M={vocab:!1},reverse:B=!1,base:A=null})=>{if(q===null)return q;T.isPropertyTermScoped&&T.previousContext&&(T=T.previousContext);const j=T.getInverse();if(b(q)&&q in j&&"@none"in j[q]&&"@type"in j[q]["@none"]&&"@none"in j[q]["@none"]["@type"])return j[q]["@none"]["@type"]["@none"];if(M.vocab&&q in j){const K=T["@language"]||"@none",v=[];t(R)&&"@index"in R&&!("@graph"in R)&&v.push("@index","@index@set"),t(R)&&"@preserve"in R&&(R=R["@preserve"][0]),o(R)?("@index"in R&&v.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R&&v.push("@graph@id","@graph@id@set"),v.push("@graph","@graph@set","@set"),"@index"in R||v.push("@graph@index","@graph@index@set","@index","@index@set"),"@id"in R||v.push("@graph@id","@graph@id@set")):t(R)&&!a(R)&&v.push("@id","@id@set","@type","@set@type");let U="@language",Q="@null";if(B)U="@type",Q="@reverse",v.push("@set");else if(s(R)){"@index"in R||v.push("@list");const ae=R["@list"];if(ae.length===0)U="@any",Q="@none";else{let H=ae.length===0?K:null,V=null;for(let W=0;W<ae.length;++W){const F=ae[W];let Z="@none",te="@none";if(a(F))if("@direction"in F){const ce=(F["@language"]||"").toLowerCase(),fe=F["@direction"];Z=`${ce}_${fe}`}else"@language"in F?Z=F["@language"].toLowerCase():"@type"in F?te=F["@type"]:Z="@null";else te="@id";if(H===null?H=Z:Z!==H&&a(F)&&(H="@none"),V===null?V=te:te!==V&&(V="@none"),H==="@none"&&V==="@none")break}H=H||"@none",V=V||"@none",V!=="@none"?(U="@type",Q=V):Q=H}}else{if(a(R))if("@language"in R&&!("@index"in R)){v.push("@language","@language@set"),Q=R["@language"];const ae=R["@direction"];ae&&(Q=`${Q}_${ae}`)}else"@direction"in R&&!("@index"in R)?Q=`_${R["@direction"]}`:"@type"in R&&(U="@type",Q=R["@type"]);else U="@type",Q="@id";v.push("@set")}v.push("@none"),t(R)&&!("@index"in R)&&v.push("@index","@index@set"),a(R)&&Object.keys(R).length===1&&v.push("@language","@language@set");const z=N(T,q,R,v,U,Q);if(z!==null)return z}if(M.vocab&&"@vocab"in T){const K=T["@vocab"];if(q.indexOf(K)===0&&q!==K){const v=q.substr(K.length);if(!T.mappings.has(v))return v}}let Y=null;const L=[];let ee=T.fastCurieMap;const P=q.length-1;for(let K=0;K<P&&q[K]in ee;++K)ee=ee[q[K]],""in ee&&L.push(ee[""][0]);for(let K=L.length-1;K>=0;--K){const v=L[K],U=v.terms;for(const Q of U){const z=Q+":"+q.substr(v.iri.length);T.mappings.get(Q)._prefix&&(!T.mappings.has(z)||R===null&&T.mappings.get(z)["@id"]===q)&&(Y===null||d(z,Y)<0)&&(Y=z)}}if(Y!==null)return Y;for(const[K,v]of T.mappings)if(v&&v._prefix&&q.startsWith(K+":"))throw new r(`Absolute IRI "${q}" confused with prefix "${K}".`,"jsonld.SyntaxError",{code:"IRI confused with prefix",context:T});if(!M.vocab)if("@base"in T)if(T["@base"]){const K=_(x(A,T["@base"]),q);return S.test(K)?`./${K}`:K}else return q;else return _(A,q);return q},p.compactValue=({activeCtx:T,activeProperty:q,value:R,options:M})=>{if(a(R)){const Y=y(T,q,"@type"),L=y(T,q,"@language"),ee=y(T,q,"@direction"),P=y(T,q,"@container")||[],K="@index"in R&&!P.includes("@index");if(!K&&Y!=="@none"&&(R["@type"]===Y||"@language"in R&&R["@language"]===L&&"@direction"in R&&R["@direction"]===ee||"@language"in R&&R["@language"]===L||"@direction"in R&&R["@direction"]===ee))return R["@value"];const v=Object.keys(R).length,U=v===1||v===2&&"@index"in R&&!K,Q="@language"in T,z=n(R["@value"]),ae=T.mappings.has(q)&&T.mappings.get(q)["@language"]===null;if(U&&Y!=="@none"&&(!Q||!z||ae))return R["@value"];const H={};return K&&(H[p.compactIri({activeCtx:T,iri:"@index",relativeTo:{vocab:!0}})]=R["@index"]),"@type"in R?H[p.compactIri({activeCtx:T,iri:"@type",relativeTo:{vocab:!0}})]=p.compactIri({activeCtx:T,iri:R["@type"],relativeTo:{vocab:!0}}):"@language"in R&&(H[p.compactIri({activeCtx:T,iri:"@language",relativeTo:{vocab:!0}})]=R["@language"]),"@direction"in R&&(H[p.compactIri({activeCtx:T,iri:"@direction",relativeTo:{vocab:!0}})]=R["@direction"]),H[p.compactIri({activeCtx:T,iri:"@value",relativeTo:{vocab:!0}})]=R["@value"],H}const B=h(T,q,{vocab:!0},M),A=y(T,q,"@type"),j=p.compactIri({activeCtx:T,iri:R["@id"],relativeTo:{vocab:A==="@vocab"},base:M.base});return A==="@id"||A==="@vocab"||B==="@graph"?j:{[p.compactIri({activeCtx:T,iri:"@id",relativeTo:{vocab:!0}})]:j}};function N(T,q,R,M,B,A){A===null&&(A="@null");const j=[];if((A==="@id"||A==="@reverse")&&t(R)&&"@id"in R){A==="@reverse"&&j.push("@reverse");const L=p.compactIri({activeCtx:T,iri:R["@id"],relativeTo:{vocab:!0}});T.mappings.has(L)&&T.mappings.get(L)&&T.mappings.get(L)["@id"]===R["@id"]?j.push.apply(j,["@vocab","@id"]):j.push.apply(j,["@id","@vocab"])}else{j.push(A);const L=j.find(ee=>ee.includes("_"));L&&j.push(L.replace(/^[^_]+_/,"_"))}j.push("@none");const Y=T.inverse[q];for(const L of M){if(!(L in Y))continue;const ee=Y[L][B];for(const P of j)if(P in ee)return ee[P]}return null}function D(T,q,R){if(h(T,q,{vocab:!0},R)!=="@nest")throw new r("JSON-LD compact error; nested property must have an @nest value resolving to @nest.","jsonld.SyntaxError",{code:"invalid @nest value"})}return os}var ls,wl;function Vf(){return wl||(wl=1,ls=r=>{class e{toString(){return"[object JsonLdProcessor]"}}return Object.defineProperty(e,"prototype",{writable:!1,enumerable:!1}),Object.defineProperty(e.prototype,"constructor",{writable:!0,enumerable:!1,configurable:!0,value:e}),e.compact=function(t,n){return arguments.length<2?Promise.reject(new TypeError("Could not compact, too few arguments.")):r.compact(t,n)},e.expand=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not expand, too few arguments.")):r.expand(t)},e.flatten=function(t){return arguments.length<1?Promise.reject(new TypeError("Could not flatten, too few arguments.")):r.flatten(t)},e}),ls}/**
|
|
310
|
+
* A JavaScript implementation of the JSON-LD API.
|
|
311
|
+
*
|
|
312
|
+
* @author Dave Longley
|
|
313
|
+
*
|
|
314
|
+
* @license BSD 3-Clause License
|
|
315
|
+
* Copyright (c) 2011-2022 Digital Bazaar, Inc.
|
|
316
|
+
* All rights reserved.
|
|
317
|
+
*
|
|
318
|
+
* Redistribution and use in source and binary forms, with or without
|
|
319
|
+
* modification, are permitted provided that the following conditions are met:
|
|
320
|
+
*
|
|
321
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
322
|
+
* this list of conditions and the following disclaimer.
|
|
323
|
+
*
|
|
324
|
+
* Redistributions in binary form must reproduce the above copyright
|
|
325
|
+
* notice, this list of conditions and the following disclaimer in the
|
|
326
|
+
* documentation and/or other materials provided with the distribution.
|
|
327
|
+
*
|
|
328
|
+
* Neither the name of the Digital Bazaar, Inc. nor the names of its
|
|
329
|
+
* contributors may be used to endorse or promote products derived from
|
|
330
|
+
* this software without specific prior written permission.
|
|
331
|
+
*
|
|
332
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
333
|
+
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
|
334
|
+
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
335
|
+
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
336
|
+
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
337
|
+
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
|
338
|
+
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
339
|
+
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
340
|
+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
341
|
+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
342
|
+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
343
|
+
*/var us,vl;function Gf(){if(vl)return us;vl=1;const r=ca(),e=jf(),t=Ye(),n=Df(),i=t.IdentifierIssuer,s=et(),a=ic(),o=Mf(),{expand:l}=Pf(),{flatten:u}=Cf(),{fromRDF:h}=qf(),{toRDF:y}=Ff(),{frameMergedOrDefault:b,cleanupNull:g}=Uf(),{isArray:m,isObject:_,isString:x}=Xe(),{isSubjectReference:S}=_t(),{expandIri:I,getInitialContext:w,process:d,processingMode:p}=Ut(),{compact:N,compactIri:D}=Hf(),{createNodeMap:T,createMergedNodeMap:q,mergeNodeMaps:R}=Cn(),{logEventHandler:M,logWarningEventHandler:B,safeEventHandler:A,setDefaultEventHandler:j,setupEventHandler:Y,strictEventHandler:L,unhandledEventHandler:ee}=Zr(),P=function(v){const U={},z=new a({max:100});v.compact=async function(H,V,W){if(arguments.length<2)throw new TypeError("Could not compact, too few arguments.");if(V===null)throw new s("The compaction context must not be null.","jsonld.CompactError",{code:"invalid local context"});if(H===null)return null;W=ae(W,{base:x(H)?H:"",compactArrays:!0,compactToRelative:!0,graph:!1,skipExpansion:!1,link:!1,issuer:new i("_:b"),contextResolver:new n({sharedCache:z})}),W.link&&(W.skipExpansion=!0),W.compactToRelative||delete W.base;let F;W.skipExpansion?F=H:F=await v.expand(H,W);const Z=await v.processContext(w(W),V,W);let te=await N({activeCtx:Z,element:F,options:W});W.compactArrays&&!W.graph&&m(te)?te.length===1?te=te[0]:te.length===0&&(te={}):W.graph&&_(te)&&(te=[te]),_(V)&&"@context"in V&&(V=V["@context"]),V=t.clone(V),m(V)||(V=[V]);const ce=V;V=[];for(let O=0;O<ce.length;++O)(!_(ce[O])||Object.keys(ce[O]).length>0)&&V.push(ce[O]);const fe=V.length>0;if(V.length===1&&(V=V[0]),m(te)){const O=D({activeCtx:Z,iri:"@graph",relativeTo:{vocab:!0}}),G=te;te={},fe&&(te["@context"]=V),te[O]=G}else if(_(te)&&fe){const O=te;te={"@context":V};for(const G in O)te[G]=O[G]}return te},v.expand=async function(H,V){if(arguments.length<1)throw new TypeError("Could not expand, too few arguments.");V=ae(V,{keepFreeFloatingNodes:!1,contextResolver:new n({sharedCache:z})});const W={},F=[];if("expandContext"in V){const fe=t.clone(V.expandContext);_(fe)&&"@context"in fe?W.expandContext=fe:W.expandContext={"@context":fe},F.push(W.expandContext)}let Z;if(!x(H))W.input=t.clone(H);else{const fe=await v.get(H,V);Z=fe.documentUrl,W.input=fe.document,fe.contextUrl&&(W.remoteContext={"@context":fe.contextUrl},F.push(W.remoteContext))}"base"in V||(V.base=Z||"");let te=w(V);for(const fe of F)te=await d({activeCtx:te,localCtx:fe,options:V});let ce=await l({activeCtx:te,element:W.input,options:V});return _(ce)&&"@graph"in ce&&Object.keys(ce).length===1?ce=ce["@graph"]:ce===null&&(ce=[]),m(ce)||(ce=[ce]),ce},v.flatten=async function(H,V,W){if(arguments.length<1)return new TypeError("Could not flatten, too few arguments.");typeof V=="function"?V=null:V=V||null,W=ae(W,{base:x(H)?H:"",contextResolver:new n({sharedCache:z})});const F=await v.expand(H,W),Z=u(F);return V===null?Z:(W.graph=!0,W.skipExpansion=!0,await v.compact(Z,V,W))},v.frame=async function(H,V,W){if(arguments.length<2)throw new TypeError("Could not frame, too few arguments.");if(W=ae(W,{base:x(H)?H:"",embed:"@once",explicit:!1,requireAll:!1,omitDefault:!1,bnodesToClear:[],contextResolver:new n({sharedCache:z})}),x(V)){const ue=await v.get(V,W);if(V=ue.document,ue.contextUrl){let de=V["@context"];de?m(de)?de.push(ue.contextUrl):de=[de,ue.contextUrl]:de=ue.contextUrl,V["@context"]=de}}const F=V?V["@context"]||{}:{},Z=await v.processContext(w(W),F,W);W.hasOwnProperty("omitGraph")||(W.omitGraph=p(Z,1.1)),W.hasOwnProperty("pruneBlankNodeIdentifiers")||(W.pruneBlankNodeIdentifiers=p(Z,1.1));const te=await v.expand(H,W),ce={...W};ce.isFrame=!0,ce.keepFreeFloatingNodes=!0;const fe=await v.expand(V,ce),O=Object.keys(V).map(ue=>I(Z,ue,{vocab:!0}));ce.merged=!O.includes("@graph"),ce.is11=p(Z,1.1);const G=b(te,fe,ce);ce.graph=!W.omitGraph,ce.skipExpansion=!0,ce.link={},ce.framing=!0;let re=await v.compact(G,F,ce);return ce.link={},re=g(re,ce),re},v.link=async function(H,V,W){const F={};return V&&(F["@context"]=V),F["@embed"]="@link",v.frame(H,F,W)},v.normalize=v.canonize=async function(H,V){if(arguments.length<1)throw new TypeError("Could not canonize, too few arguments.");if(V=ae(V,{base:x(H)?H:null,algorithm:"URDNA2015",skipExpansion:!1,safe:!0,contextResolver:new n({sharedCache:z})}),"inputFormat"in V){if(V.inputFormat!=="application/n-quads"&&V.inputFormat!=="application/nquads")throw new s("Unknown canonicalization input format.","jsonld.CanonizeError");const Z=o.parse(H);return r.canonize(Z,V)}const W={...V};delete W.format,W.produceGeneralizedRdf=!1;const F=await v.toRDF(H,W);return r.canonize(F,V)},v.fromRDF=async function(H,V){if(arguments.length<1)throw new TypeError("Could not convert from RDF, too few arguments.");V=ae(V,{format:x(H)?"application/n-quads":void 0});const{format:W}=V;let{rdfParser:F}=V;if(W){if(F=F||U[W],!F)throw new s("Unknown input format.","jsonld.UnknownFormat",{format:W})}else F=()=>H;const Z=await F(H);return h(Z,V)},v.toRDF=async function(H,V){if(arguments.length<1)throw new TypeError("Could not convert to RDF, too few arguments.");V=ae(V,{base:x(H)?H:"",skipExpansion:!1,contextResolver:new n({sharedCache:z})});let W;V.skipExpansion?W=H:W=await v.expand(H,V);const F=y(W,V);if(V.format){if(V.format==="application/n-quads"||V.format==="application/nquads")return o.serialize(F);throw new s("Unknown output format.","jsonld.UnknownFormat",{format:V.format})}return F},v.createNodeMap=async function(H,V){if(arguments.length<1)throw new TypeError("Could not create node map, too few arguments.");V=ae(V,{base:x(H)?H:"",contextResolver:new n({sharedCache:z})});const W=await v.expand(H,V);return q(W,V)},v.merge=async function(H,V,W){if(arguments.length<1)throw new TypeError("Could not merge, too few arguments.");if(!m(H))throw new TypeError('Could not merge, "docs" must be an array.');typeof V=="function"?V=null:V=V||null,W=ae(W,{contextResolver:new n({sharedCache:z})});const F=await Promise.all(H.map(ue=>{const de={...W};return v.expand(ue,de)}));let Z=!0;"mergeNodes"in W&&(Z=W.mergeNodes);const te=W.issuer||new i("_:b"),ce={"@default":{}};for(let ue=0;ue<F.length;++ue){const de=t.relabelBlankNodes(F[ue],{issuer:new i("_:b"+ue+"-")}),pe=Z||ue===0?ce:{"@default":{}};if(T(de,pe,"@default",te),pe!==ce)for(const X in pe){const le=pe[X];if(!(X in ce)){ce[X]=le;continue}const he=ce[X];for(const se in le)se in he||(he[se]=le[se])}}const fe=R(ce),O=[],G=Object.keys(fe).sort();for(let ue=0;ue<G.length;++ue){const de=fe[G[ue]];S(de)||O.push(de)}return V===null?O:(W.graph=!0,W.skipExpansion=!0,await v.compact(O,V,W))},Object.defineProperty(v,"documentLoader",{get:()=>v._documentLoader,set:H=>v._documentLoader=H}),v.documentLoader=async H=>{throw new s("Could not retrieve a JSON-LD document from the URL. URL dereferencing not implemented.","jsonld.LoadDocumentError",{code:"loading document failed",url:H})},v.get=async function(H,V){let W;typeof V.documentLoader=="function"?W=V.documentLoader:W=v.documentLoader;const F=await W(H);try{if(!F.document)throw new s("No remote document found at the given URL.","jsonld.NullRemoteDocument");x(F.document)&&(F.document=JSON.parse(F.document))}catch(Z){throw new s("Could not retrieve a JSON-LD document from the URL.","jsonld.LoadDocumentError",{code:"loading document failed",cause:Z,remoteDoc:F})}return F},v.processContext=async function(H,V,W){return W=ae(W,{base:"",contextResolver:new n({sharedCache:z})}),V===null?w(W):(V=t.clone(V),_(V)&&"@context"in V||(V={"@context":V}),d({activeCtx:H,localCtx:V,options:W}))},v.getContextValue=Ut().getContextValue,v.documentLoaders={},v.useDocumentLoader=function(H){if(!(H in v.documentLoaders))throw new s('Unknown document loader type: "'+H+'"',"jsonld.UnknownDocumentLoader",{type:H});v.documentLoader=v.documentLoaders[H].apply(v,Array.prototype.slice.call(arguments,1))},v.registerRDFParser=function(H,V){U[H]=V},v.unregisterRDFParser=function(H){delete U[H]},v.registerRDFParser("application/n-quads",o.parse),v.registerRDFParser("application/nquads",o.parse),v.url=At(),v.logEventHandler=M,v.logWarningEventHandler=B,v.safeEventHandler=A,v.setDefaultEventHandler=j,v.strictEventHandler=L,v.unhandledEventHandler=ee,v.util=t,Object.assign(v,t),v.promises=v,v.RequestQueue=nc(),v.JsonLdProcessor=Vf()(v),e.setupGlobals(v),e.setupDocumentLoaders(v);function ae(H,{documentLoader:V=v.documentLoader,...W}){if(H&&"compactionMap"in H)throw new s('"compactionMap" not supported.',"jsonld.OptionsError");if(H&&"expansionMap"in H)throw new s('"expansionMap" not supported.',"jsonld.OptionsError");return Object.assign({},{documentLoader:V},W,H,{eventHandler:Y({options:H})})}return v},K=function(){return P(function(){return K()})};return P(K),us=K,us}var Wf=Gf();const cs={},ds={};let Fs;class zf{constructor(e){this.loadedExternalUrls=[],this.loadedClasses=[],this.config=e}async loadGraphs(){this.loadedExternalUrls=[],this.loadedClasses=[];let e=Fs;this.config.prefixes={};const t=[];if(e||(e=new Ue,t.push(this.importRDF(this.config.attributes.shapes?this.config.attributes.shapes:this.config.attributes.shapesUrl?this.fetchRDF(this.config.attributes.shapesUrl):"",e,_n))),t.push(this.importRDF(this.config.attributes.values?this.config.attributes.values:this.config.attributes.valuesUrl?this.fetchRDF(this.config.attributes.valuesUrl):"",e,ot,new js({blankNodePrefix:""}))),await Promise.all(t),!Fs&&(e==null?void 0:e.size)==0&&this.config.attributes.valuesSubject){const n=[...e.getObjects(this.config.attributes.valuesSubject,qe,ot),...e.getObjects(this.config.attributes.valuesSubject,$s,ot)],i=[];for(const s of n){const a=this.toURL(s.value);a&&this.loadedExternalUrls.indexOf(a)<0&&(this.loadedExternalUrls.push(a),i.push(this.importRDF(this.fetchRDF(a),e,_n)))}try{await Promise.allSettled(i)}catch(s){console.warn(s)}}this.config.store=e}async importRDF(e,t,n,i){const s=i||new js,a=async o=>{const l=[];await new Promise((u,h)=>{s.parse(o,(y,b,g)=>{if(y)return console.warn("failed parsing graph",n,y.message),h(y);if(b){if(t.add(new An(b.subject,b.predicate,b.object,n)),this.config.attributes.ignoreOwlImports===null&&Zs.equals(b.predicate)){const m=this.toURL(b.object.value);m&&this.loadedExternalUrls.indexOf(m)<0&&(this.loadedExternalUrls.push(m),l.push(this.importRDF(this.fetchRDF(m),t,Se.namedNode(m),i)))}if(this.config.classInstanceProvider&&ea.equals(b.predicate)){const m=b.object.value;if(this.loadedClasses.indexOf(m)<0){let _;m in ds?_=ds[m]:(_=this.config.classInstanceProvider(m),ds[m]=_),this.loadedClasses.push(m),l.push(this.importRDF(_,t,n,i))}}return}g&&this.config.registerPrefixes(g),u(null)})});try{await Promise.allSettled(l)}catch(u){console.warn(u)}};if(e instanceof Promise&&(e=await e),e){try{e=await Wf.toRDF(JSON.parse(e),{format:"application/n-quads"})}catch{}await a(e)}}async fetchRDF(e){if(e in cs)return cs[e];const t=fetch(e,{headers:{Accept:"text/turtle, application/trig, application/n-triples, application/n-quads, text/n3, application/ld+json"}}).then(n=>n.text());return cs[e]=t,t}toURL(e){if(Ms(e))return e;if(this.config.prefixes){const t=e.split(":");if(t.length===2){const n=this.config.prefixes[t[0]];if(n&&(e=e.replace(`${t[0]}:`,n),Ms(e)))return e}}return null}}function Jf(r){Fs=r}class fs{constructor(){this.shapes=null,this.shapesUrl=null,this.shapeSubject=null,this.values=null,this.valuesUrl=null,this.valueSubject=null,this.valuesSubject=null,this.valuesNamespace="",this.valuesGraph=null,this.view=null,this.language=null,this.loading="Loading…",this.ignoreOwlImports=null,this.collapse=null,this.submitButton=null,this.generateNodeShapeReference=null,this.showNodeIds=null}}class _l{constructor(e,t){this.attributes=new fs,this.loader=new zf(this),this.prefixes={},this.editMode=!0,this.lists={},this.groups=[],this.renderedNodes=new Set,this._store=new Ue,this.theme=e,this.form=t,this.languages=[...new Set(navigator.languages.flatMap(n=>n.length>2?[n.toLocaleLowerCase(),n.substring(0,2)]:n)),""]}updateAttributes(e){const t=new fs;if(Object.keys(t).forEach(n=>{const i=e.dataset[n];i!==void 0&&(t[n]=i)}),this.editMode=t.view===null,this.attributes=t,this.attributes.valueSubject&&!this.attributes.valuesSubject&&(this.attributes.valuesSubject=this.attributes.valueSubject),t.language){const n=this.languages.indexOf(t.language);n>-1&&this.languages.splice(n,1),this.languages.unshift(t.language)}t.valuesGraph&&(this.valuesGraphId=Se.namedNode(t.valuesGraph))}static dataAttributes(){const e=new fs;return Object.keys(e).map(t=>(t=t.replace(/[A-Z]/g,n=>"-"+n.toLowerCase()),"data-"+t))}get store(){return this._store}set store(e){this._store=e,this.lists=e.extractLists(),this.groups=[],e.forSubjects(t=>{this.groups.push(t.id)},qe,`${be}PropertyGroup`,null)}registerPrefixes(e){for(const t in e)t&&(this.prefixes[t]=e[t])}}function Qf(r){return"_:"+r.value}function Xf(r,e){return[...r].map(t=>e(t)).join(`
|
|
344
|
+
`)+`
|
|
345
|
+
`}function Kf(){return""}function sc(r){return"<"+r.value+">"}const Yf=/["\\\\\n\r]/,Zf=/["\\\\\n\r]/g,eh={'"':'\\"',"\\":"\\\\","\n":"\\n","\r":"\\r"};function th(r){return eh[r]}function rh(r){return Yf.test(r)?r.replace(Zf,th):r}function nh(r){const e=rh(r.value);return r.datatype.value==="http://www.w3.org/2001/XMLSchema#string"?'"'+e+'"':r.datatype.value==="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"?'"'+e+'"@'+r.language:'"'+e+'"^^'+sc(r.datatype)}function ih(r,e){const t=e(r.subject),n=e(r.predicate),i=e(r.object),s=e(r.graph);return`${t} ${n} ${i} ${s?s+" ":""}.`}function sh(r){return"?"+r.value}function Je(r){if(!r)return null;if(r.termType==="BlankNode")return Qf(r);if(r.termType==="DefaultGraph")return Kf();if(r.termType==="Literal")return nh(r);if(r.termType==="NamedNode")return sc(r);if(r.termType==="Quad"||r.subject&&r.predicate&&r.object&&r.graph)return ih(r,Je);if(r.termType==="Variable")return sh(r);if(r[Symbol.iterator])return Xf(r,Je);throw new Error(`unknown termType ${r.termType}`)}class cr{constructor(e){if(this.index=new Map,e)for(const[t,n]of e)this.set(t,n)}get size(){return this.index.size}clear(){this.index.clear()}delete(e){return this.index.delete(Je(e))}*entries(){for(const[,{term:e,value:t}]of this.index)yield[e,t]}forEach(e,t){for(const n of this.entries())e.call(t,n[1],n[0],this)}get(e){const t=this.index.get(Je(e));return t&&t.value}has(e){return this.index.has(Je(e))}*keys(){for(const[,{term:e}]of this.index)yield e}set(e,t){const n=Je(e);return this.index.set(n,{term:e,value:t}),this}*values(){for(const[,{value:e}]of this.index)yield e}[Symbol.iterator](){return this.entries()[Symbol.iterator]()}}class xl{constructor({dataset:e,end:t,quad:n,start:i}){this.dataset=e,this.end=t,this.quad=n,this.start=i}get term(){return this.quad[this.end]}get graph(){return this.quad.graph}get startTerm(){return this.quad[this.start]}}function Sl(r){try{return Je(r)}catch{return null}}class Ze{constructor(e){if(this.index=new Map,e)for(const t of e)this.add(t)}get size(){return this.index.size}add(e){const t=Je(e);return this.index.has(t)||this.index.set(t,e),this}clear(){this.index.clear()}delete(e){return e?this.index.delete(Sl(e)):!1}entries(){return this.values().entries()}forEach(e,t){return this.values().forEach(e,t)}has(e){return e?this.index.has(Sl(e)):!1}values(){return new Set(this.index.values())}keys(){return this.values()}[Symbol.iterator](){return this.index.values()}}let ac=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};ac.prototype.termType="BlankNode";let fa=class{equals(e){return!!e&&e.termType===this.termType}};fa.prototype.termType="DefaultGraph";fa.prototype.value="";function El(r,e){if(!e)return null;if(e.termType==="BlankNode")return r.blankNode(e.value);if(e.termType==="DefaultGraph")return r.defaultGraph();if(e.termType==="Literal")return r.literal(e.value,e.language||r.namedNode(e.datatype.value));if(e.termType==="NamedNode")return r.namedNode(e.value);if(e.termType==="Quad"){const t=r.fromTerm(e.subject),n=r.fromTerm(e.predicate),i=r.fromTerm(e.object),s=r.fromTerm(e.graph);return r.quad(t,n,i,s)}if(e.termType==="Variable")return r.variable(e.value);throw new Error(`unknown termType ${e.termType}`)}let wn=class{constructor(e,t,n,i=""){this.value=e,this.language=t,this.datatype=n,this.direction=i}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value&&e.language===this.language&&e.datatype.equals(this.datatype)&&(e.direction||"")===this.direction}};wn.prototype.termType="Literal";let en=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};en.prototype.termType="NamedNode";let ha=class{constructor(e,t,n,i){this.subject=e,this.predicate=t,this.object=n,this.graph=i}equals(e){return!!e&&(e.termType==="Quad"||!e.termType)&&e.subject.equals(this.subject)&&e.predicate.equals(this.predicate)&&e.object.equals(this.object)&&e.graph.equals(this.graph)}};ha.prototype.termType="Quad";ha.prototype.value="";let oc=class{constructor(e){this.value=e}equals(e){return!!e&&e.termType===this.termType&&e.value===this.value}};oc.prototype.termType="Variable";const ah=new en("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),Il=new en("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),oh=new en("http://www.w3.org/2001/XMLSchema#string");let lc=class{constructor(){this.init()}init(){this._data={blankNodeCounter:0,defaultGraph:new fa}}namedNode(e){return new en(e)}blankNode(e){return e=e||"b"+ ++this._data.blankNodeCounter,new ac(e)}literal(e,t){return typeof t=="string"?new wn(e,t,Il):typeof(t==null?void 0:t.language)=="string"?new wn(e,t.language,t.direction?ah:Il,t.direction):new wn(e,"",t||oh)}variable(e){return new oc(e)}defaultGraph(){return this._data.defaultGraph}quad(e,t,n,i=this.defaultGraph()){return new ha(e,t,n,i)}fromTerm(e){return El(this,e)}fromQuad(e){return El(this,e)}};lc.exports=["blankNode","defaultGraph","fromQuad","fromTerm","literal","namedNode","quad","variable"];const pa=new lc,lh={apply:(r,e,t)=>r(t[0]),get:(r,e)=>r(e)};function tt(r,{factory:e=pa}={}){const t=(n="")=>e.namedNode(`${r}${n.raw||n}`);return typeof Proxy>"u"?t:new Proxy(t,lh)}tt("http://www.w3.org/2001/XMLSchema#");const st=tt("http://www.w3.org/1999/02/22-rdf-syntax-ns#");tt("http://www.w3.org/2000/01/rdf-schema#");class Ne{static add({ptr:e,start:t,end:n,subjects:i=[null],predicates:s=[null],objects:a=[null],graphs:o,callback:l}={}){if(!e.factory)throw new Error("add operation requires a factory");let u=()=>{};l&&(u=h=>{l(new xl({dataset:e.dataset,start:t,end:n,quad:h}))});for(const h of i)for(const y of s)for(const b of a)for(const g of o){const m={subject:h,predicate:y,object:b,graph:g};m[t]=e.term;const _=e.factory.quad(m.subject,m.predicate,m.object,m.graph);e.dataset.add(_),u(_)}return e}static addList({ptr:e,predicates:t,items:n,graphs:i}){if(e.isAny())throw new Error("can't attach a list to an any ptr");for(const s of t)for(const a of i){const o=n.map(()=>e.factory.blankNode());e.dataset.add(e.factory.quad(e.term,s,o[0]||st.nil,a));for(let l=0;l<o.length;l++)e.dataset.add(e.factory.quad(o[l],st.first,n[l],a)),e.dataset.add(e.factory.quad(o[l],st.rest,o[l+1]||st.nil,a))}return e}static delete({ptr:e,start:t,subjects:n=[null],predicates:i=[null],objects:s=[null]}){for(const a of n)for(const o of i)for(const l of s){const u={subject:a,predicate:o,object:l};u[t]=e.term;const h=e.dataset.match(u.subject,u.predicate,u.object);for(const y of h)e.dataset.delete(y)}return e}static deleteList({ptr:e,predicates:t}){const n=[];for(const i of t)for(const s of e.dataset.match(e.term,i)){let a=s.object;for(n.push(s);!st.nil.equals(a);){a=n[n.length-1].object;const o=e.dataset.match(a);if(o.size===0)break;for(const l of o)n.push(l)}}for(const i of n)e.dataset.delete(i);return e}static execute({ptr:e,operation:t="traverse",quantifier:n,start:i,end:s,subjects:a,predicates:o,objects:l,graphs:u,items:h,callback:y}={}){if(t==="add")return Ne.add({ptr:e,start:i,end:s,subjects:a,predicates:o,objects:l,graphs:u,callback:y});if(t==="addList")return Ne.addList({ptr:e,predicates:o,items:h,graphs:u});if(t==="delete")return Ne.delete({ptr:e,start:i,subjects:a,predicates:o,objects:l});if(t==="deleteList")return Ne.deleteList({ptr:e,predicates:o});if(t==="isList")return Ne.isList({ptr:e});if(t==="list")return Ne.list({ptr:e});if(t==="traverse")return Ne.traverse({ptr:e,quantifier:n,start:i,end:s,subjects:a,predicates:o,objects:l,graphs:u});throw new Error(`unknown operation ${t}`)}static isList({ptr:e}){return e.isAny()?!1:!!(st.nil.equals(e.term)||Ne.traverse({ptr:e,predicates:[st.first]}).length===1)}static list({ptr:e}){if(e.isList())return{*[Symbol.iterator](){for(;e&&!e.term.equals(st.nil);){const t=e.out([st.first]);if(t.length!==1)throw new Error(`Invalid list: rdf:first count not equals one on ${e.value}`);const n=e.out([st.rest]);if(n.length!==1)throw new Error(`Invalid list: rdf:rest count not equals one on ${e.value}`);yield t[0],e=n[0]}}}}static traverse({ptr:e,quantifier:t="one",start:n="subject",end:i="object",subjects:s=[null],predicates:a=[null],objects:o=[null],graphs:l=[null],callback:u}){if(t==="one")return Ne.traverseOne({ptr:e,start:n,end:i,subjects:s,predicates:a,objects:o,graphs:l,callback:u});if(t==="oneOrMore"){const h=Ne.traverse({ptr:e,end:i,start:n,subjects:s,predicates:a,objects:o,graphs:l,callback:u});return Ne.traverseMore({ptrs:h,end:i,start:n,subjects:s,predicates:a,objects:o,graphs:l,callback:u})}if(t==="zeroOrMore")return Ne.traverseMore({ptrs:[e],end:i,start:n,subjects:s,predicates:a,objects:o,graphs:l,callback:u});if(t==="zeroOrOne")return[e,...Ne.traverse({ptr:e,end:i,start:n,subjects:s,predicates:a,objects:o,graphs:l,callback:u})];throw new Error(`unknown quantifier ${t}`)}static traverseMore({ptrs:e,end:t,start:n,subjects:i,predicates:s,objects:a,graphs:o,callback:l}={}){let u=[...e],h,y;do{h=[];for(const b of e)h=[...h,...Ne.traverseOne({ptr:b,end:t,start:n,subjects:i,predicates:s,objects:a,graphs:o,callback:l})];y&&(h=h.filter(b=>!y.has(b.term))),e=h,u=[...u,...h],y=new Ze(u.map(b=>b.term))}while(h.length>0);return u}static traverseOne({ptr:e,start:t,end:n,subjects:i,predicates:s,objects:a,graphs:o,callback:l=(u,h)=>h.extend(u)}={}){const u=[];for(const h of i)for(const y of s)for(const b of a)for(const g of o){const m={subject:h,predicate:y,object:b,graph:g};m[t]=e.term;for(const _ of e.dataset.match(m.subject,m.predicate,m.object,m.graph))u.push(l(new xl({dataset:e.dataset,end:n,quad:_,start:t}),e))}return u}}function Rl(r,e){return e?t=>e(r.extend(t)):()=>{}}class Nl{constructor({dataset:e,edges:t=[],factory:n,graph:i,term:s}){if(!e&&t.length===0)throw new Error("dataset or edges is required");if(t.length===0&&typeof s>"u")throw new Error("edges or term must be given");if(t.length>0&&s)throw new Error("edges or term must be given");this.dataset=e||t[t.length-1].dataset,this.edges=t,this.factory=n,this._graph=i,t.length===0&&(this._term=s)}get edge(){return this.edges[this.edges.length-1]}get graph(){return typeof this._graph=="object"?this._graph:this.edge&&this.edge.graph}get length(){return this._term!==void 0?1:this.edges.length+1}get startTerm(){return this._term||this.edges[0].startTerm}get term(){return this._term!==void 0?this._term:this.edge.term}get value(){const e=this.term;return e===null?void 0:e.value}addIn(e,t,n){return Ne.add({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],callback:Rl(this,n)})}addList(e,t){return Ne.addList({ptr:this,predicates:e,graphs:[this.graph||this.factory.defaultGraph()],items:t})}addOut(e,t,n){return Ne.add({ptr:this,start:"subject",end:"object",predicates:e,objects:t,graphs:[this.graph||this.factory.defaultGraph()],callback:Rl(this,n)})}deleteIn(e,t){return Ne.delete({ptr:this,start:"object",subjects:t,predicates:e})}deleteList(e){return Ne.deleteList({ptr:this,predicates:e})}deleteOut(e,t){return Ne.delete({ptr:this,start:"subject",predicates:e,objects:t})}execute({operation:e,quantifier:t,start:n,end:i,subjects:s,predicates:a,objects:o,graphs:l,items:u,callback:h}){return Ne.execute({ptr:this,operation:e,quantifier:t,start:n,end:i,subjects:s,predicates:a,objects:o,graphs:l,items:u,callback:h})}extend(e){return new this.constructor({dataset:this.dataset,edges:[...this.edges,e],factory:this.factory,graph:this._graph})}hasIn(e,t){return Ne.traverse({ptr:this,start:"object",end:"object",subjects:t,predicates:e,graphs:[this.graph]})}hasOut(e,t){return Ne.traverse({ptr:this,start:"subject",end:"subject",predicates:e,objects:t,graphs:[this.graph]})}in(e,t){return Ne.traverse({ptr:this,start:"object",end:"subject",subjects:t,predicates:e,graphs:[this.graph]})}isAny(){return!this.term}isList(){return Ne.isList({ptr:this})}list(){return Ne.list({ptr:this})}*nodes(){for(let e=0;e<this.length;e++)this._term!==void 0?yield{dataset:this.dataset,term:this._term}:this.edges.length>e?yield{dataset:this.edges[e].dataset,term:this.edges[e].startTerm}:this.edges.length===e&&(yield{dataset:this.edges[e-1].dataset,term:this.edges[e-1].term})}out(e,t){return Ne.traverse({ptr:this,predicates:e,objects:t,graphs:[this.graph]})}*quads(){for(const{quad:e}of this.edges)yield e}trim(){return new this.constructor({dataset:this.dataset,factory:this.factory,graph:this.graph,term:this.term})}}function Tl(r,e){return r?r.equals(e):r===e}function uh(r,e){return!(r.dataset!==e.dataset||!Tl(r.graph,e.graph)||!Tl(r.term,e.term))}function Al(r,e){return e?t=>e(new r.constructor({factory:r.factory,ptrs:[t]})):()=>{}}class Nn{constructor({dataset:e,factory:t,ptrs:n,terms:i,graphs:s}){if(this.factory=t,n)this.ptrs=[...n];else{this.ptrs=[];for(const a of i||[null])for(const o of s||[null])this.ptrs.push(new Nl({dataset:e,factory:t,graph:o,term:a}))}}get dataset(){const e=new Set(this.datasets);return e.size!==1?null:e[Symbol.iterator]().next().value}get datasets(){return this.ptrs.map(e=>e.dataset)}get term(){const e=new Ze(this.terms);if(e.size===1)return e[Symbol.iterator]().next().value}get terms(){return this.ptrs.map(e=>e.term)}get value(){const e=this.term;return e==null?void 0:e.value}get values(){return this.ptrs.map(e=>e.value)}addIn(e,t,n){const i=Al(this,n);for(const s of this.ptrs)s.addIn(e,t,i);return this}addList(e,t){if(this.isAny())throw new Error("can't attach a list to an any ptr");for(const n of this.ptrs)n.addList(e,t);return this}addOut(e,t,n){const i=Al(this,n);for(const s of this.ptrs)s.addOut(e,t,i);return this}clone(e){return new this.constructor({factory:this.factory,ptrs:this.ptrs,...e})}deleteIn(e,t){for(const n of this.ptrs)n.deleteIn(e,t);return this}deleteList(e){for(const t of this.ptrs)t.deleteList(e);return this}deleteOut(e,t){for(const n of this.ptrs)n.deleteOut(e,t);return this}distinct(){const e=this.ptrs.reduce((t,n)=>(t.some(i=>uh(i,n))||t.push(n.trim()),t),[]);return this.clone({ptrs:e})}execute(e){return this.clone({ptrs:this.ptrs.flatMap(t=>t.execute(e))})}executeAll(e){let t=this;for(const n of e)t=t.execute(n);return t}filter(e){return this.clone({ptrs:[...this].filter(e).map(t=>t.ptrs[0])})}hasIn(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasIn(e,t))})}hasOut(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.hasOut(e,t))})}in(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.in(e,t))})}isAny(){return this.ptrs.length>0&&this.ptrs.some(e=>e.isAny())}isList(){return this.ptrs.length!==1?!1:this.ptrs[0].isList()}list(){if(!this.isList())return;const e=this.ptrs[0].list(),t=this;return function*(){for(const n of e)yield t.clone({ptrs:[n]})}()}map(e){return[...this].map(e)}node(e){const t=this.dataset,n=[...e].map(i=>new Nl({dataset:t,factory:this.factory,term:i}));return this.clone({ptrs:n})}out(e,t){return this.clone({ptrs:this.ptrs.flatMap(n=>n.out(e,t))})}*quads(){for(const{edges:e}of this.ptrs)for(const{quad:t}of e)yield t}trim(){return this.clone({ptrs:this.ptrs.map(e=>e.trim())})}*[Symbol.iterator](){for(const e of this.ptrs)yield this.clone({ptrs:[e]})}}tt("http://www.w3.org/2002/07/owl#");const Ht=tt("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),ch=tt("http://www.w3.org/2000/01/rdf-schema#"),ne=tt("http://www.w3.org/ns/shacl#"),Us=tt("https://schemas.link/shacl-next#"),ga=tt("http://www.w3.org/2001/XMLSchema#");function dh(r){return r?`{${[...r.quads()].map(e=>Je(e)).join(" ")}}`:"{}"}function fh(r){return r?`{${r.map(e=>dh(e)).join(" ")}}`:"{}"}var hs,Ll;function hh(){if(Ll)return hs;Ll=1;var r=/\s/;function e(t){for(var n=t.length;n--&&r.test(t.charAt(n)););return n}return hs=e,hs}var ps,jl;function ph(){if(jl)return ps;jl=1;var r=hh(),e=/^\s+/;function t(n){return n&&n.slice(0,r(n)+1).replace(e,"")}return ps=t,ps}var gs,Ol;function gh(){if(Ol)return gs;Ol=1;function r(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return gs=r,gs}var ys,$l;function yh(){if($l)return ys;$l=1;var r=typeof Zt=="object"&&Zt&&Zt.Object===Object&&Zt;return ys=r,ys}var ms,kl;function mh(){if(kl)return ms;kl=1;var r=yh(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=r||e||Function("return this")();return ms=t,ms}var bs,Dl;function uc(){if(Dl)return bs;Dl=1;var r=mh(),e=r.Symbol;return bs=e,bs}var ws,Ml;function bh(){if(Ml)return ws;Ml=1;var r=uc(),e=Object.prototype,t=e.hasOwnProperty,n=e.toString,i=r?r.toStringTag:void 0;function s(a){var o=t.call(a,i),l=a[i];try{a[i]=void 0;var u=!0}catch{}var h=n.call(a);return u&&(o?a[i]=l:delete a[i]),h}return ws=s,ws}var vs,Pl;function wh(){if(Pl)return vs;Pl=1;var r=Object.prototype,e=r.toString;function t(n){return e.call(n)}return vs=t,vs}var _s,Cl;function vh(){if(Cl)return _s;Cl=1;var r=uc(),e=bh(),t=wh(),n="[object Null]",i="[object Undefined]",s=r?r.toStringTag:void 0;function a(o){return o==null?o===void 0?i:n:s&&s in Object(o)?e(o):t(o)}return _s=a,_s}var xs,ql;function _h(){if(ql)return xs;ql=1;function r(e){return e!=null&&typeof e=="object"}return xs=r,xs}var Ss,Bl;function xh(){if(Bl)return Ss;Bl=1;var r=vh(),e=_h(),t="[object Symbol]";function n(i){return typeof i=="symbol"||e(i)&&r(i)==t}return Ss=n,Ss}var Es,Fl;function Sh(){if(Fl)return Es;Fl=1;var r=ph(),e=gh(),t=xh(),n=NaN,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,o=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return n;if(e(u)){var h=typeof u.valueOf=="function"?u.valueOf():u;u=e(h)?h+"":h}if(typeof u!="string")return u===0?u:+u;u=r(u);var y=s.test(u);return y||a.test(u)?o(u.slice(2),y?2:8):i.test(u)?n:+u}return Es=l,Es}var Is,Ul;function Eh(){if(Ul)return Is;Ul=1;var r=Sh(),e=1/0,t=17976931348623157e292;function n(i){if(!i)return i===0?i:0;if(i=r(i),i===e||i===-e){var s=i<0?-1:1;return s*t}return i===i?i:0}return Is=n,Is}var Rs,Hl;function Ih(){if(Hl)return Rs;Hl=1;var r=Eh();function e(t){var n=r(t),i=n%1;return n===n?i?n-i:n:0}return Rs=e,Rs}var Ns,Vl;function Rh(){if(Vl)return Ns;Vl=1;var r=Ih(),e="Expected a function";function t(n,i){var s;if(typeof i!="function")throw new TypeError(e);return n=r(n),function(){return--n>0&&(s=i.apply(this,arguments)),n<=1&&(i=void 0),s}}return Ns=t,Ns}var Ts,Gl;function Nh(){if(Gl)return Ts;Gl=1;var r=Rh();function e(t){return r(2,t)}return Ts=e,Ts}var Th=Nh();const nt=Ic(Th);let Wl=class{constructor({details:e,factory:t,options:n,results:i=[]}={}){this.details=e,this.factory=t,this.options=n,this.results=i,this._conforms=nt(()=>!this.results.some(s=>s.severity.equals(ne.Info)||s.severity.equals(ne.Violation)||s.severity.equals(ne.Warning))),this._ptr=nt(()=>this.build())}get conforms(){return this._conforms()}get dataset(){return this.ptr.dataset}get ptr(){return this._ptr()}get term(){return this.ptr.term}build(){const e=new Nn({dataset:this.factory.dataset(),factory:this.factory,terms:[this.factory.blankNode()]});e.addOut([Ht.type],[ne.ValidationReport]).addOut([ne.conforms],[this.factory.literal(this.conforms.toString(),ga.boolean)]);for(const t of this.results)e.addOut([ne.result],[this.factory.blankNode()],n=>{t.build(n,this.options)});return e}coverage(){return this.results.flatMap(e=>e.coverage())}};function Ah(r,e){return Object.entries(e).reduce((t,[n,i])=>(i&&i.termType&&(i=Je(i)),t.replace(`{$${n}}`,i).replace(`{?${n}}`,i)),r)}let Lh=class{constructor({args:e={},constraintComponent:t,factory:n,focusNode:i,message:s=[],path:a,results:o=[],severity:l,shape:u,source:h=[],value:y,valuePaths:b=[]}={}){this.args=e,this.constraintComponent=t,this.factory=n,this.focusNode=i,this.path=a||u.path,this.results=o,this.severity=l,this.shape=u,this.source=h,this.value=y,this.valuePaths=b,this._message=nt(()=>(this.shape.message.length>0&&(s=this.shape.message),s.length===0&&(s=this.shape.ptr.node([this.constraintComponent]).out([ne.message]).terms),s.map(g=>n.literal(Ah(g.value,e),g.language||null))))}get message(){return this._message()}build(e,{details:t}={}){e.addOut([Ht.type],[ne.ValidationResult]).addOut([ne.focusNode],this.focusNode.terms).addOut([ne.resultSeverity],[this.severity]).addOut([ne.sourceConstraint],this.source).addOut([ne.sourceConstraintComponent],[this.constraintComponent]).addOut([ne.sourceShape],this.shape.ptr.terms),this.message&&e.addOut([ne.resultMessage],this.message);const n=i=>{if(i.quantifier==="one")return i.predicates.length>1?e.node([this.factory.blankNode()]).addList([ne.alternativePath],i.predicates):i.start==="object"?e.node([this.factory.blankNode()]).addOut([ne.inversePath],[i.predicates[0]]):e.node([i.predicates[0]]);if(i.quantifier==="oneOrMore")return e.node([this.factory.blankNode()]).addOut([ne.oneOrMorePath],[i.predicates[0]]);if(i.quantifier==="zeroOrMore")return e.node([this.factory.blankNode()]).addOut([ne.zeroOrMorePath],[i.predicates[0]]);if(i.quantifier==="zeroOrOne")return e.node([this.factory.blankNode()]).addOut([ne.zeroOrOnePath],[i.predicates[0]])};if(this.path&&(this.path.length===1?e.addOut([ne.resultPath],n(this.path[0]).terms):e.addList([ne.resultPath],this.path.map(i=>n(i).term))),typeof this.value<"u"&&e.addOut([ne.value],this.value.terms),t)for(const i of this.results)e.addOut([ne.detail],[this.factory.blankNode()],s=>{i.build(s,{details:t})})}coverage(){return[...this.valuePaths.flatMap(e=>[...e.quads()]),...this.results.flatMap(e=>e.coverage())]}};class ya{constructor({factory:e,focusNode:t,options:n={debug:!1,details:!1},processed:i=new Set,report:s=new Wl({factory:e,options:n}),results:a=new Map,shape:o,value:l,valueOrNode:u,valuePaths:h,values:y}={}){this.factory=e,this.focusNode=t,this.options=n,this.processed=i,this.report=s,this.results=a,this.shape=o,this.value=l,this.valuePaths=h,this.valueOrNode=u,this.values=y}create({child:e,focusNode:t=this.focusNode,shape:n=this.shape,value:i=this.value,valueOrNode:s=this.valueOrNode,valuePaths:a=this.valuePaths,values:o=this.values}={}){return new ya({factory:this.factory,focusNode:t,options:this.options,processed:this.processed,report:e?new Wl({factory:this.factory,options:this.options}):this.report,results:this.results,shape:n,value:i,valueOrNode:s,valuePaths:a,values:o})}id({shape:e=this.shape}={}){return`${Je(e.ptr.term)} - ${Je(this.focusNode.term)} - ${fh(this.valuePaths)}`}result(e){const t=new Lh({factory:this.factory,focusNode:this.focusNode,shape:this.shape,value:this.value,valuePaths:this.valuePaths,...e}),n=this.id();this.results.has(n)?this.results.get(n).add(t):this.results.set(n,new Set([t])),this.report.results.push(t)}debug(e,t){this.options.debug&&this.result({severity:Us.Debug,constraintComponent:e,...t})}trace(e,t){this.options.trace&&this.result({severity:Us.Trace,constraintComponent:e,...t})}test(e,t,n){e?this.debug(t,n):this.violation(t,n)}violation(e,t){this.result({constraintComponent:e,severity:this.shape.severity||ne.Violation,...t})}}function jh(){return{generic:Oh()}}function Oh(){return r=>{r.trace(Us.TraversalConstraintComponent,{args:{},message:[r.factory.literal("Traversal")],value:r.valueOrNode})}}class $h{constructor(e){this.validations=new cr(e)}compile(e){const t=e.validator.options.coverage;if(e.deactivated)return[];let n=!1;const i=new Set;for(const s of e.ptr.execute({start:"subject",end:"predicate"})){const a=this.validations.get(s.term);a&&(i.add(a),s.term.equals(ne.property)&&(n=!0))}return t&&e.isPropertyShape&&!n&&i.add(jh),[...i].map(s=>s(e)).filter(Boolean)}}var $t={},kt={},xr={},zl;function cc(){if(zl)return xr;zl=1,Object.defineProperty(xr,"__esModule",{value:!0}),xr.BlankNode=void 0;let r=class{constructor(t){this.termType="BlankNode",this.value=t}equals(t){return!!t&&t.termType==="BlankNode"&&t.value===this.value}};return xr.BlankNode=r,xr}var Sr={},Er={},Jl;function dc(){if(Jl)return Er;Jl=1,Object.defineProperty(Er,"__esModule",{value:!0}),Er.DefaultGraph=void 0;let r=class{constructor(){this.termType="DefaultGraph",this.value=""}equals(t){return!!t&&t.termType==="DefaultGraph"}};return Er.DefaultGraph=r,r.INSTANCE=new r,Er}var Ir={},Rr={},Ql;function ma(){if(Ql)return Rr;Ql=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.NamedNode=void 0;let r=class{constructor(t){this.termType="NamedNode",this.value=t}equals(t){return!!t&&t.termType==="NamedNode"&&t.value===this.value}};return Rr.NamedNode=r,Rr}var Xl;function fc(){if(Xl)return Ir;Xl=1,Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.Literal=void 0;const r=ma();let e=class Cr{constructor(n,i){this.termType="Literal",this.value=n,typeof i=="string"?(this.language=i,this.datatype=Cr.RDF_LANGUAGE_STRING,this.direction=""):i?"termType"in i?(this.language="",this.datatype=i,this.direction=""):(this.language=i.language,this.datatype=i.direction?Cr.RDF_DIRECTIONAL_LANGUAGE_STRING:Cr.RDF_LANGUAGE_STRING,this.direction=i.direction||""):(this.language="",this.datatype=Cr.XSD_STRING,this.direction="")}equals(n){return!!n&&n.termType==="Literal"&&n.value===this.value&&n.language===this.language&&(n.direction===this.direction||!n.direction&&this.direction==="")&&this.datatype.equals(n.datatype)}};return Ir.Literal=e,e.RDF_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#langString"),e.RDF_DIRECTIONAL_LANGUAGE_STRING=new r.NamedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString"),e.XSD_STRING=new r.NamedNode("http://www.w3.org/2001/XMLSchema#string"),Ir}var Nr={},Kl;function hc(){if(Kl)return Nr;Kl=1,Object.defineProperty(Nr,"__esModule",{value:!0}),Nr.Quad=void 0;let r=class{constructor(t,n,i,s){this.termType="Quad",this.value="",this.subject=t,this.predicate=n,this.object=i,this.graph=s}equals(t){return!!t&&(t.termType==="Quad"||!t.termType)&&this.subject.equals(t.subject)&&this.predicate.equals(t.predicate)&&this.object.equals(t.object)&&this.graph.equals(t.graph)}};return Nr.Quad=r,Nr}var Tr={},Yl;function pc(){if(Yl)return Tr;Yl=1,Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.Variable=void 0;let r=class{constructor(t){this.termType="Variable",this.value=t}equals(t){return!!t&&t.termType==="Variable"&&t.value===this.value}};return Tr.Variable=r,Tr}var Zl;function kh(){if(Zl)return Sr;Zl=1,Object.defineProperty(Sr,"__esModule",{value:!0}),Sr.DataFactory=void 0;const r=cc(),e=dc(),t=fc(),n=ma(),i=hc(),s=pc();let a=0,o=class{constructor(u){this.blankNodeCounter=0,u=u||{},this.blankNodePrefix=u.blankNodePrefix||`df_${a++}_`}namedNode(u){return new n.NamedNode(u)}blankNode(u){return new r.BlankNode(u||`${this.blankNodePrefix}${this.blankNodeCounter++}`)}literal(u,h){return new t.Literal(u,h)}variable(u){return new s.Variable(u)}defaultGraph(){return e.DefaultGraph.INSTANCE}quad(u,h,y,b){return new i.Quad(u,h,y,b||this.defaultGraph())}fromTerm(u){switch(u.termType){case"NamedNode":return this.namedNode(u.value);case"BlankNode":return this.blankNode(u.value);case"Literal":return u.language?this.literal(u.value,u.language):u.datatype.equals(t.Literal.XSD_STRING)?this.literal(u.value):this.literal(u.value,this.fromTerm(u.datatype));case"Variable":return this.variable(u.value);case"DefaultGraph":return this.defaultGraph();case"Quad":return this.quad(this.fromTerm(u.subject),this.fromTerm(u.predicate),this.fromTerm(u.object),this.fromTerm(u.graph))}}fromQuad(u){return this.fromTerm(u)}resetBlankNodeCounter(){this.blankNodeCounter=0}};return Sr.DataFactory=o,Sr}var eu;function Dh(){return eu||(eu=1,function(r){var e=kt&&kt.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),t=kt&&kt.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(r,"__esModule",{value:!0}),t(cc(),r),t(kh(),r),t(dc(),r),t(fc(),r),t(ma(),r),t(hc(),r),t(pc(),r)}(kt)),kt}var Dt={},Ar={},Lr={},tu;function ar(){if(tu)return Lr;tu=1,Object.defineProperty(Lr,"__esModule",{value:!0}),Lr.Translator=void 0;let r=class{constructor(){this.supportedRdfDatatypes=[],this.fromRdfHandlers={},this.toRdfHandlers={}}static incorrectRdfDataType(t){throw new Error(`Invalid RDF ${t.datatype.value} value: '${t.value}'`)}registerHandler(t,n,i){for(const s of n)this.supportedRdfDatatypes.push(s),this.fromRdfHandlers[s.value]=t;for(const s of i){let a=this.toRdfHandlers[s];a||(this.toRdfHandlers[s]=a=[]),a.push(t)}}fromRdf(t,n){const i=this.fromRdfHandlers[t.datatype.value];return i?i.fromRdf(t,n):t.value}toRdf(t,n){const i=this.toRdfHandlers[typeof t];if(i)for(const s of i){const a=s.toRdf(t,n);if(a)return a}throw new Error(`Invalid JavaScript value: '${t}'`)}getSupportedRdfDatatypes(){return this.supportedRdfDatatypes}getSupportedJavaScriptPrimitives(){return Object.keys(this.toRdfHandlers)}};return Lr.Translator=r,Lr}var ru;function Mh(){if(ru)return Ar;ru=1,Object.defineProperty(Ar,"__esModule",{value:!0}),Ar.TypeHandlerBoolean=void 0;const r=ar();let e=class gc{fromRdf(n,i){switch(n.value){case"true":return!0;case"false":return!1;case"1":return!0;case"0":return!1}return i&&r.Translator.incorrectRdfDataType(n),!1}toRdf(n,{datatype:i,dataFactory:s}){return s.literal(n?"true":"false",i||s.namedNode(gc.TYPE))}};return Ar.TypeHandlerBoolean=e,e.TYPE="http://www.w3.org/2001/XMLSchema#boolean",Ar}var jr={},nu;function Ph(){if(nu)return jr;nu=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.TypeHandlerDate=void 0;const r=ar();let e=class Hs{fromRdf(n,i){switch(i&&!n.value.match(Hs.VALIDATORS[n.datatype.value.substr(33,n.datatype.value.length)])&&r.Translator.incorrectRdfDataType(n),n.datatype.value){case"http://www.w3.org/2001/XMLSchema#gDay":return new Date(0,0,parseInt(n.value,10));case"http://www.w3.org/2001/XMLSchema#gMonthDay":const s=n.value.split("-");return new Date(0,parseInt(s[0],10)-1,parseInt(s[1],10));case"http://www.w3.org/2001/XMLSchema#gYear":return new Date(n.value+"-01-01");case"http://www.w3.org/2001/XMLSchema#gYearMonth":return new Date(n.value+"-01");default:return new Date(n.value)}}toRdf(n,{datatype:i,dataFactory:s}){if(i=i||s.namedNode(Hs.TYPES[0]),!(n instanceof Date))return null;const a=n;let o;switch(i.value){case"http://www.w3.org/2001/XMLSchema#gDay":o=String(a.getUTCDate());break;case"http://www.w3.org/2001/XMLSchema#gMonthDay":o=a.getUTCMonth()+1+"-"+a.getUTCDate();break;case"http://www.w3.org/2001/XMLSchema#gYear":o=String(a.getUTCFullYear());break;case"http://www.w3.org/2001/XMLSchema#gYearMonth":o=a.getUTCFullYear()+"-"+(a.getUTCMonth()+1);break;case"http://www.w3.org/2001/XMLSchema#date":o=a.toISOString().replace(/T.*$/,"");break;default:o=a.toISOString()}return s.literal(o,i)}};return jr.TypeHandlerDate=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#dateTime","http://www.w3.org/2001/XMLSchema#date","http://www.w3.org/2001/XMLSchema#gDay","http://www.w3.org/2001/XMLSchema#gMonthDay","http://www.w3.org/2001/XMLSchema#gYear","http://www.w3.org/2001/XMLSchema#gYearMonth"],e.VALIDATORS={date:/^[0-9]+-[0-9][0-9]-[0-9][0-9]Z?$/,dateTime:/^[0-9]+-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9][0-9][0-9])?((Z?)|([\+-][0-9][0-9]:[0-9][0-9]))$/,gDay:/^[0-9]+$/,gMonthDay:/^[0-9]+-[0-9][0-9]$/,gYear:/^[0-9]+$/,gYearMonth:/^[0-9]+-[0-9][0-9]$/},jr}var Or={},iu;function Ch(){if(iu)return Or;iu=1,Object.defineProperty(Or,"__esModule",{value:!0}),Or.TypeHandlerNumberDouble=void 0;const r=ar();let e=class yc{fromRdf(n,i){const s=parseFloat(n.value);return i&&isNaN(s)&&r.Translator.incorrectRdfDataType(n),s}toRdf(n,{datatype:i,dataFactory:s}){return i=i||s.namedNode(yc.TYPES[0]),isNaN(n)?s.literal("NaN",i):isFinite(n)?n%1===0?null:s.literal(n.toExponential(15).replace(/(\d)0*e\+?/,"$1E"),i):s.literal(n>0?"INF":"-INF",i)}};return Or.TypeHandlerNumberDouble=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#double","http://www.w3.org/2001/XMLSchema#decimal","http://www.w3.org/2001/XMLSchema#float"],Or}var $r={},su;function qh(){if(su)return $r;su=1,Object.defineProperty($r,"__esModule",{value:!0}),$r.TypeHandlerNumberInteger=void 0;const r=ar();let e=class qr{fromRdf(n,i){const s=parseInt(n.value,10);return i&&(isNaN(s)||n.value.indexOf(".")>=0)&&r.Translator.incorrectRdfDataType(n),s}toRdf(n,{datatype:i,dataFactory:s}){return s.literal(String(n),i||(n<=qr.MAX_INT&&n>=qr.MIN_INT?s.namedNode(qr.TYPES[0]):s.namedNode(qr.TYPES[1])))}};return $r.TypeHandlerNumberInteger=e,e.TYPES=["http://www.w3.org/2001/XMLSchema#integer","http://www.w3.org/2001/XMLSchema#long","http://www.w3.org/2001/XMLSchema#int","http://www.w3.org/2001/XMLSchema#byte","http://www.w3.org/2001/XMLSchema#short","http://www.w3.org/2001/XMLSchema#negativeInteger","http://www.w3.org/2001/XMLSchema#nonNegativeInteger","http://www.w3.org/2001/XMLSchema#nonPositiveInteger","http://www.w3.org/2001/XMLSchema#positiveInteger","http://www.w3.org/2001/XMLSchema#unsignedByte","http://www.w3.org/2001/XMLSchema#unsignedInt","http://www.w3.org/2001/XMLSchema#unsignedLong","http://www.w3.org/2001/XMLSchema#unsignedShort"],e.MAX_INT=2147483647,e.MIN_INT=-2147483648,$r}var kr={},au;function Bh(){if(au)return kr;au=1,Object.defineProperty(kr,"__esModule",{value:!0}),kr.TypeHandlerString=void 0;let r=class{fromRdf(t){return t.value}toRdf(t,{datatype:n,dataFactory:i}){return i.literal(t,n)}};return kr.TypeHandlerString=r,r.TYPES=["http://www.w3.org/2001/XMLSchema#string","http://www.w3.org/2001/XMLSchema#normalizedString","http://www.w3.org/2001/XMLSchema#anyURI","http://www.w3.org/2001/XMLSchema#base64Binary","http://www.w3.org/2001/XMLSchema#language","http://www.w3.org/2001/XMLSchema#Name","http://www.w3.org/2001/XMLSchema#NCName","http://www.w3.org/2001/XMLSchema#NMTOKEN","http://www.w3.org/2001/XMLSchema#token","http://www.w3.org/2001/XMLSchema#hexBinary","http://www.w3.org/1999/02/22-rdf-syntax-ns#langString","http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString","http://www.w3.org/2001/XMLSchema#time","http://www.w3.org/2001/XMLSchema#duration"],kr}var ou;function lu(){return ou||(ou=1,function(r){var e=Dt&&Dt.__createBinding||(Object.create?function(n,i,s,a){a===void 0&&(a=s);var o=Object.getOwnPropertyDescriptor(i,s);(!o||("get"in o?!i.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return i[s]}}),Object.defineProperty(n,a,o)}:function(n,i,s,a){a===void 0&&(a=s),n[a]=i[s]}),t=Dt&&Dt.__exportStar||function(n,i){for(var s in n)s!=="default"&&!Object.prototype.hasOwnProperty.call(i,s)&&e(i,n,s)};Object.defineProperty(r,"__esModule",{value:!0}),t(Mh(),r),t(Ph(),r),t(Ch(),r),t(qh(),r),t(Bh(),r)}(Dt)),Dt}var As={},uu;function Fh(){return uu||(uu=1,Object.defineProperty(As,"__esModule",{value:!0})),As}var cu;function Uh(){return cu||(cu=1,function(r){var e=$t&&$t.__createBinding||(Object.create?function(g,m,_,x){x===void 0&&(x=_);var S=Object.getOwnPropertyDescriptor(m,_);(!S||("get"in S?!m.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return m[_]}}),Object.defineProperty(g,x,S)}:function(g,m,_,x){x===void 0&&(x=_),g[x]=m[_]}),t=$t&&$t.__exportStar||function(g,m){for(var _ in g)_!=="default"&&!Object.prototype.hasOwnProperty.call(m,_)&&e(m,g,_)};Object.defineProperty(r,"__esModule",{value:!0}),r.fromRdf=l,r.toRdf=u,r.getTermRaw=h,r.getSupportedRdfDatatypes=y,r.getSupportedJavaScriptPrimitives=b;const n=Dh(),i=lu(),s=ar();t(lu(),r),t(Fh(),r),t(ar(),r);const a=new n.DataFactory,o=new s.Translator;o.registerHandler(new i.TypeHandlerString,i.TypeHandlerString.TYPES.map(g=>a.namedNode(g)),["string"]),o.registerHandler(new i.TypeHandlerBoolean,[i.TypeHandlerBoolean.TYPE].map(g=>a.namedNode(g)),["boolean"]),o.registerHandler(new i.TypeHandlerNumberDouble,i.TypeHandlerNumberDouble.TYPES.map(g=>a.namedNode(g)),["number"]),o.registerHandler(new i.TypeHandlerNumberInteger,i.TypeHandlerNumberInteger.TYPES.map(g=>a.namedNode(g)),["number"]),o.registerHandler(new i.TypeHandlerDate,i.TypeHandlerDate.TYPES.map(g=>a.namedNode(g)),["object"]);function l(g,m){return o.fromRdf(g,m)}function u(g,m){return m&&"namedNode"in m&&(m={dataFactory:m}),m=m||{},m&&!m.dataFactory&&(m.dataFactory=a),o.toRdf(g,m)}function h(g,m){return g.termType==="Literal"?l(g,m):g.value}function y(){return o.getSupportedRdfDatatypes()}function b(){return o.getSupportedJavaScriptPrimitives()}}($t)),$t}var Kr=Uh();function du(r){if(r.term.termType!=="BlankNode")return{quantifier:"one",start:"subject",end:"object",predicates:[r.term]};const e=r.out([ne.alternativePath]);if(e.ptrs.length===1&&e.ptrs[0].isList())return{quantifier:"one",start:"subject",end:"object",predicates:[...e.list()].map(a=>a.term)};const t=r.out([ne.inversePath]);if(t.term)return{quantifier:"one",start:"object",end:"subject",predicates:[t.term]};const n=r.out([ne.oneOrMorePath]);if(n.term)return{quantifier:"oneOrMore",start:"subject",end:"object",predicates:[n.term]};const i=r.out([ne.zeroOrMorePath]);if(i.term)return{quantifier:"zeroOrMore",start:"subject",end:"object",predicates:[i.term]};const s=r.out([ne.zeroOrOnePath]);if(s.term)return{quantifier:"zeroOrOne",start:"subject",end:"object",predicates:[s.term]}}function Hh(r){return r.terms.length===0?null:r.ptrs[0].isList()?[...r.list()].map(e=>du(e)):[du(r)]}class Vh{constructor(e){this.shape=e,this._compiled=nt(()=>this.shape.validator.registry.compile(e))}get compiled(){return this._compiled()}async validate(e){return e.focusNode.dataset.size===0||(this.shape.isPropertyShape?await this.validateProperty(e):await this.validateNode(e)),e}async validateNode(e){const t=e.create({shape:this.shape,valueOrNode:e.value||e.focusNode});for(const n of this.compiled)n.node&&await n.node(t),n.generic&&await n.generic(t)}async validateProperty(e){let t;this.shape.isSparqlShape?t=e.focusNode:t=e.focusNode.executeAll(this.shape.path);const n=t.node(new Ze(t.terms)),i=[...t].reduce((a,o)=>{const l=o.term,u=t.node([l]);return a.has(l)||a.set(l,{value:u,valuePaths:[]}),a.get(l).valuePaths.push(o),a},new cr).values(),s=e.create({shape:this.shape,values:n});for(const a of this.compiled)a.property&&await a.property(s);for(const{value:a,valuePaths:o}of i){const l=e.create({shape:this.shape,value:a,valueOrNode:a,valuePaths:o});for(const u of this.compiled)u.generic&&await u.generic(l)}}}function Vs(r){const e=new Ze,n=new Nn({dataset:r.dataset,terms:r.terms}).execute({quantifier:"zeroOrMore",start:"object",end:"subject",predicates:[ch.subClassOf]});for(const i of n.ptrs)for(const{term:s}of i.nodes())e.add(s);return e}class Gh{constructor(e){this.targetClass=new Ze([...Vs(e.hasOut([Ht.type],[ne.NodeShape])),...Vs(e.out([ne.targetClass]))]),this.targetNode=e.out([ne.targetNode]).terms,this.targetObjectsOf=e.out([ne.targetObjectsOf]).terms,this.targetSubjectsOf=e.out([ne.targetSubjectsOf]).terms}resolve(e){const t=e.focusNode.node([null]),n=[...e.focusNode.hasOut([Ht.type],this.targetClass).ptrs,...e.focusNode.node(this.targetNode).ptrs,...t.execute({start:"object",end:"object",predicates:this.targetObjectsOf}).ptrs,...t.execute({start:"subject",end:"subject",predicates:this.targetSubjectsOf}).ptrs],i=e.focusNode.clone({ptrs:n});return i.node([...new Ze(i.terms)])}}class Wh{constructor(e,{validator:t}){this.ptr=e,this.validator=t,this._deactivated=nt(()=>{const n=this.ptr.out([ne.deactivated]).term;return n&&Kr.fromRdf(n)}),this._message=nt(()=>this.ptr.out([ne.message]).terms),this._path=nt(()=>Hh(this.ptr.out([ne.path]))),this._severity=nt(()=>this.ptr.out([ne.severity]).term),this._shapeValidator=nt(()=>new Vh(this)),this._sparql=nt(()=>this.ptr.out([ne.sparql])),this._targetResolver=nt(()=>new Gh(this.ptr))}get deactivated(){return this._deactivated()}get isPropertyShape(){return!!this.path}get isSparqlShape(){return this.sparql.terms.length>0}get path(){return this._path()}get targetResolver(){return this._targetResolver()}get message(){return this._message()}get severity(){return this._severity()}get shapeValidator(){return this._shapeValidator()}get sparql(){return this._sparql()}resolveTargets(e){return this.targetResolver.resolve(e)}async validate(e){const t=e.id({shape:this});if(e.processed.has(t)){if(e.results.has(t))for(const n of e.results.get(t))e.report.results.push(n);return e}return e.processed.add(t),this.shapeValidator.validate(e)}}function zh(r){const e=parseInt(r.ptr.out([ne.maxCount]).value);return{property:Jh(e)}}function Jh(r){return e=>{e.test(e.values.terms.length<=r,ne.MaxCountConstraintComponent,{args:{maxCount:r},message:[e.factory.literal("More than {$maxCount} values")]})}}function Qh(r){const e=parseInt(r.ptr.out([ne.minCount]).value);return{property:Xh(e)}}function Xh(r){return e=>{e.test(e.values.terms.length>=r,ne.MinCountConstraintComponent,{args:{minCount:r},message:[e.factory.literal("Less than {$minCount} values")]})}}async function Kh(r,e){for(const t of r)if(!await e(t))return!1;return!0}async function Yh(r,e){return(await Promise.all(r.map(t=>e(t)))).filter(Boolean)}async function qn(r,e){return Promise.all(r.map(e))}async function Zh(r,e){for(const t of r)if(await e(t))return!0;return!1}function ep(r){const e=[...r.ptr.out([ne.and])].flatMap(t=>[...t.list()]).map(t=>r.validator.shape(t));return{generic:tp(e)}}function tp(r){return async e=>{const t=await qn(r,async i=>(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),n=t.every(i=>i.conforms);e.test(n,ne.AndConstraintComponent,{results:t.flatMap(i=>i.results),value:e.valueOrNode})}}function rp(r){const e=r.validator.shape(r.ptr.out([ne.not]));return{generic:np(e)}}function np(r){return async e=>{const t=(await r.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report,n=!t.conforms;e.test(n,ne.NotConstraintComponent,{args:{not:r.ptr.term},message:[e.factory.literal("Value does have shape {$not}")],results:t.results,value:e.valueOrNode})}}function ip(r){const e=[...r.ptr.out([ne.or])].flatMap(t=>[...t.list()]).map(t=>r.validator.shape(t));return{generic:sp(e)}}function sp(r){return async e=>{let t=[],n;if(e.options.debug||e.options.details){const i=await qn(r,async s=>(await s.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report);t=i.flatMap(s=>s.results),n=i.some(s=>s.conforms)}else n=await Zh(r,async i=>(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report.conforms);e.test(n,ne.OrConstraintComponent,{results:t,value:e.valueOrNode})}}function ap(r){const e=[...r.ptr.out([ne.xone])].flatMap(t=>[...t.list()]).map(t=>r.validator.shape(t));return{generic:op(e)}}function op(r){return async e=>{const t=await qn(r,async i=>(await i.validate(e.create({child:!0,focusNode:e.valueOrNode}))).report),n=t.filter(i=>i.conforms).length===1;e.test(n,ne.XoneConstraintComponent,{results:t.flatMap(i=>i.results),value:e.valueOrNode})}}function lp(r){if(!Kr.fromRdf(r.ptr.out([ne.closed]).term))return null;const t=r.ptr.out([ne.property]).map(s=>r.validator.shape(s)),n=new Ze(t.filter(s=>!s.deactivated).map(s=>s.path[0].predicates[0])),i=new Ze([...r.ptr.out([ne.ignoredProperties]).list()||[]].map(s=>s.term));return{node:up(n,i)}}function up(r,e){return t=>{const n=t.focusNode.execute({start:"subject",end:"predicate"}).filter(i=>e.has(i.term)?!1:!r.has(i.term));if(n.ptrs.length>0)for(const i of n)t.violation(ne.ClosedConstraintComponent,{message:[t.factory.literal("Predicate is not allowed (closed shape)")],path:[{quantifier:"one",start:"subject",end:"object",predicates:[i.term]}],value:t.focusNode.node([[...i.quads()][0].object])});else t.debug(ne.ClosedConstraintComponent)}}function cp(r){const e=r.ptr.out([ne.hasValue]).term;return{node:dp(e),property:fp(e)}}function dp(r){return e=>{e.test(r.equals(e.valueOrNode.term),ne.HasValueConstraintComponent,{args:{hasValue:r},message:[e.factory.literal("Value must be {$hasValue}")]})}}function fp(r){return e=>{const t=[...e.values].some(n=>r.equals(n.term));e.test(t,ne.HasValueConstraintComponent,{args:{hasValue:r},message:[e.factory.literal("Missing expected value {$hasValue}")]})}}function hp(r){const e=new Ze([...r.ptr.out([ne.in]).list()].map(t=>t.term));return{generic:pp(e)}}function pp(r){return e=>{e.test(r.has(e.valueOrNode.term),ne.InConstraintComponent,{args:{in:[...r].map(t=>t.value).join(", ")},message:[e.factory.literal("Value is not in {$in}")],value:e.valueOrNode})}}function dr(r,e){if(!r||r.termType!=="Literal"||!e||e.termType!=="Literal"||fu(r)!==fu(e))return null;const t=Kr.fromRdf(r),n=Kr.fromRdf(e);return typeof t!=typeof n?null:typeof t=="string"?t.localeCompare(n):t-n}function fu(r){const e=/^.*(((\+|-)\d{2}:\d{2})|Z)$/;return ga.dateTime.equals(r.datatype)&&e.test(r.value)}function gp(r){const e=r.ptr.out([ne.disjoint]).term;return{generic:yp(e)}}function yp(r){return e=>{const t=e.focusNode.dataset.match(e.focusNode.term,r,e.valueOrNode.term);e.test(t.size===0,ne.DisjointConstraintComponent,{args:{disjoint:r},message:[e.factory.literal("Value node must not also be one of the values of {$disjoint}")],value:e.valueOrNode})}}function mp(r){const e=r.ptr.out([ne.equals]).term;return{node:bp(e),property:wp(e)}}function bp(r){return e=>{const t=e.focusNode.out([r]),n=t.filter(s=>!s.term.equals(e.focusNode.term)),i=t.terms.length!==0&&n.terms.length===0;e.test(i,ne.EqualsConstraintComponent,{args:{equals:r},message:[e.factory.literal("Must have same values as {$equals}")],value:n.terms[0]&&e.focusNode.node([n.terms[0]])||e.focusNode})}}function wp(r){return e=>{const t=new Ze(e.focusNode.out([r]).terms),n=new Ze(e.values.terms),i=[...n].filter(o=>!t.has(o)),s=[...t].filter(o=>!n.has(o)),a=[...i,...s];for(const o of a)e.violation(ne.EqualsConstraintComponent,{args:{equals:r},message:[e.factory.literal("Must have same values as {$equals}")],value:e.focusNode.node([o])});a.length===0&&e.debug(ne.EqualsConstraintComponent,{args:{equals:r},message:[e.factory.literal("Must have same values as {$equals}")]})}}function vp(r){const e=r.ptr.out([ne.lessThan]).term;return{property:_p(e)}}function _p(r){return e=>{const t=e.focusNode.out([r]).terms;for(const n of e.values)for(const i of t){const s=dr(n.term,i);s===null||s>=0?e.violation(ne.LessThanConstraintComponent,{args:{lessThan:r},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:n}):e.debug(ne.LessThanConstraintComponent,{args:{lessThan:r},message:[e.factory.literal("Value is not less than value of {$lessThan}")],value:n})}}}function xp(r){const e=r.ptr.out([ne.lessThanOrEquals]).term;return{property:Sp(e)}}function Sp(r){return e=>{const t=e.focusNode.out([r]).terms;for(const n of e.values)for(const i of t){const s=dr(n.term,i);s===null||s>0?e.violation(ne.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:r},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n}):e.debug(ne.LessThanOrEqualsConstraintComponent,{args:{lessThanOrEquals:r},message:[e.factory.literal("Value is not less than or equal to value of {$lessThanOrEquals}")],value:n})}}}function Ep(r){const e=r.ptr.out([ne.maxExclusive]).term;return{generic:Ip(e)}}function Ip(r){return e=>{const t=dr(e.valueOrNode.term,r);e.test(t!==null&&t<0,ne.MaxExclusiveConstraintComponent,{args:{maxExclusive:r},message:[e.factory.literal("Value is not less than {$maxExclusive}")],value:e.valueOrNode})}}function Rp(r){const e=r.ptr.out([ne.maxInclusive]).term;return{generic:Np(e)}}function Np(r){return e=>{const t=dr(e.valueOrNode.term,r);e.test(t!==null&&t<=0,ne.MaxInclusiveConstraintComponent,{args:{maxInclusive:r},message:[e.factory.literal("Value is not less than or equal to {$maxInclusive}")],value:e.valueOrNode})}}function Tp(r){const e=r.ptr.out([ne.minExclusive]).term;return{generic:Ap(e)}}function Ap(r){return e=>{const t=dr(e.valueOrNode.term,r);e.test(t!==null&&t>0,ne.MinExclusiveConstraintComponent,{args:{minExclusive:r},message:[e.factory.literal("Value is not greater than {$minExclusive}")],value:e.valueOrNode})}}function Lp(r){const e=r.ptr.out([ne.minInclusive]).term;return{generic:jp(e)}}function jp(r){return e=>{const t=dr(e.valueOrNode.term,r);e.test(t!==null&&t>=0,ne.MinInclusiveConstraintComponent,{args:{minInclusive:r},message:[e.factory.literal("Value is not greater than or equal to {$minInclusive}")],value:e.valueOrNode})}}function Op(r){const e=[...r.ptr.out([ne.node])].map(t=>r.validator.shape(t));return{generic:$p(e)}}function $p(r){return async e=>{for(const t of r){const n=await t.validate(e.create({child:!0,focusNode:e.valueOrNode}));e.test(n.report.conforms,ne.NodeConstraintComponent,{args:{node:t.ptr.term},message:[e.factory.literal("Value does not have shape {$node}")],results:n.report.results,value:e.valueOrNode})}}}function kp(r){const e=[...r.ptr.out([ne.property])].map(t=>r.validator.shape(t));return{generic:Dp(e)}}function Dp(r){return async e=>{const t=e.create({focusNode:e.valueOrNode});for(const n of r)await n.validate(t)}}function Mp(r){const e=r.validator.shape(r.ptr.out([ne.qualifiedValueShape])),t=r.ptr.out([ne.qualifiedValueShapesDisjoint]).term,n=t?Kr.fromRdf(t):!1,i=r.ptr.out([ne.qualifiedMaxCount]).term,s=i?parseInt(i.value):null,a=r.ptr.out([ne.qualifiedMinCount]).term,o=a?parseInt(a.value):null;return{property:Pp(e,n,s,o)}}function Pp(r,e,t,n){return async i=>{const s=[];let a=[];e&&(a=new Set(i.shape.ptr.in([ne.property]).out([ne.property]).out([ne.qualifiedValueShape]).filter(l=>!l.term.equals(r.ptr.term)).map(l=>i.shape.validator.shape(l))));const o=(await Yh(i.values,async l=>{const u=(await r.validate(i.create({child:!0,focusNode:l}))).report;if(s.push(u.results),!u.conforms)return!1;if(a.length===0)return!0;if(i.options.debug||i.options.details){const h=await qn([...a],async y=>(await y.validate(i.create({child:!0,focusNode:l}))).report);return s.push(h.flatMap(y=>y.results)),!h.every(y=>y.conforms)}else return!await Kh([...a],async h=>(await h.validate(i.create({child:!0,focusNode:l}))).report.conforms)})).length;t!==null&&i.test(o<=t,ne.QualifiedMaxCountConstraintComponent,{args:{qualifiedMaxCount:t,qualifiedValueShape:r.ptr.term,qualifiedValueShapesDisjoint:e},message:[i.factory.literal("More than {$qualifiedMaxCount} values have shape {$qualifiedValueShape}")],results:s.flat()}),n!==null&&i.test(o>=n,ne.QualifiedMinCountConstraintComponent,{args:{qualifiedMinCount:n,qualifiedValueShape:r.ptr.term,qualifiedValueShapesDisjoint:e},message:[i.factory.literal("Less than {$qualifiedMinCount} values have shape {$qualifiedValueShape}")],results:s.flat()})}}function Cp(r,e){return e?e.slice(0,r.length)===r:!1}function qp(r){const e=[...new Set([...r.ptr.out([ne.languageIn]).list()].map(t=>t.value))];return{generic:Bp(e)}}function Bp(r){return e=>{const t=r.some(n=>Cp(n,e.valueOrNode.term.language));e.test(t,ne.LanguageInConstraintComponent,{args:{languageIn:r.join(", ")},message:[e.factory.literal("Language does not match any of {$languageIn}")],value:e.valueOrNode})}}function Fp(r){const e=parseInt(r.ptr.out([ne.maxLength]).value);return{generic:Up(e)}}function Up(r){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length<=r;e.test(t,ne.MaxLengthConstraintComponent,{args:{maxLength:r},message:[e.factory.literal("Value has more than {$maxLength} characters")],value:e.valueOrNode})}}function Hp(r){const e=parseInt(r.ptr.out([ne.minLength]).value);return{generic:Vp(e)}}function Vp(r){return e=>{const t=e.valueOrNode.term.termType!=="BlankNode"&&e.valueOrNode.value.length>=r;e.test(t,ne.MinLengthConstraintComponent,{args:{minLength:r},message:[e.factory.literal("Value has less than {$minLength} characters")],value:e.valueOrNode})}}function Gp(r){const e=r.ptr.out([ne.pattern]).value,t=r.ptr.out([ne.flags]).value,n=new RegExp(e,t);return{generic:Wp(e,t,n)}}function Wp(r,e,t){return n=>{n.test(t.test(n.valueOrNode.term.value),ne.PatternConstraintComponent,{args:{flags:e,pattern:r},message:[n.factory.literal('Value does not match pattern "{$pattern}"')],value:n.valueOrNode})}}function zp(r){const e=r.ptr.out([ne.uniqueLang]).term;return e.value==="true"&&ga.boolean.equals(e.datatype)?{property:Jp()}:null}function Jp(){return r=>{const t=Object.entries(r.values.terms.reduce((n,i)=>(i.language&&(n[i.language]=(n[i.language]||0)+1),n),{})).filter(([,n])=>n>1);for(const[n]of t)r.violation(ne.UniqueLangConstraintComponent,{args:{lang:n},message:[r.factory.literal('Language "{?lang}" used more than once')]});t.length===0&&r.debug(ne.UniqueLangConstraintComponent)}}const vn=tt("http://www.w3.org/ns/shacl#"),mc=tt("https://schemas.link/shacl-next#");class or{constructor({results:e=[]}={}){this.results=e}get conforms(){return!this.results.some(e=>e.severity.equals(vn.Info)||e.severity.equals(vn.Violation)||e.severity.equals(vn.Warning))}}function Qp(r,e){return Object.entries(e).reduce((t,[n,i])=>(i&&i.termType&&(i=Je(i)),t.replace(`{$${n}}`,i).replace(`{?${n}}`,i)),r)}class Tn{constructor({args:e={},factory:t,message:n=[],severity:i=vn.Violation}={}){this.severity=i,this.message=n.map(s=>t.literal(Qp(s.value,e),s.language||null))}}class ba{constructor({factory:e=pa}={}){this.factory=e}clone({factory:e}={}){return new ba({factory:e||this.factory})}validate(){return new or}validateSimple(){return!0}}class fr extends ba{constructor({datatypes:e,factory:t}={}){super({factory:t}),this.datatypes=[];for(const n of Array.isArray(e)?e:[e])n&&this.datatypes.push(this.factory.fromTerm(n))}clone({factory:e}={}){return new fr({datatypes:this.datatypes,factory:e||this.factory})}}class Xp{constructor({factory:e=pa,validations:t}={}){if(this.factory=e,this.validations=new cr,t)for(const n of Object.values(t)){const i=n.clone({factory:this.factory});for(const s of i.datatypes)this.validations.set(s,i)}}validate(e){const t=this.validations.get(e.datatype);return t?t.validate(e):new or}validateSimple(e){const t=this.validations.get(e.datatype);return t?t.validateSimple(e):!0}}class Ae extends fr{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.message=[this.factory.literal("term value {$this} matches pattern {$pattern}")],this.patterns=Array.isArray(e)?e:[e]}clone({factory:e}={}){return new Ae(this.patterns,this.datatypes,{factory:e||this.factory})}validate(e){const t=this.patterns.map(n=>{let i;n.test(e.value)&&(i=mc.Debug);const s={pattern:this.factory.literal(n.toString()),this:e};return new Tn({args:s,factory:this.factory,message:this.message,severity:i})});return new or({results:t})}validateSimple(e){return this.patterns.every(t=>t.test(e.value))}}const Kp=/^([-+]?[0-9]+)$/;class We extends Ae{constructor(e=null,t=null,n,{factory:i}={}){super(Kp,n,{factory:i}),this.maxInclusive=null,this.minInclusive=null,typeof t=="string"&&(this.maxInclusive=BigInt(t)),typeof e=="string"&&(this.minInclusive=BigInt(e))}clone({factory:e}={}){var t,n;return new We((t=this.minInclusive)==null?void 0:t.toString(),(n=this.maxInclusive)==null?void 0:n.toString(),this.datatypes,{factory:e||this.factory})}validate(e){const t=super.validate(e).results;if(!mc.Debug.equals(t[0].severity))return new or({results:t});const n=BigInt(e.value);if(this.minInclusive!==null&&n<this.minInclusive){const i=`term value "${e.value}" is less than "${this.minInclusive.toString()}"`,s=[this.factory.literal(i)];t.push(new Tn({factory:this.factory,message:s}))}if(this.maxInclusive!==null&&n>this.maxInclusive){const i=`term value "${e.value}" is greater than "${this.maxInclusive.toString()}"`,s=[this.factory.literal(i)];t.push(new Tn({factory:this.factory,message:s}))}return new or({results:t})}validateSimple(e){if(!super.validateSimple(e))return!1;const t=BigInt(e.value);return!(this.minInclusive!==null&&t<this.minInclusive||this.maxInclusive!==null&&t>this.maxInclusive)}}class wa extends fr{constructor(e,t,{factory:n}={}){super({datatypes:t,factory:n}),this.values=new Set(e)}clone({factory:e}={}){return new wa(this.values,this.datatypes,{factory:e||this.factory})}validate(e){const t=[];if(!this.values.has(e.value)){const n=`term value "${e.value}" is not included in the list: ${[...this.values].join(",")}`,i=[this.factory.literal(n)];t.push(new Tn({factory:this.factory,message:i}))}return new or({results:t})}validateSimple(e){return this.values.has(e.value)}}const xe={xsd:tt("http://www.w3.org/2001/XMLSchema#")},Yp=new fr({datatypes:xe.xsd.anySimpleType}),Zp=new fr({datatypes:xe.xsd.anyAtomicType}),Bn=/^([^\ud8ff-\udfff\ufffe-\uffff]*)$/,eg=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+))$/,bc=/^((\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+)([Ee](\+|-)?[0-9]+)?|(\+|-)?INF|NaN)$/,va=/^(-?P((([0-9]+Y([0-9]+M)?([0-9]+D)?|([0-9]+M)([0-9]+D)?|([0-9]+D))(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))?)|(T(([0-9]+H)([0-9]+M)?([0-9]+(\.[0-9]+)?S)?|([0-9]+M)([0-9]+(\.[0-9]+)?S)?|([0-9]+(\.[0-9]+)?S)))))$/,wc=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T(([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,tg=/^((([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?|(24:00:00(\.0+)?))(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,rg=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,ng=/^(-?([1-9][0-9]{3,}|0[0-9]{3})-(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,ig=/^(-?([1-9][0-9]{3,}|0[0-9]{3})(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,sg=/^(--(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,ag=/^(---(0[1-9]|[12][0-9]|3[01])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,og=/^(--(0[1-9]|1[0-2])(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00))?)$/,lg=/^(([0-9a-fA-F]{2})*)$/,ug=/^(((([A-Za-z0-9+/] ?){4})*(([A-Za-z0-9+/] ?){3}[A-Za-z0-9+/]|([A-Za-z0-9+/] ?){2}[AEIMQUYcgkosw048] ?=|[A-Za-z0-9+/] ?[AQgw] ?= ?=))?)$/,cg=new Ae(Bn,xe.xsd.string),dg=new wa(["1","true","0","false"],xe.xsd.boolean),fg=new Ae(eg,xe.xsd.decimal),hg=new Ae(bc,xe.xsd.float),pg=new Ae(bc,xe.xsd.double),gg=new Ae(va,xe.xsd.duration),yg=new Ae(wc,xe.xsd.dateTime),mg=new Ae(tg,xe.xsd.time),bg=new Ae(rg,xe.xsd.date),wg=new Ae(ng,xe.xsd.gYearMonth),vg=new Ae(ig,xe.xsd.gYear),_g=new Ae(sg,xe.xsd.gMonthDay),xg=new Ae(ag,xe.xsd.gDay),Sg=new Ae(og,xe.xsd.gMonth),Eg=new Ae(lg,xe.xsd.hexBinary),Ig=new Ae(ug,xe.xsd.base64Binary),Rg=new Ae(Bn,xe.xsd.anyURI),vc=/^([^\u000d\u000a\u0009]*)$/,Ng=/^([^ ]+( [^ ]+)*)*$/,Tg=/^([a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*)$/,Ag=/^([^DT]*)$/,Lg=/^([^YM]*[DT].*)$/,jg=/^(.*(Z|(\+|-)[0-9][0-9]:[0-9][0-9]))$/,Og=new Ae([Bn,vc],xe.xsd.normalizedString),$g=new Ae([Bn,vc,Ng],xe.xsd.token),kg=new Ae(Tg,xe.xsd.language),Dg=new We(null,null,xe.xsd.integer),Mg=new We(null,"0",xe.xsd.nonPositiveInteger),Pg=new We(null,"-1",xe.xsd.negativeInteger),Cg=new We("-9223372036854775808","9223372036854775807",xe.xsd.long),qg=new We("-2147483648","2147483647",xe.xsd.int),Bg=new We("-32768","32767",xe.xsd.short),Fg=new We("-128","127",xe.xsd.byte),Ug=new We("0",null,xe.xsd.nonNegativeInteger),Hg=new We("0","18446744073709551615",xe.xsd.unsignedLong),Vg=new We("0","4294967295",xe.xsd.unsignedInt),Gg=new We("0","65535",xe.xsd.unsignedShort),Wg=new We("0","255",xe.xsd.unsignedByte),zg=new We("1",null,xe.xsd.positiveInteger),Jg=new Ae([va,Ag],xe.xsd.yearMonthDuration),Qg=new Ae([va,Lg],xe.xsd.dayTimeDuration),Xg=new Ae([wc,jg],xe.xsd.dateTimeStamp),Kg=Object.freeze(Object.defineProperty({__proto__:null,anyAtomicType:Zp,anySimpleType:Yp,anyURI:Rg,base64Binary:Ig,boolean:dg,byte:Fg,date:bg,dateTime:yg,dateTimeStamp:Xg,dayTimeDuration:Qg,decimal:fg,double:pg,duration:gg,float:hg,gDay:xg,gMonth:Sg,gMonthDay:_g,gYear:vg,gYearMonth:wg,hexBinary:Eg,int:qg,integer:Dg,language:kg,long:Cg,negativeInteger:Pg,nonNegativeInteger:Ug,nonPositiveInteger:Mg,normalizedString:Og,positiveInteger:zg,short:Bg,string:cg,time:mg,token:$g,unsignedByte:Wg,unsignedInt:Vg,unsignedLong:Hg,unsignedShort:Gg,yearMonthDuration:Jg},Symbol.toStringTag,{value:"Module"}));class Yg extends Xp{constructor({factory:e}={}){super({factory:e,validations:{...Kg}})}}const Zg=new cr([[ne.BlankNode,new Set(["BlankNode"])],[ne.BlankNodeOrIRI,new Set(["BlankNode","NamedNode"])],[ne.BlankNodeOrLiteral,new Set(["BlankNode","Literal"])],[ne.IRI,new Set(["NamedNode"])],[ne.IRIOrLiteral,new Set(["NamedNode","Literal"])],[ne.Literal,new Set(["Literal"])]]);function ey(r){const e=r.ptr.out([ne.class]).map(t=>Vs(t));return{generic:ty(e)}}function ty(r){return e=>{const t=new Ze(e.valueOrNode.out([Ht.type]).terms);for(const n of r){const i=[...t].some(s=>n.has(s));e.test(i,ne.ClassConstraintComponent,{value:e.valueOrNode})}}}function ry(r){const e=r.ptr.out([ne.datatype]).term,t=new Yg;return{generic:ny(e,t)}}function ny(r,e){return t=>{const n=r.equals(t.valueOrNode.term.datatype)&&e.validateSimple(t.valueOrNode.term);t.test(n,ne.DatatypeConstraintComponent,{args:{datatype:r},message:[t.factory.literal("Value does not have datatype {$datatype}")],value:t.valueOrNode})}}function iy(r){const e=r.ptr.out([ne.nodeKind]).term,t=Zg.get(e);return{generic:sy(e,t)}}function sy(r,e){return t=>{t.test(e.has(t.valueOrNode.term.termType),ne.NodeKindConstraintComponent,{args:{nodeKind:r},message:[t.factory.literal("Value does not have node kind {$nodeKind}")],value:t.valueOrNode})}}const ay=new cr([[ne.maxCount,zh],[ne.minCount,Qh],[ne.and,ep],[ne.not,rp],[ne.or,ip],[ne.xone,ap],[ne.closed,lp],[ne.hasValue,cp],[ne.in,hp],[ne.disjoint,gp],[ne.equals,mp],[ne.lessThan,vp],[ne.lessThanOrEquals,xp],[ne.maxExclusive,Ep],[ne.maxInclusive,Rp],[ne.minExclusive,Tp],[ne.minInclusive,Lp],[ne.node,Op],[ne.property,kp],[ne.qualifiedValueShape,Mp],[ne.languageIn,qp],[ne.maxLength,Fp],[ne.minLength,Hp],[ne.pattern,Gp],[ne.uniqueLang,zp],[ne.class,ey],[ne.datatype,ry],[ne.nodeKind,iy]]);class oy{constructor(e,{factory:t,...n}){if(this.factory=t,this.options=n,this.registry=new $h(ay),this.shapesPtr=new Nn({dataset:e,factory:t}),this.shapes=new cr,this.options.coverage&&(this.options.debug=!0,this.options.details=!0,this.options.trace=!0),this.options.validations)for(const[s,a]of this.options.validations)this.registry.validations.set(s,a);const i=[...this.shapesPtr.hasOut([ne.targetClass]),...this.shapesPtr.hasOut([ne.targetNode]),...this.shapesPtr.hasOut([ne.targetObjectsOf]),...this.shapesPtr.hasOut([ne.targetSubjectsOf]),...this.shapesPtr.hasOut([Ht.type],[ne.NodeShape]),...this.shapesPtr.hasOut([Ht.type],[ne.PropertyShape])];for(const s of i)this.shape(s)}shape(e){if(!e.term)return null;let t=this.shapes.get(e.term);return t||(t=new Wh(e,{validator:this}),this.shapes.set(e.term,t)),t}async validate(e,t){const n=new Nn({...e,factory:this.factory}),i=new ya({factory:this.factory,focusNode:n,options:this.options,validator:this});t?t=t.map(s=>this.shape(this.shapesPtr.node(s.terms))):t=this.shapes.values();for(const s of t){const a=i.create({shape:s});let o;n.isAny()?o=s.resolveTargets(a):o=n;for(const l of o)await s.validate(a.create({focusNode:l}))}return i.report}}let ly=class extends HTMLElement{constructor(e){super(),this.shape=null,this.attachShadow({mode:"open"}),this.form=document.createElement("form"),this.config=new _l(e,this.form),this.form.addEventListener("change",t=>{t.stopPropagation(),this.config.editMode&&this.validate(!0).then(n=>{this.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1,composed:!0,detail:{valid:n.conforms,report:n}}))}).catch(n=>{console.warn(n)})})}static get observedAttributes(){return _l.dataAttributes()}connectedCallback(){this.shadowRoot.prepend(this.form)}attributeChangedCallback(){this.config.updateAttributes(this),this.initialize()}initialize(){clearTimeout(this.initDebounceTimeout),this.initDebounceTimeout=setTimeout(async()=>{this.form.replaceChildren(document.createTextNode(this.config.attributes.loading));try{await this.config.loader.loadGraphs(),this.form.replaceChildren(),this.config.renderedNodes.clear();const e=this.findRootShaclShapeSubject();if(e){this.form.classList.forEach(n=>{this.form.classList.remove(n)}),this.form.classList.toggle("mode-edit",this.config.editMode),this.form.classList.toggle("mode-view",!this.config.editMode),this.config.theme.apply(this.form);const t=[this.config.theme.stylesheet];for(const n of vd())n.stylesheet&&t.push(n.stylesheet);if(this.shadowRoot.adoptedStyleSheets=t,this.shape=new Nt(e,this.config,this.config.attributes.valuesSubject?Se.namedNode(this.config.attributes.valuesSubject):void 0),this.form.appendChild(this.shape),this.config.editMode){if(this.config.attributes.submitButton!==null){const n=this.config.theme.createButton(this.config.attributes.submitButton||"Submit",!0);n.addEventListener("click",i=>{i.preventDefault(),this.form.reportValidity()&&this.validate().then(s=>{var a;s!=null&&s.conforms?this.dispatchEvent(new Event("submit",{bubbles:!0,cancelable:!0})):(a=this.form.querySelector(":scope .invalid > .editor"))==null||a.focus()})}),this.form.appendChild(n)}this.config.attributes.valuesSubject&&this.removeFromDataGraph(Se.namedNode(this.config.attributes.valuesSubject)),await this.validate(!0)}}else if(this.config.store.countQuads(null,null,null,_n)>0)throw new Error("shacl root node shape not found")}catch(e){console.error(e);const t=document.createElement("div");t.innerText=String(e),this.form.replaceChildren(t)}},200)}serialize(e="text/turtle",t=this.toRDF()){const n=t.getQuads(null,null,null,null);return yd(n,e,this.config.prefixes)}toRDF(e=new Ue){var t;return(t=this.shape)==null||t.toRDF(e),e}registerPlugin(e){wd(e),this.initialize()}setTheme(e){this.config.theme=e,this.initialize()}setSharedShapesGraph(e){Jf(e),this.initialize()}setClassInstanceProvider(e){this.config.classInstanceProvider=e,this.initialize()}async validate(e=!1){var t,n,i,s,a,o;for(const l of this.form.querySelectorAll(":scope .validation-error"))l.remove();for(const l of this.form.querySelectorAll(":scope .property-instance"))l.classList.remove("invalid"),(t=l.querySelector(":scope > .editor"))!=null&&t.value?l.classList.add("valid"):l.classList.remove("valid");this.config.store.deleteGraph(this.config.valuesGraphId||""),(n=this.shape)==null||n.toRDF(this.config.store),this.shape&&this.config.store.add(new An(this.shape.shaclSubject,Se.namedNode(be+"targetNode"),this.shape.nodeId,this.config.valuesGraphId));try{const l=this.config.store,u=await new oy(l,{details:!0,factory:Se}).validate({dataset:l});for(const h of u.results)if((s=(i=h.focusNode)==null?void 0:i.ptrs)!=null&&s.length)for(const y of h.focusNode.ptrs){const b=y._term;if((a=h.path)!=null&&a.length){const g=h.path[0].predicates[0];let m=this.form.querySelectorAll(`:scope shacl-node[data-node-id='${b.id}'] > shacl-property > .property-instance[data-path='${g.id}'] > .editor, :scope shacl-node[data-node-id='${b.id}'] > .shacl-group > shacl-property > .property-instance[data-path='${g.id}'] > .editor`);m.length===0&&(m=this.form.querySelectorAll(`:scope [data-node-id='${b.id}'] > * > [data-path='${g.id}']`));for(const _ of m)if(_.classList.contains("editor")){if(!e||_.value){let x=_.parentElement;x.classList.add("invalid"),x.classList.remove("valid"),x.appendChild(this.createValidationErrorDisplay(h));do x.classList.contains("collapsible")&&x.classList.add("open"),x=x.parentElement;while(x)}}else e||(_.classList.add("invalid"),_.classList.remove("valid"),_.appendChild(this.createValidationErrorDisplay(h,"node")))}else e||(o=this.form.querySelector(`:scope [data-node-id='${b.id}']`))==null||o.prepend(this.createValidationErrorDisplay(h,"node"))}return u}catch(l){return console.error(l),!1}}createValidationErrorDisplay(e,t){var i,s;const n=document.createElement("span");if(n.classList.add("validation-error"),t&&n.classList.add(t),e)if(((i=e.message)==null?void 0:i.length)>0)for(const a of e.message)n.title+=a.value+`
|
|
346
|
+
`;else n.title=(s=e.sourceConstraintComponent)==null?void 0:s.value;return n}findRootShaclShapeSubject(){let e=null;if(this.config.attributes.shapeSubject){if(e=Se.namedNode(this.config.attributes.shapeSubject),this.config.store.getQuads(e,qe,cn,null).length===0){console.warn(`shapes graph does not contain requested root shape ${this.config.attributes.shapeSubject}`);return}}else if(this.config.attributes.valuesSubject&&this.config.store.countQuads(null,null,null,ot)>0){const t=Se.namedNode(this.config.attributes.valuesSubject),n=[...this.config.store.getQuads(t,qe,null,ot),...this.config.store.getQuads(t,$s,null,ot)];if(n.length===0){console.warn(`value subject '${this.config.attributes.valuesSubject}' has neither ${qe.id} nor ${$s.id} statement`);return}for(const i of n)if(this.config.store.getQuads(i.object,qe,cn,null).length>0){e=i.object;break}if(!e){const i=this.config.store.getQuads(null,zr,n[0].object,null);if(i.length===0){console.error(`value subject '${this.config.attributes.valuesSubject}' has no shacl shape definition in the shapes graph`);return}if(i.length>1&&console.warn(`value subject '${this.config.attributes.valuesSubject}' has multiple shacl shape definitions in the shapes graph, choosing the first found (${i[0].subject})`),this.config.store.getQuads(i[0].subject,qe,cn,null).length===0){console.error(`value subject '${this.config.attributes.valuesSubject}' references a shape which is not a NodeShape (${i[0].subject})`);return}e=i[0].subject}}else{const t=this.config.store.getQuads(null,qe,cn,null);if(t.length==0){console.warn("shapes graph does not contain any root shapes");return}t.length>1&&(console.warn("shapes graph contains",t.length,"root shapes. choosing first found which is",t[0].subject.value),console.info('hint: set the shape to use with attribute "data-shape-subject"')),e=t[0].subject}return e}removeFromDataGraph(e){this.config.attributes.valuesSubject;for(const t of this.config.store.getQuads(e,null,null,ot))this.config.store.delete(t),(t.object.termType==="NamedNode"||t.object.termType==="BlankNode")&&this.removeFromDataGraph(t.object)}};const uy=`.editor:not([type='checkbox']) { border: 1px solid #DDD; padding: 2px 4px; }
|
|
347
|
+
.property-instance label { display: inline-flex; word-break: break-word; line-height: 1em; padding-top: 0.15em; padding-right: 1em; flex-shrink: 0; position: relative; }
|
|
348
|
+
.property-instance:not(:first-child) > label:not(.persistent) { visibility: hidden; max-height: 0; }
|
|
349
|
+
.mode-edit .property-instance label { width: var(--label-width); }
|
|
350
|
+
`;class cy extends pd{constructor(e){super(e||uy),this.idCtr=0}createDefaultTemplate(e,t,n,i,s){var u;i.id=`e${this.idCtr++}`,i.classList.add("editor"),s!=null&&s.datatype?i.shaclDatatype=s.datatype:t instanceof lt&&(i.shaclDatatype=t.datatype),(s==null?void 0:s.minCount)!==void 0&&(i.dataset.minCount=String(s.minCount)),s!=null&&s.class&&(i.dataset.class=s.class.value),s!=null&&s.nodeKind&&(i.dataset.nodeKind=s.nodeKind.value),(s!=null&&s.hasValue||s!=null&&s.readonly)&&(i.disabled=!0),i.value=(t==null?void 0:t.value)||((u=s==null?void 0:s.defaultValue)==null?void 0:u.value)||"";const a=document.createElement("label");a.htmlFor=i.id,a.innerText=e,s!=null&&s.description&&a.setAttribute("title",s.description.value);const o=s!=null&&s.description?s.description.value:s!=null&&s.pattern?s.pattern:null;o&&i.setAttribute("placeholder",o),n&&(i.setAttribute("required","true"),a.classList.add("required"));const l=document.createElement("div");return l.appendChild(a),l.appendChild(i),l}createDateEditor(e,t,n,i){var o,l;const s=document.createElement("input");((o=i.datatype)==null?void 0:o.value)===Ct+"dateTime"?(s.type="datetime-local",s.setAttribute("step","1")):s.type="date",s.classList.add("pr-0");const a=this.createDefaultTemplate(e,null,n,s,i);if(t)try{let u=new Date(t.value).toISOString();((l=i.datatype)==null?void 0:l.value)===Ct+"dateTime"?u=u.slice(0,19):u=u.slice(0,10),s.value=u}catch(u){console.error(u,t)}return a}createTextEditor(e,t,n,i){let s;return i.singleLine===!1?(s=document.createElement("textarea"),s.rows=5):(s=document.createElement("input"),s.type="text",i.pattern&&(s.pattern=i.pattern)),i.minLength&&(s.minLength=i.minLength),i.maxLength&&(s.maxLength=i.maxLength),this.createDefaultTemplate(e,t,n,s,i)}createLangStringEditor(e,t,n,i){var l;const s=this.createTextEditor(e,t,n,i),a=s.querySelector(":scope .editor");let o;if((l=i.languageIn)!=null&&l.length){o=document.createElement("select");for(const u of i.languageIn){const h=document.createElement("option");h.innerText=u.value,o.appendChild(h)}}else o=document.createElement("input"),o.maxLength=5,o.placeholder="lang?";return o.title="Language of the text",o.classList.add("lang-chooser"),o.addEventListener("change",u=>{u.stopPropagation(),a&&(a.dataset.lang=o.value,a.dispatchEvent(new Event("change",{bubbles:!0})))}),t instanceof lt&&(o.value=t.language),a.dataset.lang=o.value,a.after(o),s}createBooleanEditor(e,t,n,i){var o;const s=document.createElement("input");s.type="checkbox",s.classList.add("ml-0");const a=this.createDefaultTemplate(e,null,n,s,i);return s.removeAttribute("required"),(o=a.querySelector(":scope label"))==null||o.classList.remove("required"),t instanceof lt&&(s.checked=t.value==="true"),a}createFileEditor(e,t,n,i){const s=document.createElement("input");return s.type="file",s.addEventListener("change",a=>{var o;if((o=s.files)!=null&&o.length){a.stopPropagation();const l=new FileReader;l.readAsDataURL(s.files[0]),l.onload=()=>{var u;s.binaryData=btoa(l.result),(u=s.parentElement)==null||u.dispatchEvent(new Event("change",{bubbles:!0}))}}else s.binaryData=void 0}),this.createDefaultTemplate(e,t,n,s,i)}createNumberEditor(e,t,n,i){var l;const s=document.createElement("input");s.type="number",s.classList.add("pr-0");const a=i.minInclusive!==void 0?i.minInclusive:i.minExclusive!==void 0?i.minExclusive+1:void 0,o=i.maxInclusive!==void 0?i.maxInclusive:i.maxExclusive!==void 0?i.maxExclusive-1:void 0;return a!==void 0&&(s.min=String(a)),o!==void 0&&(s.max=String(o)),((l=i.datatype)==null?void 0:l.value)!==Ct+"integer"&&(s.step="0.1"),this.createDefaultTemplate(e,t,n,s,i)}createListEditor(e,t,n,i,s){const a=document.createElement("select"),o=this.createDefaultTemplate(e,null,n,a,s);let l=!0;for(const u of i){const h=document.createElement("option");let y="";if(typeof u.value=="string"?y=u.value:y=u.value.id,h.innerHTML=u.label?u.label:y,h.value=y,u.indent)for(let b=0;b<u.indent;b++)h.innerHTML="  "+h.innerHTML;t&&t.value===y&&(h.selected=!0),y===""&&(l=!1),a.appendChild(h)}if(l){const u=document.createElement("option");u.value="",t||(u.selected=!0),a.prepend(u)}return t&&(a.value=t.value),o}createButton(e,t){const n=document.createElement("button");return n.type="button",n.innerHTML=e,n}}class dy extends ly{constructor(){super(new cy)}}window.customElements.define("shacl-form",dy);export{_l as Config,zf as Loader,wy as Plugin,dy as ShaclForm,fd as ShaclPropertyTemplate,pd as Theme,kn as findLabel,wd as registerPlugin,Jf as setSharedShapesGraph};
|